aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorBirger Koblitz <git@birger-koblitz.de>2020-10-15 12:31:05 +0200
committerJohn Crispin <john@phrozen.org>2020-10-15 13:26:57 +0200
commit076fdd9fec874581dc3059c34ca72be6aab3d81d (patch)
treef22932beaef5134851e4028dba92947a684dae57 /target/linux
parent953435795d176a95b58ca78ee5fb54490c8b40c5 (diff)
downloadupstream-076fdd9fec874581dc3059c34ca72be6aab3d81d.tar.gz
upstream-076fdd9fec874581dc3059c34ca72be6aab3d81d.tar.bz2
upstream-076fdd9fec874581dc3059c34ca72be6aab3d81d.zip
rtl838x: Fix firmware handling
Fix wrong magic number verification for FW files. Correct handling of external RTL8218B firmware PHY name in firmware. Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/rtl838x/files-5.4/drivers/net/dsa/rtl838x_phy.c6
-rw-r--r--target/linux/rtl838x/files/firmware/rtl838x_phy/rtl838x_8218b.fwbin1168 -> 1168 bytes
2 files changed, 3 insertions, 3 deletions
diff --git a/target/linux/rtl838x/files-5.4/drivers/net/dsa/rtl838x_phy.c b/target/linux/rtl838x/files-5.4/drivers/net/dsa/rtl838x_phy.c
index aa6ac62c27..e5dfdcaa07 100644
--- a/target/linux/rtl838x/files-5.4/drivers/net/dsa/rtl838x_phy.c
+++ b/target/linux/rtl838x/files-5.4/drivers/net/dsa/rtl838x_phy.c
@@ -251,8 +251,8 @@ rtl838x_request_fw(struct phy_device *phydev, const struct firmware *fw,
h = (struct fw_header *) fw->data;
pr_info("Firmware loaded. Size %d, magic: %08x\n", fw->size, h->magic);
- if (h->phy != 0x83800000) {
- pr_err("Wrong firmware file: PHY mismatch.\n");
+ if (h->magic != 0x83808380) {
+ pr_err("Wrong firmware file: MAGIC mismatch.\n");
goto out;
}
@@ -415,7 +415,7 @@ static int rtl8380_configure_ext_rtl8218b(struct phy_device *phydev)
if (!h)
return -1;
- if (h->phy != 0x8218b00) {
+ if (h->phy != 0x8218b000) {
phydev_err(phydev, "Wrong firmware file: PHY mismatch.\n");
return -1;
}
diff --git a/target/linux/rtl838x/files/firmware/rtl838x_phy/rtl838x_8218b.fw b/target/linux/rtl838x/files/firmware/rtl838x_phy/rtl838x_8218b.fw
index a907849fb9..66325ef242 100644
--- a/target/linux/rtl838x/files/firmware/rtl838x_phy/rtl838x_8218b.fw
+++ b/target/linux/rtl838x/files/firmware/rtl838x_phy/rtl838x_8218b.fw
Binary files differ