From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06BA9C433EF for ; Tue, 11 Jan 2022 09:01:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7509482A71; Tue, 11 Jan 2022 10:01:02 +0100 (CET) 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=1641891663; bh=wRAWo1dvJPRSdOW7l0pNDevbY+CrkbewGKi3/fFr/K4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ELNNxzZaLd4zlafQjpXVE6Bbrq1kzXa5tiU/8AyyuXPsIrlPMZXuV88D1i5mrrMXH zGNLpUU3x24WY2L4DA8mJo19DDX6/5bmBSKj3h3c1yrOygz6nY1xQP73oSQK+7xEY6 NfxOXp11Q0HrVlcsPm/f1Q0qUv0DPN6dFUvAcegdBQ/cyEEU1rwkyhOB/vs79IMmLK F3eyQkr4JyJ4rdv5q+viWAMqDEN8mNfzHHD3lP0ysgtRdFi0vP9wqoK/PKyca5hDJ6 8bPsAq+hgAOMY6FFfwT1YRddxNvTFmmJk91GTehsj8fIaRP8bwPPI6BmgL/bo71VAB 51nJB75KwXxFw== Received: by phobos.denx.de (Postfix, from userid 109) id 2C48182FC8; Tue, 11 Jan 2022 10:01:00 +0100 (CET) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:1::465:204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9F42881A03 for ; Tue, 11 Jan 2022 10:00:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:105:465:1:4:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4JY4RY1RkdzQkHC; Tue, 11 Jan 2022 10:00:57 +0100 (CET) Message-ID: <48306c45-fb2b-9d6b-ba49-4149201b4885@denx.de> Date: Tue, 11 Jan 2022 10:00:51 +0100 MIME-Version: 1.0 Subject: Re: [PATCH 3/3] arm: apple: Use watchdog timer for system reset Content-Language: en-US To: Mark Kettenis , u-boot@lists.denx.de Cc: sjg@chromium.org, sven@svenpeter.dev References: <20211114111942.96151-1-kettenis@openbsd.org> <20211114111942.96151-4-kettenis@openbsd.org> From: Stefan Roese In-Reply-To: <20211114111942.96151-4-kettenis@openbsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.2 at phobos.denx.de X-Virus-Status: Clean On 11/14/21 12:19, Mark Kettenis wrote: > Rely on the new watchdog timer driver and the sysreset uclass to > reset the system. This gets rid of hard-coded addresses and > should work on systems based on the new M1 Pro and M1 Max SoCs > as well. > > Signed-off-by: Mark Kettenis Reviewed-by: Stefan Roese Thanks, Stefan > --- > arch/arm/Kconfig | 3 +++ > arch/arm/mach-apple/board.c | 24 ------------------------ > 2 files changed, 3 insertions(+), 24 deletions(-) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index f7f03837fe..4c58af45da 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -936,6 +936,9 @@ config ARCH_APPLE > select OF_CONTROL > select OF_BOARD > select POSITION_INDEPENDENT > + select SYSRESET > + select SYSRESET_WATCHDOG > + select SYSRESET_WATCHDOG_AUTO > select USB > imply CMD_DM > imply CMD_GPT > diff --git a/arch/arm/mach-apple/board.c b/arch/arm/mach-apple/board.c > index 0bfbc473ec..b7e8d212f1 100644 > --- a/arch/arm/mach-apple/board.c > +++ b/arch/arm/mach-apple/board.c > @@ -119,30 +119,6 @@ int dram_init_banksize(void) > return fdtdec_setup_memory_banksize(); > } > > -#define APPLE_WDT_BASE 0x23d2b0000ULL > - > -#define APPLE_WDT_SYS_CTL_ENABLE BIT(2) > - > -typedef struct apple_wdt { > - u32 reserved0[3]; > - u32 chip_ctl; > - u32 sys_tmr; > - u32 sys_cmp; > - u32 reserved1; > - u32 sys_ctl; > -} apple_wdt_t; > - > -void reset_cpu(void) > -{ > - apple_wdt_t *wdt = (apple_wdt_t *)APPLE_WDT_BASE; > - > - writel(0, &wdt->sys_cmp); > - writel(APPLE_WDT_SYS_CTL_ENABLE, &wdt->sys_ctl); > - > - while(1) > - wfi(); > -} > - > extern long fw_dtb_pointer; > > void *board_fdt_blob_setup(int *err) > Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de