diff options
Diffstat (limited to 'arch/mips/bcm47xx/setup.c')
-rw-r--r-- | arch/mips/bcm47xx/setup.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c index 17503a05938e..6d38948f0f1e 100644 --- a/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c | |||
@@ -105,11 +105,28 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus, | |||
105 | struct ssb_init_invariants *iv) | 105 | struct ssb_init_invariants *iv) |
106 | { | 106 | { |
107 | char buf[20]; | 107 | char buf[20]; |
108 | int len, err; | ||
108 | 109 | ||
109 | /* Fill boardinfo structure */ | 110 | /* Fill boardinfo structure */ |
110 | memset(&iv->boardinfo, 0 , sizeof(struct ssb_boardinfo)); | 111 | memset(&iv->boardinfo, 0 , sizeof(struct ssb_boardinfo)); |
111 | 112 | ||
112 | bcm47xx_fill_ssb_boardinfo(&iv->boardinfo, NULL); | 113 | len = bcm47xx_nvram_getenv("boardvendor", buf, sizeof(buf)); |
114 | if (len > 0) { | ||
115 | err = kstrtou16(strim(buf), 0, &iv->boardinfo.vendor); | ||
116 | if (err) | ||
117 | pr_warn("Couldn't parse nvram board vendor entry with value \"%s\"\n", | ||
118 | buf); | ||
119 | } | ||
120 | if (!iv->boardinfo.vendor) | ||
121 | iv->boardinfo.vendor = SSB_BOARDVENDOR_BCM; | ||
122 | |||
123 | len = bcm47xx_nvram_getenv("boardtype", buf, sizeof(buf)); | ||
124 | if (len > 0) { | ||
125 | err = kstrtou16(strim(buf), 0, &iv->boardinfo.type); | ||
126 | if (err) | ||
127 | pr_warn("Couldn't parse nvram board type entry with value \"%s\"\n", | ||
128 | buf); | ||
129 | } | ||
113 | 130 | ||
114 | memset(&iv->sprom, 0, sizeof(struct ssb_sprom)); | 131 | memset(&iv->sprom, 0, sizeof(struct ssb_sprom)); |
115 | bcm47xx_fill_sprom(&iv->sprom, NULL, false); | 132 | bcm47xx_fill_sprom(&iv->sprom, NULL, false); |