1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-03-09 15:40:20 +00:00

Add r5s support. From coolsnowwold repo

This commit is contained in:
Ycarus (Yannick Chabanois) 2022-11-18 18:11:43 +01:00
parent f2bf060a04
commit 2d9c2e0625
112 changed files with 25981 additions and 75 deletions

View file

@ -0,0 +1,82 @@
# SPDX-License-Identifier: GPL-2.0-only
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
DEVICE_VARS += UBOOT_DEVICE_NAME
define Build/Compile
$(CP) $(LINUX_DIR)/COPYING $(KDIR)/COPYING.linux
endef
### Image scripts ###
define Build/boot-common
# This creates a new folder copies the dtb (as rockchip.dtb)
# and the kernel image (as kernel.img)
rm -fR $@.boot
mkdir -p $@.boot
$(CP) $(DTS_DIR)/$(DEVICE_DTS).dtb $@.boot/rockchip.dtb
$(CP) $(IMAGE_KERNEL) $@.boot/kernel.img
endef
define Build/boot-script
# Make an U-boot image and copy it to the boot partition
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d $(if $(1),$(1),mmc).bootscript $@.boot/boot.scr
endef
define Build/pine64-img
# Creates the final SD/eMMC images,
# combining boot partition, root partition as well as the u-boot bootloader
# Generate a new partition table in $@ with 32 MiB of
# alignment padding for the idbloader and u-boot to fit:
# http://opensource.rock-chips.com/wiki_Boot_option#Boot_flow
#
# U-Boot SPL expects the U-Boot ITB to be located at sector 0x4000 (8 MiB) on the MMC storage
PADDING=1 $(SCRIPT_DIR)/gen_image_generic.sh \
$@ \
$(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
32768
# Copy the idbloader and the u-boot image to the image at sector 0x40 and 0x4000
dd if="$(STAGING_DIR_IMAGE)"/$(UBOOT_DEVICE_NAME)-idbloader.img of="$@" seek=64 conv=notrunc
dd if="$(STAGING_DIR_IMAGE)"/$(UBOOT_DEVICE_NAME)-u-boot.itb of="$@" seek=16384 conv=notrunc
endef
define Build/pine64-bin
# Typical Rockchip boot flow with Rockchip miniloader
# Rockchp idbLoader which is combinded by Rockchip ddr init bin
# and miniloader bin from Rockchip rkbin project
# Generate a new partition table in $@ with 32 MiB of alignment
# padding for the idbloader, uboot and trust image to fit:
# http://opensource.rock-chips.com/wiki_Boot_option#Boot_flow
PADDING=1 $(SCRIPT_DIR)/gen_image_generic.sh \
$@ \
$(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
32768
# Copy the idbloader, uboot and trust image to the image at sector 0x40, 0x4000 and 0x6000
dd if="$(STAGING_DIR_IMAGE)"/$(SOC)-idbloader.bin of="$@" seek=64 conv=notrunc
dd if="$(STAGING_DIR_IMAGE)"/$(UBOOT_DEVICE_NAME)-uboot.img of="$@" seek=16384 conv=notrunc
dd if="$(STAGING_DIR_IMAGE)"/$(SOC)-trust.bin of="$@" seek=24576 conv=notrunc
endef
### Devices ###
define Device/Default
PROFILES := Default
KERNEL := kernel-bin
IMAGES := sysupgrade.img.gz
DEVICE_DTS = rockchip/$$(SOC)-$(lastword $(subst _, ,$(1)))
endef
ifdef CONFIG_LINUX_6_0
DTS_CPPFLAGS += -DDTS_NO_LEGACY
endif
include $(SUBTARGET).mk
$(eval $(call BuildImage))

View file

@ -2,12 +2,71 @@
#
# Copyright (C) 2020 Tobias Maedel
define Device/ezpro_mrkaio-m68s
DEVICE_VENDOR := EZPRO
DEVICE_MODEL := Mrkaio M68S
SOC := rk3568
UBOOT_DEVICE_NAME := mrkaio-m68s-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r5s | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-ata-ahci kmod-ata-ahci-platform
endef
TARGET_DEVICES += ezpro_mrkaio-m68s
define Device/hinlink_opc-h68k
DEVICE_VENDOR := HINLINK
DEVICE_MODEL := OPC-H68K
SOC := rk3568
UBOOT_DEVICE_NAME := opc-h68k-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r5s | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-mt7921e kmod-r8125
endef
TARGET_DEVICES += hinlink_opc-h68k
define Device/fastrhino_common
DEVICE_VENDOR := FastRhino
SOC := rk3568
UBOOT_DEVICE_NAME := r66s-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r5s | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8125
endef
define Device/fastrhino_r66s
$(call Device/fastrhino_common)
DEVICE_MODEL := R66S
endef
TARGET_DEVICES += fastrhino_r66s
define Device/fastrhino_r68s
$(call Device/fastrhino_common)
DEVICE_MODEL := R68S
endef
TARGET_DEVICES += fastrhino_r68s
define Device/friendlyarm_nanopi-neo3
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := NanoPi NEO3
SOC := rk3328
UBOOT_DEVICE_NAME := nanopi-r2s-rk3328
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata
endef
TARGET_DEVICES += friendlyarm_nanopi-neo3
define Device/friendlyarm_nanopi-r2c
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := NanoPi R2C
SOC := rk3328
UBOOT_DEVICE_NAME := nanopi-r2c-rk3328
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-usb-net-rtl8152
endef
TARGET_DEVICES += friendlyarm_nanopi-r2c
define Device/friendlyarm_nanopi-r2s
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := NanoPi R2S
SOC := rk3328
UBOOT_DEVICE_NAME := nanopi-r2s-rk3328
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-img | gzip | append-metadata
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-usb-net-rtl8152
endef
TARGET_DEVICES += friendlyarm_nanopi-r2s
@ -17,20 +76,61 @@ define Device/friendlyarm_nanopi-r4s
DEVICE_MODEL := NanoPi R4S
SOC := rk3399
UBOOT_DEVICE_NAME := nanopi-r4s-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r4s | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8169
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r4s | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168 -urngd
endef
TARGET_DEVICES += friendlyarm_nanopi-r4s
define Device/friendlyarm_nanopi-r4se
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := NanoPi R4SE
SOC := rk3399
UBOOT_DEVICE_NAME := nanopi-r4se-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r4s | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168 -urngd
endef
TARGET_DEVICES += friendlyarm_nanopi-r4se
define Device/friendlyarm_nanopi-r5s
DEVICE_VENDOR := FriendlyARM
DEVICE_MODEL := NanoPi R5S
SOC := rk3568
UBOOT_DEVICE_NAME := nanopi-r5s-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r5s | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8125 kmod-nvme kmod-scsi-core
endef
TARGET_DEVICES += friendlyarm_nanopi-r5s
define Device/firefly_station-p2
DEVICE_VENDOR := Firefly
DEVICE_MODEL := Station P2
DEVICE_DTS := rockchip/rk3568-roc-pc
UBOOT_DEVICE_NAME := station-p2-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r5s | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-brcmfmac kmod-ikconfig kmod-ata-ahci-platform station-p2-firmware wpad-openssl
endef
TARGET_DEVICES += firefly_station-p2
define Device/pine64_rockpro64
DEVICE_VENDOR := Pine64
DEVICE_MODEL := RockPro64
SOC := rk3399
UBOOT_DEVICE_NAME := rockpro64-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := -urngd
endef
TARGET_DEVICES += pine64_rockpro64
define Device/radxa_rock-3a
DEVICE_VENDOR := Radxa
DEVICE_MODEL := ROCK3 A
SOC := rk3568
SUPPORTED_DEVICES := radxa,rock3a
UBOOT_DEVICE_NAME := rock-3a-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r5s | pine64-img | gzip | append-metadata
endef
TARGET_DEVICES += radxa_rock-3a
define Device/radxa_rock-pi-4
DEVICE_VENDOR := Radxa
DEVICE_MODEL := ROCK Pi 4
@ -38,5 +138,47 @@ define Device/radxa_rock-pi-4
SUPPORTED_DEVICES := radxa,rockpi4
UBOOT_DEVICE_NAME := rock-pi-4-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := -urngd
endef
TARGET_DEVICES += radxa_rock-pi-4
define Device/radxa_rock-pi-e25
DEVICE_VENDOR := Radxa
DEVICE_MODEL := ROCK Pi E25
SOC := rk3568
SUPPORTED_DEVICES := radxa,rockpi-e25
UBOOT_DEVICE_NAME := rock-pi-e25-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r5s | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8125
endef
TARGET_DEVICES += radxa_rock-pi-e25
define Device/sharevdi_guangmiao-g4c
DEVICE_VENDOR := SHAREVDI
DEVICE_MODEL := GuangMiao G4C
SOC := rk3399
UBOOT_DEVICE_NAME := guangmiao-g4c-rk3399
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r4s | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8168 -urngd
endef
TARGET_DEVICES += sharevdi_guangmiao-g4c
define Device/xunlong_orangepi-r1-plus
DEVICE_VENDOR := Xunlong
DEVICE_MODEL := Orange Pi R1 Plus
SOC := rk3328
UBOOT_DEVICE_NAME := orangepi-r1-plus-rk3328
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-usb-net-rtl8152
endef
TARGET_DEVICES += xunlong_orangepi-r1-plus
define Device/xunlong_orangepi-r1-plus-lts
DEVICE_VENDOR := Xunlong
DEVICE_MODEL := Orange Pi R1 Plus LTS
SOC := rk3328
UBOOT_DEVICE_NAME := orangepi-r1-plus-lts-rk3328
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata
DEVICE_PACKAGES := kmod-usb-net-rtl8152
endef
TARGET_DEVICES += xunlong_orangepi-r1-plus-lts

View file

@ -0,0 +1,8 @@
part uuid mmc ${devnum}:2 uuid
setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xfe660000 root=PARTUUID=${uuid} rw rootwait"
load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb
load mmc ${devnum}:1 ${kernel_addr_r} kernel.img
booti ${kernel_addr_r} - ${fdt_addr_r}