All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@oss.nxp.com>
To: "Pali Rohár" <pali@kernel.org>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH] board: freescale: p1_p2_rdb_pc: Delete watchdog max6370 node in load_default mode
Date: Wed, 7 Sep 2022 11:07:08 +0800	[thread overview]
Message-ID: <1f0c942d-8d20-0d65-6489-23fb33a4aa61@oss.nxp.com> (raw)
In-Reply-To: <20220817210548.vszqtpsqft2ftgop@pali>



On 8/18/2022 5:05 AM, Pali Rohár wrote:
> 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 <pali@kernel.org>

Applied, sorry for late.

If possible, please help assign your patch in patchwork to me[freenix],
that would help a lot.

Thanks,
Peng.

>> ---
>>   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
>>

      parent reply	other threads:[~2022-09-07  3:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01 13:35 [PATCH] board: freescale: p1_p2_rdb_pc: Delete watchdog max6370 node in load_default mode Pali Rohár
2022-08-17 21:05 ` Pali Rohár
2022-09-07  2:58   ` Peng Fan
2022-09-07  3:04   ` Peng Fan
2022-09-07  3:07   ` Peng Fan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1f0c942d-8d20-0d65-6489-23fb33a4aa61@oss.nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=pali@kernel.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.