1 # SPDX-License-Identifier: GPL-2.0-or-later
3 # Board configuration file for Amazon Kindle Model No. D00701 and D00801
4 # AKA Kindle 2nd generation and Kindle DX
5 # using a Freescale MCIMX31LDVKN5D i.MX31 processor
7 # Pins at J9 40-Pin FFC-A:
19 source [find target/imx31.cfg]
20 source [find target/imx.cfg]
22 $_TARGETNAME configure -event reset-init { kindle2_init }
23 $_TARGETNAME configure -event reset-start { adapter speed 1000 }
26 set _FLASHNAME $_CHIPNAME.flash
27 flash bank $_FLASHNAME cfi 0xa0000000 0x800000 2 2 $_TARGETNAME
30 $_TARGETNAME configure -work-area-phys 0x1fffc000 \
31 -work-area-size 0x4000 -work-area-backup 0
33 # FIXME: currently SRST is not wired to the system
34 reset_config trst_only
35 jtag_ntrst_assert_width 10
38 # this is broken but enabled by default
39 arm11 memwrite burst disable
42 ftdi tdo_sample_edge falling
44 proc kindle2_init {} {
53 proc kindle2_clock_setup {} {
54 # CCMR: clock from FPM/CKIL
55 mww 0x53f80000 0x074b0b7b
59 mww 0x53f80004 0xff871650
60 mww 0x53f80010 0x00331c23
63 proc kindle2_misc_init { } {
70 mww 0x43f00000 0x77777777
71 mww 0x43f00004 0x77777777
79 mww 0x53f00000 0x77777777
80 mww 0x53f00004 0x77777777
82 # Start 16 bit NorFlash Initialization on CS0
83 mww 0xb8002000 0x0000cc03
84 mww 0xb8002004 0xa0330d01
85 mww 0xb8002008 0x00220800
88 proc disable_mmu_and_cache {} {
89 # Mode Supervisor, disable FIQ, IRQ and imprecise data aborts
94 # invalidate instruction and data cache
95 # MCR CP15, 0, R1, C7, C7, 0
98 # clean and invalidate cache
101 # disable MMU and caches
104 arm mcr 15 0 15 2 4 0
109 # Drain the write buffer
110 arm mcr 15 0 7 10 4 0
112 # start from AIPS 2GB region
113 arm mcr 15 0 15 2 4 0x40000015
116 proc kindle2_sdram_init {} {
117 #--------------------------------------------
118 # Samsung K4X1G323PC-8GC3 32Mx32 Mobile DDR SDRAM
119 #--------------------------------------------
130 mww 0x43fac27c 0x1000
135 # DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10 (0x288..0x2dc)
160 mww 0xb8002000 0x00006602
161 mww 0xb8002004 0x00000501
162 mww 0xb8002008 0x00000000
164 # LPDDR1 Initialization script
165 mww 0xb8001010 0x00000002
166 mww 0xb8001010 0x00000004
167 # ESDCFG0: set timing parameters
168 mww 0xb8001004 0x007fff7f
169 # ESDCTL0: select Prechare-All mode
170 mww 0xb8001000 0x92100000
171 mww 0x80000f00 0x12344321
172 # ESDCTL0: Auto Refresh
173 mww 0xb8001000 0xa2100000
174 mww 0x80000000 0x12344321
175 mww 0x80000000 0x12344321
176 # ESDCTL0: Load Mode Register
177 mww 0xb8001000 0xb2100000
180 # ESDCTL0: enable Auto-Refresh
181 mww 0xb8001000 0x82226080
182 mww 0x80000000 0xdeadbeef