Skip to content

Commit

Permalink
arm: mach-k3: am6_init: Prioritize MSMC traffic over DDR in NAVSS Nor…
Browse files Browse the repository at this point in the history
…thbridge

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 patch does just that.

This is required to fix ICSSG TX lock-ups due to delays in
MSMC transfers due to incorrect Northbridge configuration.
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, extened commit log]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
Roger Quadros authored and jan-kiszka committed Sep 7, 2021
1 parent ad320c2 commit 2cf7a2f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions arch/arm/mach-k3/am6_init.c
Expand Up @@ -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)
Expand All @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/mach-k3/include/mach/am6_hardware.h
Expand Up @@ -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 */

0 comments on commit 2cf7a2f

Please sign in to comment.