Commit b37b7b2063e02718970ca1882a4522ccbe1106e9
1 parent
7bb6028768
Exists in
smarc_8mq_lf_v2020.04
and in
11 other branches
x86: Switch to use DM sysreset driver
This converts all x86 boards over to DM sysreset. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Showing 31 changed files with 41 additions and 66 deletions Side-by-side Diff
- arch/Kconfig
- arch/x86/cpu/baytrail/valleyview.c
- arch/x86/cpu/braswell/braswell.c
- arch/x86/cpu/cpu.c
- arch/x86/cpu/ivybridge/early_me.c
- arch/x86/cpu/ivybridge/sdram.c
- arch/x86/cpu/qemu/qemu.c
- arch/x86/cpu/quark/quark.c
- arch/x86/cpu/tangier/tangier.c
- arch/x86/dts/bayleybay.dts
- arch/x86/dts/baytrail_som-db5800-som-6867.dts
- arch/x86/dts/broadwell_som-6896.dts
- arch/x86/dts/cherryhill.dts
- arch/x86/dts/chromebook_link.dts
- arch/x86/dts/chromebook_samus.dts
- arch/x86/dts/chromebox_panther.dts
- arch/x86/dts/conga-qeval20-qa3-e3845.dts
- arch/x86/dts/cougarcanyon2.dts
- arch/x86/dts/crownbay.dts
- arch/x86/dts/dfi-bt700.dtsi
- arch/x86/dts/edison.dts
- arch/x86/dts/efi-x86_app.dts
- arch/x86/dts/efi-x86_payload.dts
- arch/x86/dts/galileo.dts
- arch/x86/dts/minnowmax.dts
- arch/x86/dts/qemu-x86_i440fx.dts
- arch/x86/dts/qemu-x86_q35.dts
- arch/x86/dts/reset.dtsi
- arch/x86/include/asm/processor.h
- arch/x86/include/asm/u-boot-x86.h
- configs/chromebook_link64_defconfig
arch/Kconfig
arch/x86/cpu/baytrail/valleyview.c
arch/x86/cpu/braswell/braswell.c
arch/x86/cpu/cpu.c
... | ... | @@ -75,35 +75,9 @@ |
75 | 75 | } |
76 | 76 | int init_cache(void) __attribute__((weak, alias("x86_init_cache"))); |
77 | 77 | |
78 | -int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
79 | -{ | |
80 | - printf("resetting ...\n"); | |
81 | - | |
82 | - /* wait 50 ms */ | |
83 | - udelay(50000); | |
84 | - disable_interrupts(); | |
85 | - reset_cpu(0); | |
86 | - | |
87 | - /*NOTREACHED*/ | |
88 | - return 0; | |
89 | -} | |
90 | - | |
91 | 78 | void flush_cache(unsigned long dummy1, unsigned long dummy2) |
92 | 79 | { |
93 | 80 | asm("wbinvd\n"); |
94 | -} | |
95 | - | |
96 | -__weak void reset_cpu(ulong addr) | |
97 | -{ | |
98 | - /* Do a hard reset through the chipset's reset control register */ | |
99 | - outb(SYS_RST | RST_CPU, IO_PORT_RESET); | |
100 | - for (;;) | |
101 | - cpu_hlt(); | |
102 | -} | |
103 | - | |
104 | -void x86_full_reset(void) | |
105 | -{ | |
106 | - outb(FULL_RST | SYS_RST | RST_CPU, IO_PORT_RESET); | |
107 | 81 | } |
108 | 82 | |
109 | 83 | /* Define these functions to allow ehch-hcd to function */ |
arch/x86/cpu/ivybridge/early_me.c
... | ... | @@ -8,6 +8,7 @@ |
8 | 8 | #include <common.h> |
9 | 9 | #include <dm.h> |
10 | 10 | #include <errno.h> |
11 | +#include <sysreset.h> | |
11 | 12 | #include <asm/pci.h> |
12 | 13 | #include <asm/cpu.h> |
13 | 14 | #include <asm/processor.h> |
14 | 15 | |
15 | 16 | |
... | ... | @@ -138,17 +139,17 @@ |
138 | 139 | case ME_HFS_ACK_RESET: |
139 | 140 | /* Non-power cycle reset */ |
140 | 141 | set_global_reset(dev, 0); |
141 | - reset_cpu(0); | |
142 | + sysreset_walk_halt(SYSRESET_COLD); | |
142 | 143 | break; |
143 | 144 | case ME_HFS_ACK_PWR_CYCLE: |
144 | 145 | /* Power cycle reset */ |
145 | 146 | set_global_reset(dev, 0); |
146 | - x86_full_reset(); | |
147 | + sysreset_walk_halt(SYSRESET_COLD); | |
147 | 148 | break; |
148 | 149 | case ME_HFS_ACK_GBL_RESET: |
149 | 150 | /* Global reset */ |
150 | 151 | set_global_reset(dev, 1); |
151 | - x86_full_reset(); | |
152 | + sysreset_walk_halt(SYSRESET_COLD); | |
152 | 153 | break; |
153 | 154 | case ME_HFS_ACK_S3: |
154 | 155 | case ME_HFS_ACK_S4: |
arch/x86/cpu/ivybridge/sdram.c
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 | #include <spi.h> |
19 | 19 | #include <spi_flash.h> |
20 | 20 | #include <syscon.h> |
21 | +#include <sysreset.h> | |
21 | 22 | #include <asm/cpu.h> |
22 | 23 | #include <asm/processor.h> |
23 | 24 | #include <asm/gpio.h> |
... | ... | @@ -497,7 +498,7 @@ |
497 | 498 | /* If MRC data is not found we cannot continue S3 resume. */ |
498 | 499 | if (pei_data->boot_mode == PEI_BOOT_RESUME && !pei_data->mrc_input) { |
499 | 500 | debug("Giving up in sdram_initialize: No MRC data\n"); |
500 | - reset_cpu(0); | |
501 | + sysreset_walk_halt(SYSRESET_COLD); | |
501 | 502 | } |
502 | 503 | |
503 | 504 | /* Pass console handler in pei_data */ |
arch/x86/cpu/qemu/qemu.c
arch/x86/cpu/quark/quark.c
arch/x86/cpu/tangier/tangier.c
... | ... | @@ -4,7 +4,6 @@ |
4 | 4 | */ |
5 | 5 | |
6 | 6 | #include <common.h> |
7 | -#include <asm/scu.h> | |
8 | 7 | #include <asm/u-boot-x86.h> |
9 | 8 | |
10 | 9 | /* |
... | ... | @@ -23,10 +22,5 @@ |
23 | 22 | int print_cpuinfo(void) |
24 | 23 | { |
25 | 24 | return default_print_cpuinfo(); |
26 | -} | |
27 | - | |
28 | -void reset_cpu(ulong addr) | |
29 | -{ | |
30 | - scu_ipc_simple_command(IPCMSG_COLD_RESET, 0); | |
31 | 25 | } |
arch/x86/dts/bayleybay.dts
arch/x86/dts/baytrail_som-db5800-som-6867.dts
arch/x86/dts/broadwell_som-6896.dts
arch/x86/dts/cherryhill.dts
arch/x86/dts/chromebook_link.dts
arch/x86/dts/chromebook_samus.dts
arch/x86/dts/chromebox_panther.dts
arch/x86/dts/conga-qeval20-qa3-e3845.dts
arch/x86/dts/cougarcanyon2.dts
arch/x86/dts/crownbay.dts
arch/x86/dts/dfi-bt700.dtsi
arch/x86/dts/edison.dts
arch/x86/dts/efi-x86_app.dts
arch/x86/dts/efi-x86_payload.dts
arch/x86/dts/galileo.dts
arch/x86/dts/minnowmax.dts
arch/x86/dts/qemu-x86_i440fx.dts
arch/x86/dts/qemu-x86_q35.dts
arch/x86/dts/reset.dtsi
arch/x86/include/asm/processor.h
... | ... | @@ -43,11 +43,6 @@ |
43 | 43 | FULL_RST = 1 << 3, /* full power cycle */ |
44 | 44 | }; |
45 | 45 | |
46 | -/** | |
47 | - * x86_full_reset() - reset everything: perform a full power cycle | |
48 | - */ | |
49 | -void x86_full_reset(void); | |
50 | - | |
51 | 46 | static inline __attribute__((always_inline)) void cpu_hlt(void) |
52 | 47 | { |
53 | 48 | asm("hlt"); |
arch/x86/include/asm/u-boot-x86.h
configs/chromebook_link64_defconfig