Commit 754613f740368f847a2261c5c41b034ff5c51b1c

Authored by Nobuhiro Iwamatsu
Committed by Nobuhiro Iwamatsu
1 parent 9a1e3e9fe3
Exists in master and in 55 other branches 8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf_v2022.04, emb_lf_v2023.04, imx_v2015.04_4.1.15_1.0.0_ga, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-emmc-imx_v2014.04_3.10.53_1.1.0_ga, smarc-emmc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx-l5.0.0_1.0.0-ga, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2017.03_4.9.11_1.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx_v2015.04_4.1.15_1.0.0_ga, smarc-imx_v2017.03_4.9.11_1.0.0_ga, smarc-imx_v2017.03_4.9.88_2.0.0_ga, smarc-imx_v2017.03_o8.1.0_1.3.0_8m, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_2.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0, smarc_8mq_lf_v2020.04, ti-u-boot-2015.07, u-boot-2013.01.y, v2013.10, v2013.10-smarct33, v2013.10-smartmen, v2014.01, v2014.04, v2014.04-smarct33, v2014.04-smarct33-emmc, v2014.04-smartmen, v2014.07, v2014.07-smarct33, v2014.07-smartmen, v2015.07-smarct33, v2015.07-smarct33-emmc, v2015.07-smarct4x, v2016.05-dlt, v2016.05-smarct3x, v2016.05-smarct3x-emmc, v2016.05-smarct4x, v2017.01-smarct3x, v2017.01-smarct3x-emmc, v2017.01-smarct4x

sh: Add trigger_address_error and support cpu reset

This add support cpu reset by trigger_address_error function.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

Showing 4 changed files with 27 additions and 2 deletions Side-by-side Diff

arch/sh/cpu/sh2/watchdog.c
1 1 /*
2   - * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhoro@renesas.com>
3   - * Copyright (C) 2008 Renesas Solutions Corp.
  2 + * Copyright (C) 2008,2010 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
  3 + * Copyright (C) 2008,2010 Renesas Solutions Corp.
4 4 *
5 5 * This program is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU General Public License as
... ... @@ -20,6 +20,7 @@
20 20  
21 21 #include <common.h>
22 22 #include <asm/processor.h>
  23 +#include <asm/system.h>
23 24  
24 25 int watchdog_init(void)
25 26 {
... ... @@ -28,6 +29,9 @@
28 29  
29 30 void reset_cpu(unsigned long ignored)
30 31 {
  32 + /* Address error with SR.BL=1 first. */
  33 + trigger_address_error();
  34 +
31 35 while (1)
32 36 ;
33 37 }
arch/sh/cpu/sh3/watchdog.c
1 1 /*
  2 + * (C) Copyright 2010
  3 + * Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
  4 + *
2 5 * (C) Copyright 2007
3 6 * Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
4 7 *
... ... @@ -20,6 +23,7 @@
20 23  
21 24 #include <common.h>
22 25 #include <asm/processor.h>
  26 +#include <asm/system.h>
23 27  
24 28 int watchdog_init(void)
25 29 {
... ... @@ -28,6 +32,9 @@
28 32  
29 33 void reset_cpu(unsigned long ignored)
30 34 {
  35 + /* Address error with SR.BL=1 first. */
  36 + trigger_address_error();
  37 +
31 38 while (1)
32 39 ;
33 40 }
arch/sh/cpu/sh4/watchdog.c
... ... @@ -17,6 +17,7 @@
17 17  
18 18 #include <common.h>
19 19 #include <asm/processor.h>
  20 +#include <asm/system.h>
20 21 #include <asm/io.h>
21 22  
22 23 #define WDT_BASE WTCNT
... ... @@ -66,6 +67,9 @@
66 67  
67 68 void reset_cpu(unsigned long ignored)
68 69 {
  70 + /* Address error with SR.BL=1 first. */
  71 + trigger_address_error();
  72 +
69 73 while (1)
70 74 ;
71 75 }
arch/sh/include/asm/system.h
... ... @@ -272,5 +272,15 @@
272 272  
273 273 #define arch_align_stack(x) (x)
274 274  
  275 +static inline void trigger_address_error(void)
  276 +{
  277 + __asm__ __volatile__ (
  278 + "ldc %0, sr\n\t"
  279 + "mov.l @%1, %0"
  280 + :
  281 + : "r" (0x10000000), "r" (0x80000001)
  282 + );
  283 +}
  284 +
275 285 #endif