From 6ade6b1b5b512c82bfbee8c30db74dfa5ad4cb93 Mon Sep 17 00:00:00 2001 From: Jose V Beneyto Date: Tue, 27 Aug 2013 18:12:55 +0000 Subject: [PATCH] Added cubieboard2 stuff --- devices/cubieboard2/Makefile | 79 ++++++++++++++++++++++++++ devices/cubieboard2/boot-mmc.script.in | 5 ++ 2 files changed, 84 insertions(+) create mode 100644 devices/cubieboard2/Makefile create mode 100644 devices/cubieboard2/boot-mmc.script.in diff --git a/devices/cubieboard2/Makefile b/devices/cubieboard2/Makefile new file mode 100644 index 0000000..7648eb9 --- /dev/null +++ b/devices/cubieboard2/Makefile @@ -0,0 +1,79 @@ +# +# bootloader/devices/cubieboard/Makefile +# + +PWD = $(shell pwd) +WORK = $(PWD)/work +MKIMAGE = $(PWD)/../../work/mkimage +ZIMAGE = $(PWD)/../../../kernel/cubieboard2/work/zImage +INITRDGZ = $(PWD)/../../../initrd/work/initrd.gz +INITRAMFS = $(PWD)/../../../initramfs/work/initramfs + +KERNEL_VERSION_STRING = $(shell readlink $(ZIMAGE) | sed s/zImage-//) + +RAMDISK_TYPE = uInitrd +#RAMDISK_TYPE = uInitramfs + +CONSOLE_DEVICE = tty0 +#CONSOLE_DEVICE = ttymxc0,115200 + +.PHONY: all clean distclean kernel ramdisk bootscr + +all: kernel ramdisk bootscr + +clean: kernel-clean ramdisk-clean bootscr-clean + +distclean: clean + +$(WORK): + install -d $(WORK) + +$(WORK)/uImage: $(WORK) $(MKIMAGE) $(ZIMAGE) + $(MKIMAGE) -A arm -O linux -a 0x40008000 -e 0x40008000 \ + -T kernel -C none -n "Linux-$(KERNEL_VERSION_STRING)" \ + -d $(ZIMAGE) $(WORK)/uImage + +kernel: $(WORK)/uImage + +kernel-clean: + rm -f $(WORK)/uImage + +$(WORK)/uInitrd: $(WORK) $(MKIMAGE) $(INITRDGZ) + $(MKIMAGE) -A arm -O linux -a 0 -e 0 \ + -T ramdisk -C none -n "CRUX-ARM Initrd Image" \ + -d $(INITRDGZ) $(WORK)/uInitrd + +uInitrd: $(WORK)/uInitrd + +uInitrd-clean: + rm -f $(WORK)/uInitrd + +$(WORK)/uInitramfs: $(WORK) $(MKIMAGE) $(INITRAMFS) + $(MKIMAGE) -A arm -O linux -a 0 -e 0 \ + -T ramdisk -C none -n "CRUX-ARM Initramfs Image" \ + -d $(INITRAMFS) $(WORK)/uInitramfs + +uInitramfs: $(WORK)/uInitramfs + +uInitramfs-clean: + rm -f $(WORK)/uInitramfs + +ramdisk: $(RAMDISK_TYPE) + +ramdisk-clean: uInitrd-clean uInitramfs-clean + +$(WORK)/%.script: %.script.in + sed -e "s|@@RAMDISK_TYPE@@|$(RAMDISK_TYPE)|" -e "s|@@CONSOLE_DEVICE@@|$(CONSOLE_DEVICE)|" $< > $@ + +$(WORK)/boot-mmc.scr: $(WORK)/boot-mmc.script $(MKIMAGE) + $(MKIMAGE) -A arm -O linux -a 0 -e 0 \ + -T script -C none -n "Cubieboard2 Boot Script (mmc)" \ + -d $(WORK)/boot-mmc.script \ + $(WORK)/boot-mmc.scr + +bootscr: $(WORK)/boot-mmc.scr + +bootscr-clean: + rm -f $(WORK)/boot-*.scr* + +# End of file diff --git a/devices/cubieboard2/boot-mmc.script.in b/devices/cubieboard2/boot-mmc.script.in new file mode 100644 index 0000000..2d0380f --- /dev/null +++ b/devices/cubieboard2/boot-mmc.script.in @@ -0,0 +1,5 @@ +setenv machid 0xf35 +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