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 628C3C25B08 for ; Wed, 17 Aug 2022 21:06:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 556CE84A70; Wed, 17 Aug 2022 23:06:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="r7+D1gEJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1496F84A71; Wed, 17 Aug 2022 23:05:59 +0200 (CEST) Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) (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 7807884A67 for ; Wed, 17 Aug 2022 23:05:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id D78CDCE1E97; Wed, 17 Aug 2022 21:05:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 150F4C433D6; Wed, 17 Aug 2022 21:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660770351; bh=1lvcvt66oGtWlSP1GCW+wiE/7qkLAOQDF8c0+HFeQNY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r7+D1gEJ1CEvEyZVWFVfeRu2TNJnwbNRReRuuVEUTE08ru687ELSMkLh1V1NAvj1H uynFRDgDa1+bB3RzYOafBP5plDhbcYaJefHLUqI01YH/RSVY1RWSRtlRAqvw3oMzvR 5VCS/jLHOcdPsFdgKctGsAcWjhfE0tSdmtyQffRfbs7JPdNFcht5m+xrXsDlxqLh0z Ep7Ri5X7jsJTjsc0MTTjpbtzsOgxJkYBlM2plJ62SOqti7FCcbL1pPmkpz5onNGPcf rJnrUSpnlnD6W6dG6ww8Nd9GwKtlv5ere+3q/iryXbaAckz1WfSml/RYnnrZ45b4kS pjqkCn7RimNrg== Received: by pali.im (Postfix) id 72043739; Wed, 17 Aug 2022 23:05:48 +0200 (CEST) Date: Wed, 17 Aug 2022 23:05:48 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Peng Fan Cc: u-boot@lists.denx.de Subject: Re: [PATCH] board: freescale: p1_p2_rdb_pc: Delete watchdog max6370 node in load_default mode Message-ID: <20220817210548.vszqtpsqft2ftgop@pali> References: <20220801133543.11806-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220801133543.11806-1-pali@kernel.org> User-Agent: NeoMutt/20180716 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.6 at phobos.denx.de X-Virus-Status: Clean PING? (This change applies also for Turris 1.x boards; which use same CPLD firmware code) On Monday 01 August 2022 15:35:43 Pali Rohár wrote: > CPLD in load_default mode ignores watchdog reset signal. It does not reset > board when watchdog triggers reset signal. > > Detect load_default mode by GPIO7 - LOAD_DEFAULT_N and delete watchdog > max6370 node from device to prevent registering driver for non-working > watchdog. > > Signed-off-by: Pali Rohár > --- > board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 28 +++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c > index a71952dcf399..06cab729e4ab 100644 > --- a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c > +++ b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c > @@ -368,6 +368,24 @@ int board_eth_init(struct bd_info *bis) > } > #endif > > +#if defined(CONFIG_OF_BOARD_SETUP) || defined(CONFIG_OF_BOARD_FIXUP) > +static void fix_max6370_watchdog(void *blob) > +{ > + int off = fdt_node_offset_by_compatible(blob, -1, "maxim,max6370"); > + ccsr_gpio_t *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR); > + u32 gpioval = in_be32(&pgpio->gpdat); > + > + /* > + * Delete watchdog max6370 node in load_default mode (detected by > + * GPIO7 - LOAD_DEFAULT_N) because CPLD in load_default mode ignores > + * watchdog reset signal. CPLD in load_default mode does not reset > + * board when watchdog triggers reset signal. > + */ > + if (!(gpioval & BIT(31-7)) && off >= 0) > + fdt_del_node(blob, off); > +} > +#endif > + > #ifdef CONFIG_OF_BOARD_SETUP > int ft_board_setup(void *blob, struct bd_info *bd) > { > @@ -393,6 +411,8 @@ int ft_board_setup(void *blob, struct bd_info *bd) > sizeof("okay"), 0); > #endif > > + fix_max6370_watchdog(blob); > + > #if defined(CONFIG_HAS_FSL_DR_USB) > fsl_fdt_fixup_dr_usb(blob, bd); > #endif > @@ -444,3 +464,11 @@ int ft_board_setup(void *blob, struct bd_info *bd) > return 0; > } > #endif > + > +#ifdef CONFIG_OF_BOARD_FIXUP > +int board_fix_fdt(void *blob) > +{ > + fix_max6370_watchdog(blob); > + return 0; > +} > +#endif > -- > 2.20.1 >