Skip to contentSkip to conversation

LS1012A PFE driver patch series

PATCH In review Calvin Johnson 2 participants 28 messages Mar 8, 2018 – Mar 27, 2018

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

v4 cover LS1012A PFE driver patch series

This patch series introduces U-Boot support for NXP's LS1012A Packet Forwarding Engine (pfe_eth). LS1012A uses hardware packet forwarding engine to provide high performance Ethernet interfaces. The device includes two Ethernet ports.

Changes in v4:
-Compile pfe driver conditionally with CONFIG_FSL_PFE -Compile pfe driver conditionally with CONFIG_FSL_PFE -Compile pfe driver conditionally with CONFIG_FSL_PFE -Fix typo "ppfe stop"

Changes in v3:
-Update header location to include/net/pfe_eth -Replace EMACX_PHY_ADDR with CONFIG_PFE_EMACX_PHY_ADDR -Update header location to include/net/pfe_eth -Move pfe_eth header files to include/net/pfe_eth -Use BIT macro wherever applicable
-Update Kconfig
-Update header file location to include/net/pfe_eth -Cosmetic changes
-Update Kconfig
-Update header file location to include/net/pfe_eth -Prefix CONFIG_PFE_ to appropriate macros -Update Kconfig
-Update header file location to include/net/pfe_eth -Update Kconfig
-Update header file location to include/net/pfe_eth -Prefix CONFIG_PFE_ to appropriate macros -Indent properly
-Use BIT macro wherever applicable
-Cosmetic change
-Move PFE macros to Kconfig
-Remove unused UTIL_PE_DISABLED config

Changes in v2:
-fix RGMII TX-delay issue
-add pfe_rx_done to clear bd after packet processing
-use writel/readl to access hw bds
-cleanup typos and indent
-remove unused code under CONFIG_UTIL_PE_DISABLED -Consolidate code in pfe_lib_init
-Corrected typo receive
-Magic numbers replaced with proper definitions
-File names pfe.c renamed to pfe_hw.c to be more clear as it contains
low level functions that directly access pfe hardware block.
-MDIO related code is also moved from pfe_eth.c to a new file
pfe_mdio.c.
-remove unused code under CONFIG_UTIL_PE_DISABLED
-remove unused code under CONFIG_PFE_WARN_WA
-Add pfe_rx_done to clear bd after packet processing -remove unused code under CONFIG_UTIL_PE_DISABLED
-Used BIT and GENMASK macros wherever applicable
-Removed generic definitions that pollutes namespace
-File names pfe.h renamed to pfe_hw.h to be more clear as it contains
low level functions that directly access pfe hardware block
-Added pfe_dm_eth.h for new driver model
-split from original patch "board: freescale: ls1012a: enable network support on ls1012a platforms"
-split from original patch "board: freescale: ls1012a: enable network support on ls1012a platforms"
-split from original patch "board: freescale: ls1012a: enable network support on ls1012a platforms"
-New patch added to series to enable ethernet support for ls1012a2g5rdb
-Improved commit message to provide more description -Replaced magic numbers with proper definitions
-Improved commit message to provide more description -Moved SYS_LS_PFE_FW_ADDR from pfe Kconfig to board Kconfigs -Add "pfe stop" to ls1012a rdb, frdm and 2g5rdb config files

Calvin Johnson (12):
drivers: net: phy: Fix aquantia compilation with DM
drivers: net: pfe_eth: LS1012A PFE driver introduction
drivers: net: pfe_eth: provide pfe commands
drivers: net: pfe_eth: LS1012A PFE headers
board: freescale: ls1012aqds: enable network support on ls1012aqds
board: freescale: ls1012afrdm: enable network support on ls1012afrdm
board: freescale: ls1012ardb: enable network support on ls1012ardb
board: freescale: ls1012a2g5rdb: enable network support on

    ls1012a2g5rdb

armv8: fsl-lsch2: add pfe macros and update ccsr_scfg structure
armv8: fsl-lsch2: configure pfe's DDR and HDBUS interfaces and ECC
armv8: layerscape: csu: enable ns access to PFE registers
configs: ls1012a: add pfe configuration for LS1012A

Prabhakar Kushwaha (1):
armv8: fsl-layerscape: Add support of GPIO structure

 arch/arm/cpu/armv8/fsl-layerscape/soc.c            |  23 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  63 +-
 .../include/asm/arch-fsl-layerscape/ns_access.h    |   2 +
 arch/arm/include/asm/arch-fsl-layerscape/soc.h     |   3 +
 board/freescale/ls1012afrdm/Kconfig                |  29 +
 board/freescale/ls1012afrdm/Makefile               |   1 +
 board/freescale/ls1012afrdm/eth.c                  | 124 +++
 board/freescale/ls1012afrdm/ls1012afrdm.c          |   5 -
 board/freescale/ls1012aqds/Kconfig                 |  45 +
 board/freescale/ls1012aqds/Makefile                |   1 +
 board/freescale/ls1012aqds/eth.c                   | 309 +++++++
 board/freescale/ls1012aqds/ls1012aqds.c            |  97 +-
 board/freescale/ls1012aqds/ls1012aqds_pfe.h        |  45 +
 board/freescale/ls1012aqds/ls1012aqds_qixis.h      |   2 +-
 board/freescale/ls1012ardb/Kconfig                 |  59 ++
 board/freescale/ls1012ardb/Makefile                |   1 +
 board/freescale/ls1012ardb/eth.c                   | 135 +++
 board/freescale/ls1012ardb/ls1012ardb.c            |   4 -
 configs/ls1012a2g5rdb_qspi_defconfig               |   2 +
 configs/ls1012afrdm_qspi_defconfig                 |   2 +
 configs/ls1012aqds_qspi_defconfig                  |   2 +
 configs/ls1012ardb_qspi_defconfig                  |   2 +
 drivers/net/Kconfig                                |   1 +
 drivers/net/Makefile                               |   1 +
 drivers/net/pfe_eth/Kconfig                        |  12 +
 drivers/net/pfe_eth/Makefile                       |  12 +
 drivers/net/pfe_eth/pfe_cmd.c                      | 497 ++++++++++
 drivers/net/pfe_eth/pfe_driver.c                   | 643 +++++++++++++
 drivers/net/pfe_eth/pfe_eth.c                      | 297 ++++++
 drivers/net/pfe_eth/pfe_firmware.c                 | 230 +++++
 drivers/net/pfe_eth/pfe_hw.c                       | 999 +++++++++++++++++++++
 drivers/net/pfe_eth/pfe_mdio.c                     | 291 ++++++
 drivers/net/phy/aquantia.c                         |   1 +
 include/configs/ls1012a2g5rdb.h                    |  11 +-
 include/configs/ls1012a_common.h                   |   6 +-
 include/configs/ls1012afrdm.h                      |   2 +-
 include/configs/ls1012ardb.h                       |   6 +-
 include/dm/platform_data/pfe_dm_eth.h              |  21 +
 include/net/pfe_eth/pfe/cbus.h                     |  77 ++
 include/net/pfe_eth/pfe/cbus/bmu.h                 |  40 +
 include/net/pfe_eth/pfe/cbus/class_csr.h           | 180 ++++
 include/net/pfe_eth/pfe/cbus/emac.h                | 140 +++
 include/net/pfe_eth/pfe/cbus/gpi.h                 |  62 ++
 include/net/pfe_eth/pfe/cbus/hif.h                 |  68 ++
 include/net/pfe_eth/pfe/cbus/hif_nocpy.h           |  40 +
 include/net/pfe_eth/pfe/cbus/tmu_csr.h             | 148 +++
 include/net/pfe_eth/pfe/cbus/util_csr.h            |  47 +
 include/net/pfe_eth/pfe/pfe_hw.h                   | 163 ++++
 include/net/pfe_eth/pfe_driver.h                   |  59 ++
 include/net/pfe_eth/pfe_eth.h                      | 104 +++
 include/net/pfe_eth/pfe_firmware.h                 |  17 +
 include/net/pfe_eth/pfe_mdio.h                     |  13 +
 52 files changed, 5111 insertions(+), 33 deletions(-)
 create mode 100644 board/freescale/ls1012afrdm/eth.c
 create mode 100644 board/freescale/ls1012aqds/eth.c
 create mode 100644 board/freescale/ls1012aqds/ls1012aqds_pfe.h
 create mode 100644 board/freescale/ls1012ardb/eth.c
 create mode 100644 drivers/net/pfe_eth/Kconfig
 create mode 100644 drivers/net/pfe_eth/Makefile
 create mode 100644 drivers/net/pfe_eth/pfe_cmd.c
 create mode 100644 drivers/net/pfe_eth/pfe_driver.c
 create mode 100644 drivers/net/pfe_eth/pfe_eth.c
 create mode 100644 drivers/net/pfe_eth/pfe_firmware.c
 create mode 100644 drivers/net/pfe_eth/pfe_hw.c
 create mode 100644 drivers/net/pfe_eth/pfe_mdio.c
 create mode 100644 include/dm/platform_data/pfe_dm_eth.h
 create mode 100644 include/net/pfe_eth/pfe/cbus.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/bmu.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/class_csr.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/emac.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/gpi.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/hif.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/hif_nocpy.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/tmu_csr.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/util_csr.h
 create mode 100644 include/net/pfe_eth/pfe/pfe_hw.h
 create mode 100644 include/net/pfe_eth/pfe_driver.h
 create mode 100644 include/net/pfe_eth/pfe_eth.h
 create mode 100644 include/net/pfe_eth/pfe_firmware.h
 create mode 100644 include/net/pfe_eth/pfe_mdio.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH v4 1/13 drivers: net: phy: Fix aquantia compilation with DM

With CONFIG_DM_ETH enabled, aquantia driver compilation fails with below error. This patch fixes the issue by including dm.h.

drivers/net/phy/aquantia.c: In function ‘aquantia_startup’:
drivers/net/phy/aquantia.c:73:21: error: dereferencing pointer to incomplete
type ‘struct udevice’

          phydev->dev->name);
		     ^~

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/net/phy/aquantia.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/phy/aquantia.c +1 -0
index ad12f6d..6678147 100644
@@ -7,6 +7,7 @@
  */
 #include <config.h>
 #include <common.h>
+#include <dm.h>
 #include <phy.h>
 
 #ifndef CONFIG_PHYLIB_10G
Signature · 1 line
2.7.4
#3 lore raw

PATCH v4 2/13 armv8: fsl-layerscape: Add support of GPIO structure

In reply to Calvin Johnson

From: Prabhakar Kushwaha <[email protected]>

Layerscape Gen2 SoC supports GPIO registers to control GPIO signals. Adding support of GPIO structure to access GPIO registers.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h +15 -0
index 1ff5cac..b195005 100644
@@ -82,6 +82,11 @@
 #define QSPI0_BASE_ADDR				(CONFIG_SYS_IMMR + 0x00550000)
 #define DSPI1_BASE_ADDR				(CONFIG_SYS_IMMR + 0x01100000)
 
+#define GPIO1_BASE_ADDR				(CONFIG_SYS_IMMR + 0x1300000)
+#define GPIO2_BASE_ADDR				(CONFIG_SYS_IMMR + 0x1310000)
+#define GPIO3_BASE_ADDR				(CONFIG_SYS_IMMR + 0x1320000)
+#define GPIO4_BASE_ADDR				(CONFIG_SYS_IMMR + 0x1330000)
+
 #define LPUART_BASE				(CONFIG_SYS_IMMR + 0x01950000)
 
 #define AHCI_BASE_ADDR				(CONFIG_SYS_IMMR + 0x02200000)
@@ -591,6 +596,16 @@ struct ccsr_serdes {
 	u8	res_19a0[0x2000-0x19a0];	/* from 0x19a0 to 0x1fff */
 };
 
+struct ccsr_gpio {
+	u32	gpdir;
+	u32	gpodr;
+	u32	gpdat;
+	u32	gpier;
+	u32	gpimr;
+	u32	gpicr;
+	u32	gpibe;
+};
+
 /* MMU 500 */
 #define SMMU_SCR0			(SMMU_BASE + 0x0)
 #define SMMU_SCR1			(SMMU_BASE + 0x4)
Signature · 1 line
2.7.4
#5 lore raw

PATCH v4 3/13 drivers: net: pfe_eth: LS1012A PFE driver introduction

In reply to Calvin Johnson

This patch adds PFE driver to U-Boot

Following are the main driver files:-
pfe_hw.c: provides low level helper functions to initialize PFE internal processor engines and other hardware blocks pfe_driver.c: provides initialization functions
and packet send and receive functions
pfe_eth.c: provides high level gemac initialization functions pfe_firmware.c: provides functions to load firmware into PFE internal processor engines.
pfe_mdio.c: provides functions to initialize phy and mdio.

---

Changes in v4: None
Changes in v3:
-Update header location to include/net/pfe_eth -Replace EMACX_PHY_ADDR with CONFIG_PFE_EMACX_PHY_ADDR

Changes in v2:
-fix RGMII TX-delay issue
-add pfe_rx_done to clear bd after packet processing
-use writel/readl to access hw bds
-cleanup typos and indent
-remove unused code under CONFIG_UTIL_PE_DISABLED -Consolidate code in pfe_lib_init
-Corrected typo receive
-Magic numbers replaced with proper definitions
-File names pfe.c renamed to pfe_hw.c to be more clear as it contains
low level functions that directly access pfe hardware block.
-MDIO related code is also moved from pfe_eth.c to a new file
pfe_mdio.c.

 drivers/net/pfe_eth/pfe_driver.c   | 643 ++++++++++++++++++++++++
 drivers/net/pfe_eth/pfe_eth.c      | 297 +++++++++++
 drivers/net/pfe_eth/pfe_firmware.c | 230 +++++++++
 drivers/net/pfe_eth/pfe_hw.c       | 999 +++++++++++++++++++++++++++++++++++++
 drivers/net/pfe_eth/pfe_mdio.c     | 291 +++++++++++
 5 files changed, 2460 insertions(+)
 create mode 100644 drivers/net/pfe_eth/pfe_driver.c
 create mode 100644 drivers/net/pfe_eth/pfe_eth.c
 create mode 100644 drivers/net/pfe_eth/pfe_firmware.c
 create mode 100644 drivers/net/pfe_eth/pfe_hw.c
 create mode 100644 drivers/net/pfe_eth/pfe_mdio.c
drivers/net/pfe_eth/pfe_driver.c new file +643 -0
new file mode 100644
index 0000000..a9991f5
@@ -0,0 +1,643 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <net/pfe_eth/pfe_eth.h>
+#include <net/pfe_eth/pfe_firmware.h>
+
+static struct tx_desc_s *g_tx_desc;
+static struct rx_desc_s *g_rx_desc;
+
+/*
+ * HIF Rx interface function
+ * Reads the rx descriptor from the current location (rx_to_read).
+ * - If the descriptor has a valid data/pkt, then get the data pointer
+ * - check for the input rx phy number
+ * - increment the rx data pointer by pkt_head_room_size
+ * - decrement the data length by pkt_head_room_size
+ * - handover the packet to caller.
+ *
+ * @param[out] pkt_ptr - Pointer to store rx packet
+ * @param[out] phy_port - Pointer to store recv phy port
+ *
+ * @return -1 if no packet, else return length of packet.
+ */
+int pfe_recv(uchar **pkt_ptr, int *phy_port)
+{
+	struct rx_desc_s *rx_desc = g_rx_desc;
+	struct buf_desc *bd;
+	int len = 0;
+
+	struct hif_header_s *hif_header;
+
+	bd = rx_desc->rx_base + rx_desc->rx_to_read;
+
+	if (readl(&bd->ctrl) & BD_CTRL_DESC_EN)
+		return len; /* No pending Rx packet */
+
+	/* this len include hif_header(8 bytes) */
+	len = readl(&bd->ctrl) & 0xFFFF;
+
+	hif_header = (struct hif_header_s *)DDR_PFE_TO_VIRT(readl(&bd->data));
+
+	/* Get the receive port info from the packet */
+	debug("Pkt received:");
+	debug(" Pkt ptr(%p), len(%d), gemac_port(%d) status(%08x)\n",
+	      hif_header, len, hif_header->port_no, readl(&bd->status));
+#ifdef DEBUG
+	{
+		int i;
+		unsigned char *p = (unsigned char *)hif_header;
+
+		for (i = 0; i < len; i++) {
+			if (!(i % 16))
+				printf("\n");
+			printf(" %02x", p[i]);
+		}
+		printf("\n");
+	}
+#endif
+
+	*pkt_ptr = (uchar *)(hif_header + 1);
+	*phy_port = hif_header->port_no;
+	len -= sizeof(struct hif_header_s);
+
+	return len;
+}
+
+/*
+ * HIF function to check the Rx done
+ * This function will check the rx done indication of the current rx_to_read
+ * locations
+ * if success, moves the rx_to_read to next location.
+ */
+int pfe_eth_free_pkt(struct udevice *dev, uchar *packet, int length)
+{
+	struct rx_desc_s *rx_desc = g_rx_desc;
+	struct buf_desc *bd;
+
+	debug("%s:rx_base: %p, rx_to_read: %d\n", __func__, rx_desc->rx_base,
+	      rx_desc->rx_to_read);
+
+	bd = rx_desc->rx_base + rx_desc->rx_to_read;
+
+	/* reset the control field */
+	writel((MAX_FRAME_SIZE | BD_CTRL_LIFM | BD_CTRL_DESC_EN
+		    | BD_CTRL_DIR), &bd->ctrl);
+	writel(0, &bd->status);
+
+	debug("Rx Done : status: %08x, ctrl: %08x\n", readl(&bd->status),
+	      readl(&bd->ctrl));
+
+	/* Give START_STROBE to BDP to fetch the descriptor __NOW__,
+	 * BDP need not wait for rx_poll_cycle time to fetch the descriptor,
+	 * In idle state (ie., no rx pkt), BDP will not fetch
+	 * the descriptor even if strobe is given.
+	 */
+	writel((readl(HIF_RX_CTRL) | HIF_CTRL_BDP_CH_START_WSTB), HIF_RX_CTRL);
+
+	/* increment the rx_to_read index to next location */
+	rx_desc->rx_to_read = (rx_desc->rx_to_read + 1)
+			       & (rx_desc->rx_ring_size - 1);
+
+	debug("Rx next pkt location: %d\n", rx_desc->rx_to_read);
+
+	return 0;
+}
+
+/*
+ * HIF Tx interface function
+ * This function sends a single packet to PFE from HIF interface.
+ * - No interrupt indication on tx completion.
+ * - Data is copied to tx buffers before tx descriptor is updated
+ *   and TX DMA is enabled.
+ *
+ * @param[in] phy_port	Phy port number to send out this packet
+ * @param[in] data	Pointer to the data
+ * @param[in] length	Length of the ethernet packet to be transferred.
+ *
+ * @return -1 if tx Q is full, else returns the tx location where the pkt is
+ * placed.
+ */
+int pfe_send(int phy_port, void *data, int length)
+{
+	struct tx_desc_s *tx_desc = g_tx_desc;
+	struct buf_desc *bd;
+	struct hif_header_s hif_header;
+	u8 *tx_buf_va;
+
+	debug("%s:pkt: %p, len: %d, tx_base: %p, tx_to_send: %d\n", __func__,
+	      data, length, tx_desc->tx_base, tx_desc->tx_to_send);
+
+	bd = tx_desc->tx_base + tx_desc->tx_to_send;
+
+	/* check queue-full condition */
+	if (readl(&bd->ctrl) & BD_CTRL_DESC_EN)
+		return -1;
+
+	/* PFE checks for min pkt size */
+	if (length < MIN_PKT_SIZE)
+		length = MIN_PKT_SIZE;
+
+	tx_buf_va = (void *)DDR_PFE_TO_VIRT(readl(&bd->data));
+	debug("%s: tx_buf_va: %p, tx_buf_pa: %08x\n", __func__, tx_buf_va,
+	      readl(&bd->data));
+
+	/* Fill the gemac/phy port number to send this packet out */
+	memset(&hif_header, 0, sizeof(struct hif_header_s));
+	hif_header.port_no = phy_port;
+
+	memcpy(tx_buf_va, (u8 *)&hif_header, sizeof(struct hif_header_s));
+	memcpy(tx_buf_va + sizeof(struct hif_header_s), data, length);
+	length += sizeof(struct hif_header_s);
+
+#ifdef DEBUG
+	{
+		int i;
+		unsigned char *p = (unsigned char *)tx_buf_va;
+
+		for (i = 0; i < length; i++) {
+			if (!(i % 16))
+				printf("\n");
+			printf("%02x ", p[i]);
+		}
+	}
+#endif
+
+	debug("Tx Done: status: %08x, ctrl: %08x\n", readl(&bd->status),
+	      readl(&bd->ctrl));
+
+	/* fill the tx desc */
+	writel((u32)(BD_CTRL_DESC_EN | BD_CTRL_LIFM | (length & 0xFFFF)),
+	       &bd->ctrl);
+	writel(0, &bd->status);
+
+	writel((HIF_CTRL_DMA_EN | HIF_CTRL_BDP_CH_START_WSTB), HIF_TX_CTRL);
+
+	udelay(100);
+
+	return tx_desc->tx_to_send;
+}
+
+/*
+ * HIF function to check the Tx done
+ *  This function will check the tx done indication of the current tx_to_send
+ *  locations
+ *  if success, moves the tx_to_send to next location.
+ *
+ * @return -1 if TX ownership bit is not cleared by hw.
+ * else on success (tx done completion) return zero.
+ */
+int pfe_tx_done(void)
+{
+	struct tx_desc_s *tx_desc = g_tx_desc;
+	struct buf_desc *bd;
+
+	debug("%s:tx_base: %p, tx_to_send: %d\n", __func__, tx_desc->tx_base,
+	      tx_desc->tx_to_send);
+
+	bd = tx_desc->tx_base + tx_desc->tx_to_send;
+
+	/* check queue-full condition */
+	if (readl(&bd->ctrl) & BD_CTRL_DESC_EN)
+		return -1;
+
+	/* reset the control field */
+	writel(0, &bd->ctrl);
+	writel(0, &bd->status);
+
+	debug("Tx Done : status: %08x, ctrl: %08x\n", readl(&bd->status),
+	      readl(&bd->ctrl));
+
+	/* increment the txtosend index to next location */
+	tx_desc->tx_to_send = (tx_desc->tx_to_send + 1)
+			       & (tx_desc->tx_ring_size - 1);
+
+	debug("Tx next pkt location: %d\n", tx_desc->tx_to_send);
+
+	return 0;
+}
+
+/*
+ * Helper function to dump Rx descriptors.
+ */
+static inline void hif_rx_desc_dump(void)
+{
+	struct buf_desc *bd_va;
+	int i;
+	struct rx_desc_s *rx_desc;
+
+	if (!g_rx_desc) {
+		printf("%s: HIF Rx desc no init\n", __func__);
+		return;
+	}
+
+	rx_desc = g_rx_desc;
+	bd_va = rx_desc->rx_base;
+
+	debug("HIF rx desc: base_va: %p, base_pa: %08x\n", rx_desc->rx_base,
+	      rx_desc->rx_base_pa);
+	for (i = 0; i < rx_desc->rx_ring_size; i++) {
+		debug("status: %08x, ctrl: %08x, data: %08x, next: 0x%08x\n",
+		      readl(&bd_va->status),
+		      readl(&bd_va->ctrl),
+		      readl(&bd_va->data),
+		      readl(&bd_va->next));
+		bd_va++;
+	}
+}
+
+/*
+ * This function mark all Rx descriptors as LAST_BD.
+ */
+void hif_rx_desc_disable(void)
+{
+	int i;
+	struct rx_desc_s *rx_desc;
+	struct buf_desc *bd_va;
+
+	if (!g_rx_desc) {
+		printf("%s: HIF Rx desc not initialized\n", __func__);
+		return;
+	}
+
+	rx_desc = g_rx_desc;
+	bd_va = rx_desc->rx_base;
+
+	for (i = 0; i < rx_desc->rx_ring_size; i++) {
+		writel(readl(&bd_va->ctrl) | BD_CTRL_LAST_BD, &bd_va->ctrl);
+		bd_va++;
+	}
+}
+
+/*
+ * HIF Rx Desc initialization function.
+ */
+static int hif_rx_desc_init(struct pfe_ddr_address *pfe_addr)
+{
+	u32 ctrl;
+	struct buf_desc *bd_va;
+	struct buf_desc *bd_pa;
+	struct rx_desc_s *rx_desc;
+	u32 rx_buf_pa;
+	int i;
+
+	/* sanity check */
+	if (g_rx_desc) {
+		printf("%s: HIF Rx desc re-init request\n", __func__);
+		return 0;
+	}
+
+	rx_desc = (struct rx_desc_s *)malloc(sizeof(struct rx_desc_s));
+	if (!rx_desc) {
+		printf("%s: Memory allocation failure\n", __func__);
+		return -ENOMEM;
+	}
+	memset(rx_desc, 0, sizeof(struct rx_desc_s));
+
+	/* init: Rx ring buffer */
+	rx_desc->rx_ring_size = HIF_RX_DESC_NT;
+
+	/* NOTE: must be 64bit aligned  */
+	bd_va = (struct buf_desc *)(pfe_addr->ddr_pfe_baseaddr
+		 + RX_BD_BASEADDR);
+	bd_pa = (struct buf_desc *)(pfe_addr->ddr_pfe_phys_baseaddr
+				    + RX_BD_BASEADDR);
+
+	rx_desc->rx_base = bd_va;
+	rx_desc->rx_base_pa = (unsigned long)bd_pa;
+
+	rx_buf_pa = pfe_addr->ddr_pfe_phys_baseaddr + HIF_RX_PKT_DDR_BASEADDR;
+
+	debug("%s: Rx desc base: %p, base_pa: %08x, desc_count: %d\n",
+	      __func__, rx_desc->rx_base, rx_desc->rx_base_pa,
+	      rx_desc->rx_ring_size);
+
+	memset(bd_va, 0, sizeof(struct buf_desc) * rx_desc->rx_ring_size);
+
+	ctrl = (MAX_FRAME_SIZE | BD_CTRL_DESC_EN | BD_CTRL_DIR | BD_CTRL_LIFM);
+
+	for (i = 0; i < rx_desc->rx_ring_size; i++) {
+		writel((unsigned long)(bd_pa + 1), &bd_va->next);
+		writel(ctrl, &bd_va->ctrl);
+		writel(rx_buf_pa + (i * MAX_FRAME_SIZE), &bd_va->data);
+		bd_va++;
+		bd_pa++;
+	}
+	--bd_va;
+	writel((u32)rx_desc->rx_base_pa, &bd_va->next);
+
+	writel(rx_desc->rx_base_pa, HIF_RX_BDP_ADDR);
+	writel((readl(HIF_RX_CTRL) | HIF_CTRL_BDP_CH_START_WSTB), HIF_RX_CTRL);
+
+	g_rx_desc = rx_desc;
+
+	return 0;
+}
+
+/*
+ * Helper function to dump Tx Descriptors.
+ */
+static inline void hif_tx_desc_dump(void)
+{
+	struct tx_desc_s *tx_desc;
+	int i;
+	struct buf_desc *bd_va;
+
+	if (!g_tx_desc) {
+		printf("%s: HIF Tx desc no init\n", __func__);
+		return;
+	}
+
+	tx_desc = g_tx_desc;
+	bd_va = tx_desc->tx_base;
+
+	debug("HIF tx desc: base_va: %p, base_pa: %08x\n", tx_desc->tx_base,
+	      tx_desc->tx_base_pa);
+
+	for (i = 0; i < tx_desc->tx_ring_size; i++)
+		bd_va++;
+}
+
+/*
+ * HIF Tx descriptor initialization function.
+ */
+static int hif_tx_desc_init(struct pfe_ddr_address *pfe_addr)
+{
+	struct buf_desc *bd_va;
+	struct buf_desc *bd_pa;
+	int i;
+	struct tx_desc_s *tx_desc;
+	u32 tx_buf_pa;
+
+	/* sanity check */
+	if (g_tx_desc) {
+		printf("%s: HIF Tx desc re-init request\n", __func__);
+		return 0;
+	}
+
+	tx_desc = (struct tx_desc_s *)malloc(sizeof(struct tx_desc_s));
+	if (!tx_desc) {
+		printf("%s:%d:Memory allocation failure\n", __func__,
+		       __LINE__);
+		return -ENOMEM;
+	}
+	memset(tx_desc, 0, sizeof(struct tx_desc_s));
+
+	/* init: Tx ring buffer */
+	tx_desc->tx_ring_size = HIF_TX_DESC_NT;
+
+	/* NOTE: must be 64bit aligned  */
+	bd_va = (struct buf_desc *)(pfe_addr->ddr_pfe_baseaddr
+		 + TX_BD_BASEADDR);
+	bd_pa = (struct buf_desc *)(pfe_addr->ddr_pfe_phys_baseaddr
+				    + TX_BD_BASEADDR);
+
+	tx_desc->tx_base_pa = (unsigned long)bd_pa;
+	tx_desc->tx_base = bd_va;
+
+	debug("%s: Tx desc_base: %p, base_pa: %08x, desc_count: %d\n",
+	      __func__, tx_desc->tx_base, tx_desc->tx_base_pa,
+	      tx_desc->tx_ring_size);
+
+	memset(bd_va, 0, sizeof(struct buf_desc) * tx_desc->tx_ring_size);
+
+	tx_buf_pa = pfe_addr->ddr_pfe_phys_baseaddr + HIF_TX_PKT_DDR_BASEADDR;
+
+	for (i = 0; i < tx_desc->tx_ring_size; i++) {
+		writel((unsigned long)(bd_pa + 1), &bd_va->next);
+		writel(tx_buf_pa + (i * MAX_FRAME_SIZE), &bd_va->data);
+		bd_va++;
+		bd_pa++;
+	}
+	--bd_va;
+	writel((u32)tx_desc->tx_base_pa, &bd_va->next);
+
+	writel(tx_desc->tx_base_pa, HIF_TX_BDP_ADDR);
+
+	g_tx_desc = tx_desc;
+
+	return 0;
+}
+
+/*
+ * PFE/Class initialization.
+ */
+static void pfe_class_init(struct pfe_ddr_address *pfe_addr)
+{
+	struct class_cfg class_cfg = {
+		.route_table_baseaddr = pfe_addr->ddr_pfe_phys_baseaddr +
+					ROUTE_TABLE_BASEADDR,
+		.route_table_hash_bits = ROUTE_TABLE_HASH_BITS,
+	};
+
+	class_init(&class_cfg);
+
+	debug("class init complete\n");
+}
+
+/*
+ * PFE/TMU initialization.
+ */
+static void pfe_tmu_init(struct pfe_ddr_address *pfe_addr)
+{
+	struct tmu_cfg tmu_cfg = {
+		.llm_base_addr = pfe_addr->ddr_pfe_phys_baseaddr
+				 + TMU_LLM_BASEADDR,
+		.llm_queue_len = TMU_LLM_QUEUE_LEN,
+	};
+
+	tmu_init(&tmu_cfg);
+
+	debug("tmu init complete\n");
+}
+
+/*
+ * PFE/BMU (both BMU1 & BMU2) initialization.
+ */
+static void pfe_bmu_init(struct pfe_ddr_address *pfe_addr)
+{
+	struct bmu_cfg bmu1_cfg = {
+		.baseaddr = CBUS_VIRT_TO_PFE(LMEM_BASE_ADDR +
+						BMU1_LMEM_BASEADDR),
+		.count = BMU1_BUF_COUNT,
+		.size = BMU1_BUF_SIZE,
+	};
+
+	struct bmu_cfg bmu2_cfg = {
+		.baseaddr = pfe_addr->ddr_pfe_phys_baseaddr + BMU2_DDR_BASEADDR,
+		.count = BMU2_BUF_COUNT,
+		.size = BMU2_BUF_SIZE,
+	};
+
+	bmu_init(BMU1_BASE_ADDR, &bmu1_cfg);
+	debug("bmu1 init: done\n");
+
+	bmu_init(BMU2_BASE_ADDR, &bmu2_cfg);
+	debug("bmu2 init: done\n");
+}
+
+/*
+ * PFE/GPI initialization function.
+ *  - egpi1, egpi2, egpi3, hgpi
+ */
+static void pfe_gpi_init(struct pfe_ddr_address *pfe_addr)
+{
+	struct gpi_cfg egpi1_cfg = {
+		.lmem_rtry_cnt = EGPI1_LMEM_RTRY_CNT,
+		.tmlf_txthres = EGPI1_TMLF_TXTHRES,
+		.aseq_len = EGPI1_ASEQ_LEN,
+	};
+
+	struct gpi_cfg egpi2_cfg = {
+		.lmem_rtry_cnt = EGPI2_LMEM_RTRY_CNT,
+		.tmlf_txthres = EGPI2_TMLF_TXTHRES,
+		.aseq_len = EGPI2_ASEQ_LEN,
+	};
+
+	struct gpi_cfg hgpi_cfg = {
+		.lmem_rtry_cnt = HGPI_LMEM_RTRY_CNT,
+		.tmlf_txthres = HGPI_TMLF_TXTHRES,
+		.aseq_len = HGPI_ASEQ_LEN,
+	};
+
+	gpi_init(EGPI1_BASE_ADDR, &egpi1_cfg);
+	debug("GPI1 init complete\n");
+
+	gpi_init(EGPI2_BASE_ADDR, &egpi2_cfg);
+	debug("GPI2 init complete\n");
+
+	gpi_init(HGPI_BASE_ADDR, &hgpi_cfg);
+	debug("HGPI init complete\n");
+}
+
+/*
+ * PFE/HIF initialization function.
+ */
+static int pfe_hif_init(struct pfe_ddr_address *pfe_addr)
+{
+	int ret = 0;
+
+	hif_tx_disable();
+	hif_rx_disable();
+
+	ret = hif_tx_desc_init(pfe_addr);
+	if (ret)
+		return ret;
+	ret = hif_rx_desc_init(pfe_addr);
+	if (ret)
+		return ret;
+
+	hif_init();
+
+	hif_tx_enable();
+	hif_rx_enable();
+
+	hif_rx_desc_dump();
+	hif_tx_desc_dump();
+
+	debug("HIF init complete\n");
+	return ret;
+}
+
+/*
+ * PFE initialization
+ * - Firmware loading (CLASS-PE and TMU-PE)
+ * - BMU1 and BMU2 init
+ * - GEMAC init
+ * - GPI init
+ * - CLASS-PE init
+ * - TMU-PE init
+ * - HIF tx and rx descriptors init
+ *
+ * @param[in]	edev	Pointer to eth device structure.
+ *
+ * @return 0, on success.
+ */
+static int pfe_hw_init(struct pfe_ddr_address *pfe_addr)
+{
+	int ret = 0;
+
+	debug("%s: start\n", __func__);
+
+	writel(0x3, CLASS_PE_SYS_CLK_RATIO);
+	writel(0x3, TMU_PE_SYS_CLK_RATIO);
+	writel(0x3, UTIL_PE_SYS_CLK_RATIO);
+	udelay(10);
+
+	pfe_class_init(pfe_addr);
+
+	pfe_tmu_init(pfe_addr);
+
+	pfe_bmu_init(pfe_addr);
+
+	pfe_gpi_init(pfe_addr);
+
+	ret = pfe_hif_init(pfe_addr);
+	if (ret)
+		return ret;
+
+	bmu_enable(BMU1_BASE_ADDR);
+	debug("bmu1 enabled\n");
+
+	bmu_enable(BMU2_BASE_ADDR);
+	debug("bmu2 enabled\n");
+
+	debug("%s: done\n", __func__);
+
+	return ret;
+}
+
+/*
+ * PFE driver init function.
+ * - Initializes pfe_lib
+ * - pfe hw init
+ * - fw loading and enables PEs
+ * - should be executed once.
+ *
+ * @param[in] pfe  Pointer the pfe control block
+ */
+int pfe_drv_init(struct pfe_ddr_address  *pfe_addr)
+{
+	int ret = 0;
+
+	pfe_lib_init();
+
+	ret = pfe_hw_init(pfe_addr);
+	if (ret)
+		return ret;
+
+	/* Load the class,TM, Util fw.
+	 * By now pfe is:
+	 * - out of reset + disabled + configured.
+	 * Fw loading should be done after pfe_hw_init()
+	 */
+	/* It loads default inbuilt sbl firmware */
+	pfe_firmware_init();
+
+	return ret;
+}
+
+/*
+ * PFE remove function
+ *  - stops PEs
+ *  - frees tx/rx descriptor resources
+ *  - should be called once.
+ *
+ * @param[in] pfe Pointer to pfe control block.
+ */
+int pfe_eth_remove(struct udevice *dev)
+{
+	if (g_tx_desc)
+		free(g_tx_desc);
+
+	if (g_rx_desc)
+		free(g_rx_desc);
+
+	pfe_firmware_exit();
+
+	return 0;
+}
drivers/net/pfe_eth/pfe_eth.c new file +297 -0

297 lines not on this page · raw message

drivers/net/pfe_eth/pfe_firmware.c new file +230 -0

230 lines not on this page · raw message

drivers/net/pfe_eth/pfe_hw.c new file +999 -0

999 lines not on this page · raw message

drivers/net/pfe_eth/pfe_mdio.c new file +291 -0

291 lines not on this page · raw message

Signature · 1 line
2.7.4
#7 lore raw

PATCH v4 4/13 drivers: net: pfe_eth: provide pfe commands

In reply to Calvin Johnson

pfe_command provides command line support for several features that support pfe, like starting or stopping the pfe, checking the health of the processor engines and checking status of different units inside pfe.

---

Changes in v4: None
Changes in v3:
-Update header location to include/net/pfe_eth

Changes in v2:
-remove unused code under CONFIG_UTIL_PE_DISABLED
-remove unused code under CONFIG_PFE_WARN_WA

 drivers/net/pfe_eth/pfe_cmd.c | 497 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 497 insertions(+)
 create mode 100644 drivers/net/pfe_eth/pfe_cmd.c
drivers/net/pfe_eth/pfe_cmd.c new file +497 -0
new file mode 100644
index 0000000..822dc0f
@@ -0,0 +1,497 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+/*
+ * @file
+ * @brief PFE utility commands
+ */
+
+#include <net/pfe_eth/pfe_eth.h>
+
+static inline void pfe_command_help(void)
+{
+	printf("Usage: pfe [pe | status | expt ] <options>\n");
+}
+
+static void pfe_command_pe(int argc, char * const argv[])
+{
+	if (argc >= 3 && strcmp(argv[2], "pmem") == 0) {
+		if (argc >= 4 && strcmp(argv[3], "read") == 0) {
+			int i;
+			int num;
+			int id;
+			u32 addr;
+			u32 size;
+			u32 val;
+
+			if (argc == 7) {
+				num = simple_strtoul(argv[6], NULL, 0);
+			} else if (argc == 6) {
+				num = 1;
+			} else {
+				printf("Usage: pfe pe pmem read <id> <addr> [<num>]\n");
+				return;
+			}
+
+			id = simple_strtoul(argv[4], NULL, 0);
+			addr = simple_strtoul(argv[5], NULL, 16);
+			size = 4;
+
+			for (i = 0; i < num; i++, addr += 4) {
+				val = pe_pmem_read(id, addr, size);
+				val = be32_to_cpu(val);
+				if (!(i & 3))
+					printf("%08x: ", addr);
+				printf("%08x%s", val, i == num - 1 || (i & 3)
+				       == 3 ? "\n" : " ");
+			}
+
+		} else {
+			printf("Usage: pfe pe pmem read <parameters>\n");
+		}
+	} else if (argc >= 3 && strcmp(argv[2], "dmem") == 0) {
+		if (argc >= 4 && strcmp(argv[3], "read") == 0) {
+			int i;
+			int num;
+			int id;
+			u32 addr;
+			u32 size;
+			u32 val;
+
+			if (argc == 7) {
+				num = simple_strtoul(argv[6], NULL, 0);
+			} else if (argc == 6) {
+				num = 1;
+			} else {
+				printf("Usage: pfe pe dmem read <id> <addr> [<num>]\n");
+				return;
+			}
+
+			id = simple_strtoul(argv[4], NULL, 0);
+			addr = simple_strtoul(argv[5], NULL, 16);
+			size = 4;
+
+			for (i = 0; i < num; i++, addr += 4) {
+				val = pe_dmem_read(id, addr, size);
+				val = be32_to_cpu(val);
+				if (!(i & 3))
+					printf("%08x: ", addr);
+				printf("%08x%s", val, i == num - 1 || (i & 3)
+				       == 3 ? "\n" : " ");
+			}
+
+		} else if (argc >= 4 && strcmp(argv[3], "write") == 0) {
+			int id;
+			u32 val;
+			u32 addr;
+			u32 size;
+
+			if (argc != 7) {
+				printf("Usage: pfe pe dmem write <id> <val> <addr>\n");
+				return;
+			}
+
+			id = simple_strtoul(argv[4], NULL, 0);
+			val = simple_strtoul(argv[5], NULL, 16);
+			val = cpu_to_be32(val);
+			addr = simple_strtoul(argv[6], NULL, 16);
+			size = 4;
+			pe_dmem_write(id, val, addr, size);
+		} else {
+			printf("Usage: pfe pe dmem [read | write] <parameters>\n");
+		}
+	} else if (argc >= 3 && strcmp(argv[2], "lmem") == 0) {
+		if (argc >= 4 && strcmp(argv[3], "read") == 0) {
+			int i;
+			int num;
+			u32 val;
+			u32 offset;
+
+			if (argc == 6) {
+				num = simple_strtoul(argv[5], NULL, 0);
+			} else if (argc == 5) {
+				num = 1;
+			} else {
+				printf("Usage: pfe pe lmem read <offset> [<num>]\n");
+				return;
+			}
+
+			offset = simple_strtoul(argv[4], NULL, 16);
+
+			for (i = 0; i < num; i++, offset += 4) {
+				pe_lmem_read(&val, 4, offset);
+				val = be32_to_cpu(val);
+				printf("%08x%s", val, i == num - 1 || (i & 7)
+				       == 7 ? "\n" : " ");
+			}
+
+		} else if (argc >= 4 && strcmp(argv[3], "write") == 0)	{
+			u32 val;
+			u32 offset;
+
+			if (argc != 6) {
+				printf("Usage: pfe pe lmem write <val> <offset>\n");
+				return;
+			}
+
+			val = simple_strtoul(argv[4], NULL, 16);
+			val = cpu_to_be32(val);
+			offset = simple_strtoul(argv[5], NULL, 16);
+			pe_lmem_write(&val, 4, offset);
+		} else {
+			printf("Usage: pfe pe lmem [read | write] <parameters>\n");
+		}
+	} else {
+		if (strcmp(argv[2], "help") != 0)
+			printf("Unknown option: %s\n", argv[2]);
+
+		printf("Usage: pfe pe <parameters>\n");
+	}
+}
+
+#define NUM_QUEUES		16
+
+/*
+ * qm_read_drop_stat
+ * This function is used to read the drop statistics from the TMU
+ * hw drop counter.  Since the hw counter is always cleared afer
+ * reading, this function maintains the previous drop count, and
+ * adds the new value to it.  That value can be retrieved by
+ * passing a pointer to it with the total_drops arg.
+ *
+ * @param tmu           TMU number (0 - 3)
+ * @param queue         queue number (0 - 15)
+ * @param total_drops   pointer to location to store total drops (or NULL)
+ * @param do_reset      if TRUE, clear total drops after updating
+ *
+ */
+u32 qm_read_drop_stat(u32 tmu, u32 queue, u32 *total_drops, int do_reset)
+{
+	static u32 qtotal[TMU_MAX_ID + 1][NUM_QUEUES];
+	u32 val;
+
+	writel((tmu << 8) | queue, TMU_TEQ_CTRL);
+	writel((tmu << 8) | queue, TMU_LLM_CTRL);
+	val = readl(TMU_TEQ_DROP_STAT);
+	qtotal[tmu][queue] += val;
+	if (total_drops)
+		*total_drops = qtotal[tmu][queue];
+	if (do_reset)
+		qtotal[tmu][queue] = 0;
+	return val;
+}
+
+static ssize_t tmu_queue_stats(char *buf, int tmu, int queue)
+{
+	ssize_t len = 0;
+	u32 drops;
+
+	printf("%d-%02d, ", tmu, queue);
+
+	drops = qm_read_drop_stat(tmu, queue, NULL, 0);
+
+	/* Select queue */
+	writel((tmu << 8) | queue, TMU_TEQ_CTRL);
+	writel((tmu << 8) | queue, TMU_LLM_CTRL);
+
+	printf("(teq) drop: %10u, tx: %10u (llm) head: %08x, tail: %08x, drop: %10u\n",
+	       drops, readl(TMU_TEQ_TRANS_STAT),
+	       readl(TMU_LLM_QUE_HEADPTR), readl(TMU_LLM_QUE_TAILPTR),
+	       readl(TMU_LLM_QUE_DROPCNT));
+
+	return len;
+}
+
+static ssize_t tmu_queues(char *buf, int tmu)
+{
+	ssize_t len = 0;
+	int queue;
+
+	for (queue = 0; queue < 16; queue++)
+		len += tmu_queue_stats(buf + len, tmu, queue);
+
+	return len;
+}
+
+static inline void hif_status(void)
+{
+	printf("hif:\n");
+
+	printf("  tx curr bd:    %x\n", readl(HIF_TX_CURR_BD_ADDR));
+	printf("  tx status:     %x\n", readl(HIF_TX_STATUS));
+	printf("  tx dma status: %x\n", readl(HIF_TX_DMA_STATUS));
+
+	printf("  rx curr bd:    %x\n", readl(HIF_RX_CURR_BD_ADDR));
+	printf("  rx status:     %x\n", readl(HIF_RX_STATUS));
+	printf("  rx dma status: %x\n", readl(HIF_RX_DMA_STATUS));
+
+	printf("hif nocopy:\n");
+
+	printf("  tx curr bd:    %x\n", readl(HIF_NOCPY_TX_CURR_BD_ADDR));
+	printf("  tx status:     %x\n", readl(HIF_NOCPY_TX_STATUS));
+	printf("  tx dma status: %x\n", readl(HIF_NOCPY_TX_DMA_STATUS));
+
+	printf("  rx curr bd:    %x\n", readl(HIF_NOCPY_RX_CURR_BD_ADDR));
+	printf("  rx status:     %x\n", readl(HIF_NOCPY_RX_STATUS));
+	printf("  rx dma status: %x\n", readl(HIF_NOCPY_RX_DMA_STATUS));
+}
+
+static void gpi(int id, void *base)
+{
+	u32 val;
+
+	printf("%s%d:\n", __func__, id);
+
+	printf("  tx under stick: %x\n", readl(base + GPI_FIFO_STATUS));
+	val = readl(base + GPI_FIFO_DEBUG);
+	printf("  tx pkts:        %x\n", (val >> 23) & 0x3f);
+	printf("  rx pkts:        %x\n", (val >> 18) & 0x3f);
+	printf("  tx bytes:       %x\n", (val >> 9) & 0x1ff);
+	printf("  rx bytes:       %x\n", (val >> 0) & 0x1ff);
+	printf("  overrun:        %x\n", readl(base + GPI_OVERRUN_DROPCNT));
+}
+
+static void  bmu(int id, void *base)
+{
+	printf("%s%d:\n", __func__, id);
+
+	printf("  buf size:  %x\n", (1 << readl(base + BMU_BUF_SIZE)));
+	printf("  buf count: %x\n", readl(base + BMU_BUF_CNT));
+	printf("  buf rem:   %x\n", readl(base + BMU_REM_BUF_CNT));
+	printf("  buf curr:  %x\n", readl(base + BMU_CURR_BUF_CNT));
+	printf("  free err:  %x\n", readl(base + BMU_FREE_ERR_ADDR));
+}
+
+#define	PESTATUS_ADDR_CLASS	0x800
+#define PEMBOX_ADDR_CLASS	0x890
+#define	PESTATUS_ADDR_TMU	0x80
+#define PEMBOX_ADDR_TMU		0x290
+#define	PESTATUS_ADDR_UTIL	0x0
+
+static void pfe_pe_status(int argc, char * const argv[])
+{
+	int do_clear = 0;
+	u32 id;
+	u32 dmem_addr;
+	u32 cpu_state;
+	u32 activity_counter;
+	u32 rx;
+	u32 tx;
+	u32 drop;
+	char statebuf[5];
+	u32 class_debug_reg = 0;
+
+	if (argc == 4 && strcmp(argv[3], "clear") == 0)
+		do_clear = 1;
+
+	for (id = CLASS0_ID; id < MAX_PE; id++) {
+		if (id >= TMU0_ID) {
+			if (id == TMU2_ID)
+				continue;
+			if (id == TMU0_ID)
+				printf("tmu:\n");
+			dmem_addr = PESTATUS_ADDR_TMU;
+		} else {
+			if (id == CLASS0_ID)
+				printf("class:\n");
+			dmem_addr = PESTATUS_ADDR_CLASS;
+			class_debug_reg = readl(CLASS_PE0_DEBUG + id * 4);
+		}
+
+		cpu_state = pe_dmem_read(id, dmem_addr, 4);
+		dmem_addr += 4;
+		memcpy(statebuf, (char *)&cpu_state, 4);
+		statebuf[4] = '\0';
+		activity_counter = pe_dmem_read(id, dmem_addr, 4);
+		dmem_addr += 4;
+		rx = pe_dmem_read(id, dmem_addr, 4);
+		if (do_clear)
+			pe_dmem_write(id, 0, dmem_addr, 4);
+		dmem_addr += 4;
+		tx = pe_dmem_read(id, dmem_addr, 4);
+		if (do_clear)
+			pe_dmem_write(id, 0, dmem_addr, 4);
+		dmem_addr += 4;
+		drop = pe_dmem_read(id, dmem_addr, 4);
+		if (do_clear)
+			pe_dmem_write(id, 0, dmem_addr, 4);
+		dmem_addr += 4;
+
+		if (id >= TMU0_ID) {
+			printf("%d: state=%4s ctr=%08x rx=%x qstatus=%x\n",
+			       id - TMU0_ID, statebuf,
+			       cpu_to_be32(activity_counter),
+			       cpu_to_be32(rx), cpu_to_be32(tx));
+		} else {
+			printf("%d: pc=1%04x ldst=%04x state=%4s ctr=%08x rx=%x tx=%x drop=%x\n",
+			       id - CLASS0_ID, class_debug_reg & 0xFFFF,
+			       class_debug_reg >> 16,
+			       statebuf, cpu_to_be32(activity_counter),
+			       cpu_to_be32(rx), cpu_to_be32(tx),
+			       cpu_to_be32(drop));
+		}
+	}
+}
+
+static void pfe_command_status(int argc, char * const argv[])
+{
+	if (argc >= 3 && strcmp(argv[2], "pe") == 0) {
+		pfe_pe_status(argc, argv);
+	} else if (argc == 3 && strcmp(argv[2], "bmu") == 0) {
+		bmu(1, BMU1_BASE_ADDR);
+		bmu(2, BMU2_BASE_ADDR);
+	} else if (argc == 3 && strcmp(argv[2], "hif") == 0) {
+		hif_status();
+	} else if (argc == 3 && strcmp(argv[2], "gpi") == 0) {
+		gpi(0, EGPI1_BASE_ADDR);
+		gpi(1, EGPI2_BASE_ADDR);
+		gpi(3, HGPI_BASE_ADDR);
+	} else if (argc == 3 && strcmp(argv[2], "tmu0_queues") == 0) {
+		tmu_queues(NULL, 0);
+	} else if (argc == 3 && strcmp(argv[2], "tmu1_queues") == 0) {
+		tmu_queues(NULL, 1);
+	} else if (argc == 3 && strcmp(argv[2], "tmu3_queues") == 0) {
+		tmu_queues(NULL, 3);
+	} else {
+		printf("Usage: pfe status [pe <clear> | bmu | gpi | hif | tmuX_queues ]\n");
+	}
+}
+
+#define EXPT_DUMP_ADDR 0x1fa8
+#define EXPT_REG_COUNT 20
+static const char *register_names[EXPT_REG_COUNT] = {
+		"  pc", "ECAS", " EID", "  ED",
+		"  sp", "  r1", "  r2", "  r3",
+		"  r4", "  r5", "  r6", "  r7",
+		"  r8", "  r9", " r10", " r11",
+		" r12", " r13", " r14", " r15"
+};
+
+static void pfe_command_expt(int argc, char * const argv[])
+{
+	unsigned int id, i, val, addr;
+
+	if (argc == 3) {
+		id = simple_strtoul(argv[2], NULL, 0);
+		addr = EXPT_DUMP_ADDR;
+		printf("Exception information for PE %d:\n", id);
+		for (i = 0; i < EXPT_REG_COUNT; i++) {
+			val = pe_dmem_read(id, addr, 4);
+			val = be32_to_cpu(val);
+			printf("%s:%08x%s", register_names[i], val,
+			       (i & 3) == 3 ? "\n" : " ");
+			addr += 4;
+		}
+	} else {
+		printf("Usage: pfe expt <id>\n");
+	}
+}
+
+#ifdef PFE_RESET_WA
+/*This function sends a dummy packet to HIF through TMU3 */
+static void send_dummy_pkt_to_hif(void)
+{
+	u32 buf;
+	static u32 dummy_pkt[] =  {
+		0x4200800a, 0x01000003, 0x00018100, 0x00000000,
+		0x33221100, 0x2b785544, 0xd73093cb, 0x01000608,
+		0x04060008, 0x2b780200, 0xd73093cb, 0x0a01a8c0,
+		0x33221100, 0xa8c05544, 0x00000301, 0x00000000,
+		0x00000000, 0x00000000, 0x00000000, 0xbe86c51f };
+
+	/*Allocate BMU2 buffer */
+	buf = readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL);
+
+	debug("Sending a dummy pkt to HIF %x\n", buf);
+	buf += 0x80;
+	memcpy((void *)DDR_PFE_TO_VIRT(buf), dummy_pkt, sizeof(dummy_pkt));
+
+	/*Write length and pkt to TMU*/
+	writel(0x03000042, TMU_PHY_INQ_PKTPTR);
+	writel(buf, TMU_PHY_INQ_PKTINFO);
+}
+
+static void pfe_command_stop(int argc, char * const argv[])
+{
+	int pfe_pe_id, hif_stop_loop = 10;
+	u32 rx_status;
+
+	printf("Stopping PFE...\n");
+
+	/*Mark all descriptors as LAST_BD */
+	hif_rx_desc_disable();
+
+	/*If HIF Rx BDP is busy send a dummy packet */
+	do {
+		rx_status = readl(HIF_RX_STATUS);
+		if (rx_status & BDP_CSR_RX_DMA_ACTV)
+			send_dummy_pkt_to_hif();
+		udelay(10);
+	} while (hif_stop_loop--);
+
+	if (readl(HIF_RX_STATUS) & BDP_CSR_RX_DMA_ACTV)
+		printf("Unable to stop HIF\n");
+
+	/*Disable Class PEs */
+	for (pfe_pe_id = CLASS0_ID; pfe_pe_id <= CLASS_MAX_ID; pfe_pe_id++) {
+		/*Inform PE to stop */
+		pe_dmem_write(pfe_pe_id, cpu_to_be32(1), PEMBOX_ADDR_CLASS, 4);
+		udelay(10);
+
+		/*Read status */
+		if (!pe_dmem_read(pfe_pe_id, PEMBOX_ADDR_CLASS + 4, 4))
+			printf("Failed to stop PE%d\n", pfe_pe_id);
+	}
+
+	/*Disable TMU PEs */
+	for (pfe_pe_id = TMU0_ID; pfe_pe_id <= TMU_MAX_ID; pfe_pe_id++) {
+		if (pfe_pe_id == TMU2_ID)
+			continue;
+
+		/*Inform PE to stop */
+		pe_dmem_write(pfe_pe_id, 1, PEMBOX_ADDR_TMU, 4);
+		udelay(10);
+
+		/*Read status */
+		if (!pe_dmem_read(pfe_pe_id, PEMBOX_ADDR_TMU + 4, 4))
+			printf("Failed to stop PE%d\n", pfe_pe_id);
+	}
+}
+#endif
+
+static int pfe_command(cmd_tbl_t *cmdtp, int flag, int argc,
+		       char * const argv[])
+{
+	if (argc == 1 || strcmp(argv[1], "help") == 0) {
+		pfe_command_help();
+		return CMD_RET_SUCCESS;
+	}
+
+	if (strcmp(argv[1], "pe") == 0) {
+		pfe_command_pe(argc, argv);
+	} else if (strcmp(argv[1], "status") == 0) {
+		pfe_command_status(argc, argv);
+	} else if (strcmp(argv[1], "expt") == 0) {
+		pfe_command_expt(argc, argv);
+#ifdef PFE_RESET_WA
+	} else if (strcmp(argv[1], "stop") == 0) {
+		pfe_command_stop(argc, argv);
+#endif
+	} else {
+		printf("Unknown option: %s\n", argv[1]);
+		pfe_command_help();
+		return CMD_RET_FAILURE;
+	}
+	return CMD_RET_SUCCESS;
+}
+
+U_BOOT_CMD(
+	pfe,	7,	1,	pfe_command,
+	"Performs PFE lib utility functions",
+	"Usage:\n"
+	"pfe <options>"
+);
Signature · 1 line
2.7.4
#9 lore raw

PATCH v4 5/13 drivers: net: pfe_eth: LS1012A PFE headers

In reply to Calvin Johnson

Contains all the pfe header files.

---

Changes in v4: None
Changes in v3:
-Move pfe_eth header files to include/net/pfe_eth
-Use BIT macro wherever applicable

Changes in v2:
-Add pfe_rx_done to clear bd after packet processing -remove unused code under CONFIG_UTIL_PE_DISABLED
-Used BIT and GENMASK macros wherever applicable
-Removed generic definitions that pollutes namespace
-File names pfe.h renamed to pfe_hw.h to be more clear as it contains
low level functions that directly access pfe hardware block
-Added pfe_dm_eth.h for new driver model

 include/dm/platform_data/pfe_dm_eth.h    |  21 ++++
 include/net/pfe_eth/pfe/cbus.h           |  77 +++++++++++++
 include/net/pfe_eth/pfe/cbus/bmu.h       |  40 +++++++
 include/net/pfe_eth/pfe/cbus/class_csr.h | 180 +++++++++++++++++++++++++++++++
 include/net/pfe_eth/pfe/cbus/emac.h      | 140 ++++++++++++++++++++++++
 include/net/pfe_eth/pfe/cbus/gpi.h       |  62 +++++++++++
 include/net/pfe_eth/pfe/cbus/hif.h       |  68 ++++++++++++
 include/net/pfe_eth/pfe/cbus/hif_nocpy.h |  40 +++++++
 include/net/pfe_eth/pfe/cbus/tmu_csr.h   | 148 +++++++++++++++++++++++++
 include/net/pfe_eth/pfe/cbus/util_csr.h  |  47 ++++++++
 include/net/pfe_eth/pfe/pfe_hw.h         | 163 ++++++++++++++++++++++++++++
 include/net/pfe_eth/pfe_driver.h         |  59 ++++++++++
 include/net/pfe_eth/pfe_eth.h            | 104 ++++++++++++++++++
 include/net/pfe_eth/pfe_firmware.h       |  17 +++
 include/net/pfe_eth/pfe_mdio.h           |  13 +++
 15 files changed, 1179 insertions(+)
 create mode 100644 include/dm/platform_data/pfe_dm_eth.h
 create mode 100644 include/net/pfe_eth/pfe/cbus.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/bmu.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/class_csr.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/emac.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/gpi.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/hif.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/hif_nocpy.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/tmu_csr.h
 create mode 100644 include/net/pfe_eth/pfe/cbus/util_csr.h
 create mode 100644 include/net/pfe_eth/pfe/pfe_hw.h
 create mode 100644 include/net/pfe_eth/pfe_driver.h
 create mode 100644 include/net/pfe_eth/pfe_eth.h
 create mode 100644 include/net/pfe_eth/pfe_firmware.h
 create mode 100644 include/net/pfe_eth/pfe_mdio.h
include/dm/platform_data/pfe_dm_eth.h new file +21 -0
new file mode 100644
index 0000000..7943c67
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __PFE_DM_ETH_H__
+#define __PFE_DM_ETH_H__
+#include <net.h>
+
+struct pfe_ddr_address {
+	void *ddr_pfe_baseaddr;
+	unsigned long ddr_pfe_phys_baseaddr;
+};
+
+struct pfe_eth_pdata {
+	struct eth_pdata pfe_eth_pdata_mac;
+	struct pfe_ddr_address pfe_ddr_addr;
+};
+#endif /* __PFE_DM_ETH_H__ */
include/net/pfe_eth/pfe/cbus.h new file +77 -0

77 lines not on this page · raw message

include/net/pfe_eth/pfe/cbus/bmu.h new file +40 -0
new file mode 100644
index 0000000..f707cc3
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _BMU_H_
+#define _BMU_H_
+
+#define BMU_VERSION		0x000
+#define BMU_CTRL		0x004
+#define BMU_UCAST_CONFIG	0x008
+#define BMU_UCAST_BASE_ADDR	0x00c
+#define BMU_BUF_SIZE		0x010
+#define BMU_BUF_CNT		0x014
+#define BMU_THRES		0x018
+#define BMU_INT_SRC		0x020
+#define BMU_INT_ENABLE		0x024
+#define BMU_ALLOC_CTRL		0x030
+#define BMU_FREE_CTRL		0x034
+#define BMU_FREE_ERR_ADDR	0x038
+#define BMU_CURR_BUF_CNT	0x03c
+#define BMU_MCAST_CNT		0x040
+#define BMU_MCAST_ALLOC_CTRL	0x044
+#define BMU_REM_BUF_CNT		0x048
+#define BMU_LOW_WATERMARK	0x050
+#define BMU_HIGH_WATERMARK	0x054
+#define BMU_INT_MEM_ACCESS	0x100
+
+struct bmu_cfg {
+	u32 baseaddr;
+	u32 count;
+	u32 size;
+};
+
+#define BMU1_BUF_SIZE	LMEM_BUF_SIZE_LN2
+#define BMU2_BUF_SIZE	DDR_BUF_SIZE_LN2
+
+#endif /* _BMU_H_ */
include/net/pfe_eth/pfe/cbus/class_csr.h new file +180 -0

180 lines not on this page · raw message

include/net/pfe_eth/pfe/cbus/emac.h new file +140 -0

140 lines not on this page · raw message

include/net/pfe_eth/pfe/cbus/gpi.h new file +62 -0

62 lines not on this page · raw message

include/net/pfe_eth/pfe/cbus/hif.h new file +68 -0

68 lines not on this page · raw message

include/net/pfe_eth/pfe/cbus/hif_nocpy.h new file +40 -0
new file mode 100644
index 0000000..c2d6f6d
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _HIF_NOCPY_H_
+#define _HIF_NOCPY_H_
+
+#define HIF_NOCPY_VERSION		(HIF_NOCPY_BASE_ADDR + 0x00)
+#define HIF_NOCPY_TX_CTRL		(HIF_NOCPY_BASE_ADDR + 0x04)
+#define HIF_NOCPY_TX_CURR_BD_ADDR	(HIF_NOCPY_BASE_ADDR + 0x08)
+#define HIF_NOCPY_TX_ALLOC		(HIF_NOCPY_BASE_ADDR + 0x0c)
+#define HIF_NOCPY_TX_BDP_ADDR		(HIF_NOCPY_BASE_ADDR + 0x10)
+#define HIF_NOCPY_TX_STATUS		(HIF_NOCPY_BASE_ADDR + 0x14)
+#define HIF_NOCPY_RX_CTRL		(HIF_NOCPY_BASE_ADDR + 0x20)
+#define HIF_NOCPY_RX_BDP_ADDR		(HIF_NOCPY_BASE_ADDR + 0x24)
+#define HIF_NOCPY_RX_STATUS		(HIF_NOCPY_BASE_ADDR + 0x30)
+#define HIF_NOCPY_INT_SRC		(HIF_NOCPY_BASE_ADDR + 0x34)
+#define HIF_NOCPY_INT_ENABLE		(HIF_NOCPY_BASE_ADDR + 0x38)
+#define HIF_NOCPY_POLL_CTRL		(HIF_NOCPY_BASE_ADDR + 0x3c)
+#define HIF_NOCPY_RX_CURR_BD_ADDR	(HIF_NOCPY_BASE_ADDR + 0x40)
+#define HIF_NOCPY_RX_ALLOC		(HIF_NOCPY_BASE_ADDR + 0x44)
+#define HIF_NOCPY_TX_DMA_STATUS		(HIF_NOCPY_BASE_ADDR + 0x48)
+#define HIF_NOCPY_RX_DMA_STATUS		(HIF_NOCPY_BASE_ADDR + 0x4c)
+#define HIF_NOCPY_RX_INQ0_PKTPTR	(HIF_NOCPY_BASE_ADDR + 0x50)
+#define HIF_NOCPY_RX_INQ1_PKTPTR	(HIF_NOCPY_BASE_ADDR + 0x54)
+#define HIF_NOCPY_TX_PORT_NO		(HIF_NOCPY_BASE_ADDR + 0x60)
+#define HIF_NOCPY_LMEM_ALLOC_ADDR	(HIF_NOCPY_BASE_ADDR + 0x64)
+#define HIF_NOCPY_CLASS_ADDR		(HIF_NOCPY_BASE_ADDR + 0x68)
+#define HIF_NOCPY_TMU_PORT0_ADDR	(HIF_NOCPY_BASE_ADDR + 0x70)
+#define HIF_NOCPY_TMU_PORT1_ADDR	(HIF_NOCPY_BASE_ADDR + 0x74)
+#define HIF_NOCPY_TMU_PORT2_ADDR	(HIF_NOCPY_BASE_ADDR + 0x7c)
+#define HIF_NOCPY_TMU_PORT3_ADDR	(HIF_NOCPY_BASE_ADDR + 0x80)
+#define HIF_NOCPY_TMU_PORT4_ADDR	(HIF_NOCPY_BASE_ADDR + 0x84)
+#define HIF_NOCPY_INT_COAL		(HIF_NOCPY_BASE_ADDR + 0x90)
+#define HIF_NOCPY_AXI_CTRL		(HIF_NOCPY_BASE_ADDR + 0x94)
+
+#endif /* _HIF_NOCPY_H_ */
include/net/pfe_eth/pfe/cbus/tmu_csr.h new file +148 -0

148 lines not on this page · raw message

include/net/pfe_eth/pfe/cbus/util_csr.h new file +47 -0

47 lines not on this page · raw message

include/net/pfe_eth/pfe/pfe_hw.h new file +163 -0

163 lines not on this page · raw message

include/net/pfe_eth/pfe_driver.h new file +59 -0

59 lines not on this page · raw message

include/net/pfe_eth/pfe_eth.h new file +104 -0

104 lines not on this page · raw message

include/net/pfe_eth/pfe_firmware.h new file +17 -0
new file mode 100644
index 0000000..588b2ae
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+/** @file
+ *  Contains all the defines to handle parsing and loading of PE firmware files.
+ */
+#ifndef __PFE_FIRMWARE_H__
+#define __PFE_FIRMWARE_H__
+
+int pfe_firmware_init(void);
+void pfe_firmware_exit(void);
+
+#endif
include/net/pfe_eth/pfe_mdio.h new file +13 -0
new file mode 100644
index 0000000..ab27ec3
@@ -0,0 +1,13 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _PFE_MDIO_H_
+#define _PFE_MDIO_H_
+
+int pfe_phy_configure(struct pfe_eth_dev *priv, int dev_id, int phy_id);
+
+#endif /* _PFE_MDIO_H_ */
Signature · 1 line
2.7.4
#11 lore raw

PATCH v4 6/13 board: freescale: ls1012aqds: enable network support on ls1012aqds

In reply to Calvin Johnson

This patch enables ethernet support for ls1012aqds.

---

Changes in v4:
-Compile pfe driver conditionally with CONFIG_FSL_PFE

Changes in v3:
-Update Kconfig
-Update header file location to include/net/pfe_eth -Cosmetic changes

Changes in v2:
-split from original patch "board: freescale: ls1012a: enable network support on ls1012a platforms"

 board/freescale/ls1012aqds/Kconfig            |  45 ++++
 board/freescale/ls1012aqds/Makefile           |   1 +
 board/freescale/ls1012aqds/eth.c              | 309 ++++++++++++++++++++++++++
 board/freescale/ls1012aqds/ls1012aqds.c       |  97 +++++++-
 board/freescale/ls1012aqds/ls1012aqds_pfe.h   |  45 ++++
 board/freescale/ls1012aqds/ls1012aqds_qixis.h |   2 +-
 6 files changed, 492 insertions(+), 7 deletions(-)
 create mode 100644 board/freescale/ls1012aqds/eth.c
 create mode 100644 board/freescale/ls1012aqds/ls1012aqds_pfe.h
board/freescale/ls1012aqds/Kconfig +45 -0
index fc9250b..c0b12ed 100644
@@ -12,6 +12,51 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "ls1012aqds"
 
+
+if FSL_PFE
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+	def_bool y
+	select PHYLIB
+	imply PHY_VITESSE
+	imply PHY_REALTEK
+	imply PHY_AQUANTIA
+	imply PHYLIB_10G
+
+config PFE_RGMII_RESET_WA
+	def_bool y
+
+config SYS_LS_PFE_FW_ADDR
+	hex "Flash address of PFE firmware"
+	default 0x40a00000
+
+config DDR_PFE_PHYS_BASEADDR
+	hex "PFE DDR physical base address"
+	default 0x03800000
+
+config DDR_PFE_BASEADDR
+	hex "PFE DDR base address"
+	default 0x83800000
+
+config PFE_EMAC1_PHY_ADDR
+	hex "PFE DDR base address"
+	default 0x1e
+
+config PFE_EMAC2_PHY_ADDR
+	hex "PFE DDR base address"
+	default 0x1
+
+config PFE_SGMII_2500_PHY1_ADDR
+	hex "PFE DDR base address"
+	default 0x1
+
+config PFE_SGMII_2500_PHY2_ADDR
+	hex "PFE DDR base address"
+	default 0x2
+
+endif
+
+
 source "board/freescale/common/Kconfig"
 
 endif
board/freescale/ls1012aqds/Makefile +1 -0
index 0b813f9..5aba9ca 100644
@@ -5,3 +5,4 @@
 #
 
 obj-y += ls1012aqds.o
+obj-$(CONFIG_FSL_PFE) += eth.o
board/freescale/ls1012aqds/eth.c new file +309 -0

309 lines not on this page · raw message

board/freescale/ls1012aqds/ls1012aqds.c +91 -6

123 lines not on this page · raw message

board/freescale/ls1012aqds/ls1012aqds_pfe.h new file +45 -0

45 lines not on this page · raw message

board/freescale/ls1012aqds/ls1012aqds_qixis.h +1 -1
index 584f604..7a1ba3d 100644
@@ -11,7 +11,7 @@
 
 /* BRDCFG4[4:7] select EC1 and EC2 as a pair */
 #define BRDCFG4_EMISEL_MASK		0xe0
-#define BRDCFG4_EMISEL_SHIFT		5
+#define BRDCFG4_EMISEL_SHIFT		6
 
 /* SYSCLK */
 #define QIXIS_SYSCLK_66			0x0
Signature · 1 line
2.7.4
#13 lore raw

PATCH v4 7/13 board: freescale: ls1012afrdm: enable network support on ls1012afrdm

In reply to Calvin Johnson

This patch enables ethernet support for ls1012afrdm.

---

Changes in v4:
-Compile pfe driver conditionally with CONFIG_FSL_PFE

Changes in v3:
-Update Kconfig
-Update header file location to include/net/pfe_eth -Prefix CONFIG_PFE_ to appropriate macros

Changes in v2:
-split from original patch "board: freescale: ls1012a: enable network support on ls1012a platforms"

 board/freescale/ls1012afrdm/Kconfig       |  29 +++++++
 board/freescale/ls1012afrdm/Makefile      |   1 +
 board/freescale/ls1012afrdm/eth.c         | 124 ++++++++++++++++++++++++++++++
 board/freescale/ls1012afrdm/ls1012afrdm.c |   5 --
 4 files changed, 154 insertions(+), 5 deletions(-)
 create mode 100644 board/freescale/ls1012afrdm/eth.c
board/freescale/ls1012afrdm/Kconfig +29 -0
index 38bd91b..22d521b 100644
@@ -12,6 +12,35 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "ls1012afrdm"
 
+if FSL_PFE
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+	def_bool y
+	select PHYLIB
+	imply PHY_REALTEK
+
+config SYS_LS_PFE_FW_ADDR
+	hex "Flash address of PFE firmware"
+	default 0x40a00000
+
+config DDR_PFE_PHYS_BASEADDR
+	hex "PFE DDR physical base address"
+	default 0x03800000
+
+config DDR_PFE_BASEADDR
+	hex "PFE DDR base address"
+	default 0x83800000
+
+config PFE_EMAC1_PHY_ADDR
+	hex "PFE DDR base address"
+	default 0x2
+
+config PFE_EMAC2_PHY_ADDR
+	hex "PFE DDR base address"
+	default 0x1
+
+endif
+
 source "board/freescale/common/Kconfig"
 
 endif
board/freescale/ls1012afrdm/Makefile +1 -0
index dbfa2ce..1e53c96 100644
@@ -5,3 +5,4 @@
 #
 
 obj-y += ls1012afrdm.o
+obj-$(CONFIG_FSL_PFE) += eth.o
board/freescale/ls1012afrdm/eth.c new file +124 -0

124 lines not on this page · raw message

board/freescale/ls1012afrdm/ls1012afrdm.c +0 -5
index 9afd1c4..0145886 100644
@@ -57,11 +57,6 @@ int dram_init(void)
 	return 0;
 }
 
-int board_eth_init(bd_t *bis)
-{
-	return pci_eth_init(bis);
-}
-
 int board_early_init_f(void)
 {
 	fsl_lsch2_early_init_f();
Signature · 1 line
2.7.4
#15 lore raw

PATCH v4 8/13 board: freescale: ls1012ardb: enable network support on ls1012ardb

In reply to Calvin Johnson

This patch enables ethernet support for ls1012ardb.

---

Changes in v4:
-Compile pfe driver conditionally with CONFIG_FSL_PFE

Changes in v3:
-Update Kconfig
-Update header file location to include/net/pfe_eth

Changes in v2:
-split from original patch "board: freescale: ls1012a: enable network support on ls1012a platforms"

 board/freescale/ls1012ardb/Kconfig      |  29 +++++++++
 board/freescale/ls1012ardb/Makefile     |   1 +
 board/freescale/ls1012ardb/eth.c        | 106 ++++++++++++++++++++++++++++++++
 board/freescale/ls1012ardb/ls1012ardb.c |   4 --
 include/configs/ls1012ardb.h            |   4 ++
 5 files changed, 140 insertions(+), 4 deletions(-)
 create mode 100644 board/freescale/ls1012ardb/eth.c
board/freescale/ls1012ardb/Kconfig +29 -0
index d13b08e..af35a01 100644
@@ -12,6 +12,35 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "ls1012ardb"
 
+if FSL_PFE
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+	def_bool y
+	select PHYLIB
+	imply PHY_REALTEK
+
+config SYS_LS_PFE_FW_ADDR
+	hex "Flash address of PFE firmware"
+	default 0x40a00000
+
+config DDR_PFE_PHYS_BASEADDR
+	hex "PFE DDR physical base address"
+	default 0x03800000
+
+config DDR_PFE_BASEADDR
+	hex "PFE DDR base address"
+	default 0x83800000
+
+config PFE_EMAC1_PHY_ADDR
+	hex "PFE DDR base address"
+	default 0x2
+
+config PFE_EMAC2_PHY_ADDR
+	hex "PFE DDR base address"
+	default 0x1
+
+endif
+
 source "board/freescale/common/Kconfig"
 
 endif
board/freescale/ls1012ardb/Makefile +1 -0
index 05fa9d9..70c7b33 100644
@@ -5,3 +5,4 @@
 #
 
 obj-y += ls1012ardb.o
+obj-$(CONFIG_FSL_PFE) += eth.o
board/freescale/ls1012ardb/eth.c new file +106 -0

106 lines not on this page · raw message

board/freescale/ls1012ardb/ls1012ardb.c +0 -4
index c9557bb..ed5a8e6 100644
@@ -114,10 +114,6 @@ int dram_init(void)
 	return 0;
 }
 
-int board_eth_init(bd_t *bis)
-{
-	return pci_eth_init(bis);
-}
 
 int board_early_init_f(void)
 {
include/configs/ls1012ardb.h +4 -0
index 97ed909..43f6236 100644
@@ -25,6 +25,7 @@
  */
 
 #define I2C_MUX_IO_ADDR		0x24
+#define I2C_MUX_IO2_ADDR	0x25
 #define I2C_MUX_IO_0		0
 #define I2C_MUX_IO_1		1
 #define SW_BOOT_MASK		0x03
@@ -39,6 +40,9 @@
 #define SW_REV_C2		0xD8
 #define SW_REV_D		0xD0
 #define SW_REV_E		0xC8
+#define __PHY_MASK		0xF9
+#define __PHY_ETH2_MASK		0xFB
+#define __PHY_ETH1_MASK		0xFD
 
 /*  MMC  */
 #ifdef CONFIG_MMC
Signature · 1 line
2.7.4
#17 lore raw

PATCH v4 9/13 board: freescale: ls1012a2g5rdb: enable network support on ls1012a2g5rdb

In reply to Calvin Johnson

This patch enables ethernet support for ls1012a2g5rdb.

---

Changes in v4: None
Changes in v3:
-Update Kconfig
-Update header file location to include/net/pfe_eth -Prefix CONFIG_PFE_ to appropriate macros -Indent properly

Changes in v2:
-New patch added to series to enable ethernet support for ls1012a2g5rdb

 board/freescale/ls1012ardb/Kconfig | 30 +++++++++++++++++++++++++
 board/freescale/ls1012ardb/eth.c   | 45 +++++++++++++++++++++++++++++++-------
 2 files changed, 67 insertions(+), 8 deletions(-)
board/freescale/ls1012ardb/Kconfig +30 -0
index af35a01..493d477 100644
@@ -59,6 +59,36 @@ config SYS_SOC
 config SYS_CONFIG_NAME
         default "ls1012a2g5rdb"
 
+if FSL_PFE
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+	def_bool y
+	select PHYLIB
+	imply CONFIG_PHYLIB_10G
+	imply CONFIG_PHY_AQUANTIA
+
+config SYS_LS_PFE_FW_ADDR
+	hex "Flash address of PFE firmware"
+	default 0x40a00000
+
+config DDR_PFE_PHYS_BASEADDR
+	hex "PFE DDR physical base address"
+	default 0x03800000
+
+config DDR_PFE_BASEADDR
+	hex "PFE DDR base address"
+	default 0x83800000
+
+config PFE_EMAC1_PHY_ADDR
+	hex "PFE DDR base address"
+	default 0x2
+
+config PFE_EMAC2_PHY_ADDR
+	hex "PFE DDR base address"
+	default 0x1
+
+endif
+
 source "board/freescale/common/Kconfig"
 
 endif
board/freescale/ls1012ardb/eth.c +37 -8

69 lines not on this page · raw message

Signature · 1 line
2.7.4
#19 lore raw

PATCH v4 10/13 armv8: fsl-lsch2: add pfe macros and update ccsr_scfg structure

In reply to Calvin Johnson

SoC specific PFE macros are defined and structure ccsr_scfg is updated with members defined for PFE.

---

Changes in v4: None
Changes in v3:
-Use BIT macro wherever applicable

Changes in v2: None

 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  | 38 ++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h +36 -2
index b195005..d6f0c5b 100644
@@ -395,6 +395,21 @@ struct ccsr_gur {
 #define SCFG_SNPCNFGCR_SATARDSNP	0x00800000
 #define SCFG_SNPCNFGCR_SATAWRSNP	0x00400000
 
+/* RGMIIPCR bit definitions*/
+#define SCFG_RGMIIPCR_EN_AUTO		BIT(3)
+#define SCFG_RGMIIPCR_SETSP_1000M	BIT(2)
+#define SCFG_RGMIIPCR_SETSP_100M	0
+#define SCFG_RGMIIPCR_SETSP_10M		BIT(1)
+#define SCFG_RGMIIPCR_SETFD		BIT(0)
+
+/* PFEASBCR bit definitions */
+#define SCFG_PFEASBCR_ARCACHE0		BIT(31)
+#define SCFG_PFEASBCR_AWCACHE0		BIT(30)
+#define SCFG_PFEASBCR_ARCACHE1		BIT(29)
+#define SCFG_PFEASBCR_AWCACHE1		BIT(28)
+#define SCFG_PFEASBCR_ARSNP		BIT(27)
+#define SCFG_PFEASBCR_AWSNP		BIT(26)
+
 /* Supplemental Configuration Unit */
 struct ccsr_scfg {
 	u8 res_000[0x100-0x000];
@@ -412,7 +427,12 @@ struct ccsr_scfg {
 	u8 res_140[0x158-0x140];
 	u32 altcbar;
 	u32 qspi_cfg;
-	u8 res_160[0x180-0x160];
+	u8 res_160[0x164 - 0x160];
+	u32 wr_qos1;
+	u32 wr_qos2;
+	u32 rd_qos1;
+	u32 rd_qos2;
+	u8 res_174[0x180 - 0x174];
 	u32 dmamcr;
 	u8 res_184[0x188-0x184];
 	u32 gic_align;
@@ -443,7 +463,21 @@ struct ccsr_scfg {
 	u32 usb_refclk_selcr1;
 	u32 usb_refclk_selcr2;
 	u32 usb_refclk_selcr3;
-	u8 res_424[0x600-0x424];
+	u8 res_424[0x434 - 0x424];
+	u32 rgmiipcr;
+	u32 res_438;
+	u32 rgmiipsr;
+	u32 pfepfcssr1;
+	u32 pfeintencr1;
+	u32 pfepfcssr2;
+	u32 pfeintencr2;
+	u32 pfeerrcr;
+	u32 pfeeerrintencr;
+	u32 pfeasbcr;
+	u32 pfebsbcr;
+	u8 res_460[0x484 - 0x460];
+	u32 mdioselcr;
+	u8 res_468[0x600 - 0x488];
 	u32 scratchrw[4];
 	u8 res_610[0x680-0x610];
 	u32 corebcr;
Signature · 1 line
2.7.4
#21 lore raw

PATCH v4 11/13 armv8: fsl-lsch2: configure pfe's DDR and HDBUS interfaces and ECC

In reply to Calvin Johnson

1. Set AWCACHE0 attribute of PFE DDR and HDBUS master interfaces to bufferable.
2. Set RD/WR QoS for PFE DDR and HDBUS AXI master interfaces.
3. Disable ECC detection for PFE.

---

Changes in v4: None
Changes in v3:
-Cosmetic change

Changes in v2:
-Improved commit message to provide more description -Replaced magic numbers with proper definitions

 arch/arm/cpu/armv8/fsl-layerscape/soc.c            | 23 ++++++++++++++++++++++
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  | 10 ++++++++++
 arch/arm/include/asm/arch-fsl-layerscape/soc.h     |  3 +++
 3 files changed, 36 insertions(+)
arch/arm/cpu/armv8/fsl-layerscape/soc.c +23 -0
index b9f837d..18fb937 100644
@@ -612,6 +612,29 @@ int setup_chip_volt(void)
 	return 0;
 }
 
+#ifdef CONFIG_FSL_PFE
+void init_pfe_scfg_dcfg_regs(void)
+{
+	struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
+	u32 ecccr2;
+
+	out_be32(&scfg->pfeasbcr,
+		 in_be32(&scfg->pfeasbcr) | SCFG_PFEASBCR_AWCACHE0);
+	out_be32(&scfg->pfebsbcr,
+		 in_be32(&scfg->pfebsbcr) | SCFG_PFEASBCR_AWCACHE0);
+
+	/* CCI-400 QoS settings for PFE */
+	out_be32(&scfg->wr_qos1, (unsigned int)(SCFG_WR_QOS1_PFE1_QOS
+		 | SCFG_WR_QOS1_PFE2_QOS));
+	out_be32(&scfg->rd_qos1, (unsigned int)(SCFG_RD_QOS1_PFE1_QOS
+		 | SCFG_RD_QOS1_PFE2_QOS));
+
+	ecccr2 = in_be32(CONFIG_SYS_DCSR_DCFG_ADDR + DCFG_DCSR_ECCCR2);
+	out_be32((void *)CONFIG_SYS_DCSR_DCFG_ADDR + DCFG_DCSR_ECCCR2,
+		 ecccr2 | (unsigned int)DISABLE_PFE_ECC);
+}
+#endif
+
 void fsl_lsch2_early_init_f(void)
 {
 	struct ccsr_cci400 *cci = (struct ccsr_cci400 *)(CONFIG_SYS_IMMR +
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h +10 -0
index d6f0c5b..af68af4 100644
@@ -205,6 +205,8 @@ struct sys_info {
 
 /* Device Configuration and Pin Control */
 #define DCFG_DCSR_PORCR1		0x0
+#define DCFG_DCSR_ECCCR2		0x524
+#define DISABLE_PFE_ECC			BIT(13)
 
 struct ccsr_gur {
 	u32     porsr1;         /* POR status 1 */
@@ -410,6 +412,14 @@ struct ccsr_gur {
 #define SCFG_PFEASBCR_ARSNP		BIT(27)
 #define SCFG_PFEASBCR_AWSNP		BIT(26)
 
+/* WR_QoS1 PFE bit definitions */
+#define SCFG_WR_QOS1_PFE1_QOS		GENMASK(27, 24)
+#define SCFG_WR_QOS1_PFE2_QOS		GENMASK(23, 20)
+
+/* RD_QoS1 PFE bit definitions */
+#define SCFG_RD_QOS1_PFE1_QOS		GENMASK(27, 24)
+#define SCFG_RD_QOS1_PFE2_QOS		GENMASK(23, 20)
+
 /* Supplemental Configuration Unit */
 struct ccsr_scfg {
 	u8 res_000[0x100-0x000];
arch/arm/include/asm/arch-fsl-layerscape/soc.h +3 -0
index cb760b5..d9bfddb 100644
@@ -127,6 +127,9 @@ void fsl_lsch2_early_init_f(void);
 int setup_chip_volt(void);
 /* Setup core vdd in unit mV */
 int board_setup_core_volt(u32 vdd);
+#ifdef CONFIG_FSL_PFE
+void init_pfe_scfg_dcfg_regs(void);
+#endif
 #endif
 
 void cpu_name(char *name);
Signature · 1 line
2.7.4
#23 lore raw

PATCH v4 12/13 armv8: layerscape: csu: enable ns access to PFE registers

In reply to Calvin Johnson

Enable all types of non-secure access to PFE block registers.

---

Changes in v4: None
Changes in v3: None
Changes in v2:
-Improved commit message to provide more description

 arch/arm/include/asm/arch-fsl-layerscape/ns_access.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/include/asm/arch-fsl-layerscape/ns_access.h +2 -0
index f46f1d8..fe97a93 100644
@@ -26,6 +26,7 @@ enum csu_cslx_ind {
 	CSU_CSLX_PCIE3_IO,
 	CSU_CSLX_USB3 = 20,
 	CSU_CSLX_USB2,
+	CSU_CSLX_PFE = 23,
 	CSU_CSLX_SERDES = 32,
 	CSU_CSLX_QDMA,
 	CSU_CSLX_LPUART2,
@@ -105,6 +106,7 @@ static struct csu_ns_dev ns_dev[] = {
 	 {CSU_CSLX_PCIE3_IO, CSU_ALL_RW},
 	 {CSU_CSLX_USB3, CSU_ALL_RW},
 	 {CSU_CSLX_USB2, CSU_ALL_RW},
+	 {CSU_CSLX_PFE, CSU_ALL_RW},
 	 {CSU_CSLX_SERDES, CSU_ALL_RW},
 	 {CSU_CSLX_QDMA, CSU_ALL_RW},
 	 {CSU_CSLX_LPUART2, CSU_ALL_RW},
Signature · 1 line
2.7.4
#25 lore raw

PATCH v4 13/13 configs: ls1012a: add pfe configuration for LS1012A

In reply to Calvin Johnson

Add configurations for PFE.

---

Changes in v4:
-Fix typo "ppfe stop"

Changes in v3:
-Move PFE macros to Kconfig
-Remove unused UTIL_PE_DISABLED config

Changes in v2:
-Moved SYS_LS_PFE_FW_ADDR from pfe Kconfig to board Kconfigs -Add "pfe stop" to ls1012a rdb, frdm and 2g5rdb config files

 configs/ls1012a2g5rdb_qspi_defconfig |  2 ++
 configs/ls1012afrdm_qspi_defconfig   |  2 ++
 configs/ls1012aqds_qspi_defconfig    |  2 ++
 configs/ls1012ardb_qspi_defconfig    |  2 ++
 drivers/net/Kconfig                  |  1 +
 drivers/net/Makefile                 |  1 +
 drivers/net/pfe_eth/Kconfig          | 12 ++++++++++++
 drivers/net/pfe_eth/Makefile         | 12 ++++++++++++
 include/configs/ls1012a2g5rdb.h      | 11 +----------
 include/configs/ls1012a_common.h     |  6 +++---
 include/configs/ls1012afrdm.h        |  2 +-
 include/configs/ls1012ardb.h         |  2 +-
 12 files changed, 40 insertions(+), 15 deletions(-)
 create mode 100644 drivers/net/pfe_eth/Kconfig
 create mode 100644 drivers/net/pfe_eth/Makefile
configs/ls1012a2g5rdb_qspi_defconfig +2 -0
index 26dcb1a..af676e2 100644
@@ -31,7 +31,9 @@ CONFIG_DM=y
 CONFIG_DM_MMC=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
+CONFIG_DM_ETH=y
 CONFIG_NETDEVICES=y
+CONFIG_FSL_PFE=y
 CONFIG_SYS_NS16550=y
 CONFIG_DM_SPI=y
 CONFIG_USB=y
configs/ls1012afrdm_qspi_defconfig +2 -0
index 1164361..c02e520 100644
@@ -29,8 +29,10 @@ CONFIG_DM=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
+CONFIG_DM_ETH=y
 CONFIG_NETDEVICES=y
 CONFIG_E1000=y
+CONFIG_FSL_PFE=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
configs/ls1012aqds_qspi_defconfig +2 -0
index 9fdf333..25470cb 100644
@@ -36,8 +36,10 @@ CONFIG_SCSI_AHCI=y
 CONFIG_DM_MMC=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
+CONFIG_DM_ETH=y
 CONFIG_NETDEVICES=y
 CONFIG_E1000=y
+CONFIG_FSL_PFE=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
configs/ls1012ardb_qspi_defconfig +2 -0
index 4347263..1f62953 100644
@@ -32,8 +32,10 @@ CONFIG_DM=y
 CONFIG_DM_MMC=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
+CONFIG_DM_ETH=y
 CONFIG_NETDEVICES=y
 CONFIG_E1000=y
+CONFIG_FSL_PFE=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
drivers/net/Kconfig +1 -0
index de1947c..f589978 100644
@@ -1,4 +1,5 @@
 source "drivers/net/phy/Kconfig"
+source "drivers/net/pfe_eth/Kconfig"
 
 config DM_ETH
 	bool "Enable Driver Model for Ethernet drivers"
drivers/net/Makefile +1 -0
index 4a16c62..95cb7bb 100644
@@ -73,3 +73,4 @@ obj-$(CONFIG_FSL_MEMAC) += fm/memac_phy.o
 obj-$(CONFIG_VSC9953) += vsc9953.o
 obj-$(CONFIG_PIC32_ETH) += pic32_mdio.o pic32_eth.o
 obj-$(CONFIG_DWC_ETH_QOS) += dwc_eth_qos.o
+obj-$(CONFIG_FSL_PFE) += pfe_eth/
drivers/net/pfe_eth/Kconfig new file +12 -0
new file mode 100644
index 0000000..a13b331
@@ -0,0 +1,12 @@
+menuconfig FSL_PFE
+	bool "NXP PFE Ethernet driver"
+	help
+	  This driver provides support for NXP's Packet Forwarding Engine.
+
+if FSL_PFE
+
+config SYS_FSL_PFE_ADDR
+	hex "PFE base address"
+	default 0x04000000
+
+endif
drivers/net/pfe_eth/Makefile new file +12 -0
new file mode 100644
index 0000000..6b5248f
@@ -0,0 +1,12 @@
+# Copyright 2015-2016 Freescale Semiconductor, Inc.
+# Copyright 2017 NXP
+#
+# SPDX-License-Identifier:GPL-2.0+
+
+# Layerscape PFE driver
+obj-y += pfe_cmd.o	\
+	 pfe_driver.o	\
+	 pfe_eth.o	\
+	 pfe_firmware.o \
+	 pfe_hw.o	\
+	 pfe_mdio.o
include/configs/ls1012a2g5rdb.h +1 -10
index 25df103..dbb0fcc 100644
@@ -9,15 +9,6 @@
 
 #include "ls1012a_common.h"
 
-/* PFE Ethernet */
-#ifdef CONFIG_FSL_PFE
-#define EMAC1_PHY_ADDR          0x2
-#define EMAC2_PHY_ADDR          0x1
-#define CONFIG_PHYLIB
-#define CONFIG_PHYLIB_10G
-#define CONFIG_PHY_AQUANTIA
-#endif
-
 /* DDR */
 #define CONFIG_DIMM_SLOTS_PER_CTLR	1
 #define CONFIG_CHIP_SELECTS_PER_CTRL	1
@@ -110,7 +101,7 @@
 
 #undef CONFIG_BOOTCOMMAND
 #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
-#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \
+#define CONFIG_BOOTCOMMAND "pfe stop;run distro_bootcmd; run qspi_bootcmd; " \
 			   "env exists secureboot && esbc_halt;"
 #endif
 
include/configs/ls1012a_common.h +3 -3
index 46b3566..eda813f 100644
@@ -113,9 +113,9 @@
 	"kernel_size=0x2800000\0"		\
 
 #undef CONFIG_BOOTCOMMAND
-#define CONFIG_BOOTCOMMAND		"sf probe 0:0; sf read $kernel_load "\
-					"$kernel_start $kernel_size && "\
-					"bootm $kernel_load"
+#define CONFIG_BOOTCOMMAND	"pfe stop; sf probe 0:0; sf read $kernel_load "\
+				"$kernel_start $kernel_size && "\
+				"bootm $kernel_load"
 
 /* Monitor Command Prompt */
 #define CONFIG_SYS_CBSIZE		512	/* Console I/O Buffer Size */
include/configs/ls1012afrdm.h +1 -1
index 297c057..7c080a0 100644
@@ -68,7 +68,7 @@
 		"$kernel_addr $kernel_size && bootm $load_addr#$board\0"
 
 #undef CONFIG_BOOTCOMMAND
-#define CONFIG_BOOTCOMMAND "run distro_bootcmd;run qspi_bootcmd"
+#define CONFIG_BOOTCOMMAND "pfe stop;run distro_bootcmd;run qspi_bootcmd"
 
 #define CONFIG_CMD_MEMINFO
 #define CONFIG_CMD_MEMTEST
include/configs/ls1012ardb.h +1 -1
index 43f6236..442c95e 100644
@@ -117,7 +117,7 @@
 		"bootm $load_addr#$board\0"
 
 #undef CONFIG_BOOTCOMMAND
-#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; "	\
+#define CONFIG_BOOTCOMMAND "pfe stop; run distro_bootcmd; run qspi_bootcmd; "\
 			   "env exists secureboot && esbc_halt;"
 
 #include <asm/fsl_secure_boot.h>
Signature · 1 line
2.7.4
#27 lore raw

[U-Boot] configs: ls1012a: add pfe configuration for LS1012A

Thanks Joe for reviewing and merging the PFE driver patches.

Calvin

Quoted 23 lines

-----Original Message-----
From: Joe Hershberger [mailto:joe.hershberger at ni.com]
Sent: Tuesday, March 27, 2018 12:56 AM
To: Calvin Johnson <[email protected]>
Cc: u-boot <[email protected]>
Subject: Re: configs: ls1012a: add pfe configuration for LS1012A

Hi Calvin,

https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchw
ork.ozlabs.org%2Fpatch%2F883033%2F&data=02%7C01%7Ccalvin.johnson%40nx p.com%7Cc29bdd41dec24a2d3ce508d593474d51%7C686ea1d3bc2b4c6fa92cd99c5 c301635%7C0%7C0%7C636576856821377657&sdata=kBw6DEIqgWsx8fZT%2BP9tV pViKJ1DBYDSQaQKqBisDQU%3D&reserved=0 was applied to
https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit.denx
.de%2F%3Fp%3Du-boot%2Fu-boot- net.git&data=02%7C01%7Ccalvin.johnson%40nxp.com%7Cc29bdd41dec24a2d3ce 508d593474d51%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636576856 821377657&sdata=zC3N6DAoV9zpQfPYO%2FJaoB%2BCH68ofXhvnR%2BTu9iM8pI %3D&reserved=0

Thanks!
-Joe