Skip to content

Commit

Permalink
add new prom.h for AU1x00
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yoichi Yuasa authored and Jeff Garzik committed Oct 15, 2007
1 parent 2de8892 commit 25b31cb
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 68 deletions.
23 changes: 10 additions & 13 deletions arch/mips/au1000/common/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,23 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/string.h>

#include <asm/bootinfo.h>

/* #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;
Expand All @@ -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++;
Expand All @@ -70,10 +67,8 @@ void prom_init_cmdline(void)
--cp;
if (prom_argc > 1)
*cp = '\0';

}


char *prom_getenv(char *envname)
{
/*
Expand All @@ -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 */
}

Expand Down
5 changes: 3 additions & 2 deletions arch/mips/au1000/common/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@
#include <asm/mipsregs.h>
#include <asm/reboot.h>
#include <asm/pgtable.h>
#include <asm/mach-au1x00/au1000.h>
#include <asm/time.h>

extern char * prom_getcmdline(void);
#include <au1000.h>
#include <prom.h>

extern void __init board_setup(void);
extern void au1000_restart(char *);
extern void au1000_halt(void);
Expand Down
10 changes: 4 additions & 6 deletions arch/mips/au1000/db1x00/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h>
#include <linux/kernel.h>

int prom_argc;
char **prom_argv, **prom_envp;
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname);
#include <asm/addrspace.h>
#include <asm/bootinfo.h>

#include <prom.h>

const char *get_system_type(void)
{
Expand Down
6 changes: 2 additions & 4 deletions arch/mips/au1000/mtx-1/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/bootmem.h>

#include <asm/addrspace.h>
#include <asm/bootinfo.h>

int prom_argc;
char **prom_argv, **prom_envp;
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname);
#include <prom.h>

const char *get_system_type(void)
{
Expand Down
10 changes: 4 additions & 6 deletions arch/mips/au1000/pb1000/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h>
#include <linux/kernel.h>

int prom_argc;
char **prom_argv, **prom_envp;
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname);
#include <asm/addrspace.h>
#include <asm/bootinfo.h>

#include <prom.h>

const char *get_system_type(void)
{
Expand Down
10 changes: 4 additions & 6 deletions arch/mips/au1000/pb1100/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h>
#include <linux/kernel.h>

int prom_argc;
char **prom_argv, **prom_envp;
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname);
#include <asm/addrspace.h>
#include <asm/bootinfo.h>

#include <prom.h>

const char *get_system_type(void)
{
Expand Down
6 changes: 4 additions & 2 deletions arch/mips/au1000/pb1200/board_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@
#include <asm/mipsregs.h>
#include <asm/reboot.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
#include <asm/mach-pb1x00/pb1200.h>
Expand Down
10 changes: 4 additions & 6 deletions arch/mips/au1000/pb1200/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h>
#include <linux/kernel.h>

int prom_argc;
char **prom_argv, **prom_envp;
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname);
#include <asm/addrspace.h>
#include <asm/bootinfo.h>

#include <prom.h>

const char *get_system_type(void)
{
Expand Down
10 changes: 4 additions & 6 deletions arch/mips/au1000/pb1500/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h>
#include <linux/kernel.h>

int prom_argc;
char **prom_argv, **prom_envp;
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname);
#include <asm/addrspace.h>
#include <asm/bootinfo.h>

#include <prom.h>

const char *get_system_type(void)
{
Expand Down
10 changes: 4 additions & 6 deletions arch/mips/au1000/pb1550/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h>
#include <linux/kernel.h>

int prom_argc;
char **prom_argv, **prom_envp;
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname);
#include <asm/addrspace.h>
#include <asm/bootinfo.h>

#include <prom.h>

const char *get_system_type(void)
{
Expand Down
10 changes: 4 additions & 6 deletions arch/mips/au1000/xxs1500/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/bootmem.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
#include <linux/string.h>
#include <linux/kernel.h>

int prom_argc;
char **prom_argv, **prom_envp;
extern void __init prom_init_cmdline(void);
extern char *prom_getenv(char *envname);
#include <asm/addrspace.h>
#include <asm/bootinfo.h>

#include <prom.h>

const char *get_system_type(void)
{
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/au1000_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@
#include <linux/delay.h>
#include <linux/crc32.h>
#include <linux/phy.h>

#include <asm/cpu.h>
#include <asm/mipsregs.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/processor.h>

#include <asm/mach-au1x00/au1000.h>
#include <asm/cpu.h>
#include <au1000.h>
#include <prom.h>

#include "au1000_eth.h"

#ifdef AU1000_ETH_DEBUG
Expand Down Expand Up @@ -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
*
Expand Down
13 changes: 13 additions & 0 deletions include/asm-mips/mach-au1x00/prom.h
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 25b31cb

Please sign in to comment.