Skip to content

Commit 8ef6e62

Browse files
author
Rob Herring
committed
ARM: footbridge: use fixed PCI i/o mapping
Move footbridge PCI to fixed i/o mapping. io.h is still needed for the !MMU case. Signed-off-by: Rob Herring <[email protected]> Cc: Russell King <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>
1 parent c04dc9a commit 8ef6e62

File tree

5 files changed

+14
-31
lines changed

5 files changed

+14
-31
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ config ARCH_FOOTBRIDGE
431431
select FOOTBRIDGE
432432
select GENERIC_CLOCKEVENTS
433433
select HAVE_IDE
434-
select NEED_MACH_IO_H
434+
select NEED_MACH_IO_H if !MMU
435435
select NEED_MACH_MEMORY_H
436436
help
437437
Support for systems based on the DC21285 companion chip

arch/arm/mach-footbridge/common.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <linux/init.h>
1616
#include <linux/io.h>
1717
#include <linux/spinlock.h>
18-
18+
1919
#include <asm/pgtable.h>
2020
#include <asm/page.h>
2121
#include <asm/irq.h>
@@ -26,6 +26,7 @@
2626

2727
#include <asm/mach/irq.h>
2828
#include <asm/mach/map.h>
29+
#include <asm/mach/pci.h>
2930

3031
#include "common.h"
3132

@@ -175,11 +176,6 @@ static struct map_desc ebsa285_host_io_desc[] __initdata = {
175176
.pfn = __phys_to_pfn(DC21285_PCI_IACK),
176177
.length = PCIIACK_SIZE,
177178
.type = MT_DEVICE,
178-
}, {
179-
.virtual = PCIO_BASE,
180-
.pfn = __phys_to_pfn(DC21285_PCI_IO),
181-
.length = PCIO_SIZE,
182-
.type = MT_DEVICE,
183179
},
184180
#endif
185181
};
@@ -196,8 +192,10 @@ void __init footbridge_map_io(void)
196192
* Now, work out what we've got to map in addition on this
197193
* platform.
198194
*/
199-
if (footbridge_cfn_mode())
195+
if (footbridge_cfn_mode()) {
200196
iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc));
197+
pci_map_io_early(__phys_to_pfn(DC21285_PCI_IO));
198+
}
201199
}
202200

203201
void footbridge_restart(char mode, const char *cmd)

arch/arm/mach-footbridge/dc21285.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys)
276276

277277
sys->mem_offset = DC21285_PCI_MEM;
278278

279-
pci_add_resource_offset(&sys->resources,
280-
&ioport_resource, sys->io_offset);
279+
pci_ioremap_io(0, DC21285_PCI_IO);
280+
281281
pci_add_resource_offset(&sys->resources, &res[0], sys->mem_offset);
282282
pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset);
283283

@@ -298,7 +298,7 @@ void __init dc21285_preinit(void)
298298
mem_size = (unsigned int)high_memory - PAGE_OFFSET;
299299
for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1)
300300
if (mem_mask >= mem_size)
301-
break;
301+
break;
302302

303303
/*
304304
* These registers need to be set up whether we're the
@@ -350,22 +350,14 @@ void __init dc21285_preinit(void)
350350
"PCI data parity", NULL);
351351

352352
if (cfn_mode) {
353-
static struct resource csrio;
354-
355-
csrio.flags = IORESOURCE_IO;
356-
csrio.name = "Footbridge";
357-
358-
allocate_resource(&ioport_resource, &csrio, 128,
359-
0xff00, 0xffff, 128, NULL, NULL);
360-
361353
/*
362354
* Map our SDRAM at a known address in PCI space, just in case
363355
* the firmware had other ideas. Using a nonzero base is
364356
* necessary, since some VGA cards forcefully use PCI addresses
365357
* in the range 0x000a0000 to 0x000c0000. (eg, S3 cards).
366358
*/
367359
*CSR_PCICSRBASE = 0xf4000000;
368-
*CSR_PCICSRIOBASE = csrio.start;
360+
*CSR_PCICSRIOBASE = 0;
369361
*CSR_PCISDRAMBASE = __virt_to_bus(PAGE_OFFSET);
370362
*CSR_PCIROMBASE = 0;
371363
*CSR_PCICMD = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |

arch/arm/mach-footbridge/include/mach/debug-macro.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
/* For NetWinder debugging */
1818
.macro addruart, rp, rv, tmp
1919
mov \rp, #0x000003f8
20-
orr \rv, \rp, #0xff000000 @ virtual
20+
orr \rv, \rp, #0xfe000000 @ virtual
21+
orr \rv, \rv, #0x00e00000 @ virtual
2122
orr \rp, \rp, #0x7c000000 @ physical
2223
.endm
2324

arch/arm/mach-footbridge/include/mach/io.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,10 @@
1414
#ifndef __ASM_ARM_ARCH_IO_H
1515
#define __ASM_ARM_ARCH_IO_H
1616

17-
#ifdef CONFIG_MMU
18-
#define MMU_IO(a, b) (a)
19-
#else
20-
#define MMU_IO(a, b) (b)
21-
#endif
22-
23-
#define PCIO_SIZE 0x00100000
24-
#define PCIO_BASE MMU_IO(0xff000000, 0x7c000000)
25-
2617
/*
27-
* Translation of various region addresses to virtual addresses
18+
* Translation of various i/o addresses to host addresses for !CONFIG_MMU
2819
*/
20+
#define PCIO_BASE 0x7c000000
2921
#define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
3022

3123
#endif

0 commit comments

Comments
 (0)