From patchwork Thu Jul 1 09:47:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teresa Remmet X-Patchwork-Id: 1499482 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=phytec.de header.i=@phytec.de header.a=rsa-sha256 header.s=a4 header.b=EimB6krP; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GFtgr4Hvfz9sWk for ; Thu, 1 Jul 2021 19:48:24 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 22C68832C2; Thu, 1 Jul 2021 11:47:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=phytec.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=phytec.de header.i=@phytec.de header.b="EimB6krP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B45998327E; Thu, 1 Jul 2021 11:47:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mickerik.phytec.de (mickerik.phytec.de [195.145.39.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E31EB8328F for ; Thu, 1 Jul 2021 11:47:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=phytec.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=t.remmet@phytec.de DKIM-Signature: v=1; a=rsa-sha256; d=phytec.de; s=a4; c=relaxed/simple; q=dns/txt; i=@phytec.de; t=1625132842; x=1627724842; h=From:Sender:Reply-To:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5gitCfcDXTmmFY7zF3Tj+wo6K7t3qb2AjdAbWIM25eQ=; b=EimB6krPD/19gBvWjXd7kWJ7NW5mIjYh2jAYrdjqNRhqu1LyVnC4O7v+n6pTnRwj iIqOUYQq5T9/h+KWTZAIvx5L/FsnBu0AJ0ukFYuu5SoxHWq+CkNdulzz18cJNtmE 86LlXIvBVmn9Jp2FeuhPUz3zBVp9xrOgie/NcVrSSo4=; X-AuditID: c39127d2-a77bc70000001c5e-94-60dd8f2a7b46 Received: from idefix.phytec.de (Unknown_Domain [172.16.0.10]) by mickerik.phytec.de (PHYTEC Mail Gateway) with SMTP id 52.69.07262.A2F8DD06; Thu, 1 Jul 2021 11:47:22 +0200 (CEST) Received: from augenblix3.phytec.de ([172.16.0.233]) by idefix.phytec.de (IBM Domino Release 9.0.1FP7) with ESMTP id 2021070111472257-1075054 ; Thu, 1 Jul 2021 11:47:22 +0200 From: Teresa Remmet To: u-boot@lists.denx.de Cc: Stefano Babic , Fabio Estevam , "NXP i . MX U-Boot Team" , Peng Fan , Jagan Teki , Heiko Schocher Subject: [PATCH 5/9] board: phytec: phycore_imx8mp: Add fec support Date: Thu, 1 Jul 2021 09:47:17 +0000 Message-Id: <20210701094721.3240071-6-t.remmet@phytec.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210701094721.3240071-1-t.remmet@phytec.de> References: <20210701094721.3240071-1-t.remmet@phytec.de> MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on Idefix/Phytec(Release 9.0.1FP7|August 17, 2016) at 01.07.2021 11:47:22, Serialize by Router on Idefix/Phytec(Release 9.0.1FP7|August 17, 2016) at 01.07.2021 11:47:22 X-TNEFEvaluated: 1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHLMWRmVeSWpSXmKPExsWyRoCBS1er/26CwaZPxhYPr/pb7Lhzn9ni y6YJbBY/Vn1htWg/5WPxdm8nu8WUx+vZHdg91n68z+oxb9YJFo+ds+6ye5y9s4PRY+O7HUwB rFFcNimpOZllqUX6dglcGSsen2IuaJCrWLfXsoFxgmQXIyeHhICJxP6569i6GLk4hAS2MUrc /j6ZFcK5wCixd951RpAqNgENiacrTjOB2CICEhK/+q8yghQxC1xnlJi8/gRYQljAWWLJwn1g DSwCKhKfGyazgNi8ApYSp28dZ4JYJy8x89J3dhCbU8BKYuqJq8xdjBxA2ywlbu5QgCgXlDg5 8wkLyHwJgSuMEl3t/6B6hSROLz7LDGIzC2hLLFv4mnkCo8AsJD2zkKQWMDKtYhTKzUzOTi3K zNYryKgsSU3WS0ndxAgM48MT1S/tYOyb43GIkYmD8RCjBAezkghv1M7bCUK8KYmVValF+fFF pTmpxYcYpTlYlMR5N/CWhAkJpCeWpGanphakFsFkmTg4pRoY6w+0Xm2xnMFc2mVVvvTbySdb 9vmwfxDvEpCcEXBC+mLy1HALxoDHAfE/N93mWl4mecp3WpO61vwynhs/Gb5e0Q39vVQiI+zT 4wW5jO/l7n53KxFK3xl8u+NwUODzP3f/Jh2fdzDhQlLLgwVNBy9kWMmXqT8/6jQh6+ppvqJX RVM+7nhcXsHVosRSnJFoqMVcVJwIAKxtvEdRAgAA X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Enable support for the fec ethernet on phyCORE-i.MX8MP. Signed-off-by: Teresa Remmet --- board/phytec/phycore_imx8mp/phycore-imx8mp.c | 14 +++++++++++ configs/phycore-imx8mp_defconfig | 7 ++++++ include/configs/phycore_imx8mp.h | 25 ++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/board/phytec/phycore_imx8mp/phycore-imx8mp.c b/board/phytec/phycore_imx8mp/phycore-imx8mp.c index 67649078c201..a8f082143762 100644 --- a/board/phytec/phycore_imx8mp/phycore-imx8mp.c +++ b/board/phytec/phycore_imx8mp/phycore-imx8mp.c @@ -10,11 +10,25 @@ #include #include #include +#include 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; } diff --git a/configs/phycore-imx8mp_defconfig b/configs/phycore-imx8mp_defconfig index 7f21e8888e0e..a22f5e089d97 100644 --- a/configs/phycore-imx8mp_defconfig +++ b/configs/phycore-imx8mp_defconfig @@ -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 diff --git a/include/configs/phycore_imx8mp.h b/include/configs/phycore_imx8mp.h index e24f223c21d3..9de89c58289b 100644 --- a/include/configs/phycore_imx8mp.h +++ b/include/configs/phycore_imx8mp.h @@ -42,6 +42,8 @@ "console=ttymxc0,115200\0" \ "fdt_addr=0x48000000\0" \ "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ + "ip_dyn=yes\0" \ + "serverip=192.168.3.10\0" \ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ "mmcroot=2\0" \ @@ -57,6 +59,22 @@ "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 " \ @@ -103,4 +121,11 @@ /* I2C */ #define CONFIG_SYS_I2C_SPEED 100000 +/* ENET1 */ +#define CONFIG_ETHPRIME "FEC" +#define CONFIG_FEC_XCV_TYPE RGMII +#define CONFIG_FEC_MXC_PHYADDR 0 +#define FEC_QUIRK_ENET_MAC +#define IMX_FEC_BASE 0x30BE0000 + #endif /* __PHYCORE_IMX8MP_H */