From patchwork Mon Mar 16 13:36:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florinel Iordache X-Patchwork-Id: 243699 List-Id: U-Boot discussion From: florinel.iordache at nxp.com (Florinel Iordache) Date: Mon, 16 Mar 2020 15:36:00 +0200 Subject: [PATCH 2/4] ls1046aqds: add support for backplane kr In-Reply-To: <1584365762-9009-1-git-send-email-florinel.iordache@nxp.com> References: <1584365762-9009-1-git-send-email-florinel.iordache@nxp.com> Message-ID: <1584365762-9009-3-git-send-email-florinel.iordache@nxp.com> Add support for backplane kr on ls1046aqds: remove board specific fixups on ls1046aqds for ethernet interfaces specified in device tree as supported backplane modes. Signed-off-by: Florinel Iordache --- board/freescale/ls1046aqds/eth.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/board/freescale/ls1046aqds/eth.c b/board/freescale/ls1046aqds/eth.c index 1eb4067..1d40e8b 100644 --- a/board/freescale/ls1046aqds/eth.c +++ b/board/freescale/ls1046aqds/eth.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2016 Freescale Semiconductor, Inc. - * Copyright 2018-2019 NXP + * Copyright 2018-2020 NXP */ #include @@ -154,9 +154,7 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr, enum fm_port port, int offset) { struct fixed_link f_link; - const u32 *handle; - const char *prop = NULL; - int off; + const char *phyconn; if (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_SGMII) { switch (port) { @@ -212,14 +210,11 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr, "qsgmii"); } else if (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_XGMII && (port == FM1_10GEC1 || port == FM1_10GEC2)) { - handle = fdt_getprop(fdt, offset, "phy-handle", NULL); - prop = NULL; - if (handle) { - off = fdt_node_offset_by_phandle(fdt, - fdt32_to_cpu(*handle)); - prop = fdt_getprop(fdt, off, "backplane-mode", NULL); - } - if (!prop || strcmp(prop, "10gbase-kr")) { + phyconn = fdt_getprop(fdt, offset, "phy-connection-type", NULL); + if (is_backplane_mode(phyconn)) { + /* Backplane KR mode: skip fixups */ + printf("Interface %d in backplane KR mode\n", port); + } else { /* XFI interface */ f_link.phy_id = cpu_to_fdt32(port); f_link.duplex = cpu_to_fdt32(1);