aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2021-09-20 19:23:58 -0700
committerPaul Spooren <mail@aparcar.org>2021-09-21 15:46:19 -1000
commitf9050f1c435bfc8593eeb689ebde5fd04ff41e66 (patch)
tree8147478ef46197bdc96220902d595358afa0d370 /target/linux
parent753f2f1eaa3d9e3ceed4fb7580b8de7997c4c07b (diff)
downloadupstream-f9050f1c435bfc8593eeb689ebde5fd04ff41e66.tar.gz
upstream-f9050f1c435bfc8593eeb689ebde5fd04ff41e66.tar.bz2
upstream-f9050f1c435bfc8593eeb689ebde5fd04ff41e66.zip
bcm63xx: remove memcpy from mac assignment
With GCC11, memcpy doesn't work here as it assumes a size of 0. Use ioremap to avoid it. Fixed parameter type to match board_get_mac_address. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/bcm63xx/patches-5.10/532-MIPS-BCM63XX-add-inventel-Livebox-support.patch11
-rw-r--r--target/linux/bcm63xx/patches-5.4/532-MIPS-BCM63XX-add-inventel-Livebox-support.patch11
2 files changed, 16 insertions, 6 deletions
diff --git a/target/linux/bcm63xx/patches-5.10/532-MIPS-BCM63XX-add-inventel-Livebox-support.patch b/target/linux/bcm63xx/patches-5.10/532-MIPS-BCM63XX-add-inventel-Livebox-support.patch
index 0035cee7e9..24b8f68807 100644
--- a/target/linux/bcm63xx/patches-5.10/532-MIPS-BCM63XX-add-inventel-Livebox-support.patch
+++ b/target/linux/bcm63xx/patches-5.10/532-MIPS-BCM63XX-add-inventel-Livebox-support.patch
@@ -58,7 +58,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support
#endif /* __BOARD_COMMON_H */
--- /dev/null
+++ b/arch/mips/bcm63xx/boards/board_livebox.c
-@@ -0,0 +1,153 @@
+@@ -0,0 +1,158 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
@@ -130,12 +130,17 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support
+/*
+ * register & return a new board mac address
+ */
-+static int livebox_get_mac_address(u8 *mac)
++static int livebox_get_mac_address(u8 mac[ETH_ALEN])
+{
+ u8 *p;
+ int count;
++ void __iomem *volatile mmio;
+
-+ memcpy(mac, (u8 *)0xBEBFF377, ETH_ALEN);
++ mmio = ioremap(0x1ebff377, 0x8);
++ if (!mmio)
++ return -EIO;
++ memcpy_fromio(mac, mmio, ETH_ALEN);
++ iounmap(mmio);
+
+ p = mac + ETH_ALEN - 1;
+ count = mac_addr_used;
diff --git a/target/linux/bcm63xx/patches-5.4/532-MIPS-BCM63XX-add-inventel-Livebox-support.patch b/target/linux/bcm63xx/patches-5.4/532-MIPS-BCM63XX-add-inventel-Livebox-support.patch
index 0035cee7e9..24b8f68807 100644
--- a/target/linux/bcm63xx/patches-5.4/532-MIPS-BCM63XX-add-inventel-Livebox-support.patch
+++ b/target/linux/bcm63xx/patches-5.4/532-MIPS-BCM63XX-add-inventel-Livebox-support.patch
@@ -58,7 +58,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support
#endif /* __BOARD_COMMON_H */
--- /dev/null
+++ b/arch/mips/bcm63xx/boards/board_livebox.c
-@@ -0,0 +1,153 @@
+@@ -0,0 +1,158 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
@@ -130,12 +130,17 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support
+/*
+ * register & return a new board mac address
+ */
-+static int livebox_get_mac_address(u8 *mac)
++static int livebox_get_mac_address(u8 mac[ETH_ALEN])
+{
+ u8 *p;
+ int count;
++ void __iomem *volatile mmio;
+
-+ memcpy(mac, (u8 *)0xBEBFF377, ETH_ALEN);
++ mmio = ioremap(0x1ebff377, 0x8);
++ if (!mmio)
++ return -EIO;
++ memcpy_fromio(mac, mmio, ETH_ALEN);
++ iounmap(mmio);
+
+ p = mac + ETH_ALEN - 1;
+ count = mac_addr_used;