0d2f6a4d26f3963dffbee485bd6cbaee48a04fd0
[fw/openocd] / tcl / board / dm6446evm.cfg
1 # DM6446 EVM board
2 #   http://focus.ti.com/docs/toolsw/folders/print/tmdsevm6446.html
3 #   http://c6000.spectrumdigital.com/davincievm/
4 # EVM is just the board; buy that at Spectrum.
5 # The "kit" from TI also has: video camera, LCD video monitor, more.
6
7 source [find target/ti_dm6446.cfg]
8
9 # J4 controls what CS2 hooks up to, usually NOR or NAND flash.
10 # S3.1/S3.2 controls boot mode, which may force J4 and S3.3 settings.
11 # S3.3 controls AEMIF bus width.
12
13 if { [info exists J4_OPTION] } {
14         # NOR, NAND, SRAM, ...
15         set CS2_MODE $J4_OPTION
16 } else {
17         set CS2_MODE ""
18 }
19
20 # ARM boot:
21 #  S3.1 = 0, S3.2 = 0   ==> ROM/UBL boot via NAND (J4 == NAND)
22 #  S3.1 = 1, S3.2 = 0   ==> AEMIF boot (J4 == NOR or SRAM)
23 #  S3.1 = 0, S3.2 = 1   ==> ROM/UBL boot via HPI
24 #  S3.1 = 1, S3.2 = 1   ==> ROM/UBL boot via UART (J4 == don't care)
25 # AEMIF bus width:
26 #  S3.3 = 0             ==> 8 bit bus width
27 #  S3.3 = 1             ==> 16 bit bus width
28 # DSP boot:
29 #  S3.4 = 0             ==> controlled by ARM
30
31 if { $CS2_MODE == "NOR" } {
32         # 16 Mbytes address space; 16 bit bus width
33         # (older boards used 32MB parts, with upper 16 MB unusable)
34         set _FLASHNAME $_CHIPNAME.flash
35         flash bank $_FLASHNAME cfi 0x02000000 0x01000000 2 2 $_TARGETNAME
36         proc flashprobe {} { flash probe 0 }
37 } elseif { $CS2_MODE == "NAND" } {
38         # 64 Mbyte small page; 8 bit bus width
39         nand device davinci $_TARGETNAME 0x02000000 hwecc1 0x01e00000
40         proc flashprobe {} { nand probe 0 }
41 } elseif { $CS2_MODE == "SRAM" } {
42         # 4 Mbyte address space; 16 bit bus width
43         # loaded via JTAG or HPI
44         proc flashprobe {} {}
45 } else {
46         # maybe it's HPI boot?  can't tell...
47         echo "WARNING:  CS2/flash configuration not recognized"
48         proc flashprobe {} {}
49 }
50
51 # NOTE:  disable or replace this call to dm6446evm_init if you're
52 # debugging new UBL code from SRAM (for NAND boot).
53 $_TARGETNAME configure -event reset-init { dm6446evm_init }
54
55 #
56 # This post-reset init is called when the MMU isn't active, all IRQs
57 # are disabled, etc.  It should do most of what a UBL does, except for
58 # loading code (like U-Boot) into DRAM and running it.
59 #
60 proc dm6446evm_init {} {
61
62         echo "Initialize DM6446 EVM board"
63
64         # FIXME initialize everything:
65         #  - PLL1
66         #  - PLL2
67         #  - PINMUX
68         #  - PSC
69         #  - DDR
70         #  - AEMIF
71         #  - UART0
72         #  - icache
73
74         flashprobe
75 }