From: Jose V Beneyto <sepen@crux.nu>
Date: Wed, 2 Nov 2011 23:46:09 +0000 (+0100)
Subject: Added initial stuff to build uboot files for efikamx devices, and the platform to... 
X-Git-Url: http://gitweb/?a=commitdiff_plain;h=64ac62a7815e36616abd3a05ff367370dc84c02f;p=bootloader.git

Added initial stuff to build uboot files for efikamx devices, and the platform to add more devices in the future. Also added a README file.
---

diff --git a/Makefile b/Makefile
index cd14348..a851b91 100644
--- a/Makefile
+++ b/Makefile
@@ -7,13 +7,22 @@ WORK = $(PWD)/work
 
 UBOOT_VERSION = 2011.09
 
-.PHONY: all mkimage clean dist-clean
+.PHONY: all help mkimage clean dist-clean efikamx efikamx-clean efikamx-distclean
 
-all: mkimage
+all: help
 
-clean: mkimage-clean
+help:
+	@echo "Usage: make <target>"
+	@echo "Where targets available are:"
+	@echo "  mkimage       Build mkimage binary for your host"
+	@echo "  <device>      Where device specified should appear under"
+	@echo "                devices's dir as for example efikamx, wm8505, ..."
+	@echo "  clean         Remove generated files"
+	@echo "  distclean     Remove generated files and temporary sources"
 
-dist-clean: mkimage-distclean
+clean: mkimage-clean efikamx-clean
+
+distclean: mkimage-distclean efikamx-distclean
 
 
 $(WORK)/u-boot-$(UBOOT_VERSION).tar.bz2:
@@ -38,3 +47,15 @@ mkimage-clean:
 	rm -f $(WORK)/mkimage mkimage
 
 mkimage-distclean: mkimage-clean
+	rm -rf $(WORK)/u-boot-$(UBOOT_VERSION) $(WORK)/u-boot-$(UBOOT_VERSION).tar.bz2
+
+efikamx: mkimage
+	make -C devices/efikamx
+
+efikamx-clean:
+	make -C devices/efikamx clean
+
+efikamx-distclean:
+	make -C devices/efikamx distclean
+
+# End of file
diff --git a/README b/README
index d34c6f1..eeb58ff 100644
--- a/README
+++ b/README
@@ -1,3 +1,20 @@
 
 README for uboot
 
+	Das U-Boot (or just "U-Boot" for short) is Open Source Firmware for
+	Embedded Power Architecture®, ARM, MIPS, x86 and other processors.
+
+	CRUX-ARM uses U-Boot as default bootloader for some devices, like
+	efikamx, wm8505, and maybe more in the future.
+
+	In this repository you'll find all required to convert kernel images
+	from zImage format to uImage, which used by U-Boot. To do that you
+	need to use mkimage, which can be built with the Makefile provided.
+        It's important to note that you must build mkimage with the compiler
+        flags for your host.
+	Also mkimage can convert files like initrd.gz to uInitrd in order to
+	be loaded it by U-Boot at boot stage.
+
+	To generate all the stuff required for a device you'll find a
+	directory for each one. Take a look in "./devices/<yourdevice>" for
+	more information related.
diff --git a/devices/efikamx/Makefile b/devices/efikamx/Makefile
new file mode 100644
index 0000000..9657996
--- /dev/null
+++ b/devices/efikamx/Makefile
@@ -0,0 +1,37 @@
+#
+# uboot/devices/efikamx/Makefile
+#
+
+PWD = $(shell pwd)
+MKIMAGE = $(PWD)/../../work/mkimage
+INITRDGZ = $(PWD)/../../../initrd/work/initrd.gz
+
+.PHONY: all clean distclean uImage boot.scr uInitrd
+
+all: uImage boot.scr uInitrd
+
+clean: uImage-clean boot.scr-clean uInitrd-clean
+
+distclean: clean
+
+uImage: # TODO
+uImage-clean: # TODO
+
+boot.scr: $(MKIMAGE) boot.script
+	$(MKIMAGE) -A arm -O linux -a 0 -e 0 -T script -C none \
+	-n "EfikaMX Boot Script" -d boot.script boot.scr
+
+boot.scr-clean:
+	rm -f boot.scr
+
+initrd.gz: $(INITRDGZ)
+	cp $(INITRDGZ) .
+
+uInitrd: $(MKIMAGE) initrd.gz
+	$(MKIMAGE) -A arm -O linux -a 0 -e 0 -T ramdisk -C none \
+	-n "initrd" -d initrd.gz uInitrd
+
+uInitrd-clean:
+	rm -f uInitrd initrd.gz
+
+# End of file
diff --git a/devices/efikamx/boot.script b/devices/efikamx/boot.script
new file mode 100644
index 0000000..206c596
--- /dev/null
+++ b/devices/efikamx/boot.script
@@ -0,0 +1,6 @@
+setenv kernel uImage;
+setenv bootargs console=ttymxc0,115200 root=/dev/sda1 rootwait ro;
+${loadcmd} ${kerneladdr} ${kernel}
+if imi ${kerneladdr}; then
+  bootm ${kerneladdr}
+fi;