]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: phytec: phycore_imx8mp: Add fec support
authorTeresa Remmet <t.remmet@phytec.de>
Wed, 7 Jul 2021 12:58:00 +0000 (12:58 +0000)
committerStefano Babic <sbabic@denx.de>
Sat, 10 Jul 2021 14:53:34 +0000 (16:53 +0200)
Enable support for the fec ethernet on phyCORE-i.MX8MP.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
board/phytec/phycore_imx8mp/phycore-imx8mp.c
configs/phycore-imx8mp_defconfig
include/configs/phycore_imx8mp.h

index 67649078c201bf4a0be35688855278a5e3900d05..a8f0821437620fa34ecef1751c3639ba53c2aee2 100644 (file)
 #include <asm/io.h>
 #include <asm/mach-imx/boot_mode.h>
 #include <env.h>
+#include <miiphy.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static int setup_fec(void)
+{
+       struct iomuxc_gpr_base_regs *gpr =
+               (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
+
+       /* Use 125M anatop REF_CLK1 for ENET1, not from external */
+       clrsetbits_le32(&gpr->gpr[1], 0x2000, 0);
+
+       return 0;
+}
+
 int board_init(void)
 {
+       setup_fec();
+
        return 0;
 }
 
index 7f21e8888e0e2642d5416e39e24cfde8d485e0b7..a22f5e089d976a523ec216580c56e2256aea2971 100644 (file)
@@ -58,6 +58,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_DEV=2
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_DM=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_CLK_IMX8MP=y
@@ -79,7 +80,13 @@ CONFIG_MMC_UHS_SUPPORT=y
 CONFIG_MMC_HS400_ES_SUPPORT=y
 CONFIG_MMC_HS400_SUPPORT=y
 CONFIG_FSL_ESDHC_IMX=y
+CONFIG_PHYLIB=y
+CONFIG_PHY_TI_DP83867=y
 CONFIG_DM_ETH=y
+CONFIG_DM_ETH_PHY=y
+CONFIG_FEC_MXC=y
+CONFIG_RGMII=y
+CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
index e24f223c21d3638bb05e5797423b2a1ce98863d5..75f84e60f5da22e7fbd7b6cd7e11e9d6e705463d 100644 (file)
@@ -42,6 +42,7 @@
        "console=ttymxc0,115200\0" \
        "fdt_addr=0x48000000\0" \
        "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+       "ip_dyn=yes\0" \
        "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
        "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
        "mmcroot=2\0" \
                "else " \
                        "echo WARN: Cannot load the DT; " \
                "fi;\0 " \
+       "nfsroot=/nfs\0" \
+       "netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp " \
+               "nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+       "netboot=echo Booting from net ...; " \
+               "run netargs; " \
+               "if test ${ip_dyn} = yes; then " \
+                       "setenv get_cmd dhcp; " \
+               "else " \
+                       "setenv get_cmd tftp; " \
+               "fi; " \
+               "${get_cmd} ${loadaddr} ${image}; " \
+               "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
+                       "booti ${loadaddr} - ${fdt_addr}; " \
+               "else " \
+                       "echo WARN: Cannot load the DT; " \
+               "fi;\0" \
 
 #define CONFIG_BOOTCOMMAND \
        "mmc dev ${mmcdev}; if mmc rescan; then " \