├── .github ├── renovate.json └── workflows │ ├── esr.yml │ ├── flowzone.yml │ ├── npe-x500-m3.yml │ ├── raspberrypi.yml │ ├── raspberrypi0-2w-64.yml │ ├── raspberrypi2.yml │ ├── raspberrypi3-64.yml │ ├── raspberrypi3-unipi-neuron.yml │ ├── raspberrypi3.yml │ ├── raspberrypi4-64.yml │ ├── raspberrypi4-superhub.yml │ ├── raspberrypi4-unipi-neuron.yml │ ├── raspberrypi400-64.yml │ ├── raspberrypi5.yml │ ├── raspberrypicm4-ioboard-sb.yml │ ├── raspberrypicm4-ioboard.yml │ ├── revpi-connect-4.yml │ ├── revpi-connect-s.yml │ ├── revpi-connect.yml │ ├── revpi-core-3.yml │ └── rt-rpi-300.yml ├── .gitignore ├── .gitmodules ├── .versionbot └── CHANGELOG.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── VERSION ├── docs └── rpi-secure-boot.md ├── layers └── meta-balena-raspberrypi │ ├── COPYING.Apache-2.0 │ ├── README.md │ ├── classes │ └── image-sign-rpi.bbclass │ ├── conf │ ├── layer.conf │ ├── machine │ │ ├── fincm3.conf │ │ ├── include │ │ │ ├── revpi.inc │ │ │ └── revpi4.inc │ │ ├── nebra-hnt.conf │ │ ├── npe-x500-m3.conf │ │ ├── raspberrypi3-unipi-neuron.conf │ │ ├── raspberrypi4-superhub.conf │ │ ├── raspberrypi4-unipi-neuron.conf │ │ ├── raspberrypi400-64.conf │ │ ├── raspberrypicm4-ioboard-sb.conf │ │ ├── raspberrypicm4-ioboard.conf │ │ ├── revpi-connect-4.conf │ │ ├── revpi-connect-s.conf │ │ ├── revpi-connect.conf │ │ ├── revpi-core-3.conf │ │ └── rt-rpi-300.conf │ └── samples │ │ ├── bblayers.conf.sample │ │ └── local.conf.sample │ ├── recipes-bsp │ ├── bootfiles │ │ ├── files │ │ │ └── fincm3-dt-blob.bin │ │ ├── rpi-bootfiles.bbappend │ │ ├── rpi-cmdline.bbappend │ │ └── rpi-config_git.bbappend │ ├── rpi-eeprom │ │ ├── files │ │ │ ├── default-config.txt │ │ │ ├── pieeprom-update.sh │ │ │ └── raspberrypicm4-ioboard-sb │ │ │ │ └── default-config.txt │ │ └── rpi-eeprom_git.bb │ ├── rpi-u-boot-scr │ │ ├── rpi-u-boot-scr.bbappend │ │ └── rpi-u-boot-scr │ │ │ ├── boot.cmd.in │ │ │ ├── raspberrypi0-2w-64 │ │ │ └── boot.cmd.in │ │ │ ├── raspberrypi3-64 │ │ │ └── boot.cmd.in │ │ │ └── raspberrypi4-64 │ │ │ └── boot.cmd.in │ └── u-boot │ │ ├── u-boot │ │ ├── 0001-Integrate-machine-independent-resin-environment-conf.patch │ │ ├── 0001-avoid-block-uart-write.patch │ │ ├── 0001-fs-fat-flush-a-directory-cluster-properly.patch │ │ ├── 0001-rpi-Disable-image-flasher-check.patch │ │ ├── 0002-raspberrypi-Disable-simple-framebuffer-support.patch │ │ ├── 0011-enable-nvme-cm4.patch │ │ ├── 0012-rpi-add-NVMe-to-boot-order.patch │ │ ├── 0013-Revert-nvme-Correct-the-prps-per-page-calculation.patch │ │ ├── 0014-nvme-improve-readability-of-nvme_setup_prps.patch │ │ ├── 0015-nvme-Use-pointer-for-CPU-addressed-buffers.patch │ │ ├── 0016-nvme-translate-virtual-addresses-bus-address.patch │ │ ├── 0017-use-temp-ptr-to-buffer.patch │ │ ├── Revert-remove-include-config_defaults.h.patch │ │ ├── configs-Add-bootcount-configs-to-rpi-defconfigs.patch │ │ ├── increase-usb-interface-nr.patch │ │ ├── pi4-fix-crash-when-issuing-usb-reset.patch │ │ ├── rpi-Use-CONFIG_OF_BOARD-instead-of-CONFIG_EMBED.patch │ │ ├── rpi4-include-configs-Use-config-defaults.patch │ │ ├── serial_pl01x-Add-retry-limit-when-writing-to-uart-co.patch │ │ └── u-boot-Remove-usb-start-from-CONFIG_PREBOOT.patch │ │ └── u-boot_%.bbappend │ ├── recipes-connectivity │ ├── bluez5 │ │ └── bluez5_%.bbappend │ └── pi-bluetooth │ │ ├── files │ │ ├── 0002-bthelper-correct-path-for-hciconfig-under-Yocto.patch │ │ └── 0003-bthelper-Set-BDADDR-if-not-initialized.patch │ │ └── pi-bluetooth_%.bbappend │ ├── recipes-containers │ └── docker-disk │ │ └── balena-supervisor.bbappend │ ├── recipes-core │ ├── extra-udev-rules │ │ ├── extra-udev-rules.bbappend │ │ └── files │ │ │ ├── 50-revpi.rules │ │ │ ├── 86-nm-unmanaged-fin.rules │ │ │ └── revpi_mac │ ├── glibc │ │ ├── glibc │ │ │ └── Fix-build-failures-with-GCC11.patch │ │ └── glibc_%.bbappend │ ├── images │ │ ├── balena-image-bootloader-initramfs.bbappend │ │ ├── balena-image-flasher.bbappend │ │ ├── balena-image-initramfs.bbappend │ │ ├── balena-image.bbappend │ │ └── balena-image.inc │ ├── initrdscripts │ │ ├── files │ │ │ ├── cryptsetup-rpi │ │ │ └── kexec_pi4_fwgpio │ │ └── initramfs-framework_%.bbappend │ ├── packagegroups │ │ ├── packagegroup-balena-connectivity.bbappend │ │ └── packagegroup-resin.bbappend │ ├── systemd │ │ ├── systemd-serialgetty.bbappend │ │ ├── systemd │ │ │ └── rpi │ │ │ │ ├── balena-os-sysctl.conf │ │ │ │ └── watchdog.conf │ │ └── systemd_%.bbappend │ └── udev │ │ └── udev-rules-rpi.bbappend │ ├── recipes-devtools │ └── usbboot │ │ └── usbboot-native_git.bb │ ├── recipes-extended │ ├── phoenix-peripheral │ │ └── phoenix-peripheral.bb │ ├── unipi-tools │ │ └── unipi-tools.bb │ ├── userlandtools │ │ ├── files │ │ │ └── 0001-dtoverlay_main-Fix-configfs-mount-failure.patch │ │ └── userlandtools.bb │ └── watchdog │ │ ├── watchdog-config.bbappend │ │ ├── watchdog-config │ │ └── watchdog-phoenix.conf │ │ ├── watchdog │ │ └── 0001-Move-watchdog-service-before-networking.patch │ │ └── watchdog_5.16.bbappend │ ├── recipes-graphics │ └── cairo │ │ └── cairo_%.bbappend │ ├── recipes-kernel │ ├── linux-firmware-rpidistro │ │ ├── linux-firmware-rpidistro │ │ │ └── 0001-Default-43455-firmware-to-standard-variant.patch │ │ └── linux-firmware-rpidistro_git.bb │ ├── linux-kunbus │ │ ├── linux-kunbus │ │ │ ├── 0001-Add-revpi-connect-can-overlay.patch │ │ │ ├── 0001-rtc-hctosys-Correctly-guard-hw-clock-polling-code.patch │ │ │ ├── default-cpu-governor.cfg │ │ │ ├── initramfs-image-bundle.cfg │ │ │ ├── raspberrypi4 │ │ │ │ └── rpi4-nvmem.cfg │ │ │ ├── scripts-Fix-kernel-module-headers-build-in-Honister.patch │ │ │ └── vc4graphics.cfg │ │ ├── linux-kunbus_%.bbappend │ │ ├── linux-kunbus_4.19.95.bb │ │ └── linux-kunbus_6.1.46.bb │ ├── linux │ │ ├── files │ │ │ ├── android-drivers.cfg │ │ │ ├── default-cpu-governor.cfg │ │ │ ├── initramfs-image-bundle.cfg │ │ │ ├── powersave.cfg │ │ │ ├── raspberrypi4 │ │ │ │ └── rpi4-nvmem.cfg │ │ │ └── vc4graphics.cfg │ │ ├── linux-balena-bootloader_%.bbappend │ │ ├── linux-balena-bootloader_6.12.bb │ │ ├── linux-raspberrypi.inc │ │ ├── linux-raspberrypi │ │ │ ├── 0001-Add-npe-x500-m3-overlay.patch │ │ │ ├── 0001-Add-tpm-slb9670-tis-spi-DT-overlay.patch │ │ │ ├── 0001-overlays-Add-overlay-for-RPI-PLC-SC16IS752.patch │ │ │ ├── 0001-overlays-Add-overlay-for-Seeed-reComputer-R1000.patch │ │ │ ├── 0001-seeed-studio-can-bus-v2-Add-dtbo-for-this-can-bus.patch │ │ │ ├── 0001-waveshare-sim7600-Add-dtbo-for-this-modem.patch │ │ │ ├── 0002-wireless-wext-Bring-back-ndo_do_ioctl-fallback.patch │ │ │ ├── 0006-overlays-Add-Hyperpixel4-overlays.patch │ │ │ ├── 0010-dts-overlays-Add-UniPi-overlays.patch │ │ │ ├── 0011-USB-serial-Add-support-for-more-Quectel-modules.patch │ │ │ ├── fincm3 │ │ │ │ ├── 0001-overlays-fin-add-internal-pull-ups-to-i2c_soft.patch │ │ │ │ ├── 0004-mmc-pwrseq-Repurpose-for-Marvell-SD8777.patch │ │ │ │ ├── 0005-balena-fin-wifi-sta-uap-mode.patch │ │ │ │ └── 0007-overlays-Add-spyfly.dts.patch │ │ │ ├── raspberrypi3-unipi-neuron │ │ │ │ └── 0001-pi3neuron-disable-gccplugins.patch │ │ │ ├── raspberrypi4-superhub │ │ │ │ ├── 0001-Add-gpio-wdt-DT-overlay-for-Phoenix-Board.patch │ │ │ │ ├── 0002-Add-infineon-tpm-DT-overlay-for-Phoenix-Board.patch │ │ │ │ ├── 0003-Add-spi1-DT-overlay-for-Phoenix-Board.patch │ │ │ │ └── 0004-Add-SD-host-DT-overlay-for-Phoenix-Board.patch │ │ │ ├── raspberrypicm4-ioboard │ │ │ │ └── 0001-Add-ed-mcp2515-overlay-and-ed-sdhost-overlay.patch │ │ │ └── rt-rpi-300 │ │ │ │ ├── rt-rpi-300-Add-changes-for-this-dt.patch │ │ │ │ └── rt-rpi-Add-ch-432t-driver-for-this-chip.patch │ │ ├── linux-raspberrypi_%.bbappend │ │ ├── linux-raspberrypi_5.15.92 │ │ │ └── 0001-waveshare-sim7600-Add-dtbo-for-this-modem.patch │ │ ├── linux-raspberrypi_5.15.bbappend │ │ ├── linux-raspberrypi_6.12.bb │ │ └── linux-raspberrypi_6.12.bbappend │ ├── picontrol │ │ ├── picontrol │ │ │ ├── 0001-Use-modules_install-as-wanted-by-yocto.patch │ │ │ └── 0002-Search-config-file-in-mnt-boot.patch │ │ ├── picontrol_2020.06.16.bb │ │ └── picontrol_2024.02.05.bb │ ├── sd8887-nxp │ │ ├── files │ │ │ └── COPYING │ │ └── sd8887-nxp.bb │ └── unipi-kernel-modules │ │ ├── files │ │ ├── 0001-unipi_tty-Fix-compile-on-kernel-5.10.patch │ │ ├── 0002-unipi_spi-use-new-structure-for-SPI-transfer-delays.patch │ │ ├── 0003-unipi_tty-remove-TTY_LDISC_MAGIC.patch │ │ ├── 0004-unipi_tty-remove-ldisc-number-in-tty_register_ldisc-.patch │ │ ├── 0005-unipi_tty-adapt-to-fp-of-tty_ldisc_ops-made-const.patch │ │ ├── 0006-unipi_spi-adapt-to-removal-of-spi_set_cs_timing.patch │ │ ├── 0007-rtc-unipi-Adapt-to-removal-of-nvram-ABI.patch │ │ ├── 0008-rtc-unipi-Add-devm-to-rtc_nvmem_register.patch │ │ └── 0009-rtc-unipi-Adapt-to-rename-of-rtc_register_device.patch │ │ └── unipi-kernel-modules.bb │ └── recipes-support │ ├── balena-keys │ └── balena-keys.bbappend │ ├── hostapp-update-hooks │ ├── files │ │ ├── 98-pieeprom │ │ ├── 999-resin-boot-cleaner │ │ └── 9999-bootfiles │ └── hostapp-update-hooks.bbappend │ ├── os-helpers │ ├── os-helpers.bbappend │ └── os-helpers │ │ ├── os-helpers-otp │ │ └── os-helpers-sb │ ├── resin-init │ ├── files │ │ ├── balena-init-flasher-rpi-diskenc │ │ ├── balena-init-flasher-rpi-secureboot │ │ ├── resin-init-board │ │ └── resin-init-flasher-board │ ├── resin-init-board.bbappend │ ├── resin-init-flasher-board.bbappend │ └── resin-init-flasher.bbappend │ └── resin-mounts │ ├── files │ ├── balena-rpi.service │ └── resin-boot.conf │ └── resin-mounts.bbappend ├── npe-x500-m3.coffee ├── raspberrypi.coffee ├── raspberrypi0-2w-64.coffee ├── raspberrypi2.coffee ├── raspberrypi3-64.coffee ├── raspberrypi3-unipi-neuron.coffee ├── raspberrypi3.coffee ├── raspberrypi4-64.coffee ├── raspberrypi4-superhub.coffee ├── raspberrypi4-unipi-neuron.coffee ├── raspberrypi400-64.coffee ├── raspberrypi5.coffee ├── raspberrypicm4-ioboard-sb.coffee ├── raspberrypicm4-ioboard.coffee ├── repo.yml ├── revpi-connect-4.coffee ├── revpi-connect-s.coffee ├── revpi-connect.coffee ├── revpi-core-3.coffee ├── rt-rpi-300.coffee └── tests └── boardtest.sh /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "github>balena-os/renovate-config" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.github/workflows/esr.yml: -------------------------------------------------------------------------------- 1 | name: ESR 2 | 3 | on: 4 | # Run at 00:00 on the second day every 3rd month (quarterly) 5 | schedule: 6 | - cron: "0 0 2 */3 *" 7 | 8 | # Allows you to run this workflow manually from the Actions tab 9 | workflow_dispatch: 10 | inputs: 11 | esr-version: 12 | required: false 13 | type: string 14 | description: ESR version override, for example 2022.10. By default it uses the current year and month. 15 | os-version: 16 | required: false 17 | type: string 18 | description: OS ESR version override, for example 2.104. By default it uses the latest ESR branch. 19 | 20 | jobs: 21 | esr: 22 | name: Create ESR branch and tag 23 | uses: balena-os/github-workflows/.github/workflows/esr.yml@master 24 | secrets: inherit 25 | -------------------------------------------------------------------------------- /.github/workflows/flowzone.yml: -------------------------------------------------------------------------------- 1 | name: Flowzone 2 | 3 | on: 4 | pull_request: 5 | types: [opened, synchronize, closed] 6 | branches: 7 | - "main" 8 | - "master" 9 | - '20[0-9][0-9].[0-1]?[1470].x' 10 | pull_request_target: 11 | types: [opened, synchronize, closed] 12 | branches: 13 | - "main" 14 | - "master" 15 | 16 | jobs: 17 | flowzone: 18 | name: Flowzone 19 | uses: product-os/flowzone/.github/workflows/flowzone.yml@master 20 | # prevent duplicate workflow executions for pull_request and pull_request_target 21 | if: | 22 | ( 23 | github.event.pull_request.head.repo.full_name == github.repository && 24 | github.event_name == 'pull_request' 25 | ) || ( 26 | github.event.pull_request.head.repo.full_name != github.repository && 27 | github.event_name == 'pull_request_target' 28 | ) 29 | secrets: inherit 30 | -------------------------------------------------------------------------------- /.github/workflows/npe-x500-m3.yml: -------------------------------------------------------------------------------- 1 | name: NPE X500 M3 2 | 3 | on: 4 | # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore 5 | # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet 6 | pull_request: 7 | branches: 8 | - main 9 | - master 10 | # ESR branches glob pattern 11 | - 20[0-9][0-9].[0-1]?[1470].x 12 | pull_request_target: 13 | branches: 14 | - main 15 | - master 16 | push: 17 | tags: 18 | # Semver tags glob pattern (includes ESR in format v20YY.MM.PATCH) 19 | - v[0-9]+.[0-9]+.[0-9]+\+?r?e?v?* 20 | # Allows you to run this workflow manually from the Actions tab 21 | workflow_dispatch: 22 | inputs: 23 | force-finalize: 24 | description: Force finalize of the build (implicitly enables hostapp and S3 deployments) 25 | required: false 26 | type: boolean 27 | default: false 28 | deploy-environment: 29 | description: Environment to use for build and deploy 30 | required: false 31 | type: string 32 | default: balena-staging.com 33 | meta-balena-ref: 34 | description: meta-balena ref if not the currently pinned version 35 | required: false 36 | type: string 37 | default: '' 38 | 39 | permissions: 40 | id-token: write # This is required for requesting the JWT #https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services#requesting-the-access-token 41 | actions: read # We are fetching workflow run results of a merge commit when workflow is triggered by new tag, to see if tests pass 42 | pull-requests: write # Read is required to fetch the PR that merged, in order to get the test results. Write is required to create PR comments for workflow approvals. 43 | packages: read 44 | contents: read 45 | 46 | jobs: 47 | yocto: 48 | name: Yocto 49 | uses: balena-os/balena-yocto-scripts/.github/workflows/yocto-build-deploy.yml@5e33bdd77f207ccf64016feb3a30f4af05e57e96 50 | # Prevent duplicate workflow executions for pull_request (PR) and pull_request_target (PRT) events. 51 | # Both PR and PRT will be triggered for the same pull request, whether it is internal or from a fork. 52 | # This condition will prevent the workflow from running twice for the same pull request while 53 | # still allowing it to run for all other event types. 54 | if: (github.event.pull_request.head.repo.full_name == github.repository) == (github.event_name == 'pull_request') 55 | secrets: inherit 56 | with: 57 | machine: npe-x500-m3 58 | # Allow manual workflow runs to force finalize without checking previous test runs 59 | force-finalize: ${{ inputs.force-finalize || false }} 60 | # Default to balena-staging.com for workflow dispatch, but balena-cloud.com for other events 61 | deploy-environment: ${{ inputs.deploy-environment || 'balena-cloud.com' }} 62 | # Allow overriding the meta-balena ref for workflow dispatch events 63 | meta-balena-ref: ${{ inputs.meta-balena-ref || '' }} 64 | -------------------------------------------------------------------------------- /.github/workflows/raspberrypi2.yml: -------------------------------------------------------------------------------- 1 | name: Raspberry Pi 2 2 | 3 | on: 4 | # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore 5 | # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet 6 | pull_request: 7 | branches: 8 | - main 9 | - master 10 | # ESR branches glob pattern 11 | - 20[0-9][0-9].[0-1]?[1470].x 12 | pull_request_target: 13 | branches: 14 | - main 15 | - master 16 | push: 17 | tags: 18 | # Semver tags glob pattern (includes ESR in format v20YY.MM.PATCH) 19 | - v[0-9]+.[0-9]+.[0-9]+\+?r?e?v?* 20 | # Allows you to run this workflow manually from the Actions tab 21 | workflow_dispatch: 22 | inputs: 23 | force-finalize: 24 | description: Force finalize of the build (implicitly enables hostapp and S3 deployments) 25 | required: false 26 | type: boolean 27 | default: false 28 | deploy-environment: 29 | description: Environment to use for build and deploy 30 | required: false 31 | type: string 32 | default: balena-staging.com 33 | meta-balena-ref: 34 | description: meta-balena ref if not the currently pinned version 35 | required: false 36 | type: string 37 | default: '' 38 | 39 | permissions: 40 | id-token: write # This is required for requesting the JWT #https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services#requesting-the-access-token 41 | actions: read # We are fetching workflow run results of a merge commit when workflow is triggered by new tag, to see if tests pass 42 | pull-requests: write # Read is required to fetch the PR that merged, in order to get the test results. Write is required to create PR comments for workflow approvals. 43 | packages: read 44 | contents: read 45 | 46 | jobs: 47 | yocto: 48 | name: Yocto 49 | uses: balena-os/balena-yocto-scripts/.github/workflows/yocto-build-deploy.yml@5e33bdd77f207ccf64016feb3a30f4af05e57e96 50 | # Prevent duplicate workflow executions for pull_request (PR) and pull_request_target (PRT) events. 51 | # Both PR and PRT will be triggered for the same pull request, whether it is internal or from a fork. 52 | # This condition will prevent the workflow from running twice for the same pull request while 53 | # still allowing it to run for all other event types. 54 | if: (github.event.pull_request.head.repo.full_name == github.repository) == (github.event_name == 'pull_request') 55 | secrets: inherit 56 | with: 57 | machine: raspberrypi2 58 | # Allow manual workflow runs to force finalize without checking previous test runs 59 | force-finalize: ${{ inputs.force-finalize || false }} 60 | # Default to balena-staging.com for workflow dispatch, but balena-cloud.com for other events 61 | deploy-environment: ${{ inputs.deploy-environment || 'balena-cloud.com' }} 62 | # Allow overriding the meta-balena ref for workflow dispatch events 63 | meta-balena-ref: ${{ inputs.meta-balena-ref || '' }} 64 | -------------------------------------------------------------------------------- /.github/workflows/raspberrypi4-superhub.yml: -------------------------------------------------------------------------------- 1 | name: SuperHub 2 | 3 | on: 4 | # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore 5 | # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet 6 | pull_request: 7 | branches: 8 | - main 9 | - master 10 | # ESR branches glob pattern 11 | - 20[0-9][0-9].[0-1]?[1470].x 12 | pull_request_target: 13 | branches: 14 | - main 15 | - master 16 | push: 17 | tags: 18 | # Semver tags glob pattern (includes ESR in format v20YY.MM.PATCH) 19 | - v[0-9]+.[0-9]+.[0-9]+\+?r?e?v?* 20 | # Allows you to run this workflow manually from the Actions tab 21 | workflow_dispatch: 22 | inputs: 23 | force-finalize: 24 | description: Force finalize of the build (implicitly enables hostapp and S3 deployments) 25 | required: false 26 | type: boolean 27 | default: false 28 | deploy-environment: 29 | description: Environment to use for build and deploy 30 | required: false 31 | type: string 32 | default: balena-staging.com 33 | meta-balena-ref: 34 | description: meta-balena ref if not the currently pinned version 35 | required: false 36 | type: string 37 | default: '' 38 | 39 | permissions: 40 | id-token: write # This is required for requesting the JWT #https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services#requesting-the-access-token 41 | actions: read # We are fetching workflow run results of a merge commit when workflow is triggered by new tag, to see if tests pass 42 | pull-requests: write # Read is required to fetch the PR that merged, in order to get the test results. Write is required to create PR comments for workflow approvals. 43 | packages: read 44 | contents: read 45 | 46 | jobs: 47 | yocto: 48 | name: Yocto 49 | uses: balena-os/balena-yocto-scripts/.github/workflows/yocto-build-deploy.yml@5e33bdd77f207ccf64016feb3a30f4af05e57e96 50 | # Prevent duplicate workflow executions for pull_request (PR) and pull_request_target (PRT) events. 51 | # Both PR and PRT will be triggered for the same pull request, whether it is internal or from a fork. 52 | # This condition will prevent the workflow from running twice for the same pull request while 53 | # still allowing it to run for all other event types. 54 | if: (github.event.pull_request.head.repo.full_name == github.repository) == (github.event_name == 'pull_request') 55 | secrets: inherit 56 | with: 57 | machine: raspberrypi4-superhub 58 | # Allow manual workflow runs to force finalize without checking previous test runs 59 | force-finalize: ${{ inputs.force-finalize || false }} 60 | # Default to balena-staging.com for workflow dispatch, but balena-cloud.com for other events 61 | deploy-environment: ${{ inputs.deploy-environment || 'balena-cloud.com' }} 62 | # Allow overriding the meta-balena ref for workflow dispatch events 63 | meta-balena-ref: ${{ inputs.meta-balena-ref || '' }} 64 | -------------------------------------------------------------------------------- /.github/workflows/raspberrypi400-64.yml: -------------------------------------------------------------------------------- 1 | name: Raspberry Pi 400 2 | 3 | on: 4 | # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore 5 | # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet 6 | pull_request: 7 | branches: 8 | - main 9 | - master 10 | # ESR branches glob pattern 11 | - 20[0-9][0-9].[0-1]?[1470].x 12 | pull_request_target: 13 | branches: 14 | - main 15 | - master 16 | push: 17 | tags: 18 | # Semver tags glob pattern (includes ESR in format v20YY.MM.PATCH) 19 | - v[0-9]+.[0-9]+.[0-9]+\+?r?e?v?* 20 | # Allows you to run this workflow manually from the Actions tab 21 | workflow_dispatch: 22 | inputs: 23 | force-finalize: 24 | description: Force finalize of the build (implicitly enables hostapp and S3 deployments) 25 | required: false 26 | type: boolean 27 | default: false 28 | deploy-environment: 29 | description: Environment to use for build and deploy 30 | required: false 31 | type: string 32 | default: balena-staging.com 33 | meta-balena-ref: 34 | description: meta-balena ref if not the currently pinned version 35 | required: false 36 | type: string 37 | default: '' 38 | 39 | permissions: 40 | id-token: write # This is required for requesting the JWT #https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services#requesting-the-access-token 41 | actions: read # We are fetching workflow run results of a merge commit when workflow is triggered by new tag, to see if tests pass 42 | pull-requests: write # Read is required to fetch the PR that merged, in order to get the test results. Write is required to create PR comments for workflow approvals. 43 | packages: read 44 | contents: read 45 | 46 | jobs: 47 | yocto: 48 | name: Yocto 49 | uses: balena-os/balena-yocto-scripts/.github/workflows/yocto-build-deploy.yml@5e33bdd77f207ccf64016feb3a30f4af05e57e96 50 | # Prevent duplicate workflow executions for pull_request (PR) and pull_request_target (PRT) events. 51 | # Both PR and PRT will be triggered for the same pull request, whether it is internal or from a fork. 52 | # This condition will prevent the workflow from running twice for the same pull request while 53 | # still allowing it to run for all other event types. 54 | if: (github.event.pull_request.head.repo.full_name == github.repository) == (github.event_name == 'pull_request') 55 | secrets: inherit 56 | with: 57 | machine: raspberrypi400-64 58 | # Allow manual workflow runs to force finalize without checking previous test runs 59 | force-finalize: ${{ inputs.force-finalize || false }} 60 | # Default to balena-staging.com for workflow dispatch, but balena-cloud.com for other events 61 | deploy-environment: ${{ inputs.deploy-environment || 'balena-cloud.com' }} 62 | # Allow overriding the meta-balena ref for workflow dispatch events 63 | meta-balena-ref: ${{ inputs.meta-balena-ref || '' }} 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore build directory 2 | build*/ 3 | 4 | # Ignore shared directories 5 | shared-*/ 6 | 7 | # Some log files from scripts 8 | *.log 9 | 10 | # device type manifest stuff 11 | /node_modules 12 | *.json 13 | !package.json 14 | 15 | # dynamically created by the build script 16 | conf-notes.txt 17 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "layers/poky"] 2 | path = layers/poky 3 | url = https://github.com/balena-os/poky 4 | branch = kirkstone 5 | [submodule "layers/meta-openembedded"] 6 | path = layers/meta-openembedded 7 | url = https://github.com/openembedded/meta-openembedded.git 8 | branch = kirkstone 9 | [submodule "layers/meta-raspberrypi"] 10 | path = layers/meta-raspberrypi 11 | url = https://github.com/agherzan/meta-raspberrypi.git 12 | branch = kirkstone 13 | [submodule "layers/meta-balena"] 14 | path = layers/meta-balena 15 | url = https://github.com/balena-os/meta-balena.git 16 | branch = master 17 | [submodule "balena-yocto-scripts"] 18 | path = balena-yocto-scripts 19 | url = https://github.com/balena-os/balena-yocto-scripts.git 20 | branch = master 21 | [submodule "tests/autohat"] 22 | path = tests/autohat 23 | url = https://github.com/balena-io/autohat.git 24 | branch = master 25 | [submodule "contracts"] 26 | path = contracts 27 | url = https://github.com/balena-io/contracts.git 28 | branch = master 29 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 6.5.24+rev3 -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/README.md: -------------------------------------------------------------------------------- 1 | # Resin.io layer for meta-raspberrypi supported boards 2 | 3 | ## Description 4 | This repository enables building BalenaOS for chosen meta-raspberrypi machines. 5 | 6 | ## Supported machines 7 | * fincm3 8 | * raspberrypi 9 | * raspberrypi2 10 | * raspberrypi3 11 | 12 | ## How to? 13 | 14 | Q: I generated an image without debug or I downloaded a Balena image from the production dashboard. How can I login over serial port? 15 | A: We don't start getty on non debug images. As well there are passward changes for root user needed. In order to simplify this process, there is a helper script https://github.com/balena-os/serial-it which does everything for you. Check the help message of that script. 16 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/fincm3.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: Balena Fin (CM3) 3 | #@DESCRIPTION: Machine configuration for Balena Fin board (CM3) 4 | 5 | MACHINEOVERRIDES = "raspberrypi3:${MACHINE}" 6 | include conf/machine/raspberrypi3.conf 7 | 8 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "sd8887-nxp" 9 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/include/revpi.inc: -------------------------------------------------------------------------------- 1 | MACHINEOVERRIDES =. "raspberrypi3:" 2 | include conf/machine/raspberrypi3.conf 3 | 4 | SOC_FAMILY = "rpi:revpi" 5 | 6 | PREFERRED_PROVIDER_virtual/kernel = "linux-kunbus" 7 | # pin existing revpi machines to the 4.19.95 kernel (until we fix the HUP altboot rollback issue from 4.19.95 to 5.10.152 kernel) 8 | PREFERRED_VERSION_linux-kunbus = "4.19.95%" 9 | 10 | KERNEL_MODULE_AUTOLOAD += "piControl" 11 | 12 | # the following overlay is not present in the kernel we use for the Revolution Pis 13 | KERNEL_DEVICETREE:remove = "overlays/uart0.dtbo" 14 | 15 | # pin existing revpi machines to older picontrol for kernel 4.19.95 16 | PREFERRED_VERSION_picontrol = "2020.06.16" 17 | IMAGE_INSTALL:append = " picontrol" 18 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/include/revpi4.inc: -------------------------------------------------------------------------------- 1 | MACHINEOVERRIDES =. "raspberrypi4-64:" 2 | include conf/machine/raspberrypi4-64.conf 3 | 4 | SOC_FAMILY = "rpi:revpi" 5 | 6 | PREFERRED_PROVIDER_virtual/kernel = "linux-kunbus" 7 | 8 | KERNEL_MODULE_AUTOLOAD += "piControl" 9 | 10 | IMAGE_INSTALL:append = " picontrol" 11 | 12 | # to have KBUILD_DEFCONFIG correctly overridden for all revpi4 based devices we need to define it for the machine type we base upon 13 | KBUILD_DEFCONFIG:raspberrypi4-64 = "revpi-v8_defconfig" 14 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/nebra-hnt.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: Raspberry Pi 3 64 bits 3 | #@DESCRIPTION: Machine configuration for Raspberry Pi 3 64 bits 4 | 5 | MACHINEOVERRIDES =. "raspberrypi3-64:" 6 | include conf/machine/raspberrypi3-64.conf 7 | 8 | # Use this version until it's updated in poky, 9 | # to test the pending upstream patches 10 | PREFERRED_VERSION_bluez5 = "5.56" 11 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/npe-x500-m3.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: NPE X500 M3 (CM3) 3 | #@DESCRIPTION: Machine configuration for NPE X500 M3 board (CM3) 4 | 5 | MACHINEOVERRIDES = "raspberrypi3:${MACHINE}" 6 | include conf/machine/raspberrypi3.conf 7 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/raspberrypi3-unipi-neuron.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: UniPi Neuron 3 | #@DESCRIPTION: Machine configuration for UniPi Neuron boards based on Raspberry Pi 3 4 | 5 | MACHINEOVERRIDES = "raspberrypi3:${MACHINE}" 6 | include conf/machine/raspberrypi3.conf 7 | 8 | IMAGE_INSTALL:append = " unipi-kernel-modules unipi-tools" 9 | 10 | PREFERRED_VERSION_linux-raspberrypi = "5.15.%" 11 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/raspberrypi4-superhub.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: Raspberrypi4 SuperHub Gateway 3 | #@DESCRIPTION: Machine configuration for Raspberrypi4 SuperHub Gateway Board 4 | 5 | MACHINEOVERRIDES =. "raspberrypi4-64:" 6 | include conf/machine/raspberrypi4-64.conf 7 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/raspberrypi4-unipi-neuron.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: UniPi Neuron 3 | #@DESCRIPTION: Machine configuration for UniPi Neuron boards based on Raspberry Pi 4 4 | 5 | MACHINEOVERRIDES =. "raspberrypi4-64:" 6 | include conf/machine/raspberrypi4-64.conf 7 | 8 | IMAGE_INSTALL:append = " unipi-kernel-modules unipi-tools" 9 | 10 | PREFERRED_VERSION_linux-raspberrypi = "5.15.%" 11 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/raspberrypi400-64.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: Raspberrypi400-64 3 | #@DESCRIPTION: Machine configuration for Raspberrypi400 4 | 5 | MACHINEOVERRIDES =. "raspberrypi4-64:" 6 | include conf/machine/raspberrypi4-64.conf 7 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/raspberrypicm4-ioboard-sb.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: RaspberrypiCM4-IOBoard-SB 3 | #@DESCRIPTION: Machine configuration for SB/FDE Raspberrypi Compute Module 4 IO Board 4 | 5 | MACHINEOVERRIDES =. "raspberrypi4-64:" 6 | include conf/machine/raspberrypi4-64.conf 7 | 8 | BALENA_NONENC_BOOT_LABEL = "balena-rpi" 9 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/raspberrypicm4-ioboard.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: RaspberrypiCM4-IOBoard 3 | #@DESCRIPTION: Machine configuration for Raspberrypi Compute Module 4 IO Board 4 | 5 | MACHINEOVERRIDES =. "raspberrypi4-64:" 6 | include conf/machine/raspberrypi4-64.conf 7 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/revpi-connect-4.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: Revolution Pi Connect 4 3 | #@DESCRIPTION: Machine configuration for Revolution Pi Connect 4 board 4 | 5 | require conf/machine/include/revpi4.inc 6 | 7 | KERNEL_DEVICETREE:append = " \ 8 | overlays/revpi-connect4.dtbo \ 9 | overlays/revpi-dt-blob-overlay.dtb \ 10 | " 11 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/revpi-connect-s.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: Revolution Pi Connect S 3 | #@DESCRIPTION: Machine configuration for Revolution Pi Connect S board 4 | 5 | require conf/machine/include/revpi4.inc 6 | 7 | KERNEL_DEVICETREE:append = " \ 8 | overlays/revpi-connect.dtbo \ 9 | overlays/revpi-connect-dt-blob-overlay.dtb \ 10 | overlays/revpi-connect-can.dtbo \ 11 | " 12 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/revpi-connect.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: Revolution Pi Connect 3 | #@DESCRIPTION: Machine configuration for Revolution Pi Connect board 4 | 5 | require conf/machine/include/revpi.inc 6 | 7 | KERNEL_DEVICETREE:append = " \ 8 | overlays/revpi-connect.dtbo \ 9 | overlays/revpi-connect-dt-blob-overlay.dtb \ 10 | overlays/revpi-connect-can.dtbo \ 11 | " 12 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/revpi-core-3.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: Revolution Pi Core 3 3 | #@DESCRIPTION: Machine configuration for Revolution Pi Core 3 board 4 | 5 | require conf/machine/include/revpi.inc 6 | 7 | KERNEL_DEVICETREE:append = " \ 8 | overlays/revpi-core.dtbo \ 9 | overlays/revpi-core-dt-blob-overlay.dtb \ 10 | " 11 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/machine/rt-rpi-300.conf: -------------------------------------------------------------------------------- 1 | #@TYPE: Machine 2 | #@NAME: Rocktech-RPI-300 3 | #@DESCRIPTION: Machine configuration for Rocktech-RPI-300 4 | 5 | MACHINEOVERRIDES =. "raspberrypi4-64:" 6 | 7 | include conf/machine/raspberrypi4-64.conf 8 | 9 | PREFERRED_VERSION_linux-raspberrypi = "5.15.%" 10 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/conf/samples/bblayers.conf.sample: -------------------------------------------------------------------------------- 1 | # LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf 2 | # changes incompatibly 3 | POKY_BBLAYERS_CONF_VERSION = "2" 4 | 5 | BBPATH = "${TOPDIR}" 6 | BBFILES ?= "" 7 | 8 | BBLAYERS ?= " \ 9 | ${TOPDIR}/../layers/meta-balena/meta-balena-rust \ 10 | ${TOPDIR}/../layers/meta-balena/meta-balena-common \ 11 | ${TOPDIR}/../layers/meta-balena/meta-balena-kirkstone \ 12 | ${TOPDIR}/../layers/meta-balena-raspberrypi \ 13 | ${TOPDIR}/../layers/poky/meta \ 14 | ${TOPDIR}/../layers/poky/meta-poky \ 15 | ${TOPDIR}/../layers/meta-openembedded/meta-oe \ 16 | ${TOPDIR}/../layers/meta-openembedded/meta-filesystems \ 17 | ${TOPDIR}/../layers/meta-openembedded/meta-networking \ 18 | ${TOPDIR}/../layers/meta-openembedded/meta-python \ 19 | ${TOPDIR}/../layers/meta-openembedded/meta-perl \ 20 | ${TOPDIR}/../layers/meta-raspberrypi \ 21 | " 22 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/files/fincm3-dt-blob.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/balena-os/balena-raspberrypi/1153bd38b1bf579188850513e3d12cffa83d686f/layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/files/fincm3-dt-blob.bin -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/rpi-bootfiles.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:append := ":${THISDIR}/files" 2 | 3 | LIC_FILES_CHKSUM = "file://LICENCE.broadcom;md5=c403841ff2837657b2ed8e5bb474ac8d" 4 | 5 | SRC_URI += " \ 6 | file://fincm3-dt-blob.bin \ 7 | " 8 | 9 | RPIFW_DATE = "20241126" 10 | SRCREV = "9f24f4bc2bdd07ffd158cfbb4bce88a2efc4c1f5" 11 | SHORTREV = "${@d.getVar("SRCREV", False).__str__()[:7]}" 12 | RPIFW_SRC_URI = "https://api.github.com/repos/raspberrypi/firmware/tarball/9f24f4bc2bdd07ffd158cfbb4bce88a2efc4c1f5;downloadfilename=raspberrypi-firmware-${SHORTREV}.tar.gz" 13 | RPIFW_S = "${WORKDIR}/raspberrypi-firmware-${SHORTREV}" 14 | 15 | SRC_URI = "${RPIFW_SRC_URI}" 16 | SRC_URI[sha256sum] = "4b436f8946b139c6a1202375ef55d4848e3bcd8c1a9cb47000e06d7ecec828f7" 17 | 18 | PV = "${RPIFW_DATE}" 19 | 20 | do_deploy:append() { 21 | # exclude from balenaOS the binaries with additional debug assertions (they 22 | # grow the used size in resin-boot and this potentially breaks hostapps 23 | # update) 24 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/fixup_db.dat 25 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/start_db.elf 26 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/fixup4db.dat 27 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/start4db.elf 28 | 29 | if echo ${MACHINEOVERRIDES} | grep -i "raspberrypi4-64"; then 30 | # exclude from raspberrypi4-64 based balenaOS builds the binaries which are for previous RaspberryPi versions 31 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/fixup.dat 32 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/fixup_cd.dat 33 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/fixup_x.dat 34 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/start.elf 35 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/start_cd.elf 36 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/start_x.elf 37 | # bootcode.bin is not used anymore on rpi4 as the boot code is now in an EEPROM (https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md) 38 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/bootcode.bin 39 | else 40 | # exclude RaspberryPi4 specific firmware from non raspberrypi4-64 based balenaOS builds 41 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/fixup4.dat 42 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/fixup4cd.dat 43 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/fixup4x.dat 44 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/start4.elf 45 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/start4cd.elf 46 | rm -f ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/start4x.elf 47 | fi 48 | } 49 | 50 | do_deploy:append:fincm3() { 51 | # Install the dt-blob needed for camera support in Balena Fin CM3 52 | install -m 644 ${WORKDIR}/fincm3-dt-blob.bin ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/dt-blob.bin 53 | } 54 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bbappend: -------------------------------------------------------------------------------- 1 | # Set console accordingly to build type 2 | CMDLINE += " dwc_otg.lpm_enable=0 rootwait" 3 | CMDLINE += "${OS_KERNEL_CMDLINE} ${@oe.utils.conditional('SIGN_API','','',"${OS_KERNEL_SECUREBOOT_CMDLINE}",d)}" 4 | 5 | # Add earlycon with OS_DEVELOPMENT=1 6 | CMDLINE:prepend:raspberrypi4-64 = " ${@bb.utils.contains('DISTRO_FEATURES','osdev-image',"earlycon=uart8250,mmio32,0xfe215040 console=tty1","",d)}" 7 | CMDLINE:prepend:raspberrypi400-64 = " ${@bb.utils.contains('DISTRO_FEATURES','osdev-image',"earlycon=uart8250,mmio32,0xfe215040 console=tty1","",d)}" 8 | CMDLINE:prepend:raspberrypicm4-ioboard = " ${@bb.utils.contains('DISTRO_FEATURES','osdev-image',"earlycon=uart8250,mmio32,0xfe215040 console=tty1","",d)}" 9 | CMDLINE:prepend:raspberrypicm4-ioboard-sb = " ${@bb.utils.contains('DISTRO_FEATURES','osdev-image',"earlycon=uart8250,mmio32,0xfe215040 console=tty1","",d)}" 10 | 11 | # See https://github.com/raspberrypi/linux/commit/9b0efcc1ec497b2985c6aaa60cd97f0d2d96d203 12 | CMDLINE += " cgroup_enable=memory" 13 | CMDLINE:remove = "root=/dev/mmcblk0p2" 14 | CMDLINE_DEBUG = "" 15 | 16 | # Necessary for balena bootloader to work 17 | # These will not be passed to the actual kernel 18 | CMDLINE:append:raspberrypicm4-ioboard-sb := " balena_stage2 nr_cpus=1" 19 | CMDLINE:append:raspberrypi5 := " balena_stage2 maxcpus=0" 20 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/rpi-eeprom/files/default-config.txt: -------------------------------------------------------------------------------- 1 | [all] 2 | BOOT_UART=0 3 | WAKE_ON_GPIO=1 4 | POWER_OFF_ON_HALT=0 5 | FREEZE_VERSION=0 6 | HDMI_DELAY=0 7 | BOOT_ORDER=0xf25641 8 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/rpi-eeprom/files/pieeprom-update.sh: -------------------------------------------------------------------------------- 1 | # Update procedure is based on the rpi-eeprom-update script available at 2 | # https://github.com/raspberrypi/rpi-eeprom/blob/master/rpi-eeprom-update 3 | 4 | set -o errexit 5 | 6 | # shellcheck disable=SC1091 7 | . /usr/libexec/os-helpers-logging 8 | # shellcheck disable=SC1091 9 | [ -f "/usr/libexec/os-helpers-sb" ] && . /usr/libexec/os-helpers-sb 10 | 11 | if type is_secured >/dev/null 2>&1 && is_secured; then 12 | info "A signed boot enabled system must use the self-update EEPROM mechanism" 13 | exit 0 14 | fi 15 | 16 | NEW_IMG="${1:-pieeprom-latest-stable.bin}" 17 | CURR_IMG=pieeprom-current.bin.tmp 18 | CURR_IMG_PATH=/tmp 19 | NEW_IMG_PATH=/mnt/boot 20 | SPI_SPEED=16000 21 | 22 | spi_bind() { 23 | command="${1}" 24 | case $command in 25 | "unbind") 26 | SPI_BCM2835_SYSPATH="/sys/bus/platform/drivers/spi-bcm2835" 27 | SPI_DEVICE="$(basename "$(find "${SPI_BCM2835_SYSPATH}" -type l -name "*.spi" | head -n1)")" 28 | if [ -n "${SPI_DEVICE}" ]; then 29 | echo "${SPI_DEVICE}" > "${SPI_BCM2835_SYSPATH}/${command}" || true 30 | fi 31 | ;; 32 | "bind") 33 | if [ -n "${SPI_DEVICE}" ]; then 34 | echo "${SPI_DEVICE}" > "${SPI_BCM2835_SYSPATH}/${command}" || true 35 | SPI_DEVICE="" 36 | fi 37 | ;; 38 | *) fatal "$command not supported";; 39 | esac 40 | } 41 | 42 | # According to documentation, custom EEPROM update scripts 43 | # must also check for FREEZE_VERSION flag 44 | if [ "$(/usr/bin/vcgencmd bootloader_config | grep "FREEZE_VERSION=1" || true)" ]; then 45 | warn "Bootloader config contains FREEZE_VERSION=1. Will NOT update SPI EEPROM firmware!" 46 | exit 0 47 | fi 48 | 49 | spi_bind unbind 50 | 51 | /usr/bin/vcmailbox 0x00030056 4 4 0 > /dev/null || true 52 | /usr/bin/dtparam -d /mnt/boot/overlays/ audio=off 53 | /usr/bin/dtoverlay -d /mnt/boot/overlays/ spi-gpio40-45 54 | 55 | spi_bind bind 56 | 57 | /usr/sbin/flashrom -p "linux_spi:dev=/dev/spidev0.0,spispeed=${SPI_SPEED}" --read ${CURR_IMG_PATH}/${CURR_IMG} 58 | 59 | curr_eeprom_md5sum=$(md5sum "${CURR_IMG_PATH}/${CURR_IMG}" | awk '{print $1}') 60 | new_eeprom_md5sum=$(md5sum "${NEW_IMG_PATH}/${NEW_IMG}" | awk '{print $1}') 61 | 62 | if [ "$curr_eeprom_md5sum" = "$new_eeprom_md5sum" ]; then 63 | info "SPI EEPROM fw update is not necessary" 64 | else 65 | info "Performing SPI EEPROM fw update..." 66 | /usr/sbin/flashrom -p "linux_spi:dev=/dev/spidev0.0,spispeed=${SPI_SPEED}" --write "${NEW_IMG_PATH}/${NEW_IMG}" 67 | fi 68 | 69 | rm ${CURR_IMG_PATH}/$CURR_IMG 70 | 71 | spi_bind unbind 72 | 73 | /usr/bin/dtparam -d /mnt/boot/overlays/ -R spi-gpio40-45 74 | /usr/bin/dtparam -d /mnt/boot/overlays/ audio=on 75 | /usr/bin/vcmailbox 0x00030056 4 4 1 > /dev/null || true 76 | 77 | spi_bind bind 78 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/rpi-eeprom/files/raspberrypicm4-ioboard-sb/default-config.txt: -------------------------------------------------------------------------------- 1 | [all] 2 | BOOT_UART=0 3 | WAKE_ON_GPIO=0 4 | POWER_OFF_ON_HALT=1 5 | FREEZE_VERSION=0 6 | HDMI_DELAY=0 7 | BOOT_ORDER=0xf2165 8 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend: -------------------------------------------------------------------------------- 1 | # We override the file provided by meta-raspberrypi 2 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 3 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr/boot.cmd.in: -------------------------------------------------------------------------------- 1 | setenv resin_kernel_load_addr ${kernel_addr_r} 2 | run resin_set_kernel_root 3 | fdt addr ${fdt_addr} 4 | fdt get value bootargs /chosen bootargs 5 | env set bootargs "${bootargs} ${resin_kernel_root} rootwait" 6 | fdt rm /chosen bootargs 7 | load ${resin_dev_type} ${resin_dev_index}:${resin_root_part} ${resin_kernel_load_addr} /boot/@@KERNEL_IMAGETYPE@@ 8 | @@KERNEL_BOOTCMD@@ ${resin_kernel_load_addr} - ${fdt_addr} 9 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr/raspberrypi0-2w-64/boot.cmd.in: -------------------------------------------------------------------------------- 1 | setenv resin_kernel_load_addr ${kernel_addr_r} 2 | setenv resin_tmp_loadaddr 0x10000000 3 | run resin_set_kernel_root 4 | fdt addr ${fdt_addr} 5 | fdt get value bootargs /chosen bootargs 6 | env set bootargs "${bootargs} ${resin_kernel_root} rootwait" 7 | fdt rm /chosen bootargs 8 | load ${resin_dev_type} ${resin_dev_index}:${resin_root_part} ${resin_tmp_loadaddr} /boot/@@KERNEL_IMAGETYPE@@ 9 | unzip ${fileaddr} ${resin_kernel_load_addr} 10 | @@KERNEL_BOOTCMD@@ ${resin_kernel_load_addr} - ${fdt_addr} 11 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr/raspberrypi3-64/boot.cmd.in: -------------------------------------------------------------------------------- 1 | setenv resin_kernel_load_addr ${kernel_addr_r} 2 | setenv resin_tmp_loadaddr 0x10000000 3 | run resin_set_kernel_root 4 | fdt addr ${fdt_addr} 5 | fdt get value bootargs /chosen bootargs 6 | env set bootargs "${bootargs} ${resin_kernel_root} rootwait" 7 | fdt rm /chosen bootargs 8 | load ${resin_dev_type} ${resin_dev_index}:${resin_root_part} ${resin_tmp_loadaddr} /boot/@@KERNEL_IMAGETYPE@@ 9 | unzip ${fileaddr} ${resin_kernel_load_addr} 10 | @@KERNEL_BOOTCMD@@ ${resin_kernel_load_addr} - ${fdt_addr} 11 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr/raspberrypi4-64/boot.cmd.in: -------------------------------------------------------------------------------- 1 | setenv resin_kernel_load_addr ${kernel_addr_r} 2 | setenv resin_tmp_loadaddr 0x10000000 3 | run resin_set_kernel_root 4 | fdt addr ${fdt_addr} 5 | fdt get value bootargs /chosen bootargs 6 | env set bootargs "${bootargs} ${resin_kernel_root} rootwait" 7 | fdt rm /chosen bootargs 8 | load ${resin_dev_type} ${resin_dev_index}:${resin_root_part} ${resin_tmp_loadaddr} /boot/@@KERNEL_IMAGETYPE@@ 9 | unzip ${fileaddr} ${resin_kernel_load_addr} 10 | @@KERNEL_BOOTCMD@@ ${resin_kernel_load_addr} - ${fdt_addr} 11 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/0001-Integrate-machine-independent-resin-environment-conf.patch: -------------------------------------------------------------------------------- 1 | From 8c41dcb55ad8fe4ab0a8202b53b8342e5c47fd7b Mon Sep 17 00:00:00 2001 2 | From: Andrei Gherzan 3 | Date: Wed, 1 Mar 2017 23:53:02 +0100 4 | Subject: [PATCH] Integrate machine independent resin environment configuration 5 | 6 | This patch integrates resin default environment configuration in an u-boot which 7 | has a version with Kconfig support. 8 | 9 | Signed-off-by: Andrei Gherzan 10 | 11 | Upstream-Status: Inappropriate [configuration] 12 | --- 13 | include/env_default.h | 3 +++ 14 | 1 file changed, 3 insertions(+) 15 | 16 | diff --git a/include/env_default.h b/include/env_default.h 17 | index 1ddd64ba8ffe..2c0a6838c735 100644 18 | --- a/include/env_default.h 19 | +++ b/include/env_default.h 20 | @@ -10,6 +10,8 @@ 21 | #include 22 | #include 23 | 24 | +#include 25 | + 26 | #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED 27 | env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = { 28 | ENV_CRC, /* CRC Sum */ 29 | @@ -25,6 +27,7 @@ uchar default_environment[] = { 30 | const uchar default_environment[] = { 31 | #endif 32 | #ifndef CONFIG_USE_DEFAULT_ENV_FILE 33 | + BALENA_ENV 34 | #ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT 35 | ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0" 36 | #endif 37 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/0001-avoid-block-uart-write.patch: -------------------------------------------------------------------------------- 1 | From 5e960cc9b208c53d5385d5a2f6c7f380e9499d4c Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Wed, 18 Mar 2020 16:54:28 +0100 4 | Subject: [PATCH] Add a retry limit when writing to uart console 5 | 6 | Seems that if the serial console is incorrectly 7 | configured in the dtb, writing to it may block indefinitely, 8 | thus preventing the board from booting. 9 | 10 | Let's add a retry count to unblock in such cases. 11 | 12 | Upstream-Status: Inappropriate [configuration] 13 | Signed-off-by: Alexandru Costache 14 | --- 15 | drivers/serial/serial_bcm283x_mu.c | 12 +++++++++--- 16 | 1 file changed, 9 insertions(+), 3 deletions(-) 17 | 18 | diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c 19 | index bd1d89ec83..bd033d14c4 100644 20 | --- a/drivers/serial/serial_bcm283x_mu.c 21 | +++ b/drivers/serial/serial_bcm283x_mu.c 22 | @@ -49,7 +49,7 @@ struct bcm283x_mu_regs { 23 | struct bcm283x_mu_priv { 24 | struct bcm283x_mu_regs *regs; 25 | }; 26 | - 27 | +static uint16_t putc_retry __section(".data"); 28 | static int bcm283x_mu_serial_getc(struct udevice *dev); 29 | 30 | static int bcm283x_mu_serial_setbrg(struct udevice *dev, int baudrate) 31 | @@ -105,8 +105,14 @@ static int bcm283x_mu_serial_putc(struct udevice *dev, const char data) 32 | struct bcm283x_mu_regs *regs = priv->regs; 33 | 34 | /* Wait until there is space in the FIFO */ 35 | - if (!(readl(®s->lsr) & BCM283X_MU_LSR_TX_EMPTY)) 36 | - return -EAGAIN; 37 | + if (!(readl(®s->lsr) & BCM283X_MU_LSR_TX_EMPTY)) { 38 | + if (++putc_retry) { 39 | + return -EAGAIN; 40 | + } else { 41 | + /* Couldn't write for too long, drop char */ 42 | + return 0; 43 | + } 44 | + } 45 | 46 | /* Send the character */ 47 | writel(data, ®s->io); 48 | -- 49 | 2.17.1 50 | 51 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/0001-rpi-Disable-image-flasher-check.patch: -------------------------------------------------------------------------------- 1 | From 91248f8583b79b4c663273b3d6612bc16abc3e20 Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Fri, 6 Dec 2019 14:16:21 +0100 4 | Subject: [PATCH] rpi: Disable image flasher check 5 | 6 | Since there's no need to check for 7 | flasher image, we disable this check 8 | so that the command "usb start" is not 9 | executed without reason when booting 10 | from sd-card, IF "usb" is also present 11 | in resin_uboot_device_types array. 12 | 13 | Upstream-Status: Inappropriate [configuration] 14 | Signed-off-by: Alexandru Costache 15 | --- 16 | include/configs/rpi.h | 3 ++- 17 | 1 file changed, 2 insertions(+), 1 deletion(-) 18 | 19 | diff --git a/include/configs/rpi.h b/include/configs/rpi.h 20 | index 8c14faa8e7f2..3b7cb91a5a6f 100644 21 | --- a/include/configs/rpi.h 22 | +++ b/include/configs/rpi.h 23 | @@ -206,7 +206,8 @@ 24 | ENV_DEVICE_SETTINGS \ 25 | ENV_DFU_SETTINGS \ 26 | ENV_MEM_LAYOUT_SETTINGS \ 27 | - BOOTENV 28 | + BOOTENV \ 29 | + "resin_flasher_skip=1\0" 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/0002-raspberrypi-Disable-simple-framebuffer-support.patch: -------------------------------------------------------------------------------- 1 | From 553b7bf556b9efffccf992c2a071b5082130d038 Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Wed, 9 Mar 2022 16:23:17 +0100 4 | Subject: [PATCH] raspberrypi: Disable simple framebuffer support 5 | 6 | On 4.19 kernels this u-boot driver clashes with bcm2708_fb. 7 | So let's disable it from here so that we have bcm2708_fb 8 | enabled in the kernel, just as Raspbian users might expect. 9 | See https://github.com/raspberrypi/linux/issues/3139 10 | 11 | Upstream-Status: Inappropriate [configuration] 12 | Signed-off-by: Florin Sarbu 13 | --- 14 | board/raspberrypi/rpi/rpi.c | 2 ++ 15 | common/Makefile | 2 +- 16 | include/configs/rpi.h | 4 ++-- 17 | 3 files changed, 5 insertions(+), 3 deletions(-) 18 | 19 | diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c 20 | index 372b26b6f2..255f4a174f 100644 21 | --- a/board/raspberrypi/rpi/rpi.c 22 | +++ b/board/raspberrypi/rpi/rpi.c 23 | @@ -500,8 +500,10 @@ int ft_board_setup(void *blob, struct bd_info *bd) 24 | int node; 25 | 26 | node = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer"); 27 | + /* 28 | if (node < 0) 29 | lcd_dt_simplefb_add_node(blob); 30 | + */ 31 | 32 | #ifdef CONFIG_EFI_LOADER 33 | /* Reserve the spin table */ 34 | diff --git a/common/Makefile b/common/Makefile 35 | index ae0430c35f..ab427c70b4 100644 36 | --- a/common/Makefile 37 | +++ b/common/Makefile 38 | @@ -49,7 +49,7 @@ ifndef CONFIG_DM_VIDEO 39 | obj-$(CONFIG_LCD) += lcd.o lcd_console.o 40 | endif 41 | obj-$(CONFIG_LCD_ROTATION) += lcd_console_rotation.o 42 | -obj-$(CONFIG_LCD_DT_SIMPLEFB) += lcd_simplefb.o 43 | +//obj-$(CONFIG_LCD_DT_SIMPLEFB) += lcd_simplefb.o 44 | obj-$(CONFIG_LYNXKDI) += lynxkdi.o 45 | obj-$(CONFIG_MENU) += menu.o 46 | obj-$(CONFIG_UPDATE_COMMON) += update.o 47 | diff --git a/include/configs/rpi.h b/include/configs/rpi.h 48 | index da3888a731..8c14faa8e7 100644 49 | --- a/include/configs/rpi.h 50 | +++ b/include/configs/rpi.h 51 | @@ -71,8 +71,8 @@ 52 | /* GPIO */ 53 | #define CONFIG_BCM2835_GPIO 54 | /* LCD */ 55 | -#define CONFIG_LCD_DT_SIMPLEFB 56 | -#define CONFIG_VIDEO_BCM2835 57 | +//#define CONFIG_LCD_DT_SIMPLEFB 58 | +//#define CONFIG_VIDEO_BCM2835 59 | 60 | /* DFU over USB/UDC */ 61 | #ifdef CONFIG_CMD_DFU 62 | -- 63 | 2.17.1 64 | 65 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/0011-enable-nvme-cm4.patch: -------------------------------------------------------------------------------- 1 | From 109052e0790155c202ba80bd31efb70fd72e5f72 Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Mon, 7 Mar 2022 13:52:31 +0100 4 | Subject: [PATCH] Enable NVME configs on CM4 IO Board 5 | 6 | Upstream-status: Inappropriate [configuration] 7 | Signed-off-by: Alexandru Costache 8 | --- 9 | configs/rpi_arm64_defconfig | 3 +++ 10 | 1 file changed, 3 insertions(+) 11 | 12 | diff --git a/configs/rpi_arm64_defconfig b/configs/rpi_arm64_defconfig 13 | index aeef34c4de..9024b63dcf 100644 14 | --- a/configs/rpi_arm64_defconfig 15 | +++ b/configs/rpi_arm64_defconfig 16 | @@ -51,3 +51,6 @@ CONFIG_SYS_WHITE_ON_BLACK=y 17 | CONFIG_CONSOLE_SCROLL_LINES=10 18 | CONFIG_PHYS_TO_BUS=y 19 | CONFIG_OF_LIBFDT_OVERLAY=y 20 | +CONFIG_NVME=y 21 | +CONFIG_CMD_NVME=y 22 | + 23 | -- 24 | 2.17.1 25 | 26 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/0012-rpi-add-NVMe-to-boot-order.patch: -------------------------------------------------------------------------------- 1 | From 3eb6cae898bb6c50a738474e6f97756acb33d44e Mon Sep 17 00:00:00 2001 2 | From: Stefan Agner 3 | Date: Tue, 29 Dec 2020 23:34:52 +0100 4 | Subject: [PATCH 1/3] rpi: add NVMe to boot order 5 | 6 | The Compute Module 4 I/O Board can support a NVMe. Add NVMe to the boot 7 | order. 8 | 9 | Patch source: 10 | https://github.com/home-assistant/operating-system/tree/dev/buildroot-external/board/raspberrypi/patches/uboot 11 | at commit SHA b0bbe70315ee6474637b6c4242c41909c9ec2db8. 12 | 13 | Upstream-status: Backport 14 | Signed-off-by: Stefan Agner 15 | Signed-off-by: Alexandru Costache 16 | --- 17 | include/configs/rpi.h | 7 +++++++ 18 | 1 file changed, 7 insertions(+) 19 | 20 | diff --git a/include/configs/rpi.h b/include/configs/rpi.h 21 | index b158eee903..391b8aa2dd 100644 22 | --- a/include/configs/rpi.h 23 | +++ b/include/configs/rpi.h 24 | @@ -149,6 +149,12 @@ 25 | #define BOOT_TARGET_MMC(func) 26 | #endif 27 | 28 | +#if CONFIG_IS_ENABLED(CMD_NVME) 29 | + #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0) 30 | +#else 31 | + #define BOOT_TARGET_NVME(func) 32 | +#endif 33 | + 34 | #if CONFIG_IS_ENABLED(CMD_USB) 35 | #define BOOT_TARGET_USB(func) func(USB, usb, 0) 36 | #else 37 | @@ -170,6 +176,7 @@ 38 | #define BOOT_TARGET_DEVICES(func) \ 39 | BOOT_TARGET_MMC(func) \ 40 | BOOT_TARGET_USB(func) \ 41 | + BOOT_TARGET_NVME(func) \ 42 | BOOT_TARGET_PXE(func) \ 43 | BOOT_TARGET_DHCP(func) 44 | 45 | -- 46 | 2.17.1 47 | 48 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/0013-Revert-nvme-Correct-the-prps-per-page-calculation.patch: -------------------------------------------------------------------------------- 1 | From bb7d531f80d676a26f85982fc2bbb2a0939fd3bf Mon Sep 17 00:00:00 2001 2 | Message-Id: 3 | In-Reply-To: 4 | References: 5 | From: Stefan Agner 6 | Date: Thu, 23 Sep 2021 23:43:31 +0200 7 | Subject: [PATCH 4/8] Revert "nvme: Correct the prps per page calculation 8 | method" 9 | 10 | This reverts commit 859b33c948945f7904f60a2c12a3792d356d51ad. 11 | 12 | If there is more than one PRP List the last entry is a pointer to 13 | the next list. From the NVM Express specification: 14 | 15 | "The last entry within a memory page, as indicated by the memory page 16 | size in the CC.MPS field, shall be a PRP List pointer if there is more 17 | than a single memory page of data to be transferred." 18 | 19 | For the purpose of calculating the number of pages required for PRP 20 | lists we should always assume that the last entry is required for 21 | the next PRP list. 22 | 23 | Patch source: 24 | https://github.com/home-assistant/operating-system/tree/dev/buildroot-external/board/raspberrypi/patches/uboot 25 | at commit SHA b0bbe70315ee6474637b6c4242c41909c9ec2db8. 26 | 27 | Upstream-status: Backport 28 | Signed-off-by: Stefan Agner 29 | Cc: Wesley Sheng 30 | --- 31 | drivers/nvme/nvme.c | 2 +- 32 | 1 file changed, 1 insertion(+), 1 deletion(-) 33 | 34 | diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c 35 | index f6465ea7f4..1ae3001a90 100644 36 | --- a/drivers/nvme/nvme.c 37 | +++ b/drivers/nvme/nvme.c 38 | @@ -81,7 +81,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, 39 | u64 *prp_pool; 40 | int length = total_len; 41 | int i, nprps; 42 | - u32 prps_per_page = page_size >> 3; 43 | + u32 prps_per_page = (page_size >> 3) - 1; 44 | u32 num_pages; 45 | 46 | length -= (page_size - offset); 47 | -- 48 | 2.33.0 49 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/0014-nvme-improve-readability-of-nvme_setup_prps.patch: -------------------------------------------------------------------------------- 1 | From a09d03397cad903a7a5925d5a0e9e5262ab9b13e Mon Sep 17 00:00:00 2001 2 | Message-Id: 3 | In-Reply-To: 4 | References: 5 | From: Stefan Agner 6 | Date: Thu, 23 Sep 2021 23:52:44 +0200 7 | Subject: [PATCH 5/8] nvme: improve readability of nvme_setup_prps() 8 | 9 | Improve readability by introducing consts, reuse consts where 10 | appropriate and adding variables with discriptive name. 11 | 12 | Patch source: 13 | https://github.com/home-assistant/operating-system/tree/dev/buildroot-external/board/raspberrypi/patches/uboot 14 | at commit SHA b0bbe70315ee6474637b6c4242c41909c9ec2db8. 15 | 16 | Upstream-status: Backport 17 | Signed-off-by: Stefan Agner 18 | Signed-off-by: Alexandru Costache 19 | --- 20 | drivers/nvme/nvme.c | 10 +++++----- 21 | 1 file changed, 5 insertions(+), 5 deletions(-) 22 | 23 | diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c 24 | index 1ae3001a90..677e66b1bb 100644 25 | --- a/drivers/nvme/nvme.c 26 | +++ b/drivers/nvme/nvme.c 27 | @@ -76,12 +76,12 @@ static int nvme_wait_ready(struct nvme_dev *dev, bool enabled) 28 | static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, 29 | int total_len, u64 dma_addr) 30 | { 31 | - u32 page_size = dev->page_size; 32 | + const u32 page_size = dev->page_size; 33 | + const u32 prps_per_page = (page_size >> 3) - 1; 34 | int offset = dma_addr & (page_size - 1); 35 | u64 *prp_pool; 36 | int length = total_len; 37 | int i, nprps; 38 | - u32 prps_per_page = (page_size >> 3) - 1; 39 | u32 num_pages; 40 | 41 | length -= (page_size - offset); 42 | @@ -119,9 +119,9 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, 43 | prp_pool = dev->prp_pool; 44 | i = 0; 45 | while (nprps) { 46 | - if (i == ((page_size >> 3) - 1)) { 47 | - *(prp_pool + i) = cpu_to_le64((ulong)prp_pool + 48 | - page_size); 49 | + if (i == prps_per_page) { 50 | + u64 next_prp_list = (u64)prp_pool + page_size; 51 | + *(prp_pool + i) = cpu_to_le64(next_prp_list); 52 | i = 0; 53 | prp_pool += page_size; 54 | } 55 | -- 56 | 2.33.0 57 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/0017-use-temp-ptr-to-buffer.patch: -------------------------------------------------------------------------------- 1 | From d033f717faaa1c41f4d80f564e21afe66583f7ed Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Wed, 9 Mar 2022 15:05:48 +0100 4 | Subject: [PATCH] The current code invalidates the range after the read buffer 5 | since the buffer pointer gets incremented in the read loop. Use a temporary 6 | pointer to make sure we have a pristine pointer to invalidate the correct 7 | memory range after read. 8 | 9 | Fixes: 704e040a51d2 ("nvme: Apply cache operations on the DMA buffers") 10 | 11 | Patch source: https://lists.denx.de/pipermail/u-boot/2021-September/461882.html 12 | 13 | Upstream-status: Backport 14 | Signed-off-by: Stefan Agner 15 | Signed-off-by: Alexandru Costache 16 | --- 17 | drivers/nvme/nvme.c | 7 ++++--- 18 | 1 file changed, 4 insertions(+), 3 deletions(-) 19 | 20 | diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c 21 | index 0b7082d71b..97b533f85c 100644 22 | --- a/drivers/nvme/nvme.c 23 | +++ b/drivers/nvme/nvme.c 24 | @@ -746,6 +746,7 @@ static ulong nvme_blk_rw(struct udevice *udev, lbaint_t blknr, 25 | u64 prp2; 26 | u64 total_len = blkcnt << desc->log2blksz; 27 | u64 temp_len = total_len; 28 | + void *temp_buffer = buffer; 29 | 30 | u64 slba = blknr; 31 | u16 lbas = 1 << (dev->max_transfer_shift - ns->lba_shift); 32 | @@ -773,19 +774,19 @@ static ulong nvme_blk_rw(struct udevice *udev, lbaint_t blknr, 33 | } 34 | 35 | if (nvme_setup_prps(dev, &prp2, 36 | - lbas << ns->lba_shift, buffer)) 37 | + lbas << ns->lba_shift, (ulong)temp_buffer)) 38 | return -EIO; 39 | c.rw.slba = cpu_to_le64(slba); 40 | slba += lbas; 41 | c.rw.length = cpu_to_le16(lbas - 1); 42 | - c.rw.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); 43 | + c.rw.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, (ulong)temp_buffer)); 44 | c.rw.prp2 = cpu_to_le64(prp2); 45 | status = nvme_submit_sync_cmd(dev->queues[NVME_IO_Q], 46 | &c, NULL, IO_TIMEOUT); 47 | if (status) 48 | break; 49 | temp_len -= (u32)lbas << ns->lba_shift; 50 | - buffer += lbas << ns->lba_shift; 51 | + temp_buffer += lbas << ns->lba_shift; 52 | } 53 | 54 | if (read) 55 | -- 56 | 2.17.1 57 | 58 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/Revert-remove-include-config_defaults.h.patch: -------------------------------------------------------------------------------- 1 | From a163256f2a84ecdfda599c8756cb45780e5ba242 Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Sun, 7 Nov 2021 18:11:29 +0100 4 | Subject: [PATCH] Revert "remove include/config_defaults.h" 5 | 6 | This reverts commit 5c6a4d5a2779d7c2611319076d9aa4a23981855f. 7 | 8 | Upstream-Status: Inappropriate [configuration] 9 | Signed-off-by: Alexandru Costache 10 | --- 11 | include/config_defaults.h | 12 ++++++++++++ 12 | include/configs/sniper.h | 6 ++++++ 13 | scripts/Makefile.autoconf | 1 + 14 | 3 files changed, 19 insertions(+) 15 | create mode 100644 include/config_defaults.h 16 | 17 | diff --git a/include/config_defaults.h b/include/config_defaults.h 18 | new file mode 100644 19 | index 0000000000..d211a41ef2 20 | --- /dev/null 21 | +++ b/include/config_defaults.h 22 | @@ -0,0 +1,12 @@ 23 | +/* 24 | + * config_defaults.h - sane defaults for everyone 25 | + * 26 | + * Copyright (c) 2009 Analog Devices Inc. 27 | + * 28 | + * Licensed under the GPL-2 or later. 29 | + */ 30 | + 31 | +#ifndef _CONFIG_DEFAULTS_H_ 32 | +#define _CONFIG_DEFAULTS_H_ 33 | + 34 | +#endif 35 | diff --git a/include/configs/sniper.h b/include/configs/sniper.h 36 | index 4747e74b68..b0e2946699 100644 37 | --- a/include/configs/sniper.h 38 | +++ b/include/configs/sniper.h 39 | @@ -139,4 +139,10 @@ 40 | "mmc read ${kernel_addr_r} ${boot_mmc_start} ${boot_mmc_size} && " \ 41 | "bootm ${kernel_addr_r};" 42 | 43 | +/* 44 | + * Defaults 45 | + */ 46 | + 47 | +#include 48 | + 49 | #endif 50 | diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf 51 | index 0bfc1b2a62..00b8fb34aa 100644 52 | --- a/scripts/Makefile.autoconf 53 | +++ b/scripts/Makefile.autoconf 54 | @@ -104,6 +104,7 @@ define filechk_config_h 55 | | sed '/=/ {s/=/ /;q; } ; { s/$$/ 1/; }'; \ 56 | done; \ 57 | echo \#define CONFIG_BOARDDIR board/$(if $(VENDOR),$(VENDOR)/)$(BOARD);\ 58 | + echo \#include \; \ 59 | echo \#include \; \ 60 | echo \#include \; \ 61 | echo \#include \; \ 62 | -- 63 | 2.17.1 64 | 65 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/increase-usb-interface-nr.patch: -------------------------------------------------------------------------------- 1 | From 3aab51b564ae90971fba1b8a633ee3aa64d926bc Mon Sep 17 00:00:00 2001 2 | From: Sebastian Panceac 3 | Date: Mon, 14 Jan 2019 11:25:15 +0100 4 | Subject: [PATCH] Increase to 16 the number of USB interfaces 5 | 6 | This fixes the "Too many USB interfaces!" error thrown by u-boot when 7 | having lots of USB devices connected to the bus 8 | 9 | Signed-off-by: Sebastian Panceac 10 | 11 | Upstream-Status: Pending 12 | --- 13 | include/usb.h | 2 +- 14 | 1 file changed, 1 insertion(+), 1 deletion(-) 15 | 16 | diff --git a/include/usb.h b/include/usb.h 17 | index b6b48a8c60..920464fcd7 100644 18 | --- a/include/usb.h 19 | +++ b/include/usb.h 20 | @@ -33,7 +33,7 @@ 21 | 22 | #define USB_MAX_DEVICE 32 23 | #define USB_MAXCONFIG 8 24 | -#define USB_MAXINTERFACES 8 25 | +#define USB_MAXINTERFACES 16 26 | #define USB_MAXENDPOINTS 16 27 | #define USB_MAXCHILDREN 8 /* This is arbitrary */ 28 | #define USB_MAX_HUB 16 29 | -- 30 | 2.17.1 31 | 32 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/pi4-fix-crash-when-issuing-usb-reset.patch: -------------------------------------------------------------------------------- 1 | From b083a894037511e56a8af06d00d790b62287f73f Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Mon, 30 Nov 2020 15:12:30 +0100 4 | Subject: [PATCH] pi4: fix crash when issuing usb reset 5 | 6 | If some specific keyboards or an arduino 7 | are connected to the Pi4 USB port, abort_td() 8 | will hit one of the BUG() statements and u-boot 9 | will reset. It will now take a bit longer to boot 10 | if a problematic device is connected, but at least 11 | u-boot won't crash or reset. 12 | 13 | Rebased from last patch in this series: 14 | http://u-boot.10912.n7.nabble.com/RFC-PATCH-v2-0-5-Improve-USB-Keyboard-support-for-rpi3-rpi4-td418314.html#a418316 15 | 16 | Upstream-Status: Pending 17 | Signed-off-by: Alexandru Costache 18 | --- 19 | drivers/usb/host/xhci-ring.c | 15 +++++++++++---- 20 | 1 file changed, 11 insertions(+), 4 deletions(-) 21 | 22 | diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c 23 | index 86aeaab412..47a0438a53 100644 24 | --- a/drivers/usb/host/xhci-ring.c 25 | +++ b/drivers/usb/host/xhci-ring.c 26 | @@ -494,11 +494,18 @@ static void abort_td(struct usb_device *udev, int ep_index) 27 | xhci_queue_command(ctrl, NULL, udev->slot_id, ep_index, TRB_STOP_RING); 28 | 29 | event = xhci_wait_for_event(ctrl, TRB_TRANSFER); 30 | - field = le32_to_cpu(event->trans_event.flags); 31 | - BUG_ON(TRB_TO_SLOT_ID(field) != udev->slot_id); 32 | - BUG_ON(TRB_TO_EP_INDEX(field) != ep_index); 33 | - BUG_ON(GET_COMP_CODE(le32_to_cpu(event->trans_event.transfer_len 34 | + 35 | + if (event) { 36 | + field = le32_to_cpu(event->trans_event.flags); 37 | + BUG_ON(TRB_TO_SLOT_ID(field) != udev->slot_id); 38 | + BUG_ON(TRB_TO_EP_INDEX(field) != ep_index); 39 | + BUG_ON(GET_COMP_CODE(le32_to_cpu(event->trans_event.transfer_len 40 | != COMP_STOP))); 41 | + } else { 42 | + printf("XHCI abort timeout\n"); 43 | + return; 44 | + } 45 | + 46 | xhci_acknowledge_event(ctrl); 47 | 48 | event = xhci_wait_for_event(ctrl, TRB_COMPLETION); 49 | -- 50 | 2.17.1 51 | 52 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/rpi4-include-configs-Use-config-defaults.patch: -------------------------------------------------------------------------------- 1 | From 09407203d8129e3abee62c52cd43234bc25cc637 Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Mon, 20 Jul 2020 16:30:01 +0200 4 | Subject: [PATCH] include/configs: Use config defaults 5 | 6 | Upstream does not include the config defaults 7 | as added by meta-balena. Let's include them. 8 | 9 | Upstream-Status: Inappropriate [configuration] 10 | Signed-off-by: Alexandru Costache 11 | --- 12 | include/configs/rpi.h | 6 ++++++ 13 | 1 file changed, 6 insertions(+) 14 | 15 | diff --git a/include/configs/rpi.h b/include/configs/rpi.h 16 | index d4cb96a170..8fb0201b41 100644 17 | --- a/include/configs/rpi.h 18 | +++ b/include/configs/rpi.h 19 | @@ -6,6 +6,12 @@ 20 | #ifndef __CONFIG_H 21 | #define __CONFIG_H 22 | 23 | +/* 24 | + * Defaults 25 | + */ 26 | + 27 | +#include 28 | + 29 | #include 30 | #include 31 | 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot/serial_pl01x-Add-retry-limit-when-writing-to-uart-co.patch: -------------------------------------------------------------------------------- 1 | From 7e1061c2c5bfc13bcd14ea80f41793efc2859d66 Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Tue, 26 Jan 2021 11:47:49 +0100 4 | Subject: [PATCH] serial_pl01x: Add retry limit when writing to uart console 5 | 6 | The newer 2020.x u-boot waits indefinitely to write 7 | to the console if uart has been disabled or is incorrectly 8 | configured. Let's add a retry timeout and give up if impossible 9 | to put chars on the line, like we did for bcm283x_mu. 10 | 11 | Upstream-Status: Inappropriate [configuration] 12 | Signed-off-by: Alexandru Costache 13 | --- 14 | drivers/serial/serial_pl01x.c | 11 +++++++++-- 15 | 1 file changed, 9 insertions(+), 2 deletions(-) 16 | 17 | diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c 18 | index 6e5d81ce34..22d985f96c 100644 19 | --- a/drivers/serial/serial_pl01x.c 20 | +++ b/drivers/serial/serial_pl01x.c 21 | @@ -34,11 +34,18 @@ static struct pl01x_regs *base_regs __attribute__ ((section(".data"))); 22 | 23 | #endif 24 | 25 | +static uint16_t putc_retry __section(".data"); 26 | static int pl01x_putc(struct pl01x_regs *regs, char c) 27 | { 28 | /* Wait until there is space in the FIFO */ 29 | - if (readl(®s->fr) & UART_PL01x_FR_TXFF) 30 | - return -EAGAIN; 31 | + if (readl(®s->fr) & UART_PL01x_FR_TXFF) { 32 | + if (++putc_retry) { 33 | + return -EAGAIN; 34 | + } else { 35 | + /* Couldn't write for too long, drop char */ 36 | + return 0; 37 | + } 38 | + } 39 | 40 | /* Send the character */ 41 | writel(c, ®s->dr); 42 | -- 43 | 2.17.1 44 | 45 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend: -------------------------------------------------------------------------------- 1 | inherit resin-u-boot 2 | UBOOT_KCONFIG_SUPPORT = "1" 3 | 4 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 5 | 6 | # Remove patch inherited from meta-resin. This needs to be rebased for v2018.07 7 | SRC_URI:remove = " file://resin-specific-env-integration-kconfig.patch " 8 | 9 | # Update to u-boot v2021.10 on top of which 10 | # we apply the NVME patches for CM4. 11 | SRCREV="d80bb749fab53da72c4a0e09b8c2d2aaa3103c91" 12 | 13 | RPI_PATCHES = " \ 14 | file://Revert-remove-include-config_defaults.h.patch \ 15 | file://rpi4-include-configs-Use-config-defaults.patch \ 16 | file://rpi-Use-CONFIG_OF_BOARD-instead-of-CONFIG_EMBED.patch \ 17 | file://increase-usb-interface-nr.patch \ 18 | file://0002-raspberrypi-Disable-simple-framebuffer-support.patch \ 19 | file://0001-avoid-block-uart-write.patch \ 20 | file://u-boot-Remove-usb-start-from-CONFIG_PREBOOT.patch \ 21 | " 22 | 23 | SRC_URI += " \ 24 | file://0001-Integrate-machine-independent-resin-environment-conf.patch \ 25 | ${RPI_PATCHES} \ 26 | " 27 | 28 | # These patches were obtained from 29 | # https://github.com/home-assistant/operating-system/pull/1557 30 | # and we can update to u-boot 2022 once the following topic 31 | # https://github.com/home-assistant/operating-system/pull/1761#issuecomment-1062992660 32 | # is clarified. 33 | SRC_URI:append:raspberrypicm4-ioboard = " \ 34 | file://0011-enable-nvme-cm4.patch \ 35 | file://0012-rpi-add-NVMe-to-boot-order.patch \ 36 | file://0013-Revert-nvme-Correct-the-prps-per-page-calculation.patch \ 37 | file://0014-nvme-improve-readability-of-nvme_setup_prps.patch \ 38 | file://0015-nvme-Use-pointer-for-CPU-addressed-buffers.patch \ 39 | file://0016-nvme-translate-virtual-addresses-bus-address.patch \ 40 | file://0017-use-temp-ptr-to-buffer.patch \ 41 | " 42 | 43 | # Disable flasher check since it starts usb unnecessarily 44 | # and we don't generate flasher images for any of the RPIs. 45 | # Also, add a retry count limit for the uart on u-boot 2020.x 46 | SRC_URI:append = " \ 47 | file://0001-rpi-Disable-image-flasher-check.patch \ 48 | file://serial_pl01x-Add-retry-limit-when-writing-to-uart-co.patch \ 49 | " 50 | 51 | BALENA_UBOOT_DEVICE_TYPES:append = " usb" 52 | 53 | # The CM4 Rpi firmware now supports booting from a NVME, 54 | # so we can add nvme to the list of balena boot devices 55 | BALENA_UBOOT_DEVICE_TYPES:append:raspberrypicm4-ioboard = " nvme" 56 | 57 | SRC_URI:append:raspberrypi4-64 = " \ 58 | file://pi4-fix-crash-when-issuing-usb-reset.patch \ 59 | " 60 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-connectivity/bluez5/bluez5_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:remove:fincm3 = "file://0001-bcm43xx-Add-bcm43xx-3wire-variant.patch" 4 | SRC_URI:remove:fincm3 = "file://0002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch" 5 | SRC_URI:remove:fincm3 = "file://0003-Increase-firmware-load-timeout-to-30s.patch" 6 | SRC_URI:remove = "file://0004-Move-the-43xx-firmware-into-lib-firmware.patch" 7 | 8 | RDEPENDS:${PN}:remove:fincm3 = "pi-bluetooth" 9 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-connectivity/pi-bluetooth/files/0002-bthelper-correct-path-for-hciconfig-under-Yocto.patch: -------------------------------------------------------------------------------- 1 | From f24693a1be280fc45366ba7feb7ca8c565884df1 Mon Sep 17 00:00:00 2001 2 | From: "Peter A. Bigot" 3 | Date: Wed, 14 Nov 2018 09:19:51 -0600 4 | Subject: [PATCH] bthelper: correct path for hciconfig under Yocto 5 | 6 | Upstream-Status: Inapproprate [OE-specific] 7 | Signed-off-by: Peter A. Bigot 8 | Signed-off-by: Andrei Gherzan 9 | --- 10 | usr/bin/bthelper | 6 +++--- 11 | 1 file changed, 3 insertions(+), 3 deletions(-) 12 | 13 | diff --git a/usr/bin/bthelper b/usr/bin/bthelper 14 | index 2133fbc..1fc9245 100755 15 | --- a/usr/bin/bthelper 16 | +++ b/usr/bin/bthelper 17 | @@ -12,8 +12,8 @@ fi 18 | dev=$1 19 | 20 | # Need to bring hci up before looking at MAC as it can be all zeros during init 21 | -/bin/hciconfig $dev up 22 | -if ! /bin/hciconfig $dev | grep -q "Bus: UART"; then 23 | +/usr/bin/hciconfig $dev up 24 | +if ! /usr/bin/hciconfig $dev | grep -q "Bus: UART"; then 25 | echo Not a UART-attached BT Modem 26 | exit 0 27 | fi 28 | @@ -26,7 +26,7 @@ if ( /usr/bin/hcitool -i $dev dev | grep -q -E '\s43:4[35]:' ); then 29 | BDADDR=`printf '0x%02x 0x%02x 0x%02x 0xeb 0x27 0xb8' $((0x$B3 ^ 0xaa)) $((0x$B2 ^ 0xaa)) $((0x$B1 ^ 0xaa))` 30 | 31 | /usr/bin/hcitool -i $dev cmd 0x3f 0x001 $BDADDR 32 | - /bin/hciconfig $dev reset 33 | + /usr/bin/hciconfig $dev reset 34 | else 35 | echo Raspberry Pi BDADDR already set 36 | fi 37 | -- 38 | 2.17.1 39 | 40 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-connectivity/pi-bluetooth/files/0003-bthelper-Set-BDADDR-if-not-initialized.patch: -------------------------------------------------------------------------------- 1 | From a2388b18d910748c8cfa49f509521028c5eed4fb Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Sat, 27 Nov 2021 11:50:04 +0100 4 | Subject: [PATCH] bthelper: Set BDADDR if not initialized 5 | 6 | With newer revisions of Pi-bluetooth, 7 | the CM4 IOBoard has the BT address set 8 | to AA:AA:AA:AA:AA:AA instead of the right 9 | value. Let's check for this too and allow 10 | bthelper to set the correct address in this case. 11 | 12 | Upstream-status: Pending 13 | Signed-off-by: Alexandru Costache 14 | --- 15 | usr/bin/bthelper | 2 +- 16 | 1 file changed, 1 insertion(+), 1 deletion(-) 17 | 18 | diff --git a/usr/bin/bthelper b/usr/bin/bthelper 19 | index 1fc9245..30b8e1c 100755 20 | --- a/usr/bin/bthelper 21 | +++ b/usr/bin/bthelper 22 | @@ -18,7 +18,7 @@ if ! /usr/bin/hciconfig $dev | grep -q "Bus: UART"; then 23 | exit 0 24 | fi 25 | 26 | -if ( /usr/bin/hcitool -i $dev dev | grep -q -E '\s43:4[35]:' ); then 27 | +if ( /usr/bin/hcitool -i $dev dev | grep -q -E '\s43:4[35]:|AA:AA:AA:AA:AA:AA' ); then 28 | SERIAL=`cat /proc/device-tree/serial-number | cut -c9-` 29 | B1=`echo $SERIAL | cut -c3-4` 30 | B2=`echo $SERIAL | cut -c5-6` 31 | -- 32 | 2.17.1 33 | 34 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_%.bbappend: -------------------------------------------------------------------------------- 1 | # Should be removed when we update the upstream meta-raspberrypi 2 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 3 | 4 | SRCREV = "fd4775bf90e037551532fc214a958074830bb80d" 5 | 6 | SRC_URI:remove = "file://0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch" 7 | 8 | SRC_URI:append = " \ 9 | file://0002-bthelper-correct-path-for-hciconfig-under-Yocto.patch \ 10 | file://0003-bthelper-Set-BDADDR-if-not-initialized.patch \ 11 | " 12 | 13 | do_install:append () { 14 | # Move udev rules into /lib as /etc/udev/rules.d is bind mounted for custom rules 15 | install -d ${D}${nonarch_base_libdir}/udev/rules.d 16 | mv ${D}/etc/udev/rules.d/*.rules ${D}${nonarch_base_libdir}/udev/rules.d/ 17 | } 18 | 19 | FILES:${PN} += "${nonarch_base_libdir}/udev/rules.d" 20 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-containers/docker-disk/balena-supervisor.bbappend: -------------------------------------------------------------------------------- 1 | LED_FILE:rpi = "/sys/class/leds/led0/brightness" 2 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/extra-udev-rules/extra-udev-rules.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:append := ":${THISDIR}/files" 2 | 3 | SRC_URI:append = " \ 4 | file://50-revpi.rules \ 5 | file://86-nm-unmanaged-fin.rules \ 6 | file://revpi_mac \ 7 | " 8 | 9 | do_install:append:fincm3() { 10 | # Install balenaFin uAP interface rules 11 | install -D -m 0644 ${WORKDIR}/86-nm-unmanaged-fin.rules ${D}/lib/udev/rules.d/86-nm-unmanaged-fin.rules 12 | } 13 | 14 | do_install:append:revpi() { 15 | # Install RevPi specific rules 16 | install -D -m 0644 ${WORKDIR}/50-revpi.rules ${D}/${nonarch_base_libdir}/udev/rules.d/50-revpi.rules 17 | install -D -m 0755 ${WORKDIR}/revpi_mac ${D}/${nonarch_base_libdir}/udev/revpi_mac 18 | } 19 | 20 | RDEPENDS:${PN}:append:revpi = "bash" 21 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/extra-udev-rules/files/86-nm-unmanaged-fin.rules: -------------------------------------------------------------------------------- 1 | # balenaFin uAP interface needs to be unmanaged by default as NetworkManager does not support well AP mode. 2 | ACTION=="add|change", SUBSYSTEM=="net", ENV{INTERFACE}=="uap[0-9]*", ENV{NM_UNMANAGED}="1" 3 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/extra-udev-rules/files/revpi_mac: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # SPDX-FileCopyrightText: 2023 KUNBUS GmbH 4 | # 5 | # SPDX-License-Identifier: GPL-2.0-or-later 6 | 7 | DEVNAME=$1 8 | OFFSET=$2 9 | 10 | if [ ! -f /proc/device-tree/hat/custom_5 ]; then 11 | exit 1 12 | fi 13 | 14 | read -r BASE_MAC < /proc/device-tree/hat/custom_5 15 | if [ -z "$BASE_MAC" ]; then 16 | exit 2 17 | fi 18 | 19 | MAC_NUM="${BASE_MAC//:/}" 20 | OFFSET_NUM=$(printf "%x" $((16#$MAC_NUM + $OFFSET))) 21 | OFFSET_MAC="$(echo "$OFFSET_NUM" | sed 's/.\{2\}/&:/g')" 22 | OFFSET_MAC="${OFFSET_MAC::-1}" 23 | 24 | /sbin/ip link set "$DEVNAME" address "$OFFSET_MAC" 25 | 26 | exit $? 27 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/glibc/glibc/Fix-build-failures-with-GCC11.patch: -------------------------------------------------------------------------------- 1 | From: Alexandru Costache 2 | Date: Tue, 4 Jan 2022 18:20:39 +0100 3 | Subject: [PATCH] Fix build failures with GCC 11 4 | 5 | We silence and fix compiler errors 6 | that occur with GCC11 and only if using 7 | the -Os flag. 8 | 9 | Upstream-status: Inappropriate [configuration] 10 | Signed-off-by: Alexandru Costache 11 | --- 12 | stdlib/canonicalize.c | 7 ++++++- 13 | sunrpc/netname.c | 6 ++++-- 14 | 2 files changed, 10 insertions(+), 3 deletions(-) 15 | 16 | diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c 17 | index 698f9ede255..a812e7b21e5 100644 18 | --- a/stdlib/canonicalize.c 19 | +++ b/stdlib/canonicalize.c 20 | @@ -41,7 +41,7 @@ 21 | #include 22 | #include 23 | #include 24 | - 25 | +#include 26 | #ifdef _LIBC 27 | # include 28 | # define GCC_LINT 1 29 | @@ -412,8 +412,13 @@ error_nomem: 30 | scratch_buffer_free (rname_buf); 31 | return failed ? NULL : resolved; 32 | } 33 | + /* With GCC 11, only if compiling with -Os, the compiler warns that 34 | + dest may be uninitialized. */ 35 | + DIAG_PUSH_NEEDS_COMMENT; 36 | + DIAG_IGNORE_Os_NEEDS_COMMENT (11, "-Wmaybe-uninitialized"); 37 | 38 | return scratch_buffer_dupfree (rname_buf, dest - rname); 39 | + DIAG_POP_NEEDS_COMMENT; 40 | } 41 | 42 | /* Return the canonical absolute name of file NAME. A canonical name 43 | diff --git a/sunrpc/netname.c b/sunrpc/netname.c 44 | index ceed23b1a72..31f823f9afc 100644 45 | --- a/sunrpc/netname.c 46 | +++ b/sunrpc/netname.c 47 | @@ -49,8 +49,10 @@ user2netname (char netname[MAXNETNAMELEN + 1], const uid_t uid, 48 | if ((strlen (dfltdom) + OPSYS_LEN + 3 + MAXIPRINT) > (size_t) MAXNETNAMELEN) 49 | return 0; 50 | 51 | - sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom); 52 | - i = strlen (netname); 53 | + /* Backported from http://patches-tcwg.linaro.org/patch/45439/ */ 54 | + i = snprintf (netname, MAXNETNAMELEN + 1, "%s.%d@%s", OPSYS, uid, dfltdom); 55 | + if (i > (size_t) MAXNETNAMELEN) 56 | + return 0; 57 | if (netname[i - 1] == '.') 58 | netname[i - 1] = '\0'; 59 | return 1; 60 | -- 61 | 2.17.1 62 | 63 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/glibc/glibc_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/glibc:" 2 | 3 | # Pi4 uses the -Os gcc flag so 4 | # this requires fixes for the warnings 5 | # that are treated as errors, and which only 6 | # occurr when optimizing for space. 7 | SRC_URI:append:raspberrypi4-64 = " \ 8 | file://Fix-build-failures-with-GCC11.patch \ 9 | " 10 | 11 | SRC_URI:append:raspberrypi3-64 = " \ 12 | file://Fix-build-failures-with-GCC11.patch \ 13 | " 14 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/images/balena-image-bootloader-initramfs.bbappend: -------------------------------------------------------------------------------- 1 | PACKAGE_INSTALL:append:raspberrypi4-64 = " initramfs-module-kexec-pi4-fwgpio" 2 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/images/balena-image-flasher.bbappend: -------------------------------------------------------------------------------- 1 | include balena-image.inc 2 | 3 | init_board_config() { 4 | sed -i 's/$/ root=LABEL=flash-rootA flasher migrate/g' "${BALENA_BOOT_WORKDIR}/cmdline.txt" 5 | } 6 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/images/balena-image-initramfs.bbappend: -------------------------------------------------------------------------------- 1 | PACKAGE_INSTALL:remove:revpi = "initramfs-module-migrate" 2 | 3 | PACKAGE_INSTALL:append:raspberrypicm4-ioboard-sb = " initramfs-module-kexec-pi4-fwgpio" 4 | IMAGE_ROOTFS_MAXSIZE:raspberrypicm4-ioboard-sb = "51200" 5 | 6 | # increase initramfs maxsize to 40 MiB 7 | IMAGE_ROOTFS_MAXSIZE:raspberrypi5 = "40960" 8 | IMAGE_ROOTFS_MAXSIZE:raspberrypi4-64 = "40960" 9 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/images/balena-image.bbappend: -------------------------------------------------------------------------------- 1 | include balena-image.inc 2 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/initrdscripts/files/cryptsetup-rpi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # shellcheck disable=SC1091 4 | . /usr/libexec/os-helpers-logging 5 | . /usr/libexec/os-helpers-fs 6 | . /usr/libexec/os-helpers-sb 7 | . /usr/sbin/balena-config-defaults 8 | 9 | # Give a chance to the by-state directory to appear 10 | # We do not expect any particular device or partition to come up 11 | # but if balenaOS is correctly configured on the device the by-state 12 | # directory will eventually be created by the custom udev rule. 13 | # This is useful if the rootfs is on a device that takes a while 14 | # to initialize such as a USB disk. 15 | wait4file "/dev/disk/by-state" "50" 16 | BALENA_NONENC_BOOT_DEV="" 17 | 18 | cryptsetup_enabled() { 19 | # Flasher should not try to unlock the partitions 20 | if [ "$bootparam_flasher" = "true" ]; then 21 | return 1 22 | fi 23 | 24 | # Ensure that secure boot is enabled and device is locked 25 | if ! is_secured; then 26 | fail "Device not locked - boot aborted" 27 | fi 28 | 29 | BALENA_NONENC_BOOT_DEV=$(get_state_path_from_label @@BALENA_NONENC_BOOT_LABEL@@) 30 | # Only run if the boot partition is split 31 | if [ ! -e "$BALENA_NONENC_BOOT_DEV" ]; then 32 | return 1 33 | fi 34 | 35 | # Check whether there are any LUKS partitions 36 | if ! lsblk -nlo fstype | grep -q crypto_LUKS; then 37 | return 1 38 | fi 39 | 40 | return 0 41 | } 42 | 43 | cryptsetup_run() { 44 | TMP_MOUNT_DIR=$(mktemp -d) 45 | mount "$BALENA_NONENC_BOOT_DEV" "$TMP_MOUNT_DIR" 46 | 47 | PASSPHRASE_FILE=$(mktemp -u) 48 | if ! gpg --decrypt --batch --passphrase "$(otp_read_key)" -o "$PASSPHRASE_FILE" "${TMP_MOUNT_DIR}/balena-luks.enc"; then 49 | umount "$TMP_MOUNT_DIR" 50 | fail "Failed to decrypt LUKS passphrase" 51 | fi 52 | 53 | BOOT_DEVICE=$(lsblk -nlo pkname "${BALENA_NONENC_BOOT_DEV}") 54 | 55 | # Unlock all the partitions - cryptsetup luksOpen does not wait for udev processing 56 | # of the DM device to complete, it just kicks off the process and returns. 57 | # Since this is async, we can perform all the luksOpens here, note the device names 58 | # and wait for them in a separate loop later 59 | LUKS_UNLOCKED="" 60 | for LUKS_UUID in $(lsblk -nlo uuid,fstype "/dev/${BOOT_DEVICE}" | grep crypto_LUKS | cut -d " " -f 1); do 61 | cryptsetup luksOpen --key-file $PASSPHRASE_FILE UUID="${LUKS_UUID}" luks-"${LUKS_UUID}" 62 | LUKS_UNLOCKED="${LUKS_UNLOCKED} luks-${LUKS_UUID}" 63 | done 64 | 65 | # Wait for udev processing of each unlocked device 66 | for DM_NAME in ${LUKS_UNLOCKED}; do 67 | wait4udev "/dev/mapper/${DM_NAME}" 68 | done 69 | 70 | rm -f "$PASSPHRASE_FILE" 71 | umount "$TMP_MOUNT_DIR" 72 | rmdir "$TMP_MOUNT_DIR" 73 | } 74 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/initrdscripts/files/kexec_pi4_fwgpio: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # shellcheck disable=SC1091 4 | . /usr/libexec/os-helpers-logging 5 | 6 | kexec_pi4_fwgpio_enabled() { 7 | if [ "$bootparam_balena_stage2" = "true" ]; then 8 | return 0 9 | fi 10 | 11 | if [ -n "$bootparam_balena_pi4_fwgpio" ]; then 12 | return 0 13 | fi 14 | 15 | return 1 16 | } 17 | 18 | kexec_pi4_fwgpio_run() { 19 | # Find the wifi/bt device labelled "mmcnr" in the device tree 20 | WIFI_DT_NODE="mmcnr" 21 | WIFI_SYSFS_PATH="$(find /sys/bus/platform/devices -name "*.${WIFI_DT_NODE}")" 22 | 23 | # Exactly one device should match, but let's be defensive 24 | if [ "$(echo "${WIFI_SYSFS_PATH}" | wc -l)" -gt 1 ]; then 25 | warn "Multiple '${WIFI_DT_NODE}' devices found, will use the first one" 26 | WIFI_SYSFS_PATH="$(echo "${WIFI_SYSFS_PATH}" | head -n 1)" 27 | fi 28 | 29 | # readlink here, because the driver unbinds as we manipulate the GPIOs 30 | WIFI_DRIVER_DIR="$(readlink -f "${WIFI_SYSFS_PATH}/driver")" 31 | WIFI_DEV="$(basename "${WIFI_SYSFS_PATH}")" 32 | 33 | GPIO_SYSFS_DIR="/sys/class/gpio" 34 | 35 | FW_GPIO_BASE="504" 36 | BT_ON="0" 37 | WL_ON="1" 38 | 39 | NEED_RESET="0" 40 | CURRENT_STATE="0" 41 | for PIN in "${BT_ON}" "${WL_ON}"; do 42 | GPIO=$["${FW_GPIO_BASE}" + "${PIN}"] 43 | echo "${GPIO}" > "${GPIO_SYSFS_DIR}/export" 44 | PIN_VALUE="$(cat "${GPIO_SYSFS_DIR}/gpio${GPIO}/value")" 45 | 46 | if [ "$bootparam_balena_stage2" = "true" ]; then 47 | CURRENT_STATE=$["${CURRENT_STATE}" | ("${PIN_VALUE}" << "${PIN}")] 48 | elif [ -n "$bootparam_balena_pi4_fwgpio" ]; then 49 | NEW_VALUE=$[("$bootparam_balena_pi4_fwgpio" >> "${PIN}") & 1] 50 | echo "${NEW_VALUE}" > "${GPIO_SYSFS_DIR}/gpio${GPIO}/value" 51 | 52 | if [ "${PIN_VALUE}" != "${NEW_VALUE}" ]; then 53 | NEED_RESET="1" 54 | fi 55 | fi 56 | 57 | echo "${GPIO}" > "${GPIO_SYSFS_DIR}/unexport" 58 | done 59 | 60 | if [ "${NEED_RESET}" = "1" ]; then 61 | echo -n "${WIFI_DEV}" > "${WIFI_DRIVER_DIR}/unbind" 62 | echo -n "${WIFI_DEV}" > "${WIFI_DRIVER_DIR}/bind" 63 | fi 64 | 65 | if [ "$bootparam_balena_stage2" = "true" ]; then 66 | export KEXEC_EXTRA_ARGS="${KEXEC_EXTRA_ARGS} balena_pi4_fwgpio=${CURRENT_STATE}" 67 | fi 68 | } 69 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/initrdscripts/initramfs-framework_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " \ 4 | file://cryptsetup-rpi \ 5 | file://kexec_pi4_fwgpio \ 6 | " 7 | 8 | PACKAGES:append = " initramfs-module-kexec-pi4-fwgpio" 9 | SUMMARY:initramfs-module-kexec-pi4-fwgpio = "Hook necessary to persist the value of Pi4/CM4 firmware GPIOs after kexec" 10 | RDEPENDS:initramfs-module-kexec-pi4-fwgpio = "initramfs-module-kexec" 11 | FILES:initramfs-module-kexec-pi4-fwgpio = "/init.d/73-kexec_pi4_fwgpio" 12 | 13 | PACKAGES:remove:revpi = "initramfs-module-migrate" 14 | do_install:append:revpi() { 15 | rm -f ${D}/init.d/92-migrate 16 | } 17 | 18 | do_install:append() { 19 | install -d ${D}/init.d 20 | 21 | install -m 0755 ${WORKDIR}/cryptsetup-rpi ${D}/init.d/72-cryptsetup 22 | sed -i -e "s/@@BALENA_NONENC_BOOT_LABEL@@/${BALENA_NONENC_BOOT_LABEL}/g" ${D}/init.d/72-cryptsetup 23 | 24 | install -m 0755 ${WORKDIR}/kexec_pi4_fwgpio ${D}/init.d/73-kexec_pi4_fwgpio 25 | } 26 | 27 | RDEPENDS:initramfs-module-cryptsetup:append = " os-helpers-otp gnupg" 28 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/packagegroups/packagegroup-balena-connectivity.bbappend: -------------------------------------------------------------------------------- 1 | CONNECTIVITY_FIRMWARES:append = " \ 2 | linux-firmware-rpidistro-bcm43430 \ 3 | linux-firmware-rpidistro-bcm43455 \ 4 | linux-firmware-sd8887 \ 5 | bluez-firmware-rpidistro-bcm43430a1-hcd \ 6 | bluez-firmware-rpidistro-bcm4345c0-hcd \ 7 | " 8 | CONNECTIVITY_FIRMWARES:append:raspberrypi = " linux-firmware-mt7601u" 9 | 10 | CONNECTIVITY_FIRMWARES:append:raspberrypi400-64 = " \ 11 | linux-firmware-rpidistro-bcm43456 \ 12 | bluez-firmware-rpidistro-bcm4345c5-hcd \ 13 | " 14 | 15 | CONNECTIVITY_FIRMWARES:remove:raspberrypi4-64 = " \ 16 | linux-firmware-rpidistro-bcm43436 \ 17 | linux-firmware-rpidistro-bcm43436s \ 18 | " 19 | 20 | CONNECTIVITY_FIRMWARES:append:raspberrypi0-2w-64 = " \ 21 | linux-firmware-rpidistro-bcm43436 \ 22 | linux-firmware-rpidistro-bcm43436s \ 23 | bluez-firmware-rpidistro-bcm43430b0-hcd \ 24 | " 25 | 26 | CONNECTIVITY_FIRMWARES:remove:raspberrypi0-2w-64 = " \ 27 | linux-firmware-rpidistro-bcm43430 \ 28 | linux-firmware-rpidistro-bcm43455 \ 29 | bluez-firmware-rpidistro-bcm43430a1-hcd \ 30 | bluez-firmware-rpidistro-bcm4345c0-hcd \ 31 | " 32 | 33 | REMOVED_FOR_HUP_SPACE = " \ 34 | linux-firmware-bcm43455 \ 35 | linux-firmware-ibt-11-5 \ 36 | linux-firmware-ibt-12-16 \ 37 | linux-firmware-ibt-18-16-1 \ 38 | linux-firmware-ibt-hw-37-7 \ 39 | linux-firmware-ibt-hw-37-8 \ 40 | linux-firmware-iwlwifi-3168 \ 41 | linux-firmware-iwlwifi-9000 \ 42 | linux-firmware-iwlwifi-9260 \ 43 | linux-firmware-iwlwifi-qu-b0-hr-b0 \ 44 | linux-firmware-pcie8897 \ 45 | linux-firmware-rtl8723 \ 46 | linux-firmware-rtl8821 \ 47 | linux-firmware-rtl8723b-bt \ 48 | linux-firmware-ralink-nic \ 49 | linux-firmware-ath9k \ 50 | linux-firmware-rtl8192cu \ 51 | linux-firmware-rtl8192su \ 52 | linux-firmware-bcm43143 \ 53 | linux-firmware-iwlwifi-135-6 \ 54 | linux-firmware-iwlwifi-3160-7 \ 55 | linux-firmware-iwlwifi-3160-8 \ 56 | linux-firmware-iwlwifi-3160-9 \ 57 | linux-firmware-iwlwifi-6000-4 \ 58 | linux-firmware-iwlwifi-6000g2a-5 \ 59 | linux-firmware-iwlwifi-6000g2a-6 \ 60 | linux-firmware-iwlwifi-6000g2b-5 \ 61 | linux-firmware-iwlwifi-6000g2b-6 \ 62 | linux-firmware-iwlwifi-6050-4 \ 63 | linux-firmware-iwlwifi-6050-5 \ 64 | linux-firmware-iwlwifi-7260 \ 65 | linux-firmware-iwlwifi-7265 \ 66 | linux-firmware-iwlwifi-7265d \ 67 | linux-firmware-iwlwifi-8000c \ 68 | linux-firmware-iwlwifi-8265 \ 69 | linux-firmware-wl18xx \ 70 | linux-firmware-rpidistro-bcm43430 \ 71 | linux-firmware-sd8887 \ 72 | bluez-firmware-rpidistro-bcm43430a1-hcd \ 73 | " 74 | 75 | # Temporary make space for HUP, untill firmwares 76 | # are provided by hostapp-extensions 77 | CONNECTIVITY_FIRMWARES:remove:raspberrypi400-64 = "${REMOVED_FOR_HUP_SPACE}" 78 | CONNECTIVITY_FIRMWARES:remove:raspberrypicm4-ioboard = "${REMOVED_FOR_HUP_SPACE}" 79 | CONNECTIVITY_FIRMWARES:remove:raspberrypi0-2w-64 = "${REMOVED_FOR_HUP_SPACE}" 80 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/packagegroups/packagegroup-resin.bbappend: -------------------------------------------------------------------------------- 1 | RDEPENDS:${PN} += "udev-rules-rpi \ 2 | " 3 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/systemd/systemd-serialgetty.bbappend: -------------------------------------------------------------------------------- 1 | do_install:append:revpi() { 2 | if [ ! -z "${SERIAL_CONSOLES}" ] ; then 3 | tmp="${SERIAL_CONSOLES}" 4 | for entry in $tmp ; do 5 | baudrate=`echo $entry | sed 's/\;.*//'` 6 | ttydev=`echo $entry | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'` 7 | if [ "$baudrate" = "$default_baudrate" ] ; then 8 | # disable the service 9 | rm -rf ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service 10 | else 11 | # disable the service 12 | rm -rf ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service 13 | fi 14 | done 15 | fi 16 | } 17 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/systemd/systemd/rpi/balena-os-sysctl.conf: -------------------------------------------------------------------------------- 1 | fs.inotify.max_user_instances=512 2 | net.ipv4.ip_local_port_range=49152 65535 3 | vm.overcommit_memory=1 4 | net.ipv4.conf.all.rp_filter=2 5 | kernel.printk = 4 4 1 7 6 | kernel.hung_task_panic = 1 7 | kernel.hung_task_timeout_secs = 240 8 | 9 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/systemd/systemd/rpi/watchdog.conf: -------------------------------------------------------------------------------- 1 | [Manager] 2 | RuntimeWatchdogSec=10s 3 | RebootWatchdogSec=15s 4 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/systemd/systemd_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend:rpi := "${THISDIR}/${PN}/rpi:" 2 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-core/udev/udev-rules-rpi.bbappend: -------------------------------------------------------------------------------- 1 | do_install:append () { 2 | # Move udev rules into /lib as /etc/udev/rules.d is bind mounted for custom rules 3 | install -d ${D}${base_libdir}/udev/rules.d 4 | mv ${D}/etc/udev/rules.d/*.rules ${D}${base_libdir}/udev/rules.d/ 5 | } 6 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-devtools/usbboot/usbboot-native_git.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Generic firware USB loading tool for RaspberryPi" 2 | SECTION = "console/utils" 3 | HOMEPAGE = "https://github.com/raspberrypi/usbboot" 4 | LICENSE = "Apache-2.0" 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" 6 | 7 | SRCREV = "dce7f60c78e16794c8a03ba1f0089fec1d23a873" 8 | SRC_URI = "git://github.com/raspberrypi/usbboot.git;protocol=https;branch=master" 9 | 10 | inherit sign-rsa pkgconfig deploy native 11 | 12 | S = "${WORKDIR}/git" 13 | 14 | DEPENDS:append = " libusb1-native" 15 | 16 | do_install[network] = "1" 17 | do_install(){ 18 | install -m 755 ${S}/rpiboot ${D} 19 | install -m 644 ${S}/msd/bootcode.bin ${D} 20 | install -m 644 ${S}/msd/bootcode4.bin ${D} 21 | install -m 644 ${S}/msd/start.elf ${D} 22 | install -m 644 ${S}/msd/start4.elf ${D} 23 | if [ "x${SIGN_API}" != "x" ] && [ "${BALENA_SIGN_MSD}" = "1" ]; then 24 | install -d ${D}/secure-boot-msd/ 25 | if ! do_sign_rsa "${S}/secure-boot-msd/boot.img" "${D}/secure-boot-msd/boot.sig"; then 26 | bbfatal "Failed to sign boot image" 27 | fi 28 | install -m 644 ${S}/secure-boot-msd/boot.img ${D}/secure-boot-msd/ 29 | cp -av ${S}/secure-boot-msd/bootcode4.bin ${D}/secure-boot-msd/bootcode4.bin 30 | fi 31 | } 32 | 33 | do_deploy(){ 34 | install -d ${DEPLOYDIR}/usbboot/ 35 | cp -r ${D}/* ${DEPLOYDIR}/usbboot/ 36 | } 37 | addtask do_deploy before do_package after do_install 38 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-extended/phoenix-peripheral/phoenix-peripheral.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "recipe for script file" 2 | LICENSE = "MIT" 3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" 4 | 5 | SRC_URI = "git://github.com/balena-os/phoenix-peripheral.git;branch=master;protocol=https" 6 | SRCREV="29eb94ed3417f9207e37ce373a89a537c25f8a86" 7 | 8 | S = "${WORKDIR}/git" 9 | 10 | inherit systemd 11 | 12 | PACKAGES =+ "${PN}-button-trig ${PN}-lvd-hook ${PN}-gpio-wdt ${PN}-rtc-sync" 13 | RDEPENDS:${PN}-gpio-wdt += "watchdog" 14 | 15 | FILES:${PN} = " \ 16 | ${datadir}/phoenix/peripheral/* \ 17 | " 18 | 19 | FILES:${PN}-button-trig = " \ 20 | ${datadir}/phoenix/button-trig/* \ 21 | " 22 | 23 | FILES:${PN}-lvd-hook = " \ 24 | ${datadir}/phoenix/lvd-hook/* \ 25 | " 26 | 27 | FILES:${PN}-gpio-wdt = " \ 28 | ${systemd_system_unitdir}/gpio-wdt.service \ 29 | " 30 | 31 | FILES:${PN}-rtc-sync = " \ 32 | ${systemd_system_unitdir}/rtc-sync.service \ 33 | " 34 | 35 | SYSTEMD_PACKAGES = "${PN}-gpio-wdt ${PN}-rtc-sync" 36 | SYSTEMD_SERVICE:${PN}-gpio-wdt = "gpio-wdt.service" 37 | SYSTEMD_AUTO_ENABLE:${PN}-gpio-wdt = "enable" 38 | SYSTEMD_SERVICE:${PN}-rtc-sync = "rtc-sync.service" 39 | SYSTEMD_AUTO_ENABLE:${PN}-rtc-sync = "enable" 40 | 41 | DEPENDS += "libgpiod" 42 | 43 | TARGET_CC_ARCH += "${LDFLAGS}" 44 | 45 | do_compile() { 46 | cd ${S}/application/button 47 | oe_runmake 'CC=${CC}' all 48 | 49 | cd ${S}/application/lvd 50 | oe_runmake 'CC=${CC}' all 51 | } 52 | 53 | do_install() { 54 | install -d ${D}${datadir}/phoenix/peripheral 55 | cp -rf ${S}/scripts/* ${D}${datadir}/phoenix/peripheral 56 | 57 | install -d ${D}${datadir}/phoenix/button-trig 58 | install -m 0755 ${S}/application/button/button ${D}${datadir}/phoenix/button-trig 59 | 60 | install -d ${D}${datadir}/phoenix/lvd-hook 61 | install -m 0755 ${S}/application/lvd/lvd ${D}${datadir}/phoenix/lvd-hook 62 | 63 | install -d ${D}${systemd_system_unitdir} 64 | install -m 0644 ${S}/systemd/gpio-wdt.service ${D}${systemd_system_unitdir} 65 | 66 | install -d ${D}${systemd_system_unitdir} 67 | install -m 0644 ${S}/systemd/rtc-sync.service ${D}${systemd_system_unitdir} 68 | } 69 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-extended/unipi-tools/unipi-tools.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "UniPi Neuron Modbus utilities" 2 | LICENSE = "GPL-3.0-only" 3 | LIC_FILES_CHKSUM = "file://../debian/copyright;md5=2ae0c739310d5de8f2d85519ac1f2a50" 4 | 5 | SRC_URI = "git://github.com/UniPiTechnology/unipi-tools.git;protocol=https;nobranch=1" 6 | 7 | inherit systemd 8 | 9 | DEPENDS += "libmodbus systemd" 10 | RDEPENDS:${PN} += "libmodbus" 11 | 12 | # Corresonds to v1.2.44 13 | SRCREV = "8eadfe0dd3098e8973738c20d61b453b390d0f7d" 14 | 15 | S = "${WORKDIR}/git/src" 16 | 17 | TARGET_CC_ARCH += "${LDFLAGS}" 18 | EXTRA_OEMAKE += "MODBUSDIR=${STAGING_INCDIR}/.. CC='${CC}'" 19 | 20 | do_install() { 21 | # systemd unit configuration file 22 | install -d ${D}${systemd_unitdir}/system 23 | install -m 0644 \ 24 | ${S}/../unipi-common/systemd/system/unipicheck.service \ 25 | ${S}/../unipi-common/systemd/system/unipispi.target \ 26 | ${S}/../unipi-firmware-tools/systemd/system/unipifirmware.service \ 27 | ${S}/../unipi-modbus-tools/systemd/system/unipitcp.service \ 28 | ${D}${systemd_unitdir}/system/ 29 | 30 | install -d ${D}${sysconfdir}/default 31 | install -m 0644 \ 32 | ${S}/../unipi-firmware-tools/etc/default/unipi-firmware-tools \ 33 | ${S}/../unipi-modbus-tools/etc/default/unipitcp \ 34 | ${D}${sysconfdir}/default 35 | 36 | # install the map file needed to determine which systemd target needs to be started 37 | install -d ${D}/opt/unipi/data 38 | install -m 0644 ${S}/unipi-target.map ${D}/opt/unipi/data 39 | 40 | # install the tools 41 | install -d ${D}/opt/unipi/tools 42 | install -m 0755 \ 43 | ${S}/unipi_tcp_server \ 44 | ${S}/fwspi \ 45 | ${S}/fwserial \ 46 | ${S}/unipihostname \ 47 | ${S}/unipicheck \ 48 | ${D}/opt/unipi/tools 49 | 50 | # udev rules 51 | install -d ${D}${base_libdir}/udev/rules.d/ 52 | install -m 0644 ${S}/../unipi-common/udev/* ${D}${base_libdir}/udev/rules.d/ 53 | } 54 | 55 | FILES:${PN} += " \ 56 | /lib/systemd/system/unipi-ttymxc2-rs485.target \ 57 | /lib/systemd/system/unipispi.target \ 58 | /lib/systemd/system/unipi-ttys0-rs485.target \ 59 | /opt/unipi/data \ 60 | /opt/unipi/tools \ 61 | " 62 | SYSTEMD_PACKAGES = "${PN}" 63 | SYSTEMD_SERVICE:${PN} = " \ 64 | unipicheck.service \ 65 | unipifirmware.service \ 66 | unipitcp.service \ 67 | " 68 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-extended/userlandtools/files/0001-dtoverlay_main-Fix-configfs-mount-failure.patch: -------------------------------------------------------------------------------- 1 | From 0e749a81e716a08be889e031e22310cf031448e9 Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Tue, 19 Jan 2021 12:56:11 +0100 4 | Subject: [PATCH] dtoverlay_main: Fix configfs mount failure 5 | 6 | App tries to mount configfs inside /config/device-tree, 7 | but the configfs already contains device-tree. 8 | 9 | Also, remove useless calls to command processor 10 | since we don't need or install lxpanelctl scripts. 11 | 12 | Upstream-status: Inappropriate [configuration] 13 | Signed-off-by: Alexandru Costache 14 | --- 15 | .../linux/apps/dtoverlay/dtoverlay_main.c | 10 ++++++---- 16 | 1 file changed, 6 insertions(+), 4 deletions(-) 17 | 18 | diff --git a/host_applications/linux/apps/dtoverlay/dtoverlay_main.c b/host_applications/linux/apps/dtoverlay/dtoverlay_main.c 19 | index 2f3b083..2bbb5fe 100644 20 | --- a/host_applications/linux/apps/dtoverlay/dtoverlay_main.c 21 | +++ b/host_applications/linux/apps/dtoverlay/dtoverlay_main.c 22 | @@ -262,7 +262,7 @@ int main(int argc, const char **argv) 23 | 24 | cfg_dir = CFG_DIR_2 DT_SUBDIR; 25 | if (!dir_exists(cfg_dir) && 26 | - (run_cmd("mount -t configfs none '%s'", cfg_dir) != 0)) 27 | + (run_cmd("mount -t configfs none '%s'", CFG_DIR_2) != 0)) 28 | fatal_error("Failed to mount configfs - %d", errno); 29 | } 30 | 31 | @@ -313,7 +313,8 @@ int main(int argc, const char **argv) 32 | if (!dry_run) 33 | { 34 | root_check(); 35 | - run_cmd("which dtoverlay-pre >/dev/null 2>&1 && dtoverlay-pre"); 36 | + // lxpanel not used, script removed, avoid useless call 37 | + // run_cmd("which dtoverlay-pre >/dev/null 2>&1 && dtoverlay-pre"); 38 | } 39 | break; 40 | default: 41 | @@ -347,8 +348,9 @@ int main(int argc, const char **argv) 42 | case OPT_ADD: 43 | case OPT_REMOVE: 44 | case OPT_REMOVE_FROM: 45 | - if (!dry_run) 46 | - run_cmd("which dtoverlay-post >/dev/null 2>&1 && dtoverlay-post"); 47 | + // lxpanel not used, script removed, avoid useless call 48 | + // if (!dry_run) 49 | + // run_cmd("which dtoverlay-post >/dev/null 2>&1 && dtoverlay-post"); 50 | break; 51 | default: 52 | break; 53 | -- 54 | 2.17.1 55 | 56 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-extended/userlandtools/userlandtools.bb: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:append := ":${THISDIR}/files" 2 | 3 | DESCRIPTION = "This repository contains the source code for ARM side \ 4 | libraries and host binaries used on Raspberry Pi." 5 | LICENSE = "BSD-3-Clause" 6 | LIC_FILES_CHKSUM = "file://LICENCE;md5=0448d6488ef8cc380632b1569ee6d196" 7 | 8 | SRC_URI = "\ 9 | git://github.com/${SRCFORK}/userland.git;protocol=https;branch=${SRCBRANCH} \ 10 | file://0001-dtoverlay_main-Fix-configfs-mount-failure.patch \ 11 | " 12 | 13 | COMPATIBLE_MACHINE = "raspberrypi4-64" 14 | 15 | SRCBRANCH = "master" 16 | SRCFORK = "raspberrypi" 17 | SRCREV = "4a0a19b88b43e48c6b51b526b9378289fb712a4c" 18 | 19 | # Use the date of the above commit as the package version. Update this when 20 | # SRCREV is changed. 21 | PV = "20210111" 22 | 23 | S = "${WORKDIR}/git" 24 | 25 | inherit cmake pkgconfig 26 | 27 | ASNEEDED = "" 28 | EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS='-Wl,--no-as-needed' \ 29 | -DVMCS_INSTALL_PREFIX=${exec_prefix} -DARM64=ON " 30 | 31 | # Keep only those libs & bins that are actually 32 | # used during boot EEPROM image update 33 | do_install:append () { 34 | rm -rf ${D}${bindir}/tvservice 35 | rm -rf ${D}${bindir}/vchiq_test 36 | rm -rf ${D}${bindir}/dtmerge 37 | rm -rf ${D}${prefix}/include 38 | rm -rf ${D}${prefix}/src 39 | rm -rf ${D}${libdir}/pkgconfig 40 | rm -rf ${D}${libdir}/*debug* 41 | rm -rf ${D}${libdir}/*host* 42 | rm -rf ${D}${libdir}/*.a 43 | rm -rf ${D}${bindir}/*post 44 | rm -rf ${D}${bindir}/*pre 45 | } 46 | 47 | # Shared libs from userland package build aren't versioned, so we need 48 | # to force the .so files into the runtime package (and keep them 49 | # out of -dev package). 50 | FILES_SOLIBSDEV = "" 51 | INSANE_SKIP:${PN} += "dev-so" 52 | FILES:${PN} += " ${libdir}/*.so " 53 | RDEPENDS:${PN} += "bash" 54 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-extended/watchdog/watchdog-config.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:append:raspberrypi4-superhub := ":${THISDIR}/watchdog-config:${THISDIR}/${BPN}" 2 | 3 | SRC_URI:append:raspberrypi4-superhub = " \ 4 | file://watchdog-phoenix.conf \ 5 | " 6 | 7 | FILES:${PN}:append:raspberrypi4-superhub = " ${sysconfdir}/*" 8 | 9 | do_install:append:raspberrypi4-superhub() { 10 | install -Dm 0644 ${WORKDIR}/watchdog-phoenix.conf ${D}${sysconfdir}/watchdog.conf 11 | } 12 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-extended/watchdog/watchdog-config/watchdog-phoenix.conf: -------------------------------------------------------------------------------- 1 | #ping = 172.31.14.1 2 | #ping = 172.26.1.255 3 | #interface = eth0 4 | #file = /var/log/messages 5 | #change = 1407 6 | 7 | # Uncomment to enable test. Setting one of these values to '0' disables it. 8 | # These values will hopefully never reboot your machine during normal use 9 | # (if your machine is really hung, the loadavg will go much higher than 25) 10 | #max-load-1 = 24 11 | #max-load-5 = 18 12 | #max-load-15 = 12 13 | 14 | # Note that this is the number of pages! 15 | # To get the real size, check how large the pagesize is on your machine. 16 | #min-memory = 1 17 | 18 | #repair-binary = /usr/sbin/repair 19 | #repair-timeout = 20 | #test-binary = 21 | #test-timeout = 22 | 23 | watchdog-device = /dev/watchdog1 24 | 25 | # Defaults compiled into the binary 26 | #temperature-device = 27 | #max-temperature = 120 28 | 29 | # Defaults compiled into the binary 30 | #admin = root 31 | #interval = 1 32 | #logtick = 1 33 | #log-dir = /var/log/watchdog 34 | 35 | # This greatly decreases the chance that watchdog won't be scheduled before 36 | # your machine is really loaded 37 | realtime = yes 38 | priority = 1 39 | 40 | # Check if rsyslogd is still running by enabling the following line 41 | #pidfile = /var/run/rsyslogd.pid 42 | 43 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-extended/watchdog/watchdog/0001-Move-watchdog-service-before-networking.patch: -------------------------------------------------------------------------------- 1 | From 39823832c202a61fadae787c534d79ceb0ba7642 Mon Sep 17 00:00:00 2001 2 | From: Cyrus Chan 3 | Date: Sun, 23 Jul 2023 21:30:47 +0800 4 | Subject: [PATCH] Move watchdog service before networking 5 | 6 | --- 7 | debian/watchdog.service | 3 ++- 8 | 1 file changed, 2 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/debian/watchdog.service b/debian/watchdog.service 11 | index 50bcecc..70303f1 100644 12 | --- a/debian/watchdog.service 13 | +++ b/debian/watchdog.service 14 | @@ -1,6 +1,7 @@ 15 | [Unit] 16 | Description=watchdog daemon 17 | -After=multi-user.target 18 | +Before=network-pre.target 19 | +Wants=network-pre.target 20 | 21 | [Service] 22 | Type=forking 23 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-extended/watchdog/watchdog_5.16.bbappend: -------------------------------------------------------------------------------- 1 | SYSTEMD_AUTO_ENABLE:raspberrypi4-superhub = "enable" 2 | 3 | FILESEXTRAPATHS:prepend:raspberrypi4-superhub := "${THISDIR}/${PN}:" 4 | 5 | SRC_URI:append:raspberrypi4-superhub = " \ 6 | file://0001-Move-watchdog-service-before-networking.patch \ 7 | " 8 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-graphics/cairo/cairo_%.bbappend: -------------------------------------------------------------------------------- 1 | PACKAGECONFIG:remove = " egl glesv2" 2 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-Default-43455-firmware-to-standard-variant.patch: -------------------------------------------------------------------------------- 1 | From b9db43e36ad0942d33cb4db5b394abd722862568 Mon Sep 17 00:00:00 2001 2 | From: Andrei Gherzan 3 | Date: Fri, 9 Sep 2022 20:28:06 +0200 4 | Subject: [PATCH] Default 43455 firmware to standard variant 5 | 6 | The firmware for 43455 is loaded as a symlink: brcmfmac43455-sdio.bin. 7 | This symlink is now broken as the debian package handles the right 8 | target of this symlink through a postinstall. We don't have that logic 9 | here so we default to the standard variant. 10 | 11 | Upstream-Status: Inappropriate [issue reported at https://github.com/RPi-Distro/firmware-nonfree/issues/26] 12 | Signed-off-by: Andrei Gherzan 13 | --- 14 | debian/config/brcm80211/brcm/brcmfmac43455-sdio.bin | 2 +- 15 | 1 file changed, 1 insertion(+), 1 deletion(-) 16 | 17 | diff --git a/debian/config/brcm80211/brcm/brcmfmac43455-sdio.bin b/debian/config/brcm80211/brcm/brcmfmac43455-sdio.bin 18 | index 9c39208..b914838 120000 19 | --- a/debian/config/brcm80211/brcm/brcmfmac43455-sdio.bin 20 | +++ b/debian/config/brcm80211/brcm/brcmfmac43455-sdio.bin 21 | @@ -1 +1 @@ 22 | -../cypress/cyfmac43455-sdio.bin 23 | \ No newline at end of file 24 | +../cypress/cyfmac43455-sdio-standard.bin 25 | \ No newline at end of file 26 | -- 27 | 2.25.1 28 | 29 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux-kunbus/linux-kunbus/0001-Add-revpi-connect-can-overlay.patch: -------------------------------------------------------------------------------- 1 | From dcbb48cfd09651b54e001d1f8993cb9e8fd6fc32 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Adolfo=20Garc=C3=ADa?= 3 | Date: Tue, 1 Feb 2022 13:23:51 -0600 4 | Subject: [PATCH] Add revpi-connect-can 5 | 6 | This patch adds a device tree overlay to support RevolutionPi's Connect CAN module. Source was extracted from official image. 7 | 8 | Upstream-Status: Pending 9 | Signed-off-by: Adolfo E. García Castro 10 | 11 | --- 12 | arch/arm/boot/dts/overlays/Makefile | 1 + 13 | .../overlays/revpi-connect-can-overlay.dts | 70 +++++++++++++++++++ 14 | 2 files changed, 71 insertions(+) 15 | create mode 100644 arch/arm/boot/dts/overlays/revpi-connect-can-overlay.dts 16 | 17 | diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile 18 | index bff07c1748b7..ef64edafd6ba 100644 19 | --- a/arch/arm/boot/dts/overlays/Makefile 20 | +++ b/arch/arm/boot/dts/overlays/Makefile 21 | @@ -165,6 +165,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ 22 | qca7000.dtbo \ 23 | qca7000-uart0.dtbo \ 24 | rotary-encoder.dtbo \ 25 | + revpi-connect-can.dtbo \ 26 | rpi-backlight.dtbo \ 27 | rpi-cirrus-wm5102.dtbo \ 28 | rpi-dac.dtbo \ 29 | diff --git a/arch/arm/boot/dts/overlays/revpi-connect-can-overlay.dts b/arch/arm/boot/dts/overlays/revpi-connect-can-overlay.dts 30 | new file mode 100644 31 | index 000000000000..bb43bcb9e34d 32 | --- /dev/null 33 | +++ b/arch/arm/boot/dts/overlays/revpi-connect-can-overlay.dts 34 | @@ -0,0 +1,70 @@ 35 | +/dts-v1/; 36 | + 37 | +/ { 38 | + compatible = "brcm,bcm2837"; 39 | + 40 | + fragment@0 { 41 | + target = <0xffffffff>; 42 | + 43 | + __overlay__ { 44 | + status = "disabled"; 45 | + }; 46 | + }; 47 | + 48 | + fragment@1 { 49 | + target-path = "/clocks"; 50 | + 51 | + __overlay__ { 52 | + 53 | + can0_osc { 54 | + compatible = "fixed-clock"; 55 | + #clock-cells = <0x00>; 56 | + clock-frequency = <0x1e84800>; 57 | + phandle = <0x01>; 58 | + }; 59 | + }; 60 | + }; 61 | + 62 | + fragment@2 { 63 | + target = <0xffffffff>; 64 | + 65 | + __overlay__ { 66 | + #address-cells = <0x01>; 67 | + #size-cells = <0x00>; 68 | + 69 | + can@0 { 70 | + compatible = "holt,hi3110"; 71 | + reg = <0x00>; 72 | + spi-max-frequency = <0x989680>; 73 | + clocks = <0x01>; 74 | + interrupt-parent = <0xffffffff>; 75 | + #interrupt-cells = <0x02>; 76 | + interrupts = <0x1c 0x04>; 77 | + status = "okay"; 78 | + }; 79 | + }; 80 | + }; 81 | + 82 | + __symbols__ { 83 | + can0_osc = "/fragment@1/__overlay__/can0_osc"; 84 | + }; 85 | + 86 | + __fixups__ { 87 | + spidev0 = "/fragment@0:target:0"; 88 | + spi0 = "/fragment@2:target:0"; 89 | + gpio = "/fragment@2/__overlay__/can@0:interrupt-parent:0"; 90 | + }; 91 | + 92 | + __local_fixups__ { 93 | + 94 | + fragment@2 { 95 | + 96 | + __overlay__ { 97 | + 98 | + can@0 { 99 | + clocks = <0x00>; 100 | + }; 101 | + }; 102 | + }; 103 | + }; 104 | +}; 105 | -- 106 | 2.34.1 107 | 108 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux-kunbus/linux-kunbus/0001-rtc-hctosys-Correctly-guard-hw-clock-polling-code.patch: -------------------------------------------------------------------------------- 1 | From 5b4f84cf64b5357ee5631a842be8b65dea0d597a Mon Sep 17 00:00:00 2001 2 | From: Florin Sarbu 3 | Date: Tue, 10 Nov 2020 11:17:39 +0100 4 | Subject: [PATCH] rtc: hctosys: Correctly guard hw clock polling code 5 | 6 | Upstream-Status: Pending 7 | Signed-off-by: Florin Sarbu 8 | --- 9 | drivers/rtc/class.c | 2 ++ 10 | 1 file changed, 2 insertions(+) 11 | 12 | diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c 13 | index 60bd0c5..8a903fd 100644 14 | --- a/drivers/rtc/class.c 15 | +++ b/drivers/rtc/class.c 16 | @@ -341,8 +341,10 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev, 17 | dev_info(dev, "rtc core: registered %s as %s\n", 18 | name, dev_name(&rtc->dev)); 19 | 20 | +#ifdef CONFIG_RTC_HCTOSYS_DEVICE 21 | if (!strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE)) 22 | rtc_hctosys(rtc); 23 | +#endif 24 | 25 | return rtc; 26 | 27 | -- 28 | 2.7.4 29 | 30 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux-kunbus/linux-kunbus/default-cpu-governor.cfg: -------------------------------------------------------------------------------- 1 | # The defconfigs from the RPi Kernel set "powersave" as the default CPU governor. 2 | # That is a bad idea as it reduces performance, so we unset that default option here. 3 | # The option to build the powersave governor (but not as the default) is also enabled. 4 | # A fix for this was sent to upstream: https://github.com/raspberrypi/linux/pull/5666 5 | # However, we need to carry this option override until those defconfigs are fixed on 6 | # *all* the kernel branches that we support. So that can be a long time depending 7 | # on wheter the above PR gets accepted and/or backported to the stable branches. 8 | CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=n 9 | CONFIG_CPU_FREQ_GOV_POWERSAVE=y 10 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux-kunbus/linux-kunbus/initramfs-image-bundle.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_OVERLAY_FS=y 2 | CONFIG_SQUASHFS=y 3 | CONFIG_MTD=y 4 | CONFIG_MTD_UBI=y 5 | CONFIG_UBIFS_FS=y 6 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux-kunbus/linux-kunbus/raspberrypi4/rpi4-nvmem.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_NVMEM_RMEM=y 2 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux-kunbus/linux-kunbus/scripts-Fix-kernel-module-headers-build-in-Honister.patch: -------------------------------------------------------------------------------- 1 | From a1a71b1e9dd75124ec24c863c0aa8cef1e1405f6 Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Thu, 18 Nov 2021 10:30:13 +0100 4 | Subject: [PATCH] scripts: Fix kernel-module-headers build in Honister 5 | 6 | This is an older kernel which is now 7 | built with a newer gcc. 8 | 9 | See: https://lkml.org/lkml/2020/4/1/1206 10 | 11 | Upstream-status: Backport 12 | Signed-off-by: Alexandru Costache 13 | --- 14 | scripts/dtc/dtc-lexer.l | 1 - 15 | 1 file changed, 1 deletion(-) 16 | 17 | diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l 18 | index 615b7ec6588f..d3694d6cf202 100644 19 | --- a/scripts/dtc/dtc-lexer.l 20 | +++ b/scripts/dtc/dtc-lexer.l 21 | @@ -38,7 +38,6 @@ LINECOMMENT "//".*\n 22 | #include "srcpos.h" 23 | #include "dtc-parser.tab.h" 24 | 25 | -YYLTYPE yylloc; 26 | extern bool treesource_error; 27 | 28 | /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ 29 | -- 30 | 2.17.1 31 | 32 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux-kunbus/linux-kunbus/vc4graphics.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_I2C_BCM2835=y 2 | CONFIG_DRM=y 3 | CONFIG_DRM_FBDEV_EMULATION=y 4 | CONFIG_DRM_VC4=y 5 | CONFIG_SND=y 6 | CONFIG_SND_SOC=y 7 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux-kunbus/linux-kunbus_4.19.95.bb: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | LINUX_VERSION = "4.19.95" 4 | 5 | SRCREV = "raspberrypi-kernel_9.20200616-4.19.95+revpi1" 6 | SRC_URI = " \ 7 | git://github.com/RevolutionPi/linux;protocol=https;branch=revpi-4.19 \ 8 | " 9 | 10 | require recipes-kernel/linux/linux-raspberrypi.inc 11 | 12 | SRC_URI:remove = "file://rpi-kernel-misc.cfg" 13 | 14 | SRC_URI:append = " \ 15 | file://scripts-Fix-kernel-module-headers-build-in-Honister.patch \ 16 | file://0001-rtc-hctosys-Correctly-guard-hw-clock-polling-code.patch \ 17 | " 18 | 19 | LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" 20 | 21 | # we need to clean up all the following RPI_KERNEL_DEVICETREE changes when we switch to a newer kernel for revpi-connect and revpi-core-3 22 | RPI_KERNEL_DEVICETREE = " \ 23 | bcm2708-rpi-zero.dtb \ 24 | bcm2708-rpi-zero-w.dtb \ 25 | bcm2708-rpi-b.dtb \ 26 | bcm2708-rpi-b-rev1.dtb \ 27 | bcm2708-rpi-b-plus.dtb \ 28 | bcm2709-rpi-2-b.dtb \ 29 | bcm2710-rpi-2-b.dtb \ 30 | bcm2710-rpi-3-b.dtb \ 31 | bcm2710-rpi-3-b-plus.dtb \ 32 | bcm2711-rpi-4-b.dtb \ 33 | bcm2711-rpi-400.dtb \ 34 | bcm2708-rpi-cm.dtb \ 35 | bcm2710-rpi-cm3.dtb \ 36 | bcm2711-rpi-cm4.dtb \ 37 | " 38 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux-kunbus/linux-kunbus_6.1.46.bb: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | LINUX_VERSION = "6.1.46" 4 | 5 | SRCREV = "raspberrypi-kernel_1%9.20240205+1-6.1.46-1-revpi11+1" 6 | SRC_URI = " \ 7 | git://github.com/RevolutionPi/linux;protocol=https;branch=revpi-6.1 \ 8 | " 9 | require recipes-kernel/linux/linux-raspberrypi.inc 10 | 11 | SRC_URI:remove = "file://rpi-kernel-misc.cfg" 12 | 13 | LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" 14 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/files/android-drivers.cfg: -------------------------------------------------------------------------------- 1 | #CONFIG_ANDROID_BINDERFS is not set 2 | CONFIG_ANDROID_BINDER_IPC=y 3 | CONFIG_ANDROID_BINDER_DEVICES="binder" 4 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/files/default-cpu-governor.cfg: -------------------------------------------------------------------------------- 1 | # The defconfigs from the RPi Kernel set "powersave" as the default CPU governor. 2 | # That is a bad idea as it reduces performance, so we unset that default option here. 3 | # The option to build the powersave governor (but not as the default) is also enabled. 4 | # A fix for this was sent to upstream: https://github.com/raspberrypi/linux/pull/5666 5 | # However, we need to carry this option override until those defconfigs are fixed on 6 | # *all* the kernel branches that we support. So that can be a long time depending 7 | # on wheter the above PR gets accepted and/or backported to the stable branches. 8 | CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=n 9 | CONFIG_CPU_FREQ_GOV_POWERSAVE=y 10 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/files/initramfs-image-bundle.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_OVERLAY_FS=y 2 | CONFIG_SQUASHFS=y 3 | CONFIG_MTD=y 4 | CONFIG_MTD_UBI=y 5 | CONFIG_UBIFS_FS=y 6 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/files/powersave.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_SUSPEND=y 2 | CONFIG_SUSPEND_FREEZER=y 3 | CONFIG_HIBERNATE_CALLBACKS=y 4 | CONFIG_HIBERNATION=y 5 | CONFIG_PM_STD_PARTITION="/dev/mmcblk0p2" 6 | CONFIG_PM_SLEEP=y 7 | CONFIG_PM_SLEEP_SMP=y 8 | CONFIG_PM_AUTOSLEEP=y 9 | CONFIG_PM_WAKELOCKS=y 10 | CONFIG_PM_WAKELOCKS_LIMIT=100 11 | CONFIG_PM_WAKELOCKS_GC=y 12 | CONFIG_PM_GENERIC_DOMAINS_SLEEP=y 13 | CONFIG_ARCH_HIBERNATION_HEADER=y 14 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/files/raspberrypi4/rpi4-nvmem.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_NVMEM_RMEM=y 2 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/files/vc4graphics.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_I2C_BCM2835=y 2 | CONFIG_I2C_BRCMSTB=y 3 | CONFIG_DRM=y 4 | CONFIG_DRM_FBDEV_EMULATION=y 5 | CONFIG_DRM_VC4=y 6 | CONFIG_SND=y 7 | CONFIG_SND_SOC=y 8 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-balena-bootloader_%.bbappend: -------------------------------------------------------------------------------- 1 | # Enable the dwc2 driver 2 | BALENA_CONFIGS:append:raspberrypicm4-ioboard-sb = " dwc2" 3 | BALENA_CONFIGS[dwc2] = "CONFIG_USB_DWC2=y" 4 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-balena-bootloader_6.12.bb: -------------------------------------------------------------------------------- 1 | LINUX_VERSION ?= "6.12.25" 2 | LINUX_RPI_BRANCH ?= "" 3 | LINUX_RPI_KMETA_BRANCH ?= "yocto-6.12" 4 | 5 | SRCREV_machine = "166ef05dd8fcfafba2951f1c658e138d235dd04a" 6 | SRCREV_meta = "1f6ab68a1d86836bf1b82b791df03da3cfeacb3f" 7 | 8 | KMETA = "kernel-meta" 9 | 10 | SRC_URI = " \ 11 | git://github.com/raspberrypi/linux.git;name=machine;nobranch=1;protocol=https \ 12 | git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=${LINUX_RPI_KMETA_BRANCH};destsuffix=${KMETA} \ 13 | " 14 | SRC_URI:remove = "file://initramfs-image-bundle.cfg" 15 | SRC_URI:remove = "file://vc4graphics.cfg" 16 | SRC_URI:remove = "file://default-cpu-governor.cfg" 17 | 18 | require recipes-kernel/linux/linux-raspberrypi.inc 19 | 20 | inherit balena-bootloader 21 | 22 | BALENA_DEFCONFIG_NAME = "${KBUILD_DEFCONFIG}" 23 | 24 | BALENA_CONFIGS:append = " \ 25 | rpisense \ 26 | " 27 | 28 | BALENA_CONFIGS[rpisense] = " \ 29 | CONFIG_MFD_RPISENSE_CORE=n \ 30 | CONFIG_FB_RPISENSE=n \ 31 | " 32 | 33 | BALENA_CONFIGS_DEPS[secureboot] += " \ 34 | CONFIG_MODULE_SIG_FORMAT=y \ 35 | CONFIG_PKCS7_MESSAGE_PARSER=y \ 36 | CONFIG_SYSTEM_DATA_VERIFICATION=y \ 37 | CONFIG_SIGNED_PE_FILE_VERIFICATION=y \ 38 | " 39 | 40 | BALENA_CONFIGS[secureboot] += " \ 41 | CONFIG_KEXEC_IMAGE_VERIFY_SIG=y \ 42 | " 43 | 44 | do_deploy:append () { 45 | BOOTENV_FILE="${DEPLOYDIR}/${KERNEL_PACKAGE_NAME}/bootenv" 46 | grub-editenv "${BOOTENV_FILE}" create 47 | grub-editenv "${BOOTENV_FILE}" set "resin_root_part=A" 48 | grub-editenv "${BOOTENV_FILE}" set "bootcount=0" 49 | grub-editenv "${BOOTENV_FILE}" set "upgrade_available=0" 50 | } 51 | 52 | do_deploy[depends] += " grub-native:do_populate_sysroot" 53 | 54 | KERNEL_DTC_FLAGS += "-@ -H epapr" 55 | 56 | INITRAMFS_IMAGE = "balena-image-bootloader-initramfs" 57 | 58 | KERNEL_PACKAGE_NAME = "balena-bootloader" 59 | 60 | KERNEL_DEVICETREE = "${RPI_KERNEL_DEVICETREE}" 61 | 62 | PROVIDES = "virtual/balena-bootloader" 63 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "Linux Kernel for Raspberry Pi" 2 | SECTION = "kernel" 3 | LICENSE = "GPL-2.0-only" 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" 5 | 6 | COMPATIBLE_MACHINE ?= "^rpi$" 7 | 8 | PE = "1" 9 | PV = "${LINUX_VERSION}+git${SRCPV}" 10 | 11 | inherit siteinfo 12 | require recipes-kernel/linux/linux-yocto.inc 13 | 14 | SRC_URI += " \ 15 | ${@bb.utils.contains("INITRAMFS_IMAGE_BUNDLE", "1", "file://initramfs-image-bundle.cfg", "", d)} \ 16 | ${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "file://vc4graphics.cfg", "", d)} \ 17 | ${@bb.utils.contains("MACHINE_FEATURES", "wm8960", "file://wm8960.cfg", "", d)} \ 18 | file://default-cpu-governor.cfg \ 19 | " 20 | 21 | SRC_URI:append:raspberrypi4 = " \ 22 | file://rpi4-nvmem.cfg \ 23 | " 24 | 25 | KCONFIG_MODE = "--alldefconfig" 26 | KBUILD_DEFCONFIG:raspberrypi0-wifi ?= "bcmrpi_defconfig" 27 | KBUILD_DEFCONFIG:raspberrypi ?= "bcmrpi_defconfig" 28 | KBUILD_DEFCONFIG:raspberrypi-cm3 ?= "bcm2709_defconfig" 29 | KBUILD_DEFCONFIG:raspberrypi2 ?= "bcm2709_defconfig" 30 | KBUILD_DEFCONFIG:raspberrypi3 ?= "bcm2709_defconfig" 31 | KBUILD_DEFCONFIG:raspberrypi3-64 ?= "bcm2711_defconfig" 32 | KBUILD_DEFCONFIG:raspberrypi4 ?= "bcm2711_defconfig" 33 | KBUILD_DEFCONFIG:raspberrypi4-64 ?= "bcm2711_defconfig" 34 | KBUILD_DEFCONFIG:raspberrypi-armv7 ?= "bcm2711_defconfig" 35 | KBUILD_DEFCONFIG:raspberrypi-armv8 ?= "bcm2711_defconfig" 36 | KBUILD_DEFCONFIG:raspberrypi5 ?= "bcm2712_defconfig" 37 | 38 | LINUX_VERSION_EXTENSION ?= "" 39 | 40 | KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}" 41 | 42 | # A LOADADDR is needed when building a uImage format kernel. This value is not 43 | # set by default in rpi-4.8.y and later branches so we need to provide it 44 | # manually. This value unused if KERNEL_IMAGETYPE is not uImage. 45 | KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}" 46 | 47 | UBOOT_ENTRYPOINT = "0x00008000" 48 | UBOOT_LOADADDRESS = "0x00008000" 49 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Add-tpm-slb9670-tis-spi-DT-overlay.patch: -------------------------------------------------------------------------------- 1 | From: Michal Toman 2 | Date: Mon, 1 Feb 2021 16:05:38 +0100 3 | Subject: [PATCH] Add tpm-slb9670-tis-spi DT overlay 4 | 5 | Signed-off-by: Michal Toman 6 | --- 7 | arch/arm/boot/dts/overlays/Makefile | 1 + 8 | .../overlays/tpm-slb9670-tis-spi-overlay.dts | 21 +++++++++++++++++++ 9 | 2 files changed, 22 insertions(+) 10 | create mode 100644 arch/arm/boot/dts/overlays/tpm-slb9670-tis-spi-overlay.dts 11 | 12 | diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile 13 | index 9203448db803..f6d410d31f8c 100644 14 | --- a/arch/arm/boot/dts/overlays/Makefile 15 | +++ b/arch/arm/boot/dts/overlays/Makefile 16 | @@ -276,6 +276,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ 17 | tc358743-audio.dtbo \ 18 | tinylcd35.dtbo \ 19 | tpm-slb9670.dtbo \ 20 | + tpm-slb9670-tis-spi.dtbo \ 21 | tpm-slb9673.dtbo \ 22 | uart0.dtbo \ 23 | uart0-pi5.dtbo \ 24 | diff --git a/arch/arm/boot/dts/overlays/tpm-slb9670-tis-spi-overlay.dts b/arch/arm/boot/dts/overlays/tpm-slb9670-tis-spi-overlay.dts 25 | new file mode 100644 26 | index 000000000000..e43f8cd248ec 27 | --- /dev/null 28 | +++ b/arch/arm/boot/dts/overlays/tpm-slb9670-tis-spi-overlay.dts 29 | @@ -0,0 +1,21 @@ 30 | +/* 31 | + * Device Tree overlay for the Infineon SLB9670 Trusted Platform Module 32 | + * that uses the tpm_tis-spi driver instead of the original slb9670. 33 | + * This depends on the tpm-slb9670 overlay being applied prior to this one. 34 | + */ 35 | + 36 | +/dts-v1/; 37 | +/plugin/; 38 | + 39 | +/ { 40 | + compatible = "brcm,bcm2835"; 41 | + 42 | + fragment@0 { 43 | + target = <&spi0>; 44 | + __overlay__ { 45 | + slb9670: slb9670@1 { 46 | + compatible = "tcg,tpm_tis-spi"; 47 | + }; 48 | + }; 49 | + }; 50 | +}; 51 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-overlays-Add-overlay-for-RPI-PLC-SC16IS752.patch: -------------------------------------------------------------------------------- 1 | commit e5cf36f74f68f53e2b2f89669c0fb029cd810bab 2 | Author: RickyFA 3 | Date: Fri Nov 29 08:51:37 2024 +0100 4 | 5 | [PATCH] overlays: Add custom overlay for SC16IS752 used in Industrial Shields RPI PLC 6 | 7 | Signed-off-by: Ricard Franch 8 | 9 | diff --git a/arch/arm/boot/dts/overlays/sc16is752-spi1-rpiplc-v4-overlay.dts b/arch/arm/boot/dts/overlays/sc16is752-spi1-rpiplc-v4-overlay.dts 10 | new file mode 100644 11 | index 000000000..73be72925 12 | --- /dev/null 13 | +++ b/arch/arm/boot/dts/overlays/sc16is752-spi1-rpiplc-v4-overlay.dts 14 | @@ -0,0 +1,79 @@ 15 | +/dts-v1/; 16 | +/plugin/; 17 | + 18 | +/ { 19 | + compatible = "brcm,bcm2835"; 20 | + 21 | + fragment@0 { 22 | + target = <&gpio>; 23 | + __overlay__ { 24 | + spi1_pins: spi1_pins { 25 | + brcm,pins = <19 20 21>; 26 | + brcm,function = <3>; /* alt4 */ 27 | + }; 28 | + 29 | + spi1_cs_pins: spi1_cs_pins { 30 | + brcm,pins = <18 17>; 31 | + brcm,function = <1>; /* output */ 32 | + }; 33 | + }; 34 | + }; 35 | + 36 | + fragment@1 { 37 | + target = <&spi1>; 38 | + __overlay__ { 39 | + #address-cells = <1>; 40 | + #size-cells = <0>; 41 | + pinctrl-names = "default"; 42 | + pinctrl-0 = <&spi1_pins &spi1_cs_pins>; 43 | + cs-gpios = <&gpio 18 1>, <&gpio 17 1>; 44 | + status = "okay"; 45 | + 46 | + sc16is752_0: sc16is752@0 { 47 | + compatible = "nxp,sc16is752"; 48 | + reg = <0>; /* CE0 */ 49 | + clocks = <&sc16is752_clk>; 50 | + interrupt-parent = <&gpio>; 51 | + interrupts = <22 2>; /* IRQ_TYPE_EDGE_FALLING */ 52 | + gpio-controller; 53 | + #gpio-cells = <2>; 54 | + spi-max-frequency = <4000000>; 55 | + }; 56 | + 57 | + sc16is752_1: sc16is752@1 { 58 | + compatible = "nxp,sc16is752"; 59 | + reg = <1>; /* CE1 */ 60 | + clocks = <&sc16is752_clk>; 61 | + interrupt-parent = <&gpio>; 62 | + interrupts = <16 2>; /* IRQ_TYPE_EDGE_FALLING */ 63 | + gpio-controller; 64 | + #gpio-cells = <2>; 65 | + spi-max-frequency = <4000000>; 66 | + }; 67 | + }; 68 | + }; 69 | + 70 | + fragment@2 { 71 | + target = <&aux>; 72 | + __overlay__ { 73 | + status = "okay"; 74 | + }; 75 | + }; 76 | + 77 | + fragment@3 { 78 | + target-path = "/"; 79 | + __overlay__ { 80 | + sc16is752_clk: sc16is752_spi1_0_clk { 81 | + compatible = "fixed-clock"; 82 | + #clock-cells = <0>; 83 | + clock-frequency = <14745600>; 84 | + }; 85 | + }; 86 | + }; 87 | + 88 | + __overrides__ { 89 | + int_pin_0 = <&sc16is752_0>,"interrupts:0"; 90 | + int_pin_1 = <&sc16is752_1>,"interrupts:0"; 91 | + xtal = <&sc16is752_clk>,"clock-frequency:0"; 92 | + }; 93 | +}; 94 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-waveshare-sim7600-Add-dtbo-for-this-modem.patch: -------------------------------------------------------------------------------- 1 | From 2b10fb586e5b812c0e85af34a1d1339503ede557 Mon Sep 17 00:00:00 2001 2 | From: Florin Sarbu 3 | Date: Mon, 7 Apr 2025 05:10:33 +0000 4 | Subject: [PATCH] overlays: Add waveshare-sim7600 dtbo 5 | 6 | This adds the necessary dtbo for GPIO 7 | setup of the Waveshare SIM7600 modem. 8 | 9 | Upstream-status: Inappropriate [configuration] 10 | Signed-off-by: Florin Sarbu 11 | --- 12 | arch/arm/boot/dts/overlays/Makefile | 1 + 13 | .../overlays/waveshare-sim7600-overlay.dts | 20 +++++++++++++++++++ 14 | 2 files changed, 21 insertions(+) 15 | create mode 100644 arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts 16 | 17 | diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile 18 | index ba3f7d0f3ab5..cec30a3cb4df 100644 19 | --- a/arch/arm/boot/dts/overlays/Makefile 20 | +++ b/arch/arm/boot/dts/overlays/Makefile 21 | @@ -355,6 +355,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ 22 | watterott-display.dtbo \ 23 | waveshare-can-fd-hat-mode-a.dtbo \ 24 | waveshare-can-fd-hat-mode-b.dtbo \ 25 | + waveshare-sim7600.dtbo \ 26 | wifimac.dtbo \ 27 | wittypi.dtbo \ 28 | wm8960-soundcard.dtbo \ 29 | diff --git a/arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts b/arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts 30 | new file mode 100644 31 | index 000000000000..7295ecec1220 32 | --- /dev/null 33 | +++ b/arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts 34 | @@ -0,0 +1,20 @@ 35 | +/dts-v1/; 36 | +/plugin/; 37 | + 38 | +/ { 39 | + compatible = "brcm,bcm2708,bcm2710,bcm2711"; 40 | + 41 | + fragment@0 { 42 | + target = <&gpio>; 43 | + __overlay__ { 44 | + pinctrl-names = "default"; 45 | + pinctrl-0 = <&modem_pins>; 46 | + 47 | + modem_pins: modem_pins { 48 | + brcm,pins = <4 6>; /* GPIO pins */ 49 | + brcm,function = <1 1>; /* Output */ 50 | + brcm,pull = <2 2>; /* pull high */ 51 | + }; 52 | + }; 53 | + }; 54 | +}; 55 | -- 56 | 2.34.1 57 | 58 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-wireless-wext-Bring-back-ndo_do_ioctl-fallback.patch: -------------------------------------------------------------------------------- 1 | From 9d7d7f117929884208ecce6046b5478d9f80a26a Mon Sep 17 00:00:00 2001 2 | From: Zahari Petkov 3 | Date: Fri, 15 Feb 2019 12:38:34 +0100 4 | Subject: [PATCH] wireless: wext: Bring back ndo_do_ioctl fallback 5 | 6 | Needed for the iwpriv support of the Marvell sd8xxx driver. 7 | 8 | Upstream-Status: Inappropriate [proprietary driver] 9 | 10 | Signed-off-by: Zahari Petkov 11 | --- 12 | net/wireless/wext-core.c | 5 +++++ 13 | 1 file changed, 5 insertions(+) 14 | 15 | diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c 16 | index 6cdb054484d6..28e5c4c24554 100644 17 | --- a/net/wireless/wext-core.c 18 | +++ b/net/wireless/wext-core.c 19 | @@ -956,6 +956,11 @@ static int wireless_process_ioctl(struct net *net, struct iwreq *iwr, 20 | else if (private) 21 | return private(dev, iwr, cmd, info, handler); 22 | } 23 | + 24 | + if (dev->netdev_ops->ndo_do_ioctl) { 25 | + return dev->netdev_ops->ndo_do_ioctl(dev, (struct ifreq *) iwr, cmd); 26 | + } 27 | + 28 | return -EOPNOTSUPP; 29 | } 30 | 31 | -- 32 | 2.17.1 33 | 34 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/fincm3/0001-overlays-fin-add-internal-pull-ups-to-i2c_soft.patch: -------------------------------------------------------------------------------- 1 | From f987e7dc54e65bee595cf3916ee68b121c979f9c Mon Sep 17 00:00:00 2001 2 | From: Joseph Kogut 3 | Date: Mon, 29 Aug 2022 14:53:28 -0700 4 | Subject: [PATCH 1/1] overlays: fin: add internal pull-ups to i2c_soft 5 | 6 | As explained by Heath Raftery: 7 | 8 | > Restore the open drain configuration of the software I2C pins in the 9 | device tree. Add internal pull-up to the pins so I2C still works on the 10 | balenaFins that have had their pull-up resistors removed while having 11 | negligible effect on standard Fins. 12 | 13 | This change should remain compatible with all known configurations of 14 | the Fin while making the I2C bus operate within specification even when 15 | the external pull-up resistors aren't populated. Future revisions of the 16 | board should keep these resistors, even on depop configurations. 17 | 18 | Change-type: patch 19 | Signed-off-by: Joseph Kogut 20 | --- 21 | arch/arm/boot/dts/overlays/balena-fin-overlay.dts | 6 ++---- 22 | 1 file changed, 2 insertions(+), 4 deletions(-) 23 | 24 | diff --git a/arch/arm/boot/dts/overlays/balena-fin-overlay.dts b/arch/arm/boot/dts/overlays/balena-fin-overlay.dts 25 | index e7ead7cdf5f5..fd38bf81be06 100644 26 | --- a/arch/arm/boot/dts/overlays/balena-fin-overlay.dts 27 | +++ b/arch/arm/boot/dts/overlays/balena-fin-overlay.dts 28 | @@ -50,11 +50,9 @@ power_ctrl: power_ctrl { 29 | 30 | i2c_soft: i2c@0 { 31 | compatible = "i2c-gpio"; 32 | - gpios = <&gpio 43 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN) /* sda */ 33 | - &gpio 42 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN) /* scl */>; 34 | + gpios = <&gpio 43 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN|GPIO_PULL_UP) /* sda */ 35 | + &gpio 42 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN|GPIO_PULL_UP) /* scl */>; 36 | i2c-gpio,delay-us = <5>; 37 | - i2c-gpio,scl-open-drain; 38 | - i2c-gpio,sda-open-drain; 39 | #address-cells = <1>; 40 | #size-cells = <0>; 41 | }; 42 | -- 43 | 2.37.2 44 | 45 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/fincm3/0005-balena-fin-wifi-sta-uap-mode.patch: -------------------------------------------------------------------------------- 1 | From 070ad28495cfe0269a1400e4ee5b3a2639aa12b8 Mon Sep 17 00:00:00 2001 2 | From: Zahari Petkov 3 | Date: Tue, 27 Aug 2019 15:40:53 +0200 4 | Subject: [PATCH] Switch balenaFin WiFi to STA+uAP mode and add DTS overrides 5 | 6 | In addition to enabling the uap0 interface, two parameters are exposed for 7 | overriding through config.txt. 8 | 9 | `wifi_dbg` could be used for tuning the verbosity of the WiFi driver. 10 | 11 | `wifi_mode` could be used for activating/deactivating WiFi interfaces. For 12 | example `dtparam=wifi_mode=1` will only expose the `wlan0` interface. 13 | 14 | For more information refer to the user manual: 15 | https://github.com/balena-io/sd8887-mrvl/tree/master/wlan_src 16 | 17 | Upstream-Status: Pending 18 | 19 | Signed-off-by: Zahari Petkov 20 | 21 | --- 22 | arch/arm/boot/dts/overlays/balena-fin-overlay.dts | 9 +++++++-- 23 | 1 file changed, 7 insertions(+), 2 deletions(-) 24 | 25 | diff --git a/arch/arm/boot/dts/overlays/balena-fin-overlay.dts b/arch/arm/boot/dts/overlays/balena-fin-overlay.dts 26 | index a2cf8dcce782..e2bb06402c21 100644 27 | --- a/arch/arm/boot/dts/overlays/balena-fin-overlay.dts 28 | +++ b/arch/arm/boot/dts/overlays/balena-fin-overlay.dts 29 | @@ -50,9 +50,9 @@ 30 | #size-cells = <0>; 31 | }; 32 | 33 | - sd8xxx-wlan { 34 | + sd8xxx: sd8xxx-wlan { 35 | drvdbg = <0x6>; 36 | - drv_mode = <0x1>; 37 | + drv_mode = <0x3>; 38 | cfg80211_wext = <0xf>; 39 | sta_name = "wlan"; 40 | wfd_name = "p2p"; 41 | @@ -113,4 +113,9 @@ 42 | }; 43 | }; 44 | }; 45 | + 46 | + __overrides__ { 47 | + wifi_mode = <&sd8xxx>,"drv_mode:0"; 48 | + wifi_dbg = <&sd8xxx>,"drvdbg:0"; 49 | + }; 50 | }; 51 | -- 52 | 2.17.1 53 | 54 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/fincm3/0007-overlays-Add-spyfly.dts.patch: -------------------------------------------------------------------------------- 1 | From 0d6dd29e54246cdf654eb05457d6d3fd28e0713e Mon Sep 17 00:00:00 2001 2 | From: Florin Sarbu 3 | Date: Wed, 8 Jul 2020 08:52:55 +0200 4 | Subject: [PATCH] overlays: Add spyfly.dts 5 | 6 | This dts was supplied by the customer for AD5446 DAC support on 7 | balenaFin. 8 | 9 | Signed-off-by: Florin Sarbu 10 | --- 11 | arch/arm/boot/dts/overlays/Makefile | 1 + 12 | arch/arm/boot/dts/overlays/spyfly-overlay.dts | 38 +++++++++++++++++++++++++++++++++++ 13 | 2 files changed, 39 insertions(+) 14 | create mode 100644 arch/arm/boot/dts/overlays/spyfly-overlay.dts 15 | 16 | diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile 17 | index 8696c29..cc59d14 100644 18 | --- a/arch/arm/boot/dts/overlays/Makefile 19 | +++ b/arch/arm/boot/dts/overlays/Makefile 20 | @@ -175,6 +175,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ 21 | spi5-2cs.dtbo \ 22 | spi6-1cs.dtbo \ 23 | spi6-2cs.dtbo \ 24 | + spyfly.dtbo \ 25 | ssd1306.dtbo \ 26 | ssd1306-spi.dtbo \ 27 | ssd1351-spi.dtbo \ 28 | diff --git a/arch/arm/boot/dts/overlays/spyfly-overlay.dts b/arch/arm/boot/dts/overlays/spyfly-overlay.dts 29 | new file mode 100644 30 | index 0000000..37a73af 31 | --- /dev/null 32 | +++ b/arch/arm/boot/dts/overlays/spyfly-overlay.dts 33 | @@ -0,0 +1,38 @@ 34 | +/dts-v1/; 35 | +/plugin/; 36 | + 37 | +/{ 38 | + compatible = "brcm,bcm2708"; 39 | + 40 | + fragment@0 { 41 | + target-path="/"; 42 | + __overlay__ { 43 | + dac_supply: fixedregulator@0 { 44 | + compatible = "regulator-fixed"; 45 | + regulator-name = "fixed-supply"; 46 | + regulator-min-microvolt = <2000000>; 47 | + regulator-max-microvolt = <2000000>; 48 | + gpio = <&gpio 20 0>; 49 | + enable-active-high; 50 | + }; 51 | + }; 52 | + }; 53 | + 54 | + fragment@1 { 55 | + target = <&i2c1>; 56 | + __overlay__ { 57 | + #address-cells = <1>; 58 | + #size-cells = <0>; 59 | + status = "okay"; 60 | + 61 | + /* Analog Devices AD5602 DAC */ 62 | + dac: ad5446@0f { 63 | + compatible = "adi,ad5602"; 64 | + reg = <0x0f>; 65 | + status = "okay"; 66 | + vcc-supply = <&dac_supply>; 67 | + #io-channel-cells = < 0 >; 68 | + }; 69 | + }; 70 | + }; 71 | +}; 72 | \ No newline at end of file 73 | -- 74 | 2.7.4 75 | 76 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi3-unipi-neuron/0001-pi3neuron-disable-gccplugins.patch: -------------------------------------------------------------------------------- 1 | From ffc2fba4a2bf3dc033c4fb0adc0dd0bad8a9c018 Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Fri, 11 Mar 2022 17:21:10 +0100 4 | Subject: [PATCH 2/2] Revert "gcc-plugins: simplify GCC plugin-dev capability 5 | test" 6 | 7 | This reverts commit 1eee36a5520b5a89fb4d0d6af6f9cb0217a3164f. 8 | 9 | Revert this commit to fix build for UniPi Neuron. 10 | BalenaOS already disables gcc plugins build 11 | from configs, but this DT still built them. 12 | 13 | Upstream-status: Inappropriate [configuration] 14 | Signed-off-by: Alexandru Costache 15 | --- 16 | scripts/gcc-plugin.sh | 19 +++++++++++++++++++ 17 | scripts/gcc-plugins/Kconfig | 2 +- 18 | 2 files changed, 20 insertions(+), 1 deletion(-) 19 | create mode 100755 scripts/gcc-plugin.sh 20 | 21 | diff --git a/scripts/gcc-plugin.sh b/scripts/gcc-plugin.sh 22 | new file mode 100755 23 | index 000000000000..b79fd0bea838 24 | --- /dev/null 25 | +++ b/scripts/gcc-plugin.sh 26 | @@ -0,0 +1,19 @@ 27 | +#!/bin/sh 28 | +# SPDX-License-Identifier: GPL-2.0 29 | + 30 | +set -e 31 | + 32 | +srctree=$(dirname "$0") 33 | + 34 | +gccplugins_dir=$($* -print-file-name=plugin) 35 | + 36 | +# we need a c++ compiler that supports the designated initializer GNU extension 37 | +$HOSTCC -c -x c++ -std=gnu++98 - -fsyntax-only -I $srctree/gcc-plugins -I $gccplugins_dir/include 2>/dev/null < 3 | Date: Wed, 23 Nov 2022 10:11:00 +0800 4 | Subject: [PATCH 1/3] Add gpio-wdt DT overlay for Phoenix Board 5 | 6 | --- 7 | arch/arm/boot/dts/overlays/Makefile | 1 + 8 | .../boot/dts/overlays/ed-gpio-wdt-overlay.dts | 36 +++++++++++++++++++ 9 | 2 files changed, 37 insertions(+) 10 | create mode 100644 arch/arm/boot/dts/overlays/ed-gpio-wdt-overlay.dts 11 | 12 | diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile 13 | index 6b4a1b3f21a4..40c529e8d8dc 100644 14 | --- a/arch/arm/boot/dts/overlays/Makefile 15 | +++ b/arch/arm/boot/dts/overlays/Makefile 16 | @@ -47,6 +47,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ 17 | draws.dtbo \ 18 | dwc-otg.dtbo \ 19 | dwc2.dtbo \ 20 | + ed-gpio-wdt.dtbo \ 21 | edt-ft5406.dtbo \ 22 | enc28j60.dtbo \ 23 | enc28j60-spi2.dtbo \ 24 | diff --git a/arch/arm/boot/dts/overlays/ed-gpio-wdt-overlay.dts b/arch/arm/boot/dts/overlays/ed-gpio-wdt-overlay.dts 25 | new file mode 100644 26 | index 000000000000..56f39255b5fb 27 | --- /dev/null 28 | +++ b/arch/arm/boot/dts/overlays/ed-gpio-wdt-overlay.dts 29 | @@ -0,0 +1,36 @@ 30 | +/* 31 | +* Device Tree overlay for Watchdog 32 | +*/ 33 | + 34 | +/dts-v1/; 35 | +/plugin/; 36 | + 37 | +/ { 38 | + compatible = "brcm,bcm2835"; 39 | + fragment@0 { 40 | + target-path = "/"; 41 | + __overlay__ { 42 | + gpio_watchdog: gpio_watchdog { 43 | + compatible = "linux,wdt-gpio"; 44 | + gpios = <&gpio 0 1>; 45 | + hw_algo = "toggle"; 46 | + hw_margin_ms = <1600>; 47 | + }; 48 | + }; 49 | + }; 50 | + 51 | + fragment@1 { 52 | + target = <&gpio>; 53 | + __overlay__ { 54 | + watchdog_ctrl_pins: watchdog_ctrl_pins { 55 | + brcm,pins = <0>; 56 | + brcm,function = <1>; // out 57 | + }; 58 | + }; 59 | + }; 60 | + 61 | + __overrides__ { 62 | + gpiowdt =<&gpio_watchdog>,"gpios:4", 63 | + <&watchdog_ctrl_pins>,"brcm,pins:0"; 64 | + }; 65 | +}; 66 | -- 67 | 2.17.1 68 | 69 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi4-superhub/0002-Add-infineon-tpm-DT-overlay-for-Phoenix-Board.patch: -------------------------------------------------------------------------------- 1 | From 866eb4dbefb929241aeff093675685e9db72b47e Mon Sep 17 00:00:00 2001 2 | From: Frank_Liyang 3 | Date: Wed, 23 Nov 2022 10:14:09 +0800 4 | Subject: [PATCH 2/3] Add infineon-tpm DT overlay for Phoenix Board 5 | 6 | --- 7 | arch/arm/boot/dts/overlays/Makefile | 1 + 8 | .../dts/overlays/ed-infineon-tpm-overlay.dts | 40 +++++++++++++++++++ 9 | 2 files changed, 41 insertions(+) 10 | create mode 100644 arch/arm/boot/dts/overlays/ed-infineon-tpm-overlay.dts 11 | 12 | diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile 13 | index 40c529e8d8dc..9c07d65a16ac 100644 14 | --- a/arch/arm/boot/dts/overlays/Makefile 15 | +++ b/arch/arm/boot/dts/overlays/Makefile 16 | @@ -48,6 +48,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ 17 | dwc-otg.dtbo \ 18 | dwc2.dtbo \ 19 | ed-gpio-wdt.dtbo \ 20 | + ed-infineon-tpm.dtbo \ 21 | edt-ft5406.dtbo \ 22 | enc28j60.dtbo \ 23 | enc28j60-spi2.dtbo \ 24 | diff --git a/arch/arm/boot/dts/overlays/ed-infineon-tpm-overlay.dts b/arch/arm/boot/dts/overlays/ed-infineon-tpm-overlay.dts 25 | new file mode 100644 26 | index 000000000000..92062e6c2fa0 27 | --- /dev/null 28 | +++ b/arch/arm/boot/dts/overlays/ed-infineon-tpm-overlay.dts 29 | @@ -0,0 +1,40 @@ 30 | +/* 31 | +* Device Tree overlay for Infineon SLx 9670 32 | +*/ 33 | +/dts-v1/; 34 | +/plugin/; 35 | +/ { 36 | + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; 37 | + 38 | + fragment@0 { 39 | + target = <&spi1>; 40 | + __overlay__ { 41 | + status = "okay"; 42 | + }; 43 | + }; 44 | + 45 | + fragment@1 { 46 | + target = <&spidev1>; 47 | + __overlay__ { 48 | + status = "disabled"; 49 | + }; 50 | + }; 51 | + 52 | + fragment@2 { 53 | + target = <&spi1>; 54 | + __overlay__ { 55 | + /* needed to avoid dtc warning */ 56 | + #address-cells = <1>; 57 | + #size-cells = <0>; 58 | + slb9670: slb9670@0{ 59 | + compatible = "infineon,slb9670"; 60 | + reg = <0>; /* CE0 */ 61 | + #address-cells = <1>; 62 | + #size-cells = <0>; 63 | + spi-max-frequency = <32000000>; 64 | + status = "okay"; 65 | + }; 66 | + 67 | + }; 68 | + }; 69 | +}; 70 | -- 71 | 2.17.1 72 | 73 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi4-superhub/0003-Add-spi1-DT-overlay-for-Phoenix-Board.patch: -------------------------------------------------------------------------------- 1 | From 5a1e61a198b4733da111b259bb683bbe6c855166 Mon Sep 17 00:00:00 2001 2 | From: Frank_Liyang 3 | Date: Wed, 23 Nov 2022 10:16:08 +0800 4 | Subject: [PATCH 3/3] Add spi1 DT overlay for Phoenix Board 5 | 6 | --- 7 | arch/arm/boot/dts/overlays/Makefile | 1 + 8 | .../boot/dts/overlays/ed-spi1-1cs-overlay.dts | 60 +++++++++++++++++++ 9 | 2 files changed, 61 insertions(+) 10 | create mode 100644 arch/arm/boot/dts/overlays/ed-spi1-1cs-overlay.dts 11 | 12 | diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile 13 | index 9c07d65a16ac..def6c4fad598 100644 14 | --- a/arch/arm/boot/dts/overlays/Makefile 15 | +++ b/arch/arm/boot/dts/overlays/Makefile 16 | @@ -49,6 +49,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ 17 | dwc2.dtbo \ 18 | ed-gpio-wdt.dtbo \ 19 | ed-infineon-tpm.dtbo \ 20 | + ed-spi1-1cs.dtbo \ 21 | edt-ft5406.dtbo \ 22 | enc28j60.dtbo \ 23 | enc28j60-spi2.dtbo \ 24 | diff --git a/arch/arm/boot/dts/overlays/ed-spi1-1cs-overlay.dts b/arch/arm/boot/dts/overlays/ed-spi1-1cs-overlay.dts 25 | new file mode 100644 26 | index 000000000000..65e7e01f6671 27 | --- /dev/null 28 | +++ b/arch/arm/boot/dts/overlays/ed-spi1-1cs-overlay.dts 29 | @@ -0,0 +1,60 @@ 30 | +/* 31 | +* Device Tree overlay for SPI1 32 | +*/ 33 | +/dts-v1/; 34 | +/plugin/; 35 | + 36 | + 37 | +/ { 38 | + compatible = "brcm,bcm2835"; 39 | + 40 | + fragment@0 { 41 | + target = <&gpio>; 42 | + __overlay__ { 43 | + spi1_pins: spi1_pins { 44 | + brcm,pins = <19 20 21>; 45 | + brcm,function = <3>; /* alt4 */ 46 | + }; 47 | + 48 | + spi1_cs_pins: spi1_cs_pins { 49 | + brcm,pins = <18>; 50 | + brcm,function = <1>; /* output */ 51 | + }; 52 | + }; 53 | + }; 54 | + 55 | + fragment@1 { 56 | + target = <&spi1>; 57 | + frag1: __overlay__ { 58 | + /* needed to avoid dtc warning */ 59 | + #address-cells = <1>; 60 | + #size-cells = <0>; 61 | + pinctrl-names = "default"; 62 | + pinctrl-0 = <&spi1_pins &spi1_cs_pins>; 63 | + cs-gpios = <&gpio 18 1>; 64 | + status = "okay"; 65 | + 66 | + spidev1_0: spidev@0 { 67 | + compatible = "spidev"; 68 | + reg = <0>; /* CE0 */ 69 | + #address-cells = <1>; 70 | + #size-cells = <0>; 71 | + spi-max-frequency = <125000000>; 72 | + status = "disabled"; 73 | + }; 74 | + }; 75 | + }; 76 | + 77 | + fragment@2 { 78 | + target = <&aux>; 79 | + __overlay__ { 80 | + status = "okay"; 81 | + }; 82 | + }; 83 | + 84 | + __overrides__ { 85 | + cs0_pin = <&spi1_cs_pins>,"brcm,pins:0", 86 | + <&frag1>,"cs-gpios:4"; 87 | + cs0_spidev = <&spidev1_0>,"status"; 88 | + }; 89 | +}; 90 | -- 91 | 2.17.1 92 | 93 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/raspberrypi4-superhub/0004-Add-SD-host-DT-overlay-for-Phoenix-Board.patch: -------------------------------------------------------------------------------- 1 | From 861d2472f3df2252b35dee444affe36d204873d0 Mon Sep 17 00:00:00 2001 2 | From: Frank_Liyang 3 | Date: Thu, 22 Dec 2022 15:59:59 +0800 4 | Subject: [PATCH 4/4] Add SD host DT overlay for Phoenix Board 5 | 6 | --- 7 | arch/arm/boot/dts/overlays/Makefile | 1 + 8 | .../boot/dts/overlays/ed-sdhost-overlay.dts | 36 +++++++++++++++++++ 9 | 2 files changed, 37 insertions(+) 10 | create mode 100644 arch/arm/boot/dts/overlays/ed-sdhost-overlay.dts 11 | 12 | diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile 13 | index def6c4fad598..363e65211cfe 100644 14 | --- a/arch/arm/boot/dts/overlays/Makefile 15 | +++ b/arch/arm/boot/dts/overlays/Makefile 16 | @@ -49,6 +49,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ 17 | dwc2.dtbo \ 18 | ed-gpio-wdt.dtbo \ 19 | ed-infineon-tpm.dtbo \ 20 | + ed-sdhost.dtbo \ 21 | ed-spi1-1cs.dtbo \ 22 | edt-ft5406.dtbo \ 23 | enc28j60.dtbo \ 24 | diff --git a/arch/arm/boot/dts/overlays/ed-sdhost-overlay.dts b/arch/arm/boot/dts/overlays/ed-sdhost-overlay.dts 25 | new file mode 100644 26 | index 000000000000..2b1ba6eb57f1 27 | --- /dev/null 28 | +++ b/arch/arm/boot/dts/overlays/ed-sdhost-overlay.dts 29 | @@ -0,0 +1,36 @@ 30 | +/dts-v1/; 31 | +/plugin/; 32 | + 33 | +/{ 34 | + compatible = "brcm,bcm2711"; 35 | + 36 | + fragment@0 { 37 | + target = <&sdhost>; 38 | + frag0: __overlay__ { 39 | + pinctrl-names = "default"; 40 | + pinctrl-0 = <&sdio_gpio_22_27>; 41 | + bus-width = <4>; 42 | + brcm,overclock-50 = <0>; 43 | + brcm,pio-limit = <1>; 44 | + status = "okay"; 45 | + }; 46 | + }; 47 | + 48 | + fragment@1 { 49 | + target = <&gpio>; 50 | + __overlay__ { 51 | + sdio_gpio_22_27: sdio_gpio_22_27 { 52 | + brcm,pins = <22 23 24 25 26 27>; 53 | + brcm,function = <4>; /* BCM2835_FSEL_ALT0, SD0 */ 54 | + brcm,pull = <0 2 2 2 2 2>; 55 | + }; 56 | + }; 57 | + }; 58 | + 59 | + __overrides__ { 60 | + overclock_50 = <&frag0>,"brcm,overclock-50:0"; 61 | + force_pio = <&frag0>,"brcm,force-pio?"; 62 | + pio_limit = <&frag0>,"brcm,pio-limit:0"; 63 | + debug = <&frag0>,"brcm,debug?"; 64 | + }; 65 | +}; 66 | -- 67 | 2.17.1 68 | 69 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend: -------------------------------------------------------------------------------- 1 | inherit kernel-balena 2 | 3 | # These device types have been using the aufs storage driver, 4 | # and during a HUP the storage in the inactive sysroot will 5 | # still be aufs, so we need to include the aufs driver further 6 | # for them, as per the internal thread 7 | # https://www.flowdock.com/app/rulemotion/resin-devices/threads/K2TQiSUfNDqBT5Ih6cciNI2d9QJ 8 | BALENA_CONFIGS:append:fincm3 = " aufs" 9 | BALENA_CONFIGS:append:npe-x500-m3 = " aufs" 10 | BALENA_CONFIGS:append:raspberrypi = " aufs" 11 | BALENA_CONFIGS:append:raspberrypi2 = " aufs" 12 | BALENA_CONFIGS:append:raspberrypi3-64 = " aufs" 13 | BALENA_CONFIGS:append:raspberrypi3 = " aufs" 14 | 15 | python do_overlays() { 16 | import glob, re, os 17 | overlays = [] 18 | source_path = d.getVar('S', True) + '/arch/' + d.getVar('ARCH',True) + '/boot/dts/overlays/*-overlay.dts' 19 | for overlay in glob.glob(source_path): 20 | overlays.append(re.sub(r'-overlay.dts','.dtbo',overlay).split('dts/')[-1]) 21 | for dtbo in overlays: 22 | d.setVar('KERNEL_DEVICETREE', d.getVar('KERNEL_DEVICETREE', True) + ' ' + dtbo) 23 | 24 | if not os.path.exists(d.getVar('DEPLOY_DIR_IMAGE')): 25 | os.makedirs(d.getVar('DEPLOY_DIR_IMAGE')) 26 | f = open(d.getVar('DEPLOY_DIR_IMAGE') + '/overlays.txt', "w") 27 | f.write(d.getVar('KERNEL_DEVICETREE', True)) 28 | f.close 29 | } 30 | 31 | # KERNEL_DEVICETREE has a local scope in each function, even in a :prepend, 32 | # so the only way to alter it to include all overlays is by using the prefuncs 33 | do_install[prefuncs] += "do_overlays" 34 | do_compile[prefuncs] += "do_overlays" 35 | do_deploy[prefuncs] += "do_overlays" 36 | 37 | # we have to ensure the overlays list is populated so that 38 | # the boot partition can be generated correctly 39 | do_install[nostamp] = "1" 40 | 41 | # Built-in SPI drivers needed for API EEPROM update 42 | # Otherwise on A/B rollback modules won't match running kernel 43 | BALENA_CONFIGS:append:raspberrypi4-64 = " pieeprom" 44 | BALENA_CONFIGS[pieeprom] = " \ 45 | CONFIG_SPI=y \ 46 | CONFIG_SPI_BCM2835=y \ 47 | CONFIG_SPI_SPIDEV=y \ 48 | " 49 | 50 | BALENA_CONFIGS:append:raspberrypicm4-ioboard-sb = " dwc2" 51 | BALENA_CONFIGS[dwc2] = "CONFIG_USB_DWC2=y" 52 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.15.92/0001-waveshare-sim7600-Add-dtbo-for-this-modem.patch: -------------------------------------------------------------------------------- 1 | From 92c62b6ea869771aea210bb7a4ecad5d38bdef40 Mon Sep 17 00:00:00 2001 2 | From: Alexandru Costache 3 | Date: Fri, 26 Jun 2020 14:02:29 +0200 4 | Subject: [PATCH] overlays: Add waveshare-sim7600 dtbo 5 | 6 | This adds dtbo necessary for GPIO setup 7 | for the waveshare-sim7600 modem. 8 | 9 | Upstream-status: Inappropriate [configuration] 10 | Signed-off-by: Martijn 11 | --- 12 | arch/arm/boot/dts/overlays/Makefile | 1 + 13 | .../overlays/waveshare-sim7600-overlay.dts | 20 +++++++++++++++++++ 14 | 2 files changed, 21 insertions(+) 15 | create mode 100644 arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts 16 | 17 | diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile 18 | index 1bf3877b09c9..6ad57aa92b51 100644 19 | --- a/arch/arm/boot/dts/overlays/Makefile 20 | +++ b/arch/arm/boot/dts/overlays/Makefile 21 | @@ -263,6 +263,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ 22 | w5500.dtbo \ 23 | waveshare-can-fd-hat-mode-a.dtbo \ 24 | waveshare-can-fd-hat-mode-b.dtbo \ 25 | + waveshare-sim7600.dtbo \ 26 | wittypi.dtbo \ 27 | wm8960-soundcard.dtbo 28 | 29 | diff --git a/arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts b/arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts 30 | new file mode 100644 31 | index 000000000000..7295ecec1220 32 | --- /dev/null 33 | +++ b/arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts 34 | @@ -0,0 +1,20 @@ 35 | +/dts-v1/; 36 | +/plugin/; 37 | + 38 | +/ { 39 | + compatible = "brcm,bcm2708,bcm2710,bcm2711"; 40 | + 41 | + fragment@0 { 42 | + target = <&gpio>; 43 | + __overlay__ { 44 | + pinctrl-names = "default"; 45 | + pinctrl-0 = <&modem_pins>; 46 | + 47 | + modem_pins: modem_pins { 48 | + brcm,pins = <4 6>; /* GPIO pins */ 49 | + brcm,function = <1 1>; /* Output */ 50 | + brcm,pull = <2 2>; /* pull high */ 51 | + }; 52 | + }; 53 | + }; 54 | +}; 55 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_6.12.bb: -------------------------------------------------------------------------------- 1 | LINUX_VERSION ?= "6.12.25" 2 | LINUX_RPI_BRANCH ?= "" 3 | LINUX_RPI_KMETA_BRANCH ?= "yocto-6.12" 4 | 5 | SRCREV_machine = "166ef05dd8fcfafba2951f1c658e138d235dd04a" 6 | SRCREV_meta = "1f6ab68a1d86836bf1b82b791df03da3cfeacb3f" 7 | 8 | KMETA = "kernel-meta" 9 | 10 | SRC_URI = " \ 11 | git://github.com/raspberrypi/linux.git;name=machine;nobranch=1;protocol=https \ 12 | git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=${LINUX_RPI_KMETA_BRANCH};destsuffix=${KMETA} \ 13 | file://powersave.cfg \ 14 | file://android-drivers.cfg \ 15 | " 16 | 17 | require linux-raspberrypi.inc 18 | 19 | KERNEL_DTC_FLAGS += "-@ -H epapr" 20 | 21 | RDEPENDS:${KERNEL_PACKAGE_NAME}:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}" 22 | RDEPENDS:${KERNEL_PACKAGE_NAME}-base:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-base" 23 | RDEPENDS:${KERNEL_PACKAGE_NAME}-image:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-image" 24 | RDEPENDS:${KERNEL_PACKAGE_NAME}-dev:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-dev" 25 | RDEPENDS:${KERNEL_PACKAGE_NAME}-vmlinux:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-vmlinux" 26 | RDEPENDS:${KERNEL_PACKAGE_NAME}-modules:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-modules" 27 | RDEPENDS:${KERNEL_PACKAGE_NAME}-dbg:raspberrypi-armv7:append = " ${RASPBERRYPI_v7_KERNEL_PACKAGE_NAME}-dbg" 28 | 29 | DEPLOYDEP = "" 30 | DEPLOYDEP:raspberrypi-armv7 = "${RASPBERRYPI_v7_KERNEL}:do_deploy" 31 | do_deploy[depends] += "${DEPLOYDEP}" 32 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/picontrol/picontrol/0001-Use-modules_install-as-wanted-by-yocto.patch: -------------------------------------------------------------------------------- 1 | From 2afd1b8f94ecfa04e1896a386a21bc4d57805e31 Mon Sep 17 00:00:00 2001 2 | From: Sebastian Panceac 3 | Date: Thu, 2 Aug 2018 13:32:58 +0200 4 | Subject: [PATCH] Use modules_install as wanted by yocto 5 | 6 | Upstream-Status: Pending 7 | Signed-off-by: Sebastian Panceac 8 | --- 9 | Makefile | 3 +++ 10 | 1 file changed, 3 insertions(+) 11 | 12 | diff --git a/Makefile b/Makefile 13 | index 56eab93..6d78b95 100644 14 | --- a/Makefile 15 | +++ b/Makefile 16 | @@ -44,6 +44,9 @@ EXTRA_CFLAGS += -D__KUNBUSPI_KERNEL__ 17 | all: compiletime.h 18 | $(MAKE) ARCH=$(ARCH) CROSS_COMPILE="$(CROSS_COMPILE)" -C $(KDIR) M=$(PWD) modules 19 | 20 | +modules_install: 21 | + $(MAKE) ARCH=$(ARCH) CROSS_COMPILE="$(CROSS_COMPILE)" -C $(KDIR) M=$(PWD) modules_install 22 | + 23 | compiletime.h: 24 | echo "#define COMPILETIME \""`date`"\"" > compiletime.h 25 | 26 | -- 27 | 2.7.4 28 | 29 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/picontrol/picontrol/0002-Search-config-file-in-mnt-boot.patch: -------------------------------------------------------------------------------- 1 | From 1b18039631adfbc193f96c714ee60e00d28a11b3 Mon Sep 17 00:00:00 2001 2 | From: Sebastian Panceac 3 | Date: Wed, 29 Aug 2018 09:38:27 +0200 4 | Subject: [PATCH] Search config file in /mnt/boot 5 | 6 | Upstream-status: Inappropriate [configuration] 7 | Signed-off-by: Sebastian Panceac 8 | --- 9 | piControl.h | 4 ++-- 10 | 1 file changed, 2 insertions(+), 2 deletions(-) 11 | 12 | diff --git a/piControl.h b/piControl.h 13 | index 6f95c83..d46f456 100755 14 | --- a/piControl.h 15 | +++ b/piControl.h 16 | @@ -58,9 +58,9 @@ 17 | 18 | #define PICONTROL_DEVICE "/dev/piControl0" 19 | 20 | -// The config file moved to /etc/revpi. 21 | +// The config file is found in /mnt/boot/ 22 | // If it cannot be found there, the old location should be used. 23 | -#define PICONFIG_FILE "/etc/revpi/config.rsc" 24 | +#define PICONFIG_FILE "/mnt/boot/config.rsc" 25 | #define PICONFIG_FILE_WHEEZY "/opt/KUNBUS/config.rsc" 26 | 27 | #define REV_PI_DEV_FIRST_RIGHT 32 // address of first module on the right side of the RevPi Core 28 | -- 29 | 2.7.4 30 | 31 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/picontrol/picontrol_2020.06.16.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Kunbus PiControl kernel module" 2 | LICENSE = "GPL-2.0-only" 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" 4 | 5 | inherit module 6 | 7 | SRC_URI = " \ 8 | git://github.com/RevolutionPi/piControl;protocol=https;nobranch=1; \ 9 | file://0001-Use-modules_install-as-wanted-by-yocto.patch \ 10 | file://0002-Search-config-file-in-mnt-boot.patch \ 11 | " 12 | 13 | # Corresponds to tag raspberrypi-kernel_9.20200616-4.19.95+revpi1 14 | SRCREV ="72a58797b2eed6edab99795476108cfeec95c8d9" 15 | 16 | S = "${WORKDIR}/git" 17 | 18 | EXTRA_OEMAKE:append = " KDIR=${STAGING_KERNEL_DIR}" 19 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/picontrol/picontrol_2024.02.05.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Kunbus PiControl kernel module" 2 | LICENSE = "GPL-2.0-only" 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" 4 | 5 | inherit module 6 | 7 | SRC_URI = " \ 8 | git://gitlab.com/revolutionpi/piControl;protocol=https;branch=master; \ 9 | file://0001-Use-modules_install-as-wanted-by-yocto.patch \ 10 | file://0002-Search-config-file-in-mnt-boot.patch \ 11 | " 12 | SRCREV = "79ad74f89ad7485a67de8fc90907a2e98f314c5f" 13 | 14 | S = "${WORKDIR}/git" 15 | 16 | EXTRA_OEMAKE:append = " KDIR=${STAGING_KERNEL_DIR}" 17 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/sd8887-nxp/sd8887-nxp.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Out of tree linux wifi and bluetooth driver modules for Marvell SD8887" 2 | LICENSE = "GPL-2.0-only" 3 | LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e" 4 | 5 | inherit module 6 | 7 | SRC_URI = " \ 8 | git://github.com/balena-io-hardware/balena-fin.git;protocol=https;nobranch=1 \ 9 | file://COPYING \ 10 | " 11 | SRCREV = "4cd9510c1c04d4eba2601388e5c4a7ae0bd0fcff" 12 | 13 | S = "${WORKDIR}/git/software/drivers/sd8887" 14 | 15 | DEPENDS = "bc-native" 16 | 17 | EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'" 18 | 19 | do_compile() { 20 | cd ${S}/src/wlan 21 | oe_runmake 22 | cd ${S}/src/bluetooth 23 | oe_runmake 24 | } 25 | 26 | module_do_install() { 27 | cd ${S}/src/wlan 28 | install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/net/wireless 29 | install -m 0644 mlan.ko sd8xxx.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/net/wireless/ 30 | cd ${S}/src/bluetooth 31 | install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/bluetooth 32 | install -m 0644 bt8xxx.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/bluetooth/ 33 | cd ${S}/firmware 34 | install -d ${D}/lib/firmware/nxp 35 | install -m 0644 sd8887_uapsta_a2.bin ${D}/lib/firmware/nxp/ 36 | 37 | # blacklist mwifi* and btmrvl* kernel modules which conflict with ours 38 | install -d ${D}/etc/modprobe.d 39 | for mod in mwifiex mwifiex_sdio btmrvl btmrvl_sdio; do 40 | echo "blacklist ${mod}" >> ${D}/etc/modprobe.d/blacklist.conf 41 | done 42 | } 43 | 44 | FILES:${PN} += " \ 45 | /etc/modprobe.d/blacklist.conf \ 46 | /lib/firmware/nxp/sd8887_uapsta_a2.bin \ 47 | " 48 | 49 | KERNEL_MODULE_AUTOLOAD += "sd8xxx" 50 | KERNEL_MODULE_PROBECONF += "mlan sd8xxx" 51 | module_conf_mlan = "install mlan /sbin/modprobe bt8xxx; sleep 5; /sbin/modprobe --ignore-install mlan $CMDLINE_OPTS" 52 | module_conf_sd8xxx = "options sd8xxx ps_mode=2" 53 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/unipi-kernel-modules/files/0001-unipi_tty-Fix-compile-on-kernel-5.10.patch: -------------------------------------------------------------------------------- 1 | From: Florin Sarbu 2 | Date: Wed, 7 Jul 2021 15:43:46 +0200 3 | Subject: [PATCH 1/9] unipi_tty: Fix compile on kernel 5.10 4 | 5 | We adapt to changes introduced by 6 | https://lore.kernel.org/lkml/20210121090020.3147058-2-gregkh@linuxfoundation.org/ 7 | 8 | Upstream-Status: Pending 9 | Signed-off-by: Florin Sarbu 10 | --- 11 | modules/unipi/src/unipi_tty.c | 5 +++++ 12 | 1 file changed, 5 insertions(+) 13 | 14 | diff --git a/modules/unipi/src/unipi_tty.c b/modules/unipi/src/unipi_tty.c 15 | index 76c01849ef50..3d2ea83eec95 100644 16 | --- a/modules/unipi/src/unipi_tty.c 17 | +++ b/modules/unipi/src/unipi_tty.c 18 | @@ -662,7 +662,12 @@ static int copy_from_read_buf(struct tty_struct *tty, 19 | */ 20 | 21 | static ssize_t unipi_tty_read(struct tty_struct *tty, struct file *file, 22 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0) 23 | unsigned char __user *buf, size_t nr) 24 | +#else 25 | + unsigned char *buf, size_t nr, 26 | + void **cookie, unsigned long offset) 27 | +#endif 28 | { 29 | struct unipi_tty_data *ldata = tty->disc_data; 30 | struct tty_port *port = tty->port; 31 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/unipi-kernel-modules/files/0002-unipi_spi-use-new-structure-for-SPI-transfer-delays.patch: -------------------------------------------------------------------------------- 1 | From: Alex Gonzalez 2 | Date: Mon, 24 Oct 2022 16:07:36 +0200 3 | Subject: [PATCH 2/9] unipi_spi: use new structure for SPI transfer delays 4 | 5 | In a change to the SPI subsystem [1], a new `delay` struct was added 6 | to replace the `delay_usecs`. This change replaces the current 7 | `delay_usecs` with `delay` for this driver. 8 | 9 | [1] commit bebcfd272df6 ("spi: introduce `delay` field for 10 | `spi_transfer` + spi_transfer_delay_exec()") 11 | 12 | Upstream-status: pending 13 | Signed-off-by: Alex Gonzalez 14 | --- 15 | modules/unipi/src/unipi_spi.c | 17 ++++++++++++++++- 16 | 1 file changed, 16 insertions(+), 1 deletion(-) 17 | 18 | diff --git a/modules/unipi/src/unipi_spi.c b/modules/unipi/src/unipi_spi.c 19 | index a65ace3a33f3..e4d3783d532d 100644 20 | --- a/modules/unipi/src/unipi_spi.c 21 | +++ b/modules/unipi/src/unipi_spi.c 22 | @@ -329,7 +329,12 @@ struct unipi_spi_context* unipi_spi_setup_context(struct spi_device* spi_dev, st 23 | s_trans = (struct spi_transfer *)(context + 1); 24 | spi_message_init_with_transfers(&context->message, s_trans, trans_count); 25 | 26 | - s_trans[0].delay_usecs = NEURONSPI_EDGE_DELAY; 27 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0) 28 | + s_trans[0].delay_usecs = NEURONSPI_EDGE_DELAY; 29 | +#else 30 | + s_trans[0].delay.value = NEURONSPI_EDGE_DELAY; 31 | + s_trans[0].delay.unit = SPI_DELAY_UNIT_USECS; 32 | +#endif 33 | s_trans[0].bits_per_word = 8; 34 | s_trans[0].speed_hz = freq; 35 | 36 | @@ -341,7 +346,12 @@ struct unipi_spi_context* unipi_spi_setup_context(struct spi_device* spi_dev, st 37 | packet_crc = neuronspi_spi_crc(send_buf->first_message, 4, 0); 38 | *((u16*)(send_buf->first_message+4)) = packet_crc; 39 | } 40 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0) 41 | s_trans[1].delay_usecs = delay; 42 | +#else 43 | + s_trans[1].delay.value = delay; 44 | + s_trans[1].delay.unit = SPI_DELAY_UNIT_USECS; 45 | +#endif 46 | s_trans[1].len = NEURONSPI_FIRST_MESSAGE_LENGTH; 47 | s_trans[1].tx_buf = send_buf->first_message; 48 | s_trans[1].rx_buf = recv_buf->first_message; 49 | @@ -355,7 +365,12 @@ struct unipi_spi_context* unipi_spi_setup_context(struct spi_device* spi_dev, st 50 | unipi_spi_trace_1(KERN_INFO "UNIPISPI: SPI Master Write(%3d) %32ph\n", len, send_buf->second_message); 51 | remain = len; 52 | for (i = 2; i < trans_count; i++) { 53 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0) 54 | s_trans[i].delay_usecs = 0; 55 | +#else 56 | + s_trans[i].delay.value = 0; 57 | + s_trans[i].delay.unit = SPI_DELAY_UNIT_USECS; 58 | +#endif 59 | s_trans[i].bits_per_word = 8; 60 | s_trans[i].speed_hz = freq; 61 | s_trans[i].tx_buf = send_buf->second_message + (NEURONSPI_MAX_TX * (i - 2)); 62 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/unipi-kernel-modules/files/0003-unipi_tty-remove-TTY_LDISC_MAGIC.patch: -------------------------------------------------------------------------------- 1 | From: Alex Gonzalez 2 | Date: Mon, 24 Oct 2022 16:14:17 +0200 3 | Subject: [PATCH 3/9] unipi_tty: remove TTY_LDISC_MAGIC 4 | 5 | Use of TTY_LDISC_MAGIC was removed in 6 | commit 981b22b8777d (tty: remove TTY_LDISC_MAGIC) 7 | 8 | Upstream-status: pending 9 | Signed-off-by: Alex Gonzalez 10 | --- 11 | modules/unipi/src/unipi_tty.c | 4 ++++ 12 | 1 file changed, 4 insertions(+) 13 | 14 | diff --git a/modules/unipi/src/unipi_tty.c b/modules/unipi/src/unipi_tty.c 15 | index 3d2ea83eec95..36bcc661af00 100644 16 | --- a/modules/unipi/src/unipi_tty.c 17 | +++ b/modules/unipi/src/unipi_tty.c 18 | @@ -990,7 +990,9 @@ static long unipi_tty_compat_ioctl(struct tty_struct *tty, struct file *file, 19 | #endif 20 | 21 | static struct tty_ldisc_ops unipi_tty_ops = { 22 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0) 23 | .magic = TTY_LDISC_MAGIC, 24 | +#endif 25 | .owner = THIS_MODULE, 26 | .name = "unipi_tty", 27 | .open = unipi_tty_open, 28 | @@ -1095,7 +1097,9 @@ int __init unipi_tty_init(void) 29 | 30 | memset(&unipi_tty_ldisc, 0, sizeof(unipi_tty_ldisc)); 31 | n_tty_inherit_ops(&unipi_tty_ldisc); 32 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0) 33 | unipi_tty_ldisc.magic = TTY_LDISC_MAGIC; 34 | +#endif 35 | unipi_tty_ldisc.name = "unipi_tty"; 36 | unipi_tty_ldisc.owner = THIS_MODULE; 37 | 38 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/unipi-kernel-modules/files/0004-unipi_tty-remove-ldisc-number-in-tty_register_ldisc-.patch: -------------------------------------------------------------------------------- 1 | From: Alex Gonzalez 2 | Date: Mon, 24 Oct 2022 16:46:29 +0200 3 | Subject: [PATCH 4/9] unipi_tty: remove ldisc number in tty_register_ldisc call 4 | 5 | The tty_register_ldisc() call dropped accepting the ldisc number in 6 | commit fbadf70a805 (tty: set tty_ldisc_ops::num statically) 7 | 8 | Upstream-status: pending 9 | Signed-off-by: Alex Gonzalez 10 | --- 11 | modules/unipi/src/unipi_tty.c | 21 +++++++++++++++++++-- 12 | 1 file changed, 19 insertions(+), 2 deletions(-) 13 | 14 | diff --git a/modules/unipi/src/unipi_tty.c b/modules/unipi/src/unipi_tty.c 15 | index 36bcc661af00..1a1808f4cfa0 100644 16 | --- a/modules/unipi/src/unipi_tty.c 17 | +++ b/modules/unipi/src/unipi_tty.c 18 | @@ -1019,7 +1019,11 @@ int __init unipi_tty_init(void) 19 | { 20 | int err; 21 | unipi_tty_trace(KERN_INFO "UNIPISPI: TTY Init\n"); 22 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) 23 | err = tty_register_ldisc(N_PROFIBUS_FDL, &unipi_tty_ops); 24 | +#else 25 | + err = tty_register_ldisc(&unipi_tty_ops); 26 | +#endif 27 | if (err) { 28 | printk(KERN_INFO "UNIPISPI: UniPi line discipline registration failed. (%d)", err); 29 | return err; 30 | @@ -1029,7 +1033,11 @@ int __init unipi_tty_init(void) 31 | 32 | void __exit unipi_tty_exit(void) 33 | { 34 | - tty_unregister_ldisc(N_PROFIBUS_FDL); 35 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) 36 | + tty_unregister_ldisc(N_PROFIBUS_FDL); 37 | +#else 38 | + tty_unregister_ldisc(&unipi_tty_ops); 39 | +#endif 40 | } 41 | 42 | #else 43 | @@ -1111,7 +1119,12 @@ int __init unipi_tty_init(void) 44 | unipi_tty_ldisc.receive_buf2 = unipi_tty_receive_buf2; 45 | unipi_tty_ldisc.ioctl = unipi_tty_ioctl; 46 | 47 | - err = tty_register_ldisc(N_PROFIBUS_FDL, &unipi_tty_ldisc); 48 | + 49 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) 50 | + err = tty_register_ldisc(N_PROFIBUS_FDL, &unipi_tty_ldisc); 51 | +#else 52 | + err = tty_register_ldisc(&unipi_tty_ldisc); 53 | +#endif 54 | if (err) { 55 | printk(KERN_INFO "UniPi line discipline registration failed. (%d)", err); 56 | return err; 57 | @@ -1121,6 +1134,10 @@ int __init unipi_tty_init(void) 58 | 59 | void __exit unipi_tty_exit(void) 60 | { 61 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) 62 | tty_unregister_ldisc(N_PROFIBUS_FDL); 63 | +#else 64 | + tty_unregister_ldisc(&unipi_tty_ldisc); 65 | +#endif 66 | } 67 | #endif 68 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/unipi-kernel-modules/files/0005-unipi_tty-adapt-to-fp-of-tty_ldisc_ops-made-const.patch: -------------------------------------------------------------------------------- 1 | From: Alex Gonzalez 2 | Date: Mon, 24 Oct 2022 16:56:36 +0200 3 | Subject: [PATCH 5/9] unipi_tty: adapt to fp of tty_ldisc_ops made const 4 | 5 | Adapt to commit 6 | 0f3dcf3b5d7(tty: make fp of tty_ldisc_ops::receive_buf{,2} const) 7 | 8 | Upstream-status: pending 9 | Signed-off-by: Alex Gonzalez 10 | --- 11 | modules/unipi/src/unipi_tty.c | 16 ++++++++++++++++ 12 | 1 file changed, 16 insertions(+) 13 | 14 | diff --git a/modules/unipi/src/unipi_tty.c b/modules/unipi/src/unipi_tty.c 15 | index 1a1808f4cfa0..4d70c5986f06 100644 16 | --- a/modules/unipi/src/unipi_tty.c 17 | +++ b/modules/unipi/src/unipi_tty.c 18 | @@ -1044,14 +1044,26 @@ void __exit unipi_tty_exit(void) 19 | 20 | struct tty_ldisc_ops unipi_tty_ldisc; 21 | static void (*alias_n_tty_receive_buf)(struct tty_struct *tty, const unsigned char *cp, 22 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) 23 | char *fp, int count); 24 | +#else 25 | + const char *fp, int count); 26 | +#endif 27 | static int (*alias_n_tty_receive_buf2)(struct tty_struct *tty, const unsigned char *cp, 28 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) 29 | char *fp, int count); 30 | +#else 31 | + const char *fp, int count); 32 | +#endif 33 | static int (*alias_n_tty_ioctl)(struct tty_struct *tty, struct file *file, 34 | unsigned int cmd, unsigned long arg); 35 | 36 | static void unipi_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, 37 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) 38 | char *fp, int count) 39 | +#else 40 | + const char *fp, int count) 41 | +#endif 42 | { 43 | int is_parmrk = I_PARMRK(tty); 44 | if (is_parmrk) { 45 | @@ -1065,7 +1077,11 @@ static void unipi_tty_receive_buf(struct tty_struct *tty, const unsigned char *c 46 | } 47 | 48 | static int unipi_tty_receive_buf2(struct tty_struct *tty, const unsigned char *cp, 49 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) 50 | char *fp, int count) 51 | +#else 52 | + const char *fp, int count) 53 | +#endif 54 | { 55 | int ret; 56 | int is_parmrk = I_PARMRK(tty); 57 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/unipi-kernel-modules/files/0006-unipi_spi-adapt-to-removal-of-spi_set_cs_timing.patch: -------------------------------------------------------------------------------- 1 | From: Alex Gonzalez 2 | Date: Mon, 24 Oct 2022 17:53:19 +0200 3 | Subject: [PATCH 6/9] unipi_spi: adapt to removal of spi_set_cs_timing() 4 | 5 | The spi_set_cs_timing() interface was removed in commit 6 | 4ccf359849ce (spi: remove spi_set_cs_timing()) 7 | 8 | Upstream-status: pending 9 | Signed-off-by: Alex Gonzalez 10 | --- 11 | modules/unipi/src/unipi_spi.c | 4 ++-- 12 | 1 file changed, 2 insertions(+), 2 deletions(-) 13 | 14 | diff --git a/modules/unipi/src/unipi_spi.c b/modules/unipi/src/unipi_spi.c 15 | index e4d3783d532d..d6260b189c72 100644 16 | --- a/modules/unipi/src/unipi_spi.c 17 | +++ b/modules/unipi/src/unipi_spi.c 18 | @@ -1243,7 +1243,7 @@ s32 neuronspi_spi_probe(struct spi_device *spi) 19 | u32 always_create_uart = 0; 20 | struct kthread_worker *worker; 21 | 22 | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) 23 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) && LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0) 24 | struct spi_delay inactive_delay; 25 | #endif 26 | 27 | @@ -1373,7 +1373,7 @@ s32 neuronspi_spi_probe(struct spi_device *spi) 28 | if (gpio_is_valid(spi->cs_gpio)) { 29 | spi->cs_gpio = -spi->cs_gpio; 30 | } 31 | -#else 32 | +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) && LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0) 33 | inactive_delay.value = 40; 34 | inactive_delay.unit = SPI_DELAY_UNIT_USECS; 35 | spi_set_cs_timing(spi, NULL, NULL, &inactive_delay); 36 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/unipi-kernel-modules/files/0007-rtc-unipi-Adapt-to-removal-of-nvram-ABI.patch: -------------------------------------------------------------------------------- 1 | From: Alex Gonzalez 2 | Date: Mon, 24 Oct 2022 18:05:47 +0200 3 | Subject: [PATCH 7/9] rtc-unipi: Adapt to removal of nvram ABI 4 | 5 | Adapt to the removal of the nvram ABI in commit 6 | 25ece30561d2 (rtc: nvmem: remove nvram ABI) 7 | 8 | Upstream-status: pending 9 | Signed-off-by: Alex Gonzalez 10 | --- 11 | modules/rtc-unipi/rtc-unipi.c | 6 ++++-- 12 | 1 file changed, 4 insertions(+), 2 deletions(-) 13 | 14 | diff --git a/modules/rtc-unipi/rtc-unipi.c b/modules/rtc-unipi/rtc-unipi.c 15 | index 255bcd181824..6615b8fa7491 100644 16 | --- a/modules/rtc-unipi/rtc-unipi.c 17 | +++ b/modules/rtc-unipi/rtc-unipi.c 18 | @@ -671,11 +671,13 @@ read_rtc: 19 | 20 | rtc_unipi->rtc->nvmem_config = &rtc_unipi->nvmem_cfg; 21 | rtc_unipi->rtc->nvram_old_abi = true; 22 | -#else 23 | +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0) && LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) 24 | nvmem_cfg.priv = rtc_unipi; 25 | rtc_unipi->rtc->nvram_old_abi = true; 26 | rtc_nvmem_register(rtc_unipi->rtc, &nvmem_cfg); 27 | - 28 | +#else 29 | + nvmem_cfg.priv = rtc_unipi; 30 | + rtc_nvmem_register(rtc_unipi->rtc, &nvmem_cfg); 31 | #endif 32 | rtc_unipi->rtc->ops = &mcp794xx_rtc_ops; /*chip->rtc_ops ?: &ds13xx_rtc_ops;*/ 33 | err = rtc_register_device(rtc_unipi->rtc); 34 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/unipi-kernel-modules/files/0008-rtc-unipi-Add-devm-to-rtc_nvmem_register.patch: -------------------------------------------------------------------------------- 1 | From: Alex Gonzalez 2 | Date: Mon, 24 Oct 2022 18:14:07 +0200 3 | Subject: [PATCH 8/9] rtc-unipi: Add devm to rtc_nvmem_register 4 | 5 | This change is introduced in commit 6 | 3a905c2d9544a (rtc: add devm_ prefix to rtc_nvmem_register()) 7 | 8 | Upstream-status: pending 9 | Signed-off-by: Alex Gonzalez 10 | --- 11 | modules/rtc-unipi/rtc-unipi.c | 2 +- 12 | 1 file changed, 1 insertion(+), 1 deletion(-) 13 | 14 | diff --git a/modules/rtc-unipi/rtc-unipi.c b/modules/rtc-unipi/rtc-unipi.c 15 | index 6615b8fa7491..9953c63e91b1 100644 16 | --- a/modules/rtc-unipi/rtc-unipi.c 17 | +++ b/modules/rtc-unipi/rtc-unipi.c 18 | @@ -677,7 +677,7 @@ read_rtc: 19 | rtc_nvmem_register(rtc_unipi->rtc, &nvmem_cfg); 20 | #else 21 | nvmem_cfg.priv = rtc_unipi; 22 | - rtc_nvmem_register(rtc_unipi->rtc, &nvmem_cfg); 23 | + devm_rtc_nvmem_register(rtc_unipi->rtc, &nvmem_cfg); 24 | #endif 25 | rtc_unipi->rtc->ops = &mcp794xx_rtc_ops; /*chip->rtc_ops ?: &ds13xx_rtc_ops;*/ 26 | err = rtc_register_device(rtc_unipi->rtc); 27 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/unipi-kernel-modules/files/0009-rtc-unipi-Adapt-to-rename-of-rtc_register_device.patch: -------------------------------------------------------------------------------- 1 | From: Alex Gonzalez 2 | Date: Mon, 24 Oct 2022 18:21:20 +0200 3 | Subject: [PATCH 9/9] rtc-unipi: Adapt to rename of rtc_register_device 4 | 5 | The rename happens in commit 6 | fdcfd854333 (rtc: rework rtc_register_device() resource management) 7 | 8 | Upstream-status: pending 9 | Signed-off-by: Alex Gonzalez 10 | --- 11 | modules/rtc-unipi/rtc-unipi.c | 4 ++++ 12 | 1 file changed, 4 insertions(+) 13 | 14 | diff --git a/modules/rtc-unipi/rtc-unipi.c b/modules/rtc-unipi/rtc-unipi.c 15 | index 9953c63e91b1..e40fce763f7b 100644 16 | --- a/modules/rtc-unipi/rtc-unipi.c 17 | +++ b/modules/rtc-unipi/rtc-unipi.c 18 | @@ -680,7 +680,11 @@ read_rtc: 19 | devm_rtc_nvmem_register(rtc_unipi->rtc, &nvmem_cfg); 20 | #endif 21 | rtc_unipi->rtc->ops = &mcp794xx_rtc_ops; /*chip->rtc_ops ?: &ds13xx_rtc_ops;*/ 22 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) 23 | err = rtc_register_device(rtc_unipi->rtc); 24 | +#else 25 | + err = devm_rtc_register_device(rtc_unipi->rtc); 26 | +#endif 27 | if (err) 28 | return err; 29 | 30 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-kernel/unipi-kernel-modules/unipi-kernel-modules.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "UniPi Neuron/Axon kernel modules" 2 | LICENSE = "GPL-2.0-only" 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" 4 | 5 | inherit module 6 | 7 | SRC_URI = " \ 8 | git://github.com/UniPiTechnology/unipi-kernel.git;protocol=https;nobranch=1 \ 9 | file://0001-unipi_tty-Fix-compile-on-kernel-5.10.patch \ 10 | file://0002-unipi_spi-use-new-structure-for-SPI-transfer-delays.patch \ 11 | file://0003-unipi_tty-remove-TTY_LDISC_MAGIC.patch \ 12 | file://0004-unipi_tty-remove-ldisc-number-in-tty_register_ldisc-.patch \ 13 | file://0005-unipi_tty-adapt-to-fp-of-tty_ldisc_ops-made-const.patch \ 14 | file://0006-unipi_spi-adapt-to-removal-of-spi_set_cs_timing.patch \ 15 | file://0007-rtc-unipi-Adapt-to-removal-of-nvram-ABI.patch \ 16 | file://0008-rtc-unipi-Add-devm-to-rtc_nvmem_register.patch \ 17 | file://0009-rtc-unipi-Adapt-to-rename-of-rtc_register_device.patch \ 18 | " 19 | 20 | # Corresponds to v1.80 21 | SRCREV = "4f09337d748936388e49ee7715854bf8aa3ee937" 22 | 23 | S = "${WORKDIR}/git" 24 | 25 | MODULES_MODULE_SYMVERS_LOCATION = "modules/unipi" 26 | EXTRA_OEMAKE:append = " LINUX_DIR_PATH=${STAGING_KERNEL_DIR}" 27 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/balena-keys/balena-keys.bbappend: -------------------------------------------------------------------------------- 1 | do_get_public_keys:append() { 2 | fetch_key "rsa/key/${SIGN_RSA_KEY_ID}" ".key" "rsa.pem" 3 | } 4 | 5 | do_get_public_keys[vardeps] += " \ 6 | SIGN_RSA_KEY_ID \ 7 | " 8 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/hostapp-update-hooks/files/98-pieeprom: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # This hook updates raspberrypi4 boot firmware located in the SPI EEPROM 5 | # 6 | # Update procedure is based on the rpi-eeprom-update script available at 7 | # https://github.com/raspberrypi/rpi-eeprom/blob/master/rpi-eeprom-update 8 | 9 | set -o errexit 10 | 11 | # shellcheck disable=SC1091 12 | . /usr/libexec/os-helpers-logging 13 | 14 | info "Updating SPI EEPROM firmware" 15 | 16 | if ! /usr/libexec/pieeprom-update.sh; then 17 | error "Failed to update SPI EEPROM firmware" 18 | fi 19 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/hostapp-update-hooks/files/999-resin-boot-cleaner: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Script which configures the cleans up redundant files in the boot partition 5 | # 6 | 7 | set -o errexit 8 | 9 | . /usr/sbin/balena-config-vars 10 | . /usr/libexec/os-helpers-logging 11 | 12 | DURING_UPDATE=${DURING_UPDATE:-0} 13 | 14 | if [ "$DURING_UPDATE" = "1" ]; then 15 | if grep -q "ext4load" "$BALENA_NONENC_BOOT_MOUNTPOINT/boot.scr" ; then 16 | if [ -e "$BALENA_NONENC_BOOT_MOUNTPOINT/zImage" ]; then 17 | # Testing the destination sysroot kernel is tricky. Lets check current root 18 | # instead as all future roots will have the kernel in root partition in /boot 19 | # This leaves the kernel lying around in boot partition until the next HUP 20 | if [ -e "/boot/zImage" ]; then 21 | info "u-boot boot.scr now reads kernel from root partitions but found zImage in boot \n" 22 | info "removing $BALENA_NONENC_BOOT_MOUNTPOINT/zImage \n" 23 | rm -f "$BALENA_NONENC_BOOT_MOUNTPOINT/zImage" || true 24 | sync -f "$BALENA_NONENC_BOOT_MOUNTPOINT" 25 | fi 26 | fi 27 | fi 28 | fi 29 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/hostapp-update-hooks/files/9999-bootfiles: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Script which applies a quirk to revpi-core-3's config.txt to remove an incompatible dtoverlay setting 5 | # 6 | 7 | set -o errexit 8 | 9 | . /usr/libexec/os-helpers-logging 10 | 11 | info "Applying quirk to remove dtoverlay=mmc from config.txt" 12 | sed "/dtoverlay=mmc/d" /mnt/boot/config.txt > /mnt/boot/config.txt.new 13 | 14 | info "Checking and applying if needed the quirks for removing older kunbus overlay" 15 | sed "/Enable RevPi specific pins for i2c/d" /mnt/boot/config.txt > /mnt/boot/config.txt.new 16 | sed "/dtoverlay=i2c1-bcm2708,sda1_pin=44,scl1_pin=45,pin_func=6/d" /mnt/boot/config.txt > /mnt/boot/config.txt.new 17 | sed "/Enable RevPi realtime clock/d" /mnt/boot/config.txt > /mnt/boot/config.txt.new 18 | sed "/dtoverlay=i2c-rtc,pcf2127/d" /mnt/boot/config.txt > /mnt/boot/config.txt.new 19 | sed "/Enable RevPi specific pins for spi/d" /mnt/boot/config.txt > /mnt/boot/config.txt.new 20 | sed "s/dtoverlay=kunbus/dtoverlay=revpi-core/g" /mnt/boot/config.txt > /mnt/boot/config.txt.new 21 | 22 | info "Setting the CMA default size to 320M for backwards compatibility" 23 | sed '/dtoverlay=vc4-kms-v3d,cma-320/! s/dtoverlay=vc4-kms-v3d/dtoverlay=vc4-kms-v3d,cma-320/g' /mnt/boot/config.txt > /mnt/boot/config.txt.new 24 | 25 | sync -f /mnt/boot 26 | mv /mnt/boot/config.txt.new /mnt/boot/config.txt 27 | sync -f /mnt/boot 28 | info " done." 29 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/hostapp-update-hooks/hostapp-update-hooks.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:append := ":${THISDIR}/files" 2 | 3 | HOSTAPP_HOOKS += " 99-resin-uboot 999-resin-boot-cleaner" 4 | HOSTAPP_HOOKS:append:revpi-core-3 = " 9999-bootfiles" 5 | 6 | HOSTAPP_HOOKS:remove:raspberrypicm4-ioboard-sb = "99-resin-uboot 999-resin-boot-cleaner" 7 | HOSTAPP_HOOKS:append:raspberrypicm4-ioboard-sb = " 99-balena-bootloader" 8 | 9 | HOSTAPP_HOOKS:remove:raspberrypi5 = "99-resin-uboot 999-resin-boot-cleaner" 10 | HOSTAPP_HOOKS:append:raspberrypi5 = " 99-balena-bootloader" 11 | 12 | HOSTAPP_HOOKS:append:raspberrypi4-64 = " 98-pieeprom" 13 | RDEPENDS:${PN}:append:raspberrypi4-64 = " rpi-eeprom" 14 | 15 | do_install:append:raspberrypi4-64 () { 16 | if [ "x${SIGN_API}" != "x" ]; then 17 | install -m 0755 1-bootfiles ${D}${sysconfdir}/hostapp-update-hooks.d/2-rpifiles 18 | sed -i -e 's:@BALENA_BOOT_FINGERPRINT@:${BALENA_BOOT_FINGERPRINT}:g;' \ 19 | ${D}${sysconfdir}/hostapp-update-hooks.d/2-rpifiles 20 | sed -i -e 's:@BALENA_BOOTFILES_BLACKLIST@:${BALENA_BOOTFILES_BLACKLIST}:g;' \ 21 | ${D}${sysconfdir}/hostapp-update-hooks.d/2-rpifiles 22 | fi 23 | } 24 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/os-helpers/os-helpers.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" 2 | 3 | SRC_URI += " \ 4 | file://os-helpers-otp \ 5 | file://os-helpers-sb \ 6 | " 7 | 8 | RDEPENDS:${PN}-sb = "os-helpers-otp" 9 | RDEPENDS:${PN}-otp:raspberrypi4-64 = "userlandtools" 10 | 11 | PACKAGES += " \ 12 | ${PN}-otp \ 13 | " 14 | 15 | do_install:append() { 16 | install -m 0775 ${WORKDIR}/os-helpers-otp ${D}${libexecdir} 17 | install -m 0775 ${WORKDIR}/os-helpers-sb ${D}${libexecdir} 18 | sed -i -e "s,@@KERNEL_IMAGETYPE@@,${KERNEL_IMAGETYPE},g" ${D}${libexecdir}/os-helpers-sb 19 | sed -i -e "s,@@BALENA_IMAGE_FLAG_FILE@@,${BALENA_IMAGE_FLAG_FILE},g" ${D}${libexecdir}/os-helpers-sb 20 | } 21 | 22 | FILES:${PN}-otp = "${libexecdir}/os-helpers-otp" 23 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/os-helpers/os-helpers/os-helpers-otp: -------------------------------------------------------------------------------- 1 | otp_read_key() { 2 | local _key 3 | _key="$(vcmailbox 0x00030081 40 40 0 8 0 0 0 0 0 0 0 0)" 4 | echo "${_key}" | sed 's/0x//g' | awk '{for(i=8;i<16;i++) printf $i; print ""}' 5 | } 6 | 7 | otp_read_register() { 8 | local _reg="${1}" 9 | vcgencmd otp_dump 2>/dev/null | grep "^${_reg}" | cut -d':' -f2 10 | } 11 | 12 | # Return success if the sha256 RSA key is written in the OTP 13 | otp_has_rsa_digest() { 14 | for r in $(seq 47 54); do 15 | local _out 16 | _out=$(otp_read_register "$r") 17 | if [ -n "${_out}" ] && [ "${_out}" != "00000000" ]; then 18 | return 0 19 | fi 20 | done 21 | return 1 22 | } 23 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/os-helpers/os-helpers/os-helpers-sb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2023 Balena Ltd. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # vi: ft=sh 17 | 18 | # shellcheck disable=SC1091 19 | [ -f "/usr/libexec/os-helpers-logging" ] && . /usr/libexec/os-helpers-logging 20 | # shellcheck disable=SC1091 21 | [ -f "/usr/libexec/os-helpers-otp" ] && . /usr/libexec/os-helpers-otp 22 | 23 | BALENA_NONENCRYPTED_BOOT_PARTITION_FILES="\ 24 | boot.img \ 25 | boot.scr \ 26 | boot.sig \ 27 | config.txt \ 28 | bcm2711-rpi-400.dtb \ 29 | bcm2711-rpi-4-b.dtb \ 30 | bcm2711-rpi-cm4.dtb \ 31 | @@BALENA_IMAGE_FLAG_FILE@@ \ 32 | extra_uEnv.txt \ 33 | @@KERNEL_IMAGETYPE@@ \ 34 | bootenv \ 35 | " 36 | 37 | is_secured() { 38 | # Check the private key has been programmed 39 | if [ -n "$(otp_read_key | sed s/0//g)" ]; then 40 | # Check that the RSA digest has been programmed 41 | # Skip on balena bootloader that has no VHCI access 42 | if grep -q "balena_stage2" < /proc/cmdline; then 43 | return 0 44 | else 45 | if otp_has_rsa_digest; then 46 | return 0 47 | fi 48 | fi 49 | fi 50 | return 1 51 | } 52 | 53 | do_skip() { 54 | _file="$1" 55 | for b in $BALENA_NONENCRYPTED_BOOT_PARTITION_FILES; do 56 | # See if file is in the non-encrypted boot partition file list 57 | if [ "$b" = "$(basename "$_file")" ]; then 58 | # If so, skip (return 0) if running the 1-bootfiles script that copies files 59 | # to the non-encrypted /mnt/boot partition 60 | # If running a different script, return 1 not to skip it 61 | test "$(basename $0)" = "1-bootfiles" 62 | return 63 | fi 64 | done 65 | # The file is in the encrypted boot partition file list, so do not skip (return 1) if running 66 | # the 1-bootfiles script that copies files to the encrypted /mnt/boot partition 67 | # If running a different script, return 0 to skip it 68 | test "$(basename "$0")" != "1-bootfiles" 69 | } 70 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/resin-init/files/balena-init-flasher-rpi-diskenc: -------------------------------------------------------------------------------- 1 | # 2 | # Device interface for secure boot programming 3 | # 4 | # 5 | 6 | # diskenc_setup 7 | # * Generate and encrypt disk encryption keys 8 | 9 | . /usr/libexec/os-helpers-logging 10 | . /usr/libexec/os-helpers-otp 11 | 12 | # 256 bits number, 32 bytes = 64 hex characters (each byte is represented by 2 hex characters) 13 | OTP_KEY_LENGTH=32 14 | OTP_KEY_REP_LENGTH=64 15 | 16 | otp_write_key() { 17 | local _key="${1}" 18 | local _count 19 | local _key_params 20 | local _start 21 | local _end 22 | 23 | if [ -n "$(otp_read_key | sed s/0//g)" ]; then 24 | info "Private key has already been programmed" 25 | return 0 26 | fi 27 | 28 | if [ "$(echo -n "${_key}" | wc -c)" != ${OTP_KEY_REP_LENGTH} ]; then 29 | fail "Invalid key argument" 30 | fi 31 | 32 | if [ -z "$(echo -n "${_key}" | sed s/0//g)" ]; then 33 | fail "Argument is an empty key" 34 | fi 35 | 36 | # Sanity checks 37 | _key="$(echo "${_key}" | tr 'A-Z' 'a-z')" 38 | _key="$(echo "${_key}" | sed 's/[^a-f0-9]//g')" 39 | 40 | _count=0 41 | _key_params="" 42 | while [ ${_count} -lt 8 ]; do 43 | _start=$(((_count * 8) + 1)) 44 | _end=$((_start + 7)) 45 | _key_params="${_key_params} 0x$(echo -n "${_key}" | cut -c${_start}-${_end})" 46 | _count=$((_count + 1)) 47 | done 48 | 49 | vcmailbox 0x38081 40 40 0 8 ${_key_params} || fail "Failed to write key" 50 | if [ "$(otp_read_key)" != "${_key}" ]; then 51 | fail "Key validation failed" 52 | fi 53 | } 54 | 55 | otp_generate_key() { 56 | local _key_length 57 | _key_length="${1}" 58 | head -c ${_key_length} /dev/urandom | xxd -p -c ${_key_length} 59 | } 60 | 61 | diskenc_setup() { 62 | local _key 63 | 64 | # Make sure the private key is present in OTP 65 | _key=$(otp_generate_key ${OTP_KEY_LENGTH}) 66 | otp_write_key "${_key}" || fail "Failed to write private key to OTP" 67 | 68 | TPM_RESULT_DIR=$(mktemp -d) 69 | PASSPHRASE_FILE="$(mktemp -p "${TPM_RESULT_DIR}")" 70 | # Generate the disk encryption passphrase 71 | otp_generate_key ${OTP_KEY_LENGTH} > "${PASSPHRASE_FILE}" 72 | 73 | # Encrypt the passphrase using the private key 74 | ENC_PASSPHRASE_FILE=$(mktemp -u -p ${TPM_RESULT_DIR}) 75 | gpg --symmetric --cipher-algo AES256 --batch --passphrase $(otp_read_key) -o "${ENC_PASSPHRASE_FILE}" < "${PASSPHRASE_FILE}" || fail "Failed to encrypt passphrase" 76 | } 77 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/resin-init/files/balena-init-flasher-rpi-secureboot: -------------------------------------------------------------------------------- 1 | # 2 | # Device interface for secure boot programming 3 | # 4 | # 5 | 6 | # secureboot_setup 7 | # * Secure boot setup mode 8 | # * Key enrollment 9 | # * Secure boot mode checks 10 | # bootpart_split 11 | # * Split boot partition into encrypted and non-encrypted partitions 12 | # secureboot_bootloader_setup 13 | # * Hook for secureboot bootloader setup 14 | # secureboot_bootloader_postsetup 15 | # * Hook for secureboot bootloader post-setup 16 | 17 | [ -f "/usr/libexec/os-helpers-sb" ] && . /usr/libexec/os-helpers-sb 18 | if ! command -v generate_bootpart_fingerprint > /dev/null; then . /usr/libexec/os-helpers-fs; fi 19 | 20 | BALENA_NONENC_BOOT_LABEL=@@BALENA_NONENC_BOOT_LABEL@@ 21 | 22 | secureboot_setup() { 23 | return 0 24 | } 25 | 26 | bootpart_split() { 27 | # Split the boot partition in an encrypted and non-encrypted partition 28 | # Encrypted resin-boot already mounted in $INTERNAL_DEVICE_BOOT_PART_MOUNTPOINT 29 | NONENC_BOOT_MOUNT_DIR="$(mktemp -d)" 30 | NONENC_BOOT_MOUNT=$(get_dev_path_in_device_with_label "${internal_dev}" "${BALENA_NONENC_BOOT_LABEL}") 31 | if ! mount "${NONENC_BOOT_MOUNT}" "$NONENC_BOOT_MOUNT_DIR"; then 32 | fail "Failed to mount disk labeled as ${BALENA_NONENC_BOOT_LABEL}." 33 | fi 34 | 35 | # Move all to be encrypted files to encrypted boot partition 36 | for FILE in "$NONENC_BOOT_MOUNT_DIR/"*; do 37 | _file=$(basename "$FILE") 38 | if [[ "${BALENA_NONENCRYPTED_BOOT_PARTITION_FILES}" == *"${_file}"* ]]; then 39 | continue 40 | fi 41 | 42 | mv "$FILE" "$INTERNAL_DEVICE_BOOT_PART_MOUNTPOINT/" 43 | done 44 | 45 | # Store files necessary for TPM decryption to the unencrypted partitions 46 | mv "${ENC_PASSPHRASE_FILE}" "$NONENC_BOOT_MOUNT_DIR/balena-luks.enc" && sync 47 | 48 | rm -rf "$TPM_RESULT_DIR" 49 | 50 | # Regenerate fingerprint in both partitions 51 | generate_bootpart_fingerprint "${NONENC_BOOT_MOUNT_DIR}" 52 | generate_bootpart_fingerprint "${INTERNAL_DEVICE_BOOT_PART_MOUNTPOINT}" 53 | 54 | # Do not umount - flasher script will still copy configuration files 55 | } 56 | 57 | secureboot_bootloader_setup() { 58 | return 0 59 | } 60 | 61 | secureboot_bootloader_postsetup() { 62 | return 0 63 | } 64 | 65 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/resin-init/files/resin-init-board: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | 4 | set -e 5 | 6 | modprobe i2c-dev || true 7 | 8 | exit 0 9 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/resin-init/files/resin-init-flasher-board: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . /usr/libexec/os-helpers-logging 6 | 7 | if ! /usr/libexec/pieeprom-update.sh; then 8 | error "Failed to update SPI EEPROM" 9 | exit 1 10 | fi 11 | 12 | exit 0 13 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/resin-init/resin-init-board.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend:rpi := "${THISDIR}/files:" 2 | 3 | RDEPENDS:${PN}:append = " kmod" 4 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/resin-init/resin-init-flasher-board.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | RDEPENDS:${PN}:append:raspberrypi4-64 = " os-helpers-logging rpi-eeprom" 4 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/resin-init/resin-init-flasher.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | INTERNAL_DEVICE_KERNEL = "mmcblk?" 4 | 5 | SRC_URI:append = " \ 6 | file://balena-init-flasher-rpi-secureboot \ 7 | file://balena-init-flasher-rpi-diskenc \ 8 | " 9 | 10 | do_install:append() { 11 | if [ "x${SIGN_API}" != "x" ]; then 12 | install -d ${D}${libexecdir} 13 | install -m 0755 ${WORKDIR}/balena-init-flasher-rpi-secureboot ${D}${libexecdir}/balena-init-flasher-secureboot 14 | sed -i -e "s,@@BALENA_FINGERPRINT_FILENAME@@,${BALENA_FINGERPRINT_FILENAME},g" ${D}${libexecdir}/balena-init-flasher-secureboot 15 | sed -i -e "s,@@BALENA_NONENC_BOOT_LABEL@@,${BALENA_NONENC_BOOT_LABEL},g" ${D}${libexecdir}/balena-init-flasher-secureboot 16 | sed -i -e "s,@@BALENA_FINGERPRINT_EXT@@,${BALENA_FINGERPRINT_EXT},g" ${D}${libexecdir}/balena-init-flasher-secureboot 17 | install -m 0755 ${WORKDIR}/balena-init-flasher-rpi-diskenc ${D}${libexecdir}/balena-init-flasher-diskenc 18 | fi 19 | } 20 | 21 | RDEPENDS:${PN}:append = "${@oe.utils.conditional('SIGN_API','','',' os-helpers-sb gnupg',d)}" 22 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/resin-mounts/files/balena-rpi.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Balena RPI partition mount service 3 | DefaultDependencies=no 4 | After=resin-boot.service 5 | Requires=resin-boot.service 6 | Before=umount.target 7 | Conflicts=umount.target 8 | ConditionVirtualization=!docker 9 | 10 | [Service] 11 | Type=oneshot 12 | RemainAfterExit=yes 13 | ExecStart=/usr/bin/resin-partition-mounter --mount @@BALENA_NONENC_BOOT_LABEL@@ 14 | ExecStop=/usr/bin/resin-partition-mounter --umount @@BALENA_NONENC_BOOT_LABEL@@ 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/resin-mounts/files/resin-boot.conf: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Before=systemd-modules-load.service 3 | -------------------------------------------------------------------------------- /layers/meta-balena-raspberrypi/recipes-support/resin-mounts/resin-mounts.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append:revpi = "\ 4 | file://resin-boot.conf \ 5 | " 6 | SRC_URI:append:raspberrypicm4-ioboard-sb = "\ 7 | file://balena-rpi.service \ 8 | " 9 | 10 | do_install:append:raspberrypicm4-ioboard-sb() { 11 | if [ "x${SIGN_API}" != "x" ]; then 12 | sed -i -e "s/@@BALENA_NONENC_BOOT_LABEL@@/${BALENA_NONENC_BOOT_LABEL}/g" "${D}${systemd_unitdir}/system/balena-rpi.service" 13 | fi 14 | } 15 | 16 | do_install:append:revpi() { 17 | install -d ${D}${sysconfdir}/systemd/system/resin-boot.service.d 18 | install -m 0644 resin-boot.conf ${D}${sysconfdir}/systemd/system/resin-boot.service.d/ 19 | } 20 | -------------------------------------------------------------------------------- /npe-x500-m3.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'npe-x500-m3' 7 | aliases: [ 'npe-x500-m3' ] 8 | name: 'NPE X500 M3' 9 | arch: 'armv7hf' 10 | state: 'released' 11 | community: true 12 | 13 | imageDownloadAlerts: [ 14 | { 15 | type: 'warning' 16 | message: 'The Raspberry Pi 3 is not capable of connecting to 5GHz WiFi networks unless you use an external WiFi adapter that supports it. The Raspberry Pi 3 B+ is capable of connecting to both 5GHz and 2.4GHz networks.' 17 | } 18 | ] 19 | 20 | instructions: commonImg.instructions 21 | gettingStartedLink: 22 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 23 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 24 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 25 | 26 | options: [ networkOptions.group ] 27 | 28 | yocto: 29 | machine: 'npe-x500-m3' 30 | image: 'balena-image' 31 | fstype: 'balenaos-img' 32 | version: 'yocto-kirkstone' 33 | deployArtifact: 'balena-image-npe-x500-m3.balenaos-img' 34 | compressed: true 35 | 36 | configuration: 37 | config: 38 | partition: 39 | primary: 1 40 | path: '/config.json' 41 | 42 | initialization: commonImg.initialization 43 | -------------------------------------------------------------------------------- /raspberrypi.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'raspberry-pi' 7 | aliases: [ 'raspberrypi' ] 8 | name: 'Raspberry Pi (v1 / Zero / Zero W)' 9 | arch: 'rpi' 10 | state: 'released' 11 | 12 | imageDownloadAlerts: [ 13 | { 14 | type: 'warning' 15 | message: 'The Raspberry Pi Zero W is not capable of connecting to 5GHz WiFi networks unless you use an external WiFi adapter that supports it.' 16 | } 17 | ] 18 | 19 | instructions: commonImg.instructions 20 | gettingStartedLink: 21 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberry-pi/nodejs/' 22 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberry-pi/nodejs/' 23 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberry-pi/nodejs/' 24 | 25 | options: [ networkOptions.group ] 26 | 27 | yocto: 28 | machine: 'raspberrypi' 29 | image: 'balena-image' 30 | fstype: 'balenaos-img' 31 | version: 'yocto-kirkstone' 32 | deployArtifact: 'balena-image-raspberrypi.balenaos-img' 33 | compressed: true 34 | 35 | configuration: 36 | config: 37 | partition: 38 | primary: 1 39 | path: '/config.json' 40 | 41 | initialization: commonImg.initialization 42 | -------------------------------------------------------------------------------- /raspberrypi0-2w-64.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'raspberrypi0-2w-64' 7 | name: 'Raspberry Pi Zero 2 W (64bit)' 8 | arch: 'aarch64' 9 | state: 'released' 10 | isDefault: true 11 | 12 | instructions: commonImg.instructions 13 | gettingStartedLink: 14 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi0-2w-64/nodejs/' 15 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi0-2w-64/nodejs/' 16 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi0-2w-64/nodejs/' 17 | 18 | options: [ networkOptions.group ] 19 | 20 | yocto: 21 | machine: 'raspberrypi0-2w-64' 22 | image: 'balena-image' 23 | fstype: 'balenaos-img' 24 | version: 'yocto-kirkstone' 25 | deployArtifact: 'balena-image-raspberrypi0-2w-64.balenaos-img' 26 | compressed: true 27 | 28 | configuration: 29 | config: 30 | partition: 31 | primary: 1 32 | path: '/config.json' 33 | 34 | initialization: commonImg.initialization 35 | -------------------------------------------------------------------------------- /raspberrypi2.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'raspberry-pi2' 7 | aliases: [ 'raspberrypi2' ] 8 | name: 'Raspberry Pi 2' 9 | arch: 'armv7hf' 10 | state: 'released' 11 | 12 | imageDownloadAlerts: [ 13 | { 14 | type: 'warning' 15 | message: 'The Raspberry Pi 2 is not capable of connecting to WiFi networks without an external adapter.' 16 | } 17 | ] 18 | 19 | instructions: commonImg.instructions 20 | gettingStartedLink: 21 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberry-pi2/nodejs/' 22 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberry-pi2/nodejs/' 23 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberry-pi2/nodejs/' 24 | 25 | options: [ networkOptions.group ] 26 | 27 | yocto: 28 | machine: 'raspberrypi2' 29 | image: 'balena-image' 30 | fstype: 'balenaos-img' 31 | version: 'yocto-kirkstone' 32 | deployArtifact: 'balena-image-raspberrypi2.balenaos-img' 33 | compressed: true 34 | 35 | configuration: 36 | config: 37 | partition: 38 | primary: 1 39 | path: '/config.json' 40 | 41 | initialization: commonImg.initialization 42 | -------------------------------------------------------------------------------- /raspberrypi3-64.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'raspberrypi3-64' 7 | aliases: [ 'raspberrypi3-64' ] 8 | name: 'Raspberry Pi 3 (using 64bit OS)' 9 | arch: 'aarch64' 10 | state: 'released' 11 | 12 | imageDownloadAlerts: [ 13 | { 14 | type: 'warning' 15 | message: 'The Raspberry Pi 3 is not capable of connecting to 5GHz WiFi networks unless you use an external WiFi adapter that supports it.' 16 | } 17 | ] 18 | 19 | instructions: commonImg.instructions 20 | gettingStartedLink: 21 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 22 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 23 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 24 | 25 | options: [ networkOptions.group ] 26 | 27 | yocto: 28 | machine: 'raspberrypi3-64' 29 | image: 'balena-image' 30 | fstype: 'balenaos-img' 31 | version: 'yocto-kirkstone' 32 | deployArtifact: 'balena-image-raspberrypi3-64.balenaos-img' 33 | compressed: true 34 | 35 | configuration: 36 | config: 37 | partition: 38 | primary: 1 39 | path: '/config.json' 40 | 41 | initialization: commonImg.initialization 42 | -------------------------------------------------------------------------------- /raspberrypi3-unipi-neuron.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'raspberrypi3-unipi-neuron' 7 | name: 'UniPi Neuron (Raspberry Pi 3)' 8 | arch: 'armv7hf' 9 | state: 'new' 10 | 11 | imageDownloadAlerts: [ 12 | { 13 | type: 'warning' 14 | message: 'The Raspberry Pi 3 is not capable of connecting to 5GHz WiFi networks unless you use an external WiFi adapter that supports it. The Raspberry Pi 3 B+ is capable of connecting to both 5GHz and 2.4GHz networks.' 15 | } 16 | ] 17 | 18 | instructions: commonImg.instructions 19 | gettingStartedLink: 20 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 21 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 22 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 23 | 24 | options: [ networkOptions.group ] 25 | 26 | yocto: 27 | machine: 'raspberrypi3-unipi-neuron' 28 | image: 'balena-image' 29 | fstype: 'balenaos-img' 30 | version: 'yocto-kirkstone' 31 | deployArtifact: 'balena-image-raspberrypi3-unipi-neuron.balenaos-img' 32 | compressed: true 33 | 34 | configuration: 35 | config: 36 | partition: 37 | primary: 1 38 | path: '/config.json' 39 | 40 | initialization: commonImg.initialization 41 | -------------------------------------------------------------------------------- /raspberrypi3.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'raspberrypi3' 7 | aliases: [ 'raspberrypi3' ] 8 | name: 'Raspberry Pi 3' 9 | arch: 'armv7hf' 10 | state: 'released' 11 | isDefault: true 12 | 13 | imageDownloadAlerts: [ 14 | { 15 | type: 'warning' 16 | message: 'The Raspberry Pi 3 is not capable of connecting to 5GHz WiFi networks unless you use an external WiFi adapter that supports it. The Raspberry Pi 3 B+ is capable of connecting to both 5GHz and 2.4GHz networks.' 17 | } 18 | ] 19 | 20 | instructions: commonImg.instructions 21 | gettingStartedLink: 22 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 23 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 24 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/' 25 | 26 | options: [ networkOptions.group ] 27 | 28 | yocto: 29 | machine: 'raspberrypi3' 30 | image: 'balena-image' 31 | fstype: 'balenaos-img' 32 | version: 'yocto-kirkstone' 33 | deployArtifact: 'balena-image-raspberrypi3.balenaos-img' 34 | compressed: true 35 | 36 | configuration: 37 | config: 38 | partition: 39 | primary: 1 40 | path: '/config.json' 41 | 42 | initialization: commonImg.initialization 43 | -------------------------------------------------------------------------------- /raspberrypi4-64.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'raspberrypi4-64' 7 | aliases: [ 'raspberrypi4-64' ] 8 | name: 'Raspberry Pi 4' 9 | arch: 'aarch64' 10 | state: 'released' 11 | 12 | instructions: commonImg.instructions 13 | gettingStartedLink: 14 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 15 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 16 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 17 | 18 | options: [ networkOptions.group ] 19 | 20 | yocto: 21 | machine: 'raspberrypi4-64' 22 | image: 'balena-image' 23 | fstype: 'balenaos-img' 24 | version: 'yocto-kirkstone' 25 | deployArtifact: 'balena-image-raspberrypi4-64.balenaos-img' 26 | compressed: true 27 | 28 | configuration: 29 | config: 30 | partition: 31 | primary: 1 32 | path: '/config.json' 33 | 34 | initialization: commonImg.initialization 35 | -------------------------------------------------------------------------------- /raspberrypi4-superhub.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'raspberrypi4-superhub' 7 | name: 'SuperHub' 8 | arch: 'aarch64' 9 | state: 'new' 10 | 11 | instructions: commonImg.instructions 12 | gettingStartedLink: 13 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 14 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 15 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 16 | 17 | options: [ networkOptions.group ] 18 | 19 | yocto: 20 | machine: 'raspberrypi4-superhub' 21 | image: 'balena-image' 22 | fstype: 'balenaos-img' 23 | version: 'yocto-kirkstone' 24 | deployArtifact: 'balena-image-raspberrypi4-superhub.balenaos-img' 25 | compressed: true 26 | 27 | configuration: 28 | config: 29 | partition: 30 | primary: 1 31 | path: '/config.json' 32 | 33 | initialization: commonImg.initialization 34 | -------------------------------------------------------------------------------- /raspberrypi4-unipi-neuron.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'raspberrypi4-unipi-neuron' 7 | name: 'UniPi Neuron (Raspberry Pi 4)' 8 | arch: 'aarch64' 9 | state: 'new' 10 | 11 | instructions: commonImg.instructions 12 | gettingStartedLink: 13 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 14 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 15 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 16 | 17 | options: [ networkOptions.group ] 18 | 19 | yocto: 20 | machine: 'raspberrypi4-unipi-neuron' 21 | image: 'balena-image' 22 | fstype: 'balenaos-img' 23 | version: 'yocto-kirkstone' 24 | deployArtifact: 'balena-image-raspberrypi4-unipi-neuron.balenaos-img' 25 | compressed: true 26 | 27 | configuration: 28 | config: 29 | partition: 30 | primary: 1 31 | path: '/config.json' 32 | 33 | initialization: commonImg.initialization 34 | -------------------------------------------------------------------------------- /raspberrypi400-64.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'raspberrypi400-64' 7 | aliases: [ 'raspberrypi400-64' ] 8 | name: 'Raspberry Pi 400' 9 | arch: 'aarch64' 10 | state: 'new' 11 | 12 | instructions: commonImg.instructions 13 | gettingStartedLink: 14 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi400/nodejs/' 15 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi400/nodejs/' 16 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi400/nodejs/' 17 | 18 | options: [ networkOptions.group ] 19 | 20 | yocto: 21 | machine: 'raspberrypi400-64' 22 | image: 'balena-image' 23 | fstype: 'balenaos-img' 24 | version: 'yocto-kirkstone' 25 | deployArtifact: 'balena-image-raspberrypi400-64.balenaos-img' 26 | compressed: true 27 | 28 | configuration: 29 | config: 30 | partition: 31 | primary: 1 32 | path: '/config.json' 33 | 34 | initialization: commonImg.initialization 35 | -------------------------------------------------------------------------------- /raspberrypi5.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'raspberrypi5' 7 | name: 'Raspberry Pi 5' 8 | arch: 'aarch64' 9 | state: 'released' 10 | 11 | instructions: commonImg.instructions 12 | gettingStartedLink: 13 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi5/nodejs/' 14 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi5/nodejs/' 15 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi5/nodejs/' 16 | 17 | options: [ networkOptions.group ] 18 | 19 | yocto: 20 | machine: 'raspberrypi5' 21 | image: 'balena-image' 22 | fstype: 'balenaos-img' 23 | version: 'yocto-kirkstone' 24 | deployArtifact: 'balena-image-raspberrypi5.balenaos-img' 25 | compressed: true 26 | 27 | configuration: 28 | config: 29 | partition: 30 | primary: 1 31 | path: '/config.json' 32 | 33 | initialization: commonImg.initialization 34 | -------------------------------------------------------------------------------- /raspberrypicm4-ioboard-sb.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | UNPACK_IMAGE = 'Unzip the image downloaded from the dashboard.' 5 | CM4IOB_WRITE_SD="If using a CM4 Lite: write the OS file you downloaded to your SD card. We recommend using Etcher. After flashing, insert the freshly burnt SD card into the IO Board" 6 | CM4IOB_WRITE_EMMC="If using a CM4 eMMC: fit jumper to disable eMMC boot on J2 and connect the IO Board's microUSB port to your PC. Power the board and use usbboot to put the eMMC in mass storage mode. Write the OS file you downloaded to mass storage device." 7 | CM4IOB_WRITE_BOOT="Disconnect the power source and eMMC boot jumper if using the CM4 eMMC. Connect the CM4 IO Board to the internet, then power it up." 8 | 9 | module.exports = 10 | version: 1 11 | slug: 'raspberrypicm4-ioboard-sb' 12 | aliases: [ 'raspberrypicm4-ioboard-sb' ] 13 | name: 'Secure boot enabled Raspberry Pi CM4 IO Board' 14 | arch: 'aarch64' 15 | state: 'new' 16 | 17 | instructions: [ 18 | UNPACK_IMAGE 19 | CM4IOB_WRITE_SD 20 | CM4IOB_WRITE_EMMC 21 | CM4IOB_WRITE_BOOT 22 | ] 23 | gettingStartedLink: 24 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypicm4-ioboard-sb/nodejs/' 25 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypicm4-ioboard-sb/nodejs/' 26 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypicm4-ioboard-sb/nodejs/' 27 | 28 | options: [ networkOptions.group ] 29 | 30 | yocto: 31 | machine: 'raspberrypicm4-ioboard-sb' 32 | image: 'balena-image-flasher' 33 | fstype: 'balenaos-img' 34 | version: 'yocto-kirkstone' 35 | deployArtifact: 'balena-image-flasher-raspberrypicm4-ioboard-sb.balenaos-img' 36 | compressed: true 37 | 38 | configuration: 39 | config: 40 | partition: 41 | primary: 1 42 | path: '/config.json' 43 | 44 | initialization: commonImg.initialization 45 | -------------------------------------------------------------------------------- /raspberrypicm4-ioboard.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | UNPACK_IMAGE = 'Unzip the image downloaded from the dashboard.' 5 | CM4IOB_WRITE_SD="If using a CM4 Lite: write the OS file you downloaded to your SD card. We recommend using Etcher. After flashing, insert the freshly burnt SD card into the IO Board" 6 | CM4IOB_WRITE_EMMC="If using a CM4 eMMC: fit jumper to disable eMMC boot on J2 and connect the IO Board's microUSB port to your PC. Power the board and use usbboot to put the eMMC in mass storage mode. Write the OS file you downloaded to mass storage device." 7 | CM4IOB_WRITE_BOOT="Disconnect the power source and eMMC boot jumper if using the CM4 eMMC. Connect the CM4 IO Board to the internet, then power it up." 8 | 9 | module.exports = 10 | version: 1 11 | slug: 'raspberrypicm4-ioboard' 12 | aliases: [ 'raspberrypicm4-ioboard' ] 13 | name: 'Raspberry Pi CM4 IO Board' 14 | arch: 'aarch64' 15 | state: 'new' 16 | 17 | instructions: [ 18 | UNPACK_IMAGE 19 | CM4IOB_WRITE_SD 20 | CM4IOB_WRITE_EMMC 21 | CM4IOB_WRITE_BOOT 22 | ] 23 | gettingStartedLink: 24 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypicm4-ioboard/nodejs/' 25 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypicm4-ioboard/nodejs/' 26 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypicm4-ioboard/nodejs/' 27 | 28 | options: [ networkOptions.group ] 29 | 30 | yocto: 31 | machine: 'raspberrypicm4-ioboard' 32 | image: 'balena-image' 33 | fstype: 'balenaos-img' 34 | version: 'yocto-kirkstone' 35 | deployArtifact: 'balena-image-raspberrypicm4-ioboard.balenaos-img' 36 | compressed: true 37 | 38 | configuration: 39 | config: 40 | partition: 41 | primary: 1 42 | path: '/config.json' 43 | 44 | initialization: commonImg.initialization 45 | -------------------------------------------------------------------------------- /repo.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: 'yocto-based OS image' 3 | reviewers: 1 4 | upstream: 5 | - repo: 'layers/meta-balena' 6 | url: 'http://github.com/balena-os/meta-balena' 7 | - repo: 'balena-yocto-scripts' 8 | url: 'http://github.com/balena-os/balena-yocto-scripts' 9 | - repo: 'contracts' 10 | url: 'https://github.com/balena-io/contracts.git' 11 | -------------------------------------------------------------------------------- /revpi-connect-4.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | REVPI_DEBUG = "While not having the Revolution Pi board powered, connect your system to the board's USB port via a micro-USB cable." 5 | REVPI_POWER = "Power on the Revolution Pi board." 6 | REVPI_WRITE = "Write the OS to the internal MMC storage device. We recommend using Etcher." 7 | REVPI_POWEROFF = "When flashing is complete, power off the board and unplug the micro-USB cable." 8 | 9 | module.exports = 10 | version: 1 11 | slug: 'revpi-connect-4' 12 | name: 'Revolution Pi Connect 4' 13 | arch: 'aarch64' 14 | state: 'new' 15 | 16 | instructions: [ 17 | REVPI_DEBUG 18 | REVPI_POWER 19 | REVPI_WRITE 20 | REVPI_POWEROFF 21 | instructions.CONNECT_AND_BOOT 22 | ] 23 | 24 | gettingStartedLink: 25 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 26 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 27 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 28 | 29 | options: [ networkOptions.group ] 30 | 31 | yocto: 32 | machine: 'revpi-connect-4' 33 | image: 'balena-image' 34 | fstype: 'balenaos-img' 35 | version: 'yocto-kirkstone' 36 | deployArtifact: 'balena-image-revpi-connect-4.balenaos-img' 37 | compressed: true 38 | 39 | configuration: 40 | config: 41 | partition: 42 | primary: 1 43 | path: '/config.json' 44 | 45 | initialization: commonImg.initialization 46 | -------------------------------------------------------------------------------- /revpi-connect-s.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | REVPI_DEBUG = "While not having the Revolution Pi board powered, connect your system to the board's USB port via a micro-USB cable." 5 | REVPI_POWER = "Power on the Revolution Pi board." 6 | REVPI_WRITE = "Write the OS to the internal MMC storage device. We recommend using Etcher." 7 | REVPI_POWEROFF = "When flashing is complete, power off the board and unplug the micro-USB cable." 8 | 9 | module.exports = 10 | version: 1 11 | slug: 'revpi-connect-s' 12 | name: 'Revolution Pi Connect S' 13 | arch: 'aarch64' 14 | state: 'new' 15 | 16 | instructions: [ 17 | REVPI_DEBUG 18 | REVPI_POWER 19 | REVPI_WRITE 20 | REVPI_POWEROFF 21 | instructions.CONNECT_AND_BOOT 22 | ] 23 | 24 | gettingStartedLink: 25 | windows: 'https://docs.resin.io/raspberrypi3/nodejs/getting-started/#adding-your-first-device' 26 | osx: 'https://docs.resin.io/raspberrypi3/nodejs/getting-started/#adding-your-first-device' 27 | linux: 'https://docs.resin.io/raspberrypi3/nodejs/getting-started/#adding-your-first-device' 28 | 29 | options: [ networkOptions.group ] 30 | 31 | yocto: 32 | machine: 'revpi-connect-s' 33 | image: 'balena-image' 34 | fstype: 'balenaos-img' 35 | version: 'yocto-kirkstone' 36 | deployArtifact: 'balena-image-revpi-connect-s.balenaos-img' 37 | compressed: true 38 | 39 | configuration: 40 | config: 41 | partition: 42 | primary: 1 43 | path: '/config.json' 44 | 45 | initialization: commonImg.initialization 46 | -------------------------------------------------------------------------------- /revpi-connect.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | REVPI_DEBUG = "While not having the Revolution Pi board powered, connect your system to the board's USB port via a micro-USB cable." 5 | REVPI_POWER = "Power on the Revolution Pi board." 6 | REVPI_WRITE = "Write the OS to the internal MMC storage device. We recommend using Etcher." 7 | REVPI_POWEROFF = "When flashing is complete, power off the board and unplug the micro-USB cable." 8 | 9 | module.exports = 10 | version: 1 11 | slug: 'revpi-connect' 12 | name: 'Revolution Pi Connect' 13 | arch: 'armv7hf' 14 | state: 'new' 15 | 16 | instructions: [ 17 | REVPI_DEBUG 18 | REVPI_POWER 19 | REVPI_WRITE 20 | REVPI_POWEROFF 21 | instructions.CONNECT_AND_BOOT 22 | ] 23 | 24 | gettingStartedLink: 25 | windows: 'https://docs.resin.io/raspberrypi3/nodejs/getting-started/#adding-your-first-device' 26 | osx: 'https://docs.resin.io/raspberrypi3/nodejs/getting-started/#adding-your-first-device' 27 | linux: 'https://docs.resin.io/raspberrypi3/nodejs/getting-started/#adding-your-first-device' 28 | 29 | options: [ networkOptions.group ] 30 | 31 | yocto: 32 | machine: 'revpi-connect' 33 | image: 'balena-image' 34 | fstype: 'balenaos-img' 35 | version: 'yocto-kirkstone' 36 | deployArtifact: 'balena-image-revpi-connect.balenaos-img' 37 | compressed: true 38 | 39 | configuration: 40 | config: 41 | partition: 42 | primary: 1 43 | path: '/config.json' 44 | 45 | initialization: commonImg.initialization 46 | -------------------------------------------------------------------------------- /revpi-core-3.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | REVPI_DEBUG = "While not having the Revolution Pi board powered, connect your system to the board's USB port via a micro-USB cable." 5 | REVPI_POWER = "Power on the Revolution Pi board." 6 | REVPI_WRITE = "Write the OS to the internal MMC storage device. We recommend using Etcher." 7 | REVPI_POWEROFF = "When flashing is complete, power off the board and unplug the micro-USB cable." 8 | 9 | module.exports = 10 | version: 1 11 | slug: 'revpi-core-3' 12 | aliases: [ 'revpi-core-3' ] 13 | name: 'Revolution Pi Core 3' 14 | arch: 'armv7hf' 15 | state: 'released' 16 | isDefault: true 17 | 18 | instructions: [ 19 | REVPI_DEBUG 20 | REVPI_POWER 21 | REVPI_WRITE 22 | REVPI_POWEROFF 23 | instructions.CONNECT_AND_BOOT 24 | ] 25 | 26 | gettingStartedLink: 27 | windows: 'https://docs.resin.io/raspberrypi3/nodejs/getting-started/#adding-your-first-device' 28 | osx: 'https://docs.resin.io/raspberrypi3/nodejs/getting-started/#adding-your-first-device' 29 | linux: 'https://docs.resin.io/raspberrypi3/nodejs/getting-started/#adding-your-first-device' 30 | 31 | options: [ networkOptions.group ] 32 | 33 | yocto: 34 | machine: 'revpi-core-3' 35 | image: 'balena-image' 36 | fstype: 'balenaos-img' 37 | version: 'yocto-kirkstone' 38 | deployArtifact: 'balena-image-revpi-core-3.balenaos-img' 39 | compressed: true 40 | 41 | configuration: 42 | config: 43 | partition: 44 | primary: 1 45 | path: '/config.json' 46 | 47 | initialization: commonImg.initialization 48 | -------------------------------------------------------------------------------- /rt-rpi-300.coffee: -------------------------------------------------------------------------------- 1 | deviceTypesCommon = require '@resin.io/device-types/common' 2 | { networkOptions, commonImg, instructions } = deviceTypesCommon 3 | 4 | module.exports = 5 | version: 1 6 | slug: 'rt-rpi-300' 7 | name: 'Rocktech-RPI-300' 8 | arch: 'aarch64' 9 | state: 'new' 10 | 11 | instructions: commonImg.instructions 12 | gettingStartedLink: 13 | windows: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 14 | osx: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 15 | linux: 'https://www.balena.io/docs/learn/getting-started/raspberrypi4/nodejs/' 16 | 17 | options: [ networkOptions.group ] 18 | 19 | yocto: 20 | machine: 'rt-rpi-300' 21 | image: 'balena-image' 22 | fstype: 'balenaos-img' 23 | version: 'yocto-kirkstone' 24 | deployArtifact: 'balena-image-rt-rpi-300.balenaos-img' 25 | compressed: true 26 | 27 | configuration: 28 | config: 29 | partition: 30 | primary: 1 31 | path: '/config.json' 32 | 33 | initialization: commonImg.initialization 34 | -------------------------------------------------------------------------------- /tests/boardtest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | git submodule update --init autohat 6 | cd autohat 7 | APPLICATION_NAME=`echo $testNode | tr '[:upper:]' '[:lower:]'` 8 | 9 | cat <start.sh 10 | #!/bin/sh 11 | cd /autohat 12 | robot --exitonerror --exitonfailure raspberrypi3.robot 13 | exit 0 14 | EOM 15 | chmod a+x start.sh 16 | 17 | docker build -t ${APPLICATION_NAME} . 18 | tar -xf ../../deploy/resin.img.tar.gz 19 | 20 | docker stop ${APPLICATION_NAME} || true 21 | docker rm ${APPLICATION_NAME} || true 22 | docker run -d -v `pwd`:/autohat --privileged \ 23 | --env INITSYSTEM=on \ 24 | --env RESINRC_RESIN_URL=${RESINRC_RESIN_URL} \ 25 | --env email=${RESIN_EMAIL} \ 26 | --env password=${RESIN_PASSWORD} \ 27 | --env device_type=${device_type} \ 28 | --env application_name=${APPLICATION_NAME} \ 29 | --env image=/autohat/resin.img \ 30 | --env rig_device_id=${rig_device_id} \ 31 | --env rig_sd_card=${rig_sd_card} \ 32 | --privileged \ 33 | --name=${APPLICATION_NAME} \ 34 | ${AUTOHAT_IMAGE} ${APPLICATION_NAME} 35 | 36 | docker exec -t ${APPLICATION_NAME} /autohat/start.sh 37 | docker stop ${APPLICATION_NAME} || true 38 | docker rm ${APPLICATION_NAME} || true 39 | --------------------------------------------------------------------------------