Commit f200709a authored by Paul Mackerras's avatar Paul Mackerras

PPC32: fixes for I/O mappings on CHRP machines.

parent 83b97532
......@@ -923,6 +923,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
struct device_node *dev, int primary)
{
unsigned int *ranges, *prev;
unsigned int size;
int rlen = 0;
int memno = 0;
struct resource *res;
......@@ -963,12 +964,16 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
ranges = (unsigned int *) get_property(dev, "ranges", &rlen);
while ((rlen -= np * sizeof(unsigned int)) >= 0) {
res = NULL;
size = ranges[na+4];
switch (ranges[0] >> 24) {
case 1: /* I/O space */
if (ranges[2] != 0)
break;
hose->io_base_phys = ranges[na+2];
hose->io_base_virt = ioremap(ranges[na+2], ranges[na+4]);
/* limit I/O space to 16MB */
if (size > 0x01000000)
size = 0x01000000;
hose->io_base_virt = ioremap(ranges[na+2], size);
if (primary)
isa_io_base = (unsigned long) hose->io_base_virt;
res = &hose->io_resource;
......@@ -997,7 +1002,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
}
if (res != NULL) {
res->name = dev->full_name;
res->end = res->start + ranges[na+4] - 1;
res->end = res->start + size - 1;
res->parent = NULL;
res->sibling = NULL;
res->child = NULL;
......
......@@ -464,35 +464,6 @@ chrp_init2(void)
#endif /* CONFIG_VT && (CONFIG_ADB_KEYBOARD || CONFIG_INPUT) */
}
/*
* One of the main thing these mappings are needed for is so that
* xmon can get to the serial port early on. We probably should
* handle the machines with the mpc106 as well as the python (F50)
* and the GG2 (longtrail). Actually we should look in the device
* tree and do the right thing.
*/
static void __init
chrp_map_io(void)
{
char *name;
/*
* The code below tends to get removed, please don't take it out.
* The F50 needs this mapping and it you take it out I'll track you
* down and slap your hands. If it causes problems please email me.
* -- Cort <cort@fsmlabs.com>
*/
name = get_property(find_path_device("/"), "name", NULL);
if (name && strncmp(name, "IBM-70", 6) == 0
&& strstr(name, "-F50")) {
io_block_mapping(0x80000000, 0x80000000, 0x10000000, _PAGE_IO);
io_block_mapping(0x90000000, 0x90000000, 0x10000000, _PAGE_IO);
return;
} else {
io_block_mapping(0xf8000000, 0xf8000000, 0x04000000, _PAGE_IO);
}
}
void __init
chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7)
......@@ -530,7 +501,6 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.calibrate_decr = chrp_calibrate_decr;
ppc_md.find_end_of_memory = pmac_find_end_of_memory;
ppc_md.setup_io_mappings = chrp_map_io;
#ifdef CONFIG_VT
/* these are adjusted in chrp_init2 if we have an ADB keyboard */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment