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

Additional BBB variants #52

Open
wants to merge 4 commits into
base: kirkstone
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions conf/machine/include/beaglebone-yocto.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Settings for the meta-yocto-bsp beaglebone-yocto machine.

# taken from meta-freescale/conf/machine/include/utilities.inc
def make_dtb_boot_files(d):
# Generate IMAGE_BOOT_FILES entries for device tree files listed in
Expand Down Expand Up @@ -25,7 +27,9 @@ WKS_FILE_DEPENDS:remove = "tezi-metadata virtual/dtb"
CORE_IMAGE_BASE_INSTALL:append = "resize-helper"

# beaglebone
KERNEL_DEVICETREE:append:beaglebone-yocto = " am335x-boneblack-wireless.dtb am335x-pocketbeagle.dtb "
KERNEL_BUILTIN_WIREGUARD:beaglebone-yocto = "1"
IMAGE_INSTALL:append:beaglebone-yocto = " linux-firmware-wl18xx ti-18xx-wlconf "
CORE_IMAGE_BASE_INSTALL:remove = "kernel-module-wireguard wireguard-tools"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot"
PREFERRED_PROVIDER_virtual/bootloader:sota = "u-boot"
Expand Down
70 changes: 70 additions & 0 deletions conf/machine/include/beaglebone.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Settings for the meta-ti-bsp beaglebone machine.

# taken from meta-freescale/conf/machine/include/utilities.inc
def make_dtb_boot_files(d):
# Generate IMAGE_BOOT_FILES entries for device tree files listed in
# KERNEL_DEVICETREE.
# Use only the basename for dtb files:
alldtbs = d.getVar('KERNEL_DEVICETREE')


# DTBs may be built out of kernel with devicetree.bbclass
if not alldtbs:
return ''

def transform(dtb):
if not (dtb.endswith('dtb') or dtb.endswith('dtbo')):
# eg: whatever/bcm2708-rpi-b.dtb has:
# DEPLOYDIR file: bcm2708-rpi-b.dtb
# destination: bcm2708-rpi-b.dtb
bb.error("KERNEL_DEVICETREE entry %s is not a .dtb or .dtbo file." % (dtb) )
return os.path.basename(dtb)

return ' '.join([transform(dtb) for dtb in alldtbs.split() if dtb])

WKS_FILE = "sdimage-2part.wks"
WKS_FILE_DEPENDS:remove = "tezi-metadata virtual/dtb"
CORE_IMAGE_BASE_INSTALL:append = "resize-helper"

KERNEL_BUILTIN_WIREGUARD:beaglebone = "1"
CORE_IMAGE_BASE_INSTALL:remove = "kernel-module-wireguard wireguard-tools"
IMAGE_INSTALL:append:beaglebone = " wl18xx-fw wlconf linux-firmware-wlcommon"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-bb.org"
PREFERRED_PROVIDER_virtual/bootloader:sota = "u-boot-bb.org"
PREFERRED_PROVIDER_virtual/bootloader:beaglebone = "u-boot-bb.org"
PREFERRED_PROVIDER_u-boot:beaglebone = "u-boot-bb.org"
PREFERRED_PROVIDER_virtual/dtb = ""
WKS_FILE_DEPENDS_BOOTLOADERS:beaglebone = "virtual/bootloader"
WKS_FILE_DEPENDS:append:beaglebone = " u-boot-default-script"
PREFERRED_PROVIDER_u-boot-default-script:beaglebone = "u-boot-distro-boot"
PREFERRED_PROVIDER_u-boot-default-script:sota:beaglebone = "u-boot-distro-boot"

PREFERRED_PROVIDER_u-boot-fw-utils = "libubootenv"
PREFERRED_RPROVIDER_u-boot-fw-utils = "libubootenv"

IMAGE_FSTYPES:remove:beaglebone = "ext3 jffs2 teziimg"

# We need ota-ext4 and wic for beagle
IMAGE_FSTYPES_REMOVE = ""
IMAGE_BOOT_FILES:beaglebone = "u-boot.img MLO ${@make_dtb_boot_files(d)} boot.scr uEnv.txt "
IMAGE_BOOT_FILES:sota:beaglebone = "u-boot.img MLO ${@make_dtb_boot_files(d)} "
IMAGE_BOOT_FILES_REMOVE:sota:remove = "boot.scr-${MACHINE};boot.scr"
IMAGE_BOOT_FILES:append = " boot.scr-${MACHINE};boot.scr "

OSTREE_KERNEL:beaglebone = "zImage"
OSTREE_DEPLOY_DEVICETREE:beaglebone = "0"
KERNEL_IMAGETYPE:beaglebone = "zImage"
KERNEL_IMAGETYPE:sota:beaglebone = "zImage"

LINUX_VERSION_EXTENSION = "-torizon-${LINUX_KERNEL_TYPE}"

## same bahavior
# This boot arguments are the same from torizon.bbclass
OSTREE_KERNEL_ARGS:sota:append:beaglebone = "console=ttyS0,115200 root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash "

UBOOT_BINARY_OTA_IGNORE:beaglebone = "1"

BBMASK += " \
meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend \
meta-common-torizon/recipes-bsp/u-boot/u-boot-toradex-ti_%.bbappend \
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From ec6a81275eb34ec46bff08f81961da4f2384deef Mon Sep 17 00:00:00 2001
From: Trevor Woerner <[email protected]>
Date: Wed, 30 Aug 2023 10:35:40 -0400
Subject: [PATCH] ARM: dts: am335x-pocketbeagle: choose tick-timer

Commit 4b2be78ab66c ("time: Fix get_ticks being non-monotonic")
requires '/chosen/tick-timer' in device-tree. Otherwise we get:

U-Boot 2023.07.02 (Jul 11 2023 - 15:20:44 +0000)

CPU : AM335X-GP rev 2.1
Model: TI AM335x PocketBeagle
DRAM: 512 MiB
Core: 154 devices, 16 uclasses, devicetree: separate
Could not initialize timer (err -19)

resetting ...

Upstream-Status: Submitted
Suggested-by: Pierre Lebleu <[email protected]>
Signed-off-by: Trevor Woerner <[email protected]>
---
arch/arm/dts/am335x-pocketbeagle.dts | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/am335x-pocketbeagle.dts b/arch/arm/dts/am335x-pocketbeagle.dts
index b379e3a5570d..9a9ab940e20c 100644
--- a/arch/arm/dts/am335x-pocketbeagle.dts
+++ b/arch/arm/dts/am335x-pocketbeagle.dts
@@ -15,6 +15,7 @@

chosen {
stdout-path = &uart0;
+ tick-timer = &timer2;
};

leds {
--
2.41.0.327.gaa9166bcc0ba

5 changes: 5 additions & 0 deletions recipes-bsp/u-boot/u-boot-bb.org_git.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot-bb.org:"

SRC_URI:append:beaglebone = " \
file://0001-ARM-dts-am335x-pocketbeagle-choose-tick-timer.patch \
"
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi

# save default U-Boot devicetree file to use in a rollback situation
env set fdtfile2 "${fdtfile}"
env set fdtfile "am335x-boneblack.dtb"
run findfdt

if test -n "${loadaddr}"
then
Expand Down
53 changes: 53 additions & 0 deletions recipes-bsp/u-boot/u-boot-distro-boot/beaglebone/boot.cmd.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# SPDX-License-Identifier: GPL-2.0+ OR MIT
#
# Copyright 2023 MicroHobby
#
# TorizonCore boot script.

setenv bootlimit 3
setenv devtype mmc
setenv devnum 0
setenv bootdevice 0
setenv otaroot 2

if test -z "${altbootcmd}"
then
env set altbootcmd 'env set rollback 1; run bootcmd'
env save
fi

if test "${rollback}" = "1" && test "${upgrade_available}" = "1"
then
# Make sure to reset upgrade_available to avoid unnecessary wear
# Note this also makes rollback permanent. aktualizr will reset rollback
# when a new (hopefully better) update comes in.
env set upgrade_available 0
env save
fi

# save default U-Boot devicetree file to use in a rollback situation
env set fdtfile2 "${fdtfile}"
run findfdt

if test -n "${loadaddr}"
then
ext4load ${devtype} ${devnum}:${otaroot} ${loadaddr} /boot/loader/uEnv.txt; env import -t ${loadaddr} ${filesize}
else
ext4load ${devtype} ${devnum}:${otaroot} ${scriptaddr} /boot/loader/uEnv.txt; env import -t ${scriptaddr} ${filesize}
fi

if test "${debug}" = "1"
then
echo "Enabling kernel debug"
env set tdxargs "${tdxargs} rodata=off nokaslr maxcpus=1 kgdboc=ttymxc0,115200"
fi

# now that we have all the environment variables, we can set the bootcmd
setenv bootargs "${defargs} ${bootargs} ${tdxargs}"

ext4load ${devtype} ${devnum}:${otaroot} ${kernel_addr_r} /boot${kernel_image}
ext4load ${devtype} ${devnum}:${otaroot} ${ramdisk_addr_r} /boot${ramdisk_image}
env set ramdisk_size ${filesize}
load ${devtype} ${devnum}:1 ${fdt_addr_r} ${fdtfile}

@@KERNEL_BOOTCMD@@ ${kernel_addr_r} ${ramdisk_addr_r}:${ramdisk_size} ${fdt_addr_r}
6 changes: 6 additions & 0 deletions recipes-bsp/u-boot/u-boot-distro-boot/beaglebone/uEnv.txt.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kernel_image_type=@@KERNEL_IMAGETYPE@@
overlays_file="overlays.txt"
bootlimit=3
devtype=mmc
devnum=0
otaroot=2
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From ec6a81275eb34ec46bff08f81961da4f2384deef Mon Sep 17 00:00:00 2001
From: Trevor Woerner <[email protected]>
Date: Wed, 30 Aug 2023 10:35:40 -0400
Subject: [PATCH] ARM: dts: am335x-pocketbeagle: choose tick-timer

Commit 4b2be78ab66c ("time: Fix get_ticks being non-monotonic")
requires '/chosen/tick-timer' in device-tree. Otherwise we get:

U-Boot 2023.07.02 (Jul 11 2023 - 15:20:44 +0000)

CPU : AM335X-GP rev 2.1
Model: TI AM335x PocketBeagle
DRAM: 512 MiB
Core: 154 devices, 16 uclasses, devicetree: separate
Could not initialize timer (err -19)

resetting ...

Upstream-Status: Submitted
Suggested-by: Pierre Lebleu <[email protected]>
Signed-off-by: Trevor Woerner <[email protected]>
---
arch/arm/dts/am335x-pocketbeagle.dts | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/am335x-pocketbeagle.dts b/arch/arm/dts/am335x-pocketbeagle.dts
index b379e3a5570d..9a9ab940e20c 100644
--- a/arch/arm/dts/am335x-pocketbeagle.dts
+++ b/arch/arm/dts/am335x-pocketbeagle.dts
@@ -15,6 +15,7 @@

chosen {
stdout-path = &uart0;
+ tick-timer = &timer2;
};

leds {
--
2.41.0.327.gaa9166bcc0ba

4 changes: 4 additions & 0 deletions recipes-bsp/u-boot/u-boot_%.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:"
SRC_URI:append:rpi = " file://0001-rpi-always-set-fdt_addr-with-firmware-provided-FDT-address.patch"

DEPENDS:append:rpi = " u-boot-default-script"

SRC_URI:append:beaglebone-yocto = " \
file://0001-ARM-dts-am335x-pocketbeagle-choose-tick-timer.patch \
"
40 changes: 40 additions & 0 deletions recipes-connectivity/ti-18xx-wlconf/ti-18xx-wlconf_8.7.3.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
SUMMARY = "Configuration utility for TI wireless drivers"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://README;beginline=1;endline=21;md5=adc05a1903d3f107f85c90328e3a9438"

# Tag: R8.7_SP3 (8.7.3)
SRCREV = "5048b59a444ac59ba7171d6e122d5a84581aebf2"
SRC_URI = "git://git.ti.com/wilink8-wlan/18xx-ti-utils.git;branch=master"

S = "${WORKDIR}/git/wlconf"

EXTRA_OEMAKE = "CC="${CC}""

do_install() {
install -d ${D}${sbindir}
install -d ${D}${sbindir}/wlconf/
install -d ${D}${sbindir}/wlconf/official_inis
install -d ${D}${nonarch_base_libdir}/firmware/ti-connectivity

install -m 0755 wlconf ${D}${sbindir}/wlconf/
install -m 0755 dictionary.txt ${D}${sbindir}/wlconf/
install -m 0755 struct.bin ${D}${sbindir}/wlconf/
install -m 0755 default.conf ${D}${sbindir}/wlconf/
install -m 0755 wl18xx-conf-default.bin ${D}${sbindir}/wlconf/
install -m 0755 wl18xx-conf-default.bin ${D}${nonarch_base_libdir}/firmware/ti-connectivity/wl18xx-conf.bin
install -m 0755 README ${D}${sbindir}/wlconf/
install -m 0755 example.conf ${D}${sbindir}/wlconf/
install -m 0755 example.ini ${D}${sbindir}/wlconf/
install -m 0755 configure-device.sh ${D}${sbindir}/wlconf/
install -m 0755 ${S}/official_inis/* \
${D}${sbindir}/wlconf/official_inis/
}

FILES:${PN} += " \
${sbindir}/wlconf \
${sbindir}/wlconf/official_inis \
${nonarch_base_libdir}/firmware/ti-connectivity/wl18xx-conf.bin \
"

FILES:${PN}-dbg += "${sbindir}/wlconf/.debug"

2 changes: 1 addition & 1 deletion recipes-extended/ostree/ostree-torizon.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def is_ti(d):

def get_deps(d):
# NOTE: beagleplay is TI but does not use the Toradex BSP
if is_ti(d) and ('beagleplay' not in d.getVar('MACHINE')) : # TI
if is_ti(d) and ('beagleplay' not in d.getVar('MACHINE')) and ('beaglebone' not in d.getVar('MACHINE')) : # TI
return 'u-boot-toradex-ti' if d.getVar('PREFERRED_PROVIDER_u-boot') else ''
else: # NXP/x86 generic/QEMU
return 'u-boot-default-script' if d.getVar('PREFERRED_PROVIDER_u-boot-default-script') else ''
Expand Down
14 changes: 14 additions & 0 deletions recipes-kernel/linux-firmware/linux-firmware_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Support additional firmware for WiLink8 modules
# TIInit_11.8.32.bts is required for bluetooth support but this particular
# version is not available in the linux-firmware repository.
#
SRC_URI:append:beaglebone = "\
https://git.ti.com/ti-bt/service-packs/blobs/raw/5f73abe7c03631bb2596af27e41a94abcc70b009/initscripts/TIInit_11.8.32.bts;name=TIInit_11.8.32 \
"
SRC_URI[TIInit_11.8.32.sha256sum] = "26ab0608e39fab95a6a55070c2f8364c92aad34442e8349abda71cee4da3277a"

do_install:append:beaglebone() {
cp ${WORKDIR}/TIInit_11.8.32.bts ${D}${nonarch_base_libdir}/firmware/ti-connectivity/
}

PACKAGE_ARCH:beaglebone = "${MACHINE_ARCH}"
2 changes: 2 additions & 0 deletions recipes-kernel/linux/files/beaglebone-yocto.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ CONFIG_SND_SOC_TI_EDMA_PCM=y
CONFIG_SND_SOC_TI_SDMA_PCM=y
CONFIG_SND_SOC_TI_UDMA_PCM=y
CONFIG_SND_SOC_HDMI_CODEC=y
CONFIG_WL18XX=m
CONFIG_WLCORE_SDIO=m
13 changes: 13 additions & 0 deletions recipes-kernel/linux/files/beaglebone.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_PCM=y
CONFIG_SND_SOC=y
CONFIG_SND_SIMPLE_CARD_UTILS=y
CONFIG_SND_SIMPLE_CARD=y
CONFIG_SND_SOC_DAVINCI_MCASP=y
CONFIG_SND_SOC_TI_EDMA_PCM=y
CONFIG_SND_SOC_TI_SDMA_PCM=y
CONFIG_SND_SOC_TI_UDMA_PCM=y
CONFIG_SND_SOC_HDMI_CODEC=y
CONFIG_WL18XX=m
CONFIG_WLCORE_SDIO=m
Loading