diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d8e0870087c8..70ba8f0aae91 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -34,6 +34,7 @@ config/boards/bananapim5.conf @igorpecovnik config/boards/bananapim64.csc @devdotnetorg config/boards/bananapim7.conf @amazingfate config/boards/bigtreetech-cb1.conf @JohnTheCoolingFan +config/boards/bigtreetech-cb2.conf @JohnTheCoolingFan config/boards/cherryba-m1.csc @IsMrX config/boards/clearfogpro.csc @Heisath config/boards/cm3588-nas.csc @ColorfulRhino @@ -168,7 +169,7 @@ config/kernel/linux-phytium-embedded-*.config @chainsx config/kernel/linux-rk35xx-*.config @ColorfulRhino @HeyMeco @SeeleVolleri @SuperKali @Tonymac32 @ZazaBR @alexl83 @amazingfate @catalinii @chainsx @efectn @fridtjof @ginkage @hoochiwetech @krachlatte @lanefu @linhz0hz @mahdichi @mattx433 @monkaBlyat @prahal @rpardini @schwar3kat @sputnik2019 @vamzii config/kernel/linux-rockchip-*.config @paolosabatino config/kernel/linux-rockchip-rk3588-*.config @ColorfulRhino @HeyMeco @SuperKali @Tonymac32 @alexl83 @amazingfate @andyshrk @efectn @fridtjof @lanefu @linhz0hz @rpardini @schwar3kat -config/kernel/linux-rockchip64-*.config @150balbes @Manouchehri @TRSx80 @TheSnowfield @Tonymac32 @ZazaBR @ahoneybun @amazingfate @andyshrk @brentr @catalinii @clee @hqnicolas @igorpecovnik @joekhoobyar @krachlatte @paolosabatino @prahal @rpardini @sicXnull @tdleiyao @utlark @vamzii +config/kernel/linux-rockchip64-*.config @150balbes @JohnTheCoolingFan @Manouchehri @TRSx80 @TheSnowfield @Tonymac32 @ZazaBR @ahoneybun @amazingfate @andyshrk @brentr @catalinii @clee @hqnicolas @igorpecovnik @joekhoobyar @krachlatte @paolosabatino @prahal @rpardini @sicXnull @tdleiyao @utlark @vamzii config/kernel/linux-sm8250-*.config @FantasyGmm @amazingfate config/kernel/linux-sun55iw3-syterkit-*.config @chainsx config/kernel/linux-sunxi-*.config @1ubuntuuser @AaronNGray @DylanHP @Janmcha @StephenGraf @Tonymac32 @janprunk @lbmendes @mhawkins-consultant @sgjava @@ -192,7 +193,7 @@ patch/kernel/phytium-embedded-*/ @chainsx patch/kernel/rk35xx-vendor-*/ @ColorfulRhino @HeyMeco @SeeleVolleri @SuperKali @Tonymac32 @ZazaBR @alexl83 @amazingfate @catalinii @chainsx @efectn @fridtjof @ginkage @hoochiwetech @krachlatte @lanefu @linhz0hz @mahdichi @mattx433 @monkaBlyat @prahal @rpardini @schwar3kat @sputnik2019 @vamzii patch/kernel/rockchip-*/ @paolosabatino patch/kernel/rockchip-rk3588-*/ @ColorfulRhino @HeyMeco @SuperKali @Tonymac32 @alexl83 @amazingfate @andyshrk @efectn @fridtjof @lanefu @linhz0hz @rpardini @schwar3kat -patch/kernel/rockchip64-*/ @150balbes @Manouchehri @TRSx80 @TheSnowfield @Tonymac32 @ZazaBR @ahoneybun @amazingfate @andyshrk @brentr @catalinii @clee @hqnicolas @igorpecovnik @joekhoobyar @krachlatte @paolosabatino @prahal @rpardini @sicXnull @tdleiyao @utlark @vamzii +patch/kernel/rockchip64-*/ @150balbes @JohnTheCoolingFan @Manouchehri @TRSx80 @TheSnowfield @Tonymac32 @ZazaBR @ahoneybun @amazingfate @andyshrk @brentr @catalinii @clee @hqnicolas @igorpecovnik @joekhoobyar @krachlatte @paolosabatino @prahal @rpardini @sicXnull @tdleiyao @utlark @vamzii patch/kernel/sm8250-*/ @FantasyGmm @amazingfate patch/kernel/sm8550-*/ @FantasyGmm patch/kernel/sun55iw3-syterkit-*/ @chainsx @@ -210,7 +211,7 @@ sources/families/phytium-embedded.conf @chainsx sources/families/rk35xx.conf @ColorfulRhino @HeyMeco @SeeleVolleri @SuperKali @Tonymac32 @ZazaBR @alexl83 @amazingfate @catalinii @chainsx @efectn @fridtjof @ginkage @hoochiwetech @krachlatte @lanefu @linhz0hz @mahdichi @mattx433 @monkaBlyat @prahal @rpardini @schwar3kat @sputnik2019 @vamzii sources/families/rockchip-rk3588.conf @ColorfulRhino @HeyMeco @SuperKali @Tonymac32 @alexl83 @amazingfate @andyshrk @efectn @fridtjof @lanefu @linhz0hz @rpardini @schwar3kat sources/families/rockchip.conf @paolosabatino -sources/families/rockchip64.conf @150balbes @Manouchehri @TRSx80 @TheSnowfield @Tonymac32 @ZazaBR @ahoneybun @amazingfate @andyshrk @brentr @catalinii @clee @hqnicolas @igorpecovnik @joekhoobyar @krachlatte @paolosabatino @prahal @rpardini @sicXnull @tdleiyao @utlark @vamzii +sources/families/rockchip64.conf @150balbes @JohnTheCoolingFan @Manouchehri @TRSx80 @TheSnowfield @Tonymac32 @ZazaBR @ahoneybun @amazingfate @andyshrk @brentr @catalinii @clee @hqnicolas @igorpecovnik @joekhoobyar @krachlatte @paolosabatino @prahal @rpardini @sicXnull @tdleiyao @utlark @vamzii sources/families/sm8250.conf @FantasyGmm @amazingfate sources/families/sun55iw3-syterkit.conf @chainsx sources/families/sunxi.conf @1ubuntuuser @AaronNGray @DylanHP @Janmcha @StephenGraf @Tonymac32 @janprunk @lbmendes @mhawkins-consultant @sgjava diff --git a/config/boards/bananapif3.csc b/config/boards/bananapif3.eos similarity index 100% rename from config/boards/bananapif3.csc rename to config/boards/bananapif3.eos diff --git a/config/boards/bananapim4zero.conf b/config/boards/bananapim4zero.conf index 9e71b70c7792..e14f9a7be90f 100644 --- a/config/boards/bananapim4zero.conf +++ b/config/boards/bananapim4zero.conf @@ -4,7 +4,7 @@ BOARDFAMILY="sun50iw9-bpi" BOARD_MAINTAINER="pyavitz" BOOTCONFIG="bananapi_m4zero_defconfig" OVERLAY_PREFIX="sun50i-h616" -BOOT_FDT_FILE="allwinner/sun50i-h618-bananapi-m4-zero.dtb" +BOOT_FDT_FILE="sun50i-h618-bananapi-m4-zero.dtb" BOOT_LOGO="desktop" KERNEL_TARGET="current,edge" KERNEL_TEST_TARGET="current" diff --git a/config/boards/bigtreetech-cb1.conf b/config/boards/bigtreetech-cb1.conf index a986944d2b77..080afc4dd40e 100644 --- a/config/boards/bigtreetech-cb1.conf +++ b/config/boards/bigtreetech-cb1.conf @@ -10,4 +10,4 @@ FORCE_BOOTSCRIPT_UPDATE="yes" BOOTFS_TYPE="fat" BOOT_FS_LABEL="BOOT" OVERLAY_PREFIX="sun50i-h616" -BOOT_FDT_FILE="allwinner/sun50i-h616-bigtreetech-cb1-sd.dtb" +BOOT_FDT_FILE="sun50i-h616-bigtreetech-cb1-sd.dtb" diff --git a/config/boards/bigtreetech-cb2.conf b/config/boards/bigtreetech-cb2.conf new file mode 100644 index 000000000000..b9ce764d7ded --- /dev/null +++ b/config/boards/bigtreetech-cb2.conf @@ -0,0 +1,48 @@ +# Rockchip RK3566 quad core 2GB-8GB GBE eMMC NVMe USB3 WiFi +BOARD_NAME="BigTreeTech CB2" +BOARDFAMILY="rockchip64" +BOARD_MAINTAINER="JohnTheCoolingFan" +BOOTCONFIG="bigtreetech-cb2-rk3566_defconfig" +BOOT_SOC="rk3566" +KERNEL_TARGET="current,edge" +KERNEL_TEST_TARGET="current" +BOOT_FDT_FILE="rockchip/rk3566-bigtreetech-cb2.dtb" +IMAGE_PARTITION_TABLE="gpt" +BOOT_SCENARIO="spl-blobs" +OVERLAY_PREFIX='rk3566' +FULL_DESKTOP="yes" +BOOT_LOGO="desktop" + +# TODO: replace with BOOT_SCENARIO=binman when it gets merged and in good shape +function post_family_config__bigtreetech-cb2_uboot_overrides() { + 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 UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin" + 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=notrunc + } + + 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 diff --git a/config/boards/inovato-quadra.conf b/config/boards/inovato-quadra.conf index e0d5a98609c3..54443537ed5a 100644 --- a/config/boards/inovato-quadra.conf +++ b/config/boards/inovato-quadra.conf @@ -4,7 +4,7 @@ BOARDFAMILY="sun50iw6" BOARD_MAINTAINER="NicoD-SBC" BOOTCONFIG="tanix_tx6_defconfig" CRUSTCONFIG="tanix_tx6_defconfig" -BOOT_FDT_FILE="allwinner/sun50i-h6-inovato-quadra.dtb" +BOOT_FDT_FILE="sun50i-h6-inovato-quadra.dtb" KERNEL_TARGET="legacy,current,edge" KERNEL_TEST_TARGET="current" BOOT_LOGO="desktop" diff --git a/config/boards/longanpi-3h.csc b/config/boards/longanpi-3h.csc new file mode 100644 index 000000000000..d0ab4ee7db6b --- /dev/null +++ b/config/boards/longanpi-3h.csc @@ -0,0 +1,15 @@ +# Allwinner H618 quad core 1GB/2GB/4GB RAM +BOARD_NAME="Longan Pi 3H" +BOARDFAMILY="sun50iw9" +BOARD_MAINTAINER="" +BOOTCONFIG="longanpi_3h_defconfig" +BOOTBRANCH="tag:v2024.10" +BOOTPATCHDIR="v2024.10" +BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory +BOOT_LOGO="desktop" +OVERLAY_PREFIX="sun50i-h616" +KERNEL_TARGET="current,edge" +KERNEL_TEST_TARGET="current" +FORCE_BOOTSCRIPT_UPDATE="yes" +enable_extension "radxa-aic8800" # compatible with radxa-aic8800 +AIC8800_TYPE="usb" diff --git a/config/boards/mixtile-edge2.csc b/config/boards/mixtile-edge2.csc index 66cdbb67dd3d..41a7e170c30d 100644 --- a/config/boards/mixtile-edge2.csc +++ b/config/boards/mixtile-edge2.csc @@ -40,7 +40,7 @@ function post_family_config_branch_vendor__kernel_and_uboot_rk35xx_mixtile_edge2 # Copypasta from rockchip-rk3588.conf family file -- we _really_ gotta find a better way! declare -g KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. declare -g KERNELSOURCE='https://github.com/armbian/linux-rockchip.git' - declare -g KERNELBRANCH='branch:rk-6.1-rkr3' + declare -g KERNELBRANCH='branch:rk-6.1-rkr4.1' declare -g KERNELPATCHDIR='rk35xx-vendor-6.1' declare -g LINUXFAMILY=rk35xx declare -g -i KERNEL_GIT_CACHE_TTL=120 # 2 minutes diff --git a/config/boards/pineh64-b.csc b/config/boards/pineh64-b.csc index 4da15fed6bc0..c337a0efc31c 100644 --- a/config/boards/pineh64-b.csc +++ b/config/boards/pineh64-b.csc @@ -5,5 +5,5 @@ BOARD_MAINTAINER="" BOOTCONFIG="pine_h64_defconfig" KERNEL_TARGET="legacy,current,edge" KERNEL_TEST_TARGET="current" -BOOT_FDT_FILE="allwinner/sun50i-h6-pine-h64-model-b.dtb" +BOOT_FDT_FILE="sun50i-h6-pine-h64-model-b.dtb" CRUSTCONFIG="h6_defconfig" diff --git a/config/bootscripts/boot-sun50i-next.cmd b/config/bootscripts/boot-sun50i-next.cmd index 2724f49c5bbf..0bd8b1b425c2 100644 --- a/config/bootscripts/boot-sun50i-next.cmd +++ b/config/bootscripts/boot-sun50i-next.cmd @@ -13,14 +13,16 @@ setenv console "both" setenv docker_optimizations "on" setenv bootlogo "false" -# Remember the default u-boot fdtfile -setenv deffdt_file ${fdtfile} +setenv vendor "allwinner" + +# Remember the default fdtfile provided by u-boot and delete the vendor name +if setexpr subfdt sub ${vendor}/ "" ${fdtfile};then + setenv deffdt_file ${subfdt} +fi # Remember the default u-boot fdtdir setenv deffdt_dir "${prefix}dtb" -if test "$fdtdir" = ""; then setenv fdtdir "${deffdt_dir}";fi - -setenv vendor "allwinner" +if test "$fdtdir" = ""; then setenv fdtdir "${deffdt_dir}/${vendor}";fi # Print boot source itest.b *0x10028 == 0x00 && echo "U-boot loaded from SD" @@ -34,32 +36,32 @@ if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then env import -t ${load_addr} ${filesize} fi +# Delete the vendor's name from the fdtfile variable and record the result +# after the file with the environment variables has been read +if setexpr subfdt sub ${vendor}/ "" ${fdtfile};then + setenv fdtfile ${subfdt} +fi + # In this shell, we can only check the existence of the file. # Make a check of reasonable ways to find the dtb file. # Set the true value of the paths. if test -e ${devtype} ${devnum} "${fdtdir}/${fdtfile}"; then - : + echo "Load fdt: ${fdtdir}/${fdtfile}" else - echo "File ${fdtdir}/${fdtfile} does not exists" - if test -e ${devtype} ${devnum} "${deffdt_dir}/${vendor}/${fdtfile}"; then - setenv fdtdir "${deffdt_dir}/${vendor}" + echo "The file ${fdtfile} was not found in the path ${fdtdir}" + if test -e ${devtype} ${devnum} "${deffdt_dir}/${fdtfile}"; then + setenv fdtdir "${deffdt_dir}" + echo "Load fdt: ${fdtdir}/${fdtfile}" else - echo "File ${deffdt_dir}/${vendor}/${fdtfile} does not exists" - if test -e ${devtype} ${devnum} "${deffdt_dir}/${fdtfile}"; then - setenv fdtdir "${deffdt_dir}" + if test -e ${devtype} ${devnum} "${deffdt_dir}/${vendor}/${deffdt_file}"; then + setenv fdtdir "${deffdt_dir}/${vendor}" + setenv fdtfile "${deffdt_file}" + echo "Load fdt: ${fdtdir}/${fdtfile}" else - echo "File ${deffdt_dir}/${fdtfile} does not exists" - if test -e ${devtype} ${devnum} "${deffdt_dir}/${vendor}/${deffdt_file}"; then - setenv fdtdir "${deffdt_dir}/${vendor}" + if test -e ${devtype} ${devnum} "${deffdt_dir}/${deffdt_file}"; then + setenv fdtdir "${deffdt_dir}" setenv fdtfile "${deffdt_file}" - else - echo "File ${deffdt_dir}/${vendor}/${deffdt_file} does not exists" - if test -e ${devtype} ${devnum} "${deffdt_dir}/${deffdt_file}"; then - setenv fdtdir "${deffdt_dir}" - setenv fdtfile "${deffdt_file}" - else - echo "File ${deffdt_dir}/${deffdt_file} does not exists" - fi + echo "Load fdt: ${fdtdir}/${fdtfile}" fi fi fi diff --git a/config/bootscripts/boot-sunxi.cmd b/config/bootscripts/boot-sunxi.cmd index 5c561957cb5d..86f5f7052979 100644 --- a/config/bootscripts/boot-sunxi.cmd +++ b/config/bootscripts/boot-sunxi.cmd @@ -45,32 +45,32 @@ if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then env import -t ${load_addr} ${filesize} fi +# Delete the vendor's name from the fdtfile variable and record the result +# after the file with the environment variables has been read +if setexpr subfdt sub ${vendor}/ "" ${fdtfile};then + setenv fdtfile ${subfdt} +fi + # In this shell, we can only check the existence of the file. # Make a check of reasonable ways to find the dtb file. # Set the true value of the paths. if test -e ${devtype} ${devnum} "${fdtdir}/${fdtfile}"; then - : + echo "Load fdt: ${fdtdir}/${fdtfile}" else - echo "File ${fdtdir}/${fdtfile} does not exists" + echo "The file ${fdtfile} was not found in the path ${fdtdir}" if test -e ${devtype} ${devnum} "${deffdt_dir}/${vendor}/${fdtfile}"; then setenv fdtdir "${deffdt_dir}/${vendor}" + echo "Load fdt: ${fdtdir}/${fdtfile}" else - echo "File ${deffdt_dir}/${vendor}/${fdtfile} does not exists" - if test -e ${devtype} ${devnum} "${deffdt_dir}/${fdtfile}"; then - setenv fdtdir "${deffdt_dir}" + if test -e ${devtype} ${devnum} "${deffdt_dir}/${vendor}/${deffdt_file}"; then + setenv fdtdir "${deffdt_dir}/${vendor}" + setenv fdtfile "${deffdt_file}" + echo "Load fdt: ${fdtdir}/${fdtfile}" else - echo "File ${deffdt_dir}/${fdtfile} does not exists" - if test -e ${devtype} ${devnum} "${deffdt_dir}/${vendor}/${deffdt_file}"; then - setenv fdtdir "${deffdt_dir}/${vendor}" + if test -e ${devtype} ${devnum} "${deffdt_dir}/${deffdt_file}"; then + setenv fdtdir "${deffdt_dir}" setenv fdtfile "${deffdt_file}" - else - echo "File ${deffdt_dir}/${vendor}/${deffdt_file} does not exists" - if test -e ${devtype} ${devnum} "${deffdt_dir}/${deffdt_file}"; then - setenv fdtdir "${deffdt_dir}" - setenv fdtfile "${deffdt_file}" - else - echo "File ${deffdt_dir}/${deffdt_file} does not exists" - fi + echo "Load fdt: ${fdtdir}/${fdtfile}" fi fi fi @@ -99,9 +99,7 @@ load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}zImage if test -e ${devtype} ${devnum} "${prefix}.next"; then echo "Found mainline kernel configuration" - if load ${devtype} ${devnum} ${fdt_addr_r} ${fdtdir}/${fdtfile}; then - echo "Load fdt: ${fdtdir}/${fdtfile}" - fi + load ${devtype} ${devnum} ${fdt_addr_r} ${fdtdir}/${fdtfile} fdt addr ${fdt_addr_r} fdt resize 65536 for overlay_file in ${overlays}; do @@ -120,7 +118,8 @@ if test -e ${devtype} ${devnum} "${prefix}.next"; then echo "Error applying DT overlays, restoring original DT" load ${devtype} ${devnum} ${fdt_addr_r} ${fdtdir}/${fdtfile} else - if load ${devtype} ${devnum} ${load_addr} ${fdtdir}/overlay/${overlay_prefix}-fixup.scr; then + if test -e ${devtype} ${devnum} ${fdtdir}/overlay/${overlay_prefix}-fixup.scr; then + load ${devtype} ${devnum} ${load_addr} ${fdtdir}/overlay/${overlay_prefix}-fixup.scr echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)" source ${load_addr} fi diff --git a/config/kernel/linux-rockchip64-current.config b/config/kernel/linux-rockchip64-current.config index 2e8e7e9cebcc..e7db6f5d8fa9 100644 --- a/config/kernel/linux-rockchip64-current.config +++ b/config/kernel/linux-rockchip64-current.config @@ -7796,6 +7796,7 @@ CONFIG_FB_TFT_SSD1331=m CONFIG_FB_TFT_SSD1351=m CONFIG_FB_TFT_ST7735R=m CONFIG_FB_TFT_ST7789V=m +CONFIG_FB_TFT_ST7796=m CONFIG_FB_TFT_TINYLCD=m CONFIG_FB_TFT_TLS8204=m CONFIG_FB_TFT_UC1611=m diff --git a/config/kernel/linux-rockchip64-edge.config b/config/kernel/linux-rockchip64-edge.config index 18a6f5228004..4eaae942d505 100644 --- a/config/kernel/linux-rockchip64-edge.config +++ b/config/kernel/linux-rockchip64-edge.config @@ -8031,6 +8031,7 @@ CONFIG_FB_TFT_SSD1331=m CONFIG_FB_TFT_SSD1351=m CONFIG_FB_TFT_ST7735R=m CONFIG_FB_TFT_ST7789V=m +CONFIG_FB_TFT_ST7796=m CONFIG_FB_TFT_TINYLCD=m CONFIG_FB_TFT_TLS8204=m CONFIG_FB_TFT_UC1611=m diff --git a/config/sources/families/include/rockchip64_common.inc b/config/sources/families/include/rockchip64_common.inc index a970819f91e7..5e18f422f676 100644 --- a/config/sources/families/include/rockchip64_common.inc +++ b/config/sources/families/include/rockchip64_common.inc @@ -301,18 +301,15 @@ write_uboot_platform_mtd() { } setup_write_uboot_platform() { - if grep -q "ubootpart" /proc/cmdline; then - - local tmp=$(cat /proc/cmdline) + local tmp part dev + tmp=$(cat /proc/cmdline) tmp="${tmp##*ubootpart=}" tmp="${tmp%% *}" - [[ -n $tmp ]] && local part=$(findfs PARTUUID=$tmp 2> /dev/null) - [[ -n $part ]] && local dev=$(lsblk -n -o PKNAME $part 2> /dev/null) + [[ -n $tmp ]] && part=$(findfs PARTUUID=$tmp 2> /dev/null) + [[ -n $part ]] && dev=$(lsblk -n -o PKNAME $part 2> /dev/null) [[ -n $dev ]] && DEVICE="/dev/$dev" - fi - } family_tweaks() { diff --git a/config/sources/families/include/sunxi64_common.inc b/config/sources/families/include/sunxi64_common.inc index e60cdd5d8548..14ef14571703 100644 --- a/config/sources/families/include/sunxi64_common.inc +++ b/config/sources/families/include/sunxi64_common.inc @@ -54,21 +54,22 @@ write_uboot_platform() { } setup_write_uboot_platform() { + local tmp part dev if grep -q "ubootpart" /proc/cmdline; then # mainline with new boot script - local tmp=$(cat /proc/cmdline) + tmp=$(cat /proc/cmdline) tmp="${tmp##*ubootpart=}" tmp="${tmp%% *}" - [[ -n $tmp ]] && local part=$(findfs PARTUUID=$tmp 2> /dev/null) - [[ -n $part ]] && local dev=$(lsblk -n -o PKNAME $part 2> /dev/null) + [[ -n $tmp ]] && part=$(findfs PARTUUID=$tmp 2> /dev/null) + [[ -n $part ]] && dev=$(lsblk -n -o PKNAME $part 2> /dev/null) [[ -n $dev ]] && DEVICE="/dev/$dev" else # legacy or old boot script - local tmp=$(cat /proc/cmdline) + tmp=$(cat /proc/cmdline) tmp="${tmp##*root=}" tmp="${tmp%% *}" - [[ -n $tmp ]] && local part=$(findfs $tmp 2> /dev/null) - [[ -n $part ]] && local dev=$(lsblk -n -o PKNAME $part 2> /dev/null) + [[ -n $tmp ]] && part=$(findfs $tmp 2> /dev/null) + [[ -n $part ]] && dev=$(lsblk -n -o PKNAME $part 2> /dev/null) # do not try to write u-boot to USB devices [[ -n $dev && $dev == mmcblk* ]] && DEVICE="/dev/$dev" fi diff --git a/config/sources/families/include/sunxi_common.inc b/config/sources/families/include/sunxi_common.inc index 4f47560b6947..0ef69277244f 100644 --- a/config/sources/families/include/sunxi_common.inc +++ b/config/sources/families/include/sunxi_common.inc @@ -63,12 +63,13 @@ write_uboot_platform() { } setup_write_uboot_platform() { + local tmp part dev if grep -q "ubootpart" /proc/cmdline; then - local tmp=$(cat /proc/cmdline) + tmp=$(cat /proc/cmdline) tmp="${tmp##*ubootpart=}" tmp="${tmp%% *}" - [[ -n $tmp ]] && local part=$(findfs PARTUUID=$tmp 2> /dev/null) - [[ -n $part ]] && local dev=$(lsblk -n -o PKNAME $part 2> /dev/null) + [[ -n $tmp ]] && part=$(findfs PARTUUID=$tmp 2> /dev/null) + [[ -n $part ]] && dev=$(lsblk -n -o PKNAME $part 2> /dev/null) [[ -n $dev ]] && DEVICE="/dev/$dev" elif [[ -f /var/lib/armbian/force_search_uboot ]]; then # This may cause overwriting u-boot for android or other non-Armbian OS installed on eMMC diff --git a/config/sources/families/odroidxu4.conf b/config/sources/families/odroidxu4.conf index b647bdcf9d91..4015383892a6 100644 --- a/config/sources/families/odroidxu4.conf +++ b/config/sources/families/odroidxu4.conf @@ -52,17 +52,16 @@ function custom_kernel_config__hack_odroidxu4_firmware() { } setup_write_uboot_platform() { - # this will update u-boot on the device rootfs is located on # in case it's a mmc device, otherwise DEVICE will not be changed # and will default to /dev/mmcblk0 - local tmp=$(cat /proc/cmdline) + local tmp part dev + tmp=$(cat /proc/cmdline) tmp="${tmp##*root=}" tmp="${tmp%% *}" - [[ -n $tmp ]] && local part=$(findfs $tmp 2> /dev/null) - [[ -n $part ]] && local dev=$(lsblk -n -o PKNAME $part 2> /dev/null) + [[ -n $tmp ]] && part=$(findfs $tmp 2> /dev/null) + [[ -n $part ]] && dev=$(lsblk -n -o PKNAME $part 2> /dev/null) [[ -n $dev && $dev == mmcblk* ]] && DEVICE="/dev/${dev}" - } write_uboot_platform() { diff --git a/extensions/image-output-abl.sh b/extensions/image-output-abl.sh index 391d4ddca353..a16478d94933 100644 --- a/extensions/image-output-abl.sh +++ b/extensions/image-output-abl.sh @@ -21,7 +21,7 @@ function post_build_image__900_convert_to_abl_img() { old_rootfs_image_mount_dir=${DESTIMG}/rootfs-old new_rootfs_image_mount_dir=${DESTIMG}/rootfs-new mkdir -p ${old_rootfs_image_mount_dir} ${new_rootfs_image_mount_dir} - truncate --size=9216M ${ROOTFS_IMAGE_FILE} + truncate --size=9728M ${ROOTFS_IMAGE_FILE} mkfs.ext4 -F ${ROOTFS_IMAGE_FILE} new_rootfs_image_uuid=$(blkid -s UUID -o value ${ROOTFS_IMAGE_FILE}) old_image_loop_device=$(losetup -f -P --show ${DESTIMG}/${version}.img) diff --git a/lib/functions/compilation/uboot.sh b/lib/functions/compilation/uboot.sh index ae9912d70765..305160e46026 100644 --- a/lib/functions/compilation/uboot.sh +++ b/lib/functions/compilation/uboot.sh @@ -414,13 +414,23 @@ function compile_uboot() { unset uboot_postinst_base postinst_functions destination # declare -f on non-defined function does not do anything (but exits with errors, so ignore them with "|| true") - cat <<- EOF > "$uboottempdir/usr/lib/u-boot/platform_install.sh" + cat <<- EOF > "${uboottempdir}/usr/lib/u-boot/platform_install.sh" + # Armbian u-boot install script for linux-u-boot-${BOARD}-${BRANCH} ${artifact_version} + # This file provides functions for deploying u-boot to a block device. DIR=/usr/lib/$uboot_name $(declare -f write_uboot_platform || true) $(declare -f write_uboot_platform_mtd || true) $(declare -f setup_write_uboot_platform || true) EOF + if [[ "${SHOW_DEBUG}" == "yes" ]]; then + display_alert "Showing contents of" "usr/lib/u-boot/platform_install.sh" "info" + run_tool_batcat --file-name "usr/lib/u-boot/platform_install.sh" "${uboottempdir}/usr/lib/u-boot/platform_install.sh" + fi + + display_alert "Running shellcheck" "usr/lib/u-boot/platform_install.sh" "info" + shellcheck_debian_control_scripts "${uboottempdir}/usr/lib/u-boot/platform_install.sh" + display_alert "Das U-Boot .deb package version" "${artifact_version}" "info" # set up control file diff --git a/patch/kernel/archive/rockchip64-6.12/dt/rk3566-bigtreetech-cb2.dts b/patch/kernel/archive/rockchip64-6.12/dt/rk3566-bigtreetech-cb2.dts new file mode 100644 index 000000000000..ea50d423a3ba --- /dev/null +++ b/patch/kernel/archive/rockchip64-6.12/dt/rk3566-bigtreetech-cb2.dts @@ -0,0 +1,1041 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2020 Rockchip Electronics Co., Ltd. + * + */ +/dts-v1/; + +#include +#include +#include +#include +#include "rk3566.dtsi" + +/ { + model = "Rockchip RK3566 OPi 3B"; + compatible = "rockchip,rk3566-orangepi-3b", "rockchip,rk3566"; + + aliases { + ethernet0 = &gmac1; + mmc0 = &sdhci; + mmc1 = &sdmmc0; + }; + + chosen: chosen { + stdout-path = "serial2:1500000n8"; + }; + + fan: pwm-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + pwms = <&pwm7 0 50000 0>; + cooling-levels = <0 50 100 150 200 255>; + rockchip,temp-trips = < + 50000 1 + 55000 2 + 60000 3 + 65000 4 + 70000 5 + >; + }; + + hdmi-con { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + leds: leds { + compatible = "gpio-leds"; + + led@0 { + gpios = <&gpio4 RK_PA1 GPIO_ACTIVE_HIGH>; + label = "power_led"; + linux,default-trigger = "default-on"; + pinctrl-names = "default"; + pinctrl-0 =<&blue_led>; + }; + + led@1 { + gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; + label = "status_led"; + linux,default-trigger = "heartbeat"; + pinctrl-names = "default"; + pinctrl-0 =<&leds_gpio>; + }; + }; + + rk809-sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + simple-audio-card,name = "Analog RK809"; + simple-audio-card,mclk-fs = <256>; + + simple-audio-card,cpu { + sound-dai = <&i2s1_8ch>; + }; + + simple-audio-card,codec { + sound-dai = <&rk809>; + }; + }; + + sdio_pwrseq: sdio-pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rk809 1>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&wifi_enable_h>; + + /* + * On the module itself this is one of these (depending + * on the actual card populated): + * - SDIO_RESET_L_WL_REG_ON + * - PDN (power down when low) + */ + post-power-on-delay-ms = <200>; + reset-gpios = <&gpio0 RK_PD3 GPIO_ACTIVE_LOW>; + }; + + /* labeled +12v in schematic */ + vcc12v_dcin: vcc12v-dcin-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc12v_dcin"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + }; + + /* labeled +5v in schematic */ + vcc_5v: vcc-5v-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc_5v"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc12v_dcin>; + }; + + vbus: vbus { + compatible = "regulator-fixed"; + regulator-name = "vbus"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + + /* labeled +3.3v For PCIe only in schematic */ + vcc3v3_pcie: vcc3v3-pcie-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_pcie"; + regulator-always-on; + regulator-boot-on; + enable-active-high; + gpio = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie_drv>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc12v_dcin>; + }; + + vcc3v3_sys: vcc3v3-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vbus>; + }; + + vcc5v0_sys: vcc5v0-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vbus>; + }; + + vcc5v0_usb: vcc5v0-usb { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_usb"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vbus>; + }; + + vcc_sd: vcc-sd { + compatible = "regulator-fixed"; + regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <3300000>; + regulator-name = "vcc_sd"; + vin-supply = <&vcc3v3_sys>; + }; + + vcc5v0_host: vcc5v0-host-regulator { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_host_en>; + regulator-name = "vcc5v0_host3"; + regulator-always-on; + }; + + vcc5v0_otg: vcc5v0-otg-regulator { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_otg_en>; + regulator-name = "vcc5v0_otg3"; + regulator-always-on; + }; + + vcc5v0_usb2t: vcc5v0-usb2t-regulator { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_usb2t_en>; + regulator-name = "vcc5v0_usb2t"; + regulator-always-on; + }; + + vcc5v0_usb2b: vcc5v0-usb2b-regulator { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_usb2b_en>; + regulator-name = "vcc5v0_usb2b"; + regulator-always-on; + }; + + ext_cam_clk: ext-cam-clk { + status = "okay"; + compatible = "fixed-clock"; + clock-frequency = <25000000>; + clock-output-names = "ext_cam_clk"; + #clock-cells = <0>; + }; + + can_mcp2515_osc: can-mcp2515-osc { + compatible = "fixed-clock"; + clock-frequency = <8000000>; + #clock-cells = <0>; + }; +}; + +&combphy1 { + status = "okay"; +}; + +&combphy2 { + status = "okay"; +}; + +&cpu0 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu1 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu2 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu3 { + cpu-supply = <&vdd_cpu>; +}; + +&gmac1 { + assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>; + assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>; + assigned-clock-rates = <0>, <125000000>; + clock_in_out = "input"; + phy-mode = "rgmii"; + pinctrl-names = "default"; + pinctrl-0 = <&gmac1m0_miim + &gmac1m0_tx_bus2 + &gmac1m0_rx_bus2 + &gmac1m0_rgmii_clk + &gmac1m0_clkinout + &gmac1m0_rgmii_bus>; + + snps,reset-gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_LOW>; + snps,reset-active-low; + /* Reset time is 20ms, 100ms for rtl8211f */ + //snps,reset-delays-us = <0 20000 100000>; + snps,reset-delays-us = <0 50000 200000>; + tx_delay = <0x30>; + rx_delay = <0x10>; + phy-handle = <&rgmii_phy0>; + status = "okay"; +}; + +&gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; +}; + +&hdmi { + avdd-0v9-supply = <&vdda0v9_image>; + avdd-1v8-supply = <&vcca1v8_image>; + status = "okay"; +}; + +&hdmi_in { + hdmi_in_vp0: endpoint { + remote-endpoint = <&vp0_out_hdmi>; + }; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&hdmi_sound { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + + vdd_cpu: tsc4525@1c { + compatible = "tcs,tcs452x"; + reg = <0x1c>; + vin-supply = <&vcc5v0_sys>; + regulator-compatible = "fan53555-reg"; + regulator-name = "vdd_cpu"; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1390000>; + regulator-init-microvolt = <900000>; + regulator-initial-mode = <1>; + regulator-ramp-delay = <2300>; + fcs,suspend-voltage-selector = <1>; + regulator-boot-on; + regulator-always-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + rk809: pmic@20 { + compatible = "rockchip,rk809"; + reg = <0x20>; + interrupt-parent = <&gpio0>; + interrupts = <3 IRQ_TYPE_LEVEL_LOW>; + + assigned-clocks = <&cru I2S1_MCLKOUT_TX>; + assigned-clock-parents = <&cru CLK_I2S1_8CH_TX>; + #clock-cells = <1>; + clock-names = "mclk"; + clocks = <&cru I2S1_MCLKOUT_TX>; + pinctrl-names = "default", "pmic-sleep", + "pmic-power-off", "pmic-reset"; + pinctrl-0 = <&pmic_int>, <&i2s1m0_mclk>; + pinctrl-1 = <&soc_slppin_slp>, <&rk817_slppin_slp>; + pinctrl-2 = <&soc_slppin_gpio>, <&rk817_slppin_pwrdn>; + pinctrl-3 = <&soc_slppin_gpio>, <&rk817_slppin_rst>; + #sound-dai-cells = <0>; + + rockchip,system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc3v3_sys>; + vcc2-supply = <&vcc3v3_sys>; + vcc3-supply = <&vcc3v3_sys>; + vcc4-supply = <&vcc3v3_sys>; + vcc5-supply = <&vcc3v3_sys>; + vcc6-supply = <&vcc3v3_sys>; + vcc7-supply = <&vcc3v3_sys>; + vcc8-supply = <&vcc3v3_sys>; + vcc9-supply = <&vcc3v3_sys>; + + pinctrl_rk8xx: pinctrl_rk8xx { + gpio-controller; + #gpio-cells = <2>; + + rk817_slppin_null: rk817_slppin_null { + pins = "gpio_slp"; + function = "pin_fun0"; + }; + + rk817_slppin_slp: rk817_slppin_slp { + pins = "gpio_slp"; + function = "pin_fun1"; + }; + + rk817_slppin_pwrdn: rk817_slppin_pwrdn { + pins = "gpio_slp"; + function = "pin_fun2"; + }; + + rk817_slppin_rst: rk817_slppin_rst { + pins = "gpio_slp"; + function = "pin_fun3"; + }; + }; + + regulators { + vdd_logic: DCDC_REG1 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1350000>; + regulator-init-microvolt = <900000>; + regulator-ramp-delay = <6001>; + regulator-initial-mode = <0x2>; + regulator-name = "vdd_logic"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_gpu: DCDC_REG2 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1350000>; + regulator-init-microvolt = <900000>; + regulator-ramp-delay = <6001>; + regulator-initial-mode = <0x2>; + regulator-name = "vdd_gpu"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-name = "vcc_ddr"; + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vdd_npu: DCDC_REG4 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1350000>; + regulator-init-microvolt = <900000>; + regulator-ramp-delay = <6001>; + regulator-initial-mode = <0x2>; + regulator-name = "vdd_npu"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdda0v9_image: LDO_REG1 { + regulator-boot-on; + regulator-always-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + regulator-name = "vdda0v9_image"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdda_0v9: LDO_REG2 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + regulator-name = "vdda_0v9"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdda0v9_pmu: LDO_REG3 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + regulator-name = "vdda0v9_pmu"; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <900000>; + }; + }; + + vccio_acodec: LDO_REG4 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vccio_acodec"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vccio_sd: LDO_REG5 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vccio_sd"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_pmu: LDO_REG6 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc3v3_pmu"; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcca_1v8: LDO_REG7 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcca_1v8"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcca1v8_pmu: LDO_REG8 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcca1v8_pmu"; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcca1v8_image: LDO_REG9 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcca1v8_image"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_1v8: DCDC_REG5 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc_1v8"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_3v3: SWITCH_REG1 { + regulator-always-on; + regulator-boot-on; + regulator-name = "vcc_3v3"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_sd: SWITCH_REG2 { + regulator-always-on; + regulator-boot-on; + regulator-name = "vcc3v3_sd"; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + }; + + codec { + mic-in-differential; + }; + }; +}; + +&i2c2 { + pinctrl-0 = <&i2c2m1_xfer>; +}; + +/* + * i2c3_m0 is exposed on the 40-pin (green connectors) + * pin 27 - i2c3_sda_m0 + * pin 28 - i2c3_scl_m0 + */ +&i2c3 { + status = "okay"; + + tft_tp: ns2009@48 { + compatible = "ti,tsc2007"; + reg = <0x48>; + status = "okay"; + ti,x-plate-ohms = <660>; + ti,rt-thr = <3000>; + ti,fuzzx = <32>; + ti,fuzzy = <16>; + i2c,ignore-nak = <1>; + }; +}; + +&i2s0_8ch { + status = "okay"; +}; + +&i2s1_8ch { + pinctrl-names = "default"; + pinctrl-0 = <&i2s1m0_sclktx + &i2s1m0_lrcktx + &i2s1m0_sdi0 + &i2s1m0_sdo0>; + rockchip,trcm-sync-tx-only; + status = "okay"; +}; + +&spi1 { + pinctrl-0 = <&spi1m1_cs0 &spi1m1_pins>; + + can_mcp2515: can-mcp2515@0 { + status = "disabled"; + compatible = "microchip,mcp2515"; + reg = <0x00>; + interrupt-parent = <&gpio4>; + interrupts = <3 IRQ_TYPE_LEVEL_LOW>; + spi-max-frequency = <10000000>; + clocks = <&can_mcp2515_osc>; + vdd-supply = <&vcc3v3_sys>; + xceiver-supply = <&vcc3v3_sys>; + pinctrl-names = "default"; + pinctrl-0 = <&mcp2515_int_pin>; + }; + + /* + tft_35: st7789v@1 { + status = "disabled"; + compatible = "sitronix,st7796s"; + reg = <0x01>; + spi-max-frequency = <12500000>; + fps = <60>; + buswidth = <8>; + rotate = <0>; + width = <480>; + height = <320>; + bpp = <24>; + bgr; + regwidth = <8>; + debug = <0>; + txbuflen = <0x2000>; + spi-cpol; + spi-cpha; + dc-gpios = <&gpio0 RK_C7 GPIO_ACTIVE_HIGH>; + }; + */ +}; + +&spi3 { + pinctrl-0 = <&spi3m1_cs0 &spi3m1_pins>; +}; + +&mdio1 { + rgmii_phy0: phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x0>; + }; +}; + +&pcie2x1 { + reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie_reset_h>; + vpcie3v3-supply = <&vcc3v3_pcie>; + status = "okay"; +}; + +&pinctrl { + wireless-bluetooth { + uart1_gpios: uart1-gpios { + rockchip,pins = <2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + sd { + sdmmc0_pwr_h: sdmmc0-pwr-h { + rockchip,pins = + <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + mxc6655xa { + mxc6655xa_irq_gpio: mxc6655xa_irq_gpio { + rockchip,pins = <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + pmic { + pmic_int: pmic_int { + rockchip,pins = + <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; + }; + + soc_slppin_gpio: soc_slppin_gpio { + rockchip,pins = + <0 RK_PA2 RK_FUNC_GPIO &pcfg_output_low>; + }; + + soc_slppin_slp: soc_slppin_slp { + rockchip,pins = + <0 RK_PA2 1 &pcfg_pull_none>; + }; + + soc_slppin_rst: soc_slppin_rst { + rockchip,pins = + <0 RK_PA2 2 &pcfg_pull_none>; + }; + }; + + touch { + touch_gpio: touch-gpio { + rockchip,pins = + <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>, + <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + sdio-pwrseq { + wifi_enable_h: wifi-enable-h { + rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + wifi_host_wake: wifi-host-wake-l { + rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; + + usb { + vcc5v0_host_en: vcc5v0-host-en { + rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + vcc5v0_otg_en: vcc5v0-otg-en { + rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + vcc5v0_usb2t_en: vcc5v0_usb2t-en { + rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + vcc5v0_usb2b_en: vcc5v0-usb2b-en { + rockchip,pins = <4 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + work-led { + leds_gpio: leds-gpio { + rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + blue_led: led-blue { + rockchip,pins = <4 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + headphone { + hp_det: hp-det { + rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; + + pcie { + pcie_drv: pcie-drv { + rockchip,pins = <4 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + pcie_reset_h: pcie-reset-h { + rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + edp { + edp_hpd: edp-hpd { + rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + bl_en: bl-en { + rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_output_high>; + }; + }; + + bt { + bt_enable: bt-enable-h { + rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + bt_host_wake: bt-host-wake-l { + rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + bt_wake: bt-wake-l { + rockchip,pins = <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + mcp2515_int_pin { + mcp2515_int_pin: mcp2515_in_pin { + rockchip,pins = <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; +}; + + /* + * There are 10 independent IO domains in RK3566/RK3568, including PMUIO[0:2] and VCCIO[1:7]. + * 1/ PMUIO0 and PMUIO1 are fixed-level power domains which cannot be configured; + * 2/ PMUIO2 and VCCIO1,VCCIO[3:7] domains require that their hardware power supply voltages + * must be consistent with the software configuration correspondingly + * a/ When the hardware IO level is connected to 1.8V, the software voltage configuration + * should also be configured to 1.8V accordingly; + * b/ When the hardware IO level is connected to 3.3V, the software voltage configuration + * should also be configured to 3.3V accordingly; + * 3/ VCCIO2 voltage control selection (0xFDC20140) + * BIT[0]: 0x0: from GPIO_0A7 (default) + * BIT[0]: 0x1: from GRF + * Default is determined by Pin FLASH_VOL_SEL/GPIO0_A7: + * L:VCCIO2 must supply 3.3V + * H:VCCIO2 must supply 1.8V + */ + +&pmu_io_domains { + status = "okay"; + pmuio1-supply = <&vcc3v3_pmu>; + pmuio2-supply = <&vcc3v3_pmu>; + vccio1-supply = <&vcc_3v3>; + vccio2-supply = <&vcc_1v8>; + vccio3-supply = <&vccio_sd>; + vccio4-supply = <&vcc_1v8>; + vccio5-supply = <&vcc_3v3>; + vccio6-supply = <&vcc_3v3>; + vccio7-supply = <&vcc_3v3>; +}; + +&pwm0 { + pinctrl-0 = <&pwm0m1_pins>; +}; + +&pwm7 { + status = "disabled"; +}; + +&pwm12 { + pinctrl-0 = <&pwm12m1_pins>; +}; + +&pwm13 { + pinctrl-0 = <&pwm13m1_pins>; +}; + +&pwm14 { + pinctrl-0 = <&pwm14m1_pins>; +}; + +&pwm15 { + pinctrl-0 = <&pwm15m1_pins>; +}; + +&saradc { + status = "okay"; + vref-supply = <&vcca_1v8>; +}; + +&sdhci { + bus-width = <8>; + max-frequency = <200000000>; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd>; + status = "okay"; +}; + +&sdmmc0 { + max-frequency = <150000000>; + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; + disable-wp; + sd-uhs-sdr104; + vmmc-supply = <&vcc_sd>; + vqmmc-supply = <&vccio_sd>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; + status = "okay"; +}; + +&sdmmc1 { + max-frequency = <150000000>; + bus-width = <4>; + disable-wp; + cap-sd-highspeed; + cap-sdio-irq; + keep-power-in-suspend; + mmc-pwrseq = <&sdio_pwrseq>; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>; + sd-uhs-sdr104; + status = "okay"; + rockchip,default-sample-phase = <90>; + + sdio-wifi@1 { + compatible = "brcm,bcm4329-fmac"; + reg = <0x1>; + interrupt-parent = <&gpio2>; + interrupts = <9 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "host-wake"; + pinctrl-names = "default"; + pinctrl-0 = <&wifi_host_wake>; + brcm,drive-strength = <10>; + }; +}; + +&sfc { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; +}; + +&tsadc { + status = "okay"; +}; + +&uart1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>; + uart-has-rtscts; + dma-names = "tx\0rx"; + + bluetooth { + compatible = "brcm,bcm4345c5"; + clocks = <&rk809 1>; + clock-names = "lpo"; + device-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>; + host-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>; + shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; + //pinctrl-names = "default"; + //pinctrl-0 = <&bt_host_wake &bt_wake &bt_enable>; + vbat-supply = <&vcc3v3_sys>; + vddio-supply = <&vcca1v8_pmu>; + }; +}; + +/* (debug) uart2 has connectors near the usb-c power, but also on the 40-pin pins 6 (tx) and 8 (rx) - don't wire both */ +&uart2 { + status = "okay"; +}; + +&uart5 { + pinctrl-0 = <&uart5m1_xfer>; +}; + +&uart7 { + pinctrl-0 = <&uart7m2_xfer>; +}; + +&usb2phy0 { + status = "okay"; +}; + +&usb2phy0_host { + phy-supply = <&vcc5v0_host &vcc5v0_otg>; + status = "okay"; +}; + +&usb2phy0_otg { + status = "okay"; +}; + +&usb2phy1 { + status = "okay"; +}; + +&usb2phy1_host { + status = "okay"; + phy-supply = <&vcc5v0_usb2t &vcc5v0_usb2b>; +}; + +&usb2phy1_otg { + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&usb_host0_xhci { + dr_mode = "host"; + extcon = <&usb2phy0>; + status = "okay"; +}; + +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + +&usb_host1_xhci { + status = "okay"; +}; + +&vop { + assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; + assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; + status = "okay"; +}; + +&vop_mmu { + status = "okay"; +}; + +&vp0 { + vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { + reg = ; + remote-endpoint = <&hdmi_in_vp0>; + }; +}; diff --git a/patch/kernel/archive/rockchip64-6.12/general-st7796-driver.patch b/patch/kernel/archive/rockchip64-6.12/general-st7796-driver.patch new file mode 100644 index 000000000000..3a593347deb9 --- /dev/null +++ b/patch/kernel/archive/rockchip64-6.12/general-st7796-driver.patch @@ -0,0 +1,196 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Maxim Medvedev +Date: Fri, 12 May 2023 22:30:14 +0000 +Subject: Custom st7796 display module + +--- + +diff --git a/drivers/staging/fbtft/Kconfig b/drivers/staging/fbtft/Kconfig +index 4d29e8c1014..265c7e3fe76 100644 +--- a/drivers/staging/fbtft/Kconfig ++++ b/drivers/staging/fbtft/Kconfig +@@ -82,6 +82,12 @@ config FB_TFT_ILI9481 + help + Generic Framebuffer support for ILI9481 + ++config FB_TFT_ST7796 ++ tristate "FB driver for the ST7796 LCD Controller" ++ depends on FB_TFT ++ help ++ Generic Framebuffer support for ST7796 ++ + config FB_TFT_ILI9486 + tristate "FB driver for the ILI9486 LCD Controller" + depends on FB_TFT +diff --git a/drivers/staging/fbtft/Makefile b/drivers/staging/fbtft/Makefile +index e9cdf0f0a7d..3c62b33e596 100644 +--- a/drivers/staging/fbtft/Makefile ++++ b/drivers/staging/fbtft/Makefile +@@ -16,6 +16,7 @@ obj-$(CONFIG_FB_TFT_ILI9325) += fb_ili9325.o + obj-$(CONFIG_FB_TFT_ILI9340) += fb_ili9340.o + obj-$(CONFIG_FB_TFT_ILI9341) += fb_ili9341.o + obj-$(CONFIG_FB_TFT_ILI9481) += fb_ili9481.o ++obj-$(CONFIG_FB_TFT_ST7796) += fb_st7796.o + obj-$(CONFIG_FB_TFT_ILI9486) += fb_ili9486.o + obj-$(CONFIG_FB_TFT_PCD8544) += fb_pcd8544.o + obj-$(CONFIG_FB_TFT_RA8875) += fb_ra8875.o +diff --git a/drivers/staging/fbtft/fb_st7796.c b/drivers/staging/fbtft/fb_st7796.c +new file mode 100755 +index 00000000000..c7deedbea69 +--- /dev/null ++++ b/drivers/staging/fbtft/fb_st7796.c +@@ -0,0 +1,154 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * FB driver for the ST7796 LCD display controller ++ * ++ * Based on ILI9486 from Christian Vogelgsang and adafruit22fb.c by Noralf Tronnes. ++ */ ++ ++#include ++#include ++#include ++#include ++#include