From 3efb3b801bb1393897ff58b9af3753157f28f441 Mon Sep 17 00:00:00 2001 From: Anton Antonov Date: Tue, 30 May 2023 02:55:16 +0000 Subject: [PATCH] armvirt: 64: Add NXP i.MX 8M Mini/Nano/Quad/Plus EVK support Also includes Advantech RSB-3720 (iMX8 Plus) support. Signed-off-by: Anton Antonov Signed-off-by: Mathew McBride [Re-sort into kernel config, move network into modules] --- target/linux/armvirt/64/config-6.1 | 2 + target/linux/armvirt/base-files/etc/inittab | 3 + target/linux/armvirt/image/Makefile | 6 +- target/linux/armvirt/modules.mk | 72 +++++++++++++++++++++ 4 files changed, 80 insertions(+), 3 deletions(-) diff --git a/target/linux/armvirt/64/config-6.1 b/target/linux/armvirt/64/config-6.1 index 343a333542..b10c84b858 100644 --- a/target/linux/armvirt/64/config-6.1 +++ b/target/linux/armvirt/64/config-6.1 @@ -368,6 +368,8 @@ CONFIG_RTC_I2C_AND_SPI=y # CONFIG_SERIAL_8250_EXAR is not set CONFIG_SERIAL_8250_FSL=y CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_FSL_LPUART=y +CONFIG_SERIAL_FSL_LPUART_CONSOLE=y CONFIG_SERIAL_MVEBU_CONSOLE=y CONFIG_SERIAL_MVEBU_UART=y CONFIG_SERIAL_SAMSUNG=y diff --git a/target/linux/armvirt/base-files/etc/inittab b/target/linux/armvirt/base-files/etc/inittab index 837d7f32a4..83b1888c5c 100644 --- a/target/linux/armvirt/base-files/etc/inittab +++ b/target/linux/armvirt/base-files/etc/inittab @@ -3,3 +3,6 @@ ttyAMA0::askfirst:/usr/libexec/login.sh ttyS0::askfirst:/usr/libexec/login.sh hvc0::askfirst:/usr/libexec/login.sh +ttymxc0::askfirst:/usr/libexec/login.sh +ttymxc1::askfirst:/usr/libexec/login.sh +ttymxc2::askfirst:/usr/libexec/login.sh diff --git a/target/linux/armvirt/image/Makefile b/target/linux/armvirt/image/Makefile index ef27d6a728..7c4ba60b9b 100644 --- a/target/linux/armvirt/image/Makefile +++ b/target/linux/armvirt/image/Makefile @@ -108,9 +108,9 @@ define Device/generic DEVICE_PACKAGES += kmod-amazon-ena kmod-e1000e kmod-vmxnet3 kmod-rtc-rx8025 \ kmod-i2c-mux-pca954x kmod-gpio-pca953x partx-utils kmod-wdt-sp805 \ kmod-mvneta kmod-mvpp2 kmod-fsl-dpaa1-net kmod-fsl-dpaa2-net \ - kmod-fsl-enetc-net kmod-sfp \ - kmod-phy-aquantia kmod-phy-broadcom kmod-phy-marvell kmod-phy-marvell-10g \ - kmod-atlantic + kmod-fsl-enetc-net kmod-dwmac-imx kmod-fsl-fec kmod-sfp \ + kmod-phy-aquantia kmod-phy-broadcom kmod-phy-marvell \ + kmod-phy-marvell-10g kmod-atlantic endef TARGET_DEVICES += generic diff --git a/target/linux/armvirt/modules.mk b/target/linux/armvirt/modules.mk index 919685bf64..1ff523c7bd 100644 --- a/target/linux/armvirt/modules.mk +++ b/target/linux/armvirt/modules.mk @@ -25,6 +25,29 @@ endef $(eval $(call KernelPackage,fsl-pcs-lynx)) +define KernelPackage/pcs-xpcs + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Synopsis DesignWare PCS driver + DEPENDS:=@(TARGET_armvirt_64) +kmod-phylink + KCONFIG:=CONFIG_PCS_XPCS + FILES:=$(LINUX_DIR)/drivers/net/pcs/pcs_xpcs.ko + AUTOLOAD:=$(call AutoLoad,20,pcs_xpcs) +endef + +$(eval $(call KernelPackage,pcs-xpcs)) + +define KernelPackage/fsl-fec + SUBMENU:=$(NETWORK_DEVICES_MENU) + DEPENDS:=@(TARGET_armvirt_64) +kmod-libphy +kmod-of-mdio \ + +kmod-ptp +kmod-net-selftests + TITLE:=NXP (Freescale) FEC Ethernet controller (i.MX) + KCONFIG:=CONFIG_FEC + FILES:=$(LINUX_DIR)/drivers/net/ethernet/freescale/fec.ko + AUTOLOAD:=$(call AutoLoad,35,fec) +endef + +$(eval $(call KernelPackage,fsl-fec)) + define KernelPackage/fsl-xgmac-mdio SUBMENU=$(NETWORK_DEVICES_MENU) DEPENDS:=@(TARGET_armvirt_64) +kmod-libphy +kmod-of-mdio +kmod-acpi-mdio @@ -162,6 +185,55 @@ endef $(eval $(call KernelPackage,mvpp2)) +define KernelPackage/imx2-wdt + SUBMENU:=$(OTHER_MENU) + TITLE:=NXP (Freescale) i.MX2+ and Layerscape watchdog driver + KCONFIG:=CONFIG_IMX2_WDT + FILES=$(LINUX_DIR)/drivers/watchdog/imx2_wdt.ko + AUTOLOAD=$(call AutoLoad,60,imx2_wdt) +endef + +$(eval $(call KernelPackage,imx2-wdt)) + +define KernelPackage/imx7-ulp-wdt + SUBMENU:=$(OTHER_MENU) + TITLE:=NXP (Freescale) i.MX7ULP and later watchdog + KCONFIG:=CONFIG_IMX7ULP_WDT + FILES=$(LINUX_DIR)/drivers/watchdog/imx7ulp_wdt.ko + AUTOLOAD=$(call AutoLoad,60,imx7ulp_wdt) +endef + +$(eval $(call KernelPackage,imx7-ulp-wdt)) + +define KernelPackage/stmmac-core + SUBMENU=$(NETWORK_DEVICES_MENU) + TITLE:=Synopsis Ethernet Controller core (NXP,STMMicro,others) + DEPENDS:=@(TARGET_armvirt_64) +kmod-pcs-xpcs +kmod-ptp \ + +kmod-of-mdio + KCONFIG:=CONFIG_STMMAC_ETH \ + CONFIG_STMMAC_SELFTESTS=n \ + CONFIG_STMMAC_PLATFORM \ + CONFIG_CONFIG_DWMAC_DWC_QOS_ETH=n \ + CONFIG_DWMAC_GENERIC + FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac.ko \ + $(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac-platform.ko \ + $(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.ko + AUTOLOAD=$(call AutoLoad,40,stmmac stmmac-platform dwmac-generic) +endef + +$(eval $(call KernelPackage,stmmac-core)) + +define KernelPackage/dwmac-imx + SUBMENU=$(NETWORK_DEVICES_MENU) + TITLE:=NXP i.MX8 Ethernet controller + DEPENDS:=+kmod-stmmac-core + KCONFIG:=CONFIG_DWMAC_IMX8 + FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.ko + AUTOLOAD=$(call AutoLoad,45,dwmac-imx) +endef + +$(eval $(call KernelPackage,dwmac-imx)) + define KernelPackage/wdt-sp805 SUBMENU:=$(OTHER_MENU) TITLE:=ARM SP805 Watchdog