Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Tom Warren | 41b6838 | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 2 | /* |
Tom Warren | ab0cc6b | 2015-03-04 16:36:00 -0700 | [diff] [blame] | 3 | * (C) Copyright 2010-2015 |
Tom Warren | 41b6838 | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 4 | * NVIDIA Corporation <www.nvidia.com> |
Tom Warren | 41b6838 | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
Tom Rini | 2f8362d | 2024-04-30 07:35:31 -0600 | [diff] [blame^] | 7 | #include <config.h> |
Simon Glass | 1d91ba7 | 2019-11-14 12:57:37 -0700 | [diff] [blame] | 8 | #include <cpu_func.h> |
Thomas Chou | e3b9026 | 2015-11-19 21:48:11 +0800 | [diff] [blame] | 9 | #include <dm.h> |
Simon Glass | 8e16b1e | 2019-12-28 10:45:05 -0700 | [diff] [blame] | 10 | #include <init.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 11 | #include <log.h> |
Thomas Chou | e3b9026 | 2015-11-19 21:48:11 +0800 | [diff] [blame] | 12 | #include <ns16550.h> |
Simon Glass | eec13c4 | 2015-05-13 07:02:29 -0600 | [diff] [blame] | 13 | #include <spl.h> |
Simon Glass | 274e0b0 | 2020-05-10 11:39:56 -0600 | [diff] [blame] | 14 | #include <asm/cache.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 15 | #include <asm/global_data.h> |
Tom Warren | 41b6838 | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 16 | #include <asm/io.h> |
Thierry Reding | 45ad0b0 | 2019-04-15 11:32:18 +0200 | [diff] [blame] | 17 | #if IS_ENABLED(CONFIG_TEGRA_CLKRST) |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 18 | #include <asm/arch/clock.h> |
Thierry Reding | 45ad0b0 | 2019-04-15 11:32:18 +0200 | [diff] [blame] | 19 | #endif |
Svyatoslav Ryhel | 1396110 | 2023-11-27 11:54:21 +0200 | [diff] [blame] | 20 | #if CONFIG_IS_ENABLED(PINCTRL_TEGRA) |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 21 | #include <asm/arch/funcmux.h> |
Thierry Reding | 7c0b150 | 2019-04-15 11:32:21 +0200 | [diff] [blame] | 22 | #endif |
Thierry Reding | 17987bb | 2019-04-15 11:32:20 +0200 | [diff] [blame] | 23 | #if IS_ENABLED(CONFIG_TEGRA_MC) |
Marcel Ziswiler | c5ecf27 | 2014-10-10 23:32:32 +0200 | [diff] [blame] | 24 | #include <asm/arch/mc.h> |
Thierry Reding | 17987bb | 2019-04-15 11:32:20 +0200 | [diff] [blame] | 25 | #endif |
Tom Warren | ab37196 | 2012-09-19 15:50:56 -0700 | [diff] [blame] | 26 | #include <asm/arch/tegra.h> |
Stephen Warren | 8d1fb31 | 2015-01-19 16:25:52 -0700 | [diff] [blame] | 27 | #include <asm/arch-tegra/ap.h> |
Lucas Stach | e80f7ca | 2012-09-29 10:02:08 +0000 | [diff] [blame] | 28 | #include <asm/arch-tegra/board.h> |
Thierry Reding | 7cef2b2 | 2019-04-15 11:32:28 +0200 | [diff] [blame] | 29 | #include <asm/arch-tegra/cboot.h> |
Tom Warren | ab37196 | 2012-09-19 15:50:56 -0700 | [diff] [blame] | 30 | #include <asm/arch-tegra/pmc.h> |
| 31 | #include <asm/arch-tegra/sys_proto.h> |
| 32 | #include <asm/arch-tegra/warmboot.h> |
Tom Warren | 41b6838 | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 33 | |
Tom Warren | 021a8bb | 2015-07-08 08:05:35 -0700 | [diff] [blame] | 34 | void save_boot_params_ret(void); |
| 35 | |
Tom Warren | 41b6838 | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 36 | DECLARE_GLOBAL_DATA_PTR; |
| 37 | |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 38 | enum { |
| 39 | /* UARTs which we can enable */ |
| 40 | UARTA = 1 << 0, |
| 41 | UARTB = 1 << 1, |
Tom Warren | e3d95bc | 2013-01-28 13:32:10 +0000 | [diff] [blame] | 42 | UARTC = 1 << 2, |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 43 | UARTD = 1 << 3, |
Tom Warren | e3d95bc | 2013-01-28 13:32:10 +0000 | [diff] [blame] | 44 | UARTE = 1 << 4, |
| 45 | UART_COUNT = 5, |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 46 | }; |
| 47 | |
Marek BehĂșn | 4bebdd3 | 2021-05-20 13:23:52 +0200 | [diff] [blame] | 48 | static bool from_spl __section(".data"); |
Simon Glass | eec13c4 | 2015-05-13 07:02:29 -0600 | [diff] [blame] | 49 | |
| 50 | #ifndef CONFIG_SPL_BUILD |
Thierry Reding | f6270a6 | 2019-04-15 11:32:23 +0200 | [diff] [blame] | 51 | void save_boot_params(unsigned long r0, unsigned long r1, unsigned long r2, |
| 52 | unsigned long r3) |
Simon Glass | eec13c4 | 2015-05-13 07:02:29 -0600 | [diff] [blame] | 53 | { |
| 54 | from_spl = r0 != UBOOT_NOT_LOADED_FROM_SPL; |
Thierry Reding | 7cef2b2 | 2019-04-15 11:32:28 +0200 | [diff] [blame] | 55 | |
| 56 | /* |
| 57 | * The logic for this is somewhat indirect. The purpose of the marker |
| 58 | * (UBOOT_NOT_LOADED_FROM_SPL) is in fact used to determine if U-Boot |
| 59 | * was loaded from a read-only instance of itself, which is something |
| 60 | * that can happen in secure boot setups. So basically the presence |
| 61 | * of the marker is an indication that U-Boot was loaded by one such |
| 62 | * special variant of U-Boot. Conversely, the absence of the marker |
| 63 | * indicates that this instance of U-Boot was loaded by something |
| 64 | * other than a special U-Boot. This could be SPL, but it could just |
| 65 | * as well be one of any number of other first stage bootloaders. |
| 66 | */ |
| 67 | if (from_spl) |
| 68 | cboot_save_boot_params(r0, r1, r2, r3); |
| 69 | |
Simon Glass | eec13c4 | 2015-05-13 07:02:29 -0600 | [diff] [blame] | 70 | save_boot_params_ret(); |
| 71 | } |
| 72 | #endif |
| 73 | |
| 74 | bool spl_was_boot_source(void) |
| 75 | { |
| 76 | return from_spl; |
| 77 | } |
| 78 | |
Stephen Warren | 8d1fb31 | 2015-01-19 16:25:52 -0700 | [diff] [blame] | 79 | #if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE) |
Stephen Warren | 8d1fb31 | 2015-01-19 16:25:52 -0700 | [diff] [blame] | 80 | bool tegra_cpu_is_non_secure(void) |
| 81 | { |
| 82 | /* |
| 83 | * This register reads 0xffffffff in non-secure mode. This register |
| 84 | * only implements bits 31:20, so the lower bits will always read 0 in |
| 85 | * secure mode. Thus, the lower bits are an indicator for secure vs. |
| 86 | * non-secure mode. |
| 87 | */ |
| 88 | struct mc_ctlr *mc = (struct mc_ctlr *)NV_PA_MC_BASE; |
| 89 | uint32_t mc_s_cfg0 = readl(&mc->mc_security_cfg0); |
| 90 | return (mc_s_cfg0 & 1) == 1; |
| 91 | } |
| 92 | #endif |
| 93 | |
Thierry Reding | 17987bb | 2019-04-15 11:32:20 +0200 | [diff] [blame] | 94 | #if IS_ENABLED(CONFIG_TEGRA_MC) |
Stephen Warren | 1b4af6b | 2014-07-02 14:12:30 -0600 | [diff] [blame] | 95 | /* Read the RAM size directly from the memory controller */ |
Stephen Warren | 6718af0 | 2015-08-07 16:12:44 -0600 | [diff] [blame] | 96 | static phys_size_t query_sdram_size(void) |
Stephen Warren | 1b4af6b | 2014-07-02 14:12:30 -0600 | [diff] [blame] | 97 | { |
| 98 | struct mc_ctlr *const mc = (struct mc_ctlr *)NV_PA_MC_BASE; |
Stephen Warren | 6718af0 | 2015-08-07 16:12:44 -0600 | [diff] [blame] | 99 | u32 emem_cfg; |
| 100 | phys_size_t size_bytes; |
Stephen Warren | 1b4af6b | 2014-07-02 14:12:30 -0600 | [diff] [blame] | 101 | |
Stephen Warren | 210bdb2 | 2014-12-23 10:34:50 -0700 | [diff] [blame] | 102 | emem_cfg = readl(&mc->mc_emem_cfg); |
Marcel Ziswiler | c5ecf27 | 2014-10-10 23:32:32 +0200 | [diff] [blame] | 103 | #if defined(CONFIG_TEGRA20) |
Stephen Warren | 210bdb2 | 2014-12-23 10:34:50 -0700 | [diff] [blame] | 104 | debug("mc->mc_emem_cfg (MEM_SIZE_KB) = 0x%08x\n", emem_cfg); |
| 105 | size_bytes = get_ram_size((void *)PHYS_SDRAM_1, emem_cfg * 1024); |
Marcel Ziswiler | c5ecf27 | 2014-10-10 23:32:32 +0200 | [diff] [blame] | 106 | #else |
Stephen Warren | 210bdb2 | 2014-12-23 10:34:50 -0700 | [diff] [blame] | 107 | debug("mc->mc_emem_cfg (MEM_SIZE_MB) = 0x%08x\n", emem_cfg); |
Stephen Warren | 6718af0 | 2015-08-07 16:12:44 -0600 | [diff] [blame] | 108 | #ifndef CONFIG_PHYS_64BIT |
Stephen Warren | c801805 | 2014-12-23 10:34:51 -0700 | [diff] [blame] | 109 | /* |
| 110 | * If >=4GB RAM is present, the byte RAM size won't fit into 32-bits |
| 111 | * and will wrap. Clip the reported size to the maximum that a 32-bit |
| 112 | * variable can represent (rounded to a page). |
| 113 | */ |
| 114 | if (emem_cfg >= 4096) { |
| 115 | size_bytes = U32_MAX & ~(0x1000 - 1); |
Stephen Warren | 6718af0 | 2015-08-07 16:12:44 -0600 | [diff] [blame] | 116 | } else |
| 117 | #endif |
| 118 | { |
Stephen Warren | c801805 | 2014-12-23 10:34:51 -0700 | [diff] [blame] | 119 | /* RAM size EMC is programmed to. */ |
Stephen Warren | 6718af0 | 2015-08-07 16:12:44 -0600 | [diff] [blame] | 120 | size_bytes = (phys_size_t)emem_cfg * 1024 * 1024; |
| 121 | #ifndef CONFIG_ARM64 |
Stephen Warren | c801805 | 2014-12-23 10:34:51 -0700 | [diff] [blame] | 122 | /* |
| 123 | * If all RAM fits within 32-bits, it can be accessed without |
| 124 | * LPAE, so go test the RAM size. Otherwise, we can't access |
| 125 | * all the RAM, and get_ram_size() would get confused, so |
| 126 | * avoid using it. There's no reason we should need this |
| 127 | * validation step anyway. |
| 128 | */ |
| 129 | if (emem_cfg <= (0 - PHYS_SDRAM_1) / (1024 * 1024)) |
| 130 | size_bytes = get_ram_size((void *)PHYS_SDRAM_1, |
| 131 | size_bytes); |
Stephen Warren | 6718af0 | 2015-08-07 16:12:44 -0600 | [diff] [blame] | 132 | #endif |
Stephen Warren | c801805 | 2014-12-23 10:34:51 -0700 | [diff] [blame] | 133 | } |
Marcel Ziswiler | c5ecf27 | 2014-10-10 23:32:32 +0200 | [diff] [blame] | 134 | #endif |
Stephen Warren | 1b4af6b | 2014-07-02 14:12:30 -0600 | [diff] [blame] | 135 | |
Marcel Ziswiler | c5ecf27 | 2014-10-10 23:32:32 +0200 | [diff] [blame] | 136 | #if defined(CONFIG_TEGRA30) || defined(CONFIG_TEGRA114) |
| 137 | /* External memory limited to 2047 MB due to IROM/HI-VEC */ |
Stephen Warren | 210bdb2 | 2014-12-23 10:34:50 -0700 | [diff] [blame] | 138 | if (size_bytes == SZ_2G) |
| 139 | size_bytes -= SZ_1M; |
Stephen Warren | 1b4af6b | 2014-07-02 14:12:30 -0600 | [diff] [blame] | 140 | #endif |
Tom Warren | 41b6838 | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 141 | |
Stephen Warren | 210bdb2 | 2014-12-23 10:34:50 -0700 | [diff] [blame] | 142 | return size_bytes; |
Marcel Ziswiler | c5ecf27 | 2014-10-10 23:32:32 +0200 | [diff] [blame] | 143 | } |
Thierry Reding | 17987bb | 2019-04-15 11:32:20 +0200 | [diff] [blame] | 144 | #endif |
Marcel Ziswiler | c5ecf27 | 2014-10-10 23:32:32 +0200 | [diff] [blame] | 145 | |
Tom Warren | 41b6838 | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 146 | int dram_init(void) |
| 147 | { |
Thierry Reding | 7cef2b2 | 2019-04-15 11:32:28 +0200 | [diff] [blame] | 148 | int err; |
| 149 | |
| 150 | /* try to initialize DRAM from cboot DTB first */ |
| 151 | err = cboot_dram_init(); |
| 152 | if (err == 0) |
| 153 | return 0; |
| 154 | |
Thierry Reding | 17987bb | 2019-04-15 11:32:20 +0200 | [diff] [blame] | 155 | #if IS_ENABLED(CONFIG_TEGRA_MC) |
Tom Warren | 41b6838 | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 156 | /* We do not initialise DRAM here. We just query the size */ |
Simon Glass | f6fcbbd | 2011-11-05 03:56:57 +0000 | [diff] [blame] | 157 | gd->ram_size = query_sdram_size(); |
Thierry Reding | 17987bb | 2019-04-15 11:32:20 +0200 | [diff] [blame] | 158 | #endif |
| 159 | |
Tom Warren | 41b6838 | 2011-01-27 10:58:05 +0000 | [diff] [blame] | 160 | return 0; |
| 161 | } |
| 162 | |
Svyatoslav Ryhel | 1396110 | 2023-11-27 11:54:21 +0200 | [diff] [blame] | 163 | #if CONFIG_IS_ENABLED(PINCTRL_TEGRA) |
Stephen Warren | 59f9010 | 2012-05-14 13:13:45 +0000 | [diff] [blame] | 164 | static int uart_configs[] = { |
Tom Warren | 61c6d0e | 2012-12-11 13:34:15 +0000 | [diff] [blame] | 165 | #if defined(CONFIG_TEGRA20) |
| 166 | #if defined(CONFIG_TEGRA_UARTA_UAA_UAB) |
Stephen Warren | 59f9010 | 2012-05-14 13:13:45 +0000 | [diff] [blame] | 167 | FUNCMUX_UART1_UAA_UAB, |
Tom Warren | 61c6d0e | 2012-12-11 13:34:15 +0000 | [diff] [blame] | 168 | #elif defined(CONFIG_TEGRA_UARTA_GPU) |
Stephen Warren | e4c01a8 | 2012-05-16 05:59:59 +0000 | [diff] [blame] | 169 | FUNCMUX_UART1_GPU, |
Tom Warren | 61c6d0e | 2012-12-11 13:34:15 +0000 | [diff] [blame] | 170 | #elif defined(CONFIG_TEGRA_UARTA_SDIO1) |
Lucas Stach | 4de6eec | 2012-05-16 08:21:02 +0000 | [diff] [blame] | 171 | FUNCMUX_UART1_SDIO1, |
Tom Warren | 61c6d0e | 2012-12-11 13:34:15 +0000 | [diff] [blame] | 172 | #else |
Stephen Warren | 59f9010 | 2012-05-14 13:13:45 +0000 | [diff] [blame] | 173 | FUNCMUX_UART1_IRRX_IRTX, |
Stephen Warren | 811af73 | 2013-01-22 06:20:08 +0000 | [diff] [blame] | 174 | #endif |
| 175 | FUNCMUX_UART2_UAD, |
Stephen Warren | 59f9010 | 2012-05-14 13:13:45 +0000 | [diff] [blame] | 176 | -1, |
| 177 | FUNCMUX_UART4_GMC, |
| 178 | -1, |
Tom Warren | e3d95bc | 2013-01-28 13:32:10 +0000 | [diff] [blame] | 179 | #elif defined(CONFIG_TEGRA30) |
Tom Warren | 61c6d0e | 2012-12-11 13:34:15 +0000 | [diff] [blame] | 180 | FUNCMUX_UART1_ULPI, /* UARTA */ |
| 181 | -1, |
| 182 | -1, |
| 183 | -1, |
| 184 | -1, |
Tom Warren | e5ffffd | 2014-01-24 12:46:16 -0700 | [diff] [blame] | 185 | #elif defined(CONFIG_TEGRA114) |
Tom Warren | e3d95bc | 2013-01-28 13:32:10 +0000 | [diff] [blame] | 186 | -1, |
| 187 | -1, |
| 188 | -1, |
| 189 | FUNCMUX_UART4_GMI, /* UARTD */ |
| 190 | -1, |
Tom Warren | ab0cc6b | 2015-03-04 16:36:00 -0700 | [diff] [blame] | 191 | #elif defined(CONFIG_TEGRA124) |
Tom Warren | e5ffffd | 2014-01-24 12:46:16 -0700 | [diff] [blame] | 192 | FUNCMUX_UART1_KBC, /* UARTA */ |
| 193 | -1, |
| 194 | -1, |
| 195 | FUNCMUX_UART4_GPIO, /* UARTD */ |
| 196 | -1, |
Tom Warren | ab0cc6b | 2015-03-04 16:36:00 -0700 | [diff] [blame] | 197 | #else /* Tegra210 */ |
| 198 | FUNCMUX_UART1_UART1, /* UARTA */ |
| 199 | -1, |
| 200 | -1, |
| 201 | FUNCMUX_UART4_UART4, /* UARTD */ |
| 202 | -1, |
Tom Warren | 61c6d0e | 2012-12-11 13:34:15 +0000 | [diff] [blame] | 203 | #endif |
Stephen Warren | 59f9010 | 2012-05-14 13:13:45 +0000 | [diff] [blame] | 204 | }; |
| 205 | |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 206 | /** |
| 207 | * Set up the specified uarts |
| 208 | * |
| 209 | * @param uarts_ids Mask containing UARTs to init (UARTx) |
| 210 | */ |
| 211 | static void setup_uarts(int uart_ids) |
| 212 | { |
| 213 | static enum periph_id id_for_uart[] = { |
| 214 | PERIPH_ID_UART1, |
| 215 | PERIPH_ID_UART2, |
| 216 | PERIPH_ID_UART3, |
| 217 | PERIPH_ID_UART4, |
Tom Warren | e3d95bc | 2013-01-28 13:32:10 +0000 | [diff] [blame] | 218 | PERIPH_ID_UART5, |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 219 | }; |
| 220 | size_t i; |
| 221 | |
| 222 | for (i = 0; i < UART_COUNT; i++) { |
| 223 | if (uart_ids & (1 << i)) { |
| 224 | enum periph_id id = id_for_uart[i]; |
| 225 | |
Stephen Warren | 59f9010 | 2012-05-14 13:13:45 +0000 | [diff] [blame] | 226 | funcmux_select(id, uart_configs[i]); |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 227 | clock_ll_start_uart(id); |
| 228 | } |
| 229 | } |
| 230 | } |
Thierry Reding | 7c0b150 | 2019-04-15 11:32:21 +0200 | [diff] [blame] | 231 | #endif |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 232 | |
| 233 | void board_init_uart_f(void) |
| 234 | { |
Svyatoslav Ryhel | 1396110 | 2023-11-27 11:54:21 +0200 | [diff] [blame] | 235 | #if CONFIG_IS_ENABLED(PINCTRL_TEGRA) |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 236 | int uart_ids = 0; /* bit mask of which UART ids to enable */ |
| 237 | |
Tom Warren | 22562a4 | 2012-09-04 17:00:24 -0700 | [diff] [blame] | 238 | #ifdef CONFIG_TEGRA_ENABLE_UARTA |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 239 | uart_ids |= UARTA; |
| 240 | #endif |
Tom Warren | 22562a4 | 2012-09-04 17:00:24 -0700 | [diff] [blame] | 241 | #ifdef CONFIG_TEGRA_ENABLE_UARTB |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 242 | uart_ids |= UARTB; |
| 243 | #endif |
Tom Warren | e3d95bc | 2013-01-28 13:32:10 +0000 | [diff] [blame] | 244 | #ifdef CONFIG_TEGRA_ENABLE_UARTC |
| 245 | uart_ids |= UARTC; |
| 246 | #endif |
Tom Warren | 22562a4 | 2012-09-04 17:00:24 -0700 | [diff] [blame] | 247 | #ifdef CONFIG_TEGRA_ENABLE_UARTD |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 248 | uart_ids |= UARTD; |
| 249 | #endif |
Tom Warren | e3d95bc | 2013-01-28 13:32:10 +0000 | [diff] [blame] | 250 | #ifdef CONFIG_TEGRA_ENABLE_UARTE |
| 251 | uart_ids |= UARTE; |
| 252 | #endif |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 253 | setup_uarts(uart_ids); |
Thierry Reding | 7c0b150 | 2019-04-15 11:32:21 +0200 | [diff] [blame] | 254 | #endif |
Simon Glass | 96b7c43 | 2011-11-28 15:04:39 +0000 | [diff] [blame] | 255 | } |
Simon Glass | 410012f | 2012-01-09 13:22:15 +0000 | [diff] [blame] | 256 | |
Simon Glass | f4402d0 | 2015-12-04 08:58:39 -0700 | [diff] [blame] | 257 | #if !CONFIG_IS_ENABLED(OF_CONTROL) |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 258 | static struct ns16550_plat ns16550_com1_pdata = { |
Tom Rini | df6a215 | 2022-11-16 13:10:28 -0500 | [diff] [blame] | 259 | .base = CFG_SYS_NS16550_COM1, |
Thomas Chou | e3b9026 | 2015-11-19 21:48:11 +0800 | [diff] [blame] | 260 | .reg_shift = 2, |
Tom Rini | df6a215 | 2022-11-16 13:10:28 -0500 | [diff] [blame] | 261 | .clock = CFG_SYS_NS16550_CLK, |
Heiko Schocher | 06f108e | 2017-01-18 08:05:49 +0100 | [diff] [blame] | 262 | .fcr = UART_FCR_DEFVAL, |
Thomas Chou | e3b9026 | 2015-11-19 21:48:11 +0800 | [diff] [blame] | 263 | }; |
| 264 | |
Simon Glass | 1d8364a | 2020-12-28 20:34:54 -0700 | [diff] [blame] | 265 | U_BOOT_DRVINFO(ns16550_com1) = { |
Thomas Chou | e3b9026 | 2015-11-19 21:48:11 +0800 | [diff] [blame] | 266 | "ns16550_serial", &ns16550_com1_pdata |
| 267 | }; |
| 268 | #endif |
| 269 | |
Trevor Woerner | 43ec7e0 | 2019-05-03 09:41:00 -0400 | [diff] [blame] | 270 | #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) && !defined(CONFIG_ARM64) |
Simon Glass | 410012f | 2012-01-09 13:22:15 +0000 | [diff] [blame] | 271 | void enable_caches(void) |
| 272 | { |
| 273 | /* Enable D-cache. I-cache is already enabled in start.S */ |
| 274 | dcache_enable(); |
| 275 | } |
| 276 | #endif |