Skip to contentSkip to conversation

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

PATCH New Kumar Gala 1 participant 4 messages Aug 2, 2011 – Aug 30, 2011

Subsystems (3)
lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH v2 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

---
* Removed static variable being init to 0
* Removed volatile from places it can be removed from

 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 v2 1/5 powerpc/85xx: Add support for FMan ethernet in Independent mode

Quoted 57 lines · Kumar Gala

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

---
* Removed static variable being init to 0
* Removed volatile from places it can be removed from

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(-)
Quoted 14 lines

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

Wolfgang,

Any issue merging this into 85xx next tree?

[ and the other patches in the series ]

- k

author
#2 lore raw

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

(just re-sending so Wolfgang is on explicit TO:)

Quoted 22 lines · Kumar Gala
Quoted 19 lines · Kumar Gala

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 13 lines
Quoted 12 lines
Quoted 1 line

---

Wolfgang,

Any issue merging this into 85xx next tree?

[ and the other patches in the series ]

- k

author Applied
#3 lore raw

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

In reply to Kumar Gala
Quoted 57 lines · Kumar Gala

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

---
* Removed static variable being init to 0
* Removed volatile from places it can be removed from

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(-)
Quoted 14 lines

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

applied to 85xx next

- k