Skip to content

Commit

Permalink
ayufan: dev.mk: add rockpi4b to build targets
Browse files Browse the repository at this point in the history
Change-Id: Iba0629b1fa0e85d71c638fd027585c0214788bf2
  • Loading branch information
ayufan committed May 28, 2019
1 parent 49104ce commit e2de533
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ build:
- ./dev-make BOARD_TARGET=rock64 -j5
- ./dev-make BOARD_TARGET=rockpro64 -j5
- ./dev-make BOARD_TARGET=pinebookpro -j5
- ./dev-make BOARD_TARGET=rockpi4b -j5
- |
set -x
Expand Down
9 changes: 9 additions & 0 deletions dev-ayufan/blobs/rockpi4b/erase-spi.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
setenv blink_power 'led status off; sleep 0.1; led status 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
28 changes: 28 additions & 0 deletions dev-ayufan/blobs/rockpi4b/flash-spi.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
setenv blink_power 'led status off; sleep 0.1; led status on'
setenv blink_standby 'led status off; sleep 0.1; led status 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
11 changes: 11 additions & 0 deletions dev-ayufan/boards.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ USE_SEPARATE_SPIFLASH ?= true
IMAGES ?= flash-spi erase-spi
LOADERS ?= rksd_loader rkspi_loader

else ifeq (rockpi4b,$(BOARD_TARGET))

UBOOT_DEFCONFIG ?= rockpi4b-rk3399_defconfig
UBOOT_TPL ?= tmp/rkbin/rk33/rk3399_ddr_933MHz_v1.19.bin
BL31 ?= tmp/rkbin/rk33/rk3399_bl31_v1.25.elf
BOARD_CHIP ?= rk3399
LOADER_BIN ?= tmp/rkbin/rk33/rk3399_loader_v1.10.112_support_1CS.bin
USE_SEPARATE_SPIFLASH ?= true
IMAGES ?= flash-spi erase-spi
LOADERS ?= rksd_loader rkspi_loader

else ifeq (pinebookpro,$(BOARD_TARGET))

UBOOT_DEFCONFIG ?= pinebook_pro-rk3399_defconfig
Expand Down
8 changes: 7 additions & 1 deletion dev-ayufan/root/usr/local/lib/u-boot-rockchip/loader-common
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ case "$PACKAGE_NAME" in
BOARD=pinebookpro
;;

*-rockchip-rockpi4b-*)
SD_LOADER=/usr/lib/u-boot-rockpi4b/rksd_loader.img
SPI_LOADER=/usr/lib/u-boot-rockpi4b/rkspi_loader.img
BOARD=rockpi4b
;;

*)
echo "Cannot detect board from $PACKAGE_NAME."
exit 1
Expand All @@ -56,7 +62,7 @@ esac

if ! grep -qi "$BOARD" /proc/device-tree/compatible; then
echo "You are currently running on different board:"
cat /proc/device-tree/model || true
echo "$(cat /proc/device-tree/model || true)"
echo "It may brick your device or the system unless"
echo "you know what are you doing."
echo ""
Expand Down

0 comments on commit e2de533

Please sign in to comment.