mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-28 15:40:29 +09:00
Revert "sunxi: psci: avoid error address-of-packed-member"
Using memcpy() for some MMIO access is generally frowned upon and might break things on some platforms. Allwinner H3, which fails to boot, being an example here. Moreover, fields being accessed are naturally aligned and warnings produced by GCC have been quiesced for some time already by:53dc8ae
("gcc-9: silence 'address-of-packed-member' warning") That said, it should be okay to revert this commit. This reverts commit9bd34a69a4
. Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com> Acked-by: Jagan Teki <jagan@amarulasolutions.com>
This commit is contained in:
parent
a4df9d8ab8
commit
3586cb8227
@ -75,7 +75,7 @@ static void __secure __mdelay(u32 ms)
|
|||||||
isb();
|
isb();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __secure clamp_release(void __maybe_unused *clamp)
|
static void __secure clamp_release(u32 __maybe_unused *clamp)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN7I) || \
|
#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN7I) || \
|
||||||
defined(CONFIG_MACH_SUN8I_H3) || \
|
defined(CONFIG_MACH_SUN8I_H3) || \
|
||||||
@ -90,7 +90,7 @@ static void __secure clamp_release(void __maybe_unused *clamp)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __secure clamp_set(void __maybe_unused *clamp)
|
static void __secure clamp_set(u32 __maybe_unused *clamp)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN7I) || \
|
#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN7I) || \
|
||||||
defined(CONFIG_MACH_SUN8I_H3) || \
|
defined(CONFIG_MACH_SUN8I_H3) || \
|
||||||
@ -99,28 +99,22 @@ static void __secure clamp_set(void __maybe_unused *clamp)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __secure sunxi_power_switch(void *clamp, void *pwroff_ptr, bool on,
|
static void __secure sunxi_power_switch(u32 *clamp, u32 *pwroff, bool on,
|
||||||
int cpu)
|
int cpu)
|
||||||
{
|
{
|
||||||
u32 pwroff;
|
|
||||||
|
|
||||||
memcpy(&pwroff, pwroff_ptr, sizeof(u32));
|
|
||||||
|
|
||||||
if (on) {
|
if (on) {
|
||||||
/* Release power clamp */
|
/* Release power clamp */
|
||||||
clamp_release(clamp);
|
clamp_release(clamp);
|
||||||
|
|
||||||
/* Clear power gating */
|
/* Clear power gating */
|
||||||
clrbits_le32(&pwroff, BIT(cpu));
|
clrbits_le32(pwroff, BIT(cpu));
|
||||||
} else {
|
} else {
|
||||||
/* Set power gating */
|
/* Set power gating */
|
||||||
setbits_le32(&pwroff, BIT(cpu));
|
setbits_le32(pwroff, BIT(cpu));
|
||||||
|
|
||||||
/* Activate power clamp */
|
/* Activate power clamp */
|
||||||
clamp_set(clamp);
|
clamp_set(clamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(pwroff_ptr, &pwroff, sizeof(u32));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MACH_SUN8I_R40
|
#ifdef CONFIG_MACH_SUN8I_R40
|
||||||
|
Loading…
Reference in New Issue
Block a user