1 # Board configuration file for Amazon Kindle Model No. D00701 and D00801
2 # AKA Kindle 2nd generation and Kindle DX
3 # using a Freescale MCIMX31LDVKN5D i.MX31 processor
5 # Pins at J9 40-Pin FFC-A:
17 source [find target/imx31.cfg]
18 source [find target/imx.cfg]
20 $_TARGETNAME configure -event reset-init { kindle2_init }
21 $_TARGETNAME configure -event reset-start { adapter speed 1000 }
24 set _FLASHNAME $_CHIPNAME.flash
25 flash bank $_FLASHNAME cfi 0xa0000000 0x800000 2 2 $_TARGETNAME
28 $_TARGETNAME configure -work-area-phys 0x1fffc000 \
29 -work-area-size 0x4000 -work-area-backup 0
31 # FIXME: currently SRST is not wired to the system
32 reset_config trst_only
33 jtag_ntrst_assert_width 10
36 # this is broken but enabled by default
37 arm11 memwrite burst disable
40 ftdi tdo_sample_edge falling
42 proc kindle2_init {} {
51 proc kindle2_clock_setup {} {
52 # CCMR: clock from FPM/CKIL
53 mww 0x53f80000 0x074b0b7b
57 mww 0x53f80004 0xff871650
58 mww 0x53f80010 0x00331c23
61 proc kindle2_misc_init { } {
68 mww 0x43f00000 0x77777777
69 mww 0x43f00004 0x77777777
77 mww 0x53f00000 0x77777777
78 mww 0x53f00004 0x77777777
80 # Start 16 bit NorFlash Initialization on CS0
81 mww 0xb8002000 0x0000cc03
82 mww 0xb8002004 0xa0330d01
83 mww 0xb8002008 0x00220800
86 proc disable_mmu_and_cache {} {
87 # Mode Supervisor, disable FIQ, IRQ and imprecise data aborts
92 # invalidate instruction and data cache
93 # MCR CP15, 0, R1, C7, C7, 0
96 # clean and invalidate cache
99 # disable MMU and caches
102 arm mcr 15 0 15 2 4 0
107 # Drain the write buffer
108 arm mcr 15 0 7 10 4 0
110 # start from AIPS 2GB region
111 arm mcr 15 0 15 2 4 0x40000015
114 proc kindle2_sdram_init {} {
115 #--------------------------------------------
116 # Samsung K4X1G323PC-8GC3 32Mx32 Mobile DDR SDRAM
117 #--------------------------------------------
128 mww 0x43fac27c 0x1000
133 # DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10 (0x288..0x2dc)
158 mww 0xb8002000 0x00006602
159 mww 0xb8002004 0x00000501
160 mww 0xb8002008 0x00000000
162 # LPDDR1 Initialization script
163 mww 0xb8001010 0x00000002
164 mww 0xb8001010 0x00000004
165 # ESDCFG0: set timing parameters
166 mww 0xb8001004 0x007fff7f
167 # ESDCTL0: select Prechare-All mode
168 mww 0xb8001000 0x92100000
169 mww 0x80000f00 0x12344321
170 # ESDCTL0: Auto Refresh
171 mww 0xb8001000 0xa2100000
172 mww 0x80000000 0x12344321
173 mww 0x80000000 0x12344321
174 # ESDCTL0: Load Mode Register
175 mww 0xb8001000 0xb2100000
178 # ESDCTL0: enable Auto-Refresh
179 mww 0xb8001000 0x82226080
180 mww 0x80000000 0xdeadbeef