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: Samuel Holland <samuel@sholland.org>
Change-Id: I62ac35fdb5ed78a016e9b18281416f1dcea38a4a
This commit is contained in:
Samuel Holland 2019-10-20 15:06:57 -05:00
parent 4538c4983b
commit 818e67324b
4 changed files with 9 additions and 13 deletions

View File

@ -12,7 +12,7 @@ void sunxi_configure_mmu_el3(int flags);
void sunxi_cpu_on(u_register_t mpidr);
void sunxi_cpu_off(u_register_t 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);
void sunxi_security_setup(void);

View File

@ -1,5 +1,5 @@
/*
* 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
*/
@ -65,6 +65,11 @@ static void __dead2 sunxi_system_off(void)
sunxi_disable_secondary_cpus(read_mpidr());
sunxi_power_down();
udelay(1000);
ERROR("PSCI: Cannot turn off system, halting\n");
wfi();
panic();
}
static void __dead2 sunxi_system_reset(void)

View File

@ -322,7 +322,7 @@ int sunxi_pmic_setup(uint16_t socid, const void *fdt)
return 0;
}
void __dead2 sunxi_power_down(void)
void sunxi_power_down(void)
{
switch (pmic) {
case GENERIC_H5:
@ -368,8 +368,4 @@ void __dead2 sunxi_power_down(void)
break;
}
udelay(1000);
ERROR("PSCI: Cannot turn off system, halting.\n");
wfi();
panic();
}

View File

@ -95,7 +95,7 @@ int sunxi_pmic_setup(uint16_t socid, const void *fdt)
return 0;
}
void __dead2 sunxi_power_down(void)
void sunxi_power_down(void)
{
uint8_t val;
@ -111,9 +111,4 @@ void __dead2 sunxi_power_down(void)
default:
break;
}
udelay(1000);
ERROR("PSCI: Cannot communicate with PMIC, halting\n");
wfi();
panic();
}