qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [SPARC] Accessing devices through MMU mapped memory region


From: Jean-Christophe DUBOIS
Subject: [Qemu-devel] [SPARC] Accessing devices through MMU mapped memory region
Date: Mon, 27 Nov 2017 21:16:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Hi,

I am using Qemu to emulate a Leon3 based board.

In the software I am running on top of Qemu, I am mapping devices to a virtual address using MMU table.

Now I am experimenting some issues when I am trying to access some device (here the UART port at 0x80000100) through the MMU mapping (with NOCACHE attribute for this page).

in my (user space) software I am doing something like:

   #define MY_VIRTUAL_ADDRESS 0x40808100 /* mapped to 0x80000100
   physical address through MMU */

   #define UART_CTRL_REG_OFFSET 0x8

   #define UART_CTRL_TE 0x00000002

   *(volatile uint32_t *)(MY_VIRTUAL_ADDRESS + UART_CTRL_REG_OFFSET) =
   UART_CTRL_TE;

But when the write is propagated by Qemu to the serial device, I am getting 4 x 8bits (1 byte) write access (0x8, 0x9, 0xa, 0xb) instead of a single 32 bits (4 bytes) access.

The Qemu driver emulator for the serial device is unhappy about this as it would not handle byte access for addresses 0x9, 0xa, 0xb which are then tagged as unsupported access.

I am wondering if I am missing something and if there is a reason for my single 32 bits access to be transformed by Qemu in 4 single byte access.

I believe it is expected to be able to get single atomic 32 bits read/write to the device.

Would you have any hint/advice for me?

JC




reply via email to

[Prev in Thread] Current Thread [Next in Thread]