Skip to content

Commit

Permalink
BigTreeTech CB2 tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTheCoolingFan committed Nov 17, 2024
1 parent 95bd0ba commit 6083f36
Show file tree
Hide file tree
Showing 5 changed files with 545 additions and 7 deletions.
23 changes: 16 additions & 7 deletions config/boards/bigtreetech-cb2.csc
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,35 @@ function bigtreetech_uboot() {
declare -g BOOTCONFIG="bigtreetech_cb2_defconfig"
}

DDR_BLOB="rk35/rk3566_ddr_1056MHz_v1.21.bin"
BL31_BLOB="rk35/rk3568_bl31_v1.44.elf" # NOT a typo, bl31 is shared across 68 and 66

function mainline_uboot() {
display_alert "$BOARD" "mainline u-boot overrides" "info"

DDR_BLOB="rk35/rk3566_ddr_1056MHz_v1.21.bin"
BL31_BLOB="rk35/rk3568_bl31_v1.44.elf" # NOT a typo, bl31 is shared across 68 and 66

declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc
declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git"
declare -g BOOTBRANCH="tag:v2024.10"
declare -g BOOTPATCHDIR="v2024.10/board_bigtreetech-cb2"
#declare -g BOOTDIR="u-boot-${BOARD}"
declare -g BOOTDELAY=1 # Wait for UART interrupt to enter UMS/RockUSB mode etc
declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin"
declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin u-boot-rockchip-spi.bin u-boot.itb idbloader.img idbloader-spi.img"
unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd # disable stuff from rockchip64_common; we're using binman here which does all the work already

# Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go
function write_uboot_platform() {
dd if=${1}/u-boot-rockchip.bin of=${2} bs=32k seek=1 conv=fsync
dd "if=${1}/u-boot-rockchip.bin" "of=${2}" bs=32k seek=1 conv=notrunc
}

#declare -g BOOTCONFIG=generic-rk3568_defconfig
function write_uboot_platform_mtd() {
declare -a extra_opts_flashcp=("--verbose")
if flashcp -h | grep -q -e '--partition'; then
echo "Confirmed flashcp supports --partition -- read and write only changed blocks." >&2
extra_opts_flashcp+=("--partition")
else
echo "flashcp does not support --partition, will write full SPI flash blocks." >&2
fi
flashcp "${extra_opts_flashcp[@]}" "${1}/u-boot-rockchip-spi.bin" /dev/mtd0
}
}

# vim: ft=bash
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
pinctrl-0 = <&pmic_int>, <&i2s1m0_mclk>;

rockchip,system-power-controller;
system-power-controller;
wakeup-source;
#clock-cells = <1>;
clock-output-names = "rk808-clkout1", "rk808-clkout2";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: JohnTheCoolingFan <[email protected]>
Date: Tue, 12 Nov 2024 16:19:49 +0000
Subject: Patching u-boot rockchip64 files
configs/bigtreetech-cb2-rk3566_defconfig

Signed-off-by: JohnTheCoolingFan <[email protected]>
---
configs/bigtreetech-cb2-rk3566_defconfig | 2 ++
1 file changed, 2 insertions(+)

diff --git a/configs/bigtreetech-cb2-rk3566_defconfig b/configs/bigtreetech-cb2-rk3566_defconfig
index 2f427107089..bec31c94e3f 100644
--- a/configs/bigtreetech-cb2-rk3566_defconfig
+++ b/configs/bigtreetech-cb2-rk3566_defconfig
@@ -2,10 +2,11 @@ CONFIG_ARM=y
CONFIG_ARCH_ROCKCHIP=y
CONFIG_SYS_MALLOC_F_LEN=0x80000
CONFIG_SF_DEFAULT_SPEED=20000000
CONFIG_DEFAULT_DEVICE_TREE="rk3566-bigtreetech-cb2"
CONFIG_ROCKCHIP_RK3568=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
CONFIG_SPL_SERIAL=y
CONFIG_DEBUG_UART_BASE=0xFE660000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_SPL_LIBDISK_SUPPORT=y
CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -95,10 +96,11 @@ CONFIG_SPL_RAM=y
CONFIG_ROCKCHIP_SDRAM_COMMON=y
CONFIG_BAUDRATE=1500000
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_SYS_NS16550_MEM32=y
CONFIG_ROCKCHIP_SFC=y
+CONFIG_ROCKCHIP_SPI=y
CONFIG_SYSRESET=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=y
CONFIG_USB_XHCI_PCI=y
--
Created with Armbian build tools https://github.com/armbian/build

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: JohnTheCoolingFan <[email protected]>
Date: Wed, 13 Nov 2024 12:39:59 +0000
Subject: Patching u-boot rockchip64 files
configs/bigtreetech-cb2-rk3566_defconfig

Signed-off-by: JohnTheCoolingFan <[email protected]>
---
configs/bigtreetech-cb2-rk3566_defconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/configs/bigtreetech-cb2-rk3566_defconfig b/configs/bigtreetech-cb2-rk3566_defconfig
index bec31c94e3f..e68e8965810 100644
--- a/configs/bigtreetech-cb2-rk3566_defconfig
+++ b/configs/bigtreetech-cb2-rk3566_defconfig
@@ -89,10 +89,11 @@ CONFIG_PCIE_DW_ROCKCHIP=y
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
CONFIG_SPL_PINCTRL=y
CONFIG_DM_PMIC=y
CONFIG_PMIC_RK8XX=y
+CONFIG_SPL_PMIC_RK8XX=y
CONFIG_REGULATOR_RK8XX=y
CONFIG_SPL_RAM=y
CONFIG_ROCKCHIP_SDRAM_COMMON=y
CONFIG_BAUDRATE=1500000
CONFIG_DEBUG_UART_SHIFT=2
--
Created with Armbian build tools https://github.com/armbian/build

Loading

0 comments on commit 6083f36

Please sign in to comment.