-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
board: add Nuvoton MA35D1 NuMaker IoT board support #9205
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
Merged
igorpecovnik
merged 8 commits into
armbian:main
from
TuAFBogey:add-nuvoton-ma35d1-support
Jan 12, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
002b17f
board: add Nuvoton MA35D1 NuMaker IoT board support
TuAFBogey 88a20e7
fix: address review comments
TuAFBogey 425fd42
Use EXTRA_BUILD_DEPS for OP-TEE dependencies instead of runtime apt-get
TuAFBogey d8b4b02
Address rpardini review: remove BTF patches, use full kernel config, …
TuAFBogey ebc6271
Run rewrite-kernel-config for proper defconfig format
TuAFBogey 0d49c8c
Address rpardini review round 2: major cleanup
TuAFBogey bfcecbc
Address final review: declare -g consistency, function keyword, move …
TuAFBogey edd101d
Fix copyright year to 2026
TuAFBogey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,17 @@ | ||
| # Dual-core Cortex-A35 + Cortex-M4, 512MB DDR | ||
| BOARD_NAME="NuMaker IoT MA35D16F90" | ||
| BOARD_VENDOR="nuvoton" | ||
| BOARDFAMILY="nuvoton-ma35d1" | ||
| # SD card boot (sdcard1 = SD1 slot on NuMaker IoT board) | ||
| BOOTCONFIG="ma35d1_sdcard1_defconfig" | ||
| KERNEL_TARGET="vendor" | ||
| FULL_DESKTOP="no" | ||
| BOOT_LOGO="no" | ||
| BOOT_FDT_FILE="nuvoton/ma35d1-iot-512m.dtb" | ||
| BOOT_SCENARIO="blobless" | ||
| IMAGE_PARTITION_TABLE="msdos" | ||
| DEFAULT_CONSOLE="serial" | ||
| SERIALCON="ttyS0:115200" | ||
|
|
||
| # Hardware features | ||
| HAS_VIDEO_OUTPUT="yes" |
This file contains hidden or 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 @@ | ||
| bootlogo=false | ||
| console=serial |
This file contains hidden or 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,155 @@ | ||
| # DO NOT EDIT THIS FILE | ||
| # | ||
| # Please edit /boot/armbianEnv.txt to set supported parameters | ||
| # | ||
| # Nuvoton MA35D1 boot script for Armbian | ||
|
|
||
| setenv overlay_error "false" | ||
| # default values | ||
| setenv rootdev "LABEL=armbi_root" | ||
| setenv verbosity "1" | ||
| setenv console "serial" | ||
| setenv bootlogo "false" | ||
| setenv rootfstype "ext4" | ||
| setenv docker_optimizations "on" | ||
| setenv earlycon "off" | ||
|
|
||
| # MA35D1 memory map - load addresses | ||
| # Memory layout (avoiding overlaps): | ||
| # 0x80000000 - Kernel (~15MB, ends ~0x80F00000) | ||
| # 0x81000000 - Temp load address for env/overlays | ||
| # 0x82000000 - Ramdisk (~20MB max, ends ~0x83400000) | ||
| # 0x84000000 - DTB (~64KB) | ||
| setenv load_addr "0x81000000" | ||
| setenv kernel_addr_r "0x80000000" | ||
| setenv ramdisk_addr_r "0x82000000" | ||
| setenv fdt_addr_r "0x84000000" | ||
|
|
||
| # Set default fdtfile if not set by U-Boot | ||
| test -n "${fdtfile}" || setenv fdtfile "nuvoton/ma35d1-iot-512m.dtb" | ||
|
|
||
| test -n "${distro_bootpart}" || setenv distro_bootpart 1 | ||
|
|
||
| echo "Boot script loaded from ${devtype} ${devnum}:${distro_bootpart}" | ||
|
|
||
| # get PARTUUID of first partition on SD/eMMC the boot script was loaded from | ||
| echo "Detecting PARTUUID for ${devtype} device ${devnum}:${distro_bootpart}..." | ||
| setenv partuuid | ||
|
|
||
| if test "${devtype}" = "mmc"; then | ||
| part uuid ${devtype} ${devnum}:${distro_bootpart} partuuid | ||
| fi | ||
|
|
||
| # Use PARTUUID if available (more reliable), otherwise fall back to rootdev label | ||
| if test -n "${partuuid}"; then | ||
| setenv rootdev "PARTUUID=${partuuid}" | ||
| fi | ||
|
|
||
| # Load armbianEnv.txt if it exists | ||
| echo "Attempting to load ${prefix}armbianEnv.txt from ${devtype} ${devnum}:${distro_bootpart} to ${load_addr}..." | ||
| if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}armbianEnv.txt; then | ||
| echo "Successfully loaded armbianEnv.txt (${filesize} bytes)" | ||
| if env import -t ${load_addr} ${filesize}; then | ||
| echo "Successfully imported environment from armbianEnv.txt" | ||
| else | ||
| echo "Warning: Failed to import environment from armbianEnv.txt" | ||
| fi | ||
| else | ||
| echo "armbianEnv.txt not found or failed to load - using default environment" | ||
| fi | ||
|
|
||
| echo "Final rootdev: ${rootdev}" | ||
|
|
||
| # Set console arguments | ||
| setenv consoleargs "" | ||
| if test "${console}" = "display" || test "${console}" = "both"; then | ||
| setenv consoleargs "console=tty1 ${consoleargs}" | ||
| fi | ||
| if test "${console}" = "serial" || test "${console}" = "both"; then | ||
| setenv consoleargs "console=ttyS0,115200n8 ${consoleargs}" | ||
| fi | ||
| if test "${earlycon}" = "on"; then | ||
| setenv consoleargs "earlycon ${consoleargs}" | ||
| fi | ||
|
|
||
| if test "${bootlogo}" = "true"; then | ||
| setenv consoleargs "splash plymouth.ignore-serial-consoles ${consoleargs}" | ||
| else | ||
| setenv consoleargs "splash=verbose ${consoleargs}" | ||
| fi | ||
|
|
||
| # MA35D1 specific: limit kernel memory if needed (for OP-TEE reserved memory) | ||
| # OP-TEE reserves 0x8f800000-0x90000000 (8MB) | ||
| setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} ${extraargs} ${extraboardargs}" | ||
|
|
||
| if test "${docker_optimizations}" = "on"; then | ||
| setenv bootargs "${bootargs} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory" | ||
| fi | ||
|
|
||
| echo "Final bootargs: ${bootargs}" | ||
|
|
||
| # Load kernel | ||
| echo "Loading kernel image to ${kernel_addr_r}..." | ||
| if load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}Image; then | ||
| echo "Kernel loaded successfully" | ||
| else | ||
| echo "ERROR: Failed to load kernel!" | ||
| exit | ||
| fi | ||
|
|
||
| # Load initramfs | ||
| echo "Loading initramfs to ${ramdisk_addr_r}..." | ||
| if load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} ${prefix}uInitrd; then | ||
| setenv ramdisk_arg "${ramdisk_addr_r}:${filesize}" | ||
| echo "Initramfs loaded successfully (${filesize} bytes)" | ||
| else | ||
| echo "Warning: Failed to load initramfs, booting without it" | ||
| setenv ramdisk_arg "-" | ||
| fi | ||
|
|
||
| # Load device tree | ||
| echo "Loading device tree ${fdtfile} to ${fdt_addr_r}..." | ||
| if load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}dtb/${fdtfile}; then | ||
| echo "DTB loaded successfully" | ||
| else | ||
| echo "ERROR: Failed to load device tree!" | ||
| exit | ||
| fi | ||
|
|
||
| # Setup FDT for overlays | ||
| fdt addr ${fdt_addr_r} | ||
| fdt resize 65536 | ||
|
|
||
| # Apply overlays if specified | ||
| for overlay_file in ${overlays}; do | ||
| if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}dtb/nuvoton/overlay/${overlay_file}.dtbo; then | ||
| echo "Applying kernel provided DT overlay ${overlay_file}.dtbo" | ||
| fdt apply ${load_addr} || setenv overlay_error "true" | ||
| fi | ||
| done | ||
|
|
||
| for overlay_file in ${user_overlays}; do | ||
| if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then | ||
| echo "Applying user provided DT overlay ${overlay_file}.dtbo" | ||
| fdt apply ${load_addr} || setenv overlay_error "true" | ||
| fi | ||
| done | ||
|
|
||
| if test "${overlay_error}" = "true"; then | ||
| echo "Error applying DT overlays, restoring original DT" | ||
| load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}dtb/${fdtfile} | ||
| fdt addr ${fdt_addr_r} | ||
| fdt resize 65536 | ||
| fi | ||
|
|
||
| # Resize FDT to actual size | ||
| fdt resize | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| echo "Booting kernel..." | ||
| echo " kernel: ${kernel_addr_r}" | ||
| echo " initrd: ${ramdisk_arg}" | ||
| echo " dtb: ${fdt_addr_r}" | ||
| booti ${kernel_addr_r} ${ramdisk_arg} ${fdt_addr_r} | ||
|
|
||
| # Recompile with: | ||
| # mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.