diff options
author | Li-Ta Lo <ollie@lanl.gov> | 2004-04-21 16:57:05 +0000 |
---|---|---|
committer | Li-Ta Lo <ollie@lanl.gov> | 2004-04-21 16:57:05 +0000 |
commit | c6bcedb2c45a0f759d152cd263751184022ab67a (patch) | |
tree | 9f1d961a98beb486eccdfbb148f9324fa47749ee /src/devices | |
parent | 771b1aefa3415eb644bfa030772f00b2178b368a (diff) |
yhlu's pnp patch
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1518 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/pnp_device.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/devices/pnp_device.c b/src/devices/pnp_device.c index 0bccd7d151..5a2e85795d 100644 --- a/src/devices/pnp_device.c +++ b/src/devices/pnp_device.c @@ -118,6 +118,7 @@ void pnp_set_resources(device_t dev) for(i = 0; i < dev->resources; i++) { pnp_set_resource(dev, &dev->resource[i]); } + } void pnp_enable_resources(device_t dev) @@ -129,8 +130,9 @@ void pnp_enable_resources(device_t dev) void pnp_enable(device_t dev) { - pnp_set_logical_device(dev); - if (!dev->enable) { + + if (!dev->enable) { + pnp_set_logical_device(dev); pnp_set_enable(dev, 0); } } @@ -165,7 +167,7 @@ static void get_resources(device_t dev, struct pnp_info *info) { struct resource *resource; - pnp_set_logical_device(dev); +// pnp_set_logical_device(dev); // coment out by LYH if (info->flags & PNP_IO0) { pnp_get_ioresource(dev, PNP_IDX_IO0, &info->io0); @@ -206,12 +208,21 @@ void pnp_enumerate(struct chip *chip, unsigned functions, chip_enumerate(chip); path.type = DEVICE_PATH_PNP; path.u.pnp.port = chip->dev->path.u.pnp.port; + /* Setup the ops and resources on the newly allocated devices */ for(i = 0; i < functions; i++) { path.u.pnp.device = info[i].function; + dev = alloc_find_dev(chip->bus, &path); - dev->ops = ops; + + if(info[i].ops == 0) { // BY LYH + dev->ops = ops; + } + else { + dev->ops = info[i].ops; // BY LYH + } get_resources(dev, &info[i]); + } } |