u-boot/arch/arm/mach-k3/r5/am62ax/am62a_qos_uboot.c
Aradhya Bhatia 72703c7a0d arm: mach-k3: Refactor QoS settings
Refactor common QoS code into a new common header file, and the soc
specific setup_qos functions into a common API.

Rename $(soc)_qos_count and $(soc)_qos_data variables to qos_count and
qos_data. When QoS settings of more SoCs are added, only one pair will
be defined at a time, based on the config SOC_K3_$(soc).

This refactoring has been done for 2 major purposes.

- The auto-generated $(soc)_qos_data.c and $(soc)_qos.h files cannot
  have any code that is specific to any bootloader. Those files have to
  remain agnostic of different bootloader implementations and their
  header files.

- The existing implementation was less than ideal and would have enabled
  multiple $(soc)_qos_count and $(soc)_qos_data variables for all SoC
  variants.

Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
2024-03-01 09:15:58 -05:00

48 lines
1.1 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_DSS_UL_MAIN_0_VBUSM_DMA + 0x100 + 0x4 * 0,
.val = ORDERID_8,
},
{
.reg = K3_DSS_UL_MAIN_0_VBUSM_DMA + 0x100 + 0x4 * 1,
.val = ORDERID_8,
},
{
.reg = K3_DSS_UL_MAIN_0_VBUSM_DMA + 0x100 + 0x4 * 2,
.val = ORDERID_8,
},
{
.reg = K3_DSS_UL_MAIN_0_VBUSM_DMA + 0x100 + 0x4 * 3,
.val = ORDERID_8,
},
/* 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_DSS_UL_MAIN_0_VBUSM_DMA + 0,
.val = 0x76543210,
},
{
.reg = K3_DSS_UL_MAIN_0_VBUSM_DMA + 4,
.val = 0xfedcba98,
},
};
u32 qos_count = ARRAY_SIZE(qos_data);