blob: e504c1fd52a06e3cb5d0798373ed79b2695ea202 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Adrian Alonso2b3d9612015-09-02 13:54:19 -05002/*
3 * Copyright (C) 2015 Freescale Semiconductor, Inc.
Gaurav Jaine389ac92022-03-24 11:50:30 +05304 * Copyright 2021 NXP
Adrian Alonso2b3d9612015-09-02 13:54:19 -05005 */
6
Simon Glass97589732020-05-10 11:40:02 -06007#include <init.h>
Adrian Alonso2b3d9612015-09-02 13:54:19 -05008#include <asm/io.h>
9#include <asm/arch/imx-regs.h>
10#include <asm/arch/clock.h>
11#include <asm/arch/sys_proto.h>
Stefano Babic33731bc2017-06-29 10:16:06 +020012#include <asm/mach-imx/dma.h>
13#include <asm/mach-imx/hab.h>
14#include <asm/mach-imx/rdc-sema.h>
Peng Fan47842492016-01-28 16:55:09 +080015#include <asm/arch/imx-rdc.h>
Marek Vasut28c0b632020-08-05 15:34:04 +020016#include <asm/mach-imx/boot_mode.h>
Sven Schwermer2645cfa2022-01-02 20:36:56 +010017#include <asm/mach-imx/sys_proto.h>
Adrian Alonso2b3d9612015-09-02 13:54:19 -050018#include <asm/arch/crm_regs.h>
Tom Riniae21e7f2021-08-30 09:16:29 -040019#include <asm/bootm.h>
Adrian Alonso2b3d9612015-09-02 13:54:19 -050020#include <dm.h>
Simon Glass5e6201b2019-08-01 09:46:51 -060021#include <env.h>
Adrian Alonso2b3d9612015-09-02 13:54:19 -050022#include <imx_thermal.h>
Bryan O'Donoghue0cdded82018-03-26 15:27:32 +010023#include <asm/setup.h>
Simon Glassdbd79542020-05-10 11:40:11 -060024#include <linux/delay.h>
Adrian Alonso2b3d9612015-09-02 13:54:19 -050025
Anson Huang9d618542018-08-08 09:17:49 +080026#define IOMUXC_GPR1 0x4
27#define BM_IOMUXC_GPR1_IRQ 0x1000
28
29#define GPC_LPCR_A7_BSC 0x0
30#define GPC_LPCR_M4 0x8
31#define GPC_SLPCR 0x14
32#define GPC_PGC_ACK_SEL_A7 0x24
33#define GPC_IMR1_CORE0 0x30
34#define GPC_IMR1_CORE1 0x40
35#define GPC_IMR1_M4 0x50
36#define GPC_PGC_CPU_MAPPING 0xec
37#define GPC_PGC_C0_PUPSCR 0x804
38#define GPC_PGC_SCU_TIMING 0x890
39#define GPC_PGC_C1_PUPSCR 0x844
40
41#define BM_LPCR_A7_BSC_IRQ_SRC_A7_WAKEUP 0x70000000
42#define BM_LPCR_A7_BSC_CPU_CLK_ON_LPM 0x4000
43#define BM_LPCR_M4_MASK_DSM_TRIGGER 0x80000000
44#define BM_SLPCR_EN_DSM 0x80000000
45#define BM_SLPCR_RBC_EN 0x40000000
46#define BM_SLPCR_REG_BYPASS_COUNT 0x3f000000
47#define BM_SLPCR_VSTBY 0x4
48#define BM_SLPCR_SBYOS 0x2
49#define BM_SLPCR_BYPASS_PMIC_READY 0x1
50#define BM_SLPCR_EN_A7_FASTWUP_WAIT_MODE 0x10000
51
52#define BM_GPC_PGC_ACK_SEL_A7_DUMMY_PUP_ACK 0x80000000
53#define BM_GPC_PGC_ACK_SEL_A7_DUMMY_PDN_ACK 0x8000
54
55#define BM_GPC_PGC_CORE_PUPSCR 0x7fff80
56
Adrian Alonso2b3d9612015-09-02 13:54:19 -050057#if defined(CONFIG_IMX_THERMAL)
58static const struct imx_thermal_plat imx7_thermal_plat = {
59 .regs = (void *)ANATOP_BASE_ADDR,
60 .fuse_bank = 3,
61 .fuse_word = 3,
62};
63
Simon Glass1d8364a2020-12-28 20:34:54 -070064U_BOOT_DRVINFO(imx7_thermal) = {
Adrian Alonso2b3d9612015-09-02 13:54:19 -050065 .name = "imx_thermal",
Simon Glass71fa5b42020-12-03 16:55:18 -070066 .plat = &imx7_thermal_plat,
Adrian Alonso2b3d9612015-09-02 13:54:19 -050067};
68#endif
69
Peng Fan77d3aeb2017-08-12 22:10:57 +080070#if CONFIG_IS_ENABLED(IMX_RDC)
Peng Fan47842492016-01-28 16:55:09 +080071/*
72 * In current design, if any peripheral was assigned to both A7 and M4,
73 * it will receive ipg_stop or ipg_wait when any of the 2 platforms enter
74 * low power mode. So M4 sleep will cause some peripherals fail to work
75 * at A7 core side. At default, all resources are in domain 0 - 3.
76 *
77 * There are 26 peripherals impacted by this IC issue:
78 * SIM2(sim2/emvsim2)
79 * SIM1(sim1/emvsim1)
80 * UART1/UART2/UART3/UART4/UART5/UART6/UART7
81 * SAI1/SAI2/SAI3
82 * WDOG1/WDOG2/WDOG3/WDOG4
83 * GPT1/GPT2/GPT3/GPT4
84 * PWM1/PWM2/PWM3/PWM4
85 * ENET1/ENET2
86 * Software Workaround:
87 * Here we setup some resources to domain 0 where M4 codes will move
88 * the M4 out of this domain. Then M4 is not able to access them any longer.
89 * This is a workaround for ic issue. So the peripherals are not shared
90 * by them. This way requires the uboot implemented the RDC driver and
91 * set the 26 IPs above to domain 0 only. M4 code will assign resource
92 * to its own domain, if it want to use the resource.
93 */
94static rdc_peri_cfg_t const resources[] = {
95 (RDC_PER_SIM1 | RDC_DOMAIN(0)),
96 (RDC_PER_SIM2 | RDC_DOMAIN(0)),
97 (RDC_PER_UART1 | RDC_DOMAIN(0)),
98 (RDC_PER_UART2 | RDC_DOMAIN(0)),
99 (RDC_PER_UART3 | RDC_DOMAIN(0)),
100 (RDC_PER_UART4 | RDC_DOMAIN(0)),
101 (RDC_PER_UART5 | RDC_DOMAIN(0)),
102 (RDC_PER_UART6 | RDC_DOMAIN(0)),
103 (RDC_PER_UART7 | RDC_DOMAIN(0)),
104 (RDC_PER_SAI1 | RDC_DOMAIN(0)),
105 (RDC_PER_SAI2 | RDC_DOMAIN(0)),
106 (RDC_PER_SAI3 | RDC_DOMAIN(0)),
107 (RDC_PER_WDOG1 | RDC_DOMAIN(0)),
108 (RDC_PER_WDOG2 | RDC_DOMAIN(0)),
109 (RDC_PER_WDOG3 | RDC_DOMAIN(0)),
110 (RDC_PER_WDOG4 | RDC_DOMAIN(0)),
111 (RDC_PER_GPT1 | RDC_DOMAIN(0)),
112 (RDC_PER_GPT2 | RDC_DOMAIN(0)),
113 (RDC_PER_GPT3 | RDC_DOMAIN(0)),
114 (RDC_PER_GPT4 | RDC_DOMAIN(0)),
115 (RDC_PER_PWM1 | RDC_DOMAIN(0)),
116 (RDC_PER_PWM2 | RDC_DOMAIN(0)),
117 (RDC_PER_PWM3 | RDC_DOMAIN(0)),
118 (RDC_PER_PWM4 | RDC_DOMAIN(0)),
119 (RDC_PER_ENET1 | RDC_DOMAIN(0)),
120 (RDC_PER_ENET2 | RDC_DOMAIN(0)),
121};
122
123static void isolate_resource(void)
124{
125 imx_rdc_setup_peripherals(resources, ARRAY_SIZE(resources));
126}
127#endif
128
Stefano Babicf8b509b2019-09-20 08:47:53 +0200129#if defined(CONFIG_IMX_HAB)
Paul Geurtsdf0f95a2024-11-01 09:49:20 +0100130struct imx_fuse const imx_sec_config_fuse = {
Adrian Alonsofcc8cb32015-10-12 13:48:13 -0500131 .bank = 1,
132 .word = 3,
133};
Paul Geurtsfea40042024-11-01 09:49:21 +0100134
135struct imx_fuse const imx_field_return_fuse = {
136 .bank = 8,
137 .word = 3,
138};
Adrian Alonsofcc8cb32015-10-12 13:48:13 -0500139#endif
140
Fabio Estevamf6ced1b2016-02-28 12:33:17 -0300141static bool is_mx7d(void)
142{
143 struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
144 struct fuse_bank *bank = &ocotp->bank[1];
145 struct fuse_bank1_regs *fuse =
146 (struct fuse_bank1_regs *)bank->fuse_regs;
147 int val;
148
149 val = readl(&fuse->tester4);
150 if (val & 1)
151 return false;
152 else
153 return true;
154}
155
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500156u32 get_cpu_rev(void)
157{
158 struct mxc_ccm_anatop_reg *ccm_anatop = (struct mxc_ccm_anatop_reg *)
159 ANATOP_BASE_ADDR;
160 u32 reg = readl(&ccm_anatop->digprog);
161 u32 type = (reg >> 16) & 0xff;
162
Fabio Estevamf6ced1b2016-02-28 12:33:17 -0300163 if (!is_mx7d())
164 type = MXC_CPU_MX7S;
165
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500166 reg &= 0xff;
167 return (type << 12) | reg;
168}
169
170#ifdef CONFIG_REVISION_TAG
171u32 __weak get_board_rev(void)
172{
173 return get_cpu_rev();
174}
175#endif
176
Peng Faneb518d52016-01-04 13:16:41 +0800177static void imx_enet_mdio_fixup(void)
178{
179 struct iomuxc_gpr_base_regs *gpr_regs =
180 (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
181
182 /*
183 * The management data input/output (MDIO) requires open-drain,
184 * i.MX7D TO1.0 ENET MDIO pin has no open drain, but TO1.1 supports
185 * this feature. So to TO1.1, need to enable open drain by setting
186 * bits GPR0[8:7].
187 */
188
189 if (soc_rev() >= CHIP_REV_1_1) {
190 setbits_le32(&gpr_regs->gpr[0],
191 IOMUXC_GPR_GPR0_ENET_MDIO_OPEN_DRAIN_MASK);
192 }
193}
194
Jun Nie9b1c85a2019-05-08 14:38:30 +0800195static void init_cpu_basic(void)
196{
197 imx_enet_mdio_fixup();
198
199#ifdef CONFIG_APBH_DMA
200 /* Start APBH DMA */
201 mxs_dma_init();
202#endif
203}
204
Igor Opaniukb65af982019-12-30 13:56:44 +0200205#ifdef CONFIG_IMX_BOOTAUX
206/*
207 * Table of mappings of physical mem regions in both
208 * Cortex-A7 and Cortex-M4 address spaces.
209 *
210 * For additional details check sections 2.1.2 and 2.1.3 in
211 * i.MX7Dual Applications Processor Reference Manual
212 *
213 */
214const struct rproc_att hostmap[] = {
215 /* aux core , host core, size */
216 { 0x00000000, 0x00180000, 0x8000 }, /* OCRAM_S */
217 { 0x00180000, 0x00180000, 0x8000 }, /* OCRAM_S */
218 { 0x20180000, 0x00180000, 0x8000 }, /* OCRAM_S */
219 { 0x1fff8000, 0x007f8000, 0x8000 }, /* TCML */
220 { 0x20000000, 0x00800000, 0x8000 }, /* TCMU */
221 { 0x00900000, 0x00900000, 0x20000 }, /* OCRAM_128KB */
222 { 0x20200000, 0x00900000, 0x20000 }, /* OCRAM_128KB */
223 { 0x00920000, 0x00920000, 0x20000 }, /* OCRAM_EPDC */
224 { 0x20220000, 0x00920000, 0x20000 }, /* OCRAM_EPDC */
225 { 0x00940000, 0x00940000, 0x20000 }, /* OCRAM_PXP */
226 { 0x20240000, 0x00940000, 0x20000 }, /* OCRAM_PXP */
227 { 0x10000000, 0x80000000, 0x0fff0000 }, /* DDR Code alias */
Igor Opaniuk02239e22020-07-15 13:30:52 +0300228 { 0x80000000, 0x80000000, 0x60000000 }, /* DDRC */
Igor Opaniukb65af982019-12-30 13:56:44 +0200229 { /* sentinel */ }
230};
Marek Vasutddc59352022-12-13 05:46:07 +0100231
232const struct rproc_att *imx_bootaux_get_hostmap(void)
233{
234 return hostmap;
235}
Igor Opaniukb65af982019-12-30 13:56:44 +0200236#endif
237
Tom Rinie1e85442021-08-27 21:18:30 -0400238#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
Jun Nie9b1c85a2019-05-08 14:38:30 +0800239/* enable all periherial can be accessed in nosec mode */
240static void init_csu(void)
241{
242 int i = 0;
243
244 for (i = 0; i < CSU_NUM_REGS; i++)
245 writel(CSU_INIT_SEC_LEVEL0, CSU_IPS_BASE_ADDR + i * 4);
246}
247
Anson Huang9d618542018-08-08 09:17:49 +0800248static void imx_gpcv2_init(void)
249{
250 u32 val, i;
251
252 /*
253 * Force IOMUXC irq pending, so that the interrupt to GPC can be
254 * used to deassert dsm_request signal when the signal gets
255 * asserted unexpectedly.
256 */
257 val = readl(IOMUXC_GPR_BASE_ADDR + IOMUXC_GPR1);
258 val |= BM_IOMUXC_GPR1_IRQ;
259 writel(val, IOMUXC_GPR_BASE_ADDR + IOMUXC_GPR1);
260
261 /* Initially mask all interrupts */
262 for (i = 0; i < 4; i++) {
263 writel(~0, GPC_IPS_BASE_ADDR + GPC_IMR1_CORE0 + i * 4);
264 writel(~0, GPC_IPS_BASE_ADDR + GPC_IMR1_CORE1 + i * 4);
265 writel(~0, GPC_IPS_BASE_ADDR + GPC_IMR1_M4 + i * 4);
266 }
267
268 /* set SCU timing */
269 writel((0x59 << 10) | 0x5B | (0x2 << 20),
270 GPC_IPS_BASE_ADDR + GPC_PGC_SCU_TIMING);
271
272 /* only external IRQs to wake up LPM and core 0/1 */
273 val = readl(GPC_IPS_BASE_ADDR + GPC_LPCR_A7_BSC);
274 val |= BM_LPCR_A7_BSC_IRQ_SRC_A7_WAKEUP;
275 writel(val, GPC_IPS_BASE_ADDR + GPC_LPCR_A7_BSC);
276
277 /* set C0 power up timming per design requirement */
278 val = readl(GPC_IPS_BASE_ADDR + GPC_PGC_C0_PUPSCR);
279 val &= ~BM_GPC_PGC_CORE_PUPSCR;
280 val |= (0x1A << 7);
281 writel(val, GPC_IPS_BASE_ADDR + GPC_PGC_C0_PUPSCR);
282
283 /* set C1 power up timming per design requirement */
284 val = readl(GPC_IPS_BASE_ADDR + GPC_PGC_C1_PUPSCR);
285 val &= ~BM_GPC_PGC_CORE_PUPSCR;
286 val |= (0x1A << 7);
287 writel(val, GPC_IPS_BASE_ADDR + GPC_PGC_C1_PUPSCR);
288
289 /* dummy ack for time slot by default */
290 writel(BM_GPC_PGC_ACK_SEL_A7_DUMMY_PUP_ACK |
291 BM_GPC_PGC_ACK_SEL_A7_DUMMY_PDN_ACK,
292 GPC_IPS_BASE_ADDR + GPC_PGC_ACK_SEL_A7);
293
294 /* mask M4 DSM trigger */
295 writel(readl(GPC_IPS_BASE_ADDR + GPC_LPCR_M4) |
296 BM_LPCR_M4_MASK_DSM_TRIGGER,
297 GPC_IPS_BASE_ADDR + GPC_LPCR_M4);
298
299 /* set mega/fast mix in A7 domain */
300 writel(0x1, GPC_IPS_BASE_ADDR + GPC_PGC_CPU_MAPPING);
301
302 /* DSM related settings */
303 val = readl(GPC_IPS_BASE_ADDR + GPC_SLPCR);
304 val &= ~(BM_SLPCR_EN_DSM | BM_SLPCR_VSTBY | BM_SLPCR_RBC_EN |
305 BM_SLPCR_SBYOS | BM_SLPCR_BYPASS_PMIC_READY |
306 BM_SLPCR_REG_BYPASS_COUNT);
307 val |= BM_SLPCR_EN_A7_FASTWUP_WAIT_MODE;
308 writel(val, GPC_IPS_BASE_ADDR + GPC_SLPCR);
309
310 /*
311 * disabling RBC need to delay at least 2 cycles of CKIL(32K)
312 * due to hardware design requirement, which is
313 * ~61us, here we use 65us for safe
314 */
315 udelay(65);
316}
317
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500318int arch_cpu_init(void)
319{
320 init_aips();
321
Peng Fanfcd53ce2015-10-23 10:13:04 +0800322 init_csu();
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500323 /* Disable PDE bit of WMCR register */
Fabio Estevam5f79d462017-11-23 10:55:33 -0200324 imx_wdog_disable_powerdown();
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500325
Jun Nie9b1c85a2019-05-08 14:38:30 +0800326 init_cpu_basic();
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500327
Peng Fan77d3aeb2017-08-12 22:10:57 +0800328#if CONFIG_IS_ENABLED(IMX_RDC)
329 isolate_resource();
330#endif
Peng Fan47842492016-01-28 16:55:09 +0800331
Bryan O'Donoghue0290ea02018-04-05 19:46:06 +0100332 init_snvs();
333
Anson Huang9d618542018-08-08 09:17:49 +0800334 imx_gpcv2_init();
335
Sven Schwermer2645cfa2022-01-02 20:36:56 +0100336 enable_ca7_smp();
337
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500338 return 0;
339}
Jun Nie9b1c85a2019-05-08 14:38:30 +0800340#else
341int arch_cpu_init(void)
342{
343 init_cpu_basic();
344
345 return 0;
346}
Rui Miguel Silvad1bb7a02018-09-05 11:56:05 +0100347#endif
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500348
Stefan Agner42dac202016-07-13 00:25:39 -0700349#ifdef CONFIG_ARCH_MISC_INIT
350int arch_misc_init(void)
351{
352#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Tom Riniae21e7f2021-08-30 09:16:29 -0400353 struct tag_serialnr serialnr;
354 char serial_string[0x20];
355
Stefan Agner42dac202016-07-13 00:25:39 -0700356 if (is_mx7d())
Simon Glass6a38e412017-08-03 12:22:09 -0600357 env_set("soc", "imx7d");
Stefan Agner42dac202016-07-13 00:25:39 -0700358 else
Simon Glass6a38e412017-08-03 12:22:09 -0600359 env_set("soc", "imx7s");
Tom Riniae21e7f2021-08-30 09:16:29 -0400360
361 /* Set serial# standard environment variable based on OTP settings */
362 get_board_serial(&serialnr);
363 snprintf(serial_string, sizeof(serial_string), "0x%08x%08x",
364 serialnr.low, serialnr.high);
365 env_set("serial#", serial_string);
Stefan Agner42dac202016-07-13 00:25:39 -0700366#endif
367
Gaurav Jaine389ac92022-03-24 11:50:30 +0530368 if (IS_ENABLED(CONFIG_FSL_CAAM)) {
369 struct udevice *dev;
370 int ret;
371 ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
372 if (ret)
Ye Liec346892022-05-11 13:56:20 +0530373 printf("Failed to initialize caam_jr: %d\n", ret);
Gaurav Jaine389ac92022-03-24 11:50:30 +0530374 }
Bryan O'Donoghue1ec9d9d2018-01-26 16:27:58 +0000375
Stefan Agner42dac202016-07-13 00:25:39 -0700376 return 0;
377}
378#endif
379
Tom Riniae21e7f2021-08-30 09:16:29 -0400380#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Bryan O'Donoghue3031d432018-03-26 15:27:33 +0100381/*
382 * OCOTP_TESTER
383 * i.MX 7Solo Applications Processor Reference Manual, Rev. 0.1, 08/2016
384 * OCOTP_TESTER describes a unique ID based on silicon wafer
385 * and die X/Y position
386 *
387 * OCOTOP_TESTER offset 0x410
388 * 31:0 fuse 0
389 * FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID
390 *
391 * OCOTP_TESTER1 offset 0x420
392 * 31:24 fuse 1
393 * The X-coordinate of the die location on the wafer/SJC CHALLENGE/ Unique ID
394 * 23:16 fuse 1
395 * The Y-coordinate of the die location on the wafer/SJC CHALLENGE/ Unique ID
396 * 15:11 fuse 1
397 * The wafer number of the wafer on which the device was fabricated/SJC
398 * CHALLENGE/ Unique ID
399 * 10:0 fuse 1
400 * FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID
401 */
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500402void get_board_serial(struct tag_serialnr *serialnr)
403{
404 struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
405 struct fuse_bank *bank = &ocotp->bank[0];
406 struct fuse_bank0_regs *fuse =
407 (struct fuse_bank0_regs *)bank->fuse_regs;
408
409 serialnr->low = fuse->tester0;
410 serialnr->high = fuse->tester1;
411}
412#endif
413
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500414void set_wdog_reset(struct wdog_regs *wdog)
415{
416 u32 reg = readw(&wdog->wcr);
417 /*
418 * Output WDOG_B signal to reset external pmic or POR_B decided by
419 * the board desgin. Without external reset, the peripherals/DDR/
420 * PMIC are not reset, that may cause system working abnormal.
421 */
422 reg = readw(&wdog->wcr);
423 reg |= 1 << 3;
424 /*
425 * WDZST bit is write-once only bit. Align this bit in kernel,
426 * otherwise kernel code will have no chance to set this bit.
427 */
428 reg |= 1 << 0;
429 writew(reg, &wdog->wcr);
430}
431
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500432void s_init(void)
433{
Adrian Alonso2b3d9612015-09-02 13:54:19 -0500434 /* clock configuration. */
435 clock_init();
436
437 return;
438}
Peng Fan99c874b2016-05-19 13:02:16 +0800439
Simon Glass85ed77d2024-09-29 19:49:46 -0600440#ifndef CONFIG_XPL_BUILD
Marek Vasut28c0b632020-08-05 15:34:04 +0200441const struct boot_mode soc_boot_modes[] = {
442 {"normal", MAKE_CFGVAL(0x00, 0x00, 0x00, 0x00)},
Marek Vasut6b17c852020-08-05 15:34:05 +0200443 {"primary", MAKE_CFGVAL_PRIMARY_BOOT},
444 {"secondary", MAKE_CFGVAL_SECONDARY_BOOT},
Marek Vasut28c0b632020-08-05 15:34:04 +0200445 {NULL, 0},
446};
Marek Vasut56022382020-08-05 15:34:07 +0200447
448int boot_mode_getprisec(void)
449{
450 struct src *psrc = (struct src *)SRC_BASE_ADDR;
451
452 return !!(readl(&psrc->gpr10) & IMX7_SRC_GPR10_PERSIST_SECONDARY_BOOT);
453}
Marek Vasut28c0b632020-08-05 15:34:04 +0200454#endif
455
Peng Fan99c874b2016-05-19 13:02:16 +0800456void reset_misc(void)
457{
Simon Glass85ed77d2024-09-29 19:49:46 -0600458#ifndef CONFIG_XPL_BUILD
Simon Glass52cb5042022-10-18 07:46:31 -0600459#if defined(CONFIG_VIDEO_MXS) && !defined(CONFIG_VIDEO)
Peng Fan99c874b2016-05-19 13:02:16 +0800460 lcdif_power_down();
461#endif
Fabio Estevamad5fbe02018-12-11 16:40:37 -0200462#endif
Peng Fan99c874b2016-05-19 13:02:16 +0800463}