summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/freescale-vf610-twr/flash-header-vf610-twr.imxcfg
blob: 553eae25dd891f26024e396902621d77c4216f82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
soc vf610
loadaddr 0x80000000
dcdofs 0x400

#include <mach/vf610-iomux-regs.h>
#include <mach/vf610-ddrmc-regs.h>

#include <mach/flash-header/vf610-ddr-pll2-400mhz.imxcfg>
#include <mach/flash-header/vf610-iomux-ddr-default.imxcfg>
#include <mach/flash-header/vf610-ddr-cr-default.imxcfg>
#include <mach/flash-header/vf610-ddr-phy-default.imxcfg>

wm 32 DDRMC_CR00 DDRMC_CR00_DRAM_CLASS_DDR3_START

check 32 until_any_bit_set 0x400ae140 0x100

/*
 * Cargo cult DDR controller initialization here we come!
 *
 * Experemintation with VF610 Tower Board shows that without the
 * following code the board would not boot off of SD card when
 * power-cycled. It will however happily boot when reset via SW3/Reset
 * button. For whatever reason the following actions appear to be
 * necessary:
 *
 *          - Initialize DDRMC as usual
 *	    - Issue a read to location in DDR address space
 *	    - Disable DDRMC
 *	    - Enable DDRMC and wait for it to finish initializing
 *
 * I am sure this is all going to be extrememly embarrassing to read
 * if/when the real problem and real solution is found.
 */

/*
 * Because there's no standalone read command what we do here instead
 * is write a pattern to memory and then checking that memory address
 * against that pattern
 */
wm 32 0x80000000 0xa5a5a5a5
check 32 until_any_bit_set 0x80000000 0xa5a5a5a5

wm 32 0x400ae000 0x00000600
wm 32 0x400ae000 0x00000601

check 32 until_any_bit_set 0x400ae140 0x100