Skip to contentSkip to conversation

Generic powerpc fixes and NXP board cleanup

PATCH In review Michael Walle 3 participants 14 messages May 6 – May 15

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover Generic powerpc fixes and NXP board cleanup

While working on an ancient P2041 based board, I've encountered several issues.

cpu_init_r wasn't called anymore, but u-boot was still somehow working. CAAM was reading/writing on address 0 because pamu_init() is never called if secure boot isn't enabled.

Since legacy ethernet was removed, board_eth_init() and fdt_fixup_board_enet() won't be called anymore, but the functions are still defined. I've just removed the ones for the NXP boards, though I think the code there did something useful. But given that it wasn't called for two years now and nobody complained, it can't be that important.

Lastly, because I have a p2041rdb, move that to a upstream DTS. Keep in mind, that the uboot dts doesn't define an UART, so any output was broken since the move to DM provided serial support.

v2:
- new patch
p2041rdb: convert README to rst
- fix build errors, tested all commits with buildman

Michael Walle (11):
powerpc: fix call to cpu_init_r
caam: don't write memory at 0 on PPC
spi: fsl_espi: fix read transactions
boards: remove dead fman code
boards/nxp: remove board_eth_init()
boards/nxp: remove empty fdt_fixup_board_enet()
p2041rdb: use the upstream device tree
p2041rdb: support SDcard boot
p2041rdb: update README and fix typos
p2041rdb: remove NAND defconfig
p2041rdb: convert README to rst

 arch/powerpc/cpu/mpc85xx/cpu_init.c           |   6 +-
 arch/powerpc/dts/Makefile                     |   1 -
 arch/powerpc/dts/p2041.dtsi                   | 138 ----
 arch/powerpc/dts/p2041rdb-u-boot.dtsi         |  19 +
 arch/powerpc/dts/p2041rdb.dts                 | 127 ---
 arch/powerpc/dts/p2041si-post.dtsi            |  43 --
 board/nxp/ls1012afrdm/eth.c                   |  10 -
 board/nxp/ls1012ardb/eth.c                    |  12 -
 board/nxp/ls1021atsn/ls1021atsn.c             |   5 -
 board/nxp/ls1021atwr/ls1021atwr.c             |   5 -
 board/nxp/ls1028a/ls1028a.c                   |   5 -
 board/nxp/ls1043aqds/Makefile                 |   3 -
 board/nxp/ls1043aqds/eth.c                    | 501 ------------
 board/nxp/ls1043aqds/ls1043aqds.c             |   4 -
 board/nxp/ls1043ardb/Makefile                 |   1 -
 board/nxp/ls1043ardb/eth.c                    |  77 --
 board/nxp/ls1046afrwy/eth.c                   |  57 --
 board/nxp/ls1046aqds/Makefile                 |   3 -
 board/nxp/ls1046aqds/eth.c                    | 431 -----------
 board/nxp/ls1046aqds/ls1046aqds.c             |   4 -
 board/nxp/ls1046ardb/eth.c                    |  71 --
 board/nxp/ls2080ardb/eth_ls2080rdb.c          |  19 -
 board/nxp/lx2160a/eth_lx2160aqds.c            |  18 -
 board/nxp/lx2160a/eth_lx2160ardb.c            |  17 -
 board/nxp/lx2160a/eth_lx2162aqds.c            |  18 -
 board/nxp/m5253demo/m5253demo.c               |   7 -
 board/nxp/mx6sxsabreauto/mx6sxsabreauto.c     |  52 --
 board/nxp/mx6sxsabresd/mx6sxsabresd.c         |  78 --
 board/nxp/p2041rdb/Makefile                   |   1 -
 board/nxp/p2041rdb/README                     | 138 ----
 board/nxp/p2041rdb/README.rst                 | 147 ++++
 board/nxp/p2041rdb/eth.c                      | 210 -----
 board/nxp/p2041rdb/p2041rdb_rcw_sd.cfg        |  11 +
 ...{rcw_p2041rdb.cfg => p2041rdb_rcw_spi.cfg} |   0
 board/nxp/t102xrdb/Makefile                   |   1 -
 board/nxp/t102xrdb/eth_t102xrdb.c             | 149 ----
 board/nxp/t102xrdb/t102xrdb.c                 |   1 -
 board/nxp/t102xrdb/t102xrdb.h                 |   1 -
 board/nxp/t104xrdb/Makefile                   |   1 -
 board/nxp/t104xrdb/eth.c                      |  91 ---
 board/nxp/t104xrdb/t104xrdb.h                 |   1 -
 board/nxp/t208xqds/Makefile                   |   2 +-
 board/nxp/t208xqds/eth_t208xqds.c             | 723 ------------------
 board/nxp/t208xqds/t208xqds.c                 |   1 -
 board/nxp/t208xqds/t208xqds.h                 |   1 -
 board/nxp/t208xrdb/eth_t208xrdb.c             |   5 -
 board/nxp/t208xrdb/t208xrdb.c                 |   1 -
 board/nxp/t208xrdb/t208xrdb.h                 |   1 -
 board/nxp/t4rdb/Makefile                      |   1 -
 board/nxp/t4rdb/eth.c                         | 152 ----
 board/nxp/t4rdb/t4240rdb.c                    |   1 -
 board/nxp/t4rdb/t4rdb.h                       |   1 -
 common/board_r.c                              |   2 +-
 configs/P2041RDB_NAND_defconfig               | 117 ---
 configs/P2041RDB_SDCARD_defconfig             |   6 +-
 configs/P2041RDB_SPIFLASH_defconfig           |   6 +-
 configs/P2041RDB_defconfig                    |   4 +-
 drivers/spi/fsl_espi.c                        |   6 +-
 include/configs/P2041RDB.h                    |   2 +
 59 files changed, 200 insertions(+), 3316 deletions(-)
 delete mode 100644 arch/powerpc/dts/p2041.dtsi
 create mode 100644 arch/powerpc/dts/p2041rdb-u-boot.dtsi
 delete mode 100644 arch/powerpc/dts/p2041rdb.dts
 delete mode 100644 arch/powerpc/dts/p2041si-post.dtsi
 delete mode 100644 board/nxp/ls1043aqds/eth.c
 delete mode 100644 board/nxp/ls1043ardb/eth.c
 delete mode 100644 board/nxp/ls1046aqds/eth.c
 delete mode 100644 board/nxp/p2041rdb/README
 create mode 100644 board/nxp/p2041rdb/README.rst
 delete mode 100644 board/nxp/p2041rdb/eth.c
 create mode 100644 board/nxp/p2041rdb/p2041rdb_rcw_sd.cfg
 rename board/nxp/p2041rdb/{rcw_p2041rdb.cfg => p2041rdb_rcw_spi.cfg} (100%)
 delete mode 100644 board/nxp/t102xrdb/eth_t102xrdb.c
 delete mode 100644 board/nxp/t104xrdb/eth.c
 delete mode 100644 board/nxp/t208xqds/eth_t208xqds.c
 delete mode 100644 board/nxp/t4rdb/eth.c
 delete mode 100644 configs/P2041RDB_NAND_defconfig
Signature · 1 line
2.47.3
#1 lore raw

PATCH v2 1/11 powerpc: fix call to cpu_init_r

Commit 6c171f7a184c ("common: board: make initcalls static") broke the call to cpu_init_r. That is because PPC is already defined to 1, see:

powerpc-linux-gnu-gcc -dM -E - < /dev/null

This will conflict with the CONFIG_IS_ENABLED(PPC). Change it to IS_ENABLED(CONFIG_PPC).

Fixes 6c171f7a184c ("common: board: make initcalls static")
---
 common/board_r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/board_r.c +1 -1
index 5d37345ca09..9b6ba9d8e56 100644
@@ -687,7 +687,7 @@ static void initcall_run_r(void)
 	INITCALL(initr_flash);
 #endif
 	WATCHDOG_RESET();
-#if CONFIG_IS_ENABLED(PPC) || CONFIG_IS_ENABLED(M68K) || CONFIG_IS_ENABLED(X86)
+#if IS_ENABLED(CONFIG_PPC) || CONFIG_IS_ENABLED(M68K) || CONFIG_IS_ENABLED(X86)
 	/* initialize higher level parts of CPU like time base and timers */
 	INITCALL(cpu_init_r);
 #endif
Signature · 1 line
2.47.3
#2 lore raw

PATCH v2 2/11 caam: don't write memory at 0 on PPC

In reply to Michael Walle

For non-secure boot environments pamu_init() isn't called but the CAAM will still call sec_config_pamu_table() -> config_pamu() which then uses an uninitialized ppaact variable. In fact, that variable is initialized with 0, so the config_pamu() will happily assume the structure is there and will operate on that memory. Call pamu_init() in the non-secure boot case, too.

---
 arch/powerpc/cpu/mpc85xx/cpu_init.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/powerpc/cpu/mpc85xx/cpu_init.c +5 -1
index 739d14f8002..414782c835f 100644
@@ -41,10 +41,12 @@
 #ifdef CONFIG_FSL_CAAM
 #include <fsl_sec.h>
 #endif
-#if defined(CONFIG_NXP_ESBC) && defined(CONFIG_FSL_CORENET)
+#if defined(CONFIG_FSL_CORENET)
 #include <asm/fsl_pamu.h>
+#if defined(CONFIG_NXP_ESBC)
 #include <fsl_secboot_err.h>
 #endif
+#endif
 #ifdef CONFIG_SYS_QE_FMAN_FW_IN_NAND
 #include <nand.h>
 #include <errno.h>
@@ -899,6 +901,8 @@ int cpu_init_r(void)
 #if defined(CONFIG_NXP_ESBC) && defined(CONFIG_FSL_CORENET)
 	if (pamu_init() < 0)
 		fsl_secboot_handle_error(ERROR_ESBC_PAMU_INIT);
+#elif defined(CONFIG_FSL_CORENET)
+	pamu_init();
 #endif
 
 #ifdef CONFIG_FSL_CAAM
Signature · 1 line
2.47.3
#3 lore raw

PATCH v2 3/11 spi: fsl_espi: fix read transactions

In reply to Michael Walle

Since commit 7917c2e35604 ("spi: fsl_espi: fix din offset") MTD is basically broken because any read transaction will get wrong data. While the commit in question will fix simple transfers (where both SPI_XFER_BEGIN and SPI_XFER_END is set), it will break the most common case, where opcode and address is send first and then data comes as a second transfer.

This basically reverts commit 7917c2e35604 ("spi: fsl_espi: fix din offset") and make the fix particular for this simple case. Instead of providing two buffers for reading and writing, just malloc one which is used for both. This will work because the data is first written on the SPI bus and then it will be read (and overwite the written data) into the same buffer.

Fixes 7917c2e35604 ("spi: fsl_espi: fix din offset")
---
 drivers/spi/fsl_espi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/spi/fsl_espi.c +3 -3
index 117e36376b7..c5bc603b5c0 100644
@@ -216,13 +216,13 @@ int espi_xfer(struct fsl_spi_slave *fsl,  uint cs, unsigned int bitlen,
 		break;
 	case SPI_XFER_BEGIN | SPI_XFER_END:
 		len = data_len;
-		buffer = (unsigned char *)malloc(len * 2);
+		buffer = (unsigned char *)malloc(len);
 		if (!buffer) {
 			debug("SF: Failed to malloc memory.\n");
 			return 1;
 		}
 		memcpy(buffer, data_out, len);
-		rx_offset = len;
+		rx_offset = 0;
 		cmd_len = 0;
 		break;
 	}
@@ -275,7 +275,7 @@ int espi_xfer(struct fsl_spi_slave *fsl,  uint cs, unsigned int bitlen,
 			}
 		}
 		if (data_in) {
-			memcpy(data_in, buffer + rx_offset, tran_len);
+			memcpy(data_in, buffer + 2 * cmd_len, tran_len);
 			if (*buffer == 0x0b) {
 				data_in += tran_len;
 				data_len -= tran_len;
Signature · 1 line
2.47.3
#4 lore raw

PATCH v2 4/11 boards: remove dead fman code

In reply to Michael Walle

Commit cc2bf624eb71 ("net: fm: Remove non-DM_ETH code") removed the call to board_ft_fman_fixup_port(). Thus remove the dead code in the board files.

I'm not sure, all that DT shenanigans are covered by the new DM-version of the fman code, but it seems no one complained for the past 4 years.

---
 board/nxp/ls1043aqds/eth.c        |  99 -------------
 board/nxp/ls1046aqds/eth.c        |  81 -----------
 board/nxp/p2041rdb/eth.c          |  71 +---------
 board/nxp/t102xrdb/eth_t102xrdb.c |  15 --
 board/nxp/t208xqds/eth_t208xqds.c | 225 ------------------------------
 5 files changed, 1 insertion(+), 490 deletions(-)
board/nxp/ls1043aqds/eth.c +0 -99
index 5a8ca27b327..5680fd2d377 100644
@@ -159,105 +159,6 @@ static int ls1043aqds_mdio_init(char *realbusname, u8 muxval)
 	return mdio_register(bus);
 }
 
-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;
-
-	if (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_SGMII) {
-		if (port == FM1_DTSEC9) {
-			fdt_set_phy_handle(fdt, compat, addr,
-					   "sgmii-riser-s1-p1");
-		} else if (port == FM1_DTSEC2) {
-			fdt_set_phy_handle(fdt, compat, addr,
-					   "sgmii-riser-s2-p1");
-		} else if (port == FM1_DTSEC5) {
-			fdt_set_phy_handle(fdt, compat, addr,
-					   "sgmii-riser-s3-p1");
-		} else if (port == FM1_DTSEC6) {
-			fdt_set_phy_handle(fdt, compat, addr,
-					   "sgmii-riser-s4-p1");
-		}
-	} else if (fm_info_get_enet_if(port) ==
-		   PHY_INTERFACE_MODE_2500BASEX) {
-		/* 2.5G SGMII interface */
-		f_link.phy_id = cpu_to_fdt32(port);
-		f_link.duplex = cpu_to_fdt32(1);
-		f_link.link_speed = cpu_to_fdt32(1000);
-		f_link.pause = 0;
-		f_link.asym_pause = 0;
-		/* no PHY for 2.5G SGMII */
-		fdt_delprop(fdt, offset, "phy-handle");
-		fdt_setprop(fdt, offset, "fixed-link", &f_link, sizeof(f_link));
-		fdt_setprop_string(fdt, offset, "phy-connection-type",
-				   "2500base-x");
-	} else if (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_QSGMII) {
-		switch (mdio_mux[port]) {
-		case EMI1_SLOT1:
-			switch (port) {
-			case FM1_DTSEC1:
-				fdt_set_phy_handle(fdt, compat, addr,
-						   "qsgmii-s1-p1");
-				break;
-			case FM1_DTSEC2:
-				fdt_set_phy_handle(fdt, compat, addr,
-						   "qsgmii-s1-p2");
-				break;
-			case FM1_DTSEC5:
-				fdt_set_phy_handle(fdt, compat, addr,
-						   "qsgmii-s1-p3");
-				break;
-			case FM1_DTSEC6:
-				fdt_set_phy_handle(fdt, compat, addr,
-						   "qsgmii-s1-p4");
-				break;
-			default:
-				break;
-			}
-			break;
-		case EMI1_SLOT2:
-			switch (port) {
-			case FM1_DTSEC1:
-				fdt_set_phy_handle(fdt, compat, addr,
-						   "qsgmii-s2-p1");
-				break;
-			case FM1_DTSEC2:
-				fdt_set_phy_handle(fdt, compat, addr,
-						   "qsgmii-s2-p2");
-				break;
-			case FM1_DTSEC5:
-				fdt_set_phy_handle(fdt, compat, addr,
-						   "qsgmii-s2-p3");
-				break;
-			case FM1_DTSEC6:
-				fdt_set_phy_handle(fdt, compat, addr,
-						   "qsgmii-s2-p4");
-				break;
-			default:
-				break;
-			}
-			break;
-		default:
-			break;
-		}
-		fdt_delprop(fdt, offset, "phy-connection-type");
-		fdt_setprop_string(fdt, offset, "phy-connection-type",
-				   "qsgmii");
-	} else if (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_XGMII &&
-		   port == FM1_10GEC1) {
-		/* 10GBase-R interface */
-		f_link.phy_id = cpu_to_fdt32(port);
-		f_link.duplex = cpu_to_fdt32(1);
-		f_link.link_speed = cpu_to_fdt32(10000);
-		f_link.pause = 0;
-		f_link.asym_pause = 0;
-		/* no PHY for 10GBase-R */
-		fdt_delprop(fdt, offset, "phy-handle");
-		fdt_setprop(fdt, offset, "fixed-link", &f_link, sizeof(f_link));
-		fdt_setprop_string(fdt, offset, "phy-connection-type", "xgmii");
-	}
-}
-
 void fdt_fixup_board_enet(void *fdt)
 {
 	int i;
board/nxp/ls1046aqds/eth.c +0 -81

87 lines not on this page · raw message

board/nxp/p2041rdb/eth.c +1 -70

80 lines not on this page · raw message

board/nxp/t102xrdb/eth_t102xrdb.c +0 -15
index 7185a0abd52..91f87983dc5 100644
@@ -129,21 +129,6 @@ int board_eth_init(struct bd_info *bis)
 	return pci_eth_init(bis);
 }
 
-void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
-			      enum fm_port port, int offset)
-{
-#if defined(CONFIG_TARGET_T1024RDB)
-	if (((fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_2500BASEX) ||
-	     (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_SGMII)) &&
-			(port == FM1_DTSEC3)) {
-		fdt_set_phy_handle(fdt, compat, addr, "sg_2500_aqr105_phy4");
-		fdt_setprop_string(fdt, offset, "phy-connection-type",
-				   "2500base-x");
-		fdt_status_disabled_by_alias(fdt, "xg_aqr105_phy3");
-	}
-#endif
-}
-
 void fdt_fixup_board_enet(void *fdt)
 {
 }
board/nxp/t208xqds/eth_t208xqds.c +0 -225

231 lines not on this page · raw message

Signature · 1 line
2.47.3
#5 lore raw

PATCH v2 5/11 boards/nxp: remove board_eth_init()

In reply to Michael Walle

board_eth_init() is dead code since commit e524f3a449f5 ("net: Remove eth_legacy.c"). Remove it.

I'm not sure, all the shenanigans are covered by the new DM-version. The MDIO mux and iomux controls probably are. The fman configuration probably isn't. OTOH, nobody cared for years and the called fm_info_set_phy_address() was also removed years ago.

This also removes fdt_fixup_board_enet() for the ls1043a and ls1046a because it relies on the local variable "mdio_mux" being initialized by the board_eth_init().

---
 board/nxp/ls1012afrdm/eth.c               |  10 -
 board/nxp/ls1012ardb/eth.c                |  12 -
 board/nxp/ls1021atsn/ls1021atsn.c         |   5 -
 board/nxp/ls1021atwr/ls1021atwr.c         |   5 -
 board/nxp/ls1028a/ls1028a.c               |   5 -
 board/nxp/ls1043aqds/eth.c                | 391 ------------------
 board/nxp/ls1043ardb/Makefile             |   1 -
 board/nxp/ls1043ardb/eth.c                |  77 ----
 board/nxp/ls1046afrwy/eth.c               |  57 ---
 board/nxp/ls1046aqds/eth.c                | 339 ----------------
 board/nxp/ls1046ardb/eth.c                |  71 ----
 board/nxp/ls2080ardb/eth_ls2080rdb.c      |  19 -
 board/nxp/lx2160a/eth_lx2160aqds.c        |  18 -
 board/nxp/lx2160a/eth_lx2160ardb.c        |  17 -
 board/nxp/lx2160a/eth_lx2162aqds.c        |  18 -
 board/nxp/m5253demo/m5253demo.c           |   7 -
 board/nxp/mx6sxsabreauto/mx6sxsabreauto.c |  52 ---
 board/nxp/mx6sxsabresd/mx6sxsabresd.c     |  78 ----
 board/nxp/p2041rdb/Makefile               |   1 -
 board/nxp/p2041rdb/eth.c                  | 141 -------
 board/nxp/t102xrdb/eth_t102xrdb.c         | 103 -----
 board/nxp/t104xrdb/Makefile               |   1 -
 board/nxp/t104xrdb/eth.c                  |  91 -----
 board/nxp/t208xqds/eth_t208xqds.c         | 460 ----------------------
 board/nxp/t4rdb/eth.c                     | 115 ------
 25 files changed, 2094 deletions(-)
 delete mode 100644 board/nxp/ls1043ardb/eth.c
 delete mode 100644 board/nxp/p2041rdb/eth.c
 delete mode 100644 board/nxp/t104xrdb/eth.c
board/nxp/ls1012afrdm/eth.c +0 -10
index c431e5e611b..8761ec7845e 100644
@@ -7,16 +7,6 @@
 #include <dm.h>
 #include <net.h>
 #include <asm/io.h>
-#include <netdev.h>
-#include <fm_eth.h>
-#include <fsl_mdio.h>
-#include <malloc.h>
-#include <asm/types.h>
-#include <fsl_dtsec.h>
-#include <asm/arch/soc.h>
-#include <asm/arch-fsl-layerscape/config.h>
-#include <asm/arch-fsl-layerscape/immap_lsch2.h>
-#include <asm/arch/fsl_serdes.h>
 #include <linux/delay.h>
 #include <net/pfe_eth/pfe_eth.h>
 #include <dm/platform_data/pfe_dm_eth.h>
board/nxp/ls1012ardb/eth.c +0 -12
index 71cb2988a56..6a6f4608fd1 100644
@@ -6,18 +6,6 @@
 
 #include <config.h>
 #include <dm.h>
-#include <net.h>
-#include <asm/io.h>
-#include <netdev.h>
-#include <fm_eth.h>
-#include <fsl_mdio.h>
-#include <malloc.h>
-#include <asm/types.h>
-#include <fsl_dtsec.h>
-#include <asm/arch/soc.h>
-#include <asm/arch-fsl-layerscape/config.h>
-#include <asm/arch-fsl-layerscape/immap_lsch2.h>
-#include <asm/arch/fsl_serdes.h>
 #include <linux/delay.h>
 #include <net/pfe_eth/pfe_eth.h>
 #include <dm/platform_data/pfe_dm_eth.h>
board/nxp/ls1021atsn/ls1021atsn.c +0 -5
index c92430c0896..277506fdbb8 100644
@@ -123,11 +123,6 @@ int dram_init(void)
 	return 0;
 }
 
-int board_eth_init(struct bd_info *bis)
-{
-	return pci_eth_init(bis);
-}
-
 int board_early_init_f(void)
 {
 	struct ccsr_scfg *scfg = (struct ccsr_scfg *)CFG_SYS_FSL_SCFG_ADDR;
board/nxp/ls1021atwr/ls1021atwr.c +0 -5
index 0758e5eae25..135497f7c5d 100644
@@ -239,11 +239,6 @@ int dram_init(void)
 	return 0;
 }
 
-int board_eth_init(struct bd_info *bis)
-{
-	return pci_eth_init(bis);
-}
-
 #if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
 static void convert_serdes_mux(int type, int need_reset)
 {
board/nxp/ls1028a/ls1028a.c +0 -5
index db94d9c1fa8..007125358bd 100644
@@ -103,11 +103,6 @@ int board_init(void)
 	return 0;
 }
 
-int board_eth_init(struct bd_info *bis)
-{
-	return pci_eth_init(bis);
-}
-
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
board/nxp/ls1043aqds/eth.c +0 -391

399 lines not on this page · raw message

board/nxp/ls1043ardb/Makefile +0 -1
index 95745bf3a9c..13e0411c1ba 100644
@@ -5,6 +5,5 @@
 obj-y += ddr.o
 obj-y += ls1043ardb.o
 ifndef CONFIG_XPL_BUILD
-obj-$(CONFIG_NET) += eth.o
 obj-y += cpld.o
 endif
board/nxp/ls1043ardb/eth.c deleted +0 -77

77 lines not on this page · raw message

board/nxp/ls1046afrwy/eth.c +0 -57

64 lines not on this page · raw message

board/nxp/ls1046aqds/eth.c +0 -339

347 lines not on this page · raw message

board/nxp/ls1046ardb/eth.c +0 -71

78 lines not on this page · raw message

board/nxp/ls2080ardb/eth_ls2080rdb.c +0 -19
index 7d5beb32417..6a8859fd0c5 100644
@@ -9,25 +9,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int board_eth_init(struct bd_info *bis)
-{
-
-#if defined(CONFIG_PHY_AQUANTIA) && !defined(CONFIG_XPL_BUILD)
-	/*
-	 * Export functions to be used by AQ firmware
-	 * upload application
-	 */
-	gd->jt->strcpy = strcpy;
-	gd->jt->mdelay = mdelay;
-	gd->jt->mdio_get_current_dev = mdio_get_current_dev;
-	gd->jt->phy_find_by_mask = phy_find_by_mask;
-	gd->jt->mdio_phydev_for_ethname = mdio_phydev_for_ethname;
-	gd->jt->miiphy_set_current_dev = miiphy_set_current_dev;
-#endif
-
-	return 0;
-}
-
 #if defined(CONFIG_RESET_PHY_R)
 void reset_phy(void)
 {
board/nxp/lx2160a/eth_lx2160aqds.c +0 -18
index 9939bb6f89e..4c16f565b69 100644
@@ -11,24 +11,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int board_eth_init(struct bd_info *bis)
-{
-#ifdef CONFIG_PHY_AQUANTIA
-	/*
-	 * Export functions to be used by AQ firmware
-	 * upload application
-	 */
-	gd->jt->strcpy = strcpy;
-	gd->jt->mdelay = mdelay;
-	gd->jt->mdio_get_current_dev = mdio_get_current_dev;
-	gd->jt->phy_find_by_mask = phy_find_by_mask;
-	gd->jt->mdio_phydev_for_ethname = mdio_phydev_for_ethname;
-	gd->jt->miiphy_set_current_dev = miiphy_set_current_dev;
-#endif
-
-	return 0;
-}
-
 #if defined(CONFIG_RESET_PHY_R)
 void reset_phy(void)
 {
board/nxp/lx2160a/eth_lx2160ardb.c +0 -17
index 90e7c9100e1..31bbac6310e 100644
@@ -11,23 +11,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int board_eth_init(struct bd_info *bis)
-{
-#ifdef CONFIG_PHY_AQUANTIA
-	/*
-	 * Export functions to be used by AQ firmware
-	 * upload application
-	 */
-	gd->jt->strcpy = strcpy;
-	gd->jt->mdelay = mdelay;
-	gd->jt->mdio_get_current_dev = mdio_get_current_dev;
-	gd->jt->phy_find_by_mask = phy_find_by_mask;
-	gd->jt->mdio_phydev_for_ethname = mdio_phydev_for_ethname;
-	gd->jt->miiphy_set_current_dev = miiphy_set_current_dev;
-#endif
-	return pci_eth_init(bis);
-}
-
 #if defined(CONFIG_RESET_PHY_R)
 void reset_phy(void)
 {
board/nxp/lx2160a/eth_lx2162aqds.c +0 -18
index 805aa705be9..81b81d47978 100644
@@ -11,24 +11,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int board_eth_init(struct bd_info *bis)
-{
-#ifdef CONFIG_PHY_AQUANTIA
-	/*
-	 * Export functions to be used by AQ firmware
-	 * upload application
-	 */
-	gd->jt->strcpy = strcpy;
-	gd->jt->mdelay = mdelay;
-	gd->jt->mdio_get_current_dev = mdio_get_current_dev;
-	gd->jt->phy_find_by_mask = phy_find_by_mask;
-	gd->jt->mdio_phydev_for_ethname = mdio_phydev_for_ethname;
-	gd->jt->miiphy_set_current_dev = miiphy_set_current_dev;
-#endif
-
-	return 0;
-}
-
 #if defined(CONFIG_RESET_PHY_R)
 void reset_phy(void)
 {
board/nxp/m5253demo/m5253demo.c +0 -7
index 50c5320b55c..7d4b60b283e 100644
@@ -133,10 +133,3 @@ void ide_set_reset(int idereset)
 	}
 }
 #endif				/* CONFIG_IDE */
-
-#ifdef CONFIG_DRIVER_DM9000
-int board_eth_init(struct bd_info *bis)
-{
-	return dm9000_initialize(bis);
-}
-#endif
board/nxp/mx6sxsabreauto/mx6sxsabreauto.c +0 -52

64 lines not on this page · raw message

board/nxp/mx6sxsabresd/mx6sxsabresd.c +0 -78

100 lines not on this page · raw message

board/nxp/p2041rdb/Makefile +0 -1
index ebd0982b5db..5512458832d 100644
@@ -7,4 +7,3 @@
 obj-y	+= p2041rdb.o
 obj-y	+= cpld.o
 obj-y	+= ddr.o
-obj-y	+= eth.o
board/nxp/p2041rdb/eth.c deleted +0 -141

141 lines not on this page · raw message

board/nxp/t102xrdb/eth_t102xrdb.c +0 -103

109 lines not on this page · raw message

board/nxp/t104xrdb/Makefile +0 -1
index 9bca1a1fbcc..cee574aabb9 100644
@@ -7,7 +7,6 @@ obj-y += spl.o
 else
 obj-y	+= t104xrdb.o
 obj-y	+= cpld.o
-obj-y	+= eth.o
 endif
 obj-y	+= ddr.o
 obj-y	+= law.o
board/nxp/t104xrdb/eth.c deleted +0 -91

91 lines not on this page · raw message

board/nxp/t208xqds/eth_t208xqds.c +0 -460

467 lines not on this page · raw message

board/nxp/t4rdb/eth.c +0 -115

118 lines not on this page · raw message

Signature · 1 line
2.47.3
#6 lore raw

PATCH v2 6/11 boards/nxp: remove empty fdt_fixup_board_enet()

In reply to Michael Walle

Remove any empty function which is just called by the board code. There is no need to define this function at all.

---
 board/nxp/ls1043aqds/Makefile     |  3 ---
 board/nxp/ls1043aqds/eth.c        | 11 ---------
 board/nxp/ls1043aqds/ls1043aqds.c |  4 ----
 board/nxp/ls1046aqds/Makefile     |  3 ---
 board/nxp/ls1046aqds/eth.c        | 11 ---------
 board/nxp/ls1046aqds/ls1046aqds.c |  4 ----
 board/nxp/t102xrdb/Makefile       |  1 -
 board/nxp/t102xrdb/eth_t102xrdb.c | 31 -------------------------
 board/nxp/t102xrdb/t102xrdb.c     |  1 -
 board/nxp/t102xrdb/t102xrdb.h     |  1 -
 board/nxp/t104xrdb/t104xrdb.h     |  1 -
 board/nxp/t208xqds/Makefile       |  2 +-
 board/nxp/t208xqds/eth_t208xqds.c | 38 -------------------------------
 board/nxp/t208xqds/t208xqds.c     |  1 -
 board/nxp/t208xqds/t208xqds.h     |  1 -
 board/nxp/t208xrdb/eth_t208xrdb.c |  5 ----
 board/nxp/t208xrdb/t208xrdb.c     |  1 -
 board/nxp/t208xrdb/t208xrdb.h     |  1 -
 board/nxp/t4rdb/Makefile          |  1 -
 board/nxp/t4rdb/eth.c             | 37 ------------------------------
 board/nxp/t4rdb/t4240rdb.c        |  1 -
 board/nxp/t4rdb/t4rdb.h           |  1 -
 22 files changed, 1 insertion(+), 159 deletions(-)
 delete mode 100644 board/nxp/ls1043aqds/eth.c
 delete mode 100644 board/nxp/ls1046aqds/eth.c
 delete mode 100644 board/nxp/t102xrdb/eth_t102xrdb.c
 delete mode 100644 board/nxp/t208xqds/eth_t208xqds.c
 delete mode 100644 board/nxp/t4rdb/eth.c
board/nxp/ls1043aqds/Makefile +0 -3
index ff830788fd7..98ad49f6f0c 100644
@@ -5,7 +5,4 @@
 #
 
 obj-y += ddr.o
-ifndef CONFIG_XPL_BUILD
-obj-y += eth.o
-endif
 obj-y += ls1043aqds.o
board/nxp/ls1043aqds/eth.c deleted +0 -11
deleted file mode 100644
index d62cf74732c..00000000000
@@ -1,11 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright 2015 Freescale Semiconductor, Inc.
- * Copyright 2019 NXP
- */
-
-#include <fdt_support.h>
-
-void fdt_fixup_board_enet(void *fdt)
-{
-}
board/nxp/ls1043aqds/ls1043aqds.c +0 -4
index f043599fbb8..0f115c16232 100644
@@ -550,10 +550,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	fdt_fixup_memory_banks(blob, base, size, 2);
 	ft_cpu_setup(blob, bd);
 
-#ifdef CONFIG_FMAN_ENET
-	fdt_fixup_board_enet(blob);
-#endif
-
 	fdt_fixup_icid(blob);
 
 	reg = QIXIS_READ(brdcfg[0]);
board/nxp/ls1046aqds/Makefile +0 -3
index 365247d92bc..8292726b0e4 100644
@@ -5,7 +5,4 @@
 #
 
 obj-y += ddr.o
-ifndef CONFIG_XPL_BUILD
-obj-y += eth.o
-endif
 obj-y += ls1046aqds.o
board/nxp/ls1046aqds/eth.c deleted +0 -11
deleted file mode 100644
index 24e6c93aece..00000000000
@@ -1,11 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright 2016 Freescale Semiconductor, Inc.
- * Copyright 2018-2020 NXP
- */
-
-#include <fdt_support.h>
-
-void fdt_fixup_board_enet(void *fdt)
-{
-}
board/nxp/ls1046aqds/ls1046aqds.c +0 -4
index 7df12550868..679b0b2235f 100644
@@ -434,10 +434,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	fdt_fixup_memory_banks(blob, base, size, 2);
 	ft_cpu_setup(blob, bd);
 
-#ifdef CONFIG_FMAN_ENET
-	fdt_fixup_board_enet(blob);
-#endif
-
 	fdt_fixup_icid(blob);
 
 	reg = QIXIS_READ(brdcfg[0]);
board/nxp/t102xrdb/Makefile +0 -1
index b0f27c47191..2a360227418 100644
@@ -9,7 +9,6 @@ obj-y	+= spl.o
 else
 obj-y   += t102xrdb.o
 obj-$(CONFIG_TARGET_T1024RDB)   += cpld.o
-obj-y   += eth_t102xrdb.o
 endif
 obj-y   += ddr.o
 obj-y   += law.o
board/nxp/t102xrdb/eth_t102xrdb.c deleted +0 -31
deleted file mode 100644
index a07d242c1eb..00000000000
@@ -1,31 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright 2014 Freescale Semiconductor, Inc.
- *
- * Shengzhou Liu <[email protected]>
- */
-
-#include <config.h>
-#include <command.h>
-#include <fdt_support.h>
-#include <net.h>
-#include <netdev.h>
-#include <asm/mmu.h>
-#include <asm/processor.h>
-#include <asm/immap_85xx.h>
-#include <asm/fsl_law.h>
-#include <asm/fsl_serdes.h>
-#include <asm/fsl_portals.h>
-#include <asm/fsl_liodn.h>
-#include <malloc.h>
-#include <fm_eth.h>
-#include <fsl_mdio.h>
-#include <miiphy.h>
-#include <phy.h>
-#include <fsl_dtsec.h>
-#include <asm/fsl_serdes.h>
-#include "../common/fman.h"
-
-void fdt_fixup_board_enet(void *fdt)
-{
-}
board/nxp/t102xrdb/t102xrdb.c +0 -1
index 0a29e27b42c..02223497dd3 100644
@@ -207,7 +207,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 #ifndef CONFIG_DM_ETH
 	fdt_fixup_fman_ethernet(blob);
 #endif
-	fdt_fixup_board_enet(blob);
 #endif
 
 #ifdef CONFIG_TARGET_T1023RDB
board/nxp/t102xrdb/t102xrdb.h +0 -1
index 33df0f24df8..71e2cfea22e 100644
@@ -6,7 +6,6 @@
 #ifndef __T1024_RDB_H__
 #define __T1024_RDB_H__
 
-void fdt_fixup_board_enet(void *blob);
 void pci_of_setup(void *blob, struct bd_info *bd);
 #ifdef CONFIG_TARGET_T1023RDB
 static u32 t1023rdb_ctrl(u32 ctrl_type);
board/nxp/t104xrdb/t104xrdb.h +0 -1
index 678724c7e2b..5825e69cdb4 100644
@@ -6,7 +6,6 @@
 #ifndef __T104x_RDB_H__
 #define __T104x_RDB_H__
 
-void fdt_fixup_board_enet(void *blob);
 void pci_of_setup(void *blob, struct bd_info *bd);
 
 #endif
board/nxp/t208xqds/Makefile +1 -1
index eb99d921b4a..4bfd2b50d8f 100644
@@ -7,7 +7,7 @@
 ifdef CONFIG_XPL_BUILD
 obj-y += spl.o
 else
-obj-$(CONFIG_TARGET_T2080QDS) += t208xqds.o eth_t208xqds.o
+obj-$(CONFIG_TARGET_T2080QDS) += t208xqds.o
 endif
 
 obj-y   += ddr.o
board/nxp/t208xqds/eth_t208xqds.c deleted +0 -38
deleted file mode 100644
index e6aeb9bb66f..00000000000
@@ -1,38 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright 2013 Freescale Semiconductor, Inc.
- * Copyright 2020 NXP
- *
- * Shengzhou Liu <[email protected]>
- */
-
-#include <config.h>
-#include <command.h>
-#include <fdt_support.h>
-#include <log.h>
-#include <net.h>
-#include <netdev.h>
-#include <asm/mmu.h>
-#include <asm/processor.h>
-#include <asm/immap_85xx.h>
-#include <asm/fsl_law.h>
-#include <asm/fsl_serdes.h>
-#include <asm/fsl_portals.h>
-#include <asm/fsl_liodn.h>
-#include <malloc.h>
-#include <fm_eth.h>
-#include <fsl_mdio.h>
-#include <miiphy.h>
-#include <phy.h>
-#include <fsl_dtsec.h>
-#include <asm/fsl_serdes.h>
-#include <hwconfig.h>
-#include "../common/qixis.h"
-#include "../common/fman.h"
-#include "t208xqds_qixis.h"
-#include <linux/libfdt.h>
-
-void fdt_fixup_board_enet(void *fdt)
-{
-	return;
-}
board/nxp/t208xqds/t208xqds.c +0 -1
index 5e71da0e163..329cf59793f 100644
@@ -419,7 +419,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 #ifndef CONFIG_DM_ETH
 	fdt_fixup_fman_ethernet(blob);
 #endif
-	fdt_fixup_board_enet(blob);
 #endif
 
 	return 0;
board/nxp/t208xqds/t208xqds.h +0 -1
index 50ebb6f6f98..4086f8c010a 100644
@@ -6,7 +6,6 @@
 #ifndef __CORENET_DS_H__
 #define __CORENET_DS_H__
 
-void fdt_fixup_board_enet(void *blob);
 void pci_of_setup(void *blob, struct bd_info *bd);
 
 #endif
board/nxp/t208xrdb/eth_t208xrdb.c +0 -5
index 5223eccb280..c9e415bc446 100644
@@ -93,8 +93,3 @@ void fdt_fixup_board_phy(void *fdt)
 		printf("Unable to rename node ethernet-phy@1: %s\n",
 		       fdt_strerror(ret));
 }
-
-void fdt_fixup_board_enet(void *fdt)
-{
-	return;
-}
board/nxp/t208xrdb/t208xrdb.c +0 -1
index d93edf007ad..d47ec91e7d0 100644
@@ -160,7 +160,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 
 #ifdef CONFIG_SYS_DPAA_FMAN
 	fdt_fixup_board_fman_ethernet(blob);
-	fdt_fixup_board_enet(blob);
 	fdt_fixup_board_phy(blob);
 #endif
 
board/nxp/t208xrdb/t208xrdb.h +0 -1
index 26998898e82..e800270a0e2 100644
@@ -10,7 +10,6 @@
 #define CORTINA_FW_ADDR_IFCNOR				0xefe00000
 #define CORTINA_FW_ADDR_IFCNOR_ALTBANK		0xebe00000
 
-void fdt_fixup_board_enet(void *blob);
 void pci_of_setup(void *blob, struct bd_info *bd);
 void fdt_fixup_board_fman_ethernet(void *blob);
 void fdt_fixup_board_phy(void *blob);
board/nxp/t4rdb/Makefile +0 -1
index 8d94faaba1c..6d9b8df2fc1 100644
@@ -9,7 +9,6 @@ obj-y	+= spl.o
 else
 obj-$(CONFIG_TARGET_T4240RDB)	+= t4240rdb.o
 obj-y			+= cpld.o
-obj-y			+= eth.o
 endif
 
 obj-y	+= ddr.o
board/nxp/t4rdb/eth.c deleted +0 -37
deleted file mode 100644
index dc2390f1003..00000000000
@@ -1,37 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright 2014 Freescale Semiconductor, Inc.
- *
- * Chunhe Lan <[email protected]>
- */
-
-#include <config.h>
-#include <command.h>
-#include <fdt_support.h>
-#include <net.h>
-#include <netdev.h>
-#include <asm/mmu.h>
-#include <asm/processor.h>
-#include <asm/cache.h>
-#include <asm/immap_85xx.h>
-#include <asm/fsl_law.h>
-#include <fsl_ddr_sdram.h>
-#include <asm/fsl_serdes.h>
-#include <asm/fsl_portals.h>
-#include <asm/fsl_liodn.h>
-#include <malloc.h>
-#include <fm_eth.h>
-#include <fsl_mdio.h>
-#include <miiphy.h>
-#include <phy.h>
-#include <fsl_dtsec.h>
-#include <asm/fsl_serdes.h>
-#include <hwconfig.h>
-
-#include "../common/fman.h"
-#include "t4rdb.h"
-
-void fdt_fixup_board_enet(void *fdt)
-{
-	return;
-}
board/nxp/t4rdb/t4240rdb.c +0 -1
index 5cacfd27380..11e2c0f78b7 100644
@@ -128,7 +128,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 #ifndef CONFIG_DM_ETH
 	fdt_fixup_fman_ethernet(blob);
 #endif
-	fdt_fixup_board_enet(blob);
 #endif
 
 	return 0;
board/nxp/t4rdb/t4rdb.h +0 -1
index bb3ce216d7d..9ec190c03cb 100644
@@ -14,7 +14,6 @@
 #define CORTINA_FW_ADDR_IFCNOR				0xefe00000
 #define CORTINA_FW_ADDR_IFCNOR_ALTBANK		0xebf00000
 
-void fdt_fixup_board_enet(void *blob);
 void pci_of_setup(void *blob, struct bd_info *bd);
 
 #endif
Signature · 1 line
2.47.3
#7 lore raw

PATCH v2 7/11 p2041rdb: use the upstream device tree

In reply to Michael Walle

Switch to the upstream device tree, which already includes the UART nodes we need for the DM.

We also need to increase malloc area before relocation otherwise you'll get the following error and the board panics:

DRAM: Initializing....using SPD
alloc space exhausted ptr 414 limit 400

---
 arch/powerpc/dts/Makefile             |   1 -
 arch/powerpc/dts/p2041.dtsi           | 138 --------------------------
 arch/powerpc/dts/p2041rdb-u-boot.dtsi |  19 ++++
 arch/powerpc/dts/p2041rdb.dts         | 127 ------------------------
 arch/powerpc/dts/p2041si-post.dtsi    |  43 --------
 configs/P2041RDB_SPIFLASH_defconfig   |   4 +-
 configs/P2041RDB_defconfig            |   4 +-
 include/configs/P2041RDB.h            |   2 +
 8 files changed, 27 insertions(+), 311 deletions(-)
 delete mode 100644 arch/powerpc/dts/p2041.dtsi
 create mode 100644 arch/powerpc/dts/p2041rdb-u-boot.dtsi
 delete mode 100644 arch/powerpc/dts/p2041rdb.dts
 delete mode 100644 arch/powerpc/dts/p2041si-post.dtsi
arch/powerpc/dts/Makefile +0 -1
index 766b0c05951..4fd3478ac2f 100644
@@ -14,7 +14,6 @@ dtb-$(CONFIG_TARGET_P1010RDB_PB) += p1010rdb-pb.dtb p1010rdb-pb_36b.dtb
 dtb-$(CONFIG_TARGET_P1020RDB_PC) += p1020rdb-pc.dtb p1020rdb-pc_36b.dtb
 dtb-$(CONFIG_TARGET_P1020RDB_PD) += p1020rdb-pd.dtb
 dtb-$(CONFIG_TARGET_P2020RDB) += p2020rdb-pc.dtb p2020rdb-pc_36b.dtb
-dtb-$(CONFIG_TARGET_P2041RDB) += p2041rdb.dtb
 dtb-$(CONFIG_TARGET_P3041DS) += p3041ds.dtb
 dtb-$(CONFIG_TARGET_P4080DS) += p4080ds.dtb
 dtb-$(CONFIG_TARGET_P5040DS) += p5040ds.dtb
arch/powerpc/dts/p2041.dtsi deleted +0 -138

138 lines not on this page · raw message

arch/powerpc/dts/p2041rdb-u-boot.dtsi new file +19 -0
new file mode 100644
index 00000000000..1dc83cf846b
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+&serial0 {
+	bootph-all;
+};
+
+&soc {
+	i2c@118000 {
+		bootph-all;
+	};
+
+	spi@110000 {
+		flash@0 {
+			spi-max-frequency = <10000000>;
+		};
+	};
+};
+
+#include "u-boot.dtsi"
arch/powerpc/dts/p2041rdb.dts deleted +0 -127

127 lines not on this page · raw message

arch/powerpc/dts/p2041si-post.dtsi deleted +0 -43

43 lines not on this page · raw message

configs/P2041RDB_SPIFLASH_defconfig +3 -1
index 1b7389178be..465b3ee7dc7 100644
@@ -1,11 +1,12 @@
 CONFIG_PPC=y
 CONFIG_TEXT_BASE=0xFFF40000
 CONFIG_SYS_MALLOC_LEN=0x100000
+CONFIG_SYS_MALLOC_F_LEN=0x600
 CONFIG_SF_DEFAULT_SPEED=10000000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_OFFSET=0x100000
 CONFIG_ENV_SECT_SIZE=0x10000
-CONFIG_DEFAULT_DEVICE_TREE="p2041rdb"
+CONFIG_DEFAULT_DEVICE_TREE="fsl/p2041rdb"
 CONFIG_SYS_MONITOR_LEN=786432
 CONFIG_MPC85xx=y
 CONFIG_SYS_INIT_RAM_LOCK=y
@@ -56,6 +57,7 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
+CONFIG_OF_UPSTREAM=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/P2041RDB_defconfig +3 -1
index b6c28db4f10..9c3e95093bf 100644
@@ -1,10 +1,11 @@
 CONFIG_PPC=y
 CONFIG_TEXT_BASE=0xEFF40000
 CONFIG_SYS_MALLOC_LEN=0x100000
+CONFIG_SYS_MALLOC_F_LEN=0x600
 CONFIG_SF_DEFAULT_SPEED=10000000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_SECT_SIZE=0x20000
-CONFIG_DEFAULT_DEVICE_TREE="p2041rdb"
+CONFIG_DEFAULT_DEVICE_TREE="fsl/p2041rdb"
 CONFIG_SYS_MONITOR_LEN=786432
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_MPC85xx=y
@@ -52,6 +53,7 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
+CONFIG_OF_UPSTREAM=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_USE_BOOTFILE=y
include/configs/P2041RDB.h +2 -0
index f88fb9cdb9a..3525e29acc4 100644
@@ -149,6 +149,8 @@
  * shorted - index 1
  */
 
+#define CFG_SYS_NS16550_CLK          (get_bus_freq(0) / 2)
+
 #define CFG_SYS_BAUDRATE_TABLE	\
 	{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
 
Signature · 1 line
2.47.3
#8 lore raw

PATCH v2 8/11 p2041rdb: support SDcard boot

In reply to Michael Walle

The RCW was just supporting SPI boot. Add a second one for the SDcard boot. While at it, use the same naming scheme as for the other NXP boards.

---
 board/nxp/p2041rdb/p2041rdb_rcw_sd.cfg                | 11 +++++++++++
 .../{rcw_p2041rdb.cfg => p2041rdb_rcw_spi.cfg}        |  0
 configs/P2041RDB_SDCARD_defconfig                     |  6 ++++--
 configs/P2041RDB_SPIFLASH_defconfig                   |  2 +-
 4 files changed, 16 insertions(+), 3 deletions(-)
 create mode 100644 board/nxp/p2041rdb/p2041rdb_rcw_sd.cfg
 rename board/nxp/p2041rdb/{rcw_p2041rdb.cfg => p2041rdb_rcw_spi.cfg} (100%)
board/nxp/p2041rdb/p2041rdb_rcw_sd.cfg new file +11 -0
new file mode 100644
index 00000000000..f22f3335e73
@@ -0,0 +1,11 @@
+#
+# Default RCW for P2041RDB.
+#
+
+#PBL preamble and RCW header
+aa55aa55 010e0100
+#64 bytes RCW data
+12600000 00000000 241C0000 00000000
+649FA0C1 C3C02000 68000000 40000000
+00000000 00000000 00000000 D0030F07
+00000000 00000000 00000000 00000000
board/nxp/p2041rdb/p2041rdb_rcw_spi.cfg renamed from board/nxp/p2041rdb/rcw_p2041rdb.cfg +0 -0
similarity index 100%
rename from board/nxp/p2041rdb/rcw_p2041rdb.cfg
rename to board/nxp/p2041rdb/p2041rdb_rcw_spi.cfg
configs/P2041RDB_SDCARD_defconfig +4 -2
index ad04e2a1172..88695e1cabe 100644
@@ -1,10 +1,11 @@
 CONFIG_PPC=y
 CONFIG_TEXT_BASE=0xFFF40000
 CONFIG_SYS_MALLOC_LEN=0x100000
+CONFIG_SYS_MALLOC_F_LEN=0x600
 CONFIG_SF_DEFAULT_SPEED=10000000
 CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_OFFSET=0xCF400
-CONFIG_DEFAULT_DEVICE_TREE="p2041rdb"
+CONFIG_DEFAULT_DEVICE_TREE="fsl/p2041rdb"
 CONFIG_SYS_MONITOR_LEN=786432
 CONFIG_MPC85xx=y
 CONFIG_SYS_INIT_RAM_LOCK=y
@@ -28,7 +29,7 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_RAMBOOT_PBL=y
 CONFIG_SYS_FSL_PBL_PBI="board/nxp/p2041rdb/pbi.cfg"
-CONFIG_SYS_FSL_PBL_RCW="board/nxp/p2041rdb/rcw_p2041rdb.cfg"
+CONFIG_SYS_FSL_PBL_RCW="board/nxp/p2041rdb/p2041rdb_rcw_sd.cfg"
 CONFIG_BOOTDELAY=10
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
@@ -54,6 +55,7 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
+CONFIG_OF_UPSTREAM=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
configs/P2041RDB_SPIFLASH_defconfig +1 -1
index 465b3ee7dc7..fc187eb311c 100644
@@ -31,7 +31,7 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_RAMBOOT_PBL=y
 CONFIG_SPIFLASH=y
 CONFIG_SYS_FSL_PBL_PBI="board/nxp/p2041rdb/pbi.cfg"
-CONFIG_SYS_FSL_PBL_RCW="board/nxp/p2041rdb/rcw_p2041rdb.cfg"
+CONFIG_SYS_FSL_PBL_RCW="board/nxp/p2041rdb/p2041rdb_rcw_spi.cfg"
 CONFIG_BOOTDELAY=10
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
Signature · 1 line
2.47.3
#9 lore raw

PATCH v2 9/11 p2041rdb: update README and fix typos

In reply to Michael Walle

Nowadays, u-boot can build the pbl image itself. Refer to that image in the documentation. Also fix some typos.

---
 board/nxp/p2041rdb/README | 34 ++++++++++++----------------------
 1 file changed, 12 insertions(+), 22 deletions(-)
board/nxp/p2041rdb/README +12 -22
index ae770277372..c2a2f0ed9e5 100644
@@ -43,20 +43,16 @@ Boot from SDCard
 	make P2041RDB_SDCARD_config
 	make all
 
-2. Generate PBL imge
-   Use PE tool to produce a image used to be programed to
-   SDCard which contains RCW and U-Boot image.
-
-3. Program the PBL image to SDCard
-	=> tftp 1000000 pbl_sd.bin
-	=> mmcinfo
+2. Program the PBL image to SDCard
+	=> tftp 1000000 u-boot.pbl
+	=> mmc info
 	=> mmc write 1000000 8 672
 
-4. Program FMAN Firmware ucode
+3. Program FMAN Firmware ucode
 	=> tftp 1000000 ucode.bin
 	=> mmc write 1000000 690 10
 
-5. Change DIP-switch
+4. Change DIP-switch
 	SW1[1-5] = 01100
 	Note: 1 stands for 'on', 0 stands for 'off'
 
@@ -66,22 +62,16 @@ Boot from SPI flash
 	make P2041RDB_SPIFLASH_config
 	make all
 
-2. Generate PBL imge
-   Use PE tool to produce a image used to be programed to
-   SPI flash which contains RCW and U-Boot image.
+2. Program the PBL image to SPI flash
+	=> tftp 1000000 u-boot.pbl
+	=> sf probe 0
+	=> sf update $fileaddr 0 $filesize
 
-3. Program the PBL image to SPI flash
-	=> tftp 1000000 pbl_spi.bin
-	=> spi probe 0
-	=> sf erase 0 100000
-	=> sf write 1000000 0 $filesize
-
-4. Program FMAN Firmware ucode
+3. Program FMAN Firmware ucode
 	=> tftp 1000000 ucode.bin
-	=> sf erase 110000 10000
-	=> sf write 1000000 110000 $filesize
+	=> sf update $fileaddr 110000 $filesize
 
-5. Change DIP-switch
+4. Change DIP-switch
 	SW1[1-5] = 10100
 	Note: 1 stands for 'on', 0 stands for 'off'
 
Signature · 1 line
2.47.3
#10 lore raw

PATCH v2 10/11 p2041rdb: remove NAND defconfig

In reply to Michael Walle

The RDB doesn't support NAND boot at all, remove the config for it. Apparently, it was introduced by commit dd84058d24ff ("kconfig: add board Kconfig and defconfig files") which ran some scripts. Maybe that script was wrong or the source boards.cfg was wrong. In any case, there is no NAND flash on the RDB.

---
 configs/P2041RDB_NAND_defconfig | 117 --------------------------------
 1 file changed, 117 deletions(-)
 delete mode 100644 configs/P2041RDB_NAND_defconfig
configs/P2041RDB_NAND_defconfig deleted +0 -117
deleted file mode 100644
index 1bef841990f..00000000000
@@ -1,117 +0,0 @@
-CONFIG_PPC=y
-CONFIG_TEXT_BASE=0xFFF40000
-CONFIG_SYS_MALLOC_LEN=0x100000
-CONFIG_SF_DEFAULT_SPEED=10000000
-CONFIG_ENV_SIZE=0x20000
-CONFIG_ENV_OFFSET=0xE0000
-CONFIG_DEFAULT_DEVICE_TREE="p2041rdb"
-CONFIG_SYS_MONITOR_LEN=786432
-CONFIG_MPC85xx=y
-CONFIG_SYS_INIT_RAM_LOCK=y
-CONFIG_SYS_SRIO=y
-CONFIG_SRIO1=y
-CONFIG_SRIO2=y
-CONFIG_SRIO_PCIE_BOOT_MASTER=y
-CONFIG_TARGET_P2041RDB=y
-CONFIG_MPC85XX_HAVE_RESET_VECTOR=y
-CONFIG_ENABLE_36BIT_PHYS=y
-CONFIG_SYS_BOOK3E_HV=y
-CONFIG_SYS_CACHE_STASHING=y
-CONFIG_USE_UBOOTPATH=y
-CONFIG_PCIE1=y
-CONFIG_PCIE2=y
-CONFIG_PCIE3=y
-CONFIG_SYS_FSL_NUM_CC_PLLS=2
-CONFIG_MP=y
-CONFIG_DYNAMIC_SYS_CLK_FREQ=y
-CONFIG_FIT=y
-CONFIG_FIT_VERBOSE=y
-CONFIG_RAMBOOT_PBL=y
-CONFIG_SYS_FSL_PBL_PBI="board/nxp/p2041rdb/pbi.cfg"
-CONFIG_SYS_FSL_PBL_RCW="board/nxp/p2041rdb/rcw_p2041rdb.cfg"
-CONFIG_BOOTDELAY=10
-CONFIG_OF_BOARD_SETUP=y
-CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_USE_BOOTCOMMAND=y
-CONFIG_BOOTCOMMAND="setenv bootargs root=/dev/$bdev rw console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr"
-CONFIG_SYS_PBSIZE=276
-CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_BOARD_EARLY_INIT_R=y
-CONFIG_ID_EEPROM=y
-CONFIG_HUSH_PARSER=y
-CONFIG_CMD_IMLS=y
-CONFIG_CMD_GREPENV=y
-CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2
-CONFIG_CMD_DM=y
-CONFIG_CMD_I2C=y
-CONFIG_LOADS_ECHO=y
-CONFIG_SYS_LOADS_BAUD_CHANGE=y
-CONFIG_CMD_MMC=y
-CONFIG_CMD_USB=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_FAT=y
-CONFIG_OF_CONTROL=y
-CONFIG_ENV_OVERWRITE=y
-CONFIG_ENV_IS_IN_NAND=y
-CONFIG_ENV_RELOC_GD_ENV_ADDR=y
-CONFIG_USE_BOOTFILE=y
-CONFIG_BOOTFILE="uImage"
-CONFIG_USE_ETHPRIME=y
-CONFIG_ETHPRIME="FM1@DTSEC1"
-CONFIG_USE_ROOTPATH=y
-CONFIG_FSL_SATA_V2=y
-CONFIG_SYS_SATA_MAX_DEVICE=2
-CONFIG_FSL_CAAM=y
-CONFIG_SYS_BR0_PRELIM_BOOL=y
-CONFIG_SYS_BR0_PRELIM=0xFFA00C21
-CONFIG_SYS_OR0_PRELIM=0xFFFC0796
-CONFIG_SYS_BR1_PRELIM_BOOL=y
-CONFIG_SYS_BR1_PRELIM=0xE8001001
-CONFIG_SYS_OR1_PRELIM=0xF8000F85
-CONFIG_SYS_BR3_PRELIM_BOOL=y
-CONFIG_SYS_BR3_PRELIM=0xFFDF0801
-CONFIG_SYS_OR3_PRELIM=0xFFFFEFF7
-CONFIG_DM_I2C=y
-CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
-CONFIG_SYS_I2C_FSL=y
-CONFIG_SYS_I2C_EEPROM_ADDR=0x50
-CONFIG_FSL_ESDHC=y
-CONFIG_MTD=y
-CONFIG_MTD_NOR_FLASH=y
-CONFIG_FLASH_CFI_DRIVER=y
-CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
-CONFIG_SYS_FLASH_EMPTY_INFO=y
-CONFIG_SYS_FLASH_CFI=y
-CONFIG_SYS_FLASH_QUIET_TEST=y
-CONFIG_SYS_MAX_FLASH_SECT=1024
-CONFIG_MTD_RAW_NAND=y
-CONFIG_NAND_FSL_ELBC=y
-CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH_SPANSION=y
-CONFIG_PHYLIB=y
-CONFIG_PHYLIB_10G=y
-CONFIG_PHY_TERANETICS=y
-CONFIG_PHY_VITESSE=y
-CONFIG_DM_MDIO=y
-CONFIG_PHY_GIGE=y
-CONFIG_E1000=y
-CONFIG_FMAN_ENET=y
-CONFIG_SYS_FMAN_FW_ADDR=0x100000
-CONFIG_MII=y
-CONFIG_PCIE_FSL=y
-CONFIG_SYS_QE_FMAN_FW_IN_NAND=y
-CONFIG_DM_SERIAL=y
-CONFIG_SYS_NS16550=y
-CONFIG_SPI=y
-CONFIG_DM_SPI=y
-CONFIG_FSL_ESPI=y
-CONFIG_USB=y
-CONFIG_USB_EHCI_FSL=y
-CONFIG_USB_MAX_CONTROLLER_COUNT=2
-CONFIG_USB_STORAGE=y
-CONFIG_ADDR_MAP=y
-CONFIG_SYS_NUM_ADDR_MAP=64
-CONFIG_POST=y
Signature · 1 line
2.47.3
#11 lore raw

PATCH v2 11/11 p2041rdb: convert README to rst

In reply to Michael Walle

Convert the README to reST format.

---
 board/nxp/p2041rdb/README     | 128 -----------------------------
 board/nxp/p2041rdb/README.rst | 147 ++++++++++++++++++++++++++++++++++
 2 files changed, 147 insertions(+), 128 deletions(-)
 delete mode 100644 board/nxp/p2041rdb/README
 create mode 100644 board/nxp/p2041rdb/README.rst
board/nxp/p2041rdb/README deleted +0 -128
deleted file mode 100644
index c2a2f0ed9e5..00000000000
@@ -1,128 +0,0 @@
-Overview
-=========
-The P2041 Processor combines four Power Architecture processor cores
-with high-performance datapath acceleration architecture(DPAA), CoreNet
-fabric infrastructure, as well as network and peripheral bus interfaces
-required for networking, telecom/datacom, wireless infrastructure, and
-military/aerospace applications.
-
-P2041RDB board is a quad core platform supporting the P2041 processor
-of QorIQ DPAA series.
-
-Boot from NOR flash
-===================
-1. Build image
-	make P2041RDB_config
-	make all
-
-2. Program image
-	=> tftp 1000000 u-boot.bin
-	=> protect off all
-	=> erase eff40000 efffffff
-	=> cp.b 1000000 eff40000 c0000
-
-3. Program RCW
-	=> tftp 1000000 rcw.bin
-	=> protect off all
-	=> erase e8000000 e801ffff
-	=> cp.b 1000000 e8000000 50
-
-4. Program FMAN Firmware ucode
-	=> tftp 1000000 ucode.bin
-	=> protect off all
-	=> erase eff00000 eff3ffff
-	=> cp.b 1000000 eff00000 2000
-
-5. Change DIP-switch
-	SW1[1-5] = 10110
-	Note: 1 stands for 'on', 0 stands for 'off'
-
-Boot from SDCard
-===================
-1. Build image
-	make P2041RDB_SDCARD_config
-	make all
-
-2. Program the PBL image to SDCard
-	=> tftp 1000000 u-boot.pbl
-	=> mmc info
-	=> mmc write 1000000 8 672
-
-3. Program FMAN Firmware ucode
-	=> tftp 1000000 ucode.bin
-	=> mmc write 1000000 690 10
-
-4. Change DIP-switch
-	SW1[1-5] = 01100
-	Note: 1 stands for 'on', 0 stands for 'off'
-
-Boot from SPI flash
-===================
-1. Build image
-	make P2041RDB_SPIFLASH_config
-	make all
-
-2. Program the PBL image to SPI flash
-	=> tftp 1000000 u-boot.pbl
-	=> sf probe 0
-	=> sf update $fileaddr 0 $filesize
-
-3. Program FMAN Firmware ucode
-	=> tftp 1000000 ucode.bin
-	=> sf update $fileaddr 110000 $filesize
-
-4. Change DIP-switch
-	SW1[1-5] = 10100
-	Note: 1 stands for 'on', 0 stands for 'off'
-
-Device tree support and how to enable it for different configs
---------------------------------------------------------------
-Device tree support is available for p2041rdb for below mentioned boot,
-1. NOR Boot
-2. NAND Boot
-3. SD Boot
-4. SPIFLASH Boot
-
-To enable device tree support for other boot, below configs need to be
-enabled in relative defconfig file,
-1. CONFIG_DEFAULT_DEVICE_TREE="p2041rdb" (Change default device tree name if required)
-2. CONFIG_OF_CONTROL
-3. CONFIG_MPC85XX_HAVE_RESET_VECTOR if reset vector is located at
-   CFG_RESET_VECTOR_ADDRESS - 0xffc
-
-CPLD command
-============
-The CPLD is used to control the power sequence and some serdes lane
-mux function.
-
-cpld reset			 - hard reset to default bank
-cpld reset altbank		 - reset to alternate bank
-cpld lane_mux <lane> <mux_value> - set multiplexed lane pin
-		lane 6: 0 -> slot1 (Default)
-			1 -> SGMII
-		lane a: 0 -> slot2 (Default)
-			1 -> AURORA
-		lane c: 0 -> slot2 (Default)
-			1 -> SATA0
-		lane d: 0 -> slot2 (Default)
-			1 -> SATA1
-
-Using the Device Tree Source File
-=================================
-To create the DTB (Device Tree Binary) image file, use a command
-similar to this:
-	dtc -O dtb -b 0 -p 1024 p2041rdb.dts > p2041rdb.dtb
-
-Or use the following command:
-	{linux-2.6}/make p2041rdb.dtb ARCH=powerpc
-
-then the dtb file will be generated under the following directory:
-	{linux-2.6}/arch/powerpc/boot/p2041rdb.dtb
-
-Booting Linux
-=============
-Place a linux uImage in the TFTP disk area.
-	tftp 1000000 uImage
-	tftp 2000000 rootfs.ext2.gz.uboot
-	tftp 3000000 p2041rdb.dtb
-	bootm 1000000 2000000 3000000
board/nxp/p2041rdb/README.rst new file +147 -0

147 lines not on this page · raw message

Signature · 1 line
2.47.3
#13 lore raw
In reply to Michael Walle

Hi Michael,

Quoted 4 lines · Michael Walle

While working on an ancient P2041 based board, I've encountered several issues.

Quoted 12 lines

Michael Walle (11):
powerpc: fix call to cpu_init_r
caam: don't write memory at 0 on PPC
spi: fsl_espi: fix read transactions
boards: remove dead fman code
boards/nxp: remove board_eth_init()
boards/nxp: remove empty fdt_fixup_board_enet()
p2041rdb: use the upstream device tree
p2041rdb: support SDcard boot
p2041rdb: update README and fix typos
p2041rdb: remove NAND defconfig
p2041rdb: convert README to rst

I applied this patchset. There are some conflicts that I fixed, it would be good if base-commit could be added in the patchset.

For the last patch, you could use a follow up patch to move the rst to doc.

Regards
Peng