aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorYoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>2007-10-15 06:11:24 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-15 14:38:25 -0400
commit25b31cb118f399e9996ed7a3766b86c69a6bb07e (patch)
tree455e89553ee38d208dad1d50bb1ba9e8d9057001 /arch/mips
parent2de889235d0e820a6b256b834ee6a64e12fede08 (diff)
add new prom.h for AU1x00
Add new prom.h for AU1x00. Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/au1000/common/prom.c23
-rw-r--r--arch/mips/au1000/common/setup.c5
-rw-r--r--arch/mips/au1000/db1x00/init.c10
-rw-r--r--arch/mips/au1000/mtx-1/init.c6
-rw-r--r--arch/mips/au1000/pb1000/init.c10
-rw-r--r--arch/mips/au1000/pb1100/init.c10
-rw-r--r--arch/mips/au1000/pb1200/board_setup.c6
-rw-r--r--arch/mips/au1000/pb1200/init.c10
-rw-r--r--arch/mips/au1000/pb1500/init.c10
-rw-r--r--arch/mips/au1000/pb1550/init.c10
-rw-r--r--arch/mips/au1000/xxs1500/init.c10
11 files changed, 47 insertions, 63 deletions
diff --git a/arch/mips/au1000/common/prom.c b/arch/mips/au1000/common/prom.c
index 5d6ddf1ed7a6..90d70695aa60 100644
--- a/arch/mips/au1000/common/prom.c
+++ b/arch/mips/au1000/common/prom.c
@@ -33,7 +33,6 @@
33 * with this program; if not, write to the Free Software Foundation, Inc., 33 * with this program; if not, write to the Free Software Foundation, Inc.,
34 * 675 Mass Ave, Cambridge, MA 02139, USA. 34 * 675 Mass Ave, Cambridge, MA 02139, USA.
35 */ 35 */
36
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/kernel.h> 37#include <linux/kernel.h>
39#include <linux/init.h> 38#include <linux/init.h>
@@ -41,18 +40,16 @@
41 40
42#include <asm/bootinfo.h> 41#include <asm/bootinfo.h>
43 42
44/* #define DEBUG_CMDLINE */ 43int prom_argc;
45 44char **prom_argv;
46extern int prom_argc; 45char **prom_envp;
47extern char **prom_argv, **prom_envp;
48
49 46
50char * __init_or_module prom_getcmdline(void) 47char * __init_or_module prom_getcmdline(void)
51{ 48{
52 return &(arcs_cmdline[0]); 49 return &(arcs_cmdline[0]);
53} 50}
54 51
55void prom_init_cmdline(void) 52void prom_init_cmdline(void)
56{ 53{
57 char *cp; 54 char *cp;
58 int actr; 55 int actr;
@@ -61,7 +58,7 @@ void prom_init_cmdline(void)
61 58
62 cp = &(arcs_cmdline[0]); 59 cp = &(arcs_cmdline[0]);
63 while(actr < prom_argc) { 60 while(actr < prom_argc) {
64 strcpy(cp, prom_argv[actr]); 61 strcpy(cp, prom_argv[actr]);
65 cp += strlen(prom_argv[actr]); 62 cp += strlen(prom_argv[actr]);
66 *cp++ = ' '; 63 *cp++ = ' ';
67 actr++; 64 actr++;
@@ -70,10 +67,8 @@ void prom_init_cmdline(void)
70 --cp; 67 --cp;
71 if (prom_argc > 1) 68 if (prom_argc > 1)
72 *cp = '\0'; 69 *cp = '\0';
73
74} 70}
75 71
76
77char *prom_getenv(char *envname) 72char *prom_getenv(char *envname)
78{ 73{
79 /* 74 /*
@@ -95,17 +90,19 @@ char *prom_getenv(char *envname)
95 } 90 }
96 env++; 91 env++;
97 } 92 }
93
98 return NULL; 94 return NULL;
99} 95}
100 96
101static inline unsigned char str2hexnum(unsigned char c) 97static inline unsigned char str2hexnum(unsigned char c)
102{ 98{
103 if(c >= '0' && c <= '9') 99 if (c >= '0' && c <= '9')
104 return c - '0'; 100 return c - '0';
105 if(c >= 'a' && c <= 'f') 101 if (c >= 'a' && c <= 'f')
106 return c - 'a' + 10; 102 return c - 'a' + 10;
107 if(c >= 'A' && c <= 'F') 103 if (c >= 'A' && c <= 'F')
108 return c - 'A' + 10; 104 return c - 'A' + 10;
105
109 return 0; /* foo */ 106 return 0; /* foo */
110} 107}
111 108
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index b212c0726125..a90d425d4651 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -40,10 +40,11 @@
40#include <asm/mipsregs.h> 40#include <asm/mipsregs.h>
41#include <asm/reboot.h> 41#include <asm/reboot.h>
42#include <asm/pgtable.h> 42#include <asm/pgtable.h>
43#include <asm/mach-au1x00/au1000.h>
44#include <asm/time.h> 43#include <asm/time.h>
45 44
46extern char * prom_getcmdline(void); 45#include <au1000.h>
46#include <prom.h>
47
47extern void __init board_setup(void); 48extern void __init board_setup(void);
48extern void au1000_restart(char *); 49extern void au1000_restart(char *);
49extern void au1000_halt(void); 50extern void au1000_halt(void);
diff --git a/arch/mips/au1000/db1x00/init.c b/arch/mips/au1000/db1x00/init.c
index 4d7bcfc8cf73..43298fd9459c 100644
--- a/arch/mips/au1000/db1x00/init.c
+++ b/arch/mips/au1000/db1x00/init.c
@@ -31,15 +31,13 @@
31#include <linux/mm.h> 31#include <linux/mm.h>
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/bootmem.h> 33#include <linux/bootmem.h>
34#include <asm/addrspace.h>
35#include <asm/bootinfo.h>
36#include <linux/string.h> 34#include <linux/string.h>
37#include <linux/kernel.h> 35#include <linux/kernel.h>
38 36
39int prom_argc; 37#include <asm/addrspace.h>
40char **prom_argv, **prom_envp; 38#include <asm/bootinfo.h>
41extern void __init prom_init_cmdline(void); 39
42extern char *prom_getenv(char *envname); 40#include <prom.h>
43 41
44const char *get_system_type(void) 42const char *get_system_type(void)
45{ 43{
diff --git a/arch/mips/au1000/mtx-1/init.c b/arch/mips/au1000/mtx-1/init.c
index 2aa7b2ed6a8c..cdeae3212a2d 100644
--- a/arch/mips/au1000/mtx-1/init.c
+++ b/arch/mips/au1000/mtx-1/init.c
@@ -34,13 +34,11 @@
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/mm.h> 35#include <linux/mm.h>
36#include <linux/bootmem.h> 36#include <linux/bootmem.h>
37
37#include <asm/addrspace.h> 38#include <asm/addrspace.h>
38#include <asm/bootinfo.h> 39#include <asm/bootinfo.h>
39 40
40int prom_argc; 41#include <prom.h>
41char **prom_argv, **prom_envp;
42extern void __init prom_init_cmdline(void);
43extern char *prom_getenv(char *envname);
44 42
45const char *get_system_type(void) 43const char *get_system_type(void)
46{ 44{
diff --git a/arch/mips/au1000/pb1000/init.c b/arch/mips/au1000/pb1000/init.c
index 4535f7208e18..ddccaf6997d0 100644
--- a/arch/mips/au1000/pb1000/init.c
+++ b/arch/mips/au1000/pb1000/init.c
@@ -30,15 +30,13 @@
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/bootmem.h> 32#include <linux/bootmem.h>
33#include <asm/addrspace.h>
34#include <asm/bootinfo.h>
35#include <linux/string.h> 33#include <linux/string.h>
36#include <linux/kernel.h> 34#include <linux/kernel.h>
37 35
38int prom_argc; 36#include <asm/addrspace.h>
39char **prom_argv, **prom_envp; 37#include <asm/bootinfo.h>
40extern void __init prom_init_cmdline(void); 38
41extern char *prom_getenv(char *envname); 39#include <prom.h>
42 40
43const char *get_system_type(void) 41const char *get_system_type(void)
44{ 42{
diff --git a/arch/mips/au1000/pb1100/init.c b/arch/mips/au1000/pb1100/init.c
index 7ba6852de7cd..c93fd39b4aba 100644
--- a/arch/mips/au1000/pb1100/init.c
+++ b/arch/mips/au1000/pb1100/init.c
@@ -31,15 +31,13 @@
31#include <linux/mm.h> 31#include <linux/mm.h>
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/bootmem.h> 33#include <linux/bootmem.h>
34#include <asm/addrspace.h>
35#include <asm/bootinfo.h>
36#include <linux/string.h> 34#include <linux/string.h>
37#include <linux/kernel.h> 35#include <linux/kernel.h>
38 36
39int prom_argc; 37#include <asm/addrspace.h>
40char **prom_argv, **prom_envp; 38#include <asm/bootinfo.h>
41extern void __init prom_init_cmdline(void); 39
42extern char *prom_getenv(char *envname); 40#include <prom.h>
43 41
44const char *get_system_type(void) 42const char *get_system_type(void)
45{ 43{
diff --git a/arch/mips/au1000/pb1200/board_setup.c b/arch/mips/au1000/pb1200/board_setup.c
index 2122515f79d7..5dbc9868f598 100644
--- a/arch/mips/au1000/pb1200/board_setup.c
+++ b/arch/mips/au1000/pb1200/board_setup.c
@@ -41,8 +41,10 @@
41#include <asm/mipsregs.h> 41#include <asm/mipsregs.h>
42#include <asm/reboot.h> 42#include <asm/reboot.h>
43#include <asm/pgtable.h> 43#include <asm/pgtable.h>
44#include <asm/mach-au1x00/au1000.h> 44
45#include <asm/mach-au1x00/au1xxx_dbdma.h> 45#include <au1000.h>
46#include <au1xxx_dbdma.h>
47#include <prom.h>
46 48
47#ifdef CONFIG_MIPS_PB1200 49#ifdef CONFIG_MIPS_PB1200
48#include <asm/mach-pb1x00/pb1200.h> 50#include <asm/mach-pb1x00/pb1200.h>
diff --git a/arch/mips/au1000/pb1200/init.c b/arch/mips/au1000/pb1200/init.c
index 5a70029d5388..c251570749ee 100644
--- a/arch/mips/au1000/pb1200/init.c
+++ b/arch/mips/au1000/pb1200/init.c
@@ -31,15 +31,13 @@
31#include <linux/mm.h> 31#include <linux/mm.h>
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/bootmem.h> 33#include <linux/bootmem.h>
34#include <asm/addrspace.h>
35#include <asm/bootinfo.h>
36#include <linux/string.h> 34#include <linux/string.h>
37#include <linux/kernel.h> 35#include <linux/kernel.h>
38 36
39int prom_argc; 37#include <asm/addrspace.h>
40char **prom_argv, **prom_envp; 38#include <asm/bootinfo.h>
41extern void __init prom_init_cmdline(void); 39
42extern char *prom_getenv(char *envname); 40#include <prom.h>
43 41
44const char *get_system_type(void) 42const char *get_system_type(void)
45{ 43{
diff --git a/arch/mips/au1000/pb1500/init.c b/arch/mips/au1000/pb1500/init.c
index e58a9d6c5021..507d4b204161 100644
--- a/arch/mips/au1000/pb1500/init.c
+++ b/arch/mips/au1000/pb1500/init.c
@@ -31,15 +31,13 @@
31#include <linux/mm.h> 31#include <linux/mm.h>
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/bootmem.h> 33#include <linux/bootmem.h>
34#include <asm/addrspace.h>
35#include <asm/bootinfo.h>
36#include <linux/string.h> 34#include <linux/string.h>
37#include <linux/kernel.h> 35#include <linux/kernel.h>
38 36
39int prom_argc; 37#include <asm/addrspace.h>
40char **prom_argv, **prom_envp; 38#include <asm/bootinfo.h>
41extern void __init prom_init_cmdline(void); 39
42extern char *prom_getenv(char *envname); 40#include <prom.h>
43 41
44const char *get_system_type(void) 42const char *get_system_type(void)
45{ 43{
diff --git a/arch/mips/au1000/pb1550/init.c b/arch/mips/au1000/pb1550/init.c
index fad53bf5aad1..b03eee601e36 100644
--- a/arch/mips/au1000/pb1550/init.c
+++ b/arch/mips/au1000/pb1550/init.c
@@ -31,15 +31,13 @@
31#include <linux/mm.h> 31#include <linux/mm.h>
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/bootmem.h> 33#include <linux/bootmem.h>
34#include <asm/addrspace.h>
35#include <asm/bootinfo.h>
36#include <linux/string.h> 34#include <linux/string.h>
37#include <linux/kernel.h> 35#include <linux/kernel.h>
38 36
39int prom_argc; 37#include <asm/addrspace.h>
40char **prom_argv, **prom_envp; 38#include <asm/bootinfo.h>
41extern void __init prom_init_cmdline(void); 39
42extern char *prom_getenv(char *envname); 40#include <prom.h>
43 41
44const char *get_system_type(void) 42const char *get_system_type(void)
45{ 43{
diff --git a/arch/mips/au1000/xxs1500/init.c b/arch/mips/au1000/xxs1500/init.c
index 9f839c36f69e..6532939f377a 100644
--- a/arch/mips/au1000/xxs1500/init.c
+++ b/arch/mips/au1000/xxs1500/init.c
@@ -30,15 +30,13 @@
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/bootmem.h> 32#include <linux/bootmem.h>
33#include <asm/addrspace.h>
34#include <asm/bootinfo.h>
35#include <linux/string.h> 33#include <linux/string.h>
36#include <linux/kernel.h> 34#include <linux/kernel.h>
37 35
38int prom_argc; 36#include <asm/addrspace.h>
39char **prom_argv, **prom_envp; 37#include <asm/bootinfo.h>
40extern void __init prom_init_cmdline(void); 38
41extern char *prom_getenv(char *envname); 39#include <prom.h>
42 40
43const char *get_system_type(void) 41const char *get_system_type(void)
44{ 42{