1 From 1cece9f7aca1f0c193edce201f77a87008c5a405 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Tue, 29 Jul 2014 21:58:38 +0200
4 Subject: [PATCH 04/10] MIPS: BCM63XX: allow different types of sprom
6 Different chips require different sprom contents, so prepare for
7 supplying the appropriate sprom type.
9 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
11 arch/mips/bcm63xx/sprom.c | 13 ++++++++++++-
12 arch/mips/include/asm/mach-bcm63xx/bcm63xx_fallback_sprom.h | 5 +++++
13 2 files changed, 17 insertions(+), 1 deletion(-)
15 --- a/arch/mips/bcm63xx/sprom.c
16 +++ b/arch/mips/bcm63xx/sprom.c
20 #ifdef CONFIG_SSB_PCIHOST
21 -static struct ssb_sprom bcm63xx_sprom = {
22 +static __initconst struct ssb_sprom bcm63xx_default_sprom = {
26 @@ -43,6 +43,8 @@ static struct ssb_sprom bcm63xx_sprom =
27 .boardflags_hi = 0x0000,
30 +static struct ssb_sprom bcm63xx_sprom;
32 int bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out)
34 if (bus->bustype == SSB_BUSTYPE_PCI) {
35 @@ -60,6 +62,15 @@ int __init bcm63xx_register_fallback_spr
38 #ifdef CONFIG_SSB_PCIHOST
39 + switch (data->type) {
41 + memcpy(&bcm63xx_sprom, &bcm63xx_default_sprom,
42 + sizeof(bcm63xx_sprom));
48 memcpy(bcm63xx_sprom.il0mac, data->mac_addr, ETH_ALEN);
49 memcpy(bcm63xx_sprom.et0mac, data->mac_addr, ETH_ALEN);
50 memcpy(bcm63xx_sprom.et1mac, data->mac_addr, ETH_ALEN);
51 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_fallback_sprom.h
52 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_fallback_sprom.h
55 #include <linux/if_ether.h>
58 + SPROM_DEFAULT, /* default fallback sprom */
61 struct fallback_sprom_data {
62 u8 mac_addr[ETH_ALEN];
63 + enum sprom_type type;
66 int bcm63xx_register_fallback_sprom(struct fallback_sprom_data *data);