Commit 818e6732 authored by Samuel Holland's avatar Samuel Holland
Browse files

allwinner: Merge duplicate code in sunxi_power_down



The action of last resort isn't going to change between SoCs. This moves
that code back to the PSCI implementation, where it more obviously
matches the code in sunxi_system_reset().

The two error messages say essentially the same thing anyway.
Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
Change-Id: I62ac35fdb5ed78a016e9b18281416f1dcea38a4a
parent 4538c498
...@@ -12,7 +12,7 @@ void sunxi_configure_mmu_el3(int flags); ...@@ -12,7 +12,7 @@ void sunxi_configure_mmu_el3(int flags);
void sunxi_cpu_on(u_register_t mpidr); void sunxi_cpu_on(u_register_t mpidr);
void sunxi_cpu_off(u_register_t mpidr); void sunxi_cpu_off(u_register_t mpidr);
void sunxi_disable_secondary_cpus(u_register_t primary_mpidr); void sunxi_disable_secondary_cpus(u_register_t primary_mpidr);
void __dead2 sunxi_power_down(void); void sunxi_power_down(void);
int sunxi_pmic_setup(uint16_t socid, const void *fdt); int sunxi_pmic_setup(uint16_t socid, const void *fdt);
void sunxi_security_setup(void); void sunxi_security_setup(void);
......
/* /*
* Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -65,6 +65,11 @@ static void __dead2 sunxi_system_off(void) ...@@ -65,6 +65,11 @@ static void __dead2 sunxi_system_off(void)
sunxi_disable_secondary_cpus(read_mpidr()); sunxi_disable_secondary_cpus(read_mpidr());
sunxi_power_down(); sunxi_power_down();
udelay(1000);
ERROR("PSCI: Cannot turn off system, halting\n");
wfi();
panic();
} }
static void __dead2 sunxi_system_reset(void) static void __dead2 sunxi_system_reset(void)
......
...@@ -322,7 +322,7 @@ int sunxi_pmic_setup(uint16_t socid, const void *fdt) ...@@ -322,7 +322,7 @@ int sunxi_pmic_setup(uint16_t socid, const void *fdt)
return 0; return 0;
} }
void __dead2 sunxi_power_down(void) void sunxi_power_down(void)
{ {
switch (pmic) { switch (pmic) {
case GENERIC_H5: case GENERIC_H5:
...@@ -368,8 +368,4 @@ void __dead2 sunxi_power_down(void) ...@@ -368,8 +368,4 @@ void __dead2 sunxi_power_down(void)
break; break;
} }
udelay(1000);
ERROR("PSCI: Cannot turn off system, halting.\n");
wfi();
panic();
} }
...@@ -95,7 +95,7 @@ int sunxi_pmic_setup(uint16_t socid, const void *fdt) ...@@ -95,7 +95,7 @@ int sunxi_pmic_setup(uint16_t socid, const void *fdt)
return 0; return 0;
} }
void __dead2 sunxi_power_down(void) void sunxi_power_down(void)
{ {
uint8_t val; uint8_t val;
...@@ -111,9 +111,4 @@ void __dead2 sunxi_power_down(void) ...@@ -111,9 +111,4 @@ void __dead2 sunxi_power_down(void)
default: default:
break; break;
} }
udelay(1000);
ERROR("PSCI: Cannot communicate with PMIC, halting\n");
wfi();
panic();
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment