[processor-sdk/performance-audio-sr.git] / pdk_k2g_1_0_1_0_eng / packages / ti / boot / sbl / board / src / sbl_avs_config.h
1 /**
2 * \file sbl_avs_config.h
3 *
4 * \brief This file contains functions and data related to AVS and ABB
5 * configuration for the voltage rails.
6 *
7 */
9 /*
10 * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 *
16 * Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 *
19 * Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the
22 * distribution.
23 *
24 * Neither the name of Texas Instruments Incorporated nor the names of
25 * its contributors may be used to endorse or promote products derived
26 * from this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 */
42 #include <stdint.h>
43 #include <string.h>
45 /* Macro values defining the different OPP Configuration supported. */
46 #define OPP_MODE_NOM (0)
47 #define OPP_MODE_OD (1)
48 #define OPP_MODE_HIGH (2)
50 /**
51 * struct volts_efuse_data - efuse definition for voltage
52 * @reg: register address for efuse
53 * @reg_bits: Number of bits in a register address, mandatory.
54 */
55 typedef struct efuse_data
56 {
57 uint32_t reg;
58 uint8_t reg_bits;
59 }efuse_data_t;
61 typedef struct voltage_rail {
62 uint32_t value;
63 uint32_t addr;
64 efuse_data_t efuse;
65 }voltage_rail_t;
67 typedef struct vcores_data
68 {
69 voltage_rail_t mpu;
70 voltage_rail_t core;
71 voltage_rail_t dsp;
72 voltage_rail_t gpu;
73 voltage_rail_t iva;
74 }vcores_data_t;
76 typedef struct abb_data {
77 uint32_t efuseReg;
78 uint32_t setupReg;
79 uint32_t ctrlReg;
80 uint32_t irqReg;
81 uint32_t irqBit;
82 uint32_t ldoVbbCtrlReg;
83 }abb_data_t;
85 typedef struct boardOppData
86 {
87 uint32_t oppVal;
88 const vcores_data_t *pboardOppData;
89 }boardOppData_t;
91 /**
92 * \brief EVM Board ID.
93 */
94 typedef enum boardId
95 {
96 BOARD_MIN,
97 /**< Should be the first value of this enumeration. */
98 BOARD_UNKNOWN = BOARD_MIN,
99 /**< Unknown board. */
100 BOARD_GPEVMAM572x = 0x1U,
101 /**< General Purpose EVM */
102 BOARD_IDKAM572x = 0x2U,
103 /**< AM572x IDK */
104 BOARD_IDKAM571x = 0x3U,
105 /**< AM571x IDK */
106 BOARD_CUSTOM = 0x4U,
107 /**< Any other custom board. */
108 BOARD_MAX = BOARD_CUSTOM
109 /**< Max board ID. */
110 } boardId_t;
112 /**
113 * \brief This API performs the AVS by scaling the the domain voltage level
114 * to specific values within the operational voltage range of the
115 * device.
116 *
117 * \param oppMode OPP value for which the OPP configuration is to be done.
118 */
119 void SBL_Configure_AVS(uint32_t oppMode);