aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/txx9/generic/setup.c15
-rw-r--r--include/asm-mips/txx9/generic.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 33d8c9e3223d..005179c2af21 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -212,6 +212,21 @@ char * __init prom_getcmdline(void)
212 return &(arcs_cmdline[0]); 212 return &(arcs_cmdline[0]);
213} 213}
214 214
215const char *__init prom_getenv(const char *name)
216{
217 const s32 *str = (const s32 *)fw_arg2;
218
219 if (!str)
220 return NULL;
221 /* YAMON style ("name", "value" pairs) */
222 while (str[0] && str[1]) {
223 if (!strcmp((const char *)(unsigned long)str[0], name))
224 return (const char *)(unsigned long)str[1];
225 str += 2;
226 }
227 return NULL;
228}
229
215static void __noreturn txx9_machine_halt(void) 230static void __noreturn txx9_machine_halt(void)
216{ 231{
217 local_irq_disable(); 232 local_irq_disable();
diff --git a/include/asm-mips/txx9/generic.h b/include/asm-mips/txx9/generic.h
index c9eed7ea148c..0a225bf73496 100644
--- a/include/asm-mips/txx9/generic.h
+++ b/include/asm-mips/txx9/generic.h
@@ -43,6 +43,7 @@ struct txx9_board_vec {
43extern struct txx9_board_vec *txx9_board_vec; 43extern struct txx9_board_vec *txx9_board_vec;
44extern int (*txx9_irq_dispatch)(int pending); 44extern int (*txx9_irq_dispatch)(int pending);
45char *prom_getcmdline(void); 45char *prom_getcmdline(void);
46const char *prom_getenv(const char *name);
46void txx9_wdt_init(unsigned long base); 47void txx9_wdt_init(unsigned long base);
47void txx9_spi_init(int busid, unsigned long base, int irq); 48void txx9_spi_init(int busid, unsigned long base, int irq);
48void txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr); 49void txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr);