This is required by the realtek PHY driver for: * rtl8261n.bin (package "rtl8261n-firmware" or "rtl8261n-lp-firmware") - RTL8251L 5Gbps PHY - RTL8261BE 10Gbps PHY - RTL8261N 10Gbps PHY * rtl8264b.bin (package "rtl8264b-firmware") - RTL8254B 5Gbps PHY - RTL8264 10Gbps PHY - RTL8264B 10Gbps PHY These PHY chips need a sequence of register writes for initialization. These are provided as firmware files which are interpreted/applied by a new register patch engine. For the moment, the patch instructions in rtl8261-firmware and rtl8264b-firmware are the same as from the rtl8261n driver. This should make it possible to first evaluate the patch engine and driver development for switching over in adjusting the patch instructions. Signed-off-by: Balázs Triszka <info@balika011.hu> [sven: rebase, split, fix package version/release, use conf from rtl8261n driver] Signed-off-by: Sven Eckelmann <sven@narfation.org> [daniel: define VERSION matching source date for the resulting packages] Signed-off-by: Daniel Golle <daniel@makrotopia.org>
48 lines
1.3 KiB
Diff
48 lines
1.3 KiB
Diff
From: Sven Eckelmann <sven@narfation.org>
|
|
Date: Fri, 27 Mar 2026 00:17:23 +0100
|
|
Subject: Fix endianness when building on big endian systems
|
|
|
|
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
|
Forwarded: https://github.com/balika011/realtek_phy_firmware/pull/2
|
|
|
|
--- a/phy_patch.c
|
|
+++ b/phy_patch.c
|
|
@@ -3,6 +3,7 @@
|
|
#include <linux/errno.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
+#include <endian.h>
|
|
|
|
#include "phy_patch.h"
|
|
|
|
@@ -12,11 +13,11 @@ int phy_patch_op(rt_phy_patch_db_t *pPhy
|
|
|
|
op.patch_op = patch_op;
|
|
op.portmask = portmask;
|
|
- op.pagemmd = pagemmd;
|
|
- op.addr = addr;
|
|
+ op.pagemmd = htole16(pagemmd);
|
|
+ op.addr = htole16(addr);
|
|
op.msb = msb;
|
|
op.lsb = lsb;
|
|
- op.data = data;
|
|
+ op.data = htole16(data);
|
|
|
|
return pPhy_patchDb->fPatch_op(phydev, &op);
|
|
}
|
|
@@ -41,11 +42,11 @@ static int _phy_patch_process(struct phy
|
|
{
|
|
patch.patch_op = pPatch[i].patch_op;
|
|
patch.portmask = pPatch[i].portmask;
|
|
- patch.pagemmd = pPatch[i].pagemmd;
|
|
- patch.addr = pPatch[i].addr;
|
|
+ patch.pagemmd = htole16(pPatch[i].pagemmd);
|
|
+ patch.addr = htole16(pPatch[i].addr);
|
|
patch.msb = pPatch[i].msb;
|
|
patch.lsb = pPatch[i].lsb;
|
|
- patch.data = pPatch[i].data;
|
|
+ patch.data = htole16(pPatch[i].data);
|
|
|
|
ret = pPatchDb->fPatch_op(phydev, &patch);
|
|
if (ret < 0)
|