tImport initial Makefile. - pinephone-boot - Bootloader and kernel build for the PinePhone devkit HTML git clone git://parazyd.org/pinephone-boot.git | https://git.parazyd.org/pinephone-boot DIR Log DIR Files DIR Refs --- DIR commit 5907c7592383b93a5a8ec55f0d9bd9c75093ead8 HTML Author: parazyd <parazyd@dyne.org> Date: Fri, 19 Apr 2019 23:11:38 +0200 Import initial Makefile. Diffstat: A Makefile | 84 +++++++++++++++++++++++++++++++ A boot.txt | 10 ++++++++++ 2 files changed, 94 insertions(+), 0 deletions(-) --- DIR diff --git a/Makefile b/Makefile t@@ -0,0 +1,84 @@ +.POSIX: + +# Dependencies: +# unzip flex bc bison kmod cpio libssl-dev device-tree-compiler python +# python-dev swig u-boot-tools + +compiler = aarch64-linux-gnu- +clonedepth = --depth 1 + +atfgit = https://github.com/ARM-software/arm-trusted-firmware.git +ubootgit = https://gitlab.com/pine64-org/u-boot.git +linuxgit = https://gitlab.com/pine64-org/linux.git + +BIN = \ + bl31.bin \ + u-boot-sunxi-with-spl-sopine.bin \ + Image.gz \ + sun50i-a64-sopine-baseboard.dtb \ + boot.scr + +DIR = \ + arm-trusted-firmware \ + u-boot \ + pinephone-linux \ + lib/modules + +all: $(BIN) $(DIR) + +arm-trusted-firmware: + git clone $(clonedepth) $(atfgit) $@ + +bl31.bin: arm-trusted-firmware + $(MAKE) -C arm-trusted-firmware distclean + $(MAKE) -C arm-trusted-firmware CROSS_COMPILE=$(compiler) \ + PLAT=sun50i_a64 DEBUG=1 bl31 + cp arm-trusted-firmware/build/sun50i_a64/debug/$@ $@ + +boot.scr: + mkimage -C none -A arm -T script -d boot.txt $@ + +u-boot: + git clone $(clonedepth) $(ubootgit) $@ + +u-boot-sunxi-with-spl-sopine.bin: bl31.bin u-boot + $(MAKE) -C u-boot distclean + $(MAKE) -C u-boot sopine_baseboard_defconfig + cp -f bl31.bin u-boot/ + echo 'CONFIG_IDENT_STRING=" Maemo Leste"' >> u-boot/.config + $(MAKE) -C u-boot ARCH=arm CROSS_COMPILE=$(compiler) + cat u-boot/spl/sunxi-spl.bin u-boot/u-boot.itb > $@ + +pinephone-linux: + git clone -b pinephone $(clonedepth) $(linuxgit) $@ + +Image.gz: pinephone-linux + cp pinephone-linux/pinephone-config pinephone-linux/.config + $(MAKE) -C pinephone-linux ARCH=arm64 CROSS_COMPILE=$(compiler) \ + oldconfig + $(MAKE) -C pinephone-linux ARCH=arm64 CROSS_COMPILE=$(compiler) \ + Image + cp pinephone-linux/arch/arm64/boot/Image Image + gzip Image + +sun50i-a64-sopine-baseboard.dtb: Image.gz + $(MAKE) -C pinephone-linux ARCH=arm64 CROSS_COMPILE=$(compiler) \ + allwinner/$@ + cp pinephone-linux/arch/arm64/boot/dtbs/allwinner/$@ $@ + +lib/modules: Image.gz + $(MAKE) -C pinephone-linux ARCH=arm64 CROSS_COMPILE=$(compiler) \ + modules + $(MAKE) -C pinephone-linux ARCH=arm64 CROSS_COMPILE=$(compiler) \ + INSTALL_MOD_PATH="$(PWD)" modules_install + +clean: + rm -rf $(BIN) lib + +distclean: clean + $(MAKE) -C arm-trusted-firmware distclean + $(MAKE) -C u-boot distclean + $(MAKE) -C pinephone-linux distclean + +mrproper: clean + rm -rf $(DIR) DIR diff --git a/boot.txt b/boot.txt t@@ -0,0 +1,10 @@ +part uuid ${devtype} ${devnum}:${distro_bootpart} uuid +setenv bootargs console=${console} console=tty0 root=PARTUUID=${uuid} rw rootwait +setenv kernel_addr_z 0x44080000 + +if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_z} Image.gz; then + unzip ${kernel_addr_z} ${kernel_addr_r} + if load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} dtbs/${fdtfile}; then + booti ${kernel_addr_r} - ${fdt_addr_r}; + fi; +fi