]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Added possibility to build boot for mpc5567 and mpc5668
authormahi <devnull@localhost>
Mon, 3 Sep 2012 19:06:14 +0000 (21:06 +0200)
committermahi <devnull@localhost>
Mon, 3 Sep 2012 19:06:14 +0000 (21:06 +0200)
boards/mpc5567qrtech/boot_info.mk [new file with mode: 0644]
boards/mpc5567qrtech/build_config.mk
boards/mpc5567qrtech/examples/os_simple/build_config.mk
boards/mpc5567qrtech/examples/os_simple/makefile
boards/mpc5668_gkit/boot_info.mk [new file with mode: 0644]
boards/mpc5668_gkit/build_config.mk
boards/mpc5668_gkit/examples/os_simple/makefile
scripts/bootloader_image.mk [new file with mode: 0644]
scripts/rules.mk

diff --git a/boards/mpc5567qrtech/boot_info.mk b/boards/mpc5567qrtech/boot_info.mk
new file mode 100644 (file)
index 0000000..949ae6d
--- /dev/null
@@ -0,0 +1,4 @@
+\r
+BOOT_IMAGE_ADDR=0x1c000\r
+BOOT_BLOB_LOAD_ADDR=0x1c100\r
+BOOT_BLOB_START_ADDR=$(BOOT_BLOB_LOAD_ADDR)\r
index 8eeb773c8c9751b4d055541d6029ff757924560d..fb8c54da63e38eebc8e1235c31b5e02018a65975 100644 (file)
@@ -7,6 +7,8 @@ ARCH_MCU=mpc5567
 # CFG (y/n) macros\r
 CFG=PPC BOOKE E200Z6 MPC55XX MPC5567 BRD_MPC5567QRTECH SPE\r
 \r
+#CFG+=BOOT\r
+\r
 # What buildable modules does this board have, \r
 # default or private\r
 \r
index b2b3e4f0ef8e383833d07ef5d774e925a5be7f11..c3e5fd22ec4f10fd77d037c79913fc1bdd02bb6c 100644 (file)
@@ -12,5 +12,4 @@ REQUIRED_BUILD_SYSTEM_VERSION=1.0.0
 SELECT_CONSOLE = RAMLOG\r
 \r
 SELECT_OPT = OPT_DEBUG \r
-CFG+=BOOT\r
 \r
index 5b4f3a205164c6cb35ba076f33be00b17647854f..cc9ce04580be7f10898b4de0ebc7d0854edc7665 100644 (file)
@@ -13,56 +13,9 @@ ifneq (${MAKELEVEL},0)
        VPATH += $(ROOTDIR)/examples\r
        VPATH += $(ROOTDIR)/examples/$(PROJECTNAME)\r
        \r
-ifneq ($(CFG_BOOT),)\r
-\r
-# "downloader" need an srecord file \r
-build-srec-image-y = $(PROJECTNAME)_srec_image.srec\r
-build-srec-y = $(PROJECTNAME).srec\r
-build-bin-image-y = $(PROJECTNAME)_bin_image.bin\r
-\r
-# To add a header with mkimage we need a binary file\r
-build-bin-y = $(PROJECTNAME).bin\r
-\r
-all-mod += $(build-srec-image-y)\r
-all-mod += $(build-srec-y)\r
-all-mod += $(build-bin-image-y)\r
-\r
-# Tools Path\r
-mkimage = /c/Users/mahi/git/bootloader/bin/mkimage\r
-SRECORD_PATH=/c/devtools/srecord\r
-SREC_CAT=$(Q)$(SRECORD_PATH)/srec_cat.exe\r
-SREC_INFO=$(Q)$(SRECORD_PATH)/srec_info.exe\r
-\r
-LOAD_ADDR=0x1c000\r
-\r
-# To srecord again to load in tool\r
-$(build-srec-image-y): $(build-bin-image-y)\r
-       @echo ">> Binary to SREC to load with tool"\r
-       $(SREC_CAT) $< -binary -offset ${LOAD_ADDR} -o $@\r
-       $(SREC_INFO) $@\r
-\r
-$(build-srec-y) : $(build-exe-y)\r
-       @echo\r
-       @echo "  >> OBJCOPY $@"   \r
-       $(Q)$(CROSS_COMPILE)objcopy -O srec $< $@\r
-       $(SREC_INFO) $@\r
-\r
-# Binary image down to 0\r
-$(build-bin-y) : $(build-srec-y)\r
-       @echo ">> srec to binary with offset 0"\r
-       $(SREC_INFO) $< \r
-       $(SREC_CAT) $< -offset - -minimum-addr $< -o $@ -binary\r
-\r
-# Add image header             \r
-# Should extract the start address with "objdump -f"\r
-$(build-bin-image-y): $(build-bin-y)\r
-       @echo ">> Adding header" \r
-       $(mkimage) -o $@ -l 0x1c100 -s 0x1c100 -m "APP" -v $<\r
-\r
 endif\r
 \r
 \r
-endif\r
 \r
 \r
 \r
diff --git a/boards/mpc5668_gkit/boot_info.mk b/boards/mpc5668_gkit/boot_info.mk
new file mode 100644 (file)
index 0000000..2f226e6
--- /dev/null
@@ -0,0 +1,4 @@
+\r
+BOOT_IMAGE_ADDR=0x20000\r
+BOOT_BLOB_LOAD_ADDR=0x20100\r
+BOOT_BLOB_START_ADDR=$(BOOT_BLOB_LOAD_ADDR)\r
index 4307f4d7bc95f090f7c7a4e81b5b1a9373677249..fb8c54da63e38eebc8e1235c31b5e02018a65975 100644 (file)
@@ -7,7 +7,7 @@ ARCH_MCU=mpc5567
 # CFG (y/n) macros\r
 CFG=PPC BOOKE E200Z6 MPC55XX MPC5567 BRD_MPC5567QRTECH SPE\r
 \r
-CFG+=BOOT\r
+#CFG+=BOOT\r
 \r
 # What buildable modules does this board have, \r
 # default or private\r
index ebff15f2f5e96112d7c1d503a9502bac4aa9bfc2..68ac9c84c64f80c4037643ab22f6b605a05a3a87 100644 (file)
@@ -13,63 +13,9 @@ ifneq (${MAKELEVEL},0)
        VPATH += $(ROOTDIR)/examples\r
        VPATH += $(ROOTDIR)/examples/$(PROJECTNAME)\r
        \r
-ifneq ($(CFG_BOOT),)\r
-\r
-# "downloader" need an srecord file \r
-build-srec-image-y = $(PROJECTNAME)_srec_image.srec\r
-\r
-build-srec-y = $(PROJECTNAME).srec\r
-build-bin-image-y = $(PROJECTNAME)_bin_image.bin\r
-# To add a header with mkimage we need a binary file\r
-build-bin-y = $(PROJECTNAME).bin\r
-\r
-all-mod += $(build-srec-image-y)\r
-all-mod += $(build-srec-y)\r
-all-mod += $(build-bin-image-y)\r
-##all-mod += $(build-bin-y)\r
-\r
-mkimage = /c/Users/mahi/git/bootloader/bin/mkimage\r
-\r
-SRECORD_PATH=/c/devtools/srecord\r
-SREC_CAT=$(Q)$(SRECORD_PATH)/srec_cat.exe\r
-SREC_INFO=$(Q)$(SRECORD_PATH)/srec_info.exe\r
-\r
-# Changes:\r
-# * Here, 2 places\r
-# * linkfile  (linkscript_cw.ldf)\r
-# * cc_cw.mk  (romaddr, etc) \r
-\r
-LOAD_ADDR=0x20000\r
-\r
-# To srecord again to load in tool\r
-$(build-srec-image-y): $(build-bin-image-y)\r
-       @echo ">> Binary to SREC to load with tool"\r
-       $(SREC_CAT) $< -binary -offset ${LOAD_ADDR} -o $@\r
-       $(SREC_INFO) $@\r
-\r
-$(build-srec-y) : $(build-exe-y)\r
-       @echo\r
-       @echo "  >> OBJCOPY $@"   \r
-       $(Q)$(CROSS_COMPILE)objcopy -O srec $< $@\r
-       $(SREC_INFO) $@\r
-\r
-# Binary image down to 0\r
-$(build-bin-y) : $(build-srec-y)\r
-       @echo ">> srec to binary with offset 0"\r
-       $(SREC_INFO) $< \r
-       $(SREC_CAT) $< -offset - -minimum-addr $< -o $@ -binary\r
-\r
-# Add image header             \r
-# Should extract the start address with "objdump -f"\r
-$(build-bin-image-y): $(build-bin-y)\r
-       @echo ">> Adding header" \r
-       $(mkimage) -o $@ -l 0x20100 -s 0x20100 -m "APP" -v $<\r
-\r
 endif\r
 \r
 \r
-endif\r
-\r
 \r
 \r
 \r
diff --git a/scripts/bootloader_image.mk b/scripts/bootloader_image.mk
new file mode 100644 (file)
index 0000000..ab10651
--- /dev/null
@@ -0,0 +1,42 @@
+\r
+\r
+MKIMAGE?=/c/Users/mahi/git/bootloader/bin/mkimage\r
+SRECORD_PATH?=/c/devtools/srecord\r
+SREC_CAT=$(Q)$(SRECORD_PATH)/srec_cat.exe\r
+SREC_INFO=$(Q)$(SRECORD_PATH)/srec_info.exe\r
+\r
+# "downloader" need an srecord file \r
+build-srec-image-y = $(PROJECTNAME)_srec_image.srec\r
+build-srec-y = $(PROJECTNAME).srec\r
+build-bin-image-y = $(PROJECTNAME)_bin_image.bin\r
+\r
+# To add a header with mkimage we need a binary file\r
+build-bin-y = $(PROJECTNAME).bin\r
+\r
+all-mod += $(build-srec-image-y)\r
+all-mod += $(build-srec-y)\r
+all-mod += $(build-bin-image-y)\r
+\r
+# To srecord again to load in tool\r
+$(build-srec-image-y): $(build-bin-image-y)\r
+       @echo ">> Binary to SREC to load with tool"\r
+       $(SREC_CAT) $< -binary -offset ${BOOT_IMAGE_ADDR} -o $@\r
+       $(SREC_INFO) $@\r
+\r
+$(build-srec-y) : $(build-exe-y)\r
+       @echo\r
+       @echo "  >> OBJCOPY $@"   \r
+       $(Q)$(CROSS_COMPILE)objcopy -O srec $< $@\r
+       $(SREC_INFO) $@\r
+\r
+# Binary image down to 0\r
+$(build-bin-y) : $(build-srec-y)\r
+       @echo ">> srec to binary with offset 0"\r
+       $(SREC_INFO) $< \r
+       $(SREC_CAT) $< -offset - -minimum-addr $< -o $@ -binary\r
+\r
+# Add image header             \r
+# Should extract the start address with "objdump -f"\r
+$(build-bin-image-y): $(build-bin-y)\r
+       @echo ">> Adding header" \r
+       $(MKIMAGE) -o $@ -l $(BOOT_BLOB_LOAD_ADDR) -s $(BOOT_BLOB_START_ADDR) -m "APP" -v $<\r
index 8b4680da084c96ca5f9a6c9477508d91234025d7..6ef9ffd3807bfd3fb56d310932cb61b54460f9ad 100644 (file)
@@ -122,6 +122,11 @@ ifndef _BOARD_COMMON_MK
 include $(ROOTDIR)/boards/board_common.mk\r
 endif\r
 \r
+# Misc tools\r
+ifneq ($(CFG_BOOT),)\r
+include $(ROOTDIR)/boards/$(BOARDDIR)/boot_info.mk\r
+include $(ROOTDIR)/scripts/bootloader_image.mk\r
+endif  \r
 \r
 ##### For backwards compatability with older project makefiles:\r
 \r