I tried to run an RTEMS application (real-time application) on a sparc virtual machine using QEMU. I am almost there, and I saw this working time ago. But after deleting some fingerprints, it does not work, and later I did not find it because of deleted fingerprints. Data is not transferred correctly between the RTEMS image and the QEMU emulation model (I work with the QEMU model 1.5.50 and lan9118.c, borrowed from QEMU version 2.0.0. I modified lan9118 a bit.)
In the QEMU model, memory region operators are defined as
struct MemoryRegionOps { uint64_t (*read)(void *opaque, hwaddr addr, unsigned size); void (*write)(void *opaque, hwaddr addr, uint64_t data, unsigned size); ... }
and in the RTEMS application I write to the device, for example
*TX_FIFO_PORT = cmdA; *TX_FIFO_PORT = cmdB;
where TX_FIFO_PORT is defined below.
#define TX_FIFO_PORT (volatile ulong *)(SMSC9118_BASE + 0x20)
But when I write, for example,
cmdA : 0x2a300200 and cmdB : 0x2a002a00,
Expected Values
cmdA : 0x0002302a and cmdB : 0x002a002a. (Just endian converted values)
But the values ββthat I see when writing a function (input to QEMU) are
cmdA : 0x02000200 and cmdB : 0x2a002a00 respectively.
The observed values ββwere not converted to the end, and even the first value is different (the lower 16 bit is repeated). What could be the problem?
Any hint would be greatly appreciated.