From: Vladimir 'phcoder' Serbinenko Date: Wed, 20 Jan 2010 19:40:30 +0000 (+0100) Subject: merge mainline into pciclean X-Git-Tag: 1.98~141^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7fcb23c76c4dd34fdf0504af25375bdd9ff2672;p=thirdparty%2Fgrub.git merge mainline into pciclean --- f7fcb23c76c4dd34fdf0504af25375bdd9ff2672 diff --cc commands/lspci.c index ab756616a,c2abd8736..a69bb35ad --- a/commands/lspci.c +++ b/commands/lspci.c @@@ -162,11 -163,11 +163,11 @@@ grub_lspci_iter (grub_pci_device_t dev addr = grub_pci_make_address (dev, reg); space = grub_pci_read (addr); - reg++; - + reg += sizeof (grub_uint32_t); - ++ if (space == 0) continue; - + switch (space & GRUB_PCI_ADDR_SPACE_MASK) { case GRUB_PCI_ADDR_SPACE_IO: diff --cc disk/ata.c index bc8383d4e,833ccb976..687ed9378 --- a/disk/ata.c +++ b/disk/ata.c @@@ -400,19 -400,34 +400,34 @@@ grub_ata_pciinit (grub_pci_device_t dev int regb; int i; static int controller = 0; + int cs5536 = 0; + int nports = 2; /* Read class. */ - addr = grub_pci_make_address (dev, 2); + addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); class = grub_pci_read (addr); + /* AMD CS5536 Southbridge. */ + if (pciid == 0x208f1022) + { + cs5536 = 1; + nports = 1; + } + /* Check if this class ID matches that of a PCI IDE Controller. */ - if (class >> 16 != 0x0101) + if (!cs5536 && (class >> 16 != 0x0101)) return 0; - for (i = 0; i < 2; i++) + for (i = 0; i < nports; i++) { /* Set to 0 when the channel operated in compatibility mode. */ - int compat = (class >> (8 + 2 * i)) & 1; + int compat; + + /* We don't support non-compatibility mode for CS5536. */ + if (cs5536) + compat = 0; + else + compat = (class >> (8 + 2 * i)) & 1; rega = 0; regb = 0;