1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
9 #include <asm/arch/mailbox_s10.h>
10 #include <asm/arch/misc.h>
11 #include <asm/arch/reset_manager.h>
12 #include <asm/arch/system_manager.h>
14 #include <asm/global_data.h>
19 #include <mach/clock_manager.h>
21 DECLARE_GLOBAL_DATA_PTR;
24 * FPGA programming support for SoC FPGA Stratix 10
26 static Altera_desc altera_fpga[] = {
29 Intel_FPGA_SDM_Mailbox,
31 secure_device_manager_mailbox,
32 /* No limitation as additional data will be ignored */
34 /* No device function table */
36 /* Base interface address specified in driver */
38 /* No cookie implementation */
45 * Print CPU information
47 #if defined(CONFIG_DISPLAY_CPUINFO)
48 int print_cpuinfo(void)
50 puts("CPU: Intel FPGA SoCFPGA Platform (ARMv8 64bit Cortex-A53)\n");
56 #ifdef CONFIG_ARCH_MISC_INIT
57 int arch_misc_init(void)
61 sprintf(qspi_string, "<0x%08x>", cm_get_qspi_controller_clk_hz());
62 env_set("qspi_clock", qspi_string);
68 int arch_early_init_r(void)
70 socfpga_fpga_add(&altera_fpga[0]);
75 /* Return 1 if FPGA is ready otherwise return 0 */
76 int is_fpga_config_ready(void)
78 return (readl(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_FPGA_CONFIG) &
79 SYSMGR_FPGACONFIG_READY_MASK) == SYSMGR_FPGACONFIG_READY_MASK;
82 void do_bridge_reset(int enable, unsigned int mask)
84 /* Check FPGA status before bridge enable */
85 if (!is_fpga_config_ready()) {
86 puts("FPGA not ready. Bridge reset aborted!\n");
90 socfpga_bridges_reset(enable);