board: lx2160a: runtime SerDes 1 lane grouping for LX2160A boards
v3 cover board: lx2160a: runtime SerDes 1 lane grouping for LX2160A boards
SRDS_PRTCL_S1 is latched at POR and read-only, so the RCW fixes the SerDes 1 protocol. These patches let U-Boot re-bundle SD1's 8 lanes at runtime, before the MC latches the converter setup, without changing the protocol number the RCW advertises:
lx2160_sd1 100g4x25g 1x 100G + 4x 25G split (patch 1), both PLLF lx2160_sd1 2x40g 2x 100G -> 2x 40G, no split (patch 2), both PLLS lx2160_sd1 40g4x10g 40G port + 4x 10G split (patch 3), both PLLS lx2160_sd1 100g4x10g 1x 100G + 4x 10G split (patch 4), mixed PLLF + PLLS lx2160_serdes status read-only view of any SerDes (patch 1)
Each mode is also reachable from hwconfig=serdes1:<mode> for the boot path.
Based on next: the 100g4x25g split itself is already there as 035d68fc36b5 ("lx2160: add lx2160_serdes split and management"), this series only builds on it.
Changes in v3:
- Incremental on top of next, where v1 is merged as 035d68fc36b5:
v2 mistakenly re-sent the whole file as its patch 1 (reported by Vladimir Oltean). Patch 1 is now only the delta: the lx2160_sd1 / lx2160_serdes command split and the 100g4x25g naming.
- Patches 2-5 unchanged, rebased onto next
Changes in v2:
- The mode-changing command is lx2160_sd1, lx2160_serdes only reads (v1 had both behind one lx2160_serdes command)
- New patches 2-4: the runtime SD1 conversions for many cases of split (2x 100GE -> 2x 40GE, second 40GE port -> 4x 10G, 1x 100GE + 4x 10G)
- New patch 5: hwconfig and README.soc documentation
- Mode names say what they produce: 100g4x25g (v1: split), 2x40g (was 40g), 40g4x10g (was 4x10g); 100g4x10g unchanged; same for the hwconfig serdes1: keys
- Rebased onto main
Vincent Jardin (5):
board: lx2160a: lx2160_serdes to lx2160_sd1 and lx2160_serdes
board: lx2160a: convert SD1 2x100GE to 2x40GE at runtime
board: lx2160a: split SD1's second 40GE port into 4x 10G
lx2160a: add SerDes 1 mode: 1x100GE + 4x10G (mix)
doc: lx2160a: SerDes 1 runtime lane grouping
.../cpu/armv8/fsl-layerscape/doc/README.soc | 10 + board/nxp/lx2160a/eth_lx2160aqds.c | 2 +- board/nxp/lx2160a/serdes_split.c | 716 ++++++++++++++++-- board/nxp/lx2160a/serdes_split.h | 40 +- doc/README.fsl-hwconfig | 25 + 5 files changed, 731 insertions(+), 62 deletions(-)
---
base-commit: 826ac8d2dc500fcc780647357032fea493e1f9bb
branch: for-upstream/lx2160a-serdes-split-v3
Signature · 1 line
2.43.0
PATCH v3 1/5 board: lx2160a: lx2160_serdes to lx2160_sd1 and lx2160_serdes
Fix the commit
035d68fc36b5 ("lx2160: add lx2160_serdes split and management")
which is in next.
It leads to the following commands which are more explicit:
lx2160_sd1 100g4x25g
CHANGES the SerDes 1 Ethernet mode: it re-groups SD1's eight lanes and re-points its protocol converters.
lx2160_serdes status [1|2|3]
only READS, any of the three SerDes, unchanged syntax.
In order to prepare the next commits, this mode should be:
100g4x25g (1x 100G + 4x 25G),
instead of "split", same for its hwconfig key:
setenv hwconfig serdes1:100g4x25g && saveenv
The follow-up patches will add more SerDes 1 modes under the lx2160_sd1.
The SerDes 3 and LX2160A-only branches use IS_ENABLED() instead of preprocessor conditionals, and the header no longer wraps its declarations in CONFIG_ARCH_LX2160A: the definitions stay guarded in serdes_split.c.
---
Changes in v3:
- Incremental on top of next, where v1 is merged as 035d68fc36b5:
v2 mistakenly re-sent the whole file as its patch 1 (reported by Vladimir Oltean). Patch 1 is now only the delta: the lx2160_sd1 / lx2160_serdes command split and the 100g4x25g naming.
- Patches 2-5 unchanged, rebased onto next
Changes in v2:
- The mode-changing command is lx2160_sd1, lx2160_serdes only reads (v1 had both behind one lx2160_serdes command)
- New patches 2-4: the runtime SD1 conversions for many cases of split (2x 100GE -> 2x 40GE, second 40GE port -> 4x 10G, 1x 100GE + 4x 10G)
- New patch 5: hwconfig and README.soc documentation
- Mode names say what they produce: 100g4x25g (v1: split), 2x40g (was 40g), 40g4x10g (was 4x10g); 100g4x10g unchanged; same for the hwconfig serdes1: keys
- Rebased onto main
board/nxp/lx2160a/eth_lx2160aqds.c | 2 +- board/nxp/lx2160a/serdes_split.c | 119 ++++++++++++++++------------- board/nxp/lx2160a/serdes_split.h | 11 +-- 3 files changed, 70 insertions(+), 62 deletions(-)
board/nxp/lx2160a/eth_lx2160aqds.c +1 -1
@@ -18,7 +18,7 @@ void reset_phy(void) {/* * Before the MC boots: it latches the live protocol-converter -* configuration when it starts, so `hwconfig=serdes1:split` has to +* configuration when it starts, so `hwconfig=serdes1:100g4x25g` has to * be applied here and not later. */ lx2160a_serdes_apply_hwconfig ();
board/nxp/lx2160a/serdes_split.c +67 -52
232 lines not on this page · raw message
board/nxp/lx2160a/serdes_split.h +2 -9
@@ -7,10 +7,9 @@#define __LX2160A_SERDES_SPLIT_H/* -* The split is LX2160A only: LX2162A's SerDes 1 is four lanes with no -* 100GE in its protocol table. +* The SerDes 1 modes are LX2160A only: LX2162A's SerDes 1 is four lanes +* without 100GE in its protocol table. */ -#if defined(CONFIG_ARCH_LX2160A )/* Is SerDes 1 already 1x 100G + 4x 25G? */ bool lx2160a_serdes1_is_split (void );
@@ -24,12 +23,6 @@ bool lx2160a_serdes1_is_split(void);*/ int lx2160a_serdes1_split (void ); -/* -* Apply `hwconfig=serdes1:split` if the board's environment asks for it. -* Boards call this from reset_phy(), before mc_env_boot(). -*/ void lx2160a_serdes_apply_hwconfig (void ); -#endif /* CONFIG_ARCH_LX2160A */ -#endif /* __LX2160A_SERDES_SPLIT_H */
Signature · 1 line
2.43.0
Re: [PATCH v3 1/5] board: lx2160a: lx2160_serdes to lx2160_sd1 and lx2160_serdes
Hi Vincent,
Please don't take this in a bad way, but please be the first reviewer of your own code.
This is just a mechanical paste of v3 over v2 which shows the raw delta, the majority of which is just gratuitous formatting change. It is very difficult to review.
Quoted 3 lines · Vincent Jardin
Fix the commit
035d68fc36b5("lx2160: addlx2160_serdessplit and management")
which is in next.
I'd suggest picking a different word than 'fix', which means something was broken.
Best is to have one single logical change per patch, and to make it obvious to the reviewer through the commit message that the change is justified and correct.
Quoted 23 lines
It leads to the following commands which are more explicit:
lx2160_sd1100g4x25g
CHANGES the SerDes 1 Ethernet mode: it re-groups SD1's eight lanes and re-points its protocol converters.
lx2160_serdesstatus [1|2|3]
only READS, any of the three SerDes, unchanged syntax.In order to prepare the next commits, this mode should be:
100g4x25g (1x 100G + 4x 25G),
instead of "split", same for its hwconfig key:setenv hwconfig serdes1:100g4x25g && saveenvThe follow-up patches will add more SerDes 1 modes under the
lx2160_sd1.The SerDes 3 and LX2160A-only branches use
IS_ENABLED()instead of preprocessor conditionals, and the header no longer wraps its declarations inCONFIG_ARCH_LX2160A: the definitions stay guarded inserdes_split.c.Signed-off-by Vincent Jardin <[email protected]>
PATCH v3 2/5 board: lx2160a: convert SD1 2x100GE to 2x40GE at runtime
In reply to Vincent Jardinadd lx2160_sd1 2x40g, and parsing hwconfig=serdes1:2x40g for the boot path, alongside the existing SD1 100G+25G split.
SRDS_PRTCL_S1 is POR-latched read-only, so this changes the hardware the protocol number describes, not the number. That much is the same trick as the split. What is not the same is the lane rate, and it is the whole reason this is more than a converter code:
LNmTGCR0[BY_N_RATE_SEL] is the bit rate as a fraction of the PLL clock, and the RM requires 011b (double) for 25G/100G and 000b (full) for 40G. The split stays on PLLF because 25G and 100G are the same 25.78125 Gbaud. 40GE is 10.3125 Gbaud, so it needs the other PLL.
The protocol 13 "powers down" PLLS only by setting PLLnRSTCTL[DIS], software can clear it. Both SD1 refclk inputs are fed with a 161.1328125 MHz, so PLLS has what it needs.
The trick: the register values were read from the CPU from a protocol-13 vs a protocol-20 build and diffed.
100g4x25g and 2x40g are mutually exclusive: 100g4x25g wins.
---
(no changes since v1)
board/nxp/lx2160a/serdes_split.c | 221 ++++++++++++++++++++++++++++++- board/nxp/lx2160a/serdes_split.h | 11 ++ 2 files changed, 228 insertions(+), 4 deletions(-)
board/nxp/lx2160a/serdes_split.c +217 -4
@@ -25,9 +25,17 @@#define SRDS_BLOCK_STRIDE 0x10000#define SRDS_LANE_STRIDE 0x100 +#define SRDS_PLL_STRIDE 0x100#define SRDS_LNmGCR0 (b, m) ((b) + 0x800 + (m) * SRDS_LANE_STRIDE)#define SRDS_LNmTRSTCTL (b, m) ((b) + 0x820 + (m) * SRDS_LANE_STRIDE) +#define SRDS_LNmTGCR0 (b, m) ((b) + 0x824 + (m) * SRDS_LANE_STRIDE)#define SRDS_LNmRRSTCTL (b, m) ((b) + 0x840 + (m) * SRDS_LANE_STRIDE) +#define SRDS_LNmRGCR0 (b, m) ((b) + 0x844 + (m) * SRDS_LANE_STRIDE) +/* n = 0 is PLLF (the fast PLL), n = 1 is PLLS (the slow one) */ +#define SRDS_PLLnRSTCTL (b, n) ((b) + 0x400 + (n) * SRDS_PLL_STRIDE) +#define SRDS_PLLnCR0 (b, n) ((b) + 0x404 + (n) * SRDS_PLL_STRIDE) +#define SRDS_PLLnCR1 (b, n) ((b) + 0x408 + (n) * SRDS_PLL_STRIDE) +#define SRDS_PLLnCR5 (b, n) ((b) + 0x414 + (n) * SRDS_PLL_STRIDE)#define SRDS_PCCC (b) ((b) + 0x10B0)#define SRDS_PCCD (b) ((b) + 0x10B4)#define SRDS_PCCE (b) ((b) + 0x10B8)
@@ -46,6 +54,14 @@#define RSTCTL_STP_REQ BIT(26)#define RSTCTL_DIS BIT(24) +/* PLLnRSTCTL adds two status bits the lane RSTCTLs do not have */ +#define PLLRSTCTL_RST_ERR BIT(29)/* no lock before time-out */ +#define PLLRSTCTL_LOCK BIT(23)/* PLL calibrated + locked */ + +/* PCCE: E40Ga at 30-28 (LRV 31), E40Gb at 26-24 (LRV 27) */ +#define PCCE_E40GA_CFG (v) (((v) >> 28) & 0x7) +#define PCCE_E40GB_CFG (v) (((v) >> 24) & 0x7) +/* PCCE: E100Ga at 14-12 (LRV 15), E100Gb at 10-8 (LRV 11) */ #define PCCE_E100GA_CFG (v) (((v) >> 12) & 0x7)#define PCCE_E100GA_LRV (v) (((v) >> 15) & 0x1)
@@ -408,20 +424,196 @@ int lx2160a_serdes1_split(void) return ret; } +/* +* 2x 100GE -> 2x 40GE, without changing the RCW. +* +* LNmTGCR0[BY_N_RATE_SEL] is the transmitter bit rate as a fraction of +* the PLL clock. +* +* Protocol 13 powers PLLS down, but only by setting +* PLLnRSTCTL[DIS] ("default value set by RCW configuration"), +* which software can clear. +* Both SD1 reference-clock inputs are fed 161.1328125 MHz. +* +* The register values below were analyzed from the CPU for both cases: +* protocol-13 vs protocol-20 run. +*/ +#define F40G_PLLS 1/* PLLS index in PLLnxxx() */ +#define F40G_PLLF 0 +#define F40G_PLLS_CR0 0x00040000/* REFCLK_SEL=4, 161.1328125 MHz */ +#define F40G_PLLS_CR1 0x86100008/* 10.3125 GHz clock net */ +#define F40G_PLLS_CR5 0x00001000 +/* PROTO_SEL=01010b (XFI/10GBase-R/40GBase-R) + IF_WIDTH=010b (20-bit) */ +#define F40G_GCR0_MASTER 0x00000052 +#define F40G_GCR0_SLAVE 0x00010052 +/* LNmTGCR0/LNmRGCR0: USE_SLOW_PLL=1 (bit 28), BY_N_RATE_SEL=000 full */ +#define F40G_LANE_GCR 0x10000000 +#define F40G_PCCE 0x11000000/* E40Ga+E40Gb on, E100G off */ + +static bool srds1_is_40g (unsigned long base) +{ +u32 pcce =in_le32 ((void __iomem *)SRDS_PCCE (base)); + +return PCCE_E40GA_CFG (pcce) !=0 && +PCCE_E40GB_CFG (pcce) !=0 && +PCCE_E100GA_CFG (pcce) ==0 && +PCCE_E100GB_CFG (pcce) ==0 ; +} + +bool lx2160a_serdes1_is_40g (void ) +{ +return srds1_is_40g (srds_base (FSL_SRDS_1 )); +} + +/* +* Bring PLLS up at the 40GE clock net. Nothing uses it yet, so this +* cannot disturb the running 100GE lanes on PLLF. +*/ +static int srds1_plls_up_40g (unsigned long base) +{ +unsigned long rstctl =SRDS_PLLnRSTCTL (base,F40G_PLLS ); +u32 v; + +out_le32 ((void __iomem *)SRDS_PLLnCR0 (base,F40G_PLLS ),F40G_PLLS_CR0 ); +out_le32 ((void __iomem *)SRDS_PLLnCR1 (base,F40G_PLLS ),F40G_PLLS_CR1 ); +out_le32 ((void __iomem *)SRDS_PLLnCR5 (base,F40G_PLLS ),F40G_PLLS_CR5 ); + +out_le32 ((void __iomem *)rstctl,0 ); +out_le32 ((void __iomem *)rstctl,RSTCTL_RST_REQ ); + +if (poll_clear (rstctl,RSTCTL_RST_REQ )) { +printf ("lx2160a serdes: SD1 PLLS reset did not complete within %d us\n" , +SPLIT_POLL_US ); +return -ETIMEDOUT ; + } + + v =in_le32 ((void __iomem *)rstctl); +if (v &PLLRSTCTL_RST_ERR ) { +printf ("lx2160a serdes: SD1 PLLS did not lock (PLLSRSTCTL=%08x, RST_ERR)\n" , v); +return -EIO ; + } +if (!(v &PLLRSTCTL_LOCK ) || !(v &RSTCTL_RST_DONE )) { +printf ("lx2160a serdes: SD1 PLLS came up without LOCK/RST_DONE (PLLSRSTCTL=%08x)\n" , + v); +return -EIO ; + } + +return 0 ; +} + +int lx2160a_serdes1_to_40g (void ) +{ +unsigned long base =srds_base (FSL_SRDS_1 ); +unsigned long pllf =SRDS_PLLnRSTCTL (base,F40G_PLLF ); +bool master[SRDS_LANES ]; +int m, ret =0 ; + +if (srds1_is_40g (base)) { +debug ("lx2160a serdes: SD1 already 2x 40GE, nothing to do\n" ); +return 0 ; + } + +if (!srds1_is_unsplit (base)) { +printf ("lx2160a serdes: SD1 is not in the 2x 100GE state (PCCD=%08x PCCE=%08x), refusing\n" , +in_le32 ((void __iomem *)SRDS_PCCD (base)), +in_le32 ((void __iomem *)SRDS_PCCE (base))); +return -EINVAL ; + } + +/* +* Remember the port masters so the 2x4 grouping is preserved +* rather than assumed to be LND and LNH. +*/ +for (m =0 ; m <SRDS_LANES ; m++) + master[m] = !(in_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m)) & +GCR0_PORT_LN0_B ); + + ret =srds1_plls_up_40g (base); +if (ret) +return ret; + +/* +* Halt PLLF, which puts every lane using it into reset "to allow +* reconfiguration" +*/ +out_le32 ((void __iomem *)pllf,RSTCTL_HLT_REQ ); +if (poll_clear (pllf,RSTCTL_HLT_REQ )) { +printf ("lx2160a serdes: SD1 PLLF did not halt within %d us, continuing\n" , +SPLIT_POLL_US ); + ret = -ETIMEDOUT ; + } + +for (m =0 ; m <SRDS_LANES ; m++) { +out_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m), + master[m] ?F40G_GCR0_MASTER :F40G_GCR0_SLAVE ); +out_le32 ((void __iomem *)SRDS_LNmTGCR0 (base, m),F40G_LANE_GCR ); +out_le32 ((void __iomem *)SRDS_LNmRGCR0 (base, m),F40G_LANE_GCR ); + } + +out_le32 ((void __iomem *)SRDS_PCCE (base),F40G_PCCE ); + +/* Every lane now selects PLLS, so one PLL reset restarts them all. */ +out_le32 ((void __iomem *)SRDS_PLLnRSTCTL (base,F40G_PLLS ), +RSTCTL_RST_REQ ); +if (poll_clear (SRDS_PLLnRSTCTL (base,F40G_PLLS ),RSTCTL_RST_REQ )) { +printf ("lx2160a serdes: SD1 PLLS re-reset did not complete within %d us\n" , +SPLIT_POLL_US ); + ret = -ETIMEDOUT ; + } + +for (m =0 ; m <SRDS_LANES ; m++) { +u32 t =in_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m)); +u32 r =in_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m)); + +if (!(t &RSTCTL_RST_DONE ) || !(r &RSTCTL_RST_DONE )) { +printf ("lx2160a serdes: LN%c has no RST_DONE (TRSTCTL=%08x RRSTCTL=%08x)\n" , +'A' + m, t, r); + ret = -EIO ; + } + } + +if (!srds1_is_40g (base)) { +printf ("lx2160a serdes: 40GE conversion did not take (PCCE=%08x)\n" , +in_le32 ((void __iomem *)SRDS_PCCE (base))); +return -EIO ; + } + +printf ("lx2160a serdes: SD1 2x 100GE converted to 2x 40GE%s\n" , + ret ?" (with warnings above)" :"" ); +printf ("lx2160a serdes: RCWSR still reads protocol 13 -- the DPC needs follow_hw_pssr\n" ); + +return ret; +} +/* * setenv hwconfig serdes1:100g4x25g +* setenv hwconfig serdes1:2x40g * * Idempotent: a board whose PBI already split SD1 skip it too. +* +* The two are mutually exclusive -- one re-points lanes 4-7 to 25G on +* PLLF, the other moves all eight to 40GE on PLLS -- so `split` wins +* and `40g` is refused alongside it rather than layered on top. */ void lx2160a_serdes_apply_hwconfig (void ) { -if (!hwconfig_sub ("serdes1" ,"100g4x25g" )) +if (hwconfig_sub ("serdes1" ,"100g4x25g" )) { +if (hwconfig_sub ("serdes1" ,"2x40g" )) +printf ("lx2160a serdes: hwconfig asks for both serdes1:100g4x25g and serdes1:2x40g, doing the split only\n" ); +if (lx2160a_serdes1_is_split ()) +return ; + +lx2160a_serdes1_split (); +return ; + } + +if (!hwconfig_sub ("serdes1" ,"2x40g" ))return ; -if (lx2160a_serdes1_is_split ()) +if (lx2160a_serdes1_is_40g ())return ; -lx2160a_serdes1_split (); +lx2160a_serdes1_to_40g (); }#endif /* CONFIG_ARCH_LX2160A */
@@ -463,6 +655,22 @@ static int do_lx2160_sd1(struct cmd_tbl *cmdtp, int flag,return CMD_RET_SUCCESS ; } +if (!strcmp (argv[1 ],"2x40g" )) { +if (!IS_ENABLED (CONFIG_ARCH_LX2160A )) { +printf ("no 100GE on SerDes 1 to convert on this SoC\n" ); +return CMD_RET_FAILURE ; + } +if (argc !=2 ) +return CMD_RET_USAGE ; +if (lx2160a_serdes1_is_40g ()) { +printf ("SD1 is already 2x 40GE, nothing to do\n" ); +return CMD_RET_SUCCESS ; + } +if (lx2160a_serdes1_to_40g ()) +return CMD_RET_FAILURE ; +return CMD_RET_SUCCESS ; + } +return CMD_RET_USAGE ; }
@@ -501,7 +709,12 @@ static int do_lx2160_serdes(struct cmd_tbl *cmdtp, int flag,"100g4x25g\n" \" - split Lynx 28G SD1 100GE.1 (lanes LNE-LNH) into 4x 25G.\n" \" Runs before the MC starts. To make it permanent on a board\n" \ - " that needs it: setenv hwconfig serdes1:100g4x25g && saveenv" +" that needs it: setenv hwconfig serdes1:100g4x25g && saveenv\n" \ +"lx2160_sd1 2x40g\n" \ +" - convert SD1 2x 100GE into 2x 40GE without touching the RCW.\n" \ +" Must run before the MC starts, and the DPC must carry\n" \ +" board_info/serdes/follow_hw_pssr: RCWSR still reads 13.\n" \ + " Undo with `reset`. Permanent: setenv hwconfig serdes1:2x40g"#else #define SD1_CMD_HELP \ " - no SerDes 1 Ethernet modes on this SoC"
board/nxp/lx2160a/serdes_split.h +11 -0
@@ -23,6 +23,17 @@ bool lx2160a_serdes1_is_split(void);*/ int lx2160a_serdes1_split (void ); +/* Is SerDes 1 already 2x 40GE? */ +bool lx2160a_serdes1_is_40g (void ); + +/* +* Convert SerDes 1's 2x 100GE into 2x 40GE, do not touch the RCW. +* +* Refuses unless SD1 is in the 2x 100GE state, and must be called +* before the CPU's MC starts. +*/ +int lx2160a_serdes1_to_40g (void ); +void lx2160a_serdes_apply_hwconfig (void );#endif /* __LX2160A_SERDES_SPLIT_H */
Signature · 1 line
2.43.0
PATCH v3 3/5 board: lx2160a: split SD1's second 40GE port into 4x 10G
In reply to Vincent Jardinlx2160_sd1 40g4x10g, hwconfig=serdes1:40g4x10g.
XFI LNmGCR0 = 0x00000052 LNmTGCR0 = 0x10000000
40GE LNmGCR0 = 0x00010052 LNmTGCR0 = 0x10000000
^ PORT_LN0_Bsame PROTO_SEL (0x0a spans XFI and 40GBase-R), same 20-bit width, same USE_SLOW_PLL, same BY_N_RATE_SEL.
It is inspired from the 100G+4x25G split, but using PLLS.
---
(no changes since v1)
board/nxp/lx2160a/serdes_split.c | 191 ++++++++++++++++++++++++++++++- board/nxp/lx2160a/serdes_split.h | 11 ++ 2 files changed, 199 insertions(+), 3 deletions(-)
board/nxp/lx2160a/serdes_split.c +188 -3
@@ -585,6 +585,154 @@ int lx2160a_serdes1_to_40g(void)return ret; } +/* +* 2x 40GE -> 1x 40GE + 4x XFI (10G), keeping the QSFP group intact. +* +* XFI lane LNmGCR0 = 0x00000052 LNmTGCR0 = 0x10000000 +* 40GE lane LNmGCR0 = 0x00010052 LNmTGCR0 = 0x10000000 +* ^ PORT_LN0_B +*/ +#define X10G_FIRST_LANE 4 +#define X10G_LAST_LANE 7 +#define X10G_GCR0 0x00000052/* as 40GE, but own port master */ +#define X10G_PCCE 0x01000000/* E40Gb kept (lanes 0-3) */ +#define X10G_PCCC 0x88889999/* XFI converters for lanes 4-7 */ + +static bool srds1_is_40g_4x10g (unsigned long base) +{ +u32 pccc =in_le32 ((void __iomem *)SRDS_PCCC (base)); +u32 pcce =in_le32 ((void __iomem *)SRDS_PCCE (base)); + +return PCCE_E40GB_CFG (pcce) !=0 && +PCCE_E40GA_CFG (pcce) ==0 && + (pccc &0xffff ) ==0x9999 ; +} + +bool lx2160a_serdes1_is_40g_4x10g (void ) +{ +return srds1_is_40g_4x10g (srds_base (FSL_SRDS_1 )); +} + +int lx2160a_serdes1_40g_4x10g (void ) +{ +unsigned long base =srds_base (FSL_SRDS_1 ); +int m, master =-1 , keep_master =-1 , ret =0 ; + +if (srds1_is_40g_4x10g (base)) { +debug ("lx2160a serdes: SD1 already 1x 40GE + 4x 10G\n" ); +return 0 ; + } + +if (!srds1_is_40g (base)) { +printf ("lx2160a serdes: SD1 is not in the 2x 40GE state (PCCC=%08x PCCE=%08x), refusing\n" , +in_le32 ((void __iomem *)SRDS_PCCC (base)), +in_le32 ((void __iomem *)SRDS_PCCE (base))); +return -EINVAL ; + } + +/* +* Halt. As in the 25G split, only the port master's request can +* clear, so issue all four and wait on that one. +*/ +/* The kept group's master, recorded before anything is halted. */ +for (m =0 ; m <SRDS_LANES ; m++) { +if (m >=X10G_FIRST_LANE && m <=X10G_LAST_LANE ) +continue ; +if (!(in_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m)) & +GCR0_PORT_LN0_B )) + keep_master = m; + } + +for (m =X10G_FIRST_LANE ; m <=X10G_LAST_LANE ; m++) { +if (!(in_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m)) & +GCR0_PORT_LN0_B )) + master = m; +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m), +RSTCTL_HLT_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m), +RSTCTL_HLT_REQ ); + } + +if (master <0 ) { +printf ("lx2160a serdes: no master lane in the dpmac.1 group, refusing\n" ); +return -EINVAL ; + } + +if (poll_clear (SRDS_LNmTRSTCTL (base, master),RSTCTL_HLT_REQ ) || +poll_clear (SRDS_LNmRRSTCTL (base, master),RSTCTL_HLT_REQ )) { +printf ("lx2160a serdes: lane %d did not halt within %d us, continuing\n" , + master,SPLIT_POLL_US ); + ret = -ETIMEDOUT ; + } + +for (m =X10G_FIRST_LANE ; m <=X10G_LAST_LANE ; m++) +out_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m),X10G_GCR0 ); + +out_le32 ((void __iomem *)SRDS_PCCE (base),X10G_PCCE ); +out_le32 ((void __iomem *)SRDS_PCCC (base),X10G_PCCC ); + +/* Reset BOTH halves, not just the four lanes whose GCR0 changed */ +for (m =X10G_FIRST_LANE ; m <=X10G_LAST_LANE ; m++) { +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m), +RSTCTL_RST_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m), +RSTCTL_RST_REQ ); + } + +for (m =0 ; m <SRDS_LANES ; m++) { +if (m >=X10G_FIRST_LANE && m <=X10G_LAST_LANE ) +continue ; +if (m == keep_master) +continue ; +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m), +RSTCTL_RST_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m), +RSTCTL_RST_REQ ); + } + +if (keep_master >=0 ) { +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, keep_master), +RSTCTL_RST_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, keep_master), +RSTCTL_RST_REQ ); + }else { +printf ("lx2160a serdes: no master lane in the kept 40GE group, it was not reset\n" ); + ret = -EINVAL ; + } + +for (m =0 ; m <SRDS_LANES ; m++) { +u32 t, r; + +if (poll_clear (SRDS_LNmTRSTCTL (base, m),RSTCTL_RST_REQ ) || +poll_clear (SRDS_LNmRRSTCTL (base, m),RSTCTL_RST_REQ )) { +printf ("lx2160a serdes: lane %d reset did not complete within %d us\n" , + m,SPLIT_POLL_US ); + ret = -ETIMEDOUT ; +continue ; + } + + t =in_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m)); + r =in_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m)); +if (!(t &RSTCTL_RST_DONE ) || !(r &RSTCTL_RST_DONE )) { +printf ("lx2160a serdes: lane %d reset finished without RST_DONE (TRSTCTL=%08x RRSTCTL=%08x)\n" , + m, t, r); + ret = -EIO ; + } + } + +if (!srds1_is_40g_4x10g (base)) { +printf ("lx2160a serdes: 4x 10G split did not take (PCCC=%08x PCCE=%08x)\n" , +in_le32 ((void __iomem *)SRDS_PCCC (base)), +in_le32 ((void __iomem *)SRDS_PCCE (base))); +return -EIO ; + } + +printf ("lx2160a serdes: SD1 now 1x 40GE (dpmac.2) + 4x 10G (dpmac.3-6)%s\n" , + ret ?" (with warnings above)" :"" ); + +return ret; +} +/* * setenv hwconfig serdes1:100g4x25g * setenv hwconfig serdes1:2x40g
@@ -598,8 +746,9 @@ int lx2160a_serdes1_to_40g(void)void lx2160a_serdes_apply_hwconfig (void ) {if (hwconfig_sub ("serdes1" ,"100g4x25g" )) { -if (hwconfig_sub ("serdes1" ,"2x40g" )) -printf ("lx2160a serdes: hwconfig asks for both serdes1:100g4x25g and serdes1:2x40g, doing the split only\n" ); +if (hwconfig_sub ("serdes1" ,"2x40g" ) || +hwconfig_sub ("serdes1" ,"40g4x10g" )) +printf ("lx2160a serdes: hwconfig asks for serdes1:100g4x25g alongside a 40GE mode, doing the split only\n" );if (lx2160a_serdes1_is_split ())return ;
@@ -607,6 +756,23 @@ void lx2160a_serdes_apply_hwconfig(void)return ; } +/* +* serdes1:40g4x10g is a target MODE, not a second step the user has +* to sequence by hand: it implies the 40GE conversion first, +* because 1x 40GE + 4x 10G is reached by splitting one of the two +* 40GE ports. +*/ +if (hwconfig_sub ("serdes1" ,"40g4x10g" )) { +if (lx2160a_serdes1_is_40g_4x10g ()) +return ; + +if (!lx2160a_serdes1_is_40g () &&lx2160a_serdes1_to_40g ()) +return ; + +lx2160a_serdes1_40g_4x10g (); +return ; + } +if (!hwconfig_sub ("serdes1" ,"2x40g" ))return ;
@@ -671,6 +837,22 @@ static int do_lx2160_sd1(struct cmd_tbl *cmdtp, int flag,return CMD_RET_SUCCESS ; } +if (!strcmp (argv[1 ],"40g4x10g" )) { +if (!IS_ENABLED (CONFIG_ARCH_LX2160A )) { +printf ("no 40GE on SerDes 1 to split on this SoC\n" ); +return CMD_RET_FAILURE ; + } +if (argc !=2 ) +return CMD_RET_USAGE ; +if (lx2160a_serdes1_is_40g_4x10g ()) { +printf ("SD1 is already 1x 40GE + 4x 10G, nothing to do\n" ); +return CMD_RET_SUCCESS ; + } +if (lx2160a_serdes1_40g_4x10g ()) +return CMD_RET_FAILURE ; +return CMD_RET_SUCCESS ; + } +return CMD_RET_USAGE ; }
@@ -714,7 +896,10 @@ static int do_lx2160_serdes(struct cmd_tbl *cmdtp, int flag," - convert SD1 2x 100GE into 2x 40GE without touching the RCW.\n" \" Must run before the MC starts, and the DPC must carry\n" \" board_info/serdes/follow_hw_pssr: RCWSR still reads 13.\n" \ - " Undo with `reset`. Permanent: setenv hwconfig serdes1:2x40g" +" Undo with `reset`. Permanent: setenv hwconfig serdes1:2x40g\n" \ +"lx2160_sd1 40g4x10g\n" \ +" - split SD1's dpmac.1 40GE port into 4x 10G,\n" \ + " Permanent: setenv hwconfig serdes1:40g4x10g (implies 2x40g)"#else #define SD1_CMD_HELP \ " - no SerDes 1 Ethernet modes on this SoC"
board/nxp/lx2160a/serdes_split.h +11 -0
@@ -34,6 +34,17 @@ bool lx2160a_serdes1_is_40g(void);*/ int lx2160a_serdes1_to_40g (void ); +/* Is SerDes 1 already 1x 40GE + 4x 10G? */ +bool lx2160a_serdes1_is_40g_4x10g (void ); + +/* +* Split SerDes 1's dpmac.1 40GE port into 4x 10G (dpmac.3-6), +* keeping dpmac.2 as one 40GE port. +* +* Refuses unless SD1 is in the 2x 40GE state. +*/ +int lx2160a_serdes1_40g_4x10g (void ); +void lx2160a_serdes_apply_hwconfig (void );#endif /* __LX2160A_SERDES_SPLIT_H */
Signature · 1 line
2.43.0
Re: [PATCH v3 3/5] board: lx2160a: split SD1's second 40GE port into 4x 10G
Quoted 239 lines · Vincent Jardin
lx2160_sd140g4x10g, hwconfig=serdes1:40g4x10g.XFI LNmGCR0 = 0x00000052 LNmTGCR0 = 0x10000000 40GE LNmGCR0 = 0x00010052 LNmTGCR0 = 0x10000000 ^ PORT_LN0_Bsame
PROTO_SEL(0x0aspans XFI and 40GBase-R), same 20-bit width, sameUSE_SLOW_PLL, sameBY_N_RATE_SEL.It is inspired from the 100G+4x25G split, but using PLLS.
Signed-off-by Vincent Jardin <[email protected]>---
(no changes since v1)
board/nxp/lx2160a/serdes_split.c | 191 ++++++++++++++++++++++++++++++- board/nxp/lx2160a/serdes_split.h | 11 ++ 2 files changed, 199 insertions(+), 3 deletions(-)board/nxp/lx2160a/serdes_split.c +184
-2@@ -585,6 +585,154 @@ int lx2160a_serdes1_to_40g(void)return ret; } +/* +* 2x 40GE -> 1x 40GE + 4x XFI (10G), keeping the QSFP group intact. +* +* XFI lane LNmGCR0 = 0x00000052 LNmTGCR0 = 0x10000000 +* 40GE lane LNmGCR0 = 0x00010052 LNmTGCR0 = 0x10000000 +* ^ PORT_LN0_B +*/ +#define X10G_FIRST_LANE 4 +#define X10G_LAST_LANE 7 +#define X10G_GCR0 0x00000052/* as 40GE, but own port master */ +#define X10G_PCCE 0x01000000/* E40Gb kept (lanes 0-3) */ +#define X10G_PCCC 0x88889999/* XFI converters for lanes 4-7 */ + +static bool srds1_is_40g_4x10g (unsigned long base) +{ +u32 pccc =in_le32 ((void __iomem *)SRDS_PCCC (base)); +u32 pcce =in_le32 ((void __iomem *)SRDS_PCCE (base)); + +return PCCE_E40GB_CFG (pcce) !=0 && +PCCE_E40GA_CFG (pcce) ==0 && + (pccc &0xffff ) ==0x9999 ; +} + +bool lx2160a_serdes1_is_40g_4x10g (void ) +{ +return srds1_is_40g_4x10g (srds_base (FSL_SRDS_1 )); +} + +int lx2160a_serdes1_40g_4x10g (void ) +{ +unsigned long base =srds_base (FSL_SRDS_1 ); +int m, master =-1 , keep_master =-1 , ret =0 ; + +if (srds1_is_40g_4x10g (base)) { +debug ("lx2160a serdes: SD1 already 1x 40GE + 4x 10G\n" ); +return 0 ; + } + +if (!srds1_is_40g (base)) { +printf ("lx2160a serdes: SD1 is not in the 2x 40GE state (PCCC=%08x PCCE=%08x), refusing\n" , +in_le32 ((void __iomem *)SRDS_PCCC (base)), +in_le32 ((void __iomem *)SRDS_PCCE (base))); +return -EINVAL ; + } + +/* +* Halt. As in the 25G split, only the port master's request can +* clear, so issue all four and wait on that one. +*/ +/* The kept group's master, recorded before anything is halted. */ +for (m =0 ; m <SRDS_LANES ; m++) { +if (m >=X10G_FIRST_LANE && m <=X10G_LAST_LANE ) +continue ; +if (!(in_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m)) & +GCR0_PORT_LN0_B )) + keep_master = m; + } + +for (m =X10G_FIRST_LANE ; m <=X10G_LAST_LANE ; m++) { +if (!(in_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m)) & +GCR0_PORT_LN0_B )) + master = m; +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m), +RSTCTL_HLT_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m), +RSTCTL_HLT_REQ ); + } + +if (master <0 ) { +printf ("lx2160a serdes: no master lane in the dpmac.1 group, refusing\n" ); +return -EINVAL ; + } + +if (poll_clear (SRDS_LNmTRSTCTL (base, master),RSTCTL_HLT_REQ ) || +poll_clear (SRDS_LNmRRSTCTL (base, master),RSTCTL_HLT_REQ )) { +printf ("lx2160a serdes: lane %d did not halt within %d us, continuing\n" , + master,SPLIT_POLL_US ); + ret = -ETIMEDOUT ; + } + +for (m =X10G_FIRST_LANE ; m <=X10G_LAST_LANE ; m++) +out_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m),X10G_GCR0 ); + +out_le32 ((void __iomem *)SRDS_PCCE (base),X10G_PCCE ); +out_le32 ((void __iomem *)SRDS_PCCC (base),X10G_PCCC ); + +/* Reset BOTH halves, not just the four lanes whose GCR0 changed */ +for (m =X10G_FIRST_LANE ; m <=X10G_LAST_LANE ; m++) { +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m), +RSTCTL_RST_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m), +RSTCTL_RST_REQ ); + } + +for (m =0 ; m <SRDS_LANES ; m++) { +if (m >=X10G_FIRST_LANE && m <=X10G_LAST_LANE ) +continue ; +if (m == keep_master) +continue ; +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m), +RSTCTL_RST_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m), +RSTCTL_RST_REQ ); + } + +if (keep_master >=0 ) { +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, keep_master), +RSTCTL_RST_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, keep_master), +RSTCTL_RST_REQ ); + }else { +printf ("lx2160a serdes: no master lane in the kept 40GE group, it was not reset\n" ); + ret = -EINVAL ; + } + +for (m =0 ; m <SRDS_LANES ; m++) { +u32 t, r; + +if (poll_clear (SRDS_LNmTRSTCTL (base, m),RSTCTL_RST_REQ ) || +poll_clear (SRDS_LNmRRSTCTL (base, m),RSTCTL_RST_REQ )) { +printf ("lx2160a serdes: lane %d reset did not complete within %d us\n" , + m,SPLIT_POLL_US ); + ret = -ETIMEDOUT ; +continue ; + } + + t =in_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m)); + r =in_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m)); +if (!(t &RSTCTL_RST_DONE ) || !(r &RSTCTL_RST_DONE )) { +printf ("lx2160a serdes: lane %d reset finished without RST_DONE (TRSTCTL=%08x RRSTCTL=%08x)\n" , + m, t, r); + ret = -EIO ; + } + } + +if (!srds1_is_40g_4x10g (base)) { +printf ("lx2160a serdes: 4x 10G split did not take (PCCC=%08x PCCE=%08x)\n" , +in_le32 ((void __iomem *)SRDS_PCCC (base)), +in_le32 ((void __iomem *)SRDS_PCCE (base))); +return -EIO ; + } + +printf ("lx2160a serdes: SD1 now 1x 40GE (dpmac.2) + 4x 10G (dpmac.3-6)%s\n" , + ret ?" (with warnings above)" :"" ); + +return ret; +} +/* * setenv hwconfig serdes1:100g4x25g * setenv hwconfig serdes1:2x40g @@ -598,8 +746,9 @@ int lx2160a_serdes1_to_40g(void)void lx2160a_serdes_apply_hwconfig (void ) {if (hwconfig_sub ("serdes1" ,"100g4x25g" )) { -if (hwconfig_sub ("serdes1" ,"2x40g" )) -printf ("lx2160a serdes: hwconfig asks for both serdes1:100g4x25g and serdes1:2x40g, doing the split only\n" ); +if (hwconfig_sub ("serdes1" ,"2x40g" ) || +hwconfig_sub ("serdes1" ,"40g4x10g" )) +printf ("lx2160a serdes: hwconfig asks for serdes1:100g4x25g alongside a 40GE mode, doing the split only\n" );if (lx2160a_serdes1_is_split ())return ;@@ -607,6 +756,23 @@ void lx2160a_serdes_apply_hwconfig(void)return ; } +/* +* serdes1:40g4x10g is a target MODE, not a second step the user has +* to sequence by hand: it implies the 40GE conversion first, +* because 1x 40GE + 4x 10G is reached by splitting one of the two +* 40GE ports. +*/ +if (hwconfig_sub ("serdes1" ,"40g4x10g" )) { +if (lx2160a_serdes1_is_40g_4x10g ()) +return ; + +if (!lx2160a_serdes1_is_40g () &&lx2160a_serdes1_to_40g ()) +return ; + +lx2160a_serdes1_40g_4x10g (); +return ; + } +if (!hwconfig_sub ("serdes1" ,"2x40g" ))return ;@@ -671,6 +837,22 @@ static int do_lx2160_sd1(struct cmd_tbl *cmdtp, int flag,return CMD_RET_SUCCESS ; } +if (!strcmp (argv[1 ],"40g4x10g" )) { +if (!IS_ENABLED (CONFIG_ARCH_LX2160A )) { +printf ("no 40GE on SerDes 1 to split on this SoC\n" ); +return CMD_RET_FAILURE ; + } +if (argc !=2 ) +return CMD_RET_USAGE ; +if (lx2160a_serdes1_is_40g_4x10g ()) { +printf ("SD1 is already 1x 40GE + 4x 10G, nothing to do\n" ); +return CMD_RET_SUCCESS ; + } +if (lx2160a_serdes1_40g_4x10g ()) +return CMD_RET_FAILURE ; +return CMD_RET_SUCCESS ; + } +return CMD_RET_USAGE ; }
board/nxp/lx2160a/serdes_split.c static int do_lx2160_serdes(struct cmd_tbl *cmdtp, int flag, · line 902
Quoted 8 lines
board/nxp/lx2160a/serdes_split.c +4
-1@@ -714,7 +896,10 @@ static int do_lx2160_serdes(struct cmd_tbl *cmdtp, int flag," - convert SD1 2x 100GE into 2x 40GE without touching the RCW.\n" \" Must run before the MC starts, and the DPC must carry\n" \" board_info/serdes/follow_hw_pssr: RCWSR still reads 13.\n" \ -" Undo with `reset`. Permanent: setenv hwconfig serdes1:2x40g" +" Undo with `reset`. Permanent: setenv hwconfig serdes1:2x40g\n" \ +"lx2160_sd1 40g4x10g\n" \ +" - split SD1's dpmac.1 40GE port into 4x 10G,\n" \ +" Permanent: setenv hwconfig serdes1:40g4x10g (implies 2x40g)"
I'll add here a comment that applies to the entire lx2160_sd1 command, not specific to this hunk.
I see it as a huge foot gun. If the MC firmware has already booted, you don't want to allow any further SerDes lane splitting/unsplitting, because as you say, the follow_hw_pssr logic in the MC has already run.
Combined with the fact that the mcinitcmd env variable is executed by mc_env_boot() before the shell even loads, and by default it boots the MC firmware already, I think this is just asking for problems. You never warn the user that the MC firmware was already loaded.
I don't really see a practical use case for the lx2160_sd1 command. Would it work for your board to just reset the system after you setenv hwconfig && saveenv?
Quoted 12 lines
board/nxp/lx2160a/serdes_split.c +0
-0#else #define SD1_CMD_HELP \ " - no SerDes 1 Ethernet modes on this SoC"board/nxp/lx2160a/serdes_split.h +1
-0@@ -34,6 +34,17 @@ bool lx2160a_serdes1_is_40g(void);*/ int lx2160a_serdes1_to_40g (void ); +/* Is SerDes 1 already 1x 40GE + 4x 10G? */
board/nxp/lx2160a/serdes_split.h bool lx2160a_serdes1_is_40g(void); · line 47
Quoted 10 lines
board/nxp/lx2160a/serdes_split.h +10
-0+bool lx2160a_serdes1_is_40g_4x10g (void ); + +/* +* Split SerDes 1's dpmac.1 40GE port into 4x 10G (dpmac.3-6), +* keeping dpmac.2 as one 40GE port. +* +* Refuses unless SD1 is in the 2x 40GE state. +*/ +int lx2160a_serdes1_40g_4x10g (void ); +
You don't need to export to serdes_split.h functions which are called exclusively from serdes_split.c. This applies to the vast majority of the functions which are already present here.
Also, a general comment regarding code organization: have you considered a structured approach with SerDes configurations (aka array of structures with function pointers), carrying their
- name
- detection method
- method to verify whether the initial conditions are fulfilled
- method to switch to it
?
As an alternative to this ad-hoc lx2160a_serdes1_is_CONFIG_X() and lx2160a_serdes1_CONFIG_X() organization scheme.
Quoted 6 lines
board/nxp/lx2160a/serdes_split.h +0
-0void lx2160a_serdes_apply_hwconfig (void );#endif /* __LX2160A_SERDES_SPLIT_H */ Signature · 1 line
2.43.0
PATCH v3 4/5 lx2160a: add SerDes 1 mode: 1x100GE + 4x10G (mix)
In reply to Vincent JardinThe four existing SD1 modes all keep the eight lanes on one clock:
fast or slow (PLLF or PLLS).
This one does not: lanes 0-3 stay 100G CAUI-4 at 25.78125 Gbaud on PLLF, and lanes 4-7 become four XFI ports at 10.3125 Gbaud on PLLS.
Checked with:
grouping [LNA-LND] [LNE] [LNF] [LNG] [LNH] PSSR0 0-3 6a01xxxx CAUI@100G, MAC 0x01 -> dpmac.2 PSSR0 4-7 28xxxxxx XFI@10G, MAC 05/04/03/02 -> dpmac.6/.5/.4/.3
---
(no changes since v1)
board/nxp/lx2160a/serdes_split.c | 271 ++++++++++++++++++++++++++----- board/nxp/lx2160a/serdes_split.h | 11 ++ 2 files changed, 244 insertions(+), 38 deletions(-)
board/nxp/lx2160a/serdes_split.c +233 -38
@@ -438,16 +438,16 @@ int lx2160a_serdes1_split(void)* The register values below were analyzed from the CPU for both cases: * protocol-13 vs protocol-20 run. */ -#define F40G_PLLS 1/* PLLS index in PLLnxxx() */ -#define F40G_PLLF 0 -#define F40G_PLLS_CR0 0x00040000/* REFCLK_SEL=4, 161.1328125 MHz */ -#define F40G_PLLS_CR1 0x86100008/* 10.3125 GHz clock net */ -#define F40G_PLLS_CR5 0x00001000 +#define SRDS_PLLS 1/* PLLS index in PLLnxxx() */ +#define SRDS_PLLF 0 +#define SLOW_PLLS_CR0 0x00040000/* REFCLK_SEL=4, 161.1328125 MHz */ +#define SLOW_PLLS_CR1 0x86100008/* 10.3125 GHz clock net */ +#define SLOW_PLLS_CR5 0x00001000/* PROTO_SEL=01010b (XFI/10GBase-R/40GBase-R) + IF_WIDTH=010b (20-bit) */ #define F40G_GCR0_MASTER 0x00000052#define F40G_GCR0_SLAVE 0x00010052/* LNmTGCR0/LNmRGCR0: USE_SLOW_PLL=1 (bit 28), BY_N_RATE_SEL=000 full */ -#define F40G_LANE_GCR 0x10000000 +#define SLOW_LANE_GCR 0x10000000#define F40G_PCCE 0x11000000/* E40Ga+E40Gb on, E100G off */ static bool srds1_is_40g (unsigned long base)
@@ -465,18 +465,14 @@ bool lx2160a_serdes1_is_40g(void)return srds1_is_40g (srds_base (FSL_SRDS_1 )); } -/* -* Bring PLLS up at the 40GE clock net. Nothing uses it yet, so this -* cannot disturb the running 100GE lanes on PLLF. -*/ -static int srds1_plls_up_40g (unsigned long base) +static int srds1_plls_up_slow (unsigned long base) { -unsigned long rstctl =SRDS_PLLnRSTCTL (base,F40G_PLLS ); +unsigned long rstctl =SRDS_PLLnRSTCTL (base,SRDS_PLLS );u32 v; -out_le32 ((void __iomem *)SRDS_PLLnCR0 (base,F40G_PLLS ),F40G_PLLS_CR0 ); -out_le32 ((void __iomem *)SRDS_PLLnCR1 (base,F40G_PLLS ),F40G_PLLS_CR1 ); -out_le32 ((void __iomem *)SRDS_PLLnCR5 (base,F40G_PLLS ),F40G_PLLS_CR5 ); +out_le32 ((void __iomem *)SRDS_PLLnCR0 (base,SRDS_PLLS ),SLOW_PLLS_CR0 ); +out_le32 ((void __iomem *)SRDS_PLLnCR1 (base,SRDS_PLLS ),SLOW_PLLS_CR1 ); +out_le32 ((void __iomem *)SRDS_PLLnCR5 (base,SRDS_PLLS ),SLOW_PLLS_CR5 );out_le32 ((void __iomem *)rstctl,0 );out_le32 ((void __iomem *)rstctl,RSTCTL_RST_REQ );
@@ -504,7 +500,7 @@ static int srds1_plls_up_40g(unsigned long base)int lx2160a_serdes1_to_40g (void ) {unsigned long base =srds_base (FSL_SRDS_1 ); -unsigned long pllf =SRDS_PLLnRSTCTL (base,F40G_PLLF ); +unsigned long pllf =SRDS_PLLnRSTCTL (base,SRDS_PLLF );bool master[SRDS_LANES ];int m, ret =0 ;
@@ -528,7 +524,7 @@ int lx2160a_serdes1_to_40g(void) master[m] = !(in_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m)) &GCR0_PORT_LN0_B ); - ret =srds1_plls_up_40g (base); + ret =srds1_plls_up_slow (base);if (ret)return ret;
@@ -546,16 +542,16 @@ int lx2160a_serdes1_to_40g(void)for (m =0 ; m <SRDS_LANES ; m++) {out_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m), master[m] ?F40G_GCR0_MASTER :F40G_GCR0_SLAVE ); -out_le32 ((void __iomem *)SRDS_LNmTGCR0 (base, m),F40G_LANE_GCR ); -out_le32 ((void __iomem *)SRDS_LNmRGCR0 (base, m),F40G_LANE_GCR ); +out_le32 ((void __iomem *)SRDS_LNmTGCR0 (base, m),SLOW_LANE_GCR ); +out_le32 ((void __iomem *)SRDS_LNmRGCR0 (base, m),SLOW_LANE_GCR ); }out_le32 ((void __iomem *)SRDS_PCCE (base),F40G_PCCE );/* Every lane now selects PLLS, so one PLL reset restarts them all. */ -out_le32 ((void __iomem *)SRDS_PLLnRSTCTL (base,F40G_PLLS ), +out_le32 ((void __iomem *)SRDS_PLLnRSTCTL (base,SRDS_PLLS ),RSTCTL_RST_REQ ); -if (poll_clear (SRDS_PLLnRSTCTL (base,F40G_PLLS ),RSTCTL_RST_REQ )) { +if (poll_clear (SRDS_PLLnRSTCTL (base,SRDS_PLLS ),RSTCTL_RST_REQ )) {printf ("lx2160a serdes: SD1 PLLS re-reset did not complete within %d us\n" ,SPLIT_POLL_US ); ret = -ETIMEDOUT ;
@@ -592,11 +588,11 @@ int lx2160a_serdes1_to_40g(void)* 40GE lane LNmGCR0 = 0x00010052 LNmTGCR0 = 0x10000000 * ^ PORT_LN0_B */ -#define X10G_FIRST_LANE 4 -#define X10G_LAST_LANE 7 -#define X10G_GCR0 0x00000052/* as 40GE, but own port master */ +#define XFI_FIRST_LANE 4 +#define XFI_LAST_LANE 7 +#define XFI_GCR0 0x00000052/* as 40GE, but own port master */ #define X10G_PCCE 0x01000000/* E40Gb kept (lanes 0-3) */ -#define X10G_PCCC 0x88889999/* XFI converters for lanes 4-7 */ +#define XFI_PCCC 0x88889999/* XFI converters for lanes 4-7 */ static bool srds1_is_40g_4x10g (unsigned long base) {
@@ -636,14 +632,14 @@ int lx2160a_serdes1_40g_4x10g(void)*/ /* The kept group's master, recorded before anything is halted. */ for (m =0 ; m <SRDS_LANES ; m++) { -if (m >=X10G_FIRST_LANE && m <=X10G_LAST_LANE ) +if (m >=XFI_FIRST_LANE && m <=XFI_LAST_LANE )continue ;if (!(in_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m)) &GCR0_PORT_LN0_B )) keep_master = m; } -for (m =X10G_FIRST_LANE ; m <=X10G_LAST_LANE ; m++) { +for (m =XFI_FIRST_LANE ; m <=XFI_LAST_LANE ; m++) {if (!(in_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m)) &GCR0_PORT_LN0_B )) master = m;
@@ -665,14 +661,14 @@ int lx2160a_serdes1_40g_4x10g(void) ret = -ETIMEDOUT ; } -for (m =X10G_FIRST_LANE ; m <=X10G_LAST_LANE ; m++) -out_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m),X10G_GCR0 ); +for (m =XFI_FIRST_LANE ; m <=XFI_LAST_LANE ; m++) +out_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m),XFI_GCR0 );out_le32 ((void __iomem *)SRDS_PCCE (base),X10G_PCCE ); -out_le32 ((void __iomem *)SRDS_PCCC (base),X10G_PCCC ); +out_le32 ((void __iomem *)SRDS_PCCC (base),XFI_PCCC );/* Reset BOTH halves, not just the four lanes whose GCR0 changed */ -for (m =X10G_FIRST_LANE ; m <=X10G_LAST_LANE ; m++) { +for (m =XFI_FIRST_LANE ; m <=XFI_LAST_LANE ; m++) {out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m),RSTCTL_RST_REQ ); out_le32((void __iomem *)SRDS_LNmRRSTCTL(base, m),
@@ -680,7 +676,7 @@ int lx2160a_serdes1_40g_4x10g(void) }for (m =0 ; m <SRDS_LANES ; m++) { -if (m >=X10G_FIRST_LANE && m <=X10G_LAST_LANE ) +if (m >=XFI_FIRST_LANE && m <=XFI_LAST_LANE )continue ;if (m == keep_master)continue ;
@@ -733,22 +729,187 @@ int lx2160a_serdes1_40g_4x10g(void)return ret; } +/* 2x 100GE -> 1x 100GE + 4x XFI (10G): SD1 with 2 differents PLLF and PLLS */ +#define M100G_PCCE SPLIT_PCCE/* E100Gb kept (lanes 0-3) */ + +static bool srds1_is_100g_4x10g (unsigned long base) +{ +u32 pccc =in_le32 ((void __iomem *)SRDS_PCCC (base)); +u32 pcce =in_le32 ((void __iomem *)SRDS_PCCE (base)); + +/* +* Disjoint from every other predicate here by construction: the 4x +* 25G split matches the same PCCE but leaves PCCC alone, and both +* 40GE modes live in PCCE's E40G fields rather than its E100G ones. +*/ +return PCCE_E100GB_CFG (pcce) !=0 && +PCCE_E100GA_CFG (pcce) ==0 && + (pccc &0xffff ) ==0x9999 ; +} + +bool lx2160a_serdes1_is_100g_4x10g (void ) +{ +return srds1_is_100g_4x10g (srds_base (FSL_SRDS_1 )); +} + +int lx2160a_serdes1_100g_4x10g (void ) +{ +unsigned long base =srds_base (FSL_SRDS_1 ); +int m, master =-1 , keep_master =-1 , ret =0 ; + +if (srds1_is_100g_4x10g (base)) { +debug ("lx2160a serdes: SD1 already 1x 100GE + 4x 10G\n" ); +return 0 ; + } + +if (!srds1_is_unsplit (base)) { +printf ("lx2160a serdes: SD1 is not in the 2x 100GE state (PCCC=%08x PCCD=%08x PCCE=%08x), refusing\n" , +in_le32 ((void __iomem *)SRDS_PCCC (base)), +in_le32 ((void __iomem *)SRDS_PCCD (base)), +in_le32 ((void __iomem *)SRDS_PCCE (base))); +return -EINVAL ; + } + +/* The kept 100GE group's master, recorded before anything halts. */ +for (m =0 ; m <SRDS_LANES ; m++) { +if (m >=XFI_FIRST_LANE && m <=XFI_LAST_LANE ) +continue ; +if (!(in_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m)) & +GCR0_PORT_LN0_B )) + keep_master = m; + } + + ret =srds1_plls_up_slow (base); +if (ret) +return ret; + +/* +* Halt only the half that moves. PLLF is NOT halted here, which is +* the whole point of this mode and the one place it diverges from +* lx2160a_serdes1_to_40g(): halting PLLF would put the 100GE lanes +* into reset too, and they are meant to keep running. +* +* As everywhere else, only the port master's request can clear, so +* issue all four and wait on that one. +*/ +for (m =XFI_FIRST_LANE ; m <=XFI_LAST_LANE ; m++) { +if (!(in_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m)) & +GCR0_PORT_LN0_B )) + master = m; +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m), +RSTCTL_HLT_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m), +RSTCTL_HLT_REQ ); + } + +if (master <0 ) { +printf ("lx2160a serdes: no master lane among the lanes to split, refusing\n" ); +return -EINVAL ; + } + +if (poll_clear (SRDS_LNmTRSTCTL (base, master),RSTCTL_HLT_REQ ) || +poll_clear (SRDS_LNmRRSTCTL (base, master),RSTCTL_HLT_REQ )) { +printf ("lx2160a serdes: lane %d did not halt within %d us, continuing\n" , + master,SPLIT_POLL_US ); + ret = -ETIMEDOUT ; + } + +/* +* Four one-lane XFI ports on PLLS. The lanes' TGCR0/RGCR0 have to +* move too -- unlike the 4x 25G split, where the rate does not +* change and only the port grouping does. +*/ +for (m =XFI_FIRST_LANE ; m <=XFI_LAST_LANE ; m++) { +out_le32 ((void __iomem *)SRDS_LNmGCR0 (base, m),XFI_GCR0 ); +out_le32 ((void __iomem *)SRDS_LNmTGCR0 (base, m),SLOW_LANE_GCR ); +out_le32 ((void __iomem *)SRDS_LNmRGCR0 (base, m),SLOW_LANE_GCR ); + } + +out_le32 ((void __iomem *)SRDS_PCCE (base),M100G_PCCE ); +out_le32 ((void __iomem *)SRDS_PCCC (base),XFI_PCCC ); + +/* Reset both halves, slaves first and the kept group's master last */ +for (m =XFI_FIRST_LANE ; m <=XFI_LAST_LANE ; m++) { +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m), +RSTCTL_RST_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m), +RSTCTL_RST_REQ ); + } + +for (m =0 ; m <SRDS_LANES ; m++) { +if (m >=XFI_FIRST_LANE && m <=XFI_LAST_LANE ) +continue ; +if (m == keep_master) +continue ; +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m), +RSTCTL_RST_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m), +RSTCTL_RST_REQ ); + } + +if (keep_master >=0 ) { +out_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, keep_master), +RSTCTL_RST_REQ ); +out_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, keep_master), +RSTCTL_RST_REQ ); + }else { +printf ("lx2160a serdes: no master lane in the kept 100GE group, it was not reset\n" ); + ret = -EINVAL ; + } + +for (m =0 ; m <SRDS_LANES ; m++) { +u32 t, r; + +if (poll_clear (SRDS_LNmTRSTCTL (base, m),RSTCTL_RST_REQ ) || +poll_clear (SRDS_LNmRRSTCTL (base, m),RSTCTL_RST_REQ )) { +printf ("lx2160a serdes: lane %d reset did not complete within %d us\n" , + m,SPLIT_POLL_US ); + ret = -ETIMEDOUT ; +continue ; + } + + t =in_le32 ((void __iomem *)SRDS_LNmTRSTCTL (base, m)); + r =in_le32 ((void __iomem *)SRDS_LNmRRSTCTL (base, m)); +if (!(t &RSTCTL_RST_DONE ) || !(r &RSTCTL_RST_DONE )) { +printf ("lx2160a serdes: lane %d reset finished without RST_DONE (TRSTCTL=%08x RRSTCTL=%08x)\n" , + m, t, r); + ret = -EIO ; + } + } + +if (!srds1_is_100g_4x10g (base)) { +printf ("lx2160a serdes: 100G + 4x 10G conversion did not take (PCCC=%08x PCCE=%08x)\n" , +in_le32 ((void __iomem *)SRDS_PCCC (base)), +in_le32 ((void __iomem *)SRDS_PCCE (base))); +return -EIO ; + } + +printf ("lx2160a serdes: SD1 now 1x 100GE (dpmac.2, PLLF) + 4x 10G (dpmac.3-6, PLLS)%s\n" , + ret ?" (with warnings above)" :"" ); +printf ("lx2160a serdes: the two retimers need different CDR rates -- U21 25.78125, U25 10.3125 Gbd\n" ); + +return ret; +} +/* * setenv hwconfig serdes1:100g4x25g * setenv hwconfig serdes1:2x40g +* setenv hwconfig serdes1:40g4x10g +* setenv hwconfig serdes1:100g4x10g * * Idempotent: a board whose PBI already split SD1 skip it too. * -* The two are mutually exclusive -- one re-points lanes 4-7 to 25G on -* PLLF, the other moves all eight to 40GE on PLLS -- so `split` wins -* and `40g` is refused alongside it rather than layered on top. +* All four are mutually exclusive, they are target STATES of the same +* eight lanes, not steps to be combined. So the first match wins and +* the rest are reported and ignored rather than layered on top. */ void lx2160a_serdes_apply_hwconfig (void ) {if (hwconfig_sub ("serdes1" ,"100g4x25g" )) {if (hwconfig_sub ("serdes1" ,"2x40g" ) || -hwconfig_sub ("serdes1" ,"40g4x10g" )) -printf ("lx2160a serdes: hwconfig asks for serdes1:100g4x25g alongside a 40GE mode, doing the split only\n" ); +hwconfig_sub ("serdes1" ,"40g4x10g" ) || +hwconfig_sub ("serdes1" ,"100g4x10g" )) +printf ("lx2160a serdes: hwconfig asks for serdes1:100g4x25g alongside another mode, doing the split only\n" );if (lx2160a_serdes1_is_split ())return ;
@@ -756,6 +917,19 @@ void lx2160a_serdes_apply_hwconfig(void)return ; } +/* +* serdes1:100g4x10g keeps lanes 0-3 as the 100GE the RCW built and +* moves only lanes 4-7 to 10G, so it is a single step from the +* protocol-13 state, no 40GE detour, unlike serdes1:40g4x10g below. +*/ +if (hwconfig_sub ("serdes1" ,"100g4x10g" )) { +if (lx2160a_serdes1_is_100g_4x10g ()) +return ; + +lx2160a_serdes1_100g_4x10g (); +return ; + } +/* * serdes1:40g4x10g is a target MODE, not a second step the user has * to sequence by hand: it implies the 40GE conversion first,
@@ -853,6 +1027,22 @@ static int do_lx2160_sd1(struct cmd_tbl *cmdtp, int flag,return CMD_RET_SUCCESS ; } +if (!strcmp (argv[1 ],"100g4x10g" )) { +if (!IS_ENABLED (CONFIG_ARCH_LX2160A )) { +printf ("no 100GE on SerDes 1 to split on this SoC\n" ); +return CMD_RET_FAILURE ; + } +if (argc !=2 ) +return CMD_RET_USAGE ; +if (lx2160a_serdes1_is_100g_4x10g ()) { +printf ("SD1 is already 1x 100GE + 4x 10G, nothing to do\n" ); +return CMD_RET_SUCCESS ; + } +if (lx2160a_serdes1_100g_4x10g ()) +return CMD_RET_FAILURE ; +return CMD_RET_SUCCESS ; + } +return CMD_RET_USAGE ; }
@@ -899,7 +1089,12 @@ static int do_lx2160_serdes(struct cmd_tbl *cmdtp, int flag," Undo with `reset`. Permanent: setenv hwconfig serdes1:2x40g\n" \"lx2160_sd1 40g4x10g\n" \" - split SD1's dpmac.1 40GE port into 4x 10G,\n" \ - " Permanent: setenv hwconfig serdes1:40g4x10g (implies 2x40g)" +" Permanent: setenv hwconfig serdes1:40g4x10g (implies 2x40g)\n" \ +"lx2160_sd1 100g4x10g\n" \ +" - keep dpmac.2 as 100GE on lanes 0-3 (PLLF, 25.78125 Gbaud)\n" \ +" and make lanes 4-7 four 10G ports (dpmac.3-6) on PLLS at\n" \ +" 10.3125 Gbaud.\n" \ + " Permanent: setenv hwconfig serdes1:100g4x10g"#else #define SD1_CMD_HELP \ " - no SerDes 1 Ethernet modes on this SoC"
board/nxp/lx2160a/serdes_split.h +11 -0
@@ -45,6 +45,17 @@ bool lx2160a_serdes1_is_40g_4x10g(void);*/ int lx2160a_serdes1_40g_4x10g (void ); +/* Is SerDes 1 already 1x 100GE + 4x 10G? */ +bool lx2160a_serdes1_is_100g_4x10g (void ); + +/* +* Keep lanes 0-3 as the 100GE port and change the lanes 4-7 +* into 4x 10G ports (dpmac.3-6). +* +* It refuses unless SD1 is in the 2x 100GE state +*/ +int lx2160a_serdes1_100g_4x10g (void ); +void lx2160a_serdes_apply_hwconfig (void );#endif /* __LX2160A_SERDES_SPLIT_H */
Signature · 1 line
2.43.0
PATCH v3 5/5 doc: lx2160a: SerDes 1 runtime lane grouping
In reply to Vincent JardinAdd the 'serdes1' hwconfig option to README.fsl-hwconfig and a short note to the Layerscape README.soc.
---
(no changes since v1)
.../cpu/armv8/fsl-layerscape/doc/README.soc | 10 ++++++++ doc/README.fsl-hwconfig | 25 +++++++++++++++++++ 2 files changed, 35 insertions(+)
arch/arm/cpu/armv8/fsl-layerscape/doc/README.soc +10 -0
@@ -332,6 +332,16 @@ LX2160A SoC has 2 more similar SoC personalities a) Eight 64-bit ARM v8 Cortex-A72 CPUs +SerDes 1 runtime lane grouping + The SerDes 1 protocol selected by the RCW (SRDS_PRTCL_S1) is latched + at reset and cannot be changed afterwards. On the LX2160A boards under + board/nxp/lx2160a/, U-Boot can nevertheless re-group the eight SerDes 1 + lanes before the management complex starts: 2x 100GE can become + 1x 100GE + 4x 25G, 2x 40GE, 1x 40GE + 4x 10G or 1x 100GE + 4x 10G. + See the 'lx2160_sd1' and 'lx2160_serdes' commands and the 'serdes1' + option in doc/README.fsl-hwconfig. + + LS1028A -------- The QorIQ LS1028A processor integrates two 64-bit Arm Cortex-A72 cores with
doc/README.fsl-hwconfig +25 -0
@@ -44,3 +44,28 @@ usb usb1:dr_mode=host;usb2:dr_mode=peripheral' usb1:dr_mode=host,phy_type=utmi;usb2:dr_mode=host' + +serdes1 + Specific to the LX2160A boards under board/nxp/lx2160a/. + + This option re-groups the eight lanes of SerDes 1 at boot, before + the DPAA2 management complex latches the protocol converters. The + RCW-selected SerDes 1 protocol (SRDS_PRTCL_S1) is latched at reset + and cannot be changed; these modes change what the lanes carry + while keeping that protocol number. The same modes are available + at the prompt through the 'lx2160_sd1' command, and 'lx2160_serdes + status' shows the resulting lane grouping. + + 'serdes1:100g4x25g' + 2x 100GE -> 1x 100GE + 4x 25G + + 'serdes1:2x40g' + 2x 100GE -> 2x 40GE + + 'serdes1:40g4x10g' + 1x 40GE + 4x 10G (converts to 2x 40GE first if needed) + + 'serdes1:100g4x10g' + 1x 100GE + 4x 10G + + Only one of them applies; '100g4x25g' wins if several are given.
Signature · 1 line
2.43.0
Re: [PATCH v3 5/5] doc: lx2160a: SerDes 1 runtime lane grouping
Quoted 69 lines · Vincent Jardin
Add the 'serdes1' hwconfig option to README.fsl-hwconfig and a short note to the Layerscape README.soc.
Signed-off-by Vincent Jardin <[email protected]>---
(no changes since v1)
.../cpu/armv8/fsl-layerscape/doc/README.soc | 10 ++++++++ doc/README.fsl-hwconfig | 25 +++++++++++++++++++ 2 files changed, 35 insertions(+)arch/arm/cpu/armv8/fsl-layerscape/doc/README.soc +10
-0@@ -332,6 +332,16 @@ LX2160A SoC has 2 more similar SoC personalities a) Eight 64-bit ARM v8 Cortex-A72 CPUs +SerDes 1 runtime lane grouping + The SerDes 1 protocol selected by the RCW (SRDS_PRTCL_S1) is latched + at reset and cannot be changed afterwards. On the LX2160A boards under + board/nxp/lx2160a/, U-Boot can nevertheless re-group the eight SerDes 1 + lanes before the management complex starts: 2x 100GE can become + 1x 100GE + 4x 25G, 2x 40GE, 1x 40GE + 4x 10G or 1x 100GE + 4x 10G. + See the 'lx2160_sd1' and 'lx2160_serdes' commands and the 'serdes1' + option in doc/README.fsl-hwconfig. + + LS1028A -------- The QorIQ LS1028A processor integrates two 64-bit Arm Cortex-A72 cores withdoc/README.fsl-hwconfig +25
-0@@ -44,3 +44,28 @@ usb usb1:dr_mode=host;usb2:dr_mode=peripheral' usb1:dr_mode=host,phy_type=utmi;usb2:dr_mode=host' + +serdes1 + Specific to the LX2160A boards under board/nxp/lx2160a/. + + This option re-groups the eight lanes of SerDes 1 at boot, before + the DPAA2 management complex latches the protocol converters. The + RCW-selected SerDes 1 protocol (SRDS_PRTCL_S1) is latched at reset + and cannot be changed; these modes change what the lanes carry + while keeping that protocol number. The same modes are available + at the prompt through the 'lx2160_sd1' command, and 'lx2160_serdes + status' shows the resulting lane grouping. + + 'serdes1:100g4x25g' + 2x 100GE -> 1x 100GE + 4x 25G + + 'serdes1:2x40g' + 2x 100GE -> 2x 40GE + + 'serdes1:40g4x10g' + 1x 40GE + 4x 10G (converts to 2x 40GE first if needed) + + 'serdes1:100g4x10g' + 1x 100GE + 4x 10G + + Only one of them applies; '100g4x25g' wins if several are given.Signature · 1 line
2.43.0
This is way under-specified - lx2160a_serdes_apply_hwconfig() cannot fulfill the hwconfig setting from any initial conditions, but you do not mention what the expected initial conditions are (initial SRDS_PRTCL_S1 value and PLL refclk frequencies).
The current documentation reads as if the hwconfig can always be fulfilled, which is misleading and false.