On 7 December 2011 09:47, Evgeny Voevodin <e.voevo...@samsung.com> wrote: > We included this chip into s5pc210 platform because SMDK board holds > lan9215 chip. Difference is that 9215 access is 16-bit wide and some > registers differ. By addition basic 16-bit access to 9118 emulation we > achieved ethernet controller support by Linux lernel on SMDK boards.
If it differs then shouldn't we add a new qdev device for 9215 ? (sharing most of the implementation code, obviously) > static const MemoryRegionOps lan9118_mem_ops = { > - .read = lan9118_readl, > - .write = lan9118_writel, > + .old_mmio = { > + .read = { lan9118_readb, lan9118_readw, lan9118_readl, }, > + .write = { lan9118_writeb, lan9118_writew, lan9118_writel, }, > + }, > .endianness = DEVICE_NATIVE_ENDIAN, > }; This is going backwards -- the .old_mmio hooks are for backwards compatibility when converting old devices to MemoryRegions -- they shouldn't be added in new code. You need to make the lan9118_read/write functions look at their 'size' argument instead. -- PMM