u-boot/arch/arm/mach-k3/r5/am62ax/am62a_qos_uboot.c
Jayesh Choudhary 6bc9a5c92f arm: mach-k3: am62a: Simplify the logic for QOS reg and val propagation
For the QOS registers, instead of using the raw values for calculation
for each reg field, use a defined macro which takes in argument for all
the reg fields to get the desired value.
Do the similar simplification for QOS register and group registers and
make the corresponding changes for am62a_qos_uboot file.

Suggested-by: Andrew Davis <afd@ti.com>
Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Acked-by: Andrew Davis <afd@ti.com>
2024-06-24 09:51:09 -06:00

48 lines
1.2 KiB
C

// SPDX-License-Identifier: GPL-2.0+
/*
* am62a Quality of Service (QoS) Configuration Data
* Auto generated from K3 Resource Partitioning tool
*
* Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/
*/
#include <asm/arch/k3-qos.h>
#include "am62a_qos.h"
struct k3_qos_data qos_data[] = {
/* modules_qosConfig0 - 1 endpoints, 4 channels */
{
.reg = K3_QOS_REG(K3_DSS_UL_MAIN_0_VBUSM_DMA, 0),
.val = K3_QOS_VAL(0, 8, 0, 0, 0, 0),
},
{
.reg = K3_QOS_REG(K3_DSS_UL_MAIN_0_VBUSM_DMA, 1),
.val = K3_QOS_VAL(0, 8, 0, 0, 0, 0),
},
{
.reg = K3_QOS_REG(K3_DSS_UL_MAIN_0_VBUSM_DMA, 2),
.val = K3_QOS_VAL(0, 8, 0, 0, 0, 0),
},
{
.reg = K3_QOS_REG(K3_DSS_UL_MAIN_0_VBUSM_DMA, 3),
.val = K3_QOS_VAL(0, 8, 0, 0, 0, 0),
},
/* Following registers set 1:1 mapping for orderID MAP1/MAP2
* remap registers. orderID x is remapped to orderID x again
* This is to ensure orderID from MAP register is unchanged
*/
/* K3_DSS_UL_MAIN_0_VBUSM_DMA - 1 groups */
{
.reg = K3_QOS_GROUP_REG(K3_DSS_UL_MAIN_0_VBUSM_DMA, 0),
.val = K3_QOS_GROUP_DEFAULT_VAL_LOW,
},
{
.reg = K3_QOS_GROUP_REG(K3_DSS_UL_MAIN_0_VBUSM_DMA, 1),
.val = K3_QOS_GROUP_DEFAULT_VAL_HIGH,
},
};
u32 qos_count = ARRAY_SIZE(qos_data);