diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c31ca09..ecefe5cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,22 +16,23 @@ jobs: query: runs-on: ubuntu-latest outputs: - forks: ${{ steps.query.outputs.forks }} + linux: ${{ steps.query.outputs.linux }} steps: - name: Checkout uses: actions/checkout@v3 - name: Query available board configs id: query run: | - echo "::set-output name=forks::$(./lbuild --json forks)" + echo "::set-output name=linux::$(./bsp --json 'edition linux')" build: needs: query runs-on: ubuntu-latest strategy: matrix: - forks: ${{fromJSON(needs.query.outputs.forks)}} + linux: ${{fromJSON(needs.query.outputs.linux)}} steps: - name: Build - uses: radxa-repo/lbuild@main + uses: radxa-repo/bsp@main with: - fork: ${{ matrix.forks }} \ No newline at end of file + target: linux + edition: ${{ matrix.linux }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index af092fae..df0e6adc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ .src/ .root/ .vscode/ -forks/**/0500-private/ \ No newline at end of file +**/0500-private/ \ No newline at end of file diff --git a/README.md b/README.md index 0492c71e..b035239b 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,28 @@ -# lbuild - Radxa Linux Kernel Build Tool +# bsp - Radxa BSP Build Tool -[![Build](https://github.com/radxa-repo/lbuild/actions/workflows/build.yml/badge.svg)](https://github.com/radxa-repo/lbuild/actions/workflows/build.yml) +[![Build](https://github.com/radxa-repo/bsp/actions/workflows/build.yml/badge.svg)](https://github.com/radxa-repo/bsp/actions/workflows/build.yml) -`lbuild` aims to provide a standardized way to build Linux kernel for Radxa boards, so the resulting file can be easliy included in our image generation pipeline. +`bsp` aims to provide a standardized way to build Linux kernel and U-Boot for Radxa boards, so the build output can be easliy included in our image generation pipeline. ## Usage -### Local +### Local Please run the following command to check all available options: + ``` -git clone --depth 1 https://github.com/radxa-repo/lbuild.git -lbuild/lbuild +git clone --depth 1 https://github.com/radxa-repo/bsp.git +cd ./bsp +./bsp ``` -You can then build the bootloader with supported options. The resulting deb package will be stored in your current directory. +You can then build the BSP components with supported options. The resulting deb package will be stored in your current directory. ### Running in GitHub Action -Please check out our [GitHub workflows](https://github.com/radxa-repo/lbuild/tree/main/.github/workflows). +Please check out our [GitHub workflows](https://github.com/radxa-repo/bsp/tree/main/.github/workflows). ## Documentation -Please visit [Radxa Documentation](https://radxa-doc.github.io/). \ No newline at end of file + +Please visit [Radxa Documentation](https://radxa-doc.github.io/). + diff --git a/action.yaml b/action.yaml index 6d543d45..58628df9 100644 --- a/action.yaml +++ b/action.yaml @@ -1,7 +1,9 @@ -name: lbuild -description: Radxa Linux Kernel Build Tool +name: bsp +description: Radxa BSP Build Tool inputs: - fork: + target: + required: true + edition: required: true revision: retuired: false @@ -16,7 +18,7 @@ runs: - name: Checkout uses: actions/checkout@v3 with: - repository: radxa-repo/lbuild + repository: radxa-repo/bsp - name: Install dependency shell: bash run: | @@ -27,7 +29,7 @@ runs: run: | mkdir .output pushd .output - ../lbuild -r ${{ inputs.revision }} ${{ inputs.fork }} + ../bsp -r ${{ inputs.revision }} ${{ inputs.target }} ${{ inputs.edition }} popd - name: Upload if: inputs.release-id != '' && inputs.github-token != '' diff --git a/bsp b/bsp new file mode 100755 index 00000000..3942eaa3 --- /dev/null +++ b/bsp @@ -0,0 +1,157 @@ +#!/bin/bash + +SCRIPT_DIR="$(dirname "$(realpath "$0")")" +source "$SCRIPT_DIR/lib/utils.sh" + +usage() { + cat >&2 << EOF +Radxa BSP Build Tool +usage: $(basename "$0") [options] [product] + +When building u-boot, you can also provide 'product' argument, +which will only build for that specific image. + +Supported package generation options: + -r, --revision [num] + Specify custom revision number, default=1 + --no-prepare-source Allow building against locally modified repos + +Alternative functionalities + --json [catagory] Print supported options in json format + Available catagories: $(get_supported_infos) + -h, --help Show this help message + +Supported Linux edition: +$(printf_array " %s\n" "$(get_supported_edition linux)") + +Supported U-Boot edition: +$(printf_array " %s\n" "$(get_supported_edition u-boot)") +EOF +} + +get_supported_edition() { + if [[ ! -d "$SCRIPT_DIR/$1" ]] || [[ -z "$1" ]] + then + error $EXIT_UNSUPPORTED_OPTION "$1" + fi + + local editions=() + for f in $(ls $SCRIPT_DIR/$1) + do + editions+="$f " + done + echo "${editions[@]}" +} + +get_supported_infos() { + local infos=("edition linux" "edition u-boot") + echo "${infos[@]}" +} + +json() { + local array=( "$(get_supported_infos)" ) + if ! in_array "$@" "${array[@]}" + then + error $EXIT_UNKNOWN_OPTION "$1" + fi + + local output + output=( $(get_supported_$@) ) + if (( $? != 0 )) + then + return 1 + fi + printf_array "json" "${output[@]}" +} + +build() { + prepare_source "$TARGET" + + bsp_prepare + + bsp_make $BSP_DEFCONFIG 2>&1 | tee -a "$SCRIPT_DIR/.src/build.log" + + for d in $(find -L "$SCRIPT_DIR/$TARGET/$FORK" -mindepth 1 -type d | sort) + do + apply_kconfig "$d/kconfig.conf" + done + apply_kconfig "$SCRIPT_DIR/$TARGET/$FORK/kconfig.conf" + + bsp_make olddefconfig $BSP_MAKE_TARGETS 2>&1 | tee -a "$SCRIPT_DIR/.src/build.log" +} + +main() { + local PKG_REVISION="1" + local NO_PREPARE_SOURCE= + + if [[ -e "$SCRIPT_DIR/.src/build.log" ]] + then + rm "$SCRIPT_DIR/.src/build.log" + fi + + while (( $# > 0 )) + do + case "$1" in + -r | --revision) + PKG_REVISION="$2" + shift 2 + ;; + --no-prepare-source) + NO_PREPARE_SOURCE="yes" + shift + ;; + --json) + shift + json "$@" + return + ;; + -h | --help) + usage + return + ;; + -*) + error $EXIT_UNKNOWN_OPTION "$1" + ;; + linux) + load_edition "$1" "$2" + build + bsp_makedeb + return + ;; + u-boot) + load_edition "$1" "$2" + + if [[ -n "$3" ]] + then + if ! in_array "$3" "${SUPPORTED_BOARDS[@]}" + then + error $EXIT_UNKNOWN_OPTION "$1" + fi + local products=("$3") + else + local products=("${SUPPORTED_BOARDS[@]}") + fi + + rm -rf "$SCRIPT_DIR/.root" + + for BOARD in "${products[@]}" + do + load_edition "$1" "$2" + bsp_$BOARD + build + bsp_preparedeb + NO_PREPARE_SOURCE="yes" + done + + SUPPORTED_BOARDS=("${products[@]}") + bsp_makedeb + return + ;; + *) break ;; + esac + done + usage + return 1 +} + +main "$@" \ No newline at end of file diff --git a/common/config b/common/config new file mode 100755 index 00000000..ff88e2fa --- /dev/null +++ b/common/config @@ -0,0 +1,230 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: GPL-2.0 +# Manipulate options in a .config file from the command line + +myname=${0##*/} + +# If no prefix forced, use the default CONFIG_ +CONFIG_="${CONFIG_-CONFIG_}" + +# We use an uncommon delimiter for sed substitutions +SED_DELIM=$(echo -en "\001") + +usage() { + cat >&2 <"$tmpfile" + # replace original file with the edited one + mv "$tmpfile" "$infile" +} + +txt_subst() { + local before="$1" + local after="$2" + local infile="$3" + local tmpfile="$infile.swp" + + sed -e "s$SED_DELIM$before$SED_DELIM$after$SED_DELIM" "$infile" >"$tmpfile" + # replace original file with the edited one + mv "$tmpfile" "$infile" +} + +txt_delete() { + local text="$1" + local infile="$2" + local tmpfile="$infile.swp" + + sed -e "/$text/d" "$infile" >"$tmpfile" + # replace original file with the edited one + mv "$tmpfile" "$infile" +} + +set_var() { + local name=$1 new=$2 before=$3 + + name_re="^($name=|# $name is not set)" + before_re="^($before=|# $before is not set)" + if test -n "$before" && grep -Eq "$before_re" "$FN"; then + txt_append "^$before=" "$new" "$FN" + txt_append "^# $before is not set" "$new" "$FN" + elif grep -Eq "$name_re" "$FN"; then + txt_subst "^$name=.*" "$new" "$FN" + txt_subst "^# $name is not set" "$new" "$FN" + else + echo "$new" >>"$FN" + fi +} + +undef_var() { + local name=$1 + + txt_delete "^$name=" "$FN" + txt_delete "^# $name is not set" "$FN" +} + +if [ "$1" = "--file" ]; then + FN="$2" + if [ "$FN" = "" ] ; then + usage + fi + shift 2 +else + FN=.config +fi + +if [ "$1" = "" ] ; then + usage +fi + +MUNGE_CASE=yes +while [ "$1" != "" ] ; do + CMD="$1" + shift + case "$CMD" in + --keep-case|-k) + MUNGE_CASE=no + continue + ;; + --refresh) + ;; + --*-after|-E|-D|-M) + checkarg "$1" + A=$ARG + checkarg "$2" + B=$ARG + shift 2 + ;; + -*) + checkarg "$1" + shift + ;; + esac + case "$CMD" in + --enable|-e) + set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=y" + ;; + + --disable|-d) + set_var "${CONFIG_}$ARG" "# ${CONFIG_}$ARG is not set" + ;; + + --module|-m) + set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=m" + ;; + + --set-str) + # sed swallows one level of escaping, so we need double-escaping + set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=\"${1//\"/\\\\\"}\"" + shift + ;; + + --set-val) + set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=$1" + shift + ;; + --undefine|-u) + undef_var "${CONFIG_}$ARG" + ;; + + --state|-s) + if grep -q "# ${CONFIG_}$ARG is not set" $FN ; then + echo n + else + V="$(grep "^${CONFIG_}$ARG=" $FN)" + if [ $? != 0 ] ; then + echo undef + else + V="${V/#${CONFIG_}$ARG=/}" + V="${V/#\"/}" + V="${V/%\"/}" + V="${V//\\\"/\"}" + echo "${V}" + fi + fi + ;; + + --enable-after|-E) + set_var "${CONFIG_}$B" "${CONFIG_}$B=y" "${CONFIG_}$A" + ;; + + --disable-after|-D) + set_var "${CONFIG_}$B" "# ${CONFIG_}$B is not set" "${CONFIG_}$A" + ;; + + --module-after|-M) + set_var "${CONFIG_}$B" "${CONFIG_}$B=m" "${CONFIG_}$A" + ;; + + # undocumented because it ignores --file (fixme) + --refresh) + yes "" | make oldconfig + ;; + + *) + echo "bad command: $CMD" >&2 + usage + ;; + esac +done diff --git a/common/u-boot_setup.sh b/common/u-boot_setup.sh new file mode 100755 index 00000000..176b7a81 --- /dev/null +++ b/common/u-boot_setup.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +update_bootloader() { + local DEVICE=$1 + local SOC=${2:-$(dtsoc)} + + case "$SOC" in + amlogic*) + dd conv=notrunc if="$SCRIPT_DIR/u-boot.bin.sd.bin" of=$DEVICE bs=1 count=444 + dd conv=notrunc if="$SCRIPT_DIR/u-boot.bin.sd.bin" of=$DEVICE bs=512 skip=1 seek=1 + ;; + rockchip*) + dd conv=notrunc if="$SCRIPT_DIR/idbloader.img" of=$DEVICE bs=512 seek=64 + dd conv=notrunc if="$SCRIPT_DIR/u-boot.itb" of=$DEVICE bs=512 seek=16384 + ;; + *) + echo Unknown SOC. >&2 + return 1 + ;; + esac +} + +update_spi() { + if [[ ! -e /dev/mtdblock0 ]] + then + echo "/dev/mtdblock0 is missing." >&2 + return 1 + fi + + local SOC=${1:-$(dtsoc)} + + case "$SOC" in + rockchip*) + cp "$SCRIPT_DIR/idbloader-spi.img" /tmp/spi.img + dd conv=notrunc if="$SCRIPT_DIR/u-boot.itb" of=/tmp/spi.img bs=512 seek=768 + dd conv=notrunc if=/tmp/spi.img of=/dev/mtdblock0 bs=4096 + rm /tmp/spi.img + ;; + *) + echo Unknown SOC. >&2 + return 1 + ;; + esac + +} + +set -e + +SCRIPT_DIR="$(dirname "$(realpath "$0")")" + +ACTION="$1" +shift + +if [[ $(type -t $ACTION) == function ]] +then + $ACTION "$@" +else + echo "Unsupported action: '$ACTION'" >&2 + return 1 +fi \ No newline at end of file diff --git a/forks/latest/fork.conf b/forks/latest/fork.conf deleted file mode 100644 index 9cf8d0a3..00000000 --- a/forks/latest/fork.conf +++ /dev/null @@ -1,3 +0,0 @@ -LINUX_GIT="https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux.git" -LINUX_TAG="v5.19-rc7" -SUPPORTED_BOARDS=("latest") \ No newline at end of file diff --git a/forks/rockchip-4.19/fork.conf b/forks/rockchip-4.19/fork.conf deleted file mode 100644 index 075f6e3f..00000000 --- a/forks/rockchip-4.19/fork.conf +++ /dev/null @@ -1,4 +0,0 @@ -LINUX_GIT="https://github.com/radxa/kernel.git" -LINUX_BRANCH="stable-4.19-rock3" -LINUX_DEFCONFIG="rockchip_linux_defconfig" -SUPPORTED_BOARDS=("rockchip-4.19" "radxa-cm3-io" "radxa-cm3-rpi-cm4-io" "radxa-e23" "radxa-e25" "radxa-3a" "radxa-3b") \ No newline at end of file diff --git a/forks/rockchip-4.4/fork.conf b/forks/rockchip-4.4/fork.conf deleted file mode 100644 index 7de5835e..00000000 --- a/forks/rockchip-4.4/fork.conf +++ /dev/null @@ -1,4 +0,0 @@ -LINUX_GIT="https://github.com/radxa/kernel.git" -LINUX_BRANCH="release-4.4-rockpi4" -LINUX_DEFCONFIG="rockchip_linux_defconfig" -SUPPORTED_BOARDS=("rockchip-4.4" "rockpi-4b" "rockpi-4c") \ No newline at end of file diff --git a/forks/rockchip-5.10/fork.conf b/forks/rockchip-5.10/fork.conf deleted file mode 100644 index d861a374..00000000 --- a/forks/rockchip-5.10/fork.conf +++ /dev/null @@ -1,4 +0,0 @@ -LINUX_GIT="https://github.com/radxa-repo/kernel.git" -LINUX_COMMIT="3bc3f4a8b10ab7518a609095652cc65f0a2813e6" -LINUX_DEFCONFIG="rockchip_linux_defconfig" -SUPPORTED_BOARDS=("rockchip-5.10" "rock-5a" "rock-5b" "radxa-nx5") \ No newline at end of file diff --git a/forks/stable/fork.conf b/forks/stable/fork.conf deleted file mode 100644 index db6e4d2e..00000000 --- a/forks/stable/fork.conf +++ /dev/null @@ -1,4 +0,0 @@ -LINUX_GIT="https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux.git" -LINUX_TAG="v5.10.129" -LINUX_DEFCONFIG="radxa_zero_defconfig" -SUPPORTED_BOARDS=("stable" "radxa-zero" "radxa-zero2") \ No newline at end of file diff --git a/lbuild b/lbuild deleted file mode 100755 index 12cddcaa..00000000 --- a/lbuild +++ /dev/null @@ -1,366 +0,0 @@ -#!/bin/bash - -ARCH="arm64" -CROSS_COMPILE="aarch64-linux-gnu-" -DPKG_FLAGS="-d" -LINUX_GIT= -LINUX_TAG= -LINUX_COMMIT= -LINUX_BRANCH= -LINUX_DEFCONFIG="defconfig" -PKG_REVISION="1" - -NO_PREPARE_SOURCE= - -EXIT_SUCCESS=0 -EXIT_UNKNOWN_OPTION=1 -EXIT_TOO_FEW_ARGUMENTS=2 -EXIT_UNSUPPORTED_OPTION=3 - -error() { - case "$1" in - $EXIT_SUCCESS) - ;; - $EXIT_UNKNOWN_OPTION) - echo "Unknown option: '$2'." >&2 - ;; - $EXIT_TOO_FEW_ARGUMENTS) - echo "Too few arguments." >&2 - ;; - $EXIT_UNSUPPORTED_OPTION) - echo "Option '$2' is not supported." >&2 - ;; - *) - echo "Unknown exit code." >&2 - ;; - esac - - exit "$1" -} - -usage() { - cat >&2 << EOF -Radxa Linux Kernel Build Tool -usage: $(basename "$0") [options] - -Supported package generation options: - -r, --revision [num] - Specify custom revision number, default=1 - --no-prepare-source Allow building against locally modified repos - -Alternative functionalities - --json [catagory] Print supported options in json format - Available catagories: $(get_supported_infos) - -h, --help Show this help message - -Supported fork: -$(printf_array " %s\n" "$(get_supported_forks)") -EOF - exit "$1" -} - -printf_array() { - local FORMAT="$1" - shift - local ARRAY=("$@") - - if [[ $FORMAT == "json" ]] - then - jq --compact-output --null-input '$ARGS.positional' --args -- "${ARRAY[@]}" - else - for i in ${ARRAY[@]} - do - printf "$FORMAT" "$i" - done - fi -} - -get_supported_forks() { - local FORKS=() - for f in $(ls $SCRIPT_DIR/forks) - do - FORKS+="$f " - done - echo "${FORKS[@]}" -} - -get_supported_infos() { - local INFOS=("forks") - echo "${INFOS[@]}" -} - -in_array() { - local ITEM="$1" - shift - local ARRAY=("$@") - if [[ " ${ARRAY[*]} " =~ " $ITEM " ]] - then - true - else - false - fi -} - -json() { - local ARRAY=($(get_supported_infos)) - if ! in_array "$1" "${ARRAY[@]}" - then - error $EXIT_UNKNOWN_OPTION "$1" - fi - - printf_array "json" $(get_supported_$1) - exit 0 -} - -git_source() { - local GIT_URL="$1" - local GIT_BRANCH="$2" - local FOLDER="$(basename $GIT_URL)" - FOLDER="${FOLDER%.*}" - - if [[ -n $GIT_BRANCH ]] - then - GIT_BRANCH="--branch $GIT_BRANCH" - fi - - if ! [[ -e "$SRC_DIR/$FOLDER" ]] - then - git clone --depth 1 $GIT_BRANCH "$GIT_URL" "$SRC_DIR/$FOLDER" - fi -} - -prepare_source() { - local SRC_DIR="$SCRIPT_DIR/.src" - local LINUX_DIR="$SRC_DIR/linux" - local FORK_DIR="$SCRIPT_DIR/forks/$FORK" - - mkdir -p "$SRC_DIR" - mkdir -p "$LINUX_DIR" - - pushd "$LINUX_DIR" - - git init - [[ -z $(git config --get user.name) ]] && git config user.name "lbuild" - [[ -z $(git config --get user.email) ]] && git config user.email "lbuild@invalid.email" - git am --abort && true - [[ -n $(git status -s) ]] && git reset --hard HEAD - - local ORIGIN=$(sha1sum <(echo "$LINUX_GIT") | cut -d' ' -f1) - git remote add $ORIGIN $LINUX_GIT 2>/dev/null && true - - if [[ -n $LINUX_COMMIT ]] - then - git fetch --depth 1 $ORIGIN $LINUX_COMMIT - git checkout $LINUX_COMMIT - git update-ref refs/tags/$LINUX_COMMIT $LINUX_COMMIT - elif [[ -n $LINUX_BRANCH ]] - then - # Tag is more precise than branch and should be preferred. - # However, since we are defaulting with upstream Linux, - # we will always have non empty $LINUX_TAG. - # As such check $LINUX_BRANCH first. - git fetch --depth 1 $ORIGIN $LINUX_BRANCH - git checkout $LINUX_BRANCH - elif [[ -n $LINUX_TAG ]] - then - git fetch --depth 1 $ORIGIN tag $LINUX_TAG - git checkout tags/$LINUX_TAG - fi - - git reset --hard FETCH_HEAD - git clean -ffd - - for d in $(find -L $FORK_DIR -type d | sort -r) - do - shopt -s nullglob - for f in $d/*.sh - do - if [[ $(type -t custom_source_action) == function ]] - then - unset -f custom_source_action - fi - - source $f - - if [[ $(type -t custom_source_action) == function ]] - then - echo "Running custom_source_action from $f" - custom_source_action "$SCRIPT_DIR" "$UBOOT_DIR" - fi - done - shopt -u nullglob - done - - for d in $(find -L $FORK_DIR -type d | sort) - do - if ls $d/*.patch &>/dev/null - then - git am --reject --whitespace=fix $(ls $d/*.patch) - fi - done - - popd -} - -kconfig() { - local MODE="config" - if [[ $1 == "-v" ]] - then - MODE="verify" - shift - fi - local FILE="$1" - - while IFS="" read -r k || [ -n "$k" ] - do - local CONFIG= - local OPTION= - local SWITCH= - if grep -q "^# CONFIG_.* is not set$" <<< $k - then - CONFIG=$(cut -d ' ' -f 2 <<< $k) - SWITCH="--undefine" - elif grep -q "^CONFIG_.*=[ynm]$" <<< $k - then - CONFIG=$(echo $k | cut -d '=' -f 1) - case "$(echo $k | cut -d'=' -f 2)" in - y) - SWITCH="--enable" - ;; - n) - SWITCH="--disable" - ;; - m) - SWITCH="--module" - ;; - esac - elif grep -q "^CONFIG_.*=\".*\"$" <<< $k - then - IFS='=' read -r CONFIG OPTION <<< $k - SWITCH="--set-val" - elif grep -q "^CONFIG_.*=.*$" <<< $k - then - IFS='=' read -r CONFIG OPTION <<< $k - SWITCH="--set-val" - elif grep -q "^#" <<< $k - then - continue - elif [[ -z "$k" ]] - then - continue - else - error $EXIT_UNKNOWN_OPTION "$k" - fi - case $MODE in - config) - "$SCRIPT_DIR/.src/linux/scripts/config" --file "$SCRIPT_DIR/.src/linux/.config" $SWITCH $CONFIG "$OPTION" - ;; - verify) - if ! grep -q "$k" "$SCRIPT_DIR/.src/linux/.config" - then - echo "kconfig: Mismatch: $k" >&2 - fi - ;; - esac - done < "$FILE" -} - -build() { - if (( $# == 0 )) - then - usage 0 - fi - - while (( $# > 0 )) - do - case "$1" in - -r | --revision) - PKG_REVISION="$2" - shift 2 - ;; - --no-prepare-source) - NO_PREPARE_SOURCE="y" - shift - ;; - --json) - json "$2" - ;; - -h | --help) - usage 0 - ;; - -*) - error $EXIT_UNKNOWN_OPTION "$1" - ;; - *) break ;; - esac - done - - if ! source "$SCRIPT_DIR/forks/$1/fork.conf" 2>/dev/null - then - error $EXIT_UNKNOWN_OPTION "$1" - fi - - local FORK=$1 - - [[ $NO_PREPARE_SOURCE != "y" ]] && prepare_source - - local LINUX_VERSION=$(make -C "$SCRIPT_DIR/.src/linux" -s kernelversion) - - make -C "$SCRIPT_DIR/.src/linux" -j$(nproc) \ - ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE \ - KDEB_COMPRESS="xz" DPKG_FLAGS=$DPKG_FLAGS \ - LOCALVERSION=-$FORK KERNELRELEASE=$LINUX_VERSION-$FORK KDEB_PKGVERSION=$LINUX_VERSION-$FORK-$PKG_REVISION \ - $LINUX_DEFCONFIG 2>&1 | tee "$SCRIPT_DIR/.src/build.log" - - for d in $(find -L "$SCRIPT_DIR/forks/$FORK" -type d | sort) - do - if [[ -e "$d/kconfig.conf" ]] - then - tee -a "$SCRIPT_DIR/.src/build.log" <<< "Apply kconfig from $d/kconfig.conf" - kconfig "$d/kconfig.conf" - kconfig -v "$d/kconfig.conf" | tee -a "$SCRIPT_DIR/.src/build.log" - fi - done - - make -C "$SCRIPT_DIR/.src/linux" -j$(nproc) \ - ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE \ - KDEB_COMPRESS="xz" DPKG_FLAGS=$DPKG_FLAGS \ - LOCALVERSION=-$FORK KERNELRELEASE=$LINUX_VERSION-$FORK KDEB_PKGVERSION=$LINUX_VERSION-$FORK-$PKG_REVISION \ - olddefconfig all bindeb-pkg 2>&1 | tee -a "$SCRIPT_DIR/.src/build.log" - - mv $SCRIPT_DIR/.src/*.deb ./ - for BOARD in ${SUPPORTED_BOARDS[@]} - do - local NAMES=("linux-image-$BOARD" "linux-headers-$BOARD") - local DESCRIPTIONS=("Radxa Linux kernel image for $BOARD" "Radxa Linux header for $BOARD") - local DEPENDS=("linux-image-$LINUX_VERSION-$FORK" "linux-headers-$LINUX_VERSION-$FORK") - for i in {0..1} - do - local NAME=${NAMES[$i]} - local VERSION="$LINUX_VERSION-$FORK-$PKG_REVISION" - local URL="https://github.com/radxa-pkg/linux-image-$FORK" - local DESCRIPTION=${DESCRIPTIONS[$i]} - local DEPEND=${DEPENDS[$i]} - fpm -s empty -t deb -n "$NAME" -v "$VERSION" \ - --deb-compression xz \ - --depends "$DEPEND" \ - --url "$URL" \ - --description "$DESCRIPTION" \ - --license "GPL-2+" \ - -m "Radxa " \ - --vendor "Radxa" \ - --force - done - done -} - -set -e -set -o pipefail - -LC_ALL="C" -LANG="C" -LANGUAGE="C" - -SCRIPT_DIR="$(dirname "$(realpath "$0")")" - -build "$@" diff --git a/lib/linux.sh b/lib/linux.sh new file mode 100644 index 00000000..fb2958e7 --- /dev/null +++ b/lib/linux.sh @@ -0,0 +1,56 @@ +bsp_reset() { + BSP_ARCH="arm64" + BSP_GIT= + BSP_TAG= + BSP_COMMIT= + BSP_BRANCH= + BSP_DEFCONFIG="defconfig" + + BSP_MAKE_TARGETS="all bindeb-pkg" + BSP_DPKG_FLAGS="-d" +} + +bsp_version() { + make -C "$TARGET_DIR" -s kernelversion +} + +bsp_prepare() { + return +} + +bsp_make() { + local BSP_VERSION="$(bsp_version)" + + make -C "$TARGET_DIR" -j$(nproc) \ + ARCH=$BSP_ARCH CROSS_COMPILE=$CROSS_COMPILE \ + KDEB_COMPRESS="xz" DPKG_FLAGS=$BSP_DPKG_FLAGS \ + LOCALVERSION=-$FORK KERNELRELEASE=$BSP_VERSION-$FORK KDEB_PKGVERSION=$BSP_VERSION-$FORK-$PKG_REVISION \ + $@ +} + +bsp_makedeb() { + mv $SCRIPT_DIR/.src/*.deb ./ + for BOARD in ${SUPPORTED_BOARDS[@]} + do + local NAMES=("linux-image-$BOARD" "linux-headers-$BOARD") + local DESCRIPTIONS=("Radxa virtual Linux package for $BOARD" "Radxa virtual Linux header package for $BOARD") + local DEPENDS=("linux-image-$BSP_VERSION-$FORK" "linux-headers-$BSP_VERSION-$FORK") + for i in {0..1} + do + local NAME=${NAMES[$i]} + local VERSION="$BSP_VERSION-$FORK-$PKG_REVISION" + local URL="https://github.com/radxa-pkg/linux-image-$FORK" + local DESCRIPTION=${DESCRIPTIONS[$i]} + local DEPEND=${DEPENDS[$i]} + fpm -s empty -t deb -n "$NAME" -v "$VERSION" \ + --deb-compression xz \ + --depends "$DEPEND" \ + --url "$URL" \ + --description "$DESCRIPTION" \ + --license "GPL-2+" \ + -m "Radxa " \ + --vendor "Radxa" \ + --force + done + done +} \ No newline at end of file diff --git a/lib/u-boot.sh b/lib/u-boot.sh new file mode 100644 index 00000000..e2e0ca3a --- /dev/null +++ b/lib/u-boot.sh @@ -0,0 +1,157 @@ +bsp_reset() { + BSP_ARCH="arm" + BSP_GIT= + BSP_TAG= + BSP_COMMIT= + BSP_BRANCH= + BSP_DEFCONFIG= + + BSP_MAKE_TARGETS="all" + BSP_SOC= + BSP_SOC_OVERRIDE= +} + +bsp_version() { + make -C "$TARGET_DIR" -s ubootversion +} + +bsp_prepare() { + local SOC_FAMILY=$(get_soc_family $BSP_SOC) + + if [[ -z $BSP_DEFCONFIG ]] + then + case "$SOC_FAMILY" in + rockchip) + BSP_DEFCONFIG="${BOARD}-${BSP_SOC}_defconfig" + ;; + *) + BSP_DEFCONFIG="${BOARD}_defconfig" + ;; + esac + fi + + if [[ -z $BSP_SOC_OVERRIDE ]] + then + BSP_SOC_OVERRIDE=$BSP_SOC + fi + + case "$SOC_FAMILY" in + rockchip) + local BSP_BL31= + if [[ $USE_ATF == "yes" ]] + then + make -C "$SCRIPT_DIR/.src/arm-trusted-firmware" -j$(nproc) CROSS_COMPILE=$CROSS_COMPILE PLAT=$BSP_SOC_OVERRIDE + BSP_BL31="BL31=$SCRIPT_DIR/.src/arm-trusted-firmware/build/$BSP_SOC_OVERRIDE/release/bl31/bl31.elf" + else + local RKBIN_BL31=$(find $SCRIPT_DIR/.src/rkbin/bin | grep -e ${BSP_SOC_OVERRIDE}_bl31_v -e ${BSP_BL31_OVERRIDE}_bl31_v | sort | tail -n 1) + if [[ -z $RKBIN_BL31 ]] + then + echo "Unable to find prebuilt bl31. The resulting bootloader may not work!" >&2 + else + echo "Using bl31 $(basename $RKBIN_BL31)" + BSP_BL31="BL31=$RKBIN_BL31" + fi + fi + + BSP_MAKE_TARGETS="$BSP_BL31 $BSP_MAKE_TARGETS" + ;; + esac +} + +bsp_make() { + make -C "$TARGET_DIR" -j$(nproc) ARCH=$BSP_ARCH CROSS_COMPILE=$CROSS_COMPILE $@ +} + +bsp_make1() { + echo "make -C "$TARGET_DIR" -j$(nproc) ARCH=$BSP_ARCH CROSS_COMPILE=$CROSS_COMPILE $@" + exit 1 +} + +bsp_preparedeb() { + local SOC_FAMILY=$(get_soc_family $BSP_SOC) + + mkdir -p "$SCRIPT_DIR/.root/usr/lib/u-boot-$BOARD" + cp "$SCRIPT_DIR/common/u-boot_setup.sh" "$SCRIPT_DIR/.root/usr/lib/u-boot-$BOARD/setup.sh" + + case "$SOC_FAMILY" in + amlogic) + make -C "$SCRIPT_DIR/.src/fip" -j$(nproc) distclean + make -C "$SCRIPT_DIR/.src/fip" -j$(nproc) fip BOARD=$BOARD UBOOT_BIN="$TARGET_DIR/u-boot.bin" + + cp "$SCRIPT_DIR/.src/fip/$BOARD/u-boot.bin" "$SCRIPT_DIR/.src/fip/$BOARD/u-boot.bin.sd.bin" "$SCRIPT_DIR/.root/usr/lib/u-boot-$BOARD/" + ;; + rockchip) + local flash_data= + if [[ -n $RKBIN ]] + then + local flash_data="$(find $SCRIPT_DIR/.src/rkbin/bin | grep ${RKBIN} | sort | tail -n 1)" + if [[ -z $flash_data ]] + then + error $EXIT_UNKNOWN_OPTION "$RKBIN" + else + echo "Using rkbin $(basename $flash_data)" + fi + fi + if [[ -e "${SCRIPT_DIR}/.src/u-boot/spl/u-boot-spl.bin" ]] && [[ "$NO_UBOOT_SPL" != "yes" ]] + then + flash_data="${flash_data:+${flash_data}:}${SCRIPT_DIR}/.src/u-boot/spl/u-boot-spl.bin" + fi + + $TARGET_DIR/tools/mkimage -n $BSP_SOC_OVERRIDE -T rksd -d "${flash_data}" "$TARGET_DIR/idbloader.img" + $TARGET_DIR/tools/mkimage -n $BSP_SOC_OVERRIDE -T rkspi -d "${flash_data}" "$TARGET_DIR/idbloader-spi.img" + + if [[ -n $RKMINILOADER ]] + then + local flash_data="$(find $SCRIPT_DIR/.src/rkbin/bin | grep ${RKMINILOADER} | sort | tail -n 1)" + if [[ -z $flash_data ]] + then + error $EXIT_UNKNOWN_OPTION "$RKMINILOADER" + else + echo "Using rkminiloader $(basename $flash_data)" + cat "$flash_data" >> "$TARGET_DIR/idbloader.img" + cat "$flash_data" >> "$TARGET_DIR/idbloader-spi.img" + fi + fi + + cp "$TARGET_DIR/u-boot.itb" "$TARGET_DIR/idbloader-spi.img" "$TARGET_DIR/idbloader.img" "$SCRIPT_DIR/.root/usr/lib/u-boot-$BOARD/" + ;; + *) + error $EXIT_UNSUPPORTED_OPTION "$SOC_FAMILY" + ;; + esac +} + +bsp_makedeb() { + local NAME="u-boot-$FORK" + local VERSION="$(bsp_version)-$PKG_REVISION" + local URL="https://github.com/radxa-pkg/$NAME" + local DESCRIPTION="Radxa U-Boot image for $FORK" + fpm -s dir -t deb -n "$NAME" -v "$VERSION" \ + --deb-compression xz \ + -a arm64 \ + --depends dthelper \ + --url "$URL" \ + --description "$DESCRIPTION" \ + --license "GPL-2+" \ + -m "Radxa " \ + --vendor "Radxa" \ + --force \ + "$SCRIPT_DIR/.root/"=/ + + local VERSION="$(bsp_version)-$FORK-$PKG_REVISION" + for BOARD in ${SUPPORTED_BOARDS[@]} + do + local NAME="u-boot-$BOARD" + local DESCRIPTION="Radxa virtual U-Boot package for $BOARD" + local DEPEND=u-boot-$FORK + fpm -s empty -t deb -n "$NAME" -v "$VERSION" \ + --deb-compression xz \ + --depends "$DEPEND" \ + --url "$URL" \ + --description "$DESCRIPTION" \ + --license "GPL-2+" \ + -m "Radxa " \ + --vendor "Radxa" \ + --force + done +} \ No newline at end of file diff --git a/lib/utils.sh b/lib/utils.sh new file mode 100644 index 00000000..180fcf61 --- /dev/null +++ b/lib/utils.sh @@ -0,0 +1,258 @@ +set -e +set -o pipefail + +LC_ALL="C" +LANG="C" +LANGUAGE="C" + +CROSS_COMPILE="aarch64-linux-gnu-" + +EXIT_SUCCESS=0 +EXIT_UNKNOWN_OPTION=1 +EXIT_TOO_FEW_ARGUMENTS=2 +EXIT_UNSUPPORTED_OPTION=3 + +error() { + case "$1" in + $EXIT_SUCCESS) + ;; + $EXIT_UNKNOWN_OPTION) + echo "${FUNCNAME[1]}->${FUNCNAME[0]}: Unknown option: '$2'." >&2 + ;; + $EXIT_TOO_FEW_ARGUMENTS) + echo "${FUNCNAME[1]}->${FUNCNAME[0]}: Too few arguments." >&2 + ;; + $EXIT_UNSUPPORTED_OPTION) + echo "${FUNCNAME[1]}->${FUNCNAME[0]}: Option '$2' is not supported." >&2 + ;; + *) + echo "${FUNCNAME[1]}->${FUNCNAME[0]}: Unknown exit code." >&2 + ;; + esac + + exit "$1" +} + +printf_array() { + local FORMAT="$1" + shift + local ARRAY=("$@") + + if [[ $FORMAT == "json" ]] + then + jq --compact-output --null-input '$ARGS.positional' --args -- "${ARRAY[@]}" + else + for i in ${ARRAY[@]} + do + printf "$FORMAT" "$i" + done + fi +} + +in_array() { + local ITEM="$1" + shift + local ARRAY=("$@") + if [[ " ${ARRAY[*]} " =~ " $ITEM " ]] + then + true + else + false + fi +} + +git_source() { + local GIT_URL="$1" + local GIT_BRANCH="$2" + local FOLDER="$(basename $GIT_URL)" + FOLDER="${FOLDER%.*}" + + if [[ -n $GIT_BRANCH ]] + then + GIT_BRANCH="--branch $GIT_BRANCH" + fi + + if ! [[ -e "$SRC_DIR/$FOLDER" ]] + then + git clone --depth 1 $GIT_BRANCH "$GIT_URL" "$SRC_DIR/$FOLDER" + fi +} + +prepare_source() { + local TARGET="$1" + local SRC_DIR="$SCRIPT_DIR/.src" + TARGET_DIR="$SRC_DIR/$TARGET" + local FORK_DIR="$SCRIPT_DIR/$TARGET/$FORK" + + mkdir -p "$TARGET_DIR" + + if [[ $NO_PREPARE_SOURCE == "yes" ]] + then + return + fi + + pushd "$TARGET_DIR" + + git init + [[ -z $(git config --get user.name) ]] && git config user.name "bsp" + [[ -z $(git config --get user.email) ]] && git config user.email "bsp@radxa.com" + git am --abort && true + [[ -n $(git status -s) ]] && git reset --hard HEAD + + local ORIGIN=$(sha1sum <(echo "$BSP_GIT") | cut -d' ' -f1) + git remote add $ORIGIN $BSP_GIT 2>/dev/null && true + + if [[ -n $BSP_COMMIT ]] + then + git fetch --depth 1 $ORIGIN $BSP_COMMIT + git checkout $BSP_COMMIT + git update-ref refs/tags/$BSP_COMMIT $BSP_COMMIT + elif [[ -n $BSP_BRANCH ]] + then + # Tag is more precise than branch and should be preferred. + # However, since we are defaulting with upstream Linux, + # we will always have non empty $BSP_TAG. + # As such check $BSP_BRANCH first. + git fetch --depth 1 $ORIGIN $BSP_BRANCH + git checkout $BSP_BRANCH + elif [[ -n $BSP_TAG ]] + then + git fetch --depth 1 $ORIGIN tag $BSP_TAG + git checkout tags/$BSP_TAG + fi + + git reset --hard FETCH_HEAD + git clean -ffd + + for d in $(find -L $FORK_DIR -type d | sort -r) + do + shopt -s nullglob + for f in $d/*.sh + do + if [[ $(type -t custom_source_action) == function ]] + then + unset -f custom_source_action + fi + + source $f + + if [[ $(type -t custom_source_action) == function ]] + then + echo "Running custom_source_action from $f" + custom_source_action "$SCRIPT_DIR" "$TARGET_DIR" + fi + done + shopt -u nullglob + done + + for d in $(find -L $FORK_DIR -type d | sort) + do + if ls $d/*.patch &>/dev/null + then + git am --reject --whitespace=fix $(ls $d/*.patch) + fi + done + + popd +} + +kconfig() { + local mode="config" + if [[ $1 == "-v" ]] + then + mode="verify" + shift + fi + local file="$1" + + while IFS="" read -r k || [ -n "$k" ] + do + local config= + local option= + local switch= + if grep -q "^# CONFIG_.* is not set$" <<< $k + then + config=$(cut -d ' ' -f 2 <<< $k) + switch="--undefine" + elif grep -q "^CONFIG_.*=[ynm]$" <<< $k + then + config=$(echo $k | cut -d '=' -f 1) + case "$(echo $k | cut -d'=' -f 2)" in + y) + switch="--enable" + ;; + n) + switch="--disable" + ;; + m) + switch="--module" + ;; + esac + elif grep -q "^CONFIG_.*=\".*\"$" <<< $k + then + IFS='=' read -r config option <<< $k + switch="--set-val" + elif grep -q "^CONFIG_.*=.*$" <<< $k + then + IFS='=' read -r config option <<< $k + switch="--set-val" + elif grep -q "^#" <<< $k + then + continue + elif [[ -z "$k" ]] + then + continue + else + error $EXIT_UNKNOWN_OPTION "$k" + fi + case $mode in + config) + "$SCRIPT_DIR/common/config" --file "$TARGET_DIR/.config" $switch $config "$option" + ;; + verify) + if ! grep -q "$k" "$TARGET_DIR/.config" + then + echo "kconfig: Mismatch: $k" >&2 + fi + ;; + esac + done < "$file" +} + +apply_kconfig() { + if [[ -e "$1" ]] + then + tee -a "$SCRIPT_DIR/.src/build.log" <<< "Apply kconfig from $1" + kconfig "$1" + kconfig -v "$1" | tee -a "$SCRIPT_DIR/.src/build.log" + fi +} + +get_soc_family() { + case "$1" in + rk*) + echo rockchip + ;; + s905y2|a311d) + echo amlogic + ;; + *) + error $EXIT_UNSUPPORTED_OPTION "$1" + ;; + esac +} + +load_edition() { + if ! source "$SCRIPT_DIR/lib/$1.sh" 2>/dev/null + then + error $EXIT_UNKNOWN_OPTION "$1" + fi + TARGET=$1 + bsp_reset + + if ! source "$SCRIPT_DIR/$TARGET/$2/fork.conf" 2>/dev/null + then + error $EXIT_UNKNOWN_OPTION "$2" + fi + FORK=$2 +} \ No newline at end of file diff --git a/forks/.common-5.y/kconfig.conf b/linux/.common-5.y/kconfig.conf similarity index 100% rename from forks/.common-5.y/kconfig.conf rename to linux/.common-5.y/kconfig.conf diff --git a/forks/.unused/latest/rockpi-4b/0006-arm64-dts-rockchip-add-ROCK-Pi-E-board.patch b/linux/.unused/latest/rockpi-4b/0006-arm64-dts-rockchip-add-ROCK-Pi-E-board.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0006-arm64-dts-rockchip-add-ROCK-Pi-E-board.patch rename to linux/.unused/latest/rockpi-4b/0006-arm64-dts-rockchip-add-ROCK-Pi-E-board.patch diff --git a/forks/.unused/latest/rockpi-4b/0011-arm64-dts-rockchip-enable-es8316-audio-for-ROCK-Pi-4.patch b/linux/.unused/latest/rockpi-4b/0011-arm64-dts-rockchip-enable-es8316-audio-for-ROCK-Pi-4.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0011-arm64-dts-rockchip-enable-es8316-audio-for-ROCK-Pi-4.patch rename to linux/.unused/latest/rockpi-4b/0011-arm64-dts-rockchip-enable-es8316-audio-for-ROCK-Pi-4.patch diff --git a/forks/.unused/latest/rockpi-4b/0014-add-overlay-compilation-support.patch b/linux/.unused/latest/rockpi-4b/0014-add-overlay-compilation-support.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0014-add-overlay-compilation-support.patch rename to linux/.unused/latest/rockpi-4b/0014-add-overlay-compilation-support.patch diff --git a/forks/.unused/latest/rockpi-4b/0015-add-overlay-configfs.patch b/linux/.unused/latest/rockpi-4b/0015-add-overlay-configfs.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0015-add-overlay-configfs.patch rename to linux/.unused/latest/rockpi-4b/0015-add-overlay-configfs.patch diff --git a/forks/.unused/latest/rockpi-4b/0019-net-stmmac-disable-mtu-validation.patch b/linux/.unused/latest/rockpi-4b/0019-net-stmmac-disable-mtu-validation.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0019-net-stmmac-disable-mtu-validation.patch rename to linux/.unused/latest/rockpi-4b/0019-net-stmmac-disable-mtu-validation.patch diff --git a/forks/.unused/latest/rockpi-4b/0020-disable-regulator-supply-validation.patch b/linux/.unused/latest/rockpi-4b/0020-disable-regulator-supply-validation.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0020-disable-regulator-supply-validation.patch rename to linux/.unused/latest/rockpi-4b/0020-disable-regulator-supply-validation.patch diff --git a/forks/.unused/latest/rockpi-4b/0021-emmc-hs400es-init-tweak.patch b/linux/.unused/latest/rockpi-4b/0021-emmc-hs400es-init-tweak.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0021-emmc-hs400es-init-tweak.patch rename to linux/.unused/latest/rockpi-4b/0021-emmc-hs400es-init-tweak.patch diff --git a/forks/.unused/latest/rockpi-4b/0022-increase-DMA-block-memory-allocation-to-2MB.patch b/linux/.unused/latest/rockpi-4b/0022-increase-DMA-block-memory-allocation-to-2MB.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0022-increase-DMA-block-memory-allocation-to-2MB.patch rename to linux/.unused/latest/rockpi-4b/0022-increase-DMA-block-memory-allocation-to-2MB.patch diff --git a/forks/.unused/latest/rockpi-4b/0025-media-rkvdec-h264-Fix-reference-frame_num-wrap-for-s.patch b/linux/.unused/latest/rockpi-4b/0025-media-rkvdec-h264-Fix-reference-frame_num-wrap-for-s.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0025-media-rkvdec-h264-Fix-reference-frame_num-wrap-for-s.patch rename to linux/.unused/latest/rockpi-4b/0025-media-rkvdec-h264-Fix-reference-frame_num-wrap-for-s.patch diff --git a/forks/.unused/latest/rockpi-4b/0027-rk3399-bump-voltages-for-low-opps.patch b/linux/.unused/latest/rockpi-4b/0027-rk3399-bump-voltages-for-low-opps.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0027-rk3399-bump-voltages-for-low-opps.patch rename to linux/.unused/latest/rockpi-4b/0027-rk3399-bump-voltages-for-low-opps.patch diff --git a/forks/.unused/latest/rockpi-4b/0029-PCI-rockchip-support-ep-gpio-undefined-case.patch b/linux/.unused/latest/rockpi-4b/0029-PCI-rockchip-support-ep-gpio-undefined-case.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0029-PCI-rockchip-support-ep-gpio-undefined-case.patch rename to linux/.unused/latest/rockpi-4b/0029-PCI-rockchip-support-ep-gpio-undefined-case.patch diff --git a/forks/.unused/latest/rockpi-4b/0035-arm64-add-rockchip_linux_defconfig.patch b/linux/.unused/latest/rockpi-4b/0035-arm64-add-rockchip_linux_defconfig.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0035-arm64-add-rockchip_linux_defconfig.patch rename to linux/.unused/latest/rockpi-4b/0035-arm64-add-rockchip_linux_defconfig.patch diff --git a/forks/.unused/latest/rockpi-4b/0036-arm64-dts-rockchip-rock-pi-4-delete-chosen-node.patch b/linux/.unused/latest/rockpi-4b/0036-arm64-dts-rockchip-rock-pi-4-delete-chosen-node.patch similarity index 100% rename from forks/.unused/latest/rockpi-4b/0036-arm64-dts-rockchip-rock-pi-4-delete-chosen-node.patch rename to linux/.unused/latest/rockpi-4b/0036-arm64-dts-rockchip-rock-pi-4-delete-chosen-node.patch diff --git a/forks/latest/0001-common b/linux/latest/0001-common similarity index 100% rename from forks/latest/0001-common rename to linux/latest/0001-common diff --git a/forks/latest/0010-upstream/0001-arm64-dts-meson-radxa-zero-add-support-for-the-usb-t.patch b/linux/latest/0010-upstream/0001-arm64-dts-meson-radxa-zero-add-support-for-the-usb-t.patch similarity index 100% rename from forks/latest/0010-upstream/0001-arm64-dts-meson-radxa-zero-add-support-for-the-usb-t.patch rename to linux/latest/0010-upstream/0001-arm64-dts-meson-radxa-zero-add-support-for-the-usb-t.patch diff --git a/forks/latest/0010-upstream/0002-pinctrl-meson-Add-several-missing-pinmux-for-pwm-fun.patch b/linux/latest/0010-upstream/0002-pinctrl-meson-Add-several-missing-pinmux-for-pwm-fun.patch similarity index 100% rename from forks/latest/0010-upstream/0002-pinctrl-meson-Add-several-missing-pinmux-for-pwm-fun.patch rename to linux/latest/0010-upstream/0002-pinctrl-meson-Add-several-missing-pinmux-for-pwm-fun.patch diff --git a/forks/latest/0010-upstream/0003-dt-bindings-arm-amlogic-add-support-for-Radxa-Zero2.patch b/linux/latest/0010-upstream/0003-dt-bindings-arm-amlogic-add-support-for-Radxa-Zero2.patch similarity index 100% rename from forks/latest/0010-upstream/0003-dt-bindings-arm-amlogic-add-support-for-Radxa-Zero2.patch rename to linux/latest/0010-upstream/0003-dt-bindings-arm-amlogic-add-support-for-Radxa-Zero2.patch diff --git a/forks/latest/0010-upstream/0004-arm64-dts-meson-add-support-for-Radxa-Zero2.patch b/linux/latest/0010-upstream/0004-arm64-dts-meson-add-support-for-Radxa-Zero2.patch similarity index 100% rename from forks/latest/0010-upstream/0004-arm64-dts-meson-add-support-for-Radxa-Zero2.patch rename to linux/latest/0010-upstream/0004-arm64-dts-meson-add-support-for-Radxa-Zero2.patch diff --git a/forks/latest/0020-radxa-zero/0001-VENDOR-Radxa-Zero-Wi-Fi-fix.patch b/linux/latest/0020-radxa-zero/0001-VENDOR-Radxa-Zero-Wi-Fi-fix.patch similarity index 100% rename from forks/latest/0020-radxa-zero/0001-VENDOR-Radxa-Zero-Wi-Fi-fix.patch rename to linux/latest/0020-radxa-zero/0001-VENDOR-Radxa-Zero-Wi-Fi-fix.patch diff --git a/forks/latest/0021-rockpi-4b/0001-drm-rockchip-cdn-dp-Force-a-full-modeset-when-crtc_s.patch b/linux/latest/0021-rockpi-4b/0001-drm-rockchip-cdn-dp-Force-a-full-modeset-when-crtc_s.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0001-drm-rockchip-cdn-dp-Force-a-full-modeset-when-crtc_s.patch rename to linux/latest/0021-rockpi-4b/0001-drm-rockchip-cdn-dp-Force-a-full-modeset-when-crtc_s.patch diff --git a/forks/latest/0021-rockpi-4b/0002-extcon-Add-EXTCON_USB_VBUS_EN.patch b/linux/latest/0021-rockpi-4b/0002-extcon-Add-EXTCON_USB_VBUS_EN.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0002-extcon-Add-EXTCON_USB_VBUS_EN.patch rename to linux/latest/0021-rockpi-4b/0002-extcon-Add-EXTCON_USB_VBUS_EN.patch diff --git a/forks/latest/0021-rockpi-4b/0003-extcon-Add-Type-C-Virtual-PD-driver.patch b/linux/latest/0021-rockpi-4b/0003-extcon-Add-Type-C-Virtual-PD-driver.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0003-extcon-Add-Type-C-Virtual-PD-driver.patch rename to linux/latest/0021-rockpi-4b/0003-extcon-Add-Type-C-Virtual-PD-driver.patch diff --git a/forks/latest/0021-rockpi-4b/0004-arm64-dts-rockchip-Move-USB-Host-enable-on-ROCK-Pi-4.patch b/linux/latest/0021-rockpi-4b/0004-arm64-dts-rockchip-Move-USB-Host-enable-on-ROCK-Pi-4.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0004-arm64-dts-rockchip-Move-USB-Host-enable-on-ROCK-Pi-4.patch rename to linux/latest/0021-rockpi-4b/0004-arm64-dts-rockchip-Move-USB-Host-enable-on-ROCK-Pi-4.patch diff --git a/forks/latest/0021-rockpi-4b/0005-arm64-dts-rk3399-rock-pi-4c-Enable-Display-Port.patch b/linux/latest/0021-rockpi-4b/0005-arm64-dts-rk3399-rock-pi-4c-Enable-Display-Port.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0005-arm64-dts-rk3399-rock-pi-4c-Enable-Display-Port.patch rename to linux/latest/0021-rockpi-4b/0005-arm64-dts-rk3399-rock-pi-4c-Enable-Display-Port.patch diff --git a/forks/latest/0021-rockpi-4b/0006-ASoC-es8316-fix-kernel-panic.patch b/linux/latest/0021-rockpi-4b/0006-ASoC-es8316-fix-kernel-panic.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0006-ASoC-es8316-fix-kernel-panic.patch rename to linux/latest/0021-rockpi-4b/0006-ASoC-es8316-fix-kernel-panic.patch diff --git a/forks/latest/0021-rockpi-4b/0007-arm64-dts-rockchip-add-led-for-ROCK-Pi-4.patch b/linux/latest/0021-rockpi-4b/0007-arm64-dts-rockchip-add-led-for-ROCK-Pi-4.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0007-arm64-dts-rockchip-add-led-for-ROCK-Pi-4.patch rename to linux/latest/0021-rockpi-4b/0007-arm64-dts-rockchip-add-led-for-ROCK-Pi-4.patch diff --git a/forks/latest/0021-rockpi-4b/0008-arm64-dts-rockchip-add-pcie-for-ROCK-Pi-4.patch b/linux/latest/0021-rockpi-4b/0008-arm64-dts-rockchip-add-pcie-for-ROCK-Pi-4.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0008-arm64-dts-rockchip-add-pcie-for-ROCK-Pi-4.patch rename to linux/latest/0021-rockpi-4b/0008-arm64-dts-rockchip-add-pcie-for-ROCK-Pi-4.patch diff --git a/forks/latest/0021-rockpi-4b/0009-arm64-dts-set-emmc-max-frequency-to-150000000-for-RO.patch b/linux/latest/0021-rockpi-4b/0009-arm64-dts-set-emmc-max-frequency-to-150000000-for-RO.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0009-arm64-dts-set-emmc-max-frequency-to-150000000-for-RO.patch rename to linux/latest/0021-rockpi-4b/0009-arm64-dts-set-emmc-max-frequency-to-150000000-for-RO.patch diff --git a/forks/latest/0021-rockpi-4b/0010-add-dwc3-xhci-usb-trb-quirk.patch b/linux/latest/0021-rockpi-4b/0010-add-dwc3-xhci-usb-trb-quirk.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0010-add-dwc3-xhci-usb-trb-quirk.patch rename to linux/latest/0021-rockpi-4b/0010-add-dwc3-xhci-usb-trb-quirk.patch diff --git a/forks/latest/0021-rockpi-4b/0011-rk3399-enable-dwc3-xhci-usb-trb-quirk.patch b/linux/latest/0021-rockpi-4b/0011-rk3399-enable-dwc3-xhci-usb-trb-quirk.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0011-rk3399-enable-dwc3-xhci-usb-trb-quirk.patch rename to linux/latest/0021-rockpi-4b/0011-rk3399-enable-dwc3-xhci-usb-trb-quirk.patch diff --git a/forks/latest/0021-rockpi-4b/0012-add-panel-simple-dsi.patch b/linux/latest/0021-rockpi-4b/0012-add-panel-simple-dsi.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0012-add-panel-simple-dsi.patch rename to linux/latest/0021-rockpi-4b/0012-add-panel-simple-dsi.patch diff --git a/forks/latest/0021-rockpi-4b/0013-Bluetooth-Add-new-quirk-for-broken-local-ext-feature.patch b/linux/latest/0021-rockpi-4b/0013-Bluetooth-Add-new-quirk-for-broken-local-ext-feature.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0013-Bluetooth-Add-new-quirk-for-broken-local-ext-feature.patch rename to linux/latest/0021-rockpi-4b/0013-Bluetooth-Add-new-quirk-for-broken-local-ext-feature.patch diff --git a/forks/latest/0021-rockpi-4b/0014-add-possibility-of-disabling-rk808-rtc.patch b/linux/latest/0021-rockpi-4b/0014-add-possibility-of-disabling-rk808-rtc.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0014-add-possibility-of-disabling-rk808-rtc.patch rename to linux/latest/0021-rockpi-4b/0014-add-possibility-of-disabling-rk808-rtc.patch diff --git a/forks/latest/0021-rockpi-4b/0015-change-the-way-that-BUCK1-and-BUCK2-of-rk808-PMIC-se.patch b/linux/latest/0021-rockpi-4b/0015-change-the-way-that-BUCK1-and-BUCK2-of-rk808-PMIC-se.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0015-change-the-way-that-BUCK1-and-BUCK2-of-rk808-PMIC-se.patch rename to linux/latest/0021-rockpi-4b/0015-change-the-way-that-BUCK1-and-BUCK2-of-rk808-PMIC-se.patch diff --git a/forks/latest/0021-rockpi-4b/0016-rk3399-add-sclk-i2sout-src-clock.patch b/linux/latest/0021-rockpi-4b/0016-rk3399-add-sclk-i2sout-src-clock.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0016-rk3399-add-sclk-i2sout-src-clock.patch rename to linux/latest/0021-rockpi-4b/0016-rk3399-add-sclk-i2sout-src-clock.patch diff --git a/forks/latest/0021-rockpi-4b/0017-Reimplement-rockchip-PCIe-bus-scan-delay.patch b/linux/latest/0021-rockpi-4b/0017-Reimplement-rockchip-PCIe-bus-scan-delay.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0017-Reimplement-rockchip-PCIe-bus-scan-delay.patch rename to linux/latest/0021-rockpi-4b/0017-Reimplement-rockchip-PCIe-bus-scan-delay.patch diff --git a/forks/latest/0021-rockpi-4b/0018-set-sd-driver-level-to-8ma-for-rk3399.patch b/linux/latest/0021-rockpi-4b/0018-set-sd-driver-level-to-8ma-for-rk3399.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0018-set-sd-driver-level-to-8ma-for-rk3399.patch rename to linux/latest/0021-rockpi-4b/0018-set-sd-driver-level-to-8ma-for-rk3399.patch diff --git a/forks/latest/0021-rockpi-4b/0019-set-CPU-temperature-alarm-level-higher-for-rk3399.patch b/linux/latest/0021-rockpi-4b/0019-set-CPU-temperature-alarm-level-higher-for-rk3399.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0019-set-CPU-temperature-alarm-level-higher-for-rk3399.patch rename to linux/latest/0021-rockpi-4b/0019-set-CPU-temperature-alarm-level-higher-for-rk3399.patch diff --git a/forks/latest/0021-rockpi-4b/0020-extcon-extcon-pd-virtual-Get-vpd-properties-from-DT.patch b/linux/latest/0021-rockpi-4b/0020-extcon-extcon-pd-virtual-Get-vpd-properties-from-DT.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0020-extcon-extcon-pd-virtual-Get-vpd-properties-from-DT.patch rename to linux/latest/0021-rockpi-4b/0020-extcon-extcon-pd-virtual-Get-vpd-properties-from-DT.patch diff --git a/forks/latest/0021-rockpi-4b/0021-arm64-dts-rockchip-Add-vpd-properties-for-ROCK-Pi-4C.patch b/linux/latest/0021-rockpi-4b/0021-arm64-dts-rockchip-Add-vpd-properties-for-ROCK-Pi-4C.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0021-arm64-dts-rockchip-Add-vpd-properties-for-ROCK-Pi-4C.patch rename to linux/latest/0021-rockpi-4b/0021-arm64-dts-rockchip-Add-vpd-properties-for-ROCK-Pi-4C.patch diff --git a/forks/latest/0021-rockpi-4b/0022-arm64-dts-rockchip-Add-Radxa-ROCK-Pi-4C-Plus-support.patch b/linux/latest/0021-rockpi-4b/0022-arm64-dts-rockchip-Add-Radxa-ROCK-Pi-4C-Plus-support.patch similarity index 100% rename from forks/latest/0021-rockpi-4b/0022-arm64-dts-rockchip-Add-Radxa-ROCK-Pi-4C-Plus-support.patch rename to linux/latest/0021-rockpi-4b/0022-arm64-dts-rockchip-Add-Radxa-ROCK-Pi-4C-Plus-support.patch diff --git a/forks/latest/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch b/linux/latest/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch similarity index 100% rename from forks/latest/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch rename to linux/latest/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch diff --git a/linux/latest/fork.conf b/linux/latest/fork.conf new file mode 100644 index 00000000..03cefb41 --- /dev/null +++ b/linux/latest/fork.conf @@ -0,0 +1,3 @@ +BSP_GIT="https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux.git" +BSP_TAG="v5.19-rc7" +SUPPORTED_BOARDS=("latest") \ No newline at end of file diff --git a/forks/rockchip-5.10/overlays.sh b/linux/latest/overlays.sh similarity index 63% rename from forks/rockchip-5.10/overlays.sh rename to linux/latest/overlays.sh index 3fae3247..3cc4f79a 100644 --- a/forks/rockchip-5.10/overlays.sh +++ b/linux/latest/overlays.sh @@ -1,4 +1,4 @@ custom_source_action() { git_source https://github.com/radxa/overlays.git - cp -r $SRC_DIR/overlays/arch $LINUX_DIR + cp -r $SRC_DIR/overlays/arch $TARGET_DIR } \ No newline at end of file diff --git a/forks/rockchip-4.19/0001-Fix-Wmisleading-indentation.patch b/linux/rockchip-4.19/0001-Fix-Wmisleading-indentation.patch similarity index 100% rename from forks/rockchip-4.19/0001-Fix-Wmisleading-indentation.patch rename to linux/rockchip-4.19/0001-Fix-Wmisleading-indentation.patch diff --git a/linux/rockchip-4.19/fork.conf b/linux/rockchip-4.19/fork.conf new file mode 100644 index 00000000..b777be48 --- /dev/null +++ b/linux/rockchip-4.19/fork.conf @@ -0,0 +1,4 @@ +BSP_GIT="https://github.com/radxa/kernel.git" +BSP_BRANCH="stable-4.19-rock3" +BSP_DEFCONFIG="rockchip_linux_defconfig" +SUPPORTED_BOARDS=("rockchip-4.19" "radxa-cm3-io" "radxa-cm3-rpi-cm4-io" "radxa-e23" "radxa-e25" "radxa-3a" "radxa-3b") \ No newline at end of file diff --git a/forks/rockchip-4.4/0001-Fix-multiple-definition-of-yylloc.patch b/linux/rockchip-4.4/0001-Fix-multiple-definition-of-yylloc.patch similarity index 100% rename from forks/rockchip-4.4/0001-Fix-multiple-definition-of-yylloc.patch rename to linux/rockchip-4.4/0001-Fix-multiple-definition-of-yylloc.patch diff --git a/forks/rockchip-4.4/0002-Suppress-additional-warnings.patch b/linux/rockchip-4.4/0002-Suppress-additional-warnings.patch similarity index 100% rename from forks/rockchip-4.4/0002-Suppress-additional-warnings.patch rename to linux/rockchip-4.4/0002-Suppress-additional-warnings.patch diff --git a/linux/rockchip-4.4/fork.conf b/linux/rockchip-4.4/fork.conf new file mode 100644 index 00000000..4e4ecea0 --- /dev/null +++ b/linux/rockchip-4.4/fork.conf @@ -0,0 +1,4 @@ +BSP_GIT="https://github.com/radxa/kernel.git" +BSP_BRANCH="release-4.4-rockpi4" +BSP_DEFCONFIG="rockchip_linux_defconfig" +SUPPORTED_BOARDS=("rockchip-4.4" "rockpi-4b" "rockpi-4c") \ No newline at end of file diff --git a/forks/rockchip-5.10/0001-common b/linux/rockchip-5.10/0001-common similarity index 100% rename from forks/rockchip-5.10/0001-common rename to linux/rockchip-5.10/0001-common diff --git a/forks/rockchip-5.10/0010-backport/0001-scripts-dtc-Update-to-upstream-version-v1.6.0-51-g18.patch b/linux/rockchip-5.10/0010-backport/0001-scripts-dtc-Update-to-upstream-version-v1.6.0-51-g18.patch similarity index 100% rename from forks/rockchip-5.10/0010-backport/0001-scripts-dtc-Update-to-upstream-version-v1.6.0-51-g18.patch rename to linux/rockchip-5.10/0010-backport/0001-scripts-dtc-Update-to-upstream-version-v1.6.0-51-g18.patch diff --git a/forks/rockchip-5.10/0010-backport/0002-kbuild-Add-support-to-build-overlays-.dtbo.patch b/linux/rockchip-5.10/0010-backport/0002-kbuild-Add-support-to-build-overlays-.dtbo.patch similarity index 100% rename from forks/rockchip-5.10/0010-backport/0002-kbuild-Add-support-to-build-overlays-.dtbo.patch rename to linux/rockchip-5.10/0010-backport/0002-kbuild-Add-support-to-build-overlays-.dtbo.patch diff --git a/forks/rockchip-5.10/0010-backport/0003-mm-page_alloc-fix-building-error-on-Werror-array-com.patch b/linux/rockchip-5.10/0010-backport/0003-mm-page_alloc-fix-building-error-on-Werror-array-com.patch similarity index 100% rename from forks/rockchip-5.10/0010-backport/0003-mm-page_alloc-fix-building-error-on-Werror-array-com.patch rename to linux/rockchip-5.10/0010-backport/0003-mm-page_alloc-fix-building-error-on-Werror-array-com.patch diff --git a/forks/rockchip-5.10/0010-backport/0004-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch b/linux/rockchip-5.10/0010-backport/0004-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch similarity index 100% rename from forks/rockchip-5.10/0010-backport/0004-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch rename to linux/rockchip-5.10/0010-backport/0004-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch diff --git a/forks/rockchip-5.10/0020-rock-5a/0001-VENDOR-bluetooth-Add-RTL8852BU-driver.patch b/linux/rockchip-5.10/0020-rock-5a/0001-VENDOR-bluetooth-Add-RTL8852BU-driver.patch similarity index 100% rename from forks/rockchip-5.10/0020-rock-5a/0001-VENDOR-bluetooth-Add-RTL8852BU-driver.patch rename to linux/rockchip-5.10/0020-rock-5a/0001-VENDOR-bluetooth-Add-RTL8852BU-driver.patch diff --git a/forks/rockchip-5.10/0020-rock-5a/0002-VENDOR-wireless-Add-RTL8852BU-driver.patch b/linux/rockchip-5.10/0020-rock-5a/0002-VENDOR-wireless-Add-RTL8852BU-driver.patch similarity index 100% rename from forks/rockchip-5.10/0020-rock-5a/0002-VENDOR-wireless-Add-RTL8852BU-driver.patch rename to linux/rockchip-5.10/0020-rock-5a/0002-VENDOR-wireless-Add-RTL8852BU-driver.patch diff --git a/forks/rockchip-5.10/0020-rock-5a/0003-arm64-dts-rockchip-Add-initial-ROCK-5A-dts.patch b/linux/rockchip-5.10/0020-rock-5a/0003-arm64-dts-rockchip-Add-initial-ROCK-5A-dts.patch similarity index 100% rename from forks/rockchip-5.10/0020-rock-5a/0003-arm64-dts-rockchip-Add-initial-ROCK-5A-dts.patch rename to linux/rockchip-5.10/0020-rock-5a/0003-arm64-dts-rockchip-Add-initial-ROCK-5A-dts.patch diff --git a/forks/rockchip-5.10/0020-rock-5a/0004-arm64-dts-rockchip-rock-5a-Fix-vcc_5v0-power-enable-.patch b/linux/rockchip-5.10/0020-rock-5a/0004-arm64-dts-rockchip-rock-5a-Fix-vcc_5v0-power-enable-.patch similarity index 100% rename from forks/rockchip-5.10/0020-rock-5a/0004-arm64-dts-rockchip-rock-5a-Fix-vcc_5v0-power-enable-.patch rename to linux/rockchip-5.10/0020-rock-5a/0004-arm64-dts-rockchip-rock-5a-Fix-vcc_5v0-power-enable-.patch diff --git a/forks/rockchip-5.10/0020-rock-5a/0005-arm64-dts-rockchip-rock-5a-Fix-ethernet-cannot-get-I.patch b/linux/rockchip-5.10/0020-rock-5a/0005-arm64-dts-rockchip-rock-5a-Fix-ethernet-cannot-get-I.patch similarity index 100% rename from forks/rockchip-5.10/0020-rock-5a/0005-arm64-dts-rockchip-rock-5a-Fix-ethernet-cannot-get-I.patch rename to linux/rockchip-5.10/0020-rock-5a/0005-arm64-dts-rockchip-rock-5a-Fix-ethernet-cannot-get-I.patch diff --git a/forks/rockchip-5.10/0020-rock-5a/0006-arm64-dts-rockchip-rock-5a-Add-USB3.0-function-for-t.patch b/linux/rockchip-5.10/0020-rock-5a/0006-arm64-dts-rockchip-rock-5a-Add-USB3.0-function-for-t.patch similarity index 100% rename from forks/rockchip-5.10/0020-rock-5a/0006-arm64-dts-rockchip-rock-5a-Add-USB3.0-function-for-t.patch rename to linux/rockchip-5.10/0020-rock-5a/0006-arm64-dts-rockchip-rock-5a-Add-USB3.0-function-for-t.patch diff --git a/forks/rockchip-5.10/0020-rock-5a/0007-arm64-dts-rockchip-rock-5a-Add-camera-imx415-support.patch b/linux/rockchip-5.10/0020-rock-5a/0007-arm64-dts-rockchip-rock-5a-Add-camera-imx415-support.patch similarity index 100% rename from forks/rockchip-5.10/0020-rock-5a/0007-arm64-dts-rockchip-rock-5a-Add-camera-imx415-support.patch rename to linux/rockchip-5.10/0020-rock-5a/0007-arm64-dts-rockchip-rock-5a-Add-camera-imx415-support.patch diff --git a/forks/rockchip-5.10/0020-rock-5a/0008-arm64-dts-rockchip-rock-5a-fix-reset-pdwn-gpio-for-i.patch b/linux/rockchip-5.10/0020-rock-5a/0008-arm64-dts-rockchip-rock-5a-fix-reset-pdwn-gpio-for-i.patch similarity index 100% rename from forks/rockchip-5.10/0020-rock-5a/0008-arm64-dts-rockchip-rock-5a-fix-reset-pdwn-gpio-for-i.patch rename to linux/rockchip-5.10/0020-rock-5a/0008-arm64-dts-rockchip-rock-5a-fix-reset-pdwn-gpio-for-i.patch diff --git a/forks/rockchip-5.10/0020-rock-5a/0009-arm64-dts-rockchip-rock-5a-fix-6252B-UUB-control-pin.patch b/linux/rockchip-5.10/0020-rock-5a/0009-arm64-dts-rockchip-rock-5a-fix-6252B-UUB-control-pin.patch similarity index 100% rename from forks/rockchip-5.10/0020-rock-5a/0009-arm64-dts-rockchip-rock-5a-fix-6252B-UUB-control-pin.patch rename to linux/rockchip-5.10/0020-rock-5a/0009-arm64-dts-rockchip-rock-5a-fix-6252B-UUB-control-pin.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0001-arm64-dts-rockchip-add-ROCK-5B-board.patch b/linux/rockchip-5.10/0021-rock-5b/0001-arm64-dts-rockchip-add-ROCK-5B-board.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0001-arm64-dts-rockchip-add-ROCK-5B-board.patch rename to linux/rockchip-5.10/0021-rock-5b/0001-arm64-dts-rockchip-add-ROCK-5B-board.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0002-delete-.scmversion.patch b/linux/rockchip-5.10/0021-rock-5b/0002-delete-.scmversion.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0002-delete-.scmversion.patch rename to linux/rockchip-5.10/0021-rock-5b/0002-delete-.scmversion.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0003-drivers-net-ethernet-add-r8125-driver.patch b/linux/rockchip-5.10/0021-rock-5b/0003-drivers-net-ethernet-add-r8125-driver.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0003-drivers-net-ethernet-add-r8125-driver.patch rename to linux/rockchip-5.10/0021-rock-5b/0003-drivers-net-ethernet-add-r8125-driver.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0004-arm64-dts-rockchip-rk3588-add-mmc-aliases-for-rk3588.patch b/linux/rockchip-5.10/0021-rock-5b/0004-arm64-dts-rockchip-rk3588-add-mmc-aliases-for-rk3588.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0004-arm64-dts-rockchip-rk3588-add-mmc-aliases-for-rk3588.patch rename to linux/rockchip-5.10/0021-rock-5b/0004-arm64-dts-rockchip-rk3588-add-mmc-aliases-for-rk3588.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0005-arm64-dts-rockchip-add-more-features-for-rock-5b.patch b/linux/rockchip-5.10/0021-rock-5b/0005-arm64-dts-rockchip-add-more-features-for-rock-5b.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0005-arm64-dts-rockchip-add-more-features-for-rock-5b.patch rename to linux/rockchip-5.10/0021-rock-5b/0005-arm64-dts-rockchip-add-more-features-for-rock-5b.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0006-ASoC-codecs-update-es8316-driver.patch b/linux/rockchip-5.10/0021-rock-5b/0006-ASoC-codecs-update-es8316-driver.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0006-ASoC-codecs-update-es8316-driver.patch rename to linux/rockchip-5.10/0021-rock-5b/0006-ASoC-codecs-update-es8316-driver.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0007-drivers-net-ethernet-update-r8125-driver-to-version-.patch b/linux/rockchip-5.10/0021-rock-5b/0007-drivers-net-ethernet-update-r8125-driver-to-version-.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0007-drivers-net-ethernet-update-r8125-driver-to-version-.patch rename to linux/rockchip-5.10/0021-rock-5b/0007-drivers-net-ethernet-update-r8125-driver-to-version-.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0008-drivers-net-ethernet-r8125-improve-network-performan.patch b/linux/rockchip-5.10/0021-rock-5b/0008-drivers-net-ethernet-r8125-improve-network-performan.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0008-drivers-net-ethernet-r8125-improve-network-performan.patch rename to linux/rockchip-5.10/0021-rock-5b/0008-drivers-net-ethernet-r8125-improve-network-performan.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0009-input-touchscreen-focaltech-touch-change-default-max.patch b/linux/rockchip-5.10/0021-rock-5b/0009-input-touchscreen-focaltech-touch-change-default-max.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0009-input-touchscreen-focaltech-touch-change-default-max.patch rename to linux/rockchip-5.10/0021-rock-5b/0009-input-touchscreen-focaltech-touch-change-default-max.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0010-input-touchscreen-focaltech-touch-Fix-compilation-er.patch b/linux/rockchip-5.10/0021-rock-5b/0010-input-touchscreen-focaltech-touch-Fix-compilation-er.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0010-input-touchscreen-focaltech-touch-Fix-compilation-er.patch rename to linux/rockchip-5.10/0021-rock-5b/0010-input-touchscreen-focaltech-touch-Fix-compilation-er.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0011-arm64-dts-rock-5b-Fix-many-peripherals-not-working-d.patch b/linux/rockchip-5.10/0021-rock-5b/0011-arm64-dts-rock-5b-Fix-many-peripherals-not-working-d.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0011-arm64-dts-rock-5b-Fix-many-peripherals-not-working-d.patch rename to linux/rockchip-5.10/0021-rock-5b/0011-arm64-dts-rock-5b-Fix-many-peripherals-not-working-d.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0012-arm64-dts-rock-5b-remove-mmc-hs400-enhanced-strobe-s.patch b/linux/rockchip-5.10/0021-rock-5b/0012-arm64-dts-rock-5b-remove-mmc-hs400-enhanced-strobe-s.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0012-arm64-dts-rock-5b-remove-mmc-hs400-enhanced-strobe-s.patch rename to linux/rockchip-5.10/0021-rock-5b/0012-arm64-dts-rock-5b-remove-mmc-hs400-enhanced-strobe-s.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0013-arm64-dts-rockchip-Add-rock-5b-v11.patch b/linux/rockchip-5.10/0021-rock-5b/0013-arm64-dts-rockchip-Add-rock-5b-v11.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0013-arm64-dts-rockchip-Add-rock-5b-v11.patch rename to linux/rockchip-5.10/0021-rock-5b/0013-arm64-dts-rockchip-Add-rock-5b-v11.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0014-arm64-dts-rockchip-rk3588-rock-5b-Assign-VOP_ACLK-to.patch b/linux/rockchip-5.10/0021-rock-5b/0014-arm64-dts-rockchip-rk3588-rock-5b-Assign-VOP_ACLK-to.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0014-arm64-dts-rockchip-rk3588-rock-5b-Assign-VOP_ACLK-to.patch rename to linux/rockchip-5.10/0021-rock-5b/0014-arm64-dts-rockchip-rk3588-rock-5b-Assign-VOP_ACLK-to.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0015-arm64-dts-rockchip-rock-5b-add-pd-for-typec-port.patch b/linux/rockchip-5.10/0021-rock-5b/0015-arm64-dts-rockchip-rock-5b-add-pd-for-typec-port.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0015-arm64-dts-rockchip-rock-5b-add-pd-for-typec-port.patch rename to linux/rockchip-5.10/0021-rock-5b/0015-arm64-dts-rockchip-rock-5b-add-pd-for-typec-port.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0016-arm64-dts-rockchip-rk3588-add-pwm-aliases.patch b/linux/rockchip-5.10/0021-rock-5b/0016-arm64-dts-rockchip-rk3588-add-pwm-aliases.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0016-arm64-dts-rockchip-rk3588-add-pwm-aliases.patch rename to linux/rockchip-5.10/0021-rock-5b/0016-arm64-dts-rockchip-rk3588-add-pwm-aliases.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0017-arm64-dts-rockchip-rock-5b-fix-pdwn-gpio-for-imx415.patch b/linux/rockchip-5.10/0021-rock-5b/0017-arm64-dts-rockchip-rock-5b-fix-pdwn-gpio-for-imx415.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0017-arm64-dts-rockchip-rock-5b-fix-pdwn-gpio-for-imx415.patch rename to linux/rockchip-5.10/0021-rock-5b/0017-arm64-dts-rockchip-rock-5b-fix-pdwn-gpio-for-imx415.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0018-arm64-dts-rockchip-rock-5b-add-source-pdos-value-for.patch b/linux/rockchip-5.10/0021-rock-5b/0018-arm64-dts-rockchip-rock-5b-add-source-pdos-value-for.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0018-arm64-dts-rockchip-rock-5b-add-source-pdos-value-for.patch rename to linux/rockchip-5.10/0021-rock-5b/0018-arm64-dts-rockchip-rock-5b-add-source-pdos-value-for.patch diff --git a/forks/rockchip-5.10/0021-rock-5b/0019-arm64-dts-rockchip-rock-5b-add-wifi-bt-gpio.patch b/linux/rockchip-5.10/0021-rock-5b/0019-arm64-dts-rockchip-rock-5b-add-wifi-bt-gpio.patch similarity index 100% rename from forks/rockchip-5.10/0021-rock-5b/0019-arm64-dts-rockchip-rock-5b-add-wifi-bt-gpio.patch rename to linux/rockchip-5.10/0021-rock-5b/0019-arm64-dts-rockchip-rock-5b-add-wifi-bt-gpio.patch diff --git a/forks/rockchip-5.10/0022-rockpi-4/0001-arm64-dts-rockchip-Fix-ROCK-Pi-4-Bluetooth-propertie.patch b/linux/rockchip-5.10/0022-rockpi-4/0001-arm64-dts-rockchip-Fix-ROCK-Pi-4-Bluetooth-propertie.patch similarity index 100% rename from forks/rockchip-5.10/0022-rockpi-4/0001-arm64-dts-rockchip-Fix-ROCK-Pi-4-Bluetooth-propertie.patch rename to linux/rockchip-5.10/0022-rockpi-4/0001-arm64-dts-rockchip-Fix-ROCK-Pi-4-Bluetooth-propertie.patch diff --git a/forks/rockchip-5.10/0022-rockpi-4/0002-arm64-dts-rockchip-add-led-for-ROCK-Pi-4.patch b/linux/rockchip-5.10/0022-rockpi-4/0002-arm64-dts-rockchip-add-led-for-ROCK-Pi-4.patch similarity index 100% rename from forks/rockchip-5.10/0022-rockpi-4/0002-arm64-dts-rockchip-add-led-for-ROCK-Pi-4.patch rename to linux/rockchip-5.10/0022-rockpi-4/0002-arm64-dts-rockchip-add-led-for-ROCK-Pi-4.patch diff --git a/forks/rockchip-5.10/0022-rockpi-4/0003-arm64-dts-set-emmc-max-frequency-to-150000000-for-RO.patch b/linux/rockchip-5.10/0022-rockpi-4/0003-arm64-dts-set-emmc-max-frequency-to-150000000-for-RO.patch similarity index 100% rename from forks/rockchip-5.10/0022-rockpi-4/0003-arm64-dts-set-emmc-max-frequency-to-150000000-for-RO.patch rename to linux/rockchip-5.10/0022-rockpi-4/0003-arm64-dts-set-emmc-max-frequency-to-150000000-for-RO.patch diff --git a/forks/rockchip-5.10/0022-rockpi-4/0004-arm64-dts-rockchip-Move-USB-Host-enable-on-ROCK-Pi-4.patch b/linux/rockchip-5.10/0022-rockpi-4/0004-arm64-dts-rockchip-Move-USB-Host-enable-on-ROCK-Pi-4.patch similarity index 100% rename from forks/rockchip-5.10/0022-rockpi-4/0004-arm64-dts-rockchip-Move-USB-Host-enable-on-ROCK-Pi-4.patch rename to linux/rockchip-5.10/0022-rockpi-4/0004-arm64-dts-rockchip-Move-USB-Host-enable-on-ROCK-Pi-4.patch diff --git a/forks/rockchip-5.10/0022-rockpi-4/0005-arm64-dts-rockchip-rock-pi-4-delete-chosen-node.patch b/linux/rockchip-5.10/0022-rockpi-4/0005-arm64-dts-rockchip-rock-pi-4-delete-chosen-node.patch similarity index 100% rename from forks/rockchip-5.10/0022-rockpi-4/0005-arm64-dts-rockchip-rock-pi-4-delete-chosen-node.patch rename to linux/rockchip-5.10/0022-rockpi-4/0005-arm64-dts-rockchip-rock-pi-4-delete-chosen-node.patch diff --git a/forks/rockchip-5.10/0022-rockpi-4/0006-arm64-dts-rockchip-rock-pi-4-fix-kernel-panic.patch b/linux/rockchip-5.10/0022-rockpi-4/0006-arm64-dts-rockchip-rock-pi-4-fix-kernel-panic.patch similarity index 100% rename from forks/rockchip-5.10/0022-rockpi-4/0006-arm64-dts-rockchip-rock-pi-4-fix-kernel-panic.patch rename to linux/rockchip-5.10/0022-rockpi-4/0006-arm64-dts-rockchip-rock-pi-4-fix-kernel-panic.patch diff --git a/forks/rockchip-5.10/0022-rockpi-4/0007-arm64-dts-rockchip-enable-es8316-audio-for-ROCK-Pi-4.patch b/linux/rockchip-5.10/0022-rockpi-4/0007-arm64-dts-rockchip-enable-es8316-audio-for-ROCK-Pi-4.patch similarity index 100% rename from forks/rockchip-5.10/0022-rockpi-4/0007-arm64-dts-rockchip-enable-es8316-audio-for-ROCK-Pi-4.patch rename to linux/rockchip-5.10/0022-rockpi-4/0007-arm64-dts-rockchip-enable-es8316-audio-for-ROCK-Pi-4.patch diff --git a/forks/rockchip-5.10/0022-rockpi-4/0008-arm64-dts-rockchip-fix-hdmi-for-ROCK-Pi-4.patch b/linux/rockchip-5.10/0022-rockpi-4/0008-arm64-dts-rockchip-fix-hdmi-for-ROCK-Pi-4.patch similarity index 100% rename from forks/rockchip-5.10/0022-rockpi-4/0008-arm64-dts-rockchip-fix-hdmi-for-ROCK-Pi-4.patch rename to linux/rockchip-5.10/0022-rockpi-4/0008-arm64-dts-rockchip-fix-hdmi-for-ROCK-Pi-4.patch diff --git a/forks/rockchip-5.10/0023-radxa-nx5/0001-arm64-dts-rockchip-add-radxa-nx5-board.patch b/linux/rockchip-5.10/0023-radxa-nx5/0001-arm64-dts-rockchip-add-radxa-nx5-board.patch similarity index 100% rename from forks/rockchip-5.10/0023-radxa-nx5/0001-arm64-dts-rockchip-add-radxa-nx5-board.patch rename to linux/rockchip-5.10/0023-radxa-nx5/0001-arm64-dts-rockchip-add-radxa-nx5-board.patch diff --git a/forks/rockchip-5.10/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch b/linux/rockchip-5.10/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch similarity index 100% rename from forks/rockchip-5.10/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch rename to linux/rockchip-5.10/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch diff --git a/forks/rockchip-5.10/0100-vendor/0002-Fix-Wmisleading-indentation.patch b/linux/rockchip-5.10/0100-vendor/0002-Fix-Wmisleading-indentation.patch similarity index 100% rename from forks/rockchip-5.10/0100-vendor/0002-Fix-Wmisleading-indentation.patch rename to linux/rockchip-5.10/0100-vendor/0002-Fix-Wmisleading-indentation.patch diff --git a/forks/rockchip-5.10/0100-vendor/0003-Fix-dangling-pointer-compiler-bug.patch b/linux/rockchip-5.10/0100-vendor/0003-Fix-dangling-pointer-compiler-bug.patch similarity index 100% rename from forks/rockchip-5.10/0100-vendor/0003-Fix-dangling-pointer-compiler-bug.patch rename to linux/rockchip-5.10/0100-vendor/0003-Fix-dangling-pointer-compiler-bug.patch diff --git a/linux/rockchip-5.10/fork.conf b/linux/rockchip-5.10/fork.conf new file mode 100644 index 00000000..9bf9566c --- /dev/null +++ b/linux/rockchip-5.10/fork.conf @@ -0,0 +1,4 @@ +BSP_GIT="https://github.com/radxa-repo/kernel.git" +BSP_COMMIT="3bc3f4a8b10ab7518a609095652cc65f0a2813e6" +BSP_DEFCONFIG="rockchip_linux_defconfig" +SUPPORTED_BOARDS=("rockchip-5.10" "rock-5a" "rock-5b" "radxa-nx5") \ No newline at end of file diff --git a/forks/rockchip-5.10/kconfig.conf b/linux/rockchip-5.10/kconfig.conf similarity index 100% rename from forks/rockchip-5.10/kconfig.conf rename to linux/rockchip-5.10/kconfig.conf diff --git a/forks/latest/overlays.sh b/linux/rockchip-5.10/overlays.sh similarity index 63% rename from forks/latest/overlays.sh rename to linux/rockchip-5.10/overlays.sh index 3fae3247..3cc4f79a 100644 --- a/forks/latest/overlays.sh +++ b/linux/rockchip-5.10/overlays.sh @@ -1,4 +1,4 @@ custom_source_action() { git_source https://github.com/radxa/overlays.git - cp -r $SRC_DIR/overlays/arch $LINUX_DIR + cp -r $SRC_DIR/overlays/arch $TARGET_DIR } \ No newline at end of file diff --git a/forks/rockchip-5.10/rtl8852bu.sh b/linux/rockchip-5.10/rtl8852bu.sh similarity index 52% rename from forks/rockchip-5.10/rtl8852bu.sh rename to linux/rockchip-5.10/rtl8852bu.sh index 2b3f84d9..080851d9 100644 --- a/forks/rockchip-5.10/rtl8852bu.sh +++ b/linux/rockchip-5.10/rtl8852bu.sh @@ -1,6 +1,6 @@ custom_source_action() { git_source https://github.com/radxa/rtl8852bu.git git_source https://github.com/radxa/rtkbt.git - cp -r $SRC_DIR/rtl8852bu $LINUX_DIR/drivers/net/wireless - cp -r $SRC_DIR/rtkbt $LINUX_DIR/drivers/bluetooth + cp -r $SRC_DIR/rtl8852bu $TARGET_DIR/drivers/net/wireless + cp -r $SRC_DIR/rtkbt $TARGET_DIR/drivers/bluetooth } \ No newline at end of file diff --git a/forks/stable/0001-common b/linux/stable/0001-common similarity index 100% rename from forks/stable/0001-common rename to linux/stable/0001-common diff --git a/forks/stable/0010-backport/0001-scripts-dtc-Update-to-upstream-version-v1.6.0-51-g18.patch b/linux/stable/0010-backport/0001-scripts-dtc-Update-to-upstream-version-v1.6.0-51-g18.patch similarity index 100% rename from forks/stable/0010-backport/0001-scripts-dtc-Update-to-upstream-version-v1.6.0-51-g18.patch rename to linux/stable/0010-backport/0001-scripts-dtc-Update-to-upstream-version-v1.6.0-51-g18.patch diff --git a/forks/stable/0010-backport/0002-kbuild-Add-support-to-build-overlays-.dtbo.patch b/linux/stable/0010-backport/0002-kbuild-Add-support-to-build-overlays-.dtbo.patch similarity index 100% rename from forks/stable/0010-backport/0002-kbuild-Add-support-to-build-overlays-.dtbo.patch rename to linux/stable/0010-backport/0002-kbuild-Add-support-to-build-overlays-.dtbo.patch diff --git a/forks/stable/0010-backport/0003-usb-typec-tcpm-Pass-down-negotiated-rev-to-update-re.patch b/linux/stable/0010-backport/0003-usb-typec-tcpm-Pass-down-negotiated-rev-to-update-re.patch similarity index 100% rename from forks/stable/0010-backport/0003-usb-typec-tcpm-Pass-down-negotiated-rev-to-update-re.patch rename to linux/stable/0010-backport/0003-usb-typec-tcpm-Pass-down-negotiated-rev-to-update-re.patch diff --git a/forks/stable/0020-radxa-zero/0001-arm64-dts-amlogic-add-support-for-Radxa-Zero.patch b/linux/stable/0020-radxa-zero/0001-arm64-dts-amlogic-add-support-for-Radxa-Zero.patch similarity index 100% rename from forks/stable/0020-radxa-zero/0001-arm64-dts-amlogic-add-support-for-Radxa-Zero.patch rename to linux/stable/0020-radxa-zero/0001-arm64-dts-amlogic-add-support-for-Radxa-Zero.patch diff --git a/forks/stable/0020-radxa-zero/0002-arm64-configs-add-radxa_zero_defconfig.patch b/linux/stable/0020-radxa-zero/0002-arm64-configs-add-radxa_zero_defconfig.patch similarity index 100% rename from forks/stable/0020-radxa-zero/0002-arm64-configs-add-radxa_zero_defconfig.patch rename to linux/stable/0020-radxa-zero/0002-arm64-configs-add-radxa_zero_defconfig.patch diff --git a/forks/stable/0020-radxa-zero/0003-arm64-dts-Radxa-Zero-set-aliases-for-serial-and-i2c.patch b/linux/stable/0020-radxa-zero/0003-arm64-dts-Radxa-Zero-set-aliases-for-serial-and-i2c.patch similarity index 100% rename from forks/stable/0020-radxa-zero/0003-arm64-dts-Radxa-Zero-set-aliases-for-serial-and-i2c.patch rename to linux/stable/0020-radxa-zero/0003-arm64-dts-Radxa-Zero-set-aliases-for-serial-and-i2c.patch diff --git a/forks/stable/0020-radxa-zero/0004-arm64-dts-Radxa-Zero-set-aliases-for-spi.patch b/linux/stable/0020-radxa-zero/0004-arm64-dts-Radxa-Zero-set-aliases-for-spi.patch similarity index 100% rename from forks/stable/0020-radxa-zero/0004-arm64-dts-Radxa-Zero-set-aliases-for-spi.patch rename to linux/stable/0020-radxa-zero/0004-arm64-dts-Radxa-Zero-set-aliases-for-spi.patch diff --git a/forks/stable/0020-radxa-zero/0005-arm64-dts-amlogic-meson-g12-common-add-uart_AO_B-pin.patch b/linux/stable/0020-radxa-zero/0005-arm64-dts-amlogic-meson-g12-common-add-uart_AO_B-pin.patch similarity index 100% rename from forks/stable/0020-radxa-zero/0005-arm64-dts-amlogic-meson-g12-common-add-uart_AO_B-pin.patch rename to linux/stable/0020-radxa-zero/0005-arm64-dts-amlogic-meson-g12-common-add-uart_AO_B-pin.patch diff --git a/forks/stable/0020-radxa-zero/0006-arm64-dts-radxa-zero-set-dr_mode-of-usb-node-to-otg.patch b/linux/stable/0020-radxa-zero/0006-arm64-dts-radxa-zero-set-dr_mode-of-usb-node-to-otg.patch similarity index 100% rename from forks/stable/0020-radxa-zero/0006-arm64-dts-radxa-zero-set-dr_mode-of-usb-node-to-otg.patch rename to linux/stable/0020-radxa-zero/0006-arm64-dts-radxa-zero-set-dr_mode-of-usb-node-to-otg.patch diff --git a/forks/stable/0020-radxa-zero/0007-arm64-dts-radxa-zero-add-user-led.patch b/linux/stable/0020-radxa-zero/0007-arm64-dts-radxa-zero-add-user-led.patch similarity index 100% rename from forks/stable/0020-radxa-zero/0007-arm64-dts-radxa-zero-add-user-led.patch rename to linux/stable/0020-radxa-zero/0007-arm64-dts-radxa-zero-add-user-led.patch diff --git a/forks/stable/0020-radxa-zero/0008-revert-meson-drv-shutdown.patch b/linux/stable/0020-radxa-zero/0008-revert-meson-drv-shutdown.patch similarity index 100% rename from forks/stable/0020-radxa-zero/0008-revert-meson-drv-shutdown.patch rename to linux/stable/0020-radxa-zero/0008-revert-meson-drv-shutdown.patch diff --git a/forks/stable/0020-radxa-zero/0009-arm64-dts-meson-Reduce-Wi-Fi-SDIO-frequency.patch b/linux/stable/0020-radxa-zero/0009-arm64-dts-meson-Reduce-Wi-Fi-SDIO-frequency.patch similarity index 100% rename from forks/stable/0020-radxa-zero/0009-arm64-dts-meson-Reduce-Wi-Fi-SDIO-frequency.patch rename to linux/stable/0020-radxa-zero/0009-arm64-dts-meson-Reduce-Wi-Fi-SDIO-frequency.patch diff --git a/forks/stable/0020-radxa-zero/0010-VENDOR-make-Radxa-Zero-s-dts-closer-to-mainline.patch b/linux/stable/0020-radxa-zero/0010-VENDOR-make-Radxa-Zero-s-dts-closer-to-mainline.patch similarity index 100% rename from forks/stable/0020-radxa-zero/0010-VENDOR-make-Radxa-Zero-s-dts-closer-to-mainline.patch rename to linux/stable/0020-radxa-zero/0010-VENDOR-make-Radxa-Zero-s-dts-closer-to-mainline.patch diff --git a/forks/stable/0020-radxa-zero/0011-VENDOR-Radxa-Zero-Wi-Fi-fix.patch b/linux/stable/0020-radxa-zero/0011-VENDOR-Radxa-Zero-Wi-Fi-fix.patch similarity index 100% rename from forks/stable/0020-radxa-zero/0011-VENDOR-Radxa-Zero-Wi-Fi-fix.patch rename to linux/stable/0020-radxa-zero/0011-VENDOR-Radxa-Zero-Wi-Fi-fix.patch diff --git a/forks/stable/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch b/linux/stable/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch similarity index 100% rename from forks/stable/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch rename to linux/stable/0100-vendor/0001-VENDOR-Add-Radxa-overlays.patch diff --git a/forks/stable/0200-upstream/0001-arm64-dts-meson-radxa-zero-add-support-for-the-usb-t.patch b/linux/stable/0200-upstream/0001-arm64-dts-meson-radxa-zero-add-support-for-the-usb-t.patch similarity index 100% rename from forks/stable/0200-upstream/0001-arm64-dts-meson-radxa-zero-add-support-for-the-usb-t.patch rename to linux/stable/0200-upstream/0001-arm64-dts-meson-radxa-zero-add-support-for-the-usb-t.patch diff --git a/forks/stable/0200-upstream/0002-pinctrl-meson-Add-several-missing-pinmux-for-pwm-fun.patch b/linux/stable/0200-upstream/0002-pinctrl-meson-Add-several-missing-pinmux-for-pwm-fun.patch similarity index 100% rename from forks/stable/0200-upstream/0002-pinctrl-meson-Add-several-missing-pinmux-for-pwm-fun.patch rename to linux/stable/0200-upstream/0002-pinctrl-meson-Add-several-missing-pinmux-for-pwm-fun.patch diff --git a/forks/stable/0200-upstream/0003-dt-bindings-arm-amlogic-add-support-for-Radxa-Zero2.patch b/linux/stable/0200-upstream/0003-dt-bindings-arm-amlogic-add-support-for-Radxa-Zero2.patch similarity index 100% rename from forks/stable/0200-upstream/0003-dt-bindings-arm-amlogic-add-support-for-Radxa-Zero2.patch rename to linux/stable/0200-upstream/0003-dt-bindings-arm-amlogic-add-support-for-Radxa-Zero2.patch diff --git a/forks/stable/0200-upstream/0004-arm64-dts-meson-add-support-for-Radxa-Zero2.patch b/linux/stable/0200-upstream/0004-arm64-dts-meson-add-support-for-Radxa-Zero2.patch similarity index 100% rename from forks/stable/0200-upstream/0004-arm64-dts-meson-add-support-for-Radxa-Zero2.patch rename to linux/stable/0200-upstream/0004-arm64-dts-meson-add-support-for-Radxa-Zero2.patch diff --git a/linux/stable/fork.conf b/linux/stable/fork.conf new file mode 100644 index 00000000..128ea924 --- /dev/null +++ b/linux/stable/fork.conf @@ -0,0 +1,4 @@ +BSP_GIT="https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux.git" +BSP_TAG="v5.10.129" +BSP_DEFCONFIG="radxa_zero_defconfig" +SUPPORTED_BOARDS=("stable" "radxa-zero" "radxa-zero2") \ No newline at end of file diff --git a/forks/stable/overlays.sh b/linux/stable/overlays.sh similarity index 63% rename from forks/stable/overlays.sh rename to linux/stable/overlays.sh index 3fae3247..3cc4f79a 100644 --- a/forks/stable/overlays.sh +++ b/linux/stable/overlays.sh @@ -1,4 +1,4 @@ custom_source_action() { git_source https://github.com/radxa/overlays.git - cp -r $SRC_DIR/overlays/arch $LINUX_DIR + cp -r $SRC_DIR/overlays/arch $TARGET_DIR } \ No newline at end of file diff --git a/u-boot/.amlogic/0001-HACK-mmc-meson-gx-limit-to-24MHz.patch b/u-boot/.amlogic/0001-HACK-mmc-meson-gx-limit-to-24MHz.patch new file mode 100644 index 00000000..a0bdf25a --- /dev/null +++ b/u-boot/.amlogic/0001-HACK-mmc-meson-gx-limit-to-24MHz.patch @@ -0,0 +1,27 @@ +From ff82d04354784cd982ab1a912c08d3eb22f82d13 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Neil Armstrong +Date: Mon, 2 Sep 2019 15:42:04 +0200 +Subject: [PATCH] HACK: mmc: meson-gx: limit to 24MHz + +Signed-off-by: Neil Armstrong +--- + drivers/mmc/meson_gx_mmc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c +index fcf4f03d1e..6ded4b619b 100644 +--- a/drivers/mmc/meson_gx_mmc.c ++++ b/drivers/mmc/meson_gx_mmc.c +@@ -279,7 +279,7 @@ static int meson_mmc_probe(struct udevice *dev) + cfg->host_caps = MMC_MODE_8BIT | MMC_MODE_4BIT | + MMC_MODE_HS_52MHz | MMC_MODE_HS; + cfg->f_min = DIV_ROUND_UP(SD_EMMC_CLKSRC_24M, CLK_MAX_DIV); +- cfg->f_max = 100000000; /* 100 MHz */ ++ cfg->f_max = SD_EMMC_CLKSRC_24M; + cfg->b_max = 511; /* max 512 - 1 blocks */ + cfg->name = dev->name; + +-- +2.33.0 + diff --git a/u-boot/.amlogic/fip.sh b/u-boot/.amlogic/fip.sh new file mode 100644 index 00000000..382c0872 --- /dev/null +++ b/u-boot/.amlogic/fip.sh @@ -0,0 +1,3 @@ +custom_source_action() { + git_source "https://github.com/radxa/fip.git" +} \ No newline at end of file diff --git a/u-boot/.common/kconfig.conf b/u-boot/.common/kconfig.conf new file mode 100644 index 00000000..92019abb --- /dev/null +++ b/u-boot/.common/kconfig.conf @@ -0,0 +1,52 @@ +## Normal U-Boot +CONFIG_BOOTCOMMAND="run distro_bootcmd; env set serial# RADXA; echo Enter fastboot mode. Press Ctrl+C to stop...; fastboot usb 1; echo Enter ums mode. Press Ctrl+C to stop...; ums 1 mmc 2;" +## radxa-zero-erase-emmc +# CONFIG_BOOTDELAY=0 +# CONFIG_BOOTCOMMAND="mmc dev 2 0; mmc erase 0 20000; mmc dev 2 1; mmc erase 0 2000; mmc dev 2 2; mmc erase 0 2000; mbr write mmc 2 'size=-,id=0x83'; echo Enter ums mode. Press Ctrl+C to stop...; ums 1 mmc 2;" +## rz-udisk-loader +# CONFIG_BOOTDELAY=0 +# CONFIG_BOOTCOMMAND="echo Enter ums mode. Press Ctrl+C to stop...; ums 1 mmc 2;" +## rz-fastboot-loader +# CONFIG_BOOTDELAY=0 +# CONFIG_BOOTCOMMAND="env set serial# RADXA; echo Enter fastboot mode. Press Ctrl+C to stop...; fastboot usb 1;" + +## Enable USB keyboard +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="usb start" + +## Add partition table tools +CONFIG_CMD_MBR=y +CONFIG_CMD_GPT=y + +## Enable fastboot +CONFIG_CMD_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x13000000 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=2 +CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y +CONFIG_FASTBOOT_MMC_USER_SUPPORT=y +CONFIG_USB_FUNCTION_FASTBOOT=y + +## Enable fdt overlay +CONFIG_OF_LIBFDT_OVERLAY=y + +## Enable SPI boot +CONFIG_ROCKCHIP_SPI=y +CONFIG_SPI_BOOT=y +CONFIG_SPI_FLASH_XTX=y +CONFIG_SPL_SPI=y +CONFIG_SPL_SPI_FLASH_SUPPORT=y +CONFIG_SPL_SPI_SUPPORT=y +CONFIG_SPL_SPI_LOAD=y + +## Enable NVMe boot +CONFIG_CMD_NVME=y + +## Enable UMS command +CONFIG_CMD_USB_MASS_STORAGE=y + +## Enable hardware commands +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPIO_READ=y +CONFIG_CMD_PWM=y \ No newline at end of file diff --git a/u-boot/.rockchip/atf.sh b/u-boot/.rockchip/atf.sh new file mode 100644 index 00000000..32b75c78 --- /dev/null +++ b/u-boot/.rockchip/atf.sh @@ -0,0 +1,3 @@ +custom_source_action() { + git_source "https://github.com/ARM-software/arm-trusted-firmware.git" "v2.7.0" +} \ No newline at end of file diff --git a/u-boot/.rockchip/rkbin.sh b/u-boot/.rockchip/rkbin.sh new file mode 100644 index 00000000..0703168e --- /dev/null +++ b/u-boot/.rockchip/rkbin.sh @@ -0,0 +1,3 @@ +custom_source_action() { + git_source "https://github.com/radxa/rkbin.git" +} \ No newline at end of file diff --git a/u-boot/latest/0001-common b/u-boot/latest/0001-common new file mode 120000 index 00000000..d2afe44c --- /dev/null +++ b/u-boot/latest/0001-common @@ -0,0 +1 @@ +../.common \ No newline at end of file diff --git a/u-boot/latest/0002-amlogic b/u-boot/latest/0002-amlogic new file mode 120000 index 00000000..2c3e7f61 --- /dev/null +++ b/u-boot/latest/0002-amlogic @@ -0,0 +1 @@ +../.amlogic \ No newline at end of file diff --git a/u-boot/latest/0003-rockchip b/u-boot/latest/0003-rockchip new file mode 120000 index 00000000..996195bf --- /dev/null +++ b/u-boot/latest/0003-rockchip @@ -0,0 +1 @@ +../.rockchip \ No newline at end of file diff --git a/u-boot/latest/0020-radxa-zero2/0001-WIP-ARM-dts-add-support-for-Radxa-Zero2.patch b/u-boot/latest/0020-radxa-zero2/0001-WIP-ARM-dts-add-support-for-Radxa-Zero2.patch new file mode 100644 index 00000000..60afa8dc --- /dev/null +++ b/u-boot/latest/0020-radxa-zero2/0001-WIP-ARM-dts-add-support-for-Radxa-Zero2.patch @@ -0,0 +1,625 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Sat, 15 Jan 2022 06:17:23 +0000 +Subject: [PATCH] WIP: ARM: dts: add support for Radxa Zero2 + +Import the initial dts (WIP) from chewitt/amlogic-5.16.y + +Signed-off-by: Christian Hewitt +Signed-off-by: Yuntian Zhang +--- + arch/arm/dts/Makefile | 1 + + .../dts/meson-g12b-radxa-zero2-u-boot.dtsi | 7 + + arch/arm/dts/meson-g12b-radxa-zero2.dts | 574 ++++++++++++++++++ + 3 files changed, 582 insertions(+) + create mode 100644 arch/arm/dts/meson-g12b-radxa-zero2-u-boot.dtsi + create mode 100644 arch/arm/dts/meson-g12b-radxa-zero2.dts + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index c752d2bd18..44241fafee 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -194,6 +194,7 @@ dtb-$(CONFIG_ARCH_MESON) += \ + meson-g12b-gsking-x.dtb \ + meson-g12b-odroid-n2.dtb \ + meson-g12b-odroid-n2-plus.dtb \ ++ meson-g12b-radxa-zero2.dtb \ + meson-sm1-bananapi-m5.dtb \ + meson-sm1-khadas-vim3l.dtb \ + meson-sm1-odroid-c4.dtb \ +diff --git a/arch/arm/dts/meson-g12b-radxa-zero2-u-boot.dtsi b/arch/arm/dts/meson-g12b-radxa-zero2-u-boot.dtsi +new file mode 100644 +index 0000000000..236f2468dc +--- /dev/null ++++ b/arch/arm/dts/meson-g12b-radxa-zero2-u-boot.dtsi +@@ -0,0 +1,7 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2019 BayLibre, SAS. ++ * Author: Neil Armstrong ++ */ ++ ++#include "meson-g12-common-u-boot.dtsi" +diff --git a/arch/arm/dts/meson-g12b-radxa-zero2.dts b/arch/arm/dts/meson-g12b-radxa-zero2.dts +new file mode 100644 +index 0000000000..f0c9ef8592 +--- /dev/null ++++ b/arch/arm/dts/meson-g12b-radxa-zero2.dts +@@ -0,0 +1,574 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2019 BayLibre, SAS ++ * Author: Neil Armstrong ++ * Copyright (c) 2019 Christian Hewitt ++ * Copyright (c) 2022 Radxa Limited ++ * Author: Yuntian Zhang ++ */ ++ ++/dts-v1/; ++ ++#include "meson-g12b-a311d.dtsi" ++#include ++#include ++#include ++#include ++ ++/ { ++ compatible = "radxa,zero2", "amlogic,a311d", "amlogic,g12b"; ++ model = "Radxa Zero2"; ++ ++ aliases { ++ serial0 = &uart_AO; ++ serial2 = &uart_A; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ fan0: pwm-fan { ++ compatible = "pwm-fan"; ++ #cooling-cells = <2>; ++ cooling-min-state = <0>; ++ cooling-max-state = <3>; ++ cooling-levels = <0 120 170 220>; ++ pwms = <&pwm_AO_ab 0 40000 0>; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0x80000000>; ++ }; ++ ++ gpio-keys-polled { ++ compatible = "gpio-keys-polled"; ++ poll-interval = <100>; ++ power-button { ++ label = "power"; ++ linux,code = ; ++ gpios = <&gpio_ao GPIOAO_3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-green { ++ color = ; ++ function = LED_FUNCTION_STATUS; ++ gpios = <&gpio GPIOA_12 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++ ++ cvbs-connector { ++ status = "disabled"; ++ compatible = "composite-video-connector"; ++ ++ port { ++ cvbs_connector_in: endpoint { ++ remote-endpoint = <&cvbs_vdac_out>; ++ }; ++ }; ++ }; ++ ++ hdmi-connector { ++ compatible = "hdmi-connector"; ++ type = "a"; ++ ++ port { ++ hdmi_connector_in: endpoint { ++ remote-endpoint = <&hdmi_tx_tmds_out>; ++ }; ++ }; ++ }; ++ ++ emmc_pwrseq: emmc-pwrseq { ++ compatible = "mmc-pwrseq-emmc"; ++ reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; ++ }; ++ ++ sdio_pwrseq: sdio-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; ++ clocks = <&wifi32k>; ++ clock-names = "ext_clock"; ++ }; ++ ++ typec2_vbus: regulator-typec2_vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "TYPEC2_VBUS"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&ao_5v>; ++ }; ++ ++ ao_5v: regulator-ao_5v { ++ compatible = "regulator-fixed"; ++ regulator-name = "AO_5V"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ }; ++ ++ vcc_1v8: regulator-vcc_1v8 { ++ compatible = "regulator-fixed"; ++ regulator-name = "VCC_1V8"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc_3v3>; ++ regulator-always-on; ++ }; ++ ++ vcc_3v3: regulator-vcc_3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "VCC_3V3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vddao_3v3>; ++ regulator-always-on; ++ /* FIXME: actually controlled by VDDCPU_B_EN */ ++ }; ++ ++ vddao_1v8: regulator-vddao_1v8 { ++ compatible = "regulator-fixed"; ++ regulator-name = "VDDIO_AO1V8"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vddao_3v3>; ++ regulator-always-on; ++ }; ++ ++ vddao_3v3: regulator-vddao_3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "VDDAO_3V3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&ao_5v>; ++ regulator-always-on; ++ }; ++ ++ vddcpu_a: regulator-vddcpu-a { ++ /* ++ * MP8756GD Regulator. ++ */ ++ compatible = "pwm-regulator"; ++ ++ regulator-name = "VDDCPU_A"; ++ regulator-min-microvolt = <730000>; ++ regulator-max-microvolt = <1022000>; ++ ++ pwm-supply = <&ao_5v>; ++ ++ pwms = <&pwm_ab 0 1250 0>; ++ pwm-dutycycle-range = <100 0>; ++ ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++ ++ vddcpu_b: regulator-vddcpu-b { ++ /* ++ * Silergy SY8120B1ABC Regulator. ++ */ ++ compatible = "pwm-regulator"; ++ ++ regulator-name = "VDDCPU_B"; ++ regulator-min-microvolt = <730000>; ++ regulator-max-microvolt = <1022000>; ++ ++ pwm-supply = <&ao_5v>; ++ ++ pwms = <&pwm_AO_cd 1 1250 0>; ++ pwm-dutycycle-range = <100 0>; ++ ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++ ++ sound { ++ compatible = "amlogic,axg-sound-card"; ++ model = "RADXA-ZERO2"; ++ audio-aux-devs = <&tdmout_b>; ++ audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", ++ "TDMOUT_B IN 1", "FRDDR_B OUT 1", ++ "TDMOUT_B IN 2", "FRDDR_C OUT 1", ++ "TDM_B Playback", "TDMOUT_B OUT"; ++ ++ assigned-clocks = <&clkc CLKID_MPLL2>, ++ <&clkc CLKID_MPLL0>, ++ <&clkc CLKID_MPLL1>; ++ assigned-clock-parents = <0>, <0>, <0>; ++ assigned-clock-rates = <294912000>, ++ <270950400>, ++ <393216000>; ++ status = "okay"; ++ ++ dai-link-0 { ++ sound-dai = <&frddr_a>; ++ }; ++ ++ dai-link-1 { ++ sound-dai = <&frddr_b>; ++ }; ++ ++ dai-link-2 { ++ sound-dai = <&frddr_c>; ++ }; ++ ++ /* 8ch hdmi interface */ ++ dai-link-3 { ++ sound-dai = <&tdmif_b>; ++ dai-format = "i2s"; ++ dai-tdm-slot-tx-mask-0 = <1 1>; ++ dai-tdm-slot-tx-mask-1 = <1 1>; ++ dai-tdm-slot-tx-mask-2 = <1 1>; ++ dai-tdm-slot-tx-mask-3 = <1 1>; ++ mclk-fs = <256>; ++ ++ codec { ++ sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>; ++ }; ++ }; ++ ++ /* hdmi glue */ ++ dai-link-4 { ++ sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; ++ ++ codec { ++ sound-dai = <&hdmi_tx>; ++ }; ++ }; ++ }; ++ ++ wifi32k: wifi32k { ++ compatible = "pwm-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <32768>; ++ pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */ ++ }; ++}; ++ ++&periphs_pinctrl { ++ /* Ensure the TYPE C controller irq pin is not driven by the SoC */ ++ fusb302_irq_pins: fusb302_irq { ++ mux { ++ groups = "GPIOA_4"; ++ function = "gpio_periphs"; ++ bias-pull-up; ++ output-disable; ++ }; ++ }; ++}; ++ ++&arb { ++ status = "okay"; ++}; ++ ++&cec_AO { ++ pinctrl-0 = <&cec_ao_a_h_pins>; ++ pinctrl-names = "default"; ++ status = "disabled"; ++ hdmi-phandle = <&hdmi_tx>; ++}; ++ ++&cecb_AO { ++ pinctrl-0 = <&cec_ao_b_h_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ hdmi-phandle = <&hdmi_tx>; ++}; ++ ++&clkc_audio { ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vddcpu_b>; ++ operating-points-v2 = <&cpu_opp_table_0>; ++ clocks = <&clkc CLKID_CPU_CLK>; ++ clock-latency = <50000>; ++}; ++ ++&cpu1 { ++ cpu-supply = <&vddcpu_b>; ++ operating-points-v2 = <&cpu_opp_table_0>; ++ clocks = <&clkc CLKID_CPU_CLK>; ++ clock-latency = <50000>; ++}; ++ ++&cpu100 { ++ cpu-supply = <&vddcpu_a>; ++ operating-points-v2 = <&cpub_opp_table_1>; ++ clocks = <&clkc CLKID_CPUB_CLK>; ++ clock-latency = <50000>; ++}; ++ ++&cpu101 { ++ cpu-supply = <&vddcpu_a>; ++ operating-points-v2 = <&cpub_opp_table_1>; ++ clocks = <&clkc CLKID_CPUB_CLK>; ++ clock-latency = <50000>; ++}; ++ ++&cpu102 { ++ cpu-supply = <&vddcpu_a>; ++ operating-points-v2 = <&cpub_opp_table_1>; ++ clocks = <&clkc CLKID_CPUB_CLK>; ++ clock-latency = <50000>; ++}; ++ ++&cpu103 { ++ cpu-supply = <&vddcpu_a>; ++ operating-points-v2 = <&cpub_opp_table_1>; ++ clocks = <&clkc CLKID_CPUB_CLK>; ++ clock-latency = <50000>; ++}; ++ ++&cvbs_vdac_port { ++ cvbs_vdac_out: endpoint { ++ remote-endpoint = <&cvbs_connector_in>; ++ }; ++}; ++ ++&frddr_a { ++ status = "okay"; ++}; ++ ++&frddr_b { ++ status = "okay"; ++}; ++ ++&frddr_c { ++ status = "okay"; ++}; ++ ++&gpio { ++ gpio-line-names = ++ /* GPIOZ */ ++ "PIN_27", "PIN_28", "PIN_7", "PIN_11", "PIN_13", "PIN_15", "PIN_18", "PIN_40", ++ "PIN_16", "PIN_22", "", "", "", "", "", "", ++ /* GPIOH */ ++ "", "", "", "", "PIN_19", "PIN_21", "PIN_24", "PIN_23", ++ "", ++ /* BOOT */ ++ "", "", "", "", "", "", "", "", ++ "", "", "", "", "EMMC_PWRSEQ", "", "", "", ++ /* GPIOC */ ++ "", "", "", "", "", "", "SD_CD", "PIN_36", ++ /* GPIOA */ ++ "PIN_32", "PIN_12", "PIN_35", "", "FUSB_IRQ", "PIN_38", "", "", ++ "", "", "", "", "LED_GREEN", "PIN_31", "PIN_3", "PIN_5", ++ /* GPIOX */ ++ "", "", "", "", "", "", "SDIO_PWRSEQ", "", ++ "", "", "", "", "", "", "", "", ++ "", "BT_SHUTDOWN", "", ""; ++}; ++ ++&gpio_ao { ++ gpio-line-names = ++ /* GPIOAO */ ++ "PIN_8", "PIN_10", "", "BTN_POWER", "", "", "", "PIN_29", ++ "PIN_33", "PIN_37", "", "FAN", ++ /* GPIOE */ ++ "", "", ""; ++}; ++ ++&hdmi_tx { ++ status = "okay"; ++ pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>; ++ pinctrl-names = "default"; ++ hdmi-supply = <&ao_5v>; ++}; ++ ++&hdmi_tx_tmds_port { ++ hdmi_tx_tmds_out: endpoint { ++ remote-endpoint = <&hdmi_connector_in>; ++ }; ++}; ++ ++&cpu_thermal { ++ cooling-maps { ++ map0 { ++ trip = <&cpu_passive>; ++ cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; ++ }; ++ }; ++}; ++ ++&ddr_thermal { ++ cooling-maps { ++ map0 { ++ trip = <&ddr_passive>; ++ cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; ++ }; ++ }; ++}; ++ ++&ir { ++ status = "disabled"; ++ pinctrl-0 = <&remote_input_ao_pins>; ++ pinctrl-names = "default"; ++}; ++ ++&i2c3 { ++ fusb302@22 { ++ compatible = "fcs,fusb302"; ++ reg = <0x22>; ++ ++ pinctrl-0 = <&fusb302_irq_pins>; ++ pinctrl-names = "default"; ++ interrupt-parent = <&gpio_intc>; ++ interrupts = <59 IRQ_TYPE_LEVEL_LOW>; ++ ++ vbus-supply = <&typec2_vbus>; ++ ++ status = "okay"; ++ }; ++}; ++ ++&pwm_ab { ++ pinctrl-0 = <&pwm_a_e_pins>; ++ pinctrl-names = "default"; ++ clocks = <&xtal>; ++ clock-names = "clkin0"; ++ status = "okay"; ++}; ++ ++&pwm_ef { ++ pinctrl-0 = <&pwm_e_pins>; ++ pinctrl-names = "default"; ++ clocks = <&xtal>; ++ clock-names = "clkin2"; ++ status = "okay"; ++}; ++ ++&pwm_AO_ab { ++ pinctrl-0 = <&pwm_ao_a_pins>; ++ pinctrl-names = "default"; ++ clocks = <&xtal>; ++ clock-names = "clkin3"; ++ status = "okay"; ++}; ++ ++&pwm_AO_cd { ++ pinctrl-0 = <&pwm_ao_d_e_pins>; ++ pinctrl-names = "default"; ++ clocks = <&xtal>; ++ clock-names = "clkin4"; ++ status = "okay"; ++}; ++ ++&saradc { ++ status = "okay"; ++ vref-supply = <&vddao_1v8>; ++}; ++ ++/* SDIO */ ++&sd_emmc_a { ++ status = "okay"; ++ pinctrl-0 = <&sdio_pins>; ++ pinctrl-1 = <&sdio_clk_gate_pins>; ++ pinctrl-names = "default", "clk-gate"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ bus-width = <4>; ++ cap-sd-highspeed; ++ max-frequency = <80000000>; ++ ++ non-removable; ++ disable-wp; ++ ++ /* WiFi firmware requires power to be kept while in suspend */ ++ keep-power-in-suspend; ++ ++ mmc-pwrseq = <&sdio_pwrseq>; ++ ++ vmmc-supply = <&vddao_3v3>; ++ vqmmc-supply = <&vddao_1v8>; ++ ++ brcmf: wifi@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ }; ++}; ++ ++/* SD card */ ++&sd_emmc_b { ++ status = "okay"; ++ pinctrl-0 = <&sdcard_c_pins>; ++ pinctrl-1 = <&sdcard_clk_gate_c_pins>; ++ pinctrl-names = "default", "clk-gate"; ++ ++ bus-width = <4>; ++ cap-sd-highspeed; ++ max-frequency = <50000000>; ++ disable-wp; ++ ++ cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; ++ vmmc-supply = <&vddao_3v3>; ++ vqmmc-supply = <&vddao_3v3>; ++}; ++ ++/* eMMC */ ++&sd_emmc_c { ++ status = "okay"; ++ pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>; ++ pinctrl-1 = <&emmc_clk_gate_pins>; ++ pinctrl-names = "default", "clk-gate"; ++ ++ bus-width = <8>; ++ cap-mmc-highspeed; ++ mmc-ddr-1_8v; ++ mmc-hs200-1_8v; ++ max-frequency = <200000000>; ++ disable-wp; ++ ++ mmc-pwrseq = <&emmc_pwrseq>; ++ vmmc-supply = <&vcc_3v3>; ++ vqmmc-supply = <&vcc_1v8>; ++}; ++ ++&tdmif_b { ++ status = "okay"; ++}; ++ ++&tdmout_b { ++ status = "okay"; ++}; ++ ++&tohdmitx { ++ status = "okay"; ++}; ++ ++&uart_A { ++ status = "okay"; ++ pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; ++ pinctrl-names = "default"; ++ uart-has-rtscts; ++ ++ bluetooth { ++ compatible = "brcm,bcm43438-bt"; ++ shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; ++ max-speed = <2000000>; ++ clocks = <&wifi32k>; ++ clock-names = "lpo"; ++ }; ++}; ++ ++&uart_AO { ++ status = "okay"; ++ pinctrl-0 = <&uart_ao_a_pins>; ++ pinctrl-names = "default"; ++}; ++ ++&usb { ++ status = "okay"; ++}; ++ ++&usb3_pcie_phy { ++ phy-supply = <&typec2_vbus>; ++}; +-- +2.35.1 + diff --git a/u-boot/latest/0020-radxa-zero2/0002-WIP-boards-amlogic-add-Radxa-Zero2-defconfig.patch b/u-boot/latest/0020-radxa-zero2/0002-WIP-boards-amlogic-add-Radxa-Zero2-defconfig.patch new file mode 100644 index 00000000..149b3ffd --- /dev/null +++ b/u-boot/latest/0020-radxa-zero2/0002-WIP-boards-amlogic-add-Radxa-Zero2-defconfig.patch @@ -0,0 +1,109 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Sat, 15 Jan 2022 06:23:29 +0000 +Subject: [PATCH] WIP: boards: amlogic: add Radxa Zero2 defconfig + +Add a defconfig for the Radxa Zero2 SBC, using an Amlogic A311D chip. + +Signed-off-by: Christian Hewitt +Signed-off-by: Yuntian Zhang +--- + board/amlogic/w400/MAINTAINERS | 1 + + configs/radxa-zero2_defconfig | 75 ++++++++++++++++++++++++++++++++++ + 2 files changed, 76 insertions(+) + create mode 100644 configs/radxa-zero2_defconfig + +diff --git a/board/amlogic/w400/MAINTAINERS b/board/amlogic/w400/MAINTAINERS +index 991590d9f2..8587f67b46 100644 +--- a/board/amlogic/w400/MAINTAINERS ++++ b/board/amlogic/w400/MAINTAINERS +@@ -3,4 +3,5 @@ M: Neil Armstrong + S: Maintained + L: u-boot-amlogic@groups.io + F: board/amlogic/w400/ ++F: configs/radxa-zero2_defconfig + F: doc/board/amlogic/w400.rst +diff --git a/configs/radxa-zero2_defconfig b/configs/radxa-zero2_defconfig +new file mode 100644 +index 0000000000..e9bd2a4f13 +--- /dev/null ++++ b/configs/radxa-zero2_defconfig +@@ -0,0 +1,75 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_MESON=y ++CONFIG_SYS_TEXT_BASE=0x01000000 ++CONFIG_SYS_LOAD_ADDR=0x1000000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_ENV_SIZE=0x2000 ++CONFIG_DM_GPIO=y ++CONFIG_DEFAULT_DEVICE_TREE="meson-g12b-radxa-zero2" ++CONFIG_USE_PREBOOT=y ++CONFIG_PREBOOT="usb start" ++CONFIG_MESON_G12A=y ++CONFIG_DEBUG_UART_BASE=0xff803000 ++CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_IDENT_STRING=" radxa-zero2" ++CONFIG_DEBUG_UART=y ++CONFIG_OF_BOARD_SETUP=y ++# CONFIG_DISPLAY_CPUINFO is not set ++CONFIG_MISC_INIT_R=y ++# CONFIG_CMD_BDI is not set ++# CONFIG_CMD_IMI is not set ++# CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++# CONFIG_CMD_LOADS is not set ++CONFIG_CMD_MBR=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_USB=y ++CONFIG_CMD_USB_MASS_STORAGE=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_REGULATOR=y ++CONFIG_OF_CONTROL=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++# CONFIG_NET_RANDOM_ETHADDR is not set ++CONFIG_MMC_MESON_GX=y ++CONFIG_MTD=y ++CONFIG_DM_MTD=y ++CONFIG_DM_ETH=y ++# CONFIG_PHY_REALTEK is not set ++CONFIG_DM_MDIO=y ++CONFIG_DM_MDIO_MUX=y ++# CONFIG_ETH_DESIGNWARE_MESON8B is not set ++CONFIG_MDIO_MUX_MESON_G12A=y ++CONFIG_MESON_G12A_USB_PHY=y ++CONFIG_PINCTRL=y ++CONFIG_PINCTRL_MESON_G12A=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MESON_EE_POWER_DOMAIN=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_RESET=y ++CONFIG_DEBUG_UART_ANNOUNCE=y ++CONFIG_DEBUG_UART_SKIP_INIT=y ++CONFIG_MESON_SERIAL=y ++CONFIG_USB=y ++CONFIG_DM_USB=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_DWC3=y ++CONFIG_USB_DWC3=y ++# CONFIG_USB_DWC3_GADGET is not set ++CONFIG_USB_DWC3_MESON_G12A=y ++CONFIG_USB_KEYBOARD=y ++CONFIG_USB_GADGET=y ++CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e ++CONFIG_USB_GADGET_PRODUCT_NUM=0xfada ++CONFIG_USB_GADGET_DWC2_OTG=y ++CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y ++CONFIG_USB_GADGET_DOWNLOAD=y ++CONFIG_DM_VIDEO=y ++# CONFIG_VIDEO_BPP8 is not set ++# CONFIG_VIDEO_BPP16 is not set ++CONFIG_SYS_WHITE_ON_BLACK=y ++CONFIG_VIDEO_MESON=y ++CONFIG_VIDEO_DT_SIMPLEFB=y ++CONFIG_SPLASH_SCREEN=y ++CONFIG_SPLASH_SCREEN_ALIGN=y ++CONFIG_OF_LIBFDT_OVERLAY=y +-- +2.35.1 + diff --git a/u-boot/latest/0020-radxa-zero2/0003-WIP-doc-boards-amlogic-update-for-Radxa-Zero2.patch b/u-boot/latest/0020-radxa-zero2/0003-WIP-doc-boards-amlogic-update-for-Radxa-Zero2.patch new file mode 100644 index 00000000..da22b355 --- /dev/null +++ b/u-boot/latest/0020-radxa-zero2/0003-WIP-doc-boards-amlogic-update-for-Radxa-Zero2.patch @@ -0,0 +1,124 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Sat, 15 Jan 2022 06:35:47 +0000 +Subject: [PATCH] WIP: doc: boards: amlogic: update for Radxa Zero2 + +Add documentation bits for the Radxa Zero2 + +Signed-off-by: Christian Hewitt +Signed-off-by: Yuntian Zhang +--- + board/amlogic/w400/MAINTAINERS | 1 + + doc/board/amlogic/index.rst | 3 +- + .../{radxa-zero.rst => radxa-zero2.rst} | 29 ++++++++++--------- + 3 files changed, 18 insertions(+), 15 deletions(-) + rename doc/board/amlogic/{radxa-zero.rst => radxa-zero2.rst} (75%) + +diff --git a/board/amlogic/w400/MAINTAINERS b/board/amlogic/w400/MAINTAINERS +index 8587f67b46..d8f9d3bded 100644 +--- a/board/amlogic/w400/MAINTAINERS ++++ b/board/amlogic/w400/MAINTAINERS +@@ -5,3 +5,4 @@ L: u-boot-amlogic@groups.io + F: board/amlogic/w400/ + F: configs/radxa-zero2_defconfig + F: doc/board/amlogic/w400.rst ++F: doc/board/amlogic/radxa-zero2.rst +diff --git a/doc/board/amlogic/index.rst b/doc/board/amlogic/index.rst +index 189b1efe2b..8369f6f3d0 100644 +--- a/doc/board/amlogic/index.rst ++++ b/doc/board/amlogic/index.rst +@@ -19,7 +19,7 @@ This matrix concerns the actual source code version. + | | Nanopi-K2 | Khadas-VIM | Libretech-PC | JetHub J100 | SEI510 | Khadas-VIM3 | Khadas-VIM3L | + | | P200 | LibreTech-CC v1 | WeTek Core2 | | Radxa Zero | GT-King/Pro | Odroid-C4 | + | | P201 | LibreTech-AC v2 | | | | GSKing-X | Odroid-HC4 | +-| | | JetHub J80 | | | | | BananaPi-M5 | ++| | | JetHub J80 | | | | Radxa Zero2 | BananaPi-M5 | + +-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ + | UART | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | **Yes** | + +-------------------------------+-----------+-----------------+--------------+-------------+------------+-------------+--------------+ +@@ -99,6 +99,7 @@ Board Documentation + p212 + q200 + radxa-zero ++ radxa-zero2 + s400 + sei510 + sei610 +diff --git a/doc/board/amlogic/radxa-zero.rst b/doc/board/amlogic/radxa-zero2.rst +similarity index 75% +rename from doc/board/amlogic/radxa-zero.rst +rename to doc/board/amlogic/radxa-zero2.rst +index 423403f3c7..24bc1b0767 100644 +--- a/doc/board/amlogic/radxa-zero.rst ++++ b/doc/board/amlogic/radxa-zero2.rst +@@ -1,18 +1,17 @@ + .. SPDX-License-Identifier: GPL-2.0+ + +-U-Boot for Radxa Zero +-===================== ++U-Boot for Radxa Zero2 ++====================== + +-Radxa Zero is a small form factor SBC based on the Amlogic S905Y2 +-chipset that ships in a number of RAM/eMMC configurations: ++Radxa Zero2 is a small form factor SBC based on the Amlogic A311D ++chipset that ships in a number of eMMC configurations: + +-Boards with 512MB/1GB LPDDR4 RAM have no eMMC storage and BCM43436 +-wireless (2.4GHz b/g/n) while 2GB/4GB boards have 8/16/32/64/128GB +-eMMC storage and BCM4345 wireless (2.4/5GHz a/b/g/n/ac). +- +-- Amlogic S905Y2 quad-core Cortex-A53 +-- Mali G31-MP2 GPU ++- Amlogic A311D (Quad A73 + Dual A53) CPU ++- 4GB LPDDR4 RAM ++- 32/64/128GB eMMC ++- Mali G52-MP4 GPU + - HDMI 2.1 output (micro) ++- BCM4345 WiFi (2.4/5GHz a/b/g/n/ac) and BT 5.0 + - 1x USB 2.0 port - Type C (OTG) + - 1x USB 3.0 port - Type C (Host) + - 1x micro SD Card slot +@@ -20,6 +19,7 @@ eMMC storage and BCM4345 wireless (2.4/5GHz a/b/g/n/ac). + + Schematics are available on the manufacturer website: + ++** TO-DO ** (provide updated URL) + https://dl.radxa.com/zero/docs/hw/RADAX_ZERO_V13_SCH_20210309.pdf + + U-Boot compilation +@@ -28,7 +28,7 @@ U-Boot compilation + .. code-block:: bash + + $ export CROSS_COMPILE=aarch64-none-elf- +- $ make radxa-zero_defconfig ++ $ make radxa-zero2_defconfig + $ make + + Image creation +@@ -40,6 +40,7 @@ git trees published by the board vendor: + + .. code-block:: bash + ++ ** TO-DO ** UPDATE URLs + $ git clone -b radxa-zero-v2021.07 https://github.com/radxa/u-boot.git + $ git clone https://github.com/radxa/fip.git + +@@ -52,11 +53,11 @@ git trees published by the board vendor: + $ export CROSS_COMPILE=/opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/aarch64-none-elf- + $ export ARCH=arm + $ cd u-boot +- $ make radxa-zero_defconfig ++ $ make radxa-zero2_defconfig + $ make + +- $ cp u-boot.bin ../fip/radxa-zero/bl33.bin +- $ cd ../fip/radxa-zero ++ $ cp u-boot.bin ../fip/radxa-zero2/bl33.bin ++ $ cd ../fip/radxa-zero2 + $ make + + This will generate: +-- +2.35.1 + diff --git a/u-boot/latest/fork.conf b/u-boot/latest/fork.conf new file mode 100644 index 00000000..0daac1d6 --- /dev/null +++ b/u-boot/latest/fork.conf @@ -0,0 +1,27 @@ +BSP_GIT="https://github.com/u-boot/u-boot.git" +BSP_TAG="v2022.07" +BSP_MAKE_TARGETS="u-boot.dtb u-boot.itb all" +SUPPORTED_BOARDS=("radxa-zero" "radxa-zero2" "rockpi-4b" "rockpi-4c") + +bsp_radxa-zero() { + BSP_SOC="s905y2" +} + +bsp_radxa-zero2() { + BSP_SOC="a311d" +} + +bsp_rockpi-4() { + BSP_SOC="rk3399" + local UBUILD_BOARD_VARIANT="$1" + BSP_DEFCONFIG="rock-pi-4${UBUILD_BOARD_VARIANT}-${BSP_SOC}_defconfig" + RKBIN="rk3399_ddr_800MHz_v1.20" +} + +bsp_rockpi-4b() { + bsp_rockpi-4 +} + +bsp_rockpi-4c() { + bsp_rockpi-4 "c" +} \ No newline at end of file diff --git a/u-boot/rk3308/0001-common b/u-boot/rk3308/0001-common new file mode 120000 index 00000000..d2afe44c --- /dev/null +++ b/u-boot/rk3308/0001-common @@ -0,0 +1 @@ +../.common \ No newline at end of file diff --git a/u-boot/rk3308/0002-rockchip b/u-boot/rk3308/0002-rockchip new file mode 120000 index 00000000..996195bf --- /dev/null +++ b/u-boot/rk3308/0002-rockchip @@ -0,0 +1 @@ +../.rockchip \ No newline at end of file diff --git a/u-boot/rk3308/0100-vendor/0001-Fix-multiple-definition-of-yylloc.patch b/u-boot/rk3308/0100-vendor/0001-Fix-multiple-definition-of-yylloc.patch new file mode 100644 index 00000000..ef9b6bcc --- /dev/null +++ b/u-boot/rk3308/0100-vendor/0001-Fix-multiple-definition-of-yylloc.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yuntian Zhang +Date: Thu, 9 Jun 2022 16:46:21 +0800 +Subject: [PATCH] Fix multiple definition of yylloc + +Signed-off-by: Yuntian Zhang +--- + scripts/dtc/dtc-lexer.l | 2 +- + scripts/dtc/dtc-parser.tab.c_shipped | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l +index fd825ebba6..f57c9a7e83 100644 +--- a/scripts/dtc/dtc-lexer.l ++++ b/scripts/dtc/dtc-lexer.l +@@ -38,7 +38,7 @@ LINECOMMENT "//".*\n + #include "srcpos.h" + #include "dtc-parser.tab.h" + +-YYLTYPE yylloc; ++extern YYLTYPE yylloc; + extern bool treesource_error; + + /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ +diff --git a/scripts/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped +index aea514fa69..e70924a8ce 100644 +--- a/scripts/dtc/dtc-parser.tab.c_shipped ++++ b/scripts/dtc/dtc-parser.tab.c_shipped +@@ -1202,7 +1202,7 @@ int yychar; + /* The semantic value of the lookahead symbol. */ + YYSTYPE yylval; + /* Location data for the lookahead symbol. */ +-YYLTYPE yylloc ++extern YYLTYPE yylloc + # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + = { 1, 1, 1, 1 } + # endif +-- +2.36.1 + diff --git a/u-boot/rk3308/0100-vendor/0002-Fix-build-error.patch b/u-boot/rk3308/0100-vendor/0002-Fix-build-error.patch new file mode 100644 index 00000000..49a9f627 --- /dev/null +++ b/u-boot/rk3308/0100-vendor/0002-Fix-build-error.patch @@ -0,0 +1,54 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yuntian Zhang +Date: Fri, 22 Jul 2022 18:54:44 +0800 +Subject: [PATCH] Fix build error + +Signed-off-by: Yuntian Zhang +--- + Makefile | 1 + + arch/arm/mach-rockchip/resource_img.c | 3 +-- + scripts/Makefile.lib | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 7060da1c..cf3a4789 100644 +--- a/Makefile ++++ b/Makefile +@@ -605,6 +605,7 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-stack-usage.sh $(CC)),y) + endif + + KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral) ++KBUILD_CFLAGS += $(call cc-option,-Wno-address-of-packed-member) + + # turn jbsr into jsr for m68k + ifeq ($(ARCH),m68k) +diff --git a/arch/arm/mach-rockchip/resource_img.c b/arch/arm/mach-rockchip/resource_img.c +index 8f084628..08b8def7 100755 +--- a/arch/arm/mach-rockchip/resource_img.c ++++ b/arch/arm/mach-rockchip/resource_img.c +@@ -113,8 +113,7 @@ static int resource_image_check_header(const struct resource_img_hdr *hdr) + + ret = memcmp(RESOURCE_MAGIC, hdr->magic, RESOURCE_MAGIC_SIZE); + if (ret) { +- printf("bad resource image magic: %s\n", +- hdr->magic ? hdr->magic : "none"); ++ printf("bad resource image magic: %s\n", hdr->magic); + ret = -EINVAL; + } + debug("resource image header:\n"); +diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib +index 12d1123a..7daed6a4 100644 +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -308,7 +308,7 @@ quiet_cmd_dtc = DTC $@ + # Modified for U-Boot + # Bring in any U-Boot-specific include at the end of the file + cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ +- (cat $<; $(if $(u_boot_dtsi),echo '\#include "$(u_boot_dtsi)"')) > $(pre-tmp); \ ++ (cat $<; $(if $(u_boot_dtsi),echo '#include "$(u_boot_dtsi)"')) > $(pre-tmp); \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $(pre-tmp) ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ +-- +2.37.1 + diff --git a/u-boot/rk3308/fork.conf b/u-boot/rk3308/fork.conf new file mode 100644 index 00000000..4436e948 --- /dev/null +++ b/u-boot/rk3308/fork.conf @@ -0,0 +1,16 @@ +BSP_GIT="https://github.com/radxa/u-boot.git" +BSP_BRANCH="stable-4.4-rockpis" +RKBIN="rk3308_ddr_589MHz_uart0_m0_v" +NO_UBOOT_SPL="yes" +RKMINILOADER="rk3308_miniloader_v" +SUPPORTED_BOARDS=("rockpis" "rockpis-v2") + +bsp_rockpis() { + BSP_SOC="rk3308" + BSP_DEFCONFIG="rock-pi-s-rk3308_defconfig" +} + +bsp_rockpis-v2() { + BSP_SOC="rk3308" + BSP_DEFCONFIG="rock-pi-s-v20-rk3308_defconfig" +} \ No newline at end of file diff --git a/u-boot/rk3308/kconfig.conf b/u-boot/rk3308/kconfig.conf new file mode 100644 index 00000000..41eda7ab --- /dev/null +++ b/u-boot/rk3308/kconfig.conf @@ -0,0 +1 @@ +# CONFIG_SPL_SPI_LOAD is not set \ No newline at end of file diff --git a/u-boot/rk3328/0001-common b/u-boot/rk3328/0001-common new file mode 120000 index 00000000..d2afe44c --- /dev/null +++ b/u-boot/rk3328/0001-common @@ -0,0 +1 @@ +../.common \ No newline at end of file diff --git a/u-boot/rk3328/0002-rockchip b/u-boot/rk3328/0002-rockchip new file mode 120000 index 00000000..996195bf --- /dev/null +++ b/u-boot/rk3328/0002-rockchip @@ -0,0 +1 @@ +../.rockchip \ No newline at end of file diff --git a/u-boot/rk3328/0100-vendor/0001-Fix-multiple-definition-of-yylloc.patch b/u-boot/rk3328/0100-vendor/0001-Fix-multiple-definition-of-yylloc.patch new file mode 100644 index 00000000..8a58a6e9 --- /dev/null +++ b/u-boot/rk3328/0100-vendor/0001-Fix-multiple-definition-of-yylloc.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yuntian Zhang +Date: Thu, 9 Jun 2022 16:46:21 +0800 +Subject: [PATCH] Fix multiple definition of yylloc + +Signed-off-by: Yuntian Zhang +--- + scripts/dtc/dtc-lexer.l | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l +index fd825ebba6..f57c9a7e83 100644 +--- a/scripts/dtc/dtc-lexer.l ++++ b/scripts/dtc/dtc-lexer.l +@@ -38,7 +38,7 @@ LINECOMMENT "//".*\n + #include "srcpos.h" + #include "dtc-parser.tab.h" + +-YYLTYPE yylloc; ++extern YYLTYPE yylloc; + extern bool treesource_error; + + /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ +-- +2.36.1 + diff --git a/u-boot/rk3328/0100-vendor/0002-Fix-build-error.patch.ignore b/u-boot/rk3328/0100-vendor/0002-Fix-build-error.patch.ignore new file mode 100644 index 00000000..49a9f627 --- /dev/null +++ b/u-boot/rk3328/0100-vendor/0002-Fix-build-error.patch.ignore @@ -0,0 +1,54 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yuntian Zhang +Date: Fri, 22 Jul 2022 18:54:44 +0800 +Subject: [PATCH] Fix build error + +Signed-off-by: Yuntian Zhang +--- + Makefile | 1 + + arch/arm/mach-rockchip/resource_img.c | 3 +-- + scripts/Makefile.lib | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 7060da1c..cf3a4789 100644 +--- a/Makefile ++++ b/Makefile +@@ -605,6 +605,7 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-stack-usage.sh $(CC)),y) + endif + + KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral) ++KBUILD_CFLAGS += $(call cc-option,-Wno-address-of-packed-member) + + # turn jbsr into jsr for m68k + ifeq ($(ARCH),m68k) +diff --git a/arch/arm/mach-rockchip/resource_img.c b/arch/arm/mach-rockchip/resource_img.c +index 8f084628..08b8def7 100755 +--- a/arch/arm/mach-rockchip/resource_img.c ++++ b/arch/arm/mach-rockchip/resource_img.c +@@ -113,8 +113,7 @@ static int resource_image_check_header(const struct resource_img_hdr *hdr) + + ret = memcmp(RESOURCE_MAGIC, hdr->magic, RESOURCE_MAGIC_SIZE); + if (ret) { +- printf("bad resource image magic: %s\n", +- hdr->magic ? hdr->magic : "none"); ++ printf("bad resource image magic: %s\n", hdr->magic); + ret = -EINVAL; + } + debug("resource image header:\n"); +diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib +index 12d1123a..7daed6a4 100644 +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -308,7 +308,7 @@ quiet_cmd_dtc = DTC $@ + # Modified for U-Boot + # Bring in any U-Boot-specific include at the end of the file + cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ +- (cat $<; $(if $(u_boot_dtsi),echo '\#include "$(u_boot_dtsi)"')) > $(pre-tmp); \ ++ (cat $<; $(if $(u_boot_dtsi),echo '#include "$(u_boot_dtsi)"')) > $(pre-tmp); \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $(pre-tmp) ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ +-- +2.37.1 + diff --git a/u-boot/rk3328/fork.conf b/u-boot/rk3328/fork.conf new file mode 100644 index 00000000..62191a4f --- /dev/null +++ b/u-boot/rk3328/fork.conf @@ -0,0 +1,17 @@ +BSP_GIT="https://github.com/radxa/u-boot.git" +BSP_BRANCH="stable-4.4-rockpie" +RKBIN="rk3328_ddr_333MHz_v" +BSP_BL31_OVERRIDE="rk322xh" +NO_UBOOT_SPL="yes" +RKMINILOADER="rk322xh_miniloader_v" +SUPPORTED_BOARDS=("rockpie" "rockpie3") + +bsp_rockpie() { + BSP_SOC="rk3328" + BSP_DEFCONFIG="rock-pi-e-rk3328_defconfig" +} + +bsp_rockpie3() { + BSP_SOC="rk3328" + BSP_DEFCONFIG="rock-pi-e3-rk3328_defconfig" +} \ No newline at end of file diff --git a/u-boot/rk3328/kconfig.conf b/u-boot/rk3328/kconfig.conf new file mode 100644 index 00000000..41eda7ab --- /dev/null +++ b/u-boot/rk3328/kconfig.conf @@ -0,0 +1 @@ +# CONFIG_SPL_SPI_LOAD is not set \ No newline at end of file diff --git a/u-boot/rk356x/0001-common b/u-boot/rk356x/0001-common new file mode 120000 index 00000000..d2afe44c --- /dev/null +++ b/u-boot/rk356x/0001-common @@ -0,0 +1 @@ +../.common \ No newline at end of file diff --git a/u-boot/rk356x/0002-rockchip b/u-boot/rk356x/0002-rockchip new file mode 120000 index 00000000..996195bf --- /dev/null +++ b/u-boot/rk356x/0002-rockchip @@ -0,0 +1 @@ +../.rockchip \ No newline at end of file diff --git a/u-boot/rk356x/0100-vendor/0001-Fix-Werror-address.patch b/u-boot/rk356x/0100-vendor/0001-Fix-Werror-address.patch new file mode 100644 index 00000000..a2c47cb7 --- /dev/null +++ b/u-boot/rk356x/0100-vendor/0001-Fix-Werror-address.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yuntian Zhang +Date: Mon, 30 May 2022 15:09:48 +0800 +Subject: [PATCH] Fix -Werror=address + +Signed-off-by: Yuntian Zhang +--- + drivers/mmc/rockchip_dw_mmc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c +index 1287551bf1..a78cb39c7f 100644 +--- a/drivers/mmc/rockchip_dw_mmc.c ++++ b/drivers/mmc/rockchip_dw_mmc.c +@@ -42,7 +42,7 @@ int board_mmc_dm_reinit(struct udevice *dev) + { + struct rockchip_dwmmc_priv *priv = dev_get_priv(dev); + +- if (!priv || !&priv->clk) ++ if (!priv) + return 0; + + if (!memcmp(dev->name, "dwmmc", strlen("dwmmc"))) +-- +2.36.1 + diff --git a/u-boot/rk356x/fork.conf b/u-boot/rk356x/fork.conf new file mode 100644 index 00000000..90a7f47a --- /dev/null +++ b/u-boot/rk356x/fork.conf @@ -0,0 +1,34 @@ +BSP_SOC_OVERRIDE="rk3568" +BSP_GIT="https://github.com/radxa/u-boot.git" +BSP_BRANCH="stable-4.19-rock3" +BSP_MAKE_TARGETS="u-boot.dtb u-boot.itb all" +RKBIN="rk3568_ddr_1056MHz_v" +SUPPORTED_BOARDS=("radxa-cm3-io" "radxa-cm3-rpi-cm4-io" "radxa-e23" "radxa-e25" "rock-3a" "rock-3b" "rock-3c") + +bsp_radxa-cm3-io() { + BSP_SOC="rk3566" +} + +bsp_radxa-cm3-rpi-cm4-io() { + BSP_SOC="rk3566" +} + +bsp_radxa-e23() { + BSP_SOC="rk3566" +} + +bsp_radxa-e25() { + BSP_SOC="rk3568" +} + +bsp_rock-3a() { + BSP_SOC="rk3568" +} + +bsp_rock-3b() { + BSP_SOC="rk3568" +} + +bsp_rock-3c() { + BSP_SOC="rk3566" +} \ No newline at end of file diff --git a/u-boot/rk356x/kconfig.conf b/u-boot/rk356x/kconfig.conf new file mode 100644 index 00000000..b2eba7aa --- /dev/null +++ b/u-boot/rk356x/kconfig.conf @@ -0,0 +1 @@ +# CONFIG_SPL_SPI_LOAD is not set diff --git a/u-boot/rk3588/0001-common b/u-boot/rk3588/0001-common new file mode 120000 index 00000000..d2afe44c --- /dev/null +++ b/u-boot/rk3588/0001-common @@ -0,0 +1 @@ +../.common \ No newline at end of file diff --git a/u-boot/rk3588/0002-rockchip b/u-boot/rk3588/0002-rockchip new file mode 120000 index 00000000..996195bf --- /dev/null +++ b/u-boot/rk3588/0002-rockchip @@ -0,0 +1 @@ +../.rockchip \ No newline at end of file diff --git a/u-boot/rk3588/0020-rock-5a/0001-rockchip-move-crypto-functions-to-rk3588s.patch b/u-boot/rk3588/0020-rock-5a/0001-rockchip-move-crypto-functions-to-rk3588s.patch new file mode 100644 index 00000000..961bb49a --- /dev/null +++ b/u-boot/rk3588/0020-rock-5a/0001-rockchip-move-crypto-functions-to-rk3588s.patch @@ -0,0 +1,68 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yuntian Zhang +Date: Tue, 26 Apr 2022 14:16:32 +0800 +Subject: [PATCH] rockchip: move crypto functions to rk3588s + +rkbin uses crypto device to verify hash before passing control to bootloader. If this device is missing boot will fail. + +Signed-off-by: Yuntian Zhang +--- + arch/arm/dts/rk3588.dtsi | 15 --------------- + arch/arm/dts/rk3588s.dtsi | 15 +++++++++++++++ + 2 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/arch/arm/dts/rk3588.dtsi b/arch/arm/dts/rk3588.dtsi +index 8a13e8edd8..f7eb5936a8 100644 +--- a/arch/arm/dts/rk3588.dtsi ++++ b/arch/arm/dts/rk3588.dtsi +@@ -429,21 +429,6 @@ + status = "disabled"; + }; + +- crypto: crypto@fe370000 { +- compatible = "rockchip,rk3588-crypto"; +- reg = <0x0 0xfe370000 0x0 0x4000>; +- clocks = <&scmi_clk SCMI_CRYPTO_CORE>, <&scmi_clk SCMI_CRYPTO_PKA>; +- clock-names = "sclk_crypto", "apkclk_crypto"; +- clock-frequency = <350000000>, <350000000>; +- status = "disabled"; +- }; +- +- rng: rng@fe378000 { +- compatible = "rockchip,trngv1"; +- reg = <0x0 0xfe378000 0x0 0x200>; +- status = "disabled"; +- }; +- + hdptxphy1: phy@fed70000 { + compatible = "rockchip,rk3588-hdptx-phy"; + reg = <0x0 0xfed70000 0x0 0x2000>; +diff --git a/arch/arm/dts/rk3588s.dtsi b/arch/arm/dts/rk3588s.dtsi +index 53ccfbaeed..ca18d3bd0c 100644 +--- a/arch/arm/dts/rk3588s.dtsi ++++ b/arch/arm/dts/rk3588s.dtsi +@@ -2220,6 +2220,21 @@ + arm,pl330-periph-burst; + }; + ++ crypto: crypto@fe370000 { ++ compatible = "rockchip,rk3588-crypto"; ++ reg = <0x0 0xfe370000 0x0 0x4000>; ++ clocks = <&scmi_clk SCMI_CRYPTO_CORE>, <&scmi_clk SCMI_CRYPTO_PKA>; ++ clock-names = "sclk_crypto", "apkclk_crypto"; ++ clock-frequency = <350000000>, <350000000>; ++ status = "disabled"; ++ }; ++ ++ rng: rng@fe378000 { ++ compatible = "rockchip,trngv1"; ++ reg = <0x0 0xfe378000 0x0 0x200>; ++ status = "disabled"; ++ }; ++ + hdptxphy0: phy@fed60000 { + compatible = "rockchip,rk3588-hdptx-phy"; + reg = <0x0 0xfed60000 0x0 0x2000>; +-- +2.36.1 + diff --git a/u-boot/rk3588/0020-rock-5a/0002-rockchip-create-rk3588s-u-boot-dtsi.patch b/u-boot/rk3588/0020-rock-5a/0002-rockchip-create-rk3588s-u-boot-dtsi.patch new file mode 100644 index 00000000..b0a03b18 --- /dev/null +++ b/u-boot/rk3588/0020-rock-5a/0002-rockchip-create-rk3588s-u-boot-dtsi.patch @@ -0,0 +1,546 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yuntian Zhang +Date: Tue, 26 Apr 2022 14:23:52 +0800 +Subject: [PATCH] rockchip: create rk3588s-u-boot-dtsi + +This file will contain common features between rk3588 & rk3588s. + +rk3588 specific features are kept in rk3588-u-boot-dtsi. + +Signed-off-by: Yuntian Zhang +--- + arch/arm/dts/rk3588-u-boot.dtsi | 250 +----------------------------- + arch/arm/dts/rk3588s-u-boot.dtsi | 253 +++++++++++++++++++++++++++++++ + 2 files changed, 255 insertions(+), 248 deletions(-) + create mode 100644 arch/arm/dts/rk3588s-u-boot.dtsi + +diff --git a/arch/arm/dts/rk3588-u-boot.dtsi b/arch/arm/dts/rk3588-u-boot.dtsi +index 3fe8054aac..3d411437b5 100644 +--- a/arch/arm/dts/rk3588-u-boot.dtsi ++++ b/arch/arm/dts/rk3588-u-boot.dtsi +@@ -4,260 +4,14 @@ + * SPDX-License-Identifier: GPL-2.0+ + */ + +-#include +- +-/ { +- aliases { +- mmc0 = &sdhci; +- mmc1 = &sdmmc; +- }; +- +- chosen { +- stdout-path = &uart2; +- u-boot,spl-boot-order = &sdmmc, &sdhci, &spi_nand, &spi_nor; +- }; +- +- secure-otp@fe3a0000 { +- u-boot,dm-spl; +- compatible = "rockchip,rk3588-secure-otp"; +- reg = <0x0 0xfe3a0000 0x0 0x4000>; +- }; +-}; +- +-&firmware { +- u-boot,dm-spl; +-}; +- +-&gpio0 { +- u-boot,dm-spl; +- status = "okay"; +-}; +-&gpio1 { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- +-&gpio2 { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +-&gpio3 { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- +-&gpio4 { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- +-&scmi { +- u-boot,dm-spl; +-}; +- +-&scmi_clk { +- u-boot,dm-spl; +-}; +- +-&sram { +- u-boot,dm-spl; +-}; +- +-&scmi_shmem { +- u-boot,dm-spl; +-}; +- +-&xin24m { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- +-&cru { +- u-boot,dm-spl; +- status = "okay"; +-}; +- +-&psci { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- +-&crypto { +- u-boot,dm-spl; +- status = "okay"; +-}; +- +-&sys_grf { +- u-boot,dm-spl; +- status = "okay"; +-}; ++#include "rk3588s-u-boot.dtsi" + + &pcie30_phy_grf { + u-boot,dm-pre-reloc; + status = "okay"; + }; + +-&php_grf { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- +-&pipe_phy0_grf { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- + &pipe_phy1_grf { + u-boot,dm-pre-reloc; + status = "okay"; +-}; +- +-&pipe_phy2_grf { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- +-&uart2 { +- u-boot,dm-spl; +- status = "okay"; +-}; +- +-&hw_decompress { +- u-boot,dm-spl; +- status = "okay"; +-}; +- +-&rng { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- +-&sfc { +- u-boot,dm-spl; +- status = "okay"; +- +- #address-cells = <1>; +- #size-cells = <0>; +- spi_nand: flash@0 { +- u-boot,dm-spl; +- compatible = "spi-nand"; +- reg = <0>; +- spi-tx-bus-width = <1>; +- spi-rx-bus-width = <4>; +- spi-max-frequency = <80000000>; +- }; +- +- spi_nor: flash@1 { +- u-boot,dm-spl; +- compatible = "jedec,spi-nor"; +- label = "sfc_nor"; +- reg = <0>; +- spi-tx-bus-width = <1>; +- spi-rx-bus-width = <4>; +- spi-max-frequency = <80000000>; +- }; +-}; +- +-&saradc { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- +-&sdmmc { +- bus-width = <4>; +- u-boot,dm-spl; +- cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>; +- status = "okay"; +-}; +- +-&sdhci { +- bus-width = <8>; +- u-boot,dm-spl; +- mmc-hs200-1_8v; +- non-removable; +- status = "okay"; +-}; +- +-&usb2phy0_grf { +- u-boot,dm-pre-reloc; +-}; +- +-&u2phy0 { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- +-&u2phy0_otg { +- u-boot,dm-pre-reloc; +- status = "okay"; +-}; +- +-/* Support SPL-PINCTRL: +- * 1. ioc +- * 2. pinctrl(sdmmc) +- * 3. gpio if need +- */ +-&ioc { +- u-boot,dm-spl; +-}; +- +-&pinctrl { +- u-boot,dm-spl; +- /delete-node/ sdmmc; +- sdmmc { +- u-boot,dm-spl; +- sdmmc_bus4: sdmmc-bus4 { +- u-boot,dm-spl; +- rockchip,pins = +- /* sdmmc_d0 */ +- <4 RK_PD0 1 &pcfg_pull_up_drv_level_2>, +- /* sdmmc_d1 */ +- <4 RK_PD1 1 &pcfg_pull_up_drv_level_2>, +- /* sdmmc_d2 */ +- <4 RK_PD2 1 &pcfg_pull_up_drv_level_2>, +- /* sdmmc_d3 */ +- <4 RK_PD3 1 &pcfg_pull_up_drv_level_2>; +- }; +- +- sdmmc_clk: sdmmc-clk { +- u-boot,dm-spl; +- rockchip,pins = +- /* sdmmc_clk */ +- <4 RK_PD5 1 &pcfg_pull_up_drv_level_2>; +- }; +- +- sdmmc_cmd: sdmmc-cmd { +- u-boot,dm-spl; +- rockchip,pins = +- /* sdmmc_cmd */ +- <4 RK_PD4 1 &pcfg_pull_up_drv_level_2>; +- }; +- +- sdmmc_det: sdmmc-det { +- u-boot,dm-spl; +- rockchip,pins = +- /* sdmmc_det */ +- <0 RK_PA4 1 &pcfg_pull_up>; +- }; +- +- sdmmc_pwren: sdmmc-pwren { +- u-boot,dm-spl; +- rockchip,pins = +- /* sdmmc_pwren */ +- <0 RK_PA5 2 &pcfg_pull_none>; +- }; +- }; +-}; +- +-&pcfg_pull_up_drv_level_2 { +- u-boot,dm-spl; +-}; +- +-&pcfg_pull_up { +- u-boot,dm-spl; +-}; +- +-&pcfg_pull_none +-{ +- u-boot,dm-spl; +-}; ++}; +\ No newline at end of file +diff --git a/arch/arm/dts/rk3588s-u-boot.dtsi b/arch/arm/dts/rk3588s-u-boot.dtsi +new file mode 100644 +index 0000000000..f606faa95e +--- /dev/null ++++ b/arch/arm/dts/rk3588s-u-boot.dtsi +@@ -0,0 +1,253 @@ ++/* ++ * (C) Copyright 2021 Rockchip Electronics Co., Ltd ++ * ++ * SPDX-License-Identifier: GPL-2.0+ ++ */ ++ ++#include ++ ++/ { ++ aliases { ++ mmc0 = &sdhci; ++ mmc1 = &sdmmc; ++ }; ++ ++ chosen { ++ stdout-path = &uart2; ++ u-boot,spl-boot-order = &sdmmc, &sdhci, &spi_nand, &spi_nor; ++ }; ++ ++ secure-otp@fe3a0000 { ++ u-boot,dm-spl; ++ compatible = "rockchip,rk3588-secure-otp"; ++ reg = <0x0 0xfe3a0000 0x0 0x4000>; ++ }; ++}; ++ ++&firmware { ++ u-boot,dm-spl; ++}; ++ ++&gpio0 { ++ u-boot,dm-spl; ++ status = "okay"; ++}; ++&gpio1 { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++&gpio2 { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++&gpio3 { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++&gpio4 { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++&scmi { ++ u-boot,dm-spl; ++}; ++ ++&scmi_clk { ++ u-boot,dm-spl; ++}; ++ ++&sram { ++ u-boot,dm-spl; ++}; ++ ++&scmi_shmem { ++ u-boot,dm-spl; ++}; ++ ++&xin24m { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++&cru { ++ u-boot,dm-spl; ++ status = "okay"; ++}; ++ ++&psci { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++&crypto { ++ u-boot,dm-spl; ++ status = "okay"; ++}; ++ ++&sys_grf { ++ u-boot,dm-spl; ++ status = "okay"; ++}; ++ ++&php_grf { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++&pipe_phy0_grf { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++&pipe_phy2_grf { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++&uart2 { ++ u-boot,dm-spl; ++ status = "okay"; ++}; ++ ++&hw_decompress { ++ u-boot,dm-spl; ++ status = "okay"; ++}; ++ ++&rng { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++&sfc { ++ u-boot,dm-spl; ++ status = "okay"; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi_nand: flash@0 { ++ u-boot,dm-spl; ++ compatible = "spi-nand"; ++ reg = <0>; ++ spi-tx-bus-width = <1>; ++ spi-rx-bus-width = <4>; ++ spi-max-frequency = <80000000>; ++ }; ++ ++ spi_nor: flash@1 { ++ u-boot,dm-spl; ++ compatible = "jedec,spi-nor"; ++ label = "sfc_nor"; ++ reg = <0>; ++ spi-tx-bus-width = <1>; ++ spi-rx-bus-width = <4>; ++ spi-max-frequency = <80000000>; ++ }; ++}; ++ ++&saradc { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++&sdmmc { ++ bus-width = <4>; ++ u-boot,dm-spl; ++ cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++}; ++ ++&sdhci { ++ bus-width = <8>; ++ u-boot,dm-spl; ++ mmc-hs200-1_8v; ++ non-removable; ++ status = "okay"; ++}; ++ ++&usb2phy0_grf { ++ u-boot,dm-pre-reloc; ++}; ++ ++&u2phy0 { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++&u2phy0_otg { ++ u-boot,dm-pre-reloc; ++ status = "okay"; ++}; ++ ++/* Support SPL-PINCTRL: ++ * 1. ioc ++ * 2. pinctrl(sdmmc) ++ * 3. gpio if need ++ */ ++&ioc { ++ u-boot,dm-spl; ++}; ++ ++&pinctrl { ++ u-boot,dm-spl; ++ /delete-node/ sdmmc; ++ sdmmc { ++ u-boot,dm-spl; ++ sdmmc_bus4: sdmmc-bus4 { ++ u-boot,dm-spl; ++ rockchip,pins = ++ /* sdmmc_d0 */ ++ <4 RK_PD0 1 &pcfg_pull_up_drv_level_2>, ++ /* sdmmc_d1 */ ++ <4 RK_PD1 1 &pcfg_pull_up_drv_level_2>, ++ /* sdmmc_d2 */ ++ <4 RK_PD2 1 &pcfg_pull_up_drv_level_2>, ++ /* sdmmc_d3 */ ++ <4 RK_PD3 1 &pcfg_pull_up_drv_level_2>; ++ }; ++ ++ sdmmc_clk: sdmmc-clk { ++ u-boot,dm-spl; ++ rockchip,pins = ++ /* sdmmc_clk */ ++ <4 RK_PD5 1 &pcfg_pull_up_drv_level_2>; ++ }; ++ ++ sdmmc_cmd: sdmmc-cmd { ++ u-boot,dm-spl; ++ rockchip,pins = ++ /* sdmmc_cmd */ ++ <4 RK_PD4 1 &pcfg_pull_up_drv_level_2>; ++ }; ++ ++ sdmmc_det: sdmmc-det { ++ u-boot,dm-spl; ++ rockchip,pins = ++ /* sdmmc_det */ ++ <0 RK_PA4 1 &pcfg_pull_up>; ++ }; ++ ++ sdmmc_pwren: sdmmc-pwren { ++ u-boot,dm-spl; ++ rockchip,pins = ++ /* sdmmc_pwren */ ++ <0 RK_PA5 2 &pcfg_pull_none>; ++ }; ++ }; ++}; ++ ++&pcfg_pull_up_drv_level_2 { ++ u-boot,dm-spl; ++}; ++ ++&pcfg_pull_up { ++ u-boot,dm-spl; ++}; ++ ++&pcfg_pull_none ++{ ++ u-boot,dm-spl; ++}; +-- +2.36.1 + diff --git a/u-boot/rk3588/0020-rock-5a/0003-rockchip-add-ROCK-5A-support.patch b/u-boot/rk3588/0020-rock-5a/0003-rockchip-add-ROCK-5A-support.patch new file mode 100644 index 00000000..8c956a32 --- /dev/null +++ b/u-boot/rk3588/0020-rock-5a/0003-rockchip-add-ROCK-5A-support.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yuntian Zhang +Date: Tue, 26 Apr 2022 14:24:30 +0800 +Subject: [PATCH] rockchip: add ROCK 5A support + +Signed-off-by: Yuntian Zhang +--- + arch/arm/dts/Makefile | 1 + + 1 files changed, 1 insertions(+) + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index b834bc3fc3..05a1a5967b 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -56,6 +56,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \ + rk3399-puma-ddr1333.dtb \ + rk3399-puma-ddr1600.dtb \ + rk3399-puma-ddr1866.dtb \ ++ rk3588s-rock-5a.dtb \ + rv1108-evb.dtb + dtb-$(CONFIG_ARCH_MESON) += \ + meson-gxbb-odroidc2.dtb +-- +2.36.1 + diff --git a/u-boot/rk3588/0100-vendor/0001-Fix-Werror-address.patch b/u-boot/rk3588/0100-vendor/0001-Fix-Werror-address.patch new file mode 100644 index 00000000..a2c47cb7 --- /dev/null +++ b/u-boot/rk3588/0100-vendor/0001-Fix-Werror-address.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Yuntian Zhang +Date: Mon, 30 May 2022 15:09:48 +0800 +Subject: [PATCH] Fix -Werror=address + +Signed-off-by: Yuntian Zhang +--- + drivers/mmc/rockchip_dw_mmc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c +index 1287551bf1..a78cb39c7f 100644 +--- a/drivers/mmc/rockchip_dw_mmc.c ++++ b/drivers/mmc/rockchip_dw_mmc.c +@@ -42,7 +42,7 @@ int board_mmc_dm_reinit(struct udevice *dev) + { + struct rockchip_dwmmc_priv *priv = dev_get_priv(dev); + +- if (!priv || !&priv->clk) ++ if (!priv) + return 0; + + if (!memcmp(dev->name, "dwmmc", strlen("dwmmc"))) +-- +2.36.1 + diff --git a/u-boot/rk3588/fork.conf b/u-boot/rk3588/fork.conf new file mode 100644 index 00000000..8951db1a --- /dev/null +++ b/u-boot/rk3588/fork.conf @@ -0,0 +1,14 @@ +BSP_SOC_OVERRIDE="rk3588" +BSP_GIT="https://github.com/radxa/u-boot.git" +BSP_BRANCH="stable-5.10-rock5" +BSP_MAKE_TARGETS="u-boot.dtb u-boot.itb all" +RKBIN="rk3588_ddr_lp4_2112MHz_lp5_2736MHz" +SUPPORTED_BOARDS=("rock-5a" "rock-5b") + +bsp_rock-5a() { + BSP_SOC="rk3588s" +} + +bsp_rock-5b() { + BSP_SOC="rk3588" +} \ No newline at end of file diff --git a/u-boot/rk3588/kconfig.conf b/u-boot/rk3588/kconfig.conf new file mode 100644 index 00000000..b2eba7aa --- /dev/null +++ b/u-boot/rk3588/kconfig.conf @@ -0,0 +1 @@ +# CONFIG_SPL_SPI_LOAD is not set