From patchwork Wed Oct 11 16:42:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Brack X-Patchwork-Id: 824491 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yC0C82ftpz9s82 for ; Thu, 12 Oct 2017 03:42:44 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 4A2DDC21E18; Wed, 11 Oct 2017 16:42:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C3E82C21E14; Wed, 11 Oct 2017 16:42:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 91387C21E14; Wed, 11 Oct 2017 16:42:33 +0000 (UTC) Received: from mail.ltec.ch (mail.ltec.ch [95.143.48.181]) by lists.denx.de (Postfix) with ESMTPS id ACCD7C21D92 for ; Wed, 11 Oct 2017 16:42:31 +0000 (UTC) Received: from nebula.ltec ([172.27.11.2] helo=vm64.ltec) by mail.ltec.ch with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1e2K5Y-0002oW-Tk; Wed, 11 Oct 2017 18:42:32 +0200 From: Felix Brack To: u-boot@lists.denx.de Date: Wed, 11 Oct 2017 18:42:23 +0200 Message-Id: <1507740143-12732-1-git-send-email-fb@ltec.ch> X-Mailer: git-send-email 2.7.4 Cc: t-kristo@ti.com Subject: [U-Boot] [PATCH] am33xx: Add a function to query MPU voltage in uV X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" For the DM TPS65910 driver I'm working on, querying the MPU voltage should return a value in uV. This value can then be used by the regulator's standard function set_value to set the MPU voltage. Signed-off-by: Felix Brack Reviewed-by: Lokesh Vutla --- arch/arm/include/asm/arch-am33xx/sys_proto.h | 1 + arch/arm/mach-omap2/am33xx/sys_info.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h index 4e78aaf..57fbfa4 100644 --- a/arch/arm/include/asm/arch-am33xx/sys_proto.h +++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h @@ -40,6 +40,7 @@ void enable_norboot_pin_mux(void); #endif void am33xx_spl_board_init(void); int am335x_get_efuse_mpu_max_freq(struct ctrl_dev *cdev); +int am335x_get_mpu_vdd(int sil_rev, int frequency); int am335x_get_tps65910_mpu_vdd(int sil_rev, int frequency); #endif diff --git a/arch/arm/mach-omap2/am33xx/sys_info.c b/arch/arm/mach-omap2/am33xx/sys_info.c index ea434aa..0181a8c 100644 --- a/arch/arm/mach-omap2/am33xx/sys_info.c +++ b/arch/arm/mach-omap2/am33xx/sys_info.c @@ -175,6 +175,22 @@ int am335x_get_efuse_mpu_max_freq(struct ctrl_dev *cdev) return MPUPLL_M_720; } +int am335x_get_mpu_vdd(int sil_rev, int frequency) +{ + int sel_mask = am335x_get_tps65910_mpu_vdd(sil_rev, frequency); + + switch (sel_mask) { + case TPS65910_OP_REG_SEL_1_3_2_5: + return 1325000; + case TPS65910_OP_REG_SEL_1_2_0: + return 1200000; + case TPS65910_OP_REG_SEL_1_1_0: + return 1100000; + default: + return 1262500; + } +} + int am335x_get_tps65910_mpu_vdd(int sil_rev, int frequency) { /* For PG2.0 and later, we have one set of values. */