diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-11-30 00:57:28 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-08 22:51:26 -0500 |
commit | d2dd482bc17c3bc240045f80a7c4b4d5cea5e29c (patch) | |
tree | 9c40a9ab9a04839f2d578f9d47985b399074ce58 /arch/powerpc/kernel/legacy_serial.c | |
parent | bb6b9b28d6847bc71f910e2e82c9040ff4b97ec0 (diff) |
[PATCH] powerpc: Update OF address parsers
This updates the OF address parsers to return the IO flags
indicating the type of address obtained. It also adds a PCI
call for converting physical addresses that hit IO space into
into IO tokens, and add routines that return the translated
addresses into struct resource
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/legacy_serial.c')
-rw-r--r-- | arch/powerpc/kernel/legacy_serial.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 83023bb59ad9..d179ec502292 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c | |||
@@ -146,6 +146,7 @@ static int __init add_legacy_pci_port(struct device_node *np, | |||
146 | { | 146 | { |
147 | phys_addr_t addr, base; | 147 | phys_addr_t addr, base; |
148 | u32 *addrp; | 148 | u32 *addrp; |
149 | unsigned int flags; | ||
149 | int iotype, index = -1, lindex = 0; | 150 | int iotype, index = -1, lindex = 0; |
150 | 151 | ||
151 | /* We only support ports that have a clock frequency properly | 152 | /* We only support ports that have a clock frequency properly |
@@ -159,12 +160,12 @@ static int __init add_legacy_pci_port(struct device_node *np, | |||
159 | return -1; | 160 | return -1; |
160 | 161 | ||
161 | /* Get the PCI address. Assume BAR 0 */ | 162 | /* Get the PCI address. Assume BAR 0 */ |
162 | addrp = of_get_pci_address(pci_dev, 0, NULL); | 163 | addrp = of_get_pci_address(pci_dev, 0, NULL, &flags); |
163 | if (addrp == NULL) | 164 | if (addrp == NULL) |
164 | return -1; | 165 | return -1; |
165 | 166 | ||
166 | /* We only support BAR 0 for now */ | 167 | /* We only support BAR 0 for now */ |
167 | iotype = (addrp[0] & 0x02000000) ? UPIO_MEM : UPIO_PORT; | 168 | iotype = (flags & IORESOURCE_MEM) ? UPIO_MEM : UPIO_PORT; |
168 | addr = of_translate_address(pci_dev, addrp); | 169 | addr = of_translate_address(pci_dev, addrp); |
169 | 170 | ||
170 | /* Set the IO base to the same as the translated address for MMIO, | 171 | /* Set the IO base to the same as the translated address for MMIO, |