aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm63xx/patches-4.19/364-MIPS-BCM63XX-allow-board-files-to-provide-sprom-fixu.patch
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-02-08 20:33:30 +0100
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-02-14 14:10:51 +0100
commite7bfda2c243e66a75ff966ba04c28b1590b5d24c (patch)
tree069959b7e6a8cf31b0feb2857a63c7c4c0e3dcbf /target/linux/bcm63xx/patches-4.19/364-MIPS-BCM63XX-allow-board-files-to-provide-sprom-fixu.patch
parent8fe5ad5d3373cebed4fbc55a7b779721971ce427 (diff)
downloadupstream-e7bfda2c243e66a75ff966ba04c28b1590b5d24c.tar.gz
upstream-e7bfda2c243e66a75ff966ba04c28b1590b5d24c.tar.bz2
upstream-e7bfda2c243e66a75ff966ba04c28b1590b5d24c.zip
brcm63xx: rename target to bcm63xx
This change makes the names of Broadcom targets consistent by using the common notation based on SoC/CPU ID (which is used internally anyway), bcmXXXX instead of brcmXXXX. This is even used for target TITLE in make menuconfig already, only the short target name used brcm so far. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/bcm63xx/patches-4.19/364-MIPS-BCM63XX-allow-board-files-to-provide-sprom-fixu.patch')
-rw-r--r--target/linux/bcm63xx/patches-4.19/364-MIPS-BCM63XX-allow-board-files-to-provide-sprom-fixu.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/target/linux/bcm63xx/patches-4.19/364-MIPS-BCM63XX-allow-board-files-to-provide-sprom-fixu.patch b/target/linux/bcm63xx/patches-4.19/364-MIPS-BCM63XX-allow-board-files-to-provide-sprom-fixu.patch
new file mode 100644
index 0000000000..74c2846d5f
--- /dev/null
+++ b/target/linux/bcm63xx/patches-4.19/364-MIPS-BCM63XX-allow-board-files-to-provide-sprom-fixu.patch
@@ -0,0 +1,67 @@
+From 8575548b08e33c9ff4fd540abec09dd177e33682 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo@openwrt.org>
+Date: Thu, 31 Jul 2014 19:12:33 +0200
+Subject: [PATCH 09/10] MIPS: BCM63XX: allow board files to provide sprom
+ fixups
+
+Allow board_info files to supply fixups for the base sproms to adapt
+them to the actual used sprom contents in case they do not use the
+default ones.
+
+Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+---
+ arch/mips/bcm63xx/sprom.c | 14 +++++++++++++-
+ .../mips/include/asm/mach-bcm63xx/bcm63xx_fallback_sprom.h | 8 ++++++++
+ 2 files changed, 21 insertions(+), 1 deletion(-)
+
+--- a/arch/mips/bcm63xx/sprom.c
++++ b/arch/mips/bcm63xx/sprom.c
+@@ -883,6 +883,14 @@ static int sprom_extract(struct ssb_spro
+ return 0;
+ }
+
++void sprom_apply_fixups(u16 *sprom, struct sprom_fixup *fixups, int n)
++{
++ unsigned int i;
++
++ for (i = 0; i < n; i++)
++ sprom[fixups[i].offset] = fixups[i].value;
++}
++
+ static __initdata u16 template_sprom[220];
+ #endif
+
+@@ -961,8 +969,12 @@ int __init bcm63xx_register_fallback_spr
+ return -EINVAL;
+ }
+
+- if (size > 0)
++ if (size > 0) {
++ sprom_apply_fixups(template_sprom, data->board_fixups,
++ data->num_board_fixups);
++
+ sprom_extract(&bcm63xx_sprom, template_sprom, size);
++ }
+
+ memcpy(bcm63xx_sprom.il0mac, data->mac_addr, ETH_ALEN);
+ memcpy(bcm63xx_sprom.et0mac, data->mac_addr, ETH_ALEN);
+--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_fallback_sprom.h
++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_fallback_sprom.h
+@@ -21,9 +21,17 @@ enum sprom_type {
+ SPROM_BCM4331,
+ };
+
++struct sprom_fixup {
++ u16 offset;
++ u16 value;
++};
++
+ struct fallback_sprom_data {
+ u8 mac_addr[ETH_ALEN];
+ enum sprom_type type;
++
++ struct sprom_fixup *board_fixups;
++ unsigned int num_board_fixups;
+ };
+
+ int bcm63xx_register_fallback_sprom(struct fallback_sprom_data *data);