mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 09:32:34 +00:00
mediatek: Add SENAO IAP4300M
Specifications: SoC: MediaTek MT7986A RF Chipset: MT7976G @2.4GHz 4T4R MT7976A @5ghz 4T4R RAM: 1GB DDR4 RAM (2x 512MB) Flash: SPI-NAND 256 MiB Ethernet: 1x 2.5GbE PHY Reset Button Power Source: DC IN 12v, Standard PoE 802.3af/at LED Indicator: 4 x single color LED (GPIO Control) Fixes: WIFI-13983 Signed-off-by: Steven Lin <steven.lin@senao.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpQIBAAKCAQEAylkhSz5UGwJnJjIchwS8KeJEmf2apWM40/z3ukTZHvnzR6cH
|
||||
Wvx0uahlMaHdnXlt1+a1ZjEr9VIehFsnad1MmF0p3evHSdW95q4KXn7QXD0kfTrs
|
||||
yiBbUbrzG+VSokpTY0xoUaqxSJWZyf0cytnnB+HYHVdjj5zshNHzJRCH494hB50m
|
||||
wzw3jyB15DAQzCrd3nhRpb/SwdaMV80M9AzhxfvL6vMpWn+GcA9SPMEZupbFYPZv
|
||||
7H/tDr6f+ZFQH8LCOuzA3wELbm6ML2pzRhR6iL8d8yft6k02uQ3C5mGXgz1LD7io
|
||||
alEu3LrvkcUdcBmaaBlO3cdvvSygArZZXFsIFwIDAQABAoIBAQCBbgGd34Bsxly0
|
||||
Udltg9nX8KNw3IbOw2jWMDlFLES1S6wRaQWLbXA8UTppROA8mi9oqmndtBYqFRzw
|
||||
DF5pmOQlkXH2QZp34ABYTXrUdslQNsvgTpCnuYqv/KUEcusoY+Jy4azYkBZWF1sH
|
||||
mJ+SIU9l+1ABdKR6eCXRz3l3e9twJMCoNbC6Sjohw32+YnFhChBKYH4v2tIbKGed
|
||||
L/xBli4a9JqGHDI3+wY/3bDy2pr88RL631ru3KWN0QfokKv1dMDFFxnes7bhIeTD
|
||||
oOJeCMPKOx6QU1zsNOb2N2OYfsr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Rohg
|
||||
InfRQ/wEMlBeEWYgTHqMOfJCCWLeY8bGh3lU2MVSE2IkPlbb7/XIH5DXLpHi9fBh
|
||||
3rARGv34J2vWuDFhbDcoI+dJkfQ1cX5aRrb13hMCgYBHGw9XJnBIlsWMcFUdtC8w
|
||||
rmoWz1E5TY6tkispUt95G+Eak13luSU2tg2bgNRLt2QvzUAqWybOmhv8quxrOih6
|
||||
CwT++EkBRs6NdZICVnmcHgzl88pRpIxePIzV186V7FzEgmJ851pc8dONYEhAYJAh
|
||||
KHa9mCrPObYM/faOM/p83QKBgBE5t6ROR3INrX5sbZuXAeHMK8jHAzmmRaYUv3JV
|
||||
1UbQrG3l0KdJM+P+0kOkwlxRzaBjvj5EFQ46GCPm5wDBighVLvBcggi6T07xVGb3
|
||||
wWDwupcunfQXg9d7dx9/upnRt7c0HMF0monslnahXTi1SzUcXSwykWMLh1OkZ5mN
|
||||
f7TdAoGABh4DU0SB7bY8LnQ21jNlzi3qdj4EKMkfQyTVDiT84hXi42OhGN23jKuI
|
||||
2tl6KMqdsN/GLNCPGy5VMfbQCFyyn3g2gHc2Cl90LRf/PsQ4v4HD/c+bjEPJUrYe
|
||||
W2sPfHJqK3UsUL68JVaVsHZZ49oM1wJr0bn82Pl/+kNe02Njs2U=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -0,0 +1,21 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDazCCAlOgAwIBAgIUDRQDKYZevoXzVn+I8sJA7oo0TWowDQYJKoZIhvcNAQEL
|
||||
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
|
||||
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA0MDIwNTIwMDhaFw0yNDA1
|
||||
MDIwNTIwMDhaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
|
||||
HwYDVQQKDBhJbnRlcm5ldCBXaWRn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jJovkulYu3bvP8XItL/YNIo5OF8dlpV46kQY
|
||||
QWTgTYpeEDYQWUzp+UyrcSJhTH0XJcVL9npXfQsCgYEAvS2SSPO1L4VztiRKeTEZ
|
||||
SerIH0OIzsj2Pby3tGyzBsUZ5DWZ2J+uHGn/Se2EPjBkUhcpcDzZdXFq5YurXxYq
|
||||
04gQIPw2bh5b6XukkfOuNHWQTsd6Sb7opJGxoU8SZMLiiThU6EIDI6IM/YDtpL3t
|
||||
a0sR5n8ZeSasoagmPBrtRPECgYEAiui/7fSMB/vI9iGNBFA0yvOR6sRYEtHSHXFC
|
||||
kNMBTm+Y4wzmi1H9Ztgv8hu+1k9+zazmSr4ITK9MYY48osQHVunOEutC0pygPO/T
|
||||
zLMBoSGIKiEKkQyUpO4yy2Cb3rfBSQD7TNePIHwGN022lw8YAnCgiqHfkWq78CA6
|
||||
nyrAFeMCgYBDciC+Haz5Z38qzUrHYeTpFnUzKn6JW9RezCD61+LGHnhSaIm+9SsR
|
||||
gtyzSr8K1btoMxKjZeGc0zbYvgtbZFviUtb1ixevqI2K58IT/vPELxlE4AYq5pZQ
|
||||
/1/lITNjBLuAfZG7TCQK2JCPVGkTKpk9ewRXnfncfP2sFxVdYOFALQ==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -0,0 +1,413 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
/*
|
||||
* Copyright (C) 2021 MediaTek Inc.
|
||||
* Author: Sam.Shih <sam.shih@mediatek.com>
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include "mt7986a.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
/ {
|
||||
model = "SENAO IAP4300M";
|
||||
compatible = "senao,iap4300m", "mediatek,mt7986a";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_green;
|
||||
led-failsafe = &led_green;
|
||||
led-running = &led_green;
|
||||
led-upgrade = &led_green;
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
memory {
|
||||
reg = <0 0x40000000 0 0x40000000>;
|
||||
};
|
||||
|
||||
reg_1p8v: regulator-1p8v {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "fixed-1.8V";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
reg_3p3v: regulator-3p3v {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "fixed-3.3V";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
reg_5v: regulator-5v {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "fixed-5V";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_green: led@0 {
|
||||
label = "green:power";
|
||||
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@1 {
|
||||
label = "wan";
|
||||
gpios = <&pio 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led@2 {
|
||||
label = "wifi5";
|
||||
gpios = <&pio 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
led@3 {
|
||||
label = "wifi2";
|
||||
gpios = <&pio 13 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ð {
|
||||
status = "okay";
|
||||
|
||||
gmac1: mac@1 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <1>;
|
||||
phy-mode = "2500base-x";
|
||||
};
|
||||
|
||||
mdio: mdio-bus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
&watchdog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&wbsys {
|
||||
status = "okay";
|
||||
mediatek,mtd-eeprom = <&factory 0x0000>;
|
||||
pinctrl-names = "default", "dbdc";
|
||||
pinctrl-0 = <&wf_2g_5g_pins>;
|
||||
pinctrl-1 = <&wf_dbdc_pins>;
|
||||
clocks = <&topckgen CLK_TOP_CONN_MCUSYS_SEL>,
|
||||
<&topckgen CLK_TOP_AP2CNN_HOST_SEL>;
|
||||
clock-names = "mcu", "ap2conn";
|
||||
|
||||
};
|
||||
|
||||
&mdio {
|
||||
phy6: phy@6 {
|
||||
compatible = "ethernet-phy-ieee802.3-c45";
|
||||
reg = <6>;
|
||||
reset-gpios = <&pio 6 1>;
|
||||
reset-deassert-us = <20000>;
|
||||
};
|
||||
};
|
||||
|
||||
&crypto {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mmc0 {
|
||||
pinctrl-names = "default", "state_uhs";
|
||||
pinctrl-0 = <&mmc0_pins_default>;
|
||||
pinctrl-1 = <&mmc0_pins_uhs>;
|
||||
bus-width = <8>;
|
||||
max-frequency = <200000000>;
|
||||
cap-mmc-highspeed;
|
||||
mmc-hs200-1_8v;
|
||||
mmc-hs400-1_8v;
|
||||
hs400-ds-delay = <0x14014>;
|
||||
vmmc-supply = <®_3p3v>;
|
||||
vqmmc-supply = <®_1p8v>;
|
||||
non-removable;
|
||||
no-sd;
|
||||
no-sdio;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pcie_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pio {
|
||||
mmc0_pins_default: mmc0-pins {
|
||||
mux {
|
||||
function = "emmc";
|
||||
groups = "emmc_51";
|
||||
};
|
||||
conf-cmd-dat {
|
||||
pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
|
||||
"EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
|
||||
"EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
|
||||
input-enable;
|
||||
drive-strength = <4>;
|
||||
mediatek,pull-up-adv = <1>; /* pull-up 10K */
|
||||
};
|
||||
conf-clk {
|
||||
pins = "EMMC_CK";
|
||||
drive-strength = <6>;
|
||||
mediatek,pull-down-adv = <2>; /* pull-down 50K */
|
||||
};
|
||||
conf-ds {
|
||||
pins = "EMMC_DSL";
|
||||
mediatek,pull-down-adv = <2>; /* pull-down 50K */
|
||||
};
|
||||
conf-rst {
|
||||
pins = "EMMC_RSTB";
|
||||
drive-strength = <4>;
|
||||
mediatek,pull-up-adv = <1>; /* pull-up 10K */
|
||||
};
|
||||
};
|
||||
|
||||
mmc0_pins_uhs: mmc0-uhs-pins {
|
||||
mux {
|
||||
function = "emmc";
|
||||
groups = "emmc_51";
|
||||
};
|
||||
conf-cmd-dat {
|
||||
pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
|
||||
"EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
|
||||
"EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
|
||||
input-enable;
|
||||
drive-strength = <4>;
|
||||
mediatek,pull-up-adv = <1>; /* pull-up 10K */
|
||||
};
|
||||
conf-clk {
|
||||
pins = "EMMC_CK";
|
||||
drive-strength = <6>;
|
||||
mediatek,pull-down-adv = <2>; /* pull-down 50K */
|
||||
};
|
||||
conf-ds {
|
||||
pins = "EMMC_DSL";
|
||||
mediatek,pull-down-adv = <2>; /* pull-down 50K */
|
||||
};
|
||||
conf-rst {
|
||||
pins = "EMMC_RSTB";
|
||||
drive-strength = <4>;
|
||||
mediatek,pull-up-adv = <1>; /* pull-up 10K */
|
||||
};
|
||||
};
|
||||
|
||||
pcie_pins: pcie0-pins-9-10-41 {
|
||||
mux {
|
||||
function = "pcie";
|
||||
groups = "pcie_clk", "pcie_wake", "pcie_pereset";
|
||||
};
|
||||
};
|
||||
|
||||
spic_pins_g2: spic-pins-29-to-32 {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi1_2";
|
||||
};
|
||||
};
|
||||
|
||||
spi_flash_pins: spi-flash-pins-33-to-38 {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi0", "spi0_wp_hold";
|
||||
};
|
||||
conf-pu {
|
||||
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
|
||||
drive-strength = <8>;
|
||||
mediatek,pull-up-adv = <0>; /* bias-disable */
|
||||
};
|
||||
conf-pd {
|
||||
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
|
||||
drive-strength = <8>;
|
||||
mediatek,pull-down-adv = <0>; /* bias-disable */
|
||||
};
|
||||
};
|
||||
|
||||
uart1_pins: uart1-pins {
|
||||
mux {
|
||||
function = "uart";
|
||||
groups = "uart1";
|
||||
};
|
||||
};
|
||||
|
||||
uart2_pins: uart2-pins {
|
||||
mux {
|
||||
function = "uart";
|
||||
groups = "uart2";
|
||||
};
|
||||
};
|
||||
|
||||
wf_2g_5g_pins: wf_2g_5g-pins {
|
||||
mux {
|
||||
function = "wifi";
|
||||
groups = "wf_2g", "wf_5g";
|
||||
};
|
||||
conf {
|
||||
pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
|
||||
"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
|
||||
"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
|
||||
"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
|
||||
"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
|
||||
"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
|
||||
"WF1_TOP_CLK", "WF1_TOP_DATA";
|
||||
drive-strength = <MTK_DRIVE_4mA>;
|
||||
};
|
||||
};
|
||||
|
||||
wf_dbdc_pins: wf_dbdc-pins {
|
||||
mux {
|
||||
function = "wifi";
|
||||
groups = "wf_dbdc";
|
||||
};
|
||||
conf {
|
||||
pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
|
||||
"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
|
||||
"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
|
||||
"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
|
||||
"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
|
||||
"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
|
||||
"WF1_TOP_CLK", "WF1_TOP_DATA";
|
||||
drive-strength = <MTK_DRIVE_4mA>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi_flash_pins>;
|
||||
cs-gpios = <0>, <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
|
||||
spi_nand: spi_nand@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "spi-nand";
|
||||
reg = <1>;
|
||||
spi-max-frequency = <10000000>;
|
||||
spi-tx-buswidth = <4>;
|
||||
spi-rx-buswidth = <4>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "BL2"; //1024KB
|
||||
reg = <0x00000 0x0100000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@100000 {
|
||||
label = "u-boot-env"; //512KB
|
||||
reg = <0x0100000 0x0080000>;
|
||||
};
|
||||
|
||||
factory: partition@180000 {
|
||||
label = "Factory"; //2048KB
|
||||
reg = <0x180000 0x0200000>;
|
||||
};
|
||||
|
||||
partition@380000 {
|
||||
label = "FIP"; //2048KB
|
||||
reg = <0x380000 0x0200000>;
|
||||
};
|
||||
|
||||
partition@580000 {
|
||||
label = "ubi"; //110MB
|
||||
reg = <0x580000 0x6E00000>;
|
||||
};
|
||||
|
||||
partition@7380000 {
|
||||
label = "ubi_1"; //110MB
|
||||
reg = <0x7380000 0x6E00000>;
|
||||
};
|
||||
|
||||
partition@E180000 {
|
||||
label = "cert"; //384KB
|
||||
reg = <0xE180000 0x0060000>;
|
||||
};
|
||||
|
||||
partition@E1E0000 {
|
||||
label = "userconfig"; //640KB
|
||||
reg = <0xE1E0000 0x00a0000>;
|
||||
};
|
||||
|
||||
partition@E280000 {
|
||||
label = "crashdump"; //384KB
|
||||
reg = <0xE280000 0x0060000>;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spic_pins_g2>;
|
||||
status = "okay";
|
||||
|
||||
proslic_spi: proslic_spi@0 {
|
||||
compatible = "silabs,proslic_spi";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <10000000>;
|
||||
spi-cpha = <1>;
|
||||
spi-cpol = <1>;
|
||||
channel_count = <1>;
|
||||
debug_level = <4>; /* 1 = TRC, 2 = DBG, 4 = ERR */
|
||||
reset_gpio = <&pio 7 0>;
|
||||
ig,enable-spi = <1>; /* 1: Enable, 0: Disable */
|
||||
};
|
||||
};
|
||||
|
||||
&gmac1 {
|
||||
phy-mode = "2500base-x";
|
||||
phy-connection-type = "2500base-x";
|
||||
phy-handle = <&phy6>;
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart1_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart2_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
@@ -109,6 +109,7 @@
|
||||
#define CK_TOP_F26M 48
|
||||
#define CK_TOP_AUD_L 49
|
||||
#define CK_TOP_A_TUNER 50
|
||||
#define CLK_TOP_CONN_MCUSYS_SEL 50
|
||||
#define CK_TOP_U2U3_REF 51
|
||||
#define CK_TOP_U2U3_SYS 52
|
||||
#define CK_TOP_U2U3_XHCI 53
|
||||
@@ -121,6 +122,7 @@
|
||||
#define CK_TOP_PWM_SEL 60
|
||||
#define CK_TOP_I2C_SEL 61
|
||||
#define CK_TOP_PEXTP_TL_SEL 62
|
||||
#define CLK_TOP_AP2CNN_HOST_SEL 62
|
||||
#define CK_TOP_EMMC_250M_SEL 63
|
||||
#define CK_TOP_EMMC_416M_SEL 64
|
||||
#define CK_TOP_F_26M_ADC_SEL 65
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
KERNEL_LOADADDR := 0x48080000
|
||||
|
||||
define Build/fit-sign
|
||||
$(TOPDIR)/scripts/mkits-secure_boot.sh \
|
||||
-D $(DEVICE_NAME) \
|
||||
-o $@.its \
|
||||
-k $@ \
|
||||
$(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \
|
||||
-a $(KERNEL_LOADADDR) \
|
||||
-e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
||||
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
|
||||
-A $(LINUX_KARCH) \
|
||||
-v $(LINUX_VERSION) \
|
||||
$(if $(FIT_KEY_NAME),-S $(FIT_KEY_NAME)) \
|
||||
$(if $(FW_AR_VER),-r $(FW_AR_VER)) \
|
||||
$(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),-R $(ROOTFS/squashfs/$(DEVICE_NAME)))
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage \
|
||||
-f $@.its \
|
||||
$(if $(FIT_KEY_DIR),-k $(FIT_KEY_DIR)) \
|
||||
-r \
|
||||
$@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Device/mt7986a-ax6000-spim-nor-rfb
|
||||
DEVICE_VENDOR := MediaTek
|
||||
DEVICE_MODEL := mt7986a-ax6000-spim-nor-rfb
|
||||
@@ -413,3 +435,28 @@ define Device/mediatek_mt7986-fpga-ubi
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
endef
|
||||
TARGET_DEVICES += mediatek_mt7986-fpga-ubi
|
||||
|
||||
define Device/senao_iap4300m
|
||||
DEVICE_VENDOR := SENAO
|
||||
DEVICE_MODEL := IAP4300M
|
||||
DEVICE_DTS := mt7986a-senao-iap4300m
|
||||
DEVICE_PACKAGES := kmod-mt7986-firmware kmod-crypto-hw-safexcel kmod-mt7915e wpad-basic-mbedtls uboot-envtools -procd-ujail
|
||||
DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
|
||||
SUPPORTED_DEVICES := senao,iap4300m
|
||||
UBINIZE_OPTS := -E 5
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
IMAGE_SIZE := 65536k
|
||||
KERNEL_IN_UBI := 1
|
||||
FIT_KEY_DIR := $(DTS_DIR)/mediatek/keys/senao_iap4300m
|
||||
FIT_KEY_NAME := fit_key
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
KERNEL = kernel-bin | lzma | \
|
||||
fit-sign lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
KERNEL_INITRAMFS = kernel-bin | lzma | \
|
||||
fit-sign lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
||||
endef
|
||||
TARGET_DEVICES += senao_iap4300m
|
||||
DEFAULT_DEVICE_VARS += FIT_KEY_DIR FIT_KEY_NAME
|
||||
|
||||
18
feeds/mediatek-sdk/mediatek/mt7986/base-files/etc/board.d/01_leds
Executable file
18
feeds/mediatek-sdk/mediatek/mt7986/base-files/etc/board.d/01_leds
Executable file
@@ -0,0 +1,18 @@
|
||||
. /lib/functions/leds.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
board_config_update
|
||||
|
||||
case $board in
|
||||
senao,iap4300m)
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "wifi5" "phy1tpt"
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "wifi2" "phy0tpt"
|
||||
ucidef_set_led_netdev "poe" "poe" "wan" "eth0"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
@@ -19,6 +19,9 @@ mediatek_setup_interfaces()
|
||||
ucidef_add_switch "switch0" \
|
||||
"0:lan" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan" "6u@eth0"
|
||||
;;
|
||||
senao,iap4300m)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
;;
|
||||
*)
|
||||
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3 lan4 lan5" eth1
|
||||
;;
|
||||
@@ -35,6 +38,9 @@ mediatek_setup_macs()
|
||||
local wan_mac_offset=""
|
||||
|
||||
case $board in
|
||||
senao,iap4300m)
|
||||
up_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
;;
|
||||
*)
|
||||
lan_mac_offset="0x2A"
|
||||
wan_mac_offset="0x24"
|
||||
@@ -59,6 +65,14 @@ mediatek_setup_macs()
|
||||
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$up_mac" in
|
||||
00:00:00:00:00:00);;
|
||||
ff:ff:ff:ff:ff:ff);;
|
||||
*)
|
||||
[ -n "$up_mac" ] && ucidef_set_interface_macaddr "up" "$up_mac"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
board_config_update
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
[ "$ACTION" == "add" ] || exit 0
|
||||
|
||||
PHYNBR=${DEVPATH##*/phy}
|
||||
|
||||
[ -n $PHYNBR ] || exit 0
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
senao,iap4300m)
|
||||
hw_mac_addr=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
[ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
|
||||
[ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,24 @@
|
||||
#
|
||||
# Copyright (C) 2021 OpenWrt.org
|
||||
#
|
||||
|
||||
[ -e /etc/config/ubootenv ] && exit 0
|
||||
|
||||
touch /etc/config/ubootenv
|
||||
|
||||
. /lib/uboot-envtools.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
senao,iap4300m)
|
||||
local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
|
||||
ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
config_foreach ubootenv_add_app_config
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,487 @@
|
||||
# Copyright (C) 2014 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
# 'kernel' partition or UBI volume on NAND contains the kernel
|
||||
CI_KERNPART="${CI_KERNPART:-kernel}"
|
||||
|
||||
# 'ubi' partition on NAND contains UBI
|
||||
# There are also CI_KERN_UBIPART and CI_ROOT_UBIPART if kernel
|
||||
# and rootfs are on separated UBIs.
|
||||
CI_UBIPART="${CI_UBIPART:-ubi}"
|
||||
|
||||
# 'rootfs' UBI volume on NAND contains the rootfs
|
||||
CI_ROOTPART="${CI_ROOTPART:-rootfs}"
|
||||
|
||||
# update uboot-env if upgrade suceeded
|
||||
CI_FWSETENV=
|
||||
|
||||
ubi_mknod() {
|
||||
local dir="$1"
|
||||
local dev="/dev/$(basename $dir)"
|
||||
|
||||
[ -e "$dev" ] && return 0
|
||||
|
||||
local devid="$(cat $dir/dev)"
|
||||
local major="${devid%%:*}"
|
||||
local minor="${devid##*:}"
|
||||
mknod "$dev" c $major $minor
|
||||
}
|
||||
|
||||
nand_find_volume() {
|
||||
local ubidevdir ubivoldir
|
||||
ubidevdir="/sys/class/ubi/"
|
||||
[ ! -d "$ubidevdir" ] && return 1
|
||||
for ubivoldir in $ubidevdir/${1}_*; do
|
||||
[ ! -d "$ubivoldir" ] && continue
|
||||
if [ "$( cat $ubivoldir/name )" = "$2" ]; then
|
||||
basename $ubivoldir
|
||||
ubi_mknod "$ubivoldir"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
nand_find_ubi() {
|
||||
local ubidevdir ubidev mtdnum cmtdnum
|
||||
mtdnum="$( find_mtd_index $1 )"
|
||||
[ ! "$mtdnum" ] && return 1
|
||||
for ubidevdir in /sys/class/ubi/ubi*; do
|
||||
[ ! -e "$ubidevdir/mtd_num" ] && continue
|
||||
cmtdnum="$( cat $ubidevdir/mtd_num )"
|
||||
if [ "$mtdnum" = "$cmtdnum" ]; then
|
||||
ubidev=$( basename $ubidevdir )
|
||||
ubi_mknod "$ubidevdir"
|
||||
echo $ubidev
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
nand_get_magic_long() {
|
||||
(${3}cat "$1" | dd bs=4 "skip=${2:-0}" count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2> /dev/null
|
||||
}
|
||||
|
||||
get_magic_long_tar() {
|
||||
(tar xO${3}f "$1" "$2" | dd bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2> /dev/null
|
||||
}
|
||||
|
||||
identify() {
|
||||
identify_magic_long $(nand_get_magic_long "$@")
|
||||
}
|
||||
|
||||
identify_tar() {
|
||||
identify_magic_long $(get_magic_long_tar "$@")
|
||||
}
|
||||
|
||||
identify_if_gzip() {
|
||||
if [ "$(identify "$1")" = gzip ]; then echo -n z; fi
|
||||
}
|
||||
|
||||
nand_restore_config() {
|
||||
local ubidev=$( nand_find_ubi "${CI_ROOT_UBIPART:-$CI_UBIPART}" )
|
||||
local ubivol="$( nand_find_volume $ubidev rootfs_data )"
|
||||
if [ ! "$ubivol" ]; then
|
||||
ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )"
|
||||
if [ ! "$ubivol" ]; then
|
||||
echo "cannot find ubifs data volume"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
mkdir /tmp/new_root
|
||||
if ! mount -t ubifs /dev/$ubivol /tmp/new_root; then
|
||||
echo "cannot mount ubifs volume $ubivol"
|
||||
rmdir /tmp/new_root
|
||||
return 1
|
||||
fi
|
||||
if mv "$1" "/tmp/new_root/$BACKUP_FILE"; then
|
||||
if umount /tmp/new_root; then
|
||||
echo "configuration saved"
|
||||
rmdir /tmp/new_root
|
||||
return 0
|
||||
fi
|
||||
else
|
||||
umount /tmp/new_root
|
||||
fi
|
||||
echo "could not save configuration to ubifs volume $ubivol"
|
||||
rmdir /tmp/new_root
|
||||
return 1
|
||||
}
|
||||
|
||||
nand_remove_ubiblock() {
|
||||
local ubivol="$1"
|
||||
|
||||
local ubiblk="ubiblock${ubivol:3}"
|
||||
if [ -e "/dev/$ubiblk" ]; then
|
||||
umount "/dev/$ubiblk" && echo "unmounted /dev/$ubiblk" || :
|
||||
if ! ubiblock -r "/dev/$ubivol"; then
|
||||
echo "cannot remove $ubiblk"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
nand_attach_ubi() {
|
||||
local ubipart="$1"
|
||||
local has_env="${2:-0}"
|
||||
|
||||
local mtdnum="$( find_mtd_index "$ubipart" )"
|
||||
if [ ! "$mtdnum" ]; then
|
||||
>&2 echo "cannot find ubi mtd partition $ubipart"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local ubidev="$( nand_find_ubi "$ubipart" )"
|
||||
if [ ! "$ubidev" ]; then
|
||||
>&2 ubiattach -m "$mtdnum"
|
||||
ubidev="$( nand_find_ubi "$ubipart" )"
|
||||
|
||||
if [ ! "$ubidev" ]; then
|
||||
>&2 ubiformat /dev/mtd$mtdnum -y
|
||||
>&2 ubiattach -m "$mtdnum"
|
||||
ubidev="$( nand_find_ubi "$ubipart" )"
|
||||
|
||||
if [ ! "$ubidev" ]; then
|
||||
>&2 echo "cannot attach ubi mtd partition $ubipart"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ "$has_env" -gt 0 ]; then
|
||||
>&2 ubimkvol /dev/$ubidev -n 0 -N ubootenv -s 1MiB
|
||||
>&2 ubimkvol /dev/$ubidev -n 1 -N ubootenv2 -s 1MiB
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$ubidev"
|
||||
return 0
|
||||
}
|
||||
|
||||
nand_detach_ubi() {
|
||||
local ubipart="$1"
|
||||
|
||||
local mtdnum="$( find_mtd_index "$ubipart" )"
|
||||
if [ ! "$mtdnum" ]; then
|
||||
echo "cannot find ubi mtd partition $ubipart"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local ubidev="$( nand_find_ubi "$ubipart" )"
|
||||
if [ "$ubidev" ]; then
|
||||
for ubivol in $(find /dev -name "${ubidev}_*" -maxdepth 1 | sort); do
|
||||
ubivol="${ubivol:5}"
|
||||
nand_remove_ubiblock "$ubivol" || :
|
||||
umount "/dev/$ubivol" && echo "unmounted /dev/$ubivol" || :
|
||||
done
|
||||
if ! ubidetach -m "$mtdnum"; then
|
||||
echo "cannot detach ubi mtd partition $ubipart"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
nand_upgrade_prepare_ubi() {
|
||||
local rootfs_length="$1"
|
||||
local rootfs_type="$2"
|
||||
local rootfs_data_max="$(fw_printenv -n rootfs_data_max 2> /dev/null)"
|
||||
[ -n "$rootfs_data_max" ] && rootfs_data_max=$((rootfs_data_max))
|
||||
|
||||
local kernel_length="$3"
|
||||
local has_env="${4:-0}"
|
||||
local kern_ubidev
|
||||
local root_ubidev
|
||||
|
||||
[ -n "$rootfs_length" -o -n "$kernel_length" ] || return 1
|
||||
|
||||
if [ -n "$CI_KERN_UBIPART" -a -n "$CI_ROOT_UBIPART" ]; then
|
||||
kern_ubidev="$( nand_attach_ubi "$CI_KERN_UBIPART" "$has_env" )"
|
||||
[ -n "$kern_ubidev" ] || return 1
|
||||
root_ubidev="$( nand_attach_ubi "$CI_ROOT_UBIPART" )"
|
||||
[ -n "$root_ubidev" ] || return 1
|
||||
else
|
||||
kern_ubidev="$( nand_attach_ubi "$CI_UBIPART" "$has_env" )"
|
||||
[ -n "$kern_ubidev" ] || return 1
|
||||
root_ubidev="$kern_ubidev"
|
||||
fi
|
||||
|
||||
local kern_ubivol="$( nand_find_volume $kern_ubidev "$CI_KERNPART" )"
|
||||
local root_ubivol="$( nand_find_volume $root_ubidev "$CI_ROOTPART" )"
|
||||
local data_ubivol="$( nand_find_volume $root_ubidev rootfs_data )"
|
||||
[ "$root_ubivol" = "$kern_ubivol" ] && root_ubivol=
|
||||
|
||||
# remove ubiblocks
|
||||
[ "$kern_ubivol" ] && { nand_remove_ubiblock $kern_ubivol || return 1; }
|
||||
[ "$root_ubivol" ] && { nand_remove_ubiblock $root_ubivol || return 1; }
|
||||
[ "$data_ubivol" ] && { nand_remove_ubiblock $data_ubivol || return 1; }
|
||||
|
||||
# kill volumes
|
||||
[ "$kern_ubivol" ] && ubirmvol /dev/$kern_ubidev -N "$CI_KERNPART" || :
|
||||
[ "$root_ubivol" ] && ubirmvol /dev/$root_ubidev -N "$CI_ROOTPART" || :
|
||||
[ "$data_ubivol" ] && ubirmvol /dev/$root_ubidev -N rootfs_data || :
|
||||
|
||||
# create kernel vol
|
||||
if [ -n "$kernel_length" ]; then
|
||||
if ! ubimkvol /dev/$kern_ubidev -N "$CI_KERNPART" -s $kernel_length; then
|
||||
echo "cannot create kernel volume"
|
||||
return 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
# create rootfs vol
|
||||
if [ -n "$rootfs_length" ]; then
|
||||
local rootfs_size_param
|
||||
if [ "$rootfs_type" = "ubifs" ]; then
|
||||
rootfs_size_param="-m"
|
||||
else
|
||||
rootfs_size_param="-s $rootfs_length"
|
||||
fi
|
||||
if ! ubimkvol /dev/$root_ubidev -N "$CI_ROOTPART" $rootfs_size_param; then
|
||||
echo "cannot create rootfs volume"
|
||||
return 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
# create rootfs_data vol for non-ubifs rootfs
|
||||
if [ "$rootfs_type" != "ubifs" ]; then
|
||||
local rootfs_data_size_param="-m"
|
||||
if [ -n "$rootfs_data_max" ]; then
|
||||
rootfs_data_size_param="-s $rootfs_data_max"
|
||||
fi
|
||||
if ! ubimkvol /dev/$root_ubidev -N rootfs_data $rootfs_data_size_param; then
|
||||
if ! ubimkvol /dev/$root_ubidev -N rootfs_data -m; then
|
||||
echo "cannot initialize rootfs_data volume"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Write the UBI image to MTD ubi partition
|
||||
nand_upgrade_ubinized() {
|
||||
local ubi_file="$1"
|
||||
local gz="$2"
|
||||
|
||||
local ubi_length=$( (${gz}cat "$ubi_file" | wc -c) 2> /dev/null)
|
||||
|
||||
nand_detach_ubi "$CI_UBIPART" || return 1
|
||||
|
||||
local mtdnum="$( find_mtd_index "$CI_UBIPART" )"
|
||||
${gz}cat "$ubi_file" | ubiformat "/dev/mtd$mtdnum" -S "$ubi_length" -y -f - && ubiattach -m "$mtdnum"
|
||||
}
|
||||
|
||||
# Write the UBIFS image to UBI rootfs volume
|
||||
nand_upgrade_ubifs() {
|
||||
local ubifs_file="$1"
|
||||
local gz="$2"
|
||||
|
||||
local ubifs_length=$( (${gz}cat "$ubifs_file" | wc -c) 2> /dev/null)
|
||||
|
||||
nand_upgrade_prepare_ubi "$ubifs_length" "ubifs" "" "" || return 1
|
||||
|
||||
local ubidev="$( nand_find_ubi "$CI_UBIPART" )"
|
||||
local root_ubivol="$(nand_find_volume $ubidev "$CI_ROOTPART")"
|
||||
${gz}cat "$ubifs_file" | ubiupdatevol /dev/$root_ubivol -s "$ubifs_length" -
|
||||
}
|
||||
|
||||
# Write the FIT image to UBI kernel volume
|
||||
nand_upgrade_fit() {
|
||||
local fit_file="$1"
|
||||
local gz="$2"
|
||||
|
||||
local fit_length=$( (${gz}cat "$fit_file" | wc -c) 2> /dev/null)
|
||||
|
||||
nand_upgrade_prepare_ubi "" "" "$fit_length" "1" || return 1
|
||||
|
||||
local fit_ubidev="$(nand_find_ubi "$CI_UBIPART")"
|
||||
local fit_ubivol="$(nand_find_volume $fit_ubidev "$CI_KERNPART")"
|
||||
${gz}cat "$fit_file" | ubiupdatevol /dev/$fit_ubivol -s "$fit_length" -
|
||||
}
|
||||
|
||||
# Write images in the TAR file to MTD partitions and/or UBI volumes as required
|
||||
nand_upgrade_tar() {
|
||||
local tar_file="$1"
|
||||
local gz="$2"
|
||||
local jffs2_markers="${CI_JFFS2_CLEAN_MARKERS:-0}"
|
||||
|
||||
# WARNING: This fails if tar contains more than one 'sysupgrade-*' directory.
|
||||
local board_dir="$(tar t${gz}f "$tar_file" | grep -m 1 '^sysupgrade-.*/$')"
|
||||
board_dir="${board_dir%/}"
|
||||
|
||||
local kernel_mtd kernel_length
|
||||
if [ "$CI_KERNPART" != "none" ]; then
|
||||
kernel_mtd="$(find_mtd_index "$CI_KERNPART")"
|
||||
kernel_length=$( (tar xO${gz}f "$tar_file" "$board_dir/kernel" | wc -c) 2> /dev/null)
|
||||
[ "$kernel_length" = 0 ] && kernel_length=
|
||||
fi
|
||||
local rootfs_length=$( (tar xO${gz}f "$tar_file" "$board_dir/root" | wc -c) 2> /dev/null)
|
||||
[ "$rootfs_length" = 0 ] && rootfs_length=
|
||||
local rootfs_type
|
||||
[ "$rootfs_length" ] && rootfs_type="$(identify_tar "$tar_file" "$board_dir/root" "$gz")"
|
||||
|
||||
local ubi_kernel_length
|
||||
if [ "$kernel_length" ]; then
|
||||
if [ "$kernel_mtd" ]; then
|
||||
# On some devices, the raw kernel and ubi partitions overlap.
|
||||
# These devices brick if the kernel partition is erased.
|
||||
# Hence only invalidate kernel for now.
|
||||
dd if=/dev/zero bs=4096 count=1 2> /dev/null | \
|
||||
mtd write - "$CI_KERNPART"
|
||||
else
|
||||
ubi_kernel_length="$kernel_length"
|
||||
fi
|
||||
fi
|
||||
|
||||
local has_env=0
|
||||
nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "$ubi_kernel_length" "$has_env" || return 1
|
||||
|
||||
if [ "$rootfs_length" ]; then
|
||||
local ubidev="$( nand_find_ubi "${CI_ROOT_UBIPART:-$CI_UBIPART}" )"
|
||||
local root_ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )"
|
||||
tar xO${gz}f "$tar_file" "$board_dir/root" | \
|
||||
ubiupdatevol /dev/$root_ubivol -s "$rootfs_length" -
|
||||
fi
|
||||
if [ "$kernel_length" ]; then
|
||||
if [ "$kernel_mtd" ]; then
|
||||
if [ "$jffs2_markers" = 1 ]; then
|
||||
flash_erase -j "/dev/mtd${kernel_mtd}" 0 0
|
||||
tar xO${gz}f "$tar_file" "$board_dir/kernel" | \
|
||||
nandwrite "/dev/mtd${kernel_mtd}" -
|
||||
else
|
||||
tar xO${gz}f "$tar_file" "$board_dir/kernel" | \
|
||||
mtd write - "$CI_KERNPART"
|
||||
fi
|
||||
else
|
||||
local ubidev="$( nand_find_ubi "${CI_KERN_UBIPART:-$CI_UBIPART}" )"
|
||||
local kern_ubivol="$( nand_find_volume $ubidev "$CI_KERNPART" )"
|
||||
tar xO${gz}f "$tar_file" "$board_dir/kernel" | \
|
||||
ubiupdatevol /dev/$kern_ubivol -s "$kernel_length" -
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
nand_verify_if_gzip_file() {
|
||||
local file="$1"
|
||||
local gz="$2"
|
||||
|
||||
if [ "$gz" = z ]; then
|
||||
echo "verifying compressed sysupgrade file integrity"
|
||||
if ! gzip -t "$file"; then
|
||||
echo "corrupted compressed sysupgrade file"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
nand_verify_tar_file() {
|
||||
local file="$1"
|
||||
local gz="$2"
|
||||
|
||||
echo "verifying sysupgrade tar file integrity"
|
||||
if ! tar xO${gz}f "$file" > /dev/null; then
|
||||
echo "corrupted sysupgrade tar file"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
nand_do_flash_file() {
|
||||
local file="$1"
|
||||
|
||||
local gz="$(identify_if_gzip "$file")"
|
||||
local file_type="$(identify "$file" "" "$gz")"
|
||||
|
||||
[ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART=rootfs
|
||||
|
||||
case "$file_type" in
|
||||
"fit")
|
||||
nand_verify_if_gzip_file "$file" "$gz" || return 1
|
||||
nand_upgrade_fit "$file" "$gz"
|
||||
;;
|
||||
"ubi")
|
||||
nand_verify_if_gzip_file "$file" "$gz" || return 1
|
||||
nand_upgrade_ubinized "$file" "$gz"
|
||||
;;
|
||||
"ubifs")
|
||||
nand_verify_if_gzip_file "$file" "$gz" || return 1
|
||||
nand_upgrade_ubifs "$file" "$gz"
|
||||
;;
|
||||
*)
|
||||
nand_verify_tar_file "$file" "$gz" || return 1
|
||||
nand_upgrade_tar "$file" "$gz"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
nand_do_restore_config() {
|
||||
local conf_tar="/tmp/sysupgrade.tgz"
|
||||
[ ! -f "$conf_tar" ] || nand_restore_config "$conf_tar"
|
||||
}
|
||||
|
||||
# Recognize type of passed file and start the upgrade process
|
||||
nand_do_upgrade() {
|
||||
local file="$1"
|
||||
|
||||
sync
|
||||
nand_do_flash_file "$file" && nand_do_upgrade_success
|
||||
nand_do_upgrade_failed
|
||||
}
|
||||
|
||||
nand_do_upgrade_success() {
|
||||
platform_post_upgrade_success
|
||||
if nand_do_restore_config && sync; then
|
||||
[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV
|
||||
echo "sysupgrade successful"
|
||||
umount -a
|
||||
reboot -f
|
||||
fi
|
||||
nand_do_upgrade_failed
|
||||
}
|
||||
|
||||
nand_do_upgrade_failed() {
|
||||
sync
|
||||
echo "sysupgrade failed"
|
||||
# Should we reboot or bring up some failsafe mode instead?
|
||||
umount -a
|
||||
reboot -f
|
||||
}
|
||||
|
||||
# Check if passed file is a valid one for NAND sysupgrade.
|
||||
# Currently it accepts 4 types of files:
|
||||
# 1) UBI: a ubinized image containing required UBI volumes.
|
||||
# 2) UBIFS: a UBIFS rootfs volume image.
|
||||
# 3) FIT: a FIT image containing kernel and rootfs.
|
||||
# 4) TAR: an archive that includes directory "sysupgrade-${BOARD_NAME}" containing
|
||||
# a non-empty "CONTROL" file and required partition and/or volume images.
|
||||
#
|
||||
# You usually want to call this function in platform_check_image.
|
||||
#
|
||||
# $(1): board name, used in case of passing TAR file
|
||||
# $(2): file to be checked
|
||||
nand_do_platform_check() {
|
||||
local board_name="$1"
|
||||
local file="$2"
|
||||
|
||||
local gz="$(identify_if_gzip "$file")"
|
||||
local file_type="$(identify "$file" "" "$gz")"
|
||||
local control_length=$( (tar xO${gz}f "$file" "sysupgrade-${board_name//,/_}/CONTROL" | wc -c) 2> /dev/null)
|
||||
|
||||
if [ "$control_length" = 0 ]; then
|
||||
control_length=$( (tar xO${gz}f "$file" "sysupgrade-${board_name//_/,}/CONTROL" | wc -c) 2> /dev/null)
|
||||
fi
|
||||
|
||||
if [ "$control_length" != 0 ]; then
|
||||
nand_verify_tar_file "$file" "$gz" || return 1
|
||||
else
|
||||
nand_verify_if_gzip_file "$file" "$gz" || return 1
|
||||
if [ "$file_type" != "fit" -a "$file_type" != "ubi" -a "$file_type" != "ubifs" ]; then
|
||||
echo "invalid sysupgrade file"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
@@ -1,6 +1,18 @@
|
||||
RAMFS_COPY_BIN='mkfs.f2fs blkid blockdev fw_printenv fw_setenv dmsetup'
|
||||
RAMFS_COPY_DATA="/etc/fw_env.config /var/lock/fw_printenv.lock"
|
||||
|
||||
senao_swap_active_fw() {
|
||||
echo "Doing swap active_fw" > /dev/console
|
||||
tmp_active_fw=$(fw_printenv -n active_fw)
|
||||
if [ $tmp_active_fw == "0" ]; then
|
||||
fw_setenv active_fw 1
|
||||
fw_setenv mtdparts nmbm0:1024k\(bl2\),512k\(u-boot-env\),2048k\(factory\),2048k\(fip\),112640k\(ubi_1\),112640k\(ubi\),384k\(cert\),640k\(userconfig\),384k\(crashdump\)
|
||||
else
|
||||
fw_setenv active_fw 0
|
||||
fw_setenv mtdparts nmbm0:1024k\(bl2\),512k\(u-boot-env\),2048k\(factory\),2048k\(fip\),112640k\(ubi\),112640k\(ubi_1\),384k\(cert\),640k\(userconfig\),384k\(crashdump\)
|
||||
fi
|
||||
}
|
||||
|
||||
platform_do_upgrade() {
|
||||
local board=$(board_name)
|
||||
|
||||
@@ -11,6 +23,10 @@ platform_do_upgrade() {
|
||||
*emmc*)
|
||||
mtk_mmc_do_upgrade "$1"
|
||||
;;
|
||||
senao,iap4300m)
|
||||
CI_UBIPART="ubi_1"
|
||||
nand_do_upgrade "$1"
|
||||
;;
|
||||
*)
|
||||
default_do_upgrade "$1"
|
||||
;;
|
||||
@@ -26,6 +42,7 @@ platform_check_image() {
|
||||
[ "$#" -gt 1 ] && return 1
|
||||
|
||||
case "$board" in
|
||||
senao,iap4300m |\
|
||||
*snand* |\
|
||||
*emmc*)
|
||||
# tar magic `ustar`
|
||||
@@ -49,3 +66,13 @@ platform_check_image() {
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
platform_post_upgrade_success() {
|
||||
local board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
senao,iap4300m)
|
||||
senao_swap_active_fw
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -568,3 +568,8 @@ CONFIG_WANT_DEV_COREDUMP=y
|
||||
CONFIG_VIRTIO_CONSOLE=n
|
||||
CONFIG_VIRTIO_NET=n
|
||||
CONFIG_VIRTIO_BLK=n
|
||||
# CONFIG_NF_FLOW_TABLE_NETLINK is not set
|
||||
# CONFIG_NET_DSA_TAG_AIROHA is not set
|
||||
CONFIG_AN8855_GSW=y
|
||||
# CONFIG_INIT_STACK_ALL is not set
|
||||
# CONFIG_NET_DSA_AN8855 is not set
|
||||
|
||||
235
patches/0075-Add-secure-boot-patch.patch
Normal file
235
patches/0075-Add-secure-boot-patch.patch
Normal file
@@ -0,0 +1,235 @@
|
||||
From 7206e3945d7ea71117c68401b2541578772758f8 Mon Sep 17 00:00:00 2001
|
||||
From: "steven.lin" <steven.lin@senao.com>
|
||||
Date: Mon, 15 Jul 2024 11:36:04 +0800
|
||||
Subject: [PATCH] Add-secure-boot-patch.patch
|
||||
|
||||
---
|
||||
scripts/mkits-secure_boot.sh | 212 +++++++++
|
||||
tools/Makefile | 1 +
|
||||
tools/crc32sum/Makefile | 23 +
|
||||
tools/crc32sum/src/Makefile | 18 +
|
||||
tools/crc32sum/src/crc32sum.c | 282 ++++++++++++
|
||||
create mode 100755 scripts/mkits-secure_boot.sh
|
||||
create mode 100644 tools/crc32sum/Makefile
|
||||
create mode 100644 tools/crc32sum/src/Makefile
|
||||
create mode 100644 tools/crc32sum/src/crc32sum.c
|
||||
|
||||
diff --git a/scripts/mkits-secure_boot.sh b/scripts/mkits-secure_boot.sh
|
||||
new file mode 100755
|
||||
index 0000000000..1c7f292618
|
||||
--- /dev/null
|
||||
+++ b/scripts/mkits-secure_boot.sh
|
||||
@@ -0,0 +1,212 @@
|
||||
+#!/bin/sh
|
||||
+#
|
||||
+# Licensed under the terms of the GNU GPL License version 2 or later.
|
||||
+#
|
||||
+# Author: Peter Tyser <ptyser@xes-inc.com>
|
||||
+#
|
||||
+# U-Boot firmware supports the booting of images in the Flattened Image
|
||||
+# Tree (FIT) format. The FIT format uses a device tree structure to
|
||||
+# describe a kernel image, device tree blob, ramdisk, etc. This script
|
||||
+# creates an Image Tree Source (.its file) which can be passed to the
|
||||
+# 'mkimage' utility to generate an Image Tree Blob (.itb file). The .itb
|
||||
+# file can then be booted by U-Boot (or other bootloaders which support
|
||||
+# FIT images). See doc/uImage.FIT/howto.txt in U-Boot source code for
|
||||
+# additional information on FIT images.
|
||||
+#
|
||||
+
|
||||
+usage() {
|
||||
+ printf "Usage: %s -A arch -C comp -a addr -e entry" "$(basename "$0")"
|
||||
+ printf " -v version -k kernel [-D name -n address -d dtb] -o its_file"
|
||||
+ printf " [-s script] [-S key_name_hint] [-r ar_ver] [-R rootfs]"
|
||||
+
|
||||
+ printf "\n\t-A ==> set architecture to 'arch'"
|
||||
+ printf "\n\t-C ==> set compression type 'comp'"
|
||||
+ printf "\n\t-c ==> set config name 'config'"
|
||||
+ printf "\n\t-a ==> set load address to 'addr' (hex)"
|
||||
+ printf "\n\t-e ==> set entry point to 'entry' (hex)"
|
||||
+ printf "\n\t-v ==> set kernel version to 'version'"
|
||||
+ printf "\n\t-k ==> include kernel image 'kernel'"
|
||||
+ printf "\n\t-D ==> human friendly Device Tree Blob 'name'"
|
||||
+ printf "\n\t-n ==> fdt unit-address 'address'"
|
||||
+ printf "\n\t-d ==> include Device Tree Blob 'dtb'"
|
||||
+ printf "\n\t-o ==> create output file 'its_file'"
|
||||
+ printf "\n\t-s ==> include u-boot script 'script'"
|
||||
+ printf "\n\t-S ==> add signature at configurations and assign its key_name_hint by 'key_name_hint'"
|
||||
+ printf "\n\t-r ==> set anti-rollback version to 'fw_ar_ver' (dec)"
|
||||
+ printf "\n\t-R ==> specify rootfs file for embedding hash\n"
|
||||
+ exit 1
|
||||
+}
|
||||
+
|
||||
+FDTNUM=1
|
||||
+
|
||||
+while getopts ":A:a:c:C:D:d:e:k:n:o:v:s:S:r:R:" OPTION
|
||||
+do
|
||||
+ case $OPTION in
|
||||
+ A ) ARCH=$OPTARG;;
|
||||
+ a ) LOAD_ADDR=$OPTARG;;
|
||||
+ c ) CONFIG=$OPTARG;;
|
||||
+ C ) COMPRESS=$OPTARG;;
|
||||
+ D ) DEVICE=$OPTARG;;
|
||||
+ d ) DTB=$OPTARG;;
|
||||
+ e ) ENTRY_ADDR=$OPTARG;;
|
||||
+ k ) KERNEL=$OPTARG;;
|
||||
+ n ) FDTNUM=$OPTARG;;
|
||||
+ o ) OUTPUT=$OPTARG;;
|
||||
+ v ) VERSION=$OPTARG;;
|
||||
+ s ) UBOOT_SCRIPT=$OPTARG;;
|
||||
+ S ) KEY_NAME_HINT=$OPTARG;;
|
||||
+ r ) AR_VER=$OPTARG;;
|
||||
+ R ) ROOTFS_FILE=$OPTARG;;
|
||||
+ * ) echo "Invalid option passed to '$0' (options:$*)"
|
||||
+ usage;;
|
||||
+ esac
|
||||
+done
|
||||
+
|
||||
+# Make sure user entered all required parameters
|
||||
+if [ -z "${ARCH}" ] || [ -z "${COMPRESS}" ] || [ -z "${LOAD_ADDR}" ] || \
|
||||
+ [ -z "${ENTRY_ADDR}" ] || [ -z "${VERSION}" ] || [ -z "${KERNEL}" ] || \
|
||||
+ [ -z "${OUTPUT}" ] || [ -z "${CONFIG}" ]; then
|
||||
+ usage
|
||||
+fi
|
||||
+
|
||||
+ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]')
|
||||
+
|
||||
+# Conditionally create fdt information
|
||||
+if [ -n "${DTB}" ]; then
|
||||
+ FDT_NODE="
|
||||
+ fdt-$FDTNUM {
|
||||
+ description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree blob\";
|
||||
+ data = /incbin/(\"${DTB}\");
|
||||
+ type = \"flat_dt\";
|
||||
+ arch = \"${ARCH}\";
|
||||
+ compression = \"none\";
|
||||
+ hash-1 {
|
||||
+ algo = \"crc32\";
|
||||
+ };
|
||||
+ hash-2 {
|
||||
+ algo = \"sha1\";
|
||||
+ };
|
||||
+ };
|
||||
+"
|
||||
+ FDT_PROP="fdt = \"fdt-$FDTNUM\";"
|
||||
+fi
|
||||
+
|
||||
+# Conditionally create rootfs hash information
|
||||
+if [ -f "${ROOTFS_FILE}" ]; then
|
||||
+ ROOTFS_SIZE=$(stat -c %s ${ROOTFS_FILE})
|
||||
+
|
||||
+ ROOTFS_SHA1=$(sha1sum ${ROOTFS_FILE} | awk '{print "<0x"substr($0,1,8) " 0x"substr($0,9,8) " 0x"substr($0,17,8) " 0x"substr($0,25,8) " 0x"substr($0,33,8) ">"}')
|
||||
+ ROOTFS_CRC32=$(crc32sum ${ROOTFS_FILE})
|
||||
+
|
||||
+ ROOTFS="
|
||||
+ rootfs {
|
||||
+ size = <${ROOTFS_SIZE}>;
|
||||
+
|
||||
+ hash-1 {
|
||||
+ value = <0x${ROOTFS_CRC32}>;
|
||||
+ algo = \"crc32\";
|
||||
+ };
|
||||
+
|
||||
+ hash-2 {
|
||||
+ value = ${ROOTFS_SHA1};
|
||||
+ algo = \"sha1\";
|
||||
+ };
|
||||
+ };
|
||||
+"
|
||||
+fi
|
||||
+
|
||||
+# Conditionally create script information
|
||||
+if [ -n "${UBOOT_SCRIPT}" ]; then
|
||||
+ SCRIPT="\
|
||||
+ script-1 {
|
||||
+ description = \"U-Boot Script\";
|
||||
+ data = /incbin/(\"${UBOOT_SCRIPT}\");
|
||||
+ type = \"script\";
|
||||
+ arch = \"${ARCH}\";
|
||||
+ os = \"linux\";
|
||||
+ load = <0>;
|
||||
+ entry = <0>;
|
||||
+ compression = \"none\";
|
||||
+ hash-1 {
|
||||
+ algo = \"crc32\";
|
||||
+ };
|
||||
+ hash-2 {
|
||||
+ algo = \"sha1\";
|
||||
+ };
|
||||
+ };\
|
||||
+"
|
||||
+ LOADABLES="\
|
||||
+ loadables = \"script-1\";\
|
||||
+"
|
||||
+ SIGN_IMAGES="\
|
||||
+ sign-images = \"fdt\", \"kernel\", \"loadables\";\
|
||||
+"
|
||||
+else
|
||||
+ SIGN_IMAGES="\
|
||||
+ sign-images = \"fdt\", \"kernel\";\
|
||||
+"
|
||||
+fi
|
||||
+
|
||||
+# Conditionally create signature information
|
||||
+if [ -n "${KEY_NAME_HINT}" ]; then
|
||||
+ SIGNATURE="\
|
||||
+ signature {
|
||||
+ algo = \"sha1,rsa2048\";
|
||||
+ key-name-hint = \"${KEY_NAME_HINT}\";
|
||||
+${SIGN_IMAGES}
|
||||
+ };\
|
||||
+"
|
||||
+fi
|
||||
+
|
||||
+# Conditionally create anti-rollback version information
|
||||
+if [ -n "${AR_VER}" ]; then
|
||||
+ FW_AR_VER="\
|
||||
+ fw_ar_ver = <${AR_VER}>;\
|
||||
+"
|
||||
+fi
|
||||
+
|
||||
+# Create a default, fully populated DTS file
|
||||
+DATA="/dts-v1/;
|
||||
+
|
||||
+/ {
|
||||
+ description = \"${ARCH_UPPER} OpenWrt FIT (Flattened Image Tree)\";
|
||||
+ #address-cells = <1>;
|
||||
+
|
||||
+ images {
|
||||
+ kernel-1 {
|
||||
+ description = \"${ARCH_UPPER} OpenWrt Linux-${VERSION}\";
|
||||
+ data = /incbin/(\"${KERNEL}\");
|
||||
+ type = \"kernel\";
|
||||
+ arch = \"${ARCH}\";
|
||||
+ os = \"linux\";
|
||||
+ compression = \"${COMPRESS}\";
|
||||
+ load = <${LOAD_ADDR}>;
|
||||
+ entry = <${ENTRY_ADDR}>;
|
||||
+ hash-1 {
|
||||
+ algo = \"crc32\";
|
||||
+ };
|
||||
+ hash-2 {
|
||||
+ algo = \"sha1\";
|
||||
+ };
|
||||
+ };
|
||||
+${FDT_NODE}
|
||||
+${SCRIPT}
|
||||
+ };
|
||||
+
|
||||
+${ROOTFS}
|
||||
+
|
||||
+ configurations {
|
||||
+ default = \"${CONFIG}\";
|
||||
+ ${CONFIG} {
|
||||
+ description = \"OpenWrt\";
|
||||
+${FW_AR_VER}
|
||||
+${LOADABLES}
|
||||
+ kernel = \"kernel-1\";
|
||||
+ ${FDT_PROP}
|
||||
+${SIGNATURE}
|
||||
+ };
|
||||
+ };
|
||||
+};"
|
||||
+
|
||||
+# Write .its file to disk
|
||||
+echo "$DATA" > "${OUTPUT}"
|
||||
|
||||
13
profiles/senao_iap4300m.yml
Normal file
13
profiles/senao_iap4300m.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
profile: senao_iap4300m
|
||||
target: mediatek
|
||||
subtarget: mt7986
|
||||
description: Build image for the SENAO IAP4300M
|
||||
image: bin/targets/mediatek/filogic/openwrt-mediatek-filogic-senao_iap4300m-squashfs-sysupgrade.bin
|
||||
feeds:
|
||||
- name: mediatek
|
||||
path: ../../feeds/mediatek-sdk
|
||||
packages:
|
||||
- mediatek
|
||||
include:
|
||||
- ucentral-ap
|
||||
Reference in New Issue
Block a user