net/fman: Support both new and legacy FMan Compatibles
Subsystems (2)
PATCH v2 1/1 net/fman: Support both new and legacy FMan Compatibles
From: Igal Liberman <[email protected]>
Recently the FMan Port and MAC compatibles were changed. This patch aligns the FMan Port and MAC compatibles
to the new FMan device tree binding document.
The FMan device tree binding document can be found in the Linux kernel:./Documentation/devicetree/bindings/powerpc/fsl/fman.txt
This patch doesn't affect legacy compatibles support.
v1 --- v2:
- Changed the subject of the patch
v1: https://patchwork.ozlabs.org/patch/473501/
- Added Support to both new and legacy FMan compatibles
--- arch/powerpc/cpu/mpc85xx/b4860_ids.c | 2 +- arch/powerpc/cpu/mpc85xx/liodn.c | 64 +++++++++++++++++++++++++++++++--- arch/powerpc/cpu/mpc85xx/p2041_ids.c | 2 +- arch/powerpc/cpu/mpc85xx/p3041_ids.c | 2 +- arch/powerpc/cpu/mpc85xx/p4080_ids.c | 4 +-- arch/powerpc/cpu/mpc85xx/p5020_ids.c | 2 +- arch/powerpc/cpu/mpc85xx/p5040_ids.c | 4 +-- arch/powerpc/cpu/mpc85xx/t1024_ids.c | 2 +- arch/powerpc/cpu/mpc85xx/t1040_ids.c | 2 +- arch/powerpc/cpu/mpc85xx/t2080_ids.c | 2 +- arch/powerpc/cpu/mpc85xx/t4240_ids.c | 4 +-- arch/powerpc/include/asm/fsl_liodn.h | 53 ++++++++++++++++++++++------ drivers/net/fm/init.c | 27 ++++++++++---- 13 files changed, 135 insertions(+), 35 deletions(-)
arch/powerpc/cpu/mpc85xx/b4860_ids.c +1 -1
@@ -74,7 +74,7 @@ struct liodn_id_table liodn_tbl[] = {int liodn_tbl_sz =ARRAY_SIZE (liodn_tbl);#ifdef CONFIG_SYS_DPAA_FMAN -struct liodn_id_table fman1_liodn_tbl[] = { +struct fman_liodn_id_table fman1_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (1 ,0 ,88 ),SET_FMAN_RX_1G_LIODN (1 ,1 ,89 ), SET_FMAN_RX_1G_LIODN(1, 2, 90),
arch/powerpc/cpu/mpc85xx/liodn.c +59 -5
99 lines not on this page · raw message
arch/powerpc/cpu/mpc85xx/p2041_ids.c +1 -1
@@ -61,7 +61,7 @@ struct liodn_id_table liodn_tbl[] = {int liodn_tbl_sz =ARRAY_SIZE (liodn_tbl);#ifdef CONFIG_SYS_DPAA_FMAN -struct liodn_id_table fman1_liodn_tbl[] = { +struct fman_liodn_id_table fman1_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (1 ,0 ,10 ),SET_FMAN_RX_1G_LIODN (1 ,1 ,11 ), SET_FMAN_RX_1G_LIODN(1, 2, 12),
arch/powerpc/cpu/mpc85xx/p3041_ids.c +1 -1
@@ -62,7 +62,7 @@ struct liodn_id_table liodn_tbl[] = {int liodn_tbl_sz =ARRAY_SIZE (liodn_tbl);#ifdef CONFIG_SYS_DPAA_FMAN -struct liodn_id_table fman1_liodn_tbl[] = { +struct fman_liodn_id_table fman1_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (1 ,0 ,10 ),SET_FMAN_RX_1G_LIODN (1 ,1 ,11 ), SET_FMAN_RX_1G_LIODN(1, 2, 12),
arch/powerpc/cpu/mpc85xx/p4080_ids.c +2 -2
@@ -54,7 +54,7 @@ struct liodn_id_table liodn_tbl[] = {int liodn_tbl_sz =ARRAY_SIZE (liodn_tbl);#ifdef CONFIG_SYS_DPAA_FMAN -struct liodn_id_table fman1_liodn_tbl[] = { +struct fman_liodn_id_table fman1_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (1 ,0 ,11 ),SET_FMAN_RX_1G_LIODN (1 ,1 ,12 ), SET_FMAN_RX_1G_LIODN(1, 2, 13),
@@ -64,7 +64,7 @@ struct liodn_id_table fman1_liodn_tbl[] = {int fman1_liodn_tbl_sz =ARRAY_SIZE (fman1_liodn_tbl);#if (CONFIG_SYS_NUM_FMAN ==2 ) -struct liodn_id_table fman2_liodn_tbl[] = { +struct fman_liodn_id_table fman2_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (2 ,0 ,16 ),SET_FMAN_RX_1G_LIODN (2 ,1 ,17 ), SET_FMAN_RX_1G_LIODN(2, 2, 18),
arch/powerpc/cpu/mpc85xx/p5020_ids.c +1 -1
@@ -62,7 +62,7 @@ struct liodn_id_table liodn_tbl[] = {int liodn_tbl_sz =ARRAY_SIZE (liodn_tbl);#ifdef CONFIG_SYS_DPAA_FMAN -struct liodn_id_table fman1_liodn_tbl[] = { +struct fman_liodn_id_table fman1_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (1 ,0 ,10 ),SET_FMAN_RX_1G_LIODN (1 ,1 ,11 ), SET_FMAN_RX_1G_LIODN(1, 2, 12),
arch/powerpc/cpu/mpc85xx/p5040_ids.c +2 -2
@@ -48,7 +48,7 @@ struct liodn_id_table liodn_tbl[] = {int liodn_tbl_sz =ARRAY_SIZE (liodn_tbl);#ifdef CONFIG_SYS_DPAA_FMAN -struct liodn_id_table fman1_liodn_tbl[] = { +struct fman_liodn_id_table fman1_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (1 ,0 ,11 ),SET_FMAN_RX_1G_LIODN (1 ,1 ,12 ), SET_FMAN_RX_1G_LIODN(1, 2, 13),
@@ -59,7 +59,7 @@ struct liodn_id_table fman1_liodn_tbl[] = {int fman1_liodn_tbl_sz =ARRAY_SIZE (fman1_liodn_tbl);#if (CONFIG_SYS_NUM_FMAN ==2 ) -struct liodn_id_table fman2_liodn_tbl[] = { +struct fman_liodn_id_table fman2_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (2 ,0 ,17 ),SET_FMAN_RX_1G_LIODN (2 ,1 ,18 ), SET_FMAN_RX_1G_LIODN(2, 2, 19),
arch/powerpc/cpu/mpc85xx/t1024_ids.c +1 -1
@@ -50,7 +50,7 @@ struct liodn_id_table liodn_tbl[] = {int liodn_tbl_sz =ARRAY_SIZE (liodn_tbl);#ifdef CONFIG_SYS_DPAA_FMAN -struct liodn_id_table fman1_liodn_tbl[] = { +struct fman_liodn_id_table fman1_liodn_tbl[] = {SET_FMAN_RX_10G_TYPE2_LIODN (1 ,0 ,88 ),SET_FMAN_RX_1G_LIODN (1 ,1 ,89 ), SET_FMAN_RX_1G_LIODN(1, 2, 90),
arch/powerpc/cpu/mpc85xx/t1040_ids.c +1 -1
@@ -55,7 +55,7 @@ struct liodn_id_table liodn_tbl[] = {int liodn_tbl_sz =ARRAY_SIZE (liodn_tbl);#ifdef CONFIG_SYS_DPAA_FMAN -struct liodn_id_table fman1_liodn_tbl[] = { +struct fman_liodn_id_table fman1_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (1 ,0 ,88 ),SET_FMAN_RX_1G_LIODN (1 ,1 ,89 ), SET_FMAN_RX_1G_LIODN(1, 2, 90),
arch/powerpc/cpu/mpc85xx/t2080_ids.c +1 -1
@@ -83,7 +83,7 @@ struct liodn_id_table liodn_tbl[] = {int liodn_tbl_sz =ARRAY_SIZE (liodn_tbl);#ifdef CONFIG_SYS_DPAA_FMAN -struct liodn_id_table fman1_liodn_tbl[] = { +struct fman_liodn_id_table fman1_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (1 ,0 ,88 ),SET_FMAN_RX_1G_LIODN (1 ,1 ,89 ), SET_FMAN_RX_1G_LIODN(1, 2, 90),
arch/powerpc/cpu/mpc85xx/t4240_ids.c +2 -2
@@ -112,7 +112,7 @@ struct liodn_id_table liodn_tbl[] = {int liodn_tbl_sz =ARRAY_SIZE (liodn_tbl);#ifdef CONFIG_SYS_DPAA_FMAN -struct liodn_id_table fman1_liodn_tbl[] = { +struct fman_liodn_id_table fman1_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (1 ,0 ,88 ),SET_FMAN_RX_1G_LIODN (1 ,1 ,89 ), SET_FMAN_RX_1G_LIODN(1, 2, 90),
@@ -124,7 +124,7 @@ struct liodn_id_table fman1_liodn_tbl[] = { };int fman1_liodn_tbl_sz =ARRAY_SIZE (fman1_liodn_tbl);#if (CONFIG_SYS_NUM_FMAN ==2 ) -struct liodn_id_table fman2_liodn_tbl[] = { +struct fman_liodn_id_table fman2_liodn_tbl[] = {SET_FMAN_RX_1G_LIODN (2 ,0 ,88 ),SET_FMAN_RX_1G_LIODN (2 ,1 ,89 ), SET_FMAN_RX_1G_LIODN(2, 2, 90),
arch/powerpc/include/asm/fsl_liodn.h +43 -10
86 lines not on this page · raw message
drivers/net/fm/init.c +20 -7
@@ -3,6 +3,7 @@* * SPDX-License-Identifier: GPL-2.0+ */ +#include <errno.h> #include <common.h> #include <asm/io.h> #include <asm/fsl_serdes.h>
@@ -230,7 +231,7 @@ void board_ft_fman_fixup_port(void *blob, char * prop, phys_addr_t pa, enum fm_port port, int offset) __attribute__((weak, alias("__def_board_ft_fman_fixup_port"))); -static void ft_fixup_port (void *blob,struct fm_eth_info *info,char *prop) +int ft_fixup_port (void *blob,struct fm_eth_info *info,char *prop) {int off;uint32_t ph;
@@ -239,11 +240,13 @@ static void ft_fixup_port(void *blob, struct fm_eth_info *info, char *prop)CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET ; off =fdt_node_offset_by_compat_reg (blob, prop, paddr); +if (off == -FDT_ERR_NOTFOUND ) +return -EINVAL ;if (info->enabled) {fdt_fixup_phy_connection (blob, off, info->enet_if);board_ft_fman_fixup_port (blob, prop, paddr, info->port, off); -return ; +return 0 ; }#ifdef CONFIG_SYS_FMAN_V3
@@ -281,7 +284,7 @@ static void ft_fixup_port(void *blob, struct fm_eth_info *info, char *prop) ((info->port == FM1_10GEC4) && (PORT_IS_ENABLED(FM1_DTSEC4))) #endif ) - return; +return 0 ;#endif /* board code might have caused offset to change */ off =fdt_node_offset_by_compat_reg (blob, prop, paddr);
@@ -294,6 +297,8 @@ static void ft_fixup_port(void *blob, struct fm_eth_info *info, char *prop) ph =fdt_get_phandle (blob, off);do_fixup_by_prop (blob,"fsl,fman-mac" , &ph,sizeof (ph),"status" ,"disabled" ,strlen ("disabled" ) +1 ,1 ); + +return 0 ; }void fdt_fixup_fman_ethernet (void *blob)
@@ -305,10 +310,18 @@ void fdt_fixup_fman_ethernet(void *blob)ft_fixup_port (blob, &fm_info[i],"fsl,fman-memac" );#else for (i =0 ; i <ARRAY_SIZE (fm_info); i++) { -if (fm_info[i].type ==FM_ETH_1G_E ) -ft_fixup_port (blob, &fm_info[i],"fsl,fman-1g-mac" ); -else -ft_fixup_port (blob, &fm_info[i],"fsl,fman-10g-mac" ); +/* Try the new compatible first. +* If the node is missing, try the old. +*/ +if (fm_info[i].type ==FM_ETH_1G_E ) { +if (ft_fixup_port (blob, &fm_info[i],"fsl,fman-dtsec" )) +ft_fixup_port (blob, &fm_info[i], +"fsl,fman-1g-mac" ); + }else { +if (ft_fixup_port (blob, &fm_info[i],"fsl,fman-tgec" )) +ft_fixup_port (blob, &fm_info[i], +"fsl,fman-10g-mac" ); + } }#endif }
Signature · 1 line
1.7.9.5
PATCH v2 1/1 net/fman: Support both new and legacy FMan Compatibles
Quoted 8 lines · Igal.Liberman
From: Igal Liberman <[email protected]>
Recently the FMan Port and MAC compatibles were changed. This patch aligns the FMan Port and MAC compatibles
to the new FMan device tree binding document.
The FMan device tree binding document can be found in the Linux kernel:./Documentation/devicetree/bindings/powerpc/fsl/fman.txt
Quoted 8 lines
This patch doesn't affect legacy compatibles support.
Signed-off-by Igal Liberman <[email protected]>v1 --- v2:
- Changed the subject of the patch
v1: https://patchwork.ozlabs.org/patch/473501/
- Added Support to both new and legacy FMan compatibles
I'm guessing York should be taking this in since it's 85xx specific.
-Joe
PATCH v2 1/1 net/fman: Support both new and legacy FMan Compatibles
In reply to Igal.LibermanQuoted 8 lines · Igal.Liberman
From: Igal Liberman <[email protected]>
Recently the FMan Port and MAC compatibles were changed. This patch aligns the FMan Port and MAC compatibles
to the new FMan device tree binding document.
The FMan device tree binding document can be found in the Linux kernel:./Documentation/devicetree/bindings/powerpc/fsl/fman.txt
Quoted 9 lines
This patch doesn't affect legacy compatibles support.
Signed-off-by Igal Liberman <[email protected]>v1 --- v2:
- Changed the subject of the patch
v1: https://patchwork.ozlabs.org/patch/473501/
- Added Support to both new and legacy FMan compatibles
Applied to u-boot-mpc85xx master. Awaiting upstream.
York