|
|
|
[PATCH 06/33] MIPS: ath79: Cleanup firmware support for the ath79 platform. | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
From: "Steven J. Hill" <sjhill@xxxxxxxx>
Signed-off-by: Steven J. Hill <sjhill@xxxxxxxx>
---
arch/mips/ath79/prom.c | 38 +++++++++++++++++---------------------
1 file changed, 17 insertions(+), 21 deletions(-)
diff --git a/arch/mips/ath79/prom.c b/arch/mips/ath79/prom.c
index e9cbd7c..c891f6b 100644
--- a/arch/mips/ath79/prom.c
+++ b/arch/mips/ath79/prom.c
@@ -1,20 +1,17 @@
/*
- * Atheros AR71XX/AR724X/AR913X specific prom routines
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
*
- * Copyright (C) 2008-2010 Gabor Juhos <juhosg@xxxxxxxxxxx>
- * Copyright (C) 2008 Imre Kaloz <kaloz@xxxxxxxxxxx>
+ * Atheros AR71XX/AR724X/AR913X specific prom routines
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
+ * Copyright (C) 2008-2010 Gabor Juhos <juhosg@xxxxxxxxxxx>
+ * Copyright (C) 2008 Imre Kaloz <kaloz@xxxxxxxxxxx>
*/
-
-#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
-#include <linux/string.h>
-#include <asm/bootinfo.h>
+#include <asm/fw/fw.h>
#include <asm/addrspace.h>
#include "common.h"
@@ -32,25 +29,24 @@ static inline int is_valid_ram_addr(void *addr)
return 0;
}
-static __init void ath79_prom_init_cmdline(int argc, char **argv)
+void __init prom_init(void)
{
int i;
- if (!is_valid_ram_addr(argv))
+ fw_argc = (fw_arg0 & 0x0000ffff);
+ _fw_argv = (int *)fw_arg1;
+ _fw_envp = (int *)fw_arg2;
+
+ if (!is_valid_ram_addr((void *)_fw_argv))
return;
- for (i = 0; i < argc; i++)
- if (is_valid_ram_addr(argv[i])) {
- strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
- strlcat(arcs_cmdline, argv[i], sizeof(arcs_cmdline));
+ for (i = 1; i < fw_argc; i++)
+ if (is_valid_ram_addr(fw_argv(i))) {
+ strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
+ strlcat(arcs_cmdline, fw_argv(i), COMMAND_LINE_SIZE);
}
}
-void __init prom_init(void)
-{
- ath79_prom_init_cmdline(fw_arg0, (char **)fw_arg1);
-}
-
void __init prom_free_prom_memory(void)
{
/* We do not have to prom memory to free */
--
1.7.10.3
[Linux MIPS Home] [LKML Archive] [Linux ARM] [Linux] [Git] [Photo] [Yosemite News] [Linux SCSI] [Linux Hams]
![]() |
![]() |