1 From 8575548b08e33c9ff4fd540abec09dd177e33682 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Thu, 31 Jul 2014 19:12:33 +0200
4 Subject: [PATCH 09/10] MIPS: BCM63XX: allow board files to provide sprom
7 Allow board_info files to supply fixups for the base sproms to adapt
8 them to the actual used sprom contents in case they do not use the
11 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
13 arch/mips/bcm63xx/sprom.c | 14 +++++++++++++-
14 .../mips/include/asm/mach-bcm63xx/bcm63xx_fallback_sprom.h | 8 ++++++++
15 2 files changed, 21 insertions(+), 1 deletion(-)
17 --- a/arch/mips/bcm63xx/sprom.c
18 +++ b/arch/mips/bcm63xx/sprom.c
19 @@ -883,6 +883,14 @@ static int sprom_extract(struct ssb_spro
23 +void sprom_apply_fixups(u16 *sprom, struct sprom_fixup *fixups, int n)
27 + for (i = 0; i < n; i++)
28 + sprom[fixups[i].offset] = fixups[i].value;
31 static __initdata u16 template_sprom[220];
34 @@ -961,8 +969,12 @@ int __init bcm63xx_register_fallback_spr
40 + sprom_apply_fixups(template_sprom, data->board_fixups,
41 + data->num_board_fixups);
43 sprom_extract(&bcm63xx_sprom, template_sprom, size);
46 memcpy(bcm63xx_sprom.et0mac, data->mac_addr, ETH_ALEN);
47 memcpy(bcm63xx_sprom.et0mac, data->mac_addr, ETH_ALEN);
48 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_fallback_sprom.h
49 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_fallback_sprom.h
50 @@ -21,9 +21,17 @@ enum sprom_type {
59 struct fallback_sprom_data {
60 u8 mac_addr[ETH_ALEN];
63 + struct sprom_fixup *board_fixups;
64 + unsigned int num_board_fixups;
67 int bcm63xx_register_fallback_sprom(struct fallback_sprom_data *data);