Add support for Ethernet Boot on SK-AM62
Subsystems (6)
v3 cover Add support for Ethernet Boot on SK-AM62
This series enables Ethernet Boot on SK-AM62 device.
This series is based on commit "b4cbd1a257d4" of origin/next branch of u-boot.
Link to v2:
https://lore.kernel.org/r/[email protected]/
TestLogs:
https://gist.github.com/chintanv133/76de0a51fd532b34fea686f4c7bd75c6
Changes frpom v2 to v3:
- Since register property is defined as "ring" for PKTDMA and "cfg" for UDMA, change the condition to configure the base address of ring configuration register accordingly.
- Since "phy_gmii_sel" with "bootph-all" property is merged at upstream Linux for am62x-sk-common with commit "ba50141137fa", [PATCH 10/10] can be drop with next DT-Sync.
Chintan Vankar (2):
common: spl: spl: Init DRAM size in R5/A53 SPL
arch: arm: dts: k3-am62-sk-u-boot: Add missing "bootph-all" property
to phy_gmii_sel node
Kishon Vijay Abraham I (6):
firmware: ti_sci: Add No-OP for "RX_FL_CFG"
soc: ti: k3-navss-ringacc: Initialize base address of ring cfg
registers
dma: ti: k3-udma: Add support for native configuration of chan/flow
arm: mach-k3: am625_init: Probe AM65 CPSW NUSS
configs: am62: Add configs for enabling ETHBOOT in R5SPL
configs: am62: Enable configs required for Ethboot
Siddharth Vadapalli (1):
arm: dts: k3-am625-r5-sk: Enable DM services for main_pktdma
Vignesh Raghavendra (1):
soc: ti: k3-navss-ringacc: Fix reset ring API
arch/arm/dts/k3-am625-r5-sk.dts | 5 +++++ arch/arm/dts/k3-am625-sk-u-boot.dtsi | 4 ++++ arch/arm/mach-k3/am62x/am625_init.c | 10 ++++++++++ common/spl/spl.c | 2 +- configs/am62x_evm_a53_ethboot_defconfig | 12 ++++++++++++ configs/am62x_evm_r5_ethboot_defconfig | 20 ++++++++++++++++++++ drivers/dma/ti/k3-udma.c | 6 ++++++ drivers/firmware/ti_sci.c | 8 +++++++- drivers/soc/ti/k3-navss-ringacc-u-boot.c | 9 ++++++++- drivers/soc/ti/k3-navss-ringacc.c | 17 ++++++++++++++++- 10 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 configs/am62x_evm_a53_ethboot_defconfig create mode 100644 configs/am62x_evm_r5_ethboot_defconfig
Signature · 1 line
2.34.1
PATCH v3 1/10 common: spl: spl: Init DRAM size in R5/A53 SPL
Initialize DRAM size in SPL stage since networking requires DDR to be initialized.
---
Link to v2:
https://lore.kernel.org/r/[email protected]/
Changes from v2 to v3:
- No changes.
common/spl/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/spl.c +1 -1
@@ -720,7 +720,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)initr_watchdog ();if (IS_ENABLED (CONFIG_SPL_OS_BOOT ) ||CONFIG_IS_ENABLED (HANDOFF ) || -IS_ENABLED (CONFIG_SPL_ATF )) +IS_ENABLED (CONFIG_SPL_ATF ) ||IS_ENABLED (CONFIG_SPL_NET ))dram_init_banksize ();if (CONFIG_IS_ENABLED (PCI ) && !(gd->flags &GD_FLG_DM_DEAD )) {
Signature · 1 line
2.34.1
Re: [PATCH v3 01/10] common: spl: spl: Init DRAM size in R5/A53 SPL
Quoted 7 lines · Chintan Vankar
Initialize DRAM size in SPL stage since networking requires DDR to be initialized.
Signed-off-by Kishon Vijay Abraham I <[email protected]>Signed-off-by Chintan Vankar <[email protected]>---
Best regards,
Dhruva
Quoted 25 lines
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.common/spl/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/spl/spl.c +1
-1@@ -720,7 +720,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)initr_watchdog ();if (IS_ENABLED (CONFIG_SPL_OS_BOOT ) ||CONFIG_IS_ENABLED (HANDOFF ) || -IS_ENABLED (CONFIG_SPL_ATF )) +IS_ENABLED (CONFIG_SPL_ATF ) ||IS_ENABLED (CONFIG_SPL_NET ))dram_init_banksize ();if (CONFIG_IS_ENABLED (PCI ) && !(gd->flags &GD_FLG_DM_DEAD )) {Signature · 1 line
2.34.1
Re: [PATCH v3 01/10] common: spl: spl: Init DRAM size in R5/A53 SPL
In reply to Chintan VankarQuoted 5 lines · Chintan Vankar
Initialize DRAM size in SPL stage since networking requires DDR to be initialized.
Signed-off-by Kishon Vijay Abraham I <[email protected]>Signed-off-by Chintan Vankar <[email protected]>
Signature · 1 line
Tom
PATCH v3 2/10 firmware: ti_sci: Add No-OP for "RX_FL_CFG"
In reply to Chintan VankarFrom: Kishon Vijay Abraham I <[email protected]>
RX_FL_CFG message should not be forwarded to TIFS and should be handled within R5 SPL (when DM services are not available). Add a no-op function to not handle RX_FL_CFG messages.
---
Link to v2:
https://lore.kernel.org/r/[email protected]/
Changes from v2 to v3:
- No changes.
drivers/firmware/ti_sci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/firmware/ti_sci.c +7 -1
@@ -2451,6 +2451,12 @@ fail:return ret; } +static int ti_sci_cmd_rm_udmap_rx_flow_cfg_noop (const struct ti_sci_handle *handle, +const struct ti_sci_msg_rm_udmap_flow_cfg *params) +{ +return 0 ; +} +/** * ti_sci_cmd_set_fwl_region() - Request for configuring a firewall region * @handle: pointer to TI SCI handle
@@ -2896,7 +2902,7 @@ static __maybe_unused int ti_sci_dm_probe(struct udevice *dev) udmap_ops = &ops->rm_udmap_ops; udmap_ops->tx_ch_cfg = ti_sci_cmd_rm_udmap_tx_ch_cfg; udmap_ops->rx_ch_cfg = ti_sci_cmd_rm_udmap_rx_ch_cfg; - udmap_ops->rx_flow_cfg = ti_sci_cmd_rm_udmap_rx_flow_cfg; + udmap_ops->rx_flow_cfg = ti_sci_cmd_rm_udmap_rx_flow_cfg_noop;return ret; }
Signature · 1 line
2.34.1
Re: [PATCH v3 02/10] firmware: ti_sci: Add No-OP for "RX_FL_CFG"
Quoted 9 lines · Chintan Vankar
From: Kishon Vijay Abraham I <[email protected]>
RX_FL_CFGmessage should not be forwarded to TIFS and should be handled within R5 SPL (when DM services are not available). Add a no-op function to not handleRX_FL_CFGmessages.Signed-off-by Kishon Vijay Abraham I <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>
Quoted 37 lines
---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.drivers/firmware/ti_sci.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)drivers/firmware/ti_sci.c +0
-0@@ -2451,6 +2451,12 @@ fail: return ret; }drivers/firmware/ti_sci.c +6
-0+static int ti_sci_cmd_rm_udmap_rx_flow_cfg_noop (const struct ti_sci_handle *handle, +const struct ti_sci_msg_rm_udmap_flow_cfg *params) +{ +return 0 ; +} +/**
*ti_sci_cmd_set_fwl_region()- Request for configuring a firewall region
* @handle: pointer to TI SCI handledrivers/firmware/ti_sci.c +1
-1@@ -2896,7 +2902,7 @@ static __maybe_unused int ti_sci_dm_probe(struct udevice *dev) udmap_ops = &ops->rm_udmap_ops; udmap_ops->tx_ch_cfg = ti_sci_cmd_rm_udmap_tx_ch_cfg; udmap_ops->rx_ch_cfg = ti_sci_cmd_rm_udmap_rx_ch_cfg; - udmap_ops->rx_flow_cfg = ti_sci_cmd_rm_udmap_rx_flow_cfg; + udmap_ops->rx_flow_cfg = ti_sci_cmd_rm_udmap_rx_flow_cfg_noop;
return ret;
}
Signature · 3 lines
Alexander Sverdlin Siemens AG www.siemens.com
PATCH v3 3/10 soc: ti: k3-navss-ringacc: Initialize base address of ring cfg registers
In reply to Chintan VankarFrom: Kishon Vijay Abraham I <[email protected]>
Initialize base address of ring config registers required to natively setup ring cfg registers in the absence of Device Manager (DM) services at R5 SPL stage. Since register property is defined as "ring" for PKTDMA and "cfg" for UDMA, configure base address of ring configuration register accordingly.
---
Link to v2:
https://lore.kernel.org/r/[email protected]/
Changes from v2 to v3:
- Since register property is defined as "ring" for PKTDMA and "cfg" for UDMA, change conditon to configure the base address of ring configuration register accordingly.
drivers/soc/ti/k3-navss-ringacc.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/soc/ti/k3-navss-ringacc.c +16 -1
@@ -1029,8 +1029,8 @@ static int k3_nav_ringacc_init(struct udevice *dev, struct k3_nav_ringacc *ringastruct k3_nav_ringacc *k3_ringacc_dmarings_init (struct udevice *dev,struct k3_ringacc_init_data *data) { +void __iomem *base_rt, *base_cfg;struct k3_nav_ringacc *ringacc; -void __iomem *base_rt;int i; ringacc =devm_kzalloc (dev,sizeof (*ringacc),GFP_KERNEL );
@@ -1048,6 +1048,20 @@ struct k3_nav_ringacc *k3_ringacc_dmarings_init(struct udevice *dev,if (!base_rt)return ERR_PTR (-EINVAL ); +/* +* Since register property is defined as "ring" for PKTDMA and +* "cfg" for UDMA, configure base address of ring configuration +* register accordingly. +*/ + base_cfg =dev_remap_addr_name (dev,"ring" ); +pr_debug ("ring %p\n" , base_cfg); +if (!base_cfg) { + base_cfg =dev_remap_addr_name (dev,"cfg" ); +pr_debug ("cfg %p\n" , base_cfg); +if (!base_cfg) +return ERR_PTR (-EINVAL ); + } + ringacc->rings = devm_kzalloc(dev, sizeof(*ringacc->rings) * ringacc->num_rings * 2,
@@ -1062,6 +1076,7 @@ struct k3_nav_ringacc *k3_ringacc_dmarings_init(struct udevice *dev,for (i =0 ; i < ringacc->num_rings; i++) {struct k3_nav_ring *ring = &ringacc->rings[i]; + ring->cfg = base_cfg +KNAV_RINGACC_CFG_REGS_STEP * i; ring->rt = base_rt +K3_DMARING_RING_RT_REGS_STEP * i; ring->parent = ringacc; ring->ring_id = i;
Signature · 1 line
2.34.1
Re: [PATCH v3 03/10] soc: ti: k3-navss-ringacc: Initialize base address of ring cfg registers
Quoted 11 lines · Chintan Vankar
From: Kishon Vijay Abraham I <[email protected]>
Initialize base address of ring config registers required to natively setup ring cfg registers in the absence of Device Manager (DM) services at R5 SPL stage. Since register property is defined as "ring" for PKTDMA and "cfg" for UDMA, configure base address of ring configuration register accordingly.
Signed-off-by Kishon Vijay Abraham I <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>
Quoted 56 lines
---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- Since register property is defined as "ring" for PKTDMA and "cfg" for UDMA, change conditon to configure the base address of ring configuration register accordingly.drivers/soc/ti/k3-navss-ringacc.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)drivers/soc/ti/k3-navss-ringacc.c +1
-1@@ -1029,8 +1029,8 @@ static int k3_nav_ringacc_init(struct udevice *dev, struct k3_nav_ringacc *ringa struct k3_nav_ringacc *k3_ringacc_dmarings_init(struct udevice *dev, struct k3_ringacc_init_data *data) { +void __iomem *base_rt, *base_cfg; struct k3_nav_ringacc *ringacc; -void __iomem *base_rt; int i;
ringacc =devm_kzalloc(dev, sizeof(*ringacc), GFP_KERNEL);drivers/soc/ti/k3-navss-ringacc.c +0
-0@@ -1048,6 +1048,20 @@ struct k3_nav_ringacc *k3_ringacc_dmarings_init(struct udevice *dev, if (!base_rt) return ERR_PTR(-EINVAL);drivers/soc/ti/k3-navss-ringacc.c +14
-0+/* +* Since register property is defined as "ring" for PKTDMA and +* "cfg" for UDMA, configure base address of ring configuration +* register accordingly. +*/ + base_cfg =dev_remap_addr_name (dev,"ring" ); +pr_debug ("ring %p\n" , base_cfg); +if (!base_cfg) { + base_cfg =dev_remap_addr_name (dev,"cfg" ); +pr_debug ("cfg %p\n" , base_cfg); +if (!base_cfg) +return ERR_PTR (-EINVAL ); + } +
ringacc->rings= devm_kzalloc(dev,sizeof(*ringacc->rings)*ringacc->num_rings* 2,drivers/soc/ti/k3-navss-ringacc.c +0
-0@@ -1062,6 +1076,7 @@ struct k3_nav_ringacc *k3_ringacc_dmarings_init(struct udevice *dev, for (i = 0; i < ringacc->num_rings; i++) { struct k3_nav_ring *ring = &ringacc->rings[i];drivers/soc/ti/k3-navss-ringacc.c +1
-0+ ring->cfg = base_cfg +KNAV_RINGACC_CFG_REGS_STEP * i;
ring->rt=base_rt+K3_DMARING_RING_RT_REGS_STEP* i;ring->parent= ringacc;
ring->ring_id= i;
Signature · 3 lines
Alexander Sverdlin Siemens AG www.siemens.com
PATCH v3 4/10 soc: ti: k3-navss-ringacc: Fix reset ring API
In reply to Chintan VankarFrom: Vignesh Raghavendra <[email protected]>
Expectation of k3_ringacc_ring_reset_raw() is to reset the ring to requested size and not to 0. Fix this.
---
Link to v2:
https://lore.kernel.org/r/[email protected]/
Changes from v2 to v3:
- No changes.
drivers/soc/ti/k3-navss-ringacc-u-boot.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/soc/ti/k3-navss-ringacc-u-boot.c +8 -1
@@ -25,9 +25,16 @@ struct k3_nav_ring_cfg_regs {#define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_MASK GENMASK(26, 24)#define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_SHIFT (24) +#define KNAV_RINGACC_CFG_RING_SIZE_MASK GENMASK(15, 0) +static void k3_ringacc_ring_reset_raw (struct k3_nav_ring *ring) { -writel (0 , &ring->cfg->size); +u32 reg; + + reg =readl (&ring->cfg->size); + reg &=KNAV_RINGACC_CFG_RING_SIZE_MASK ; + reg |= ring->size; +writel (reg, &ring->cfg->size); }static void k3_ringacc_ring_reconfig_qmode_raw (struct k3_nav_ring *ring,enum k3_nav_ring_mode mode)
Signature · 1 line
2.34.1
Re: [PATCH v3 04/10] soc: ti: k3-navss-ringacc: Fix reset ring API
Hi Chintan, Vignesh,
Quoted 31 lines · Chintan Vankar
From: Vignesh Raghavendra <[email protected]>
Expectation of
k3_ringacc_ring_reset_raw()is to reset the ring to requested size and not to 0. Fix this.Signed-off-by Vignesh Raghavendra <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.drivers/soc/ti/k3-navss-ringacc-u-boot.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)drivers/soc/ti/k3-navss-ringacc-u-boot.c +0
-0@@ -25,9 +25,16 @@ struct k3_nav_ring_cfg_regs { #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_MASK GENMASK(26, 24) #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_SHIFT (24)drivers/soc/ti/k3-navss-ringacc-u-boot.c +2
-0+#define KNAV_RINGACC_CFG_RING_SIZE_MASK GENMASK(15, 0) +static void
k3_ringacc_ring_reset_raw(struct k3_nav_ring *ring){
drivers/soc/ti/k3-navss-ringacc-u-boot.c struct k3_nav_ring_cfg_regs { · line 35
Quoted 5 lines
drivers/soc/ti/k3-navss-ringacc-u-boot.c +4
-1-writel (0 , &ring->cfg->size); +u32 reg; + + reg =readl (&ring->cfg->size); + reg &=KNAV_RINGACC_CFG_RING_SIZE_MASK ;
should it actually be "reg &= ~KNAV_RINGACC_CFG_RING_SIZE_MASK;"? Otherwise you could potentially bump the size to some number higher than ring->size if you "OR" ring->size with something lower than ring->size and ring->size is not N^2-1?
Quoted 5 lines
drivers/soc/ti/k3-navss-ringacc-u-boot.c +2
-0+ reg |= ring->size; +writel (reg, &ring->cfg->size);}
static voidk3_ringacc_ring_reconfig_qmode_raw(struct k3_nav_ring *ring, enum k3_nav_ring_mode mode)
Signature · 3 lines
Alexander Sverdlin Siemens AG www.siemens.com
Re: [PATCH v3 04/10] soc: ti: k3-navss-ringacc: Fix reset ring API
Quoted 30 lines · Alexander
Hi Chintan, Vignesh,
Quoted 27 lines · Chintan Vankar
From: Vignesh Raghavendra <[email protected]>
Expectation of
k3_ringacc_ring_reset_raw()is to reset the ring to requested size and not to 0. Fix this.Signed-off-by Vignesh Raghavendra <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.drivers/soc/ti/k3-navss-ringacc-u-boot.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/soc/ti/k3-navss-ringacc-u-boot.c +0
-0@@ -25,9 +25,16 @@ struct k3_nav_ring_cfg_regs { #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_MASK GENMASK(26, 24) #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_SHIFT (24)
Quoted 15 lines
drivers/soc/ti/k3-navss-ringacc-u-boot.c struct k3_nav_ring_cfg_regs { · line 35
Quoted 9 lines
drivers/soc/ti/k3-navss-ringacc-u-boot.c +6
-1+#define KNAV_RINGACC_CFG_RING_SIZE_MASK GENMASK(15, 0) + static void k3_ringacc_ring_reset_raw(struct k3_nav_ring *ring) { -writel (0 , &ring->cfg->size); +u32 reg; + + reg =readl (&ring->cfg->size); + reg &=KNAV_RINGACC_CFG_RING_SIZE_MASK ;should it actually be "reg &= ~KNAV_RINGACC_CFG_RING_SIZE_MASK;"? Otherwise you could potentially bump the size to some number higher than
ring->sizeif you "OR"ring->sizewith something lower thanring->sizeandring->sizeis not N^2-1?
Hello Alexander, I didn't get your comment, can you explain in more detail?
Quoted 6 lines
Quoted 5 lines
drivers/soc/ti/k3-navss-ringacc-u-boot.c +2
-0+ reg |= ring->size; +writel (reg, &ring->cfg->size); } static void k3_ringacc_ring_reconfig_qmode_raw(struct k3_nav_ring *ring, enum k3_nav_ring_mode mode)
Re: [PATCH v3 04/10] soc: ti: k3-navss-ringacc: Fix reset ring API
Hi Chintan,
Quoted 47 lines · Chintan Vankar
Quoted 36 lines · Alexander
Hi Chintan, Vignesh,
Quoted 33 lines · Chintan Vankar
From: Vignesh Raghavendra <[email protected]>
Expectation of
k3_ringacc_ring_reset_raw()is to reset the ring to requested size and not to 0. Fix this.Signed-off-by Vignesh Raghavendra <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.drivers/soc/ti/k3-navss-ringacc-u-boot.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)drivers/soc/ti/k3-navss-ringacc-u-boot.c +0
-0@@ -25,9 +25,16 @@ struct k3_nav_ring_cfg_regs { #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_MASK GENMASK(26, 24) #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_SHIFT (24)drivers/soc/ti/k3-navss-ringacc-u-boot.c +2
-0+#define KNAV_RINGACC_CFG_RING_SIZE_MASK GENMASK(15, 0) +static void
k3_ringacc_ring_reset_raw(struct k3_nav_ring *ring){drivers/soc/ti/k3-navss-ringacc-u-boot.c +1
-1-writel (0 , &ring->cfg->size); +u32 reg;Quoted 9 lines
drivers/soc/ti/k3-navss-ringacc-u-boot.c struct k3_nav_ring_cfg_regs { · line 35
Quoted 3 lines
drivers/soc/ti/k3-navss-ringacc-u-boot.c +3
-0+ + reg =readl (&ring->cfg->size); + reg &=KNAV_RINGACC_CFG_RING_SIZE_MASK ;should it actually be "reg &= ~KNAV_RINGACC_CFG_RING_SIZE_MASK;"? Otherwise you could potentially bump the size to some number higher than
ring->sizeif you "OR"ring->sizewith something lower thanring->sizeandring->sizeis not N^2-1?
Quoted 2 lines
Hello Alexander, I didn't get your comment, can you explain in more detail?
What is the exact purpose of "reg &= KNAV_RINGACC_CFG_RING_SIZE_MASK;"? Which corner case is handled by it?
What happens if ring->cfg->size contains "1" and ring->size contains "2"? What will be written into ring->cfg->size?
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/soc/ti/k3-navss-ringacc-u-boot.c +2
-0+ reg |= ring->size; +writel (reg, &ring->cfg->size);}
static voidk3_ringacc_ring_reconfig_qmode_raw(struct k3_nav_ring *ring, enum k3_nav_ring_mode mode)
Signature · 3 lines
Alexander Sverdlin Siemens AG www.siemens.com
Re: [PATCH v3 04/10] soc: ti: k3-navss-ringacc: Fix reset ring API
Quoted 50 lines · Alexander
Hi Chintan,
Quoted 47 lines · Chintan Vankar
Quoted 45 lines · Alexander
Hi Chintan, Vignesh,
Quoted 26 lines · Chintan Vankar
From: Vignesh Raghavendra <[email protected]>
Expectation of
k3_ringacc_ring_reset_raw()is to reset the ring to requested size and not to 0. Fix this.Signed-off-by Vignesh Raghavendra <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.drivers/soc/ti/k3-navss-ringacc-u-boot.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/soc/ti/k3-navss-ringacc-u-boot.c +0
-0@@ -25,9 +25,16 @@ struct k3_nav_ring_cfg_regs { #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_MASK GENMASK(26, 24) #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_SHIFT (24)drivers/soc/ti/k3-navss-ringacc-u-boot.c struct k3_nav_ring_cfg_regs { · line 35
Quoted 10 lines
drivers/soc/ti/k3-navss-ringacc-u-boot.c +6
-1+#define KNAV_RINGACC_CFG_RING_SIZE_MASK GENMASK(15, 0) + static void k3_ringacc_ring_reset_raw(struct k3_nav_ring *ring) { -writel (0 , &ring->cfg->size); +u32 reg; + + reg =readl (&ring->cfg->size); + reg &=KNAV_RINGACC_CFG_RING_SIZE_MASK ;should it actually be "reg &= ~KNAV_RINGACC_CFG_RING_SIZE_MASK;"? Otherwise you could potentially bump the size to some number higher than
ring->sizeif you "OR"ring->sizewith something lower thanring->sizeandring->sizeis not N^2-1?
Quoted 9 lines
Quoted 2 lines
Hello Alexander, I didn't get your comment, can you explain in more detail?
What is the exact purpose of "reg &=
KNAV_RINGACC_CFG_RING_SIZE_MASK;"? Which corner case is handled by it?What happens if
ring->cfg->sizecontains "1" andring->sizecontains "2"? What will be written intoring->cfg->size?
Hello Alexander, Thank you for asking above questions, I got your point. You are correct that we need to "AND" negation of KNAV_RINGACC_CFG_RING_SIZE_MASK with reg.
By doing so we can avoid clearing out fields other than size, and also at the same time it will make sure to clear size field in ring->cfg->size and later we can "OR" it with requested size to not change other field in the reg and only update the size field.
I hope this is what you wanted to say at your very first comment.
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/soc/ti/k3-navss-ringacc-u-boot.c +2
-0+ reg |= ring->size; +writel (reg, &ring->cfg->size); } static void k3_ringacc_ring_reconfig_qmode_raw(struct k3_nav_ring *ring, enum k3_nav_ring_mode mode)
Re: [PATCH v3 04/10] soc: ti: k3-navss-ringacc: Fix reset ring API
Hi Chintan,
Quoted 57 lines · Chintan Vankar
Quoted 43 lines
Quoted 43 lines
Quoted 42 lines
Quoted 31 lines
From: Vignesh Raghavendra <[email protected]>
Expectation of
k3_ringacc_ring_reset_raw()is to reset the ring to requested size and not to 0. Fix this.Signed-off-by Vignesh Raghavendra <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.drivers/soc/ti/k3-navss-ringacc-u-boot.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)drivers/soc/ti/k3-navss-ringacc-u-boot.c +0
-0@@ -25,9 +25,16 @@ struct k3_nav_ring_cfg_regs { #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_MASK GENMASK(26, 24) #define KNAV_RINGACC_CFG_RING_SIZE_ELSIZE_SHIFT (24)drivers/soc/ti/k3-navss-ringacc-u-boot.c +2
-0+#define KNAV_RINGACC_CFG_RING_SIZE_MASK GENMASK(15, 0) +static void
k3_ringacc_ring_reset_raw(struct k3_nav_ring *ring){drivers/soc/ti/k3-navss-ringacc-u-boot.c struct k3_nav_ring_cfg_regs { · line 35
Quoted 5 lines
drivers/soc/ti/k3-navss-ringacc-u-boot.c +4
-1-writel (0 , &ring->cfg->size); +u32 reg; + + reg =readl (&ring->cfg->size); + reg &=KNAV_RINGACC_CFG_RING_SIZE_MASK ;should it actually be "reg &= ~KNAV_RINGACC_CFG_RING_SIZE_MASK;"? Otherwise you could potentially bump the size to some number higher than
ring->sizeif you "OR"ring->sizewith something lower thanring->sizeandring->sizeis not N^2-1?Quoted 9 lines
Quoted 2 lines
Hello Alexander, I didn't get your comment, can you explain in more detail?
What is the exact purpose of "reg &=
KNAV_RINGACC_CFG_RING_SIZE_MASK;"? Which corner case is handled by it?What happens if
ring->cfg->sizecontains "1" andring->sizecontains "2"? What will be written intoring->cfg->size?Hello Alexander, Thank you for asking above questions, I got your point. You are correct that we need to "AND" negation of
KNAV_RINGACC_CFG_RING_SIZE_MASKwith reg.
Quoted 6 lines
By doing so we can avoid clearing out fields other than size, and also at the same time it will make sure to clear size field in
ring->cfg->sizeand later we can "OR" it with requested size to not change other field in the reg and only update the size field.I hope this is what you wanted to say at your very first comment.
Yes, I think now we have common understanding!
Thanks for looking into this!
Signature · 3 lines
Alexander Sverdlin Siemens AG www.siemens.com
PATCH v3 5/10 dma: ti: k3-udma: Add support for native configuration of chan/flow
In reply to Chintan VankarFrom: Kishon Vijay Abraham I <[email protected]>
In absence of Device Manager (DM) services such as at R5 SPL stage, driver will have to natively setup TCHAN/RCHAN/RFLOW cfg registers. Existing UDMA driver performed the above mentioned configuration for UDMA. Add similar configuration for PKTDMA here.
---
Link to v2:
https://lore.kernel.org/r/[email protected]/
Changes from v2 to v3:
- No changes.
drivers/dma/ti/k3-udma.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/dma/ti/k3-udma.c +6 -0
@@ -2119,6 +2119,9 @@ static int bcdma_tisci_tx_channel_config(struct udma_chan *uc)if (ret)dev_err (ud->dev,"tchan%d cfg failed %d\n" , tchan->id, ret); +if (IS_ENABLED (CONFIG_K3_DM_FW )) +udma_alloc_tchan_raw (uc); +return ret; }
@@ -2167,6 +2170,9 @@ static int pktdma_tisci_rx_channel_config(struct udma_chan *uc)dev_err (ud->dev,"flow%d config failed: %d\n" , uc->rflow->id, ret); +if (IS_ENABLED (CONFIG_K3_DM_FW )) +udma_alloc_rchan_raw (uc); +return ret; }
Signature · 1 line
2.34.1
Re: [PATCH v3 05/10] dma: ti: k3-udma: Add support for native configuration of chan/flow
Hi Chintan,
Quoted 10 lines · Chintan Vankar
From: Kishon Vijay Abraham I <[email protected]>
In absence of Device Manager (DM) services such as at R5 SPL stage, driver will have to natively setup TCHAN/RCHAN/RFLOW cfg registers. Existing UDMA driver performed the above mentioned configuration for UDMA. Add similar configuration for PKTDMA here.
Signed-off-by Kishon Vijay Abraham I <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>
Quoted 35 lines
---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.drivers/dma/ti/k3-udma.c | 6 ++++++
1 file changed, 6 insertions(+)drivers/dma/ti/k3-udma.c +0
-0@@ -2119,6 +2119,9 @@ static int bcdma_tisci_tx_channel_config(struct udma_chan *uc) if (ret) dev_err(ud->dev, "tchan%d cfg failed %d\n", tchan->id, ret);drivers/dma/ti/k3-udma.c +3
-0+if (IS_ENABLED (CONFIG_K3_DM_FW )) +udma_alloc_tchan_raw (uc); +return ret;
}drivers/dma/ti/k3-udma.c +0
-0@@ -2167,6 +2170,9 @@ static int pktdma_tisci_rx_channel_config(struct udma_chan *uc) dev_err(ud->dev, "flow%d config failed: %d\n", uc->rflow->id, ret);drivers/dma/ti/k3-udma.c +3
-0+if (IS_ENABLED (CONFIG_K3_DM_FW )) +udma_alloc_rchan_raw (uc); +return ret;
}
Signature · 3 lines
Alexander Sverdlin Siemens AG www.siemens.com
PATCH v3 6/10 arm: mach-k3: am62x: am625_init: Probe AM65 CPSW NUSS
In reply to Chintan VankarFrom: Kishon Vijay Abraham I <[email protected]>
In order to support Ethernet boot on AM62x, probe AM65 CPSW NUSS driver in board_init_f().
---
Link to v2:
https://lore.kernel.org/r/[email protected]/
Changes from v2 to v3:
- No changes.
arch/arm/mach-k3/am62x/am625_init.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/mach-k3/am62x/am625_init.c +10 -0
@@ -280,6 +280,16 @@ void board_init_f(ulong dummy)if (ret)panic ("DRAM init failed: %d\n" , ret); } + +if (IS_ENABLED (CONFIG_SPL_ETH ) &&IS_ENABLED (CONFIG_TI_AM65_CPSW_NUSS ) && +spl_boot_device () ==BOOT_DEVICE_ETHERNET ) { +struct udevice *cpswdev; + +if (uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (am65_cpsw_nuss), + &cpswdev)) +printf ("Failed to probe am65_cpsw_nuss driver\n" ); + } +spl_enable_cache ();fixup_a53_cpu_freq_by_speed_grade ();
Signature · 1 line
2.34.1
Re: [PATCH v3 06/10] arm: mach-k3: am62x: am625_init: Probe AM65 CPSW NUSS
Hi Chintan,
Quoted 8 lines · Chintan Vankar
From: Kishon Vijay Abraham I <[email protected]>
In order to support Ethernet boot on AM62x, probe AM65 CPSW NUSS driver in
board_init_f().Signed-off-by Kishon Vijay Abraham I <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>
Quoted 32 lines
---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.arch/arm/mach-k3/am62x/am625_init.c | 10 ++++++++++
1 file changed, 10 insertions(+)arch/arm/mach-k3/am62x/am625_init.c +10
-0@@ -280,6 +280,16 @@ void board_init_f(ulong dummy) if (ret) panic("DRAM init failed: %d\n", ret); } + +if (IS_ENABLED (CONFIG_SPL_ETH ) &&IS_ENABLED (CONFIG_TI_AM65_CPSW_NUSS ) && + spl_boot_device() == BOOT_DEVICE_ETHERNET) { +struct udevice *cpswdev; + +if (uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (am65_cpsw_nuss), + &cpswdev)) +printf ("Failed to probe am65_cpsw_nuss driver\n" ); + } + spl_enable_cache();
fixup_a53_cpu_freq_by_speed_grade();
Signature · 3 lines
Alexander Sverdlin Siemens AG www.siemens.com
PATCH v3 7/10 configs: am62: Add configs for enabling ETHBOOT in R5SPL
In reply to Chintan VankarFrom: Kishon Vijay Abraham I <[email protected]>
Add configs for enabling ETHBOOT in R5SPL.
---
Link to v2:
https://lore.kernel.org/r/[email protected]/
Changes from v2 to v3:
- No changes.
configs/am62x_evm_r5_ethboot_defconfig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 configs/am62x_evm_r5_ethboot_defconfig
configs/am62x_evm_r5_ethboot_defconfig new file +20 -0
@@ -0,0 +1,20 @@ +#include<configs/am62x_evm_r5_defconfig> + +CONFIG_SPL_GPIO=y +CONFIG_SPL_MMC=n +CONFIG_SPL_BOARD_INIT=y +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x200000 +CONFIG_SPL_BSS_MAX_SIZE=0X3100 +CONFIG_SPL_DMA=y +CONFIG_SPL_ENV_SUPPORT=y +CONFIG_SPL_ETH=y +CONFIG_SPL_I2C=y +CONFIG_SPL_NET=y +CONFIG_SPL_NET_VCI_STRING="AM62X U-Boot R5 SPL" +CONFIG_CMD_DHCP=y +CONFIG_SPL_SYSCON=y +CONFIG_DMA_CHANNELS=y +CONFIG_TI_K3_NAVSS_UDMA=y +CONFIG_DM_I2C=y +CONFIG_PHY_TI_DP83867=y +CONFIG_TI_AM65_CPSW_NUSS=y
Signature · 1 line
2.34.1
Re: [PATCH v3 07/10] configs: am62: Add configs for enabling ETHBOOT in R5SPL
Quoted 26 lines · Chintan Vankar
From: Kishon Vijay Abraham I <[email protected]>
Add configs for enabling ETHBOOT in R5SPL.
Signed-off-by Kishon Vijay Abraham I <[email protected]>Signed-off-by Andreas Dannenberg <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.configs/am62x_evm_r5_ethboot_defconfig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 configs/am62x_evm_r5_ethboot_defconfigconfigs/am62x_evm_r5_ethboot_defconfig new file +0
-0
configs/am62x_evm_r5_ethboot_defconfig line 3
Quoted 3 lines
configs/am62x_evm_r5_ethboot_defconfig new file +3
-0@@ -0,0 +1,20 @@ +#include<configs/am62x_evm_r5_defconfig> + +CONFIG_SPL_GPIO=y
You need a few other options set in order for buildman to work in this case, please look at the other #include users.
Signature · 1 line
Tom
Re: [PATCH v3 07/10] configs: am62: Add configs for enabling ETHBOOT in R5SPL
Quoted 22 lines · Tom Rini
Quoted 20 lines · Chintan Vankar
From: Kishon Vijay Abraham I <[email protected]>
Add configs for enabling ETHBOOT in R5SPL.
Signed-off-by Kishon Vijay Abraham I <[email protected]>Signed-off-by Andreas Dannenberg <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.configs/am62x_evm_r5_ethboot_defconfig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)create mode 100644 configs/am62x_evm_r5_ethboot_defconfig
Quoted 13 lines
configs/am62x_evm_r5_ethboot_defconfig line 3
Quoted 9 lines
configs/am62x_evm_r5_ethboot_defconfig new file +3
-0@@ -0,0 +1,20 @@ +#include<configs/am62x_evm_r5_defconfig> + +CONFIG_SPL_GPIO=yYou need a few other options set in order for buildman to work in this case, please look at the other #include users.
Are you referring to include "configs/k3_efi_capsule.config" ?
Re: [PATCH v3 07/10] configs: am62: Add configs for enabling ETHBOOT in R5SPL
Quoted 39 lines · Chintan Vankar
Quoted 22 lines · Tom Rini
Quoted 20 lines · Chintan Vankar
From: Kishon Vijay Abraham I <[email protected]>
Add configs for enabling ETHBOOT in R5SPL.
Signed-off-by Kishon Vijay Abraham I <[email protected]>Signed-off-by Andreas Dannenberg <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.configs/am62x_evm_r5_ethboot_defconfig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)create mode 100644 configs/am62x_evm_r5_ethboot_defconfig
Quoted 13 lines
configs/am62x_evm_r5_ethboot_defconfig line 3
Quoted 9 lines
configs/am62x_evm_r5_ethboot_defconfig new file +3
-0@@ -0,0 +1,20 @@ +#include<configs/am62x_evm_r5_defconfig> + +CONFIG_SPL_GPIO=yYou need a few other options set in order for buildman to work in this case, please look at the other #include users.
Quoted 1 line
Are you referring to include "
configs/k3_efi_capsule.config" ?
No, I'm referring to:
$ grep -l '#include' configs configs/am62px_evm_a53_defconfig configs/am62x_beagleplay_a53_defconfig configs/am62x_evm_a53_defconfig configs/am62x_lpsk_a53_defconfig configs/am62x_lpsk_r5_defconfig configs/am64x_evm_a53_defconfig configs/am68_sk_a72_defconfig configs/am68_sk_r5_defconfig configs/am69_sk_a72_defconfig configs/am69_sk_r5_defconfig configs/j721e_beagleboneai64_a72_defconfig configs/j721e_evm_a72_defconfig configs/j721e_sk_a72_defconfig configs/j721e_sk_r5_defconfig configs/j784s4_evm_a72_defconfig
Signature · 1 line
Tom
PATCH v3 8/10 configs: am62: Enable configs required for Ethboot
In reply to Chintan VankarFrom: Kishon Vijay Abraham I <[email protected]>
Enable config options needed to support Ethernet boot on AM62x SK.
---
Link to v2:
https://lore.kernel.org/r/[email protected]/
Changes from v2 to v3:
- No changes.
configs/am62x_evm_a53_ethboot_defconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 configs/am62x_evm_a53_ethboot_defconfig
configs/am62x_evm_a53_ethboot_defconfig new file +12 -0
@@ -0,0 +1,12 @@ +#include <configs/am62x_evm_a53_defconfig> + +CONFIG_SPL_STACK_R_ADDR=0x83000000 +CONFIG_SPL_SIZE_LIMIT=0x80000 +CONFIG_SPL_DRIVERS_MISC=y +CONFIG_SPL_BOARD_INIT=y +CONFIG_SPL_DMA=y +CONFIG_SPL_ENV_SUPPORT=y +CONFIG_SPL_ETH=y +CONFIG_SPL_NET=y +CONFIG_SPL_NET_VCI_STRING="AM62X U-Boot A53 SPL" +CONFIG_SPL_SYSCON=y
Signature · 1 line
2.34.1
Re: [PATCH v3 08/10] configs: am62: Enable configs required for Ethboot
Quoted 25 lines · Chintan Vankar
From: Kishon Vijay Abraham I <[email protected]>
Enable config options needed to support Ethernet boot on AM62x SK.
Signed-off-by Kishon Vijay Abraham I <[email protected]>Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.configs/am62x_evm_a53_ethboot_defconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 configs/am62x_evm_a53_ethboot_defconfigconfigs/am62x_evm_a53_ethboot_defconfig new file +0
-0
configs/am62x_evm_a53_ethboot_defconfig line 1
Quoted 1 line
configs/am62x_evm_a53_ethboot_defconfig new file +1
-0@@ -0,0 +1,12 @@ +#include <configs/am62x_evm_a53_defconfig>
Same problem as the other defconfig.
Signature · 1 line
Tom
PATCH v3 9/10 arm: dts: k3-am625-r5-sk: Enable DM services for main_pktdma
In reply to Chintan VankarFrom: Siddharth Vadapalli <[email protected]>
Enable DM services for main_pktdma during R5 SPL stage.
---
Link to v2:
https://lore.kernel.org/r/[email protected]/
Changes from v2 to v3:
- No changes.
arch/arm/dts/k3-am625-r5-sk.dts | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/dts/k3-am625-r5-sk.dts +5 -0
@@ -83,3 +83,8 @@ reg = <0x00 0x0fc40000 0x00 0x100>, <0x00 0x60000000 0x00 0x08000000>; }; + +&main_pktdma { + ti,sci = <&dm_tifs>; + bootph-all; +};
Signature · 1 line
2.34.1
Re: [PATCH v3 09/10] arm: dts: k3-am625-r5-sk: Enable DM services for main_pktdma
Hi Chintan,
Quoted 6 lines · Chintan Vankar
From: Siddharth Vadapalli <[email protected]>
Enable DM services for
main_pktdmaduring R5 SPL stage.Signed-off-by Siddharth Vadapalli <[email protected]>Signed-off-by Chintan Vankar <[email protected]>
Quoted 24 lines
---
Link to v2:
https://lore.kernel.org/r/[email protected]/Changes from v2 to v3:
- No changes.arch/arm/dts/k3-am625-r5-sk.dts | 5 +++++
1 file changed, 5 insertions(+)arch/arm/dts/k3-am625-r5-sk.dts +5
-0@@ -83,3 +83,8 @@ reg = <0x00 0x0fc40000 0x00 0x100>, <0x00 0x60000000 0x00 0x08000000>; }; + +&main_pktdma { + ti,sci = <&dm_tifs>; + bootph-all; +};
Signature · 3 lines
Alexander Sverdlin Siemens AG www.siemens.com
PATCH v3 10/10 arch: arm: dts: k3-am62-sk-u-boot: Add missing "bootph-all" property to phy_gmii_sel node
In reply to Chintan VankarAdd "bootph-all" property to CPSW MAC's PHY node phy_gmii_sel.
---
Link to v2:
https://lore.kernel.org/r/[email protected]/
Changes from v2 to v3:
- Since "phy_gmii_sel" with "bootph-all" property is merged at upstream Linux for am62x-sk-common with commit "ba50141137fa", this patch can be drop with next DT-Sync.
arch/arm/dts/k3-am625-sk-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/k3-am625-sk-u-boot.dtsi +4 -0
@@ -12,6 +12,10 @@ }; }; +&phy_gmii_sel { + bootph-all; +}; + &main_timer0 { clock-frequency = <25000000>; };
Signature · 1 line
2.34.1
Re: [PATCH v3 10/10] arch: arm: dts: k3-am62-sk-u-boot: Add missing "bootph-all" property to phy_gmii_sel node
Quoted 8 lines · Chintan Vankar
Add "bootph-all" property to CPSW MAC's PHY node
phy_gmii_sel.Signed-off-by Chintan Vankar <[email protected]>---
Link to v2:
https://lore.kernel.org/r/[email protected]/
Quoted 7 lines
Changes from v2 to v3:
- Since "phy_gmii_sel" with "bootph-all" property is merged at upstream Linux for am62x-sk-common with commit "ba50141137fa", this patch can be drop with next DT-Sync.arch/arm/dts/k3-am625-sk-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
Please use the cherry-pick option to bring this change forward so there's nothing to do on the next re-sync, thanks.
Signature · 1 line
Tom