summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-socfpga/include/mach/misc.h5
-rw-r--r--arch/arm/mach-socfpga/include/mach/system_manager_soc64.h6
-rw-r--r--arch/arm/mach-socfpga/misc_s10.c18
-rw-r--r--arch/x86/Kconfig3
-rw-r--r--arch/x86/cpu/start.S3
-rw-r--r--arch/x86/include/asm/acpi_nhlt.h8
6 files changed, 26 insertions, 17 deletions
diff --git a/arch/arm/mach-socfpga/include/mach/misc.h b/arch/arm/mach-socfpga/include/mach/misc.h
index a85c5aeef9..649d2f6ce2 100644
--- a/arch/arm/mach-socfpga/include/mach/misc.h
+++ b/arch/arm/mach-socfpga/include/mach/misc.h
@@ -39,6 +39,11 @@ void socfpga_init_security_policies(void);
void socfpga_sdram_remap_zero(void);
#endif
+#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10) || \
+ defined(CONFIG_TARGET_SOCFPGA_AGILEX)
+int is_fpga_config_ready(void);
+#endif
+
void do_bridge_reset(int enable, unsigned int mask);
void socfpga_pl310_clear(void);
void socfpga_get_managers_addr(void);
diff --git a/arch/arm/mach-socfpga/include/mach/system_manager_soc64.h b/arch/arm/mach-socfpga/include/mach/system_manager_soc64.h
index c90f63a754..5e3f54a6a8 100644
--- a/arch/arm/mach-socfpga/include/mach/system_manager_soc64.h
+++ b/arch/arm/mach-socfpga/include/mach/system_manager_soc64.h
@@ -88,8 +88,12 @@ void sysmgr_pinmux_table_delay(const u32 **table, unsigned int *table_len);
#define SYSMGR_ECC_OCRAM_EN BIT(0)
#define SYSMGR_ECC_OCRAM_SERR BIT(3)
#define SYSMGR_ECC_OCRAM_DERR BIT(4)
-#define SYSMGR_FPGAINTF_USEFPGA 0x1
+#define SYSMGR_FPGACONFIG_FPGA_COMPLETE BIT(0)
+#define SYSMGR_FPGACONFIG_EARLY_USERMODE BIT(1)
+#define SYSMGR_FPGACONFIG_READY_MASK (SYSMGR_FPGACONFIG_FPGA_COMPLETE | \
+ SYSMGR_FPGACONFIG_EARLY_USERMODE)
+#define SYSMGR_FPGAINTF_USEFPGA 0x1
#define SYSMGR_FPGAINTF_NAND BIT(4)
#define SYSMGR_FPGAINTF_SDMMC BIT(8)
#define SYSMGR_FPGAINTF_SPIM0 BIT(16)
diff --git a/arch/arm/mach-socfpga/misc_s10.c b/arch/arm/mach-socfpga/misc_s10.c
index 670bfa1a31..52868fb344 100644
--- a/arch/arm/mach-socfpga/misc_s10.c
+++ b/arch/arm/mach-socfpga/misc_s10.c
@@ -151,17 +151,19 @@ int arch_early_init_r(void)
return 0;
}
+/* Return 1 if FPGA is ready otherwise return 0 */
+int is_fpga_config_ready(void)
+{
+ return (readl(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_FPGA_CONFIG) &
+ SYSMGR_FPGACONFIG_READY_MASK) == SYSMGR_FPGACONFIG_READY_MASK;
+}
+
void do_bridge_reset(int enable, unsigned int mask)
{
/* Check FPGA status before bridge enable */
- if (enable) {
- int ret = mbox_get_fpga_config_status(MBOX_RECONFIG_STATUS);
-
- if (ret && ret != MBOX_CFGSTAT_STATE_CONFIG)
- ret = mbox_get_fpga_config_status(MBOX_CONFIG_STATUS);
-
- if (ret)
- return;
+ if (!is_fpga_config_ready()) {
+ puts("FPGA not ready. Bridge reset aborted!\n");
+ return;
}
socfpga_bridges_reset(enable);
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index a34b108fff..76276c6027 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -203,6 +203,9 @@ config SPL_X86_32BIT_INIT
help
This is enabled when 32-bit init is in SPL
+config USE_EARLY_BOARD_INIT
+ bool
+
config RESET_SEG_START
hex
depends on X86_RESET_VECTOR
diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
index 4ad515ce08..3b6ed37bc0 100644
--- a/arch/x86/cpu/start.S
+++ b/arch/x86/cpu/start.S
@@ -88,6 +88,7 @@ _start:
/* Clear the interrupt vectors */
lidt blank_idt_ptr
+#ifdef CONFIG_USE_EARLY_BOARD_INIT
/*
* Critical early platform init - generally not used, we prefer init
* to happen later when we have a console, in case something goes
@@ -96,6 +97,8 @@ _start:
jmp early_board_init
.globl early_board_init_ret
early_board_init_ret:
+#endif
+
post_code(POST_START)
/* Initialise Cache-As-RAM */
diff --git a/arch/x86/include/asm/acpi_nhlt.h b/arch/x86/include/asm/acpi_nhlt.h
index 4720321381..2c44196317 100644
--- a/arch/x86/include/asm/acpi_nhlt.h
+++ b/arch/x86/include/asm/acpi_nhlt.h
@@ -139,14 +139,6 @@ void nhlt_next_instance(struct nhlt *nhlt, int link_type);
/*
* Serialize NHLT object to ACPI table. Take in the beginning address of where
- * the table will reside and return the address of the next ACPI table. On
- * error 0 will be returned. The NHLT object is no longer valid after this
- * function is called.
- */
-uintptr_t nhlt_serialise(struct nhlt *nhlt, uintptr_t acpi_addr);
-
-/*
- * Serialize NHLT object to ACPI table. Take in the beginning address of where
* the table will reside oem_id and oem_table_id and return the address of the
* next ACPI table. On error 0 will be returned. The NHLT object is no longer
* valid after this function is called.