blob: 26609927c834ae2f035bb8a93bd4c5241ba8018d [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Ley Foon Tanb149f2b2017-04-26 02:44:36 +08002/*
3 * Copyright (C) 2016-2017 Intel Corporation
Ley Foon Tanb149f2b2017-04-26 02:44:36 +08004 */
5
6#ifndef _MISC_H_
7#define _MISC_H_
8
Simon Goldschmidtda13a0a2018-10-10 14:55:23 +02009#include <asm/sections.h>
10
Ley Foon Tanb149f2b2017-04-26 02:44:36 +080011void dwmac_deassert_reset(const unsigned int of_reset_id, const u32 phymode);
12
13struct bsel {
14 const char *mode;
15 const char *name;
16};
17
18extern struct bsel bsel_str[];
19
20#ifdef CONFIG_FPGA
21void socfpga_fpga_add(void);
22#else
23static inline void socfpga_fpga_add(void) {}
24#endif
25
Simon Goldschmidt8e302032018-08-13 21:34:35 +020026#ifdef CONFIG_TARGET_SOCFPGA_GEN5
27void socfpga_sdram_remap_zero(void);
Simon Goldschmidtda13a0a2018-10-10 14:55:23 +020028static 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 Goldschmidt8e302032018-08-13 21:34:35 +020035#endif
36
Marek Vasut8fdb4192018-08-18 19:11:52 +020037#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10
38void socfpga_init_security_policies(void);
39void socfpga_sdram_remap_zero(void);
40#endif
41
Ley Foon Tan4cc6b582018-05-24 00:17:23 +080042void do_bridge_reset(int enable);
43
Ley Foon Tanb149f2b2017-04-26 02:44:36 +080044#endif /* _MISC_H_ */