Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add beagleplay support take 4 build branch #686

Merged
merged 13 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions beagleplay.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
deviceTypesCommon = require '@resin.io/device-types/common'
{ networkOptions, commonImg, instructions } = deviceTypesCommon

BBB_FLASH = 'Power up the <%= TYPE_NAME %> after inserting the flasher image into the SDCard Slot.
The device will power down automatically after the flashing is complete. Remove the SDCard and restart the device.'

postProvisioningInstructions = [
instructions.BOARD_SHUTDOWN
instructions.REMOVE_INSTALL_MEDIA
instructions.BOARD_REPOWER
]

module.exports =
version: 1
slug: 'beagleplay'
aliases: [ 'beagleplay' ]
name: 'BeaglePlay'
arch: 'aarch64'
state: 'released'

stateInstructions:
postProvisioning: postProvisioningInstructions

instructions: [
instructions.ETCHER_SD
instructions.EJECT_SD
instructions.FLASHER_WARNING
BBB_FLASH
].concat(postProvisioningInstructions)

gettingStartedLink:
windows: 'https://docs.resin.io/beaglebone/nodejs/getting-started/#adding-your-first-device'
osx: 'https://docs.resin.io/beaglebone/nodejs/getting-started/#adding-your-first-device'
linux: 'https://docs.resin.io/beaglebone/nodejs/getting-started/#adding-your-first-device'

yocto:
machine: 'beagleplay'
image: 'balena-image-flasher'
fstype: 'balenaos-img'
version: 'yocto-kirkstone'
deployArtifact: 'balena-image-flasher-beagleplay.balenaos-img'
compressed: true

options: [ networkOptions.group ]

configuration:
config:
partition:
primary: 1
path: '/config.json'

initialization: commonImg.initialization
2 changes: 1 addition & 1 deletion layers/meta-balena
Submodule meta-balena updated 73 files
+34 −0 .github/workflows/bananapi-m1-plus.yml
+34 −0 .github/workflows/beaglebone-ai64.yml
+34 −0 .github/workflows/beaglebone-pocket.yml
+34 −0 .github/workflows/beaglebone.yml
+43 −0 .github/workflows/generic-aarch64.yml
+44 −0 .github/workflows/generic-amd64.yml
+44 −0 .github/workflows/genericx86-64-ext.yml
+36 −0 .github/workflows/genericx86-64.yml
+34 −0 .github/workflows/imx6ul-var-dart.yml
+34 −0 .github/workflows/imx7-var-som.yml
+34 −0 .github/workflows/iot-gate-imx8.yml
+34 −0 .github/workflows/iot-gate-imx8plus.yml
+34 −0 .github/workflows/jetson-agx-orin-devkit.yml
+34 −0 .github/workflows/jetson-nano.yml
+34 −0 .github/workflows/jetson-tx2.yml
+34 −0 .github/workflows/jetson-xavier.yml
+11 −10 .github/workflows/meta-balena-esr.yml
+34 −0 .github/workflows/nanopi-neo-air.yml
+34 −0 .github/workflows/nanopi-r2c.yml
+34 −0 .github/workflows/orangepi-plus2.yml
+34 −0 .github/workflows/owa5x.yml
+34 −0 .github/workflows/raspberrypi.yml
+34 −0 .github/workflows/raspberrypi2.yml
+36 −0 .github/workflows/raspberrypi3-64.yml
+36 −0 .github/workflows/raspberrypi3.yml
+36 −0 .github/workflows/raspberrypi4-64.yml
+34 −0 .github/workflows/revpi-connect-4.yml
+34 −0 .github/workflows/revpi-connect-s.yml
+34 −0 .github/workflows/revpi-connect.yml
+34 −0 .github/workflows/revpi-core-3.yml
+34 −0 .github/workflows/rockpi-4b-rk3399.yml
+34 −0 .github/workflows/surface-go.yml
+34 −0 .github/workflows/surface-pro-6.yml
+1 −1 .github/workflows/update-backports.yml
+34 −0 .github/workflows/var-som-mx6..yml
+3,244 −0 .versionbot/CHANGELOG.yml
+952 −0 CHANGELOG.md
+3 −3 contributing-device-support.md
+9 −0 meta-balena-common/classes/balena-bootloader.bbclass
+0 −83 meta-balena-common/classes/compress-kernel-modules.bbclass
+1 −1 meta-balena-common/classes/image-balena.bbclass
+4 −2 meta-balena-common/classes/image_types_balena.bbclass
+22 −4 meta-balena-common/classes/kernel-balena.bbclass
+4 −1 meta-balena-common/conf/distro/include/balena-os.inc
+281 −0 ...ipes-connectivity/modemmanager/balena-files/0002-quectel-disable-qmi-unsolicited-profile-manager-even.patch
+26 −0 ...ipes-connectivity/modemmanager/balena-files/0003-broadband-modem-qmi-quectel-fix-task-completion-when.patch
+2 −0 meta-balena-common/recipes-connectivity/modemmanager/modemmanager_%.bbappend
+46 −15 meta-balena-common/recipes-connectivity/networkmanager/balena-files/90shared
+1 −1 meta-balena-common/recipes-containers/balena-supervisor/balena-supervisor.inc
+30 −8 meta-balena-common/recipes-containers/balena/balena/balena-healthcheck
+3 −3 meta-balena-common/recipes-containers/mkfs-hostapp-native/mkfs-hostapp-native.bb
+7 −0 meta-balena-common/recipes-core/balena-rollback/files/rollback-health
+22 −13 meta-balena-common/recipes-core/initrdscripts/files/kexec
+22 −9 meta-balena-common/recipes-core/initrdscripts/files/migrate
+1 −0 meta-balena-common/recipes-kernel/kmod/kmod_%.bbappend
+2 −2 meta-balena-common/recipes-kernel/linux/kernel-headers-test.bb
+1 −1 meta-balena-common/recipes-kernel/peak/peak_8.17.0.bb
+0 −14 meta-balena-common/recipes-kernel/rtl8192cu/rtl8192cu_4.0.2_9000.bb
+5 −0 meta-balena-common/recipes-support/hostapp-update-hooks/files/0-signed-update
+3 −3 meta-balena-common/recipes-support/hostapp-update-hooks/files/95-secureboot/1-fwd_commit_apply-dbx
+37 −12 meta-balena-common/recipes-support/os-helpers/os-helpers/os-helpers-tpm2
+38 −7 meta-balena-common/recipes-support/resin-init/resin-init-flasher/resin-init-flasher
+1 −1 tests/leviathan
+32 −0 tests/suites/cloud/config.js
+33 −0 tests/suites/hup/config.js
+4 −5 tests/suites/hup/suite.js
+32 −0 tests/suites/os/config.js
+19 −14 tests/suites/os/suite.js
+86 −0 tests/suites/os/tests/iptables/index.js
+1 −1 tests/suites/os/tests/modem/index.js
+1 −1 tests/suites/os/tests/modem/modems.json
+10 −16 tests/suites/os/tests/safe-reboot/index.js
+319 −133 tests/suites/os/tests/secureboot/index.js
14 changes: 14 additions & 0 deletions layers/meta-balena-beaglebone/conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ UBOOT_CONFIG_FRAGMENTS:beaglebone-ai64-k3r5 = ""
KERNEL_IMAGETYPES:beaglebone-ai64 = "Image"
KERNEL_CLASSES:beaglebone-ai64 = "kernel-uimage"

MACHINE_FEATURES:remove:beagleplay = "efi"

PREFERRED_PROVIDER_virtual/bootloader:beagleplay = "u-boot-bb.org"
PREFERRED_PROVIDER_virtual/bootloader:beagleplay-k3r5 = "u-boot-bb.org"
PREFERRED_PROVIDER_u-boot:beagleplay = "u-boot-bb.org"
PREFERRED_PROVIDER_u-boot:beagleplay-k3r5 = "u-boot-bb.org"
PREFERRED_VERSION_u-boot-tools:beagleplay ?= "2022.01"
PREFERRED_VERSION_u-boot-tools:beagleplay-k3r5 ?= "2022.01"
PREFERRED_VERSION_u-boot-tools-native:beagleplay ?= "2022.01"
PREFERRED_VERSION_u-boot-tools-native:beagleplay-k3r5 ?= "2022.01"

PREFERRED_PROVIDER_virtual/kernel:beagleplay = "linux-bb.org"
PREFERRED_PROVIDER_virtual/kernel:beagleplay-k3r5 = "linux-bb.org"

LAYERSERIES_COMPAT_balena-beaglebone = " kirkstone "
MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove = "kernel-image-zimage"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove = "kernel-image-image"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#MACHINE ?= "beaglebone-green-gateway"
#MACHINE ?= "beaglebone-green-wifi"
#MACHINE ?= "beaglebone-pocket"
#MACHINE ?= "beagleplay"

# More info meta-resin/README.md
#TARGET_REPOSITORY ?= ""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 955cb9fb2302c5b2caff328b7516382f60295682 Mon Sep 17 00:00:00 2001
From: delhiryder <[email protected]>
Date: Mon, 20 Nov 2023 22:39:22 +0000
Subject: [PATCH] Added device tree fix (as suggested by Nishanth Menon) for
the wlcore/wl1271_sdio_mmc2 error messages

---
arch/arm/dts/k3-am625-beagleplay.dts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/k3-am625-beagleplay.dts b/arch/arm/dts/k3-am625-beagleplay.dts
index 0bc609fd00..f89188356a 100644
--- a/arch/arm/dts/k3-am625-beagleplay.dts
+++ b/arch/arm/dts/k3-am625-beagleplay.dts
@@ -108,7 +108,8 @@
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
enable-active-high;
- regulator-always-on;
+ /* regulator-always-on; */
+ regulator-off-in-suspend;
vin-supply = <&vdd_3v3>;
gpio = <&main_gpio0 38 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_BOOTCOMMAND="run set_led_state_start_load; setenv resin_kernel_load_addr ${kernel_addr_r}; run resin_set_kernel_root; run set_os_cmdline; setenv name_fdt k3-am625-beagleplay.dtb; setenv bootargs console=${console} ${optargs} ${resin_kernel_root} ${os_cmdline}; if load mmc ${resin_dev_index}:${resin_root_part} ${fdtaddr} boot/dtb/${name_fdt}; then run balena_fdt_load_crc_save; else false; fi; if load mmc ${resin_dev_index}:${resin_root_part} ${loadaddr} ${bootdir}/${name_kern}; then run balena_kernel_load_crc_save; else false; fi; run balena_fdt_load_crc_check; run balena_kernel_load_crc_check; run run_kern;"

Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,68 @@ FILESEXTRAPATHS:append := ":${THISDIR}/${PN}"

inherit resin-u-boot

SRC_URI += " \
SRC_URI:append:beaglebone-ai64 = " \
acostach marked this conversation as resolved.
Show resolved Hide resolved
file://integrate_with_balena_u-boot-environment.patch \
file://balenaos_bootcommand.cfg \
file://0005-env_default.h-Add-support-for-OS_KERNEL_CMDLINE.patch \
file://set_right_dtb_path.patch \
"

BALENA_DEVICE_FDT_ADDR_VAR = "fdtaddr"

UBOOT_MACHINE:beagleplay = "am62x_beagleplay_a53_defconfig"
UBOOT_MACHINE:beagleplay-k3r5 = "am62x_beagleplay_r5_defconfig"

# No need to use the UBOOT_CONFIG_FRAGMENTS from the meta-ti layer for the beagplay,
# since the 2024.04-BeaglePlay branch already has the necessary changes.
UBOOT_CONFIG_FRAGMENTS:beagleplay = ""
UBOOT_CONFIG_FRAGMENTS:beagleplay-k3r5 = ""

SRC_URI:append:beagleplay = " \
file://balenaos_bootcommand_beagleplay_emmc.cfg \
file://0001-Added-device-tree-fix-as-suggested-by-Nishanth-Menon.patch \
"

DEPENDS:append:beaglebone-ai64-k3r5 = " python3-yamllint-native python3-pathspec-native"

DEPENDS:append:beagleplay-k3r5 = " python3-yamllint-native python3-pathspec-native"


PV:beaglebone-ai64 = "2023.04"
PV:beaglebone-ai64-k3r5 = "2023.04"
BRANCH:beaglebone-ai64 = "v2023.04-ti-09.00.00.007"
SRCREV:beaglebone-ai64 = "354f64f67e5b36df0027dbfbf071503b0071f4ed"
BRANCH:beaglebone-ai64-k3r5 = "v2023.04-ti-09.00.00.007"
SRCREV:beaglebone-ai64-k3r5 = "354f64f67e5b36df0027dbfbf071503b0071f4ed"

PV:beagleplay = "2024.04"
PV:beagleplay-k3r5 = "2024.04"
BRANCH:beagleplay= "v2024.04-BeaglePlay"
BRANCH:beagleplay-k3r5= "v2024.04-BeaglePlay"
SRCREV:beagleplay = "881379e9e286d0b40d9f054a1d176cbbcfed835e"
SRCREV:beagleplay-k3r5 = "881379e9e286d0b40d9f054a1d176cbbcfed835e"
SPL_BINARY:beagleplay = "tispl.bin_unsigned"
SPL_BINARYNAME:beagleplay = "tispl.bin_unsigned"

# Generate an extlinux.conf file
UBOOT_EXTLINUX = "1"
UBOOT_EXTLINUX_ROOT = "root=/dev/mmcblk1p2"

UBOOT_EXTLINUX_KERNEL_ARGS = "rootwait rw rootfstype=ext4"
UBOOT_EXTLINUX_KERNEL_IMAGE = "../${KERNEL_IMAGETYPE}"
UBOOT_EXTLINUX_FDTDIR = "../"

# The BB-AI64 creates this file for both archs, remove one.
do_deploy:append:beaglebone-ai64-k3r5 () {
rm -vf ${DEPLOYDIR}/extra_uEnv.txt
}

# The Beagleplay *also* creates this file for both archs, remove one.
do_deploy:append:beagleplay-k3r5 () {
rm -vf ${DEPLOYDIR}/extra_uEnv.txt
}

do_install[nostamp] = "1"
do_compile[nostamp] = "1"
do_deploy[nostamp] = "1"
do_configure[nostamp] = "1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 018921ee79d3f30893614b3b2b63b588d8544f73 Mon Sep 17 00:00:00 2001
From: Peter Robinson <[email protected]>
Date: Thu, 30 Jan 2020 09:37:15 +0000
Subject: [PATCH] Remove redundant YYLOC global declaration

Same as the upstream fix for building dtc with gcc 10.

Signed-off-by: Peter Robinson <[email protected]>
---
scripts/dtc/dtc-lexer.l | 1 -
1 file changed, 1 deletion(-)

diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
index fd825ebba6..24af549977 100644
--- a/scripts/dtc/dtc-lexer.l
+++ b/scripts/dtc/dtc-lexer.l
@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n
#include "srcpos.h"
#include "dtc-parser.tab.h"

-YYLTYPE yylloc;
extern bool treesource_error;

/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
--
2.26.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
inherit resin-u-boot

FILESEXTRAPATHS:append := ":${THISDIR}/${PN}"

SRC_URI += " \
file://remove-redundant-yyloc-global.patch \
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SRC_URI:aarch64 = "git://git.beagleboard.org/beagleboard/18xx-ti-utils.git;protocol=https;branch=R8.7_SP3-bbb.io"
SRCREV:aarch64 = "ba027b093aa013637fcc6271c2d47f3ce99e933e"

do_install:append:aarch64() {
install -m 0755 device-20221220-wl18xx-conf.bin ${D}${sbindir}/wlconf/
install -m 0755 device-20221220-wl18xx-conf.bin ${D}${nonarch_base_libdir}/firmware/ti-connectivity/wl18xx-conf.bin
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
include balena-image.inc

BALENA_BOOT_PARTITION_FILES:append:beaglebone = " uEnv.txt_internal:"

IMAGE_INSTALL:append:beaglebone = " bb-org-overlays"
IMAGE_INSTALL:append:beaglebone-ai64 = " mmc-utils vxd-dec-fw"
IMAGE_INSTALL:append:beagleplay = " mmc-utils"

# Enable verbose output and use the specific
# disk geometry expected by beagleplay boot firmware
# to be able to load u-boot from the SD-CARD. The default
# mkfs.vfat setting is 16 heads / 63 sectors per track
# when creating the filesystem on a file, and that prevents
# the beagleplay from loading uboot from the sd.
DEVICE_SPECIFIC_BOOTFS_OPTS:beagleplay = "-v -g 16/32"
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
# on the initramfs.
IMAGE_ROOTFS_MAXSIZE:beaglebone-ai64 = "65536"
PACKAGE_INSTALL:append:beaglebone-ai64 = " cadence-mhdp-fw"
IMAGE_ROOTFS_MAXSIZE:beagleplay = "65536"
IMAGE_ROOTFS_MAXSIZE:beagleplay-k3r5 = "65536"
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ IMAGE_ROOTFS_SIZE:beaglebone-ai64 = "733184"
IMAGE_INSTALL:append:beaglebone = " bb-org-overlays fix-mmc-bbb bb-wl18xx-bluetooth bb-wl18xx-wlan0"
IMAGE_INSTALL:append:beaglebone-ai64 = " mmc-utils vxd-dec-fw"
IMAGE_INSTALL:append:beaglebone-pocket = " boot-scripts"
IMAGE_INSTALL:append:beagleplay = " mmc-utils "

IMAGE_ROOTFS_SIZE:beagleplay = "733184"
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ BALENA_BOOT_PARTITION_FILES:beagleboard-xm = " \
u-boot.img: \
"

BALENA_BOOT_PARTITION_FILES:beagleplay = " \
tispl.bin_unsigned:/tispl.bin \
u-boot.img: \
tiboot3.bin: \
"

# Beaglebone expects the kernel and dtbs on rootfs
IMAGE_INSTALL:append = " kernel-image-initramfs kernel-devicetree wlconf"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Manager]
RuntimeWatchdogSec=0
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FILESEXTRAPATHS:append := ":${THISDIR}/${PN}"
Copy link
Contributor

@acostach acostach Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should leave a note here too on the reason for disabling the watchdog

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have already added a line to the commit message: fc7769e (reproduced below):

"Also, disabled the hardware watchdog (due an ongoing open issue, whose fix is currently being tested). Add the "test_watchdog" package to the kernel package (for easy verification of the patch, when it become available)."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't hurt to leave a comment in the file because it's quicker for someone investigating a problem and looking at this file on a remote device to understand the reason behind the configuration. Otherwise he would have to go find the device integration repository, search for the yocto package as well as for the layer which provides/modifies it then look in the git history for it, to finally understand why. cc @floion


SRC_URI:append = " \
file://watchdog-disable.conf \
"

do_install:append() {
# enable watchdog
install -d -m 0755 ${D}/${sysconfdir}/systemd/system.conf.d
install -m 0644 ${WORKDIR}/watchdog-disable.conf ${D}/${sysconfdir}/systemd/system.conf.d/watchdog.conf
}







Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

PACKAGECONFIG:append:aarch64 = " watchdog"
TEST_LIST:append:aarch64 = "\
watchdog \
"

CFLAGS:append:aarch64 = " -static"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 1920d52d6f37b57d43f9adf533fd40045fe3132b Mon Sep 17 00:00:00 2001
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch is not being applied and also tested that without it the wifi does not have issues so it can be deleted from here @delhiryder

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK @floion

From: delhiryder <[email protected]>
Date: Tue, 21 Nov 2023 01:41:09 +0000
Subject: [PATCH] Changed the behavior of the wlan_en (regulator-3) to
'regulator-off-in-suspend'. Fix for the wlcore/wl1271_sdio_mmc2 errors.

---
arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts b/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts
index eda9b77f49ac..0f6ef0693105 100644
--- a/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts
+++ b/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts
@@ -140,7 +140,8 @@ wlan_en: regulator-3 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
enable-active-high;
- regulator-always-on;
+ /* regulator-always-on; */
+ regulator-off-in-suspend;
vin-supply = <&vdd_3v3>;
gpio = <&main_gpio0 38 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
inherit kernel-balena

PV:aarch64 = "6.1.80+git${SRCPV}"
SRCREV:aarch64 = "6.1.80-ti-arm64-r58"
TAG:aarch64 = "6.1.80-ti-arm64-r58"
SRC_URI:aarch64 = " \
git://github.com/beagleboard/linux.git;protocol=https;nobranch=1;tag=${TAG} \
file://defconfig \
"
# SRC_URI:aarch64 = "https://github.com/beagleboard/linux/archive/refs/tags/6.1.80-ti-rt-arm64-r58.tar.gz;protocol=https"
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

#
# Script used by hostapps updater to flash bootloader onto internal media.
#

set -o errexit

# The following lines of code are copied from
# https://openbeagle.org/beagleboard/repos-arm64/-/blob/main/bb-u-boot-beagleplay-debian-12/suite/bookworm/debian/install-emmc.sh?ref_type=heads

if [ -b /dev/mmcblk0 ] ; then
#mmc extcsd read /dev/mmcblk0
mmc bootpart enable 1 2 /dev/mmcblk0
mmc bootbus set single_backward x1 x8 /dev/mmcblk0
mmc hwreset enable /dev/mmcblk0 | true

echo "Clearing eMMC boot0"

echo '0' >> /sys/class/block/mmcblk0boot0/force_ro

echo "dd if=/dev/zero of=/dev/mmcblk0boot0 count=32 bs=128k"
dd if=/dev/zero of=/dev/mmcblk0boot0 count=32 bs=128k

echo "dd if=/resin-boot/tiboot3.bin of=/dev/mmcblk0boot0 bs=128k"
dd if=/resin-boot/tiboot3.bin of=/dev/mmcblk0boot0 bs=128k
fi

sync

echo 1 > /sys/block/mmcblk0boot0/force_ro
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ FILESEXTRAPATHS:append := ":${THISDIR}/files"

HOSTAPP_HOOKS += "99-resin-uboot"

HOSTAPP_HOOKS:append:beaglebone-ai64 = " 99-flash-bootloader-beaglebone-ai64"
HOSTAPP_HOOKS:append:beaglebone-ai64 = " 99-flash-bootloader-beaglebone-ai64"
HOSTAPP_HOOKS:append:beagleplay = " 99-flash-bootloader-beagleplay"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ INTERNAL_DEVICE_KERNEL:beaglebone = "mmcblk1"
# Except on the beaglebone-ai64
INTERNAL_DEVICE_KERNEL:beaglebone-ai64 = "mmcblk0"

# Because eMMC enumeration on the beagpleplay is different from other Beaglebone devices (?)
INTERNAL_DEVICE_KERNEL:beagleplay = "mmcblk0"

# the name of the bootloader config file to be written to internal media
INTERNAL_DEVICE_BOOTLOADER_CONFIG:beaglebone = "uEnv.txt_internal"

Expand Down