TI/Cadence: Add Sierra/Torrent SERDES driver
Subsystems (5)
v4 cover TI/Cadence: Add Sierra/Torrent SERDES driver
Patch series adds Sierra and Torrent SERDES driver for the SERDES used in TI's K3 platforms. This SERDES is used by USB3, PCIe and Ethernet. This series is mostly an adaptation of drivers added in upstream Linux kernel.
Changes from v3:
1) Dropped "drivers: reset: Handle gracefully NULL pointers" and added "drivers: reset: Add devm_to_reset() to return dummy "struct reset_ctl"
2) Moved documentation from board/ti/j721e/README to doc/board/ti/j721e_evm.rst
3) Adapted Sierra and Torrent driver to 1).
Changes from v2:
1) Re-worked "Handle gracefully NULL pointers" to fix Simons comments
2) Ported the part that allows creating clocks without explicit sub-nodes in DT from the upstream linux kernel.
Changes from v1:
1) Fixed string comparison strncmp() to remove "=="
2) Added a test for node name comparison to ignore unit address in test/dm
3) Added better commit message in "drivers: reset: Handle gracefully NULL pointers"
Alan Douglas (1):
phy: cadence: Add driver for Sierra PHY
Aswath Govindraju (7):
dt-bindings: phy: Add definitions for additional phy types
phy: cadence: Add driver for Torrent SERDES
board: ti: j721e: Add support for probing and configuring Torrent
serdes on J7200
arm: dts: k3-j7200-main: Add DT node for torrent serdes
arm: dts: k3-j7200-common-proc-board: Enable SERDES DT
arm: dts: k3-j7200-common-proc-board-u-boot: Add u-boot tags for
torrent serdes
configs: j7200_evm_a72_defconfig: Add config for torrent serdes and
common clock framework
Jean-Jacques Hiblot (2):
phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC
configs: j721e_evm_a72: Enable the drivers required for the USB3
support
Kishon Vijay Abraham I (11):
drivers: reset: Add devm_to_reset() to return dummy "struct reset_ctl"
dm: core: Add helper to compare node names
dm: test: Add test case to check node name ignoring unit address
dt-bindings: phy: Add defines for AM64 SERDES Wrapper
dt-bindings: phy: cadence-torrent: Add defines for refclk driver
dt-bindings: ti-serdes-mux: Add defines for AM64 SoC
ARM: dts: k3-j721e: Add support for USB3 in USB0 instance
env: ti: j721e-evm: Add env variable to power on & reset QSGMII PHY in
J7200 EVM
configs: j7200_evm_a72: Add CONFIG_PREBOOT to configure ethernet PHY
doc: board: Move j721e document to doc/board/ti/ directory
doc: board: j721e_evm: Add documentation for firmware loading
.../k3-j7200-common-proc-board-u-boot.dtsi | 12 + arch/arm/dts/k3-j7200-common-proc-board.dts | 23 + arch/arm/dts/k3-j7200-main.dtsi | 63 + .../k3-j721e-common-proc-board-u-boot.dtsi | 19 +- board/ti/j721e/README | 277 -- board/ti/j721e/evm.c | 34 +- configs/j7200_evm_a72_defconfig | 8 + configs/j721e_evm_a72_defconfig | 6 + doc/board/index.rst | 1 + doc/board/ti/j721e_evm.rst | 331 +++ drivers/core/ofnode.c | 13 + drivers/phy/Kconfig | 3 + drivers/phy/Makefile | 2 + drivers/phy/cadence/Kconfig | 11 + drivers/phy/cadence/Makefile | 2 + drivers/phy/cadence/phy-cadence-sierra.c | 765 +++++ drivers/phy/cadence/phy-cadence-torrent.c | 2477 +++++++++++++++++ drivers/phy/ti/Kconfig | 9 + drivers/phy/ti/Makefile | 1 + drivers/phy/ti/phy-j721e-wiz.c | 1156 ++++++++ drivers/reset/reset-uclass.c | 16 + drivers/reset/sandbox-reset-test.c | 4 +- include/configs/j721e_evm.h | 16 +- include/dm/ofnode.h | 10 + include/dt-bindings/mux/ti-serdes.h | 5 + include/dt-bindings/phy/phy-cadence.h | 20 + include/dt-bindings/phy/phy-ti.h | 21 + include/dt-bindings/phy/phy.h | 1 + include/reset.h | 17 + test/dm/core.c | 14 + 30 files changed, 5056 insertions(+), 281 deletions(-) delete mode 100644 board/ti/j721e/README create mode 100644 doc/board/ti/j721e_evm.rst create mode 100644 drivers/phy/cadence/Kconfig create mode 100644 drivers/phy/cadence/Makefile create mode 100644 drivers/phy/cadence/phy-cadence-sierra.c create mode 100644 drivers/phy/cadence/phy-cadence-torrent.c create mode 100644 drivers/phy/ti/Kconfig create mode 100644 drivers/phy/ti/Makefile create mode 100644 drivers/phy/ti/phy-j721e-wiz.c create mode 100644 include/dt-bindings/phy/phy-cadence.h create mode 100644 include/dt-bindings/phy/phy-ti.h
Signature · 1 line
2.17.1
PATCH v4 1/21 drivers: reset: Add devm_to_reset() to return dummy "struct reset_ctl"
Add devm_to_reset() to return dummy "struct reset_ctl", useful for invoking reset APIs which doesn't have a valid "struct reset_ctl".
--- drivers/reset/reset-uclass.c | 16 ++++++++++++++++ drivers/reset/sandbox-reset-test.c | 4 +++- include/reset.h | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-)
drivers/reset/reset-uclass.c +16 -0
@@ -15,6 +15,8 @@#include <dm/devres.h> #include <dm/lists.h> +static struct reset_ctl devm_no_reset; +static inline struct reset_ops *reset_dev_ops (struct udevice *dev) {return (struct reset_ops *)dev->driver->ops;
@@ -256,6 +258,20 @@ int reset_release_all(struct reset_ctl *reset_ctl, int count)return 0 ; } +int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp) +{ +if (IS_ERR_OR_NULL (in)) { + *outp = &devm_no_reset; +if (!in) +return -ENOENT ; +else +return PTR_ERR (in); + } + *outp = in; + +return 0 ; +} +static void devm_reset_release (struct udevice *dev,void *res) {reset_free (res);
drivers/reset/sandbox-reset-test.c +3 -1
@@ -32,13 +32,15 @@ int sandbox_reset_test_get_devm(struct udevice *dev) {struct sandbox_reset_test *sbrt =dev_get_priv (dev);struct reset_ctl *r; +int ret; r =devm_reset_control_get (dev,"not-a-valid-reset-ctl" );if (!IS_ERR (r))return -EINVAL ; r =devm_reset_control_get_optional (dev,"not-a-valid-reset-ctl" ); -if (r) + ret =devm_to_reset (r, &r); +if (reset_valid (r))return -EINVAL ; sbrt->ctlp =devm_reset_control_get (dev,"test" );
include/reset.h +17 -0
@@ -341,6 +341,18 @@ int reset_status(struct reset_ctl *reset_ctl);*/ int reset_release_all (struct reset_ctl *reset_ctl,int count); +/** +* devm_to_reset - Provide a dummy reset_ctl for invalid reset_ctl +* +* Provide a dummy reset_ctl for invalid reset_ctl or give the same +* input reset_ctl +* +* @in: Input reset_ctl returned by devm_reset_control_get() +* @outp: Dummy reset_ctl for invalid reset_ctl or Input reset_ctl +* @return 0 if OK, or a negative error code. +*/ +int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp); +/** * reset_release_bulk - Assert/Free an array of previously requested reset * signals in a reset control bulk struct.
@@ -456,6 +468,11 @@ static inline int reset_release_bulk(struct reset_ctl_bulk *bulk) {return 0 ; } + +static inline int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp) +{ +return 0 ; +}#endif /**
Signature · 1 line
2.17.1
Re: [PATCH v4 01/21] drivers: reset: Add devm_to_reset() to return dummy "struct reset_ctl"
Hi Kishon,
Quoted 26 lines · Kishon Vijay Abraham I
Add
devm_to_reset()to return dummy "structreset_ctl", useful for invoking reset APIs which doesn't have a valid "structreset_ctl".Suggested-by Simon Glass <[email protected]>Signed-off-by Kishon Vijay Abraham I <[email protected]>--- drivers/reset/reset-uclass.c | 16 ++++++++++++++++ drivers/reset/sandbox-reset-test.c | 4 +++- include/reset.h | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-)drivers/reset/reset-uclass.c +2
-0@@ -15,6 +15,8 @@#include <dm/devres.h> #include <dm/lists.h> +static struct reset_ctl devm_no_reset; +static inline struct reset_ops *reset_dev_ops (struct udevice *dev) {return (struct reset_ops *)dev->driver->ops;
drivers/reset/reset-uclass.c int reset_release_all(struct reset_ctl *reset_ctl, int count) · line 264
Quoted 7 lines
drivers/reset/reset-uclass.c +4
-0@@ -256,6 +258,20 @@ int reset_release_all(struct reset_ctl *reset_ctl, int count)return 0 ; } +int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp) +{ +if (IS_ERR_OR_NULL (in)) { + *outp = &devm_no_reset;
This var ends up in BSS so won't work in early SPL / pre-relocation in U-Boot. Please add a priv_auto struct in the UCLASS_DRIVER() and put this value in there.
drivers/reset/sandbox-reset-test.c int sandbox_reset_test_get_devm(struct udevice *dev)
Quoted 18 lines
drivers/reset/reset-uclass.c +10
-0+if (!in) +return -ENOENT ; +else +return PTR_ERR (in); + } + *outp = in; + +return 0 ; +} +static void devm_reset_release (struct udevice *dev,void *res) {reset_free (res);drivers/reset/sandbox-reset-test.c +0
-0@@ -32,13 +32,15 @@ int sandbox_reset_test_get_devm(struct udevice *dev)
Can this function move into the test itself? It seems strange for it to be here.
Quoted 4 lines
drivers/reset/sandbox-reset-test.c +1
-0{struct sandbox_reset_test *sbrt =dev_get_priv (dev);struct reset_ctl *r; +int ret;
drivers/reset/sandbox-reset-test.c int sandbox_reset_test_get_devm(struct udevice *dev) · line 44
Quoted 10 lines
drivers/reset/sandbox-reset-test.c +2
-1r =devm_reset_control_get (dev,"not-a-valid-reset-ctl" );if (!IS_ERR (r))return -EINVAL ; r =devm_reset_control_get_optional (dev,"not-a-valid-reset-ctl" ); -if (r) + ret =devm_to_reset (r, &r); +if (reset_valid (r))return -EINVAL ;
Can you not do:
if (ret)
return ret;
?
include/reset.h int reset_status(struct reset_ctl *reset_ctl); · line 345
Quoted 12 lines
drivers/reset/sandbox-reset-test.c +0
-0sbrt->ctlp =devm_reset_control_get (dev,"test" );include/reset.h +2
-0@@ -341,6 +341,18 @@ int reset_status(struct reset_ctl *reset_ctl);*/ int reset_release_all (struct reset_ctl *reset_ctl,int count); +/** +* devm_to_reset - Provide a dummy reset_ctl for invalid reset_ctl
Returns the reset_ctl to use for a devm reset?
include/reset.h int reset_status(struct reset_ctl *reset_ctl); · line 351
Quoted 6 lines
include/reset.h +6
-0+* +* Provide a dummy reset_ctl for invalid reset_ctl or give the same +* input reset_ctl +* +* @in: Input reset_ctl returned by devm_reset_control_get() +* @outp: Dummy reset_ctl for invalid reset_ctl or Input reset_ctl
Put the positive case first.
Returns @in if valid. If not valid, returns a dummy reset_ctl for which reset_valid() will always return false.
include/reset.h int reset_status(struct reset_ctl *reset_ctl); · line 352
Quoted 1 line
include/reset.h +1
-0+* @return 0 if OK, or a negative error code.
Please document what specific errors this returns as this is important.
Quoted 7 lines
include/reset.h +3
-0+*/ +int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp); +/** * reset_release_bulk - Assert/Free an array of previously requested reset * signals in a reset control bulk struct.
include/reset.h static inline int reset_release_bulk(struct reset_ctl_bulk *bulk) · line 474
Quoted 7 lines
include/reset.h +4
-0@@ -456,6 +468,11 @@ static inline int reset_release_bulk(struct reset_ctl_bulk *bulk) {return 0 ; } + +static inline int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp) +{ +return 0 ;
That indicates success but *outp is not set. Is that OK? Should you return -ENOSYS, or maybe set *outp to something?
Quoted 7 lines
include/reset.h +1
-1+}#endif /** -- 2.17.1
Regards,
Simon
Re: [PATCH v4 01/21] drivers: reset: Add devm_to_reset() to return dummy "struct reset_ctl"
Hi Simon,
Quoted 32 lines · Simon Glass
Hi Kishon,
Quoted 29 lines · Kishon Vijay Abraham I
Add
devm_to_reset()to return dummy "structreset_ctl", useful for invoking reset APIs which doesn't have a valid "structreset_ctl".Suggested-by Simon Glass <[email protected]>Signed-off-by Kishon Vijay Abraham I <[email protected]>--- drivers/reset/reset-uclass.c | 16 ++++++++++++++++ drivers/reset/sandbox-reset-test.c | 4 +++- include/reset.h | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-)drivers/reset/reset-uclass.c +2
-0@@ -15,6 +15,8 @@#include <dm/devres.h> #include <dm/lists.h> +static struct reset_ctl devm_no_reset; +static inline struct reset_ops *reset_dev_ops (struct udevice *dev) {return (struct reset_ops *)dev->driver->ops;@@ -256,6 +258,20 @@ int reset_release_all(struct reset_ctl *reset_ctl, int count)return 0 ; }
Quoted 8 lines
drivers/reset/reset-uclass.c int reset_release_all(struct reset_ctl *reset_ctl, int count) · line 264
Quoted 4 lines
drivers/reset/reset-uclass.c +4
-0+int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp) +{ +if (IS_ERR_OR_NULL (in)) { + *outp = &devm_no_reset;This var ends up in BSS so won't work in early SPL / pre-relocation in U-Boot. Please add a
priv_autostruct in theUCLASS_DRIVER()and put this value in there.
Sure.
Quoted 13 lines
Quoted 13 lines
drivers/reset/reset-uclass.c +10
-0+if (!in) +return -ENOENT ; +else +return PTR_ERR (in); + } + *outp = in; + +return 0 ; +} +static void devm_reset_release (struct udevice *dev,void *res) {
Quoted 8 lines
drivers/reset/sandbox-reset-test.c int sandbox_reset_test_get_devm(struct udevice *dev)
Quoted 6 lines
drivers/reset/reset-uclass.c +0
-0reset_free (res);drivers/reset/sandbox-reset-test.c +0
-0@@ -32,13 +32,15 @@ int sandbox_reset_test_get_devm(struct udevice *dev)Can this function move into the test itself? It seems strange for it to be here.
You mean merge drivers/reset/sandbox-reset-test.c to test/dm/reset.c?
Quoted 16 lines
Quoted 5 lines
drivers/reset/sandbox-reset-test.c +1
-0{struct sandbox_reset_test *sbrt =dev_get_priv (dev);struct reset_ctl *r; +int ret;drivers/reset/sandbox-reset-test.c int sandbox_reset_test_get_devm(struct udevice *dev) · line 44
Quoted 10 lines
drivers/reset/sandbox-reset-test.c +2
-1r =devm_reset_control_get (dev,"not-a-valid-reset-ctl" );if (!IS_ERR (r))return -EINVAL ; r =devm_reset_control_get_optional (dev,"not-a-valid-reset-ctl" ); -if (r) + ret =devm_to_reset (r, &r); +if (reset_valid (r))return -EINVAL ;
Quoted 6 lines
Can you not do:
if (ret)
return ret;?
For a reset that doesn't exist (where we return devm_no_reset), the return value is still going to be a negative value. We should probably change the check to
if (ret && reset_valid(r))
return -EINVAL;
Quoted 41 lines
include/reset.h int reset_status(struct reset_ctl *reset_ctl); · line 345
Quoted 13 lines
drivers/reset/sandbox-reset-test.c +0
-0sbrt->ctlp =devm_reset_control_get (dev,"test" );include/reset.h +2
-0@@ -341,6 +341,18 @@ int reset_status(struct reset_ctl *reset_ctl);*/ int reset_release_all (struct reset_ctl *reset_ctl,int count); +/** +* devm_to_reset - Provide a dummy reset_ctl for invalid reset_ctl Returns the
reset_ctlto use for a devm reset?include/reset.h int reset_status(struct reset_ctl *reset_ctl); · line 351
Quoted 6 lines
include/reset.h +6
-0+* +* Provide a dummy reset_ctl for invalid reset_ctl or give the same +* input reset_ctl +* +* @in: Input reset_ctl returned by devm_reset_control_get() +* @outp: Dummy reset_ctl for invalid reset_ctl or Input reset_ctl Put the positive case first.
Returns @in if valid. If not valid, returns a dummy
reset_ctlfor whichreset_valid()will always return false.include/reset.h int reset_status(struct reset_ctl *reset_ctl); · line 352
Quoted 1 line
include/reset.h +1
-0+* @return 0 if OK, or a negative error code. Please document what specific errors this returns as this is important.
Quoted 9 lines
include/reset.h +3
-0+*/ +int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp); +/** * reset_release_bulk - Assert/Free an array of previously requested reset * signals in a reset control bulk struct. @@ -456,6 +468,11 @@ static inline int reset_release_bulk(struct reset_ctl_bulk *bulk) {return 0 ;
Quoted 8 lines
include/reset.h static inline int reset_release_bulk(struct reset_ctl_bulk *bulk) · line 474
Quoted 5 lines
include/reset.h +4
-0} + +static inline int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp) +{ +return 0 ;That indicates success but *outp is not set. Is that OK? Should you return
-ENOSYS, or maybe set *outp to something?
yeah, return 0 and *outp to something looks correct.
Thanks
Kishon
Re: [PATCH v4 01/21] drivers: reset: Add devm_to_reset() to return dummy "struct reset_ctl"
Hi Kishon,
Quoted 68 lines · Kishon Vijay Abraham I
Hi Simon,
Quoted 32 lines · Simon Glass
Hi Kishon,
Quoted 29 lines · Kishon Vijay Abraham I
Add
devm_to_reset()to return dummy "structreset_ctl", useful for invoking reset APIs which doesn't have a valid "structreset_ctl".Suggested-by Simon Glass <[email protected]>Signed-off-by Kishon Vijay Abraham I <[email protected]>--- drivers/reset/reset-uclass.c | 16 ++++++++++++++++ drivers/reset/sandbox-reset-test.c | 4 +++- include/reset.h | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-)drivers/reset/reset-uclass.c +2
-0@@ -15,6 +15,8 @@#include <dm/devres.h> #include <dm/lists.h> +static struct reset_ctl devm_no_reset; +static inline struct reset_ops *reset_dev_ops (struct udevice *dev) {return (struct reset_ops *)dev->driver->ops;@@ -256,6 +258,20 @@ int reset_release_all(struct reset_ctl *reset_ctl, int count)return 0 ; }Quoted 8 lines
drivers/reset/reset-uclass.c int reset_release_all(struct reset_ctl *reset_ctl, int count) · line 264
Quoted 4 lines
drivers/reset/reset-uclass.c +4
-0+int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp) +{ +if (IS_ERR_OR_NULL (in)) { + *outp = &devm_no_reset;This var ends up in BSS so won't work in early SPL / pre-relocation in U-Boot. Please add a
priv_autostruct in theUCLASS_DRIVER()and put this value in there.Sure.
Quoted 13 lines
Quoted 13 lines
drivers/reset/reset-uclass.c +10
-0+if (!in) +return -ENOENT ; +else +return PTR_ERR (in); + } + *outp = in; + +return 0 ; +} +static void devm_reset_release (struct udevice *dev,void *res) {Quoted 8 lines
drivers/reset/sandbox-reset-test.c int sandbox_reset_test_get_devm(struct udevice *dev)
Quoted 6 lines
drivers/reset/reset-uclass.c +0
-0reset_free (res);drivers/reset/sandbox-reset-test.c +0
-0@@ -32,13 +32,15 @@ int sandbox_reset_test_get_devm(struct udevice *dev)Can this function move into the test itself? It seems strange for it to be here.
Quoted 1 line
You mean merge
drivers/reset/sandbox-reset-test.ctotest/dm/reset.c?
Just the sandbox_reset_test_get_devm() function. It doesn't seem to need to be in the driver, but I may be wrong.
Quoted 21 lines
Quoted 21 lines
Quoted 5 lines
drivers/reset/sandbox-reset-test.c +1
-0{struct sandbox_reset_test *sbrt =dev_get_priv (dev);struct reset_ctl *r; +int ret;drivers/reset/sandbox-reset-test.c int sandbox_reset_test_get_devm(struct udevice *dev) · line 44
Quoted 10 lines
drivers/reset/sandbox-reset-test.c +2
-1r =devm_reset_control_get (dev,"not-a-valid-reset-ctl" );if (!IS_ERR (r))return -EINVAL ; r =devm_reset_control_get_optional (dev,"not-a-valid-reset-ctl" ); -if (r) + ret =devm_to_reset (r, &r); +if (reset_valid (r))return -EINVAL ;Can you not do:
if (ret)
return ret;
Quoted 8 lines
Quoted 1 line
?
For a reset that doesn't exist (where we return
devm_no_reset), the return value is still going to be a negative value. We should probably change the check toif (ret &&
reset_valid(r))return -EINVAL;
Well when you add comments about the return value to devm_to_reset() I will understand this better :-)
But ret must be zero if the reset is valid and non-zero if not, right? So why return a different error from the one that occured? That will make it harder for people to figure out.
Also, I suggest using
return log_msg_ret("something", ret)
so we can get logging to show where the error was originated.
Quoted 50 lines
Quoted 41 lines
include/reset.h int reset_status(struct reset_ctl *reset_ctl); · line 345
Quoted 13 lines
drivers/reset/sandbox-reset-test.c +0
-0sbrt->ctlp =devm_reset_control_get (dev,"test" );include/reset.h +2
-0@@ -341,6 +341,18 @@ int reset_status(struct reset_ctl *reset_ctl);*/ int reset_release_all (struct reset_ctl *reset_ctl,int count); +/** +* devm_to_reset - Provide a dummy reset_ctl for invalid reset_ctl Returns the
reset_ctlto use for a devm reset?include/reset.h int reset_status(struct reset_ctl *reset_ctl); · line 351
Quoted 6 lines
include/reset.h +6
-0+* +* Provide a dummy reset_ctl for invalid reset_ctl or give the same +* input reset_ctl +* +* @in: Input reset_ctl returned by devm_reset_control_get() +* @outp: Dummy reset_ctl for invalid reset_ctl or Input reset_ctl Put the positive case first.
Returns @in if valid. If not valid, returns a dummy
reset_ctlfor whichreset_valid()will always return false.include/reset.h int reset_status(struct reset_ctl *reset_ctl); · line 352
Quoted 1 line
include/reset.h +1
-0+* @return 0 if OK, or a negative error code. Please document what specific errors this returns as this is important.
Quoted 9 lines
include/reset.h +3
-0+*/ +int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp); +/** * reset_release_bulk - Assert/Free an array of previously requested reset * signals in a reset control bulk struct. @@ -456,6 +468,11 @@ static inline int reset_release_bulk(struct reset_ctl_bulk *bulk) {return 0 ;Quoted 8 lines
include/reset.h static inline int reset_release_bulk(struct reset_ctl_bulk *bulk) · line 474
Quoted 5 lines
include/reset.h +4
-0} + +static inline int devm_to_reset (struct reset_ctl *in,struct reset_ctl **outp) +{ +return 0 ;That indicates success but *outp is not set. Is that OK? Should you return
-ENOSYS, or maybe set *outp to something?
Quoted 1 line
yeah, return 0 and *outp to something looks correct.
OK
Regards,
Simon
PATCH v4 2/21 dm: core: Add helper to compare node names
In reply to Kishon Vijay Abraham IAdd helper to compare node names.
--- drivers/core/ofnode.c | 13 +++++++++++++ include/dm/ofnode.h | 10 ++++++++++ 2 files changed, 23 insertions(+)
drivers/core/ofnode.c +13 -0
@@ -18,6 +18,19 @@#include <linux/ioport.h> #include <asm/global_data.h> +bool ofnode_name_eq (ofnode node,const char *name) +{ +const char *node_name; +size_t len; + +assert (ofnode_valid (node)); + + node_name =ofnode_get_name (node); + len =strchrnul (node_name,'@' ) - node_name; + +return (strlen (name) == len) && !strncmp (node_name, name, len); +} +int ofnode_read_u32 (ofnode node,const char *propname,u32 *outp) {return ofnode_read_u32_index (node, propname,0 , outp);
include/dm/ofnode.h +10 -0
@@ -231,6 +231,16 @@ static inline ofnode ofnode_root(void)return node; } +/** +* ofnode_name_eq() - Check if the node name is equivalent to a given name +* ignoring the unit address +* +* @node: valid node reference that has to be compared +* @name: name that has to be compared with the node name +* @return true if matches, false if it doesn't match +*/ +bool ofnode_name_eq (ofnode node,const char *name); +/** * ofnode_read_u32() - Read a 32-bit integer from a property *
Signature · 1 line
2.17.1
PATCH v4 3/21 dm: test: Add test case to check node name ignoring unit address
In reply to Kishon Vijay Abraham IAdd test to check node name ignoring unit address.
--- test/dm/core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
test/dm/core.c +14 -0
@@ -177,6 +177,20 @@ static int dm_test_autobind_uclass_pdata_alloc(struct unit_test_state *uts) }DM_TEST (dm_test_autobind_uclass_pdata_alloc,UT_TESTF_SCAN_PDATA ); +/* compare node names ignoring the unit address */ +static int dm_test_compare_node_name (struct unit_test_state *uts) +{ +ofnode node; + + node =ofnode_path ("/mmio-bus@0" ); +ut_assert (ofnode_valid (node)); +ut_assert (ofnode_name_eq (node,"mmio-bus" )); + +return 0 ; +} + +DM_TEST (dm_test_compare_node_name,UT_TESTF_SCAN_PDATA ); +/* Test that binding with uclass plat setting occurs correctly */ static int dm_test_autobind_uclass_pdata_valid (struct unit_test_state *uts) {
Signature · 1 line
2.17.1
PATCH v4 4/21 dt-bindings: phy: Add definitions for additional phy types
In reply to Kishon Vijay Abraham IFrom: Aswath Govindraju <[email protected]>
Add definitions for additional phy types that's used specifically for Torrent SERDES.
--- include/dt-bindings/phy/phy.h | 1 + 1 file changed, 1 insertion(+)
include/dt-bindings/phy/phy.h +1 -0
@@ -19,5 +19,6 @@#define PHY_TYPE_DP 6#define PHY_TYPE_XPCS 7#define PHY_TYPE_SGMII 8 +#define PHY_TYPE_QSGMII 9#endif /* _DT_BINDINGS_PHY */
Signature · 1 line
2.17.1
PATCH v4 5/21 dt-bindings: phy: Add defines for AM64 SERDES Wrapper
In reply to Kishon Vijay Abraham IAdd defines for AM64 SERDES Wrapper.
--- include/dt-bindings/phy/phy-ti.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/dt-bindings/phy/phy-ti.h
include/dt-bindings/phy/phy-ti.h new file +21 -0
@@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* This header provides constants for TI SERDES. +*/ + +#ifndef _DT_BINDINGS_TI_SERDES +#define _DT_BINDINGS_TI_SERDES + +/* Clock index for output clocks from WIZ */ + +/* MUX Clocks */ +#define TI_WIZ_PLL0_REFCLK 0 +#define TI_WIZ_PLL1_REFCLK 1 +#define TI_WIZ_REFCLK_DIG 2 + +/* Reserve index here for future additions */ + +/* MISC Clocks */ +#define TI_WIZ_PHY_EN_REFCLK 16 + +#endif /* _DT_BINDINGS_TI_SERDES */
Signature · 1 line
2.17.1
PATCH v4 6/21 dt-bindings: phy: cadence-torrent: Add defines for refclk driver
In reply to Kishon Vijay Abraham IAdd defines for refclk driver used to route the refclk out of torrent SERDES.
--- include/dt-bindings/phy/phy-cadence.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 include/dt-bindings/phy/phy-cadence.h
include/dt-bindings/phy/phy-cadence.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* This header provides constants for Cadence SERDES. +*/ + +#ifndef _DT_BINDINGS_CADENCE_SERDES_H +#define _DT_BINDINGS_CADENCE_SERDES_H + +/* Torrent */ +#define TORRENT_SERDES_NO_SSC 0 +#define TORRENT_SERDES_EXTERNAL_SSC 1 +#define TORRENT_SERDES_INTERNAL_SSC 2 + +#define CDNS_TORRENT_REFCLK_DRIVER 0 + +/* Sierra */ +#define CDNS_SIERRA_PLL_CMNLC 0 +#define CDNS_SIERRA_PLL_CMNLC1 1 + +#endif /* _DT_BINDINGS_CADENCE_SERDES_H */
Signature · 1 line
2.17.1
PATCH v4 7/21 dt-bindings: ti-serdes-mux: Add defines for AM64 SoC
In reply to Kishon Vijay Abraham IAM64 has a single lane SERDES which can be configured to be used with either PCIe or USB. Define the possilbe values for the SERDES function in AM64 SoC here.
--- include/dt-bindings/mux/ti-serdes.h | 5 +++++ 1 file changed, 5 insertions(+)
include/dt-bindings/mux/ti-serdes.h +5 -0
@@ -90,4 +90,9 @@#define J7200_SERDES0_LANE3_USB 0x2#define J7200_SERDES0_LANE3_IP4_UNUSED 0x3 +/* AM64 */ + +#define AM64_SERDES0_LANE0_PCIE0 0x0 +#define AM64_SERDES0_LANE0_USB 0x1 +#endif /* _DT_BINDINGS_MUX_TI_SERDES */
Signature · 1 line
2.17.1
PATCH v4 8/21 phy: cadence: Add driver for Sierra PHY
In reply to Kishon Vijay Abraham IFrom: Alan Douglas <[email protected]>
Add a Sierra PHY driver with PCIe and USB support. This driver is a port from the mainline linux driver.
The PHY has multiple lanes, which can be configured into groups, and a generic PHY device is created for each group.
There are two resets controlling the overall PHY block, one to enable the APB interface for programming registers, and another to enable the PHY itself. Additionally there are resets for each PHY lane.
The PHY can be configured in hardware to read register settings from ROM, or they can be written by the driver.
The sequence of operation on startup is to enable the APB bus, write the PHY registers (if required) for each lane group, and then enable the PHY. Each group of lanes can then be individually controlled using the power_on()/ power_off() function for that generic PHY
One difference with the linux driver is that the PHY is always reset after it is powered-on. This is because role switching is not supported in u-boot and the cable orientation is handled by the PHY reset.
--- drivers/phy/Kconfig | 2 + drivers/phy/Makefile | 1 + drivers/phy/cadence/Kconfig | 5 + drivers/phy/cadence/Makefile | 1 + drivers/phy/cadence/phy-cadence-sierra.c | 765 +++++++++++++++++++++++ 5 files changed, 774 insertions(+) create mode 100644 drivers/phy/cadence/Kconfig create mode 100644 drivers/phy/cadence/Makefile create mode 100644 drivers/phy/cadence/phy-cadence-sierra.c
drivers/phy/Kconfig +2 -0
@@ -269,4 +269,6 @@ config PHY_MTK_TPHY so you can easily distinguish them by banks layout. source "drivers/phy/rockchip/Kconfig" +source "drivers/phy/cadence/Kconfig" + endmenu
drivers/phy/Makefile +1 -0
@@ -31,3 +31,4 @@ obj-$(CONFIG_MT7620_USB_PHY) += mt7620-usb-phy.o obj-$(CONFIG_MT76X8_USB_PHY) += mt76x8-usb-phy.o obj-$(CONFIG_PHY_DA8XX_USB) += phy-da8xx-usb.o obj-$(CONFIG_PHY_MTK_TPHY) += phy-mtk-tphy.o +obj-y += cadence/
drivers/phy/cadence/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config PHY_CADENCE_SIERRA + tristate "Cadence Sierra PHY Driver" + depends on DM_RESET + help + Enable this to support the Cadence Sierra PHY driver
drivers/phy/cadence/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_$(SPL_)PHY_CADENCE_SIERRA) += phy-cadence-sierra.o
drivers/phy/cadence/phy-cadence-sierra.c new file +765 -0
765 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v4 9/21 phy: cadence: Add driver for Torrent SERDES
In reply to Kishon Vijay Abraham IFrom: Aswath Govindraju <[email protected]>
Add driver for Torrent SERDES.
--- drivers/phy/cadence/Kconfig | 6 + drivers/phy/cadence/Makefile | 1 + drivers/phy/cadence/phy-cadence-torrent.c | 2477 +++++++++++++++++++++ 3 files changed, 2484 insertions(+) create mode 100644 drivers/phy/cadence/phy-cadence-torrent.c
drivers/phy/cadence/Kconfig +6 -0
@@ -3,3 +3,9 @@ config PHY_CADENCE_SIERRA depends on DM_RESET help Enable this to support the Cadence Sierra PHY driver + +config PHY_CADENCE_TORRENT + tristate "Cadence Torrent PHY Driver" + depends on DM_RESET + help + Enable this to support the Cadence Torrent PHY driver
drivers/phy/cadence/Makefile +1 -0
@@ -1 +1,2 @@ obj-$(CONFIG_$(SPL_)PHY_CADENCE_SIERRA) += phy-cadence-sierra.o +obj-$(CONFIG_$(SPL_)PHY_CADENCE_TORRENT) += phy-cadence-torrent.o
drivers/phy/cadence/phy-cadence-torrent.c new file +2477 -0
2,477 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v4 10/21 phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC
In reply to Kishon Vijay Abraham IFrom: Jean-Jacques Hiblot <[email protected]>
Add support for WIZ module present in TI's J721E SoC. WIZ is a SERDES wrapper used to configure some of the input signals to the SERDES. It is used with both Sierra(16G) and Torrent(10G) SERDES. This driver configures three clock selects (pll0, pll1, dig) and supports resets for each of the lanes.
This is an adaptation of the linux driver.
--- drivers/phy/Kconfig | 1 + drivers/phy/Makefile | 1 + drivers/phy/ti/Kconfig | 9 + drivers/phy/ti/Makefile | 1 + drivers/phy/ti/phy-j721e-wiz.c | 1156 ++++++++++++++++++++++++++++++++ 5 files changed, 1168 insertions(+) create mode 100644 drivers/phy/ti/Kconfig create mode 100644 drivers/phy/ti/Makefile create mode 100644 drivers/phy/ti/phy-j721e-wiz.c
drivers/phy/Kconfig +1 -0
@@ -270,5 +270,6 @@ config PHY_MTK_TPHY source "drivers/phy/rockchip/Kconfig" source "drivers/phy/cadence/Kconfig" +source "drivers/phy/ti/Kconfig" endmenu
drivers/phy/Makefile +1 -0
@@ -32,3 +32,4 @@ obj-$(CONFIG_MT76X8_USB_PHY) += mt76x8-usb-phy.o obj-$(CONFIG_PHY_DA8XX_USB) += phy-da8xx-usb.o obj-$(CONFIG_PHY_MTK_TPHY) += phy-mtk-tphy.o obj-y += cadence/ +obj-y += ti/
drivers/phy/ti/Kconfig new file +9 -0
@@ -0,0 +1,9 @@ +config PHY_J721E_WIZ + tristate "TI J721E WIZ (SERDES Wrapper) support" + depends on ARCH_K3 + help + This option enables support for WIZ module present in TI's J721E + SoC. WIZ is a serdes wrapper used to configure some of the input + signals to the SERDES (Sierra/Torrent). This driver configures + three clock selects (pll0, pll1, dig) and resets for each of the + lanes.
drivers/phy/ti/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_$(SPL_)PHY_J721E_WIZ) += phy-j721e-wiz.o
drivers/phy/ti/phy-j721e-wiz.c new file +1156 -0
1,156 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v4 11/21 board: ti: j721e: Add support for probing and configuring Torrent serdes on J7200
In reply to Kishon Vijay Abraham IFrom: Aswath Govindraju <[email protected]>
Add support for probing and configuring Torrent serdes on J7200.
--- board/ti/j721e/evm.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-)
board/ti/j721e/evm.c +33 -1
@@ -10,6 +10,7 @@#include <common.h> #include <env.h> #include <fdt_support.h> +#include <generic-phy.h> #include <image.h> #include <init.h> #include <log.h>
@@ -29,7 +30,8 @@#define board_is_j721e_som () (board_ti_k3_is("J721EX-PM1-SOM") || \ board_ti_k3_is("J721EX-PM2-SOM")) -#define board_is_j7200_som () board_ti_k3_is("J7200X-PM1-SOM") +#define board_is_j7200_som () (board_ti_k3_is("J7200X-PM1-SOM") || \ + board_ti_k3_is("J7200X-PM2-SOM"))/* Max number of MAC addresses that are parsed/processed per daughter card */ #define DAUGHTER_CARD_NO_OF_MAC_ADDR 8
@@ -384,6 +386,33 @@ static int probe_daughtercards(void) }#endif +void configure_serdes_torrent (void ) +{ +struct udevice *dev; +struct phy serdes; +int ret; + +if (!IS_ENABLED (CONFIG_PHY_CADENCE_TORRENT )) +return ; + + ret =uclass_get_device_by_driver (UCLASS_PHY , +DM_DRIVER_GET (torrent_phy_provider), + &dev); +if (ret) +printf ("Torrent init failed:%d\n" , ret); + + serdes.dev = dev; + serdes.id =0 ; + + ret =generic_phy_init (&serdes); +if (ret) +printf ("phy_init failed!!\n" ); + + ret =generic_phy_power_on (&serdes); +if (ret) +printf ("phy_power_on failed !!\n" ); +} +int board_late_init (void ) {if (IS_ENABLED (CONFIG_TI_I2C_BOARD_DETECT )) {
@@ -394,6 +423,9 @@ int board_late_init(void)probe_daughtercards (); } +if (board_is_j7200_som ()) +configure_serdes_torrent (); +return 0 ; }
Signature · 1 line
2.17.1
PATCH v4 12/21 ARM: dts: k3-j721e: Add support for USB3 in USB0 instance
In reply to Kishon Vijay Abraham IConfigure the parent clock of wiz3_pll0_refclk to the internal clock required for USB3 to be functional and also remove "ti,usb2-only" property as it now supports USB3 mode. This has properties specific to u-boot on top of DT present in v5.13 of Linux Kernel.
--- .../k3-j721e-common-proc-board-u-boot.dtsi | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi +18 -1
@@ -129,13 +129,17 @@ u-boot,dm-spl; }; +&wiz3_pll1_refclk { + assigned-clocks = <&wiz3_pll1_refclk>, <&wiz3_pll0_refclk>; + assigned-clock-parents = <&k3_clks 295 0>, <&k3_clks 295 9>; +}; + &main_usbss0_pins_default { u-boot,dm-spl; }; &usbss0 { u-boot,dm-spl; - ti,usb2-only; }; &usb0 {
@@ -215,3 +219,16 @@ &main_r5fss1 { ti,cluster-mode = <0>; }; + +&wiz3_pll1_refclk { + assigned-clocks = <&wiz3_pll1_refclk>, <&wiz3_pll0_refclk>; + assigned-clock-parents = <&k3_clks 295 0>, <&k3_clks 295 9>; +}; + +&serdes_ln_ctrl { + u-boot,mux-autoprobe; +}; + +&usb_serdes_mux { + u-boot,mux-autoprobe; +};
Signature · 1 line
2.17.1
PATCH v4 13/21 arm: dts: k3-j7200-main: Add DT node for torrent serdes
In reply to Kishon Vijay Abraham IFrom: Aswath Govindraju <[email protected]>
Add DT node for torrent serdes. This is in sync with v5.13 Linux Kernel.
--- arch/arm/dts/k3-j7200-main.dtsi | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+)
arch/arm/dts/k3-j7200-main.dtsi +63 -0
@@ -5,6 +5,13 @@ * Copyright (C) 2020 Texas Instruments Incorporated - https://www.ti.com/ */ +/ { + serdes_refclk: serdes-refclk { + #clock-cells = <0>; + compatible = "fixed-clock"; + }; +}; + &cbass_main { msmc_ram: sram@70000000 { compatible = "mmio-sram";
@@ -554,6 +561,62 @@ clock-names = "gpio"; }; + serdes_wiz0: wiz@5060000 { + compatible = "ti,j721e-wiz-10g"; + #address-cells = <1>; + #size-cells = <1>; + power-domains = <&k3_pds 292 TI_SCI_PD_EXCLUSIVE>; + clocks = <&k3_clks 292 11>, <&k3_clks 292 85>, <&serdes_refclk>; + clock-names = "fck", "core_ref_clk", "ext_ref_clk"; + num-lanes = <4>; + #reset-cells = <1>; + ranges = <0x5060000 0x0 0x5060000 0x10000>; + + assigned-clocks = <&k3_clks 292 85>; + assigned-clock-parents = <&k3_clks 292 89>; + + wiz0_pll0_refclk: pll0-refclk { + clocks = <&k3_clks 292 85>, <&serdes_refclk>; + clock-output-names = "wiz0_pll0_refclk"; + #clock-cells = <0>; + assigned-clocks = <&wiz0_pll0_refclk>; + assigned-clock-parents = <&k3_clks 292 85>; + }; + + wiz0_pll1_refclk: pll1-refclk { + clocks = <&k3_clks 292 85>, <&serdes_refclk>; + clock-output-names = "wiz0_pll1_refclk"; + #clock-cells = <0>; + assigned-clocks = <&wiz0_pll1_refclk>; + assigned-clock-parents = <&k3_clks 292 85>; + }; + + wiz0_refclk_dig: refclk-dig { + clocks = <&k3_clks 292 85>, <&serdes_refclk>; + clock-output-names = "wiz0_refclk_dig"; + #clock-cells = <0>; + assigned-clocks = <&wiz0_refclk_dig>; + assigned-clock-parents = <&k3_clks 292 85>; + }; + + wiz0_cmn_refclk_dig_div: cmn-refclk-dig-div { + clocks = <&wiz0_refclk_dig>; + #clock-cells = <0>; + }; + + serdes0: serdes@5060000 { + compatible = "ti,j721e-serdes-10g"; + reg = <0x05060000 0x00010000>; + reg-names = "torrent_phy"; + resets = <&serdes_wiz0 0>; + reset-names = "torrent_reset"; + clocks = <&wiz0_pll0_refclk>; + clock-names = "refclk"; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + usbss0: cdns-usb@4104000 { compatible = "ti,j721e-usb"; reg = <0x00 0x4104000 0x00 0x100>;
Signature · 1 line
2.17.1
PATCH v4 14/21 arm: dts: k3-j7200-common-proc-board: Enable SERDES DT
In reply to Kishon Vijay Abraham IFrom: Aswath Govindraju <[email protected]>
Add default lane function for torrent serdes. This is in sync with v5.13 Linux Kernel.
--- arch/arm/dts/k3-j7200-common-proc-board.dts | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+)
arch/arm/dts/k3-j7200-common-proc-board.dts +23 -0
@@ -9,6 +9,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/net/ti-dp83867.h> #include <dt-bindings/mux/ti-serdes.h> +#include <dt-bindings/phy/phy.h> / { chosen {
@@ -281,3 +282,25 @@ ti,adc-channels = <0 1 2 3 4 5 6 7>; }; }; + +&serdes_refclk { + clock-frequency = <100000000>; +}; + +&serdes0 { + serdes0_pcie_link: link@0 { + reg = <0>; + cdns,num-lanes = <2>; + #phy-cells = <0>; + cdns,phy-type = <PHY_TYPE_PCIE>; + resets = <&serdes_wiz0 1>, <&serdes_wiz0 2>; + }; + + serdes0_qsgmii_link: link@1 { + reg = <2>; + cdns,num-lanes = <1>; + #phy-cells = <0>; + cdns,phy-type = <PHY_TYPE_QSGMII>; + resets = <&serdes_wiz0 3>; + }; +};
Signature · 1 line
2.17.1
PATCH v4 15/21 arm: dts: k3-j7200-common-proc-board-u-boot: Add u-boot tags for torrent serdes
In reply to Kishon Vijay Abraham IFrom: Aswath Govindraju <[email protected]>
Add u-boot tags for torrent serdes. This has properties specific to u-boot on top of DT in v5.13 Linux Kernel.
--- arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +12 -0
@@ -188,3 +188,15 @@ &hbmc_mux { u-boot,dm-spl; }; + +&serdes_ln_ctrl { + u-boot,mux-autoprobe; +}; + +&usb_serdes_mux { + u-boot,mux-autoprobe; +}; + +&serdes0 { + u-boot,dm-spl; +};
Signature · 1 line
2.17.1
PATCH v4 16/21 configs: j721e_evm_a72: Enable the drivers required for the USB3 support
In reply to Kishon Vijay Abraham IFrom: Jean-Jacques Hiblot <[email protected]>
Enable the mmio mux driver, the J721E-wiz PHy driver and the cadence sierra phy driver. All of them are required for USB3 support
--- configs/j721e_evm_a72_defconfig | 6 ++++++ 1 file changed, 6 insertions(+)
configs/j721e_evm_a72_defconfig +6 -0
@@ -135,9 +135,15 @@ CONFIG_SPI_FLASH_STMICRO=y # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set CONFIG_SPI_FLASH_MTD=y CONFIG_PHY_TI_DP83867=y +CONFIG_MULTIPLEXER=y +CONFIG_MUX_MMIO=y CONFIG_PHY_FIXED=y CONFIG_DM_ETH=y CONFIG_TI_AM65_CPSW_NUSS=y +CONFIG_PHY=y +CONFIG_SPL_PHY=y +CONFIG_PHY_CADENCE_SIERRA=y +CONFIG_PHY_J721E_WIZ=y CONFIG_PINCTRL=y # CONFIG_PINCTRL_GENERIC is not set CONFIG_SPL_PINCTRL=y
Signature · 1 line
2.17.1
PATCH v4 17/21 configs: j7200_evm_a72_defconfig: Add config for torrent serdes and common clock framework
In reply to Kishon Vijay Abraham IFrom: Aswath Govindraju <[email protected]>
Add config for torrent serdes and common clock framework.
--- configs/j7200_evm_a72_defconfig | 7 +++++++ 1 file changed, 7 insertions(+)
configs/j7200_evm_a72_defconfig +7 -0
@@ -96,6 +96,7 @@ CONFIG_SPL_OF_TRANSLATE=y CONFIG_CLK=y CONFIG_SPL_CLK=y CONFIG_CLK_TI_SCI=y +CONFIG_CLK_CCF=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y CONFIG_DFU_SF=y
@@ -137,9 +138,15 @@ CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set CONFIG_SPI_FLASH_MTD=y +CONFIG_MULTIPLEXER=y +CONFIG_MUX_MMIO=y CONFIG_PHY_FIXED=y CONFIG_DM_ETH=y CONFIG_TI_AM65_CPSW_NUSS=y +CONFIG_PHY=y +CONFIG_SPL_PHY=y +CONFIG_PHY_CADENCE_TORRENT=y +CONFIG_PHY_J721E_WIZ=y CONFIG_PINCTRL=y # CONFIG_PINCTRL_GENERIC is not set CONFIG_SPL_PINCTRL=y
Signature · 1 line
2.17.1
PATCH v4 18/21 env: ti: j721e-evm: Add env variable to power on & reset QSGMII PHY in J7200 EVM
In reply to Kishon Vijay Abraham IMAIN CPSW0 requires the PHY to be powered on and reset for QSGMII operation. Add a env variable to configure driving "0" on ENET_EXP_PWRDN controlled by GPIO EXPANDER2 (I2C Addr: 0x22), PIN: 17 and driving "1" on ENET_EXP_RESETZ controlled by GPIO EXPANDER2 (I2C Addr: 0x22),
PIN: 18.
--- include/configs/j721e_evm.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
include/configs/j721e_evm.h +15 -1
@@ -139,11 +139,24 @@#endif /* CONFIG_TARGET_J721E_A72_EVM */ #ifdef CONFIG_TARGET_J7200_A72_EVM +#define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY \ + "do_main_cpsw0_qsgmii_phyinit=1\0" \ + "init_main_cpsw0_qsgmii_phy=gpio set gpio@22_17;" \ + "gpio clear gpio@22_16\0" \ + "main_cpsw0_qsgmii_phyinit=" \ + "if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1 && test ${dorprocboot} -eq 1 && " \ + "test ${boot} = mmc; then " \ + "run init_main_cpsw0_qsgmii_phy;" \ + "fi;\0"#define DEFAULT_RPROCS "" \ "2 /lib/firmware/j7200-main-r5f0_0-fw " \ "3 /lib/firmware/j7200-main-r5f0_1-fw "#endif /* CONFIG_TARGET_J7200_A72_EVM */ +#ifndef EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY +#define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY +#endif +/* set default dfu_bufsiz to 128KB (sector size of OSPI) */ #define EXTRA_ENV_DFUARGS \ "dfu_bufsiz=0x20000\0" \
@@ -170,7 +183,8 @@EXTRA_ENV_RPROC_SETTINGS \ EXTRA_ENV_DFUARGS \DEFAULT_UFS_TI_ARGS \ -EXTRA_ENV_J721E_BOARD_SETTINGS_MTD + EXTRA_ENV_J721E_BOARD_SETTINGS_MTD \ +EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY /* Now for the remaining common defines */#include <configs/ti_armv7_common.h>
Signature · 1 line
2.17.1
PATCH v4 19/21 configs: j7200_evm_a72: Add CONFIG_PREBOOT to configure ethernet PHY
In reply to Kishon Vijay Abraham IAdd CONFIG_PREBOOT to provide an automatic and easier way to configure ethernet PHY before loading the firmware.
--- configs/j7200_evm_a72_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/j7200_evm_a72_defconfig +1 -0
@@ -30,6 +30,7 @@ CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 # CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y +CONFIG_PREBOOT="run main_cpsw0_qsgmii_phyinit;" CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern" CONFIG_LOGLEVEL=7 CONFIG_SPL_BOARD_INIT=y
Signature · 1 line
2.17.1
PATCH v4 20/21 doc: board: Move j721e document to doc/board/ti/ directory
In reply to Kishon Vijay Abraham IMove j721e document from board/ti/j721e/README to doc/board/ti/j721e_evm.rst after converting it to RST format.
--- board/ti/j721e/README | 277 -------------------------------- doc/board/index.rst | 1 + doc/board/ti/j721e_evm.rst | 316 +++++++++++++++++++++++++++++++++++++ 3 files changed, 317 insertions(+), 277 deletions(-) delete mode 100644 board/ti/j721e/README create mode 100644 doc/board/ti/j721e_evm.rst
board/ti/j721e/README deleted +0 -277
@@ -1,277 +0,0 @@ -Introduction: -------------- -The J721e family of SoCs are part of K3 Multicore SoC architecture platform -targeting automotive applications. They are designed as a low power, high -performance and highly integrated device architecture, adding significant -enhancement on processing power, graphics capability, video and imaging -processing, virtualization and coherent memory support. - -The device is partitioned into three functional domains, each containing -specific processing cores and peripherals: -1. Wake-up (WKUP) domain: - - Device Management and Security Controller (DMSC) -2. Microcontroller (MCU) domain: - - Dual Core ARM Cortex-R5F processor -3. MAIN domain: - - Dual core 64-bit ARM Cortex-A72 - - 2 x Dual cortex ARM Cortex-R5 subsystem - - 2 x C66x Digital signal processor sub system - - C71x Digital signal processor sub-system with MMA. - -More info can be found in TRM: http://www.ti.com/lit/pdf/spruil1 - -Boot Flow: ----------- -Boot flow is similar to that of AM65x SoC and extending it with remoteproc -support. Below is the pictorial representation of boot flow: - -+------------------------------------------------------------------------+-----------------------+ -| DMSC | MCU R5 | A72 | MAIN R5/C66x/C7x | -+------------------------------------------------------------------------+-----------------------+ -| +--------+ | | | | -| | Reset | | | | | -| +--------+ | | | | -| : | | | | -| +--------+ | +-----------+ | | | -| | *ROM* |----------|-->| Reset rls | | | | -| +--------+ | +-----------+ | | | -| | | | : | | | -| | ROM | | : | | | -| |services| | : | | | -| | | | +-------------+ | | | -| | | | | *R5 ROM* | | | | -| | | | +-------------+ | | | -| | |<---------|---|Load and auth| | | | -| | | | | tiboot3.bin | | | | -| | | | +-------------+ | | | -| | | | : | | | -| | | | : | | | -| | | | : | | | -| | | | +-------------+ | | | -| | | | | *R5 SPL* | | | | -| | | | +-------------+ | | | -| | | | | Load | | | | -| | | | | sysfw.itb | | | | -| | Start | | +-------------+ | | | -| | System |<---------|---| Start | | | | -| |Firmware| | | SYSFW | | | | -| +--------+ | +-------------+ | | | -| : | | | | | | -| +---------+ | | Load | | | | -| | *SYSFW* | | | system | | | | -| +---------+ | | Config data | | | | -| | |<--------|---| | | | | -| | | | +-------------+ | | | -| | | | | DDR | | | | -| | | | | config | | | | -| | | | +-------------+ | | | -| | | | | Load | | | | -| | | | | tispl.bin | | | | -| | | | +-------------+ | | | -| | | | | Load R5 | | | | -| | | | | firmware | | | | -| | | | +-------------+ | | | -| | |<--------|---| Start A72 | | | | -| | | | | and jump to | | | | -| | | | | DM fw image | | | | -| | | | +-------------+ | | | -| | | | | +-----------+ | | -| | |---------|-----------------------|---->| Reset rls | | | -| | | | | +-----------+ | | -| | TIFS | | | : | | -| |Services | | | +-----------+ | | -| | |<--------|-----------------------|---->|*ATF/OPTEE*| | | -| | | | | +-----------+ | | -| | | | | : | | -| | | | | +-----------+ | | -| | |<--------|-----------------------|---->| *A72 SPL* | | | -| | | | | +-----------+ | | -| | | | | | Load | | | -| | | | | | u-boot.img| | | -| | | | | +-----------+ | | -| | | | | : | | -| | | | | +-----------+ | | -| | |<--------|-----------------------|---->| *U-Boot* | | | -| | | | | +-----------+ | | -| | | | | | prompt | | | -| | | | | +-----------+ | | -| | | | | | Load R5 | | | -| | | | | | Firmware | | | -| | | | | +-----------+ | | -| | |<--------|-----------------------|-----| Start R5 | | +-----------+ | -| | |---------|-----------------------|-----+-----------+-----|----->| R5 starts | | -| | | | | | Load C6 | | +-----------+ | -| | | | | | Firmware | | | -| | | | | +-----------+ | | -| | |<--------|-----------------------|-----| Start C6 | | +-----------+ | -| | |---------|-----------------------|-----+-----------+-----|----->| C6 starts | | -| | | | | | Load C7 | | +-----------+ | -| | | | | | Firmware | | | -| | | | | +-----------+ | | -| | |<--------|-----------------------|-----| Start C7 | | +-----------+ | -| | |---------|-----------------------|-----+-----------+-----|----->| C7 starts | | -| +---------+ | | | +-----------+ | -| | | | | -+------------------------------------------------------------------------+-----------------------+ - -- Here DMSC acts as master and provides all the critical services. R5/A72 -requests DMSC to get these services done as shown in the above diagram. - -Sources: --------- -1. SYSFW: - Tree: git://git.ti.com/k3-image-gen/k3-image-gen.git - Branch: master - -2. ATF: - Tree: https://github.com/ARM-software/arm-trusted-firmware.git - Branch: master - -3. OPTEE: - Tree: https://github.com/OP-TEE/optee_os.git - Branch: master - -4. U-Boot: - Tree: https://source.denx.de/u-boot/u-boot - Branch: master - -Build procedure: ----------------- -1. SYSFW: -$ make CROSS_COMPILE=arm-linux-gnueabihf- - -2. ATF: -$ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=aarch64 PLAT=k3 TARGET_BOARD=generic SPD=opteed - -3. OPTEE: -$ make PLATFORM=k3-j721e CFG_ARM64_core=y - -4. U-Boot: - -4.1. R5: -$ make CROSS_COMPILE=arm-linux-gnueabihf- j721e_evm_r5_defconfig O=/tmp/r5 -$ make CROSS_COMPILE=arm-linux-gnueabihf- O=/tmp/r5 - -4.2. A72: -$ make CROSS_COMPILE=aarch64-linux-gnu- j721e_evm_a72_defconfig O=/tmp/a72 -$ make CROSS_COMPILE=aarch64-linux-gnu- ATF=<path to ATF dir>/build/k3/generic/release/bl31.bin TEE=<path to OPTEE OS dir>/out/arm-plat-k3/core/tee-pager_v2.bin DM=<path to DM firmware image> O=/tmp/a72 - -Target Images --------------- -Copy the below images to an SD card and boot: -- sysfw.itb from step 1 -- tiboot3.bin from step 4.1 -- tispl.bin, u-boot.img from 4.2 - -Image formats: --------------- - -- tiboot3.bin: - +-----------------------+ - | X.509 | - | Certificate | - | +-------------------+ | - | | | | - | | R5 | | - | | u-boot-spl.bin | | - | | | | - | +-------------------+ | - | | | | - | | FIT header | | - | | +---------------+ | | - | | | | | | - | | | DTB 1...N | | | - | | +---------------+ | | - | +-------------------+ | - +-----------------------+ - -- tispl.bin - +-----------------------+ - | | - | FIT HEADER | - | +-------------------+ | - | | | | - | | A72 ATF | | - | +-------------------+ | - | | | | - | | A72 OPTEE | | - | +-------------------+ | - | | | | - | | R5 DM FW | | - | +-------------------+ | - | | | | - | | A72 SPL | | - | +-------------------+ | - | | | | - | | SPL DTB 1...N | | - | +-------------------+ | - +-----------------------+ - -- sysfw.itb - +-----------------------+ - | | - | FIT HEADER | - | +-------------------+ | - | | | | - | | sysfw.bin | | - | +-------------------+ | - | | | | - | | board config | | - | +-------------------+ | - | | | | - | | PM config | | - | +-------------------+ | - | | | | - | | RM config | | - | +-------------------+ | - | | | | - | | Secure config | | - | +-------------------+ | - +-----------------------+ - -OSPI: ------ -ROM supports booting from OSPI from offset 0x0. - -Flashing images to OSPI: - -Below commands can be used to download tiboot3.bin, tispl.bin, u-boot.img, -and sysfw.itb over tftp and then flash those to OSPI at their respective -addresses. - -=> sf probe -=> tftp ${loadaddr} tiboot3.bin -=> sf update $loadaddr 0x0 $filesize -=> tftp ${loadaddr} tispl.bin -=> sf update $loadaddr 0x80000 $filesize -=> tftp ${loadaddr} u-boot.img -=> sf update $loadaddr 0x280000 $filesize -=> tftp ${loadaddr} sysfw.itb -=> sf update $loadaddr 0x6C0000 $filesize - -Flash layout for OSPI: - - 0x0 +----------------------------+ - | ospi.tiboot3(512K) | - | | - 0x80000 +----------------------------+ - | ospi.tispl(2M) | - | | - 0x280000 +----------------------------+ - | ospi.u-boot(4M) | - | | - 0x680000 +----------------------------+ - | ospi.env(128K) | - | | - 0x6A0000 +----------------------------+ - | ospi.env.backup (128K) | - | | - 0x6C0000 +----------------------------+ - | ospi.sysfw(1M) | - | | - 0x7C0000 +----------------------------+ - | padding (256k) | - 0x800000 +----------------------------+ - | ospi.rootfs(UBIFS) | - | | - +----------------------------+
doc/board/index.rst +1 -0
@@ -26,6 +26,7 @@ Board-specific doc socionext/index st/index tbs/index + ti/index toradex/index xen/index xilinx/index
doc/board/ti/j721e_evm.rst new file +316 -0
316 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [PATCH v4 20/21] doc: board: Move j721e document to doc/board/ti/ directory
Quoted 4 lines · Kishon V;ijay Abraham I
Move j721e document from board/ti/j721e/README to
doc/board/ti/j721e_evm.rstafter converting it to RST format.Signed-off-by Kishon Vijay Abraham I <[email protected]>
[snip]
doc/board/ti/j721e_evm.rst line 2
Quoted 8 lines
doc/board/ti/j721e_evm.rst new file +2
-0@@ -0,0 +1,316 @@ +.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause +.. sectionauthor:: Patrick Delaunay <[email protected]>
Should fix this :)
Signature · 1 line
Tom
Re: [PATCH v4 20/21] doc: board: Move j721e document to doc/board/ti/ directory
Quoted 7 lines · Tom Rini
Quoted 4 lines · Kishon V;ijay Abraham I
Move j721e document from board/ti/j721e/README to
doc/board/ti/j721e_evm.rstafter converting it to RST format.Signed-off-by Kishon Vijay Abraham I <[email protected]>[snip]
Quoted 10 lines
doc/board/ti/j721e_evm.rst line 2
Quoted 8 lines
doc/board/ti/j721e_evm.rst new file +2
-0@@ -0,0 +1,316 @@ +.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause +.. sectionauthor:: Patrick Delaunay <[email protected]>Should fix this :)
Er.. Will fix it up.
Thanks
Kishon
PATCH v4 21/21 doc: board: j721e_evm: Add documentation for firmware loading
In reply to Kishon Vijay Abraham IAdd documentation for loading firmwares to be used by remote cores in the system including the environment variables that has to be set to load the firmwares.
--- doc/board/ti/j721e_evm.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
doc/board/ti/j721e_evm.rst +15 -0
@@ -314,3 +314,18 @@ Flash layout for OSPI: | ospi.rootfs(UBIFS) | | | +----------------------------+ + +Firmwares: +---------- + +The J721e u-boot allows firmware to be loaded for the Cortex-R5 subsystem. +The CPSW5G in J7200 and CPSW9G in J721E present in MAIN domain is configured +and controlled by the ethernet firmware that executes in the MAIN Cortex R5. +The default supported environment variables support loading these firmwares +from only MMC. "dorprocboot" env variable has to be set for the U-BOOT to load +and start the remote cores in the system. + +J721E common processor board can be attached to a Ethernet QSGMII card and the +PHY in the card has to be reset before it can be used for data transfer. +"do_main_cpsw0_qsgmii_phyinit" env variable has to be set for the U-BOOT to +configure this PHY.
Signature · 1 line
2.17.1