From 144f1e09f0b3594693adc30b56ea1f4ebcf50a4a Mon Sep 17 00:00:00 2001 From: Noel Georgi Date: Thu, 14 Mar 2024 16:59:57 +0530 Subject: [PATCH] feat: add rockpi overlay Add RockPi overlay. Signed-off-by: Noel Georgi --- .conform.yaml | 48 ++++++ .dockerignore | 7 + .github/workflows/ci.yaml | 78 +++++++++ .github/workflows/slack-notify.yaml | 92 +++++++++++ .gitignore | 6 + .kres.yaml | 2 +- Makefile | 156 ++++++++++++++++++ Pkgfile | 5 + README.md | 22 +-- .../arm-trusted-firmware/m0/rk3399m0.bin | Bin 0 -> 784 bytes .../arm-trusted-firmware/m0/rk3399m0pmu.bin | Bin 0 -> 576 bytes .../patches/platform.mk.patch | 10 ++ artifacts/arm-trusted-firmware/pkg.yaml | 40 +++++ .../board-rock-pi-4-enable-spi-flash.patch | 153 +++++++++++++++++ .../patches/enable-boot-from-spi-flash.patch | 26 +++ .../general-add-xtx-spi-nor-chips.patch | 14 ++ artifacts/rockpi4/u-boot/pkg.yaml | 52 ++++++ .../board-rock-pi-4-enable-spi-flash.patch | 153 +++++++++++++++++ .../patches/enable-boot-from-spi-flash.patch | 26 +++ .../general-add-xtx-spi-nor-chips.patch | 14 ++ artifacts/rockpi4c/u-boot/pkg.yaml | 52 ++++++ artifacts/u-boot/pkg.yaml | 37 ----- go.work | 5 +- hack/release.sh | 66 ++++++++ hack/release.toml | 11 ++ installers/board/src/main.go | 56 ------- installers/pkg.yaml | 22 +++ installers/{board => rockpi4}/pkg.yaml | 11 +- installers/{board => rockpi4}/src/go.mod | 5 +- installers/{board => rockpi4}/src/go.sum | 6 +- installers/rockpi4/src/main.go | 85 ++++++++++ installers/rockpi4c/pkg.yaml | 25 +++ installers/rockpi4c/src/go.mod | 11 ++ installers/rockpi4c/src/go.sum | 10 ++ installers/rockpi4c/src/main.go | 84 ++++++++++ profiles/pkg.yaml | 4 +- .../board.yaml => rockpi4/rockpi4.yaml} | 2 +- profiles/rockpi4c/rockpi4c.yaml | 9 + 38 files changed, 1282 insertions(+), 123 deletions(-) create mode 100644 .conform.yaml create mode 100644 .dockerignore create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/slack-notify.yaml create mode 100644 .gitignore create mode 100755 artifacts/arm-trusted-firmware/m0/rk3399m0.bin create mode 100755 artifacts/arm-trusted-firmware/m0/rk3399m0pmu.bin create mode 100644 artifacts/arm-trusted-firmware/patches/platform.mk.patch create mode 100644 artifacts/arm-trusted-firmware/pkg.yaml create mode 100644 artifacts/rockpi4/u-boot/patches/board-rock-pi-4-enable-spi-flash.patch create mode 100644 artifacts/rockpi4/u-boot/patches/enable-boot-from-spi-flash.patch create mode 100644 artifacts/rockpi4/u-boot/patches/general-add-xtx-spi-nor-chips.patch create mode 100644 artifacts/rockpi4/u-boot/pkg.yaml create mode 100644 artifacts/rockpi4c/u-boot/patches/board-rock-pi-4-enable-spi-flash.patch create mode 100644 artifacts/rockpi4c/u-boot/patches/enable-boot-from-spi-flash.patch create mode 100644 artifacts/rockpi4c/u-boot/patches/general-add-xtx-spi-nor-chips.patch create mode 100644 artifacts/rockpi4c/u-boot/pkg.yaml delete mode 100644 artifacts/u-boot/pkg.yaml create mode 100755 hack/release.sh create mode 100644 hack/release.toml delete mode 100644 installers/board/src/main.go create mode 100644 installers/pkg.yaml rename installers/{board => rockpi4}/pkg.yaml (64%) rename installers/{board => rockpi4}/src/go.mod (51%) rename installers/{board => rockpi4}/src/go.sum (59%) create mode 100644 installers/rockpi4/src/main.go create mode 100644 installers/rockpi4c/pkg.yaml create mode 100644 installers/rockpi4c/src/go.mod create mode 100644 installers/rockpi4c/src/go.sum create mode 100644 installers/rockpi4c/src/main.go rename profiles/{board/board.yaml => rockpi4/rockpi4.yaml} (88%) create mode 100644 profiles/rockpi4c/rockpi4c.yaml diff --git a/.conform.yaml b/.conform.yaml new file mode 100644 index 00000000..01959837 --- /dev/null +++ b/.conform.yaml @@ -0,0 +1,48 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-14T17:15:12Z by kres latest. + +policies: + - type: commit + spec: + dco: true + gpg: + required: true + identity: + gitHubOrganization: siderolabs + spellcheck: + locale: US + maximumOfOneCommit: true + header: + length: 89 + imperative: true + case: lower + invalidLastCharacters: . + body: + required: true + conventional: + types: + - chore + - docs + - perf + - refactor + - style + - test + - release + scopes: + - .* + - type: license + spec: + root: . + skipPaths: + - .git/ + - testdata/ + includeSuffixes: + - .go + excludeSuffixes: + - .pb.go + - .pb.gw.go + header: | + // This Source Code Form is subject to the terms of the Mozilla Public + // License, v. 2.0. If a copy of the MPL was not distributed with this + // file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..a7391eb3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-14T09:48:15Z by kres latest. + +* +!README.md +!pkg.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..98562f1e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,78 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-14T09:48:15Z by kres latest. + +name: default +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true +"on": + push: + branches: + - main + - release-* + tags: + - v* + pull_request: + branches: + - main + - release-* +jobs: + default: + permissions: + actions: read + contents: write + issues: read + packages: write + pull-requests: read + runs-on: + - self-hosted + - pkgs + if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/')) + services: + buildkitd: + image: moby/buildkit:v0.12.5 + options: --privileged + ports: + - 1234:1234 + volumes: + - /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit + - /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml + steps: + - name: checkout + uses: actions/checkout@v4 + - name: Unshallow + run: | + git fetch --prune --unshallow + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + append: | + - endpoint: tcp://buildkit-arm64.ci.svc.cluster.local:1234 + platforms: linux/arm64 + driver: remote + endpoint: tcp://127.0.0.1:1234 + - name: Build + run: | + make + - name: Login to registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + username: ${{ github.repository_owner }} + - name: Push to registry + if: github.event_name != 'pull_request' + run: | + make PUSH=true + - name: release-notes + if: startsWith(github.ref, 'refs/tags/') + run: | + make release-notes + - name: Release + if: startsWith(github.ref, 'refs/tags/') + uses: crazy-max/ghaction-github-release@v2 + with: + body_path: _out/RELEASE_NOTES.md + draft: "true" diff --git a/.github/workflows/slack-notify.yaml b/.github/workflows/slack-notify.yaml new file mode 100644 index 00000000..8dde1d82 --- /dev/null +++ b/.github/workflows/slack-notify.yaml @@ -0,0 +1,92 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-14T09:48:15Z by kres latest. + +name: slack-notify +"on": + workflow_run: + workflows: + - default + types: + - completed +jobs: + slack-notify: + runs-on: + - self-hosted + - generic + if: github.event.workflow_run.conclusion != 'skipped' + steps: + - name: Get PR number + id: get-pr-number + if: github.event.workflow_run.event == 'pull_request' + env: + GH_TOKEN: ${{ github.token }} + run: | + echo pull_request_number=$(gh pr view -R ${{ github.repository }} ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }} --json number --jq .number) >> $GITHUB_OUTPUT + - name: Slack Notify + uses: slackapi/slack-github-action@v1 + with: + channel-id: proj-talos-maintainers + payload: | + { + "attachments": [ + { + "color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}", + "fallback": "test", + "blocks": [ + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}" + }, + { + "type": "mrkdwn", + "text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`" + } + ] + }, + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Author:*\n`${{ github.actor }}`" + }, + { + "type": "mrkdwn", + "text": "*Event:*\n`${{ github.event.workflow_run.event }}`" + } + ] + }, + { + "type": "divider" + }, + { + "type": "actions", + "elements": [ + { + "type": "button", + "text": { + "type": "plain_text", + "text": "Logs" + }, + "url": "${{ github.event.workflow_run.html_url }}" + }, + { + "type": "button", + "text": { + "type": "plain_text", + "text": "Commit" + }, + "url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}" + } + ] + } + ] + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..73cbf9e2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-14T09:48:15Z by kres latest. + +_out +go.work.sum diff --git a/.kres.yaml b/.kres.yaml index 8885fdc1..584a0831 100644 --- a/.kres.yaml +++ b/.kres.yaml @@ -2,7 +2,7 @@ kind: pkgfile.Build spec: targets: - - board + - sbc-rockpi extraBuildArgs: - PKGS_PREFIX - PKGS diff --git a/Makefile b/Makefile index 38a3f9bd..35200a8f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,162 @@ +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-14T16:50:45Z by kres latest. + +# common variables + +SHA := $(shell git describe --match=none --always --abbrev=8 --dirty) +TAG := $(shell git describe --tag --always --dirty --match v[0-9]\*) +ABBREV_TAG := $(shell git describe --tags >/dev/null 2>/dev/null && git describe --tag --always --match v[0-9]\* --abbrev=0 || echo 'undefined') +BRANCH := $(shell git rev-parse --abbrev-ref HEAD) +ARTIFACTS := _out +OPERATING_SYSTEM := $(shell uname -s | tr '[:upper:]' '[:lower:]') +GOARCH := $(shell uname -m | tr '[:upper:]' '[:lower:]') + +ifeq ($(GOARCH),x86_64) + GOARCH := amd64 +endif +REGISTRY ?= ghcr.io +USERNAME ?= siderolabs +REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME) KRES_IMAGE ?= ghcr.io/siderolabs/kres:latest +CONFORMANCE_IMAGE ?= ghcr.io/siderolabs/conform:latest + +# source date epoch of first commit + +INITIAL_COMMIT_SHA := $(shell git rev-list --max-parents=0 HEAD) +SOURCE_DATE_EPOCH := $(shell git log $(INITIAL_COMMIT_SHA) --pretty=%ct) + +# sync bldr image with pkgfile + +BLDR_RELEASE := v0.3.0 +BLDR_IMAGE := ghcr.io/siderolabs/bldr:$(BLDR_RELEASE) +BLDR := docker run --rm --user $(shell id -u):$(shell id -g) --volume $(PWD):/src --entrypoint=/bldr $(BLDR_IMAGE) --root=/src + +# docker build settings + +BUILD := docker buildx build +PLATFORM ?= linux/amd64,linux/arm64 +PROGRESS ?= auto +PUSH ?= false +CI_ARGS ?= +COMMON_ARGS = --file=Pkgfile +COMMON_ARGS += --provenance=false +COMMON_ARGS += --progress=$(PROGRESS) +COMMON_ARGS += --platform=$(PLATFORM) +COMMON_ARGS += --build-arg=SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) +COMMON_ARGS += --build-arg=PKGS_PREFIX="$(PKGS_PREFIX)" +COMMON_ARGS += --build-arg=PKGS="$(PKGS)" + +# extra variables + +PKGS_PREFIX ?= ghcr.io/siderolabs +PKGS ?= v1.7.0-alpha.0-33-g3aacf03 + +# targets defines all the available targets + +TARGETS = sbc-rockpi + +# help menu + +export define HELP_MENU_HEADER +# Getting Started + +To build this project, you must have the following installed: + +- git +- make +- docker (19.03 or higher) + +## Creating a Builder Instance + +The build process makes use of experimental Docker features (buildx). +To enable experimental features, add 'experimental: "true"' to '/etc/docker/daemon.json' on +Linux or enable experimental features in Docker GUI for Windows or Mac. + +To create a builder instance, run: + + docker buildx create --name local --use + +If running builds that needs to be cached aggresively create a builder instance with the following: + + docker buildx create --name local --use --config=config.toml + +config.toml contents: + +[worker.oci] + gc = true + gckeepstorage = 50000 + + [[worker.oci.gcpolicy]] + keepBytes = 10737418240 + keepDuration = 604800 + filters = [ "type==source.local", "type==exec.cachemount", "type==source.git.checkout"] + [[worker.oci.gcpolicy]] + all = true + keepBytes = 53687091200 + +If you already have a compatible builder instance, you may use that instead. + +## Artifacts + +All artifacts will be output to ./$(ARTIFACTS). Images will be tagged with the +registry "$(REGISTRY)", username "$(USERNAME)", and a dynamic tag (e.g. $(IMAGE):$(TAG)). +The registry and username can be overridden by exporting REGISTRY, and USERNAME +respectively. + +endef + +all: $(TARGETS) ## Builds all targets defined. + +.PHONY: clean +clean: ## Cleans up all artifacts. + @rm -rf $(ARTIFACTS) + +$(ARTIFACTS): ## Creates artifacts directory. + @mkdir -p $(ARTIFACTS) + +target-%: ## Builds the specified target defined in the Pkgfile. The build result will only remain in the build cache. + @$(BUILD) --target=$* $(COMMON_ARGS) $(TARGET_ARGS) $(CI_ARGS) . + +local-%: ## Builds the specified target defined in the Pkgfile using the local output type. The build result will be output to the specified local destination. + @$(MAKE) target-$* TARGET_ARGS="--output=type=local,dest=$(DEST) $(TARGET_ARGS)" + +docker-%: ## Builds the specified target defined in the Pkgfile using the docker output type. The build result will be loaded into Docker. + @$(MAKE) target-$* TARGET_ARGS="$(TARGET_ARGS)" + +reproducibility-test-local-%: ## Builds the specified target defined in the Pkgfile using the local output type with and without cahce. The build result will be output to the specified local destination + @rm -rf $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b + @$(MAKE) local-$* DEST=$(ARTIFACTS)/build-a + @$(MAKE) local-$* DEST=$(ARTIFACTS)/build-b TARGET_ARGS="--no-cache" + @touch -ch -t $$(date -d @$(SOURCE_DATE_EPOCH) +%Y%m%d0000) $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b + @diffoscope $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b + @rm -rf $(ARTIFACTS)/build-a $(ARTIFACTS)/build-b + +.PHONY: $(TARGETS) +$(TARGETS): + @$(MAKE) docker-$@ TARGET_ARGS="--tag=$(REGISTRY_AND_USERNAME)/$@:$(TAG) --push=$(PUSH)" + +.PHONY: deps.png +deps.png: ## Generates a dependency graph of the Pkgfile. + @$(BLDR) graph | dot -Tpng -o deps.png .PHONY: rekres rekres: @docker pull $(KRES_IMAGE) @docker run --rm --net=host --user $(shell id -u):$(shell id -g) -v $(PWD):/src -w /src -e GITHUB_TOKEN $(KRES_IMAGE) + +.PHONY: help +help: ## This help menu. + @echo "$$HELP_MENU_HEADER" + @grep -E '^[a-zA-Z%_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +.PHONY: release-notes +release-notes: + mkdir -p $(ARTIFACTS) + @ARTIFACTS=$(ARTIFACTS) ./hack/release.sh $@ $(ARTIFACTS)/RELEASE_NOTES.md $(TAG) + +.PHONY: conformance +conformance: + @docker pull $(CONFORMANCE_IMAGE) + @docker run --rm -it -v $(PWD):/src -w /src $(CONFORMANCE_IMAGE) enforce + diff --git a/Pkgfile b/Pkgfile index 848c09c5..6d700e78 100644 --- a/Pkgfile +++ b/Pkgfile @@ -3,6 +3,11 @@ format: v1alpha2 vars: + # renovate: datasource=github-tags depName=ARM-software/arm-trusted-firmware + arm_trusted_firmware_version: v2.8.0 + arm_trusted_firmware_sha256: 60fad60eeb6840097f8e64f16093c06ddb2ef269c7a22affed02beaa6cefe466 + arm_trusted_firmware_sha512: 958cf8f9e258638e59d0fbd8b053fce7d8a9ea2fc922686c9d20ea16f79f55219ac18a12ab240c528ee98e49c2e0eef4c963fdb255cc14b92437a5b3cffc8640 + # renovate: datasource=github-tags extractVersion=^v(?.*)$ depName=u-boot/u-boot uboot_version: 2023.01 uboot_sha256: 69423bad380f89a0916636e89e6dcbd2e4512d584308d922d1039d1e4331950f diff --git a/README.md b/README.md index c185e903..493d334f 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,10 @@ -# sbc-template +# sbc-rockpi -This is a template repository to generate a new project for the SBC. +This repo provides the overlay for Rock Pi generic Talos image. -The template already contains an example of building and copying over `u-boot`. -This can be used as a starting point for your own project. +## Supported Overlay -## Requirements - -Using a sbc project templates assume docker is installed on your machine. - -## Usage - -* Create a new repository using this template. -* Start by replacing `board` to `` -* Update `installers//src/main.go` with your own logic. -* Run `make rekres` -* Now run `make help` on instructions on setting up `buildx` builder if one is not already setup. +| Overlay Name | Board | Description | +| ------------ | --------------------- | --------------------------------------------- | +| rockpi4 | Rock Pi 4A,Rock Pi 4B | Generic overlay for Rock Pi 4A and Rock Pi 4B | +| rockpi4c | Rock Pi 4C | Overlay for Rock Pi 4C | diff --git a/artifacts/arm-trusted-firmware/m0/rk3399m0.bin b/artifacts/arm-trusted-firmware/m0/rk3399m0.bin new file mode 100755 index 0000000000000000000000000000000000000000..7c23123cb191015f8925bc04e2793e13776bbfd9 GIT binary patch literal 784 zcmWe&W?*1sVqo~o2*C_^07wlC5ThQZb}-Nl$_AddnYl9bJ*1qu67;^REDOvu(PI@Z~}|6hL=DFv(ujo z2b9#kC$UH+r~!4IP!h;c^%6)p1Ef`ebc0e5lT?DTw^Rm$)}LFl-ikmql3UTn<3mOE`lYsOE{X2+$0J{ePd= z=&f*1U@&yAS+~O7fU(q_0~l}r|Npm70gACQm;!@2$z1@5eHhBz85tNE9DuY75PJYI pkju=(zywtP8K`Cd|5=CUef{_RfSbV9|KAJ$3+x>XaWoj*004psT$lg= literal 0 HcmV?d00001 diff --git a/artifacts/arm-trusted-firmware/m0/rk3399m0pmu.bin b/artifacts/arm-trusted-firmware/m0/rk3399m0pmu.bin new file mode 100755 index 0000000000000000000000000000000000000000..e2131e2b8738cc0983494711b04e58d00ccdcb2c GIT binary patch literal 576 zcmZ=@Vqh?3WMD9aVg@__qy`3vQ4do)7-&9ksSF0KKNlDkdA)=)x}Aj+xPT%8T7Pab zDRKfuxPc<9KoLo>2rE>L!T!I`54cq@7`iI}u?i6X1M&s7{{MdczrfzX;IDyp0|2E# B9&Z2u literal 0 HcmV?d00001 diff --git a/artifacts/arm-trusted-firmware/patches/platform.mk.patch b/artifacts/arm-trusted-firmware/patches/platform.mk.patch new file mode 100644 index 00000000..bcbdaaa2 --- /dev/null +++ b/artifacts/arm-trusted-firmware/patches/platform.mk.patch @@ -0,0 +1,10 @@ +--- plat/rockchip/rk3399/platform.mk 2018-03-04 18:44:54.018191729 +0000 ++++ plat/rockchip/rk3399/platform.mk 2021-03-04 18:44:54.018191729 +0000 +@@ -103,7 +103,6 @@ + $(eval $(call MAKE_PREREQ_DIR,${BUILD_M0},${BUILD_PLAT})) + .PHONY: $(RK3399M0FW) + $(RK3399M0FW): | ${BUILD_M0} +- $(MAKE) -C ${RK_PLAT_SOC}/drivers/m0 BUILD=$(abspath ${BUILD_PLAT}/m0) + + # Do not enable SVE + ENABLE_SVE_FOR_NS := 0 diff --git a/artifacts/arm-trusted-firmware/pkg.yaml b/artifacts/arm-trusted-firmware/pkg.yaml new file mode 100644 index 00000000..1969b211 --- /dev/null +++ b/artifacts/arm-trusted-firmware/pkg.yaml @@ -0,0 +1,40 @@ +name: arm-trusted-firmware +variant: scratch +shell: /toolchain/bin/bash +dependencies: + - stage: base +steps: + - sources: + - url: https://github.com/ARM-software/arm-trusted-firmware/archive/{{ .arm_trusted_firmware_version }}.tar.gz + destination: arm-trusted-firmware.tar.gz + sha256: "{{ .arm_trusted_firmware_sha256 }}" + sha512: "{{ .arm_trusted_firmware_sha512 }}" + env: + SOURCE_DATE_EPOCH: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }} + prepare: + - | + mkdir -p /usr/bin \ + && ln -sf /toolchain/bin/env /usr/bin/env + + tar xf arm-trusted-firmware.tar.gz --strip-components=1 + + patch -p0 < /pkg/patches/platform.mk.patch + # rk3399 + build: + - | + make realclean + mkdir -p $(pwd)/build/rk3399/release/ + cp -r /pkg/m0 $(pwd)/build/rk3399/release/ + + # https://salsa.debian.org/debian/arm-trusted-firmware/-/commit/6424a59e08585af7f8a56f1e16ecc6a6b9e4ad7a + # https://salsa.debian.org/debian/arm-trusted-firmware/-/commit/6ed8f61df3b07bb22a68a0fc189ec3b3f7b00dbd + # https://developer.trustedfirmware.org/T996 + TF_LDFLAGS=--no-warn-rwx-segments CFLAGS=--param=min-pagesize=0 make -j $(nproc) PLAT=rk3399 DEBUG=0 bl31 + install: + - | + mkdir -p /rootfs/arm-trusted-firmware/rockpi4 + + cp build/rk3399/release/bl31/bl31.elf /rootfs/arm-trusted-firmware/rockpi4/bl31.elf +finalize: + - from: /rootfs + to: /libs diff --git a/artifacts/rockpi4/u-boot/patches/board-rock-pi-4-enable-spi-flash.patch b/artifacts/rockpi4/u-boot/patches/board-rock-pi-4-enable-spi-flash.patch new file mode 100644 index 00000000..12ec2bfa --- /dev/null +++ b/artifacts/rockpi4/u-boot/patches/board-rock-pi-4-enable-spi-flash.patch @@ -0,0 +1,153 @@ +# copied from https://github.com/armbian/build/blob/09e416e31cc01ece4533a65f02a470a4c21b90ea/patch/u-boot/u-boot-rockchip64/board-rock-pi-4-enable-spi-flash.patch +# and modified for u-boot v2023.01 +diff --git arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi +index c17e769f64..bd8c60b4cd 100644 +--- arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi ++++ arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi +@@ -8,7 +8,27 @@ + + / { + chosen { +- u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc; ++ u-boot,spl-boot-order = "same-as-spl", &spi_flash, &sdmmc, &sdhci; ++ }; ++ ++ config { ++ u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */ ++ }; ++}; ++ ++&spi1 { ++ status = "okay"; ++ ++ flash@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <10000000>; ++ }; ++}; ++ ++&spi1 { ++ spi_flash: flash@0 { ++ u-boot,dm-pre-reloc; + }; + }; + +diff --git configs/rock-pi-4-rk3399_defconfig configs/rock-pi-4-rk3399_defconfig +index 91ecb6d9f1..2e9b92614c 100644 +--- configs/rock-pi-4-rk3399_defconfig ++++ configs/rock-pi-4-rk3399_defconfig +@@ -4,12 +4,16 @@ CONFIG_COUNTER_FREQUENCY=24000000 + CONFIG_ARCH_ROCKCHIP=y + CONFIG_TEXT_BASE=0x00200000 + CONFIG_NR_DRAM_BANKS=1 ++CONFIG_ENV_SIZE=0x6000 + CONFIG_ENV_OFFSET=0x3F8000 ++CONFIG_ENV_SECT_SIZE=0x1000 + CONFIG_DEFAULT_DEVICE_TREE="rk3399-rock-pi-4b" + CONFIG_ROCKCHIP_RK3399=y + CONFIG_TARGET_EVB_RK3399=y + CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SPL_SPI_FLASH_SUPPORT=y ++CONFIG_SPL_SPI_SUPPORT=y + CONFIG_SYS_LOAD_ADDR=0x800800 + CONFIG_DEBUG_UART=y + CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +@@ -28,6 +32,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x2000 + CONFIG_SPL_STACK=0x400000 + CONFIG_SPL_STACK_R=y + CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 ++CONFIG_SPL_SPI_LOAD=y + CONFIG_TPL=y + CONFIG_CMD_BOOTZ=y + CONFIG_CMD_NVEDIT_EFI=y +@@ -43,8 +48,9 @@ CONFIG_CMD_EFIDEBUG=y + CONFIG_CMD_TIME=y + CONFIG_SPL_OF_CONTROL=y + CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +-CONFIG_ENV_IS_IN_MMC=y ++CONFIG_ENV_IS_IN_SPI_FLASH=y + CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_SPL_DM_SEQ_ALIAS=y + CONFIG_DFU_MMC=y + CONFIG_ROCKCHIP_GPIO=y + CONFIG_SYS_I2C_ROCKCHIP=y +@@ -54,6 +60,10 @@ CONFIG_MMC_DW=y + CONFIG_MMC_DW_ROCKCHIP=y + CONFIG_MMC_SDHCI=y + CONFIG_MMC_SDHCI_ROCKCHIP=y ++CONFIG_SF_DEFAULT_BUS=1 ++CONFIG_SPI_FLASH_GIGADEVICE=y ++CONFIG_SPI_FLASH_WINBOND=y ++CONFIG_SPI_FLASH_XTX=y + CONFIG_ETH_DESIGNWARE=y + CONFIG_GMAC_ROCKCHIP=y + CONFIG_NVME_PCI=y +@@ -68,6 +78,7 @@ CONFIG_RAM_RK3399_LPDDR4=y + CONFIG_DM_RESET=y + CONFIG_BAUDRATE=1500000 + CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_ROCKCHIP_SPI=y + CONFIG_SYSRESET=y + CONFIG_USB=y + CONFIG_USB_XHCI_HCD=y +diff --git configs/rock-pi-4c-rk3399_defconfig configs/rock-pi-4c-rk3399_defconfig +index bd21a4c8b6..ffcb5d4b67 100644 +--- configs/rock-pi-4c-rk3399_defconfig ++++ configs/rock-pi-4c-rk3399_defconfig +@@ -4,12 +4,16 @@ CONFIG_COUNTER_FREQUENCY=24000000 + CONFIG_ARCH_ROCKCHIP=y + CONFIG_TEXT_BASE=0x00200000 + CONFIG_NR_DRAM_BANKS=1 ++CONFIG_ENV_SIZE=0x6000 + CONFIG_ENV_OFFSET=0x3F8000 ++CONFIG_ENV_SECT_SIZE=0x1000 + CONFIG_DEFAULT_DEVICE_TREE="rk3399-rock-pi-4c" + CONFIG_ROCKCHIP_RK3399=y + CONFIG_TARGET_EVB_RK3399=y + CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SPL_SPI_FLASH_SUPPORT=y ++CONFIG_SPL_SPI_SUPPORT=y + CONFIG_SYS_LOAD_ADDR=0x800800 + CONFIG_DEBUG_UART=y + CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +@@ -28,6 +32,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x2000 + CONFIG_SPL_STACK=0x400000 + CONFIG_SPL_STACK_R=y + CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 ++CONFIG_SPL_SPI_LOAD=y + CONFIG_TPL=y + CONFIG_CMD_BOOTZ=y + CONFIG_CMD_NVEDIT_EFI=y +@@ -43,8 +48,9 @@ CONFIG_CMD_EFIDEBUG=y + CONFIG_CMD_TIME=y + CONFIG_SPL_OF_CONTROL=y + CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +-CONFIG_ENV_IS_IN_MMC=y ++CONFIG_ENV_IS_IN_SPI_FLASH=y + CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_SPL_DM_SEQ_ALIAS=y + CONFIG_DFU_MMC=y + CONFIG_ROCKCHIP_GPIO=y + CONFIG_SYS_I2C_ROCKCHIP=y +@@ -54,6 +60,10 @@ CONFIG_MMC_DW=y + CONFIG_MMC_DW_ROCKCHIP=y + CONFIG_MMC_SDHCI=y + CONFIG_MMC_SDHCI_ROCKCHIP=y ++CONFIG_SF_DEFAULT_BUS=1 ++CONFIG_SPI_FLASH_GIGADEVICE=y ++CONFIG_SPI_FLASH_WINBOND=y ++CONFIG_SPI_FLASH_XTX=y + CONFIG_ETH_DESIGNWARE=y + CONFIG_GMAC_ROCKCHIP=y + CONFIG_NVME_PCI=y +@@ -68,6 +78,7 @@ CONFIG_RAM_RK3399_LPDDR4=y + CONFIG_DM_RESET=y + CONFIG_BAUDRATE=1500000 + CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_ROCKCHIP_SPI=y + CONFIG_SYSRESET=y + CONFIG_USB=y + CONFIG_USB_XHCI_HCD=y diff --git a/artifacts/rockpi4/u-boot/patches/enable-boot-from-spi-flash.patch b/artifacts/rockpi4/u-boot/patches/enable-boot-from-spi-flash.patch new file mode 100644 index 00000000..5e5dd3df --- /dev/null +++ b/artifacts/rockpi4/u-boot/patches/enable-boot-from-spi-flash.patch @@ -0,0 +1,26 @@ +# this patch was missing from https://github.com/armbian/build/blob/09e416e31cc01ece4533a65f02a470a4c21b90ea/patch/u-boot/u-boot-rockchip64/board-rock-pi-4-enable-spi-flash.patch +# and prevented booting from SPI +diff --git configs/rock-pi-4-rk3399_defconfig configs/rock-pi-4-rk3399_defconfig +index 2e9b92614c..a87d011473 100644 +--- configs/rock-pi-4-rk3399_defconfig ++++ configs/rock-pi-4-rk3399_defconfig +@@ -12,6 +12,7 @@ CONFIG_ROCKCHIP_RK3399=y + CONFIG_TARGET_EVB_RK3399=y + CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SPL_SPI=y + CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI_SUPPORT=y + CONFIG_SYS_LOAD_ADDR=0x800800 +diff --git configs/rock-pi-4c-rk3399_defconfig configs/rock-pi-4c-rk3399_defconfig +index ffcb5d4b67..744b769076 100644 +--- configs/rock-pi-4c-rk3399_defconfig ++++ configs/rock-pi-4c-rk3399_defconfig +@@ -12,6 +12,7 @@ CONFIG_ROCKCHIP_RK3399=y + CONFIG_TARGET_EVB_RK3399=y + CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SPL_SPI=y + CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI_SUPPORT=y + CONFIG_SYS_LOAD_ADDR=0x800800 diff --git a/artifacts/rockpi4/u-boot/patches/general-add-xtx-spi-nor-chips.patch b/artifacts/rockpi4/u-boot/patches/general-add-xtx-spi-nor-chips.patch new file mode 100644 index 00000000..f4005774 --- /dev/null +++ b/artifacts/rockpi4/u-boot/patches/general-add-xtx-spi-nor-chips.patch @@ -0,0 +1,14 @@ +# copied from https://github.com/armbian/build/blob/09e416e31cc01ece4533a65f02a470a4c21b90ea/patch/u-boot/u-boot-rockchip64/general-add-xtx-spi-nor-chips.patch +# and modified for u-boot v2023.01 +diff --git drivers/mtd/spi/spi-nor-ids.c drivers/mtd/spi/spi-nor-ids.c +index 7050ddc397..1d982c8994 100644 +--- drivers/mtd/spi/spi-nor-ids.c ++++ drivers/mtd/spi/spi-nor-ids.c +@@ -387,6 +387,7 @@ const struct flash_info spi_nor_ids[] = { + #endif + #ifdef CONFIG_SPI_FLASH_XTX + /* XTX Technology (Shenzhen) Limited */ ++ { INFO("xt25f32b", 0x0b4016, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { INFO("xt25f128b", 0x0b4018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + #endif + { }, diff --git a/artifacts/rockpi4/u-boot/pkg.yaml b/artifacts/rockpi4/u-boot/pkg.yaml new file mode 100644 index 00000000..788abc8e --- /dev/null +++ b/artifacts/rockpi4/u-boot/pkg.yaml @@ -0,0 +1,52 @@ +# References: +# U-Boot: +# - https://u-boot.readthedocs.io/en/latest +# Broadcom/RaspberryPi +# - https://github.com/u-boot/u-boot/blob/master/doc/board/broadcom/raspberrypi.rst +name: u-boot-rockpi4 +variant: scratch +shell: /toolchain/bin/bash +dependencies: + - stage: base + - stage: arm-trusted-firmware +steps: + - sources: + - url: https://ftp.denx.de/pub/u-boot/u-boot-{{ .uboot_version }}.tar.bz2 + destination: u-boot.tar.bz2 + sha256: "{{ .uboot_sha256 }}" + sha512: "{{ .uboot_sha512 }}" + env: + SOURCE_DATE_EPOCH: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }} + prepare: + # rock-pi-4-rk3399 + - | + mkdir -p /usr/bin \ + && ln -sf /toolchain/bin/env /usr/bin/env + + tar xf u-boot.tar.bz2 --strip-components=1 + - | + patch -p0 < /pkg/patches/board-rock-pi-4-enable-spi-flash.patch + patch -p0 < /pkg/patches/general-add-xtx-spi-nor-chips.patch + patch -p0 < /pkg/patches/enable-boot-from-spi-flash.patch + + make rock-pi-4-rk3399_defconfig + sed -i "s/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/" .config + build: + - | + make -j $(nproc) HOSTLDLIBS_mkimage="-lssl -lcrypto" BL31=/libs/arm-trusted-firmware/rockpi4/bl31.elf + + # create spi image + # https://github.com/armbian/build/blob/09e416e31cc01ece4533a65f02a470a4c21b90ea/config/sources/families/include/rockchip64_common.inc#L173-L178 + tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin rkspi_tpl_spl.img + dd if=/dev/zero of=rkspi_loader.img count=8128 status=none + dd if=rkspi_tpl_spl.img of=rkspi_loader.img conv=notrunc status=none + dd if=u-boot.itb of=rkspi_loader.img seek=768 conv=notrunc status=none + install: + - | + mkdir -p /rootfs/artifacts/arm64/u-boot/rockpi4 + cp u-boot-rockchip.bin /rootfs/artifacts/arm64/u-boot/rockpi4 + + cp rkspi_loader.img /rootfs/artifacts/arm64/u-boot/rockpi4 +finalize: + - from: /rootfs + to: /rootfs diff --git a/artifacts/rockpi4c/u-boot/patches/board-rock-pi-4-enable-spi-flash.patch b/artifacts/rockpi4c/u-boot/patches/board-rock-pi-4-enable-spi-flash.patch new file mode 100644 index 00000000..12ec2bfa --- /dev/null +++ b/artifacts/rockpi4c/u-boot/patches/board-rock-pi-4-enable-spi-flash.patch @@ -0,0 +1,153 @@ +# copied from https://github.com/armbian/build/blob/09e416e31cc01ece4533a65f02a470a4c21b90ea/patch/u-boot/u-boot-rockchip64/board-rock-pi-4-enable-spi-flash.patch +# and modified for u-boot v2023.01 +diff --git arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi +index c17e769f64..bd8c60b4cd 100644 +--- arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi ++++ arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi +@@ -8,7 +8,27 @@ + + / { + chosen { +- u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc; ++ u-boot,spl-boot-order = "same-as-spl", &spi_flash, &sdmmc, &sdhci; ++ }; ++ ++ config { ++ u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */ ++ }; ++}; ++ ++&spi1 { ++ status = "okay"; ++ ++ flash@0 { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <10000000>; ++ }; ++}; ++ ++&spi1 { ++ spi_flash: flash@0 { ++ u-boot,dm-pre-reloc; + }; + }; + +diff --git configs/rock-pi-4-rk3399_defconfig configs/rock-pi-4-rk3399_defconfig +index 91ecb6d9f1..2e9b92614c 100644 +--- configs/rock-pi-4-rk3399_defconfig ++++ configs/rock-pi-4-rk3399_defconfig +@@ -4,12 +4,16 @@ CONFIG_COUNTER_FREQUENCY=24000000 + CONFIG_ARCH_ROCKCHIP=y + CONFIG_TEXT_BASE=0x00200000 + CONFIG_NR_DRAM_BANKS=1 ++CONFIG_ENV_SIZE=0x6000 + CONFIG_ENV_OFFSET=0x3F8000 ++CONFIG_ENV_SECT_SIZE=0x1000 + CONFIG_DEFAULT_DEVICE_TREE="rk3399-rock-pi-4b" + CONFIG_ROCKCHIP_RK3399=y + CONFIG_TARGET_EVB_RK3399=y + CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SPL_SPI_FLASH_SUPPORT=y ++CONFIG_SPL_SPI_SUPPORT=y + CONFIG_SYS_LOAD_ADDR=0x800800 + CONFIG_DEBUG_UART=y + CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +@@ -28,6 +32,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x2000 + CONFIG_SPL_STACK=0x400000 + CONFIG_SPL_STACK_R=y + CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 ++CONFIG_SPL_SPI_LOAD=y + CONFIG_TPL=y + CONFIG_CMD_BOOTZ=y + CONFIG_CMD_NVEDIT_EFI=y +@@ -43,8 +48,9 @@ CONFIG_CMD_EFIDEBUG=y + CONFIG_CMD_TIME=y + CONFIG_SPL_OF_CONTROL=y + CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +-CONFIG_ENV_IS_IN_MMC=y ++CONFIG_ENV_IS_IN_SPI_FLASH=y + CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_SPL_DM_SEQ_ALIAS=y + CONFIG_DFU_MMC=y + CONFIG_ROCKCHIP_GPIO=y + CONFIG_SYS_I2C_ROCKCHIP=y +@@ -54,6 +60,10 @@ CONFIG_MMC_DW=y + CONFIG_MMC_DW_ROCKCHIP=y + CONFIG_MMC_SDHCI=y + CONFIG_MMC_SDHCI_ROCKCHIP=y ++CONFIG_SF_DEFAULT_BUS=1 ++CONFIG_SPI_FLASH_GIGADEVICE=y ++CONFIG_SPI_FLASH_WINBOND=y ++CONFIG_SPI_FLASH_XTX=y + CONFIG_ETH_DESIGNWARE=y + CONFIG_GMAC_ROCKCHIP=y + CONFIG_NVME_PCI=y +@@ -68,6 +78,7 @@ CONFIG_RAM_RK3399_LPDDR4=y + CONFIG_DM_RESET=y + CONFIG_BAUDRATE=1500000 + CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_ROCKCHIP_SPI=y + CONFIG_SYSRESET=y + CONFIG_USB=y + CONFIG_USB_XHCI_HCD=y +diff --git configs/rock-pi-4c-rk3399_defconfig configs/rock-pi-4c-rk3399_defconfig +index bd21a4c8b6..ffcb5d4b67 100644 +--- configs/rock-pi-4c-rk3399_defconfig ++++ configs/rock-pi-4c-rk3399_defconfig +@@ -4,12 +4,16 @@ CONFIG_COUNTER_FREQUENCY=24000000 + CONFIG_ARCH_ROCKCHIP=y + CONFIG_TEXT_BASE=0x00200000 + CONFIG_NR_DRAM_BANKS=1 ++CONFIG_ENV_SIZE=0x6000 + CONFIG_ENV_OFFSET=0x3F8000 ++CONFIG_ENV_SECT_SIZE=0x1000 + CONFIG_DEFAULT_DEVICE_TREE="rk3399-rock-pi-4c" + CONFIG_ROCKCHIP_RK3399=y + CONFIG_TARGET_EVB_RK3399=y + CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SPL_SPI_FLASH_SUPPORT=y ++CONFIG_SPL_SPI_SUPPORT=y + CONFIG_SYS_LOAD_ADDR=0x800800 + CONFIG_DEBUG_UART=y + CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +@@ -28,6 +32,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x2000 + CONFIG_SPL_STACK=0x400000 + CONFIG_SPL_STACK_R=y + CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 ++CONFIG_SPL_SPI_LOAD=y + CONFIG_TPL=y + CONFIG_CMD_BOOTZ=y + CONFIG_CMD_NVEDIT_EFI=y +@@ -43,8 +48,9 @@ CONFIG_CMD_EFIDEBUG=y + CONFIG_CMD_TIME=y + CONFIG_SPL_OF_CONTROL=y + CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +-CONFIG_ENV_IS_IN_MMC=y ++CONFIG_ENV_IS_IN_SPI_FLASH=y + CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_SPL_DM_SEQ_ALIAS=y + CONFIG_DFU_MMC=y + CONFIG_ROCKCHIP_GPIO=y + CONFIG_SYS_I2C_ROCKCHIP=y +@@ -54,6 +60,10 @@ CONFIG_MMC_DW=y + CONFIG_MMC_DW_ROCKCHIP=y + CONFIG_MMC_SDHCI=y + CONFIG_MMC_SDHCI_ROCKCHIP=y ++CONFIG_SF_DEFAULT_BUS=1 ++CONFIG_SPI_FLASH_GIGADEVICE=y ++CONFIG_SPI_FLASH_WINBOND=y ++CONFIG_SPI_FLASH_XTX=y + CONFIG_ETH_DESIGNWARE=y + CONFIG_GMAC_ROCKCHIP=y + CONFIG_NVME_PCI=y +@@ -68,6 +78,7 @@ CONFIG_RAM_RK3399_LPDDR4=y + CONFIG_DM_RESET=y + CONFIG_BAUDRATE=1500000 + CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_ROCKCHIP_SPI=y + CONFIG_SYSRESET=y + CONFIG_USB=y + CONFIG_USB_XHCI_HCD=y diff --git a/artifacts/rockpi4c/u-boot/patches/enable-boot-from-spi-flash.patch b/artifacts/rockpi4c/u-boot/patches/enable-boot-from-spi-flash.patch new file mode 100644 index 00000000..5e5dd3df --- /dev/null +++ b/artifacts/rockpi4c/u-boot/patches/enable-boot-from-spi-flash.patch @@ -0,0 +1,26 @@ +# this patch was missing from https://github.com/armbian/build/blob/09e416e31cc01ece4533a65f02a470a4c21b90ea/patch/u-boot/u-boot-rockchip64/board-rock-pi-4-enable-spi-flash.patch +# and prevented booting from SPI +diff --git configs/rock-pi-4-rk3399_defconfig configs/rock-pi-4-rk3399_defconfig +index 2e9b92614c..a87d011473 100644 +--- configs/rock-pi-4-rk3399_defconfig ++++ configs/rock-pi-4-rk3399_defconfig +@@ -12,6 +12,7 @@ CONFIG_ROCKCHIP_RK3399=y + CONFIG_TARGET_EVB_RK3399=y + CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SPL_SPI=y + CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI_SUPPORT=y + CONFIG_SYS_LOAD_ADDR=0x800800 +diff --git configs/rock-pi-4c-rk3399_defconfig configs/rock-pi-4c-rk3399_defconfig +index ffcb5d4b67..744b769076 100644 +--- configs/rock-pi-4c-rk3399_defconfig ++++ configs/rock-pi-4c-rk3399_defconfig +@@ -12,6 +12,7 @@ CONFIG_ROCKCHIP_RK3399=y + CONFIG_TARGET_EVB_RK3399=y + CONFIG_DEBUG_UART_BASE=0xFF1A0000 + CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SPL_SPI=y + CONFIG_SPL_SPI_FLASH_SUPPORT=y + CONFIG_SPL_SPI_SUPPORT=y + CONFIG_SYS_LOAD_ADDR=0x800800 diff --git a/artifacts/rockpi4c/u-boot/patches/general-add-xtx-spi-nor-chips.patch b/artifacts/rockpi4c/u-boot/patches/general-add-xtx-spi-nor-chips.patch new file mode 100644 index 00000000..f4005774 --- /dev/null +++ b/artifacts/rockpi4c/u-boot/patches/general-add-xtx-spi-nor-chips.patch @@ -0,0 +1,14 @@ +# copied from https://github.com/armbian/build/blob/09e416e31cc01ece4533a65f02a470a4c21b90ea/patch/u-boot/u-boot-rockchip64/general-add-xtx-spi-nor-chips.patch +# and modified for u-boot v2023.01 +diff --git drivers/mtd/spi/spi-nor-ids.c drivers/mtd/spi/spi-nor-ids.c +index 7050ddc397..1d982c8994 100644 +--- drivers/mtd/spi/spi-nor-ids.c ++++ drivers/mtd/spi/spi-nor-ids.c +@@ -387,6 +387,7 @@ const struct flash_info spi_nor_ids[] = { + #endif + #ifdef CONFIG_SPI_FLASH_XTX + /* XTX Technology (Shenzhen) Limited */ ++ { INFO("xt25f32b", 0x0b4016, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { INFO("xt25f128b", 0x0b4018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + #endif + { }, diff --git a/artifacts/rockpi4c/u-boot/pkg.yaml b/artifacts/rockpi4c/u-boot/pkg.yaml new file mode 100644 index 00000000..9b47fde8 --- /dev/null +++ b/artifacts/rockpi4c/u-boot/pkg.yaml @@ -0,0 +1,52 @@ +# References: +# U-Boot: +# - https://u-boot.readthedocs.io/en/latest +# Broadcom/RaspberryPi +# - https://github.com/u-boot/u-boot/blob/master/doc/board/broadcom/raspberrypi.rst +name: u-boot-rockpi4c +variant: scratch +shell: /toolchain/bin/bash +dependencies: + - stage: base + - stage: arm-trusted-firmware +steps: + - sources: + - url: https://ftp.denx.de/pub/u-boot/u-boot-{{ .uboot_version }}.tar.bz2 + destination: u-boot.tar.bz2 + sha256: "{{ .uboot_sha256 }}" + sha512: "{{ .uboot_sha512 }}" + env: + SOURCE_DATE_EPOCH: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }} + prepare: + # rock-pi-4c-rk3399 + - | + mkdir -p /usr/bin \ + && ln -sf /toolchain/bin/env /usr/bin/env + + tar xf u-boot.tar.bz2 --strip-components=1 + - | + patch -p0 < /pkg/patches/board-rock-pi-4-enable-spi-flash.patch + patch -p0 < /pkg/patches/general-add-xtx-spi-nor-chips.patch + patch -p0 < /pkg/patches/enable-boot-from-spi-flash.patch + + make rock-pi-4c-rk3399_defconfig + sed -i "s/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/" .config + build: + - | + make -j $(nproc) HOSTLDLIBS_mkimage="-lssl -lcrypto" BL31=/libs/arm-trusted-firmware/rockpi4/bl31.elf + + # create spi image + # https://github.com/armbian/build/blob/09e416e31cc01ece4533a65f02a470a4c21b90ea/config/sources/families/include/rockchip64_common.inc#L173-L178 + tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin rkspi_tpl_spl.img + dd if=/dev/zero of=rkspi_loader.img count=8128 status=none + dd if=rkspi_tpl_spl.img of=rkspi_loader.img conv=notrunc status=none + dd if=u-boot.itb of=rkspi_loader.img seek=768 conv=notrunc status=none + install: + - | + mkdir -p /rootfs/artifacts/arm64/u-boot/rockpi4c + cp u-boot-rockchip.bin /rootfs/artifacts/arm64/u-boot/rockpi4c + + cp rkspi_loader.img /rootfs/artifacts/arm64/u-boot/rockpi4c +finalize: + - from: /rootfs + to: /rootfs diff --git a/artifacts/u-boot/pkg.yaml b/artifacts/u-boot/pkg.yaml deleted file mode 100644 index 868bd7b4..00000000 --- a/artifacts/u-boot/pkg.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# References: -# U-Boot: -# - https://u-boot.readthedocs.io/en/latest -# Broadcom/RaspberryPi -# - https://github.com/u-boot/u-boot/blob/master/doc/board/broadcom/raspberrypi.rst -name: u-boot -variant: scratch -shell: /toolchain/bin/bash -dependencies: - - stage: base -steps: - - sources: - - url: https://ftp.denx.de/pub/u-boot/u-boot-{{ .uboot_version }}.tar.bz2 - destination: u-boot.tar.bz2 - sha256: "{{ .uboot_sha256 }}" - sha512: "{{ .uboot_sha512 }}" - env: - SOURCE_DATE_EPOCH: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }} - prepare: - - | - mkdir -p /usr/bin \ - && ln -sf /toolchain/bin/env /usr/bin/env - - tar xf u-boot.tar.bz2 --strip-components=1 - - | - make _defconfig - sed -i "s/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/" .config - build: - - | - make -j $(nproc) HOSTLDLIBS_mkimage="-lssl -lcrypto" - install: - - | - mkdir -p /rootfs/artifacts/arm64/u-boot/board - cp -v u-boot.bin /rootfs/artifacts/arm64/u-boot/board -finalize: - - from: /rootfs - to: /rootfs diff --git a/go.work b/go.work index c35cdff2..e7e0c463 100644 --- a/go.work +++ b/go.work @@ -1,3 +1,6 @@ go 1.22.1 -use ./installers/board/src +use ( + ./installers/rockpi4/src + ./installers/rockpi4c/src +) diff --git a/hack/release.sh b/hack/release.sh new file mode 100755 index 00000000..42a288b1 --- /dev/null +++ b/hack/release.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. +# +# Generated on 2024-03-14T09:48:15Z by kres latest. + +set -e + +RELEASE_TOOL_IMAGE="ghcr.io/siderolabs/release-tool:latest" + +function release-tool { + docker pull "${RELEASE_TOOL_IMAGE}" >/dev/null + docker run --rm -w /src -v "${PWD}":/src:ro "${RELEASE_TOOL_IMAGE}" -l -d -n -t "${1}" ./hack/release.toml +} + +function changelog { + if [ "$#" -eq 1 ]; then + (release-tool ${1}; echo; cat CHANGELOG.md) > CHANGELOG.md- && mv CHANGELOG.md- CHANGELOG.md + else + echo 1>&2 "Usage: $0 changelog [tag]" + exit 1 + fi +} + +function release-notes { + release-tool "${2}" > "${1}" +} + +function cherry-pick { + if [ $# -ne 2 ]; then + echo 1>&2 "Usage: $0 cherry-pick " + exit 1 + fi + + git checkout $2 + git fetch + git rebase upstream/$2 + git cherry-pick -x $1 +} + +function commit { + if [ $# -ne 1 ]; then + echo 1>&2 "Usage: $0 commit " + exit 1 + fi + + git commit -s -m "release($1): prepare release" -m "This is the official $1 release." +} + +if declare -f "$1" > /dev/null +then + cmd="$1" + shift + $cmd "$@" +else + cat < . + CGO_ENABLED=0 go build -o ./rockpi4 . install: - | mkdir -p /rootfs/installers/ - cp -p /pkg/src/ /rootfs/installers/ + cp /pkg/src/rockpi4 /rootfs/installers/rockpi4 finalize: - from: /rootfs - to: / + to: /rootfs diff --git a/installers/board/src/go.mod b/installers/rockpi4/src/go.mod similarity index 51% rename from installers/board/src/go.mod rename to installers/rockpi4/src/go.mod index 68613872..5b779430 100644 --- a/installers/board/src/go.mod +++ b/installers/rockpi4/src/go.mod @@ -1,10 +1,11 @@ -module board +module rockpi4 go 1.22.1 require ( github.com/siderolabs/go-copy v0.1.0 - github.com/siderolabs/talos/pkg/machinery v1.6.0-alpha.2.0.20240312171629-d118a852b995 + github.com/siderolabs/talos/pkg/machinery v1.7.0-alpha.1 + golang.org/x/sys v0.16.0 ) require gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/installers/board/src/go.sum b/installers/rockpi4/src/go.sum similarity index 59% rename from installers/board/src/go.sum rename to installers/rockpi4/src/go.sum index c13c2dcd..6a910867 100644 --- a/installers/board/src/go.sum +++ b/installers/rockpi4/src/go.sum @@ -1,7 +1,9 @@ github.com/siderolabs/go-copy v0.1.0 h1:OIWCtSg+rhOtnIZTpT31Gfpn17rv5kwJqQHG+QUEgC8= github.com/siderolabs/go-copy v0.1.0/go.mod h1:4bF2rZOZAR/ags/U4AVSpjFE5RPGdEeSkOq6yR9YOkU= -github.com/siderolabs/talos/pkg/machinery v1.6.0-alpha.2.0.20240312171629-d118a852b995 h1:XZ+lxBlWbkpt/2ksu+q3h7zDphR3wqs0PirsOScg1Jk= -github.com/siderolabs/talos/pkg/machinery v1.6.0-alpha.2.0.20240312171629-d118a852b995/go.mod h1:ZCx55VkLuZ/dpvEo3YfIzNS9nLphvjTMxwCXZ8eLMd0= +github.com/siderolabs/talos/pkg/machinery v1.7.0-alpha.1 h1:0pURmnbzsu19reku8OjN1DkeAxgkmuxmKgDgbFT3228= +github.com/siderolabs/talos/pkg/machinery v1.7.0-alpha.1/go.mod h1:H2+5QeGXYi2Q7RhBNUAD6dhc9LmdJ2AUXtiAWRXtWBc= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/installers/rockpi4/src/main.go b/installers/rockpi4/src/main.go new file mode 100644 index 00000000..c3bcfbf1 --- /dev/null +++ b/installers/rockpi4/src/main.go @@ -0,0 +1,85 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package main + +import ( + _ "embed" + "fmt" + "os" + "path/filepath" + + "github.com/siderolabs/go-copy/copy" + "github.com/siderolabs/talos/pkg/machinery/overlay" + "github.com/siderolabs/talos/pkg/machinery/overlay/adapter" + "golang.org/x/sys/unix" +) + +const ( + off int64 = 512 * 64 + // https://github.com/u-boot/u-boot/blob/4de720e98d552dfda9278516bf788c4a73b3e56f/configs/rock-pi-4-rk3399_defconfig#L7= + // 4a and 4b uses the same overlay. + dtb = "rockchip/rk3399-rock-pi-4b.dtb" +) + +func main() { + adapter.Execute(&rockPi4{}) +} + +type rockPi4 struct{} + +type rockPi4ExtraOptions struct{} + +func (i *rockPi4) GetOptions(extra rockPi4ExtraOptions) (overlay.Options, error) { + return overlay.Options{ + Name: "rockpi4", + KernelArgs: []string{ + "console=tty0", + "console=ttyS2,1500000n8", + "sysctl.kernel.kexec_load_disabled=1", + "talos.dashboard.disabled=1", + }, + PartitionOptions: overlay.PartitionOptions{ + Offset: 2048 * 10, + }, + }, nil +} + +func (i *rockPi4) Install(options overlay.InstallOptions[rockPi4ExtraOptions]) error { + var f *os.File + + f, err := os.OpenFile(options.InstallDisk, os.O_RDWR|unix.O_CLOEXEC, 0o666) + if err != nil { + return fmt.Errorf("failed to open %s: %w", options.InstallDisk, err) + } + + defer f.Close() //nolint:errcheck + + uboot, err := os.ReadFile(filepath.Join(options.ArtifactsPath, "artifacts/arm64/u-boot/rockpi4/u-boot-rockchip.bin")) + if err != nil { + return err + } + + if _, err = f.WriteAt(uboot, off); err != nil { + return err + } + + // NB: In the case that the block device is a loopback device, we sync here + // to esure that the file is written before the loopback device is + // unmounted. + err = f.Sync() + if err != nil { + return err + } + + src := filepath.Join(options.ArtifactsPath, "artifacts/arm64/dtb", dtb) + dst := filepath.Join(options.MountPrefix, "/boot/EFI/dtb", dtb) + + err = os.MkdirAll(filepath.Dir(dst), 0o600) + if err != nil { + return err + } + + return copy.File(src, dst) +} diff --git a/installers/rockpi4c/pkg.yaml b/installers/rockpi4c/pkg.yaml new file mode 100644 index 00000000..e5390717 --- /dev/null +++ b/installers/rockpi4c/pkg.yaml @@ -0,0 +1,25 @@ +name: rockpi4c +variant: scratch +shell: /toolchain/bin/bash +dependencies: + - stage: base +steps: + - env: + GOPATH: /go + cachePaths: + - /.cache/go-build + - /go/pkg + build: + - | + export PATH=${PATH}:${TOOLCHAIN}/go/bin + + cd /pkg/src + CGO_ENABLED=0 go build -o ./rockpi4c . + install: + - | + mkdir -p /rootfs/installers/ + + cp /pkg/src/rockpi4c /rootfs/installers/rockpi4c +finalize: + - from: /rootfs + to: /rootfs diff --git a/installers/rockpi4c/src/go.mod b/installers/rockpi4c/src/go.mod new file mode 100644 index 00000000..53a6eaaa --- /dev/null +++ b/installers/rockpi4c/src/go.mod @@ -0,0 +1,11 @@ +module rockpi4c + +go 1.22.1 + +require ( + github.com/siderolabs/go-copy v0.1.0 + github.com/siderolabs/talos/pkg/machinery v1.7.0-alpha.1 + golang.org/x/sys v0.16.0 +) + +require gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/installers/rockpi4c/src/go.sum b/installers/rockpi4c/src/go.sum new file mode 100644 index 00000000..6a910867 --- /dev/null +++ b/installers/rockpi4c/src/go.sum @@ -0,0 +1,10 @@ +github.com/siderolabs/go-copy v0.1.0 h1:OIWCtSg+rhOtnIZTpT31Gfpn17rv5kwJqQHG+QUEgC8= +github.com/siderolabs/go-copy v0.1.0/go.mod h1:4bF2rZOZAR/ags/U4AVSpjFE5RPGdEeSkOq6yR9YOkU= +github.com/siderolabs/talos/pkg/machinery v1.7.0-alpha.1 h1:0pURmnbzsu19reku8OjN1DkeAxgkmuxmKgDgbFT3228= +github.com/siderolabs/talos/pkg/machinery v1.7.0-alpha.1/go.mod h1:H2+5QeGXYi2Q7RhBNUAD6dhc9LmdJ2AUXtiAWRXtWBc= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/installers/rockpi4c/src/main.go b/installers/rockpi4c/src/main.go new file mode 100644 index 00000000..0f5a704c --- /dev/null +++ b/installers/rockpi4c/src/main.go @@ -0,0 +1,84 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package main + +import ( + _ "embed" + "fmt" + "os" + "path/filepath" + + "github.com/siderolabs/go-copy/copy" + "github.com/siderolabs/talos/pkg/machinery/overlay" + "github.com/siderolabs/talos/pkg/machinery/overlay/adapter" + "golang.org/x/sys/unix" +) + +const ( + off int64 = 512 * 64 + // https://github.com/u-boot/u-boot/blob/4de720e98d552dfda9278516bf788c4a73b3e56f/configs/rock-pi-4c-rk3399_defconfig#L7= + dtb = "rockchip/rk3399-rock-pi-4c.dtb" +) + +func main() { + adapter.Execute(&rockPi4{}) +} + +type rockPi4 struct{} + +type rockPi4ExtraOptions struct{} + +func (i *rockPi4) GetOptions(extra rockPi4ExtraOptions) (overlay.Options, error) { + return overlay.Options{ + Name: "rockpi4c", + KernelArgs: []string{ + "console=tty0", + "console=ttyS2,1500000n8", + "sysctl.kernel.kexec_load_disabled=1", + "talos.dashboard.disabled=1", + }, + PartitionOptions: overlay.PartitionOptions{ + Offset: 2048 * 10, + }, + }, nil +} + +func (i *rockPi4) Install(options overlay.InstallOptions[rockPi4ExtraOptions]) error { + var f *os.File + + f, err := os.OpenFile(options.InstallDisk, os.O_RDWR|unix.O_CLOEXEC, 0o666) + if err != nil { + return fmt.Errorf("failed to open %s: %w", options.InstallDisk, err) + } + + defer f.Close() //nolint:errcheck + + uboot, err := os.ReadFile(filepath.Join(options.ArtifactsPath, "artifacts/arm64/u-boot/rockpi4/u-boot-rockchip.bin")) + if err != nil { + return err + } + + if _, err = f.WriteAt(uboot, off); err != nil { + return err + } + + // NB: In the case that the block device is a loopback device, we sync here + // to esure that the file is written before the loopback device is + // unmounted. + err = f.Sync() + if err != nil { + return err + } + + src := filepath.Join(options.ArtifactsPath, "artifacts/arm64/dtb", dtb) + dst := filepath.Join(options.MountPrefix, "/boot/EFI/dtb", dtb) + + err = os.MkdirAll(filepath.Dir(dst), 0o600) + if err != nil { + return err + } + + return copy.File(src, dst) +} diff --git a/profiles/pkg.yaml b/profiles/pkg.yaml index 53260ead..dfe7a799 100644 --- a/profiles/pkg.yaml +++ b/profiles/pkg.yaml @@ -1,5 +1,7 @@ name: profiles variant: scratch finalize: - - from: /pkg/board + - from: /pkg/rockpi4 + to: /rootfs/profiles + - from: /pkg/rockpi4c to: /rootfs/profiles diff --git a/profiles/board/board.yaml b/profiles/rockpi4/rockpi4.yaml similarity index 88% rename from profiles/board/board.yaml rename to profiles/rockpi4/rockpi4.yaml index 03abe943..158064f6 100644 --- a/profiles/board/board.yaml +++ b/profiles/rockpi4/rockpi4.yaml @@ -3,7 +3,7 @@ platform: metal secureboot: false output: kind: image - outFormat: raw + outFormat: xz imageOptions: diskSize: 1306525696 diskFormat: raw diff --git a/profiles/rockpi4c/rockpi4c.yaml b/profiles/rockpi4c/rockpi4c.yaml new file mode 100644 index 00000000..158064f6 --- /dev/null +++ b/profiles/rockpi4c/rockpi4c.yaml @@ -0,0 +1,9 @@ +arch: arm64 +platform: metal +secureboot: false +output: + kind: image + outFormat: xz + imageOptions: + diskSize: 1306525696 + diskFormat: raw