-
-
Notifications
You must be signed in to change notification settings - Fork 3k
board: add BeagleBadge support & Bump TI K3 sources #9679
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,192 @@ | ||
| # BeagleBadge Texas Instruments AM62L dual core 256MB 2xGBE OSPI HDMI | ||
|
|
||
| BOARD_NAME="BeagleBadge" | ||
| BOARD_VENDOR="beagleboard" | ||
| BOARDFAMILY="k3" | ||
| BOARD_MAINTAINER="Grippy98" | ||
| BOOT_SOC="am62l" | ||
| BOOTCONFIG="am62lx_badge_defconfig" | ||
| BOOTFS_TYPE="fat" | ||
| BOOT_FDT_FILE="ti/k3-am62l3-badge.dts" | ||
| TIBOOT3_FILE="tiboot3.bin" | ||
| DEFAULT_CONSOLE="serial" | ||
| KERNEL_TARGET="vendor,vendor-rt,vendor-edge" | ||
| KERNEL_TEST_TARGET="vendor" | ||
| SERIALCON="ttyS2" | ||
| ATF_BOARD="am62l3-badge" | ||
| EXTRA_ATF_TARGETS="build/k3low/am62l3-badge/release/bl1.bin:bl1.bin" | ||
| OPTEE_ARGS="CFG_TEE_CORE_LOG_LEVEL=1" | ||
| OPTEE_PLATFORM="k3-am62lx" | ||
| EXTRA_BOOT_ARGS="BL1=bl1.bin" | ||
| DISPLAY_SUPPORT="yes" | ||
| CC33XX_SUPPORT="yes" | ||
| PACKAGE_LIST_BOARD_REMOVE="weston seatd ti-lvgl-demo firmware-cnm-wave" | ||
| PACKAGE_LIST_BOARD+=" bluetooth bluez-tools" | ||
|
|
||
| # ============================================================================ | ||
| # LOW-RAM OPTIMIZATIONS FOR 256MB BADGE | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about using:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah did not know about that, will take a look! |
||
| # ============================================================================ | ||
|
|
||
| function post_customize_image__beaglebadge_05_configure_zram() { | ||
| display_alert "$BOARD" "Configuring ZRAM for 256MB RAM system" "info" | ||
|
|
||
| cat <<-EOF > "${SDCARD}"/etc/default/armbian-zram-config | ||
| ENABLED=true | ||
| ZRAM_PERCENTAGE=25 | ||
| ZRAM_ALGORITHM=zstd | ||
| SWAP_PRIORITY=100 | ||
| EOF | ||
|
|
||
| chroot "${SDCARD}" /bin/bash -c "systemctl enable armbian-zram-config.service || true" | ||
|
|
||
| display_alert "$BOARD" "ZRAM configured: 25% of physical RAM (priority 100)" "info" | ||
| } | ||
|
|
||
| function post_customize_image__beaglebadge_06_enable_cc33xx_ble() { | ||
| display_alert "$BOARD" "Configuring CC33xx udev rule for BLE" "info" | ||
|
|
||
| mkdir -p "${SDCARD}"/etc/udev/rules.d/ | ||
| cat <<-EOF > "${SDCARD}"/etc/udev/rules.d/99-cc33xx-ble.rules | ||
| # Enable BLE when the cc33xx wlan physical interface initializes | ||
| ACTION=="add", KERNEL=="phy[0-9]*", SUBSYSTEM=="ieee80211", DRIVERS=="cc33xx", RUN+="/bin/sh -c 'sleep 1; echo 1 > /sys/kernel/debug/ieee80211/%k/cc33xx/ble_enable'" | ||
| EOF | ||
| } | ||
|
|
||
| function post_customize_image__zz_beaglebadge_10_disable_apt_periodic() { | ||
| display_alert "$BOARD" "Disabling APT periodic services (post-config)" "info" | ||
|
|
||
| # Disable and mask APT timers; timers are what trigger the services | ||
| chroot "${SDCARD}" /bin/bash -c " | ||
| systemctl disable apt-daily.timer apt-daily-upgrade.timer || true | ||
| systemctl mask apt-daily.timer apt-daily-upgrade.timer apt-daily.service apt-daily-upgrade.service || true | ||
| " | ||
|
|
||
| # Override APT periodic config | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minimal image doesn't have unnatended-upgrade service - probably don't need to bother with this? |
||
| cat <<-EOF > "${SDCARD}"/etc/apt/apt.conf.d/02-armbian-periodic | ||
| // Disabled for 256MB RAM optimization | ||
| APT::Periodic::Enable "0"; | ||
| APT::Periodic::Update-Package-Lists "0"; | ||
| APT::Periodic::Download-Upgradeable-Packages "0"; | ||
| APT::Periodic::Unattended-Upgrade "0"; | ||
| APT::Periodic::AutocleanInterval "0"; | ||
| EOF | ||
|
|
||
| # Add low-RAM APT settings | ||
| cat <<-EOF > "${SDCARD}"/etc/apt/apt.conf.d/99-lowram | ||
| // Reduce APT memory usage | ||
| // APT::Cache-Limit "8388608"; | ||
| // APT::Cache-Start "8388608"; | ||
| // APT::Cache-Grow "1048576"; | ||
| Dir::Cache::Archives::MaxAge "0"; | ||
| Dir::Cache::Archives::MaxSize "50M"; | ||
| APT::AutoRemove::RecommendsImportant "0"; | ||
| APT::AutoRemove::SuggestsImportant "0"; | ||
| EOF | ||
| } | ||
|
|
||
|
|
||
|
|
||
| function post_customize_image__zz_beaglebadge_30_trim_systemd() { | ||
| display_alert "$BOARD" "Trimming systemd services (post-config)" "info" | ||
|
|
||
| # Services to disable (not mask - let them exist but not start) | ||
| local services_to_disable=( | ||
| "keyboard-setup.service" | ||
| "console-setup.service" | ||
| "rsyslog.service" | ||
| "systemd-homed.service" | ||
| "systemd-homed-activate.service" | ||
| ) | ||
|
|
||
| for service in "${services_to_disable[@]}"; do | ||
| chroot "${SDCARD}" /bin/bash -c "systemctl disable ${service} || true" | ||
| done | ||
|
|
||
| # Timers to mask (these are safe and won't conflict) | ||
| local timers_to_mask=( | ||
| "man-db.timer" | ||
| "dpkg-db-backup.timer" | ||
| "e2scrub_all.timer" | ||
| ) | ||
|
|
||
| for timer in "${timers_to_mask[@]}"; do | ||
| chroot "${SDCARD}" /bin/bash -c "systemctl mask ${timer} || true" | ||
| local service="${timer%.timer}.service" | ||
| chroot "${SDCARD}" /bin/bash -c "systemctl mask ${service} || true" | ||
| done | ||
| } | ||
|
|
||
| function post_customize_image__zz_beaglebadge_40_limit_journal() { | ||
| display_alert "$BOARD" "Limiting systemd journal size" "info" | ||
|
|
||
| mkdir -p "${SDCARD}"/etc/systemd/journald.conf.d/ | ||
| cat <<-EOF > "${SDCARD}"/etc/systemd/journald.conf.d/00-journal-size.conf | ||
| [Journal] | ||
| SystemMaxUse=16M | ||
| SystemMaxFileSize=4M | ||
| RuntimeMaxUse=8M | ||
| RuntimeMaxFileSize=2M | ||
| MaxRetentionSec=1day | ||
| ForwardToSyslog=no | ||
| ForwardToKMsg=no | ||
| ForwardToConsole=no | ||
| ForwardToWall=no | ||
| MaxLevelStore=info | ||
| MaxLevelSyslog=info | ||
| Compress=yes | ||
| EOF | ||
| } | ||
|
|
||
| function post_customize_image__zz_beaglebadge_50_optimize_systemd_timeouts() { | ||
| display_alert "$BOARD" "Optimizing systemd timeouts" "info" | ||
|
|
||
| mkdir -p "${SDCARD}"/etc/systemd/system.conf.d/ | ||
| cat <<-EOF > "${SDCARD}"/etc/systemd/system.conf.d/99-lowram.conf | ||
| [Manager] | ||
| DefaultTimeoutStartSec=30s | ||
| DefaultTimeoutStopSec=15s | ||
| DefaultTimeoutAbortSec=15s | ||
| DefaultDeviceTimeoutSec=30s | ||
| # Cap processes to prevent out-of-memory fork bombs | ||
| DefaultLimitNPROC=256:512 | ||
| EOF | ||
|
|
||
| mkdir -p "${SDCARD}"/etc/systemd/coredump.conf.d/ | ||
| cat <<-EOF > "${SDCARD}"/etc/systemd/coredump.conf.d/disable.conf | ||
| [Coredump] | ||
| Storage=none | ||
| ProcessSizeMax=0 | ||
| EOF | ||
| } | ||
|
|
||
| function post_customize_image__zz_beaglebadge_60_kernel_params() { | ||
| display_alert "$BOARD" "Setting low-RAM kernel parameters" "info" | ||
|
|
||
| cat <<-EOF > "${SDCARD}"/etc/sysctl.d/99-lowram.conf | ||
| # Memory management for 256MB system | ||
| vm.swappiness=100 | ||
| zswap.enabled=0 | ||
| vm.page-cluster=0 | ||
| vm.watermark_scale_factor=125 | ||
| vm.compact_memory=1 | ||
|
Comment on lines
+164
to
+170
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: zswap.enabled is not a valid Linux sysctl key under /proc/sys/vm/. It is configurable via kernel command line (e.g., zswap.enabled=1) or module parameter (echo 1 > /sys/module/zswap/parameters/enabled). Writing vm.compact_memory=1 via sysctl triggers memory compaction across all zones (if CONFIG_COMPACTION is enabled), moving free memory into contiguous blocks to reduce fragmentation. This aids allocations like huge pages, though processes compact as needed. Citations:
Remove
Suggested fix # Memory management for 256MB system
vm.swappiness=100
- zswap.enabled=0
vm.page-cluster=0
vm.watermark_scale_factor=125
- vm.compact_memory=1
vm.vfs_cache_pressure=150🤖 Prompt for AI Agents |
||
| vm.vfs_cache_pressure=150 | ||
| vm.dirty_background_ratio=5 | ||
| vm.dirty_ratio=10 | ||
| vm.min_free_kbytes=8192 | ||
| vm.overcommit_memory=1 | ||
|
|
||
| # Reduce kernel verbosity | ||
| kernel.printk=3 4 1 3 | ||
|
|
||
| # Minimize network buffers | ||
| net.core.rmem_max=262144 | ||
| net.core.wmem_max=262144 | ||
| net.ipv4.tcp_rmem=4096 65536 262144 | ||
| net.ipv4.tcp_wmem=4096 16384 262144 | ||
| net.core.netdev_max_backlog=1000 | ||
|
|
||
| # Reduce inotify limits | ||
| fs.inotify.max_user_watches=8192 | ||
| fs.inotify.max_user_instances=256 | ||
| EOF | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,10 @@ | ||||||
| bootpart=1:1 | ||||||
| bootdir= | ||||||
| finduuid=part uuid \${boot} 1:2 uuid | ||||||
| check_beaglebadge=if test "${fdtfile}" = "ti/k3-am62l3-badge.dtb"; then rdaddr=0x84900000; name_overlays=ti/k3-am62l3-badge-eink-gdey042t81.dtbo; fi | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Append the badge overlay instead of replacing This assignment discards any overlays already supplied by the user, so BeagleBadge owners can't combine the mandatory E-Ink overlay with their own add-ons. 🩹 Proposed fix-check_beaglebadge=if test "${fdtfile}" = "ti/k3-am62l3-badge.dtb"; then rdaddr=0x84900000; name_overlays=ti/k3-am62l3-badge-eink-gdey042t81.dtbo; fi
+check_beaglebadge=if test "${fdtfile}" = "ti/k3-am62l3-badge.dtb"; then rdaddr=0x84900000; if test -n "${name_overlays}"; then name_overlays="${name_overlays} ti/k3-am62l3-badge-eink-gdey042t81.dtbo"; else name_overlays=ti/k3-am62l3-badge-eink-gdey042t81.dtbo; fi; fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jonaswood01 Can you take a look
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
| name_rd=uInitrd | ||||||
| get_rd_mmc=load mmc ${bootpart} ${rdaddr} ${bootdir}/${name_rd} | ||||||
|
|
||||||
| uenvcmd=run get_rd_${boot}; env set rd_spec ${rdaddr}:${filesize}; setexpr fdtfile sub ti/ti ti; run bootcmd_ti_mmc | ||||||
| uenvcmd=run check_beaglebadge; run get_rd_${boot}; env set rd_spec ${rdaddr}:${filesize}; setexpr fdtfile sub ti/ti ti; run bootcmd_ti_mmc | ||||||
|
|
||||||
| optargs=vt.global_cursor_default=0 | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the hardware description on Line 1.
This looks copied from another TI board and advertises
2xGBE OSPI HDMI, which does not match the badge-specific E-Ink/CC33xx setup introduced below. This string is shown during interactive board selection, so it needs to describe the actual hardware.Based on learnings: in Armbian board configuration files, the first-line comment must be a proper hardware feature description because it is used during interactive compilation.
🤖 Prompt for AI Agents