iMX8MP Android 14: STMMAC Ethernet issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX8MP Android 14: STMMAC Ethernet issue

742 Views
santhanakumar
Contributor II

Hi Everyone,

I am trying to enable STMMAC ethernet (ETH1) support in Android 14 for iMX8MP platform.
"imx-android-14.0.0_1.0.0" is the Android SDK version.

By default STMMAC support is not enabled in kernel config and I modified arch/arm64/configs/imx8mp_gki.fragment file to include STMMAC support.

CONFIG_STMMAC_ETH=m
CONFIG_DWMAC_DWC_QOS_ETH=m

Then compiled kernel but fails during kernel module creation:

 

GEN Makefile
DESCEND bpf/resolve_btfids
INSTALL libsubcmd_headers
CALL /data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/scripts/checksyscalls.sh
CC [M] drivers/net/pcs/pcs-xpcs.o
CC [M] drivers/net/mdio/mdio-mux.o
CC [M] drivers/net/pcs/pcs-xpcs-nxp.o
CC [M] drivers/net/ethernet/stmicro/stmmac/stmmac_main.o
CC [M] drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.o
CC [M] drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.o
CC [M] drivers/net/ethernet/stmicro/stmmac/ring_mode.o
CC [M] drivers/net/ethernet/stmicro/stmmac/chain_mode.o
CHK kernel/kheaders_data.tar.xz
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac_lib.o
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.o
/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/drivers/net/mdio/mdio-mux.c:72:19: error: no member named 'read_c45' in 'struct mii_bus'
r = pb->mii_bus->read_c45(pb->mii_bus, phy_id, dev_addr, regnum);
~~~~~~~~~~~ ^
/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/drivers/net/mdio/mdio-mux.c:119:19: error: no member named 'write_c45' in 'struct mii_bus'
r = pb->mii_bus->write_c45(pb->mii_bus, phy_id, dev_addr, regnum, val);
~~~~~~~~~~~ ^
/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/drivers/net/mdio/mdio-mux.c:221:19: error: no member named 'read_c45' in 'struct mii_bus'
if (parent_bus->read_c45)
~~~~~~~~~~ ^
/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/drivers/net/mdio/mdio-mux.c:222:17: error: no member named 'read_c45' in 'struct mii_bus'
cb->mii_bus->read_c45 = mdio_mux_read_c45;
~~~~~~~~~~~ ^
/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/drivers/net/mdio/mdio-mux.c:223:19: error: no member named 'write_c45' in 'struct mii_bus'
if (parent_bus->write_c45)
~~~~~~~~~~ ^
/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/drivers/net/mdio/mdio-mux.c:224:17: error: no member named 'write_c45' in 'struct mii_bus'
cb->mii_bus->write_c45 = mdio_mux_write_c45;
~~~~~~~~~~~ ^
6 errors generated.
make[6]: *** [/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/scripts/Makefile.build:250: drivers/net/mdio/mdio-mux.o] Error 1
make[5]: *** [/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/scripts/Makefile.build:500: drivers/net/mdio] Error 2
make[5]: *** Waiting for unfinished jobs....

 


I traced kernel source and observed the functions are excluded by CONFIG_IMX_GKI_FIX option.

struct mii_bus {
struct module *owner;
const char *name;
char id[MII_BUS_ID_SIZE];
void *priv;
/** @read: Perform a read transfer on the bus */
int (*read)(struct mii_bus *bus, int addr, int regnum);
/** @write: Perform a write transfer on the bus */
int (*write)(struct mii_bus *bus, int addr, int regnum, u16 val);
#ifndef CONFIG_IMX_GKI_FIX
/** @read_c45: Perform a C45 read transfer on the bus */
int (*read_c45)(struct mii_bus *bus, int addr, int devnum, int regnum);
/** @write_c45: Perform a C45 write transfer on the bus */
int (*write_c45)(struct mii_bus *bus, int addr, int devnum,
int regnum, u16 val);
#endif

 

To fix the issue, disabled CONFIG_IMX_GKI_FIX in kernel config but this inturn creates underfined symbol error during kernel compilation.

 

ld.lld: error: undefined symbol: linkmode_support_c73
>>> referenced by phylink.c:1051 (/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/drivers/net/phy/phylink.c:1051)
>>> vmlinux.o:(phylink_create)
>>> referenced by phylink.c:718 (/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/drivers/net/phy/phylink.c:718)
>>> vmlinux.o:(phylink_validate_mac_and_pcs)
BTF .btf.vmlinux.bin.o
LD .tmp_vmlinux.kallsyms1
ld.lld: error: undefined symbol: linkmode_support_c73
>>> referenced by phylink.c:1051 (/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/drivers/net/phy/phylink.c:1051)
>>> vmlinux.o:(phylink_create)
>>> referenced by phylink.c:718 (/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/drivers/net/phy/phylink.c:718)
>>> vmlinux.o:(phylink_validate_mac_and_pcs)
make[3]: *** [/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/scripts/Makefile.vmlinux:34: vmlinux] Error 1
make[2]: *** [/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx/Makefile:1318: vmlinux] Error 2
make[2]: Leaving directory '/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/out/target/product/lec_imx8mp/obj/KERNEL_OBJ'
make[1]: *** [Makefile:256: __sub-make] Error 2
make[1]: Leaving directory '/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/vendor/nxp-opensource/kernel_imx'
make: *** [/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/device/nxp/common/build/kernel.mk:197: /data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build/out/target/product/lec_imx8mp/obj/KERNEL_OBJ/arch/arm64/boot/Image.lz4] Error 2
make: Leaving directory '/data/ssd/adlink/imx8mp/android/android-14/imx-android-14.0.0_1.0.0/android_build'

Please help to resolve this issue to enable STMMAC support in Android 14.
Thanks!

0 Kudos
Reply
2 Replies

669 Views
santhanakumar
Contributor II

Hi, 

As suggested, I enabled the necessary configs in android_addition_defconfig, disabled CONFIG_IMX_GKI_FIX  and able to compile the kernel and get rid of the errors.
But, disabling CONFIG_IMX_GKI_FIX option in kernel makes Android not-bootable.
I am not able to get any kernel logs after disabling CONFIG_IMX_GKI_FIX 
Whereas, enabling this config conflicts with STMMAC ETH1 port.

So, looks like CONFIG_IMX_GKI_FIX option should not be disabled in Android 14.
Please provide your suggestion on this issue and let me know why "read_c45" and "write_c45" phy related functions are disabled in latest Android?

0 Kudos
Reply

721 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

The Android we release will output No-GKI boot image as well(name:boot-imx.img), you can add configs to android_addition_defconfig and download boot-imx.img

.1. No-GKI kernel

Set these CONFIG to y, you don't need add the ko in SharedBoardConfig.mk

2.GKI kernel

add these configs to android_build/vendor/nxp-opensource/kernel_imx/arch/arm64/configs/imx8mp_gki.fragment

 

Regards

0 Kudos
Reply