Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image with pinetab specific uboot-spl #37

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 53 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ CROSS_FLAGS_BOOT = CROSS_COMPILE=aarch64-linux-gnu-
all: pine64-pinephone.img.xz pine64-pinetab.img.xz


pine64-pinephone.img: fat-pine64-pinephone.img u-boot-sunxi-with-spl.bin
pine64-pinephone.img: fat-pine64-pinephone.img u-boot-sunxi-with-spl-pinephone.bin
rm -f $@
truncate --size 50M $@
parted -s $@ mktable msdos
parted -s $@ mkpart primary fat32 2048s 100%
parted -s $@ set 1 boot on
dd if=u-boot-sunxi-with-spl.bin of=$@ bs=8k seek=1
dd if=u-boot-sunxi-with-spl-pinephone.bin of=$@ bs=8k seek=1
dd if=fat-$@ of=$@ seek=1024 bs=1k

fat-pine64-pinephone.img: initramfs-pine64-pinephone.gz kernel-sunxi.gz pine64-pinephone.scr dtbs/sunxi/sun50i-a64-pinephone-1.2.dtb
Expand All @@ -26,13 +26,13 @@ fat-pine64-pinephone.img: initramfs-pine64-pinephone.gz kernel-sunxi.gz pine64-p
@mcopy -i $@ initramfs-pine64-pinephone.gz ::initramfs.gz
@mcopy -i $@ pine64-pinephone.scr ::boot.scr

pine64-pinetab.img: fat-pine64-pinetab.img u-boot-sunxi-with-spl.bin
pine64-pinetab.img: fat-pine64-pinetab.img u-boot-sunxi-with-spl-pinetab.bin
rm -f $@
truncate --size 50M $@
parted -s $@ mktable msdos
parted -s $@ mkpart primary fat32 2048s 100%
parted -s $@ set 1 boot on
dd if=u-boot-sunxi-with-spl.bin of=$@ bs=8k seek=1
dd if=u-boot-sunxi-with-spl-pinetab.bin of=$@ bs=8k seek=1
dd if=fat-$@ of=$@ seek=1024 bs=1k

fat-pine64-pinetab.img: initramfs-pine64-pinetab.gz kernel-sunxi.gz pine64-pinetab.scr dtbs/sunxi/sun50i-a64-pinetab.dtb
Expand Down Expand Up @@ -130,13 +130,20 @@ build/atf/sun50i_a64/bl31.bin: src/arm-trusted-firmware
@cd src/arm-trusted-firmware; make $(CROSS_FLAGS_BOOT) PLAT=sun50i_a64 bl31
@cp src/arm-trusted-firmware/build/sun50i_a64/release/bl31.bin "$@"

u-boot-sunxi-with-spl.bin: build/atf/sun50i_a64/bl31.bin src/u-boot
u-boot-sunxi-with-spl-pinephone.bin: build/atf/sun50i_a64/bl31.bin src/u-boot
@echo "MAKE $@"
@mkdir -p build/u-boot/sun50i_a64
@BL31=../../../build/atf/sun50i_a64/bl31.bin $(MAKE) -C src/u-boot O=../../build/u-boot/sun50i_a64 $(CROSS_FLAGS_BOOT) pinephone_defconfig
@BL31=../../../build/atf/sun50i_a64/bl31.bin $(MAKE) -C src/u-boot O=../../build/u-boot/sun50i_a64 $(CROSS_FLAGS_BOOT) ARCH=arm all
@cp build/u-boot/sun50i_a64/u-boot-sunxi-with-spl.bin "$@"

u-boot-sunxi-with-spl-pinetab.bin: build/atf/sun50i_a64/bl31.bin src/u-boot
@echo "MAKE $@"
@mkdir -p build/u-boot/sun50i_a64
@BL31=../../../build/atf/sun50i_a64/bl31.bin $(MAKE) -C src/u-boot O=../../build/u-boot/sun50i_a64 $(CROSS_FLAGS_BOOT) pinetab_defconfig
@BL31=../../../build/atf/sun50i_a64/bl31.bin $(MAKE) -C src/u-boot O=../../build/u-boot/sun50i_a64 $(CROSS_FLAGS_BOOT) ARCH=arm all
@cp build/u-boot/sun50i_a64/u-boot-sunxi-with-spl.bin "$@"

build/atf/rk3399/bl31.elf: src/arm-trusted-firmware
@echo "MAKE $@"
@mkdir -p build/atf/rk3399
Expand All @@ -150,36 +157,55 @@ u-boot-rk3399.bin: build/atf/rk3399/bl31.elf src/u-boot
@BL31=../../../build/atf/rk3399/bl31.elf $(MAKE) -C src/u-boot O=../../build/u-boot/rk3399 $(CROSS_FLAGS_BOOT) all
@cp build/u-boot/rk3399/u-boot "$@"

src/linux-rockchip:
deps: linux-pinebook-pro-v5.6.tar.gz orange-pi-5.9-20201019-1553.tar.gz arm-trusted-firmware.tar.gz u-boot-2020.04.tar.bz2 busybox-1.32.0.tar.bz2

src: deps src/linux-rockchip src/linux-sunxi src/arm-trusted-firmware src/u-boot src/busybox

linux-pinebook-pro-v5.6.tar.gz:
@echo "WGET linux-rockchip"
@mkdir src/linux-rockchip
@wget https://gitlab.manjaro.org/tsys/linux-pinebook-pro/-/archive/v5.6/linux-pinebook-pro-v5.6.tar.gz
@tar -xvf linux-pinebook-pro-v5.6.tar.gz --strip-components 1 -C src/linux-rockchip

src/linux-sunxi:
src/linux-rockchip: linux-pinebook-pro-v5.6.tar.gz
@echo "UNTAR linux-rockchip"
@mkdir src/linux-rockchip
@tar -xf linux-pinebook-pro-v5.6.tar.gz --strip-components 1 -C src/linux-rockchip

orange-pi-5.9-20201019-1553.tar.gz:
@echo "WGET linux-sunxi"
@mkdir src/linux-sunxi
@wget https://github.com/megous/linux/archive/orange-pi-5.9-20201019-1553.tar.gz
@tar -xvf orange-pi-5.9-20201019-1553.tar.gz --strip-components 1 -C src/linux-sunxi

src/arm-trusted-firmware:
src/linux-sunxi: orange-pi-5.9-20201019-1553.tar.gz
@echo "UNTAR linux-sunxi"
@mkdir src/linux-sunxi
@tar -xf orange-pi-5.9-20201019-1553.tar.gz --strip-components 1 -C src/linux-sunxi

arm-trusted-firmware.tar.gz:
@echo "WGET arm-trusted-firmware"
@wget -O arm-trusted-firmware.tar.gz https://github.com/ARM-software/arm-trusted-firmware/archive/50d8cf26dc57bb453b1a52be646140bfea4aa591.tar.gz

src/arm-trusted-firmware: arm-trusted-firmware.tar.gz
@echo "UNTAR arm-trusted-firmware"
@mkdir src/arm-trusted-firmware
@wget https://github.com/ARM-software/arm-trusted-firmware/archive/50d8cf26dc57bb453b1a52be646140bfea4aa591.tar.gz
@tar -xvf 50d8cf26dc57bb453b1a52be646140bfea4aa591.tar.gz --strip-components 1 -C src/arm-trusted-firmware
@tar -xf arm-trusted-firmware.tar.gz --strip-components 1 -C src/arm-trusted-firmware

src/u-boot:
u-boot-2020.04.tar.bz2:
@echo "WGET u-boot"
@mkdir src/u-boot
@wget ftp://ftp.denx.de/pub/u-boot/u-boot-2020.04.tar.bz2
@tar -xvf u-boot-2020.04.tar.bz2 --strip-components 1 -C src/u-boot
@cd src/u-boot && patch -p1 < ../u-boot-pinephone.patch

src/busybox:
src/u-boot: u-boot-2020.04.tar.bz2
@echo "UNTAR u-boot"
@mkdir src/u-boot
@tar -xf u-boot-2020.04.tar.bz2 --strip-components 1 -C src/u-boot
@cd src/u-boot && patch -p1 < ../u-boot-pinephone.patch && patch -p1 -i ../0001-isun50i-a64-Add-PinePhone-DTS-and-defconfig.patch

busybox-1.32.0.tar.bz2:
@echo "WGET busybox"
@mkdir src/busybox
@wget https://www.busybox.net/downloads/busybox-1.32.0.tar.bz2
@tar -xvf busybox-1.32.0.tar.bz2 --strip-components 1 -C src/busybox

src/busybox: busybox-1.32.0.tar.bz2
@echo "UNTAR busybox"
@mkdir src/busybox
@tar -xf busybox-1.32.0.tar.bz2 --strip-components 1 -C src/busybox

.PHONY: clean cleanfast

Expand All @@ -191,11 +217,15 @@ cleanfast:
@rm -vf *.apk
@rm -vf *.bin
@rm -vf *.cpio
@rm -vf *.gz
@rm -vf *.tar.gz
@rm -vf *.tar.bz2
@rm -vf *.scr
@rm -vf splash/*.gz

clean: cleanfast
cleansrc:
@rm -rf src/linux-rockchip src/linux-sunxi src/arm-trusted-firmware src/u-boot src/busybox

clean: cleanfast cleansrc
@rm -vf kernel*.gz
@rm -vf initramfs/bin/busybox
@rm -vrf dtbs
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ The dependencies are:
- mtools

```shell-session
$ git submodule update --init --recursive
Downloads the projects to build
$ make src
Downloads & unpacks the projects to build

$ make -j8 pine64-pinephone.img.xz
Builds everything needed for the pinephone image...
Expand Down
Loading