forked from mirror/openwrt
Compare commits
10 commits
main
...
mikrotik_s
| Author | SHA1 | Date | |
|---|---|---|---|
| 60527a9a95 | |||
|
|
f1862ad8e9 | ||
|
|
5b5439ad23 | ||
|
|
ccd3670ec4 | ||
|
|
560f679c3e | ||
|
|
25677ef7ec | ||
|
|
31b3a8f0a1 | ||
|
|
ddc389fa49 | ||
|
|
3b42f2f4c3 | ||
| a65b45d8c4 |
11 changed files with 252 additions and 3 deletions
|
|
@ -492,7 +492,7 @@ define Build/yaffs-filesystem
|
||||||
filesystem_size="filesystem_blocks * 64 * 1024" \
|
filesystem_size="filesystem_blocks * 64 * 1024" \
|
||||||
filesystem_size_with_reserve="(filesystem_blocks + 2) * 64 * 1024"; \
|
filesystem_size_with_reserve="(filesystem_blocks + 2) * 64 * 1024"; \
|
||||||
head -c $$filesystem_size_with_reserve /dev/zero | tr "\000" "\377" > $@.img \
|
head -c $$filesystem_size_with_reserve /dev/zero | tr "\000" "\377" > $@.img \
|
||||||
&& yafut -d $@.img -w -i $@ -o kernel -C 1040 -B 64k -E -P -S $(1) \
|
&& yafut -d $@.img -w -i $@ -o $(if $(findstring v7,$@),bootimage,kernel) -C 1040 -B 64k -E -P -S $(1) \
|
||||||
&& truncate -s $$filesystem_size $@.img \
|
&& truncate -s $$filesystem_size $@.img \
|
||||||
&& mv $@.img $@
|
&& mv $@.img $@
|
||||||
endef
|
endef
|
||||||
|
|
@ -530,6 +530,11 @@ define Build/gl-qsdk-factory
|
||||||
$(KDIR_TMP)/$(notdir $(BOOT_SCRIPT))
|
$(KDIR_TMP)/$(notdir $(BOOT_SCRIPT))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Build/kernel-pack-npk
|
||||||
|
PYTHONPATH="$(STAGING_DIR_HOST)/share/npkpy" python $(STAGING_DIR_HOST)/share/npkpy/pack_npk_kernel.py --kernel $@ --output $@.npk
|
||||||
|
mv $@.npk $@
|
||||||
|
endef
|
||||||
|
|
||||||
define Build/linksys-image
|
define Build/linksys-image
|
||||||
let \
|
let \
|
||||||
size="$$(stat -c%s $@)" \
|
size="$$(stat -c%s $@)" \
|
||||||
|
|
|
||||||
23
scripts/flashing/mikrotik_ethboot.sh
Executable file
23
scripts/flashing/mikrotik_ethboot.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
IFNAME=enp101s0f4u1
|
||||||
|
IP="192.168.88.10"
|
||||||
|
BOOTFILE="mikrotik.initramfs"
|
||||||
|
|
||||||
|
/sbin/ip addr replace $IP/24 dev $IFNAME
|
||||||
|
/sbin/ip link set dev $IFNAME up
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/usr/sbin/dnsmasq \
|
||||||
|
--no-daemon \
|
||||||
|
--listen-address $IP \
|
||||||
|
--bind-interfaces \
|
||||||
|
-p0 \
|
||||||
|
--dhcp-authoritative \
|
||||||
|
--dhcp-range=192.168.88.100,192.168.88.200 \
|
||||||
|
--bootp-dynamic \
|
||||||
|
--dhcp-boot=mikrotik.initramfs \
|
||||||
|
--log-dhcp \
|
||||||
|
--enable-tftp \
|
||||||
|
--tftp-root=$(pwd)
|
||||||
|
|
||||||
|
|
@ -13,6 +13,10 @@ define Device/mikrotik_nor
|
||||||
IMAGE/sysupgrade.bin := append-kernel | yaffs-filesystem -M | \
|
IMAGE/sysupgrade.bin := append-kernel | yaffs-filesystem -M | \
|
||||||
pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
|
pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
|
||||||
check-size | append-metadata
|
check-size | append-metadata
|
||||||
|
IMAGES += sysupgrade-v7.bin
|
||||||
|
IMAGE/sysupgrade-v7.bin := append-kernel | kernel-pack-npk | \
|
||||||
|
yaffs-filesystem -M | pad-to $$$$(BLOCKSIZE) | \
|
||||||
|
append-rootfs | pad-rootfs | check-size | append-metadata
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Device/mikrotik_nand
|
define Device/mikrotik_nand
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,13 @@ define Device/mikrotik_nor
|
||||||
KERNEL_NAME := vmlinux
|
KERNEL_NAME := vmlinux
|
||||||
KERNEL := kernel-bin | append-dtb-elf
|
KERNEL := kernel-bin | append-dtb-elf
|
||||||
IMAGES = sysupgrade.bin
|
IMAGES = sysupgrade.bin
|
||||||
|
IMAGES += sysupgrade-v7.bin
|
||||||
IMAGE/sysupgrade.bin := append-kernel | yaffs-filesystem -L | \
|
IMAGE/sysupgrade.bin := append-kernel | yaffs-filesystem -L | \
|
||||||
pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
|
pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
|
||||||
check-size | append-metadata
|
check-size | append-metadata
|
||||||
|
IMAGE/sysupgrade-v7.bin := append-kernel | kernel-pack-npk | \
|
||||||
|
yaffs-filesystem -L | pad-to $$$$(BLOCKSIZE) | \
|
||||||
|
append-rootfs | pad-rootfs | check-size | append-metadata
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Device/mikrotik_nand
|
define Device/mikrotik_nand
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ include $(TOPDIR)/rules.mk
|
||||||
ARCH:=aarch64
|
ARCH:=aarch64
|
||||||
BOARD:=qualcommax
|
BOARD:=qualcommax
|
||||||
BOARDNAME:=Qualcomm Atheros 802.11ax WiSoC-s
|
BOARDNAME:=Qualcomm Atheros 802.11ax WiSoC-s
|
||||||
FEATURES:=squashfs ramdisk fpu nand rtc emmc
|
FEATURES:=squashfs ramdisk fpu nand rtc emmc minor
|
||||||
KERNELNAME:=Image
|
KERNELNAME:=vmlinux
|
||||||
CPU_TYPE:=cortex-a53
|
CPU_TYPE:=cortex-a53
|
||||||
SUBTARGETS:=ipq807x ipq60xx ipq50xx
|
SUBTARGETS:=ipq807x ipq60xx ipq50xx
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,150 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||||
|
|
||||||
|
/dts-v1/;
|
||||||
|
|
||||||
|
#include "ipq5018.dtsi"
|
||||||
|
#include "ipq5018-ess.dtsi"
|
||||||
|
|
||||||
|
#include <dt-bindings/gpio/gpio.h>
|
||||||
|
#include <dt-bindings/input/input.h>
|
||||||
|
#include <dt-bindings/leds/common.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
model = "MikroTik SXTsq 5 ax";
|
||||||
|
compatible = "mikrotik,sxtsq-5-ax", "qcom,ipq5018";
|
||||||
|
|
||||||
|
aliases {
|
||||||
|
led-boot = &led_power;
|
||||||
|
led-failsafe = &led_power;
|
||||||
|
led-running = &led_power;
|
||||||
|
led-upgrade = &led_power;
|
||||||
|
};
|
||||||
|
|
||||||
|
chosen {
|
||||||
|
bootargs-append = " netconsole=@/,@10.0.0.2/";
|
||||||
|
};
|
||||||
|
|
||||||
|
leds {
|
||||||
|
compatible = "gpio-leds";
|
||||||
|
pinctrl-0 = <&led_pins>;
|
||||||
|
pinctrl-names = "default";
|
||||||
|
|
||||||
|
led_user: user {
|
||||||
|
gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>;
|
||||||
|
color = <LED_COLOR_ID_GREEN>;
|
||||||
|
function = LED_FUNCTION_STATUS;
|
||||||
|
};
|
||||||
|
|
||||||
|
led_power: power {
|
||||||
|
gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>;
|
||||||
|
color = <LED_COLOR_ID_BLUE>;
|
||||||
|
function = LED_FUNCTION_POWER;
|
||||||
|
panic-indicator;
|
||||||
|
};
|
||||||
|
|
||||||
|
led_eth {
|
||||||
|
gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;
|
||||||
|
color = <LED_COLOR_ID_GREEN>;
|
||||||
|
function = LED_FUNCTION_LAN;
|
||||||
|
};
|
||||||
|
rssilow {
|
||||||
|
label = "green:rssilow";
|
||||||
|
gpios = <&tlmm 17 GPIO_ACTIVE_HIGH>;
|
||||||
|
color = <LED_COLOR_ID_GREEN>;
|
||||||
|
};
|
||||||
|
|
||||||
|
rssimediumlow {
|
||||||
|
label = "green:rssimediumlow";
|
||||||
|
gpios = <&tlmm 19 GPIO_ACTIVE_HIGH>;
|
||||||
|
color = <LED_COLOR_ID_GREEN>;
|
||||||
|
};
|
||||||
|
|
||||||
|
rssimedium {
|
||||||
|
label = "green:rssimedium";
|
||||||
|
gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>;
|
||||||
|
color = <LED_COLOR_ID_GREEN>;
|
||||||
|
};
|
||||||
|
|
||||||
|
rssimediumhigh {
|
||||||
|
label = "green:rssimediumhigh";
|
||||||
|
gpios = <&tlmm 26 GPIO_ACTIVE_HIGH>;
|
||||||
|
color = <LED_COLOR_ID_GREEN>;
|
||||||
|
};
|
||||||
|
|
||||||
|
rssihigh {
|
||||||
|
label = "green:rssihigh";
|
||||||
|
gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>;
|
||||||
|
color = <LED_COLOR_ID_GREEN>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
reserved-memory {
|
||||||
|
q6_mem_regions: q6_mem_regions@4b000000 {
|
||||||
|
no-map;
|
||||||
|
reg = <0x0 0x4b000000 0x0 0x3000000>;
|
||||||
|
status = "disabled";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&sleep_clk {
|
||||||
|
clock-frequency = <32000>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&xo_board_clk {
|
||||||
|
clock-frequency = <24000000>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&crypto {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&cryptobam {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&prng {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&qfprom {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&qpic_bam {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&tlmm {
|
||||||
|
led_pins: led-pins {
|
||||||
|
pins = "gpio46", "gpio20", "gpio30", "gpio17",
|
||||||
|
"gpio19", "gpio25", "gpio26", "gpio34";
|
||||||
|
function = "gpio";
|
||||||
|
drive-strength = <8>;
|
||||||
|
bias-pull-down;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&switch {
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
switch_mac_mode = <MAC_MODE_SGMII_CHANNEL0>;
|
||||||
|
|
||||||
|
qcom,port_phyinfo {
|
||||||
|
port@0 {
|
||||||
|
port_id = <1>;
|
||||||
|
mdiobus = <&mdio0>;
|
||||||
|
phy_address = <7>;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&mdio0 {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&tsens {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
@ -36,6 +36,26 @@ define Device/elecom_wrc-x3000gs2
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += elecom_wrc-x3000gs2
|
TARGET_DEVICES += elecom_wrc-x3000gs2
|
||||||
|
|
||||||
|
define Device/mikrotik_nor
|
||||||
|
DEVICE_VENDOR := MikroTik
|
||||||
|
BLOCKSIZE := 64k
|
||||||
|
KERNEL_NAME := vmlinux.elf
|
||||||
|
KERNEL_INITRAMFS_NAME = vmlinux-initramfs.elf
|
||||||
|
KERNEL := kernel-bin
|
||||||
|
IMAGES = sysupgrade-v7.bin
|
||||||
|
IMAGE/sysupgrade-v7.bin := append-kernel | kernel-pack-npk | \
|
||||||
|
yaffs-filesystem -L | pad-to $$$$(BLOCKSIZE) | \
|
||||||
|
append-rootfs | pad-rootfs | check-size | append-metadata
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Device/mikrotik_sxtsq-5-ax
|
||||||
|
$(call Device/mikrotik_nor)
|
||||||
|
DEVICE_VENDOR := MikroTik
|
||||||
|
DEVICE_MODEL := SXTsq 5 ax
|
||||||
|
SOC := ipq5018
|
||||||
|
endef
|
||||||
|
TARGET_DEVICES += mikrotik_sxtsq-5-ax
|
||||||
|
|
||||||
define Device/glinet_gl-b3000
|
define Device/glinet_gl-b3000
|
||||||
$(call Device/FitImage)
|
$(call Device/FitImage)
|
||||||
DEVICE_VENDOR := GL.iNet
|
DEVICE_VENDOR := GL.iNet
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
SUBTARGET:=ipq50xx
|
SUBTARGET:=ipq50xx
|
||||||
BOARDNAME:=Qualcomm Atheros IPQ50xx
|
BOARDNAME:=Qualcomm Atheros IPQ50xx
|
||||||
DEFAULT_PACKAGES += ath11k-firmware-ipq5018
|
DEFAULT_PACKAGES += ath11k-firmware-ipq5018
|
||||||
|
IMAGES_DIR:=compressed
|
||||||
|
|
||||||
define Target/Description
|
define Target/Description
|
||||||
Build firmware images for Qualcomm Atheros IPQ50xx based boards.
|
Build firmware images for Qualcomm Atheros IPQ50xx based boards.
|
||||||
|
|
|
||||||
|
|
@ -223,6 +223,7 @@ endef
|
||||||
define Build/zytrx-header
|
define Build/zytrx-header
|
||||||
$(eval board=$(word 1,$(1)))
|
$(eval board=$(word 1,$(1)))
|
||||||
$(eval version=$(word 2,$(1)))
|
$(eval version=$(word 2,$(1)))
|
||||||
|
$(eval version=$(shell echo $(version) | cut -c 1-31))
|
||||||
$(STAGING_DIR_HOST)/bin/zytrx -B '$(board)' -v '$(version)' -i $@ -o $@.new
|
$(STAGING_DIR_HOST)/bin/zytrx -B '$(board)' -v '$(version)' -i $@ -o $@.new
|
||||||
mv $@.new $@
|
mv $@.new $@
|
||||||
endef
|
endef
|
||||||
|
|
@ -2091,9 +2092,16 @@ define Device/MikroTik
|
||||||
DEVICE_PACKAGES := kmod-usb3 -uboot-envtools
|
DEVICE_PACKAGES := kmod-usb3 -uboot-envtools
|
||||||
KERNEL_NAME := vmlinuz
|
KERNEL_NAME := vmlinuz
|
||||||
KERNEL := kernel-bin | append-dtb-elf
|
KERNEL := kernel-bin | append-dtb-elf
|
||||||
|
LOADER_TYPE := elf
|
||||||
|
KERNEL_INITRAMFS_NAME := vmlinux-initramfs
|
||||||
|
KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel
|
||||||
IMAGE/sysupgrade.bin := append-kernel | yaffs-filesystem -L | \
|
IMAGE/sysupgrade.bin := append-kernel | yaffs-filesystem -L | \
|
||||||
pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size | \
|
pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size | \
|
||||||
append-metadata
|
append-metadata
|
||||||
|
IMAGES += sysupgrade-v7.bin
|
||||||
|
IMAGE/sysupgrade-v7.bin := append-kernel | kernel-pack-npk | \
|
||||||
|
yaffs-filesystem -L | pad-to $$$$(BLOCKSIZE) | \
|
||||||
|
append-rootfs | pad-rootfs | check-size | append-metadata
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Device/mikrotik_ltap-2hnd
|
define Device/mikrotik_ltap-2hnd
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USES_MINOR),y) += yafut
|
||||||
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_SPARSE),y) += sparse
|
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_SPARSE),y) += sparse
|
||||||
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_LLVM_BUILD),y) += llvm-bpf
|
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_LLVM_BUILD),y) += llvm-bpf
|
||||||
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_MOLD),y) += mold
|
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USE_MOLD),y) += mold
|
||||||
|
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_USES_MINOR),y) += npkpy
|
||||||
|
|
||||||
# builddir dependencies
|
# builddir dependencies
|
||||||
$(curdir)/autoconf/compile := $(curdir)/m4/compile
|
$(curdir)/autoconf/compile := $(curdir)/m4/compile
|
||||||
|
|
|
||||||
33
tools/npkpy/Makefile
Normal file
33
tools/npkpy/Makefile
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 OpenWrt.org
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=npkpy
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_SOURCE_PROTO:=git
|
||||||
|
PKG_SOURCE_URL:=https://github.com/john-tho/npkpy.git
|
||||||
|
PKG_SOURCE_DATE:=2023-01-22
|
||||||
|
PKG_SOURCE_VERSION:=771dddc5aaaff95a9b4160d6867152cfa1a9255f
|
||||||
|
PKG_MIRROR_HASH:=430375e34117f39cd557025ca7ea84cfad9ac209ee911f3c41f2a5c22f77b886
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/host-build.mk
|
||||||
|
|
||||||
|
define Host/Compile
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Host/Install
|
||||||
|
mkdir -p $(STAGING_DIR_HOST)/share/npkpy
|
||||||
|
$(CP) $(HOST_BUILD_DIR)/npkpy $(STAGING_DIR_HOST)/share/npkpy/
|
||||||
|
$(CP) $(HOST_BUILD_DIR)/tools/demo_pack_kernel/poc_pack_kernel.py $(STAGING_DIR_HOST)/share/npkpy/pack_npk_kernel.py
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Host/Clean
|
||||||
|
rm -rf $(STAGING_DIR_HOST)/share/npkpy
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call HostBuild))
|
||||||
Loading…
Add table
Reference in a new issue