From patchwork Wed Feb 13 16:46:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1041435 X-Patchwork-Delegate: promsoft@gmail.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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="j0eOAtfp"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44056N6vrvz9s2P for ; Thu, 14 Feb 2019 03:47:24 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 8465CC2200E; Wed, 13 Feb 2019 16:47:14 +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=T_DKIM_INVALID 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 176A2C22099; Wed, 13 Feb 2019 16:47:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E4E50C21FEC; Wed, 13 Feb 2019 16:46:58 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id B8326C21F98 for ; Wed, 13 Feb 2019 16:46:57 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 71CA5222CF; Wed, 13 Feb 2019 16:46:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550076416; bh=yp3Q1bL+KJ7TAQMrlCeejKPok81K/Jq61WERezNMbiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j0eOAtfp0qakRBnKIgLimE5rOFNTG0UCK4Fi9DdXgG2wnicZi7WEmCSq6ptGff3h+ GPnzKfeA/A1ikDN8yOrBCl2KrweuRyzl7qGU2z5BrNr/RecnPaLoefXWR4mGJySkIB uiB8Z04/PFdM1q6UHDuvsF1mD7pDo5B8Sfa3jwTc= From: Krzysztof Kozlowski To: Albert Aribaud , Jaehoon Chung , Lukasz Majewski , Simon Glass , Minkyu Kang , Marek Szyprowski , u-boot@lists.denx.de Date: Wed, 13 Feb 2019 17:46:40 +0100 Message-Id: <20190213164648.26579-2-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213164648.26579-1-krzk@kernel.org> References: <20190213164648.26579-1-krzk@kernel.org> Cc: Krzysztof Kozlowski Subject: [U-Boot] [PATCH v2 1/9] adc: exynos-adc: Fix wrong bit operation used to stop the ADC 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" When stopping the ADC_V2_CON1_STC_EN should be cleared. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski --- drivers/adc/exynos-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/adc/exynos-adc.c b/drivers/adc/exynos-adc.c index d33e3d632afc..12c49fc8cefb 100644 --- a/drivers/adc/exynos-adc.c +++ b/drivers/adc/exynos-adc.c @@ -62,7 +62,7 @@ int exynos_adc_stop(struct udevice *dev) /* Stop conversion */ cfg = readl(®s->con1); - cfg |= ~ADC_V2_CON1_STC_EN; + cfg &= ~ADC_V2_CON1_STC_EN; writel(cfg, ®s->con1); From patchwork Wed Feb 13 16:46:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1041439 X-Patchwork-Delegate: promsoft@gmail.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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="yo7LrrSl"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44058C0371z9s2P for ; Thu, 14 Feb 2019 03:48:58 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id AD088C22093; Wed, 13 Feb 2019 16:47:28 +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=T_DKIM_INVALID 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 93383C21FEC; Wed, 13 Feb 2019 16:47:05 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C3CF2C22059; Wed, 13 Feb 2019 16:47:03 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id 46682C2205C for ; Wed, 13 Feb 2019 16:47:00 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0E4DF222D0; Wed, 13 Feb 2019 16:46:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550076419; bh=KX7+SppqBVHXusb/vv0PfgBGwP9hoDjCj+8NIsq1GLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yo7LrrSlLZo/WSYHkyfzWLyxsff4OCaEcj1HgHv6gfxuySSdwODAuxqU/00A0lEO6 K3QQjX4BMtf4URfL4qgLxMxYxaLY2i88eZwpUBVhqm9ffanl3PtjLIgdHFWcEVNflA Ah1QQk/7PmvtmqHoFNYU+JBNH531yV54zaIf3AYI= From: Krzysztof Kozlowski To: Albert Aribaud , Jaehoon Chung , Lukasz Majewski , Simon Glass , Minkyu Kang , Marek Szyprowski , u-boot@lists.denx.de Date: Wed, 13 Feb 2019 17:46:41 +0100 Message-Id: <20190213164648.26579-3-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213164648.26579-1-krzk@kernel.org> References: <20190213164648.26579-1-krzk@kernel.org> Cc: Krzysztof Kozlowski Subject: [U-Boot] [PATCH v2 2/9] power: regulator: s2mps11: Fix step for LDO27 and LDO35 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" LDO27 and LDO35 have 25 mV step, not 50 mV. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski --- drivers/power/regulator/s2mps11_regulator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/power/regulator/s2mps11_regulator.c b/drivers/power/regulator/s2mps11_regulator.c index ced504eb1476..723d27f67c9a 100644 --- a/drivers/power/regulator/s2mps11_regulator.c +++ b/drivers/power/regulator/s2mps11_regulator.c @@ -346,6 +346,8 @@ static int s2mps11_ldo_hex2volt(int ldo, int hex) case 11: case 22: case 23: + case 27: + case 35: uV = hex * S2MPS11_LDO_STEP + S2MPS11_LDO_UV_MIN; break; default: @@ -366,6 +368,8 @@ static int s2mps11_ldo_volt2hex(int ldo, int uV) case 11: case 22: case 23: + case 27: + case 35: hex = (uV - S2MPS11_LDO_UV_MIN) / S2MPS11_LDO_STEP; break; default: From patchwork Wed Feb 13 16:46:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1041437 X-Patchwork-Delegate: promsoft@gmail.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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="eaHbYsYp"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44057c59PJz9s2P for ; Thu, 14 Feb 2019 03:48:28 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 5044BC22093; Wed, 13 Feb 2019 16:47:42 +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=T_DKIM_INVALID 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 24DE5C220BB; Wed, 13 Feb 2019 16:47:17 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EC18AC21F98; Wed, 13 Feb 2019 16:47:06 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id CE479C220A4 for ; Wed, 13 Feb 2019 16:47:02 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8D30E222D1; Wed, 13 Feb 2019 16:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550076421; bh=eNJ7w4QwL7hqCXbmvEvIcgRG65EskXNlqnnPJEbtjL8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eaHbYsYpWv6BDUTJVzm4bDhQMPp0LZpam/u8mmspcsY2ZJvvN/pMcAYk8OLDcwIFx /VNaqqHvgz9Bwa+QaetqTYg320JPXedoEmxYvfWt+LqXUPKRs1lunoxzLOPcM0BYWt DglXDjLrg/JOxRNo/UI5uHp3cB0fKperHiqx+3kA= From: Krzysztof Kozlowski To: Albert Aribaud , Jaehoon Chung , Lukasz Majewski , Simon Glass , Minkyu Kang , Marek Szyprowski , u-boot@lists.denx.de Date: Wed, 13 Feb 2019 17:46:42 +0100 Message-Id: <20190213164648.26579-4-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213164648.26579-1-krzk@kernel.org> References: <20190213164648.26579-1-krzk@kernel.org> Cc: Krzysztof Kozlowski Subject: [U-Boot] [PATCH v2 3/9] arm: exynos: Detect revision later, when all resources are ready 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" Detection of board revision is done early - before power setup. In case of Odroid XU3/XU4/HC1 family, the detection is done using ADC which is supplied by LDO4/VDD_ADC regulator. This regulator could be turned off (e.g. by kernel before reboot). If ADC is used early, the regulators are not yet available and the detection won't work. Split the revision detection out of set_board_type() into separate function called later - either when displaying board info or during misc_init_r (whatever succeeds first). The idea is that set_board_type() will be called early so its method of detection are limited to flattened device tree (exynos5-dt-types.c for Exynos5) or GPIO (odroid.c for Exynos4412). The newly added set_board_revision() can be called only later, when resources like regulator are available. This is necessary to fix the detection of Odroid HC1 after reboot, if kernel turned off the LDO4 regulator. Signed-off-by: Krzysztof Kozlowski --- board/samsung/common/board.c | 13 ++++++++++++- board/samsung/common/exynos5-dt-types.c | 20 +++++++++++++++++--- board/samsung/odroid/odroid.c | 8 ++++++++ include/samsung/misc.h | 1 + 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index 96228a86a117..52a2764a1919 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -253,7 +253,12 @@ int board_eth_init(bd_t *bis) int checkboard(void) { if (IS_ENABLED(CONFIG_BOARD_TYPES)) { - const char *board_info = get_board_type(); + const char *board_info; + + /* Printing type requires having revision */ + set_board_revision(); + + board_info = get_board_type(); if (board_info) printf("Type: %s\n", board_info); @@ -287,6 +292,12 @@ int board_late_init(void) #ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { + /* + * At this point regulators should be available so do full + * revision detection + */ + set_board_revision(); + #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG set_board_info(); #endif diff --git a/board/samsung/common/exynos5-dt-types.c b/board/samsung/common/exynos5-dt-types.c index 7a86e9187768..af711e727a78 100644 --- a/board/samsung/common/exynos5-dt-types.c +++ b/board/samsung/common/exynos5-dt-types.c @@ -192,8 +192,11 @@ const char *get_board_type(void) /** * set_board_type() - set board type in gd->board_type. - * As default type set EXYNOS5_BOARD_GENERIC, if detect Odroid, - * then set its proper type. + * As default type set EXYNOS5_BOARD_GENERIC. If Odroid is detected, + * set its proper type based on device tree. + * + * This might be called early when some more specific ways to detect revision + * are not yet available. */ void set_board_type(void) { @@ -211,8 +214,19 @@ void set_board_type(void) gd->board_type = of_match->data; break; } +} + +/** + * set_board_revision() - set detailed board type in gd->board_type. + * Should be called when resources (e.g. regulators) are available + * so ADC can be used to detect the specific revision of a board. + */ +void set_board_revision(void) +{ + /* Do not detect revision twice */ + if (gd->board_type == EXYNOS5_BOARD_GENERIC) + return; - /* If Odroid, then check its revision */ if (board_is_odroidxu3()) gd->board_type = odroid_get_board_type(); } diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c index 552333fe869d..4be8cc9826c3 100644 --- a/board/samsung/odroid/odroid.c +++ b/board/samsung/odroid/odroid.c @@ -54,6 +54,14 @@ void set_board_type(void) gd->board_type = ODROID_TYPE_U3; } +void set_board_revision(void) +{ + /* + * Revision already set by set_board_type() because it can be + * executed early. + */ +} + const char *get_board_type(void) { const char *board_type[] = {"u3", "x2"}; diff --git a/include/samsung/misc.h b/include/samsung/misc.h index 017560c25662..4ff28a1df0e8 100644 --- a/include/samsung/misc.h +++ b/include/samsung/misc.h @@ -33,6 +33,7 @@ char *get_dfu_alt_system(char *interface, char *devstr); char *get_dfu_alt_boot(char *interface, char *devstr); #endif void set_board_type(void); +void set_board_revision(void); const char *get_board_type(void); #endif /* __SAMSUNG_MISC_COMMON_H__ */ From patchwork Wed Feb 13 16:46:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1041442 X-Patchwork-Delegate: promsoft@gmail.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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="rDOgre/j"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4405902FLMz9s2P for ; Thu, 14 Feb 2019 03:49:40 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 10E34C2209E; Wed, 13 Feb 2019 16:48:09 +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=T_DKIM_INVALID 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 79AFEC220A1; Wed, 13 Feb 2019 16:47:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9F913C22091; Wed, 13 Feb 2019 16:47:09 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id 6FFFEC220BC for ; Wed, 13 Feb 2019 16:47:05 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 019EA222CE; Wed, 13 Feb 2019 16:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550076424; bh=0f5+V777d8c/HBCWaogHMWsf24Z+u/hcXTQ7ls2/vxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rDOgre/jMsCucz/zsEmzKJIejcgbR3doyQU1oydWzhitk0A/jpywBh/o9P+Sw1ukP ygp3kzqe+zLPzQx/VDIedSk/radTDsvkT9T/Fi6Ez5dYiqFg28kDdzeCNyBJoGYkJ2 17OH3hP/JGSrGb9okGAT5poLL8MNRO+T/tsZE96A= From: Krzysztof Kozlowski To: Albert Aribaud , Jaehoon Chung , Lukasz Majewski , Simon Glass , Minkyu Kang , Marek Szyprowski , u-boot@lists.denx.de Date: Wed, 13 Feb 2019 17:46:43 +0100 Message-Id: <20190213164648.26579-5-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213164648.26579-1-krzk@kernel.org> References: <20190213164648.26579-1-krzk@kernel.org> Cc: Krzysztof Kozlowski Subject: [U-Boot] [PATCH v2 4/9] arm: exynos: odroid-xu3: Display info late to have proper type 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" From: Krzysztof Kozlowski Printing the "Type" of board requires proper detection of revision which can happen only late because regulators are needed. Signed-off-by: Krzysztof Kozlowski --- board/samsung/common/board.c | 2 +- configs/odroid-xu3_defconfig | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index 52a2764a1919..632732288e73 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -249,7 +249,7 @@ int board_eth_init(bd_t *bis) return 0; } -#ifdef CONFIG_DISPLAY_BOARDINFO +#if defined(CONFIG_DISPLAY_BOARDINFO) || defined(CONFIG_DISPLAY_BOARDINFO_LATE) int checkboard(void) { if (IS_ENABLED(CONFIG_BOARD_TYPES)) { diff --git a/configs/odroid-xu3_defconfig b/configs/odroid-xu3_defconfig index f6f05b294833..57aca5e015fc 100644 --- a/configs/odroid-xu3_defconfig +++ b/configs/odroid-xu3_defconfig @@ -11,6 +11,8 @@ CONFIG_FIT=y CONFIG_FIT_BEST_MATCH=y CONFIG_SILENT_CONSOLE=y CONFIG_CONSOLE_MUX=y +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_MISC_INIT_R=y CONFIG_SYS_PROMPT="ODROID-XU3 # " CONFIG_CMD_THOR_DOWNLOAD=y From patchwork Wed Feb 13 16:46:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1041446 X-Patchwork-Delegate: promsoft@gmail.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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="dJpQiuaa"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4405C50Klmz9s1l for ; Thu, 14 Feb 2019 03:51:28 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id ACBCFC21FDA; Wed, 13 Feb 2019 16:48:24 +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=T_DKIM_INVALID 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 1CB95C220A3; Wed, 13 Feb 2019 16:47:39 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 47E63C22019; Wed, 13 Feb 2019 16:47:12 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id 4512AC220C0 for ; Wed, 13 Feb 2019 16:47:08 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B9344222CF; Wed, 13 Feb 2019 16:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550076426; bh=qio8BcMA0RQ3X3KeiBll7IyylxAVTHCV+ZqexJfUYBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dJpQiuaaHPfczgf+SvVONd5Av0uOaUj3+M+7+VSkpPOFLduxlQ+vrzORs855Ll70m QBg1hlE40WIHAjv5VfzOFgjm3QzvJ2maRUa32CPxi8aWJD9ElOa5t6Lz2WoTPNBxN/ nwvoNCvj5QG6NaHYpA8MXdNqQVCF9+fX8RKdw4Z0= From: Krzysztof Kozlowski To: Albert Aribaud , Jaehoon Chung , Lukasz Majewski , Simon Glass , Minkyu Kang , Marek Szyprowski , u-boot@lists.denx.de Date: Wed, 13 Feb 2019 17:46:44 +0100 Message-Id: <20190213164648.26579-6-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213164648.26579-1-krzk@kernel.org> References: <20190213164648.26579-1-krzk@kernel.org> Cc: Krzysztof Kozlowski Subject: [U-Boot] [PATCH v2 5/9] arm: exynos: Wait till ADC stabilizes before checking Odroid HC1 revision 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" Fix detection of Odroid HC1 (Exynos5422) after reboot if kernel disabled the LDO4/VDD_ADC regulator. The LDO4 supplies both ADC block and the ADC input AIN9. Voltage on AIN9 will rise slowly, so be patient and wait for it to stabilize. First reads on Odroid HC1 return 305, 1207, 1297 and finally 1308 (reference value is 1309). Signed-off-by: Krzysztof Kozlowski --- board/samsung/common/exynos5-dt-types.c | 38 ++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/board/samsung/common/exynos5-dt-types.c b/board/samsung/common/exynos5-dt-types.c index af711e727a78..8aed64183837 100644 --- a/board/samsung/common/exynos5-dt-types.c +++ b/board/samsung/common/exynos5-dt-types.c @@ -57,12 +57,48 @@ static unsigned int odroid_get_rev(void) return 0; } +/* + * Read ADC at least twice and check the resuls. If regulator providing voltage + * on to measured point was just turned on, first reads might require time + * to stabilize. + */ +static int odroid_get_adc_val(unsigned int *adcval) +{ + unsigned int adcval_prev = 0; + int ret, retries = 20; + + ret = adc_channel_single_shot("adc", CONFIG_ODROID_REV_AIN, + &adcval_prev); + if (ret) + return ret; + + while (retries--) { + mdelay(5); + + ret = adc_channel_single_shot("adc", CONFIG_ODROID_REV_AIN, + adcval); + if (ret) + return ret; + + /* + * If difference between ADC reads is less than 3%, + * accept the result + */ + if ((100 * abs(*adcval - adcval_prev) / adcval_prev) < 3) + return ret; + + adcval_prev = *adcval; + } + + return ret; +} + static int odroid_get_board_type(void) { unsigned int adcval; int ret, i; - ret = adc_channel_single_shot("adc", CONFIG_ODROID_REV_AIN, &adcval); + ret = odroid_get_adc_val(&adcval); if (ret) goto rev_default; From patchwork Wed Feb 13 16:46:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1041441 X-Patchwork-Delegate: promsoft@gmail.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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="G0PC5YXs"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44058t2yKmz9s1l for ; Thu, 14 Feb 2019 03:49:34 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id E6504C2209E; Wed, 13 Feb 2019 16:48:39 +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=T_DKIM_INVALID 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 CDAF9C2208F; Wed, 13 Feb 2019 16:47:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 96974C2200E; Wed, 13 Feb 2019 16:47:14 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id A6161C22095 for ; Wed, 13 Feb 2019 16:47:10 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6620D222D0; Wed, 13 Feb 2019 16:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550076429; bh=rQWLaCRXUAnd1NjrSvIzse23KysdnYLdHq6Xi0kBKpw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G0PC5YXsMRbVqSi+7zasW/I3wHfO2ZiJda6nnb/UF4bFOXnRB5ydubqox5862h1z3 vA3YVbjzNx/AI9Y4noPfnWORtUBAuHnVx+jq+nHjAg7/aX7owGc+B6WT6M4IkrpKrG 8/KGroMFH1U/Btj0UoN4CQPRc9gsGFYHbw4Se2vM= From: Krzysztof Kozlowski To: Albert Aribaud , Jaehoon Chung , Lukasz Majewski , Simon Glass , Minkyu Kang , Marek Szyprowski , u-boot@lists.denx.de Date: Wed, 13 Feb 2019 17:46:45 +0100 Message-Id: <20190213164648.26579-7-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213164648.26579-1-krzk@kernel.org> References: <20190213164648.26579-1-krzk@kernel.org> Cc: Krzysztof Kozlowski Subject: [U-Boot] [PATCH v2 6/9] regulator: Add support for ramp delay 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" Changing voltage and enabling regulator might require delays so the regulator stabilizes at expected level. Add support for "regulator-ramp-delay" binding which can introduce required time to both enabling the regulator and to changing the voltage. Signed-off-by: Krzysztof Kozlowski --- .../regulator/regulator.txt | 2 + drivers/power/regulator/regulator-uclass.c | 47 ++++++++++++++++++- include/power/regulator.h | 2 + 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/doc/device-tree-bindings/regulator/regulator.txt b/doc/device-tree-bindings/regulator/regulator.txt index 65b69c427899..4ba642b7c77f 100644 --- a/doc/device-tree-bindings/regulator/regulator.txt +++ b/doc/device-tree-bindings/regulator/regulator.txt @@ -35,6 +35,7 @@ Optional properties: - regulator-max-microamp: a maximum allowed Current value - regulator-always-on: regulator should never be disabled - regulator-boot-on: enabled by bootloader/firmware +- regulator-ramp-delay: ramp delay for regulator (in uV/us) Note The "regulator-name" constraint is used for setting the device's uclass @@ -60,4 +61,5 @@ ldo0 { regulator-max-microamp = <100000>; regulator-always-on; regulator-boot-on; + regulator-ramp-delay = <12000>; }; diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index 6f355b969a6d..363c6e6441fa 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -35,10 +35,22 @@ int regulator_get_value(struct udevice *dev) return ops->get_value(dev); } +static void regulator_set_value_delay(struct udevice *dev, int old_uV, + int new_uV, unsigned int ramp_delay) +{ + int delay = DIV_ROUND_UP(abs(new_uV - old_uV), ramp_delay); + + debug("regulator %s: delay %u us (%d uV -> %d uV)\n", dev->name, delay, + old_uV, new_uV); + + udelay(delay); +} + int regulator_set_value(struct udevice *dev, int uV) { const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); struct dm_regulator_uclass_platdata *uc_pdata; + int ret, old_uV = uV, is_enabled = 0; uc_pdata = dev_get_uclass_platdata(dev); if (uc_pdata->min_uV != -ENODATA && uV < uc_pdata->min_uV) @@ -49,7 +61,20 @@ int regulator_set_value(struct udevice *dev, int uV) if (!ops || !ops->set_value) return -ENOSYS; - return ops->set_value(dev, uV); + if (uc_pdata->ramp_delay) { + is_enabled = regulator_get_enable(dev); + old_uV = regulator_get_value(dev); + } + + ret = ops->set_value(dev, uV); + + if (!ret) { + if (uc_pdata->ramp_delay && old_uV > 0 && is_enabled) + regulator_set_value_delay(dev, old_uV, uV, + uc_pdata->ramp_delay); + } + + return ret; } /* @@ -107,6 +132,7 @@ int regulator_set_enable(struct udevice *dev, bool enable) { const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); struct dm_regulator_uclass_platdata *uc_pdata; + int ret, old_enable = 0; if (!ops || !ops->set_enable) return -ENOSYS; @@ -115,7 +141,22 @@ int regulator_set_enable(struct udevice *dev, bool enable) if (!enable && uc_pdata->always_on) return -EACCES; - return ops->set_enable(dev, enable); + if (uc_pdata->ramp_delay) + old_enable = regulator_get_enable(dev); + + ret = ops->set_enable(dev, enable); + if (!ret) { + if (uc_pdata->ramp_delay && !old_enable && enable) { + int uV = regulator_get_value(dev); + + if (uV > 0) { + regulator_set_value_delay(dev, 0, uV, + uc_pdata->ramp_delay); + } + } + } + + return ret; } int regulator_set_enable_if_allowed(struct udevice *dev, bool enable) @@ -335,6 +376,8 @@ static int regulator_pre_probe(struct udevice *dev) -ENODATA); uc_pdata->always_on = dev_read_bool(dev, "regulator-always-on"); uc_pdata->boot_on = dev_read_bool(dev, "regulator-boot-on"); + uc_pdata->ramp_delay = dev_read_u32_default(dev, "regulator-ramp-delay", + 0); /* Those values are optional (-ENODATA if unset) */ if ((uc_pdata->min_uV != -ENODATA) && diff --git a/include/power/regulator.h b/include/power/regulator.h index 314160a894b7..6c6e2cd4f996 100644 --- a/include/power/regulator.h +++ b/include/power/regulator.h @@ -150,6 +150,7 @@ enum regulator_flag { * @always_on* - bool type, true or false * @boot_on* - bool type, true or false * TODO(sjg@chromium.org): Consider putting the above two into @flags + * @ramp_delay - Time to settle down after voltage change (unit: uV/us) * @flags: - flags value (see REGULATOR_FLAG_...) * @name** - fdt regulator name - should be taken from the device tree * ctrl_reg: - Control register offset used to enable/disable regulator @@ -169,6 +170,7 @@ struct dm_regulator_uclass_platdata { int max_uV; int min_uA; int max_uA; + unsigned int ramp_delay; bool always_on; bool boot_on; const char *name; From patchwork Wed Feb 13 16:46:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1041445 X-Patchwork-Delegate: promsoft@gmail.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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="u5A4Wr0F"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4405Bc4ZG7z9s1l for ; Thu, 14 Feb 2019 03:51:04 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 4AEEEC220B8; Wed, 13 Feb 2019 16:47:56 +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=T_DKIM_INVALID 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 C9CBDC22099; Wed, 13 Feb 2019 16:47:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4A93BC22068; Wed, 13 Feb 2019 16:47:16 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id 656B9C220C0 for ; Wed, 13 Feb 2019 16:47:13 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E9FB7222D3; Wed, 13 Feb 2019 16:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550076432; bh=h3lrcoif1nWN8lLlcR3vifZuW+rOS67Y2k6tWR8eBO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u5A4Wr0FYSYMoSgprN4Veuw52NxOcmakLyqsFs026lzSCSqYfPEYCpzRI+3aZ41n2 Ca/KewiB86tYuMBj/rBNJZBFB+BRq4ChPQE6TYjMmUXwdyckG1p0lDQfQrQTzOoofO KRYLtsawDt876sInf9wEjvflCXksLasXbslN6fnk= From: Krzysztof Kozlowski To: Albert Aribaud , Jaehoon Chung , Lukasz Majewski , Simon Glass , Minkyu Kang , Marek Szyprowski , u-boot@lists.denx.de Date: Wed, 13 Feb 2019 17:46:46 +0100 Message-Id: <20190213164648.26579-8-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213164648.26579-1-krzk@kernel.org> References: <20190213164648.26579-1-krzk@kernel.org> Cc: Krzysztof Kozlowski Subject: [U-Boot] [PATCH v2 7/9] power: regulator: s2mps11: Add enable delay 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" According to datasheet, the output on LDO regulators will start appearing after 10-15 us. Signed-off-by: Krzysztof Kozlowski --- drivers/power/regulator/s2mps11_regulator.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/power/regulator/s2mps11_regulator.c b/drivers/power/regulator/s2mps11_regulator.c index 723d27f67c9a..1f1581852ee2 100644 --- a/drivers/power/regulator/s2mps11_regulator.c +++ b/drivers/power/regulator/s2mps11_regulator.c @@ -551,7 +551,14 @@ static int ldo_get_enable(struct udevice *dev) static int ldo_set_enable(struct udevice *dev, bool enable) { - return s2mps11_ldo_enable(dev, PMIC_OP_SET, &enable); + int ret; + + ret = s2mps11_ldo_enable(dev, PMIC_OP_SET, &enable); + + /* Wait the "enable delay" for voltage to start to rise */ + udelay(15); + + return ret; } static int ldo_get_mode(struct udevice *dev) From patchwork Wed Feb 13 16:46:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1041447 X-Patchwork-Delegate: promsoft@gmail.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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="lc2f2KzS"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4405CS4zzTz9s2P for ; Thu, 14 Feb 2019 03:51:48 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 51D9FC22096; Wed, 13 Feb 2019 16:49:06 +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=T_DKIM_INVALID 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 EE70AC21FB8; Wed, 13 Feb 2019 16:48:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BB53CC22008; Wed, 13 Feb 2019 16:47:19 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id 575ABC21FDA for ; Wed, 13 Feb 2019 16:47:16 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EBF02222CE; Wed, 13 Feb 2019 16:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550076435; bh=DZNWaXlIS7u5YN6nivKgijVmgWRpMjve9rAJzTi84cA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lc2f2KzSlW6MKrele4/sevSdYo0PXTt7iFCkBu74pMDidukKrEii0+lX9hM4k82Nh s1p7888tPymZdwhgBJuEwKBoUzwGFQdXKcII/BTcWzbbuhbKgP/3lEHqpMlc6yKWxK M34yVC+gBThm+5HkJOxq8Bd1s9hmw02BgRzFj3do= From: Krzysztof Kozlowski To: Albert Aribaud , Jaehoon Chung , Lukasz Majewski , Simon Glass , Minkyu Kang , Marek Szyprowski , u-boot@lists.denx.de Date: Wed, 13 Feb 2019 17:46:47 +0100 Message-Id: <20190213164648.26579-9-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213164648.26579-1-krzk@kernel.org> References: <20190213164648.26579-1-krzk@kernel.org> Cc: Krzysztof Kozlowski Subject: [U-Boot] [PATCH v2 8/9] arm: dts: exynos: Add supply for ADC block to Odroid XU3 family 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" The ADC block requires VDD supply to be on so provide one. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski --- arch/arm/dts/exynos5422-odroidxu3.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/dts/exynos5422-odroidxu3.dts b/arch/arm/dts/exynos5422-odroidxu3.dts index e859dd1b981a..9dfae90667cf 100644 --- a/arch/arm/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/dts/exynos5422-odroidxu3.dts @@ -32,6 +32,7 @@ adc@12D10000 { u-boot,dm-pre-reloc; + vdd-supply = <&ldo4_reg>; status = "okay"; }; From patchwork Wed Feb 13 16:46:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1041443 X-Patchwork-Delegate: promsoft@gmail.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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="qPZ+rTCq"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4405BD6nLBz9s2P for ; Thu, 14 Feb 2019 03:50:44 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id A3927C21FB8; Wed, 13 Feb 2019 16:48:52 +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=T_DKIM_INVALID 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 28B5AC2205C; Wed, 13 Feb 2019 16:48:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AF5CAC22095; Wed, 13 Feb 2019 16:47:22 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id DA32BC220C4 for ; Wed, 13 Feb 2019 16:47:18 +0000 (UTC) Received: from localhost.localdomain (unknown [194.230.155.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A0A39222D0; Wed, 13 Feb 2019 16:47:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550076437; bh=ZtIviFhvmy8CowrsjTAtUf28NsAW7uk69B4YGFIfW2U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qPZ+rTCqN+ifGIZ5s8vXLac3gVmTY+ilHKHJ6+FI1QwQICrlTkHWf9/hLJOBYqq4P KtRPnIEdH6tnFwgIOQhA2ZCUYInHpz8mKYLtdxI/+AsDm5feyIyHFNsbJXFhs4TwgI WAUgW7nJL75t8mwc0lpygYXPMX7bt7lRLURd3Yz4= From: Krzysztof Kozlowski To: Albert Aribaud , Jaehoon Chung , Lukasz Majewski , Simon Glass , Minkyu Kang , Marek Szyprowski , u-boot@lists.denx.de Date: Wed, 13 Feb 2019 17:46:48 +0100 Message-Id: <20190213164648.26579-10-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213164648.26579-1-krzk@kernel.org> References: <20190213164648.26579-1-krzk@kernel.org> Cc: Krzysztof Kozlowski Subject: [U-Boot] [PATCH v2 9/9] arm: dts: exynos: Add ramp delay property to LDO regulators to Odroid XU3 family 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" Add startup time to LDO regulators of S2MPS11 PMIC on Odroid XU3/XU4/HC1 family of boards to be sure the voltage is proper before relying on the regulator. The datasheet for all the S2MPS1x family is inconsistent here and does not specify unambiguously the value of ramp delay for LDO. It mentions 30 mV/us in one timing diagram but then omits it completely in LDO regulator characteristics table (it is specified for bucks). However the vendor kernels for Galaxy S5 and Odroid XU3 use values of 12 mV/us or 24 mV/us. Without the ramp delay value the consumers do not wait for voltage settle after changing it. Although the proper value of ramp delay for LDOs is unknown, it seems safer to use at least some value from reference kernel than to leave it unset. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski --- arch/arm/dts/exynos5422-odroidxu3.dts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/dts/exynos5422-odroidxu3.dts b/arch/arm/dts/exynos5422-odroidxu3.dts index 9dfae90667cf..04ecc404f907 100644 --- a/arch/arm/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/dts/exynos5422-odroidxu3.dts @@ -45,6 +45,7 @@ regulator-name = "vdd_ldo1"; regulator-min-microvolt = <1000000>; regulator-max-microvolt = <1000000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -52,18 +53,21 @@ regulator-name = "vddq_mmc0"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; }; ldo4_reg: LDO4 { regulator-name = "vdd_adc"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; }; ldo5_reg: LDO5 { regulator-name = "vdd_ldo5"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -71,6 +75,7 @@ regulator-name = "vdd_ldo6"; regulator-min-microvolt = <1000000>; regulator-max-microvolt = <1000000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -78,6 +83,7 @@ regulator-name = "vdd_ldo7"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -85,6 +91,7 @@ regulator-name = "vdd_ldo8"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -92,6 +99,7 @@ regulator-name = "vdd_ldo9"; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3000000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -99,6 +107,7 @@ regulator-name = "vdd_ldo10"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -106,6 +115,7 @@ regulator-name = "vdd_ldo11"; regulator-min-microvolt = <1000000>; regulator-max-microvolt = <1000000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -113,6 +123,7 @@ regulator-name = "vdd_ldo12"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -120,12 +131,14 @@ regulator-name = "vddq_mmc2"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; + regulator-ramp-delay = <12000>; }; ldo15_reg: LDO15 { regulator-name = "vdd_ldo15"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -133,6 +146,7 @@ regulator-name = "vdd_ldo16"; regulator-min-microvolt = <2200000>; regulator-max-microvolt = <2200000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -140,6 +154,7 @@ regulator-name = "vdd_ldo17"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -147,18 +162,21 @@ regulator-name = "vdd_emmc_1V8"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; }; ldo19_reg: LDO19 { regulator-name = "vdd_sd"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; + regulator-ramp-delay = <12000>; }; ldo24_reg: LDO24 { regulator-name = "tsp_io"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -166,6 +184,7 @@ regulator-name = "vdd_ldo26"; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3000000>; + regulator-ramp-delay = <12000>; regulator-always-on; };