]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/host-tools.git/blob - k3-bootswitch/boot_select/0001-HACK-Select-bootmode-and-reset.patch
Revert "TEMP changes"
[glsdk/host-tools.git] / k3-bootswitch / boot_select / 0001-HACK-Select-bootmode-and-reset.patch
1 From 1460609e82f980b58163bcb04968ba414fa47e57 Mon Sep 17 00:00:00 2001
2 From: Nikhil Devshatwar <nikhil.nd@ti.com>
3 Date: Tue, 7 Apr 2020 18:33:36 +0530
4 Subject: [PATCH] HACK: Select bootmode and reset
6 Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
7 ---
8  arch/arm/mach-k3/j721e_init.c | 28 ++++++++++++++++++++++++++++
9  1 file changed, 28 insertions(+)
11 diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
12 index b4ceb3b57f..d3865ad535 100644
13 --- a/arch/arm/mach-k3/j721e_init.c
14 +++ b/arch/arm/mach-k3/j721e_init.c
15 @@ -268,6 +268,34 @@ void board_init_f(ulong dummy)
16         /* Make all control module registers accessible */
17         ctrl_mmr_unlock();
18  
19 +#define MMC    0xdead0000
20 +#define EMMC   0xdead0001
21 +#define OSPI   0xdead0002
22 +#define UART   0xdead0003
23 +#define NOBOOT 0xdead0004
24 +#define BOOTMODE NOBOOT
25 +
26 +#if BOOTMODE == MMC
27 +       /* Set the boot mode to MMC/SD */
28 +       *((volatile uint8_t *)0x00100030) = 0x41;
29 +       *((volatile uint8_t *)0x43000030) = 0x00;
30 +#elif BOOTMODE == EMMC
31 +#elif BOOTMODE == OSPI
32 +       /* Set the boot mode to OSPI */
33 +       *((volatile uint8_t *)0x00100030) = 0x00;
34 +       *((volatile uint8_t *)0x43000030) = 0x08;
35 +#elif BOOTMODE == UART
36 +       /* Set the boot mode to UART */
37 +       *((volatile uint8_t *)0x00100030) = 0x00;
38 +       *((volatile uint8_t *)0x43000030) = 0x38;
39 +#elif BOOTMODE == NOBOOT
40 +       /* Set the boot mode to UART */
41 +       *((volatile uint8_t *)0x00100030) = 0x11;
42 +       *((volatile uint8_t *)0x43000030) = 0x38;
43 +#endif
44 +       /* Issue a system reset */
45 +       *((volatile uint32_t *)0x4301817C) = 0x60000;
46 +
47  #ifdef CONFIG_CPU_V7R
48         disable_linefill_optimization();
49         setup_k3_mpu_regions();
50 -- 
51 2.17.1