From 287a3b25bde4a340f81b0c85ca32860b6a39c1a0 Mon Sep 17 00:00:00 2001 From: Reid Tonking Date: Tue, 19 Nov 2024 06:02:56 +0530 Subject: misc: k3_avs: Add OPP_LOW voltage and frequency to vd_data J7200 SOC supports OPP_LOW and OPP_NOM as two Operating Performance Points as per (7.5 Operating Performance Points) section in the Datasheet [0]. - A72SS/MSMC at 2 GHz/1GHz operation must use OPP_NOM. - A72SS/MSMC at 1 GHz/500 MHz operation can use OPP_NOM or OPP_LOW voltage (though OPP_LOW voltage is recommended to reduce power consumption). Add OPP_LOW frequency->voltage entry to vd_data. The actual OPP voltage for the device is read from the efuse and updated in k3_avs_probe(). OPP_NOM corresponds to OPP_1 and OPP_LOW to OPP_0 efuse register fields, as described in the Datasheet [0] The register offsets and fields are described in the TRM (5.2.6.1.5 WKUP_VTM_VD_OPPVID_j Register) [1]. [0]: https://www.ti.com/lit/gpn/dra821u (J7200 Datasheet) [1]: https://www.ti.com/lit/pdf/spruiu1 (J7200 TRM) Signed-off-by: Reid Tonking Signed-off-by: Aniket Limaye --- include/k3-avs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/k3-avs.h b/include/k3-avs.h index 1014d5d114d..f6f1031c9cc 100644 --- a/include/k3-avs.h +++ b/include/k3-avs.h @@ -20,6 +20,7 @@ #define NUM_OPPS 4 +#define AM6_OPP_LOW 0 #define AM6_OPP_NOM 1 #define AM6_OPP_OD 2 #define AM6_OPP_TURBO 3 -- cgit v1.2.3 From afe0ab6d3004b435cd17d3b5864de6461d68c7a0 Mon Sep 17 00:00:00 2001 From: Reid Tonking Date: Tue, 19 Nov 2024 06:02:57 +0530 Subject: misc: k3_avs: Check validity of efuse voltage data k3_avs driver checks opp_ids when probing and overwrites the voltage values in vd_data for the respective board. The new k3_avs_check_opp() can be called from board files to check the efuse data and returns 0 if valid. Also add the same check in k3_avs_program_voltage() to error out if the efuse data was not valid. Signed-off-by: Reid Tonking Signed-off-by: Aniket Limaye Reviewed-by: Manorit Chawdhry --- include/k3-avs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/k3-avs.h b/include/k3-avs.h index f6f1031c9cc..5a973e4ed45 100644 --- a/include/k3-avs.h +++ b/include/k3-avs.h @@ -27,5 +27,6 @@ int k3_avs_set_opp(struct udevice *dev, int vdd_id, int opp_id); int k3_avs_notify_freq(int dev_id, int clk_id, u32 freq); +int k3_avs_check_opp(struct udevice *dev, int vdd_id, int opp_id); #endif -- cgit v1.2.3