-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
Some SIO/PNP devices are abusing register 0x30 for multiple LDN enables, like
mine W83627EHF.
This patch introduces a concept of virtual LDN. Each virtual LDN is unique, but
maps to original LDN and bit position in register 0x30.
VirtualLDN = origLDN[7:0] | bitpos[10:8]
For example mine GPIO5 device is on LDN 0x9 and bit position 3 -> virtualLDN is
0x309.
As the nice effect one can have now in Config.lb right enable:
device pnp 2e.309 on #GPIO5 on
end
Plus normal resources if it is a GAME port for example:
device pnp 2e.107 on #GAME on
io 0x60 = 0x201
end
This patch just modifies the core PNP subsystem, other patches will follow.
Signed-off-by: Rudolf Marek <[EMAIL PROTECTED]>
Thanks,
Rudolf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHt36p3J9wPJqZRNURAiWpAJ937dnfnFp5qhdwM33Y1sm/4p16BwCg4k1g
rdTZt5zuSFFEr1Qan1sO48M=
=e2Ax
-----END PGP SIGNATURE-----
Index: src/devices/pnp_device.c
===================================================================
--- src/devices/pnp_device.c (revision 3100)
+++ src/devices/pnp_device.c (working copy)
@@ -46,17 +46,32 @@
void pnp_set_logical_device(device_t dev)
{
- pnp_write_config(dev, 0x07, dev->path.u.pnp.device);
+ pnp_write_config(dev, 0x07, dev->path.u.pnp.device & 0xff);
}
void pnp_set_enable(device_t dev, int enable)
{
- pnp_write_config(dev, 0x30, enable?0x1:0x0);
+ u8 tmp, bitpos;
+
+ tmp = pnp_read_config(dev, 0x30);
+ /* handle the virtual devices, which share same LDN register */
+ bitpos = (dev->path.u.pnp.device >> 8) & 0x7;
+
+ if (enable) {
+ tmp |= (1 << bitpos);
+ } else {
+ tmp &= ~(1 << bitpos);
+ }
+ pnp_write_config(dev, 0x30, tmp);
}
int pnp_read_enable(device_t dev)
{
- return !!pnp_read_config(dev, 0x30);
+ u8 tmp, bitpos;
+ tmp = pnp_read_config(dev, 0x30);
+ /* handle the virtual devices, which share same LDN register */
+ bitpos = (dev->path.u.pnp.device >> 8) & 0x7;
+ return !!(tmp & bitpos);
}
void pnp_set_iobase(device_t dev, unsigned index, unsigned iobase)
Index: util/newconfig/config.g
===================================================================
--- util/newconfig/config.g (revision 3100)
+++ util/newconfig/config.g (working copy)
@@ -923,7 +923,7 @@
""" Add a relative path to a pnp device hanging off our parent """
if ((port < 0) or (port > 65536)):
fatal("Invalid port")
- if ((device < 0) or (device > 0xff)):
+ if ((device < 0) or (device > 0xffff)):
fatal("Invalid device")
self.set_path(".type=DEVICE_PATH_PNP,.u={.pnp={ .port = 0x%x, .device = 0x%x }}" % (port, device))
--
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot