diff options
author | John Crispin <john@openwrt.org> | 2013-04-03 09:59:10 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2013-04-03 09:59:10 +0000 |
commit | 46f141637c81ad0508cced2496678461d638cb39 (patch) | |
tree | 0339883c1042298f9df733f2ec4ffc61de8a5be1 /target/linux/ramips/patches-3.8/0004-MIPS-ralink-adds-prom-and-cmdline-code.patch | |
parent | 4f86ea43ca3ae3b670da308166f9a91f36e69f3a (diff) | |
download | upstream-46f141637c81ad0508cced2496678461d638cb39.tar.gz upstream-46f141637c81ad0508cced2496678461d638cb39.tar.bz2 upstream-46f141637c81ad0508cced2496678461d638cb39.zip |
add patches for v3.8
Signed-off-by: John Crsipin <blogic@openwrt.org>
SVN-Revision: 36163
Diffstat (limited to 'target/linux/ramips/patches-3.8/0004-MIPS-ralink-adds-prom-and-cmdline-code.patch')
-rw-r--r-- | target/linux/ramips/patches-3.8/0004-MIPS-ralink-adds-prom-and-cmdline-code.patch | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-3.8/0004-MIPS-ralink-adds-prom-and-cmdline-code.patch b/target/linux/ramips/patches-3.8/0004-MIPS-ralink-adds-prom-and-cmdline-code.patch new file mode 100644 index 0000000000..5ff48d57e9 --- /dev/null +++ b/target/linux/ramips/patches-3.8/0004-MIPS-ralink-adds-prom-and-cmdline-code.patch @@ -0,0 +1,93 @@ +From 7e47cefa69c8ed2c889522ce29fcce73ce8cf08e Mon Sep 17 00:00:00 2001 +From: John Crispin <blogic@openwrt.org> +Date: Sun, 20 Jan 2013 22:01:05 +0100 +Subject: [PATCH 04/14] MIPS: ralink: adds prom and cmdline code + +Add minimal code to handle commandlines. + +Signed-off-by: John Crispin <blogic@openwrt.org> +Signed-off-by: Gabor Juhos <juhosg@openwrt.org> +Patchwork: http://patchwork.linux-mips.org/patch/4892/ +--- + arch/mips/ralink/prom.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 69 insertions(+) + create mode 100644 arch/mips/ralink/prom.c + +diff --git a/arch/mips/ralink/prom.c b/arch/mips/ralink/prom.c +new file mode 100644 +index 0000000..9c64f02 +--- /dev/null ++++ b/arch/mips/ralink/prom.c +@@ -0,0 +1,69 @@ ++/* ++ * 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) 2009 Gabor Juhos <juhosg@openwrt.org> ++ * Copyright (C) 2010 Joonas Lahtinen <joonas.lahtinen@gmail.com> ++ * Copyright (C) 2013 John Crispin <blogic@openwrt.org> ++ */ ++ ++#include <linux/string.h> ++#include <linux/of_fdt.h> ++#include <linux/of_platform.h> ++ ++#include <asm/bootinfo.h> ++#include <asm/addrspace.h> ++ ++#include "common.h" ++ ++struct ralink_soc_info soc_info; ++ ++const char *get_system_type(void) ++{ ++ return soc_info.sys_type; ++} ++ ++static __init void prom_init_cmdline(int argc, char **argv) ++{ ++ int i; ++ ++ pr_debug("prom: fw_arg0=%08x fw_arg1=%08x fw_arg2=%08x fw_arg3=%08x\n", ++ (unsigned int)fw_arg0, (unsigned int)fw_arg1, ++ (unsigned int)fw_arg2, (unsigned int)fw_arg3); ++ ++ argc = fw_arg0; ++ argv = (char **) KSEG1ADDR(fw_arg1); ++ ++ if (!argv) { ++ pr_debug("argv=%p is invalid, skipping\n", ++ argv); ++ return; ++ } ++ ++ for (i = 0; i < argc; i++) { ++ char *p = (char *) KSEG1ADDR(argv[i]); ++ ++ if (CPHYSADDR(p) && *p) { ++ pr_debug("argv[%d]: %s\n", i, p); ++ strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline)); ++ strlcat(arcs_cmdline, p, sizeof(arcs_cmdline)); ++ } ++ } ++} ++ ++void __init prom_init(void) ++{ ++ int argc; ++ char **argv; ++ ++ prom_soc_init(&soc_info); ++ ++ pr_info("SoC Type: %s\n", get_system_type()); ++ ++ prom_init_cmdline(argc, argv); ++} ++ ++void __init prom_free_prom_memory(void) ++{ ++} +-- +1.7.10.4 + |