void bl2_el3_plat_arch_setup(void) { unsigned int soc; int skip_scp = 0; int ret; uniphier_mmap_setup(BL2_BASE, BL2_SIZE, uniphier_bl2_mmap); enable_mmu_el3(0); soc = uniphier_get_soc_id(); if (soc == UNIPHIER_SOC_UNKNOWN) { ERROR("unsupported SoC\n"); plat_error_handler(-ENOTSUP); } ret = uniphier_io_setup(soc); if (ret) { ERROR("failed to setup io devices\n"); plat_error_handler(ret); } switch (uniphier_get_boot_master(soc)) { case UNIPHIER_BOOT_MASTER_THIS: INFO("Booting from this SoC\n"); skip_scp = 1; break; case UNIPHIER_BOOT_MASTER_SCP: INFO("Booting from on-chip SCP\n"); if (uniphier_scp_is_running()) { INFO("SCP is already running. SCP_BL2 load will be skipped.\n"); skip_scp = 1; } /* * SCP must be kicked every time even if it is already running * because it polls this event after the reboot of the backend. */ uniphier_bl2_kick_scp = 1; break; case UNIPHIER_BOOT_MASTER_EXT: INFO("Booting from external SCP\n"); skip_scp = 1; break; default: plat_error_handler(-ENOTSUP); break; } if (skip_scp) { struct image_info *image_info; image_info = uniphier_get_image_info(SCP_BL2_IMAGE_ID); image_info->h.attr |= IMAGE_ATTRIB_SKIP_LOADING; } }
void bl1_platform_setup(void) { unsigned int soc; int ret; soc = uniphier_get_soc_id(); if (soc == UNIPHIER_SOC_UNKNOWN) { ERROR("unsupported SoC\n"); plat_error_handler(-ENOTSUP); } ret = uniphier_io_setup(soc); if (ret) { ERROR("failed to setup io devices\n"); plat_error_handler(ret); } }
static int do_pinmon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { printf("Boot Swap: %s\n\n", boot_is_swapped() ? "ON" : "OFF"); switch (uniphier_get_soc_id()) { #if defined(CONFIG_ARCH_UNIPHIER_SLD3) case UNIPHIER_SLD3_ID: uniphier_sld3_boot_mode_show(); break; #endif #if defined(CONFIG_ARCH_UNIPHIER_LD4) || defined(CONFIG_ARCH_UNIPHIER_PRO4) || \ defined(CONFIG_ARCH_UNIPHIER_SLD8) case UNIPHIER_LD4_ID: case UNIPHIER_PRO4_ID: case UNIPHIER_SLD8_ID: uniphier_ld4_boot_mode_show(); break; #endif #if defined(CONFIG_ARCH_UNIPHIER_PRO5) case UNIPHIER_PRO5_ID: uniphier_pro5_boot_mode_show(); break; #endif #if defined(CONFIG_ARCH_UNIPHIER_PXS2) || defined(CONFIG_ARCH_UNIPHIER_LD6B) case UNIPHIER_PXS2_ID: case UNIPHIER_LD6B_ID: uniphier_pxs2_boot_mode_show(); break; #endif #if defined(CONFIG_ARCH_UNIPHIER_LD11) || defined(CONFIG_ARCH_UNIPHIER_LD20) case UNIPHIER_LD11_ID: case UNIPHIER_LD20_ID: uniphier_ld20_boot_mode_show(); break; #endif default: break; } return 0; }
int print_cpuinfo(void) { unsigned int id, model, rev, required_model = 1, required_rev = 1; id = uniphier_get_soc_id(); model = uniphier_get_soc_model(); rev = uniphier_get_soc_revision(); puts("SoC: "); switch (id) { case UNIPHIER_SLD3_ID: puts("sLD3"); required_model = 2; break; case UNIPHIER_LD4_ID: puts("LD4"); required_rev = 2; break; case UNIPHIER_PRO4_ID: puts("Pro4"); break; case UNIPHIER_SLD8_ID: puts("sLD8"); break; case UNIPHIER_PRO5_ID: puts("Pro5"); break; case UNIPHIER_PXS2_ID: puts("PXs2"); break; case UNIPHIER_LD6B_ID: puts("LD6b"); break; case UNIPHIER_LD11_ID: puts("LD11"); break; case UNIPHIER_LD20_ID: puts("LD20"); break; case UNIPHIER_PXS3_ID: puts("PXs3"); break; default: printf("Unknown Processor ID (0x%x)\n", id); return -ENOTSUPP; } printf(" (model %d, revision %d)\n", model, rev); if (model < required_model) { printf("Only model %d or newer is supported.\n", required_model); return -ENOTSUPP; } else if (rev < required_rev) { printf("Only revision %d or newer is supported.\n", required_rev); return -ENOTSUPP; } return 0; }