From: Anton Antonov Date: Thu, 22 Dec 2022 12:00:12 +0000 (+0000) Subject: armvirt: 64: Add NXP i.MX 8M Mini/Nano/Quad/Plus EVK support X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=3eb25435af354b84eaac35de9bae851857ff27ce;p=openwrt%2Fstaging%2Fjow.git 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] (23.05/5.15 version of commit 3efb3b801bb1393897ff58b9af3753157f28f441) --- diff --git a/target/linux/armvirt/64/config-5.15 b/target/linux/armvirt/64/config-5.15 index bcae79c8fb..e77d17d07f 100644 --- a/target/linux/armvirt/64/config-5.15 +++ b/target/linux/armvirt/64/config-5.15 @@ -8,6 +8,7 @@ CONFIG_ARCH_MMAP_RND_BITS_MAX=24 CONFIG_ARCH_MMAP_RND_BITS_MIN=18 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 CONFIG_ARCH_MVEBU=y +CONFIG_ARCH_MXC=y CONFIG_ARCH_PROC_KCORE_TEXT=y CONFIG_ARCH_ROCKCHIP=y CONFIG_ARCH_STACKWALK=y @@ -60,6 +61,7 @@ CONFIG_ARM_SMMU=y CONFIG_ARM_SMMU_V3=y # CONFIG_ARM_SMMU_V3_PMU is not set # CONFIG_ARM_SMMU_V3_SVA is not set +CONFIG_AT803X_PHY=y CONFIG_ATOMIC64_SELFTEST=y CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y # CONFIG_AXI_DMAC is not set @@ -67,6 +69,10 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BLK_PM=y CONFIG_CAVIUM_TX2_ERRATUM_219=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y +CONFIG_CLK_IMX8MM=y +CONFIG_CLK_IMX8MN=y +CONFIG_CLK_IMX8MP=y +CONFIG_CLK_IMX8MQ=y CONFIG_CLK_INTEL_SOCFPGA=y CONFIG_CLK_INTEL_SOCFPGA64=y CONFIG_CLK_LS1028A_PLLDIG=y @@ -139,6 +145,7 @@ CONFIG_DRM=y CONFIG_DRM_BOCHS=y CONFIG_DRM_BRIDGE=y CONFIG_DRM_GEM_SHMEM_HELPER=y +# CONFIG_DRM_IMX_DCSS is not set CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_PANEL=y CONFIG_DRM_PANEL_BRIDGE=y @@ -159,6 +166,7 @@ CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_CMDLINE=y CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_MX3 is not set # CONFIG_FB_XILINX is not set CONFIG_FRAME_POINTER=y # CONFIG_FSL_DPAA is not set @@ -174,6 +182,7 @@ CONFIG_GENERIC_FIND_FIRST_BIT=y CONFIG_GPIO_GENERIC=y CONFIG_GPIO_GENERIC_PLATFORM=y CONFIG_GPIO_MPC8XXX=y +CONFIG_GPIO_MXC=y CONFIG_GPIO_ROCKCHIP=y CONFIG_GPIO_THUNDERX=y CONFIG_GPIO_XLP=y @@ -194,14 +203,29 @@ CONFIG_I2C_ALTERA=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_HIX5HD2 is not set CONFIG_I2C_IMX=y +CONFIG_I2C_IMX_LPI2C=y CONFIG_I2C_SYNQUACER=y CONFIG_I2C_THUNDERX=y # CONFIG_I2C_XLP9XX is not set CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -# CONFIG_IMX2_WDT is not set +CONFIG_IMX2_WDT=y +CONFIG_IMX7ULP_WDT=y +# CONFIG_IMX8MM_THERMAL is not set +# CONFIG_IMX_DMA is not set +# CONFIG_IMX_DSP is not set +CONFIG_IMX_IRQSTEER=y +CONFIG_IMX_MBOX=y +# CONFIG_IMX_SCU is not set +CONFIG_IMX_SDMA=y +# CONFIG_IMX_WEIM is not set # CONFIG_INPUT_HISI_POWERKEY is not set # CONFIG_INTEL_STRATIX10_RSU is not set # CONFIG_INTEL_STRATIX10_SERVICE is not set +CONFIG_INTERCONNECT=y +CONFIG_INTERCONNECT_IMX=y +CONFIG_INTERCONNECT_IMX8MM=y +CONFIG_INTERCONNECT_IMX8MN=y +CONFIG_INTERCONNECT_IMX8MQ=y # CONFIG_IOMMU_DEBUGFS is not set # CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set CONFIG_IOMMU_DEFAULT_DMA_STRICT=y @@ -228,6 +252,7 @@ CONFIG_MFD_SYSCON=y CONFIG_MFD_VEXPRESS_SYSREG=y CONFIG_MMC=y CONFIG_MMC_ARMMMCI=y +CONFIG_MMC_BLOCK=y CONFIG_MMC_CAVIUM_THUNDERX=y CONFIG_MMC_DW=y # CONFIG_MMC_DW_BLUEFIELD is not set @@ -237,15 +262,20 @@ CONFIG_MMC_DW=y # CONFIG_MMC_DW_PCI is not set CONFIG_MMC_DW_PLTFM=y CONFIG_MMC_DW_ROCKCHIP=y +# CONFIG_MMC_MXC is not set CONFIG_MMC_RICOH_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ACPI=y +CONFIG_MMC_SDHCI_CADENCE=y +CONFIG_MMC_SDHCI_ESDHC_IMX=y CONFIG_MMC_SDHCI_OF_ESDHC=y CONFIG_MMC_SDHCI_PCI=y CONFIG_MMC_SDHCI_PLTFM=y CONFIG_MMC_SUNXI=y CONFIG_MODULES_USE_ELF_RELA=y # CONFIG_MV_XOR is not set +# CONFIG_MX3_IPU is not set +CONFIG_MXS_DMA=y CONFIG_NEED_SG_DMA_LENGTH=y # CONFIG_NET_VENDOR_ALLWINNER is not set CONFIG_NO_HZ=y @@ -253,9 +283,13 @@ CONFIG_NO_HZ_COMMON=y CONFIG_NO_HZ_IDLE=y CONFIG_NR_CPUS=64 CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=y +# CONFIG_NVMEM_IMX_IIM is not set +CONFIG_NVMEM_IMX_OCOTP=y +CONFIG_NVMEM_IMX_OCOTP_SCU=y # CONFIG_NVMEM_LAYERSCAPE_SFP is not set CONFIG_NVMEM_ROCKCHIP_EFUSE=y # CONFIG_NVMEM_ROCKCHIP_OTP is not set +# CONFIG_NVMEM_SNVS_LPGPR is not set # CONFIG_NVMEM_SUNXI_SID is not set # CONFIG_NVMEM_ZYNQMP is not set CONFIG_PCC=y @@ -268,7 +302,9 @@ CONFIG_PCIE_ROCKCHIP_HOST=y CONFIG_PCIE_XILINX_CPM=y CONFIG_PCIE_XILINX_NWL=y CONFIG_PCI_AARDVARK=y +CONFIG_PCI_IMX6=y CONFIG_PCI_LAYERSCAPE=y +CONFIG_PHY_FSL_IMX8MQ_USB=y CONFIG_PHY_HI3660_USB=y CONFIG_PHY_HI3670_USB=y CONFIG_PHY_HI6220_USB=y @@ -293,6 +329,11 @@ CONFIG_PHY_SUN50I_USB3=y # CONFIG_PHY_SUN6I_MIPI_DPHY is not set CONFIG_PHY_SUN9I_USB=y # CONFIG_PHY_XILINX_ZYNQMP is not set +CONFIG_PINCTRL_IMX8MM=y +CONFIG_PINCTRL_IMX8MN=y +CONFIG_PINCTRL_IMX8MP=y +CONFIG_PINCTRL_IMX8MQ=y +CONFIG_PINCTRL_IMX8ULP=y CONFIG_PINCTRL_ROCKCHIP=y CONFIG_PINCTRL_SUN4I_A10=y CONFIG_PINCTRL_SUN50I_A100=y @@ -331,8 +372,13 @@ CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y -CONFIG_REGULATOR_AXP20X=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_ANATOP=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_REGULATOR_HI655X=y +CONFIG_REGULATOR_PFUZE100=y +# CONFIG_REGULATOR_VEXPRESS is not set +CONFIG_RESET_IMX7=y CONFIG_ROCKCHIP_IODOMAIN=y CONFIG_ROCKCHIP_IOMMU=y # CONFIG_ROCKCHIP_MBOX is not set @@ -341,10 +387,16 @@ CONFIG_ROCKCHIP_PM_DOMAINS=y # CONFIG_ROCKCHIP_THERMAL is not set CONFIG_RODATA_FULL_DEFAULT_ENABLED=y # CONFIG_RTC_DRV_FSL_FTM_ALARM is not set +# CONFIG_RTC_DRV_IMXDI is not set CONFIG_RTC_DRV_MV=y +# CONFIG_RTC_DRV_MXC is not set +# CONFIG_RTC_DRV_MXC_V2 is not set CONFIG_RTC_I2C_AND_SPI=y # CONFIG_SERIAL_8250_EXAR is not set CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_IMX=y +CONFIG_SERIAL_IMX_CONSOLE=y +CONFIG_SERIAL_IMX_EARLYCON=y CONFIG_SERIAL_MVEBU_CONSOLE=y CONFIG_SERIAL_MVEBU_UART=y CONFIG_SERIAL_SAMSUNG=y @@ -356,15 +408,18 @@ CONFIG_SMC91X=y # CONFIG_SND_SUN8I_CODEC is not set # CONFIG_SND_SUN8I_CODEC_ANALOG is not set # CONFIG_SNI_NETSEC is not set +CONFIG_SOC_IMX8M=y CONFIG_SPARSEMEM=y CONFIG_SPARSEMEM_EXTREME=y CONFIG_SPARSEMEM_VMEMMAP=y CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y CONFIG_SPI_ARMADA_3700=y +# CONFIG_SPI_FSL_LPSPI is not set # CONFIG_SPI_FSL_QUADSPI is not set # CONFIG_SPI_HISI_KUNPENG is not set # CONFIG_SPI_HISI_SFC is not set # CONFIG_SPI_HISI_SFC_V3XX is not set +# CONFIG_SPI_IMX is not set # CONFIG_SPI_ROCKCHIP_SFC is not set # CONFIG_SPI_SUN4I is not set # CONFIG_SPI_SUN6I is not set @@ -394,9 +449,32 @@ CONFIG_SYSCTL_EXCEPTION_TRACE=y # CONFIG_TCG_TIS_SYNQUACER is not set CONFIG_THREAD_INFO_IN_TASK=y # CONFIG_TURRIS_MOX_RWTM is not set +CONFIG_TYPEC=y +# CONFIG_TYPEC_DP_ALTMODE is not set +# CONFIG_TYPEC_FUSB302 is not set +# CONFIG_TYPEC_HD3SS3220 is not set +# CONFIG_TYPEC_MUX_PI3USB30532 is not set +# CONFIG_TYPEC_RT1711H is not set +# CONFIG_TYPEC_STUSB160X is not set +CONFIG_TYPEC_TCPCI=y +# CONFIG_TYPEC_TCPCI_MAXIM is not set +CONFIG_TYPEC_TCPM=y +# CONFIG_TYPEC_TPS6598X is not set CONFIG_UNMAP_KERNEL_AT_EL0=y +CONFIG_USB_CHIPIDEA=y +CONFIG_USB_CHIPIDEA_HOST=y +CONFIG_USB_CHIPIDEA_IMX=y +CONFIG_USB_CHIPIDEA_MSM=y +CONFIG_USB_CHIPIDEA_UDC=y CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_DUAL_ROLE=y +CONFIG_USB_DWC3_HAPS=y +CONFIG_USB_DWC3_IMX8MP=y +CONFIG_USB_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3_XILINX=y +CONFIG_USB_EHCI_FSL=y +# CONFIG_USB_EHCI_HCD_ORION is not set +CONFIG_USB_MXS_PHY=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_HISTB=y CONFIG_USB_XHCI_MVEBU=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 5a2004345c..693ae38c08 100644 --- a/target/linux/armvirt/image/Makefile +++ b/target/linux/armvirt/image/Makefile @@ -108,7 +108,7 @@ 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-fsl-enetc-net kmod-dwmac-imx kmod-fsl-fec \ kmod-phy-aquantia kmod-phy-broadcom kmod-phy-marvell \ kmod-phy-marvell-10g kmod-atlantic endef diff --git a/target/linux/armvirt/modules.mk b/target/linux/armvirt/modules.mk index f1dc28083a..1750fe73d7 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) + 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,54 @@ 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-phylink +kmod-pcs-xpcs +kmod-ptp + 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