Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2009 |
| 4 | * Stefano Babic, DENX Software Engineering, sbabic@denx.de. |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef _SYS_PROTO_H_ |
| 8 | #define _SYS_PROTO_H_ |
| 9 | |
Jagan Teki | e5f970b | 2017-02-24 15:45:12 +0530 | [diff] [blame] | 10 | #include <asm/io.h> |
Stefano Babic | 33731bc | 2017-06-29 10:16:06 +0200 | [diff] [blame] | 11 | #include <asm/mach-imx/regs-common.h> |
Peng Fan | 415f895 | 2020-05-01 22:08:34 +0800 | [diff] [blame] | 12 | #include <asm/mach-imx/module_fuse.h> |
Simon Glass | 1e26864 | 2020-05-10 11:39:55 -0600 | [diff] [blame] | 13 | #include <linux/bitops.h> |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 14 | #include "../arch-imx/cpu.h" |
| 15 | |
Simon Glass | 1e26864 | 2020-05-10 11:39:55 -0600 | [diff] [blame] | 16 | struct bd_info; |
| 17 | |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 18 | #define soc_rev() (get_cpu_rev() & 0xFF) |
| 19 | #define is_soc_rev(rev) (soc_rev() == rev) |
| 20 | |
| 21 | /* returns MXC_CPU_ value */ |
Peng Fan | 6e3a380 | 2020-02-05 17:44:28 +0800 | [diff] [blame] | 22 | #define cpu_type(rev) (((rev) >> 12) & 0x1ff) |
Adrian Alonso | 1eec27c | 2015-09-02 13:54:12 -0500 | [diff] [blame] | 23 | #define soc_type(rev) (((rev) >> 12) & 0xf0) |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 24 | /* both macros return/take MXC_CPU_ constants */ |
| 25 | #define get_cpu_type() (cpu_type(get_cpu_rev())) |
Adrian Alonso | 1eec27c | 2015-09-02 13:54:12 -0500 | [diff] [blame] | 26 | #define get_soc_type() (soc_type(get_cpu_rev())) |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 27 | #define is_cpu_type(cpu) (get_cpu_type() == cpu) |
Adrian Alonso | 1eec27c | 2015-09-02 13:54:12 -0500 | [diff] [blame] | 28 | #define is_soc_type(soc) (get_soc_type() == soc) |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 29 | |
Peng Fan | 1e4e762 | 2016-05-23 18:35:52 +0800 | [diff] [blame] | 30 | #define is_mx6() (is_soc_type(MXC_SOC_MX6)) |
| 31 | #define is_mx7() (is_soc_type(MXC_SOC_MX7)) |
Peng Fan | 39945c1 | 2018-11-20 10:19:25 +0000 | [diff] [blame] | 32 | #define is_imx8m() (is_soc_type(MXC_SOC_IMX8M)) |
Peng Fan | 36b6517 | 2018-10-18 14:28:16 +0200 | [diff] [blame] | 33 | #define is_imx8() (is_soc_type(MXC_SOC_IMX8)) |
Peng Fan | bbcd2c4 | 2022-07-26 16:40:39 +0800 | [diff] [blame] | 34 | #define is_imx9() (is_soc_type(MXC_SOC_IMX9)) |
Giulio Benetti | 3d1a573 | 2021-05-20 16:10:13 +0200 | [diff] [blame] | 35 | #define is_imxrt() (is_soc_type(MXC_SOC_IMXRT)) |
Peng Fan | 1e4e762 | 2016-05-23 18:35:52 +0800 | [diff] [blame] | 36 | |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 37 | #define is_mx6dqp() (is_cpu_type(MXC_CPU_MX6QP) || is_cpu_type(MXC_CPU_MX6DP)) |
Peng Fan | 1e4e762 | 2016-05-23 18:35:52 +0800 | [diff] [blame] | 38 | #define is_mx6dq() (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D)) |
| 39 | #define is_mx6sdl() (is_cpu_type(MXC_CPU_MX6SOLO) || is_cpu_type(MXC_CPU_MX6DL)) |
Jagan Teki | 0d6d48b | 2016-10-08 18:00:11 +0530 | [diff] [blame] | 40 | #define is_mx6dl() (is_cpu_type(MXC_CPU_MX6DL)) |
Peng Fan | 1e4e762 | 2016-05-23 18:35:52 +0800 | [diff] [blame] | 41 | #define is_mx6sx() (is_cpu_type(MXC_CPU_MX6SX)) |
| 42 | #define is_mx6sl() (is_cpu_type(MXC_CPU_MX6SL)) |
Jagan Teki | 0d6d48b | 2016-10-08 18:00:11 +0530 | [diff] [blame] | 43 | #define is_mx6solo() (is_cpu_type(MXC_CPU_MX6SOLO)) |
Peng Fan | 1e4e762 | 2016-05-23 18:35:52 +0800 | [diff] [blame] | 44 | #define is_mx6ul() (is_cpu_type(MXC_CPU_MX6UL)) |
Peng Fan | ad69a06 | 2020-02-05 20:17:17 +0800 | [diff] [blame] | 45 | #define is_mx6ull() (is_cpu_type(MXC_CPU_MX6ULL) || is_cpu_type(MXC_CPU_MX6ULZ)) |
Peng Fan | c53d0c9 | 2019-08-08 09:55:52 +0000 | [diff] [blame] | 46 | #define is_mx6ulz() (is_cpu_type(MXC_CPU_MX6ULZ)) |
Peng Fan | 4cfd797 | 2016-12-11 19:24:20 +0800 | [diff] [blame] | 47 | #define is_mx6sll() (is_cpu_type(MXC_CPU_MX6SLL)) |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 48 | |
Peng Fan | 98c5782 | 2017-02-22 16:21:46 +0800 | [diff] [blame] | 49 | #define is_mx7ulp() (is_cpu_type(MXC_CPU_MX7ULP)) |
| 50 | |
Peng Fan | 6781508 | 2020-02-05 17:34:54 +0800 | [diff] [blame] | 51 | #define is_imx8mq() (is_cpu_type(MXC_CPU_IMX8MQ) || is_cpu_type(MXC_CPU_IMX8MD) || is_cpu_type(MXC_CPU_IMX8MQL)) |
| 52 | #define is_imx8md() (is_cpu_type(MXC_CPU_IMX8MD)) |
| 53 | #define is_imx8mql() (is_cpu_type(MXC_CPU_IMX8MQL)) |
Peng Fan | 3e1d1ea | 2019-08-26 08:11:46 +0000 | [diff] [blame] | 54 | #define is_imx8qm() (is_cpu_type(MXC_CPU_IMX8QM)) |
Peng Fan | 5c2218a | 2021-08-07 16:00:31 +0800 | [diff] [blame] | 55 | #define is_imx8ulp() (is_cpu_type(MXC_CPU_IMX8ULP)) |
Peng Fan | 2d22a99 | 2019-08-27 06:25:04 +0000 | [diff] [blame] | 56 | #define is_imx8mm() (is_cpu_type(MXC_CPU_IMX8MM) || is_cpu_type(MXC_CPU_IMX8MML) ||\ |
| 57 | is_cpu_type(MXC_CPU_IMX8MMD) || is_cpu_type(MXC_CPU_IMX8MMDL) || \ |
| 58 | is_cpu_type(MXC_CPU_IMX8MMS) || is_cpu_type(MXC_CPU_IMX8MMSL)) |
| 59 | #define is_imx8mml() (is_cpu_type(MXC_CPU_IMX8MML)) |
| 60 | #define is_imx8mmd() (is_cpu_type(MXC_CPU_IMX8MMD)) |
| 61 | #define is_imx8mmdl() (is_cpu_type(MXC_CPU_IMX8MMDL)) |
| 62 | #define is_imx8mms() (is_cpu_type(MXC_CPU_IMX8MMS)) |
| 63 | #define is_imx8mmsl() (is_cpu_type(MXC_CPU_IMX8MMSL)) |
Peng Fan | 1a07d91 | 2020-02-05 17:39:27 +0800 | [diff] [blame] | 64 | #define is_imx8mn() (is_cpu_type(MXC_CPU_IMX8MN) || is_cpu_type(MXC_CPU_IMX8MND) || \ |
| 65 | is_cpu_type(MXC_CPU_IMX8MNS) || is_cpu_type(MXC_CPU_IMX8MNL) || \ |
Ye Li | 715180e | 2021-03-19 15:57:11 +0800 | [diff] [blame] | 66 | is_cpu_type(MXC_CPU_IMX8MNDL) || is_cpu_type(MXC_CPU_IMX8MNSL) || \ |
| 67 | is_cpu_type(MXC_CPU_IMX8MNUD) || is_cpu_type(MXC_CPU_IMX8MNUS) || is_cpu_type(MXC_CPU_IMX8MNUQ)) |
Peng Fan | 1a07d91 | 2020-02-05 17:39:27 +0800 | [diff] [blame] | 68 | #define is_imx8mnd() (is_cpu_type(MXC_CPU_IMX8MND)) |
| 69 | #define is_imx8mns() (is_cpu_type(MXC_CPU_IMX8MNS)) |
| 70 | #define is_imx8mnl() (is_cpu_type(MXC_CPU_IMX8MNL)) |
| 71 | #define is_imx8mndl() (is_cpu_type(MXC_CPU_IMX8MNDL)) |
| 72 | #define is_imx8mnsl() (is_cpu_type(MXC_CPU_IMX8MNSL)) |
Ye Li | 715180e | 2021-03-19 15:57:11 +0800 | [diff] [blame] | 73 | #define is_imx8mnuq() (is_cpu_type(MXC_CPU_IMX8MNUQ)) |
| 74 | #define is_imx8mnud() (is_cpu_type(MXC_CPU_IMX8MNUD)) |
| 75 | #define is_imx8mnus() (is_cpu_type(MXC_CPU_IMX8MNUS)) |
Ye Li | d2d754f | 2020-04-20 20:12:54 -0700 | [diff] [blame] | 76 | #define is_imx8mp() (is_cpu_type(MXC_CPU_IMX8MP) || is_cpu_type(MXC_CPU_IMX8MPD) || \ |
Peng Fan | 4d54f5b | 2022-04-07 15:55:51 +0800 | [diff] [blame] | 77 | is_cpu_type(MXC_CPU_IMX8MPL) || is_cpu_type(MXC_CPU_IMX8MP6) || is_cpu_type(MXC_CPU_IMX8MPUL)) |
Ye Li | d2d754f | 2020-04-20 20:12:54 -0700 | [diff] [blame] | 78 | #define is_imx8mpd() (is_cpu_type(MXC_CPU_IMX8MPD)) |
| 79 | #define is_imx8mpl() (is_cpu_type(MXC_CPU_IMX8MPL)) |
Ye Li | d2d754f | 2020-04-20 20:12:54 -0700 | [diff] [blame] | 80 | #define is_imx8mp6() (is_cpu_type(MXC_CPU_IMX8MP6)) |
Peng Fan | 4d54f5b | 2022-04-07 15:55:51 +0800 | [diff] [blame] | 81 | #define is_imx8mpul() (is_cpu_type(MXC_CPU_IMX8MPUL)) |
Peng Fan | 5d2f206 | 2019-06-27 17:23:49 +0800 | [diff] [blame] | 82 | |
Peng Fan | 36b6517 | 2018-10-18 14:28:16 +0200 | [diff] [blame] | 83 | #define is_imx8qxp() (is_cpu_type(MXC_CPU_IMX8QXP)) |
| 84 | |
Peng Fan | bbcd2c4 | 2022-07-26 16:40:39 +0800 | [diff] [blame] | 85 | #define is_imx93() (is_cpu_type(MXC_CPU_IMX93)) |
| 86 | |
Giulio Benetti | 3d1a573 | 2021-05-20 16:10:13 +0200 | [diff] [blame] | 87 | #define is_imxrt1020() (is_cpu_type(MXC_CPU_IMXRT1020)) |
| 88 | #define is_imxrt1050() (is_cpu_type(MXC_CPU_IMXRT1050)) |
| 89 | |
Jagan Teki | e5f970b | 2017-02-24 15:45:12 +0530 | [diff] [blame] | 90 | #ifdef CONFIG_MX6 |
Marek Vasut | 28c0b63 | 2020-08-05 15:34:04 +0200 | [diff] [blame] | 91 | #define IMX6_SRC_GPR10_BMODE BIT(28) |
Marek Vasut | 6b17c85 | 2020-08-05 15:34:05 +0200 | [diff] [blame] | 92 | #define IMX6_SRC_GPR10_PERSIST_SECONDARY_BOOT BIT(30) |
Jagan Teki | e5f970b | 2017-02-24 15:45:12 +0530 | [diff] [blame] | 93 | |
Jagan Teki | 32a7114 | 2017-02-24 15:45:14 +0530 | [diff] [blame] | 94 | #define IMX6_BMODE_MASK GENMASK(7, 0) |
Harald Seiler | 808c5d6 | 2021-12-01 10:02:54 +0100 | [diff] [blame] | 95 | #define IMX6_BMODE_SHIFT 4 |
| 96 | #define IMX6_BMODE_EIM_MASK BIT(3) |
| 97 | #define IMX6_BMODE_EIM_SHIFT 3 |
Jagan Teki | 32a7114 | 2017-02-24 15:45:14 +0530 | [diff] [blame] | 98 | #define IMX6_BMODE_SERIAL_ROM_MASK GENMASK(26, 24) |
| 99 | #define IMX6_BMODE_SERIAL_ROM_SHIFT 24 |
| 100 | |
| 101 | enum imx6_bmode_serial_rom { |
| 102 | IMX6_BMODE_ECSPI1, |
| 103 | IMX6_BMODE_ECSPI2, |
| 104 | IMX6_BMODE_ECSPI3, |
| 105 | IMX6_BMODE_ECSPI4, |
| 106 | IMX6_BMODE_ECSPI5, |
| 107 | IMX6_BMODE_I2C1, |
| 108 | IMX6_BMODE_I2C2, |
| 109 | IMX6_BMODE_I2C3, |
| 110 | }; |
| 111 | |
Harald Seiler | 808c5d6 | 2021-12-01 10:02:54 +0100 | [diff] [blame] | 112 | enum imx6_bmode_eim { |
Jagan Teki | 32a7114 | 2017-02-24 15:45:14 +0530 | [diff] [blame] | 113 | IMX6_BMODE_NOR, |
Lukasz Majewski | 3234ef3 | 2019-01-03 23:50:51 +0100 | [diff] [blame] | 114 | IMX6_BMODE_ONENAND, |
Jagan Teki | 32a7114 | 2017-02-24 15:45:14 +0530 | [diff] [blame] | 115 | }; |
| 116 | |
| 117 | enum imx6_bmode { |
Harald Seiler | 808c5d6 | 2021-12-01 10:02:54 +0100 | [diff] [blame] | 118 | IMX6_BMODE_EIM, |
Stefan Agner | 53456f5 | 2017-08-15 17:49:42 -0700 | [diff] [blame] | 119 | #if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL) |
| 120 | IMX6_BMODE_QSPI, |
| 121 | IMX6_BMODE_RESERVED, |
| 122 | #else |
| 123 | IMX6_BMODE_RESERVED, |
Jagan Teki | 32a7114 | 2017-02-24 15:45:14 +0530 | [diff] [blame] | 124 | IMX6_BMODE_SATA, |
Stefan Agner | 53456f5 | 2017-08-15 17:49:42 -0700 | [diff] [blame] | 125 | #endif |
Jagan Teki | 32a7114 | 2017-02-24 15:45:14 +0530 | [diff] [blame] | 126 | IMX6_BMODE_SERIAL_ROM, |
| 127 | IMX6_BMODE_SD, |
| 128 | IMX6_BMODE_ESD, |
| 129 | IMX6_BMODE_MMC, |
| 130 | IMX6_BMODE_EMMC, |
Eran Matityahu | 5fa7ca6 | 2017-12-14 20:20:02 +0200 | [diff] [blame] | 131 | IMX6_BMODE_NAND_MIN, |
| 132 | IMX6_BMODE_NAND_MAX = 0xf, |
Jagan Teki | 32a7114 | 2017-02-24 15:45:14 +0530 | [diff] [blame] | 133 | }; |
| 134 | |
Jagan Teki | e5f970b | 2017-02-24 15:45:12 +0530 | [diff] [blame] | 135 | u32 imx6_src_get_boot_mode(void); |
Breno Lima | f22b109 | 2017-08-24 10:00:16 -0300 | [diff] [blame] | 136 | void gpr_init(void); |
| 137 | |
Jagan Teki | e5f970b | 2017-02-24 15:45:12 +0530 | [diff] [blame] | 138 | #endif /* CONFIG_MX6 */ |
| 139 | |
Marek Vasut | 28c0b63 | 2020-08-05 15:34:04 +0200 | [diff] [blame] | 140 | #ifdef CONFIG_MX7 |
| 141 | #define IMX7_SRC_GPR10_BMODE BIT(28) |
Marek Vasut | 6b17c85 | 2020-08-05 15:34:05 +0200 | [diff] [blame] | 142 | #define IMX7_SRC_GPR10_PERSIST_SECONDARY_BOOT BIT(30) |
Marek Vasut | 28c0b63 | 2020-08-05 15:34:04 +0200 | [diff] [blame] | 143 | #endif |
| 144 | |
Igor Opaniuk | b65af98 | 2019-12-30 13:56:44 +0200 | [diff] [blame] | 145 | /* address translation table */ |
| 146 | struct rproc_att { |
| 147 | u32 da; /* device address (From Cortex M4 view) */ |
| 148 | u32 sa; /* system bus address */ |
| 149 | u32 size; /* size of reg range */ |
| 150 | }; |
| 151 | |
Marek Vasut | ddc5935 | 2022-12-13 05:46:07 +0100 | [diff] [blame] | 152 | const struct rproc_att *imx_bootaux_get_hostmap(void); |
| 153 | |
Peng Fan | 3698679 | 2019-09-16 03:09:31 +0000 | [diff] [blame] | 154 | struct rom_api { |
| 155 | u16 ver; |
| 156 | u16 tag; |
| 157 | u32 reserved1; |
| 158 | u32 (*download_image)(u8 *dest, u32 offset, u32 size, u32 xor); |
| 159 | u32 (*query_boot_infor)(u32 info_type, u32 *info, u32 xor); |
| 160 | }; |
| 161 | |
| 162 | enum boot_dev_type_e { |
| 163 | BT_DEV_TYPE_SD = 1, |
| 164 | BT_DEV_TYPE_MMC = 2, |
| 165 | BT_DEV_TYPE_NAND = 3, |
| 166 | BT_DEV_TYPE_FLEXSPINOR = 4, |
Marek Vasut | 31b3bc4 | 2022-03-25 18:59:28 +0100 | [diff] [blame] | 167 | BT_DEV_TYPE_SPI_NOR = 6, |
Peng Fan | 3698679 | 2019-09-16 03:09:31 +0000 | [diff] [blame] | 168 | |
| 169 | BT_DEV_TYPE_USB = 0xE, |
| 170 | BT_DEV_TYPE_MEM_DEV = 0xF, |
| 171 | |
| 172 | BT_DEV_TYPE_INVALID = 0xFF |
| 173 | }; |
| 174 | |
Ye Li | 504514b | 2023-02-03 18:21:47 +0800 | [diff] [blame^] | 175 | enum boot_stage_type { |
| 176 | BT_STAGE_PRIMARY = 0x6, |
| 177 | BT_STAGE_SECONDARY = 0x9, |
| 178 | BT_STAGE_RECOVERY = 0xa, |
| 179 | BT_STAGE_USB = 0x5, |
| 180 | }; |
| 181 | |
Peng Fan | 3698679 | 2019-09-16 03:09:31 +0000 | [diff] [blame] | 182 | #define QUERY_ROM_VER 1 |
| 183 | #define QUERY_BT_DEV 2 |
| 184 | #define QUERY_PAGE_SZ 3 |
| 185 | #define QUERY_IVT_OFF 4 |
| 186 | #define QUERY_BT_STAGE 5 |
| 187 | #define QUERY_IMG_OFF 6 |
| 188 | |
| 189 | #define ROM_API_OKAY 0xF0 |
| 190 | |
| 191 | extern struct rom_api *g_rom_api; |
Peng Fan | 5de0fc0 | 2022-07-26 16:40:48 +0800 | [diff] [blame] | 192 | extern unsigned long rom_pointer[]; |
| 193 | |
| 194 | ulong spl_romapi_raw_seekable_read(u32 offset, u32 size, void *buf); |
| 195 | ulong spl_romapi_get_uboot_base(u32 image_offset, u32 rom_bt_dev); |
Rasmus Villemoes | ae1a848 | 2022-06-20 10:53:19 +0200 | [diff] [blame] | 196 | |
| 197 | u32 rom_api_download_image(u8 *dest, u32 offset, u32 size); |
| 198 | u32 rom_api_query_boot_infor(u32 info_type, u32 *info); |
| 199 | |
Peng Fan | 101ef62 | 2021-08-07 16:00:32 +0800 | [diff] [blame] | 200 | /* For i.MX ULP */ |
| 201 | #define BT0CFG_LPBOOT_MASK 0x1 |
| 202 | #define BT0CFG_DUALBOOT_MASK 0x2 |
| 203 | |
| 204 | enum bt_mode { |
| 205 | LOW_POWER_BOOT, /* LP_BT = 1 */ |
| 206 | DUAL_BOOT, /* LP_BT = 0, DUAL_BT = 1 */ |
| 207 | SINGLE_BOOT /* LP_BT = 0, DUAL_BT = 0 */ |
| 208 | }; |
| 209 | |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 210 | u32 get_nr_cpus(void); |
| 211 | u32 get_cpu_rev(void); |
| 212 | u32 get_cpu_speed_grade_hz(void); |
| 213 | u32 get_cpu_temp_grade(int *minc, int *maxc); |
| 214 | const char *get_imx_type(u32 imxtype); |
| 215 | u32 imx_ddr_size(void); |
| 216 | void sdelay(unsigned long); |
| 217 | void set_chipselect_size(int const); |
| 218 | |
Adrian Alonso | ee7c4ca | 2015-09-02 13:54:15 -0500 | [diff] [blame] | 219 | void init_aips(void); |
| 220 | void init_src(void); |
Bryan O'Donoghue | 0290ea0 | 2018-04-05 19:46:06 +0100 | [diff] [blame] | 221 | void init_snvs(void); |
Fabio Estevam | 5f79d46 | 2017-11-23 10:55:33 -0200 | [diff] [blame] | 222 | void imx_wdog_disable_powerdown(void); |
Adrian Alonso | ee7c4ca | 2015-09-02 13:54:15 -0500 | [diff] [blame] | 223 | |
Marcel Ziswiler | a45585b | 2020-10-22 11:21:40 +0300 | [diff] [blame] | 224 | void board_mem_get_layout(u64 *phys_sdram_1_start, |
| 225 | u64 *phys_sdram_1_size, |
| 226 | u64 *phys_sdram_2_start, |
| 227 | u64 *phys_sdram_2_size); |
| 228 | |
Igor Opaniuk | cbee945 | 2019-12-03 14:04:47 +0200 | [diff] [blame] | 229 | int arch_auxiliary_core_check_up(u32 core_id); |
| 230 | |
Diego Dorta | 29f702e | 2017-09-21 15:10:03 -0300 | [diff] [blame] | 231 | int board_mmc_get_env_dev(int devno); |
| 232 | |
Fabio Estevam | 49bcdd7 | 2017-11-27 10:25:09 -0200 | [diff] [blame] | 233 | int nxp_board_rev(void); |
| 234 | char nxp_board_rev_string(void); |
| 235 | |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 236 | /* |
| 237 | * Initializes on-chip ethernet controllers. |
| 238 | * to override, implement board_eth_init() |
| 239 | */ |
Simon Glass | 1e26864 | 2020-05-10 11:39:55 -0600 | [diff] [blame] | 240 | int fecmxc_initialize(struct bd_info *bis); |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 241 | u32 get_ahb_clk(void); |
| 242 | u32 get_periph_clk(void); |
| 243 | |
Peng Fan | 5f8dbf5 | 2015-10-29 15:54:49 +0800 | [diff] [blame] | 244 | void lcdif_power_down(void); |
| 245 | |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 246 | int mxs_reset_block(struct mxs_register_32 *reg); |
| 247 | int mxs_wait_mask_set(struct mxs_register_32 *reg, u32 mask, u32 timeout); |
| 248 | int mxs_wait_mask_clr(struct mxs_register_32 *reg, u32 mask, u32 timeout); |
Peng Fan | aa3b907 | 2018-01-10 13:20:23 +0800 | [diff] [blame] | 249 | |
Peng Fan | 4de1128 | 2022-04-06 14:30:25 +0800 | [diff] [blame] | 250 | void board_late_mmc_env_init(void); |
| 251 | |
Peng Fan | aa3b907 | 2018-01-10 13:20:23 +0800 | [diff] [blame] | 252 | unsigned long call_imx_sip(unsigned long id, unsigned long reg0, |
Ye Li | e5e9109 | 2019-10-26 16:24:03 +0200 | [diff] [blame] | 253 | unsigned long reg1, unsigned long reg2, |
| 254 | unsigned long reg3); |
Peng Fan | a506009 | 2019-04-12 07:54:50 +0000 | [diff] [blame] | 255 | unsigned long call_imx_sip_ret2(unsigned long id, unsigned long reg0, |
| 256 | unsigned long *reg1, unsigned long reg2, |
| 257 | unsigned long reg3); |
Ye Li | 89e2f95 | 2020-05-03 22:41:19 +0800 | [diff] [blame] | 258 | |
| 259 | void imx_get_mac_from_fuse(int dev_id, unsigned char *mac); |
Sven Schwermer | 2645cfa | 2022-01-02 20:36:56 +0100 | [diff] [blame] | 260 | |
| 261 | #if defined(CONFIG_MX6) || defined(CONFIG_MX7) || defined(CONFIG_MX7ULP) |
| 262 | void enable_ca7_smp(void); |
| 263 | #endif |
| 264 | |
Peng Fan | 2040206 | 2022-07-26 16:40:36 +0800 | [diff] [blame] | 265 | enum boot_device get_boot_device(void); |
| 266 | |
Peng Fan | f664c14 | 2015-08-13 10:55:34 +0800 | [diff] [blame] | 267 | #endif |