[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 11/17] lm32: system control model
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 11/17] lm32: system control model |
Date: |
Sat, 12 Feb 2011 09:54:38 +0200 |
On Sat, Feb 12, 2011 at 12:35 AM, Michael Walle <address@hidden> wrote:
> Am Freitag 11 Februar 2011, 22:03:40 schrieb Blue Swirl:
>> > +static int lm32_sys_init(SysBusDevice *dev)
>> > +{
>> > + LM32SysState *s = FROM_SYSBUS(typeof(*s), dev);
>> > + int sys_regs;
>> > +
>> > + sys_regs = cpu_register_io_memory(sys_read_fn, sys_write_fn, s,
>> > + DEVICE_NATIVE_ENDIAN);
>> > + sysbus_init_mmio(dev, R_MAX * 4, sys_regs);
>> > + sysbus_mmio_map(dev, 0, s->base);
>>
>> Devices should not map themselves or care what is their address.
>> Please remove base field and qdev property and move the mapping to
>> board level.
>
> I added this because the device isn't created in the board initialization.
> Instead it can be added with -device, if needed. Who does the mapping in this
> case?
Since SysBus does not map the devices like PCI, there would be nothing
to map the device. Maybe self-mapping isn't so incorrect in this case.
- [Qemu-devel] [PATCH 00/17 v2] LatticeMico32 target, Michael Walle, 2011/02/10
- [Qemu-devel] [PATCH 05/17] lm32: gdbstub support, Michael Walle, 2011/02/10
- [Qemu-devel] [PATCH 04/17] lm32: machine state loading/saving, Michael Walle, 2011/02/10
- [Qemu-devel] [PATCH 01/17] LatticeMico32 target support, Michael Walle, 2011/02/10
- [Qemu-devel] [PATCH 08/17] lm32: pic and juart helper functions, Michael Walle, 2011/02/10
- [Qemu-devel] [PATCH 11/17] lm32: system control model, Michael Walle, 2011/02/10
- [Qemu-devel] [PATCH 16/17] Add lm32 target to configure, Michael Walle, 2011/02/10
- [Qemu-devel] [PATCH 10/17] lm32: uart model, Michael Walle, 2011/02/10
- [Qemu-devel] [PATCH 07/17] lm32: juart model, Michael Walle, 2011/02/10
- [Qemu-devel] [PATCH 03/17] lm32: translation code helper, Michael Walle, 2011/02/10
- [Qemu-devel] [PATCH 02/17] lm32: translation routines, Michael Walle, 2011/02/10