Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
13 changes: 13 additions & 0 deletions config/boards/milkv-duos-arm.csc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Sophgo SG2000 Cortex-A53 single core 512MB SoC headless 1x100MBe SD eMMC WiFi/BT USB2
BOARD_NAME="Milk-V Duo S"
BOARD_VENDOR="milkv"
BOARDFAMILY="sophgo-sg200x-arm64"
BOARD_MAINTAINER="lukaszsobala"
INTRODUCED="2024"
KERNEL_TARGET="edge,bleedingedge"
KERNEL_TEST_TARGET="edge"
BOOT_FDT_FILE="sophgo/sg2000-milkv-duo-s.dtb"
HAS_VIDEO_OUTPUT="no"
PACKAGE_LIST_BOARD_REMOVE="snapd cloud-init" # 512MB of RAM
Comment thread
lukaszsobala marked this conversation as resolved.
Outdated

enable_extension "sophgo-sg200x-aic8800"
13 changes: 13 additions & 0 deletions config/boards/milkv-duos-riscv.csc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Sophgo SG2000 T-Head C906 single core 512MB SoC headless 1x100MBe SD eMMC WiFi/BT USB2
BOARD_NAME="Milk-V Duo S"
BOARD_VENDOR="milkv"
BOARDFAMILY="sophgo-sg200x-riscv64"
BOARD_MAINTAINER="lukaszsobala"
INTRODUCED="2024"
KERNEL_TARGET="edge,bleedingedge"
KERNEL_TEST_TARGET="edge"
BOOT_FDT_FILE="sophgo/sg2000-milkv-duo-s.dtb"
HAS_VIDEO_OUTPUT="no"
PACKAGE_LIST_BOARD_REMOVE="snapd cloud-init" # 512MB of RAM

enable_extension "sophgo-sg200x-aic8800"
4 changes: 4 additions & 0 deletions config/bootenv/sophgo-sg200x-arm64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
verbosity=1
console=serial
earlycon=on
overlays=
4 changes: 4 additions & 0 deletions config/bootenv/sophgo-sg200x-riscv64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
verbosity=1
console=serial
earlycon=sbi
overlays=
68 changes: 68 additions & 0 deletions config/bootscripts/boot-sophgo-sg200x.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

# Scratch space for armbianEnv.txt and for each overlay before it is applied.
# 0x82300000 is fdtoverlay_addr_r from the vendor U-Boot's distroboot patch: it
# sits between fdt_addr_r (0x82200000) and pxefile_addr_r (0x82400000), so there
# is 1MiB for the device tree to grow into and 1MiB of scratch after it.
setenv load_addr "0x82300000"
setenv overlay_error "false"

# Defaults, overridden by armbianEnv.txt below. The Duo S has no display, so the
# console is serial-only; "both" would add a console=tty1 that never appears.
setenv rootdev "/dev/mmcblk0p2"
setenv verbosity "1"
setenv console "serial"
setenv rootfstype "ext4"
setenv earlycon "off"

test -n "${distro_bootpart}" || distro_bootpart=1

echo "Boot script loaded from ${devtype} ${devnum}:${distro_bootpart}"

if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}armbianEnv.txt; then
load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}armbianEnv.txt
env import -t ${load_addr} ${filesize}
fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,115200 ${consoleargs}"; fi

# Two spellings, because the two architectures need different ones and share
# this script. The C906 has no memory-mapped earlycon before the SBI console is
# up, so RISC-V wants earlycon=sbi; on the Cortex-A53 the device tree's
# stdout-path is enough and plain earlycon works.
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
if test "${earlycon}" = "sbi"; then setenv consoleargs "earlycon=sbi ${consoleargs}"; fi

setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} rw no_console_suspend consoleblank=0 loglevel=${verbosity} fsck.fix=yes fsck.repair=yes net.ifnames=0 ${extraargs} ${extraboardargs}"

load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} ${prefix}uInitrd
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}Image

load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize 65536
for overlay_file in ${overlays}; do
if load ${devtype} ${devnum}:${distro_bootpart} ${load_addr} ${prefix}dtb/sophgo/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
echo "Applying kernel provided DT overlay ${overlay_prefix}-${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}
fi

booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
Loading
Loading