aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-k3
diff options
context:
space:
mode:
authorTom Rini2024-03-11 13:40:06 -0400
committerTom Rini2024-03-11 15:27:20 -0400
commit20a0ce574d6642e0dfe651467159039fac48cc4f (patch)
tree9a76dcd90a2e27e65963b4a74d1621cd10fe91f0 /arch/arm/mach-k3
parentbeedf675b36841ce1e077779157a87a6505317e6 (diff)
parentf3c979dd0053c082d2df170446923e7ce5edbc2d (diff)
Merge tag 'v2024.04-rc4' into next
Prepare v2024.04-rc4
Diffstat (limited to 'arch/arm/mach-k3')
-rw-r--r--arch/arm/mach-k3/am62a7_init.c14
-rw-r--r--arch/arm/mach-k3/common.c12
-rw-r--r--arch/arm/mach-k3/common.h8
-rw-r--r--arch/arm/mach-k3/include/mach/hardware.h9
-rw-r--r--arch/arm/mach-k3/include/mach/k3-qos.h22
-rw-r--r--arch/arm/mach-k3/r5/Kconfig8
-rw-r--r--arch/arm/mach-k3/r5/am62ax/Makefile2
-rw-r--r--arch/arm/mach-k3/r5/am62ax/am62a_qos.h (renamed from arch/arm/mach-k3/include/mach/am62a_qos.h)0
-rw-r--r--arch/arm/mach-k3/r5/am62ax/am62a_qos_uboot.c (renamed from arch/arm/mach-k3/r5/am62ax/am62a_qos_data.c)9
9 files changed, 56 insertions, 28 deletions
diff --git a/arch/arm/mach-k3/am62a7_init.c b/arch/arm/mach-k3/am62a7_init.c
index ccbde5bdd85..2a0221a3718 100644
--- a/arch/arm/mach-k3/am62a7_init.c
+++ b/arch/arm/mach-k3/am62a7_init.c
@@ -69,20 +69,6 @@ static void ctrl_mmr_unlock(void)
mmr_unlock(PADCFG_MMR1_BASE, 1);
}
-#if (IS_ENABLED(CONFIG_CPU_V7R))
-static void setup_qos(void)
-{
- u32 i;
-
- for (i = 0; i < am62a_qos_count; i++)
- writel(am62a_qos_data[i].val, (uintptr_t)am62a_qos_data[i].reg);
-}
-#else
-static void setup_qos(void)
-{
-}
-#endif
-
void board_init_f(ulong dummy)
{
struct udevice *dev;
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index ed8aec360c9..b0fb87b97a2 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -28,6 +28,8 @@
#include <elf.h>
#include <soc.h>
+#include <asm/arch/k3-qos.h>
+
struct ti_sci_handle *get_ti_sci_handle(void)
{
struct udevice *dev;
@@ -284,3 +286,13 @@ int misc_init_r(void)
void __weak do_board_detect(void)
{
}
+
+#if (IS_ENABLED(CONFIG_K3_QOS))
+void setup_qos(void)
+{
+ u32 i;
+
+ for (i = 0; i < qos_count; i++)
+ writel(qos_data[i].val, (uintptr_t)qos_data[i].reg);
+}
+#endif
diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h
index e9db9fbfb63..53aa186b31a 100644
--- a/arch/arm/mach-k3/common.h
+++ b/arch/arm/mach-k3/common.h
@@ -45,3 +45,11 @@ void ti_secure_image_post_process(void **p_image, size_t *p_size);
struct ti_sci_handle *get_ti_sci_handle(void);
void do_board_detect(void);
void ti_secure_image_check_binary(void **p_image, size_t *p_size);
+
+#if (IS_ENABLED(CONFIG_K3_QOS))
+void setup_qos(void);
+#else
+static inline void setup_qos(void)
+{
+}
+#endif
diff --git a/arch/arm/mach-k3/include/mach/hardware.h b/arch/arm/mach-k3/include/mach/hardware.h
index 74692b745ad..055715f20d6 100644
--- a/arch/arm/mach-k3/include/mach/hardware.h
+++ b/arch/arm/mach-k3/include/mach/hardware.h
@@ -30,7 +30,6 @@
#ifdef CONFIG_SOC_K3_AM62A7
#include "am62a_hardware.h"
-#include "am62a_qos.h"
#endif
#ifdef CONFIG_SOC_K3_J784S4
@@ -102,12 +101,4 @@ struct rom_extended_boot_data {
u32 num_components;
};
-struct k3_qos_data {
- u32 reg;
- u32 val;
-};
-
-extern struct k3_qos_data am62a_qos_data[];
-extern u32 am62a_qos_count;
-
#endif /* _ASM_ARCH_HARDWARE_H_ */
diff --git a/arch/arm/mach-k3/include/mach/k3-qos.h b/arch/arm/mach-k3/include/mach/k3-qos.h
new file mode 100644
index 00000000000..e00e1de5b9c
--- /dev/null
+++ b/arch/arm/mach-k3/include/mach/k3-qos.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Quality of Service (QoS) Configuration Header File
+ *
+ * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
+ */
+#ifndef _K3_QOS_H_
+#define _K3_QOS_H_
+
+#include <linux/kernel.h>
+
+struct k3_qos_data {
+ u32 reg;
+ u32 val;
+};
+
+#if (IS_ENABLED(CONFIG_K3_QOS))
+extern struct k3_qos_data qos_data[];
+extern u32 qos_count;
+#endif
+
+#endif /* _K3_QOS_H_ */
diff --git a/arch/arm/mach-k3/r5/Kconfig b/arch/arm/mach-k3/r5/Kconfig
index 317a6c4b67e..878087fbf56 100644
--- a/arch/arm/mach-k3/r5/Kconfig
+++ b/arch/arm/mach-k3/r5/Kconfig
@@ -1,6 +1,14 @@
config K3_LOAD_SYSFW
bool
+config K3_QOS
+ bool "Enable Quality of Service (QoS) Settings for TI K3 SoCs"
+ default y if SOC_K3_AM62A7
+ help
+ This option enables the R5 SPL to apply QoS settings for various
+ HW controllers inside the TI K3 SoCs. The files for QoS settings are
+ generated from Sysconfig and k3-resource-partitioning tools.
+
config K3_SYSFW_IMAGE_NAME
string "File name of SYSFW firmware and configuration blob"
depends on K3_LOAD_SYSFW
diff --git a/arch/arm/mach-k3/r5/am62ax/Makefile b/arch/arm/mach-k3/r5/am62ax/Makefile
index 02a941805e9..e4e55ce5c7d 100644
--- a/arch/arm/mach-k3/r5/am62ax/Makefile
+++ b/arch/arm/mach-k3/r5/am62ax/Makefile
@@ -4,4 +4,4 @@
obj-y += clk-data.o
obj-y += dev-data.o
-obj-y += am62a_qos_data.o
+obj-y += am62a_qos_uboot.o
diff --git a/arch/arm/mach-k3/include/mach/am62a_qos.h b/arch/arm/mach-k3/r5/am62ax/am62a_qos.h
index c74d69a28f8..c74d69a28f8 100644
--- a/arch/arm/mach-k3/include/mach/am62a_qos.h
+++ b/arch/arm/mach-k3/r5/am62ax/am62a_qos.h
diff --git a/arch/arm/mach-k3/r5/am62ax/am62a_qos_data.c b/arch/arm/mach-k3/r5/am62ax/am62a_qos_uboot.c
index 38db4f2f5c8..9a82944d5fe 100644
--- a/arch/arm/mach-k3/r5/am62ax/am62a_qos_data.c
+++ b/arch/arm/mach-k3/r5/am62ax/am62a_qos_uboot.c
@@ -5,10 +5,11 @@
*
* Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/
*/
-#include <asm/arch/hardware.h>
-#include "common.h"
-struct k3_qos_data am62a_qos_data[] = {
+#include <asm/arch/k3-qos.h>
+#include "am62a_qos.h"
+
+struct k3_qos_data qos_data[] = {
/* modules_qosConfig0 - 1 endpoints, 4 channels */
{
.reg = K3_DSS_UL_MAIN_0_VBUSM_DMA + 0x100 + 0x4 * 0,
@@ -43,4 +44,4 @@ struct k3_qos_data am62a_qos_data[] = {
},
};
-uint32_t am62a_qos_count = sizeof(am62a_qos_data) / sizeof(am62a_qos_data[0]);
+u32 qos_count = ARRAY_SIZE(qos_data);