diff mbox

[U-Boot,1/2] MX31: mx31pdk: Add watchdog support

Message ID 1299688544-13635-1-git-send-email-fabio.estevam@freescale.com
State Superseded
Delegated to: Stefano Babic
Headers show

Commit Message

Fabio Estevam March 9, 2011, 4:35 p.m. UTC
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 board/freescale/mx31pdk/mx31pdk.c |   16 ++++++++++++++++
 include/configs/mx31pdk.h         |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)

Comments

Stefano Babic April 10, 2011, 3:45 p.m. UTC | #1
On 03/09/2011 05:35 PM, Fabio Estevam wrote:
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  board/freescale/mx31pdk/mx31pdk.c |   16 ++++++++++++++++
>  include/configs/mx31pdk.h         |    1 +
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c
> index a9f0fb4..4a5d3ef 100644

Hi Fabio,

> diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
> index 86c758f..1f1de46 100644
> --- a/include/configs/mx31pdk.h
> +++ b/include/configs/mx31pdk.h
> @@ -61,6 +61,7 @@
>  
>  #define CONFIG_MXC_UART		1
>  #define CONFIG_SYS_MX31_UART1	1
> +#define CONFIG_HW_WATCHDOG
>  
>  #define CONFIG_HARD_SPI		1
>  #define CONFIG_MXC_SPI		1

Applying this patch I have not found BOARD_LATE_INIT in mx31pdk.h. How
can the watchdog be enabled ?

Best regards,
Stefano
Stefano Babic April 26, 2011, 5:45 a.m. UTC | #2
On 03/09/2011 05:35 PM, Fabio Estevam wrote:
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  board/freescale/mx31pdk/mx31pdk.c |   16 ++++++++++++++++
>  include/configs/mx31pdk.h         |    1 +
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c
> index a9f0fb4..4a5d3ef 100644

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic
Detlev Zundel April 27, 2011, 11:38 a.m. UTC | #3
Hi Stefano,

> On 03/09/2011 05:35 PM, Fabio Estevam wrote:
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>> ---
>>  board/freescale/mx31pdk/mx31pdk.c |   16 ++++++++++++++++
>>  include/configs/mx31pdk.h         |    1 +
>>  2 files changed, 17 insertions(+), 0 deletions(-)
>> 
>> diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c
>> index a9f0fb4..4a5d3ef 100644
>
> Applied to u-boot-imx, thanks.

Ah, obviously I'm a bit late on this.  Can you please make sure that a
follow-up patch according to my suggestion sent just now gets into the
tree?

Thanks!
  Detlev
Fabio Estevam April 27, 2011, 12:37 p.m. UTC | #4
Hi Detlev,

On 4/27/2011 8:38 AM, Detlev Zundel wrote:
> Hi Stefano,
> 
>> On 03/09/2011 05:35 PM, Fabio Estevam wrote:
>>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>>> ---
>>>  board/freescale/mx31pdk/mx31pdk.c |   16 ++++++++++++++++
>>>  include/configs/mx31pdk.h         |    1 +
>>>  2 files changed, 17 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c
>>> index a9f0fb4..4a5d3ef 100644
>>
>> Applied to u-boot-imx, thanks.
> 
> Ah, obviously I'm a bit late on this.  Can you please make sure that a
> follow-up patch according to my suggestion sent just now gets into the
> tree?

Thanks for your clarification regarding the watchdog usage.

I will send a follow-up patch soon as per your suggestion.

Regards,

Fabio Estevam
diff mbox

Patch

diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c
index a9f0fb4..4a5d3ef 100644
--- a/board/freescale/mx31pdk/mx31pdk.c
+++ b/board/freescale/mx31pdk/mx31pdk.c
@@ -28,9 +28,17 @@ 
 #include <netdev.h>
 #include <asm/arch/mx31.h>
 #include <asm/arch/mx31-regs.h>
+#include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_HW_WATCHDOG
+void hw_watchdog_reset(void)
+{
+	mxc_hw_watchdog_reset();
+}
+#endif
+
 int dram_init(void)
 {
 	/* dram_init must store complete ramsize in gd->ram_size */
@@ -68,6 +76,14 @@  int board_init(void)
 	return 0;
 }
 
+int board_late_init(void)
+{
+#ifdef CONFIG_HW_WATCHDOG
+	mxc_hw_watchdog_enable();
+#endif
+	return 0;
+}
+
 int checkboard(void)
 {
 	printf("Board: i.MX31 MAX PDK (3DS)\n");
diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index 86c758f..1f1de46 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -61,6 +61,7 @@ 
 
 #define CONFIG_MXC_UART		1
 #define CONFIG_SYS_MX31_UART1	1
+#define CONFIG_HW_WATCHDOG
 
 #define CONFIG_HARD_SPI		1
 #define CONFIG_MXC_SPI		1