Commit d837cda3 authored by David S. Miller's avatar David S. Miller

SPARC: Kill CONFIG_SUN_CONSOLE checks, always on so check is pointless.

parent d4d9c3ac
......@@ -146,19 +146,15 @@ extern char reboot_command [];
extern int serial_console;
#ifdef CONFIG_SUN_CONSOLE
extern void (*prom_palette)(int);
#endif
void machine_halt(void)
{
sti();
mdelay(8);
cli();
#ifdef CONFIG_SUN_CONSOLE
if (!serial_console && prom_palette)
prom_palette (1);
#endif
prom_halt();
panic("Halt failed!");
}
......@@ -173,10 +169,8 @@ void machine_restart(char * cmd)
p = strchr (reboot_command, '\n');
if (p) *p = 0;
#ifdef CONFIG_SUN_CONSOLE
if (!serial_console && prom_palette)
prom_palette (1);
#endif
if (cmd)
prom_reboot(cmd);
if (*reboot_command)
......
......@@ -69,9 +69,7 @@ struct screen_info screen_info = {
extern unsigned long trapbase;
extern int serial_console;
extern void breakpoint(void);
#if CONFIG_SUN_CONSOLE
void (*prom_palette)(int);
#endif
asmlinkage void sys_sync(void); /* it's really int */
/* Pretty sick eh? */
......@@ -87,10 +85,8 @@ void prom_sync_me(void)
"nop\n\t"
"nop\n\t" : : "r" (&trapbase));
#ifdef CONFIG_SUN_CONSOLE
if (prom_palette)
prom_palette(1);
#endif
prom_printf("PROM SYNC COMMAND...\n");
show_free_areas();
if(current->pid != 0) {
......@@ -118,9 +114,7 @@ unsigned int boot_flags __initdata = 0;
#define BOOTME_KGDBB 0x8
#define BOOTME_KGDB 0xc
#ifdef CONFIG_SUN_CONSOLE
static int console_fb __initdata = 0;
#endif
/* Exported for mm/init.c:paging_init. */
unsigned long cmdline_memory_size __initdata = 0;
......@@ -221,7 +215,6 @@ static void __init boot_flags_init(char *commands)
}
commands += 9;
} else {
#if CONFIG_SUN_CONSOLE
if (!strncmp(commands, "console=", 8)) {
commands += 8;
if (!strncmp (commands, "ttya", 4)) {
......@@ -242,9 +235,7 @@ static void __init boot_flags_init(char *commands)
} else {
console_fb = 1;
}
} else
#endif
if (!strncmp(commands, "mem=", 4)) {
} else if (!strncmp(commands, "mem=", 4)) {
/*
* "mem=XXX[kKmM] overrides the PROM-reported
* memory size.
......
......@@ -46,10 +46,8 @@ prom_feval(char *fstring)
}
/* We want to do this more nicely some day. */
#ifdef CONFIG_SUN_CONSOLE
extern void (*prom_palette)(int);
extern int serial_console;
#endif
/* Drop into the prom, with the chance to continue with the 'go'
* prom command.
......@@ -63,10 +61,8 @@ prom_cmdline(void)
unsigned long flags;
kernel_enter_debugger();
#ifdef CONFIG_SUN_CONSOLE
if(!serial_console && prom_palette)
prom_palette (1);
#endif
install_obp_ticker();
spin_lock_irqsave(&prom_lock, flags);
(*(romvec->pv_abort))();
......@@ -76,10 +72,8 @@ prom_cmdline(void)
#ifdef CONFIG_SUN_AUXIO
TURN_ON_LED;
#endif
#ifdef CONFIG_SUN_CONSOLE
if(!serial_console && prom_palette)
prom_palette (0);
#endif
}
/* Drop into the prom, but completely terminate the program.
......
......@@ -109,18 +109,14 @@ int cpu_idle(void)
extern char reboot_command [];
#ifdef CONFIG_SUN_CONSOLE
extern void (*prom_palette)(int);
extern int serial_console;
#endif
extern void (*prom_keyboard)(void);
void machine_halt(void)
{
#ifdef CONFIG_SUN_CONSOLE
if (!serial_console && prom_palette)
prom_palette (1);
#endif
if (prom_keyboard)
prom_keyboard();
prom_halt();
......@@ -129,10 +125,8 @@ void machine_halt(void)
void machine_alt_power_off(void)
{
#ifdef CONFIG_SUN_CONSOLE
if (!serial_console && prom_palette)
prom_palette(1);
#endif
if (prom_keyboard)
prom_keyboard();
prom_halt_power_off();
......@@ -145,10 +139,8 @@ void machine_restart(char * cmd)
p = strchr (reboot_command, '\n');
if (p) *p = 0;
#ifdef CONFIG_SUN_CONSOLE
if (!serial_console && prom_palette)
prom_palette (1);
#endif
if (prom_keyboard)
prom_keyboard();
if (cmd)
......
......@@ -65,9 +65,7 @@ struct screen_info screen_info = {
* prints out pretty messages and returns.
*/
#if CONFIG_SUN_CONSOLE
void (*prom_palette)(int);
#endif
void (*prom_keyboard)(void);
asmlinkage void sys_sync(void); /* it's really int */
......@@ -322,9 +320,7 @@ unsigned int boot_flags = 0;
#define BOOTME_SINGLE 0x2
#define BOOTME_KGDB 0x4
#ifdef CONFIG_SUN_CONSOLE
static int console_fb __initdata = 0;
#endif
/* Exported for mm/init.c:paging_init. */
unsigned long cmdline_memory_size = 0;
......@@ -413,7 +409,6 @@ static void __init boot_flags_init(char *commands)
}
commands += 9;
} else {
#if CONFIG_SUN_CONSOLE
if (!strncmp(commands, "console=", 8)) {
commands += 8;
if (!strncmp (commands, "ttya", 4)) {
......@@ -434,9 +429,7 @@ static void __init boot_flags_init(char *commands)
} else {
console_fb = 1;
}
} else
#endif
if (!strncmp(commands, "mem=", 4)) {
} else if (!strncmp(commands, "mem=", 4)) {
/*
* "mem=XXX[kKmM]" overrides the PROM-reported
* memory size.
......
......@@ -16,28 +16,24 @@
#include <asm/oplib.h>
/* Reset and reboot the machine with the command 'bcommand'. */
void
prom_reboot(char *bcommand)
void prom_reboot(char *bcommand)
{
p1275_cmd ("boot", P1275_ARG(0,P1275_ARG_IN_STRING)|
P1275_INOUT(1,0), bcommand);
p1275_cmd("boot", P1275_ARG(0, P1275_ARG_IN_STRING) |
P1275_INOUT(1, 0), bcommand);
}
/* Forth evaluate the expression contained in 'fstring'. */
void
prom_feval(char *fstring)
void prom_feval(char *fstring)
{
if(!fstring || fstring[0] == 0)
if (!fstring || fstring[0] == 0)
return;
p1275_cmd ("interpret", P1275_ARG(0,P1275_ARG_IN_STRING)|
P1275_INOUT(1,1), fstring);
p1275_cmd("interpret", P1275_ARG(0, P1275_ARG_IN_STRING) |
P1275_INOUT(1, 1), fstring);
}
/* We want to do this more nicely some day. */
#ifdef CONFIG_SUN_CONSOLE
extern void (*prom_palette)(int);
extern int serial_console;
#endif
#ifdef CONFIG_SMP
extern void smp_capture(void);
......@@ -47,32 +43,27 @@ extern void smp_release(void);
/* Drop into the prom, with the chance to continue with the 'go'
* prom command.
*/
void
prom_cmdline(void)
void prom_cmdline(void)
{
unsigned long flags;
local_irq_save(flags);
#ifdef CONFIG_SUN_CONSOLE
if(!serial_console && prom_palette)
prom_palette (1);
#endif
if (!serial_console && prom_palette)
prom_palette(1);
#ifdef CONFIG_SMP
smp_capture();
#endif
p1275_cmd ("enter", P1275_INOUT(0,0));
p1275_cmd("enter", P1275_INOUT(0, 0));
#ifdef CONFIG_SMP
smp_release();
#endif
#ifdef CONFIG_SUN_CONSOLE
if(!serial_console && prom_palette)
prom_palette (0);
#endif
if (!serial_console && prom_palette)
prom_palette(0);
local_irq_restore(flags);
}
......@@ -84,74 +75,69 @@ extern void smp_promstop_others(void);
/* Drop into the prom, but completely terminate the program.
* No chance of continuing.
*/
void
prom_halt(void)
void prom_halt(void)
{
#ifdef CONFIG_SMP
smp_promstop_others();
udelay(8000);
#endif
again:
p1275_cmd ("exit", P1275_INOUT(0,0));
p1275_cmd("exit", P1275_INOUT(0, 0));
goto again; /* PROM is out to get me -DaveM */
}
void
prom_halt_power_off(void)
void prom_halt_power_off(void)
{
#ifdef CONFIG_SMP
smp_promstop_others();
udelay(8000);
#endif
p1275_cmd ("SUNW,power-off", P1275_INOUT(0,0));
p1275_cmd("SUNW,power-off", P1275_INOUT(0, 0));
/* if nothing else helps, we just halt */
prom_halt ();
prom_halt();
}
/* Set prom sync handler to call function 'funcp'. */
void
prom_setcallback(callback_func_t funcp)
void prom_setcallback(callback_func_t funcp)
{
if(!funcp) return;
p1275_cmd ("set-callback", P1275_ARG(0,P1275_ARG_IN_FUNCTION)|
P1275_INOUT(1,1), funcp);
if (!funcp)
return;
p1275_cmd("set-callback", P1275_ARG(0, P1275_ARG_IN_FUNCTION) |
P1275_INOUT(1, 1), funcp);
}
/* Get the idprom and stuff it into buffer 'idbuf'. Returns the
* format type. 'num_bytes' is the number of bytes that your idbuf
* has space for. Returns 0xff on error.
*/
unsigned char
prom_get_idprom(char *idbuf, int num_bytes)
unsigned char prom_get_idprom(char *idbuf, int num_bytes)
{
int len;
len = prom_getproplen(prom_root_node, "idprom");
if((len>num_bytes) || (len==-1)) return 0xff;
if(!prom_getproperty(prom_root_node, "idprom", idbuf, num_bytes))
if ((len >num_bytes) || (len == -1))
return 0xff;
if (!prom_getproperty(prom_root_node, "idprom", idbuf, num_bytes))
return idbuf[0];
return 0xff;
}
/* Get the major prom version number. */
int
prom_version(void)
int prom_version(void)
{
return PROM_P1275;
}
/* Get the prom plugin-revision. */
int
prom_getrev(void)
int prom_getrev(void)
{
return prom_rev;
}
/* Get the prom firmware print revision. */
int
prom_getprev(void)
int prom_getprev(void)
{
return prom_prev;
}
......@@ -173,7 +159,7 @@ int prom_get_mmu_ihandle(void)
node = prom_finddevice("/chosen");
ret = prom_getint(node, "mmu");
if(ret == -1 || ret == 0)
if (ret == -1 || ret == 0)
mmu_ihandle_cache = -1;
else
mmu_ihandle_cache = ret;
......@@ -284,7 +270,7 @@ unsigned long prom_retain(char *name,
/* If align is zero, the pa_low/pa_high args are passed,
* else they are not.
*/
if(align == 0)
if (align == 0)
return p1275_cmd("SUNW,retain",
(P1275_ARG(0, P1275_ARG_IN_BUF) | P1275_INOUT(5, 2)),
name, pa_low, pa_high, size, align);
......
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