diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-09-12 08:11:45 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-09-12 08:11:45 +0000 |
commit | 40f361dd944803e500169337fffe7713842fd632 (patch) | |
tree | ad60e121bbb07e16d7337a14efd8e7e1c8f47bc7 /tcl/board | |
parent | c993d75d1febddc96286b0d41b682ab81bf28684 (diff) | |
download | riscv-openocd-40f361dd944803e500169337fffe7713842fd632.zip riscv-openocd-40f361dd944803e500169337fffe7713842fd632.tar.gz riscv-openocd-40f361dd944803e500169337fffe7713842fd632.tar.bz2 |
David Brownell <david-b@pacbell.net>
Update the board config for the DaVinci DM355 EVM so the reset-init
event handler does the rest of the work it should do:
- minor PLL setup bugfixes
- initialize the DDR2 controller
- probe both NAND banks
- initialize UART0
- enable the icache
git-svn-id: svn://svn.berlios.de/openocd/trunk@2699 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'tcl/board')
-rw-r--r-- | tcl/board/dm355evm.cfg | 87 |
1 files changed, 84 insertions, 3 deletions
diff --git a/tcl/board/dm355evm.cfg b/tcl/board/dm355evm.cfg index 9b32ef9..bb74500 100644 --- a/tcl/board/dm355evm.cfg +++ b/tcl/board/dm355evm.cfg @@ -35,7 +35,7 @@ proc dm355evm_init {} { set addr [dict get $dm355 pllc1] set pll_divs [dict create] dict set pll_divs div3 16 - dict set pll_divs div4 8 + dict set pll_divs div4 4 pll_v02_setup $addr 144 $pll_divs # ARM is now running at 216 MHz, so JTAG can go faster @@ -48,6 +48,7 @@ proc dm355evm_init {} { set addr [dict get $dm355 pllc2] set pll_divs [dict create] + dict set pll_divs div1 1 dict set pll_divs prediv 8 pll_v02_setup $addr 114 $pll_divs @@ -77,7 +78,54 @@ proc dm355evm_init {} { ######################## # DDR2 EMIF - # FIXME setup + # VTPIOCR impedance calibration + set addr [dict get $dm355 sysbase] + set addr [expr $addr + 0x70] + + # clear CLR, LOCK, PWRDN; wait a clock; set CLR + mmw $addr 0 0x20c0 + mmw $addr 0x2000 0 + + # wait for READY + while { [expr [mrw $addr] & 0x8000] == 0 } { sleep 1 } + + # set IO_READY; then LOCK and PWRSAVE; then PWRDN + mmw $addr 0x4000 0 + mmw $addr 0x0180 0 + mmw $addr 0x0040 0 + + # NOTE: this DDR2 initialization sequence borrows from + # both UBL 1.50 and the SPRUEH7D DDR2 EMIF spec. + + # reset (then re-enable) DDR controller + psc_reset 13 + psc_go + psc_enable 13 + psc_go + + # now set it up for Micron MT47H64M16HR-37E @ 171 MHz + + set addr [dict get $dm355 ddr_emif] + + # DDRPHYCR1 + mww [expr $addr + 0xe4] 0x50006404 + + # PBBPR -- burst priority + mww [expr $addr + 0x20] 0xfe + + # SDCR -- unlock boot config; init for DDR2, relock, unlock SDTIM* + mmw [expr $addr + 0x08] 0x00800000 0 + mmw [expr $addr + 0x08] 0x0013c632 0x03870fff + + # SDTIMR, SDTIMR2 + mww [expr $addr + 0x10] 0x2a923249 + mww [expr $addr + 0x14] 0x4c17c763 + + # SDCR -- relock SDTIM* + mmw [expr $addr + 0x08] 0 0x00008000 + + # SDRCR -- refresh rate (171 MHz * 7.8usec) + mww [expr $addr + 0x0c] 1336 ######################## # ASYNC EMIF @@ -98,10 +146,43 @@ proc dm355evm_init {} { # NANDFCR -- only CS0 has NAND mww [expr $addr + 0x60] 0x01 + # default: both chipselects to the NAND socket are used + nand probe 0 + nand probe 1 + ######################## # UART0 - # FIXME setup + set addr [dict get $dm355 uart0] + + # PWREMU_MGNT -- rx + tx in reset + mww [expr $addr + 0x30] 0 + + # DLL, DLH -- 115200 baud + mwb [expr $addr + 0x20] 0x0d + mwb [expr $addr + 0x24] 0x00 + + # FCR - clear and disable FIFOs + mwb [expr $addr + 0x08] 0x07 + mwb [expr $addr + 0x08] 0x00 + + # IER - disable IRQs + mwb [expr $addr + 0x04] 0x00 + + # LCR - 8-N-1 + mwb [expr $addr + 0x0c] 0x03 + + # MCR - no flow control or loopback + mwb [expr $addr + 0x10] 0x00 + + # PWREMU_MGNT -- rx + tx normal, free running during JTAG halt + mww [expr $addr + 0x30] 0xe001 + + + ######################## + + # turn on icache - set I bit in cp15 register c1 + arm926ejs cp15 0 0 1 0 0x00051078 } # NAND -- socket has two chipselects, MT29F16G08FAA puts 1GByte on each one. |