Skip to content

ADD SMART-AM60 SUPPORT #2817

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
merged 13 commits into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions .github/workflows/build-armbian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ on:
- s922x-ugoos-am6
- seewo-sv21
- smart-am40
- smart-am60
- station-m1
- swan1-w28
- sw799
Expand Down Expand Up @@ -203,6 +204,7 @@ on:
type: choice
options:
- ophub/kernel
- dy008/kernel
kernel_usage:
description: "Set the tags of the stable kernel."
required: false
Expand All @@ -213,6 +215,7 @@ on:
- flippy
- dev
- beta
- rk3588
armbian_fstype:
description: "Select armbian rootfs type."
required: false
Expand All @@ -237,7 +240,7 @@ on:
options:
- ophub
- angel
- yourname
- dy008

env:
TZ: America/New_York
Expand Down Expand Up @@ -300,7 +303,7 @@ jobs:
df -hT ${PWD}
git clone -q --single-branch --depth=1 --branch=main https://github.com/armbian/build.git build
ln -sf /builder/build ${GITHUB_WORKSPACE}/build
ln -sf /builder/build /home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/build
ln -sf /builder/build /home/runner/work/_actions/dy008/amlogic-s9xxx-armbian/main/build
echo "status=success" >> ${GITHUB_OUTPUT}

- name: Compile Armbian [ ${{ inputs.set_release }} ]
Expand Down Expand Up @@ -338,7 +341,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Rebuild Armbian
uses: ophub/amlogic-s9xxx-armbian@main
uses: dy008/amlogic-s9xxx-armbian@main
if: ${{ steps.clean.outputs.status }} == 'success' && !cancelled()
with:
build_target: armbian
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/use-releases-file-to-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ on:
- s922x-ugoos-am6
- seewo-sv21
- smart-am40
- smart-am60
- station-m1
- swan1-w28
- sw799
Expand Down Expand Up @@ -203,6 +204,7 @@ on:
type: choice
options:
- ophub/kernel
- dy008/kernel
kernel_usage:
description: "Set the tags of the stable kernel."
required: false
Expand All @@ -213,6 +215,7 @@ on:
- flippy
- dev
- beta
- rk3588
armbian_fstype:
description: "Select armbian rootfs type."
required: false
Expand All @@ -237,7 +240,7 @@ on:
options:
- ophub
- angel
- yourname
- dy008

env:
TZ: America/New_York
Expand Down Expand Up @@ -299,7 +302,7 @@ jobs:
armbian_buildpath="build/output/images"
[[ -d "${armbian_buildpath}" ]] || mkdir -p "${armbian_buildpath}"
ln -sf /builder/build ${GITHUB_WORKSPACE}/build
ln -sf /builder/build /home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/build
ln -sf /builder/build /home/runner/work/_actions/dy008/amlogic-s9xxx-armbian/main/build

latest_version=$(curl -s \
-H "Accept: application/vnd.github+json" \
Expand Down Expand Up @@ -327,7 +330,7 @@ jobs:
echo "status=success" >> ${GITHUB_OUTPUT}

- name: Rebuild Armbian [ ${{ inputs.set_release }} ]
uses: ophub/amlogic-s9xxx-armbian@main
uses: dy008/amlogic-s9xxx-armbian@main
if: ${{ steps.down.outputs.status }} == 'success' && !cancelled()
with:
build_target: armbian
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ custom_log="/tmp/ophub_start_service.log"
echo "[$(date +"%Y.%m.%d.%H:%M:%S")] Start the custom service..." >${custom_log}

# Set the release check file
board_fdt_file="/boot/armbianEnv.txt"
[[ -f "${board_fdt_file}" ]] && BOARD_FDT="$(cat ${board_fdt_file} | grep -oE 'rk3.*dtb')" || BOARD_FDT=""

ophub_release_file="/etc/ophub-release"
[[ -f "${ophub_release_file}" ]] && FDT_FILE="$(cat ${ophub_release_file} | grep -oE 'meson.*dtb')" || FDT_FILE=""

Expand All @@ -31,7 +34,7 @@ ophub_release_file="/etc/ophub-release"
}

# For swan1-w28(rk3568) board USB power and switch contrl
[[ "${FDT_FILE}" == "rk3568-swan1-w28.dtb" ]] && {
[[ "${BOARD_FDT}" == "rk3568-swan1-w28.dtb" ]] && {
# USB 5V Power buick ON
gpioset 0 21=1 2>/dev/null
# USB3.0 Port ON
Expand All @@ -42,6 +45,17 @@ ophub_release_file="/etc/ophub-release"
echo "[$(date +"%Y.%m.%d.%H:%M:%S")] USB successfully enabled on Swan1-w28(rk3568)." >>${custom_log}
}

# For smart-am60(rk3588) board Bluetooth contrl
[[ "${BOARD_FDT}" == "rk3588-smart-am60.dtb" ]] && {
rfkill block all
chmod a+x /lib/firmware/ap6276p/brcm_patchram_plus1
sleep .5
rfkill unblock all
/lib/firmware/ap6276p/brcm_patchram_plus1 --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 --baudrate 1500000 --patchram /lib/firmware/ap6276p/ /dev/ttyS9 &

echo "[$(date +"%Y.%m.%d.%H:%M:%S")] Bluetooth firmware successfully download on Smart-am60(rk3588)." >>${custom_log}
}

# Restart ssh service
[[ -d "/var/run/sshd" ]] || mkdir -p -m0755 /var/run/sshd 2>/dev/null
[[ -f "/etc/init.d/ssh" ]] && {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ r105 :Rock5C :rk3588s :rk3588s-rock-5c.
#-------+--------------------------------------------+---------+---------------------------------------+-----------------------------+------------------------------------+--------------------------------+-------------------------------------------+----------------+------------+-------------+----------------+-----------------------------------------------------+--------------------+----------
r106 :Orange-Pi-5-Plus :rk3588 :rk3588-orangepi-5-plus.dtb :NA :u-boot.itb :idbloader.img :Oct-core,4/8/16GB-RAM,2.5Gb-Nic :rk3588/5.10.y :rockchip :rk3588 :armbianEnv.txt :yonggedebaqi :orangepi-5-plus :yes
r107 :NanoPC-T6 :rk3588 :rk3588-nanopc-t6.dtb :NA :u-boot.itb :idbloader.img :4/8/16GB-RAM,32/64/256Gb-ROM,2x2.5Gb-Nic :stable/6.1.y :rockchip :rk3588 :armbianEnv.txt :hunter24099 :nanopc-t6 :yes

r108 :Smart-Am60 :rk3588 :rk3588-smart-am60.dtb :NA :u-boot.itb :idbloader.img :8/16GB-RAM,64/256Gb-ROM,1Gb-Nic :rk3588/6.1.y :rockchip :rk3588 :armbianEnv.txt :dy008 :smart-am60 :yes

# Rockchip RK3568 Family
#-------+--------------------------------------------+---------+---------------------------------------+-----------------------------+------------------------------------+--------------------------------+-------------------------------------------+----------------+------------+-------------+----------------+-----------------------------------------------------+--------------------+----------
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
verbosity=9
bootlogo=true
fdtfile=rockchip/rk3588-smart-am60.dtb
rootdev=/dev/mmcblk0p2
rootfstype=ext4
rootflags=compress=zstd:6
earlycon=on
console=serial
consoleargs=console=ttyFIQ0 console=tty1
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
docker_optimizations=on
extraargs=
extraboardargs=net.ifnames=0 max_loop=128
overlay_prefix=rk3588
overlays=
user_overlays=
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

setenv load_addr "0x9000000"
setenv overlay_error "false"
# default values
setenv rootdev "/dev/mmcblk0p1"
setenv verbosity "1"
setenv console "both"
setenv bootlogo "false"
setenv rootfstype "ext4"
setenv rootflags "rw,errors=remount-ro"
setenv docker_optimizations "on"
setenv earlycon "off"

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

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

if test "${logo}" = "disabled"; then setenv logo "logo.nologo"; 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=ttyS2,1500000 ${consoleargs}"; fi
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi

# get PARTUUID of first partition on SD/eMMC the boot script was loaded from
# if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:1 partuuid; fi
# get PARTUUID of first partition on current boot device the boot script was loaded from
part uuid ${devtype} ${devnum}:1 partuuid

setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} rootflags=${rootflags} ${consoleargs} consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"

if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1"; fi

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

load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize 65536
for overlay_file in ${overlays}; do
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/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} ${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} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
else
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-fixup.scr; then
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
source ${load_addr}
fi
if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then
load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr
echo "Applying user provided fixup script (fixup.scr)"
source ${load_addr}
fi
fi
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

# Recompile with:
# mkimage -C none -A arm -T script -n 'flatmax load script' -d /boot/boot.cmd /boot/boot.scr
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
xhci-hcd:usb5 5
xhci-hcd:usb7 7
Binary file not shown.
2 changes: 1 addition & 1 deletion rebuild
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ armbian_release_file="etc/armbian-release"
ophub_release_file="etc/ophub-release"

# U-BOOT files download repository
uboot_repo="https://github.com/ophub/u-boot"
uboot_repo="https://github.com/dy008/u-boot"
# Firmware files download repository
firmware_repo="https://github.com/ophub/firmware"

Expand Down