From efc3cbcf2a71f00c53d5de102adccf5e815e9691 Mon Sep 17 00:00:00 2001 From: Jose V Beneyto Date: Tue, 27 Aug 2013 14:05:05 +0000 Subject: [PATCH] Improved cubieboard's stuff. Now using Makefile rules for patterns to create boot scripts --- devices/cubieboard/Makefile | 18 ++++++++++-------- devices/cubieboard/boot-mmc.script | 4 ---- devices/cubieboard/boot-mmc.script.in | 4 ++++ 3 files changed, 14 insertions(+), 12 deletions(-) delete mode 100644 devices/cubieboard/boot-mmc.script create mode 100644 devices/cubieboard/boot-mmc.script.in diff --git a/devices/cubieboard/Makefile b/devices/cubieboard/Makefile index 88031bf..9bfcde3 100644 --- a/devices/cubieboard/Makefile +++ b/devices/cubieboard/Makefile @@ -1,5 +1,5 @@ # -# uboot/devices/cubieboard/Makefile +# bootloader/devices/cubieboard/Makefile # PWD = $(shell pwd) @@ -9,9 +9,11 @@ ZIMAGE = $(PWD)/../../../kernel/cubieboard/work/zImage INITRDGZ = $(PWD)/../../../initrd/work/initrd.gz INITRAMFS = $(PWD)/../../../initramfs/work/initramfs -RAMDISK_TYPE = uInitrd # select between uInitramfs or uInitrd +RAMDISK_TYPE = uInitrd +#RAMDISK_TYPE = uInitramfs -CONSOLE = tty0 # tty0 / ttyS0,115200 +CONSOLE_DEVICE = tty0 +#CONSOLE_DEVICE = ttymxc0,115200 .PHONY: all clean distclean kernel ramdisk bootscr @@ -58,16 +60,16 @@ ramdisk: $(RAMDISK_TYPE) ramdisk-clean: uInitrd-clean uInitramfs-clean -templates: $(PWD)/boot-mmc.script - sed "s|#CONSOLE#|$(CONSOLE)|" $(PWD)/boot-mmc.script > $(WORK)/boot-mmc.script +$(WORK)/%.script: %.script.in + sed -e "s|@@RAMDISK_TYPE@@|$(RAMDISK_TYPE)|" -e "s|@@CONSOLE_DEVICE@@|$(CONSOLE_DEVICE)|" $< > $@ -$(WORK)/boot-mmc.scr: $(WORK) $(MKIMAGE) +$(WORK)/boot-mmc.scr: $(WORK)/boot-mmc.script $(MKIMAGE) $(MKIMAGE) -A arm -O linux -a 0 -e 0 \ - -T script -C none -n "A10 Boot Script (mmc)" \ + -T script -C none -n "Cubieboard Boot Script (mmc)" \ -d $(WORK)/boot-mmc.script \ $(WORK)/boot-mmc.scr -bootscr: templates $(WORK)/boot-mmc.scr +bootscr: $(WORK)/boot-mmc.scr bootscr-clean: rm -f $(WORK)/boot-*.scr* diff --git a/devices/cubieboard/boot-mmc.script b/devices/cubieboard/boot-mmc.script deleted file mode 100644 index 849ed00..0000000 --- a/devices/cubieboard/boot-mmc.script +++ /dev/null @@ -1,4 +0,0 @@ -setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 ${extra} -fatload mmc 0 0x43000000 script.bin -fatload mmc 0 0x48000000 uImage -bootm 0x48000000 diff --git a/devices/cubieboard/boot-mmc.script.in b/devices/cubieboard/boot-mmc.script.in new file mode 100644 index 0000000..3f3d35a --- /dev/null +++ b/devices/cubieboard/boot-mmc.script.in @@ -0,0 +1,4 @@ +setenv bootargs console=@@CONSOLE_DEVICE@@ root=/dev/mmcblk0p2 rootwait panic=10 ${extra} +fatload mmc 0 0x43000000 script.bin +fatload mmc 0 0x48000000 uImage +bootm 0x48000000 -- 2.26.2