forked from u-boot/u-boot
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ayufan: dev.mk: own .gitlab-ci.yml ayufan: dev.mk: add `writesd` target ayufan: dev.mk: allow to compile ATF on-demand ayufan: dev.mk: add `loader-clearsd` ayufan: dev.mk: fix my rock64 build ayufan: dev.mk: support new partition layout ayufan: dev.mk: support `mtd` in `boot_device` validation ayufan: dev.mk: fix leds for rockpro64 and pinebookpro ayufan: dev.mk: support FLASH_SPI=1 for rockpro64 ayufan: dev.mk: fix loader flash ayufan: dev.mk: fix typo in erase_spi_flash ayufan: dev.mk: add FULL_WIPE ayufan: dev.mk: first recompile, then load
- Loading branch information
Showing
40 changed files
with
972 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
on: [push] | ||
|
||
env: | ||
RELEASE_START: 2021 # 2021, as this is latest build by GitLab CI | ||
|
||
jobs: | ||
build: | ||
runs-on: [self-hosted, Linux, ARM64] | ||
container: ayufan/rock64-dockerfiles:bookworm | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install binaries | ||
run: | | ||
apt-get -y update | ||
apt-get -y install docker.io \ | ||
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \ | ||
gcc-arm-linux-gnueabi g++-arm-linux-gnueabi \ | ||
python3-pip | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Configure ccache | ||
run: echo "CCACHE_DIR=$RUNNER_TEMP/ccache" >> $GITHUB_ENV | ||
- name: Reset ccache statistics | ||
run: ccache -M 0 -F 0 | ||
- name: Build package | ||
run: | | ||
export RELEASE=$(($RELEASE_START+$GITHUB_RUN_NUMBER)) | ||
rm -f ../*.deb | ||
./dev-make all | ||
- name: Release package | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
set -x | ||
export RELEASE=$(($RELEASE_START+$GITHUB_RUN_NUMBER)) | ||
export RELEASE_NAME="$(./dev-make version BOARD_TARGET=rock64)" | ||
export RELEASE_TITLE="$(./dev-make version BOARD_TARGET=rock64)" | ||
export DESCRIPTION="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" | ||
github-release release \ | ||
--tag "${RELEASE_NAME}" \ | ||
--name "${RELEASE_TITLE}" \ | ||
--user "${GITHUB_REPOSITORY%/*}" \ | ||
--repo "${GITHUB_REPOSITORY#*/}" \ | ||
--description "${DESCRIPTION}" \ | ||
--target "${GITHUB_SHA}" \ | ||
--draft | ||
sleep 3s # allow to update release | ||
for i in *.deb *.img.xz; do | ||
github-release upload \ | ||
--tag "${RELEASE_NAME}" \ | ||
--name "$(basename "${i}")" \ | ||
--user "${GITHUB_REPOSITORY%/*}" \ | ||
--repo "${GITHUB_REPOSITORY#*/}" \ | ||
--file "${i}" | ||
done | ||
github-release edit \ | ||
--tag "${RELEASE_NAME}" \ | ||
--name "${RELEASE_TITLE}" \ | ||
--user "${GITHUB_REPOSITORY%/*}" \ | ||
--repo "${GITHUB_REPOSITORY#*/}" \ | ||
--description "${DESCRIPTION}" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include dev-ayufan/chips/rk3399/board.mk | ||
|
||
UBOOT_DEFCONFIG ?= pinebook-pro-rk3399_defconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
UBOOT_DEFCONFIG ?= qemu_arm64_defconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include dev-ayufan/chips/rk3566/board.mk | ||
|
||
UBOOT_DEFCONFIG ?= quartz64-a-rk3566_defconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include dev-ayufan/chips/rk3566/board.mk | ||
|
||
UBOOT_DEFCONFIG ?= quartz64-b-rk3566_defconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include dev-ayufan/chips/rk3588/board.mk | ||
|
||
UBOOT_DEFCONFIG ?= rock5b-rk3588_defconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include dev-ayufan/chips/rk3328/board.mk | ||
|
||
UBOOT_DEFCONFIG ?= rock64-rk3328_defconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include dev-ayufan/chips/rk3399/board.mk | ||
|
||
UBOOT_DEFCONFIG ?= rock-pi-4-rk3399_defconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include dev-ayufan/chips/rk3399/board.mk | ||
|
||
UBOOT_DEFCONFIG ?= rockpro64-rk3399_defconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
UBOOT_TMP_DIR ?= $(CURDIR)/tmp/u-boot-$(BOARD_TARGET)-build | ||
UBOOT_OUTPUT_DIR ?= $(CURDIR)/tmp/u-boot-$(BOARD_TARGET) | ||
UBOOT_MAKE ?= make KBUILD_OUTPUT=$(UBOOT_OUTPUT_DIR) BL31=$(realpath $(BL31)) ROCKCHIP_TPL=$(realpath $(ROCKCHIP_TPL)) \ | ||
CROSS_COMPILE="ccache aarch64-linux-gnu-" | ||
|
||
UBOOT_LOADERS ?= $(addprefix $(UBOOT_OUTPUT_DIR)/, $(addsuffix .img, $(LOADERS))) | ||
UBOOT_TPL ?= $(UBOOT_OUTPUT_DIR)/tpl/u-boot-tpl.bin | ||
UBOOT_SPL ?= $(UBOOT_OUTPUT_DIR)/spl/u-boot-spl.bin | ||
|
||
tmp/u-boot-$(BOARD_TARGET)/.config: configs/$(UBOOT_DEFCONFIG) | ||
$(UBOOT_MAKE) $(UBOOT_DEFCONFIG) | ||
|
||
$(UBOOT_OUTPUT_DIR): | ||
mkdir -p $@ | ||
|
||
$(UBOOT_OUTPUT_DIR)/u-boot.bin: .scmversion $(UBOOT_OUTPUT_DIR) tmp/u-boot-$(BOARD_TARGET)/.config $(BL31) $(ROCKCHIP_TPL) | ||
$(UBOOT_MAKE) -j $$(nproc) | ||
|
||
$(UBOOT_OUTPUT_DIR)/u-boot.itb: $(UBOOT_OUTPUT_DIR)/u-boot.bin | ||
#grep CONFIG_LED=y $(UBOOT_OUTPUT_DIR)/.config | ||
#grep CONFIG_CMD_USB_MASS_STORAGE=y $(UBOOT_OUTPUT_DIR)/.config | ||
$(UBOOT_MAKE) -j $$(nproc) u-boot.itb | ||
|
||
$(UBOOT_TPL) $(UBOOT_SPL): $(UBOOT_OUTPUT_DIR)/u-boot.itb | ||
|
||
$(UBOOT_OUTPUT_DIR)/rksd_loader.img: $(UBOOT_OUTPUT_DIR)/u-boot.itb $(UBOOT_TPL) $(UBOOT_SPL) | ||
grep CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR= $(UBOOT_OUTPUT_DIR)/.config | ||
dev-ayufan/scripts/build_loader $@ $(UBOOT_OUTPUT_DIR)/idbloader.img $(IDBLOADER_OFFSET) $(UBOOT_OUTPUT_DIR) CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 512 | ||
|
||
$(UBOOT_OUTPUT_DIR)/rkspi_loader.img: $(UBOOT_OUTPUT_DIR)/u-boot.itb $(UBOOT_TPL) $(UBOOT_SPL) | ||
grep CONFIG_SPL_SPI_LOAD=y $(UBOOT_OUTPUT_DIR)/.config | ||
grep CONFIG_SYS_SPI_U_BOOT_OFFS= $(UBOOT_OUTPUT_DIR)/.config | ||
grep CONFIG_ROCKCHIP_SPI_IMAGE=y $(UBOOT_OUTPUT_DIR)/.config | ||
dev-ayufan/scripts/build_loader $@ $(UBOOT_OUTPUT_DIR)/idbloader-spi.img $$(($(IDBLOADER_SPI_OFFSET)*512)) $(UBOOT_OUTPUT_DIR) CONFIG_SYS_SPI_U_BOOT_OFFS 1 | ||
|
||
.PHONY: u-boot-menuconfig # edit u-boot config and save as defconfig | ||
u-boot-menuconfig: | ||
$(UBOOT_MAKE) ARCH=arm64 $(UBOOT_DEFCONFIG) | ||
$(UBOOT_MAKE) ARCH=arm64 menuconfig | ||
$(UBOOT_MAKE) ARCH=arm64 savedefconfig | ||
mv $(UBOOT_OUTPUT_DIR)/defconfig configs/$(UBOOT_DEFCONFIG) | ||
|
||
.PHONY: u-boot-build # compile u-boot | ||
u-boot-build: $(UBOOT_LOADERS) | ||
|
||
.PHONY: u-boot-bin | ||
u-boot-bin: $(UBOOT_OUTPUT_DIR)/u-boot.bin | ||
|
||
.PHONY: u-boot-clean | ||
u-boot-clean: | ||
rm -rf $(UBOOT_OUTPUT_DIR) | ||
rm -rf $(UBOOT_TMP_DIR) | ||
|
||
all: u-boot-bin u-boot-build | ||
clean: u-boot-clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
BL31 ?= tmp/rkbin/bin/rk33/rk322xh_bl31_v1.49.elf | ||
BOARD_CHIP ?= rk3328 | ||
ifneq (,$(FLASH_SPI)) | ||
RKDEV_LOADER_BIN ?= tmp/rkbin/loaders/rk3328_loader_v1.08.244_for_spi_nor_build_Aug_7_2017.bin | ||
else | ||
RKDEV_LOADER_BIN ?= tmp/rkbin/loaders/rk3328_loader_v1.19.250.bin | ||
endif | ||
IMAGES ?= flash-spi erase-spi | ||
LOADERS ?= rksd_loader rkspi_loader | ||
IDBLOADER_OFFSET ?= 64 | ||
IDBLOADER_SPI_OFFSET ?= 64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
setenv blink_power 'led power off; sleep 0.1; led power on' | ||
|
||
# erase flash | ||
run blink_power blink_power | ||
sf probe | ||
sf erase 0 400000 | ||
|
||
# blink forever | ||
while true; do run blink_power; sleep 1; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
setenv blink_power 'led power off; sleep 0.1; led power on' | ||
setenv blink_standby 'led standby off; sleep 0.1; led standby on' | ||
|
||
# first read existing loader | ||
run blink_power | ||
sf probe | ||
|
||
# or load rkspi_loader.img and write it to 8000 offset of spi | ||
# or fail badly | ||
|
||
if size ${devtype} ${devnum}:${distro_bootpart} rkspi_loader.img; then | ||
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} rkspi_loader.img | ||
|
||
# erase flash | ||
run blink_power blink_power | ||
sf erase 8000 3f8000 | ||
|
||
# write flash | ||
run blink_power blink_power blink_power | ||
sf write ${kernel_addr_r} 8000 ${filesize} | ||
|
||
# blink forever | ||
while true; do run blink_power; sleep 1; done | ||
else | ||
# blink forever | ||
echo "missing rksd_loader.img" | ||
while true; do run blink_standby; sleep 1; done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
BOARD_CHIP ?= rk3399 | ||
BL31 ?= tmp/rkbin/bin/rk33/rk3399_bl31_v1.36.elf | ||
RKDEV_LOADER_BIN ?= tmp/rkbin/loaders/rk3399_loader_v1.30.130.bin | ||
IMAGES ?= flash-spi erase-spi | ||
LOADERS ?= rksd_loader rkspi_loader | ||
IDBLOADER_OFFSET ?= 64 | ||
IDBLOADER_SPI_OFFSET ?= 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
setenv blink_power 'led work off; sleep 0.1; led work on' | ||
|
||
# erase flash | ||
run blink_power blink_power | ||
sf probe | ||
sf erase 0 400000 | ||
|
||
# blink forever | ||
while true; do run blink_power; sleep 1; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
setenv blink_power 'led work off; sleep 0.1; led work on' | ||
setenv blink_standby 'led diy off; sleep 0.1; led diy on' | ||
|
||
# first read existing loader | ||
run blink_power | ||
sf probe | ||
|
||
# or load rkspi_loader.img and write it to 0 offset of spi | ||
# or fail badly | ||
|
||
if size ${devtype} ${devnum}:${distro_bootpart} rkspi_loader.img; then | ||
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} rkspi_loader.img | ||
|
||
# erase flash | ||
run blink_power blink_power | ||
sf erase 0 400000 | ||
|
||
# write flash | ||
run blink_power blink_power blink_power | ||
sf write ${kernel_addr_r} 0 ${filesize} | ||
|
||
# blink forever | ||
while true; do run blink_power; sleep 1; done | ||
else | ||
# blink forever | ||
echo "missing rkspi_loader.img" | ||
while true; do run blink_standby; sleep 1; done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
BL31 ?= tmp/rkbin/bin/rk35/rk3568_bl31_v1.43.elf | ||
BOARD_CHIP ?= rk3566 | ||
UBOOT_TPL = | ||
ROCKCHIP_TPL ?= tmp/rkbin/bin/rk35/rk3566_ddr_1056MHz_v1.18.bin | ||
IMAGES ?= flash-spi erase-spi | ||
LOADERS ?= rksd_loader rkspi_loader | ||
IDBLOADER_OFFSET ?= 64 | ||
IDBLOADER_SPI_OFFSET ?= 64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
setenv blink_power 'led power off; sleep 0.1; led power on' | ||
|
||
# erase flash | ||
run blink_power blink_power | ||
sf probe | ||
sf erase 0 400000 | ||
|
||
# blink forever | ||
while true; do run blink_power; sleep 1; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
setenv blink_power 'led power off; sleep 0.1; led power on' | ||
setenv blink_standby 'led standby off; sleep 0.1; led standby on' | ||
|
||
# first read existing loader | ||
run blink_power | ||
sf probe | ||
|
||
# or load rksd_loader.img and write it to 8000 offset of spi | ||
# or fail badly | ||
|
||
if size ${devtype} ${devnum}:${distro_bootpart} rkspi_loader.img; then | ||
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} rkspi_loader.img | ||
|
||
# erase flash | ||
run blink_power blink_power | ||
sf erase 8000 3f8000 | ||
|
||
# write flash | ||
run blink_power blink_power blink_power | ||
sf write ${kernel_addr_r} 8000 ${filesize} | ||
|
||
# blink forever | ||
while true; do run blink_power; sleep 1; done | ||
else | ||
# blink forever | ||
echo "missing rksd_loader.img" | ||
while true; do run blink_standby; sleep 1; done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
BL31 ?= tmp/rkbin/bin/rk35/rk3588_bl31_v1.40.elf | ||
BOARD_CHIP ?= rk3588 | ||
UBOOT_TPL = | ||
ROCKCHIP_TPL ?= tmp/rkbin/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.12.bin | ||
RKDEV_LOADER_BIN ?= tmp/rkbin/loaders/rk3588_spl_loader_v1.12.112.bin | ||
LOADER_FLASH ?= rksd_loader | ||
IMAGES ?= flash-spi erase-spi | ||
LOADERS ?= rksd_loader rkspi_loader | ||
IDBLOADER_OFFSET ?= 64 | ||
IDBLOADER_SPI_OFFSET ?= 64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
setenv blink_power 'led power off; sleep 0.1; led power on' | ||
|
||
# erase flash | ||
run blink_power blink_power | ||
sf probe | ||
sf erase 0 400000 | ||
|
||
# blink forever | ||
while true; do run blink_power; sleep 1; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
setenv blink_power 'led power off; sleep 0.1; led power on' | ||
setenv blink_standby 'led standby off; sleep 0.1; led standby on' | ||
|
||
# first read existing loader | ||
run blink_power | ||
sf probe | ||
|
||
# or load rkspi_loader.img and write it to 8000 offset of spi | ||
# or fail badly | ||
|
||
if size ${devtype} ${devnum}:${distro_bootpart} rkspi_loader.img; then | ||
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} rkspi_loader.img | ||
|
||
# erase flash | ||
run blink_power blink_power | ||
sf erase 8000 3f8000 | ||
|
||
# write flash | ||
run blink_power blink_power blink_power | ||
sf write ${kernel_addr_r} 8000 ${filesize} | ||
|
||
# blink forever | ||
while true; do run blink_power; sleep 1; done | ||
else | ||
# blink forever | ||
echo "missing rkspi_loader.img" | ||
while true; do run blink_standby; sleep 1; done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
$(filter tmp/rkbin/%, $(BL31) $(UBOOT_TPL) $(UBOOT_SPL) $(RKDEV_LOADER_BIN) $(ROCKCHIP_TPL)): | ||
mkdir -p $$(dirname "$@") | ||
curl --fail -L https://github.com/ayufan-rock64/rkbin/raw/master/$(subst tmp/rkbin/,,$@) > $@.tmp | ||
mv $@.tmp $@ | ||
|
||
$(filter tmp/atf/%, $(BL31)): | ||
rm -rf $$(dirname "$@")/$$(basename "$@" .elf)/src | ||
git clone https://github.com/ARM-software/arm-trusted-firmware.git $$(dirname "$@")/$$(basename "$@" .elf)/src | ||
git -C $$(dirname "$@")/$$(basename "$@" .elf)/src checkout $$(basename "$@" .elf) | ||
make -C $$(dirname "$@")/$$(basename "$@" .elf)/src PLAT=$(BOARD_CHIP) CROSS_COMPILE="ccache aarch64-linux-gnu-" M0_CROSS_COMPILE="ccache arm-linux-gnueabi-" bl31 | ||
cp $$(dirname "$@")/$$(basename "$@" .elf)/src/build/$(BOARD_CHIP)/release/bl31/bl31.elf $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
$(UBOOT_OUTPUT_DIR)/%/boot.scr: dev-ayufan/chips/$(BOARD_CHIP)/%.cmd | ||
mkdir -p $$(dirname $@) | ||
mkimage -C none -A arm -T script -d $< $@ | ||
|
||
$(UBOOT_OUTPUT_DIR)/%/boot.img: $(UBOOT_OUTPUT_DIR)/%/boot.scr $(UBOOT_LOADERS) | ||
dd if=/dev/zero of=$@.tmp bs=1M count=32 | ||
mkfs.vfat -n "u-boot-scr" $@.tmp | ||
mcopy -sm -i $@.tmp $^ :: | ||
mv $@.tmp $@ | ||
|
||
u-boot-%-$(BOARD_TARGET).img: $(UBOOT_OUTPUT_DIR)/%/boot.img $(UBOOT_LOADERS) | ||
dd if=/dev/zero of=$@.tmp bs=1M count=16 | ||
parted -s $@.tmp mklabel gpt | ||
parted -s $@.tmp unit s mkpart bootloader 64 8127 | ||
parted -s $@.tmp unit s mkpart boot fat16 8192 100% | ||
parted -s $@.tmp set 2 legacy_boot on | ||
dd if=$(word 2,$^) of=$@.tmp conv=notrunc seek=64 | ||
dd if=$(word 1,$^) of=$@.tmp conv=notrunc seek=8192 | ||
mv "$@.tmp" $@ | ||
|
||
u-boot-%-$(BOARD_TARGET).img.xz: u-boot-%-$(BOARD_TARGET).img | ||
xz -f $< | ||
|
||
.PHONY: u-boot-images | ||
u-boot-images: $(addprefix u-boot-, $(addsuffix -$(BOARD_TARGET).img.xz, $(IMAGES))) | ||
|
||
u-boot-images-clean: | ||
ifneq (,$(IMAGES)) | ||
rm -f $(addprefix u-boot-, $(addsuffix -$(BOARD_TARGET).img.xz, $(IMAGES))) | ||
endif | ||
|
||
all: u-boot-images | ||
clean: u-boot-images-clean |
Oops, something went wrong.