From 25b31cb118f399e9996ed7a3766b86c69a6bb07e Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Mon, 15 Oct 2007 19:11:24 +0900 Subject: [PATCH] add new prom.h for AU1x00 Add new prom.h for AU1x00. Signed-off-by: Yoichi Yuasa Acked-by: Ralf Baechle Signed-off-by: Jeff Garzik --- arch/mips/au1000/common/prom.c | 23 ++++++++++------------- arch/mips/au1000/common/setup.c | 5 +++-- arch/mips/au1000/db1x00/init.c | 10 ++++------ arch/mips/au1000/mtx-1/init.c | 6 ++---- arch/mips/au1000/pb1000/init.c | 10 ++++------ arch/mips/au1000/pb1100/init.c | 10 ++++------ arch/mips/au1000/pb1200/board_setup.c | 6 ++++-- arch/mips/au1000/pb1200/init.c | 10 ++++------ arch/mips/au1000/pb1500/init.c | 10 ++++------ arch/mips/au1000/pb1550/init.c | 10 ++++------ arch/mips/au1000/xxs1500/init.c | 10 ++++------ drivers/net/au1000_eth.c | 10 +++++----- include/asm-mips/mach-au1x00/prom.h | 13 +++++++++++++ 13 files changed, 65 insertions(+), 68 deletions(-) create mode 100644 include/asm-mips/mach-au1x00/prom.h 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 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ - #include #include #include @@ -41,18 +40,16 @@ #include -/* #define DEBUG_CMDLINE */ - -extern int prom_argc; -extern char **prom_argv, **prom_envp; - +int prom_argc; +char **prom_argv; +char **prom_envp; char * __init_or_module prom_getcmdline(void) { return &(arcs_cmdline[0]); } -void prom_init_cmdline(void) +void prom_init_cmdline(void) { char *cp; int actr; @@ -61,7 +58,7 @@ void prom_init_cmdline(void) cp = &(arcs_cmdline[0]); while(actr < prom_argc) { - strcpy(cp, prom_argv[actr]); + strcpy(cp, prom_argv[actr]); cp += strlen(prom_argv[actr]); *cp++ = ' '; actr++; @@ -70,10 +67,8 @@ void prom_init_cmdline(void) --cp; if (prom_argc > 1) *cp = '\0'; - } - char *prom_getenv(char *envname) { /* @@ -95,17 +90,19 @@ char *prom_getenv(char *envname) } env++; } + return NULL; } static inline unsigned char str2hexnum(unsigned char c) { - if(c >= '0' && c <= '9') + if (c >= '0' && c <= '9') return c - '0'; - if(c >= 'a' && c <= 'f') + if (c >= 'a' && c <= 'f') return c - 'a' + 10; - if(c >= 'A' && c <= 'F') + if (c >= 'A' && c <= 'F') return c - 'A' + 10; + return 0; /* foo */ } 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 @@ #include #include #include -#include #include -extern char * prom_getcmdline(void); +#include +#include + extern void __init board_setup(void); extern void au1000_restart(char *); extern 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 @@ #include #include #include -#include -#include #include #include -int prom_argc; -char **prom_argv, **prom_envp; -extern void __init prom_init_cmdline(void); -extern char *prom_getenv(char *envname); +#include +#include + +#include const char *get_system_type(void) { 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 @@ #include #include #include + #include #include -int prom_argc; -char **prom_argv, **prom_envp; -extern void __init prom_init_cmdline(void); -extern char *prom_getenv(char *envname); +#include const char *get_system_type(void) { 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 @@ #include #include #include -#include -#include #include #include -int prom_argc; -char **prom_argv, **prom_envp; -extern void __init prom_init_cmdline(void); -extern char *prom_getenv(char *envname); +#include +#include + +#include const char *get_system_type(void) { 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 @@ #include #include #include -#include -#include #include #include -int prom_argc; -char **prom_argv, **prom_envp; -extern void __init prom_init_cmdline(void); -extern char *prom_getenv(char *envname); +#include +#include + +#include const char *get_system_type(void) { 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 @@ #include #include #include -#include -#include + +#include +#include +#include #ifdef CONFIG_MIPS_PB1200 #include 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 @@ #include #include #include -#include -#include #include #include -int prom_argc; -char **prom_argv, **prom_envp; -extern void __init prom_init_cmdline(void); -extern char *prom_getenv(char *envname); +#include +#include + +#include const char *get_system_type(void) { 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 @@ #include #include #include -#include -#include #include #include -int prom_argc; -char **prom_argv, **prom_envp; -extern void __init prom_init_cmdline(void); -extern char *prom_getenv(char *envname); +#include +#include + +#include const char *get_system_type(void) { 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 @@ #include #include #include -#include -#include #include #include -int prom_argc; -char **prom_argv, **prom_envp; -extern void __init prom_init_cmdline(void); -extern char *prom_getenv(char *envname); +#include +#include + +#include const char *get_system_type(void) { 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 @@ #include #include #include -#include -#include #include #include -int prom_argc; -char **prom_argv, **prom_envp; -extern void __init prom_init_cmdline(void); -extern char *prom_getenv(char *envname); +#include +#include + +#include const char *get_system_type(void) { diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 297e2d08d267..185f98e3964c 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c @@ -54,13 +54,16 @@ #include #include #include + +#include #include #include #include #include -#include -#include +#include +#include + #include "au1000_eth.h" #ifdef AU1000_ETH_DEBUG @@ -96,9 +99,6 @@ static void mdio_write(struct net_device *, int, int, u16); static void au1000_adjust_link(struct net_device *); static void enable_mac(struct net_device *, int); -// externs -extern int prom_get_ethernet_addr(char *ethernet_addr); - /* * Theory of operation * diff --git a/include/asm-mips/mach-au1x00/prom.h b/include/asm-mips/mach-au1x00/prom.h new file mode 100644 index 000000000000..e38715577c51 --- /dev/null +++ b/include/asm-mips/mach-au1x00/prom.h @@ -0,0 +1,13 @@ +#ifndef __AU1X00_PROM_H +#define __AU1X00_PROM_H + +extern int prom_argc; +extern char **prom_argv; +extern char **prom_envp; + +extern void prom_init_cmdline(void); +extern char *prom_getcmdline(void); +extern char *prom_getenv(char *envname); +extern int prom_get_ethernet_addr(char *ethernet_addr); + +#endif -- GitLab