From patchwork Thu Jun 14 10:45:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 929211 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 415p124y8zz9s01 for ; Thu, 14 Jun 2018 12:46:46 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3EE99C21DA6; Thu, 14 Jun 2018 02:45:53 +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 ACF80C21DC1; Thu, 14 Jun 2018 02:45:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 770E3C21D74; Thu, 14 Jun 2018 02:45:38 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lists.denx.de (Postfix) with ESMTPS id 4D1ADC21DC1 for ; Thu, 14 Jun 2018 02:45:34 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2018 19:45:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,221,1526367600"; d="scan'208";a="66846132" Received: from lftan-mobl.gar.corp.intel.com (HELO ubuntu) ([10.226.248.78]) by orsmga002.jf.intel.com with SMTP; 13 Jun 2018 19:45:28 -0700 Received: by ubuntu (sSMTP sendmail emulation); Thu, 14 Jun 2018 18:45:28 +0800 From: Ley Foon Tan To: u-boot@lists.denx.de Date: Thu, 14 Jun 2018 18:45:19 +0800 Message-Id: <1528973123-21858-2-git-send-email-ley.foon.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528973123-21858-1-git-send-email-ley.foon.tan@intel.com> References: <1528973123-21858-1-git-send-email-ley.foon.tan@intel.com> Cc: Marek Vasut , Tom Rini , Joe Hershberger , Chin Liang See Subject: [U-Boot] [PATCH v6 1/5] reset: Rename CONFIG_SPL_RESET_SUPPORT to CONFIG_SPL_DM_RESET 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" Rename CONFIG_SPL_RESET_SUPPORT to CONFIG_SPL_DM_RESET, so can use CONFIG_IS_ENABLED(DM_RESET) checking in reset.h later. Signed-off-by: Ley Foon Tan Reviewed-by: Simon Glass --- arch/arm/mach-stm32mp/Kconfig | 2 +- common/spl/Kconfig | 2 +- drivers/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig index abceede..898ad6b 100644 --- a/arch/arm/mach-stm32mp/Kconfig +++ b/arch/arm/mach-stm32mp/Kconfig @@ -13,7 +13,7 @@ config SPL select SPL_OF_TRANSLATE select SPL_PINCTRL select SPL_REGMAP - select SPL_RESET_SUPPORT + select SPL_DM_RESET select SPL_SERIAL_SUPPORT select SPL_SYSCON select SPL_DRIVERS_MISC_SUPPORT diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 431710a..bf301a9 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -577,7 +577,7 @@ config SPL_POST_MEM_SUPPORT performed before booting. This enables the drivers in post/drivers as part of an SPL build. -config SPL_RESET_SUPPORT +config SPL_DM_RESET bool "Support reset drivers" depends on SPL help diff --git a/drivers/Makefile b/drivers/Makefile index a213ea9..66834c3 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -28,7 +28,7 @@ obj-$(CONFIG_ARMADA_XP) += ddr/marvell/axp/ obj-$(CONFIG_ALTERA_SDRAM) += ddr/altera/ obj-$(CONFIG_SPL_POWER_SUPPORT) += power/ power/pmic/ obj-$(CONFIG_SPL_POWER_SUPPORT) += power/regulator/ -obj-$(CONFIG_SPL_RESET_SUPPORT) += reset/ +obj-$(CONFIG_SPL_DM_RESET) += reset/ obj-$(CONFIG_SPL_MTD_SUPPORT) += mtd/ obj-$(CONFIG_SPL_ONENAND_SUPPORT) += mtd/onenand/ obj-$(CONFIG_SPL_UBI) += mtd/ubispl/ From patchwork Thu Jun 14 10:45:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 929213 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 415p221s8vz9s01 for ; Thu, 14 Jun 2018 12:47:38 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E4EAEC21D56; Thu, 14 Jun 2018 02:46: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 7CEC9C21D72; Thu, 14 Jun 2018 02:45:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E0149C21DD4; Thu, 14 Jun 2018 02:45:42 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lists.denx.de (Postfix) with ESMTPS id B3257C21E0B for ; Thu, 14 Jun 2018 02:45:38 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2018 19:45:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,221,1526367600"; d="scan'208";a="59091403" Received: from lftan-mobl.gar.corp.intel.com (HELO ubuntu) ([10.226.248.78]) by orsmga003.jf.intel.com with SMTP; 13 Jun 2018 19:45:33 -0700 Received: by ubuntu (sSMTP sendmail emulation); Thu, 14 Jun 2018 18:45:33 +0800 From: Ley Foon Tan To: u-boot@lists.denx.de Date: Thu, 14 Jun 2018 18:45:20 +0800 Message-Id: <1528973123-21858-3-git-send-email-ley.foon.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528973123-21858-1-git-send-email-ley.foon.tan@intel.com> References: <1528973123-21858-1-git-send-email-ley.foon.tan@intel.com> Cc: Marek Vasut , Tom Rini , Joe Hershberger , Chin Liang See Subject: [U-Boot] [PATCH v6 2/5] include: reset: Change to use CONFIG_IS_ENABLED(DM_RESET) 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" Change to use CONFIG_IS_ENABLED(DM_RESET), so this can work in SPL build (CONFIG_SPL_DM_RESET) and U-boot build (CONFIG_DM_RESET). Signed-off-by: Ley Foon Tan Reviewed-by: Simon Glass --- include/reset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/reset.h b/include/reset.h index 201bafc..a7bbc1c 100644 --- a/include/reset.h +++ b/include/reset.h @@ -77,7 +77,7 @@ struct reset_ctl_bulk { unsigned int count; }; -#ifdef CONFIG_DM_RESET +#if CONFIG_IS_ENABLED(DM_RESET) /** * reset_get_by_index - Get/request a reset signal by integer index. * From patchwork Thu Jun 14 10:45:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 929214 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 415p2f53KPz9s01 for ; Thu, 14 Jun 2018 12:48:10 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5664EC21DD3; Thu, 14 Jun 2018 02:46:11 +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 9C682C21DD3; Thu, 14 Jun 2018 02:45:56 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F1899C21C6A; Thu, 14 Jun 2018 02:45:47 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lists.denx.de (Postfix) with ESMTPS id 151DDC21C6A for ; Thu, 14 Jun 2018 02:45:42 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2018 19:45:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,221,1526367600"; d="scan'208";a="63937757" Received: from lftan-mobl.gar.corp.intel.com (HELO ubuntu) ([10.226.248.78]) by fmsmga001.fm.intel.com with SMTP; 13 Jun 2018 19:45:38 -0700 Received: by ubuntu (sSMTP sendmail emulation); Thu, 14 Jun 2018 18:45:37 +0800 From: Ley Foon Tan To: u-boot@lists.denx.de Date: Thu, 14 Jun 2018 18:45:21 +0800 Message-Id: <1528973123-21858-4-git-send-email-ley.foon.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528973123-21858-1-git-send-email-ley.foon.tan@intel.com> References: <1528973123-21858-1-git-send-email-ley.foon.tan@intel.com> Cc: Marek Vasut , Tom Rini , Joe Hershberger , Chin Liang See Subject: [U-Boot] [PATCH v6 3/5] mmc: dwmmc: socfpga: Add reset ctrl to driver 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 code to reset all reset signals as in mmc DT node. A reset property is an optional feature, so only print out a warning and do not fail if a reset property is not present. If a reset property is discovered, then use it to deassert, thus bringing the IP out of reset. Signed-off-by: Ley Foon Tan Reviewed-by: Simon Glass --- v3: - Removed #ifdef CONFIG_DM_RESET switch. v5: - Added Simon's Reviewed-by. --- drivers/mmc/socfpga_dw_mmc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/mmc/socfpga_dw_mmc.c b/drivers/mmc/socfpga_dw_mmc.c index d0a0362..4be4eb5 100644 --- a/drivers/mmc/socfpga_dw_mmc.c +++ b/drivers/mmc/socfpga_dw_mmc.c @@ -13,6 +13,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -33,6 +34,20 @@ struct dwmci_socfpga_priv_data { unsigned int smplsel; }; +static void socfpga_dwmci_reset(struct udevice *dev) +{ + struct reset_ctl_bulk reset_bulk; + int ret; + + ret = reset_get_bulk(dev, &reset_bulk); + if (ret) { + dev_warn(dev, "Can't get reset: %d\n", ret); + return; + } + + reset_deassert_bulk(&reset_bulk); +} + static void socfpga_dwmci_clksel(struct dwmci_host *host) { struct dwmci_socfpga_priv_data *priv = host->priv; @@ -109,6 +124,8 @@ static int socfpga_dwmmc_probe(struct udevice *dev) struct dwmci_socfpga_priv_data *priv = dev_get_priv(dev); struct dwmci_host *host = &priv->host; + socfpga_dwmci_reset(dev); + #ifdef CONFIG_BLK dwmci_setup_cfg(&plat->cfg, host, host->bus_hz, 400000); host->mmc = &plat->mmc; From patchwork Thu Jun 14 10:45:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 929216 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 415p481R4dz9s01 for ; Thu, 14 Jun 2018 12:49:28 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D626EC21DA2; Thu, 14 Jun 2018 02:47:01 +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 71BA6C21DED; Thu, 14 Jun 2018 02:46:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 464B4C21DA2; Thu, 14 Jun 2018 02:45:51 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lists.denx.de (Postfix) with ESMTPS id F247EC21E0B for ; Thu, 14 Jun 2018 02:45:47 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2018 19:45:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,221,1526367600"; d="scan'208";a="57180608" Received: from lftan-mobl.gar.corp.intel.com (HELO ubuntu) ([10.226.248.78]) by FMSMGA003.fm.intel.com with SMTP; 13 Jun 2018 19:45:42 -0700 Received: by ubuntu (sSMTP sendmail emulation); Thu, 14 Jun 2018 18:45:41 +0800 From: Ley Foon Tan To: u-boot@lists.denx.de Date: Thu, 14 Jun 2018 18:45:22 +0800 Message-Id: <1528973123-21858-5-git-send-email-ley.foon.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528973123-21858-1-git-send-email-ley.foon.tan@intel.com> References: <1528973123-21858-1-git-send-email-ley.foon.tan@intel.com> Cc: Marek Vasut , Tom Rini , Joe Hershberger , Chin Liang See Subject: [U-Boot] [PATCH v6 4/5] serial: ns16550: Add reset ctrl to driver 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 code to reset all reset signals as in serial DT node. A reset property is an optional feature, so do not fail if a reset property is not present. If a reset property is discovered, then use it to deassert, thus bringing the IP out of reset. Signed-off-by: Ley Foon Tan Reviewed-by: Marek Vasut Reviewed-by: Simon Glass --- v2: - Added Marek's Reviewed-by. v5: - Added Simon's Reviewed-by. --- drivers/serial/ns16550.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 53550bf..9c80090 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -177,6 +178,7 @@ void NS16550_init(NS16550_t com_port, int baud_divisor) #if defined(CONFIG_ARCH_OMAP2PLUS) serial_out(0x7, &com_port->mdr1); /* mode select reset TL16C750*/ #endif + serial_out(UART_MCRVAL, &com_port->mcr); serial_out(ns16550_getfcr(com_port), &com_port->fcr); if (baud_divisor != -1) @@ -370,6 +372,12 @@ static int ns16550_serial_setbrg(struct udevice *dev, int baudrate) int ns16550_serial_probe(struct udevice *dev) { struct NS16550 *const com_port = dev_get_priv(dev); + struct reset_ctl_bulk reset_bulk; + int ret; + + ret = reset_get_bulk(dev, &reset_bulk); + if (!ret) + reset_deassert_bulk(&reset_bulk); com_port->plat = dev_get_platdata(dev); NS16550_init(com_port, -1); From patchwork Thu Jun 14 10:45:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 929212 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 415p1f528kz9s01 for ; Thu, 14 Jun 2018 12:47:18 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 43C07C21DB6; Thu, 14 Jun 2018 02:46: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 325C3C21D56; Thu, 14 Jun 2018 02:46:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 861E4C21C93; Thu, 14 Jun 2018 02:45:55 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lists.denx.de (Postfix) with ESMTPS id 78AD3C21DD3 for ; Thu, 14 Jun 2018 02:45:51 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2018 19:45:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,221,1526367600"; d="scan'208";a="64417133" Received: from lftan-mobl.gar.corp.intel.com (HELO ubuntu) ([10.226.248.78]) by orsmga001.jf.intel.com with SMTP; 13 Jun 2018 19:45:46 -0700 Received: by ubuntu (sSMTP sendmail emulation); Thu, 14 Jun 2018 18:45:46 +0800 From: Ley Foon Tan To: u-boot@lists.denx.de Date: Thu, 14 Jun 2018 18:45:23 +0800 Message-Id: <1528973123-21858-6-git-send-email-ley.foon.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528973123-21858-1-git-send-email-ley.foon.tan@intel.com> References: <1528973123-21858-1-git-send-email-ley.foon.tan@intel.com> Cc: Marek Vasut , Tom Rini , Joe Hershberger , Chin Liang See Subject: [U-Boot] [PATCH v6 5/5] net: designware: Add reset ctrl to driver 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 code to reset all reset signals as in Ethernet DT node. A reset property is an optional feature, so only print out a warning and do not fail if a reset property is not present. If a reset property is discovered, then use it to deassert, thus bringing the IP out of reset. Signed-off-by: Ley Foon Tan Reviewed-by: Simon Glass Acked-by: Joe Hershberger --- v2: - Removed 'return' when failed to reset. v5: - Added Simon's Reviewed-by. v6: - Added Joe's Acked-by. --- drivers/net/designware.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index cf12521..6797691 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -664,6 +665,7 @@ int designware_eth_probe(struct udevice *dev) u32 iobase = pdata->iobase; ulong ioaddr; int ret; + struct reset_ctl_bulk reset_bulk; #ifdef CONFIG_CLK int i, err, clock_nb; @@ -710,6 +712,12 @@ int designware_eth_probe(struct udevice *dev) } #endif + ret = reset_get_bulk(dev, &reset_bulk); + if (ret) + dev_warn(dev, "Can't get reset: %d\n", ret); + else + reset_deassert_bulk(&reset_bulk); + #ifdef CONFIG_DM_PCI /* * If we are on PCI bus, either directly attached to a PCI root port,