Skip to content

Commit

Permalink
ayufan: dev.mk: add quartz64a and quartz64b
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Nov 11, 2023
1 parent 0b207d4 commit 4d1240c
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 0 deletions.
1 change: 1 addition & 0 deletions configs/quartz64-a-rk3566_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,4 @@ CONFIG_USB_OHCI_GENERIC=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_GENERIC=y
CONFIG_ERRNO_STR=y
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
1 change: 1 addition & 0 deletions configs/quartz64-b-rk3566_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ CONFIG_USB_OHCI_GENERIC=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_GENERIC=y
CONFIG_ERRNO_STR=y
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
11 changes: 11 additions & 0 deletions dev-ayufan/blobs/quartz64a/board.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
UBOOT_DEFCONFIG ?= quartz64-a-rk3566_defconfig
BL31 ?= tmp/rkbin/bin/rk35/rk3568_bl31_v1.43.elf
BOARD_CHIP ?= rk3568
UBOOT_TPL =
ROCKCHIP_TPL ?= tmp/rkbin/bin/rk35/rk3568_ddr_1560MHz_v1.17.bin
LOADER_OFFSET ?= 64
LOADER_FLASH ?= rksd_loader
IMAGES ?= flash-spi erase-spi
LOADERS ?= rksd_loader rkspi_loader
RKSD_LOADER ?= idbloader.img
RKSPI_LOADER ?= idbloader-spi.img
9 changes: 9 additions & 0 deletions dev-ayufan/blobs/quartz64a/erase-spi.cmd
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
28 changes: 28 additions & 0 deletions dev-ayufan/blobs/quartz64a/flash-spi.cmd
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
11 changes: 11 additions & 0 deletions dev-ayufan/blobs/quartz64b/board.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
UBOOT_DEFCONFIG ?= quartz64-b-rk3566_defconfig
BL31 ?= tmp/rkbin/bin/rk35/rk3568_bl31_v1.43.elf
BOARD_CHIP ?= rk3568
UBOOT_TPL =
ROCKCHIP_TPL ?= tmp/rkbin/bin/rk35/rk3568_ddr_1560MHz_v1.17.bin
LOADER_OFFSET ?= 64
LOADER_FLASH ?= rksd_loader
IMAGES ?= flash-spi erase-spi
LOADERS ?= rksd_loader rkspi_loader
RKSD_LOADER ?= idbloader.img
RKSPI_LOADER ?= idbloader-spi.img
9 changes: 9 additions & 0 deletions dev-ayufan/blobs/quartz64b/erase-spi.cmd
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
28 changes: 28 additions & 0 deletions dev-ayufan/blobs/quartz64b/flash-spi.cmd
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

0 comments on commit 4d1240c

Please sign in to comment.