[coreboot] Resource allocation

Marc Jones marcj303 at yahoo.com
Tue Nov 11 23:58:19 CET 2008


>> > > resources.
>> > > For example:
> > > >     PNP 2e.0: size 8 align 3 gran 3 limit 7ff flags 100 index 60
>> > > which is the floppy device has this resource definition
>> > >     { &w83627hf_ops, W83627HF_FDC,  PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {
>> > > 0x07f8, 0}, },
>> > > and this dts entry
>> > >     /* Floppy */
>> > >     floppydev = "0x0";
>> > >     floppyenable = "0";
>> > >     floppyio = "0x3f0";
>> > >     floppyirq = "0x60";
>> > >     floppydrq = "0x02";
>> >
>> > So you're saying it should be a fixed resource size 8 base 0x3f0?
>>
>> Yes, if it were enabled. I don't know what the device code does if it is
>> disabled.
>
>Good point.  I looked, and this doesn't ever get checked.  All these devices
>show up as dynamic devices and lose this information.  I guess some phase3
>scan function needs to be implemented that takes this into account.
>
>  static void phase3_chip_setup_dev(struct device *dev)
>{
>-       pnp_enable_devices(dev, &w83627hf_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
>+       struct superio_winbond_w83627hf_dts_config *conf;
>+       conf = dev->device_configuration;
>+
>+       if (conf->com1enable)
>+               pnp_enable_devices(dev, &w83627hf_ops, 1, &pnp_dev_info[2]);
>+       if (conf->com2enable)
>+               pnp_enable_devices(dev, &w83627hf_ops, 1, &pnp_dev_info[3]);
>+       if (conf->kbenable)
>+               pnp_enable_devices(dev, &w83627hf_ops, 1, &pnp_dev_info[4]);
>+       if (conf->hwmenable)
>+               pnp_enable_devices(dev, &w83627hf_ops, 1, &pnp_dev_info[9]);
>}
>
>
>Are we thinking something like this?  Something different?  I don't understand how we were hoping those dts values would make it into devices.

This would be a good reason to have a generic enable for each device like in v2. Then the enable function can handle anything. I am not sure how or why this changed in v3. 

Marc





More information about the coreboot mailing list