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

Test for RUTX 6.1 compilation

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-06-29 13:20:32 +02:00
parent ca1b5e5ab0
commit fb024bdfd3
7 changed files with 567 additions and 86 deletions

View file

@ -323,3 +323,14 @@
if (priv == NULL) {
pr_err("<%s>: Invalid private data\n", __func__);
return count;
--- a/dcdp/ptm_tc.c 2023-06-29 11:30:37.060472655 +0200
+++ b/dcdp/ptm_tc.c 2023-06-29 11:31:01.376064210 +0200
@@ -88,7 +88,7 @@
unsigned int *data_addr, unsigned int *desc_addr);
-static inline void tc_ether_addr_copy(u8 *dst, const u8 *src)
+static inline void tc_ether_addr_copy(const u8 *dst, const u8 *src)
{
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
*(u32 *)dst = *(const u32 *)src;

View file

@ -0,0 +1,232 @@
#
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
# Copyright (c) 2011-2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
ipq40xx_setup_interfaces()
{
local board="$1"
case "$board" in
8dev,habanero-dvk|\
avm,fritzbox-4040|\
asus,rt-ac42u|\
asus,rt-ac58u|\
linksys,ea6350v3|\
linksys,ea8300|\
linksys,mr8300|\
mikrotik,hap-ac2|\
mikrotik,hap-ac3|\
mikrotik,hap-ac3-lte6-kit|\
p2w,r619ac-64m|\
p2w,r619ac-128m|\
pakedge,wr-1|\
zyxel,nbg6617)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
8dev,jalapeno|\
alfa-network,ap120c-ac|\
asus,map-ac2200|\
cilab,meshpoint-one|\
edgecore,ecw5211|\
glinet,gl-ap1300|\
glinet,gl-b2200|\
google,wifi|\
linksys,whw03v2|\
luma,wrtq-329acn|\
mikrotik,cap-ac|\
netgear,wac510|\
sony,ncp-hg100-cellular|\
wallys,dr40x9|\
zte,mf18a|\
zte,mf289f)
ucidef_set_interfaces_lan_wan "lan" "wan"
;;
aruba,ap-303|\
aruba,ap-365|\
avm,fritzrepeater-1200|\
dlink,dap-2610|\
extreme-networks,ws-ap3915i|\
meraki,mr33|\
meraki,mr74|\
mikrotik,lhgg-60ad|\
mikrotik,sxtsq-5-ac|\
netgear,ex6100v2|\
netgear,ex6150v2)
ucidef_set_interface_lan "lan"
;;
avm,fritzbox-7530)
ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
;;
avm,fritzrepeater-3000|\
cellc,rtl30vw)
ucidef_set_interface_lan "lan1 lan2"
;;
compex,wpj428)
ucidef_set_interface_lan "lan1 lan2"
;;
linksys,whw01)
ucidef_set_interface_lan "eth1 eth2"
;;
glinet,gl-a1300|\
glinet,gl-b1300|\
mobipromo,cm520-79f)
ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
;;
mikrotik,wap-ac|\
mikrotik,wap-ac-lte|\
mikrotik,wap-r-ac)
ucidef_set_interface_lan "sw-eth1 sw-eth2"
;;
aruba,ap-303h|\
buffalo,wtr-m2133hp|\
ezviz,cs-w3-wd1200g-eup|\
netgear,rbr50|\
netgear,rbs50|\
netgear,srr60|\
netgear,srs60|\
teltonika,rutx10)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
openmesh,a42|\
openmesh,a62)
ucidef_set_interfaces_lan_wan "ethernet2" "ethernet1"
;;
plasmacloud,pa1200|\
plasmacloud,pa2200)
ucidef_set_interfaces_lan_wan "ethernet1" "ethernet2"
;;
qxwlan,e2600ac-c1)
ucidef_set_interfaces_lan_wan "sw-eth1" "sw-eth2"
;;
qxwlan,e2600ac-c2)
ucidef_set_interfaces_lan_wan "sw-eth1 sw-eth2" "sw-eth3"
;;
zte,mf286d)
ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" "wan"
;;
*)
echo "Unsupported hardware. Network interfaces not initialized"
;;
esac
}
ipq40xx_setup_dsl()
{
local board="$1"
local annex="j"
local tone="b"
local xfer_mode=""
case "$board" in
avm,fritzbox-7530)
;;
*)
return 0
;;
esac
ucidef_add_atm_bridge "1" "32" "llc" "bridged" "dsl"
ucidef_add_vdsl_modem "$annex" "$tone" "$xfer_mode"
ucidef_set_interface_wan "dsl0" "pppoe"
}
ipq40xx_setup_macs()
{
local board="$1"
local lan_mac=""
local wan_mac=""
local label_mac=""
case "$board" in
8dev,habanero-dvk)
label_mac=$(mtd_get_mac_binary "ART" 0x1006)
;;
asus,rt-ac42u)
label_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
;;
asus,rt-ac58u)
wan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
lan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006)
label_mac=$wan_mac
;;
avm,fritzbox-7530)
local tffsdev=$(find_mtd_chardev "nand-tffs")
wan_mac=$(/usr/bin/fritz_tffs_nand -b -d $tffsdev -n macdsl)
;;
cilab,meshpoint-one)
label_mac=$(mtd_get_mac_binary "ART" 0x1006)
;;
devolo,magic-2-wifi-next)
lan_mac=$(mtd_get_mac_ascii APPSBLENV MacAddress0)
label_mac=$lan_mac
;;
dlink,dap-2610)
lan_mac=$(mtd_get_mac_ascii bdcfg lanmac)
label_mac=$lan_mac
;;
engenius,eap2200|\
engenius,emd1)
lan_mac=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
label_mac=$lan_mac
;;
engenius,emr3500)
wan_mac=$(mtd_get_mac_ascii 0:APPSBLENV wanaddr)
lan_mac=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
label_mac=$wan_mac
;;
engenius,ens620ext)
wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
ezviz,cs-w3-wd1200g-eup)
label_mac=$(mtd_get_mac_binary "ART" 0x6)
;;
google,wifi)
wan_mac=$(get_mac_label)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
linksys,ea6350v3|\
linksys,ea8300 |\
linksys,mr8300)
wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
mikrotik,cap-ac |\
mikrotik,hap-ac2|\
mikrotik,hap-ac3|\
mikrotik,hap-ac3-lte6-kit)
wan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
lan_mac=$(macaddr_add $wan_mac 1)
label_mac="$wan_mac"
;;
mikrotik,lhgg-60ad|\
mikrotik,sxtsq-5-ac)
lan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
label_mac="$lan_mac"
;;
netgear,rbr50|\
netgear,rbs50|\
netgear,srr60|\
netgear,srs60|\
pakedge,wr-1)
wan_mac=$(macaddr_add $(get_mac_label) 1)
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
}
board_config_update
board=$(board_name)
ipq40xx_setup_interfaces $board
ipq40xx_setup_dsl $board
ipq40xx_setup_macs $board
board_config_flush
exit 0

View file

@ -0,0 +1,287 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qcom-ipq4019-ap.dk01.1.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
memory {
device_type = "memory";
reg = <0x80000000 0x10000000>;
};
soc {
pinctrl@1000000 {
mdio_pins: mdio_pinmux {
mux_1 {
pins = "gpio53";
function = "mdio";
bias-pull-up;
};
mux_2 {
pins = "gpio52";
function = "mdc";
bias-pull-up;
};
};
i2c_0_pins: i2c_0_pinmux {
mux {
pins = "gpio58", "gpio59";
function = "blsp_i2c0";
bias-disable;
};
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&tlmm 4 1>;
linux,code = <KEY_RESTART>;
};
};
gpio_export {
compatible = "gpio-export";
#size-cells = <0>;
gpio_out {
gpio-export,name = "gpio_out";
gpio-export,output = <0>;
gpio-export,direction_may_change = <0>;
gpios = <&stm32_io 23 GPIO_ACTIVE_HIGH>;
};
gpio_in {
gpio-export,name = "gpio_in";
gpio-export,input = <0>;
gpio-export,direction_may_change = <0>;
gpios = <&stm32_io 24 GPIO_ACTIVE_LOW>;
};
};
};
};
&blsp1_i2c3 {
status = "okay";
pinctrl-0 = <&i2c_0_pins>;
pinctrl-names = "default";
clock-frequency = <400000>;
stm32_io: stm32@74 {
compatible = "tlt,stm32v1";
#gpio-cells = <2>;
#interrupt-cells = <2>;
gpio-controller;
interrupt-controller;
interrupt-parent = <&tlmm>;
interrupts = <5 2>;
reg = <0x74>;
};
};
&blsp1_spi1 {
cs-gpios = <&tlmm 54 0>, <&tlmm 63 0>;
num-cs = <2>;
xt25f128b@0 {
/*
* Factory U-boot looks in 0:BOOTCONFIG partition for active
* partitions settings and mangles the partition config so
* 0:QSEE/0:QSEE_1, 0:CDT/0:CDT_1 and 0:APPSBL/0:APPSBL_1 pairs
* can be swaped. It isn't a problem but we never can be sure where
* OFW put factory images. "n25q128a11" is required for proper nor
* recognition in u-boot.
*/
compatible = "jedec,spi-nor", "n25q128a11";
#address-cells = <1>;
#size-cells = <1>;
reg = <0>;
spi-max-frequency = <24000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "0:SBL1";
reg = <0x0 0x40000>;
read-only;
};
partition@40000 {
label = "0:MIBIB";
reg = <0x40000 0x20000>;
read-only;
};
partition@60000 {
label = "0:BOOTCONFIG";
reg = <0x60000 0x20000>;
read-only;
};
partition@80000 {
label = "0:BOOTCONFIG1";
reg = <0x80000 0x20000>;
read-only;
};
partition@a0000 {
label = "0:QSEE";
reg = <0xa0000 0x60000>;
read-only;
};
partition@100000 {
label = "0:QSEE_1";
reg = <0x100000 0x60000>;
read-only;
};
partition@160000 {
label = "0:CDT";
reg = <0x160000 0x10000>;
read-only;
};
partition@170000 {
label = "0:CDT_1";
reg = <0x170000 0x10000>;
read-only;
};
partition@180000 {
label = "0:DDRPARAMS";
reg = <0x180000 0x10000>;
read-only;
};
partition@190000 {
label = "0:APPSBLENV";
reg = <0x190000 0x10000>;
read-only;
};
partition@1a0000 {
label = "0:APPSBL";
reg = <0x1a0000 0xa0000>;
read-only;
};
partition@240000 {
label = "0:APPSBL_1";
reg = <0x240000 0xa0000>;
read-only;
};
partition@2e0000 {
label = "0:ART";
reg = <0x2e0000 0x10000>;
read-only;
};
config: partition@2f0000 {
label = "0:CONFIG";
reg = <0x2f0000 0x10000>;
read-only;
};
partition@300000 {
label = "0:CONFIG_RW";
reg = <0x300000 0x10000>;
read-only;
};
partition@310000 {
label = "0:EVENTSLOG";
reg = <0x310000 0x90000>;
read-only;
};
};
};
xt26g02a@1 {
/*
* Factory U-boot looks in 0:BOOTCONFIG partition for active
* partitions settings and mangles the partition config so
* rootfs/rootfs_1 pairs can be swaped.
* It isn't a problem but we never can be sure where OFW put
* factory images. "spinand,mt29f" value is required for proper
* nand recognition in u-boot.
*/
compatible = "spi-nand", "spinand,mt29f";
#address-cells = <1>;
#size-cells = <1>;
reg = <1>;
spi-max-frequency = <24000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "rootfs_1";
reg = <0x00000000 0x08000000>;
};
partition@8000000 {
label = "rootfs";
reg = <0x08000000 0x08000000>;
};
};
};
};
&mdio {
status = "okay";
pinctrl-0 = <&mdio_pins>;
pinctrl-names = "default";
phy-reset-gpio = <&tlmm 62 0>;
};
&wifi0 {
nvmem-cell-names = "pre-calibration", "mac-address";
nvmem-cells = <&precal_art_1000>, <&macaddr_config_0>;
mac-address-increment = <2>;
};
&wifi1 {
nvmem-cell-names = "pre-calibration", "mac-address";
nvmem-cells = <&precal_art_5000>, <&macaddr_config_0>;
mac-address-increment = <3>;
};
&gmac {
status = "okay";
};
&switch {
status = "okay";
};
&swport2 {
status = "okay";
label = "lan1";
};
&swport3 {
status = "okay";
label = "lan2";
};
&swport4 {
status = "okay";
label = "lan3";
};
&swport5 {
status = "okay";
label = "wan";
};

View file

@ -0,0 +1,36 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qcom-ipq4018-rutx.dtsi"
/ {
model = "Teltonika RUTX12";
compatible = "teltonika,rutx12";
soc {
leds {
compatible = "gpio-leds";
wifi2g {
label = "green:wifi2g";
gpios = <&stm32_io 19 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "phy0tpt";
};
wifi5g {
label = "green:wifi5g";
gpios = <&stm32_io 18 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "phy1tpt";
};
};
};
};
&wifi0 {
status = "okay";
qcom,ath10k-calibration-variant = "Teltonika-RUTX12";
};
&wifi1 {
status = "okay";
qcom,ath10k-calibration-variant = "Teltonika-RUTX12";
};

View file

@ -1,24 +0,0 @@
From f63ea127643a605da97090ce585fdd7c2d17fa42 Mon Sep 17 00:00:00 2001
From: Robert Marko <robert.marko@sartura.hr>
Date: Mon, 14 Dec 2020 13:35:35 +0100
Subject: [PATCH] mmc: sdhci-msm: use sdhci_set_clock
When using sdhci_msm_set_clock clock setting will fail, so lets
use the generic sdhci_set_clock.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
drivers/mmc/host/sdhci-msm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -2447,7 +2447,7 @@ MODULE_DEVICE_TABLE(of, sdhci_msm_dt_mat
static const struct sdhci_ops sdhci_msm_ops = {
.reset = sdhci_msm_reset,
- .set_clock = sdhci_msm_set_clock,
+ .set_clock = sdhci_set_clock,
.get_min_clock = sdhci_msm_get_min_clock,
.get_max_clock = sdhci_msm_get_max_clock,
.set_bus_width = sdhci_set_bus_width,

View file

@ -1,61 +0,0 @@
From 3e1825e00dafb68eec25df389b63f3ab3d905b59 Mon Sep 17 00:00:00 2001
From: Gabor Juhos <j4g8y7@gmail.com>
Date: Fri, 25 Dec 2020 08:02:47 +0100
Subject: [PATCH] net: phy: define PSGMII PHY interface mode
The PSGMII interface is similar to QSGMII. The main difference
is that the PSGMII interface combines five SGMII lines into a
single link while in QSGMII only four lines are combined.
Similarly to the QSGMII, this interface mode might also needs
special handling within the MAC driver.
Add definitions for the PHY layer to allow to express this type
of connection between the MAC and PHY.
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
Documentation/devicetree/bindings/net/ethernet-controller.yaml | 1 +
drivers/net/phy/phylink.c | 1 +
include/linux/phy.h | 3 +++
3 files changed, 5 insertions(+)
--- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
@@ -64,6 +64,7 @@ properties:
- mii
- gmii
- sgmii
+ - psgmii
- qsgmii
- tbi
- rev-mii
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -629,6 +629,7 @@ static int phylink_parse_mode(struct phy
switch (pl->link_config.interface) {
case PHY_INTERFACE_MODE_SGMII:
+ case PHY_INTERFACE_MODE_PSGMII:
case PHY_INTERFACE_MODE_QSGMII:
phylink_set(pl->supported, 10baseT_Half);
phylink_set(pl->supported, 10baseT_Full);
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -138,6 +138,7 @@ typedef enum {
PHY_INTERFACE_MODE_XGMII,
PHY_INTERFACE_MODE_XLGMII,
PHY_INTERFACE_MODE_MOCA,
+ PHY_INTERFACE_MODE_PSGMII,
PHY_INTERFACE_MODE_QSGMII,
PHY_INTERFACE_MODE_TRGMII,
PHY_INTERFACE_MODE_100BASEX,
@@ -243,6 +244,8 @@ static inline const char *phy_modes(phy_
return "xlgmii";
case PHY_INTERFACE_MODE_MOCA:
return "moca";
+ case PHY_INTERFACE_MODE_PSGMII:
+ return "psgmii";
case PHY_INTERFACE_MODE_QSGMII:
return "qsgmii";
case PHY_INTERFACE_MODE_TRGMII:

View file

@ -711,7 +711,7 @@ if [ "$OMR_KERNEL" = "6.1" ]; then
if [ "$TARGET" = "bpi-r2" ]; then
echo "# CONFIG_VERSION_CODE_FILENAMES is not set" >> ".config"
fi
if [ "$OMR_TARGET" != "x86" ] && [ "$OMR_TARGET" != "x86_64" ] && [ "$OMR_TARGET" != "r4s" ] && [ "$OMR_TARGET" != "r5s" ] && [ "$OMR_TARGET" != "qnap-301w" ] && [ "$OMR_TARGET" != "rpi4" ] && [ "$OMR_TARGET" != "rpi3" ] && [ "$OMR_TARGET" != "wrt32x" ] && [ "$OMR_TARGET" != "wrt3200acm" ] && [ "$OMR_TARGET" != "bpi-r64" ] && [ "$OMR_TARGET" != "r7800" ] && [ "$OMR_TARGET" != "espressobin" ] && [ "$OMR_TARGET" != "rutx" ]; then
if [ "$OMR_TARGET" != "x86" ] && [ "$OMR_TARGET" != "x86_64" ] && [ "$OMR_TARGET" != "r2s" ] && [ "$OMR_TARGET" != "r4s" ] && [ "$OMR_TARGET" != "r5s" ] && [ "$OMR_TARGET" != "qnap-301w" ] && [ "$OMR_TARGET" != "rpi2" ] && [ "$OMR_TARGET" != "rpi3" ] && [ "$OMR_TARGET" != "rpi4" ] && [ "$OMR_TARGET" != "rpi3" ] && [ "$OMR_TARGET" != "wrt32x" ] && [ "$OMR_TARGET" != "wrt3200acm" ] && [ "$OMR_TARGET" != "bpi-r64" ] && [ "$OMR_TARGET" != "r7800" ] && [ "$OMR_TARGET" != "espressobin" ] && [ "$OMR_TARGET" != "rutx" ]; then
echo "Sorry but kernel 6.1 is not supported on your arch yet"
NOT_SUPPORTED="1"
#exit 1