commit 093464843a2d1cb503a64f3bf05fb656967ad21e
parent 645ba0533fe9aada5ede5a86a14d4e261932f961
Author: Brian Swetland <swetland@frotz.net>
Date: Tue, 18 Mar 2014 23:23:06 -0700
skeleton of lpc15xx build support and flash script
Diffstat:
3 files changed, 118 insertions(+), 0 deletions(-)
diff --git a/arch/lpc15xx/config.mk b/arch/lpc15xx/config.mk
@@ -0,0 +1,26 @@
+
+# name arch rambase ramsize flashbase flashsize linkscript
+$(call chip,lpc1549-ram,lpc15xx,0x02000000,0x00009000,0x00000000,0x00000000,ram)
+$(call chip,lpc1549-rom,lpc15xx,0x02000000,0x00009000,0x00000000,0x00040000,rom)
+$(call chip,lpc1549-blr,lpc15xx,0x02008c00,0x00000400,0x00000000,0x00001000,rom)
+$(call chip,lpc1549-app,lpc15xx,0x02000000,0x00009000,0x00001000,0x0003F000,rom)
+
+$(call chip,lpc1548-ram,lpc15xx,0x02000000,0x00005000,0x00000000,0x00000000,ram)
+$(call chip,lpc1548-rom,lpc15xx,0x02000000,0x00005000,0x00000000,0x00020000,rom)
+$(call chip,lpc1548-blr,lpc15xx,0x02004c00,0x00000400,0x00000000,0x00001000,rom)
+$(call chip,lpc1548-app,lpc15xx,0x02000000,0x00005000,0x00001000,0x0001F000,rom)
+
+$(call chip,lpc1547-ram,lpc15xx,0x02000000,0x00003000,0x00000000,0x00000000,ram)
+$(call chip,lpc1547-rom,lpc15xx,0x02000000,0x00003000,0x00000000,0x00010000,rom)
+$(call chip,lpc1547-blr,lpc15xx,0x02002c00,0x00000400,0x00000000,0x00001000,rom)
+$(call chip,lpc1547-app,lpc15xx,0x02000000,0x00003000,0x00001000,0x0000F000,rom)
+
+ARCH_lpc15xx_CFLAGS := \
+ -Iarch/lpc15xx/include \
+ -Iarch/arm-cm3/include
+ARCH_lpc15xx_START := arch/arm-cm3/start.o
+ARCH_lpc15xx_CONFIG := \
+ ARCH_LPC15XX=1 \
+ STACKTOP=0x02008f00
+ARCH_lpc15xx_OBJS :=
+
diff --git a/arch/lpc15xx/include/arch/irqs.h b/arch/lpc15xx/include/arch/irqs.h
diff --git a/scripts/lpc15xx b/scripts/lpc15xx
@@ -0,0 +1,92 @@
+# scripts/lpc13xx
+#
+# Copyright 2011 Brian Swetland <swetland@frotz.net>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# 32K flash in 1K pages at 0
+set flash-start 0
+set flash-size 40000
+set flash-block 1000
+
+# use ram at 02000000 for download buffer
+set flash-buffer 02000000
+
+# flash-setup
+# - attach and reset
+# - allow on-die ROM to run (important for correct flash init)
+# - regain control when it attempts to read the reset vector
+function flash-setup
+ attach
+ reset-stop
+ watch-rw 0
+ go
+
+ # write breakpoint at 10001000 and setup SP
+ wr 02001000 be00be00
+ wr sp 02008f00
+end
+
+# flash-erase <flash-addr>
+function flash-erase
+ set page $1 >> .12
+
+ # prepare for write
+ wr pc 03000205
+ wr lr 02001001
+ wr r0 02001010
+ wr r1 02001030
+ wr 02001010 .50
+ wr 02001014 $page
+ wr 02001018 $page
+ go
+
+ # erase
+ wr pc 03000205
+ wr lr 02001001
+ wr r0 02001010
+ wr r1 02001030
+ wr 02001010 .52
+ wr 02001014 $page
+ wr 02001018 $page
+ wr 0200101c 2ee0
+ go
+end
+
+# flash-write <flash-addr>
+function flash-write
+ set page $1 >> .12
+
+ # prepare for write
+ wr pc 03000205
+ wr lr 02001001
+ wr r0 02001010
+ wr r1 02001030
+ wr 02001010 .50
+ wr 02001014 $page
+ wr 02001018 $page
+ go
+
+ # write
+ wr pc 03000205
+ wr lr 02001001
+ wr r0 02001010
+ wr r1 02001030
+ wr 02001010 .51
+ wr 02001014 $1
+ wr 02001018 02000000
+ wr 0200101c 1000
+ wr 02001020 2ee0
+ go
+end
+