diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/cpu/armv7/sunxi/psci.c | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/system.h | 15 | ||||
-rw-r--r-- | arch/arm/lib/crt0_aarch64_efi.S | 9 | ||||
-rw-r--r-- | arch/arm/lib/crt0_arm_efi.S | 9 | ||||
-rw-r--r-- | arch/arm/mach-imx/mx7/psci-mx7.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-stm32mp/psci.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-uniphier/arm32/psci.c | 4 | ||||
-rw-r--r-- | arch/riscv/lib/crt0_riscv_efi.S | 11 |
8 files changed, 41 insertions, 29 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/psci.c b/arch/arm/cpu/armv7/sunxi/psci.c index f3e8f99a71..2c5d99e9ac 100644 --- a/arch/arm/cpu/armv7/sunxi/psci.c +++ b/arch/arm/cpu/armv7/sunxi/psci.c @@ -276,7 +276,7 @@ int __secure psci_cpu_on(u32 __always_unused unused, u32 mpidr, u32 pc, return ARM_PSCI_RET_SUCCESS; } -void __secure psci_cpu_off(void) +s32 __secure psci_cpu_off(void) { psci_cpu_off_common(); diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index aed2e3c51e..a1a5e35ef6 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -516,6 +516,21 @@ enum { */ void mmu_page_table_flush(unsigned long start, unsigned long stop); +#ifdef CONFIG_ARMV7_PSCI +void psci_arch_cpu_entry(void); +u32 psci_version(void); +s32 psci_features(u32 function_id, u32 psci_fid); +s32 psci_cpu_off(void); +s32 psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc, + u32 context_id); +s32 psci_affinity_info(u32 function_id, u32 target_affinity, + u32 lowest_affinity_level); +u32 psci_migrate_info_type(void); +void psci_system_off(void); +void psci_system_reset(void); +s32 psci_features(u32 function_id, u32 psci_fid); +#endif + #endif /* __ASSEMBLY__ */ #define arch_align_stack(x) (x) diff --git a/arch/arm/lib/crt0_aarch64_efi.S b/arch/arm/lib/crt0_aarch64_efi.S index cb205fa30a..368933ecf2 100644 --- a/arch/arm/lib/crt0_aarch64_efi.S +++ b/arch/arm/lib/crt0_aarch64_efi.S @@ -17,14 +17,13 @@ */ .globl ImageBase ImageBase: - .ascii "MZ" + .short IMAGE_DOS_SIGNATURE /* 'MZ' */ .skip 58 /* 'MZ' + pad + offset == 64 */ .long pe_header - ImageBase /* Offset to the PE header */ pe_header: - .ascii "PE" - .short 0 + .long IMAGE_NT_SIGNATURE /* 'PE' */ coff_header: - .short 0xaa64 /* AArch64 */ + .short IMAGE_FILE_MACHINE_ARM64 /* AArch64 */ .short 2 /* nr_sections */ .long 0 /* TimeDateStamp */ .long 0 /* PointerToSymbolTable */ @@ -36,7 +35,7 @@ coff_header: IMAGE_FILE_LOCAL_SYMS_STRIPPED | \ IMAGE_FILE_DEBUG_STRIPPED) optional_header: - .short 0x20b /* PE32+ format */ + .short IMAGE_NT_OPTIONAL_HDR64_MAGIC /* PE32+ format */ .byte 0x02 /* MajorLinkerVersion */ .byte 0x14 /* MinorLinkerVersion */ .long _edata - _start /* SizeOfCode */ diff --git a/arch/arm/lib/crt0_arm_efi.S b/arch/arm/lib/crt0_arm_efi.S index 5470e2ff0e..cc8a115f31 100644 --- a/arch/arm/lib/crt0_arm_efi.S +++ b/arch/arm/lib/crt0_arm_efi.S @@ -16,14 +16,13 @@ */ .globl image_base image_base: - .ascii "MZ" + .short IMAGE_DOS_SIGNATURE /* 'MZ' */ .skip 58 /* 'MZ' + pad + offset == 64 */ .long pe_header - image_base /* Offset to the PE header */ pe_header: - .ascii "PE" - .short 0 + .long IMAGE_NT_SIGNATURE /* 'PE' */ coff_header: - .short 0x1c2 /* Mixed ARM/Thumb */ + .short IMAGE_FILE_MACHINE_THUMB /* Mixed ARM/Thumb */ .short 2 /* nr_sections */ .long 0 /* TimeDateStamp */ .long 0 /* PointerToSymbolTable */ @@ -36,7 +35,7 @@ coff_header: IMAGE_FILE_32BIT_MACHINE | \ IMAGE_FILE_DEBUG_STRIPPED) optional_header: - .short 0x10b /* PE32 format */ + .short IMAGE_NT_OPTIONAL_HDR32_MAGIC /* PE32 format */ .byte 0x02 /* MajorLinkerVersion */ .byte 0x14 /* MinorLinkerVersion */ .long _edata - _start /* SizeOfCode */ diff --git a/arch/arm/mach-imx/mx7/psci-mx7.c b/arch/arm/mach-imx/mx7/psci-mx7.c index 34ba0a9307..c98d2e96af 100644 --- a/arch/arm/mach-imx/mx7/psci-mx7.c +++ b/arch/arm/mach-imx/mx7/psci-mx7.c @@ -298,7 +298,7 @@ __secure s32 psci_affinity_info(u32 __always_unused function_id, return psci_state[cpu]; } -__secure s32 psci_migrate_info_type(u32 function_id) +__secure u32 psci_migrate_info_type(void) { /* Trusted OS is either not present or does not require migration */ return 2; diff --git a/arch/arm/mach-stm32mp/psci.c b/arch/arm/mach-stm32mp/psci.c index 139bb09292..1d91b2d324 100644 --- a/arch/arm/mach-stm32mp/psci.c +++ b/arch/arm/mach-stm32mp/psci.c @@ -30,7 +30,7 @@ u8 psci_state[STM32MP1_PSCI_NR_CPUS] __secure_data = { PSCI_AFFINITY_LEVEL_ON, PSCI_AFFINITY_LEVEL_OFF}; -void __secure psci_set_state(int cpu, u8 state) +static inline void psci_set_state(int cpu, u8 state) { psci_state[cpu] = state; dsb(); @@ -67,7 +67,7 @@ void __secure psci_arch_cpu_entry(void) writel(0xFFFFFFFF, TAMP_BACKUP_MAGIC_NUMBER); } -int __secure psci_features(u32 function_id, u32 psci_fid) +s32 __secure psci_features(u32 function_id, u32 psci_fid) { switch (psci_fid) { case ARM_PSCI_0_2_FN_PSCI_VERSION: @@ -82,12 +82,12 @@ int __secure psci_features(u32 function_id, u32 psci_fid) return ARM_PSCI_RET_NI; } -unsigned int __secure psci_version(u32 function_id) +u32 __secure psci_version(void) { return ARM_PSCI_VER_1_0; } -int __secure psci_affinity_info(u32 function_id, u32 target_affinity, +s32 __secure psci_affinity_info(u32 function_id, u32 target_affinity, u32 lowest_affinity_level) { u32 cpu = target_affinity & MPIDR_AFF0; @@ -104,7 +104,7 @@ int __secure psci_affinity_info(u32 function_id, u32 target_affinity, return psci_state[cpu]; } -int __secure psci_migrate_info_type(u32 function_id) +u32 __secure psci_migrate_info_type(void) { /* * in Power_State_Coordination_Interface_PDD_v1_1_DEN0022D.pdf @@ -116,7 +116,7 @@ int __secure psci_migrate_info_type(u32 function_id) return 2; } -int __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc, +s32 __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc, u32 context_id) { u32 cpu = target_cpu & MPIDR_AFF0; @@ -161,7 +161,7 @@ int __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc, return ARM_PSCI_RET_SUCCESS; } -int __secure psci_cpu_off(u32 function_id) +s32 __secure psci_cpu_off(void) { u32 cpu; @@ -181,7 +181,7 @@ int __secure psci_cpu_off(u32 function_id) wfi(); } -void __secure psci_system_reset(u32 function_id) +void __secure psci_system_reset(void) { /* System reset */ writel(RCC_MP_GRSTCSETR_MPSYSRST, RCC_MP_GRSTCSETR); @@ -190,7 +190,7 @@ void __secure psci_system_reset(u32 function_id) wfi(); } -void __secure psci_system_off(u32 function_id) +void __secure psci_system_off(void) { /* System Off is not managed, waiting user power off * TODO: handle I2C write in PMIC Main Control register bit 0 = SWOFF diff --git a/arch/arm/mach-uniphier/arm32/psci.c b/arch/arm/mach-uniphier/arm32/psci.c index 3f67edf26e..ef35923f6a 100644 --- a/arch/arm/mach-uniphier/arm32/psci.c +++ b/arch/arm/mach-uniphier/arm32/psci.c @@ -130,7 +130,7 @@ void psci_arch_init(void) u32 uniphier_psci_holding_pen_release __secure_data = 0xffffffff; -int __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point, +s32 __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point, u32 context_id) { u32 cpu = cpuid & 0xff; @@ -155,7 +155,7 @@ int __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point, return PSCI_RET_SUCCESS; } -void __secure psci_system_reset(u32 function_id) +void __secure psci_system_reset(void) { reset_cpu(0); } diff --git a/arch/riscv/lib/crt0_riscv_efi.S b/arch/riscv/lib/crt0_riscv_efi.S index b7b5329e1f..87fe1e56f9 100644 --- a/arch/riscv/lib/crt0_riscv_efi.S +++ b/arch/riscv/lib/crt0_riscv_efi.S @@ -14,12 +14,12 @@ #define SIZE_LONG 8 #define SAVE_LONG(reg, idx) sd reg, (idx*SIZE_LONG)(sp) #define LOAD_LONG(reg, idx) ld reg, (idx*SIZE_LONG)(sp) -#define PE_MACHINE 0x5064 +#define PE_MACHINE IMAGE_FILE_MACHINE_RISCV64 #else #define SIZE_LONG 4 #define SAVE_LONG(reg, idx) sw reg, (idx*SIZE_LONG)(sp) #define LOAD_LONG(reg, idx) lw reg, (idx*SIZE_LONG)(sp) -#define PE_MACHINE 0x5032 +#define PE_MACHINE IMAGE_FILE_MACHINE_RISCV32 #endif @@ -30,12 +30,11 @@ */ .globl ImageBase ImageBase: - .ascii "MZ" + .short IMAGE_DOS_SIGNATURE /* 'MZ' */ .skip 58 /* 'MZ' + pad + offset == 64 */ .long pe_header - ImageBase /* Offset to the PE header */ pe_header: - .ascii "PE" - .short 0 + .long IMAGE_NT_SIGNATURE /* 'PE' */ coff_header: .short PE_MACHINE /* RISC-V 64/32-bit */ .short 2 /* nr_sections */ @@ -49,7 +48,7 @@ coff_header: IMAGE_FILE_LOCAL_SYMS_STRIPPED | \ IMAGE_FILE_DEBUG_STRIPPED) optional_header: - .short 0x20b /* PE32+ format */ + .short IMAGE_NT_OPTIONAL_HDR64_MAGIC /* PE32+ format */ .byte 0x02 /* MajorLinkerVersion */ .byte 0x14 /* MinorLinkerVersion */ .long _edata - _start /* SizeOfCode */ |