aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorManuel Lauss <mano@roarinelk.homelinux.net>2008-12-21 03:26:16 -0500
committerRalf Baechle <ralf@linux-mips.org>2009-01-11 04:57:25 -0500
commit7179380ee9bdeb5fa2ff07581f512fe0f5382e5b (patch)
tree12bc5c0cfc3506434b0e51829bbbb66aaadf491a /arch/mips
parent23ba25d56606eec6fabc37c1efcbd48837dc9adc (diff)
MIPS: Alchemy: move commandline mangling out of common code
Not every alchemy-based board might want these options forced on it, and most of this stuff seems to be intended for devboard code anyway. Remove commandline mangling code out of common chip code and instead add relevant sections to all in-tree boards to not change existing behaviour. Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/alchemy/common/setup.c34
-rw-r--r--arch/mips/alchemy/devboards/db1x00/board_setup.c28
-rw-r--r--arch/mips/alchemy/devboards/pb1000/board_setup.c10
-rw-r--r--arch/mips/alchemy/devboards/pb1100/board_setup.c27
-rw-r--r--arch/mips/alchemy/devboards/pb1200/board_setup.c24
-rw-r--r--arch/mips/alchemy/devboards/pb1500/board_setup.c18
-rw-r--r--arch/mips/alchemy/devboards/pb1550/board_setup.c12
-rw-r--r--arch/mips/alchemy/mtx-1/board_setup.c12
-rw-r--r--arch/mips/alchemy/xxs1500/board_setup.c12
9 files changed, 136 insertions, 41 deletions
diff --git a/arch/mips/alchemy/common/setup.c b/arch/mips/alchemy/common/setup.c
index 1ac6b06f42a3..9889ec3ba4c4 100644
--- a/arch/mips/alchemy/common/setup.c
+++ b/arch/mips/alchemy/common/setup.c
@@ -35,7 +35,6 @@
35#include <asm/time.h> 35#include <asm/time.h>
36 36
37#include <au1000.h> 37#include <au1000.h>
38#include <prom.h>
39 38
40extern void __init board_setup(void); 39extern void __init board_setup(void);
41extern void au1000_restart(char *); 40extern void au1000_restart(char *);
@@ -46,12 +45,15 @@ extern void set_cpuspec(void);
46void __init plat_mem_setup(void) 45void __init plat_mem_setup(void)
47{ 46{
48 struct cpu_spec *sp; 47 struct cpu_spec *sp;
49 char *argptr;
50 unsigned long prid, cpufreq, bclk; 48 unsigned long prid, cpufreq, bclk;
51 49
52 set_cpuspec(); 50 set_cpuspec();
53 sp = cur_cpu_spec[0]; 51 sp = cur_cpu_spec[0];
54 52
53 _machine_restart = au1000_restart;
54 _machine_halt = au1000_halt;
55 pm_power_off = au1000_power_off;
56
55 board_setup(); /* board specific setup */ 57 board_setup(); /* board specific setup */
56 58
57 prid = read_c0_prid(); 59 prid = read_c0_prid();
@@ -79,34 +81,6 @@ void __init plat_mem_setup(void)
79 /* Clear to obtain best system bus performance */ 81 /* Clear to obtain best system bus performance */
80 clear_c0_config(1 << 19); /* Clear Config[OD] */ 82 clear_c0_config(1 << 19); /* Clear Config[OD] */
81 83
82 argptr = prom_getcmdline();
83
84#ifdef CONFIG_SERIAL_8250_CONSOLE
85 argptr = strstr(argptr, "console=");
86 if (argptr == NULL) {
87 argptr = prom_getcmdline();
88 strcat(argptr, " console=ttyS0,115200");
89 }
90#endif
91
92#ifdef CONFIG_FB_AU1100
93 argptr = strstr(argptr, "video=");
94 if (argptr == NULL) {
95 argptr = prom_getcmdline();
96 /* default panel */
97 /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/
98 }
99#endif
100
101#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000)
102 /* au1000 does not support vra, au1500 and au1100 do */
103 strcat(argptr, " au1000_audio=vra");
104 argptr = prom_getcmdline();
105#endif
106 _machine_restart = au1000_restart;
107 _machine_halt = au1000_halt;
108 pm_power_off = au1000_power_off;
109
110 /* IO/MEM resources. */ 84 /* IO/MEM resources. */
111 set_io_port_base(0); 85 set_io_port_base(0);
112 ioport_resource.start = IOPORT_RESOURCE_START; 86 ioport_resource.start = IOPORT_RESOURCE_START;
diff --git a/arch/mips/alchemy/devboards/db1x00/board_setup.c b/arch/mips/alchemy/devboards/db1x00/board_setup.c
index 427f799031bb..a75ffbf99f25 100644
--- a/arch/mips/alchemy/devboards/db1x00/board_setup.c
+++ b/arch/mips/alchemy/devboards/db1x00/board_setup.c
@@ -32,6 +32,9 @@
32#include <asm/mach-au1x00/au1000.h> 32#include <asm/mach-au1x00/au1000.h>
33#include <asm/mach-db1x00/db1x00.h> 33#include <asm/mach-db1x00/db1x00.h>
34 34
35#include <prom.h>
36
37
35static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; 38static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
36 39
37const char *get_system_type(void) 40const char *get_system_type(void)
@@ -52,6 +55,31 @@ void board_reset(void)
52void __init board_setup(void) 55void __init board_setup(void)
53{ 56{
54 u32 pin_func = 0; 57 u32 pin_func = 0;
58 char *argptr;
59
60 argptr = prom_getcmdline();
61#ifdef CONFIG_SERIAL_8250_CONSOLE
62 argptr = strstr(argptr, "console=");
63 if (argptr == NULL) {
64 argptr = prom_getcmdline();
65 strcat(argptr, " console=ttyS0,115200");
66 }
67#endif
68
69#ifdef CONFIG_FB_AU1100
70 argptr = strstr(argptr, "video=");
71 if (argptr == NULL) {
72 argptr = prom_getcmdline();
73 /* default panel */
74 /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/
75 }
76#endif
77
78#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000)
79 /* au1000 does not support vra, au1500 and au1100 do */
80 strcat(argptr, " au1000_audio=vra");
81 argptr = prom_getcmdline();
82#endif
55 83
56 /* Not valid for Au1550 */ 84 /* Not valid for Au1550 */
57#if defined(CONFIG_IRDA) && \ 85#if defined(CONFIG_IRDA) && \
diff --git a/arch/mips/alchemy/devboards/pb1000/board_setup.c b/arch/mips/alchemy/devboards/pb1000/board_setup.c
index b75e487f53ed..889c8fda2ab1 100644
--- a/arch/mips/alchemy/devboards/pb1000/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1000/board_setup.c
@@ -28,6 +28,7 @@
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <asm/mach-au1x00/au1000.h> 29#include <asm/mach-au1x00/au1000.h>
30#include <asm/mach-pb1x00/pb1000.h> 30#include <asm/mach-pb1x00/pb1000.h>
31#include <prom.h>
31 32
32 33
33struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 34struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
@@ -52,6 +53,15 @@ void __init board_setup(void)
52 u32 sys_freqctrl, sys_clksrc; 53 u32 sys_freqctrl, sys_clksrc;
53 u32 prid = read_c0_prid(); 54 u32 prid = read_c0_prid();
54 55
56#ifdef CONFIG_SERIAL_8250_CONSOLE
57 char *argptr = prom_getcmdline();
58 argptr = strstr(argptr, "console=");
59 if (argptr == NULL) {
60 argptr = prom_getcmdline();
61 strcat(argptr, " console=ttyS0,115200");
62 }
63#endif
64
55 /* Set AUX clock to 12 MHz * 8 = 96 MHz */ 65 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
56 au_writel(8, SYS_AUXPLL); 66 au_writel(8, SYS_AUXPLL);
57 au_writel(0, SYS_PINSTATERD); 67 au_writel(0, SYS_PINSTATERD);
diff --git a/arch/mips/alchemy/devboards/pb1100/board_setup.c b/arch/mips/alchemy/devboards/pb1100/board_setup.c
index 9daab7e29224..fbd211e13489 100644
--- a/arch/mips/alchemy/devboards/pb1100/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1100/board_setup.c
@@ -29,6 +29,8 @@
29#include <asm/mach-au1x00/au1000.h> 29#include <asm/mach-au1x00/au1000.h>
30#include <asm/mach-pb1x00/pb1100.h> 30#include <asm/mach-pb1x00/pb1100.h>
31 31
32#include <prom.h>
33
32 34
33struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 35struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
34 { AU1000_GPIO_9, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card Fully_Inserted# */ 36 { AU1000_GPIO_9, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card Fully_Inserted# */
@@ -54,6 +56,31 @@ void board_reset(void)
54void __init board_setup(void) 56void __init board_setup(void)
55{ 57{
56 volatile void __iomem *base = (volatile void __iomem *)0xac000000UL; 58 volatile void __iomem *base = (volatile void __iomem *)0xac000000UL;
59 char *argptr;
60
61 argptr = prom_getcmdline();
62#ifdef CONFIG_SERIAL_8250_CONSOLE
63 argptr = strstr(argptr, "console=");
64 if (argptr == NULL) {
65 argptr = prom_getcmdline();
66 strcat(argptr, " console=ttyS0,115200");
67 }
68#endif
69
70#ifdef CONFIG_FB_AU1100
71 argptr = strstr(argptr, "video=");
72 if (argptr == NULL) {
73 argptr = prom_getcmdline();
74 /* default panel */
75 /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/
76 }
77#endif
78
79#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000)
80 /* au1000 does not support vra, au1500 and au1100 do */
81 strcat(argptr, " au1000_audio=vra");
82 argptr = prom_getcmdline();
83#endif
57 84
58 /* Set AUX clock to 12 MHz * 8 = 96 MHz */ 85 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
59 au_writel(8, SYS_AUXPLL); 86 au_writel(8, SYS_AUXPLL);
diff --git a/arch/mips/alchemy/devboards/pb1200/board_setup.c b/arch/mips/alchemy/devboards/pb1200/board_setup.c
index 8f03dc8fdd29..b5585e462004 100644
--- a/arch/mips/alchemy/devboards/pb1200/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1200/board_setup.c
@@ -46,7 +46,19 @@ void board_reset(void)
46 46
47void __init board_setup(void) 47void __init board_setup(void)
48{ 48{
49 char *argptr = NULL; 49 char *argptr;
50
51 argptr = prom_getcmdline();
52#ifdef CONFIG_SERIAL_8250_CONSOLE
53 argptr = strstr(argptr, "console=");
54 if (argptr == NULL) {
55 argptr = prom_getcmdline();
56 strcat(argptr, " console=ttyS0,115200");
57 }
58#endif
59#ifdef CONFIG_FB_AU1200
60 strcat(argptr, " video=au1200fb:panel:bs");
61#endif
50 62
51#if 0 63#if 0
52 { 64 {
@@ -104,16 +116,6 @@ void __init board_setup(void)
104 } 116 }
105#endif 117#endif
106 118
107#ifdef CONFIG_FB_AU1200
108 argptr = prom_getcmdline();
109#ifdef CONFIG_MIPS_PB1200
110 strcat(argptr, " video=au1200fb:panel:bs");
111#endif
112#ifdef CONFIG_MIPS_DB1200
113 strcat(argptr, " video=au1200fb:panel:bs");
114#endif
115#endif
116
117 /* 119 /*
118 * The Pb1200 development board uses external MUX for PSC0 to 120 * The Pb1200 development board uses external MUX for PSC0 to
119 * support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI 121 * support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
diff --git a/arch/mips/alchemy/devboards/pb1500/board_setup.c b/arch/mips/alchemy/devboards/pb1500/board_setup.c
index 47173f1e5ae9..dcb36a66442f 100644
--- a/arch/mips/alchemy/devboards/pb1500/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1500/board_setup.c
@@ -29,6 +29,8 @@
29#include <asm/mach-au1x00/au1000.h> 29#include <asm/mach-au1x00/au1000.h>
30#include <asm/mach-pb1x00/pb1500.h> 30#include <asm/mach-pb1x00/pb1500.h>
31 31
32#include <prom.h>
33
32 34
33char irq_tab_alchemy[][5] __initdata = { 35char irq_tab_alchemy[][5] __initdata = {
34 [12] = { -1, INTA, INTX, INTX, INTX }, /* IDSEL 12 - HPT370 */ 36 [12] = { -1, INTA, INTX, INTX, INTX }, /* IDSEL 12 - HPT370 */
@@ -61,6 +63,22 @@ void __init board_setup(void)
61{ 63{
62 u32 pin_func; 64 u32 pin_func;
63 u32 sys_freqctrl, sys_clksrc; 65 u32 sys_freqctrl, sys_clksrc;
66 char *argptr;
67
68 argptr = prom_getcmdline();
69#ifdef CONFIG_SERIAL_8250_CONSOLE
70 argptr = strstr(argptr, "console=");
71 if (argptr == NULL) {
72 argptr = prom_getcmdline();
73 strcat(argptr, " console=ttyS0,115200");
74 }
75#endif
76
77#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000)
78 /* au1000 does not support vra, au1500 and au1100 do */
79 strcat(argptr, " au1000_audio=vra");
80 argptr = prom_getcmdline();
81#endif
64 82
65 sys_clksrc = sys_freqctrl = pin_func = 0; 83 sys_clksrc = sys_freqctrl = pin_func = 0;
66 /* Set AUX clock to 12 MHz * 8 = 96 MHz */ 84 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
diff --git a/arch/mips/alchemy/devboards/pb1550/board_setup.c b/arch/mips/alchemy/devboards/pb1550/board_setup.c
index 25a9190265db..f462652d762a 100644
--- a/arch/mips/alchemy/devboards/pb1550/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1550/board_setup.c
@@ -32,6 +32,8 @@
32#include <asm/mach-au1x00/au1000.h> 32#include <asm/mach-au1x00/au1000.h>
33#include <asm/mach-pb1x00/pb1550.h> 33#include <asm/mach-pb1x00/pb1550.h>
34 34
35#include <prom.h>
36
35 37
36char irq_tab_alchemy[][5] __initdata = { 38char irq_tab_alchemy[][5] __initdata = {
37 [12] = { -1, INTB, INTC, INTD, INTA }, /* IDSEL 12 - PCI slot 2 (left) */ 39 [12] = { -1, INTB, INTC, INTD, INTA }, /* IDSEL 12 - PCI slot 2 (left) */
@@ -61,6 +63,16 @@ void __init board_setup(void)
61{ 63{
62 u32 pin_func; 64 u32 pin_func;
63 65
66#ifdef CONFIG_SERIAL_8250_CONSOLE
67 char *argptr;
68 argptr = prom_getcmdline();
69 argptr = strstr(argptr, "console=");
70 if (argptr == NULL) {
71 argptr = prom_getcmdline();
72 strcat(argptr, " console=ttyS0,115200");
73 }
74#endif
75
64 /* 76 /*
65 * Enable PSC1 SYNC for AC'97. Normaly done in audio driver, 77 * Enable PSC1 SYNC for AC'97. Normaly done in audio driver,
66 * but it is board specific code, so put it here. 78 * but it is board specific code, so put it here.
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c
index 3f8079186cf2..8ed1ae12bc55 100644
--- a/arch/mips/alchemy/mtx-1/board_setup.c
+++ b/arch/mips/alchemy/mtx-1/board_setup.c
@@ -32,6 +32,8 @@
32 32
33#include <asm/mach-au1x00/au1000.h> 33#include <asm/mach-au1x00/au1000.h>
34 34
35#include <prom.h>
36
35extern int (*board_pci_idsel)(unsigned int devsel, int assert); 37extern int (*board_pci_idsel)(unsigned int devsel, int assert);
36int mtx1_pci_idsel(unsigned int devsel, int assert); 38int mtx1_pci_idsel(unsigned int devsel, int assert);
37 39
@@ -43,6 +45,16 @@ void board_reset(void)
43 45
44void __init board_setup(void) 46void __init board_setup(void)
45{ 47{
48#ifdef CONFIG_SERIAL_8250_CONSOLE
49 char *argptr;
50 argptr = prom_getcmdline();
51 argptr = strstr(argptr, "console=");
52 if (argptr == NULL) {
53 argptr = prom_getcmdline();
54 strcat(argptr, " console=ttyS0,115200");
55 }
56#endif
57
46#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 58#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
47 /* Enable USB power switch */ 59 /* Enable USB power switch */
48 au_writel(au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR); 60 au_writel(au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR);
diff --git a/arch/mips/alchemy/xxs1500/board_setup.c b/arch/mips/alchemy/xxs1500/board_setup.c
index 4c587acac5c3..a2634fabc50d 100644
--- a/arch/mips/alchemy/xxs1500/board_setup.c
+++ b/arch/mips/alchemy/xxs1500/board_setup.c
@@ -28,6 +28,8 @@
28 28
29#include <asm/mach-au1x00/au1000.h> 29#include <asm/mach-au1x00/au1000.h>
30 30
31#include <prom.h>
32
31void board_reset(void) 33void board_reset(void)
32{ 34{
33 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ 35 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
@@ -38,6 +40,16 @@ void __init board_setup(void)
38{ 40{
39 u32 pin_func; 41 u32 pin_func;
40 42
43#ifdef CONFIG_SERIAL_8250_CONSOLE
44 char *argptr;
45 argptr = prom_getcmdline();
46 argptr = strstr(argptr, "console=");
47 if (argptr == NULL) {
48 argptr = prom_getcmdline();
49 strcat(argptr, " console=ttyS0,115200");
50 }
51#endif
52
41 /* Set multiple use pins (UART3/GPIO) to UART (it's used as UART too) */ 53 /* Set multiple use pins (UART3/GPIO) to UART (it's used as UART too) */
42 pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3; 54 pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3;
43 pin_func |= SYS_PF_UR3; 55 pin_func |= SYS_PF_UR3;