ARMv8/Layerscape: switch SMP method accordingly
If the PSCI and PPA is ready, skip the fixup for spin-table and waking secondary cores. Otherwise, change SMP method to spin-table, and the device node of PSCI will be removed. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
This commit is contained in:
		
							parent
							
								
									f1dd4cadd2
								
							
						
					
					
						commit
						032d5bb4ae
					
				|  | @ -23,6 +23,9 @@ | ||||||
| #ifdef CONFIG_FSL_ESDHC | #ifdef CONFIG_FSL_ESDHC | ||||||
| #include <fsl_esdhc.h> | #include <fsl_esdhc.h> | ||||||
| #endif | #endif | ||||||
|  | #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT | ||||||
|  | #include <asm/armv8/sec_firmware.h> | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
| DECLARE_GLOBAL_DATA_PTR; | DECLARE_GLOBAL_DATA_PTR; | ||||||
| 
 | 
 | ||||||
|  | @ -364,6 +367,7 @@ int arch_early_init_r(void) | ||||||
| { | { | ||||||
| #ifdef CONFIG_MP | #ifdef CONFIG_MP | ||||||
| 	int rv = 1; | 	int rv = 1; | ||||||
|  | 	u32 psci_ver = 0xffffffff; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_SYS_FSL_ERRATUM_A009635 | #ifdef CONFIG_SYS_FSL_ERRATUM_A009635 | ||||||
|  | @ -371,9 +375,15 @@ int arch_early_init_r(void) | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_MP | #ifdef CONFIG_MP | ||||||
| 	rv = fsl_layerscape_wake_seconday_cores(); | #if defined(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT) && defined(CONFIG_ARMV8_PSCI) | ||||||
| 	if (rv) | 	/* Check the psci version to determine if the psci is supported */ | ||||||
| 		printf("Did not wake secondary cores\n"); | 	psci_ver = sec_firmware_support_psci_version(); | ||||||
|  | #endif | ||||||
|  | 	if (psci_ver == 0xffffffff) { | ||||||
|  | 		rv = fsl_layerscape_wake_seconday_cores(); | ||||||
|  | 		if (rv) | ||||||
|  | 			printf("Did not wake secondary cores\n"); | ||||||
|  | 	} | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_SYS_HAS_SERDES | #ifdef CONFIG_SYS_HAS_SERDES | ||||||
|  |  | ||||||
|  | @ -22,6 +22,9 @@ | ||||||
| #endif | #endif | ||||||
| #include <fsl_sec.h> | #include <fsl_sec.h> | ||||||
| #include <asm/arch-fsl-layerscape/soc.h> | #include <asm/arch-fsl-layerscape/soc.h> | ||||||
|  | #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT | ||||||
|  | #include <asm/armv8/sec_firmware.h> | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
| int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc) | int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc) | ||||||
| { | { | ||||||
|  | @ -38,7 +41,37 @@ void ft_fixup_cpu(void *blob) | ||||||
| 	int addr_cells; | 	int addr_cells; | ||||||
| 	u64 val, core_id; | 	u64 val, core_id; | ||||||
| 	size_t *boot_code_size = &(__secondary_boot_code_size); | 	size_t *boot_code_size = &(__secondary_boot_code_size); | ||||||
|  | #if defined(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT) && defined(CONFIG_ARMV8_PSCI) | ||||||
|  | 	int node; | ||||||
|  | 	u32 psci_ver; | ||||||
| 
 | 
 | ||||||
|  | 	/* Check the psci version to determine if the psci is supported */ | ||||||
|  | 	psci_ver = sec_firmware_support_psci_version(); | ||||||
|  | 	if (psci_ver == 0xffffffff) { | ||||||
|  | 		/* remove psci DT node */ | ||||||
|  | 		node = fdt_path_offset(blob, "/psci"); | ||||||
|  | 		if (node >= 0) | ||||||
|  | 			goto remove_psci_node; | ||||||
|  | 
 | ||||||
|  | 		node = fdt_node_offset_by_compatible(blob, -1, "arm,psci"); | ||||||
|  | 		if (node >= 0) | ||||||
|  | 			goto remove_psci_node; | ||||||
|  | 
 | ||||||
|  | 		node = fdt_node_offset_by_compatible(blob, -1, "arm,psci-0.2"); | ||||||
|  | 		if (node >= 0) | ||||||
|  | 			goto remove_psci_node; | ||||||
|  | 
 | ||||||
|  | 		node = fdt_node_offset_by_compatible(blob, -1, "arm,psci-1.0"); | ||||||
|  | 		if (node >= 0) | ||||||
|  | 			goto remove_psci_node; | ||||||
|  | 
 | ||||||
|  | remove_psci_node: | ||||||
|  | 		if (node >= 0) | ||||||
|  | 			fdt_del_node(blob, node); | ||||||
|  | 	} else { | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
|  | #endif | ||||||
| 	off = fdt_path_offset(blob, "/cpus"); | 	off = fdt_path_offset(blob, "/cpus"); | ||||||
| 	if (off < 0) { | 	if (off < 0) { | ||||||
| 		puts("couldn't find /cpus node\n"); | 		puts("couldn't find /cpus node\n"); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue