Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 2 | /* |
| 3 | * NAND boot for Freescale Integrated Flash Controller, NAND FCM |
| 4 | * |
| 5 | * Copyright 2011 Freescale Semiconductor, Inc. |
| 6 | * Author: Dipen Dudhat <dipen.dudhat@freescale.com> |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 7 | */ |
| 8 | |
Tom Rini | abb9a04 | 2024-05-18 20:20:43 -0600 | [diff] [blame] | 9 | #include <common.h> |
Simon Glass | 6333448 | 2019-11-14 12:57:39 -0700 | [diff] [blame] | 10 | #include <cpu_func.h> |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 11 | #include <asm/io.h> |
York Sun | 37562f6 | 2013-10-22 12:39:02 -0700 | [diff] [blame] | 12 | #include <fsl_ifc.h> |
Simon Glass | 655306c | 2020-05-10 11:39:58 -0600 | [diff] [blame] | 13 | #include <part.h> |
Masahiro Yamada | 2b7a873 | 2017-11-30 13:45:24 +0900 | [diff] [blame] | 14 | #include <linux/mtd/rawnand.h> |
Sumit Garg | f6d96cb | 2016-07-14 12:27:51 -0400 | [diff] [blame] | 15 | #ifdef CONFIG_CHAIN_OF_TRUST |
| 16 | #include <fsl_validate.h> |
| 17 | #endif |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 18 | |
| 19 | static inline int is_blank(uchar *addr, int page_size) |
| 20 | { |
| 21 | int i; |
| 22 | |
| 23 | for (i = 0; i < page_size; i++) { |
| 24 | if (__raw_readb(&addr[i]) != 0xff) |
| 25 | return 0; |
| 26 | } |
| 27 | |
| 28 | /* |
| 29 | * For the SPL, don't worry about uncorrectable errors |
| 30 | * where the main area is all FFs but shouldn't be. |
| 31 | */ |
| 32 | return 1; |
| 33 | } |
| 34 | |
| 35 | /* returns nonzero if entire page is blank */ |
| 36 | static inline int check_read_ecc(uchar *buf, u32 *eccstat, |
| 37 | unsigned int bufnum, int page_size) |
| 38 | { |
| 39 | u32 reg = eccstat[bufnum / 4]; |
| 40 | int errors = (reg >> ((3 - bufnum % 4) * 8)) & 0xf; |
| 41 | |
| 42 | if (errors == 0xf) { /* uncorrectable */ |
| 43 | /* Blank pages fail hw ECC checks */ |
| 44 | if (is_blank(buf, page_size)) |
| 45 | return 1; |
| 46 | |
| 47 | puts("ecc error\n"); |
| 48 | for (;;) |
| 49 | ; |
| 50 | } |
| 51 | |
| 52 | return 0; |
| 53 | } |
| 54 | |
Jaiprakash Singh | dd88806 | 2015-03-20 19:28:27 -0700 | [diff] [blame] | 55 | static inline struct fsl_ifc_runtime *runtime_regs_address(void) |
| 56 | { |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 57 | struct fsl_ifc regs = {(void *)CFG_SYS_IFC_ADDR, NULL}; |
Jaiprakash Singh | dd88806 | 2015-03-20 19:28:27 -0700 | [diff] [blame] | 58 | int ver = 0; |
| 59 | |
| 60 | ver = ifc_in32(®s.gregs->ifc_rev); |
| 61 | if (ver >= FSL_IFC_V2_0_0) |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 62 | regs.rregs = (void *)CFG_SYS_IFC_ADDR + IFC_RREGS_64KOFFSET; |
Jaiprakash Singh | dd88806 | 2015-03-20 19:28:27 -0700 | [diff] [blame] | 63 | else |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 64 | regs.rregs = (void *)CFG_SYS_IFC_ADDR + IFC_RREGS_4KOFFSET; |
Jaiprakash Singh | dd88806 | 2015-03-20 19:28:27 -0700 | [diff] [blame] | 65 | |
| 66 | return regs.rregs; |
| 67 | } |
| 68 | |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 69 | static inline void nand_wait(uchar *buf, int bufnum, int page_size) |
| 70 | { |
Jaiprakash Singh | dd88806 | 2015-03-20 19:28:27 -0700 | [diff] [blame] | 71 | struct fsl_ifc_runtime *ifc = runtime_regs_address(); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 72 | u32 status; |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 73 | u32 eccstat[8]; |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 74 | int bufperpage = page_size / 512; |
| 75 | int bufnum_end, i; |
| 76 | |
| 77 | bufnum *= bufperpage; |
| 78 | bufnum_end = bufnum + bufperpage - 1; |
| 79 | |
| 80 | do { |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 81 | status = ifc_in32(&ifc->ifc_nand.nand_evter_stat); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 82 | } while (!(status & IFC_NAND_EVTER_STAT_OPC)); |
| 83 | |
| 84 | if (status & IFC_NAND_EVTER_STAT_FTOER) { |
| 85 | puts("flash time out error\n"); |
| 86 | for (;;) |
| 87 | ; |
| 88 | } |
| 89 | |
| 90 | for (i = bufnum / 4; i <= bufnum_end / 4; i++) |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 91 | eccstat[i] = ifc_in32(&ifc->ifc_nand.nand_eccstat[i]); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 92 | |
| 93 | for (i = bufnum; i <= bufnum_end; i++) { |
| 94 | if (check_read_ecc(buf, eccstat, i, page_size)) |
| 95 | break; |
| 96 | } |
| 97 | |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 98 | ifc_out32(&ifc->ifc_nand.nand_evter_stat, status); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | static inline int bad_block(uchar *marker, int port_size) |
| 102 | { |
| 103 | if (port_size == 8) |
| 104 | return __raw_readb(marker) != 0xff; |
| 105 | else |
| 106 | return __raw_readw((u16 *)marker) != 0xffff; |
| 107 | } |
| 108 | |
Sean Anderson | 8805f9d | 2023-11-04 16:37:44 -0400 | [diff] [blame] | 109 | static int saved_page_size; |
| 110 | |
Po Liu | f6facca | 2014-01-10 10:10:58 +0800 | [diff] [blame] | 111 | int nand_spl_load_image(uint32_t offs, unsigned int uboot_size, void *vdst) |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 112 | { |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 113 | struct fsl_ifc_fcm *gregs = (void *)CFG_SYS_IFC_ADDR; |
Jaiprakash Singh | dd88806 | 2015-03-20 19:28:27 -0700 | [diff] [blame] | 114 | struct fsl_ifc_runtime *ifc = NULL; |
Tom Rini | b421349 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 115 | uchar *buf = (uchar *)CFG_SYS_NAND_BASE; |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 116 | int page_size; |
| 117 | int port_size; |
| 118 | int pages_per_blk; |
| 119 | int blk_size; |
| 120 | int bad_marker = 0; |
Prabhakar Kushwaha | 5c23a82 | 2014-06-14 08:48:19 +0530 | [diff] [blame] | 121 | int bufnum_mask, bufnum, ver = 0; |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 122 | |
| 123 | int csor, cspr; |
| 124 | int pos = 0; |
| 125 | int j = 0; |
| 126 | |
| 127 | int sram_addr; |
| 128 | int pg_no; |
Po Liu | f6facca | 2014-01-10 10:10:58 +0800 | [diff] [blame] | 129 | uchar *dst = vdst; |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 130 | |
Jaiprakash Singh | dd88806 | 2015-03-20 19:28:27 -0700 | [diff] [blame] | 131 | ifc = runtime_regs_address(); |
| 132 | |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 133 | /* Get NAND Flash configuration */ |
Tom Rini | b421349 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 134 | csor = CFG_SYS_NAND_CSOR; |
| 135 | cspr = CFG_SYS_NAND_CSPR; |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 136 | |
| 137 | port_size = (cspr & CSPR_PORT_SIZE_16) ? 16 : 8; |
| 138 | |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 139 | if ((csor & CSOR_NAND_PGS_MASK) == CSOR_NAND_PGS_8K) { |
| 140 | page_size = 8192; |
| 141 | bufnum_mask = 0x0; |
| 142 | } else if ((csor & CSOR_NAND_PGS_MASK) == CSOR_NAND_PGS_4K) { |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 143 | page_size = 4096; |
| 144 | bufnum_mask = 0x1; |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 145 | } else if ((csor & CSOR_NAND_PGS_MASK) == CSOR_NAND_PGS_2K) { |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 146 | page_size = 2048; |
| 147 | bufnum_mask = 0x3; |
| 148 | } else { |
| 149 | page_size = 512; |
| 150 | bufnum_mask = 0xf; |
| 151 | |
| 152 | if (port_size == 8) |
| 153 | bad_marker = 5; |
| 154 | } |
Sean Anderson | 8805f9d | 2023-11-04 16:37:44 -0400 | [diff] [blame] | 155 | saved_page_size = page_size; |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 156 | |
Jaiprakash Singh | dd88806 | 2015-03-20 19:28:27 -0700 | [diff] [blame] | 157 | ver = ifc_in32(&gregs->ifc_rev); |
Prabhakar Kushwaha | 5c23a82 | 2014-06-14 08:48:19 +0530 | [diff] [blame] | 158 | if (ver >= FSL_IFC_V2_0_0) |
| 159 | bufnum_mask = (bufnum_mask * 2) + 1; |
| 160 | |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 161 | pages_per_blk = |
| 162 | 32 << ((csor & CSOR_NAND_PB_MASK) >> CSOR_NAND_PB_SHIFT); |
| 163 | |
| 164 | blk_size = pages_per_blk * page_size; |
| 165 | |
| 166 | /* Open Full SRAM mapping for spare are access */ |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 167 | ifc_out32(&ifc->ifc_nand.ncfgr, 0x0); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 168 | |
| 169 | /* Clear Boot events */ |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 170 | ifc_out32(&ifc->ifc_nand.nand_evter_stat, 0xffffffff); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 171 | |
| 172 | /* Program FIR/FCR for Large/Small page */ |
| 173 | if (page_size > 512) { |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 174 | ifc_out32(&ifc->ifc_nand.nand_fir0, |
| 175 | (IFC_FIR_OP_CW0 << IFC_NAND_FIR0_OP0_SHIFT) | |
| 176 | (IFC_FIR_OP_CA0 << IFC_NAND_FIR0_OP1_SHIFT) | |
| 177 | (IFC_FIR_OP_RA0 << IFC_NAND_FIR0_OP2_SHIFT) | |
| 178 | (IFC_FIR_OP_CMD1 << IFC_NAND_FIR0_OP3_SHIFT) | |
| 179 | (IFC_FIR_OP_BTRD << IFC_NAND_FIR0_OP4_SHIFT)); |
| 180 | ifc_out32(&ifc->ifc_nand.nand_fir1, 0x0); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 181 | |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 182 | ifc_out32(&ifc->ifc_nand.nand_fcr0, |
| 183 | (NAND_CMD_READ0 << IFC_NAND_FCR0_CMD0_SHIFT) | |
| 184 | (NAND_CMD_READSTART << IFC_NAND_FCR0_CMD1_SHIFT)); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 185 | } else { |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 186 | ifc_out32(&ifc->ifc_nand.nand_fir0, |
| 187 | (IFC_FIR_OP_CW0 << IFC_NAND_FIR0_OP0_SHIFT) | |
| 188 | (IFC_FIR_OP_CA0 << IFC_NAND_FIR0_OP1_SHIFT) | |
| 189 | (IFC_FIR_OP_RA0 << IFC_NAND_FIR0_OP2_SHIFT) | |
| 190 | (IFC_FIR_OP_BTRD << IFC_NAND_FIR0_OP3_SHIFT)); |
| 191 | ifc_out32(&ifc->ifc_nand.nand_fir1, 0x0); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 192 | |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 193 | ifc_out32(&ifc->ifc_nand.nand_fcr0, |
| 194 | NAND_CMD_READ0 << IFC_NAND_FCR0_CMD0_SHIFT); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | /* Program FBCR = 0 for full page read */ |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 198 | ifc_out32(&ifc->ifc_nand.nand_fbcr, 0); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 199 | |
| 200 | /* Read and copy u-boot on SDRAM from NAND device, In parallel |
| 201 | * check for Bad block if found skip it and read continue to |
| 202 | * next Block |
| 203 | */ |
| 204 | while (pos < uboot_size) { |
| 205 | int i = 0; |
| 206 | do { |
| 207 | pg_no = offs / page_size; |
| 208 | bufnum = pg_no & bufnum_mask; |
| 209 | sram_addr = bufnum * page_size * 2; |
| 210 | |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 211 | ifc_out32(&ifc->ifc_nand.row0, pg_no); |
| 212 | ifc_out32(&ifc->ifc_nand.col0, 0); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 213 | /* start read */ |
Prabhakar Kushwaha | 62908c2 | 2014-01-18 12:28:30 +0530 | [diff] [blame] | 214 | ifc_out32(&ifc->ifc_nand.nandseq_strt, |
| 215 | IFC_NAND_SEQ_STRT_FIR_STRT); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 216 | |
| 217 | /* wait for read to complete */ |
| 218 | nand_wait(&buf[sram_addr], bufnum, page_size); |
| 219 | |
| 220 | /* |
| 221 | * If either of the first two pages are marked bad, |
| 222 | * continue to the next block. |
| 223 | */ |
| 224 | if (i++ < 2 && |
| 225 | bad_block(&buf[sram_addr + page_size + bad_marker], |
| 226 | port_size)) { |
| 227 | puts("skipping\n"); |
| 228 | offs = (offs + blk_size) & ~(blk_size - 1); |
| 229 | pos &= ~(blk_size - 1); |
| 230 | break; |
| 231 | } |
| 232 | |
| 233 | for (j = 0; j < page_size; j++) |
| 234 | dst[pos + j] = __raw_readb(&buf[sram_addr + j]); |
| 235 | |
| 236 | pos += page_size; |
| 237 | offs += page_size; |
| 238 | } while ((offs & (blk_size - 1)) && (pos < uboot_size)); |
| 239 | } |
Po Liu | f6facca | 2014-01-10 10:10:58 +0800 | [diff] [blame] | 240 | |
| 241 | return 0; |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 242 | } |
| 243 | |
| 244 | /* |
| 245 | * Main entrypoint for NAND Boot. It's necessary that SDRAM is already |
Bin Meng | 7557405 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 246 | * configured and available since this code loads the main U-Boot image |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 247 | * from NAND into SDRAM and starts from there. |
| 248 | */ |
| 249 | void nand_boot(void) |
| 250 | { |
| 251 | __attribute__((noreturn)) void (*uboot)(void); |
| 252 | /* |
| 253 | * Load U-Boot image from NAND into RAM |
| 254 | */ |
Po Liu | f6facca | 2014-01-10 10:10:58 +0800 | [diff] [blame] | 255 | nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS, |
Tom Rini | b421349 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 256 | CFG_SYS_NAND_U_BOOT_SIZE, |
| 257 | (uchar *)CFG_SYS_NAND_U_BOOT_DST); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 258 | |
| 259 | #ifdef CONFIG_NAND_ENV_DST |
Po Liu | f6facca | 2014-01-10 10:10:58 +0800 | [diff] [blame] | 260 | nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, |
| 261 | (uchar *)CONFIG_NAND_ENV_DST); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 262 | |
| 263 | #ifdef CONFIG_ENV_OFFSET_REDUND |
Po Liu | f6facca | 2014-01-10 10:10:58 +0800 | [diff] [blame] | 264 | nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE, |
| 265 | (uchar *)CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 266 | #endif |
| 267 | #endif |
| 268 | /* |
| 269 | * Jump to U-Boot image |
| 270 | */ |
| 271 | #ifdef CONFIG_SPL_FLUSH_IMAGE |
| 272 | /* |
| 273 | * Clean d-cache and invalidate i-cache, to |
| 274 | * make sure that no stale data is executed. |
| 275 | */ |
Tom Rini | b421349 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 276 | flush_cache(CFG_SYS_NAND_U_BOOT_DST, CFG_SYS_NAND_U_BOOT_SIZE); |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 277 | #endif |
Sumit Garg | f6d96cb | 2016-07-14 12:27:51 -0400 | [diff] [blame] | 278 | |
| 279 | #ifdef CONFIG_CHAIN_OF_TRUST |
| 280 | /* |
Michal Simek | 50fa118 | 2023-05-17 09:17:16 +0200 | [diff] [blame] | 281 | * U-Boot header is appended at end of U-Boot image, so |
| 282 | * calculate U-Boot header address using U-Boot header size. |
Sumit Garg | f6d96cb | 2016-07-14 12:27:51 -0400 | [diff] [blame] | 283 | */ |
Tom Rini | cb18926 | 2022-12-02 16:42:50 -0500 | [diff] [blame] | 284 | #define FSL_U_BOOT_HDR_ADDR \ |
Tom Rini | b421349 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 285 | ((CFG_SYS_NAND_U_BOOT_START + \ |
| 286 | CFG_SYS_NAND_U_BOOT_SIZE) - \ |
Tom Rini | cb18926 | 2022-12-02 16:42:50 -0500 | [diff] [blame] | 287 | FSL_U_BOOT_HDR_SIZE) |
| 288 | spl_validate_uboot(FSL_U_BOOT_HDR_ADDR, |
Tom Rini | b421349 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 289 | CFG_SYS_NAND_U_BOOT_START); |
Sumit Garg | f6d96cb | 2016-07-14 12:27:51 -0400 | [diff] [blame] | 290 | /* |
| 291 | * In case of failure in validation, spl_validate_uboot would |
| 292 | * not return back in case of Production environment with ITS=1. |
| 293 | * Thus U-Boot will not start. |
| 294 | * In Development environment (ITS=0 and SB_EN=1), the function |
| 295 | * may return back in case of non-fatal failures. |
| 296 | */ |
| 297 | #endif |
| 298 | |
Tom Rini | b421349 | 2022-11-12 17:36:51 -0500 | [diff] [blame] | 299 | uboot = (void *)CFG_SYS_NAND_U_BOOT_START; |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 300 | uboot(); |
| 301 | } |
Alison Wang | ab98bb5 | 2014-12-09 17:38:14 +0800 | [diff] [blame] | 302 | |
Tom Rini | 1a9f23d | 2022-05-26 14:31:57 -0400 | [diff] [blame] | 303 | #ifndef CONFIG_TPL_NAND_INIT |
Alison Wang | ab98bb5 | 2014-12-09 17:38:14 +0800 | [diff] [blame] | 304 | void nand_init(void) |
| 305 | { |
Sean Anderson | 8805f9d | 2023-11-04 16:37:44 -0400 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | unsigned int nand_page_size(void) |
| 309 | { |
| 310 | return saved_page_size; |
Alison Wang | ab98bb5 | 2014-12-09 17:38:14 +0800 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | void nand_deselect(void) |
| 314 | { |
| 315 | } |
| 316 | #endif |