summaryrefslogtreecommitdiff
path: root/cleopatre
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre')
-rwxr-xr-xcleopatre/tools/openocd-r668/config/gen_ocd_config18
-rw-r--r--cleopatre/tools/openocd-r668/config/reset_init_sdram_16.ocd85
-rw-r--r--cleopatre/tools/openocd-r668/config/reset_init_sdram_32.ocd (renamed from cleopatre/tools/openocd-r668/config/reset_init_sdram.ocd)0
3 files changed, 100 insertions, 3 deletions
diff --git a/cleopatre/tools/openocd-r668/config/gen_ocd_config b/cleopatre/tools/openocd-r668/config/gen_ocd_config
index df4a088396..a0d96b23ac 100755
--- a/cleopatre/tools/openocd-r668/config/gen_ocd_config
+++ b/cleopatre/tools/openocd-r668/config/gen_ocd_config
@@ -36,8 +36,13 @@ if [ ! -f reset_500.ocd ]; then
echo ""
exit 1;
fi
-if [ ! -f reset_init_sdram.ocd ]; then
- echo "Cannot find OCD script $pathcaller/reset_init_sdram.ocd"
+if [ ! -f reset_init_sdram_32.ocd ]; then
+ echo "Cannot find OCD script $pathcaller/reset_init_sdram_32.ocd"
+ echo ""
+ exit 1;
+fi
+if [ ! -f reset_init_sdram_16.ocd ]; then
+ echo "Cannot find OCD script $pathcaller/reset_init_sdram_16.ocd"
echo ""
exit 1;
fi
@@ -51,6 +56,7 @@ do
-f|--flash) shift; flash=$1; shift ;;
-s|--speed) shift; speed=$1; shift ;;
-e|--empty) empty=true; shift ;;
+ -w|--sdram-width) shift; sdram_width=$1; shift ;;
-ne|--not-empty) empty=false; shift ;;
-h|--help) echo; usage_board; usage_probe;
echo -n "[-e/--empty (default) | -ne/--not-empty], "
@@ -62,6 +68,7 @@ do
echo -n "i.e. already contains u-boot or NVRAM, ";
echo -n "SDRAM controller should not be initialized again ";
echo "('reset_300.ocd' will be used)";
+ echo "Use -w [16|32] to register SDRAM width (default 32)"
echo "";
exit 1;;
-|--) shift; break;;
@@ -69,6 +76,10 @@ do
esac
done
+if [ -z $sdram_width ]; then
+ sdram_width=32
+fi
+
if [ -z $probe ]; then
echo
echo "Probe not defined"; usage_probe;
@@ -145,7 +156,7 @@ if [ -z $empty ]; then
echo "!!! Default flash empty flag is true! SDRAM controller will be reset"
fi
if [ $empty == true ]; then
- file_ocd=$pathcaller\/reset_init_sdram.ocd
+ file_ocd=$pathcaller\/reset_init_sdram_$sdram_width.ocd
else
file_ocd=$pathcaller\/reset_300.ocd
fi
@@ -191,6 +202,7 @@ echo "BOARD=$board"
echo "FLASH=$flash"
echo "SPEED=$speed"
echo "EMPTYFLASH=$empty:"
+echo "SDRAM_WIDTH=$sdram_width:"
echo " reset_filepath=${file_ocd}"
echo
diff --git a/cleopatre/tools/openocd-r668/config/reset_init_sdram_16.ocd b/cleopatre/tools/openocd-r668/config/reset_init_sdram_16.ocd
new file mode 100644
index 0000000000..edbea96ba3
--- /dev/null
+++ b/cleopatre/tools/openocd-r668/config/reset_init_sdram_16.ocd
@@ -0,0 +1,85 @@
+#
+#***********************************************************************
+# memory configuration
+# SPI FLASH : 0x30000000
+# SDRAM : 0x40000000
+#***********************************************************************
+#
+
+
+#***********************************************************************
+# stop processor
+#***********************************************************************
+halt
+soft_reset_halt
+
+#
+#***********************************************************************
+# INIT_PLL
+# PLLs configuration set to bypass
+#***********************************************************************
+#
+# spll bypass
+mww 0xC8040580 1
+
+# dpll bypass
+mww 0xC8040560 1
+
+# ppll bypass
+mww 0xC8040540 1
+
+# sys_remapped
+mww 0xC8040100 0
+
+#***********************************************************************
+# reset processor
+#***********************************************************************
+# reset group
+mww 0xC8040708 0xe
+
+# reset all IPs
+mww 0xC804070C 0x1fff
+mww 0xC804070C 0x1000
+
+# restart code
+reg pc 0
+reg cpsr 0xd3
+arm926ejs cp15 0 0 1 0 0
+
+#
+#***********************************************************************
+# INIT_SDRAM
+# SDRAM Memory configuration
+#***********************************************************************
+#
+# Set SDRAM Architecture : SCONR
+mww 0xE0000000 0x001C1168
+
+# Set SDRAM Chip Select : SCSLR0_LOW
+mww 0xE0000014 0x00000000
+
+# Set SDRAM Mask to 128MB : SMSKR0
+mww 0xE0000054 0x0000000C
+
+# Set SDRAM Timings : STMGR0
+mww 0xE0000004 0x022E5699
+
+# Activate SDRAM Configuration : SCTLR
+mww 0xE000000C 0x00003089
+
+# Wait Activation
+# ---> wait @0xE000000C = 0x3088
+sleep 4
+
+
+#***********************************************************************
+# Flash probe
+#***********************************************************************
+flash probe 0
+flash protect 0 0 3 off
+
+
+#***********************************************************************
+# Stop processor
+#***********************************************************************
+halt
diff --git a/cleopatre/tools/openocd-r668/config/reset_init_sdram.ocd b/cleopatre/tools/openocd-r668/config/reset_init_sdram_32.ocd
index a5c2afb496..a5c2afb496 100644
--- a/cleopatre/tools/openocd-r668/config/reset_init_sdram.ocd
+++ b/cleopatre/tools/openocd-r668/config/reset_init_sdram_32.ocd