Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2014 Freescale Semiconductor, Inc. |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 4 | */ |
| 5 | |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 6 | #include <config.h> |
| 7 | |
| 8 | /* image version */ |
| 9 | |
| 10 | IMAGE_VERSION 2 |
| 11 | |
| 12 | /* |
| 13 | * Boot Device : one of |
| 14 | * spi/sd/nand/onenand, qspi/nor |
| 15 | */ |
| 16 | |
| 17 | BOOT_FROM sd |
| 18 | |
| 19 | /* |
Breno Matheus Lima | 4f46120 | 2019-06-13 21:10:56 +0000 | [diff] [blame] | 20 | * Secure boot support |
| 21 | */ |
Stefano Babic | f8b509b | 2019-09-20 08:47:53 +0200 | [diff] [blame] | 22 | #ifdef CONFIG_IMX_HAB |
Breno Matheus Lima | 4f46120 | 2019-06-13 21:10:56 +0000 | [diff] [blame] | 23 | CSF CONFIG_CSF_SIZE |
| 24 | #endif |
| 25 | |
| 26 | /* |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 27 | * Device Configuration Data (DCD) |
| 28 | * |
| 29 | * Each entry must have the format: |
| 30 | * Addr-type Address Value |
| 31 | * |
| 32 | * where: |
| 33 | * Addr-type register length (1,2 or 4 bytes) |
| 34 | * Address absolute address of the register |
| 35 | * value value to be stored in the register |
| 36 | */ |
| 37 | |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 38 | /* Enable all clocks */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 39 | DATA 4 0x020c4068 0xffffffff |
| 40 | DATA 4 0x020c406c 0xffffffff |
| 41 | DATA 4 0x020c4070 0xffffffff |
| 42 | DATA 4 0x020c4074 0xffffffff |
| 43 | DATA 4 0x020c4078 0xffffffff |
| 44 | DATA 4 0x020c407c 0xffffffff |
| 45 | DATA 4 0x020c4080 0xffffffff |
| 46 | DATA 4 0x020c4084 0xffffffff |
| 47 | |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 48 | /* IOMUX - DDR IO Type */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 49 | DATA 4 0x020e0618 0x000c0000 |
| 50 | DATA 4 0x020e05fc 0x00000000 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 51 | |
| 52 | /* Clock */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 53 | DATA 4 0x020e032c 0x00000030 |
| 54 | |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 55 | /* Address */ |
| 56 | DATA 4 0x020e0300 0x00000020 |
| 57 | DATA 4 0x020e02fc 0x00000020 |
| 58 | DATA 4 0x020e05f4 0x00000020 |
| 59 | |
| 60 | /* Control */ |
| 61 | DATA 4 0x020e0340 0x00000020 |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 62 | |
| 63 | DATA 4 0x020e0320 0x00000000 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 64 | DATA 4 0x020e0310 0x00000020 |
| 65 | DATA 4 0x020e0314 0x00000020 |
| 66 | DATA 4 0x020e0614 0x00000020 |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 67 | |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 68 | /* Data Strobe */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 69 | DATA 4 0x020e05f8 0x00020000 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 70 | DATA 4 0x020e0330 0x00000028 |
| 71 | DATA 4 0x020e0334 0x00000028 |
| 72 | DATA 4 0x020e0338 0x00000028 |
| 73 | DATA 4 0x020e033c 0x00000028 |
| 74 | |
| 75 | /* Data */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 76 | DATA 4 0x020e0608 0x00020000 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 77 | DATA 4 0x020e060c 0x00000028 |
| 78 | DATA 4 0x020e0610 0x00000028 |
| 79 | DATA 4 0x020e061c 0x00000028 |
| 80 | DATA 4 0x020e0620 0x00000028 |
| 81 | DATA 4 0x020e02ec 0x00000028 |
| 82 | DATA 4 0x020e02f0 0x00000028 |
| 83 | DATA 4 0x020e02f4 0x00000028 |
| 84 | DATA 4 0x020e02f8 0x00000028 |
| 85 | |
| 86 | /* Calibrations - ZQ */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 87 | DATA 4 0x021b0800 0xa1390003 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 88 | |
| 89 | /* Write leveling */ |
| 90 | DATA 4 0x021b080c 0x00290025 |
| 91 | DATA 4 0x021b0810 0x00220022 |
| 92 | |
| 93 | /* DQS Read Gate */ |
| 94 | DATA 4 0x021b083c 0x41480144 |
| 95 | DATA 4 0x021b0840 0x01340130 |
| 96 | |
| 97 | /* Read/Write Delay */ |
| 98 | DATA 4 0x021b0848 0x3C3E4244 |
| 99 | DATA 4 0x021b0850 0x34363638 |
| 100 | |
| 101 | /* Read data bit delay */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 102 | DATA 4 0x021b081c 0x33333333 |
| 103 | DATA 4 0x021b0820 0x33333333 |
| 104 | DATA 4 0x021b0824 0x33333333 |
| 105 | DATA 4 0x021b0828 0x33333333 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 106 | |
| 107 | /* Complete calibration by forced measurement */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 108 | DATA 4 0x021b08b8 0x00000800 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 109 | |
| 110 | /* MMDC init - DDR3, 64-bit mode, only MMDC0 is initiated */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 111 | DATA 4 0x021b0004 0x0002002d |
| 112 | DATA 4 0x021b0008 0x00333030 |
| 113 | DATA 4 0x021b000c 0x676b52f3 |
| 114 | DATA 4 0x021b0010 0xb66d8b63 |
| 115 | DATA 4 0x021b0014 0x01ff00db |
| 116 | DATA 4 0x021b0018 0x00011740 |
| 117 | DATA 4 0x021b001c 0x00008000 |
| 118 | DATA 4 0x021b002c 0x000026d2 |
| 119 | DATA 4 0x021b0030 0x006b1023 |
| 120 | DATA 4 0x021b0040 0x0000005f |
| 121 | DATA 4 0x021b0000 0x84190000 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 122 | |
| 123 | /* Initialize MT41K256M16HA-125 - MR2 */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 124 | DATA 4 0x021b001c 0x04008032 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 125 | /* MR3 */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 126 | DATA 4 0x021b001c 0x00008033 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 127 | /* MR1 */ |
| 128 | DATA 4 0x021b001c 0x00048031 |
| 129 | /* MR0 */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 130 | DATA 4 0x021b001c 0x05208030 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 131 | /* DDR device ZQ calibration */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 132 | DATA 4 0x021b001c 0x04008040 |
Fabio Estevam | 44beebb | 2014-08-15 01:00:48 -0300 | [diff] [blame] | 133 | |
| 134 | /* Final DDR setup, before operation start */ |
Fabio Estevam | b6936d7 | 2014-06-24 17:41:01 -0300 | [diff] [blame] | 135 | DATA 4 0x021b0020 0x00000800 |
| 136 | DATA 4 0x021b0818 0x00011117 |
| 137 | DATA 4 0x021b001c 0x00000000 |