-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
torizon-common: Add beagleplay initial support
Signed-off-by: Matheus Castello <[email protected]>
- Loading branch information
1 parent
2a0cce6
commit 75d0a65
Showing
8 changed files
with
151 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# 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:beagleplay = "1" | ||
CORE_IMAGE_BASE_INSTALL:remove = "kernel-module-wireguard wireguard-tools" | ||
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-bb.org" | ||
PREFERRED_PROVIDER_virtual/bootloader:sota = "u-boot-bb.org" | ||
PREFERRED_PROVIDER_virtual/bootloader:beagleplay = "u-boot-bb.org" | ||
PREFERRED_PROVIDER_u-boot:beagleplay = "u-boot-bb.org" | ||
PREFERRED_PROVIDER_virtual/dtb = "" | ||
WKS_FILE_DEPENDS_BOOTLOADERS:beagleplay = "virtual/bootloader" | ||
WKS_FILE_DEPENDS:append:beagleplay = " u-boot-default-script" | ||
PREFERRED_PROVIDER_u-boot-default-script:beagleplay = "u-boot-distro-boot" | ||
PREFERRED_PROVIDER_u-boot-default-script:sota:beagleplay = "u-boot-distro-boot" | ||
|
||
PREFERRED_PROVIDER_u-boot-fw-utils = "libubootenv" | ||
PREFERRED_RPROVIDER_u-boot-fw-utils = "libubootenv" | ||
|
||
IMAGE_FSTYPES:remove:beagleplay = "ext3 jffs2 teziimg" | ||
|
||
# We need ota-ext4 and wic for beagle | ||
IMAGE_FSTYPES_REMOVE = "" | ||
IMAGE_BOOT_FILES:beagleplay = "u-boot.img tispl.bin tiboot3.bin ${@make_dtb_boot_files(d)} " | ||
IMAGE_BOOT_FILES:sota:beaglebone-yocto = "u-boot.img tispl.bin tiboot3.bin ${@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 " | ||
|
||
LINUX_VERSION_EXTENSION = "-torizon-${LINUX_KERNEL_TYPE}" | ||
|
||
## same bahavior | ||
# This boot arguments are the same from torizon.bbclass | ||
OSTREE_KERNEL_ARGS:sota:append:beagleplay = "console=ttyS2,115200 root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash " | ||
|
||
UBOOT_BINARY_OTA_IGNORE:beagleplay = "1" | ||
|
||
PREFERRED_PROVIDER_virtual/mesa = "mesa-pvr" | ||
PREFERRED_PROVIDER_virtual/egl = "mesa-pvr" | ||
PREFERRED_PROVIDER_virtual/libgles1 = "mesa-pvr" | ||
PREFERRED_PROVIDER_virtual/libgles2 = "mesa-pvr" | ||
PREFERRED_PROVIDER_virtual/libgles3 = "mesa-pvr" | ||
PREFERRED_PROVIDER_virtual/libgbm = "mesa-pvr" | ||
PREFERRED_PROVIDER_virtual/libglx = "mesa-pvr" | ||
PREFERRED_PROVIDER_virtual/libgl = "mesa-pvr" | ||
|
||
INITRAMFS_MAXSIZE = "315400" | ||
|
||
BBMASK += " \ | ||
meta-common-torizon/recipes-bsp/u-boot/u-boot-toradex \ | ||
meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend \ | ||
meta-common-torizon/recipes-bsp/u-boot/u-boot-toradex_%.bbappend \ | ||
" |
52 changes: 52 additions & 0 deletions
52
recipes-bsp/u-boot/u-boot-distro-boot/beagleplay/boot.cmd.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# SPDX-License-Identifier: GPL-2.0+ OR MIT | ||
# | ||
# Copyright 2023 MicroHobby | ||
# | ||
# TorizonCore boot script. | ||
|
||
setenv bootlimit 3 | ||
setenv devtype mmc | ||
setenv devnum 1 | ||
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 fdtfile "k3-am625-beagleplay.dtb" | ||
|
||
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=1 | ||
otaroot=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
# fix the wrong triple | ||
do_compile:prepend() { | ||
export CARGO_BUILD_TARGET="${RUST_HOST_SYS}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# CONFIG_REMOTEPROC is not set | ||
# CONFIG_PRU_REMOTEPROC is not set | ||
# CONFIG_TI_K3_DSP_REMOTEPROC is not set | ||
# CONFIG_TI_K3_R5_REMOTEPROC is not set | ||
# CONFIG_TI_K3_M4_REMOTEPROC is not set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
require common.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters