tcl/target|board: move common AR9331 code to atheros_ar9331.cfg 99/2999/5
authorAntony Pavlov <antonynpavlov@gmail.com>
Sun, 20 Sep 2015 13:52:37 +0000 (16:52 +0300)
committerPaul Fertser <fercerpav@gmail.com>
Tue, 31 Jul 2018 14:56:31 +0000 (15:56 +0100)
The ar9331_25mhz_pll_init and ar9331_ddr1_init routines
can be used not only for TP-Link MR3020 board,
so move them to the common atheros_ar9331.cfg file.

Change-Id: I04090856b08151d6bb0f5ef9cc654efae1c81835
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2999
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
tcl/board/tp-link_tl-mr3020.cfg
tcl/target/atheros_ar9331.cfg

index 7e040b32538a9c9fe4fe55ff544b99d5ae4625a0..48fb698937aba9b2b1c6fddcc0085f0f14607a53 100644 (file)
@@ -1,39 +1,5 @@
 source [find target/atheros_ar9331.cfg]
 
-proc ar9331_25mhz_pll_init {} {
-       mww 0xb8050008 0x00018004       ;# bypass PLL; AHB_POST_DIV - ratio 4
-       mww 0xb8050004 0x00000352       ;# 34000(ns)/40ns(25MHz) = 0x352 (850)
-       mww 0xb8050000 0x40818000       ;# Power down control for CPU PLL
-                                       ;# OUTDIV | REFDIV | DIV_INT
-       mww 0xb8050010 0x001003e8       ;# CPU PLL Dither FRAC Register
-                                       ;# (disabled?)
-       mww 0xb8050000 0x00818000       ;# Power on | OUTDIV | REFDIV | DIV_INT
-       mww 0xb8050008 0x00008000       ;# remove bypass;
-                                       ;# AHB_POST_DIV - ratio 2
-}
-
-proc ar9331_ddr1_init {} {
-       mww 0xb8000000 0x7fbc8cd0       ;# DDR_CONFIG - lots of DRAM confs
-       mww 0xb8000004 0x9dd0e6a8       ;# DDR_CONFIG2 - more DRAM confs
-
-       mww 0xb8000010 0x8      ;# Forces a PRECHARGE ALL cycle
-       mww 0xb8000008 0x133    ;# mode reg: 0x133 - default
-       mww 0xb8000010 0x1      ;# Forces an MRS update cycl
-       mww 0xb800000c 0x2      ;# Extended mode register value.
-                               ;# default 0x2 - Reset to weak driver, DLL on
-       mww 0xb8000010 0x2      ;# Forces an EMRS update cycle
-       mww 0xb8000010 0x8      ;# Forces a PRECHARGE ALL cycle
-       mww 0xb8000008 0x33     ;# mode reg: remove some bit?
-       mww 0xb8000010 0x1      ;# Forces an MRS update cycl
-       mww 0xb8000014 0x4186   ;# enable refres: bit(14) - set refresh rate
-       mww 0xb800001c 0x8      ;# This register is used along with DQ Lane 0,
-                               ;# DQ[7:0], DQS_0
-       mww 0xb8000020 0x9      ;# This register is used along with DQ Lane 1,
-                               ;# DQ[15:8], DQS_1.
-       mww 0xb8000018 0xff     ;# DDR read and capture bit mask.
-                               ;# Each bit represents a cycle of valid data.
-}
-
 $_TARGETNAME configure -event reset-init {
        ar9331_25mhz_pll_init
        sleep 1
index c5609bb1d35b2f62aa34caa565b69a4215d7cf71..cd6918339176d851f2fa77b029e6bb38a3b448f1 100644 (file)
@@ -14,3 +14,37 @@ jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id $_CPUTAPID
 
 set _TARGETNAME $_CHIPNAME.cpu
 target create $_TARGETNAME mips_m4k -endian big -chain-position $_TARGETNAME
+
+proc ar9331_25mhz_pll_init {} {
+       mww 0xb8050008 0x00018004       ;# bypass PLL; AHB_POST_DIV - ratio 4
+       mww 0xb8050004 0x00000352       ;# 34000(ns)/40ns(25MHz) = 0x352 (850)
+       mww 0xb8050000 0x40818000       ;# Power down control for CPU PLL
+                                       ;# OUTDIV | REFDIV | DIV_INT
+       mww 0xb8050010 0x001003e8       ;# CPU PLL Dither FRAC Register
+                                       ;# (disabled?)
+       mww 0xb8050000 0x00818000       ;# Power on | OUTDIV | REFDIV | DIV_INT
+       mww 0xb8050008 0x00008000       ;# remove bypass;
+                                       ;# AHB_POST_DIV - ratio 2
+}
+
+proc ar9331_ddr1_init {} {
+       mww 0xb8000000 0x7fbc8cd0       ;# DDR_CONFIG - lots of DRAM confs
+       mww 0xb8000004 0x9dd0e6a8       ;# DDR_CONFIG2 - more DRAM confs
+
+       mww 0xb8000010 0x8      ;# Forces a PRECHARGE ALL cycle
+       mww 0xb8000008 0x133    ;# mode reg: 0x133 - default
+       mww 0xb8000010 0x1      ;# Forces an MRS update cycl
+       mww 0xb800000c 0x2      ;# Extended mode register value.
+                               ;# default 0x2 - Reset to weak driver, DLL on
+       mww 0xb8000010 0x2      ;# Forces an EMRS update cycle
+       mww 0xb8000010 0x8      ;# Forces a PRECHARGE ALL cycle
+       mww 0xb8000008 0x33     ;# mode reg: remove some bit?
+       mww 0xb8000010 0x1      ;# Forces an MRS update cycl
+       mww 0xb8000014 0x4186   ;# enable refres: bit(14) - set refresh rate
+       mww 0xb800001c 0x8      ;# This register is used along with DQ Lane 0,
+                               ;# DQ[7:0], DQS_0
+       mww 0xb8000020 0x9      ;# This register is used along with DQ Lane 1,
+                               ;# DQ[15:8], DQS_1.
+       mww 0xb8000018 0xff     ;# DDR read and capture bit mask.
+                               ;# Each bit represents a cycle of valid data.
+}

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)