From patchwork Fri Apr 27 08:17: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: 905520 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=none (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 40XRdh5yYdz9ryr for ; Fri, 27 Apr 2018 18:18:16 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 77A6CC220D9; Fri, 27 Apr 2018 08:17:55 +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 2B8C3C220CE; Fri, 27 Apr 2018 08:17:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B32AEC22024; Fri, 27 Apr 2018 08:17:43 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by lists.denx.de (Postfix) with ESMTPS id D7180C220E1 for ; Fri, 27 Apr 2018 08:17:37 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 01:17:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,334,1520924400"; d="scan'208";a="194818346" Received: from lftan-mobl.gar.corp.intel.com (HELO ubuntu) ([10.226.248.79]) by orsmga004.jf.intel.com with SMTP; 27 Apr 2018 01:17:33 -0700 Received: by ubuntu (sSMTP sendmail emulation); Fri, 27 Apr 2018 16:17:30 +0800 From: Ley Foon Tan To: u-boot@lists.denx.de, Marek Vasut Date: Fri, 27 Apr 2018 16:17:23 +0800 Message-Id: <1524817045-31252-2-git-send-email-ley.foon.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524817045-31252-1-git-send-email-ley.foon.tan@intel.com> References: <1524817045-31252-1-git-send-email-ley.foon.tan@intel.com> Cc: Chin Liang See , Dinh Nguyen Subject: [U-Boot] [PATCH 1/3] 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 --- drivers/mmc/socfpga_dw_mmc.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/socfpga_dw_mmc.c b/drivers/mmc/socfpga_dw_mmc.c index 9ace505..3a110a8 100644 --- a/drivers/mmc/socfpga_dw_mmc.c +++ b/drivers/mmc/socfpga_dw_mmc.c @@ -14,6 +14,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -34,6 +35,22 @@ struct dwmci_socfpga_priv_data { unsigned int smplsel; }; +static void socfpga_dwmci_reset(struct udevice *dev) +{ +#ifdef CONFIG_DM_RESET + 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); +#endif +} + static void socfpga_dwmci_clksel(struct dwmci_host *host) { struct dwmci_socfpga_priv_data *priv = host->priv; @@ -110,6 +127,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 Fri Apr 27 08:17:24 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: 905522 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=none (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 40XRgT2r4Gz9s0v for ; Fri, 27 Apr 2018 18:19:49 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 13452C220F4; Fri, 27 Apr 2018 08:18:13 +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 5D402C2208F; Fri, 27 Apr 2018 08:17:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6AEA7C21FAE; Fri, 27 Apr 2018 08:17:45 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lists.denx.de (Postfix) with ESMTPS id ACDFBC220BD for ; Fri, 27 Apr 2018 08:17:41 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 01:17:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,334,1520924400"; d="scan'208";a="223833781" Received: from lftan-mobl.gar.corp.intel.com (HELO ubuntu) ([10.226.248.79]) by fmsmga006.fm.intel.com with SMTP; 27 Apr 2018 01:17:37 -0700 Received: by ubuntu (sSMTP sendmail emulation); Fri, 27 Apr 2018 16:17:35 +0800 From: Ley Foon Tan To: u-boot@lists.denx.de, Marek Vasut Date: Fri, 27 Apr 2018 16:17:24 +0800 Message-Id: <1524817045-31252-3-git-send-email-ley.foon.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524817045-31252-1-git-send-email-ley.foon.tan@intel.com> References: <1524817045-31252-1-git-send-email-ley.foon.tan@intel.com> Cc: Chin Liang See , Dinh Nguyen Subject: [U-Boot] [PATCH 2/3] 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 --- drivers/serial/ns16550.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 53550bf..457b636 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) @@ -371,6 +373,16 @@ int ns16550_serial_probe(struct udevice *dev) { struct NS16550 *const com_port = dev_get_priv(dev); +#ifdef CONFIG_DM_RESET + struct reset_ctl_bulk reset_bulk; + int ret; + + ret = reset_get_bulk(dev, &reset_bulk); + if (!ret) + reset_deassert_bulk(&reset_bulk); + +#endif + com_port->plat = dev_get_platdata(dev); NS16550_init(com_port, -1); From patchwork Fri Apr 27 08:17:25 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: 905523 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=none (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 40XRgV1g0gz9s0w for ; Fri, 27 Apr 2018 18:19:50 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CF1ADC21F74; Fri, 27 Apr 2018 08:18:57 +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 A67D0C22094; Fri, 27 Apr 2018 08:18:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DDC1BC22058; Fri, 27 Apr 2018 08:17:49 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lists.denx.de (Postfix) with ESMTPS id 55E31C220D3 for ; Fri, 27 Apr 2018 08:17:45 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Apr 2018 01:17:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,334,1520924400"; d="scan'208";a="35055961" Received: from lftan-mobl.gar.corp.intel.com (HELO ubuntu) ([10.226.248.79]) by fmsmga007.fm.intel.com with SMTP; 27 Apr 2018 01:17:41 -0700 Received: by ubuntu (sSMTP sendmail emulation); Fri, 27 Apr 2018 16:17:39 +0800 From: Ley Foon Tan To: u-boot@lists.denx.de, Marek Vasut Date: Fri, 27 Apr 2018 16:17:25 +0800 Message-Id: <1524817045-31252-4-git-send-email-ley.foon.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524817045-31252-1-git-send-email-ley.foon.tan@intel.com> References: <1524817045-31252-1-git-send-email-ley.foon.tan@intel.com> Cc: Chin Liang See , Dinh Nguyen Subject: [U-Boot] [PATCH 3/3] 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 --- drivers/net/designware.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 43670a7..e34f3fb 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -713,6 +714,18 @@ int designware_eth_probe(struct udevice *dev) } #endif +#ifdef CONFIG_DM_RESET + struct reset_ctl_bulk reset_bulk; + + 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); +#endif + #ifdef CONFIG_DM_PCI /* * If we are on PCI bus, either directly attached to a PCI root port,