Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Ley Foon Tan | b149f2b | 2017-04-26 02:44:36 +0800 | [diff] [blame] | 2 | /* |
Tien Fong Chee | 8ca1708 | 2021-11-07 23:08:55 +0800 | [diff] [blame] | 3 | * Copyright (C) 2016-2021 Intel Corporation |
Ley Foon Tan | b149f2b | 2017-04-26 02:44:36 +0800 | [diff] [blame] | 4 | */ |
| 5 | |
Simon Goldschmidt | 5216671 | 2019-10-23 22:32:30 +0200 | [diff] [blame] | 6 | #ifndef _SOCFPGA_MISC_H_ |
| 7 | #define _SOCFPGA_MISC_H_ |
Ley Foon Tan | b149f2b | 2017-04-26 02:44:36 +0800 | [diff] [blame] | 8 | |
Simon Goldschmidt | da13a0a | 2018-10-10 14:55:23 +0200 | [diff] [blame] | 9 | #include <asm/sections.h> |
| 10 | |
Ley Foon Tan | b149f2b | 2017-04-26 02:44:36 +0800 | [diff] [blame] | 11 | void dwmac_deassert_reset(const unsigned int of_reset_id, const u32 phymode); |
| 12 | |
| 13 | struct bsel { |
| 14 | const char *mode; |
| 15 | const char *name; |
| 16 | }; |
| 17 | |
| 18 | extern struct bsel bsel_str[]; |
| 19 | |
| 20 | #ifdef CONFIG_FPGA |
Ang, Chee Hong | ff14f16 | 2018-12-19 18:35:15 -0800 | [diff] [blame] | 21 | void socfpga_fpga_add(void *fpga_desc); |
Ley Foon Tan | b149f2b | 2017-04-26 02:44:36 +0800 | [diff] [blame] | 22 | #else |
Tom Rini | ea84ae6 | 2020-05-14 08:30:05 -0400 | [diff] [blame] | 23 | static inline void socfpga_fpga_add(void *fpga_desc) {} |
Ley Foon Tan | b149f2b | 2017-04-26 02:44:36 +0800 | [diff] [blame] | 24 | #endif |
| 25 | |
Simon Goldschmidt | 8e30203 | 2018-08-13 21:34:35 +0200 | [diff] [blame] | 26 | #ifdef CONFIG_TARGET_SOCFPGA_GEN5 |
| 27 | void socfpga_sdram_remap_zero(void); |
Simon Goldschmidt | da13a0a | 2018-10-10 14:55:23 +0200 | [diff] [blame] | 28 | static inline bool socfpga_is_booting_from_fpga(void) |
| 29 | { |
| 30 | if ((__image_copy_start >= (char *)SOCFPGA_FPGA_SLAVES_ADDRESS) && |
| 31 | (__image_copy_start < (char *)SOCFPGA_STM_ADDRESS)) |
| 32 | return true; |
| 33 | return false; |
| 34 | } |
Simon Goldschmidt | 8e30203 | 2018-08-13 21:34:35 +0200 | [diff] [blame] | 35 | #endif |
| 36 | |
Marek Vasut | 8fdb419 | 2018-08-18 19:11:52 +0200 | [diff] [blame] | 37 | #ifdef CONFIG_TARGET_SOCFPGA_ARRIA10 |
| 38 | void socfpga_init_security_policies(void); |
| 39 | void socfpga_sdram_remap_zero(void); |
| 40 | #endif |
| 41 | |
Chee Hong Ang | 61e9199 | 2020-08-06 11:56:29 +0800 | [diff] [blame] | 42 | #if defined(CONFIG_TARGET_SOCFPGA_STRATIX10) || \ |
| 43 | defined(CONFIG_TARGET_SOCFPGA_AGILEX) |
| 44 | int is_fpga_config_ready(void); |
| 45 | #endif |
| 46 | |
Marek Vasut | 713a8a2 | 2019-04-16 22:28:08 +0200 | [diff] [blame] | 47 | void do_bridge_reset(int enable, unsigned int mask); |
Tien Fong Chee | adc079f | 2021-11-07 23:08:56 +0800 | [diff] [blame] | 48 | void force_periph_program(unsigned int status); |
Tien Fong Chee | 8ca1708 | 2021-11-07 23:08:55 +0800 | [diff] [blame] | 49 | bool is_regular_boot_valid(void); |
Tien Fong Chee | adc079f | 2021-11-07 23:08:56 +0800 | [diff] [blame] | 50 | bool is_periph_program_force(void); |
Tien Fong Chee | 8ca1708 | 2021-11-07 23:08:55 +0800 | [diff] [blame] | 51 | void set_regular_boot(unsigned int status); |
Marek Vasut | b6ba490 | 2019-03-21 23:05:38 +0100 | [diff] [blame] | 52 | void socfpga_pl310_clear(void); |
Ley Foon Tan | fed4c95 | 2019-11-08 10:38:19 +0800 | [diff] [blame] | 53 | void socfpga_get_managers_addr(void); |
Tien Fong Chee | 8ca1708 | 2021-11-07 23:08:55 +0800 | [diff] [blame] | 54 | int qspi_flash_software_reset(void); |
Ley Foon Tan | 4cc6b58 | 2018-05-24 00:17:23 +0800 | [diff] [blame] | 55 | |
Simon Goldschmidt | 5216671 | 2019-10-23 22:32:30 +0200 | [diff] [blame] | 56 | #endif /* _SOCFPGA_MISC_H_ */ |