From patchwork Wed Apr 29 13:04:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Seiler X-Patchwork-Id: 1279294 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=qL2PA+jO; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49BzJZ53yDz9sSq for ; Wed, 29 Apr 2020 23:05:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 50D6F820F0; Wed, 29 Apr 2020 15:05:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1588165514; bh=pVxqUBRNvlUV8dORdcnuZXxdgQj06bLhQm7Aqa2AIk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qL2PA+jOvTAV1OVR4FpxDItjsVB5PMdstLJDDMr8Zu6UZNfgsDt4nGD776WypS5m2 mDTEVJxbNr2+7w0xLLxgvgk7UDI9/fCalWLXo94NNQixQ9qmKk5wVRAUeMybZb5EwI L2sMRduroJ+WhuJ95/q4SJVRn3S38iTLoRQj2APHoRI+mBQXxWs9QarT9NC9vxIgwr dc79oO252ZsJf+8+kr05cmKIGBAx+NIzsOD1vwaiSV3ce0HhZQ4P8w9BCq07HdIdHb n7BpTgSF1IFYGvApOR7PBfEZSQPMSnIJyWd7XpqPjkzux7DUp/CSSuBBP/jJwNy0qH 5Pvmz5r4hMm+A== Received: by phobos.denx.de (Postfix, from userid 109) id 24BAC820E0; Wed, 29 Apr 2020 15:05:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 73CE7820A2 for ; Wed, 29 Apr 2020 15:04:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49BzJ811P2z1qs0h; Wed, 29 Apr 2020 15:04:56 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49BzJ76YbWz1qv7N; Wed, 29 Apr 2020 15:04:55 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id lfuGX0Ct2Mjv; Wed, 29 Apr 2020 15:04:51 +0200 (CEST) X-Auth-Info: T8PAPJCuWL9uS9PSPMKgx4/EbQ15F1mNapn19rIlPd4= Received: from localhost.localdomain (p5484738E.dip0.t-ipconnect.de [84.132.115.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 29 Apr 2020 15:04:51 +0200 (CEST) From: Harald Seiler To: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam Cc: Harald Seiler , "NXP i.MX U-Boot Team" , Claudius Heine , Flavio Suligoi , Igor Opaniuk , Marcel Ziswiler , Oleksandr Suvorov , Peng Fan , Simon Glass , Marek Vasut Subject: [PATCH 1/8] ARM: imx8m: Do not define do_reset() if sysreset is enabled Date: Wed, 29 Apr 2020 15:04:21 +0200 Message-Id: <20200429130428.124788-2-hws@denx.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200429130428.124788-1-hws@denx.de> References: <20200429130428.124788-1-hws@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Marek Vasut The SPL can also be compiled with sysreset drivers just fine, so update the condition to cater for that option. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Flavio Suligoi Cc: Harald Seiler Cc: Igor Opaniuk Cc: Marcel Ziswiler Cc: Oleksandr Suvorov Cc: Peng Fan Cc: Stefano Babic --- arch/arm/mach-imx/imx8m/soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 7fcbd53f3020..0f17252e80b7 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -382,7 +382,7 @@ int ft_system_setup(void *blob, bd_t *bd) } #endif -#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SYSRESET) +#if !CONFIG_IS_ENABLED(SYSRESET) void reset_cpu(ulong addr) { struct watchdog_regs *wdog = (struct watchdog_regs *)addr; From patchwork Wed Apr 29 13:04:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Seiler X-Patchwork-Id: 1279295 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=lASmRsfq; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49BzJp65pBz9sSq for ; Wed, 29 Apr 2020 23:05:30 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D7C5D820F6; Wed, 29 Apr 2020 15:05:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1588165518; bh=LJs/qcyG8x45RMRp5sz624/Ml8NdmQ04N9+LH29PGaI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lASmRsfqdgpFj75InHEnVvJXVWw/FEzPF5QCMIy2kMpvLmwla3/A9V3n9MVNZh91f 4wOwAfO6N+3TNAkKTubJTfScg0L2mIyLJOs+kZnWPgKhCOQYybI1C9a/CKcYldAOMa ScL6Iz7FukUUDhAUodQQ8yyspD9jcX8beZ6nDncG64GH5DYE8jIFl0JrkDYHJkIBI2 lTQ8N6Wi+SphWjbqrtvV2oRccex/ZfRoIrCN62dKHwq4YjFedqkIPg+oJUMOfQ7+h1 UHxauob9IO/sY6kowntR6nZgquV7XlrrFYnaZh1XhrUutPHxWQ6EBUn8eG4RoaSYxS C95hojYu26GMg== Received: by phobos.denx.de (Postfix, from userid 109) id 70B2E820F4; Wed, 29 Apr 2020 15:05:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B3A44820E4 for ; Wed, 29 Apr 2020 15:04:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49BzJ93LGrz1rv9d; Wed, 29 Apr 2020 15:04:57 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49BzJ92D9Gz1qv7Q; Wed, 29 Apr 2020 15:04:57 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id lGuKLC8gP2VE; Wed, 29 Apr 2020 15:04:56 +0200 (CEST) X-Auth-Info: bIR5zsteuvpYDwXg2FZ0WrBq1KAoT+6n93DL78++nBw= Received: from localhost.localdomain (p5484738E.dip0.t-ipconnect.de [84.132.115.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 29 Apr 2020 15:04:56 +0200 (CEST) From: Harald Seiler To: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam Cc: Harald Seiler , "NXP i.MX U-Boot Team" , Claudius Heine , Flavio Suligoi , Igor Opaniuk , Marcel Ziswiler , Oleksandr Suvorov , Peng Fan , Simon Glass , Marek Vasut Subject: [PATCH 2/8] ARM: imx8m: Fix indentation of reset_cpu() function Date: Wed, 29 Apr 2020 15:04:22 +0200 Message-Id: <20200429130428.124788-3-hws@denx.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200429130428.124788-1-hws@denx.de> References: <20200429130428.124788-1-hws@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Use proper code-style, tabs instead of spaces for indentation. Signed-off-by: Harald Seiler --- arch/arm/mach-imx/imx8m/soc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 0f17252e80b7..5b3fbe712c6b 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -385,18 +385,18 @@ int ft_system_setup(void *blob, bd_t *bd) #if !CONFIG_IS_ENABLED(SYSRESET) void reset_cpu(ulong addr) { - struct watchdog_regs *wdog = (struct watchdog_regs *)addr; + struct watchdog_regs *wdog = (struct watchdog_regs *)addr; - if (!addr) - wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; + if (!addr) + wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; - /* Clear WDA to trigger WDOG_B immediately */ - writew((WCR_WDE | WCR_SRS), &wdog->wcr); + /* Clear WDA to trigger WDOG_B immediately */ + writew((WCR_WDE | WCR_SRS), &wdog->wcr); - while (1) { - /* - * spin for .5 seconds before reset - */ - } + while (1) { + /* + * spin for .5 seconds before reset + */ + } } #endif From patchwork Wed Apr 29 13:04:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Seiler X-Patchwork-Id: 1279296 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=ebj4e4dG; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49BzK34ppHz9sSq for ; Wed, 29 Apr 2020 23:05:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3AF4882060; Wed, 29 Apr 2020 15:05:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1588165520; bh=upol/jsHeFrPW9lrLfmDD6k1n1eT8v3gGXW12lohTyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ebj4e4dGx8spwZUL+Tn5Tb1SJkJxpxf8OEE9cjBw85Er9xOPt3IFwrkJdQBB4rBqY R7UknGPjvYE0L/y19pk+K4UsmGMtVgWQGSzRV67rJrl8dD6XPXhtKsJ4JE5J3RGz2h EsJuQtalC4NZRzX8rcM+tR0MSBiyMLtOk8vFO2FB0hdYpdXXhXoriZW/qq1GVdLjUe cM7KqGHDebw6qggNzyscHC+xjw2Hd3tP8/5cDjB7j2oVWROPTVwNyFPuLBDxvSbvI1 +hvCwz4qwgVkRGA67Py3BjQSrvHBytLE6FSRtvwy302rLxQfBNvsVqjQxcq0RFpyvq jfpTPlwDQqGZw== Received: by phobos.denx.de (Postfix, from userid 109) id 474E5820F3; Wed, 29 Apr 2020 15:05:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 24ECD820CB for ; Wed, 29 Apr 2020 15:04:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49BzJB6ZwXz1qs1D; Wed, 29 Apr 2020 15:04:58 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49BzJB4vGhz1qv7N; Wed, 29 Apr 2020 15:04:58 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id qM-4wCoD4Vkv; Wed, 29 Apr 2020 15:04:57 +0200 (CEST) X-Auth-Info: 4Ci2AEjsCfcdvxQlOjxFVz+/lyejPuUVlfS6EIERyoY= Received: from localhost.localdomain (p5484738E.dip0.t-ipconnect.de [84.132.115.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 29 Apr 2020 15:04:57 +0200 (CEST) From: Harald Seiler To: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam Cc: Harald Seiler , "NXP i.MX U-Boot Team" , Claudius Heine , Flavio Suligoi , Igor Opaniuk , Marcel Ziswiler , Oleksandr Suvorov , Peng Fan , Simon Glass , Marek Vasut Subject: [PATCH 3/8] ARM: imx8m: Don't use the addr parameter of reset_cpu() Date: Wed, 29 Apr 2020 15:04:23 +0200 Message-Id: <20200429130428.124788-4-hws@denx.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200429130428.124788-1-hws@denx.de> References: <20200429130428.124788-1-hws@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Claudius Heine imx8m has the only implementation of reset_cpu() which does not ignore the addr parameter and instead gives it some meaning as the base address of watchdog registers. This breaks convention with the rest of U-Boot where the parameter is ignored and callers are passing in 0. Fixes: d2041725e84b ("imx8m: restrict reset_cpu") Co-developed-by: Harald Seiler Signed-off-by: Harald Seiler Signed-off-by: Claudius Heine --- arch/arm/mach-imx/imx8m/soc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 5b3fbe712c6b..2fe1fa75fb05 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -385,10 +385,7 @@ int ft_system_setup(void *blob, bd_t *bd) #if !CONFIG_IS_ENABLED(SYSRESET) void reset_cpu(ulong addr) { - struct watchdog_regs *wdog = (struct watchdog_regs *)addr; - - if (!addr) - wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; + struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; /* Clear WDA to trigger WDOG_B immediately */ writew((WCR_WDE | WCR_SRS), &wdog->wcr); From patchwork Wed Apr 29 13:04:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Seiler X-Patchwork-Id: 1279305 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=o5uUMc5a; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49BzKZ5cgrz9sT2 for ; Wed, 29 Apr 2020 23:06:10 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DDE4B82100; Wed, 29 Apr 2020 15:05:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1588165528; bh=y4NjjLrN3IQtIKFFu1cL0z5JEL/mIxzSooG1YuvM6Vw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=o5uUMc5aO3s+OD/w34nTiMIsBOQs8w0c43pIffu3tI8Szd2KkHQIkTbJxPEPVF90w AQzppEGx8VNrZCqMXEcor8ErIN0tl9uO+RUp5vQYLaMSLWEHDd5po0TGwSsBxt8FGT TcdS67iQeNpDUz69VBYrnMjyYEXj5UhkDCUJy4H9vYg4TTHgej1HyiBMxtO6iFnNHq siHUPYDQuBOxhFGGSbwvl8ROV4HTD9HElvQxg7jv5ErZ6rkN0uaH2hrUA9TjH0OW0B 09fGRfZKx7rrTXS5hwunuYtChfv2wAtLBwdPuY/GqKfW70Iu+amYWU4ykN0gOt+Qs0 N5Y2CcWd6BXZw== Received: by phobos.denx.de (Postfix, from userid 109) id 3A962820F8; Wed, 29 Apr 2020 15:05:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D7578820F0 for ; Wed, 29 Apr 2020 15:05:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49BzJF6hBrz1rv9d; Wed, 29 Apr 2020 15:05:01 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49BzJF54mVz1qv7Q; Wed, 29 Apr 2020 15:05:01 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id kg9bEoSn4Uy0; Wed, 29 Apr 2020 15:04:59 +0200 (CEST) X-Auth-Info: bs8k2FFwWPS4rBcAumcQAh/GRSzGKyPc91dNPZ8rhZo= Received: from localhost.localdomain (p5484738E.dip0.t-ipconnect.de [84.132.115.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 29 Apr 2020 15:04:58 +0200 (CEST) From: Harald Seiler To: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam Cc: Harald Seiler , "NXP i.MX U-Boot Team" , Claudius Heine , Flavio Suligoi , Igor Opaniuk , Marcel Ziswiler , Oleksandr Suvorov , Peng Fan , Simon Glass , Marek Vasut Subject: [PATCH 4/8] ARM: imx8m: Fix reset in SPL on NXP iMX8MM EVK Date: Wed, 29 Apr 2020 15:04:24 +0200 Message-Id: <20200429130428.124788-5-hws@denx.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200429130428.124788-1-hws@denx.de> References: <20200429130428.124788-1-hws@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Marek Vasut Board files should not re-implement do_reset() to work around this function not being defined in for specific configurations. Rather, the fix is to compile in drivers which implement this properly. This patch enables sysreset and watchdog drivers in SPL and ties them together to implement the same as the do_reset() hack in the board file, except correctly in the DM/DT framework. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Flavio Suligoi Cc: Harald Seiler Cc: Igor Opaniuk Cc: Marcel Ziswiler Cc: Oleksandr Suvorov Cc: Peng Fan Cc: Stefano Babic --- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 12 ++++++++++++ board/freescale/imx8mm_evk/spl.c | 9 --------- configs/imx8mm_evk_defconfig | 5 +++++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi b/arch/arm/dts/imx8mm-evk-u-boot.dtsi index 3502602fbb86..b5c12105a9d1 100644 --- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi @@ -3,6 +3,14 @@ * Copyright 2019 NXP */ +/ { + wdt-reboot { + compatible = "wdt-reboot"; + wdt = <&wdog1>; + u-boot,dm-spl; + }; +}; + &{/soc@0} { u-boot,dm-pre-reloc; u-boot,dm-spl; @@ -117,3 +125,7 @@ &fec1 { phy-reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>; }; + +&wdog1 { + u-boot,dm-spl; +}; diff --git a/board/freescale/imx8mm_evk/spl.c b/board/freescale/imx8mm_evk/spl.c index 5d17f397cb68..4d34622465b3 100644 --- a/board/freescale/imx8mm_evk/spl.c +++ b/board/freescale/imx8mm_evk/spl.c @@ -161,12 +161,3 @@ void board_init_f(ulong dummy) board_init_r(NULL, 0); } - -int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -{ - puts ("resetting ...\n"); - - reset_cpu(WDOG1_BASE_ADDR); - - return 0; -} diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig index d988507bc330..120c76633066 100644 --- a/configs/imx8mm_evk_defconfig +++ b/configs/imx8mm_evk_defconfig @@ -30,6 +30,7 @@ CONFIG_SPL_BOARD_INIT=y CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_POWER_SUPPORT=y +CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="u-boot=> " # CONFIG_CMD_EXPORTENV is not set @@ -82,5 +83,9 @@ CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y CONFIG_MXC_UART=y CONFIG_SYSRESET=y +CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_PSCI=y +CONFIG_SYSRESET_WATCHDOG=y CONFIG_DM_THERMAL=y +# CONFIG_WATCHDOG is not set +CONFIG_IMX_WATCHDOG=y From patchwork Wed Apr 29 13:04:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Seiler X-Patchwork-Id: 1279306 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=rjqAkwH1; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49BzKs3kHFz9sSq for ; Wed, 29 Apr 2020 23:06:24 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DEBB682107; Wed, 29 Apr 2020 15:05:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1588165559; bh=LddmChDdGSpEi8S04Q1gGGhABnP8zpjI3xec0klrCPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rjqAkwH17GdvI27KV60bZ46nx9RlJJki5Q/Wklpm3H1PZQT0tfeAkHYf7s3VP2izU X85bheY+EjeDLyBneU+MApukKAmT3wWvyqyjnqC6sI0e+dCqPQ41UCQ1XFjmlRvmds vA3a5zT4q+f+LpvLiP+YEWgggAWg+KP7fDME4helIO+ATqhY1mcnesWustd4ViAM1z Izyvtx9eCgImRjmic3HKhfP9moGvglgHZn8AgL83GUCp1U1eW1oxXGUkBFaJLS9DTb lrsPQIdDnoal2AgMPRRzbdweyrjQBBnHodo/PH6QAc6R1y8NBTgV4ETgeaE81LZimM s0JAo56vTwAUQ== Received: by phobos.denx.de (Postfix, from userid 109) id B2CF4820F9; Wed, 29 Apr 2020 15:05:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0D6DB820EF for ; Wed, 29 Apr 2020 15:05:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49BzJH3LCGz1qsb3; Wed, 29 Apr 2020 15:05:03 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49BzJH1v6dz1qv7N; Wed, 29 Apr 2020 15:05:03 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id hXqgia7bE_FO; Wed, 29 Apr 2020 15:05:02 +0200 (CEST) X-Auth-Info: OVxJfpIpd/eIZ/Jzgdhl1BdNXfwQ+szoQ9/IkbYJ3yw= Received: from localhost.localdomain (p5484738E.dip0.t-ipconnect.de [84.132.115.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 29 Apr 2020 15:05:01 +0200 (CEST) From: Harald Seiler To: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam Cc: Harald Seiler , "NXP i.MX U-Boot Team" , Claudius Heine , Flavio Suligoi , Igor Opaniuk , Marcel Ziswiler , Oleksandr Suvorov , Peng Fan , Simon Glass , Marek Vasut Subject: [PATCH 5/8] ARM: imx8m: Fix reset in SPL on NXP iMX8MN EVK Date: Wed, 29 Apr 2020 15:04:25 +0200 Message-Id: <20200429130428.124788-6-hws@denx.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200429130428.124788-1-hws@denx.de> References: <20200429130428.124788-1-hws@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Marek Vasut Board files should not re-implement do_reset() to work around this function not being defined in for specific configurations. Rather, the fix is to compile in drivers which implement this properly. This patch enables sysreset and watchdog drivers in SPL and ties them together to implement the same as the do_reset() hack in the board file, except correctly in the DM/DT framework. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Flavio Suligoi Cc: Harald Seiler Cc: Igor Opaniuk Cc: Marcel Ziswiler Cc: Oleksandr Suvorov Cc: Peng Fan Cc: Stefano Babic --- arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 12 ++++++++++++ board/freescale/imx8mn_evk/spl.c | 9 --------- configs/imx8mn_ddr4_evk_defconfig | 5 +++++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi index 8d61597e0ce0..4419679d4c66 100644 --- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi @@ -3,6 +3,14 @@ * Copyright 2019 NXP */ +/ { + wdt-reboot { + compatible = "wdt-reboot"; + wdt = <&wdog1>; + u-boot,dm-spl; + }; +}; + &{/soc@0} { u-boot,dm-pre-reloc; u-boot,dm-spl; @@ -90,3 +98,7 @@ &usdhc3 { u-boot,dm-spl; }; + +&wdog1 { + u-boot,dm-spl; +}; diff --git a/board/freescale/imx8mn_evk/spl.c b/board/freescale/imx8mn_evk/spl.c index 7aed14c52b68..45417b24464d 100644 --- a/board/freescale/imx8mn_evk/spl.c +++ b/board/freescale/imx8mn_evk/spl.c @@ -114,12 +114,3 @@ void board_init_f(ulong dummy) board_init_r(NULL, 0); } - -int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -{ - puts("resetting ...\n"); - - reset_cpu(WDOG1_BASE_ADDR); - - return 0; -} diff --git a/configs/imx8mn_ddr4_evk_defconfig b/configs/imx8mn_ddr4_evk_defconfig index f7485ab27270..224aeb6f0dfa 100644 --- a/configs/imx8mn_ddr4_evk_defconfig +++ b/configs/imx8mn_ddr4_evk_defconfig @@ -32,6 +32,7 @@ CONFIG_SPL_BOARD_INIT=y CONFIG_SPL_BOOTROM_SUPPORT=y CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_I2C_SUPPORT=y +CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="u-boot=> " # CONFIG_CMD_EXPORTENV is not set @@ -76,5 +77,9 @@ CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y CONFIG_MXC_UART=y CONFIG_SYSRESET=y +CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_PSCI=y +CONFIG_SYSRESET_WATCHDOG=y CONFIG_DM_THERMAL=y +# CONFIG_WATCHDOG is not set +CONFIG_IMX_WATCHDOG=y From patchwork Wed Apr 29 13:04:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Seiler X-Patchwork-Id: 1279307 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=SKaxkj8k; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49BzL61rx6z9sPF for ; Wed, 29 Apr 2020 23:06:37 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B0BA3820FB; Wed, 29 Apr 2020 15:06:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1588165564; bh=P5ndlfoRDg9AMzj5K+R8ycL8qXCf5LNUnHBIFLUiLAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SKaxkj8kGkEsVjyP47Uy2Vmt2TjqOrHkzi7OxAl3PeBnFZmprWFy1zJOwjyI2mf9B uSIGbprxELf9DesPsB7IZmelDtA+6EVJqe0qUcs1k31wj+3CCn+qm4lJofhRXChEqv fkulVYBYEwf9x6ic86q+Tr3XxmhRcjvVAyYIrAnmN73v030rnb6D2pMDizUs7M6JMy IRyBdJnLpNDcUEnLjzgrdd1FVON2lX0jSeclE995tJDV/KfJPhYlinQMivXkR26ypq ZD7k68JxNsusuSG+ArCINuCHm4LbCgC6DGVFD/kylBBzLsbT9cCpwnEVjMnG+fFbZB fKm+33pUsr/WQ== Received: by phobos.denx.de (Postfix, from userid 109) id 6E367820EF; Wed, 29 Apr 2020 15:05:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1A161820E4 for ; Wed, 29 Apr 2020 15:05:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49BzJJ5jB7z1qsbM; Wed, 29 Apr 2020 15:05:04 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49BzJJ5H2Gz1qv7T; Wed, 29 Apr 2020 15:05:04 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id Ov1TvH3CBqVs; Wed, 29 Apr 2020 15:05:03 +0200 (CEST) X-Auth-Info: jZzJ8SHLRXpa97HbPbdn9ILE9pQ02or0vZt6IVlhn7w= Received: from localhost.localdomain (p5484738E.dip0.t-ipconnect.de [84.132.115.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 29 Apr 2020 15:05:03 +0200 (CEST) From: Harald Seiler To: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam Cc: Harald Seiler , "NXP i.MX U-Boot Team" , Claudius Heine , Flavio Suligoi , Igor Opaniuk , Marcel Ziswiler , Oleksandr Suvorov , Peng Fan , Simon Glass , Marek Vasut Subject: [PATCH 6/8] ARM: imx8m: Fix reset in SPL on NXP iMX8MP EVK Date: Wed, 29 Apr 2020 15:04:26 +0200 Message-Id: <20200429130428.124788-7-hws@denx.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200429130428.124788-1-hws@denx.de> References: <20200429130428.124788-1-hws@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Marek Vasut Board files should not re-implement do_reset() to work around this function not being defined in for specific configurations. Rather, the fix is to compile in drivers which implement this properly. This patch enables sysreset and watchdog drivers in SPL and ties them together to implement the same as the do_reset() hack in the board file, except correctly in the DM/DT framework. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Flavio Suligoi Cc: Harald Seiler Cc: Igor Opaniuk Cc: Marcel Ziswiler Cc: Oleksandr Suvorov Cc: Peng Fan Cc: Stefano Babic --- arch/arm/dts/imx8mp-evk-u-boot.dtsi | 12 ++++++++++++ board/freescale/imx8mp_evk/spl.c | 9 --------- configs/imx8mp_evk_defconfig | 4 ++++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi b/arch/arm/dts/imx8mp-evk-u-boot.dtsi index 4675ada0a0a9..24a93ac2d690 100644 --- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi +++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi @@ -3,6 +3,14 @@ * Copyright 2019 NXP */ +/ { + wdt-reboot { + compatible = "wdt-reboot"; + wdt = <&wdog1>; + u-boot,dm-spl; + }; +}; + &{/soc@0} { u-boot,dm-pre-reloc; u-boot,dm-spl; @@ -119,3 +127,7 @@ &usdhc3 { u-boot,dm-spl; }; + +&wdog1 { + u-boot,dm-spl; +}; diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c index 0b20668e2b30..39c1dae684ac 100644 --- a/board/freescale/imx8mp_evk/spl.c +++ b/board/freescale/imx8mp_evk/spl.c @@ -149,12 +149,3 @@ void board_init_f(ulong dummy) board_init_r(NULL, 0); } - -int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -{ - puts("resetting ...\n"); - - reset_cpu(WDOG1_BASE_ADDR); - - return 0; -} diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig index ce6b342c3672..09ed7a89c9aa 100644 --- a/configs/imx8mp_evk_defconfig +++ b/configs/imx8mp_evk_defconfig @@ -81,4 +81,8 @@ CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y CONFIG_MXC_UART=y CONFIG_SYSRESET=y +CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_PSCI=y +CONFIG_SYSRESET_WATCHDOG=y +# CONFIG_WATCHDOG is not set +CONFIG_IMX_WATCHDOG=y From patchwork Wed Apr 29 13:04:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Seiler X-Patchwork-Id: 1279300 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=fhQQ84PI; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49BzKJ0NVzz9sT4 for ; Wed, 29 Apr 2020 23:05:55 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0DC6E820FA; Wed, 29 Apr 2020 15:05:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1588165525; bh=82icUdcDrSQZbXSCMBo+HG1hGVaNQgmNlMnNYiFJDu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fhQQ84PI3a25WQt2PPn08nm+ahz7j64KLO+6lZZMdz99zeMl8e5oHtkwJBY2kqQay o2w0KI7RYDyLrYNWfky6BVB+q7VeIPxNq+L/cIRH6j2BNkCtSfhlDJKdjjOS5i+Btu lsw6dbelyBouLz7ZPFW0Xq9yVmAqQf3QvmJLcxMwzagNO/lGWq2ZjpcvB1Wlvjzj3e FLCjw0dFmw1WUtQIANLN68wo0b/vc10X+9gLMb9CM6rbUBRK6laUwsdcCsDXX5zOjE wQTvu7pfGVIFWMidx6bz/DM/dkyfmhz6pQ6YFIMN4nHo45alTr4c5D9nh5pAIZ1fsw vsrzlElTaMaeA== Received: by phobos.denx.de (Postfix, from userid 109) id E9DEA820FA; Wed, 29 Apr 2020 15:05:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CEEE2820CB for ; Wed, 29 Apr 2020 15:05:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49BzJL2QLnz1qsbw; Wed, 29 Apr 2020 15:05:06 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49BzJL1DcJz1qv7Q; Wed, 29 Apr 2020 15:05:06 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id Ht1WNkOw0YtS; Wed, 29 Apr 2020 15:05:04 +0200 (CEST) X-Auth-Info: kRBw+zaHiMx55vzm/cybeGWI2cPTP5x45HmhVtYK8/E= Received: from localhost.localdomain (p5484738E.dip0.t-ipconnect.de [84.132.115.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 29 Apr 2020 15:05:04 +0200 (CEST) From: Harald Seiler To: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam Cc: Harald Seiler , "NXP i.MX U-Boot Team" , Claudius Heine , Flavio Suligoi , Igor Opaniuk , Marcel Ziswiler , Oleksandr Suvorov , Peng Fan , Simon Glass , Marek Vasut Subject: [PATCH 7/8] ARM: imx8m: Fix reset in SPL on Toradex iMX8MM Verdin Date: Wed, 29 Apr 2020 15:04:27 +0200 Message-Id: <20200429130428.124788-8-hws@denx.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200429130428.124788-1-hws@denx.de> References: <20200429130428.124788-1-hws@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Marek Vasut Board files should not re-implement do_reset() to work around this function not being defined in for specific configurations. Rather, the fix is to compile in drivers which implement this properly. This patch enables sysreset and watchdog drivers in SPL and ties them together to implement the same as the do_reset() hack in the board file, except correctly in the DM/DT framework. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Flavio Suligoi Cc: Harald Seiler Cc: Igor Opaniuk Cc: Marcel Ziswiler Cc: Oleksandr Suvorov Cc: Peng Fan Cc: Stefano Babic Reviewed-by: Oleksandr Suvorov Acked-by: Igor Opaniuk Acked-by: Igor Opaniuk --- arch/arm/dts/imx8mm-verdin-u-boot.dtsi | 12 ++++++++++++ board/toradex/verdin-imx8mm/spl.c | 9 --------- configs/verdin-imx8mm_defconfig | 5 +++++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi index e60b9faee442..fe6bb9bf03cf 100644 --- a/arch/arm/dts/imx8mm-verdin-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-verdin-u-boot.dtsi @@ -3,6 +3,14 @@ * Copyright 2020 Toradex */ +/ { + wdt-reboot { + compatible = "wdt-reboot"; + wdt = <&wdog1>; + u-boot,dm-spl; + }; +}; + &aips1 { u-boot,dm-spl; u-boot,dm-pre-reloc; @@ -105,3 +113,7 @@ &usdhc3 { u-boot,dm-spl; }; + +&wdog1 { + u-boot,dm-spl; +}; diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c index a5dc54082054..dc5bd84f332e 100644 --- a/board/toradex/verdin-imx8mm/spl.c +++ b/board/toradex/verdin-imx8mm/spl.c @@ -169,12 +169,3 @@ void board_init_f(ulong dummy) board_init_r(NULL, 0); } - -int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -{ - puts("resetting ...\n"); - - reset_cpu(WDOG1_BASE_ADDR); - - return 0; -} diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig index 590750e9b2d1..21f6aa308208 100644 --- a/configs/verdin-imx8mm_defconfig +++ b/configs/verdin-imx8mm_defconfig @@ -38,6 +38,7 @@ CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_USB_HOST_SUPPORT=y +CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SYS_PROMPT="Verdin iMX8MM # " # CONFIG_BOOTM_NETBSD is not set CONFIG_CMD_ASKENV=y @@ -94,5 +95,9 @@ CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y CONFIG_MXC_UART=y CONFIG_SYSRESET=y +CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_PSCI=y +CONFIG_SYSRESET_WATCHDOG=y CONFIG_DM_THERMAL=y +# CONFIG_WATCHDOG is not set +CONFIG_IMX_WATCHDOG=y From patchwork Wed Apr 29 13:04:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Seiler X-Patchwork-Id: 1279308 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=SBlwrGqD; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49BzLL4Db6z9sSb for ; Wed, 29 Apr 2020 23:06:50 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3579C82109; Wed, 29 Apr 2020 15:06:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1588165568; bh=29q5rBP2OeZYIOkzp0aAoxL+w19XIrisA1hy3vFytnI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SBlwrGqDqcLCqEVIg9ag3MYIl8u6TQyQ5yhEhWsZzfjx5b+vOSUfQFbAmSdy2jvVo spprvyKQAqfUt6qCmdGD6rytvHbURFWeEyml63AxU7YC3tgrxn4lHFnYLDx2bjreX8 3IX9WMDc62mrRjGlEatwyd/48buyDEdoGB5TVIgdHzrro7XPZn/FZa5Zkp1XePdyYw S6NqD1Has8L3x2bBzX8kFT1TWStPgfSDqqJ2MAzk/XyuK/o2EDIHDETJazvNfzTZwH /2cq3g12zMsG44/qB0ETrNC3TJTiZaSOn4A5IE67UXVHs1j/5uekDZlYC6cO9DaNJA ykY4d0W8BiyjA== Received: by phobos.denx.de (Postfix, from userid 109) id 74986820EF; Wed, 29 Apr 2020 15:05:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1E78F820F4 for ; Wed, 29 Apr 2020 15:05:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49BzJM4Kjqz1rvBb; Wed, 29 Apr 2020 15:05:07 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49BzJM37vbz1qv7Y; Wed, 29 Apr 2020 15:05:07 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id NKcas_fltjLb; Wed, 29 Apr 2020 15:05:06 +0200 (CEST) X-Auth-Info: IhA5KPHB+TJ0iv1BG5EeusEPqA6dHbLUsE8BGZHN2Rc= Received: from localhost.localdomain (p5484738E.dip0.t-ipconnect.de [84.132.115.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 29 Apr 2020 15:05:06 +0200 (CEST) From: Harald Seiler To: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam Cc: Harald Seiler , "NXP i.MX U-Boot Team" , Claudius Heine , Flavio Suligoi , Igor Opaniuk , Marcel Ziswiler , Oleksandr Suvorov , Peng Fan , Simon Glass , Marek Vasut Subject: [PATCH 8/8] ARM: reset: use do_reset in SPL/TPL if SYSRESET was not enabled for them Date: Wed, 29 Apr 2020 15:04:28 +0200 Message-Id: <20200429130428.124788-9-hws@denx.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200429130428.124788-1-hws@denx.de> References: <20200429130428.124788-1-hws@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Claudius Heine In case CONFIG_SYSRESET is set, do_reset() from reset.c will not be available anywere, even if SYSRESET is disabled for SPL/TPL. do_reset() is called from SPL for instance from the panic handler and PANIC_HANG is not set Signed-off-by: Claudius Heine --- arch/arm/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 8482f5446c5c..b839aa7a5096 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -57,7 +57,7 @@ obj-y += interrupts_64.o else obj-y += interrupts.o endif -ifndef CONFIG_SYSRESET +ifndef CONFIG_$(SPL_TPL_)SYSRESET obj-y += reset.o endif