blob: b54b402f7eea8a6b15ed3f9a81888529279bfa91 [file] [log] [blame]
Hadi Asyrafi616da772019-06-27 11:34:03 +08001/*
Sieu Mun Tang9dd2c182024-10-22 01:00:45 +08002 * Copyright (c) 2019-2023, Intel Corporation. All rights reserved.
3 * Copyright (c) 2024, Altera Corporation. All rights reserved.
Hadi Asyrafi616da772019-06-27 11:34:03 +08004 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
Hadi Asyrafif0fa8072019-10-23 17:02:55 +08008#ifndef SOCFPGA_PRIVATE_H
9#define SOCFPGA_PRIVATE_H
10
Hadi Asyrafif0fa8072019-10-23 17:02:55 +080011
12#define EMMC_DESC_SIZE (1<<20)
13
14#define EMMC_INIT_PARAMS(base, clk) \
15 { .bus_width = MMC_BUS_WIDTH_4, \
16 .clk_rate = (clk), \
17 .desc_base = (base), \
18 .desc_size = EMMC_DESC_SIZE, \
19 .flags = 0, \
20 .reg_base = SOCFPGA_MMC_REG_BASE \
21 }
22
23typedef enum {
24 BOOT_SOURCE_FPGA = 0,
25 BOOT_SOURCE_SDMMC,
26 BOOT_SOURCE_NAND,
27 BOOT_SOURCE_RSVD,
28 BOOT_SOURCE_QSPI
29} boot_source_type;
Hadi Asyrafi616da772019-06-27 11:34:03 +080030
31/*******************************************************************************
32 * Function and variable prototypes
33 ******************************************************************************/
Hadi Asyrafif0fa8072019-10-23 17:02:55 +080034
35void enable_nonsecure_access(void);
36
Mahesh Raoc2715992023-08-22 17:26:23 +080037void socfpga_io_setup(int boot_source, unsigned long offset);
Hadi Asyrafif0fa8072019-10-23 17:02:55 +080038
Hadi Asyrafi616da772019-06-27 11:34:03 +080039void socfgpa_configure_mmu_el3(unsigned long total_base,
40 unsigned long total_size,
41 unsigned long ro_start,
42 unsigned long ro_limit,
43 unsigned long coh_start,
44 unsigned long coh_limit);
45
46
47void socfpga_configure_mmu_el1(unsigned long total_base,
48 unsigned long total_size,
49 unsigned long ro_start,
50 unsigned long ro_limit,
51 unsigned long coh_start,
52 unsigned long coh_limit);
53
54void socfpga_delay_timer_init(void);
55
56void socfpga_gic_driver_init(void);
57
BenjaminLimJLa4a43272022-04-06 10:19:16 +080058void socfpga_delay_timer_init_args(void);
59
Hadi Asyrafi616da772019-06-27 11:34:03 +080060uint32_t socfpga_get_spsr_for_bl32_entry(void);
61
62uint32_t socfpga_get_spsr_for_bl33_entry(void);
63
64unsigned long socfpga_get_ns_image_entrypoint(void);
65
Hadi Asyrafi0563a852019-10-22 12:59:32 +080066void plat_secondary_cpus_bl31_entry(void);
Hadi Asyrafi616da772019-06-27 11:34:03 +080067
Sieu Mun Tang9dd2c182024-10-22 01:00:45 +080068void invalidate_cache_low_el(void);
69
Hadi Asyrafif0fa8072019-10-23 17:02:55 +080070#endif /* SOCFPGA_PRIVATE_H */