Skip to contentSkip to conversation

powerpc/85xx: Add support for FMan ethernet in Independent mode

PATCH Superseded Kumar Gala 4 participants 18 messages Aug 1, 2011 – Aug 30, 2011

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/5 powerpc/85xx: Add support for FMan ethernet in Independent mode

The Frame Manager (FMan) on QorIQ SoCs with DPAA (datapath acceleration architecture) is the ethernet contoller block. Normally it is utilized via Queue Manager (Qman) and Buffer Manager (Bman). However for boot usage the FMan supports a mode similar to QE or CPM ethernet collers called Independent mode.

Additionally the FMan block supports multiple 1g and 10g interfaces as a single entity in the system rather than each controller being managed uniquely. This means we have to initialize all of Fman regardless of the number of interfaces we utilize.

Different SoCs support different combinations of the number of FMan as well as the number of 1g & 10g interfaces support per Fman.

We add support for the following SoCs:
* P1023 - 1 Fman, 2x1g
* P4080 - 2 Fman, each Fman has 4x1g and 1x10g
* P204x/P3041/P5020 - 1 Fman, 5x1g, 1x10g

---
 Makefile                              |    1 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c   |    5 +
 arch/powerpc/cpu/mpc8xxx/cpu.c        |    4 +
 arch/powerpc/include/asm/config.h     |    5 +
 arch/powerpc/include/asm/fsl_dtsec.h  |  244 ++++++++++++
 arch/powerpc/include/asm/fsl_fman.h   |  257 ++++++++++++-
 arch/powerpc/include/asm/fsl_tgec.h   |  215 +++++++++++
 arch/powerpc/include/asm/immap_85xx.h |   23 +-
 drivers/net/Makefile                  |    1 +
 drivers/net/fm/Makefile               |   61 +++
 drivers/net/fm/dtsec.c                |  181 +++++++++
 drivers/net/fm/eth.c                  |  670 +++++++++++++++++++++++++++++++++
 drivers/net/fm/fm.c                   |  432 +++++++++++++++++++++
 drivers/net/fm/fm.h                   |  154 ++++++++
 drivers/net/fm/init.c                 |  208 ++++++++++
 drivers/net/fm/p1023.c                |   68 ++++
 drivers/net/fm/p4080.c                |   94 +++++
 drivers/net/fm/p5020.c                |   85 +++++
 drivers/net/fm/tgec.c                 |  119 ++++++
 drivers/net/fm/tgec_phy.c             |  139 +++++++
 include/fm_eth.h                      |  114 ++++++
 21 files changed, 3068 insertions(+), 12 deletions(-)
 create mode 100644 arch/powerpc/include/asm/fsl_dtsec.h
 create mode 100644 arch/powerpc/include/asm/fsl_tgec.h
 create mode 100644 drivers/net/fm/Makefile
 create mode 100644 drivers/net/fm/dtsec.c
 create mode 100644 drivers/net/fm/eth.c
 create mode 100644 drivers/net/fm/fm.c
 create mode 100644 drivers/net/fm/fm.h
 create mode 100644 drivers/net/fm/init.c
 create mode 100644 drivers/net/fm/p1023.c
 create mode 100644 drivers/net/fm/p4080.c
 create mode 100644 drivers/net/fm/p5020.c
 create mode 100644 drivers/net/fm/tgec.c
 create mode 100644 drivers/net/fm/tgec_phy.c
 create mode 100644 include/fm_eth.h
Makefile +1 -0
index ac757e6..b176464 100644
@@ -257,6 +257,7 @@ LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
 endif
 ifeq ($(CPU),mpc85xx)
 LIBS += drivers/qe/libqe.o
+LIBS += drivers/net/fm/libfm.o
 LIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
 LIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
 endif
arch/powerpc/cpu/mpc85xx/cpu_init.c +5 -0
index 6aca166..27f836c 100644
@@ -31,6 +31,7 @@
 #include <asm/processor.h>
 #include <ioports.h>
 #include <sata.h>
+#include <fm_eth.h>
 #include <asm/io.h>
 #include <asm/cache.h>
 #include <asm/mmu.h>
@@ -472,6 +473,10 @@ skip_l2:
 	}
 #endif
 
+#ifdef CONFIG_FMAN_ENET
+	fman_enet_init();
+#endif
+
 	return 0;
 }
 
arch/powerpc/cpu/mpc8xxx/cpu.c +4 -0
index 767bc52..861952d 100644
@@ -27,6 +27,7 @@
 #include <common.h>
 #include <command.h>
 #include <tsec.h>
+#include <fm_eth.h>
 #include <netdev.h>
 #include <asm/cache.h>
 #include <asm/io.h>
@@ -174,5 +175,8 @@ int cpu_eth_init(bd_t *bis)
 	tsec_standard_init(bis);
 #endif
 
+#ifdef CONFIG_FMAN_ENET
+	fm_standard_init(bis);
+#endif
 	return 0;
 }
arch/powerpc/include/asm/config.h +5 -0
index 9aad9be..c5e5c9c 100644
@@ -96,6 +96,11 @@
 #endif /* TSEC_ENET */
 #endif /* !CONFIG_PHYLIB */
 
+/* The FMAN driver uses the PHYLIB infrastructure */
+#if defined(CONFIG_FMAN_ENET)
+#define CONFIG_PHYLIB
+#endif
+
 /* All PPC boards must swap IDE bytes */
 #define CONFIG_IDE_SWAP_IO
 
arch/powerpc/include/asm/fsl_dtsec.h new file +244 -0

244 lines not on this page · raw message

arch/powerpc/include/asm/fsl_fman.h +250 -7

295 lines not on this page · raw message

arch/powerpc/include/asm/fsl_tgec.h new file +215 -0

215 lines not on this page · raw message

arch/powerpc/include/asm/immap_85xx.h +18 -5
index 6aaade0..50569fb 100644
@@ -1700,12 +1700,24 @@ typedef struct ccsr_gur {
 #define FSL_CORENET_RCWSR8_HOST_AGT_B1		0x00e00000
 #define FSL_CORENET_RCWSR8_HOST_AGT_B2		0x00100000
 #define FSL_CORENET_RCWSR11_EC1			0x00c00000 /* bits 360..361 */
-#define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC1	0x00000000
-#define FSL_CORENET_RCWSR11_EC1_FM1_USB1	0x00800000
+#if defined(CONFIG_PPC_P4080)
+#define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC1		0x00000000
+#define FSL_CORENET_RCWSR11_EC1_FM1_USB1		0x00800000
 #define FSL_CORENET_RCWSR11_EC2			0x001c0000 /* bits 363..365 */
-#define FSL_CORENET_RCWSR11_EC2_FM2_DTSEC1	0x00000000
-#define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC2	0x00080000
-#define FSL_CORENET_RCWSR11_EC2_USB2		0x00100000
+#define FSL_CORENET_RCWSR11_EC2_FM2_DTSEC1		0x00000000
+#define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC2		0x00080000
+#define FSL_CORENET_RCWSR11_EC2_USB2			0x00100000
+#endif
+#if defined(CONFIG_PPC_P2040) || defined(CONFIG_PPC_P2041) \
+	|| defined(CONFIG_PPC_P3041) || defined(CONFIG_PPC_P5020)
+#define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC4_RGMII	0x00000000
+#define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC4_MII		0x00800000
+#define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC4_NONE		0x00c00000
+#define FSL_CORENET_RCWSR11_EC2			0x00180000 /* bits 363..364 */
+#define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC5_RGMII	0x00000000
+#define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC5_MII		0x00100000
+#define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC5_NONE		0x00180000
+#endif
 	u8	res18[192];
 	u32	scratchrw[4];	/* Scratch Read/Write */
 	u8	res19[240];
@@ -1873,6 +1885,7 @@ typedef struct ccsr_gur {
 #if defined(CONFIG_P1017) || defined(CONFIG_P1023)
 #define MPC85xx_PORDEVSR_SGMII1_DIS	0x10000000
 #define MPC85xx_PORDEVSR_SGMII2_DIS	0x08000000
+#define MPC85xx_PORDEVSR_TSEC1_PRTC	0x02000000
 #else
 #define MPC85xx_PORDEVSR_SGMII1_DIS	0x20000000
 #define MPC85xx_PORDEVSR_SGMII2_DIS	0x10000000
drivers/net/Makefile +1 -0
index 819b197..39f036e 100644
@@ -80,6 +80,7 @@ COBJS-$(CONFIG_TIGON3) += bcm570x_autoneg.o
 COBJS-$(CONFIG_TIGON3) += 5701rls.o
 COBJS-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o
 COBJS-$(CONFIG_TSEC_ENET) += tsec.o fsl_mdio.o
+COBJS-$(CONFIG_FMAN_ENET) += fsl_mdio.o
 COBJS-$(CONFIG_TSI108_ETH) += tsi108_eth.o
 COBJS-$(CONFIG_ULI526X) += uli526x.o
 COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
drivers/net/fm/Makefile new file +61 -0

61 lines not on this page · raw message

drivers/net/fm/dtsec.c new file +181 -0

181 lines not on this page · raw message

drivers/net/fm/eth.c new file +670 -0

670 lines not on this page · raw message

drivers/net/fm/fm.c new file +432 -0

432 lines not on this page · raw message

drivers/net/fm/fm.h new file +154 -0

154 lines not on this page · raw message

drivers/net/fm/init.c new file +208 -0

208 lines not on this page · raw message

drivers/net/fm/p1023.c new file +68 -0

68 lines not on this page · raw message

drivers/net/fm/p4080.c new file +94 -0

94 lines not on this page · raw message

drivers/net/fm/p5020.c new file +85 -0

85 lines not on this page · raw message

drivers/net/fm/tgec.c new file +119 -0

119 lines not on this page · raw message

drivers/net/fm/tgec_phy.c new file +139 -0

81 lines not on this page · raw message

include/fm_eth.h new file +114 -0

114 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.3.4

Part of the diff is not shown here. View the raw message.

author
#1 lore raw

PATCH 2/5 powerpc/85xx: Add FMan ethernet support to P4080DS

From: Andy Fleming <[email protected]>

Add support for RGMII, SGMII, and XAUI (10Gb) Ethernet on P4080DS.

The board supports add-on cards for SGMII and XAUI functionality. Which slots on the board these cards are in is a function of the SERDES option selected and muxes on the board.

Additionally because of the high-configurablity which MDIO bus one is connected to is "selected" via an FPGA register. We create dummy MDIO bus for the phy layer and hide the mux manipulation in this dummy layer.

Add fman fdt helper function in board common code it'll be used by several freescale boards that do various muxing of the MDIO signals based on which controller/interface one is trying to talk to.

Removed CONFIG_SYS_FMAN_FW as its not used anywhere.

---
 board/freescale/common/Makefile         |    1 +
 board/freescale/common/fman.c           |   67 ++++
 board/freescale/common/fman.h           |   26 ++
 board/freescale/corenet_ds/Makefile     |    1 +
 board/freescale/corenet_ds/corenet_ds.c |   11 +-
 board/freescale/corenet_ds/eth_p4080.c  |  506 +++++++++++++++++++++++++++++++
 include/configs/corenet_ds.h            |    4 +-
 7 files changed, 611 insertions(+), 5 deletions(-)
 create mode 100644 board/freescale/common/fman.c
 create mode 100644 board/freescale/common/fman.h
 create mode 100644 board/freescale/corenet_ds/eth_p4080.c
board/freescale/common/Makefile +1 -0
index c47d10d..9bdf45b 100644
@@ -31,6 +31,7 @@ LIB	= $(obj)libfreescale.o
 
 COBJS-$(CONFIG_FSL_CADMUS)	+= cadmus.o
 COBJS-$(CONFIG_FSL_VIA)		+= cds_via.o
+COBJS-$(CONFIG_FMAN_ENET)	+= fman.o
 COBJS-$(CONFIG_FSL_PIXIS)	+= pixis.o
 COBJS-$(CONFIG_FSL_NGPIXIS)	+= ngpixis.o
 COBJS-$(CONFIG_PQ_MDS_PIB)	+= pq-mds-pib.o
board/freescale/common/fman.c new file +67 -0

67 lines not on this page · raw message

board/freescale/common/fman.h new file +26 -0
new file mode 100644
index 0000000..19ef7c4
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __FMAN_BOARD_HELPER__
+#define __FMAN_BOARD_HELPER__
+
+void fdt_set_phy_handle(void *fdt, char *compat, phys_addr_t addr,
+			const char *alias);
+
+#endif
board/freescale/corenet_ds/Makefile +1 -0
index 69e81a4..8b8d01a 100644
@@ -28,6 +28,7 @@ LIB	= $(obj)lib$(BOARD).o
 
 COBJS-y	+= $(BOARD).o
 COBJS-y	+= ddr.o
+COBJS-$(CONFIG_P4080DS)	+= eth_p4080.o
 COBJS-$(CONFIG_P3041DS)	+= p3041ds_ddr.o
 COBJS-$(CONFIG_P4080DS)	+= p4080ds_ddr.o
 COBJS-$(CONFIG_P5020DS)	+= p5020ds_ddr.o
board/freescale/corenet_ds/corenet_ds.c +7 -4
index b1e7823..7c82da0 100644
@@ -32,6 +32,7 @@
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_portals.h>
 #include <asm/fsl_liodn.h>
+#include <fm_eth.h>
 
 extern void pci_of_setup(void *blob, bd_t *bd);
 
@@ -219,6 +220,8 @@ int misc_init_r(void)
 	return 0;
 }
 
+extern void fdt_fixup_board_enet(void *blob);
+
 void ft_board_setup(void *blob, bd_t *bd)
 {
 	phys_addr_t base;
@@ -237,9 +240,9 @@ void ft_board_setup(void *blob, bd_t *bd)
 
 	fdt_fixup_liodn(blob);
 	fdt_fixup_dr_usb(blob, bd);
-}
 
-int board_eth_init(bd_t *bis)
-{
-	return pci_eth_init(bis);
+#ifdef CONFIG_SYS_DPAA_FMAN
+	fdt_fixup_fman_ethernet(blob);
+	fdt_fixup_board_enet(blob);
+#endif
 }
board/freescale/corenet_ds/eth_p4080.c new file +506 -0

506 lines not on this page · raw message

include/configs/corenet_ds.h +3 -1
index eb89b30..4f8c391 100644
@@ -474,7 +474,6 @@
 #define CONFIG_SYS_DPAA_FMAN
 #define CONFIG_SYS_DPAA_PME
 /* Default address of microcode for the Linux Fman driver */
-#define CONFIG_SYS_FMAN_FW
 #if defined(CONFIG_SPIFLASH)
 /*
  * env is stored@0x100000, sector size is 0x10000, ucode is stored after
@@ -498,6 +497,9 @@
 
 #ifdef CONFIG_SYS_DPAA_FMAN
 #define CONFIG_FMAN_ENET
+#define CONFIG_PHYLIB_10G
+#define CONFIG_PHY_VITESSE
+#define CONFIG_PHY_TERANETICS
 #endif
 
 #ifdef CONFIG_PCI
Signature · 1 line
1.7.3.4
author
#2 lore raw

PATCH 3/5 powerpc/hydra: Add ethernet support on P5020/P3041 DS boards

From: Timur Tabi <[email protected]>

Add support for RGMII, SGMII, and XAUI (10Gb) Ethernet on P3041DS & P5020DS ("Hydra").

The lane_to_slot[] array is initialized dynamically, since board switches can be used to control the muxing of SERDES lanes to slots.

The BRDCFG1 PIXIS register is used to route the MII bus to the appropriate slot. The SERDES configuration is queried to help determine the routing between MACs and slot/phy combination.

If a XAUI card is inserted, muxing for that card is enabled and never turned off. The PHY address for the 10G XAUI card depends on the slot in which it's inserted. If it's in slot 1, the address is 4. If it's in slot 2, the address is 0.

Update the MDIO routing in the P3041DS and P5020DS device trees based on the board-level muxing. The SERDES configuration determines which SGMII/XGMII boards are located in which slots, and so the MDIO bus needs to be muxed correctly whenever talking to a PHY connected to any Fman MAC. The Fman Ethernet nodes in the device tree also need to be routed to the correct PHYs.

Removed CONFIG_SYS_FMAN_FW as its not used anywhere.

---
 board/freescale/corenet_ds/Makefile    |    2 +
 board/freescale/corenet_ds/eth_hydra.c |  553 ++++++++++++++++++++++++++++++++
 2 files changed, 555 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/corenet_ds/eth_hydra.c
board/freescale/corenet_ds/Makefile +2 -0
index 8b8d01a..c377c39 100644
@@ -28,7 +28,9 @@ LIB	= $(obj)lib$(BOARD).o
 
 COBJS-y	+= $(BOARD).o
 COBJS-y	+= ddr.o
+COBJS-$(CONFIG_P3041DS)	+= eth_hydra.o
 COBJS-$(CONFIG_P4080DS)	+= eth_p4080.o
+COBJS-$(CONFIG_P5020DS)	+= eth_hydra.o
 COBJS-$(CONFIG_P3041DS)	+= p3041ds_ddr.o
 COBJS-$(CONFIG_P4080DS)	+= p4080ds_ddr.o
 COBJS-$(CONFIG_P5020DS)	+= p5020ds_ddr.o
board/freescale/corenet_ds/eth_hydra.c new file +553 -0

553 lines not on this page · raw message

Signature · 1 line
1.7.3.4
author Applied
#3 lore raw

PATCH 3/5 powerpc/hydra: Add ethernet support on P5020/P3041 DS boards

Quoted 30 lines · Kumar Gala

From: Timur Tabi <[email protected]>

Add support for RGMII, SGMII, and XAUI (10Gb) Ethernet on P3041DS & P5020DS ("Hydra").

The lane_to_slot[] array is initialized dynamically, since board switches can be used to control the muxing of SERDES lanes to slots.

The BRDCFG1 PIXIS register is used to route the MII bus to the appropriate slot. The SERDES configuration is queried to help determine the routing between MACs and slot/phy combination.

If a XAUI card is inserted, muxing for that card is enabled and never turned off. The PHY address for the 10G XAUI card depends on the slot in which it's inserted. If it's in slot 1, the address is 4. If it's in slot 2, the address is 0.

Update the MDIO routing in the P3041DS and P5020DS device trees based on the board-level muxing. The SERDES configuration determines which SGMII/XGMII boards are located in which slots, and so the MDIO bus needs to be muxed correctly whenever talking to a PHY connected to any Fman MAC. The Fman Ethernet nodes in the device tree also need to be routed to the correct PHYs.

Removed CONFIG_SYS_FMAN_FW as its not used anywhere.

Quoted 5 lines

---
board/freescale/corenet_ds/Makefile | 2 +
board/freescale/corenet_ds/eth_hydra.c | 553 ++++++++++++++++++++++++++++++++

2 files changed, 555 insertions(+), 0 deletions(-)

create mode 100644 board/freescale/corenet_ds/eth_hydra.c

applied to 85xx next

- k

author
#4 lore raw

PATCH 4/5 powerpc/85xx: Add networking support to P1023RDS

In reply to Kumar Gala

From: Roy Zang <[email protected]>

The P1023 has two 1G ethernet controllers the first can run in SGMII, RGMII, or RMII. The second can only do SGMII & RGMII.

We need to setup a for SoC & board registers based on our various configuration for ethernet to function properly on the board.

Removed CONFIG_SYS_FMAN_FW as its not used anywhere.

---
 arch/powerpc/include/asm/immap_85xx.h |    4 +++
 board/freescale/p1023rds/p1023rds.c   |   40 +++++++++++++++++++++++++++++++++
 include/configs/P1023RDS.h            |    2 +-
 3 files changed, 45 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/immap_85xx.h +4 -0
index 50569fb..0dd57f3 100644
@@ -1984,6 +1984,9 @@ typedef struct ccsr_gur {
 #define MPC85xx_PMUXCR_CAN2_TDM			0x00000002
 #define MPC85xx_PMUXCR_CAN2_RES			0x00000003
 #endif
+#if defined(CONFIG_P1017) || defined(CONFIG_P1023)
+#define MPC85xx_PMUXCR_TSEC1_1		0x10000000
+#else
 #define MPC85xx_PMUXCR_SD_DATA		0x80000000
 #define MPC85xx_PMUXCR_SDHC_CD		0x40000000
 #define MPC85xx_PMUXCR_SDHC_WP		0x20000000
@@ -2002,6 +2005,7 @@ typedef struct ccsr_gur {
 #define MPC85xx_PMUXCR_QE10		0x00000020
 #define MPC85xx_PMUXCR_QE11		0x00000010
 #define MPC85xx_PMUXCR_QE12		0x00000008
+#endif
 #if defined(CONFIG_P1013) || defined(CONFIG_P1022)
 #define MPC85xx_PMUXCR_TDM_MASK		0x0001cc00
 #define MPC85xx_PMUXCR_TDM		0x00014800
board/freescale/p1023rds/p1023rds.c +40 -0
index 8cfd199..546819c 100644
@@ -38,6 +38,11 @@
 #include <fdt_support.h>
 #include <netdev.h>
 #include <malloc.h>
+#include <fm_eth.h>
+#include <fsl_mdio.h>
+#include <miiphy.h>
+#include <phy.h>
+#include <asm/fsl_dtsec.h>
 
 #include "bcsr.h"
 
@@ -143,6 +148,39 @@ unsigned long get_board_ddr_clk(ulong dummy)
 
 int board_eth_init(bd_t *bis)
 {
+	u8 *bcsr = (u8 *)BCSR_ACCESS_REG_ADDR;
+	ccsr_gur_t *gur = (ccsr_gur_t *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+	struct fsl_pq_mdio_info dtsec_mdio_info;
+
+	/*
+	 * Need to set dTSEC 1 pin multiplexing to TSEC. The default setting
+	 * is not correct.
+	 */
+	setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_TSEC1_1);
+
+	dtsec_mdio_info.regs =
+		(struct tsec_mii_mng *)CONFIG_SYS_FM1_DTSEC1_MDIO_ADDR;
+	dtsec_mdio_info.name = DEFAULT_FM_MDIO_NAME;
+
+	/* Register the 1G MDIO bus */
+	fsl_pq_mdio_init(bis, &dtsec_mdio_info);
+
+	fm_info_set_phy_address(FM1_DTSEC1, CONFIG_SYS_FM1_DTSEC1_PHY_ADDR);
+	fm_info_set_phy_address(FM1_DTSEC2, CONFIG_SYS_FM1_DTSEC2_PHY_ADDR);
+
+	fm_info_set_mdio(FM1_DTSEC1,
+		miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME));
+	fm_info_set_mdio(FM1_DTSEC2,
+		miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME));
+
+	/* Make SERDES connected to SGMII by cleaing bcsr19[7] */
+	if (fm_info_get_enet_if(FM1_DTSEC1) == PHY_INTERFACE_MODE_SGMII)
+		clrbits_8(&bcsr[19], BCSR19_SGMII_SEL_L);
+
+#ifdef CONFIG_FMAN_ENET
+	cpu_eth_init(bis);
+#endif
+
 	return pci_eth_init(bis);
 }
 
@@ -158,5 +196,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 	size = getenv_bootm_size();
 
 	fdt_fixup_memory(blob, (u64)base, (u64)size);
+
+	fdt_fixup_fman_ethernet(blob);
 }
 #endif
include/configs/P1023RDS.h +1 -1
index 24042df..9386674 100644
@@ -525,9 +525,9 @@ extern unsigned long get_clock_freq(void);
 
 #ifdef CONFIG_SYS_DPAA_FMAN
 #define CONFIG_FMAN_ENET
+#define CONFIG_PHY_MARVELL
 #endif
 
-#define CONFIG_SYS_FMAN_FW
 #ifndef CONFIG_NAND
 /* Default address of microcode for the Linux Fman driver */
 /* QE microcode/firmware address */
Signature · 1 line
1.7.3.4
author Applied
#5 lore raw

PATCH 4/5 powerpc/85xx: Add networking support to P1023RDS

Quoted 16 lines · Kumar Gala

From: Roy Zang <[email protected]>

The P1023 has two 1G ethernet controllers the first can run in SGMII, RGMII, or RMII. The second can only do SGMII & RGMII.

We need to setup a for SoC & board registers based on our various configuration for ethernet to function properly on the board.

Removed CONFIG_SYS_FMAN_FW as its not used anywhere.

Quoted 5 lines

---

arch/powerpc/include/asm/immap_85xx.h |    4 +++
board/freescale/p1023rds/p1023rds.c   |   40 +++++++++++++++++++++++++++++++++
include/configs/P1023RDS.h            |    2 +-
3 files changed, 45 insertions(+), 1 deletions(-)

applied to 85xx next

- k

author
#6 lore raw

PATCH 5/5 powerpc/p2041rdb: Add ethernet support on P2041RDB board

In reply to Kumar Gala

From: Mingkai Hu <[email protected]>

Add support for RGMII, SGMII and XAUI Ethernet on P2041RDB board.

The five dTSEC can be routed to two on-board RGMII phy, three on-board SGMII phy or four SGMII phy on SGMII riser card according to different serdes protocol configuration and board lane configuration. Also updated the device tree to direct the Fmac MAC to the correct PHY.

Removed CONFIG_SYS_FMAN_FW as its not used anywhere.

---
 board/freescale/p2041rdb/Makefile   |    1 +
 board/freescale/p2041rdb/eth.c      |  225 +++++++++++++++++++++++++++++++++++
 board/freescale/p2041rdb/p2041rdb.c |    4 +
 include/configs/P2041RDB.h          |    6 +-
 4 files changed, 235 insertions(+), 1 deletions(-)
 create mode 100644 board/freescale/p2041rdb/eth.c
board/freescale/p2041rdb/Makefile +1 -0
index 65f348f..b4cb83e 100644
@@ -29,6 +29,7 @@ LIB	= $(obj)lib$(BOARD).o
 COBJS-y	+= $(BOARD).o
 COBJS-y += cpld.o
 COBJS-y	+= ddr.o
+COBJS-y	+= eth.o
 COBJS-y	+= law.o
 COBJS-y	+= tlb.o
 COBJS-$(CONFIG_PCI) += pci.o
board/freescale/p2041rdb/eth.c new file +225 -0

225 lines not on this page · raw message

board/freescale/p2041rdb/p2041rdb.c +4 -0
index 52269d3..6ed404f 100644
@@ -32,6 +32,7 @@
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_portals.h>
 #include <asm/fsl_liodn.h>
+#include <fm_eth.h>
 
 extern void pci_of_setup(void *blob, bd_t *bd);
 
@@ -200,4 +201,7 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 
 	fdt_fixup_liodn(blob);
+#ifdef CONFIG_SYS_DPAA_FMAN
+	fdt_fixup_fman_ethernet(blob);
+#endif
 }
include/configs/P2041RDB.h +5 -1
index 03dbe55..37e98bb 100644
@@ -405,7 +405,6 @@
 #define CONFIG_SYS_DPAA_FMAN
 #define CONFIG_SYS_DPAA_PME
 /* Default address of microcode for the Linux Fman driver */
-#define CONFIG_SYS_FMAN_FW
 #if defined(CONFIG_SPIFLASH)
 /*
  * env is stored at 0x100000, sector size is 0x10000, ucode is stored after
@@ -429,6 +428,9 @@
 
 #ifdef CONFIG_SYS_DPAA_FMAN
 #define CONFIG_FMAN_ENET
+#define CONFIG_PHYLIB_10G
+#define CONFIG_PHY_VITESSE
+#define CONFIG_PHY_TERANETICS
 #endif
 
 #ifdef CONFIG_PCI
@@ -472,6 +474,8 @@
 #define CONFIG_SYS_FM1_DTSEC3_RISER_PHY_ADDR	0x1e
 #define CONFIG_SYS_FM1_DTSEC4_RISER_PHY_ADDR	0x1f
 
+#define CONFIG_SYS_FM1_10GEC1_PHY_ADDR	0
+
 #define CONFIG_SYS_TBIPA_VALUE	8
 #define CONFIG_MII		/* MII PHY management */
 #define CONFIG_ETHPRIME		"FM1 at DTSEC1"
Signature · 1 line
1.7.3.4
author Applied
#7 lore raw

PATCH 5/5 powerpc/p2041rdb: Add ethernet support on P2041RDB board

Quoted 13 lines · Kumar Gala

From: Mingkai Hu <[email protected]>

Add support for RGMII, SGMII and XAUI Ethernet on P2041RDB board.

The five dTSEC can be routed to two on-board RGMII phy, three on-board SGMII phy or four SGMII phy on SGMII riser card according to different serdes protocol configuration and board lane configuration. Also updated the device tree to direct the Fmac MAC to the correct PHY.

Removed CONFIG_SYS_FMAN_FW as its not used anywhere.

Quoted 7 lines

---

board/freescale/p2041rdb/Makefile   |    1 +
board/freescale/p2041rdb/eth.c      |  225 +++++++++++++++++++++++++++++++++++
board/freescale/p2041rdb/p2041rdb.c |    4 +
include/configs/P2041RDB.h          |    6 +-
4 files changed, 235 insertions(+), 1 deletions(-)

create mode 100644 board/freescale/p2041rdb/eth.c

applied to 85xx next

- k

#8 lore raw

PATCH 2/5 powerpc/85xx: Add FMan ethernet support to P4080DS

In reply to Kumar Gala

Dear Kumar Gala,

Quoted 16 lines · In message <[email protected]> you…

From: Andy Fleming <[email protected]>

Add support for RGMII, SGMII, and XAUI (10Gb) Ethernet on P4080DS.

The board supports add-on cards for SGMII and XAUI functionality. Which slots on the board these cards are in is a function of the SERDES option selected and muxes on the board.

Additionally because of the high-configurablity which MDIO bus one is connected to is "selected" via an FPGA register. We create dummy MDIO bus for the phy layer and hide the mux manipulation in this dummy layer.

Add fman fdt helper function in board common code it'll be used by several freescale boards that do various muxing of the MDIO signals based on which controller/interface one is trying to talk to.

Quoted 6 lines

Removed CONFIG_SYS_FMAN_FW as its not used anywhere.

Checkpatch says:

WARNING: externs should be avoided in .c files #259: FILE: board/freescale/corenet_ds/corenet_ds.c:223:
+extern void fdt_fixup_board_enet(void *blob);

Please move to header file.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Programmer's Lament: (Shakespeare, Macbeth, Act I, Scene vii)
        "That we but teach bloody instructions,
        which, being taught, return to plague the inventor..."
author
#9 lore raw

PATCH v2 2/5 powerpc/85xx: Add FMan ethernet support to P4080DS

From: Andy Fleming <[email protected]>

Add support for RGMII, SGMII, and XAUI (10Gb) Ethernet on P4080DS.

The board supports add-on cards for SGMII and XAUI functionality. Which slots on the board these cards are in is a function of the SERDES option selected and muxes on the board.

Additionally because of the high-configurablity which MDIO bus one is connected to is "selected" via an FPGA register. We create dummy MDIO bus for the phy layer and hide the mux manipulation in this dummy layer.

Add fman fdt helper function in board common code it'll be used by several freescale boards that do various muxing of the MDIO signals based on which controller/interface one is trying to talk to.

Removed CONFIG_SYS_FMAN_FW as its not used anywhere.

---
* Fix checkpatch warning due to extern

 board/freescale/common/Makefile         |    1 +
 board/freescale/common/fman.c           |   67 ++++
 board/freescale/common/fman.h           |   26 ++
 board/freescale/corenet_ds/Makefile     |    1 +
 board/freescale/corenet_ds/corenet_ds.c |   10 +-
 board/freescale/corenet_ds/corenet_ds.h |   25 ++
 board/freescale/corenet_ds/eth_p4080.c  |  506 +++++++++++++++++++++++++++++++
 include/configs/corenet_ds.h            |    4 +-
 8 files changed, 635 insertions(+), 5 deletions(-)
 create mode 100644 board/freescale/common/fman.c
 create mode 100644 board/freescale/common/fman.h
 create mode 100644 board/freescale/corenet_ds/corenet_ds.h
 create mode 100644 board/freescale/corenet_ds/eth_p4080.c
board/freescale/common/Makefile +1 -0
index c47d10d..9bdf45b 100644
@@ -31,6 +31,7 @@ LIB	= $(obj)libfreescale.o
 
 COBJS-$(CONFIG_FSL_CADMUS)	+= cadmus.o
 COBJS-$(CONFIG_FSL_VIA)		+= cds_via.o
+COBJS-$(CONFIG_FMAN_ENET)	+= fman.o
 COBJS-$(CONFIG_FSL_PIXIS)	+= pixis.o
 COBJS-$(CONFIG_FSL_NGPIXIS)	+= ngpixis.o
 COBJS-$(CONFIG_PQ_MDS_PIB)	+= pq-mds-pib.o
board/freescale/common/fman.c new file +67 -0

67 lines not on this page · raw message

board/freescale/common/fman.h new file +26 -0
new file mode 100644
index 0000000..19ef7c4
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __FMAN_BOARD_HELPER__
+#define __FMAN_BOARD_HELPER__
+
+void fdt_set_phy_handle(void *fdt, char *compat, phys_addr_t addr,
+			const char *alias);
+
+#endif
board/freescale/corenet_ds/Makefile +1 -0
index 69e81a4..8b8d01a 100644
@@ -28,6 +28,7 @@ LIB	= $(obj)lib$(BOARD).o
 
 COBJS-y	+= $(BOARD).o
 COBJS-y	+= ddr.o
+COBJS-$(CONFIG_P4080DS)	+= eth_p4080.o
 COBJS-$(CONFIG_P3041DS)	+= p3041ds_ddr.o
 COBJS-$(CONFIG_P4080DS)	+= p4080ds_ddr.o
 COBJS-$(CONFIG_P5020DS)	+= p5020ds_ddr.o
board/freescale/corenet_ds/corenet_ds.c +6 -4
index b1e7823..a03fdfd 100644
@@ -32,10 +32,12 @@
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_portals.h>
 #include <asm/fsl_liodn.h>
+#include <fm_eth.h>
 
 extern void pci_of_setup(void *blob, bd_t *bd);
 
 #include "../common/ngpixis.h"
+#include "corenet_ds.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -237,9 +239,9 @@ void ft_board_setup(void *blob, bd_t *bd)
 
 	fdt_fixup_liodn(blob);
 	fdt_fixup_dr_usb(blob, bd);
-}
 
-int board_eth_init(bd_t *bis)
-{
-	return pci_eth_init(bis);
+#ifdef CONFIG_SYS_DPAA_FMAN
+	fdt_fixup_fman_ethernet(blob);
+	fdt_fixup_board_enet(blob);
+#endif
 }
board/freescale/corenet_ds/corenet_ds.h new file +25 -0
new file mode 100644
index 0000000..425c6aa
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CORENET_DS_H__
+#define __CORENET_DS_H__
+
+void fdt_fixup_board_enet(void *blob);
+
+#endif
board/freescale/corenet_ds/eth_p4080.c new file +506 -0

506 lines not on this page · raw message

include/configs/corenet_ds.h +3 -1
index eb89b30..4f8c391 100644
@@ -474,7 +474,6 @@
 #define CONFIG_SYS_DPAA_FMAN
 #define CONFIG_SYS_DPAA_PME
 /* Default address of microcode for the Linux Fman driver */
-#define CONFIG_SYS_FMAN_FW
 #if defined(CONFIG_SPIFLASH)
 /*
  * env is stored@0x100000, sector size is 0x10000, ucode is stored after
@@ -498,6 +497,9 @@
 
 #ifdef CONFIG_SYS_DPAA_FMAN
 #define CONFIG_FMAN_ENET
+#define CONFIG_PHYLIB_10G
+#define CONFIG_PHY_VITESSE
+#define CONFIG_PHY_TERANETICS
 #endif
 
 #ifdef CONFIG_PCI
Signature · 1 line
1.7.3.4
author Applied
#10 lore raw

PATCH v2 2/5 powerpc/85xx: Add FMan ethernet support to P4080DS

Quoted 34 lines · Kumar Gala

From: Andy Fleming <[email protected]>

Add support for RGMII, SGMII, and XAUI (10Gb) Ethernet on P4080DS.

The board supports add-on cards for SGMII and XAUI functionality. Which slots on the board these cards are in is a function of the SERDES option selected and muxes on the board.

Additionally because of the high-configurablity which MDIO bus one is connected to is "selected" via an FPGA register. We create dummy MDIO bus for the phy layer and hide the mux manipulation in this dummy layer.

Add fman fdt helper function in board common code it'll be used by several freescale boards that do various muxing of the MDIO signals based on which controller/interface one is trying to talk to.

Removed CONFIG_SYS_FMAN_FW as its not used anywhere.

---
* Fix checkpatch warning due to extern

board/freescale/common/Makefile         |    1 +
board/freescale/common/fman.c           |   67 ++++
board/freescale/common/fman.h           |   26 ++
board/freescale/corenet_ds/Makefile     |    1 +
board/freescale/corenet_ds/corenet_ds.c |   10 +-
board/freescale/corenet_ds/corenet_ds.h |   25 ++
board/freescale/corenet_ds/eth_p4080.c  |  506 +++++++++++++++++++++++++++++++
include/configs/corenet_ds.h            |    4 +-
8 files changed, 635 insertions(+), 5 deletions(-)
Quoted 4 lines

create mode 100644 board/freescale/common/fman.c create mode 100644 board/freescale/common/fman.h create mode 100644 board/freescale/corenet_ds/corenet_ds.h create mode 100644 board/freescale/corenet_ds/eth_p4080.c

applied to 85xx next

- k

#11 lore raw

PATCH 1/5 powerpc/85xx: Add support for FMan ethernet in Independent mode

In reply to Kumar Gala

Dear Kumar Gala,

Quoted 19 lines · In message <[email protected]> you…

The Frame Manager (FMan) on QorIQ SoCs with DPAA (datapath acceleration architecture) is the ethernet contoller block. Normally it is utilized via Queue Manager (Qman) and Buffer Manager (Bman). However for boot usage the FMan supports a mode similar to QE or CPM ethernet collers called Independent mode.

Additionally the FMan block supports multiple 1g and 10g interfaces as a single entity in the system rather than each controller being managed uniquely. This means we have to initialize all of Fman regardless of the number of interfaces we utilize.

Different SoCs support different combinations of the number of FMan as well as the number of 1g & 10g interfaces support per Fman.

We add support for the following SoCs:
* P1023 - 1 Fman, 2x1g
* P4080 - 2 Fman, each Fman has 4x1g and 1x10g
* P204x/P3041/P5020 - 1 Fman, 5x1g, 1x10g

Quoted 12 lines

checkpatch says:

total: 8 errors, 3 warnings, 3172 lines checked

Please clean up.

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The manager will be continually amazed that policies he took for com-
mon knowledge are totally unknown by some member of his  team.  Since
his fundamental job is to keep everybody going in the same direction,
his chief daily task will be communication, not decision-making.
                              - Fred Brooks, "The Mythical Man Month"
author
#12 lore raw

PATCH 1/5 powerpc/85xx: Add support for FMan ethernet in Independent mode

Quoted 35 lines · Wolfgang Denk

Dear Kumar Gala,

Quoted 19 lines · In message <[email protected]> you…

The Frame Manager (FMan) on QorIQ SoCs with DPAA (datapath acceleration architecture) is the ethernet contoller block. Normally it is utilized via Queue Manager (Qman) and Buffer Manager (Bman). However for boot usage the FMan supports a mode similar to QE or CPM ethernet collers called Independent mode.

Additionally the FMan block supports multiple 1g and 10g interfaces as a single entity in the system rather than each controller being managed uniquely. This means we have to initialize all of Fman regardless of the number of interfaces we utilize.

Different SoCs support different combinations of the number of FMan as well as the number of 1g & 10g interfaces support per Fman.

We add support for the following SoCs:
* P1023 - 1 Fman, 2x1g
* P4080 - 2 Fman, each Fman has 4x1g and 1x10g
* P204x/P3041/P5020 - 1 Fman, 5x1g, 1x10g

Quoted 12 lines
Quoted 3 lines

checkpatch says:

total: 8 errors, 3 warnings, 3172 lines checked

Just wondering which checkpatch you are running.

I get:

total: 1 errors, 16 warnings, 3172 lines checked

Mine's from linux kernel tree HEAD as of a day or so ago.

- k

#13 lore raw

PATCH 1/5 powerpc/85xx: Add support for FMan ethernet in Independent mode

Quoted 7 lines · Kumar Gala

Just wondering which checkpatch you are running.

I get:

total: 1 errors, 16 warnings, 3172 lines checked

Mine's from linux kernel tree HEAD as of a day or so ago.

I believe that checkpatch has become a more forgiving with the 80-character limit.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
author
#14 lore raw

PATCH 1/5 powerpc/85xx: Add support for FMan ethernet in Independent mode

Quoted 4 lines · On Aug 1, 2011, at 12:59 PM, Tabi Timur-B04825 wrote:
Quoted 2 lines · Kumar Gala

Just wondering which checkpatch you are running.

Quoted 8 lines
Quoted 5 lines

I get:

total: 1 errors, 16 warnings, 3172 lines checked

Mine's from linux kernel tree HEAD as of a day or so ago.

I believe that checkpatch has become a more forgiving with the 80-character limit.

I don't think its that as my version still reports 80-char limit as warnings.

- k

#15 lore raw

PATCH 1/5 powerpc/85xx: Add support for FMan ethernet in Independent mode

Quoted 1 line · Kumar Gala

I don't think its that as my version still reports 80-char limit as warnings.

By "more forgiving", I mean that there's some intelligence behind it now. Depending on the actual characters that are after column 80, it may be allowed.

So the question is whether U-Boot will include the new exceptions.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#16 lore raw

PATCH 1/5 powerpc/85xx: Add support for FMan ethernet in Independent mode

In reply to Kumar Gala

Dear Kumar Gala,

Quoted 8 lines · In message <[email protected]> you wrote:

Just wondering which checkpatch you are running.

I get:

total: 1 errors, 16 warnings, 3172 lines checked

Mine's from linux kernel tree HEAD as of a day or so ago.

Mine is a bit older, from Jan 20; it says: Version: 0.31

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Pardon me for breathing, which I never do anyway so I don't know why
I bother to say it, oh God, I'm so depressed. Here's another of those
self-satisfied doors. Life! Don't talk to me about life."
                                        - Marvin the Paranoid Android
author
#17 lore raw

PATCH 1/5 powerpc/85xx: Add support for FMan ethernet in Independent mode

Quoted 6 lines · Wolfgang Denk

Dear Kumar Gala,

Quoted 3 lines · In message <[email protected]> you wrote:

Just wondering which checkpatch you are running.

Quoted 7 lines
Quoted 5 lines

I get:

total: 1 errors, 16 warnings, 3172 lines checked

Mine's from linux kernel tree HEAD as of a day or so ago.

Mine is a bit older, from Jan 20; it says: Version: 0.31

Mine says v0.31 as well, but from Aug 1st ;)

- k