summaryrefslogtreecommitdiff
path: root/target/linux/brcm47xx/patches-3.3/400-arch-bcm47xx.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-05-03 20:18:41 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2012-05-03 20:18:41 +0000
commit22b2e3fbb9cc78d671e44f788a062031c97ffc6f (patch)
tree6395b1a6324793714e3d8d770a71cdc9362da4e1 /target/linux/brcm47xx/patches-3.3/400-arch-bcm47xx.patch
parent8e9d914343967982a1a48e80000bbb09161e636c (diff)
downloadmtk-20170518-22b2e3fbb9cc78d671e44f788a062031c97ffc6f.zip
mtk-20170518-22b2e3fbb9cc78d671e44f788a062031c97ffc6f.tar.gz
mtk-20170518-22b2e3fbb9cc78d671e44f788a062031c97ffc6f.tar.bz2
brcm47xx: add support for kernel 3.3
SVN-Revision: 31573
Diffstat (limited to 'target/linux/brcm47xx/patches-3.3/400-arch-bcm47xx.patch')
-rw-r--r--target/linux/brcm47xx/patches-3.3/400-arch-bcm47xx.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.3/400-arch-bcm47xx.patch b/target/linux/brcm47xx/patches-3.3/400-arch-bcm47xx.patch
new file mode 100644
index 0000000..0933fb6
--- /dev/null
+++ b/target/linux/brcm47xx/patches-3.3/400-arch-bcm47xx.patch
@@ -0,0 +1,56 @@
+--- a/arch/mips/bcm47xx/nvram.c
++++ b/arch/mips/bcm47xx/nvram.c
+@@ -269,3 +269,30 @@ int nvram_getenv(char *name, char *val,
+ return NVRAM_ERR_ENVNOTFOUND;
+ }
+ EXPORT_SYMBOL(nvram_getenv);
++
++char *nvram_get(const char *name)
++{
++ char *var, *value, *end, *eq;
++
++ if (!name)
++ return NULL;
++
++ if (!nvram_buf[0])
++ early_nvram_init();
++
++ /* Look for name=value and return value */
++ var = &nvram_buf[sizeof(struct nvram_header)];
++ end = nvram_buf + sizeof(nvram_buf) - 2;
++ end[0] = end[1] = '\0';
++ for (; *var; var = value + strlen(value) + 1) {
++ eq = strchr(var, '=');
++ if (!eq)
++ break;
++ value = eq + 1;
++ if ((eq - var) == strlen(name) && strncmp(var, name, (eq - var)) == 0)
++ return value;
++ }
++
++ return NULL;
++}
++EXPORT_SYMBOL(nvram_get);
+--- a/arch/mips/bcm47xx/setup.c
++++ b/arch/mips/bcm47xx/setup.c
+@@ -384,3 +384,20 @@ static int __init bcm47xx_register_flash
+ return -1;
+ }
+ fs_initcall(bcm47xx_register_flash);
++
++static int __init bcm47xx_register_gpiodev(void)
++{
++ static struct resource res = {
++ .start = 0xFFFFFFFF,
++ };
++ struct platform_device *pdev;
++
++ pdev = platform_device_register_simple("GPIODEV", 0, &res, 1);
++ if (!pdev) {
++ printk(KERN_ERR "bcm47xx: GPIODEV init failed\n");
++ return -ENODEV;
++ }
++
++ return 0;
++}
++device_initcall(bcm47xx_register_gpiodev);