qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/3] sh4: mmio based CF support on r2d board.


From: andrzej zaborowski
Subject: Re: [Qemu-devel] [PATCH 1/3] sh4: mmio based CF support on r2d board.
Date: Mon, 27 Oct 2008 03:29:26 +0200

2008/10/26 Blue Swirl <address@hidden>:
> On 10/26/08, address@hidden <address@hidden> wrote:
>> This patch adds emulation for a CompactFlash on sh4/r2d board.
>>  The device is CF, but wired to be worked as True-IDE mode, and connected
>>   directly to SH bus.

The CF-ATA code (IBM microdrive) in ide.c should expose a qemu_irq
that toggles between CF and True-IDE mode so that it can be used as
both... but it can be done another time.  I hadn't done it originally
because the pin is wired to CF mode in zaurus.

>
> +    if(addr & 7)
>
> I'd add a space between if and (.
>
> +static uint32_t mmio_ide_status_read (void *opaque,target_phys_addr_t addr)
>
> Please add a space between the comma after opaque and target_phys_addr_t.
>
>>  +void mmio_ide_init (int *mmio, BlockDriverState *hd0, BlockDriverState 
>> *hd1,
>>  +       qemu_irq irq, int shift)
>>  +{
>>  +    MMIOState *s = qemu_mallocz(sizeof(MMIOState));
>>  +    IDEState *ide = qemu_mallocz(sizeof(IDEState) * 2);
>>  +    int *io;
>>  +
>>  +    ide_init2(ide, hd0, hd1, irq);
>>  +
>>  +    s->dev = ide;
>>  +    s->shift = shift;
>>  +
>>  +    mmio[0] = cpu_register_io_memory(0, mmio_ide_reads, mmio_ide_writes, 
>> s);
>>  +    mmio[1] = cpu_register_io_memory(0, mmio_ide_status, mmio_ide_cmd, s);
>>  +}
>
> It would be better to make the init function take instead of mmio
> pointer, two target_phys_addr_t parameters and do the physical memory
> registration there.

Why would it be better?  This implementation seems more flexible.

Cheers




reply via email to

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