Commit b7d4259af298402b7d65c876d8e39e5b9e6c8934
Committed by
Lukasz Majewski
1 parent
711b931f90
Exists in
v2017.01-smarct4x
and in
40 other branches
dfu: mmc: change offset base handling
Previously offsets handled by dfu_fill_entity_mmc(), defined in boards' CONFIG_DFU_ALT were treated as hexadecimal regardless of their prefix, which sometimes led to confusion. This patch forces usage of explicit numerical base prefixes. Signed-off-by: Mateusz Zalega <m.zalega@samsung.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Tom Rini <trini@ti.com> Cc: Minkyu Kang <mk7.kang@samsung.com>
Showing 4 changed files with 14 additions and 10 deletions Inline Diff
drivers/dfu/dfu_mmc.c
1 | /* | 1 | /* |
2 | * dfu.c -- DFU back-end routines | 2 | * dfu.c -- DFU back-end routines |
3 | * | 3 | * |
4 | * Copyright (C) 2012 Samsung Electronics | 4 | * Copyright (C) 2012 Samsung Electronics |
5 | * author: Lukasz Majewski <l.majewski@samsung.com> | 5 | * author: Lukasz Majewski <l.majewski@samsung.com> |
6 | * | 6 | * |
7 | * SPDX-License-Identifier: GPL-2.0+ | 7 | * SPDX-License-Identifier: GPL-2.0+ |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <common.h> | 10 | #include <common.h> |
11 | #include <malloc.h> | 11 | #include <malloc.h> |
12 | #include <errno.h> | 12 | #include <errno.h> |
13 | #include <div64.h> | 13 | #include <div64.h> |
14 | #include <dfu.h> | 14 | #include <dfu.h> |
15 | #include <mmc.h> | 15 | #include <mmc.h> |
16 | 16 | ||
17 | static unsigned char __aligned(CONFIG_SYS_CACHELINE_SIZE) | 17 | static unsigned char __aligned(CONFIG_SYS_CACHELINE_SIZE) |
18 | dfu_file_buf[CONFIG_SYS_DFU_MAX_FILE_SIZE]; | 18 | dfu_file_buf[CONFIG_SYS_DFU_MAX_FILE_SIZE]; |
19 | static long dfu_file_buf_len; | 19 | static long dfu_file_buf_len; |
20 | 20 | ||
21 | static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu, | 21 | static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu, |
22 | u64 offset, void *buf, long *len) | 22 | u64 offset, void *buf, long *len) |
23 | { | 23 | { |
24 | struct mmc *mmc = find_mmc_device(dfu->dev_num); | 24 | struct mmc *mmc = find_mmc_device(dfu->dev_num); |
25 | u32 blk_start, blk_count, n = 0; | 25 | u32 blk_start, blk_count, n = 0; |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * We must ensure that we work in lba_blk_size chunks, so ALIGN | 28 | * We must ensure that we work in lba_blk_size chunks, so ALIGN |
29 | * this value. | 29 | * this value. |
30 | */ | 30 | */ |
31 | *len = ALIGN(*len, dfu->data.mmc.lba_blk_size); | 31 | *len = ALIGN(*len, dfu->data.mmc.lba_blk_size); |
32 | 32 | ||
33 | blk_start = dfu->data.mmc.lba_start + | 33 | blk_start = dfu->data.mmc.lba_start + |
34 | (u32)lldiv(offset, dfu->data.mmc.lba_blk_size); | 34 | (u32)lldiv(offset, dfu->data.mmc.lba_blk_size); |
35 | blk_count = *len / dfu->data.mmc.lba_blk_size; | 35 | blk_count = *len / dfu->data.mmc.lba_blk_size; |
36 | if (blk_start + blk_count > | 36 | if (blk_start + blk_count > |
37 | dfu->data.mmc.lba_start + dfu->data.mmc.lba_size) { | 37 | dfu->data.mmc.lba_start + dfu->data.mmc.lba_size) { |
38 | puts("Request would exceed designated area!\n"); | 38 | puts("Request would exceed designated area!\n"); |
39 | return -EINVAL; | 39 | return -EINVAL; |
40 | } | 40 | } |
41 | 41 | ||
42 | debug("%s: %s dev: %d start: %d cnt: %d buf: 0x%p\n", __func__, | 42 | debug("%s: %s dev: %d start: %d cnt: %d buf: 0x%p\n", __func__, |
43 | op == DFU_OP_READ ? "MMC READ" : "MMC WRITE", dfu->dev_num, | 43 | op == DFU_OP_READ ? "MMC READ" : "MMC WRITE", dfu->dev_num, |
44 | blk_start, blk_count, buf); | 44 | blk_start, blk_count, buf); |
45 | switch (op) { | 45 | switch (op) { |
46 | case DFU_OP_READ: | 46 | case DFU_OP_READ: |
47 | n = mmc->block_dev.block_read(dfu->dev_num, blk_start, | 47 | n = mmc->block_dev.block_read(dfu->dev_num, blk_start, |
48 | blk_count, buf); | 48 | blk_count, buf); |
49 | break; | 49 | break; |
50 | case DFU_OP_WRITE: | 50 | case DFU_OP_WRITE: |
51 | n = mmc->block_dev.block_write(dfu->dev_num, blk_start, | 51 | n = mmc->block_dev.block_write(dfu->dev_num, blk_start, |
52 | blk_count, buf); | 52 | blk_count, buf); |
53 | break; | 53 | break; |
54 | default: | 54 | default: |
55 | error("Operation not supported\n"); | 55 | error("Operation not supported\n"); |
56 | } | 56 | } |
57 | 57 | ||
58 | if (n != blk_count) { | 58 | if (n != blk_count) { |
59 | error("MMC operation failed"); | 59 | error("MMC operation failed"); |
60 | return -EIO; | 60 | return -EIO; |
61 | } | 61 | } |
62 | 62 | ||
63 | return 0; | 63 | return 0; |
64 | } | 64 | } |
65 | 65 | ||
66 | static int mmc_file_buffer(struct dfu_entity *dfu, void *buf, long *len) | 66 | static int mmc_file_buffer(struct dfu_entity *dfu, void *buf, long *len) |
67 | { | 67 | { |
68 | if (dfu_file_buf_len + *len > CONFIG_SYS_DFU_MAX_FILE_SIZE) { | 68 | if (dfu_file_buf_len + *len > CONFIG_SYS_DFU_MAX_FILE_SIZE) { |
69 | dfu_file_buf_len = 0; | 69 | dfu_file_buf_len = 0; |
70 | return -EINVAL; | 70 | return -EINVAL; |
71 | } | 71 | } |
72 | 72 | ||
73 | /* Add to the current buffer. */ | 73 | /* Add to the current buffer. */ |
74 | memcpy(dfu_file_buf + dfu_file_buf_len, buf, *len); | 74 | memcpy(dfu_file_buf + dfu_file_buf_len, buf, *len); |
75 | dfu_file_buf_len += *len; | 75 | dfu_file_buf_len += *len; |
76 | 76 | ||
77 | return 0; | 77 | return 0; |
78 | } | 78 | } |
79 | 79 | ||
80 | static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu, | 80 | static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu, |
81 | void *buf, long *len) | 81 | void *buf, long *len) |
82 | { | 82 | { |
83 | char cmd_buf[DFU_CMD_BUF_SIZE]; | 83 | char cmd_buf[DFU_CMD_BUF_SIZE]; |
84 | char *str_env; | 84 | char *str_env; |
85 | int ret; | 85 | int ret; |
86 | 86 | ||
87 | switch (dfu->layout) { | 87 | switch (dfu->layout) { |
88 | case DFU_FS_FAT: | 88 | case DFU_FS_FAT: |
89 | sprintf(cmd_buf, "fat%s mmc %d:%d 0x%x %s", | 89 | sprintf(cmd_buf, "fat%s mmc %d:%d 0x%x %s", |
90 | op == DFU_OP_READ ? "load" : "write", | 90 | op == DFU_OP_READ ? "load" : "write", |
91 | dfu->data.mmc.dev, dfu->data.mmc.part, | 91 | dfu->data.mmc.dev, dfu->data.mmc.part, |
92 | (unsigned int) buf, dfu->name); | 92 | (unsigned int) buf, dfu->name); |
93 | break; | 93 | break; |
94 | case DFU_FS_EXT4: | 94 | case DFU_FS_EXT4: |
95 | sprintf(cmd_buf, "ext4%s mmc %d:%d 0x%x /%s", | 95 | sprintf(cmd_buf, "ext4%s mmc %d:%d 0x%x /%s", |
96 | op == DFU_OP_READ ? "load" : "write", | 96 | op == DFU_OP_READ ? "load" : "write", |
97 | dfu->data.mmc.dev, dfu->data.mmc.part, | 97 | dfu->data.mmc.dev, dfu->data.mmc.part, |
98 | (unsigned int) buf, dfu->name); | 98 | (unsigned int) buf, dfu->name); |
99 | break; | 99 | break; |
100 | default: | 100 | default: |
101 | printf("%s: Layout (%s) not (yet) supported!\n", __func__, | 101 | printf("%s: Layout (%s) not (yet) supported!\n", __func__, |
102 | dfu_get_layout(dfu->layout)); | 102 | dfu_get_layout(dfu->layout)); |
103 | return -1; | 103 | return -1; |
104 | } | 104 | } |
105 | 105 | ||
106 | if (op == DFU_OP_WRITE) | 106 | if (op == DFU_OP_WRITE) |
107 | sprintf(cmd_buf + strlen(cmd_buf), " %lx", *len); | 107 | sprintf(cmd_buf + strlen(cmd_buf), " %lx", *len); |
108 | 108 | ||
109 | debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf); | 109 | debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf); |
110 | 110 | ||
111 | ret = run_command(cmd_buf, 0); | 111 | ret = run_command(cmd_buf, 0); |
112 | if (ret) { | 112 | if (ret) { |
113 | puts("dfu: Read error!\n"); | 113 | puts("dfu: Read error!\n"); |
114 | return ret; | 114 | return ret; |
115 | } | 115 | } |
116 | 116 | ||
117 | if (dfu->layout != DFU_RAW_ADDR && op == DFU_OP_READ) { | 117 | if (dfu->layout != DFU_RAW_ADDR && op == DFU_OP_READ) { |
118 | str_env = getenv("filesize"); | 118 | str_env = getenv("filesize"); |
119 | if (str_env == NULL) { | 119 | if (str_env == NULL) { |
120 | puts("dfu: Wrong file size!\n"); | 120 | puts("dfu: Wrong file size!\n"); |
121 | return -1; | 121 | return -1; |
122 | } | 122 | } |
123 | *len = simple_strtoul(str_env, NULL, 16); | 123 | *len = simple_strtoul(str_env, NULL, 16); |
124 | } | 124 | } |
125 | 125 | ||
126 | return ret; | 126 | return ret; |
127 | } | 127 | } |
128 | 128 | ||
129 | int dfu_write_medium_mmc(struct dfu_entity *dfu, | 129 | int dfu_write_medium_mmc(struct dfu_entity *dfu, |
130 | u64 offset, void *buf, long *len) | 130 | u64 offset, void *buf, long *len) |
131 | { | 131 | { |
132 | int ret = -1; | 132 | int ret = -1; |
133 | 133 | ||
134 | switch (dfu->layout) { | 134 | switch (dfu->layout) { |
135 | case DFU_RAW_ADDR: | 135 | case DFU_RAW_ADDR: |
136 | ret = mmc_block_op(DFU_OP_WRITE, dfu, offset, buf, len); | 136 | ret = mmc_block_op(DFU_OP_WRITE, dfu, offset, buf, len); |
137 | break; | 137 | break; |
138 | case DFU_FS_FAT: | 138 | case DFU_FS_FAT: |
139 | case DFU_FS_EXT4: | 139 | case DFU_FS_EXT4: |
140 | ret = mmc_file_buffer(dfu, buf, len); | 140 | ret = mmc_file_buffer(dfu, buf, len); |
141 | break; | 141 | break; |
142 | default: | 142 | default: |
143 | printf("%s: Layout (%s) not (yet) supported!\n", __func__, | 143 | printf("%s: Layout (%s) not (yet) supported!\n", __func__, |
144 | dfu_get_layout(dfu->layout)); | 144 | dfu_get_layout(dfu->layout)); |
145 | } | 145 | } |
146 | 146 | ||
147 | return ret; | 147 | return ret; |
148 | } | 148 | } |
149 | 149 | ||
150 | int dfu_flush_medium_mmc(struct dfu_entity *dfu) | 150 | int dfu_flush_medium_mmc(struct dfu_entity *dfu) |
151 | { | 151 | { |
152 | int ret = 0; | 152 | int ret = 0; |
153 | 153 | ||
154 | if (dfu->layout != DFU_RAW_ADDR) { | 154 | if (dfu->layout != DFU_RAW_ADDR) { |
155 | /* Do stuff here. */ | 155 | /* Do stuff here. */ |
156 | ret = mmc_file_op(DFU_OP_WRITE, dfu, &dfu_file_buf, | 156 | ret = mmc_file_op(DFU_OP_WRITE, dfu, &dfu_file_buf, |
157 | &dfu_file_buf_len); | 157 | &dfu_file_buf_len); |
158 | 158 | ||
159 | /* Now that we're done */ | 159 | /* Now that we're done */ |
160 | dfu_file_buf_len = 0; | 160 | dfu_file_buf_len = 0; |
161 | } | 161 | } |
162 | 162 | ||
163 | return ret; | 163 | return ret; |
164 | } | 164 | } |
165 | 165 | ||
166 | int dfu_read_medium_mmc(struct dfu_entity *dfu, u64 offset, void *buf, | 166 | int dfu_read_medium_mmc(struct dfu_entity *dfu, u64 offset, void *buf, |
167 | long *len) | 167 | long *len) |
168 | { | 168 | { |
169 | int ret = -1; | 169 | int ret = -1; |
170 | 170 | ||
171 | switch (dfu->layout) { | 171 | switch (dfu->layout) { |
172 | case DFU_RAW_ADDR: | 172 | case DFU_RAW_ADDR: |
173 | ret = mmc_block_op(DFU_OP_READ, dfu, offset, buf, len); | 173 | ret = mmc_block_op(DFU_OP_READ, dfu, offset, buf, len); |
174 | break; | 174 | break; |
175 | case DFU_FS_FAT: | 175 | case DFU_FS_FAT: |
176 | case DFU_FS_EXT4: | 176 | case DFU_FS_EXT4: |
177 | ret = mmc_file_op(DFU_OP_READ, dfu, buf, len); | 177 | ret = mmc_file_op(DFU_OP_READ, dfu, buf, len); |
178 | break; | 178 | break; |
179 | default: | 179 | default: |
180 | printf("%s: Layout (%s) not (yet) supported!\n", __func__, | 180 | printf("%s: Layout (%s) not (yet) supported!\n", __func__, |
181 | dfu_get_layout(dfu->layout)); | 181 | dfu_get_layout(dfu->layout)); |
182 | } | 182 | } |
183 | 183 | ||
184 | return ret; | 184 | return ret; |
185 | } | 185 | } |
186 | 186 | ||
187 | /* | 187 | /* |
188 | * @param s Parameter string containing space-separated arguments: | 188 | * @param s Parameter string containing space-separated arguments: |
189 | * 1st: | 189 | * 1st: |
190 | * raw (raw read/write) | 190 | * raw (raw read/write) |
191 | * fat (files) | 191 | * fat (files) |
192 | * ext4 (^) | 192 | * ext4 (^) |
193 | * part (partition image) | 193 | * part (partition image) |
194 | * 2nd and 3rd: | 194 | * 2nd and 3rd: |
195 | * lba_start and lba_size, for raw write | 195 | * lba_start and lba_size, for raw write |
196 | * mmc_dev and mmc_part, for filesystems and part | 196 | * mmc_dev and mmc_part, for filesystems and part |
197 | */ | 197 | */ |
198 | int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s) | 198 | int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s) |
199 | { | 199 | { |
200 | const char *entity_type; | 200 | const char *entity_type; |
201 | size_t second_arg; | 201 | size_t second_arg; |
202 | size_t third_arg; | 202 | size_t third_arg; |
203 | 203 | ||
204 | struct mmc *mmc; | 204 | struct mmc *mmc; |
205 | 205 | ||
206 | const char *argv[3]; | 206 | const char *argv[3]; |
207 | const char **parg = argv; | 207 | const char **parg = argv; |
208 | 208 | ||
209 | for (; parg < argv + sizeof(argv) / sizeof(*argv); ++parg) { | 209 | for (; parg < argv + sizeof(argv) / sizeof(*argv); ++parg) { |
210 | *parg = strsep(&s, " "); | 210 | *parg = strsep(&s, " "); |
211 | if (*parg == NULL) { | 211 | if (*parg == NULL) { |
212 | error("Invalid number of arguments.\n"); | 212 | error("Invalid number of arguments.\n"); |
213 | return -ENODEV; | 213 | return -ENODEV; |
214 | } | 214 | } |
215 | } | 215 | } |
216 | 216 | ||
217 | entity_type = argv[0]; | 217 | entity_type = argv[0]; |
218 | second_arg = simple_strtoul(argv[1], NULL, 16); | 218 | /* |
219 | third_arg = simple_strtoul(argv[2], NULL, 16); | 219 | * Base 0 means we'll accept (prefixed with 0x or 0) base 16, 8, |
220 | * with default 10. | ||
221 | */ | ||
222 | second_arg = simple_strtoul(argv[1], NULL, 0); | ||
223 | third_arg = simple_strtoul(argv[2], NULL, 0); | ||
220 | 224 | ||
221 | mmc = find_mmc_device(dfu->dev_num); | 225 | mmc = find_mmc_device(dfu->dev_num); |
222 | if (mmc == NULL) { | 226 | if (mmc == NULL) { |
223 | error("Couldn't find MMC device no. %d.\n", dfu->dev_num); | 227 | error("Couldn't find MMC device no. %d.\n", dfu->dev_num); |
224 | return -ENODEV; | 228 | return -ENODEV; |
225 | } | 229 | } |
226 | 230 | ||
227 | if (mmc_init(mmc)) { | 231 | if (mmc_init(mmc)) { |
228 | error("Couldn't init MMC device.\n"); | 232 | error("Couldn't init MMC device.\n"); |
229 | return -ENODEV; | 233 | return -ENODEV; |
230 | } | 234 | } |
231 | 235 | ||
232 | if (!strcmp(entity_type, "raw")) { | 236 | if (!strcmp(entity_type, "raw")) { |
233 | dfu->layout = DFU_RAW_ADDR; | 237 | dfu->layout = DFU_RAW_ADDR; |
234 | dfu->data.mmc.lba_start = second_arg; | 238 | dfu->data.mmc.lba_start = second_arg; |
235 | dfu->data.mmc.lba_size = third_arg; | 239 | dfu->data.mmc.lba_size = third_arg; |
236 | dfu->data.mmc.lba_blk_size = mmc->read_bl_len; | 240 | dfu->data.mmc.lba_blk_size = mmc->read_bl_len; |
237 | } else if (!strcmp(entity_type, "part")) { | 241 | } else if (!strcmp(entity_type, "part")) { |
238 | disk_partition_t partinfo; | 242 | disk_partition_t partinfo; |
239 | block_dev_desc_t *blk_dev = &mmc->block_dev; | 243 | block_dev_desc_t *blk_dev = &mmc->block_dev; |
240 | int mmcdev = second_arg; | 244 | int mmcdev = second_arg; |
241 | int mmcpart = third_arg; | 245 | int mmcpart = third_arg; |
242 | 246 | ||
243 | if (get_partition_info(blk_dev, mmcpart, &partinfo) != 0) { | 247 | if (get_partition_info(blk_dev, mmcpart, &partinfo) != 0) { |
244 | error("Couldn't find part #%d on mmc device #%d\n", | 248 | error("Couldn't find part #%d on mmc device #%d\n", |
245 | mmcpart, mmcdev); | 249 | mmcpart, mmcdev); |
246 | return -ENODEV; | 250 | return -ENODEV; |
247 | } | 251 | } |
248 | 252 | ||
249 | dfu->layout = DFU_RAW_ADDR; | 253 | dfu->layout = DFU_RAW_ADDR; |
250 | dfu->data.mmc.lba_start = partinfo.start; | 254 | dfu->data.mmc.lba_start = partinfo.start; |
251 | dfu->data.mmc.lba_size = partinfo.size; | 255 | dfu->data.mmc.lba_size = partinfo.size; |
252 | dfu->data.mmc.lba_blk_size = partinfo.blksz; | 256 | dfu->data.mmc.lba_blk_size = partinfo.blksz; |
253 | } else if (!strcmp(entity_type, "fat")) { | 257 | } else if (!strcmp(entity_type, "fat")) { |
254 | dfu->layout = DFU_FS_FAT; | 258 | dfu->layout = DFU_FS_FAT; |
255 | } else if (!strcmp(entity_type, "ext4")) { | 259 | } else if (!strcmp(entity_type, "ext4")) { |
256 | dfu->layout = DFU_FS_EXT4; | 260 | dfu->layout = DFU_FS_EXT4; |
257 | } else { | 261 | } else { |
258 | error("Memory layout (%s) not supported!\n", entity_type); | 262 | error("Memory layout (%s) not supported!\n", entity_type); |
259 | return -ENODEV; | 263 | return -ENODEV; |
260 | } | 264 | } |
261 | 265 | ||
262 | /* if it's NOT a raw write */ | 266 | /* if it's NOT a raw write */ |
263 | if (strcmp(entity_type, "raw")) { | 267 | if (strcmp(entity_type, "raw")) { |
264 | dfu->data.mmc.dev = second_arg; | 268 | dfu->data.mmc.dev = second_arg; |
265 | dfu->data.mmc.part = third_arg; | 269 | dfu->data.mmc.part = third_arg; |
266 | } | 270 | } |
267 | 271 | ||
268 | dfu->dev_type = DFU_DEV_MMC; | 272 | dfu->dev_type = DFU_DEV_MMC; |
269 | dfu->read_medium = dfu_read_medium_mmc; | 273 | dfu->read_medium = dfu_read_medium_mmc; |
270 | dfu->write_medium = dfu_write_medium_mmc; | 274 | dfu->write_medium = dfu_write_medium_mmc; |
271 | dfu->flush_medium = dfu_flush_medium_mmc; | 275 | dfu->flush_medium = dfu_flush_medium_mmc; |
272 | dfu->inited = 0; | 276 | dfu->inited = 0; |
273 | 277 | ||
274 | return 0; | 278 | return 0; |
275 | } | 279 | } |
276 | 280 |
include/configs/am335x_evm.h
1 | /* | 1 | /* |
2 | * am335x_evm.h | 2 | * am335x_evm.h |
3 | * | 3 | * |
4 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ | 4 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License as | 7 | * modify it under the terms of the GNU General Public License as |
8 | * published by the Free Software Foundation version 2. | 8 | * published by the Free Software Foundation version 2. |
9 | * | 9 | * |
10 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | 10 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any |
11 | * kind, whether express or implied; without even the implied warranty | 11 | * kind, whether express or implied; without even the implied warranty |
12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #ifndef __CONFIG_AM335X_EVM_H | 16 | #ifndef __CONFIG_AM335X_EVM_H |
17 | #define __CONFIG_AM335X_EVM_H | 17 | #define __CONFIG_AM335X_EVM_H |
18 | 18 | ||
19 | #include <configs/ti_am335x_common.h> | 19 | #include <configs/ti_am335x_common.h> |
20 | 20 | ||
21 | #define MACH_TYPE_TIAM335EVM 3589 /* Until the next sync */ | 21 | #define MACH_TYPE_TIAM335EVM 3589 /* Until the next sync */ |
22 | #define CONFIG_MACH_TYPE MACH_TYPE_TIAM335EVM | 22 | #define CONFIG_MACH_TYPE MACH_TYPE_TIAM335EVM |
23 | #define CONFIG_BOARD_LATE_INIT | 23 | #define CONFIG_BOARD_LATE_INIT |
24 | 24 | ||
25 | /* Clock Defines */ | 25 | /* Clock Defines */ |
26 | #define V_OSCK 24000000 /* Clock output from T2 */ | 26 | #define V_OSCK 24000000 /* Clock output from T2 */ |
27 | #define V_SCLK (V_OSCK) | 27 | #define V_SCLK (V_OSCK) |
28 | 28 | ||
29 | /* Custom script for NOR */ | 29 | /* Custom script for NOR */ |
30 | #define CONFIG_SYS_LDSCRIPT "board/ti/am335x/u-boot.lds" | 30 | #define CONFIG_SYS_LDSCRIPT "board/ti/am335x/u-boot.lds" |
31 | 31 | ||
32 | /* Always 128 KiB env size */ | 32 | /* Always 128 KiB env size */ |
33 | #define CONFIG_ENV_SIZE (128 << 10) | 33 | #define CONFIG_ENV_SIZE (128 << 10) |
34 | 34 | ||
35 | /* Enhance our eMMC support / experience. */ | 35 | /* Enhance our eMMC support / experience. */ |
36 | #define CONFIG_CMD_GPT | 36 | #define CONFIG_CMD_GPT |
37 | #define CONFIG_EFI_PARTITION | 37 | #define CONFIG_EFI_PARTITION |
38 | #define CONFIG_PARTITION_UUIDS | 38 | #define CONFIG_PARTITION_UUIDS |
39 | #define CONFIG_CMD_PART | 39 | #define CONFIG_CMD_PART |
40 | 40 | ||
41 | #ifdef CONFIG_NAND | 41 | #ifdef CONFIG_NAND |
42 | #define NANDARGS \ | 42 | #define NANDARGS \ |
43 | "mtdids=" MTDIDS_DEFAULT "\0" \ | 43 | "mtdids=" MTDIDS_DEFAULT "\0" \ |
44 | "mtdparts=" MTDPARTS_DEFAULT "\0" \ | 44 | "mtdparts=" MTDPARTS_DEFAULT "\0" \ |
45 | "nandargs=setenv bootargs console=${console} " \ | 45 | "nandargs=setenv bootargs console=${console} " \ |
46 | "${optargs} " \ | 46 | "${optargs} " \ |
47 | "root=${nandroot} " \ | 47 | "root=${nandroot} " \ |
48 | "rootfstype=${nandrootfstype}\0" \ | 48 | "rootfstype=${nandrootfstype}\0" \ |
49 | "nandroot=ubi0:rootfs rw ubi.mtd=7,2048\0" \ | 49 | "nandroot=ubi0:rootfs rw ubi.mtd=7,2048\0" \ |
50 | "nandrootfstype=ubifs rootwait=1\0" \ | 50 | "nandrootfstype=ubifs rootwait=1\0" \ |
51 | "nandboot=echo Booting from nand ...; " \ | 51 | "nandboot=echo Booting from nand ...; " \ |
52 | "run nandargs; " \ | 52 | "run nandargs; " \ |
53 | "nand read ${fdtaddr} u-boot-spl-os; " \ | 53 | "nand read ${fdtaddr} u-boot-spl-os; " \ |
54 | "nand read ${loadaddr} kernel; " \ | 54 | "nand read ${loadaddr} kernel; " \ |
55 | "bootz ${loadaddr} - ${fdtaddr}\0" | 55 | "bootz ${loadaddr} - ${fdtaddr}\0" |
56 | #else | 56 | #else |
57 | #define NANDARGS "" | 57 | #define NANDARGS "" |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG | 60 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
61 | 61 | ||
62 | #ifndef CONFIG_SPL_BUILD | 62 | #ifndef CONFIG_SPL_BUILD |
63 | #define CONFIG_EXTRA_ENV_SETTINGS \ | 63 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
64 | "loadaddr=0x80200000\0" \ | 64 | "loadaddr=0x80200000\0" \ |
65 | "fdtaddr=0x80F80000\0" \ | 65 | "fdtaddr=0x80F80000\0" \ |
66 | "fdt_high=0xffffffff\0" \ | 66 | "fdt_high=0xffffffff\0" \ |
67 | "boot_fdt=try\0" \ | 67 | "boot_fdt=try\0" \ |
68 | "rdaddr=0x81000000\0" \ | 68 | "rdaddr=0x81000000\0" \ |
69 | "bootpart=0:2\0" \ | 69 | "bootpart=0:2\0" \ |
70 | "bootdir=/boot\0" \ | 70 | "bootdir=/boot\0" \ |
71 | "bootfile=zImage\0" \ | 71 | "bootfile=zImage\0" \ |
72 | "fdtfile=undefined\0" \ | 72 | "fdtfile=undefined\0" \ |
73 | "console=ttyO0,115200n8\0" \ | 73 | "console=ttyO0,115200n8\0" \ |
74 | "partitions=" \ | 74 | "partitions=" \ |
75 | "uuid_disk=${uuid_gpt_disk};" \ | 75 | "uuid_disk=${uuid_gpt_disk};" \ |
76 | "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \ | 76 | "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \ |
77 | "optargs=\0" \ | 77 | "optargs=\0" \ |
78 | "mmcdev=0\0" \ | 78 | "mmcdev=0\0" \ |
79 | "mmcroot=/dev/mmcblk0p2 ro\0" \ | 79 | "mmcroot=/dev/mmcblk0p2 ro\0" \ |
80 | "mmcrootfstype=ext4 rootwait\0" \ | 80 | "mmcrootfstype=ext4 rootwait\0" \ |
81 | "rootpath=/export/rootfs\0" \ | 81 | "rootpath=/export/rootfs\0" \ |
82 | "nfsopts=nolock\0" \ | 82 | "nfsopts=nolock\0" \ |
83 | "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \ | 83 | "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \ |
84 | "::off\0" \ | 84 | "::off\0" \ |
85 | "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0" \ | 85 | "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0" \ |
86 | "ramrootfstype=ext2\0" \ | 86 | "ramrootfstype=ext2\0" \ |
87 | "mmcargs=setenv bootargs console=${console} " \ | 87 | "mmcargs=setenv bootargs console=${console} " \ |
88 | "${optargs} " \ | 88 | "${optargs} " \ |
89 | "root=${mmcroot} " \ | 89 | "root=${mmcroot} " \ |
90 | "rootfstype=${mmcrootfstype}\0" \ | 90 | "rootfstype=${mmcrootfstype}\0" \ |
91 | "spiroot=/dev/mtdblock4 rw\0" \ | 91 | "spiroot=/dev/mtdblock4 rw\0" \ |
92 | "spirootfstype=jffs2\0" \ | 92 | "spirootfstype=jffs2\0" \ |
93 | "spisrcaddr=0xe0000\0" \ | 93 | "spisrcaddr=0xe0000\0" \ |
94 | "spiimgsize=0x362000\0" \ | 94 | "spiimgsize=0x362000\0" \ |
95 | "spibusno=0\0" \ | 95 | "spibusno=0\0" \ |
96 | "spiargs=setenv bootargs console=${console} " \ | 96 | "spiargs=setenv bootargs console=${console} " \ |
97 | "${optargs} " \ | 97 | "${optargs} " \ |
98 | "root=${spiroot} " \ | 98 | "root=${spiroot} " \ |
99 | "rootfstype=${spirootfstype}\0" \ | 99 | "rootfstype=${spirootfstype}\0" \ |
100 | "netargs=setenv bootargs console=${console} " \ | 100 | "netargs=setenv bootargs console=${console} " \ |
101 | "${optargs} " \ | 101 | "${optargs} " \ |
102 | "root=/dev/nfs " \ | 102 | "root=/dev/nfs " \ |
103 | "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \ | 103 | "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \ |
104 | "ip=dhcp\0" \ | 104 | "ip=dhcp\0" \ |
105 | "bootenv=uEnv.txt\0" \ | 105 | "bootenv=uEnv.txt\0" \ |
106 | "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ | 106 | "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ |
107 | "importbootenv=echo Importing environment from mmc ...; " \ | 107 | "importbootenv=echo Importing environment from mmc ...; " \ |
108 | "env import -t $loadaddr $filesize\0" \ | 108 | "env import -t $loadaddr $filesize\0" \ |
109 | "ramargs=setenv bootargs console=${console} " \ | 109 | "ramargs=setenv bootargs console=${console} " \ |
110 | "${optargs} " \ | 110 | "${optargs} " \ |
111 | "root=${ramroot} " \ | 111 | "root=${ramroot} " \ |
112 | "rootfstype=${ramrootfstype}\0" \ | 112 | "rootfstype=${ramrootfstype}\0" \ |
113 | "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ | 113 | "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ |
114 | "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ | 114 | "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ |
115 | "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ | 115 | "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
116 | "mmcloados=run mmcargs; " \ | 116 | "mmcloados=run mmcargs; " \ |
117 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ | 117 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
118 | "if run loadfdt; then " \ | 118 | "if run loadfdt; then " \ |
119 | "bootz ${loadaddr} - ${fdtaddr}; " \ | 119 | "bootz ${loadaddr} - ${fdtaddr}; " \ |
120 | "else " \ | 120 | "else " \ |
121 | "if test ${boot_fdt} = try; then " \ | 121 | "if test ${boot_fdt} = try; then " \ |
122 | "bootz; " \ | 122 | "bootz; " \ |
123 | "else " \ | 123 | "else " \ |
124 | "echo WARN: Cannot load the DT; " \ | 124 | "echo WARN: Cannot load the DT; " \ |
125 | "fi; " \ | 125 | "fi; " \ |
126 | "fi; " \ | 126 | "fi; " \ |
127 | "else " \ | 127 | "else " \ |
128 | "bootz; " \ | 128 | "bootz; " \ |
129 | "fi;\0" \ | 129 | "fi;\0" \ |
130 | "mmcboot=mmc dev ${mmcdev}; " \ | 130 | "mmcboot=mmc dev ${mmcdev}; " \ |
131 | "if mmc rescan; then " \ | 131 | "if mmc rescan; then " \ |
132 | "echo SD/MMC found on device ${mmcdev};" \ | 132 | "echo SD/MMC found on device ${mmcdev};" \ |
133 | "if run loadbootenv; then " \ | 133 | "if run loadbootenv; then " \ |
134 | "echo Loaded environment from ${bootenv};" \ | 134 | "echo Loaded environment from ${bootenv};" \ |
135 | "run importbootenv;" \ | 135 | "run importbootenv;" \ |
136 | "fi;" \ | 136 | "fi;" \ |
137 | "if test -n $uenvcmd; then " \ | 137 | "if test -n $uenvcmd; then " \ |
138 | "echo Running uenvcmd ...;" \ | 138 | "echo Running uenvcmd ...;" \ |
139 | "run uenvcmd;" \ | 139 | "run uenvcmd;" \ |
140 | "fi;" \ | 140 | "fi;" \ |
141 | "if run loadimage; then " \ | 141 | "if run loadimage; then " \ |
142 | "run mmcloados;" \ | 142 | "run mmcloados;" \ |
143 | "fi;" \ | 143 | "fi;" \ |
144 | "fi;\0" \ | 144 | "fi;\0" \ |
145 | "spiboot=echo Booting from spi ...; " \ | 145 | "spiboot=echo Booting from spi ...; " \ |
146 | "run spiargs; " \ | 146 | "run spiargs; " \ |
147 | "sf probe ${spibusno}:0; " \ | 147 | "sf probe ${spibusno}:0; " \ |
148 | "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \ | 148 | "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \ |
149 | "bootz ${loadaddr}\0" \ | 149 | "bootz ${loadaddr}\0" \ |
150 | "netboot=echo Booting from network ...; " \ | 150 | "netboot=echo Booting from network ...; " \ |
151 | "setenv autoload no; " \ | 151 | "setenv autoload no; " \ |
152 | "dhcp; " \ | 152 | "dhcp; " \ |
153 | "tftp ${loadaddr} ${bootfile}; " \ | 153 | "tftp ${loadaddr} ${bootfile}; " \ |
154 | "tftp ${fdtaddr} ${fdtfile}; " \ | 154 | "tftp ${fdtaddr} ${fdtfile}; " \ |
155 | "run netargs; " \ | 155 | "run netargs; " \ |
156 | "bootz ${loadaddr} - ${fdtaddr}\0" \ | 156 | "bootz ${loadaddr} - ${fdtaddr}\0" \ |
157 | "ramboot=echo Booting from ramdisk ...; " \ | 157 | "ramboot=echo Booting from ramdisk ...; " \ |
158 | "run ramargs; " \ | 158 | "run ramargs; " \ |
159 | "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \ | 159 | "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \ |
160 | "findfdt="\ | 160 | "findfdt="\ |
161 | "if test $board_name = A335BONE; then " \ | 161 | "if test $board_name = A335BONE; then " \ |
162 | "setenv fdtfile am335x-bone.dtb; fi; " \ | 162 | "setenv fdtfile am335x-bone.dtb; fi; " \ |
163 | "if test $board_name = A335BNLT; then " \ | 163 | "if test $board_name = A335BNLT; then " \ |
164 | "setenv fdtfile am335x-boneblack.dtb; fi; " \ | 164 | "setenv fdtfile am335x-boneblack.dtb; fi; " \ |
165 | "if test $board_name = A33515BB; then " \ | 165 | "if test $board_name = A33515BB; then " \ |
166 | "setenv fdtfile am335x-evm.dtb; fi; " \ | 166 | "setenv fdtfile am335x-evm.dtb; fi; " \ |
167 | "if test $board_name = A335X_SK; then " \ | 167 | "if test $board_name = A335X_SK; then " \ |
168 | "setenv fdtfile am335x-evmsk.dtb; fi; " \ | 168 | "setenv fdtfile am335x-evmsk.dtb; fi; " \ |
169 | "if test $fdtfile = undefined; then " \ | 169 | "if test $fdtfile = undefined; then " \ |
170 | "echo WARNING: Could not determine device tree to use; fi; \0" \ | 170 | "echo WARNING: Could not determine device tree to use; fi; \0" \ |
171 | NANDARGS \ | 171 | NANDARGS \ |
172 | DFUARGS | 172 | DFUARGS |
173 | #endif | 173 | #endif |
174 | 174 | ||
175 | #define CONFIG_BOOTCOMMAND \ | 175 | #define CONFIG_BOOTCOMMAND \ |
176 | "run findfdt; " \ | 176 | "run findfdt; " \ |
177 | "run mmcboot;" \ | 177 | "run mmcboot;" \ |
178 | "setenv mmcdev 1; " \ | 178 | "setenv mmcdev 1; " \ |
179 | "setenv bootpart 1:2; " \ | 179 | "setenv bootpart 1:2; " \ |
180 | "run mmcboot;" \ | 180 | "run mmcboot;" \ |
181 | "run nandboot;" | 181 | "run nandboot;" |
182 | 182 | ||
183 | /* NS16550 Configuration */ | 183 | /* NS16550 Configuration */ |
184 | #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */ | 184 | #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */ |
185 | #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */ | 185 | #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */ |
186 | #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */ | 186 | #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */ |
187 | #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */ | 187 | #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */ |
188 | #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */ | 188 | #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */ |
189 | #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */ | 189 | #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */ |
190 | #define CONFIG_BAUDRATE 115200 | 190 | #define CONFIG_BAUDRATE 115200 |
191 | 191 | ||
192 | #define CONFIG_CMD_EEPROM | 192 | #define CONFIG_CMD_EEPROM |
193 | #define CONFIG_ENV_EEPROM_IS_ON_I2C | 193 | #define CONFIG_ENV_EEPROM_IS_ON_I2C |
194 | #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */ | 194 | #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */ |
195 | #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 | 195 | #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 |
196 | #define CONFIG_SYS_I2C_MULTI_EEPROMS | 196 | #define CONFIG_SYS_I2C_MULTI_EEPROMS |
197 | 197 | ||
198 | /* PMIC support */ | 198 | /* PMIC support */ |
199 | #define CONFIG_POWER_TPS65217 | 199 | #define CONFIG_POWER_TPS65217 |
200 | #define CONFIG_POWER_TPS65910 | 200 | #define CONFIG_POWER_TPS65910 |
201 | 201 | ||
202 | /* SPL */ | 202 | /* SPL */ |
203 | #ifndef CONFIG_NOR_BOOT | 203 | #ifndef CONFIG_NOR_BOOT |
204 | #define CONFIG_SPL_POWER_SUPPORT | 204 | #define CONFIG_SPL_POWER_SUPPORT |
205 | #define CONFIG_SPL_YMODEM_SUPPORT | 205 | #define CONFIG_SPL_YMODEM_SUPPORT |
206 | 206 | ||
207 | /* Bootcount using the RTC block */ | 207 | /* Bootcount using the RTC block */ |
208 | #define CONFIG_BOOTCOUNT_LIMIT | 208 | #define CONFIG_BOOTCOUNT_LIMIT |
209 | #define CONFIG_BOOTCOUNT_AM33XX | 209 | #define CONFIG_BOOTCOUNT_AM33XX |
210 | 210 | ||
211 | /* USB gadget RNDIS */ | 211 | /* USB gadget RNDIS */ |
212 | #define CONFIG_SPL_MUSB_NEW_SUPPORT | 212 | #define CONFIG_SPL_MUSB_NEW_SUPPORT |
213 | 213 | ||
214 | /* General network SPL, both CPSW and USB gadget RNDIS */ | 214 | /* General network SPL, both CPSW and USB gadget RNDIS */ |
215 | #define CONFIG_SPL_NET_SUPPORT | 215 | #define CONFIG_SPL_NET_SUPPORT |
216 | #define CONFIG_SPL_ENV_SUPPORT | 216 | #define CONFIG_SPL_ENV_SUPPORT |
217 | #define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL" | 217 | #define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL" |
218 | 218 | ||
219 | /* SPI flash. */ | 219 | /* SPI flash. */ |
220 | #define CONFIG_SPL_SPI_SUPPORT | 220 | #define CONFIG_SPL_SPI_SUPPORT |
221 | #define CONFIG_SPL_SPI_FLASH_SUPPORT | 221 | #define CONFIG_SPL_SPI_FLASH_SUPPORT |
222 | #define CONFIG_SPL_SPI_LOAD | 222 | #define CONFIG_SPL_SPI_LOAD |
223 | #define CONFIG_SPL_SPI_BUS 0 | 223 | #define CONFIG_SPL_SPI_BUS 0 |
224 | #define CONFIG_SPL_SPI_CS 0 | 224 | #define CONFIG_SPL_SPI_CS 0 |
225 | #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000 | 225 | #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000 |
226 | 226 | ||
227 | #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds" | 227 | #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds" |
228 | 228 | ||
229 | #ifdef CONFIG_NAND | 229 | #ifdef CONFIG_NAND |
230 | #define CONFIG_NAND_OMAP_GPMC | 230 | #define CONFIG_NAND_OMAP_GPMC |
231 | #define CONFIG_NAND_OMAP_ELM | 231 | #define CONFIG_NAND_OMAP_ELM |
232 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE | 232 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
233 | #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \ | 233 | #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \ |
234 | CONFIG_SYS_NAND_PAGE_SIZE) | 234 | CONFIG_SYS_NAND_PAGE_SIZE) |
235 | #define CONFIG_SYS_NAND_PAGE_SIZE 2048 | 235 | #define CONFIG_SYS_NAND_PAGE_SIZE 2048 |
236 | #define CONFIG_SYS_NAND_OOBSIZE 64 | 236 | #define CONFIG_SYS_NAND_OOBSIZE 64 |
237 | #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024) | 237 | #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024) |
238 | #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS | 238 | #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS |
239 | #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \ | 239 | #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \ |
240 | 10, 11, 12, 13, 14, 15, 16, 17, \ | 240 | 10, 11, 12, 13, 14, 15, 16, 17, \ |
241 | 18, 19, 20, 21, 22, 23, 24, 25, \ | 241 | 18, 19, 20, 21, 22, 23, 24, 25, \ |
242 | 26, 27, 28, 29, 30, 31, 32, 33, \ | 242 | 26, 27, 28, 29, 30, 31, 32, 33, \ |
243 | 34, 35, 36, 37, 38, 39, 40, 41, \ | 243 | 34, 35, 36, 37, 38, 39, 40, 41, \ |
244 | 42, 43, 44, 45, 46, 47, 48, 49, \ | 244 | 42, 43, 44, 45, 46, 47, 48, 49, \ |
245 | 50, 51, 52, 53, 54, 55, 56, 57, } | 245 | 50, 51, 52, 53, 54, 55, 56, 57, } |
246 | 246 | ||
247 | #define CONFIG_SYS_NAND_ECCSIZE 512 | 247 | #define CONFIG_SYS_NAND_ECCSIZE 512 |
248 | #define CONFIG_SYS_NAND_ECCBYTES 14 | 248 | #define CONFIG_SYS_NAND_ECCBYTES 14 |
249 | #define CONFIG_SYS_NAND_ONFI_DETECTION | 249 | #define CONFIG_SYS_NAND_ONFI_DETECTION |
250 | #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW | 250 | #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW |
251 | #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE | 251 | #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE |
252 | #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000 | 252 | #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000 |
253 | #endif | 253 | #endif |
254 | #endif | 254 | #endif |
255 | 255 | ||
256 | /* | 256 | /* |
257 | * For NOR boot, we must set this to the start of where NOR is mapped | 257 | * For NOR boot, we must set this to the start of where NOR is mapped |
258 | * in memory. | 258 | * in memory. |
259 | */ | 259 | */ |
260 | #ifdef CONFIG_NOR_BOOT | 260 | #ifdef CONFIG_NOR_BOOT |
261 | #define CONFIG_SYS_TEXT_BASE 0x08000000 | 261 | #define CONFIG_SYS_TEXT_BASE 0x08000000 |
262 | #endif | 262 | #endif |
263 | 263 | ||
264 | /* | 264 | /* |
265 | * USB configuration. We enable MUSB support, both for host and for | 265 | * USB configuration. We enable MUSB support, both for host and for |
266 | * gadget. We set USB0 as peripheral and USB1 as host, based on the | 266 | * gadget. We set USB0 as peripheral and USB1 as host, based on the |
267 | * board schematic and physical port wired to each. Then for host we | 267 | * board schematic and physical port wired to each. Then for host we |
268 | * add mass storage support and for gadget we add both RNDIS ethernet | 268 | * add mass storage support and for gadget we add both RNDIS ethernet |
269 | * and DFU. | 269 | * and DFU. |
270 | */ | 270 | */ |
271 | #define CONFIG_USB_MUSB_DSPS | 271 | #define CONFIG_USB_MUSB_DSPS |
272 | #define CONFIG_ARCH_MISC_INIT | 272 | #define CONFIG_ARCH_MISC_INIT |
273 | #define CONFIG_MUSB_GADGET | 273 | #define CONFIG_MUSB_GADGET |
274 | #define CONFIG_MUSB_PIO_ONLY | 274 | #define CONFIG_MUSB_PIO_ONLY |
275 | #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT | 275 | #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT |
276 | #define CONFIG_USB_GADGET | 276 | #define CONFIG_USB_GADGET |
277 | #define CONFIG_USBDOWNLOAD_GADGET | 277 | #define CONFIG_USBDOWNLOAD_GADGET |
278 | #define CONFIG_USB_GADGET_DUALSPEED | 278 | #define CONFIG_USB_GADGET_DUALSPEED |
279 | #define CONFIG_USB_GADGET_VBUS_DRAW 2 | 279 | #define CONFIG_USB_GADGET_VBUS_DRAW 2 |
280 | #define CONFIG_MUSB_HOST | 280 | #define CONFIG_MUSB_HOST |
281 | #define CONFIG_AM335X_USB0 | 281 | #define CONFIG_AM335X_USB0 |
282 | #define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL | 282 | #define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL |
283 | #define CONFIG_AM335X_USB1 | 283 | #define CONFIG_AM335X_USB1 |
284 | #define CONFIG_AM335X_USB1_MODE MUSB_HOST | 284 | #define CONFIG_AM335X_USB1_MODE MUSB_HOST |
285 | 285 | ||
286 | #ifdef CONFIG_MUSB_HOST | 286 | #ifdef CONFIG_MUSB_HOST |
287 | #define CONFIG_CMD_USB | 287 | #define CONFIG_CMD_USB |
288 | #define CONFIG_USB_STORAGE | 288 | #define CONFIG_USB_STORAGE |
289 | #endif | 289 | #endif |
290 | 290 | ||
291 | #ifdef CONFIG_MUSB_GADGET | 291 | #ifdef CONFIG_MUSB_GADGET |
292 | #define CONFIG_USB_ETHER | 292 | #define CONFIG_USB_ETHER |
293 | #define CONFIG_USB_ETH_RNDIS | 293 | #define CONFIG_USB_ETH_RNDIS |
294 | #define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00" | 294 | #define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00" |
295 | 295 | ||
296 | /* USB TI's IDs */ | 296 | /* USB TI's IDs */ |
297 | #define CONFIG_G_DNL_VENDOR_NUM 0x0403 | 297 | #define CONFIG_G_DNL_VENDOR_NUM 0x0403 |
298 | #define CONFIG_G_DNL_PRODUCT_NUM 0xBD00 | 298 | #define CONFIG_G_DNL_PRODUCT_NUM 0xBD00 |
299 | #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments" | 299 | #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments" |
300 | #endif /* CONFIG_MUSB_GADGET */ | 300 | #endif /* CONFIG_MUSB_GADGET */ |
301 | 301 | ||
302 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT) | 302 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT) |
303 | /* disable host part of MUSB in SPL */ | 303 | /* disable host part of MUSB in SPL */ |
304 | #undef CONFIG_MUSB_HOST | 304 | #undef CONFIG_MUSB_HOST |
305 | /* disable EFI partitions and partition UUID support */ | 305 | /* disable EFI partitions and partition UUID support */ |
306 | #undef CONFIG_PARTITION_UUIDS | 306 | #undef CONFIG_PARTITION_UUIDS |
307 | #undef CONFIG_EFI_PARTITION | 307 | #undef CONFIG_EFI_PARTITION |
308 | /* | 308 | /* |
309 | * Disable CPSW SPL support so we fit within the 101KiB limit. | 309 | * Disable CPSW SPL support so we fit within the 101KiB limit. |
310 | */ | 310 | */ |
311 | #undef CONFIG_SPL_ETH_SUPPORT | 311 | #undef CONFIG_SPL_ETH_SUPPORT |
312 | #endif | 312 | #endif |
313 | 313 | ||
314 | /* USB Device Firmware Update support */ | 314 | /* USB Device Firmware Update support */ |
315 | #define CONFIG_DFU_FUNCTION | 315 | #define CONFIG_DFU_FUNCTION |
316 | #define CONFIG_DFU_MMC | 316 | #define CONFIG_DFU_MMC |
317 | #define CONFIG_CMD_DFU | 317 | #define CONFIG_CMD_DFU |
318 | #define DFU_ALT_INFO_MMC \ | 318 | #define DFU_ALT_INFO_MMC \ |
319 | "dfu_alt_info_mmc=" \ | 319 | "dfu_alt_info_mmc=" \ |
320 | "boot part 0 1;" \ | 320 | "boot part 0 1;" \ |
321 | "rootfs part 0 2;" \ | 321 | "rootfs part 0 2;" \ |
322 | "MLO fat 0 1;" \ | 322 | "MLO fat 0 1;" \ |
323 | "MLO.raw mmc 100 100;" \ | 323 | "MLO.raw mmc 0x100 0x100;" \ |
324 | "u-boot.img.raw mmc 300 400;" \ | 324 | "u-boot.img.raw mmc 0x300 0x400;" \ |
325 | "spl-os-args.raw mmc 80 80;" \ | 325 | "spl-os-args.raw mmc 0x80 0x80;" \ |
326 | "spl-os-image.raw mmc 900 2000;" \ | 326 | "spl-os-image.raw mmc 0x900 0x2000;" \ |
327 | "spl-os-args fat 0 1;" \ | 327 | "spl-os-args fat 0 1;" \ |
328 | "spl-os-image fat 0 1;" \ | 328 | "spl-os-image fat 0 1;" \ |
329 | "u-boot.img fat 0 1;" \ | 329 | "u-boot.img fat 0 1;" \ |
330 | "uEnv.txt fat 0 1\0" | 330 | "uEnv.txt fat 0 1\0" |
331 | #ifdef CONFIG_NAND | 331 | #ifdef CONFIG_NAND |
332 | #define CONFIG_DFU_NAND | 332 | #define CONFIG_DFU_NAND |
333 | #define DFU_ALT_INFO_NAND \ | 333 | #define DFU_ALT_INFO_NAND \ |
334 | "dfu_alt_info_nand=" \ | 334 | "dfu_alt_info_nand=" \ |
335 | "SPL part 0 1;" \ | 335 | "SPL part 0 1;" \ |
336 | "SPL.backup1 part 0 2;" \ | 336 | "SPL.backup1 part 0 2;" \ |
337 | "SPL.backup2 part 0 3;" \ | 337 | "SPL.backup2 part 0 3;" \ |
338 | "SPL.backup3 part 0 4;" \ | 338 | "SPL.backup3 part 0 4;" \ |
339 | "u-boot part 0 5;" \ | 339 | "u-boot part 0 5;" \ |
340 | "u-boot-spl-os part 0 6;" \ | 340 | "u-boot-spl-os part 0 6;" \ |
341 | "kernel part 0 8;" \ | 341 | "kernel part 0 8;" \ |
342 | "rootfs part 0 9\0" | 342 | "rootfs part 0 9\0" |
343 | #else | 343 | #else |
344 | #define DFU_ALT_INFO_NAND "" | 344 | #define DFU_ALT_INFO_NAND "" |
345 | #endif | 345 | #endif |
346 | #define CONFIG_DFU_RAM | 346 | #define CONFIG_DFU_RAM |
347 | #define DFU_ALT_INFO_RAM \ | 347 | #define DFU_ALT_INFO_RAM \ |
348 | "dfu_alt_info_ram=" \ | 348 | "dfu_alt_info_ram=" \ |
349 | "kernel ram 0x80200000 0xD80000;" \ | 349 | "kernel ram 0x80200000 0xD80000;" \ |
350 | "fdt ram 0x80F80000 0x80000;" \ | 350 | "fdt ram 0x80F80000 0x80000;" \ |
351 | "ramdisk ram 0x81000000 0x4000000\0" | 351 | "ramdisk ram 0x81000000 0x4000000\0" |
352 | #define DFUARGS \ | 352 | #define DFUARGS \ |
353 | "dfu_alt_info_emmc=rawemmc mmc 0 3751936\0" \ | 353 | "dfu_alt_info_emmc=rawemmc mmc 0 3751936\0" \ |
354 | DFU_ALT_INFO_MMC \ | 354 | DFU_ALT_INFO_MMC \ |
355 | DFU_ALT_INFO_RAM \ | 355 | DFU_ALT_INFO_RAM \ |
356 | DFU_ALT_INFO_NAND | 356 | DFU_ALT_INFO_NAND |
357 | 357 | ||
358 | /* | 358 | /* |
359 | * Default to using SPI for environment, etc. | 359 | * Default to using SPI for environment, etc. |
360 | * 0x000000 - 0x020000 : SPL (128KiB) | 360 | * 0x000000 - 0x020000 : SPL (128KiB) |
361 | * 0x020000 - 0x0A0000 : U-Boot (512KiB) | 361 | * 0x020000 - 0x0A0000 : U-Boot (512KiB) |
362 | * 0x0A0000 - 0x0BFFFF : First copy of U-Boot Environment (128KiB) | 362 | * 0x0A0000 - 0x0BFFFF : First copy of U-Boot Environment (128KiB) |
363 | * 0x0C0000 - 0x0DFFFF : Second copy of U-Boot Environment (128KiB) | 363 | * 0x0C0000 - 0x0DFFFF : Second copy of U-Boot Environment (128KiB) |
364 | * 0x0E0000 - 0x442000 : Linux Kernel | 364 | * 0x0E0000 - 0x442000 : Linux Kernel |
365 | * 0x442000 - 0x800000 : Userland | 365 | * 0x442000 - 0x800000 : Userland |
366 | */ | 366 | */ |
367 | #if defined(CONFIG_SPI_BOOT) | 367 | #if defined(CONFIG_SPI_BOOT) |
368 | #define CONFIG_ENV_IS_IN_SPI_FLASH | 368 | #define CONFIG_ENV_IS_IN_SPI_FLASH |
369 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT | 369 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT |
370 | #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED | 370 | #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED |
371 | #define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */ | 371 | #define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */ |
372 | #define CONFIG_ENV_OFFSET (768 << 10) /* 768 KiB in */ | 372 | #define CONFIG_ENV_OFFSET (768 << 10) /* 768 KiB in */ |
373 | #define CONFIG_ENV_OFFSET_REDUND (896 << 10) /* 896 KiB in */ | 373 | #define CONFIG_ENV_OFFSET_REDUND (896 << 10) /* 896 KiB in */ |
374 | #define MTDIDS_DEFAULT "nor0=m25p80-flash.0" | 374 | #define MTDIDS_DEFAULT "nor0=m25p80-flash.0" |
375 | #define MTDPARTS_DEFAULT "mtdparts=m25p80-flash.0:128k(SPL)," \ | 375 | #define MTDPARTS_DEFAULT "mtdparts=m25p80-flash.0:128k(SPL)," \ |
376 | "512k(u-boot),128k(u-boot-env1)," \ | 376 | "512k(u-boot),128k(u-boot-env1)," \ |
377 | "128k(u-boot-env2),3464k(kernel)," \ | 377 | "128k(u-boot-env2),3464k(kernel)," \ |
378 | "-(rootfs)" | 378 | "-(rootfs)" |
379 | #elif defined(CONFIG_EMMC_BOOT) | 379 | #elif defined(CONFIG_EMMC_BOOT) |
380 | #undef CONFIG_ENV_IS_NOWHERE | 380 | #undef CONFIG_ENV_IS_NOWHERE |
381 | #define CONFIG_ENV_IS_IN_MMC | 381 | #define CONFIG_ENV_IS_IN_MMC |
382 | #define CONFIG_SYS_MMC_ENV_DEV 1 | 382 | #define CONFIG_SYS_MMC_ENV_DEV 1 |
383 | #define CONFIG_SYS_MMC_ENV_PART 2 | 383 | #define CONFIG_SYS_MMC_ENV_PART 2 |
384 | #define CONFIG_ENV_OFFSET 0x0 | 384 | #define CONFIG_ENV_OFFSET 0x0 |
385 | #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) | 385 | #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) |
386 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT | 386 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT |
387 | #endif | 387 | #endif |
388 | 388 | ||
389 | /* SPI flash. */ | 389 | /* SPI flash. */ |
390 | #define CONFIG_CMD_SF | 390 | #define CONFIG_CMD_SF |
391 | #define CONFIG_SPI_FLASH | 391 | #define CONFIG_SPI_FLASH |
392 | #define CONFIG_SPI_FLASH_WINBOND | 392 | #define CONFIG_SPI_FLASH_WINBOND |
393 | #define CONFIG_SF_DEFAULT_SPEED 24000000 | 393 | #define CONFIG_SF_DEFAULT_SPEED 24000000 |
394 | 394 | ||
395 | /* Network. */ | 395 | /* Network. */ |
396 | #define CONFIG_PHY_GIGE | 396 | #define CONFIG_PHY_GIGE |
397 | #define CONFIG_PHYLIB | 397 | #define CONFIG_PHYLIB |
398 | #define CONFIG_PHY_SMSC | 398 | #define CONFIG_PHY_SMSC |
399 | 399 | ||
400 | /* NAND support */ | 400 | /* NAND support */ |
401 | #ifdef CONFIG_NAND | 401 | #ifdef CONFIG_NAND |
402 | #define CONFIG_CMD_NAND | 402 | #define CONFIG_CMD_NAND |
403 | #if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT) | 403 | #if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT) |
404 | #define MTDIDS_DEFAULT "nand0=omap2-nand.0" | 404 | #define MTDIDS_DEFAULT "nand0=omap2-nand.0" |
405 | #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:128k(SPL)," \ | 405 | #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:128k(SPL)," \ |
406 | "128k(SPL.backup1)," \ | 406 | "128k(SPL.backup1)," \ |
407 | "128k(SPL.backup2)," \ | 407 | "128k(SPL.backup2)," \ |
408 | "128k(SPL.backup3),1792k(u-boot)," \ | 408 | "128k(SPL.backup3),1792k(u-boot)," \ |
409 | "128k(u-boot-spl-os)," \ | 409 | "128k(u-boot-spl-os)," \ |
410 | "128k(u-boot-env),5m(kernel),-(rootfs)" | 410 | "128k(u-boot-env),5m(kernel),-(rootfs)" |
411 | #define CONFIG_ENV_IS_IN_NAND | 411 | #define CONFIG_ENV_IS_IN_NAND |
412 | #define CONFIG_ENV_OFFSET 0x260000 /* environment starts here */ | 412 | #define CONFIG_ENV_OFFSET 0x260000 /* environment starts here */ |
413 | #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */ | 413 | #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */ |
414 | #endif | 414 | #endif |
415 | #endif | 415 | #endif |
416 | 416 | ||
417 | /* | 417 | /* |
418 | * NOR Size = 16 MiB | 418 | * NOR Size = 16 MiB |
419 | * Number of Sectors/Blocks = 128 | 419 | * Number of Sectors/Blocks = 128 |
420 | * Sector Size = 128 KiB | 420 | * Sector Size = 128 KiB |
421 | * Word length = 16 bits | 421 | * Word length = 16 bits |
422 | * Default layout: | 422 | * Default layout: |
423 | * 0x000000 - 0x07FFFF : U-Boot (512 KiB) | 423 | * 0x000000 - 0x07FFFF : U-Boot (512 KiB) |
424 | * 0x080000 - 0x09FFFF : First copy of U-Boot Environment (128 KiB) | 424 | * 0x080000 - 0x09FFFF : First copy of U-Boot Environment (128 KiB) |
425 | * 0x0A0000 - 0x0BFFFF : Second copy of U-Boot Environment (128 KiB) | 425 | * 0x0A0000 - 0x0BFFFF : Second copy of U-Boot Environment (128 KiB) |
426 | * 0x0C0000 - 0x4BFFFF : Linux Kernel (4 MiB) | 426 | * 0x0C0000 - 0x4BFFFF : Linux Kernel (4 MiB) |
427 | * 0x4C0000 - 0xFFFFFF : Userland (11 MiB + 256 KiB) | 427 | * 0x4C0000 - 0xFFFFFF : Userland (11 MiB + 256 KiB) |
428 | */ | 428 | */ |
429 | #if defined(CONFIG_NOR) | 429 | #if defined(CONFIG_NOR) |
430 | #undef CONFIG_SYS_NO_FLASH | 430 | #undef CONFIG_SYS_NO_FLASH |
431 | #define CONFIG_CMD_FLASH | 431 | #define CONFIG_CMD_FLASH |
432 | #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE | 432 | #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE |
433 | #define CONFIG_SYS_FLASH_PROTECTION | 433 | #define CONFIG_SYS_FLASH_PROTECTION |
434 | #define CONFIG_SYS_FLASH_CFI | 434 | #define CONFIG_SYS_FLASH_CFI |
435 | #define CONFIG_FLASH_CFI_DRIVER | 435 | #define CONFIG_FLASH_CFI_DRIVER |
436 | #define CONFIG_FLASH_CFI_MTD | 436 | #define CONFIG_FLASH_CFI_MTD |
437 | #define CONFIG_SYS_MAX_FLASH_SECT 128 | 437 | #define CONFIG_SYS_MAX_FLASH_SECT 128 |
438 | #define CONFIG_SYS_MAX_FLASH_BANKS 1 | 438 | #define CONFIG_SYS_MAX_FLASH_BANKS 1 |
439 | #define CONFIG_SYS_FLASH_BASE (0x08000000) | 439 | #define CONFIG_SYS_FLASH_BASE (0x08000000) |
440 | #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT | 440 | #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT |
441 | #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE | 441 | #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE |
442 | /* Reduce SPL size by removing unlikey targets */ | 442 | /* Reduce SPL size by removing unlikey targets */ |
443 | #undef CONFIG_SPL_SPI_SUPPORT | 443 | #undef CONFIG_SPL_SPI_SUPPORT |
444 | #ifdef CONFIG_NOR_BOOT | 444 | #ifdef CONFIG_NOR_BOOT |
445 | #define CONFIG_ENV_IS_IN_FLASH | 445 | #define CONFIG_ENV_IS_IN_FLASH |
446 | #define CONFIG_ENV_SECT_SIZE (128 << 10) /* 128 KiB */ | 446 | #define CONFIG_ENV_SECT_SIZE (128 << 10) /* 128 KiB */ |
447 | #define CONFIG_ENV_OFFSET (512 << 10) /* 512 KiB */ | 447 | #define CONFIG_ENV_OFFSET (512 << 10) /* 512 KiB */ |
448 | #define CONFIG_ENV_OFFSET_REDUND (768 << 10) /* 768 KiB */ | 448 | #define CONFIG_ENV_OFFSET_REDUND (768 << 10) /* 768 KiB */ |
449 | #define MTDIDS_DEFAULT "nor0=physmap-flash.0" | 449 | #define MTDIDS_DEFAULT "nor0=physmap-flash.0" |
450 | #define MTDPARTS_DEFAULT "mtdparts=physmap-flash.0:" \ | 450 | #define MTDPARTS_DEFAULT "mtdparts=physmap-flash.0:" \ |
451 | "512k(u-boot)," \ | 451 | "512k(u-boot)," \ |
452 | "128k(u-boot-env1)," \ | 452 | "128k(u-boot-env1)," \ |
453 | "128k(u-boot-env2)," \ | 453 | "128k(u-boot-env2)," \ |
454 | "4m(kernel),-(rootfs)" | 454 | "4m(kernel),-(rootfs)" |
455 | #endif | 455 | #endif |
456 | #endif /* NOR support */ | 456 | #endif /* NOR support */ |
457 | 457 | ||
458 | #endif /* ! __CONFIG_AM335X_EVM_H */ | 458 | #endif /* ! __CONFIG_AM335X_EVM_H */ |
459 | 459 |
include/configs/trats.h
1 | /* | 1 | /* |
2 | * Copyright (C) 2011 Samsung Electronics | 2 | * Copyright (C) 2011 Samsung Electronics |
3 | * Heungjun Kim <riverful.kim@samsung.com> | 3 | * Heungjun Kim <riverful.kim@samsung.com> |
4 | * | 4 | * |
5 | * Configuation settings for the SAMSUNG TRATS (EXYNOS4210) board. | 5 | * Configuation settings for the SAMSUNG TRATS (EXYNOS4210) board. |
6 | * | 6 | * |
7 | * SPDX-License-Identifier: GPL-2.0+ | 7 | * SPDX-License-Identifier: GPL-2.0+ |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef __CONFIG_TRATS_H | 10 | #ifndef __CONFIG_TRATS_H |
11 | #define __CONFIG_TRATS_H | 11 | #define __CONFIG_TRATS_H |
12 | 12 | ||
13 | #include <configs/exynos4-dt.h> | 13 | #include <configs/exynos4-dt.h> |
14 | 14 | ||
15 | #define CONFIG_SYS_PROMPT "Trats # " /* Monitor Command Prompt */ | 15 | #define CONFIG_SYS_PROMPT "Trats # " /* Monitor Command Prompt */ |
16 | 16 | ||
17 | #define CONFIG_TRATS | 17 | #define CONFIG_TRATS |
18 | 18 | ||
19 | #undef CONFIG_DEFAULT_DEVICE_TREE | 19 | #undef CONFIG_DEFAULT_DEVICE_TREE |
20 | #define CONFIG_DEFAULT_DEVICE_TREE exynos4210-trats | 20 | #define CONFIG_DEFAULT_DEVICE_TREE exynos4210-trats |
21 | 21 | ||
22 | #define CONFIG_TIZEN /* TIZEN lib */ | 22 | #define CONFIG_TIZEN /* TIZEN lib */ |
23 | 23 | ||
24 | #define CONFIG_SYS_L2CACHE_OFF | 24 | #define CONFIG_SYS_L2CACHE_OFF |
25 | #ifndef CONFIG_SYS_L2CACHE_OFF | 25 | #ifndef CONFIG_SYS_L2CACHE_OFF |
26 | #define CONFIG_SYS_L2_PL310 | 26 | #define CONFIG_SYS_L2_PL310 |
27 | #define CONFIG_SYS_PL310_BASE 0x10502000 | 27 | #define CONFIG_SYS_PL310_BASE 0x10502000 |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | /* TRATS has 4 banks of DRAM */ | 30 | /* TRATS has 4 banks of DRAM */ |
31 | #define CONFIG_NR_DRAM_BANKS 4 | 31 | #define CONFIG_NR_DRAM_BANKS 4 |
32 | #define CONFIG_SYS_SDRAM_BASE 0x40000000 | 32 | #define CONFIG_SYS_SDRAM_BASE 0x40000000 |
33 | #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE | 33 | #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE |
34 | #define CONFIG_SYS_TEXT_BASE 0x63300000 | 34 | #define CONFIG_SYS_TEXT_BASE 0x63300000 |
35 | #define SDRAM_BANK_SIZE (256 << 20) /* 256 MB */ | 35 | #define SDRAM_BANK_SIZE (256 << 20) /* 256 MB */ |
36 | 36 | ||
37 | /* memtest works on */ | 37 | /* memtest works on */ |
38 | #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE | 38 | #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE |
39 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x5000000) | 39 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x5000000) |
40 | #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x4800000) | 40 | #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x4800000) |
41 | 41 | ||
42 | #define CONFIG_SYS_TEXT_BASE 0x63300000 | 42 | #define CONFIG_SYS_TEXT_BASE 0x63300000 |
43 | 43 | ||
44 | #include <linux/sizes.h> | 44 | #include <linux/sizes.h> |
45 | /* Size of malloc() pool */ | 45 | /* Size of malloc() pool */ |
46 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (80 * SZ_1M)) | 46 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (80 * SZ_1M)) |
47 | 47 | ||
48 | /* select serial console configuration */ | 48 | /* select serial console configuration */ |
49 | #define CONFIG_SERIAL2 | 49 | #define CONFIG_SERIAL2 |
50 | #define CONFIG_BAUDRATE 115200 | 50 | #define CONFIG_BAUDRATE 115200 |
51 | 51 | ||
52 | /* Console configuration */ | 52 | /* Console configuration */ |
53 | #define CONFIG_SYS_CONSOLE_INFO_QUIET | 53 | #define CONFIG_SYS_CONSOLE_INFO_QUIET |
54 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV | 54 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV |
55 | 55 | ||
56 | /* MACH_TYPE_TRATS macro will be removed once added to mach-types */ | 56 | /* MACH_TYPE_TRATS macro will be removed once added to mach-types */ |
57 | #define MACH_TYPE_TRATS 3928 | 57 | #define MACH_TYPE_TRATS 3928 |
58 | #define CONFIG_MACH_TYPE MACH_TYPE_TRATS | 58 | #define CONFIG_MACH_TYPE MACH_TYPE_TRATS |
59 | 59 | ||
60 | #define CONFIG_BOOTARGS "Please use defined boot" | 60 | #define CONFIG_BOOTARGS "Please use defined boot" |
61 | #define CONFIG_BOOTCOMMAND "run mmcboot" | 61 | #define CONFIG_BOOTCOMMAND "run mmcboot" |
62 | #define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0" | 62 | #define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0" |
63 | 63 | ||
64 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \ | 64 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \ |
65 | - GENERATED_GBL_DATA_SIZE) | 65 | - GENERATED_GBL_DATA_SIZE) |
66 | 66 | ||
67 | #define CONFIG_SYS_MEM_TOP_HIDE (1 << 20) /* ram console */ | 67 | #define CONFIG_SYS_MEM_TOP_HIDE (1 << 20) /* ram console */ |
68 | 68 | ||
69 | #define CONFIG_SYS_MONITOR_BASE 0x00000000 | 69 | #define CONFIG_SYS_MONITOR_BASE 0x00000000 |
70 | 70 | ||
71 | #define CONFIG_BOOTBLOCK "10" | 71 | #define CONFIG_BOOTBLOCK "10" |
72 | #define CONFIG_ENV_COMMON_BOOT "${console} ${meminfo}" | 72 | #define CONFIG_ENV_COMMON_BOOT "${console} ${meminfo}" |
73 | 73 | ||
74 | #define CONFIG_ENV_IS_IN_MMC | 74 | #define CONFIG_ENV_IS_IN_MMC |
75 | #define CONFIG_SYS_MMC_ENV_DEV CONFIG_MMC_DEFAULT_DEV | 75 | #define CONFIG_SYS_MMC_ENV_DEV CONFIG_MMC_DEFAULT_DEV |
76 | #define CONFIG_ENV_SIZE 4096 | 76 | #define CONFIG_ENV_SIZE 4096 |
77 | #define CONFIG_ENV_OFFSET ((32 - 4) << 10) /* 32KiB - 4KiB */ | 77 | #define CONFIG_ENV_OFFSET ((32 - 4) << 10) /* 32KiB - 4KiB */ |
78 | 78 | ||
79 | #define CONFIG_ENV_OVERWRITE | 79 | #define CONFIG_ENV_OVERWRITE |
80 | 80 | ||
81 | #define CONFIG_ENV_VARS_UBOOT_CONFIG | 81 | #define CONFIG_ENV_VARS_UBOOT_CONFIG |
82 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG | 82 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
83 | 83 | ||
84 | /* Tizen - partitions definitions */ | 84 | /* Tizen - partitions definitions */ |
85 | #define PARTS_CSA "csa-mmc" | 85 | #define PARTS_CSA "csa-mmc" |
86 | #define PARTS_BOOT "boot" | 86 | #define PARTS_BOOT "boot" |
87 | #define PARTS_QBOOT "qboot" | 87 | #define PARTS_QBOOT "qboot" |
88 | #define PARTS_CSC "csc" | 88 | #define PARTS_CSC "csc" |
89 | #define PARTS_ROOT "platform" | 89 | #define PARTS_ROOT "platform" |
90 | #define PARTS_DATA "data" | 90 | #define PARTS_DATA "data" |
91 | #define PARTS_UMS "ums" | 91 | #define PARTS_UMS "ums" |
92 | 92 | ||
93 | #define PARTS_DEFAULT \ | 93 | #define PARTS_DEFAULT \ |
94 | "uuid_disk=${uuid_gpt_disk};" \ | 94 | "uuid_disk=${uuid_gpt_disk};" \ |
95 | "name="PARTS_CSA",start=5MiB,size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \ | 95 | "name="PARTS_CSA",start=5MiB,size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \ |
96 | "name="PARTS_BOOT",size=60MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \ | 96 | "name="PARTS_BOOT",size=60MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \ |
97 | "name="PARTS_QBOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_QBOOT"};" \ | 97 | "name="PARTS_QBOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_QBOOT"};" \ |
98 | "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \ | 98 | "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \ |
99 | "name="PARTS_ROOT",size=1536MiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \ | 99 | "name="PARTS_ROOT",size=1536MiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \ |
100 | "name="PARTS_DATA",size=3000MiB,uuid=${uuid_gpt_"PARTS_DATA"};" \ | 100 | "name="PARTS_DATA",size=3000MiB,uuid=${uuid_gpt_"PARTS_DATA"};" \ |
101 | "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \ | 101 | "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \ |
102 | 102 | ||
103 | #define CONFIG_DFU_ALT \ | 103 | #define CONFIG_DFU_ALT \ |
104 | "u-boot mmc 80 400;" \ | 104 | "u-boot raw 0x80 0x400;" \ |
105 | "uImage ext4 0 2;" \ | 105 | "uImage ext4 0 2;" \ |
106 | "modem.bin ext4 0 2;" \ | 106 | "modem.bin ext4 0 2;" \ |
107 | "exynos4210-trats.dtb ext4 0 2;" \ | 107 | "exynos4210-trats.dtb ext4 0 2;" \ |
108 | ""PARTS_CSA" part 0 1;" \ | 108 | ""PARTS_CSA" part 0 1;" \ |
109 | ""PARTS_BOOT" part 0 2;" \ | 109 | ""PARTS_BOOT" part 0 2;" \ |
110 | ""PARTS_QBOOT" part 0 3;" \ | 110 | ""PARTS_QBOOT" part 0 3;" \ |
111 | ""PARTS_CSC" part 0 4;" \ | 111 | ""PARTS_CSC" part 0 4;" \ |
112 | ""PARTS_ROOT" part 0 5;" \ | 112 | ""PARTS_ROOT" part 0 5;" \ |
113 | ""PARTS_DATA" part 0 6;" \ | 113 | ""PARTS_DATA" part 0 6;" \ |
114 | ""PARTS_UMS" part 0 7;" \ | 114 | ""PARTS_UMS" part 0 7;" \ |
115 | "params.bin mmc 0x38 0x8\0" | 115 | "params.bin raw 0x38 0x8\0" |
116 | 116 | ||
117 | #define CONFIG_EXTRA_ENV_SETTINGS \ | 117 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
118 | "bootk=" \ | 118 | "bootk=" \ |
119 | "run loaduimage;" \ | 119 | "run loaduimage;" \ |
120 | "if run loaddtb; then " \ | 120 | "if run loaddtb; then " \ |
121 | "bootm 0x40007FC0 - ${fdtaddr};" \ | 121 | "bootm 0x40007FC0 - ${fdtaddr};" \ |
122 | "fi;" \ | 122 | "fi;" \ |
123 | "bootm 0x40007FC0;\0" \ | 123 | "bootm 0x40007FC0;\0" \ |
124 | "updatemmc=" \ | 124 | "updatemmc=" \ |
125 | "mmc boot 0 1 1 1; mmc write 0 0x42008000 0 0x200;" \ | 125 | "mmc boot 0 1 1 1; mmc write 0 0x42008000 0 0x200;" \ |
126 | "mmc boot 0 1 1 0\0" \ | 126 | "mmc boot 0 1 1 0\0" \ |
127 | "updatebackup=" \ | 127 | "updatebackup=" \ |
128 | "mmc boot 0 1 1 2; mmc write 0 0x42100000 0 0x200;" \ | 128 | "mmc boot 0 1 1 2; mmc write 0 0x42100000 0 0x200;" \ |
129 | "mmc boot 0 1 1 0\0" \ | 129 | "mmc boot 0 1 1 0\0" \ |
130 | "updatebootb=" \ | 130 | "updatebootb=" \ |
131 | "mmc read 0 0x42100000 0x80 0x200; run updatebackup\0" \ | 131 | "mmc read 0 0x42100000 0x80 0x200; run updatebackup\0" \ |
132 | "lpj=lpj=3981312\0" \ | 132 | "lpj=lpj=3981312\0" \ |
133 | "nfsboot=" \ | 133 | "nfsboot=" \ |
134 | "setenv bootargs root=/dev/nfs rw " \ | 134 | "setenv bootargs root=/dev/nfs rw " \ |
135 | "nfsroot=${nfsroot},nolock,tcp " \ | 135 | "nfsroot=${nfsroot},nolock,tcp " \ |
136 | "ip=${ipaddr}:${serverip}:${gatewayip}:" \ | 136 | "ip=${ipaddr}:${serverip}:${gatewayip}:" \ |
137 | "${netmask}:generic:usb0:off " CONFIG_ENV_COMMON_BOOT \ | 137 | "${netmask}:generic:usb0:off " CONFIG_ENV_COMMON_BOOT \ |
138 | "; run bootk\0" \ | 138 | "; run bootk\0" \ |
139 | "ramfsboot=" \ | 139 | "ramfsboot=" \ |
140 | "setenv bootargs root=/dev/ram0 rw rootfstype=ext2 " \ | 140 | "setenv bootargs root=/dev/ram0 rw rootfstype=ext2 " \ |
141 | "${console} ${meminfo} " \ | 141 | "${console} ${meminfo} " \ |
142 | "initrd=0x43000000,8M ramdisk=8192\0" \ | 142 | "initrd=0x43000000,8M ramdisk=8192\0" \ |
143 | "mmcboot=" \ | 143 | "mmcboot=" \ |
144 | "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ | 144 | "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ |
145 | "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \ | 145 | "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \ |
146 | "run bootk\0" \ | 146 | "run bootk\0" \ |
147 | "bootchart=setenv opts init=/sbin/bootchartd; run bootcmd\0" \ | 147 | "bootchart=setenv opts init=/sbin/bootchartd; run bootcmd\0" \ |
148 | "boottrace=setenv opts initcall_debug; run bootcmd\0" \ | 148 | "boottrace=setenv opts initcall_debug; run bootcmd\0" \ |
149 | "mmcoops=mmc read 0 0x40000000 0x40 8; md 0x40000000 0x400\0" \ | 149 | "mmcoops=mmc read 0 0x40000000 0x40 8; md 0x40000000 0x400\0" \ |
150 | "verify=n\0" \ | 150 | "verify=n\0" \ |
151 | "rootfstype=ext4\0" \ | 151 | "rootfstype=ext4\0" \ |
152 | "console=" CONFIG_DEFAULT_CONSOLE \ | 152 | "console=" CONFIG_DEFAULT_CONSOLE \ |
153 | "meminfo=crashkernel=32M@0x50000000\0" \ | 153 | "meminfo=crashkernel=32M@0x50000000\0" \ |
154 | "nfsroot=/nfsroot/arm\0" \ | 154 | "nfsroot=/nfsroot/arm\0" \ |
155 | "bootblock=" CONFIG_BOOTBLOCK "\0" \ | 155 | "bootblock=" CONFIG_BOOTBLOCK "\0" \ |
156 | "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0 uImage\0" \ | 156 | "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0 uImage\0" \ |
157 | "loaddtb=ext4load mmc ${mmcdev}:${mmcbootpart} ${fdtaddr} " \ | 157 | "loaddtb=ext4load mmc ${mmcdev}:${mmcbootpart} ${fdtaddr} " \ |
158 | "${fdtfile}\0" \ | 158 | "${fdtfile}\0" \ |
159 | "mmcdev=0\0" \ | 159 | "mmcdev=0\0" \ |
160 | "mmcbootpart=2\0" \ | 160 | "mmcbootpart=2\0" \ |
161 | "mmcrootpart=5\0" \ | 161 | "mmcrootpart=5\0" \ |
162 | "opts=always_resume=1\0" \ | 162 | "opts=always_resume=1\0" \ |
163 | "partitions=" PARTS_DEFAULT \ | 163 | "partitions=" PARTS_DEFAULT \ |
164 | "dfu_alt_info=" CONFIG_DFU_ALT \ | 164 | "dfu_alt_info=" CONFIG_DFU_ALT \ |
165 | "spladdr=0x40000100\0" \ | 165 | "spladdr=0x40000100\0" \ |
166 | "splsize=0x200\0" \ | 166 | "splsize=0x200\0" \ |
167 | "splfile=falcon.bin\0" \ | 167 | "splfile=falcon.bin\0" \ |
168 | "spl_export=" \ | 168 | "spl_export=" \ |
169 | "setexpr spl_imgsize ${splsize} + 8 ;" \ | 169 | "setexpr spl_imgsize ${splsize} + 8 ;" \ |
170 | "setenv spl_imgsize 0x${spl_imgsize};" \ | 170 | "setenv spl_imgsize 0x${spl_imgsize};" \ |
171 | "setexpr spl_imgaddr ${spladdr} - 8 ;" \ | 171 | "setexpr spl_imgaddr ${spladdr} - 8 ;" \ |
172 | "setexpr spl_addr_tmp ${spladdr} - 4 ;" \ | 172 | "setexpr spl_addr_tmp ${spladdr} - 4 ;" \ |
173 | "mw.b ${spl_imgaddr} 0x00 ${spl_imgsize};run loaduimage;" \ | 173 | "mw.b ${spl_imgaddr} 0x00 ${spl_imgsize};run loaduimage;" \ |
174 | "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ | 174 | "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ |
175 | "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo};" \ | 175 | "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo};" \ |
176 | "spl export atags 0x40007FC0;" \ | 176 | "spl export atags 0x40007FC0;" \ |
177 | "crc32 ${spladdr} ${splsize} ${spl_imgaddr};" \ | 177 | "crc32 ${spladdr} ${splsize} ${spl_imgaddr};" \ |
178 | "mw.l ${spl_addr_tmp} ${splsize};" \ | 178 | "mw.l ${spl_addr_tmp} ${splsize};" \ |
179 | "ext4write mmc ${mmcdev}:${mmcbootpart}" \ | 179 | "ext4write mmc ${mmcdev}:${mmcbootpart}" \ |
180 | " /${splfile} ${spl_imgaddr} ${spl_imgsize};" \ | 180 | " /${splfile} ${spl_imgaddr} ${spl_imgsize};" \ |
181 | "setenv spl_imgsize;" \ | 181 | "setenv spl_imgsize;" \ |
182 | "setenv spl_imgaddr;" \ | 182 | "setenv spl_imgaddr;" \ |
183 | "setenv spl_addr_tmp;\0" \ | 183 | "setenv spl_addr_tmp;\0" \ |
184 | "fdtaddr=40800000\0" \ | 184 | "fdtaddr=40800000\0" \ |
185 | 185 | ||
186 | /* Falcon mode definitions */ | 186 | /* Falcon mode definitions */ |
187 | #define CONFIG_CMD_SPL | 187 | #define CONFIG_CMD_SPL |
188 | #define CONFIG_SYS_SPL_ARGS_ADDR CONFIG_SYS_SDRAM_BASE + 0x100 | 188 | #define CONFIG_SYS_SPL_ARGS_ADDR CONFIG_SYS_SDRAM_BASE + 0x100 |
189 | 189 | ||
190 | /* GPT */ | 190 | /* GPT */ |
191 | #define CONFIG_RANDOM_UUID | 191 | #define CONFIG_RANDOM_UUID |
192 | 192 | ||
193 | /* I2C */ | 193 | /* I2C */ |
194 | #include <asm/arch/gpio.h> | 194 | #include <asm/arch/gpio.h> |
195 | 195 | ||
196 | #define CONFIG_CMD_I2C | 196 | #define CONFIG_CMD_I2C |
197 | 197 | ||
198 | #define CONFIG_SYS_I2C | 198 | #define CONFIG_SYS_I2C |
199 | #define CONFIG_SYS_I2C_S3C24X0 | 199 | #define CONFIG_SYS_I2C_S3C24X0 |
200 | #define CONFIG_SYS_I2C_S3C24X0_SPEED 100000 | 200 | #define CONFIG_SYS_I2C_S3C24X0_SPEED 100000 |
201 | #define CONFIG_SYS_I2C_S3C24X0_SLAVE 0xFE | 201 | #define CONFIG_SYS_I2C_S3C24X0_SLAVE 0xFE |
202 | #define CONFIG_MAX_I2C_NUM 8 | 202 | #define CONFIG_MAX_I2C_NUM 8 |
203 | #define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */ | 203 | #define CONFIG_SYS_I2C_SOFT /* I2C bit-banged */ |
204 | #define CONFIG_SYS_I2C_SOFT_SPEED 50000 | 204 | #define CONFIG_SYS_I2C_SOFT_SPEED 50000 |
205 | #define CONFIG_SYS_I2C_SOFT_SLAVE 0x7F | 205 | #define CONFIG_SYS_I2C_SOFT_SLAVE 0x7F |
206 | #define CONFIG_SOFT_I2C_READ_REPEATED_START | 206 | #define CONFIG_SOFT_I2C_READ_REPEATED_START |
207 | #define CONFIG_SYS_I2C_INIT_BOARD | 207 | #define CONFIG_SYS_I2C_INIT_BOARD |
208 | 208 | ||
209 | /* I2C FG */ | 209 | /* I2C FG */ |
210 | #define CONFIG_SOFT_I2C_GPIO_SCL exynos4_gpio_get(2, y4, 1) | 210 | #define CONFIG_SOFT_I2C_GPIO_SCL exynos4_gpio_get(2, y4, 1) |
211 | #define CONFIG_SOFT_I2C_GPIO_SDA exynos4_gpio_get(2, y4, 0) | 211 | #define CONFIG_SOFT_I2C_GPIO_SDA exynos4_gpio_get(2, y4, 0) |
212 | 212 | ||
213 | /* POWER */ | 213 | /* POWER */ |
214 | #define CONFIG_POWER | 214 | #define CONFIG_POWER |
215 | #define CONFIG_POWER_I2C | 215 | #define CONFIG_POWER_I2C |
216 | #define CONFIG_POWER_MAX8997 | 216 | #define CONFIG_POWER_MAX8997 |
217 | 217 | ||
218 | #define CONFIG_POWER_FG | 218 | #define CONFIG_POWER_FG |
219 | #define CONFIG_POWER_FG_MAX17042 | 219 | #define CONFIG_POWER_FG_MAX17042 |
220 | #define CONFIG_POWER_MUIC | 220 | #define CONFIG_POWER_MUIC |
221 | #define CONFIG_POWER_MUIC_MAX8997 | 221 | #define CONFIG_POWER_MUIC_MAX8997 |
222 | #define CONFIG_POWER_BATTERY | 222 | #define CONFIG_POWER_BATTERY |
223 | #define CONFIG_POWER_BATTERY_TRATS | 223 | #define CONFIG_POWER_BATTERY_TRATS |
224 | 224 | ||
225 | /* Security subsystem - enable hw_rand() */ | 225 | /* Security subsystem - enable hw_rand() */ |
226 | #define CONFIG_EXYNOS_ACE_SHA | 226 | #define CONFIG_EXYNOS_ACE_SHA |
227 | #define CONFIG_LIB_HW_RAND | 227 | #define CONFIG_LIB_HW_RAND |
228 | 228 | ||
229 | /* Common misc for Samsung */ | 229 | /* Common misc for Samsung */ |
230 | #define CONFIG_MISC_COMMON | 230 | #define CONFIG_MISC_COMMON |
231 | 231 | ||
232 | #define CONFIG_MISC_INIT_R | 232 | #define CONFIG_MISC_INIT_R |
233 | 233 | ||
234 | /* Download menu - Samsung common */ | 234 | /* Download menu - Samsung common */ |
235 | #define CONFIG_LCD_MENU | 235 | #define CONFIG_LCD_MENU |
236 | #define CONFIG_LCD_MENU_BOARD | 236 | #define CONFIG_LCD_MENU_BOARD |
237 | 237 | ||
238 | /* Download menu - definitions for check keys */ | 238 | /* Download menu - definitions for check keys */ |
239 | #ifndef __ASSEMBLY__ | 239 | #ifndef __ASSEMBLY__ |
240 | #include <power/max8997_pmic.h> | 240 | #include <power/max8997_pmic.h> |
241 | 241 | ||
242 | #define KEY_PWR_PMIC_NAME "MAX8997_PMIC" | 242 | #define KEY_PWR_PMIC_NAME "MAX8997_PMIC" |
243 | #define KEY_PWR_STATUS_REG MAX8997_REG_STATUS1 | 243 | #define KEY_PWR_STATUS_REG MAX8997_REG_STATUS1 |
244 | #define KEY_PWR_STATUS_MASK (1 << 0) | 244 | #define KEY_PWR_STATUS_MASK (1 << 0) |
245 | #define KEY_PWR_INTERRUPT_REG MAX8997_REG_INT1 | 245 | #define KEY_PWR_INTERRUPT_REG MAX8997_REG_INT1 |
246 | #define KEY_PWR_INTERRUPT_MASK (1 << 0) | 246 | #define KEY_PWR_INTERRUPT_MASK (1 << 0) |
247 | 247 | ||
248 | #define KEY_VOL_UP_GPIO exynos4_gpio_get(2, x2, 0) | 248 | #define KEY_VOL_UP_GPIO exynos4_gpio_get(2, x2, 0) |
249 | #define KEY_VOL_DOWN_GPIO exynos4_gpio_get(2, x2, 1) | 249 | #define KEY_VOL_DOWN_GPIO exynos4_gpio_get(2, x2, 1) |
250 | #endif /* __ASSEMBLY__ */ | 250 | #endif /* __ASSEMBLY__ */ |
251 | 251 | ||
252 | /* LCD console */ | 252 | /* LCD console */ |
253 | #define LCD_BPP LCD_COLOR16 | 253 | #define LCD_BPP LCD_COLOR16 |
254 | #define CONFIG_SYS_WHITE_ON_BLACK | 254 | #define CONFIG_SYS_WHITE_ON_BLACK |
255 | 255 | ||
256 | /* LCD */ | 256 | /* LCD */ |
257 | #define CONFIG_EXYNOS_FB | 257 | #define CONFIG_EXYNOS_FB |
258 | #define CONFIG_LCD | 258 | #define CONFIG_LCD |
259 | #define CONFIG_CMD_BMP | 259 | #define CONFIG_CMD_BMP |
260 | #define CONFIG_BMP_16BPP | 260 | #define CONFIG_BMP_16BPP |
261 | #define CONFIG_FB_ADDR 0x52504000 | 261 | #define CONFIG_FB_ADDR 0x52504000 |
262 | #define CONFIG_S6E8AX0 | 262 | #define CONFIG_S6E8AX0 |
263 | #define CONFIG_EXYNOS_MIPI_DSIM | 263 | #define CONFIG_EXYNOS_MIPI_DSIM |
264 | #define CONFIG_VIDEO_BMP_GZIP | 264 | #define CONFIG_VIDEO_BMP_GZIP |
265 | #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54) | 265 | #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54) |
266 | 266 | ||
267 | #define LCD_XRES 720 | 267 | #define LCD_XRES 720 |
268 | #define LCD_YRES 1280 | 268 | #define LCD_YRES 1280 |
269 | 269 | ||
270 | #endif /* __CONFIG_H */ | 270 | #endif /* __CONFIG_H */ |
271 | 271 |
include/configs/trats2.h
1 | /* | 1 | /* |
2 | * Copyright (C) 2013 Samsung Electronics | 2 | * Copyright (C) 2013 Samsung Electronics |
3 | * Sanghee Kim <sh0130.kim@samsung.com> | 3 | * Sanghee Kim <sh0130.kim@samsung.com> |
4 | * Piotr Wilczek <p.wilczek@samsung.com> | 4 | * Piotr Wilczek <p.wilczek@samsung.com> |
5 | * | 5 | * |
6 | * Configuation settings for the SAMSUNG TRATS2 (EXYNOS4412) board. | 6 | * Configuation settings for the SAMSUNG TRATS2 (EXYNOS4412) board. |
7 | * | 7 | * |
8 | * SPDX-License-Identifier: GPL-2.0+ | 8 | * SPDX-License-Identifier: GPL-2.0+ |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifndef __CONFIG_TRATS2_H | 11 | #ifndef __CONFIG_TRATS2_H |
12 | #define __CONFIG_TRATS2_H | 12 | #define __CONFIG_TRATS2_H |
13 | 13 | ||
14 | #include <configs/exynos4-dt.h> | 14 | #include <configs/exynos4-dt.h> |
15 | 15 | ||
16 | #define CONFIG_SYS_PROMPT "Trats2 # " /* Monitor Command Prompt */ | 16 | #define CONFIG_SYS_PROMPT "Trats2 # " /* Monitor Command Prompt */ |
17 | 17 | ||
18 | #undef CONFIG_DEFAULT_DEVICE_TREE | 18 | #undef CONFIG_DEFAULT_DEVICE_TREE |
19 | #define CONFIG_DEFAULT_DEVICE_TREE exynos4412-trats2 | 19 | #define CONFIG_DEFAULT_DEVICE_TREE exynos4412-trats2 |
20 | 20 | ||
21 | #define CONFIG_TIZEN /* TIZEN lib */ | 21 | #define CONFIG_TIZEN /* TIZEN lib */ |
22 | 22 | ||
23 | #define CONFIG_SYS_L2CACHE_OFF | 23 | #define CONFIG_SYS_L2CACHE_OFF |
24 | #ifndef CONFIG_SYS_L2CACHE_OFF | 24 | #ifndef CONFIG_SYS_L2CACHE_OFF |
25 | #define CONFIG_SYS_L2_PL310 | 25 | #define CONFIG_SYS_L2_PL310 |
26 | #define CONFIG_SYS_PL310_BASE 0x10502000 | 26 | #define CONFIG_SYS_PL310_BASE 0x10502000 |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | /* TRATS2 has 4 banks of DRAM */ | 29 | /* TRATS2 has 4 banks of DRAM */ |
30 | #define CONFIG_NR_DRAM_BANKS 4 | 30 | #define CONFIG_NR_DRAM_BANKS 4 |
31 | #define CONFIG_SYS_SDRAM_BASE 0x40000000 | 31 | #define CONFIG_SYS_SDRAM_BASE 0x40000000 |
32 | #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE | 32 | #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE |
33 | #define SDRAM_BANK_SIZE (256 << 20) /* 256 MB */ | 33 | #define SDRAM_BANK_SIZE (256 << 20) /* 256 MB */ |
34 | /* memtest works on */ | 34 | /* memtest works on */ |
35 | #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE | 35 | #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE |
36 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x5E00000) | 36 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x5E00000) |
37 | #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x3E00000) | 37 | #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x3E00000) |
38 | 38 | ||
39 | #define CONFIG_SYS_TEXT_BASE 0x43e00000 | 39 | #define CONFIG_SYS_TEXT_BASE 0x43e00000 |
40 | 40 | ||
41 | #include <linux/sizes.h> | 41 | #include <linux/sizes.h> |
42 | /* Size of malloc() pool */ | 42 | /* Size of malloc() pool */ |
43 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (80 * SZ_1M)) | 43 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (80 * SZ_1M)) |
44 | 44 | ||
45 | /* select serial console configuration */ | 45 | /* select serial console configuration */ |
46 | #define CONFIG_SERIAL2 | 46 | #define CONFIG_SERIAL2 |
47 | #define CONFIG_BAUDRATE 115200 | 47 | #define CONFIG_BAUDRATE 115200 |
48 | 48 | ||
49 | /* Console configuration */ | 49 | /* Console configuration */ |
50 | #define CONFIG_SYS_CONSOLE_INFO_QUIET | 50 | #define CONFIG_SYS_CONSOLE_INFO_QUIET |
51 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV | 51 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV |
52 | 52 | ||
53 | #define CONFIG_BOOTARGS "Please use defined boot" | 53 | #define CONFIG_BOOTARGS "Please use defined boot" |
54 | #define CONFIG_BOOTCOMMAND "run mmcboot" | 54 | #define CONFIG_BOOTCOMMAND "run mmcboot" |
55 | #define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0" | 55 | #define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0" |
56 | 56 | ||
57 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \ | 57 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \ |
58 | - GENERATED_GBL_DATA_SIZE) | 58 | - GENERATED_GBL_DATA_SIZE) |
59 | 59 | ||
60 | #define CONFIG_SYS_MEM_TOP_HIDE (1 << 20) /* ram console */ | 60 | #define CONFIG_SYS_MEM_TOP_HIDE (1 << 20) /* ram console */ |
61 | 61 | ||
62 | #define CONFIG_SYS_MONITOR_BASE 0x00000000 | 62 | #define CONFIG_SYS_MONITOR_BASE 0x00000000 |
63 | 63 | ||
64 | #define CONFIG_ENV_IS_IN_MMC | 64 | #define CONFIG_ENV_IS_IN_MMC |
65 | #define CONFIG_SYS_MMC_ENV_DEV CONFIG_MMC_DEFAULT_DEV | 65 | #define CONFIG_SYS_MMC_ENV_DEV CONFIG_MMC_DEFAULT_DEV |
66 | #define CONFIG_ENV_SIZE 4096 | 66 | #define CONFIG_ENV_SIZE 4096 |
67 | #define CONFIG_ENV_OFFSET ((32 - 4) << 10) /* 32KiB - 4KiB */ | 67 | #define CONFIG_ENV_OFFSET ((32 - 4) << 10) /* 32KiB - 4KiB */ |
68 | 68 | ||
69 | #define CONFIG_ENV_OVERWRITE | 69 | #define CONFIG_ENV_OVERWRITE |
70 | 70 | ||
71 | #define CONFIG_ENV_VARS_UBOOT_CONFIG | 71 | #define CONFIG_ENV_VARS_UBOOT_CONFIG |
72 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG | 72 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
73 | 73 | ||
74 | /* Tizen - partitions definitions */ | 74 | /* Tizen - partitions definitions */ |
75 | #define PARTS_CSA "csa-mmc" | 75 | #define PARTS_CSA "csa-mmc" |
76 | #define PARTS_BOOT "boot" | 76 | #define PARTS_BOOT "boot" |
77 | #define PARTS_QBOOT "qboot" | 77 | #define PARTS_QBOOT "qboot" |
78 | #define PARTS_CSC "csc" | 78 | #define PARTS_CSC "csc" |
79 | #define PARTS_ROOT "platform" | 79 | #define PARTS_ROOT "platform" |
80 | #define PARTS_DATA "data" | 80 | #define PARTS_DATA "data" |
81 | #define PARTS_UMS "ums" | 81 | #define PARTS_UMS "ums" |
82 | 82 | ||
83 | #define PARTS_DEFAULT \ | 83 | #define PARTS_DEFAULT \ |
84 | "uuid_disk=${uuid_gpt_disk};" \ | 84 | "uuid_disk=${uuid_gpt_disk};" \ |
85 | "name="PARTS_CSA",start=5MiB,size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \ | 85 | "name="PARTS_CSA",start=5MiB,size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \ |
86 | "name="PARTS_BOOT",size=60MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \ | 86 | "name="PARTS_BOOT",size=60MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \ |
87 | "name="PARTS_QBOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_QBOOT"};" \ | 87 | "name="PARTS_QBOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_QBOOT"};" \ |
88 | "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \ | 88 | "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \ |
89 | "name="PARTS_ROOT",size=1536MiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \ | 89 | "name="PARTS_ROOT",size=1536MiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \ |
90 | "name="PARTS_DATA",size=3000MiB,uuid=${uuid_gpt_"PARTS_DATA"};" \ | 90 | "name="PARTS_DATA",size=3000MiB,uuid=${uuid_gpt_"PARTS_DATA"};" \ |
91 | "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \ | 91 | "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \ |
92 | 92 | ||
93 | #define CONFIG_DFU_ALT \ | 93 | #define CONFIG_DFU_ALT \ |
94 | "u-boot mmc 80 800;" \ | 94 | "u-boot raw 0x80 0x800;" \ |
95 | "uImage ext4 0 2;" \ | 95 | "uImage ext4 0 2;" \ |
96 | "modem.bin ext4 0 2;" \ | 96 | "modem.bin ext4 0 2;" \ |
97 | "exynos4412-trats2.dtb ext4 0 2;" \ | 97 | "exynos4412-trats2.dtb ext4 0 2;" \ |
98 | ""PARTS_CSA" part 0 1;" \ | 98 | ""PARTS_CSA" part 0 1;" \ |
99 | ""PARTS_BOOT" part 0 2;" \ | 99 | ""PARTS_BOOT" part 0 2;" \ |
100 | ""PARTS_QBOOT" part 0 3;" \ | 100 | ""PARTS_QBOOT" part 0 3;" \ |
101 | ""PARTS_CSC" part 0 4;" \ | 101 | ""PARTS_CSC" part 0 4;" \ |
102 | ""PARTS_ROOT" part 0 5;" \ | 102 | ""PARTS_ROOT" part 0 5;" \ |
103 | ""PARTS_DATA" part 0 6;" \ | 103 | ""PARTS_DATA" part 0 6;" \ |
104 | ""PARTS_UMS" part 0 7;" \ | 104 | ""PARTS_UMS" part 0 7;" \ |
105 | "params.bin mmc 0x38 0x8\0" | 105 | "params.bin raw 0x38 0x8\0" |
106 | 106 | ||
107 | #define CONFIG_EXTRA_ENV_SETTINGS \ | 107 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
108 | "bootk=" \ | 108 | "bootk=" \ |
109 | "run loaduimage;" \ | 109 | "run loaduimage;" \ |
110 | "if run loaddtb; then " \ | 110 | "if run loaddtb; then " \ |
111 | "bootm 0x40007FC0 - ${fdtaddr};" \ | 111 | "bootm 0x40007FC0 - ${fdtaddr};" \ |
112 | "fi;" \ | 112 | "fi;" \ |
113 | "bootm 0x40007FC0;\0" \ | 113 | "bootm 0x40007FC0;\0" \ |
114 | "updatemmc=" \ | 114 | "updatemmc=" \ |
115 | "mmc boot 0 1 1 1; mmc write 0x42008000 0 0x200;" \ | 115 | "mmc boot 0 1 1 1; mmc write 0x42008000 0 0x200;" \ |
116 | "mmc boot 0 1 1 0\0" \ | 116 | "mmc boot 0 1 1 0\0" \ |
117 | "updatebackup=" \ | 117 | "updatebackup=" \ |
118 | "mmc boot 0 1 1 2; mmc write 0x42100000 0 0x200;" \ | 118 | "mmc boot 0 1 1 2; mmc write 0x42100000 0 0x200;" \ |
119 | " mmc boot 0 1 1 0\0" \ | 119 | " mmc boot 0 1 1 0\0" \ |
120 | "updatebootb=" \ | 120 | "updatebootb=" \ |
121 | "mmc read 0x51000000 0x80 0x200; run updatebackup\0" \ | 121 | "mmc read 0x51000000 0x80 0x200; run updatebackup\0" \ |
122 | "updateuboot=" \ | 122 | "updateuboot=" \ |
123 | "mmc write 0x50000000 0x80 0x400\0" \ | 123 | "mmc write 0x50000000 0x80 0x400\0" \ |
124 | "mmcboot=" \ | 124 | "mmcboot=" \ |
125 | "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ | 125 | "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ |
126 | "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \ | 126 | "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \ |
127 | "run bootk\0" \ | 127 | "run bootk\0" \ |
128 | "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \ | 128 | "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \ |
129 | "boottrace=setenv opts initcall_debug; run bootcmd\0" \ | 129 | "boottrace=setenv opts initcall_debug; run bootcmd\0" \ |
130 | "verify=n\0" \ | 130 | "verify=n\0" \ |
131 | "rootfstype=ext4\0" \ | 131 | "rootfstype=ext4\0" \ |
132 | "console=" CONFIG_DEFAULT_CONSOLE \ | 132 | "console=" CONFIG_DEFAULT_CONSOLE \ |
133 | "kernelname=uImage\0" \ | 133 | "kernelname=uImage\0" \ |
134 | "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0 " \ | 134 | "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0 " \ |
135 | "${kernelname}\0" \ | 135 | "${kernelname}\0" \ |
136 | "loaddtb=ext4load mmc ${mmcdev}:${mmcbootpart} ${fdtaddr} " \ | 136 | "loaddtb=ext4load mmc ${mmcdev}:${mmcbootpart} ${fdtaddr} " \ |
137 | "${fdtfile}\0" \ | 137 | "${fdtfile}\0" \ |
138 | "mmcdev=" __stringify(CONFIG_MMC_DEFAULT_DEV) "\0" \ | 138 | "mmcdev=" __stringify(CONFIG_MMC_DEFAULT_DEV) "\0" \ |
139 | "mmcbootpart=2\0" \ | 139 | "mmcbootpart=2\0" \ |
140 | "mmcrootpart=5\0" \ | 140 | "mmcrootpart=5\0" \ |
141 | "opts=always_resume=1\0" \ | 141 | "opts=always_resume=1\0" \ |
142 | "partitions=" PARTS_DEFAULT \ | 142 | "partitions=" PARTS_DEFAULT \ |
143 | "dfu_alt_info=" CONFIG_DFU_ALT \ | 143 | "dfu_alt_info=" CONFIG_DFU_ALT \ |
144 | "uartpath=ap\0" \ | 144 | "uartpath=ap\0" \ |
145 | "usbpath=ap\0" \ | 145 | "usbpath=ap\0" \ |
146 | "consoleon=set console console=ttySAC2,115200n8; save; reset\0" \ | 146 | "consoleon=set console console=ttySAC2,115200n8; save; reset\0" \ |
147 | "consoleoff=set console console=ram; save; reset\0" \ | 147 | "consoleoff=set console console=ram; save; reset\0" \ |
148 | "spladdr=0x40000100\0" \ | 148 | "spladdr=0x40000100\0" \ |
149 | "splsize=0x200\0" \ | 149 | "splsize=0x200\0" \ |
150 | "splfile=falcon.bin\0" \ | 150 | "splfile=falcon.bin\0" \ |
151 | "spl_export=" \ | 151 | "spl_export=" \ |
152 | "setexpr spl_imgsize ${splsize} + 8 ;" \ | 152 | "setexpr spl_imgsize ${splsize} + 8 ;" \ |
153 | "setenv spl_imgsize 0x${spl_imgsize};" \ | 153 | "setenv spl_imgsize 0x${spl_imgsize};" \ |
154 | "setexpr spl_imgaddr ${spladdr} - 8 ;" \ | 154 | "setexpr spl_imgaddr ${spladdr} - 8 ;" \ |
155 | "setexpr spl_addr_tmp ${spladdr} - 4 ;" \ | 155 | "setexpr spl_addr_tmp ${spladdr} - 4 ;" \ |
156 | "mw.b ${spl_imgaddr} 0x00 ${spl_imgsize};run loaduimage;" \ | 156 | "mw.b ${spl_imgaddr} 0x00 ${spl_imgsize};run loaduimage;" \ |
157 | "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ | 157 | "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ |
158 | "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo};" \ | 158 | "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo};" \ |
159 | "spl export atags 0x40007FC0;" \ | 159 | "spl export atags 0x40007FC0;" \ |
160 | "crc32 ${spladdr} ${splsize} ${spl_imgaddr};" \ | 160 | "crc32 ${spladdr} ${splsize} ${spl_imgaddr};" \ |
161 | "mw.l ${spl_addr_tmp} ${splsize};" \ | 161 | "mw.l ${spl_addr_tmp} ${splsize};" \ |
162 | "ext4write mmc ${mmcdev}:${mmcbootpart}" \ | 162 | "ext4write mmc ${mmcdev}:${mmcbootpart}" \ |
163 | " /${splfile} ${spl_imgaddr} ${spl_imgsize};" \ | 163 | " /${splfile} ${spl_imgaddr} ${spl_imgsize};" \ |
164 | "setenv spl_imgsize;" \ | 164 | "setenv spl_imgsize;" \ |
165 | "setenv spl_imgaddr;" \ | 165 | "setenv spl_imgaddr;" \ |
166 | "setenv spl_addr_tmp;\0" \ | 166 | "setenv spl_addr_tmp;\0" \ |
167 | "fdtaddr=40800000\0" \ | 167 | "fdtaddr=40800000\0" \ |
168 | 168 | ||
169 | /* GPT */ | 169 | /* GPT */ |
170 | #define CONFIG_RANDOM_UUID | 170 | #define CONFIG_RANDOM_UUID |
171 | 171 | ||
172 | /* I2C */ | 172 | /* I2C */ |
173 | #include <asm/arch/gpio.h> | 173 | #include <asm/arch/gpio.h> |
174 | 174 | ||
175 | #define CONFIG_CMD_I2C | 175 | #define CONFIG_CMD_I2C |
176 | 176 | ||
177 | #define CONFIG_SYS_I2C | 177 | #define CONFIG_SYS_I2C |
178 | #define CONFIG_SYS_I2C_S3C24X0 | 178 | #define CONFIG_SYS_I2C_S3C24X0 |
179 | #define CONFIG_SYS_I2C_S3C24X0_SPEED 100000 | 179 | #define CONFIG_SYS_I2C_S3C24X0_SPEED 100000 |
180 | #define CONFIG_SYS_I2C_S3C24X0_SLAVE 0 | 180 | #define CONFIG_SYS_I2C_S3C24X0_SLAVE 0 |
181 | #define CONFIG_MAX_I2C_NUM 8 | 181 | #define CONFIG_MAX_I2C_NUM 8 |
182 | #define CONFIG_SYS_I2C_SOFT | 182 | #define CONFIG_SYS_I2C_SOFT |
183 | #define CONFIG_SYS_I2C_SOFT_SPEED 50000 | 183 | #define CONFIG_SYS_I2C_SOFT_SPEED 50000 |
184 | #define CONFIG_SYS_I2C_SOFT_SLAVE 0x00 | 184 | #define CONFIG_SYS_I2C_SOFT_SLAVE 0x00 |
185 | #define I2C_SOFT_DECLARATIONS2 | 185 | #define I2C_SOFT_DECLARATIONS2 |
186 | #define CONFIG_SYS_I2C_SOFT_SPEED_2 50000 | 186 | #define CONFIG_SYS_I2C_SOFT_SPEED_2 50000 |
187 | #define CONFIG_SYS_I2C_SOFT_SLAVE_2 0x00 | 187 | #define CONFIG_SYS_I2C_SOFT_SLAVE_2 0x00 |
188 | #define CONFIG_SOFT_I2C_READ_REPEATED_START | 188 | #define CONFIG_SOFT_I2C_READ_REPEATED_START |
189 | #define CONFIG_SYS_I2C_INIT_BOARD | 189 | #define CONFIG_SYS_I2C_INIT_BOARD |
190 | 190 | ||
191 | #ifndef __ASSEMBLY__ | 191 | #ifndef __ASSEMBLY__ |
192 | int get_soft_i2c_scl_pin(void); | 192 | int get_soft_i2c_scl_pin(void); |
193 | int get_soft_i2c_sda_pin(void); | 193 | int get_soft_i2c_sda_pin(void); |
194 | #endif | 194 | #endif |
195 | #define CONFIG_SOFT_I2C_GPIO_SCL get_soft_i2c_scl_pin() | 195 | #define CONFIG_SOFT_I2C_GPIO_SCL get_soft_i2c_scl_pin() |
196 | #define CONFIG_SOFT_I2C_GPIO_SDA get_soft_i2c_sda_pin() | 196 | #define CONFIG_SOFT_I2C_GPIO_SDA get_soft_i2c_sda_pin() |
197 | 197 | ||
198 | /* POWER */ | 198 | /* POWER */ |
199 | #define CONFIG_POWER | 199 | #define CONFIG_POWER |
200 | #define CONFIG_POWER_I2C | 200 | #define CONFIG_POWER_I2C |
201 | #define CONFIG_POWER_MAX77686 | 201 | #define CONFIG_POWER_MAX77686 |
202 | #define CONFIG_POWER_PMIC_MAX77693 | 202 | #define CONFIG_POWER_PMIC_MAX77693 |
203 | #define CONFIG_POWER_MUIC_MAX77693 | 203 | #define CONFIG_POWER_MUIC_MAX77693 |
204 | #define CONFIG_POWER_FG_MAX77693 | 204 | #define CONFIG_POWER_FG_MAX77693 |
205 | #define CONFIG_POWER_BATTERY_TRATS2 | 205 | #define CONFIG_POWER_BATTERY_TRATS2 |
206 | 206 | ||
207 | /* Security subsystem - enable hw_rand() */ | 207 | /* Security subsystem - enable hw_rand() */ |
208 | #define CONFIG_EXYNOS_ACE_SHA | 208 | #define CONFIG_EXYNOS_ACE_SHA |
209 | #define CONFIG_LIB_HW_RAND | 209 | #define CONFIG_LIB_HW_RAND |
210 | 210 | ||
211 | /* Common misc for Samsung */ | 211 | /* Common misc for Samsung */ |
212 | #define CONFIG_MISC_COMMON | 212 | #define CONFIG_MISC_COMMON |
213 | 213 | ||
214 | #define CONFIG_MISC_INIT_R | 214 | #define CONFIG_MISC_INIT_R |
215 | 215 | ||
216 | /* Download menu - Samsung common */ | 216 | /* Download menu - Samsung common */ |
217 | #define CONFIG_LCD_MENU | 217 | #define CONFIG_LCD_MENU |
218 | #define CONFIG_LCD_MENU_BOARD | 218 | #define CONFIG_LCD_MENU_BOARD |
219 | 219 | ||
220 | /* Download menu - definitions for check keys */ | 220 | /* Download menu - definitions for check keys */ |
221 | #ifndef __ASSEMBLY__ | 221 | #ifndef __ASSEMBLY__ |
222 | #include <power/max77686_pmic.h> | 222 | #include <power/max77686_pmic.h> |
223 | 223 | ||
224 | #define KEY_PWR_PMIC_NAME "MAX77686_PMIC" | 224 | #define KEY_PWR_PMIC_NAME "MAX77686_PMIC" |
225 | #define KEY_PWR_STATUS_REG MAX77686_REG_PMIC_STATUS1 | 225 | #define KEY_PWR_STATUS_REG MAX77686_REG_PMIC_STATUS1 |
226 | #define KEY_PWR_STATUS_MASK (1 << 0) | 226 | #define KEY_PWR_STATUS_MASK (1 << 0) |
227 | #define KEY_PWR_INTERRUPT_REG MAX77686_REG_PMIC_INT1 | 227 | #define KEY_PWR_INTERRUPT_REG MAX77686_REG_PMIC_INT1 |
228 | #define KEY_PWR_INTERRUPT_MASK (1 << 1) | 228 | #define KEY_PWR_INTERRUPT_MASK (1 << 1) |
229 | 229 | ||
230 | #define KEY_VOL_UP_GPIO exynos4x12_gpio_get(2, x2, 2) | 230 | #define KEY_VOL_UP_GPIO exynos4x12_gpio_get(2, x2, 2) |
231 | #define KEY_VOL_DOWN_GPIO exynos4x12_gpio_get(2, x3, 3) | 231 | #define KEY_VOL_DOWN_GPIO exynos4x12_gpio_get(2, x3, 3) |
232 | #endif /* __ASSEMBLY__ */ | 232 | #endif /* __ASSEMBLY__ */ |
233 | 233 | ||
234 | /* LCD console */ | 234 | /* LCD console */ |
235 | #define LCD_BPP LCD_COLOR16 | 235 | #define LCD_BPP LCD_COLOR16 |
236 | #define CONFIG_SYS_WHITE_ON_BLACK | 236 | #define CONFIG_SYS_WHITE_ON_BLACK |
237 | 237 | ||
238 | /* LCD */ | 238 | /* LCD */ |
239 | #define CONFIG_EXYNOS_FB | 239 | #define CONFIG_EXYNOS_FB |
240 | #define CONFIG_LCD | 240 | #define CONFIG_LCD |
241 | #define CONFIG_CMD_BMP | 241 | #define CONFIG_CMD_BMP |
242 | #define CONFIG_BMP_16BPP | 242 | #define CONFIG_BMP_16BPP |
243 | #define CONFIG_FB_ADDR 0x52504000 | 243 | #define CONFIG_FB_ADDR 0x52504000 |
244 | #define CONFIG_S6E8AX0 | 244 | #define CONFIG_S6E8AX0 |
245 | #define CONFIG_EXYNOS_MIPI_DSIM | 245 | #define CONFIG_EXYNOS_MIPI_DSIM |
246 | #define CONFIG_VIDEO_BMP_GZIP | 246 | #define CONFIG_VIDEO_BMP_GZIP |
247 | #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54) | 247 | #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54) |
248 | 248 | ||
249 | #define LCD_XRES 720 | 249 | #define LCD_XRES 720 |
250 | #define LCD_YRES 1280 | 250 | #define LCD_YRES 1280 |
251 | 251 | ||
252 | #endif /* __CONFIG_H */ | 252 | #endif /* __CONFIG_H */ |
253 | 253 |