From 71e933bdd525d6c19c5f26b78ba1a6ee4546bfc5 Mon Sep 17 00:00:00 2001 From: Johan Gunnarsson Date: Sun, 13 Sep 2020 14:07:44 +0200 Subject: [PATCH] Add support for Rockchip chips --- Dockerfile | 1 + dockerfiles/Dockerfile.arm32v7 | 1 + dockerfiles/Dockerfile.arm32v7-on-amd64 | 1 + dockerfiles/Dockerfile.arm64v8 | 1 + dockerfiles/Dockerfile.arm64v8-on-amd64 | 1 + scripts/build-boot | 3 +++ scripts/build-boot-rk | 23 +++++++++++++++++++++++ 7 files changed, 31 insertions(+) create mode 100755 scripts/build-boot-rk diff --git a/Dockerfile b/Dockerfile index f1784a1..b93474a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ RUN apt-get update && \ qemu-user-static \ device-tree-compiler \ gcc \ + gcc-arm-none-eabi \ make \ git \ bc \ diff --git a/dockerfiles/Dockerfile.arm32v7 b/dockerfiles/Dockerfile.arm32v7 index 357fe81..82c2ce3 100644 --- a/dockerfiles/Dockerfile.arm32v7 +++ b/dockerfiles/Dockerfile.arm32v7 @@ -10,6 +10,7 @@ RUN apt-get update && \ ca-certificates \ device-tree-compiler \ gcc \ + gcc-arm-none-eabi \ make \ git \ bc \ diff --git a/dockerfiles/Dockerfile.arm32v7-on-amd64 b/dockerfiles/Dockerfile.arm32v7-on-amd64 index 9770ecc..282eae1 100644 --- a/dockerfiles/Dockerfile.arm32v7-on-amd64 +++ b/dockerfiles/Dockerfile.arm32v7-on-amd64 @@ -20,6 +20,7 @@ RUN apt-get update && \ ca-certificates \ device-tree-compiler \ gcc \ + gcc-arm-none-eabi \ make \ git \ bc \ diff --git a/dockerfiles/Dockerfile.arm64v8 b/dockerfiles/Dockerfile.arm64v8 index 9cb1de7..1cf6dbf 100644 --- a/dockerfiles/Dockerfile.arm64v8 +++ b/dockerfiles/Dockerfile.arm64v8 @@ -10,6 +10,7 @@ RUN apt-get update && \ ca-certificates \ device-tree-compiler \ gcc \ + gcc-arm-none-eabi \ make \ git \ bc \ diff --git a/dockerfiles/Dockerfile.arm64v8-on-amd64 b/dockerfiles/Dockerfile.arm64v8-on-amd64 index a298d6f..0e0f259 100644 --- a/dockerfiles/Dockerfile.arm64v8-on-amd64 +++ b/dockerfiles/Dockerfile.arm64v8-on-amd64 @@ -20,6 +20,7 @@ RUN apt-get update && \ ca-certificates \ device-tree-compiler \ gcc \ + gcc-arm-none-eabi \ make \ git \ bc \ diff --git a/scripts/build-boot b/scripts/build-boot index c5b1c84..600865c 100755 --- a/scripts/build-boot +++ b/scripts/build-boot @@ -21,6 +21,9 @@ allwinner*) bcm2836|bcm2837|bcm2711) build-boot-rpi "${BOARD_ID}" "${CHIP_ID}" "${DEFCONFIG}" "${TUPLE}" ;; +rk*) + build-boot-rk "${BOARD_ID}" "${CHIP_ID}" "${DEFCONFIG}" "${TUPLE}" + ;; *) echo Unknown CHIP_ID exit 1 diff --git a/scripts/build-boot-rk b/scripts/build-boot-rk new file mode 100755 index 0000000..4608e11 --- /dev/null +++ b/scripts/build-boot-rk @@ -0,0 +1,23 @@ +#!/bin/sh +# Build SD card image + +BOARD_ID="${1}" # For example "bananapi" +CHIP_ID="${2}" # For example "allwinner-a10" +DEFCONFIG="${3}" # For example "Bananapi_defconfig" +TUPLE="${4}" # For example "arm-linux-gnueabihf" + +set -e + +case "${CHIP_ID}" in +rk3308|rk3328|rk3368|rk3399) + build-atf "${CHIP_ID}" "${TUPLE}" + export BL31="$(pwd)/arm-trusted-firmware/build/${CHIP_ID}/debug/bl31/bl31.elf" + ;; +*) + ;; +esac + +build-u_boot "${DEFCONFIG}" "${TUPLE}" + +# Copy U-Boot to 64 sectors from start +dd if=u-boot/u-boot-rockchip.bin of=tmp.img seek=64