From 1e5c4a81739171fffbb246a21c90666f2437ecdc Mon Sep 17 00:00:00 2001 From: "Igor V. Kovalenko" Date: Thu, 27 May 2010 20:12:26 +0000 Subject: [PATCH] pci: assign relocatable address ranges Signed-off-by: Igor V. Kovalenko Signed-off-by: Blue Swirl git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@790 f158a5a8-5612-0410-a976-696ce0be7e32 --- drivers/pci.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/pci.c b/drivers/pci.c index aa4ca2c..2b4e525 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) { + *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; } }