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;
#include <elf.h>
#include <soc.h>
+#include <asm/arch/k3-qos.h>
+
#if IS_ENABLED(CONFIG_SYS_K3_SPL_ATF)
enum {
IMAGE_ID_ATF,
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
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
#ifdef CONFIG_SOC_K3_AM62A7
#include "am62a_hardware.h"
-#include "am62a_qos.h"
#endif
/* Assuming these addresses and definitions stay common across K3 devices */
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_ */
--- /dev/null
+/* 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_ */
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
obj-y += clk-data.o
obj-y += dev-data.o
-obj-y += am62a_qos_data.o
+obj-y += am62a_qos_uboot.o
*
* 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,
},
};
-uint32_t am62a_qos_count = sizeof(am62a_qos_data) / sizeof(am62a_qos_data[0]);
+u32 qos_count = ARRAY_SIZE(qos_data);