[OpenBIOS] [PATCH] macio ide: Fix dev tree entries for macio ide ports

BALATON Zoltan balaton at eik.bme.hu
Wed Jun 4 20:22:12 CEST 2014


On Wed, 4 Jun 2014, BALATON Zoltan wrote:
> I'd say the names are rather obvious, but a comment won't hurt.

OK. I'd like to hear others too if anything else needs to be changed 
before I send another version with just this comment enhanced.

>> OpenBIOS does number ide devices though so to satisfy both we either need
>> to change the whole naming of ide interfaces in OpenBIOS or just number
>> them from 3 and this works for the currently emulated two ports.
>
> You can have multiple devices per controller.
>
> The device tree is a tree, not a linearly numbered array; the usual way
> to make e.g disk0 and disk1 is via aliases.  Maybe you want that?

OpenBIOS adds devices like this:

#ifndef CONFIG_IDE_FIRST_UNIT
#define FIRST_UNIT 0
#else
#define FIRST_UNIT CONFIG_IDE_FIRST_UNIT
#endif

#ifndef CONFIG_IDE_DEV_TYPE
#define DEV_TYPE "ide"
#else
#define DEV_TYPE CONFIG_IDE_DEV_TYPE
#endif

#ifndef CONFIG_IDE_DEV_NAME
#define DEV_NAME "ide%d"
#else
#define DEV_NAME CONFIG_IDE_DEV_NAME
#endif

static int current_channel = FIRST_UNIT;
[...]
for (i = 0; i < nb_channels; i++, current_channel++) {
[...]
         snprintf(nodebuff, sizeof(nodebuff), "%s/" DEV_NAME, path,
                  current_channel);
         REGISTER_NAMED_NODE(ob_ide_ctrl, nodebuff);

and all through drivers/ide.c they are handled similarly in a loop. So 
adding them with names like ata-3 ata-3 is not really possible without 
more throughly rewriting this code. It's not a limitation of the device 
tree but how OpenBIOS is written now. So the easiest was to use ata-3 and 
ata-4 which matches the names on real hardware and makes client happy. 
Actually this has less chance to break things than trying to match names 
more exactly.

Regards,
BALATON Zoltan



More information about the OpenBIOS mailing list