u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] arm: mach-k3: am6_init: Prioritize MSMC traffic over DDR in NAVSS Northbridge
@ 2021-09-08 20:28 Nishanth Menon
  2021-09-17 22:53 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Nishanth Menon @ 2021-09-08 20:28 UTC (permalink / raw)
  To: Jan Kiszka, Benoit Parrot, Lokesh Vutla, trini
  Cc: u-boot, Grygorii Strashko, Bao Cheng Su, nm

From: Roger Quadros <rogerq@ti.com>

NB0 is bridge to SRAM and NB1 is bridge to DDR.

To ensure that SRAM transfers are not stalled due to delays during DDR
refreshes, SRAM traffic should be higher priority (threadmap=2) than
DDR traffic (threadmap=0).

This fixup is critical to provide deterministic access latency to
MSMC from ICSSG, it applies to all AM65 silicon revisions and is due
to incorrect reset values (has no erratum id) and statically setting
things up should be done independent of usecases and board.

This specific style of Northbridge configuration is specific only to
AM65x devices, follow-on K3 devices have different data prioritization
schemes (ASEL and the like) and hence the fixup applies purely to
AM65x.

Without this fix, ICSSG TX lock-ups due to delays in MSMC transfers in
case of SR1 devices, on SR2 devices, lockups were not observed so far
but high retry rates of ICSSG Ethernet (icssg-eth) and, thus, lower
throughput.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Andrew F. Davis <afd@ti.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Benoit Parrot <bparrot@ti.com>
[Jan: rebased, dropped used define, extended commit log]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
[Nishanth: Provide relevant context in the commit message]
Signed-off-by: Nishanth Menon<nm@ti.com>
---

Changes in V2:
* rebase (Thanks Jan)
* Updated commit message.

V1:
https://patchwork.ozlabs.org/project/uboot/patch/20200130080503.28657-1-rogerq@ti.com/

 arch/arm/mach-k3/am6_init.c                  | 15 +++++++++++++++
 arch/arm/mach-k3/include/mach/am6_hardware.h |  6 ++++++
 2 files changed, 21 insertions(+)

diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c
index 425b3f93c865..ffb7aaded2e7 100644
--- a/arch/arm/mach-k3/am6_init.c
+++ b/arch/arm/mach-k3/am6_init.c
@@ -151,6 +151,19 @@ int fdtdec_board_setup(const void *fdt_blob)
 	return fixup_usb_boot();
 }
 #endif
+
+static void setup_am654_navss_northbridge(void)
+{
+	/*
+	 * NB0 is bridge to SRAM and NB1 is bridge to DDR.
+	 * To ensure that SRAM transfers are not stalled due to
+	 * delays during DDR refreshes, SRAM traffic should be higher
+	 * priority (threadmap=2) than DDR traffic (threadmap=0).
+	 */
+	writel(0x2, NAVSS0_NBSS_NB0_CFG_BASE + NAVSS_NBSS_THREADMAP);
+	writel(0x0, NAVSS0_NBSS_NB1_CFG_BASE + NAVSS_NBSS_THREADMAP);
+}
+
 void board_init_f(ulong dummy)
 {
 #if defined(CONFIG_K3_LOAD_SYSFW) || defined(CONFIG_K3_AM654_DDRSS)
@@ -168,6 +181,8 @@ void board_init_f(ulong dummy)
 	/* Make all control module registers accessible */
 	ctrl_mmr_unlock();
 
+	setup_am654_navss_northbridge();
+
 #ifdef CONFIG_CPU_V7R
 	disable_linefill_optimization();
 	setup_k3_mpu_regions();
diff --git a/arch/arm/mach-k3/include/mach/am6_hardware.h b/arch/arm/mach-k3/include/mach/am6_hardware.h
index 1908a13f0ff2..f533e22e0617 100644
--- a/arch/arm/mach-k3/include/mach/am6_hardware.h
+++ b/arch/arm/mach-k3/include/mach/am6_hardware.h
@@ -52,4 +52,10 @@
 /* MCU SCRATCHPAD usage */
 #define TI_SRAM_SCRATCH_BOARD_EEPROM_START CONFIG_SYS_K3_MCU_SCRATCHPAD_BASE
 
+/* NAVSS Northbridge config */
+#define	NAVSS0_NBSS_NB0_CFG_BASE			0x03802000
+#define	NAVSS0_NBSS_NB1_CFG_BASE			0x03803000
+
+#define	NAVSS_NBSS_THREADMAP				0x10
+
 #endif /* __ASM_ARCH_AM6_HARDWARE_H */
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V2] arm: mach-k3: am6_init: Prioritize MSMC traffic over DDR in NAVSS Northbridge
  2021-09-08 20:28 [PATCH V2] arm: mach-k3: am6_init: Prioritize MSMC traffic over DDR in NAVSS Northbridge Nishanth Menon
@ 2021-09-17 22:53 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2021-09-17 22:53 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Jan Kiszka, Benoit Parrot, Lokesh Vutla, u-boot,
	Grygorii Strashko, Bao Cheng Su

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

On Wed, Sep 08, 2021 at 03:28:59PM -0500, Nishanth Menon wrote:

> From: Roger Quadros <rogerq@ti.com>
> 
> NB0 is bridge to SRAM and NB1 is bridge to DDR.
> 
> To ensure that SRAM transfers are not stalled due to delays during DDR
> refreshes, SRAM traffic should be higher priority (threadmap=2) than
> DDR traffic (threadmap=0).
> 
> This fixup is critical to provide deterministic access latency to
> MSMC from ICSSG, it applies to all AM65 silicon revisions and is due
> to incorrect reset values (has no erratum id) and statically setting
> things up should be done independent of usecases and board.
> 
> This specific style of Northbridge configuration is specific only to
> AM65x devices, follow-on K3 devices have different data prioritization
> schemes (ASEL and the like) and hence the fixup applies purely to
> AM65x.
> 
> Without this fix, ICSSG TX lock-ups due to delays in MSMC transfers in
> case of SR1 devices, on SR2 devices, lockups were not observed so far
> but high retry rates of ICSSG Ethernet (icssg-eth) and, thus, lower
> throughput.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Acked-by: Andrew F. Davis <afd@ti.com>
> Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Acked-by: Benoit Parrot <bparrot@ti.com>
> [Jan: rebased, dropped used define, extended commit log]
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> [Nishanth: Provide relevant context in the commit message]
> Signed-off-by: Nishanth Menon<nm@ti.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-17 22:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 20:28 [PATCH V2] arm: mach-k3: am6_init: Prioritize MSMC traffic over DDR in NAVSS Northbridge Nishanth Menon
2021-09-17 22:53 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).