From patchwork Mon Sep 11 20:04:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812587 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfCW0GpFz9s8J for ; Tue, 12 Sep 2017 06:09:26 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C53A8C21E67; Mon, 11 Sep 2017 20:05: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 F1CDDC21F8D; Mon, 11 Sep 2017 20:04:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5011DC21E39; Mon, 11 Sep 2017 20:04:43 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id B30C8C21E39 for ; Mon, 11 Sep 2017 20:04:42 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwg-0003kn-8h; Mon, 11 Sep 2017 22:04:38 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:09 +0200 Message-Id: <1505160270-10650-2-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Klaus Goger , Andy Yan , "Franklin\"" Subject: [U-Boot] [PATCH v3 01/19] bootstage: adjust Makefile to allow including bootstage in SPL, but not in TPL 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 timing our bootstages on the RK3368, which has a minimal TPL (and where we consequently don't want to time the bootstages) and a full-featured SPL (where we can bootstage recording), we need to adjust the Makefile. Use the $(SPL_TPL_) macro in the Makefile for bootstage.o Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich --- Changes in v3: None Changes in v2: None common/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/Makefile b/common/Makefile index 1b56cf9..801ea31 100644 --- a/common/Makefile +++ b/common/Makefile @@ -63,7 +63,7 @@ obj-$(CONFIG_CMDLINE) += cli_readline.o cli_simple.o endif # !CONFIG_SPL_BUILD -obj-$(CONFIG_$(SPL_)BOOTSTAGE) += bootstage.o +obj-$(CONFIG_$(SPL_TPL_)BOOTSTAGE) += bootstage.o ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu.o From patchwork Mon Sep 11 20:04:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812581 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrf860nJVz9sBZ for ; Tue, 12 Sep 2017 06:06:30 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D1724C21F94; Mon, 11 Sep 2017 20:05:02 +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 F1C79C21F1D; Mon, 11 Sep 2017 20:04:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1AC64C21E31; Mon, 11 Sep 2017 20:04:42 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id B0BFFC21E31 for ; Mon, 11 Sep 2017 20:04:42 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwg-0003kn-PZ; Mon, 11 Sep 2017 22:04:38 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:10 +0200 Message-Id: <1505160270-10650-3-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Vlad Zakharov , Zakharov Vlad , Klaus Goger Subject: [U-Boot] [PATCH v3 02/19] dm: timer: Convert to livetree 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" This updates dm_timer_init to support a live tree and deals with some fallout (i.e. the need to restructure the code such, that we don't need multiple discontinuous #if CONFIG_IS_ENABLED blocks). Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich --- Changes in v3: None Changes in v2: None drivers/timer/timer-uclass.c | 45 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c index a84755f..62d6f0b 100644 --- a/drivers/timer/timer-uclass.c +++ b/drivers/timer/timer-uclass.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -54,9 +55,10 @@ static int timer_pre_probe(struct udevice *dev) if (IS_ERR_VALUE(ret)) return ret; uc_priv->clock_rate = ret; - } else - uc_priv->clock_rate = fdtdec_get_int(gd->fdt_blob, - dev_of_offset(dev), "clock-frequency", 0); + } else { + uc_priv->clock_rate = + dev_read_u32_default(dev, "clock-frequency", 0); + } #endif return 0; @@ -83,9 +85,8 @@ u64 timer_conv_64(u32 count) int notrace dm_timer_init(void) { - __maybe_unused const void *blob = gd->fdt_blob; struct udevice *dev = NULL; - int node = -ENOENT; + __maybe_unused ofnode node; int ret; if (gd->timer) @@ -93,27 +94,27 @@ int notrace dm_timer_init(void) #if !CONFIG_IS_ENABLED(OF_PLATDATA) /* Check for a chosen timer to be used for tick */ - node = fdtdec_get_chosen_node(blob, "tick-timer"); + node = ofnode_get_chosen_node("tick-timer"); + + if (ofnode_valid(node) && + uclass_get_device_by_ofnode(UCLASS_TIMER, node, &dev)) { + /* + * If the timer is not marked to be bound before + * relocation, bind it anyway. + */ + if (!lists_bind_fdt(dm_root(), node, &dev)) { + ret = device_probe(dev); + if (ret) + return ret; + } + } #endif - if (node < 0) { - /* No chosen timer, trying first available timer */ + + if (!dev) { + /* Fall back to the first available timer */ ret = uclass_first_device_err(UCLASS_TIMER, &dev); if (ret) return ret; - } else { - if (uclass_get_device_by_of_offset(UCLASS_TIMER, node, &dev)) { - /* - * If the timer is not marked to be bound before - * relocation, bind it anyway. - */ - if (node > 0 && - !lists_bind_fdt(gd->dm_root, offset_to_ofnode(node), - &dev)) { - ret = device_probe(dev); - if (ret) - return ret; - } - } } if (dev) { From patchwork Mon Sep 11 20:04:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812579 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrf6G4K9Fz9s0Z for ; Tue, 12 Sep 2017 06:04:54 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4AB7BC21F90; Mon, 11 Sep 2017 20:04:46 +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 E0788C21E31; Mon, 11 Sep 2017 20:04:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 10829C21E64; Mon, 11 Sep 2017 20:04:42 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id AE96CC21DA4 for ; Mon, 11 Sep 2017 20:04:42 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwh-0003kn-Ab; Mon, 11 Sep 2017 22:04:39 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:11 +0200 Message-Id: <1505160270-10650-4-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Vlad Zakharov , Zakharov Vlad , Klaus Goger Subject: [U-Boot] [PATCH v3 03/19] dm: timer: handle being called before dm_root is 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" When used with bootstage recording, dm_timer_init may be called surprisingly early: i.e. before dm_root is ready. To deal with this case, we explicitly check for this condition and return -EAGAIN to the caller (refer to drivers/timer/rockchip_timer.c for a case where this is needed/used). Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich --- Changes in v3: None Changes in v2: None drivers/timer/timer-uclass.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c index 62d6f0b..45397b2 100644 --- a/drivers/timer/timer-uclass.c +++ b/drivers/timer/timer-uclass.c @@ -92,6 +92,13 @@ int notrace dm_timer_init(void) if (gd->timer) return 0; + /* + * Directly access gd->dm_root to suppress error messages, if the + * virtual root driver does not yet exist. + */ + if (gd->dm_root == NULL) + return -EAGAIN; + #if !CONFIG_IS_ENABLED(OF_PLATDATA) /* Check for a chosen timer to be used for tick */ node = ofnode_get_chosen_node("tick-timer"); From patchwork Mon Sep 11 20:04:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812580 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrf7L4HDVz9s0Z for ; Tue, 12 Sep 2017 06:05:50 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 46DD1C21F6F; Mon, 11 Sep 2017 20:05:21 +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 E4988C21F5E; Mon, 11 Sep 2017 20:04:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 33B69C21E67; Mon, 11 Sep 2017 20:04:43 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id D989EC21E4B for ; Mon, 11 Sep 2017 20:04:42 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwh-0003kn-Pa; Mon, 11 Sep 2017 22:04:40 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:12 +0200 Message-Id: <1505160270-10650-5-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Klaus Goger Subject: [U-Boot] [PATCH v3 04/19] dm: core: add dev_read_addr_ptr() 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 dev_read_addr_ptr() mimics the behaviour of the devfdt_get_addr_ptr(), retrieving the first address of the node's reg-property and returning it as a pointer (or NULL on failure). Signed-off-by: Philipp Tomsich Acked-by: Philipp Tomsich --- Changes in v3: None Changes in v2: - implements the dev_read_addr_ptr() function drivers/core/read.c | 7 +++++++ include/dm/read.h | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/core/read.c b/drivers/core/read.c index 6acb333..065589a 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -57,6 +57,13 @@ fdt_addr_t dev_read_addr(struct udevice *dev) return dev_read_addr_index(dev, 0); } +void *dev_read_addr_ptr(struct udevice *dev) +{ + fdt_addr_t addr = dev_read_addr(dev); + + return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr; +} + fdt_addr_t dev_read_addr_size(struct udevice *dev, const char *property, fdt_size_t *sizep) { diff --git a/include/dm/read.h b/include/dm/read.h index 49d69c9..e7f7125 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -113,6 +113,16 @@ fdt_addr_t dev_read_addr_index(struct udevice *dev, int index); fdt_addr_t dev_read_addr(struct udevice *dev); /** + * dev_read_addr_ptr() - Get the reg property of a device + * as a pointer + * + * @dev: Device to read from + * + * @return pointer or NULL if not found + */ +void *dev_read_addr_ptr(struct udevice *dev); + +/** * dev_read_addr_size() - get address and size from a device property * * This does no address translation. It simply reads an property that contains @@ -417,6 +427,11 @@ static inline fdt_addr_t dev_read_addr(struct udevice *dev) return devfdt_get_addr(dev); } +static inline void *dev_read_addr_ptr(struct udevice *dev) +{ + return devfdt_get_addr_ptr(dev); +} + static inline fdt_addr_t dev_read_addr_size(struct udevice *dev, const char *propname, fdt_size_t *sizep) From patchwork Mon Sep 11 20:04:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812584 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfBh2zDcz9s8J for ; Tue, 12 Sep 2017 06:08:44 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 0DC4BC21F9E; Mon, 11 Sep 2017 20:06:07 +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 1B0D7C21F9F; Mon, 11 Sep 2017 20:04:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9BDE8C21E31; Mon, 11 Sep 2017 20:04:43 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 54FCFC21E4B for ; Mon, 11 Sep 2017 20:04:43 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwi-0003kn-HJ; Mon, 11 Sep 2017 22:04:40 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:13 +0200 Message-Id: <1505160270-10650-6-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Joe Hershberger , Klaus Goger Subject: [U-Boot] [PATCH v3 05/19] net: designware: Convert to livetree 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" Update the Designware Ethernet MAC driver to support a live device tree. Signed-off-by: Philipp Tomsich Acked-by: Joe Hershberger --- Changes in v3: - added Joe's Acked-by: tag (which I had lost) Changes in v2: None drivers/net/designware.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 521e4dd..036d231 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -737,16 +737,14 @@ int designware_eth_ofdata_to_platdata(struct udevice *dev) #endif struct eth_pdata *pdata = &dw_pdata->eth_pdata; const char *phy_mode; - const fdt32_t *cell; #ifdef CONFIG_DM_GPIO int reset_flags = GPIOD_IS_OUT; #endif int ret = 0; - pdata->iobase = devfdt_get_addr(dev); + pdata->iobase = dev_read_addr(dev); pdata->phy_interface = -1; - phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", - NULL); + phy_mode = dev_read_string(dev, "phy-mode"); if (phy_mode) pdata->phy_interface = phy_get_interface_by_name(phy_mode); if (pdata->phy_interface == -1) { @@ -754,10 +752,7 @@ int designware_eth_ofdata_to_platdata(struct udevice *dev) return -EINVAL; } - pdata->max_speed = 0; - cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL); - if (cell) - pdata->max_speed = fdt32_to_cpu(*cell); + pdata->max_speed = dev_read_u32_default(dev, "max-speed", 0); #ifdef CONFIG_DM_GPIO if (dev_read_bool(dev, "snps,reset-active-low")) From patchwork Mon Sep 11 20:04:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812585 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfBj25Mkz9sBZ for ; Tue, 12 Sep 2017 06:08:45 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id ED14EC21FAB; Mon, 11 Sep 2017 20:06:21 +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 1BC1AC21F9C; Mon, 11 Sep 2017 20:04:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B7174C21F9E; Mon, 11 Sep 2017 20:04:48 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 73234C21DA4 for ; Mon, 11 Sep 2017 20:04:44 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwj-0003kn-HA; Mon, 11 Sep 2017 22:04:42 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:14 +0200 Message-Id: <1505160270-10650-7-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Marek Vasut , Alexandru Gagniuc , Joe Hershberger , Klaus Goger , Sebastien Bourdelin Subject: [U-Boot] [PATCH v3 06/19] net: phy: micrel: Convert to livetree 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" Update the Micrel KSZ90x1 driver for a live tree. Signed-off-by: Philipp Tomsich Acked-by: Joe Hershberger Reviewed-by: Simon Glass --- Changes in v3: - added Joe's Acked-by: tag (which I had lost) Changes in v2: None drivers/net/phy/micrel_ksz90x1.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c index 0bb99e6..b350a61 100644 --- a/drivers/net/phy/micrel_ksz90x1.c +++ b/drivers/net/phy/micrel_ksz90x1.c @@ -9,11 +9,11 @@ * (C) Copyright 2017 Adaptrum, Inc. * Written by Alexandru Gagniuc for Adaptrum, Inc. */ + #include #include #include #include -#include #include #include @@ -120,8 +120,7 @@ static int ksz90x1_of_config_group(struct phy_device *phydev, return -EOPNOTSUPP; for (i = 0; i < ofcfg->grpsz; i++) { - val[i] = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev), - ofcfg->grp[i].name, -1); + val[i] = dev_read_u32_default(dev, ofcfg->grp[i].name, ~0); offset = ofcfg->grp[i].off; if (val[i] == -1) { /* Default register value for KSZ9021 */ From patchwork Mon Sep 11 20:04:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812588 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfD61GW9z9s8J for ; Tue, 12 Sep 2017 06:09:58 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EE21EC21F2E; Mon, 11 Sep 2017 20:07: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=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 E33A0C21F86; Mon, 11 Sep 2017 20:05:31 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AC970C21E4B; Mon, 11 Sep 2017 20:04:51 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 0FD97C21F94 for ; Mon, 11 Sep 2017 20:04:48 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwk-0003kn-Qc; Mon, 11 Sep 2017 22:04:43 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:15 +0200 Message-Id: <1505160270-10650-8-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Klaus Goger Subject: [U-Boot] [PATCH v3 07/19] rockchip: mmc: convert to livetree 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" Update the Rockchip-specific wrapper for the Designware driver to support a live device tree. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich Version-changes: 2 - use the dev_read_addr_ptr function in rockchip_dw_mmc.c --- Changes in v3: None Changes in v2: None drivers/mmc/rockchip_dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index e7fcf89..807dc9e 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -58,7 +58,7 @@ static int rockchip_dwmmc_ofdata_to_platdata(struct udevice *dev) struct dwmci_host *host = &priv->host; host->name = dev->name; - host->ioaddr = (void *)devfdt_get_addr(dev); + host->ioaddr = dev_read_addr_ptr(dev); host->buswidth = dev_read_u32_default(dev, "bus-width", 4); host->get_mmc_clk = rockchip_dwmmc_get_mmc_clk; host->priv = dev; From patchwork Mon Sep 11 20:04:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812586 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfC651gvz9s8J for ; Tue, 12 Sep 2017 06:09:06 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 838A8C21FA4; Mon, 11 Sep 2017 20:06:36 +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 D83D7C21F92; Mon, 11 Sep 2017 20:05:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F285AC21F79; Mon, 11 Sep 2017 20:04:55 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id CBF8CC21F94 for ; Mon, 11 Sep 2017 20:04:51 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwl-0003kn-RF; Mon, 11 Sep 2017 22:04:44 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:16 +0200 Message-Id: <1505160270-10650-9-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Klaus Goger Subject: [U-Boot] [PATCH v3 08/19] rockchip: timer: implement timer_get_boot_us 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" To make the Rockchip DM timer driver useful for the timing of bootstages, we need a few enhancements: - This implements timer_get_boot_us. - This avoids reinitialising the timer, if it has already been set up (e.g. by our TPL and SPL stages). Now, we have a single timebase ticking from TPL through the full U-Boot. - This adds support for reading the timer even before the device-model is ready: we find the timer via /chosen/tick-timer, then read its address and clock-frequency, and finally read the timeval directly). Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich --- Changes in v3: None Changes in v2: None drivers/timer/rockchip_timer.c | 72 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 5 deletions(-) diff --git a/drivers/timer/rockchip_timer.c b/drivers/timer/rockchip_timer.c index cd349ca..b19aaed 100644 --- a/drivers/timer/rockchip_timer.c +++ b/drivers/timer/rockchip_timer.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -25,17 +26,72 @@ struct rockchip_timer_priv { struct rk_timer *timer; }; -static int rockchip_timer_get_count(struct udevice *dev, u64 *count) +static inline int64_t rockchip_timer_get_curr_value(struct rk_timer *timer) { - struct rockchip_timer_priv *priv = dev_get_priv(dev); uint64_t timebase_h, timebase_l; uint64_t cntr; - timebase_l = readl(&priv->timer->timer_curr_value0); - timebase_h = readl(&priv->timer->timer_curr_value1); + timebase_l = readl(&timer->timer_curr_value0); + timebase_h = readl(&timer->timer_curr_value1); - /* timers are down-counting */ cntr = timebase_h << 32 | timebase_l; + return cntr; +} + +#if CONFIG_IS_ENABLED(BOOTSTAGE) +ulong timer_get_boot_us(void) +{ + uint64_t ticks = 0; + uint32_t rate; + uint64_t us; + int ret; + + ret = dm_timer_init(); + + if (!ret) { + /* The timer is available */ + rate = timer_get_rate(gd->timer); + timer_get_count(gd->timer, &ticks); +#if !CONFIG_IS_ENABLED(OF_PLATDATA) + } else if (ret == -EAGAIN) { + /* We have been called so early that the DM is not ready,... */ + ofnode node = offset_to_ofnode(-1); + struct rk_timer *timer = NULL; + + /* + * ... so we try to access the raw timer, if it is specified + * via the tick-timer property in /chosen. + */ + node = ofnode_get_chosen_node("tick-timer"); + if (!ofnode_valid(node)) { + debug("%s: no /chosen/tick-timer\n", __func__); + return 0; + } + + timer = (struct rk_timer *)ofnode_get_addr(node); + + /* This timer is down-counting */ + ticks = ~0uLL - rockchip_timer_get_curr_value(timer); + if (ofnode_read_u32(node, "clock-frequency", &rate)) { + debug("%s: could not read clock-frequency\n", __func__); + return 0; + } +#endif + } else { + return 0; + } + + us = (ticks * 1000) / rate; + return us; +} +#endif + +static int rockchip_timer_get_count(struct udevice *dev, u64 *count) +{ + struct rockchip_timer_priv *priv = dev_get_priv(dev); + uint64_t cntr = rockchip_timer_get_curr_value(priv->timer); + + /* timers are down-counting */ *count = ~0ull - cntr; return 0; } @@ -58,6 +114,12 @@ static int rockchip_timer_start(struct udevice *dev) const uint32_t reload_val_l = reload_val & 0xffffffff; const uint32_t reload_val_h = reload_val >> 32; + /* don't reinit, if the timer is already running and set up */ + if ((readl(&priv->timer->timer_ctrl_reg) & 1) == 1 && + (readl(&priv->timer->timer_load_count0) == reload_val_l) && + (readl(&priv->timer->timer_load_count1) == reload_val_h)) + return 0; + /* disable timer and reset all control */ writel(0, &priv->timer->timer_ctrl_reg); /* write reload value */ From patchwork Mon Sep 11 20:04:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812582 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrf9h733Rz9s8J for ; Tue, 12 Sep 2017 06:07:52 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CB757C21F91; Mon, 11 Sep 2017 20:06:51 +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 B62C5C21F90; Mon, 11 Sep 2017 20:05:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9D36DC21FB7; Mon, 11 Sep 2017 20:04:51 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 6A0FDC21F9A for ; Mon, 11 Sep 2017 20:04:48 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwm-0003kn-F6; Mon, 11 Sep 2017 22:04:44 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:17 +0200 Message-Id: <1505160270-10650-10-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Klaus Goger Subject: [U-Boot] [PATCH v3 09/19] rockchip: timer: Convert to livetree 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" Update the Rockchip timer driver to support a live device tree. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich --- Changes in v3: None Changes in v2: - use the new dev_read_addr_ptr() function - improve error handling, in case dev_read_addr_ptr returns NULL drivers/timer/rockchip_timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/timer/rockchip_timer.c b/drivers/timer/rockchip_timer.c index b19aaed..07d1448 100644 --- a/drivers/timer/rockchip_timer.c +++ b/drivers/timer/rockchip_timer.c @@ -101,7 +101,9 @@ static int rockchip_clk_ofdata_to_platdata(struct udevice *dev) #if !CONFIG_IS_ENABLED(OF_PLATDATA) struct rockchip_timer_priv *priv = dev_get_priv(dev); - priv->timer = (struct rk_timer *)devfdt_get_addr(dev); + priv->timer = dev_read_addr_ptr(dev); + if (!priv->timer) + return -ENOENT; #endif return 0; From patchwork Mon Sep 11 20:04:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812603 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfLw1sk4z9sBZ for ; Tue, 12 Sep 2017 06:15:52 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EE285C21F86; Mon, 11 Sep 2017 20:13:45 +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 93EA9C21E67; Mon, 11 Sep 2017 20:13:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DD071C21F83; Mon, 11 Sep 2017 20:12:06 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 2F7B2C21FB3 for ; Mon, 11 Sep 2017 20:12:06 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwn-0003kn-AJ; Mon, 11 Sep 2017 22:04:46 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:18 +0200 Message-Id: <1505160270-10650-11-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Andy Yan , Klaus Goger Subject: [U-Boot] [PATCH v3 10/19] rockchip: clk: rk3368: Convert to livetree 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" Update the clock driver for the RK3368 to support a live device tree. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich Version-changes: 2 - use the dev_read_addr_ptr function in clk_rk3368.c --- Changes in v3: None Changes in v2: None drivers/clk/rockchip/clk_rk3368.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/rockchip/clk_rk3368.c b/drivers/clk/rockchip/clk_rk3368.c index 0160d50..e274781 100644 --- a/drivers/clk/rockchip/clk_rk3368.c +++ b/drivers/clk/rockchip/clk_rk3368.c @@ -485,7 +485,7 @@ static int rk3368_clk_ofdata_to_platdata(struct udevice *dev) #if !CONFIG_IS_ENABLED(OF_PLATDATA) struct rk3368_clk_priv *priv = dev_get_priv(dev); - priv->cru = (struct rk3368_cru *)devfdt_get_addr(dev); + priv->cru = dev_read_addr_ptr(dev); #endif return 0; From patchwork Mon Sep 11 20:04:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812602 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfKt3D54z9s8J for ; Tue, 12 Sep 2017 06:14:58 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 342EDC21FBB; Mon, 11 Sep 2017 20:12:49 +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 7D8B6C21F5E; Mon, 11 Sep 2017 20:12:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D84D6C21F7D; Mon, 11 Sep 2017 20:11:57 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 35FA4C21E67 for ; Mon, 11 Sep 2017 20:11:53 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwq-0003kn-60; Mon, 11 Sep 2017 22:04:48 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:19 +0200 Message-Id: <1505160270-10650-12-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Andy Yan , Klaus Goger Subject: [U-Boot] [PATCH v3 11/19] rockchip: pinctrl: rk3368: Convert to livetree 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" Update the pinctrl driver for the RK3368 to support a live device tree. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich --- Changes in v3: None Changes in v2: None drivers/pinctrl/rockchip/pinctrl_rk3368.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3368.c b/drivers/pinctrl/rockchip/pinctrl_rk3368.c index 81ce2e3..b1f5704 100644 --- a/drivers/pinctrl/rockchip/pinctrl_rk3368.c +++ b/drivers/pinctrl/rockchip/pinctrl_rk3368.c @@ -632,8 +632,7 @@ static int rk3368_pinctrl_get_periph_id(struct udevice *dev, u32 cell[3]; int ret; - ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(periph), - "interrupts", cell, ARRAY_SIZE(cell)); + ret = dev_read_u32_array(periph, "interrupts", cell, ARRAY_SIZE(cell)); if (ret < 0) return -EINVAL; From patchwork Mon Sep 11 20:04:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812598 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfJM2V02z9s8J for ; Tue, 12 Sep 2017 06:13:37 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6C33AC21EA7; Mon, 11 Sep 2017 20:12:34 +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 EF40AC21FC3; Mon, 11 Sep 2017 20:12:31 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 23400C21FAD; Mon, 11 Sep 2017 20:11:46 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 71282C21DA4 for ; Mon, 11 Sep 2017 20:11:43 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwr-0003kn-3w; Mon, 11 Sep 2017 22:04:49 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:20 +0200 Message-Id: <1505160270-10650-13-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Jagan Teki , Klaus Goger Subject: [U-Boot] [PATCH v3 12/19] rockchip: spi: Convert to livetree 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" Update the Rockchip SPI driver to support a live device tree. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Reviewed-by: Jagan Teki Acked-by: Philipp Tomsich --- Changes in v3: - added Jagan's Reviewed-by: tag. Changes in v2: None drivers/spi/rk_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c index c70d636..b18db74 100644 --- a/drivers/spi/rk_spi.c +++ b/drivers/spi/rk_spi.c @@ -184,7 +184,7 @@ static int rockchip_spi_ofdata_to_platdata(struct udevice *bus) struct rockchip_spi_priv *priv = dev_get_priv(bus); int ret; - plat->base = devfdt_get_addr(bus); + plat->base = dev_read_addr(bus); ret = clk_get_by_index(bus, 0, &priv->clk); if (ret < 0) { From patchwork Mon Sep 11 20:04:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812590 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfG06BSKz9s8J for ; Tue, 12 Sep 2017 06:11:36 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 840B5C21F2E; Mon, 11 Sep 2017 20:11: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=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 A1AB0C21E64; Mon, 11 Sep 2017 20:11:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3298CC21E64; Mon, 11 Sep 2017 20:11:26 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id D9406C21E4B for ; Mon, 11 Sep 2017 20:11:25 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwr-0003kn-MZ; Mon, 11 Sep 2017 22:04:49 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:21 +0200 Message-Id: <1505160270-10650-14-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Klaus Goger Subject: [U-Boot] [PATCH v3 13/19] rockchip: sdhci: Convert to livetree 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" Update the Rockchip SDHCI wrapper to support a live device tree. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich Version-changes: 2 - use the dev_read_addr_ptr function in rockchip_sdhci.c --- Changes in v3: None Changes in v2: None drivers/mmc/rockchip_sdhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c index f31d329..346a42c 100644 --- a/drivers/mmc/rockchip_sdhci.c +++ b/drivers/mmc/rockchip_sdhci.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -82,7 +81,7 @@ static int arasan_sdhci_ofdata_to_platdata(struct udevice *dev) struct sdhci_host *host = dev_get_priv(dev); host->name = dev->name; - host->ioaddr = devfdt_get_addr_ptr(dev); + host->ioaddr = dev_read_addr_ptr(dev); #endif return 0; From patchwork Mon Sep 11 20:04:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812592 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfHJ5Tjdz9sNw for ; Tue, 12 Sep 2017 06:12:44 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5095FC21E67; Mon, 11 Sep 2017 20:11:44 +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 A4937C21F7D; Mon, 11 Sep 2017 20:11:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7DFB9C21F92; Mon, 11 Sep 2017 20:11:35 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id A6270C21E4B for ; Mon, 11 Sep 2017 20:11:32 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwt-0003kn-CS; Mon, 11 Sep 2017 22:04:51 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:22 +0200 Message-Id: <1505160270-10650-15-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Jacob Chen , Klaus Goger Subject: [U-Boot] [PATCH v3 14/19] rockchip: rk8xx: remove unused header includes 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" Remove header file includes that have been left over after the conversion to livetree-support. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich --- Changes in v3: None Changes in v2: None drivers/power/pmic/rk8xx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c index eb3ec0f..735046d 100644 --- a/drivers/power/pmic/rk8xx.c +++ b/drivers/power/pmic/rk8xx.c @@ -8,8 +8,6 @@ #include #include #include -#include -#include #include #include From patchwork Mon Sep 11 20:04:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812605 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfMK0CwKz9s5L for ; Tue, 12 Sep 2017 06:16:12 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B46FCC21FAE; Mon, 11 Sep 2017 20:14:15 +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 14ECFC21FBD; Mon, 11 Sep 2017 20:13:39 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 44970C21FAE; Mon, 11 Sep 2017 20:12:25 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 3874FC21FB3 for ; Mon, 11 Sep 2017 20:12:25 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwt-0003kn-Vt; Mon, 11 Sep 2017 22:04:52 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:23 +0200 Message-Id: <1505160270-10650-16-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Klaus Goger Subject: [U-Boot] [PATCH v3 15/19] rockchip: i2c: Convert to livetree 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" Update the Rockchip I2C driver to support livetree. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich Acked-by: Heiko Schocher --- Changes in v3: - added Heiko's Acked-by: tag. Changes in v2: - use the dev_read_addr_ptr function in rk_i2c.c drivers/i2c/rk_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/rk_i2c.c b/drivers/i2c/rk_i2c.c index 68e6653..840b3f6 100644 --- a/drivers/i2c/rk_i2c.c +++ b/drivers/i2c/rk_i2c.c @@ -382,7 +382,7 @@ static int rockchip_i2c_probe(struct udevice *bus) { struct rk_i2c *priv = dev_get_priv(bus); - priv->regs = (void *)devfdt_get_addr(bus); + priv->regs = dev_read_addr_ptr(bus); return 0; } From patchwork Mon Sep 11 20:04:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812604 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfM81Nvkz9s5L for ; Tue, 12 Sep 2017 06:16:04 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id DB860C21EDE; Mon, 11 Sep 2017 20:14:32 +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 3C0BEC21FB0; Mon, 11 Sep 2017 20:13:41 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6B88EC21FC1; Mon, 11 Sep 2017 20:12:12 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 9CEB5C21F2E for ; Mon, 11 Sep 2017 20:12:12 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwu-0003kn-JA; Mon, 11 Sep 2017 22:04:52 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:24 +0200 Message-Id: <1505160270-10650-17-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Klaus Goger Subject: [U-Boot] [PATCH v3 16/19] rockchip: gpio: convert to livetree 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" Update the Rockchip GPIO-bank driver to support a live tree. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich Version-changes: 2 - use the dev_read_addr_ptr function in rk_gpio.c --- Changes in v3: None Changes in v2: None drivers/gpio/rk_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/rk_gpio.c b/drivers/gpio/rk_gpio.c index 6f7366a..a6b83b2 100644 --- a/drivers/gpio/rk_gpio.c +++ b/drivers/gpio/rk_gpio.c @@ -104,7 +104,7 @@ static int rockchip_gpio_probe(struct udevice *dev) int ret; /* This only supports RK3288 at present */ - priv->regs = (struct rockchip_gpio_regs *)devfdt_get_addr(dev); + priv->regs = dev_read_addr_ptr(dev); ret = uclass_first_device_err(UCLASS_PINCTRL, &priv->pinctrl); if (ret) return ret; From patchwork Mon Sep 11 20:04:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812606 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfNk15cgz9s5L for ; Tue, 12 Sep 2017 06:17:26 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E50D6C21E72; Mon, 11 Sep 2017 20:14:00 +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 C3ADAC21FA8; Mon, 11 Sep 2017 20:13:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 990C8C21E4B; Mon, 11 Sep 2017 20:12:31 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 0A946C21FC2 for ; Mon, 11 Sep 2017 20:12:31 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwv-0003kn-5T; Mon, 11 Sep 2017 22:04:54 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:25 +0200 Message-Id: <1505160270-10650-18-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Klaus Goger Subject: [U-Boot] [PATCH v3 17/19] rockchip: gpio: remove outdated/misleading comment 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" Remove a comment claiming that this driver only supports the RK3288, as we also use it on the RK3368, RK3399 and (most likely) on other variants. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich Version-changes: 2 - use the dev_read_addr_ptr function in rk_gpio.c --- Changes in v3: None Changes in v2: None drivers/gpio/rk_gpio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpio/rk_gpio.c b/drivers/gpio/rk_gpio.c index a6b83b2..11fc3e2 100644 --- a/drivers/gpio/rk_gpio.c +++ b/drivers/gpio/rk_gpio.c @@ -103,7 +103,6 @@ static int rockchip_gpio_probe(struct udevice *dev) char *end; int ret; - /* This only supports RK3288 at present */ priv->regs = dev_read_addr_ptr(dev); ret = uclass_first_device_err(UCLASS_PINCTRL, &priv->pinctrl); if (ret) From patchwork Mon Sep 11 20:04:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812601 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfJg0qJBz9s8J for ; Tue, 12 Sep 2017 06:13:54 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4C2CAC21F9F; Mon, 11 Sep 2017 20:13:05 +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 93BA6C21E67; Mon, 11 Sep 2017 20:13:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4F90AC21F4A; Mon, 11 Sep 2017 20:12:19 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id AEE4AC21FB0 for ; Mon, 11 Sep 2017 20:12:19 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwx-0003kn-0D; Mon, 11 Sep 2017 22:04:55 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:26 +0200 Message-Id: <1505160270-10650-19-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Albert Aribaud , Klaus Goger Subject: [U-Boot] [PATCH v3 18/19] rockchip: dts: rk3368-lion: add /chosen/tick-timer 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" To support bootstage recording, we want to mark our DM timer as the tick-timer; this triggers the support for 'trying harder' to read the timer in the Rockchip DM timer driver, even if the device model isn't ready yet. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich --- Changes in v3: None Changes in v2: None arch/arm/dts/rk3368-lion-u-boot.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/dts/rk3368-lion-u-boot.dtsi b/arch/arm/dts/rk3368-lion-u-boot.dtsi index dbf614c..a9b7f81 100644 --- a/arch/arm/dts/rk3368-lion-u-boot.dtsi +++ b/arch/arm/dts/rk3368-lion-u-boot.dtsi @@ -13,6 +13,7 @@ chosen { stdout-path = "serial0:115200n8"; u-boot,spl-boot-order = &emmc, &sdmmc; + tick-timer = "/timer@ff810000"; }; }; @@ -88,6 +89,7 @@ &timer0 { u-boot,dm-pre-reloc; clock-frequency = <24000000>; + status = "okay"; }; From patchwork Mon Sep 11 20:04:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 812600 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.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 3xrfJT4xfpz9sBZ for ; Tue, 12 Sep 2017 06:13:45 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3CD4CC21F95; Mon, 11 Sep 2017 20:13: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=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 62D22C21F95; Mon, 11 Sep 2017 20:13:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 59F87C21F95; Mon, 11 Sep 2017 20:12:00 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 6E340C21FAA for ; Mon, 11 Sep 2017 20:12:00 +0000 (UTC) Received: from [86.59.122.178] (port=59228 helo=android.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1drUwx-0003kn-Ia; Mon, 11 Sep 2017 22:04:55 +0200 From: Philipp Tomsich To: u-boot@lists.denx.de Date: Mon, 11 Sep 2017 22:04:27 +0200 Message-Id: <1505160270-10650-20-git-send-email-philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505160270-10650-1-git-send-email-philipp.tomsich@theobroma-systems.com> Cc: Klaus Goger Subject: [U-Boot] [PATCH v3 19/19] rockchip: lion-rk3368: defconfig: resync w/ OF_LIVE and BOOTSTAGE enabled 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" This adds OF_LIVE and BOOTSTAGE support for the RK3368-uQ7 and regenerates the defconfig (picking up a few changes/reorderings) from upstream Kconfig changes. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Acked-by: Philipp Tomsich --- Changes in v3: None Changes in v2: None configs/lion-rk3368_defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configs/lion-rk3368_defconfig b/configs/lion-rk3368_defconfig index 45a12a8..c7ee7b3 100644 --- a/configs/lion-rk3368_defconfig +++ b/configs/lion-rk3368_defconfig @@ -19,6 +19,11 @@ CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_SOURCE="board/theobroma-systems/lion_rk3368/fit_spl_atf.its" +CONFIG_BOOTSTAGE=y +CONFIG_SPL_BOOTSTAGE=y +CONFIG_BOOTSTAGE_REPORT=y +CONFIG_BOOTSTAGE_FDT=y +CONFIG_ENV_IS_IN_MMC=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_ARCH_EARLY_INIT_R=y CONFIG_SPL=y @@ -37,10 +42,12 @@ CONFIG_TPL_DRIVERS_MISC_SUPPORT=y CONFIG_CMD_GPIO=y CONFIG_CMD_MMC=y CONFIG_CMD_SF=y +CONFIG_CMD_BOOTSTAGE=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_MTDPARTS=y CONFIG_SPL_OF_CONTROL=y CONFIG_TPL_OF_CONTROL=y +CONFIG_OF_LIVE=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names interrupt-parent" CONFIG_TPL_OF_PLATDATA=y CONFIG_ENV_IS_IN_MMC=y