Skip to content

Commit

Permalink
Implemented make files to build platform specifics
Browse files Browse the repository at this point in the history
  • Loading branch information
xX7 committed Dec 1, 2022
1 parent 488a73a commit 107fa79
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
*.idb
*.pdb

# Output Folders
sdcard/*
firmware-rpi/*

# Kernel Module Compile Results
*.mod*
*.cmd
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SHELL:=/bin/bash

all: platform

include platform.mk

.PHONY: all
43 changes: 43 additions & 0 deletions platform.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

ARCH:=aarch64

curPath:=$(abspath .)
srcPath:=$(curPath)/src
imgPath:=$(curPath)/sdcard

firmware_repo:=https://github.com/raspberrypi/firmware.git
firmware_version:=1.20210201
firmware_images:=$(curPath)/firmware-rpi

atf_src:=$(srcPath)/arm-trusted-firmware
atf_dest_image:=$(imgPath)/bl31.bin
atf_plat:=rpi4

uboot_src:=$(srcPath)/u-boot
uboot_defconfig:=rpi_4_defconfig
uboot_dest_image:=$(imgPath)/u-boot.bin

atf $(atf_dest_image): $(atf_src)
$(MAKE) -C $(atf_src) bl31 PLAT=$(atf_plat)
cp $(atf_src)/build/$(atf_plat)/release/bl31.bin $(atf_dest_image)


u-boot $(uboot_dest_image): $(uboot_src)
$(MAKE) -C $(uboot_src) $(uboot_defconfig)
$(MAKE) -C $(uboot_src) -j$(nproc)
cp $(uboot_src)/u-boot.bin $(uboot_dest_image)

$(firmware_images):
git clone --depth 1 --branch $(firmware_version) $(firmware_repo) $(firmware_images)

sdcardDir:
@mkdir -p $(imgPath)

#instuctions:=$(bao_demos)/platforms/$(PLATFORM)/README.md

platform: sdcardDir $(uboot_dest_image) $(atf_dest_image) $(firmware_images)
# $(call print-instructions, $(instuctions), 1, false)
# $(call print-instructions, $(instuctions), 2, false)
# $(call print-instructions, $(instuctions), 3, true)

.PHONY: sdcardDir

0 comments on commit 107fa79

Please sign in to comment.