aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@openwrt.org>2013-01-03 01:53:30 +0000
committerHauke Mehrtens <hauke@openwrt.org>2013-01-03 01:53:30 +0000
commit880dc8381a3948b0c49610a3e36add1a91e7f06b (patch)
tree80c467f23a4f364b9be69716075cd3b186161e62 /package
parent979291e9c5a2acd6c9942bbb8b846f07ec0d6050 (diff)
downloadmaster-187ad058-880dc8381a3948b0c49610a3e36add1a91e7f06b.tar.gz
master-187ad058-880dc8381a3948b0c49610a3e36add1a91e7f06b.tar.bz2
master-187ad058-880dc8381a3948b0c49610a3e36add1a91e7f06b.zip
brcm47xx: add a new version of the nvram rewrite patch
This is the version like it was send for mainline inclusion. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34988 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/switch/src/switch-adm.c12
-rw-r--r--package/switch/src/switch-robo.c4
-rw-r--r--package/system/rtc-rv5c386a/src/rtc.c10
3 files changed, 13 insertions, 13 deletions
diff --git a/package/switch/src/switch-adm.c b/package/switch/src/switch-adm.c
index 9a6d32b1ef..f21470ed53 100644
--- a/package/switch/src/switch-adm.c
+++ b/package/switch/src/switch-adm.c
@@ -38,7 +38,7 @@
#include "gpio.h"
#ifdef CONFIG_BCM47XX
-#include <nvram.h>
+#include <bcm47xx_nvram.h>
#endif
#define DRIVER_NAME "adm6996"
@@ -89,7 +89,7 @@ static unsigned int get_gpiopin(char *pin_name, unsigned int def_pin)
/* Go thru all possibilities till a match in pin name */
for (pin = 0; pin < 16; pin ++) {
sprintf(name, "gpio%d", pin);
- if (nvram_getenv(name, val, sizeof(val)) >= 0) {
+ if (bcm47xx_nvram_getenv(name, val, sizeof(val)) >= 0) {
if (!strcmp(val, pin_name))
return pin;
}
@@ -497,10 +497,10 @@ static int detect_adm(void)
int boardflags = 0;
int boardnum = 0;
- if (nvram_getenv("boardflags", buf, sizeof(buf)) >= 0)
+ if (bcm47xx_nvram_getenv("boardflags", buf, sizeof(buf)) >= 0)
boardflags = simple_strtoul(buf, NULL, 0);
- if (nvram_getenv("boardnum", buf, sizeof(buf)) >= 0)
+ if (bcm47xx_nvram_getenv("boardnum", buf, sizeof(buf)) >= 0)
boardnum = simple_strtoul(buf, NULL, 0);
if ((boardnum == 44) && (boardflags == 0x0388)) { /* Trendware TEW-411BRP+ */
@@ -519,9 +519,9 @@ static int detect_adm(void)
eedi = get_gpiopin("adm_eedi", 4);
eerc = get_gpiopin("adm_rc", 0);
- } else if (nvram_getenv("boardtype", buf, sizeof(buf)) >= 0) {
+ } else if (bcm47xx_nvram_getenv("boardtype", buf, sizeof(buf)) >= 0) {
if (strcmp(buf, "bcm94710dev") == 0) {
- if (nvram_getenv("boardnum", buf, sizeof(buf)) >= 0) {
+ if (bcm47xx_nvram_getenv("boardnum", buf, sizeof(buf)) >= 0) {
if (strncmp(buf, "42", 2) == 0) {
/* WRT54G v1.1 hack */
eecs = 2;
diff --git a/package/switch/src/switch-robo.c b/package/switch/src/switch-robo.c
index f1160c8894..3751653a6d 100644
--- a/package/switch/src/switch-robo.c
+++ b/package/switch/src/switch-robo.c
@@ -35,7 +35,7 @@
#include "etc53xx.h"
#ifdef CONFIG_BCM47XX
-#include <nvram.h>
+#include <bcm47xx_nvram.h>
#endif
#define DRIVER_NAME "bcm53xx"
@@ -236,7 +236,7 @@ static int robo_switch_enable(void)
#ifdef CONFIG_BCM47XX
/* WAN port LED, except for Netgear WGT634U */
- if (nvram_getenv("nvram_type", buf, sizeof(buf)) >= 0) {
+ if (bcm47xx_nvram_getenv("nvram_type", buf, sizeof(buf)) >= 0) {
if (strcmp(buf, "cfe") != 0)
robo_write16(ROBO_CTRL_PAGE, 0x16, 0x1F);
}
diff --git a/package/system/rtc-rv5c386a/src/rtc.c b/package/system/rtc-rv5c386a/src/rtc.c
index 25e5331409..2fc6f093cf 100644
--- a/package/system/rtc-rv5c386a/src/rtc.c
+++ b/package/system/rtc-rv5c386a/src/rtc.c
@@ -62,7 +62,7 @@
#endif
#include <bcm47xx.h>
-#include <nvram.h>
+#include <bcm47xx_nvram.h>
#define RTC_IS_OPEN 0x01 /* Means /dev/rtc is in use. */
@@ -530,7 +530,7 @@ static void platform_detect(void)
int et0phyaddr, et1phyaddr;
/* Based on "model_no". */
- if (nvram_getenv("model_no", buf, sizeof(buf)) >= 0) {
+ if (bcm47xx_nvram_getenv("model_no", buf, sizeof(buf)) >= 0) {
if (startswith(buf, "WL700")) { /* WL700* */
sda_index = 2;
scl_index = 5;
@@ -538,12 +538,12 @@ static void platform_detect(void)
}
}
- if (nvram_getenv("et0phyaddr", buf, sizeof(buf)) >= 0 )
+ if (bcm47xx_nvram_getenv("et0phyaddr", buf, sizeof(buf)) >= 0 )
et0phyaddr = simple_strtoul(buf, NULL, 0);
- if (nvram_getenv("et1phyaddr", buf, sizeof(buf)) >= 0 )
+ if (bcm47xx_nvram_getenv("et1phyaddr", buf, sizeof(buf)) >= 0 )
et1phyaddr = simple_strtoul(buf, NULL, 0);
- if (nvram_getenv("hardware_version", buf, sizeof(buf)) >= 0) {
+ if (bcm47xx_nvram_getenv("hardware_version", buf, sizeof(buf)) >= 0) {
/* Either WL-300g or WL-HDD, do more extensive checks */
if (startswith(buf, "WL300-") && et0phyaddr == 0 && et1phyaddr == 1) {
sda_index = 4;