Commit 23340580 authored by Pete Zaitcev's avatar Pete Zaitcev Committed by David S. Miller

[SPARC] sparc 2.5.x again

- Little woops in the new PCI configuration routines
- Removal of last CONFIG_SUN_SERIAL occurances
- sunzilog initialized itself even if obio is not present,
also remove pointless goto
- sunru oopsed outright trying to use iobase
parent 68ea0492
......@@ -248,7 +248,7 @@ static int pcic_read_config(struct pci_bus *bus, unsigned int devfn,
return 0;
case 4:
if (where&3) return -EINVAL;
pcic_read_config_dword(bus->number, devfn, where&~3, &v);
pcic_read_config_dword(bus->number, devfn, where&~3, val);
return 0;
}
return -EINVAL;
......@@ -425,7 +425,7 @@ static void __init pcic_pbm_scan_bus(struct linux_pcic *pcic)
/*
* Main entry point from the PCI subsystem.
*/
static int __init pcibios_init(void)
static int __init pcic_init(void)
{
struct linux_pcic *pcic;
......@@ -1030,4 +1030,4 @@ void insl(unsigned long addr, void *dst, unsigned long count) {
#endif
subsys_initcall(pcibios_init);
subsys_initcall(pcic_init);
......@@ -339,8 +339,7 @@ void __init setup_arch(char **cmdline_p)
prom_setsync(prom_sync_me);
{
#if !CONFIG_SUN_SERIAL
#ifndef CONFIG_SERIAL_CONSOLE /* Not CONFIG_SERIAL_SUNCORE: to be gone. */
serial_console = 0;
#else
switch (console_fb) {
......@@ -372,7 +371,6 @@ void __init setup_arch(char **cmdline_p)
case 3: serial_console = 2; break; /* Force ttyb as console */
}
#endif
}
if((boot_flags&BOOTME_DEBUG) && (linux_dbvec!=0) &&
((*(short *)linux_dbvec) != -1)) {
......@@ -383,9 +381,6 @@ void __init setup_arch(char **cmdline_p)
init_mm.context = (unsigned long) NO_CONTEXT;
init_task.thread.kregs = &fake_swapper_regs;
if (serial_console)
conswitchp = NULL;
paging_init();
}
......
......@@ -314,12 +314,9 @@ int prom_callback(long *args)
return 0;
}
extern void rs_kgdb_hook(int tty_num); /* sparc/serial.c */
unsigned int boot_flags = 0;
#define BOOTME_DEBUG 0x1
#define BOOTME_SINGLE 0x2
#define BOOTME_KGDB 0x4
static int console_fb __initdata = 0;
......@@ -389,26 +386,6 @@ static void __init boot_flags_init(char *commands)
commands++;
while (*commands && *commands != ' ')
process_switch(*commands++);
} else if (strlen(commands) >= 9
&& !strncmp(commands, "kgdb=tty", 8)) {
boot_flags |= BOOTME_KGDB;
switch (commands[8]) {
#ifdef CONFIG_SUN_SERIAL
case 'a':
rs_kgdb_hook(0);
prom_printf("KGDB: Using serial line /dev/ttya.\n");
break;
case 'b':
rs_kgdb_hook(1);
prom_printf("KGDB: Using serial line /dev/ttyb.\n");
break;
#endif
default:
printk("KGDB: Unknown tty line.\n");
boot_flags &= ~BOOTME_KGDB;
break;
}
commands += 9;
} else {
if (!strncmp(commands, "console=", 8)) {
commands += 8;
......@@ -567,7 +544,6 @@ void __init setup_arch(char **cmdline_p)
}
#endif
#ifdef CONFIG_SUN_SERIAL
switch (console_fb) {
case 0: /* Let's get our io devices from prom */
{
......@@ -596,10 +572,7 @@ void __init setup_arch(char **cmdline_p)
case 3: /* Force ttyb as console */
serial_console = 2;
break;
}
#else
serial_console = 0;
#endif
};
if (serial_console)
conswitchp = NULL;
......
......@@ -1515,14 +1515,6 @@ void __init paging_init(void)
pages_avail = 0;
last_valid_pfn = end_pfn = bootmem_init(&pages_avail);
#ifdef CONFIG_SUN_SERIAL
/* This does not logically belong here, but we need to
* call it at the moment we are able to use the bootmem
* allocator.
*/
sun_serial_setup();
#endif
/* Inherit non-locked OBP mappings. */
inherit_prom_mappings();
......
......@@ -34,6 +34,7 @@
#include <linux/serio.h>
#endif
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/io.h>
#include <asm/irq.h>
......@@ -1019,6 +1020,8 @@ static void sunsu_autoconfig(struct uart_sunsu_port *up)
if (!up->port_node || !up->su_type)
return;
up->port.iotype = SERIAL_IO_MEM;
/*
* First we look for Ebus-bases su's
*/
......
......@@ -1642,13 +1642,10 @@ static int __init sunzilog_init(void)
/* Sun4 Zilog setup is hard coded, no probing to do. */
if (sparc_cpu_model == sun4) {
NUM_SUNZILOG = 2;
goto no_probe;
}
node = prom_getchild(prom_root_node);
if (sparc_cpu_model == sun4d) {
} else if (sparc_cpu_model == sun4d) {
int bbnode;
node = prom_getchild(prom_root_node);
NUM_SUNZILOG = 0;
while (node &&
(node = prom_searchsiblings(node, "cpu-unit"))) {
......@@ -1657,7 +1654,6 @@ static int __init sunzilog_init(void)
NUM_SUNZILOG += 2;
node = prom_getsibling(node);
}
goto no_probe;
} else if (sparc_cpu_model == sun4u) {
int central_node;
......@@ -1668,26 +1664,27 @@ static int __init sunzilog_init(void)
if (central_node != 0 && central_node != -1)
node = prom_searchsiblings(prom_getchild(central_node), "fhc");
else
node = prom_searchsiblings(node, "sbus");
node = prom_searchsiblings(prom_getchild(prom_root_node), "sbus");
if (node != 0 && node != -1)
node = prom_getchild(node);
if (node == 0 || node == -1)
return -ENODEV;
node = prom_searchsiblings(node, "zs");
if (!node)
return -ENODEV;
NUM_SUNZILOG = 2;
} else {
node = prom_getchild(prom_root_node);
node = prom_searchsiblings(node, "obio");
if (node)
node = prom_getchild(node);
NUM_SUNZILOG = 2;
goto no_probe;
}
node = prom_searchsiblings(node, "zs");
if (!node)
return -ENODEV;
NUM_SUNZILOG = 2;
no_probe:
}
sunzilog_alloc_tables();
......
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