[U-Boot] [PATCH] IDE: Don't assume there are always two devices per bus

Albert ARIBAUD albert.aribaud at free.fr
Mon Sep 6 19:15:20 CEST 2010


Le 06/09/2010 14:50, Wolfgang Denk a écrit :

>> 2) as for ide_bus_offset[] and ide_dev_desc[], and any other existing
>> array based on CONFIG_SYS_IDE_MAXBUS or CONFIG_SYS_IDE_MAXDEVICE, they
>> are not going to grow any bigger with my proposal since neither config
>> option will increase.
>
> We might chnage this to dynamically allocated structures. maybe that
> would make more sense then?

I don't see much benefit in allocating dynamically rather than 
statically unless you are really tight on RAM, which seems to not fit 
with a board which has many busses and disks.

Plus, IDE may not know about hotplugging, but SATA does, which means I 
can do an ide_init(), plug or unplug disks, and do an ide_init() again 
with a different number of devices. Dynamic allocation requires resizing 
the allocated arrays; static is just less trouble.

Anyway, static vs dynamic can be done in a second step after adding N 
busses (and thereby fixing the issue of ghost devices that prompted 
Rogan's patch proposal).

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list