[OpenBIOS] [PATCH 10/10] pci: assign relocatable address ranges
Igor V. Kovalenko
igor.v.kovalenko at gmail.com
Tue May 25 14:38:42 CEST 2010
From: Igor V. Kovalenko <igor.v.kovalenko at gmail.com>
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko at gmail.com>
---
drivers/pci.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/pci.c b/drivers/pci.c
index d22ac58..bd5abe0 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -546,24 +546,24 @@ int eth_config_cb (const pci_config_t *config)
static inline void pci_decode_pci_addr(pci_addr addr, int *flags,
int *space_code, uint32_t *mask)
{
- if (addr & 0x01) {
+ *flags = 0;
+ if (addr & 0x01) {
*space_code = IO_SPACE;
- *flags = 0;
*mask = 0x00000001;
-
- } else if (addr & 0x04) {
-
- *flags = IS_NOT_RELOCATABLE;
- *space_code = MEMORY_SPACE_64;
- *mask = 0x0000000F;
-
} else {
+ if (addr & 0x04) {
+ *space_code = MEMORY_SPACE_64;
+ *flags |= IS_NOT_RELOCATABLE; /* XXX: why not relocatable? */
+ } else {
+ *space_code = MEMORY_SPACE_32;
+ }
- *space_code = MEMORY_SPACE_32;
- *flags = IS_NOT_RELOCATABLE;
- *mask = 0x0000000F;
+ if (addr & 0x08) {
+ *flags |= IS_PREFETCHABLE;
+ }
+ *mask = 0x0000000F;
}
}
More information about the OpenBIOS
mailing list