From: Tero Kristo Date: Mon, 21 Oct 2019 09:17:47 +0300 Subject: [U-Boot] [PATCH 01/10] power: add driver for K3 Adaptive Voltage Scaling Class 0 In-Reply-To: <4572b2f7-610b-58a0-0c9b-0cf146f7b5b7@ti.com> References: <20191014084102.18863-1-j-keerthy@ti.com> <20191014084102.18863-2-j-keerthy@ti.com> <18194a0c-4506-edb2-5d4d-e1d74b0419f6@ti.com> <4572b2f7-610b-58a0-0c9b-0cf146f7b5b7@ti.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On 21/10/2019 08:32, Keerthy wrote: > > > On 15/10/19 12:27 PM, Lokesh Vutla wrote: >> >> [..snip..] >> >>> +}; >>> diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h >>> index f431f3bf29..605b52905e 100644 >>> --- a/include/dm/uclass-id.h >>> +++ b/include/dm/uclass-id.h >>> @@ -31,6 +31,7 @@ enum uclass_id { >>>       UCLASS_ADC,        /* Analog-to-digital converter */ >>>       UCLASS_AHCI,        /* SATA disk controller */ >>>       UCLASS_AUDIO_CODEC,    /* Audio codec with control and data >>> path */ >>> +    UCLASS_AVS,        /* Adaptive voltage scaling */ >> >> In general there should be sandbox tests written for adding any such >> new UCLASS. > > Tero, > > This is not a generic UCLASS driver. This is a K3 specific driver. So > should this be really introducing a new UCLASS? Well, AVS is kind of generic across TI SoCs. However, I am fine just using UCLASS_MISC if we don't want to introduce a new uclass.... assuming we don't get sequencing issues with remoteproc if we do that. -Tero > > - Keerthy > >> >> Thanks and regards, >> Lokesh >> >>>       UCLASS_AXI,        /* AXI bus */ >>>       UCLASS_BLK,        /* Block device */ >>>       UCLASS_BOARD,        /* Device information from hardware */ >>> diff --git a/include/k3-avs.h b/include/k3-avs.h >>> new file mode 100644 >>> index 0000000000..9867481617 >>> --- /dev/null >>> +++ b/include/k3-avs.h >>> @@ -0,0 +1,28 @@ >>> +// SPDX-License-Identifier: GPL-2.0+ >>> +/* >>> + * Texas Instruments' K3 Adaptive Voltage Scaling driver >>> + * >>> + * Copyright (C) 2019 Texas Instruments Incorporated - >>> http://www.ti.com/ >>> + *      Tero Kristo >>> + * >>> + */ >>> + >>> +#ifndef _K3_AVS0_ >>> +#define _K3_AVS0_ >>> + >>> +#define AM6_VDD_WKUP        0 >>> +#define AM6_VDD_MCU        1 >>> +#define AM6_VDD_CORE        2 >>> +#define AM6_VDD_MPU0        3 >>> +#define AM6_VDD_MPU1        4 >>> + >>> +#define NUM_OPPS        4 >>> + >>> +#define AM6_OPP_NOM        1 >>> +#define AM6_OPP_OD        2 >>> +#define AM6_OPP_TURBO        3 >>> + >>> +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); >>> + >>> +#endif >>> -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki