qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 09/14] hw/lan9118.c: Basic byte/word/long access


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 09/14] hw/lan9118.c: Basic byte/word/long access support.
Date: Wed, 7 Dec 2011 10:09:32 +0000

On 7 December 2011 09:47, Evgeny Voevodin <address@hidden> 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



reply via email to

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