Commit 25b31cb1 authored by Yoichi Yuasa's avatar Yoichi Yuasa Committed by Jeff Garzik

add new prom.h for AU1x00

Add new prom.h for AU1x00.
Signed-off-by: default avatarYoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Acked-by: default avatarRalf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 2de88923
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA. * 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -41,18 +40,16 @@ ...@@ -41,18 +40,16 @@
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
/* #define DEBUG_CMDLINE */ int prom_argc;
char **prom_argv;
extern int prom_argc; char **prom_envp;
extern char **prom_argv, **prom_envp;
char * __init_or_module prom_getcmdline(void) char * __init_or_module prom_getcmdline(void)
{ {
return &(arcs_cmdline[0]); return &(arcs_cmdline[0]);
} }
void prom_init_cmdline(void) void prom_init_cmdline(void)
{ {
char *cp; char *cp;
int actr; int actr;
...@@ -61,7 +58,7 @@ void prom_init_cmdline(void) ...@@ -61,7 +58,7 @@ void prom_init_cmdline(void)
cp = &(arcs_cmdline[0]); cp = &(arcs_cmdline[0]);
while(actr < prom_argc) { while(actr < prom_argc) {
strcpy(cp, prom_argv[actr]); strcpy(cp, prom_argv[actr]);
cp += strlen(prom_argv[actr]); cp += strlen(prom_argv[actr]);
*cp++ = ' '; *cp++ = ' ';
actr++; actr++;
...@@ -70,10 +67,8 @@ void prom_init_cmdline(void) ...@@ -70,10 +67,8 @@ void prom_init_cmdline(void)
--cp; --cp;
if (prom_argc > 1) if (prom_argc > 1)
*cp = '\0'; *cp = '\0';
} }
char *prom_getenv(char *envname) char *prom_getenv(char *envname)
{ {
/* /*
...@@ -95,17 +90,19 @@ char *prom_getenv(char *envname) ...@@ -95,17 +90,19 @@ char *prom_getenv(char *envname)
} }
env++; env++;
} }
return NULL; return NULL;
} }
static inline unsigned char str2hexnum(unsigned char c) static inline unsigned char str2hexnum(unsigned char c)
{ {
if(c >= '0' && c <= '9') if (c >= '0' && c <= '9')
return c - '0'; return c - '0';
if(c >= 'a' && c <= 'f') if (c >= 'a' && c <= 'f')
return c - 'a' + 10; return c - 'a' + 10;
if(c >= 'A' && c <= 'F') if (c >= 'A' && c <= 'F')
return c - 'A' + 10; return c - 'A' + 10;
return 0; /* foo */ return 0; /* foo */
} }
......
...@@ -40,10 +40,11 @@ ...@@ -40,10 +40,11 @@
#include <asm/mipsregs.h> #include <asm/mipsregs.h>
#include <asm/reboot.h> #include <asm/reboot.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/mach-au1x00/au1000.h>
#include <asm/time.h> #include <asm/time.h>
extern char * prom_getcmdline(void); #include <au1000.h>
#include <prom.h>
extern void __init board_setup(void); extern void __init board_setup(void);
extern void au1000_restart(char *); extern void au1000_restart(char *);
extern void au1000_halt(void); extern void au1000_halt(void);
......
...@@ -31,15 +31,13 @@ ...@@ -31,15 +31,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/kernel.h> #include <linux/kernel.h>
int prom_argc; #include <asm/addrspace.h>
char **prom_argv, **prom_envp; #include <asm/bootinfo.h>
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname); #include <prom.h>
const char *get_system_type(void) const char *get_system_type(void)
{ {
......
...@@ -34,13 +34,11 @@ ...@@ -34,13 +34,11 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/addrspace.h> #include <asm/addrspace.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
int prom_argc; #include <prom.h>
char **prom_argv, **prom_envp;
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname);
const char *get_system_type(void) const char *get_system_type(void)
{ {
......
...@@ -30,15 +30,13 @@ ...@@ -30,15 +30,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/kernel.h> #include <linux/kernel.h>
int prom_argc; #include <asm/addrspace.h>
char **prom_argv, **prom_envp; #include <asm/bootinfo.h>
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname); #include <prom.h>
const char *get_system_type(void) const char *get_system_type(void)
{ {
......
...@@ -31,15 +31,13 @@ ...@@ -31,15 +31,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/kernel.h> #include <linux/kernel.h>
int prom_argc; #include <asm/addrspace.h>
char **prom_argv, **prom_envp; #include <asm/bootinfo.h>
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname); #include <prom.h>
const char *get_system_type(void) const char *get_system_type(void)
{ {
......
...@@ -41,8 +41,10 @@ ...@@ -41,8 +41,10 @@
#include <asm/mipsregs.h> #include <asm/mipsregs.h>
#include <asm/reboot.h> #include <asm/reboot.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/mach-au1x00/au1000.h>
#include <asm/mach-au1x00/au1xxx_dbdma.h> #include <au1000.h>
#include <au1xxx_dbdma.h>
#include <prom.h>
#ifdef CONFIG_MIPS_PB1200 #ifdef CONFIG_MIPS_PB1200
#include <asm/mach-pb1x00/pb1200.h> #include <asm/mach-pb1x00/pb1200.h>
......
...@@ -31,15 +31,13 @@ ...@@ -31,15 +31,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/kernel.h> #include <linux/kernel.h>
int prom_argc; #include <asm/addrspace.h>
char **prom_argv, **prom_envp; #include <asm/bootinfo.h>
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname); #include <prom.h>
const char *get_system_type(void) const char *get_system_type(void)
{ {
......
...@@ -31,15 +31,13 @@ ...@@ -31,15 +31,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/kernel.h> #include <linux/kernel.h>
int prom_argc; #include <asm/addrspace.h>
char **prom_argv, **prom_envp; #include <asm/bootinfo.h>
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname); #include <prom.h>
const char *get_system_type(void) const char *get_system_type(void)
{ {
......
...@@ -31,15 +31,13 @@ ...@@ -31,15 +31,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/kernel.h> #include <linux/kernel.h>
int prom_argc; #include <asm/addrspace.h>
char **prom_argv, **prom_envp; #include <asm/bootinfo.h>
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname); #include <prom.h>
const char *get_system_type(void) const char *get_system_type(void)
{ {
......
...@@ -30,15 +30,13 @@ ...@@ -30,15 +30,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/kernel.h> #include <linux/kernel.h>
int prom_argc; #include <asm/addrspace.h>
char **prom_argv, **prom_envp; #include <asm/bootinfo.h>
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname); #include <prom.h>
const char *get_system_type(void) const char *get_system_type(void)
{ {
......
...@@ -54,13 +54,16 @@ ...@@ -54,13 +54,16 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/crc32.h> #include <linux/crc32.h>
#include <linux/phy.h> #include <linux/phy.h>
#include <asm/cpu.h>
#include <asm/mipsregs.h> #include <asm/mipsregs.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/mach-au1x00/au1000.h> #include <au1000.h>
#include <asm/cpu.h> #include <prom.h>
#include "au1000_eth.h" #include "au1000_eth.h"
#ifdef AU1000_ETH_DEBUG #ifdef AU1000_ETH_DEBUG
...@@ -96,9 +99,6 @@ static void mdio_write(struct net_device *, int, int, u16); ...@@ -96,9 +99,6 @@ static void mdio_write(struct net_device *, int, int, u16);
static void au1000_adjust_link(struct net_device *); static void au1000_adjust_link(struct net_device *);
static void enable_mac(struct net_device *, int); static void enable_mac(struct net_device *, int);
// externs
extern int prom_get_ethernet_addr(char *ethernet_addr);
/* /*
* Theory of operation * Theory of operation
* *
......
#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
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