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 | /* |
| 3 | * Copyright (C) 2016-2017 Intel Corporation |
Ley Foon Tan | b149f2b | 2017-04-26 02:44:36 +0800 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _MISC_H_ |
| 7 | #define _MISC_H_ |
| 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 |
Ang, Chee Hong | ff14f16 | 2018-12-19 18:35:15 -0800 | [diff] [blame] | 23 | 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 | |
Marek Vasut | 713a8a2 | 2019-04-16 22:28:08 +0200 | [diff] [blame] | 42 | void do_bridge_reset(int enable, unsigned int mask); |
Marek Vasut | b6ba490 | 2019-03-21 23:05:38 +0100 | [diff] [blame] | 43 | void socfpga_pl310_clear(void); |
Ley Foon Tan | 4cc6b58 | 2018-05-24 00:17:23 +0800 | [diff] [blame] | 44 | |
Ley Foon Tan | b149f2b | 2017-04-26 02:44:36 +0800 | [diff] [blame] | 45 | #endif /* _MISC_H_ */ |