diff --git a/ChangeLog b/ChangeLog index c2f501c00..cfd46dad7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2011-08-19 Vladimir Serbinenko + + Fix PCI iterating on functions >= 4. + + * grub-core/bus/pci.c (grub_pci_iterate): Remove useless ghost skipping. + * include/grub/mips/loongson/pci.h (GRUB_LOONGSON_OHCI_GHOST_FUNCTION): + Removed. + (GRUB_LOONGSON_EHCI_GHOST_FUNCTION): Likewise. + (grub_pci_read): Fix bitmask. + (grub_pci_read_word): Likewise. + (grub_pci_read_byte): Likewise. + (grub_pci_write): Likewise. + (grub_pci_write_word): Likewise. + (grub_pci_write_byte): Likewise. + 2011-08-19 Vladimir Serbinenko * configure.ac: Don't impose march=loongson2f on loongson platform. (It diff --git a/grub-core/bus/pci.c b/grub-core/bus/pci.c index 51006a20e..f007ec33a 100644 --- a/grub-core/bus/pci.c +++ b/grub-core/bus/pci.c @@ -115,16 +115,6 @@ grub_pci_iterate (grub_pci_iteratefunc_t hook) continue; } -#ifdef GRUB_MACHINE_MIPS_LOONGSON - /* Skip ghosts. */ - if (id == GRUB_LOONGSON_OHCI_PCIID - && dev.function == GRUB_LOONGSON_OHCI_GHOST_FUNCTION) - continue; - if (id == GRUB_LOONGSON_EHCI_PCIID - && dev.function == GRUB_LOONGSON_EHCI_GHOST_FUNCTION) - continue; -#endif - if (hook (dev, id)) return; diff --git a/include/grub/mips/loongson/pci.h b/include/grub/mips/loongson/pci.h index 3f828c2f8..57c7dd1fc 100644 --- a/include/grub/mips/loongson/pci.h +++ b/include/grub/mips/loongson/pci.h @@ -26,8 +26,6 @@ #define GRUB_LOONGSON_OHCI_PCIID 0x00351033 #define GRUB_LOONGSON_EHCI_PCIID 0x00e01033 -#define GRUB_LOONGSON_OHCI_GHOST_FUNCTION 4 -#define GRUB_LOONGSON_EHCI_GHOST_FUNCTION 5 #define GRUB_PCI_NUM_BUS 1 #define GRUB_PCI_NUM_DEVICES 16 @@ -66,7 +64,7 @@ grub_pci_read (grub_pci_address_t addr) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); return *(volatile grub_uint32_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)); + | (addr & 0x07ff)); } static inline grub_uint16_t @@ -74,7 +72,7 @@ grub_pci_read_word (grub_pci_address_t addr) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); return *(volatile grub_uint16_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)); + | (addr & 0x07ff)); } static inline grub_uint8_t @@ -82,7 +80,7 @@ grub_pci_read_byte (grub_pci_address_t addr) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); return *(volatile grub_uint8_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)); + | (addr & 0x07ff)); } static inline void @@ -90,7 +88,7 @@ grub_pci_write (grub_pci_address_t addr, grub_uint32_t data) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); *(volatile grub_uint32_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)) = data; + | (addr & 0x07ff)) = data; } static inline void @@ -98,7 +96,7 @@ grub_pci_write_word (grub_pci_address_t addr, grub_uint16_t data) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); *(volatile grub_uint16_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)) = data; + | (addr & 0x07ff)) = data; } static inline void @@ -106,7 +104,7 @@ grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); *(volatile grub_uint8_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)) = data; + | (addr & 0x07ff)) = data; } volatile void *