On 13/11/24 18:21, Paolo Bonzini wrote:
On 11/12/24 19:10, Philippe Mathieu-Daudé wrote:
Rather than using I/O registers for RAM buffer, having to
swap endianness back and forth (because the core memory layer
automatically swaps endiannes for us), declare the buffers
as RAM regions. Remove the now unused s->regs[] array.

The memory flat view becomes:

   FlatView #0
    Root memory region: system
     0000000081000000-00000000810007f3 (prio 0, ram): ethlite.tx[0]buf
     00000000810007f4-00000000810007ff (prio 0, i/o): ethlite.tx[0]io
     0000000081000800-0000000081000ff3 (prio 0, ram): ethlite.tx[1]buf
     0000000081000ff4-0000000081000fff (prio 0, i/o): ethlite.tx[1]io
     0000000081001000-00000000810017f3 (prio 0, ram): ethlite.rx[0]buf
     00000000810017fc-00000000810017ff (prio 0, i/o): ethlite.rx[0]io
     0000000081001800-0000000081001ff3 (prio 0, ram): ethlite.rx[1]buf
     0000000081001ffc-0000000081001fff (prio 0, i/o): ethlite.rx[1]io

The receive buffers should end at 7fb and ffb; no need to repost of course.

Nice catch. Actually, looking at the datasheet p. 20, Table 11 "XPS
Ethernet Lite MAC Memory Map" we have

0x0000 - 0x07E0  TxPingBuf
0x07E4 - 0x07F0  MDIO if C_INCLUDE_MDIO else Reserved
0x07F4 - 0x07FC  TxPingIO
0x0800 - 0x0FE0  TxPongBuf
0x0FE4 - 0x0FF0  Reserved
0x0FF4 - 0x0FFC  TxPongIO
0x1000 - 0x17E0  RxPingBuf
0x17E4 - 0x17F8  Reserved
0x17FC - 0x17FC  RxPingIO
0x1800 - 0x1FE0  RxPongBuf
0x1FE4 - 0x1FF8  Reserved
0x1FFC - 0x1FFC  RxPongIO

I'll update appropriately.

Thanks,

Phil.


Reply via email to