Skip to content

Commit 2d7aeef

Browse files
authored
Photonicat (#827)
* Update remake * Create .root * Create .root * Add files via upload * Create .root * Add files via upload * Create ath10k * Add files via upload * Add files via upload * Delete make-openwrt/openwrt-files/different-files/photonicat/.root * Delete make-openwrt/openwrt-files/different-files/photonicat/boot/.root * Delete make-openwrt/openwrt-files/different-files/photonicat/rootfs/etc/board.d/.root * Delete make-openwrt/openwrt-files/different-files/photonicat/boot/boot.scr * Create armbianEnv.txt * Add files via upload * Update model_database.conf * Update armbianEnv.txt
1 parent a1f4485 commit 2d7aeef

File tree

15 files changed

+195
-1
lines changed

15 files changed

+195
-1
lines changed

make-openwrt/openwrt-files/common-files/etc/model_database.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ r214 :Alark35-3500 :rk3568 :rk3568-alark35
248248
r215 :MMBox-Anas3035 :rk3568 :rk3568-mmbox-anas3035.dtb :NA :NA :u-boot-rockchip.bin :4GB-LPDDR4,32G-eMMC,3xSATA,2x2.5Gb-Nic :stable/6.12.y :rockchip :rk3568 :armbianEnv.txt :ritech :anas3035 :yes
249249
#-------+----------------------------------------------+---------+-----------------------------------------+-----------------------------+------------------------------------+--------------------------------+-------------------------------------------+----------------------+------------+-------------+----------------+-----------------------------------------------------+--------------------+----------
250250
r216 :Wocyber-A3 :rk3568 :rk3568-wocyber-a3.dtb :NA :u-boot.itb :idbloader.img :4GB-LPDDR4,128G-eMMC,1xSATA,1Gb-Nic :stable/6.12.y :rockchip :rk3568 :armbianEnv.txt :Arthur97172 :wocyber-a3 :yes
251+
r217 :photonicat :rk3568 :rk3568-photonicat.dtb :NA :u-boot.itb :idbloader.img :4GB-LPDDR4,256G-eMMC,wifi,1Gb-Nic :stable/6.12.y :rockchip :rk3568 :armbianEnv.txt :sibondt :photonicat :yes
251252

252253

253254
# Rockchip RK3566 Family
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
verbosity=1
2+
bootlogo=false
3+
fdtfile=rockchip/rk3568-photonicat.dtb
4+
rootdev=/dev/mmcblk0p2
5+
rootfstype=ext4
6+
rootflags=rw,errors=remount-ro
7+
overlay_prefix=rk3568
8+
overlays=
9+
extraargs=rw rootwait
10+
extraboardargs=net.ifnames=0 max_loop=128
11+
docker_optimizations=on
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# DO NOT EDIT THIS FILE
2+
#
3+
# Please edit /boot/armbianEnv.txt to set supported parameters
4+
#
5+
6+
setenv load_addr "0x9000000"
7+
setenv overlay_error "false"
8+
# default values
9+
setenv rootdev "/dev/mmcblk0p1"
10+
setenv verbosity "1"
11+
setenv console "both"
12+
setenv bootlogo "false"
13+
setenv rootfstype "ext4"
14+
setenv docker_optimizations "on"
15+
setenv earlycon "off"
16+
17+
echo "Boot script loaded from ${devtype} ${devnum}"
18+
19+
if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then
20+
load ${devtype} ${devnum} ${load_addr} ${prefix}armbianEnv.txt
21+
env import -t ${load_addr} ${filesize}
22+
fi
23+
24+
if test "${logo}" = "disabled"; then setenv logo "logo.nologo"; fi
25+
26+
if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
27+
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "console=ttyS2,1500000 ${consoleargs}"; fi
28+
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
29+
if test "${bootlogo}" = "true"; then
30+
setenv consoleargs "splash plymouth.ignore-serial-consoles ${consoleargs}"
31+
else
32+
setenv consoleargs "splash=verbose ${consoleargs}"
33+
fi
34+
35+
# get PARTUUID of first partition on SD/eMMC the boot script was loaded from
36+
if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:1 partuuid; fi
37+
38+
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs} net.ifnames=0 biosdevname=0"
39+
40+
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1"; fi
41+
42+
load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd
43+
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image
44+
45+
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
46+
fdt addr ${fdt_addr_r}
47+
fdt resize 65536
48+
for overlay_file in ${overlays}; do
49+
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
50+
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
51+
fdt apply ${load_addr} || setenv overlay_error "true"
52+
fi
53+
done
54+
for overlay_file in ${user_overlays}; do
55+
if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then
56+
echo "Applying user provided DT overlay ${overlay_file}.dtbo"
57+
fdt apply ${load_addr} || setenv overlay_error "true"
58+
fi
59+
done
60+
if test "${overlay_error}" = "true"; then
61+
echo "Error applying DT overlays, restoring original DT"
62+
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
63+
else
64+
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-fixup.scr; then
65+
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
66+
source ${load_addr}
67+
fi
68+
if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then
69+
load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr
70+
echo "Applying user provided fixup script (fixup.scr)"
71+
source ${load_addr}
72+
fi
73+
fi
74+
kaslrseed
75+
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
76+
77+
# Recompile with:
78+
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
xhci-hcd:usb5 5
2+
xhci-hcd:usb7 6
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (C) 2015 OpenWrt.org
2+
3+
. /lib/functions/uci-defaults.sh
4+
5+
board_config_update
6+
7+
ucidef_set_board_id "Photonicat"
8+
ucidef_set_model_name "Photonicat"
9+
10+
board_config_flush
11+
12+
exit 0
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (C) 2015 OpenWrt.org
4+
#
5+
6+
. /lib/functions/uci-defaults.sh
7+
8+
board_config_update
9+
10+
ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0"
11+
12+
board_config_flush
13+
14+
exit 0
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
. /lib/functions/uci-defaults.sh
2+
. /lib/functions/system.sh
3+
4+
board_config_update
5+
6+
generate_mac() {
7+
# https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt
8+
# The MAC address range registered by realtek manufacturers is as follows:
9+
local mac_grp_0="00:20:18:"
10+
local mac_grp_1="00:4f:49:"
11+
local mac_grp_2="00:60:52:"
12+
local mac_grp_3="00:e0:4c:"
13+
local mac_grp_4="52:54:00:"
14+
local mac_grp_5="52:54:ab:"
15+
local mac_grp_cnt=6
16+
17+
# get the cpu/emmc/sd unique id
18+
local sd_hash
19+
if [ -f "/sys/class/block/mmcblk1/device/cid" ]; then
20+
sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1)
21+
elif [ -f "/sys/class/block/mmcblk0/device/cid" ]; then
22+
sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1)
23+
else
24+
sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1)
25+
fi
26+
27+
# get mac address head
28+
local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6)
29+
local idx=$((dice % mac_grp_cnt))
30+
eval local mac_head="\$mac_grp_${idx}"
31+
32+
# get mac address tail
33+
# sd_hash length: max 64
34+
local mac_tail=$(echo $sd_hash | cut -b 16-17)":"$(echo $sd_hash | cut -b 26-27)":"$(echo $sd_hash | cut -b 42-43)
35+
36+
echo "${mac_head}${mac_tail}"
37+
}
38+
39+
swap_interface() {
40+
local eth_a=$1
41+
local eth_b=$2
42+
ip link set dev $eth_a down
43+
ip link set dev $eth_b down
44+
ip link set $eth_a name eth-rename-tmp
45+
ip link set $eth_b name $eth_a
46+
ip link set eth-rename-tmp name $eth_b
47+
ip link set dev $eth_a up
48+
ip link set dev $eth_b up
49+
}
50+
51+
json_is_a network object && exit 0
52+
53+
# Init LAN and WAN
54+
LAN_MAC=$(generate_mac)
55+
WAN_MAC=$(macaddr_add $LAN_MAC +1)
56+
ucidef_set_interface_lan 'eth0'
57+
ucidef_set_interface_macaddr "lan" $LAN_MAC
58+
if [ -d "/sys/class/net/eth1" ]; then
59+
ucidef_set_interface_wan 'eth1'
60+
ucidef_set_interface_macaddr "wan" $WAN_MAC
61+
fi
62+
63+
board_config_flush
64+
65+
exit 0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
::sysinit:/etc/init.d/rcS S boot
2+
::shutdown:/etc/init.d/rcS K shutdown
3+
tty1::askfirst:/usr/libexec/login.sh
4+
ttyS2::askfirst:/usr/libexec/login.sh
5+
ttyFIQ0::askfirst:/usr/libexec/login.sh
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ath10k_core
2+
ath10k_pci

0 commit comments

Comments
 (0)