Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1157050/?format=api
{ "id": 1157050, "url": "http://patchwork.ozlabs.org/api/patches/1157050/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20190903143850.9824-7-lukma@denx.de/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20190903143850.9824-7-lukma@denx.de>", "list_archive_url": null, "date": "2019-09-03T14:38:42", "name": "[U-Boot,v2,06/14] DM: eth: Switch display5 board to use DM_ETH", "commit_ref": "32e07513833515c6684f8819e176cb62adb55c4d", "pull_url": null, "state": "accepted", "archived": false, "hash": "214d45b4a6e8cfb8576fad09808d67bcd7c5134c", "submitter": { "id": 70701, "url": "http://patchwork.ozlabs.org/api/people/70701/?format=api", "name": "Lukasz Majewski", "email": "lukma@denx.de" }, "delegate": { "id": 1693, "url": "http://patchwork.ozlabs.org/api/users/1693/?format=api", "username": "sbabic", "first_name": "Stefano", "last_name": "Babic", "email": "sbabic@denx.de" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20190903143850.9824-7-lukma@denx.de/mbox/", "series": [ { "id": 128783, "url": "http://patchwork.ozlabs.org/api/series/128783/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=128783", "date": "2019-09-03T14:38:36", "name": "DM: display5: Convert display5 board to DM/DTS (including 'factory' setup)", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/128783/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1157050/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1157050/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=denx.de" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 46N8pB6lxkz9s7T\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 4 Sep 2019 00:43:30 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid A5C2CC21DA1; Tue, 3 Sep 2019 14:39:54 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id ED55AC21DA1;\n\tTue, 3 Sep 2019 14:39:29 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 15A18C21C50; Tue, 3 Sep 2019 14:39:22 +0000 (UTC)", "from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10])\n\tby lists.denx.de (Postfix) with ESMTPS id 9A3D7C21DA1\n\tfor <u-boot@lists.denx.de>; Tue, 3 Sep 2019 14:39:19 +0000 (UTC)", "from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 46N8jM1wP5z1rW6d;\n\tTue, 3 Sep 2019 16:39:19 +0200 (CEST)", "from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 46N8jM1VmKz1qqkB;\n\tTue, 3 Sep 2019 16:39:19 +0200 (CEST)", "from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id t1bwm6MPTP51; Tue, 3 Sep 2019 16:39:17 +0200 (CEST)", "from localhost.localdomain (85-222-111-42.dynamic.chello.pl\n\t[85.222.111.42])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPSA;\n\tTue, 3 Sep 2019 16:39:17 +0200 (CEST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=0.0 required=5.0 tests=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0", "X-Virus-Scanned": "amavisd-new at mnet-online.de", "X-Auth-Info": "QUFA6QjK6RHO6ZUJiDxxzWZxOe34JSyjG3PNI6LXepk=", "From": "Lukasz Majewski <lukma@denx.de>", "To": "u-boot@lists.denx.de,\n\tStefano Babic <sbabic@denx.de>", "Date": "Tue, 3 Sep 2019 16:38:42 +0200", "Message-Id": "<20190903143850.9824-7-lukma@denx.de>", "X-Mailer": "git-send-email 2.11.0", "In-Reply-To": "<20190903143850.9824-1-lukma@denx.de>", "References": "<20190903143850.9824-1-lukma@denx.de>", "Cc": "Marek Vasut <marex@denx.de>, Parthiban Nallathambi <parthitce@gmail.com>,\n\tOtavio Salvador <otavio@ossystems.com.br>,\n\tMartyn Welch <martyn@welchs.me.uk>, \n\tJoe Hershberger <joe.hershberger@ni.com>,\n\t\"NXP i.MX U-Boot Team\" <uboot-imx@nxp.com>,\n\tFabien Lahoudere <fabien.lahoudere@collabora.com>", "Subject": "[U-Boot] [PATCH v2 06/14] DM: eth: Switch display5 board to use\n\tDM_ETH", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.18", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>" }, "content": "After this commit the display5 device would use FEC driver supporting\ndriver model (DM_ETH).\n\nSigned-off-by: Lukasz Majewski <lukma@denx.de>\n\n---\n\nChanges in v2:\n- Use dm_gpio* functions instead of gpio_* ones\n\n arch/arm/mach-imx/mx6/Kconfig | 1 +\n board/liebherr/display5/display5.c | 134 +++++++++----------------------------\n include/configs/display5.h | 8 ---\n 3 files changed, 31 insertions(+), 112 deletions(-)", "diff": "diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig\nindex 2496ecacb104..aef18726702b 100644\n--- a/arch/arm/mach-imx/mx6/Kconfig\n+++ b/arch/arm/mach-imx/mx6/Kconfig\n@@ -187,6 +187,7 @@ config TARGET_DHCOMIMX6\n config TARGET_DISPLAY5\n \tbool \"LWN DISPLAY5 board\"\n \tselect DM\n+\tselect DM_ETH\n \tselect DM_I2C\n \tselect DM_MMC\n \tselect DM_GPIO\ndiff --git a/board/liebherr/display5/display5.c b/board/liebherr/display5/display5.c\nindex 0cc77dac0fa1..e008ea9a3fb8 100644\n--- a/board/liebherr/display5/display5.c\n+++ b/board/liebherr/display5/display5.c\n@@ -155,130 +155,42 @@ static void displ5_setup_ecspi(void)\n \t\tgpio_direction_output(IMX_GPIO_NR(7, 0), 1);\n }\n \n-#ifdef CONFIG_FEC_MXC\n-iomux_v3_cfg_t const enet_pads[] = {\n-\tMX6_PAD_ENET_TXD1__ENET_1588_EVENT0_IN\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_ENET_RXD1__ENET_1588_EVENT3_OUT | MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_ENET_MDIO__ENET_MDIO\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_ENET_MDC__ENET_MDC\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_ENET_REF_CLK__ENET_TX_CLK\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\n-\t/* for old evalboard with R159 present and R160 not populated */\n-\tMX6_PAD_GPIO_16__ENET_REF_CLK\t\t| MUX_PAD_CTRL(NO_PAD_CTRL),\n-\n-\tMX6_PAD_RGMII_TXC__RGMII_TXC\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_RGMII_TD0__RGMII_TD0\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_RGMII_TD1__RGMII_TD1\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_RGMII_TD2__RGMII_TD2\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_RGMII_TD3__RGMII_TD3\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_RGMII_TX_CTL__RGMII_TX_CTL\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\n-\tMX6_PAD_RGMII_RXC__RGMII_RXC\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_RGMII_RD0__RGMII_RD0\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_RGMII_RD1__RGMII_RD1\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_RGMII_RD2__RGMII_RD2\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_RGMII_RD3__RGMII_RD3\t\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\tMX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL\t| MUX_PAD_CTRL(ENET_PAD_CTRL),\n-\t/*INT#_GBE*/\n-\tMX6_PAD_ENET_TX_EN__GPIO1_IO28\t\t| MUX_PAD_CTRL(NO_PAD_CTRL),\n-};\n-\n-static void setup_iomux_enet(void)\n+/*\n+ * Do not overwrite the console\n+ * Always use serial for U-Boot console\n+ */\n+int overwrite_console(void)\n {\n-\tSETUP_IOMUX_PADS(enet_pads);\n-\tgpio_direction_input(IMX_GPIO_NR(1, 28)); /*INT#_GBE*/\n+\treturn 1;\n }\n \n-static int setup_mac_from_fuse(void)\n+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)\n+int ft_board_setup(void *blob, bd_t *bd)\n {\n-\tunsigned char enetaddr[6];\n-\tint ret;\n-\n-\tret = eth_env_get_enetaddr(\"ethaddr\", enetaddr);\n-\tif (ret)\t/* ethaddr is already set */\n-\t\treturn 0;\n-\n-\timx_get_mac_from_fuse(0, enetaddr);\n-\n-\tif (is_valid_ethaddr(enetaddr)) {\n-\t\teth_env_set_enetaddr(\"ethaddr\", enetaddr);\n-\t\treturn 0;\n-\t}\n-\n+\tfdt_fixup_ethernet(blob);\n \treturn 0;\n }\n+#endif\n \n-int board_eth_init(bd_t *bd)\n+int board_phy_config(struct phy_device *phydev)\n {\n-\tstruct phy_device *phydev;\n-\tstruct mii_dev *bus;\n-\tint ret;\n-\n-\tsetup_iomux_enet();\n-\n-\tiomuxc_set_rgmii_io_voltage(DDR_SEL_1P5V_IO);\n-\n-\tret = enable_fec_anatop_clock(0, ENET_125MHZ);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\tsetup_mac_from_fuse();\n-\n-\tbus = fec_get_miibus(IMX_FEC_BASE, -1);\n-\tif (!bus)\n-\t\treturn -ENODEV;\n-\n-\t/*\n-\t * We use here the \"rgmii-id\" mode of operation and allow M88E1512\n-\t * PHY to use its internally callibrated RX/TX delays\n-\t */\n-\tphydev = phy_find_by_mask(bus, 0xffffffff /* (0xf << 4) */,\n-\t\t\t\t PHY_INTERFACE_MODE_RGMII_ID);\n-\tif (!phydev) {\n-\t\tret = -ENODEV;\n-\t\tgoto err_phy;\n-\t}\n-\n \t/* display5 due to PCB routing can only work with 100 Mbps */\n \tphydev->advertising &= ~(ADVERTISED_1000baseX_Half |\n \t\t\t\t ADVERTISED_1000baseX_Full |\n \t\t\t\t SUPPORTED_1000baseT_Half |\n \t\t\t\t SUPPORTED_1000baseT_Full);\n \n-\tret = fec_probe(bd, -1, IMX_FEC_BASE, bus, phydev);\n-\tif (ret)\n-\t\tgoto err_sw;\n-\n-\treturn 0;\n-\n-err_sw:\n-\tfree(phydev);\n-err_phy:\n-\tmdio_unregister(bus);\n-\tfree(bus);\n-\treturn ret;\n-}\n-#endif /* CONFIG_FEC_MXC */\n-\n-/*\n- * Do not overwrite the console\n- * Always use serial for U-Boot console\n- */\n-int overwrite_console(void)\n-{\n-\treturn 1;\n-}\n+\tif (phydev->drv->config)\n+\t\treturn phydev->drv->config(phydev);\n \n-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)\n-int ft_board_setup(void *blob, bd_t *bd)\n-{\n-\tfdt_fixup_ethernet(blob);\n \treturn 0;\n }\n-#endif\n \n int board_init(void)\n {\n+\tstruct gpio_desc phy_int_gbe;\n+\tint ret;\n+\n \tdebug(\"board init\\n\");\n \t/* address of boot parameters */\n \tgd->bd->bi_boot_params = PHYS_SDRAM + 0x100;\n@@ -288,6 +200,7 @@ int board_init(void)\n \n \tdispl5_setup_ecspi();\n \n+\t/* Setup misc (application specific) stuff */\n \tSETUP_IOMUX_PADS(misc_pads);\n \n \tget_board_id(gpio_table_sw_ids, &gpio_table_sw_ids_names[0],\n@@ -303,6 +216,19 @@ int board_init(void)\n \n \tudelay(25);\n \n+\t/* Setup low level FEC (ETH) */\n+\tret = dm_gpio_lookup_name(\"GPIO1_28\", &phy_int_gbe);\n+\tif (ret) {\n+\t\tprintf(\"Cannot get GPIO1_28\\n\");\n+\t} else {\n+\t\tret = dm_gpio_request(&phy_int_gbe, \"INT_GBE\");\n+\t\tif (!ret)\n+\t\t\tdm_gpio_set_dir_flags(&phy_int_gbe, GPIOD_IS_IN);\n+\t}\n+\n+\tiomuxc_set_rgmii_io_voltage(DDR_SEL_1P5V_IO);\n+\tenable_fec_anatop_clock(0, ENET_125MHZ);\n+\n \treturn 0;\n }\n \ndiff --git a/include/configs/display5.h b/include/configs/display5.h\nindex 2a039c24288f..15027f153341 100644\n--- a/include/configs/display5.h\n+++ b/include/configs/display5.h\n@@ -59,14 +59,6 @@\n /* I2C Configs */\n #define CONFIG_I2C_MULTI_BUS\n \n-/* Ethernet */\n-#ifdef CONFIG_FEC_MXC\n-#define IMX_FEC_BASE\t\t\tENET_BASE_ADDR\n-#define CONFIG_FEC_XCV_TYPE\t\tRGMII\n-#define CONFIG_ETHPRIME\t\t\t\"FEC\"\n-#define CONFIG_FEC_MXC_PHYADDR\t\t0\n-#endif\n-\n /* MMC Configs */\n #define CONFIG_SYS_FSL_ESDHC_ADDR\t0\n #define CONFIG_SYS_FSL_USDHC_NUM\t2\n", "prefixes": [ "U-Boot", "v2", "06/14" ] }