From 3460a6bba1dfeb48e6006a73c1aa9a6ba53a526b Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 11 Apr 2020 10:57:09 +0200 Subject: board: fsl: lx2160a: unused variable gic_lpi_base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the board is configured without CONFIG_GIC_V3_ITS, an error occurs: board/freescale/lx2160a/lx2160a.c: In function ‘ft_board_setup’: board/freescale/lx2160a/lx2160a.c:673:6: error: unused variable ‘gic_lpi_base’ [-Werror=unused-variable] 673 | u64 gic_lpi_base; | ^~~~~~~~~~~~ Let's define the variable as __maybe_unused. Signed-off-by: Heinrich Schuchardt Reviewed-by: Priyanka Jain --- board/freescale/lx2160a/lx2160a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/freescale') diff --git a/board/freescale/lx2160a/lx2160a.c b/board/freescale/lx2160a/lx2160a.c index 4b20bb440f..23ea1b6f16 100644 --- a/board/freescale/lx2160a/lx2160a.c +++ b/board/freescale/lx2160a/lx2160a.c @@ -670,7 +670,7 @@ int ft_board_setup(void *blob, bd_t *bd) u64 mc_memory_base = 0; u64 mc_memory_size = 0; u16 total_memory_banks; - u64 gic_lpi_base; + u64 __maybe_unused gic_lpi_base; ft_cpu_setup(blob, bd); -- cgit v1.2.1 From 316fc6ff762b44044ef164f51e042cb8a90dc147 Mon Sep 17 00:00:00 2001 From: Yinbo Zhu Date: Tue, 14 Apr 2020 17:24:48 +0800 Subject: armv8: ls1028a: define esdhc_status_fixup This patch is to define esdhc_status_fixup function for ls1028a to disable SDHC1/SDHC2 status in device tree node if not selected. Signed-off-by: Yinbo Zhu Signed-off-by: Xiaowei Bao Signed-off-by: Yangbo Lu Reviewed-by: Priyanka Jain --- board/freescale/ls1028a/ls1028a.c | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'board/freescale') diff --git a/board/freescale/ls1028a/ls1028a.c b/board/freescale/ls1028a/ls1028a.c index aa93534ac6..0b7504aea1 100644 --- a/board/freescale/ls1028a/ls1028a.c +++ b/board/freescale/ls1028a/ls1028a.c @@ -135,6 +135,46 @@ void detail_board_ddr_info(void) print_ddr_info(0); } +int esdhc_status_fixup(void *blob, const char *compat) +{ + void __iomem *dcfg_ccsr = (void __iomem *)DCFG_BASE; + char esdhc1_path[] = "/soc/mmc@2140000"; + char esdhc2_path[] = "/soc/mmc@2150000"; + char dspi1_path[] = "/soc/spi@2100000"; + char dspi2_path[] = "/soc/spi@2110000"; + u32 mux_sdhc1, mux_sdhc2; + u32 io = 0; + + /* + * The PMUX IO-expander for mux select is used to control + * the muxing of various onboard interfaces. + */ + + io = in_le32(dcfg_ccsr + DCFG_RCWSR12); + mux_sdhc1 = (io >> DCFG_RCWSR12_SDHC_SHIFT) & DCFG_RCWSR12_SDHC_MASK; + + /* Disable esdhc1/dspi1 if not selected. */ + if (mux_sdhc1 != 0) + do_fixup_by_path(blob, esdhc1_path, "status", "disabled", + sizeof("disabled"), 1); + if (mux_sdhc1 != 2) + do_fixup_by_path(blob, dspi1_path, "status", "disabled", + sizeof("disabled"), 1); + + io = in_le32(dcfg_ccsr + DCFG_RCWSR13); + mux_sdhc2 = (io >> DCFG_RCWSR13_SDHC_SHIFT) & DCFG_RCWSR13_SDHC_MASK; + + /* Disable esdhc2/dspi2 if not selected. */ + if (mux_sdhc2 != 0) + do_fixup_by_path(blob, esdhc2_path, "status", "disabled", + sizeof("disabled"), 1); + if (mux_sdhc2 != 2) + do_fixup_by_path(blob, dspi2_path, "status", "disabled", + sizeof("disabled"), 1); + + return 0; +} + #ifdef CONFIG_OF_BOARD_SETUP int ft_board_setup(void *blob, bd_t *bd) { -- cgit v1.2.1 From d698112fd668ca076d469ab50f4d64f42fb995b9 Mon Sep 17 00:00:00 2001 From: Florinel Iordache Date: Mon, 16 Mar 2020 15:36:00 +0200 Subject: ls1046aqds: add support for backplane kr 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 Reviewed-by: Priyanka Jain --- board/freescale/ls1046aqds/eth.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'board/freescale') diff --git a/board/freescale/ls1046aqds/eth.c b/board/freescale/ls1046aqds/eth.c index 1eb40677b5..1d40e8bd17 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); -- cgit v1.2.1 From d4694ad86a330a1eb5e78c7a3784c5388eee1435 Mon Sep 17 00:00:00 2001 From: Florinel Iordache Date: Mon, 16 Mar 2020 15:36:01 +0200 Subject: lx2160aqds: add support for backplane kr Add support for backplane kr on lx2160aqds: remove board specific fixups on lx2160aqds for ethernet interfaces specified in device tree as supported backplane modes. Signed-off-by: Florinel Iordache Reviewed-by: Priyanka Jain --- board/freescale/lx2160a/eth_lx2160aqds.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'board/freescale') diff --git a/board/freescale/lx2160a/eth_lx2160aqds.c b/board/freescale/lx2160a/eth_lx2160aqds.c index 6500649d7b..0e928ebd86 100644 --- a/board/freescale/lx2160a/eth_lx2160aqds.c +++ b/board/freescale/lx2160a/eth_lx2160aqds.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2018-2019 NXP + * Copyright 2018-2020 NXP * */ @@ -616,6 +616,13 @@ int fdt_fixup_dpmac_phy_handle(void *fdt, int dpmac_id, int node_phandle) return offset; } + phy_string = fdt_getprop(fdt, offset, "phy-connection-type", NULL); + if (is_backplane_mode(phy_string)) { + /* Backplane KR mode: skip fixups */ + printf("Interface %d in backplane KR mode\n", dpmac_id); + return 0; + } + ret = fdt_appendprop_cell(fdt, offset, "phy-handle", node_phandle); if (ret) printf("%d@%s %d\n", __LINE__, __func__, ret); -- cgit v1.2.1 From e174fb7061e7a3f1996f57eb36525c51dd87b5a3 Mon Sep 17 00:00:00 2001 From: Florinel Iordache Date: Mon, 16 Mar 2020 15:36:02 +0200 Subject: t208xqds: add support for backplane kr Add support for backplane kr on t208xqds: remove board specific fixups on t208xqds for ethernet interfaces specified in device tree as supported backplane modes. Signed-off-by: Florinel Iordache Reviewed-by: Priyanka Jain --- board/freescale/t208xqds/eth_t208xqds.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'board/freescale') diff --git a/board/freescale/t208xqds/eth_t208xqds.c b/board/freescale/t208xqds/eth_t208xqds.c index 23b59bcc09..697c23b038 100644 --- a/board/freescale/t208xqds/eth_t208xqds.c +++ b/board/freescale/t208xqds/eth_t208xqds.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2013 Freescale Semiconductor, Inc. + * Copyright 2020 NXP * * Shengzhou Liu */ @@ -200,6 +201,7 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr, char buf[32] = "serdes-1,"; struct fixed_link f_link; int media_type = 0; + const char *phyconn; int off; ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); @@ -412,15 +414,24 @@ void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr, } if (!media_type) { - /* fixed-link is used for XFI fiber cable */ - f_link.phy_id = port; - f_link.duplex = 1; - f_link.link_speed = 10000; - f_link.pause = 0; - f_link.asym_pause = 0; - fdt_delprop(fdt, offset, "phy-handle"); - fdt_setprop(fdt, offset, "fixed-link", &f_link, - sizeof(f_link)); + 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 { + /* fixed-link for XFI fiber cable */ + f_link.phy_id = port; + f_link.duplex = 1; + f_link.link_speed = 10000; + f_link.pause = 0; + f_link.asym_pause = 0; + fdt_delprop(fdt, offset, "phy-handle"); + fdt_setprop(fdt, offset, "fixed-link", + &f_link, sizeof(f_link)); + } } else { /* set property for copper cable */ off = fdt_node_offset_by_compat_reg(fdt, -- cgit v1.2.1