From cca62a0dec6ac5fe7a4be40287312dbbfac6ee37 Mon Sep 17 00:00:00 2001 From: Drew Moseley Date: Fri, 18 Oct 2024 14:10:46 -0400 Subject: [PATCH 1/4] beaglebone: Support other BBB variants. Signed-off-by: Drew Moseley --- conf/machine/include/beaglebone-yocto.inc | 2 ++ .../u-boot/u-boot-distro-boot/beaglebone-yocto/boot.cmd.in | 2 +- recipes-kernel/linux/files/beaglebone-yocto.cfg | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/machine/include/beaglebone-yocto.inc b/conf/machine/include/beaglebone-yocto.inc index be26c6fc..51321ccc 100644 --- a/conf/machine/include/beaglebone-yocto.inc +++ b/conf/machine/include/beaglebone-yocto.inc @@ -25,7 +25,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 " CORE_IMAGE_BASE_INSTALL:remove = "kernel-module-wireguard wireguard-tools" PREFERRED_PROVIDER_virtual/bootloader = "u-boot" PREFERRED_PROVIDER_virtual/bootloader:sota = "u-boot" diff --git a/recipes-bsp/u-boot/u-boot-distro-boot/beaglebone-yocto/boot.cmd.in b/recipes-bsp/u-boot/u-boot-distro-boot/beaglebone-yocto/boot.cmd.in index c8aabfbb..50894f7b 100644 --- a/recipes-bsp/u-boot/u-boot-distro-boot/beaglebone-yocto/boot.cmd.in +++ b/recipes-bsp/u-boot/u-boot-distro-boot/beaglebone-yocto/boot.cmd.in @@ -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 diff --git a/recipes-kernel/linux/files/beaglebone-yocto.cfg b/recipes-kernel/linux/files/beaglebone-yocto.cfg index a1fb79a8..696ef2e0 100644 --- a/recipes-kernel/linux/files/beaglebone-yocto.cfg +++ b/recipes-kernel/linux/files/beaglebone-yocto.cfg @@ -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 From 1dcfb8c4c1551280c77c33e05453c63af4a64a43 Mon Sep 17 00:00:00 2001 From: Drew Moseley Date: Sun, 10 Nov 2024 13:59:28 -0500 Subject: [PATCH 2/4] beaglebone-wireless: Add TI wlconf configuration utility. This is needed on the bbb-wireles to avoid firmware load errors Signed-off-by: Drew Moseley --- conf/machine/include/beaglebone-yocto.inc | 2 +- .../ti-18xx-wlconf/ti-18xx-wlconf_8.7.3.bb | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 recipes-connectivity/ti-18xx-wlconf/ti-18xx-wlconf_8.7.3.bb diff --git a/conf/machine/include/beaglebone-yocto.inc b/conf/machine/include/beaglebone-yocto.inc index 51321ccc..be83f461 100644 --- a/conf/machine/include/beaglebone-yocto.inc +++ b/conf/machine/include/beaglebone-yocto.inc @@ -27,7 +27,7 @@ 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 " +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" diff --git a/recipes-connectivity/ti-18xx-wlconf/ti-18xx-wlconf_8.7.3.bb b/recipes-connectivity/ti-18xx-wlconf/ti-18xx-wlconf_8.7.3.bb new file mode 100644 index 00000000..f9d64cf2 --- /dev/null +++ b/recipes-connectivity/ti-18xx-wlconf/ti-18xx-wlconf_8.7.3.bb @@ -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" + From 527147f76dc1961e1a8fc15c26c7af02b35fc09a Mon Sep 17 00:00:00 2001 From: Drew Moseley Date: Thu, 7 Nov 2024 20:23:48 -0500 Subject: [PATCH 3/4] beaglebone: Support meta-ti BSP. Signed-off-by: Drew Moseley --- conf/machine/include/beaglebone-yocto.inc | 2 + conf/machine/include/beaglebone.inc | 70 +++++++++ .../u-boot-distro-boot/beaglebone/boot.cmd.in | 53 +++++++ .../u-boot-distro-boot/beaglebone/uEnv.txt.in | 6 + recipes-extended/ostree/ostree-torizon.inc | 2 +- .../linux-firmware/linux-firmware_%.bbappend | 14 ++ recipes-kernel/linux/files/beaglebone.cfg | 13 ++ .../beaglebone/am335x-boneblack-hdmi.dtsi | 141 ++++++++++++++++++ scripts/setup-environment-internal | 2 +- 9 files changed, 301 insertions(+), 2 deletions(-) create mode 100644 conf/machine/include/beaglebone.inc create mode 100644 recipes-bsp/u-boot/u-boot-distro-boot/beaglebone/boot.cmd.in create mode 100644 recipes-bsp/u-boot/u-boot-distro-boot/beaglebone/uEnv.txt.in create mode 100644 recipes-kernel/linux-firmware/linux-firmware_%.bbappend create mode 100644 recipes-kernel/linux/files/beaglebone.cfg create mode 100644 recipes-kernel/linux/files/beaglebone/am335x-boneblack-hdmi.dtsi diff --git a/conf/machine/include/beaglebone-yocto.inc b/conf/machine/include/beaglebone-yocto.inc index be83f461..17218057 100644 --- a/conf/machine/include/beaglebone-yocto.inc +++ b/conf/machine/include/beaglebone-yocto.inc @@ -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 diff --git a/conf/machine/include/beaglebone.inc b/conf/machine/include/beaglebone.inc new file mode 100644 index 00000000..7c9e7514 --- /dev/null +++ b/conf/machine/include/beaglebone.inc @@ -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 \ +" diff --git a/recipes-bsp/u-boot/u-boot-distro-boot/beaglebone/boot.cmd.in b/recipes-bsp/u-boot/u-boot-distro-boot/beaglebone/boot.cmd.in new file mode 100644 index 00000000..50894f7b --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-distro-boot/beaglebone/boot.cmd.in @@ -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} diff --git a/recipes-bsp/u-boot/u-boot-distro-boot/beaglebone/uEnv.txt.in b/recipes-bsp/u-boot/u-boot-distro-boot/beaglebone/uEnv.txt.in new file mode 100644 index 00000000..ccbe6963 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-distro-boot/beaglebone/uEnv.txt.in @@ -0,0 +1,6 @@ +kernel_image_type=@@KERNEL_IMAGETYPE@@ +overlays_file="overlays.txt" +bootlimit=3 +devtype=mmc +devnum=0 +otaroot=2 diff --git a/recipes-extended/ostree/ostree-torizon.inc b/recipes-extended/ostree/ostree-torizon.inc index 855833fd..e5f5375e 100644 --- a/recipes-extended/ostree/ostree-torizon.inc +++ b/recipes-extended/ostree/ostree-torizon.inc @@ -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 '' diff --git a/recipes-kernel/linux-firmware/linux-firmware_%.bbappend b/recipes-kernel/linux-firmware/linux-firmware_%.bbappend new file mode 100644 index 00000000..b8433a7d --- /dev/null +++ b/recipes-kernel/linux-firmware/linux-firmware_%.bbappend @@ -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}" diff --git a/recipes-kernel/linux/files/beaglebone.cfg b/recipes-kernel/linux/files/beaglebone.cfg new file mode 100644 index 00000000..696ef2e0 --- /dev/null +++ b/recipes-kernel/linux/files/beaglebone.cfg @@ -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 diff --git a/recipes-kernel/linux/files/beaglebone/am335x-boneblack-hdmi.dtsi b/recipes-kernel/linux/files/beaglebone/am335x-boneblack-hdmi.dtsi new file mode 100644 index 00000000..ee6c799a --- /dev/null +++ b/recipes-kernel/linux/files/beaglebone/am335x-boneblack-hdmi.dtsi @@ -0,0 +1,141 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com/ + */ + +#include +#include + +&am33xx_pinmux { + nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT_PULLDOWN, MUX_MODE3) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA0, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA1, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA2, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA3, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA4, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA5, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA6, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA7, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA8, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA9, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA10, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA11, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA12, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA13, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA14, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA15, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_VSYNC, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_HSYNC, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_PCLK, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_AC_BIAS_EN, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + >; + }; + + nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT_PULLDOWN, MUX_MODE3) + >; + }; + + mcasp0_pins: mcasp0_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_MCASP0_AHCLKX, PIN_INPUT_PULLUP, MUX_MODE0) /* mcasp0_ahcklx.mcasp0_ahclkx */ + AM33XX_PADCONF(AM335X_PIN_MCASP0_AHCLKR, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2*/ + AM33XX_PADCONF(AM335X_PIN_MCASP0_FSX, PIN_OUTPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MCASP0_ACLKX, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_GPMC_A11, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* gpmc_a11.GPIO1_27 */ + >; + }; +}; + +&lcdc { + status = "okay"; + + /* If you want to get 24 bit RGB and 16 BGR mode instead of + * current 16 bit RGB and 24 BGR modes, set the propety + * below to "crossed" and uncomment the video-ports -property + * in tda19988 node. + */ + blue-and-red-wiring = "crossed"; + + port { + lcdc_0: endpoint@0 { + remote-endpoint = <&hdmi_0>; + }; + }; +}; + +&i2c0 { + tda19988: tda19988@70 { + compatible = "nxp,tda998x"; + reg = <0x70>; + nxp,calib-gpios = <&gpio1 25 0>; + interrupts-extended = <&gpio1 25 IRQ_TYPE_LEVEL_LOW>; + + pinctrl-names = "default", "off"; + pinctrl-0 = <&nxp_hdmi_bonelt_pins>; + pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; + + /* Convert 24bit BGR to RGB, e.g. cross red and blue wiring */ + video-ports = <0x234501>; + + #sound-dai-cells = <0>; + audio-ports = < TDA998x_I2S 0x03>; + + ports { + port@0 { + hdmi_0: endpoint@0 { + remote-endpoint = <&lcdc_0>; + }; + }; + }; + }; +}; + +&mcasp0 { + #sound-dai-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&mcasp0_pins>; + status = "okay"; + op-mode = <0>; /* MCASP_IIS_MODE */ + tdm-slots = <2>; + serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ + 0 0 1 0 + >; + tx-num-evt = <32>; + rx-num-evt = <32>; +}; + +/ { + clk_mcasp0_fixed: clk_mcasp0_fixed { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <24576000>; + }; + + clk_mcasp0: clk_mcasp0 { + #clock-cells = <0>; + compatible = "gpio-gate-clock"; + clocks = <&clk_mcasp0_fixed>; + enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */ + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "TI BeagleBone Black"; + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&dailink0_master>; + simple-audio-card,frame-master = <&dailink0_master>; + + dailink0_master: simple-audio-card,cpu { + sound-dai = <&mcasp0>; + clocks = <&clk_mcasp0>; + }; + + simple-audio-card,codec { + sound-dai = <&tda19988>; + }; + }; +}; diff --git a/scripts/setup-environment-internal b/scripts/setup-environment-internal index 015f2c59..e34fd8c5 100755 --- a/scripts/setup-environment-internal +++ b/scripts/setup-environment-internal @@ -112,7 +112,7 @@ fi # Create a common list of "()", sorted by # Blacklist unsupported machines of TorizonCore MACHLAYERS=$(find layers/ -print | grep "conf/machine/.*\.conf" | - grep -E '(apalis.*\.conf|colibri.*\.conf|verdin.*\.conf|qemuarm64\.conf|genericx86-64\.conf|raspberrypi4-64\.conf|raspberrypi3-64\.conf|raspberrypi0-2w-64\.conf|raspberrypi0-wifi\.conf|intel-corei7-64\.conf|nezha-allwinner-d1\.conf|beaglebone-yocto\.conf|beagleplay\.conf|qemux86-64\.conf)' | + grep -E '(apalis.*\.conf|colibri.*\.conf|verdin.*\.conf|qemuarm64\.conf|genericx86-64\.conf|raspberrypi4-64\.conf|raspberrypi3-64\.conf|raspberrypi0-2w-64\.conf|raspberrypi0-wifi\.conf|intel-corei7-64\.conf|nezha-allwinner-d1\.conf|beaglebone-yocto\.conf|beaglebone\.conf|beagleplay\.conf|qemux86-64\.conf)' | grep -E -v '(imx7-nand|colibri-vf|tk1|colibri-imx7|colibri-imx6ull|verdin-am62-k3r5)\.conf' | sed -e 's/\.conf//g' -e 's/layers\///' | awk -F'/conf/machine/' '{print $NF "(" $1 ")"}' | LC_ALL=C sort) From ed0966ecc2e3baae89762a85b7acc13678188442 Mon Sep 17 00:00:00 2001 From: Drew Moseley Date: Fri, 8 Nov 2024 17:29:57 -0500 Subject: [PATCH 4/4] pocketbeagle: Backport patch for choosing the appropriate ticket timer. More details here: https://github.com/e-ale/meta-pocketbeagle/issues/6 Signed-off-by: Drew Moseley --- ...m335x-pocketbeagle-choose-tick-timer.patch | 40 +++++++++++++++++++ recipes-bsp/u-boot/u-boot-bb.org_git.bbappend | 5 +++ ...m335x-pocketbeagle-choose-tick-timer.patch | 40 +++++++++++++++++++ recipes-bsp/u-boot/u-boot_%.bbappend | 4 ++ 4 files changed, 89 insertions(+) create mode 100644 recipes-bsp/u-boot/u-boot-bb.org/0001-ARM-dts-am335x-pocketbeagle-choose-tick-timer.patch create mode 100644 recipes-bsp/u-boot/u-boot-bb.org_git.bbappend create mode 100644 recipes-bsp/u-boot/u-boot/0001-ARM-dts-am335x-pocketbeagle-choose-tick-timer.patch diff --git a/recipes-bsp/u-boot/u-boot-bb.org/0001-ARM-dts-am335x-pocketbeagle-choose-tick-timer.patch b/recipes-bsp/u-boot/u-boot-bb.org/0001-ARM-dts-am335x-pocketbeagle-choose-tick-timer.patch new file mode 100644 index 00000000..c9d63aa3 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-bb.org/0001-ARM-dts-am335x-pocketbeagle-choose-tick-timer.patch @@ -0,0 +1,40 @@ +From ec6a81275eb34ec46bff08f81961da4f2384deef Mon Sep 17 00:00:00 2001 +From: Trevor Woerner +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 +Signed-off-by: Trevor Woerner +--- + 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 + diff --git a/recipes-bsp/u-boot/u-boot-bb.org_git.bbappend b/recipes-bsp/u-boot/u-boot-bb.org_git.bbappend new file mode 100644 index 00000000..763dfbb3 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-bb.org_git.bbappend @@ -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 \ + " diff --git a/recipes-bsp/u-boot/u-boot/0001-ARM-dts-am335x-pocketbeagle-choose-tick-timer.patch b/recipes-bsp/u-boot/u-boot/0001-ARM-dts-am335x-pocketbeagle-choose-tick-timer.patch new file mode 100644 index 00000000..c9d63aa3 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/0001-ARM-dts-am335x-pocketbeagle-choose-tick-timer.patch @@ -0,0 +1,40 @@ +From ec6a81275eb34ec46bff08f81961da4f2384deef Mon Sep 17 00:00:00 2001 +From: Trevor Woerner +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 +Signed-off-by: Trevor Woerner +--- + 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 + diff --git a/recipes-bsp/u-boot/u-boot_%.bbappend b/recipes-bsp/u-boot/u-boot_%.bbappend index 265e8fa5..3f56c675 100644 --- a/recipes-bsp/u-boot/u-boot_%.bbappend +++ b/recipes-bsp/u-boot/u-boot_%.bbappend @@ -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 \ + "