mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 01:22:25 +00:00
Compare commits
2 Commits
main
...
staging-WI
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0319701aef | ||
|
|
780ce003b2 |
@@ -1,14 +0,0 @@
|
||||
--- a/hostapd/ctrl_iface.c 2025-09-24 14:15:25.135668867 +0800
|
||||
+++ b/hostapd/ctrl_iface.c 2025-09-24 15:32:46.082317382 +0800
|
||||
@@ -2657,6 +2657,11 @@ static int hostapd_ctrl_iface_chan_switc
|
||||
break;
|
||||
}
|
||||
|
||||
+ /* Initialize HT/VHT/HE parameters */
|
||||
+ settings.freq_params.ht_enabled = iface->conf->ieee80211n;
|
||||
+ settings.freq_params.vht_enabled = iface->conf->ieee80211ac;
|
||||
+ settings.freq_params.he_enabled = iface->conf->ieee80211ax;
|
||||
+
|
||||
if (settings.freq_params.center_freq1)
|
||||
dfs_range += hostapd_is_dfs_overlap(
|
||||
iface, bandwidth, settings.freq_params.center_freq1);
|
||||
@@ -47,11 +47,6 @@ ALLWIFIBOARDS:= \
|
||||
indio-um-310ax-v1 \
|
||||
indio-um-510axp-v1 \
|
||||
indio-um-510axm-v1 \
|
||||
indio-um-325ax-v2 \
|
||||
indio-um-335ax \
|
||||
indio-um-345ax \
|
||||
indio-um-525axp \
|
||||
indio-um-525axm \
|
||||
muxi-ap3220l \
|
||||
plasmacloud-pax1800 \
|
||||
wallys-dr5018 \
|
||||
@@ -446,11 +441,6 @@ $(eval $(call generate-ath11k-wifi-package,liteon-wpx8324,Liteon WPX8324))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-310ax-v1,Indio UM-310AX V1))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-510axp-v1,Indio UM-510AXP V1))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-510axm-v1,Indio UM-510AXM V1))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-325ax-v2,Indio UM-325AX V2))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-335ax,Indio UM-335AX))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-345ax,Indio UM-345AX))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-525axp,Indio UM-525AXP))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-525axm,Indio UM-525AXM))
|
||||
$(eval $(call generate-ath11k-wifi-package,sonicfi-rap630c-311g,Sonicfi RAP630C 311G))
|
||||
$(eval $(call generate-ath11k-wifi-package,sonicfi-rap630w-311g,Sonicfi RAP630W 311G))
|
||||
$(eval $(call generate-ath11k-wifi-package,sonicfi-rap630w-312g,Sonicfi RAP630W 312G))
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -27,7 +27,6 @@ DEFAULT_PACKAGES += kmod-qca-nss-dp kmod-qca-ssdk swconfig \
|
||||
kmod-ath11k-ahb ath11k-firmware-ipq5018 \
|
||||
kmod-gpio-button-hotplug iwinfo \
|
||||
qca-ssdk-shell kmod-bootconfig \
|
||||
uboot-envtools -procd-ujail \
|
||||
kmod-mdio-qca
|
||||
uboot-envtools -procd-ujail
|
||||
|
||||
$(eval $(call BuildTarget))
|
||||
|
||||
@@ -16,14 +16,6 @@ edgecore,eap104)
|
||||
ucidef_set_led_netdev "wan" "wan" "yellow:uplink" "eth0"
|
||||
ucidef_set_led_default "power" "POWER" "green:power" "on"
|
||||
;;
|
||||
indio,um-325ax-v2|\
|
||||
indio,um-335ax|\
|
||||
indio,um-525axm|\
|
||||
indio,um-525axp)
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "led_2g" "phy0tpt"
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "led_5g" "phy1tpt"
|
||||
ucidef_set_led_default "power" "POWER" "led_sys" "on"
|
||||
;;
|
||||
cig,wf186h|\
|
||||
cig,wf186w)
|
||||
ucidef_set_led_default "power" "POWER" "green:status" "on"
|
||||
|
||||
@@ -48,15 +48,6 @@ qcom_setup_interfaces()
|
||||
ucidef_add_switch "switch1" \
|
||||
"6u@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
|
||||
;;
|
||||
indio,um-325ax-v2|\
|
||||
indio,um-335ax|\
|
||||
indio,um-525axm|\
|
||||
indio,um-525axp)
|
||||
ucidef_set_interface_wan "eth1"
|
||||
ucidef_set_interface_lan "eth0"
|
||||
ucidef_add_switch "switch1" \
|
||||
"6@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
|
||||
;;
|
||||
emplus,wap385c|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_w)
|
||||
|
||||
@@ -142,10 +142,6 @@ ath11k/IPQ5018/hw1.0/caldata.bin)
|
||||
emplus,wap385c|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_w|\
|
||||
indio,um-325ax-v2|\
|
||||
indio,um-335ax|\
|
||||
indio,um-525axm|\
|
||||
indio,um-525axp|\
|
||||
optimcloud,d60|\
|
||||
optimcloud,d60-5g|\
|
||||
optimcloud,d50|\
|
||||
@@ -187,9 +183,6 @@ ath11k/qcn6122/hw1.0/caldata_1.bin)
|
||||
;;
|
||||
ath11k/qcn6122/hw1.0/caldata_2.bin)
|
||||
case "$board" in
|
||||
indio,um-325ax-v2|\
|
||||
indio,um-525axm|\
|
||||
indio,um-525axp|\
|
||||
wallys,dr5018|\
|
||||
edgecore,eap104|\
|
||||
edgecore,oap101-6e|\
|
||||
@@ -208,7 +201,6 @@ ath11k/qcn6122/hw1.0/caldata_2.bin)
|
||||
;;
|
||||
ath11k/QCN9074/hw1.0/caldata_1.bin)
|
||||
case "$board" in
|
||||
indio,um-335ax|\
|
||||
optimcloud,d60|\
|
||||
optimcloud,d60-5g|\
|
||||
optimcloud,d50|\
|
||||
@@ -242,9 +234,6 @@ ath11k-macs)
|
||||
edgecore,oap101|\
|
||||
edgecore,oap101-6e|\
|
||||
edgecore,oap101e-6e|\
|
||||
indio,um-325ax-v2|\
|
||||
indio,um-525axp|\
|
||||
indio,um-525axm|\
|
||||
optimcloud,d60|\
|
||||
optimcloud,d60-5g|\
|
||||
optimcloud,d50|\
|
||||
|
||||
@@ -81,10 +81,6 @@ platform_check_image() {
|
||||
wallys,dr5018|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_w|\
|
||||
indio,um-325ax-v2|\
|
||||
indio,um-335ax|\
|
||||
indio,um-525axp|\
|
||||
indio,um-525axm|\
|
||||
optimcloud,d60|\
|
||||
optimcloud,d60-5g|\
|
||||
optimcloud,d50|\
|
||||
@@ -111,46 +107,29 @@ platform_do_upgrade() {
|
||||
|
||||
board=$(board_name)
|
||||
case $board in
|
||||
indio,um-325ax-v2|\
|
||||
indio,um-335ax|\
|
||||
indio,um-525axp|\
|
||||
indio,um-525axm|\
|
||||
glinet,b3000|\
|
||||
edgecore,oap101|\
|
||||
edgecore,oap101-6e|\
|
||||
edgecore,oap101e|\
|
||||
edgecore,oap101e-6e|\
|
||||
edgecore,eap104)
|
||||
if [ "$(find_mtd_chardev rootfs)" ]; then
|
||||
CI_UBIPART="rootfs"
|
||||
else
|
||||
if grep -q rootfs1 /proc/cmdline; then
|
||||
CI_UBIPART="rootfs2"
|
||||
CI_FWSETENV="active 2"
|
||||
else
|
||||
CI_UBIPART="rootfs1"
|
||||
CI_FWSETENV="active 1"
|
||||
fi
|
||||
fi
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
glinet,b3000)
|
||||
CI_UBIPART="rootfs1"
|
||||
[ "$(find_mtd_chardev rootfs)" ] && CI_UBIPART="rootfs"
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_w)
|
||||
wp_part=$(fw_printenv primary | cut -d = -f2)
|
||||
echo "Current Primary is $wp_part"
|
||||
if [[ $wp_part == 1 ]]; then
|
||||
CI_UBIPART="rootfs"
|
||||
CI_FWSETENV="primary 0"
|
||||
else
|
||||
CI_UBIPART="rootfs_1"
|
||||
CI_FWSETENV="primary 1"
|
||||
fi
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
wp_part=$(fw_printenv primary | cut -d = -f2)
|
||||
echo "Current Primary is $wp_part"
|
||||
if [[ $wp_part == 1 ]]; then
|
||||
CI_UBIPART="rootfs"
|
||||
CI_FWSETENV="primary 0"
|
||||
else
|
||||
CI_UBIPART="rootfs_1"
|
||||
CI_FWSETENV="primary 1"
|
||||
fi
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
cig,wf186w|\
|
||||
cig,wf186h|\
|
||||
emplus,wap385c|\
|
||||
|
||||
@@ -635,7 +635,7 @@ CONFIG_MDIO_BITBANG=y
|
||||
CONFIG_MDIO_BOARDINFO=y
|
||||
# CONFIG_MDIO_BUS_MUX_MULTIPLEXER is not set
|
||||
CONFIG_MDIO_GPIO=y
|
||||
CONFIG_MDIO_QCA=m
|
||||
CONFIG_MDIO_QCA=y
|
||||
# CONFIG_MDM_GCC_9615 is not set
|
||||
# CONFIG_MDM_LCC_9615 is not set
|
||||
# CONFIG_MEMORY_HOTPLUG is not set
|
||||
|
||||
@@ -391,8 +391,8 @@
|
||||
mdio-bus = <&mdio1>;
|
||||
reset_gpio = <&tlmm 0x26 0>;
|
||||
switch_cpu_bmp = <0x40>; /* cpu port bitmap (Port 6 GMAC) */
|
||||
switch_lan_bmp = <0x1c>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x20>; /* wan port bitmap */
|
||||
switch_lan_bmp = <0x3c>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x0>; /* wan port bitmap */
|
||||
qca,ar8327-initvals = <
|
||||
0x00004 0x7600000 /* PAD0_MODE */
|
||||
0x00008 0x1000000 /* PAD5_MODE */
|
||||
|
||||
@@ -1,941 +0,0 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "ipq5018.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Indio UM-325AX V2";
|
||||
compatible = "indio,um-325ax-v2", "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
//led-failsafe = &led_red;
|
||||
//led-running = &led_green;
|
||||
//led-upgrade = &led_green;
|
||||
//led-gateway = &led_blue;
|
||||
//led-factory = &led_blue;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
bootargs-append = " swiotlb=1";
|
||||
#else
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
#endif
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* 256 MB Profile
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D300000 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E400000 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4F300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F400000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4500000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x1400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F400000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 14MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | Caldb | 0x4D400000 | 2MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D600000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E600000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E700000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | Caldb | 0x4E800000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4ED00000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4FD00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4FE00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | Caldb | 0x4FF00000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x5400000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xE00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D400000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D600000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E600000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4ED00000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FD00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FF00000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
gpio-watchdog {
|
||||
compatible = "linux,wdt-gpio";
|
||||
gpios = <&tlmm 27 GPIO_ACTIVE_LOW>;
|
||||
hw_algo = "toggle";
|
||||
hw_margin_ms = <5000>;
|
||||
always-running;
|
||||
};
|
||||
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
blsp1_uart2: serial@78b0000 {
|
||||
pinctrl-0 = <&blsp1_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 39 0>;
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <28>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-instance {
|
||||
num_devices = <0x1>;
|
||||
ess-switch@0x39c00000 {
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
mdiobus = <&mdio0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
port_mac_sel = "QGMAC_PORT";
|
||||
};
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
};
|
||||
ess-switch1@1 {
|
||||
compatible = "qcom,ess-switch-qca83xx";
|
||||
device_id = <1>;
|
||||
switch_access_mode = "mdio";
|
||||
mdio-bus = <&mdio1>;
|
||||
reset_gpio = <0x28>;
|
||||
switch_cpu_bmp = <0x40>; /* cpu port bitmap */
|
||||
switch_lan_bmp = <0x1e>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x0>; /* wan port bitmap */
|
||||
qca,ar8327-initvals = <
|
||||
0x00004 0x7600000 /* PAD0_MODE */
|
||||
0x00008 0x1000000 /* PAD5_MODE */
|
||||
0x0000c 0x80 /* PAD6_MODE */
|
||||
0x00010 0x2613a0 /* PORT6 FORCE MODE*/
|
||||
0x000e4 0xaa545 /* MAC_POWER_SEL */
|
||||
0x000e0 0xc74164de /* SGMII_CTRL */
|
||||
0x0007c 0x4e /* PORT0_STATUS */
|
||||
0x00094 0x4e /* PORT6_STATUS */
|
||||
>;
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <28>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <28>;
|
||||
mdio-bus = <&mdio1>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nss-macsec1 {
|
||||
compatible = "qcom,nss-macsec";
|
||||
phy_addr = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
};
|
||||
|
||||
lpass: lpass@0xA000000{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm: pcm@0xA3C0000{
|
||||
pinctrl-0 = <&audio_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm_lb: pcm_lb@0 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
blsp0_uart_pins: uart_pins {
|
||||
blsp0_uart_rx_tx {
|
||||
pins = "gpio20", "gpio21";
|
||||
function = "blsp0_uart0";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp1_uart_pins: blsp1_uart_pins {
|
||||
blsp1_uart_rx_tx {
|
||||
pins = "gpio22", "gpio24", "gpio23", "gpio25";
|
||||
function = "blsp1_uart2";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_0 {
|
||||
pins = "gpio7";
|
||||
function = "qspi0";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_1 {
|
||||
pins = "gpio6";
|
||||
function = "qspi1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_2 {
|
||||
pins = "gpio5";
|
||||
function = "qspi2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_3 {
|
||||
pins = "gpio4";
|
||||
function = "qspi3";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
phy_led_pins: phy_led_pins {
|
||||
gephy_led_pin {
|
||||
pins = "gpio46";
|
||||
function = "led0";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio25";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio26";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
reset_button {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
audio_pins: audio_pinmux {
|
||||
};
|
||||
leds_pins: leds_pins {
|
||||
led_5g {
|
||||
pins = "gpio34";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_2g {
|
||||
pins = "gpio33";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_sys {
|
||||
pins = "gpio26";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_onekey {
|
||||
pins = "gpio28";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led_blue: led@34 {
|
||||
label = "led_5g";
|
||||
gpios = <&tlmm 34 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_5g";
|
||||
default-state = "off";
|
||||
};
|
||||
led_green: led@33 {
|
||||
label = "led_2g";
|
||||
gpios = <&tlmm 33 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_2g";
|
||||
default-state = "off";
|
||||
};
|
||||
led_red: led@26 {
|
||||
label = "led_sys";
|
||||
gpios = <&tlmm 26 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_sys";
|
||||
default-state = "off";
|
||||
};
|
||||
led@28 {
|
||||
label = "led_onekey";
|
||||
gpios = <&tlmm 28 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_onekey";
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&q6v5_wcss {
|
||||
compatible = "qcom,ipq5018-q6-mpd";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
reg = <0x0cd00000 0x4040>,
|
||||
<0x1938000 0x8>,
|
||||
<0x193d204 0x4>;
|
||||
reg-names = "qdsp6",
|
||||
"tcsr-msip",
|
||||
"tcsr-q6";
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_Q6_BCR>;
|
||||
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_q6_reset";
|
||||
|
||||
clocks = <&gcc GCC_Q6_AXIS_CLK>,
|
||||
<&gcc GCC_WCSS_ECAHB_CLK>,
|
||||
<&gcc GCC_Q6_AXIM_CLK>,
|
||||
<&gcc GCC_Q6_AXIM2_CLK>,
|
||||
<&gcc GCC_Q6_AHB_CLK>,
|
||||
<&gcc GCC_Q6_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_S_CLK>;
|
||||
clock-names = "gcc_q6_axis_clk",
|
||||
"gcc_wcss_ecahb_clk",
|
||||
"gcc_q6_axim_clk",
|
||||
"gcc_q6_axim2_clk",
|
||||
"gcc_q6_ahb_clk",
|
||||
"gcc_q6_ahb_s_clk",
|
||||
"gcc_wcss_axi_s_clk";
|
||||
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>,
|
||||
<&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
qcom,rproc = <&q6v5_wcss>;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
|
||||
<0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
status = "ok";
|
||||
q6_wcss_pd1: remoteproc_pd1@4ab000 {
|
||||
compatible = "qcom,ipq5018-wcss-ahb-mpd";
|
||||
reg = <0x4ab000 0x20>;
|
||||
reg-names = "rmb";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_BCR>,
|
||||
<&gcc GCC_CE_BCR>;
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_reset",
|
||||
"ce_reset";
|
||||
|
||||
clocks = <&gcc GCC_WCSS_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_ACMT_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_M_CLK>;
|
||||
clock-names = "gcc_wcss_ahb_s_clk",
|
||||
"gcc_wcss_acmt_clk",
|
||||
"gcc_wcss_axi_m_clk";
|
||||
|
||||
qcom,halt-regs = <&tcsr_q6_block 0xa000 0xd000 0x0>;
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd2: remoteproc_pd2 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd3: remoteproc_pd3 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 24 0>,
|
||||
<&wcss_smp2p_in 25 0>,
|
||||
<&wcss_smp2p_in 28 0>,
|
||||
<&wcss_smp2p_in 27 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 24>,
|
||||
<&wcss_smp2p_out 25>,
|
||||
<&wcss_smp2p_out 26>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
qcom,rproc = <&q6_wcss_pd1>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x24>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 5G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd2";
|
||||
qcom,rproc = <&q6_wcss_pd2>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x50>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4D600000 0x4D600000 0x4D300000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4E800000 0x4E800000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>;
|
||||
#endif
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&wifi2 {
|
||||
/* QCN6122 6G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
qcom,rproc = <&q6_wcss_pd3>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0xb0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
||||
&usb3 {
|
||||
status = "ok";
|
||||
device-power-gpio = <&tlmm 24 1>;
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
#status = "disabled";
|
||||
#perst-gpio = <&tlmm 18 1>;
|
||||
perst-gpio = <&tlmm 18 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
#status = "disabled";
|
||||
#perst-gpio = <&tlmm 15 1>;
|
||||
perst-gpio = <&tlmm 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,731 +0,0 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2025, Shubham Vishwakarma <shubhamvis98@fossfrog.in>.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "ipq5018.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Indio UM-335AX";
|
||||
compatible = "indio,um-335ax", "qcom,ipq5018-ap-mp03.1", "qcom,ipq5018-mp03.1", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
led-boot = &led_red;
|
||||
led-failsafe = &led_red;
|
||||
led-running = &led_red;
|
||||
led-upgrade = &led_red;
|
||||
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
gpio-watchdog {
|
||||
compatible = "linux,wdt-gpio";
|
||||
gpios = <&tlmm 27 GPIO_ACTIVE_LOW>;
|
||||
hw_algo = "toggle";
|
||||
hw_margin_ms = <5000>;
|
||||
always-running;
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x1800000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xE00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4C800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C800000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4C900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C900000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4CA00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CA00000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
qcn9000_pcie0: qcn9000_pcie0@4cc00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4CC00000 0x0 0x2600000>;
|
||||
};
|
||||
|
||||
#if defined(__CNSS2__)
|
||||
mhi_region1: dma_pool1@4F200000 {
|
||||
compatible = "shared-dma-pool";
|
||||
no-map;
|
||||
reg = <0x0 0x4F200000 0x0 0x900000>;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
blsp1_uart2: serial@78b0000 {
|
||||
pinctrl-0 = <&blsp1_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 39 0>;
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <28>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-instance {
|
||||
num_devices = <0x1>;
|
||||
ess-switch@0x39c00000 {
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
mdiobus = <&mdio0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
port_mac_sel = "QGMAC_PORT";
|
||||
};
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
};
|
||||
ess-switch1@1 {
|
||||
compatible = "qcom,ess-switch-qca83xx";
|
||||
device_id = <1>;
|
||||
switch_access_mode = "mdio";
|
||||
mdio-bus = <&mdio1>;
|
||||
reset_gpio = <0x28>;
|
||||
switch_cpu_bmp = <0x40>; /* cpu port bitmap */
|
||||
switch_lan_bmp = <0x1e>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x0>; /* wan port bitmap */
|
||||
qca,ar8327-initvals = <
|
||||
0x00004 0x7600000 /* PAD0_MODE */
|
||||
0x00008 0x1000000 /* PAD5_MODE */
|
||||
0x0000c 0x80 /* PAD6_MODE */
|
||||
0x00010 0x2613a0 /* PORT6 FORCE MODE*/
|
||||
0x000e4 0xaa545 /* MAC_POWER_SEL */
|
||||
0x000e0 0xc74164de /* SGMII_CTRL */
|
||||
0x0007c 0x4e /* PORT0_STATUS */
|
||||
0x00094 0x4e /* PORT6_STATUS */
|
||||
>;
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <28>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <28>;
|
||||
mdio-bus = <&mdio1>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nss-macsec1 {
|
||||
compatible = "qcom,nss-macsec";
|
||||
phy_addr = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
};
|
||||
|
||||
lpass: lpass@0xA000000{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm: pcm@0xA3C0000{
|
||||
pinctrl-0 = <&audio_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm_lb: pcm_lb@0 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
blsp0_uart_pins: uart_pins {
|
||||
blsp0_uart_rx_tx {
|
||||
pins = "gpio20", "gpio21";
|
||||
function = "blsp0_uart0";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp1_uart_pins: blsp1_uart_pins {
|
||||
blsp1_uart_rx_tx {
|
||||
pins = "gpio22", "gpio24", "gpio23", "gpio25";
|
||||
function = "blsp1_uart2";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_0 {
|
||||
pins = "gpio7";
|
||||
function = "qspi0";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_1 {
|
||||
pins = "gpio6";
|
||||
function = "qspi1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_2 {
|
||||
pins = "gpio5";
|
||||
function = "qspi2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_3 {
|
||||
pins = "gpio4";
|
||||
function = "qspi3";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
phy_led_pins: phy_led_pins {
|
||||
gephy_led_pin {
|
||||
pins = "gpio46";
|
||||
function = "led0";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio25";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio26";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
reset_button {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
audio_pins: audio_pinmux {
|
||||
};
|
||||
|
||||
leds_pins: leds_pins {
|
||||
led_blue: led_5g {
|
||||
label = "led_5g";
|
||||
pins = "gpio34";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
led_green: led_2g {
|
||||
label = "led_2g";
|
||||
pins = "gpio33";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
led_red: led_sys {
|
||||
label = "led_sys";
|
||||
pins = "gpio26";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
led_onekey {
|
||||
pins = "gpio28";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led@33 {
|
||||
label = "led_5g";
|
||||
gpios = <&tlmm 34 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_5g";
|
||||
default-state = "off";
|
||||
};
|
||||
led@34 {
|
||||
label = "led_2g";
|
||||
gpios = <&tlmm 33 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_2g";
|
||||
default-state = "off";
|
||||
};
|
||||
led@26 {
|
||||
label = "led_sys";
|
||||
gpios = <&tlmm 26 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_sys";
|
||||
default-state = "on";
|
||||
};
|
||||
led@28 {
|
||||
label = "led_onekey";
|
||||
gpios = <&tlmm 28 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_onekey";
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&q6v5_wcss {
|
||||
compatible = "qcom,ipq5018-q6-mpd";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
reg = <0x0cd00000 0x4040>,
|
||||
<0x1938000 0x8>,
|
||||
<0x193d204 0x4>;
|
||||
reg-names = "qdsp6",
|
||||
"tcsr-msip",
|
||||
"tcsr-q6";
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_Q6_BCR>;
|
||||
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_q6_reset";
|
||||
|
||||
clocks = <&gcc GCC_Q6_AXIS_CLK>,
|
||||
<&gcc GCC_WCSS_ECAHB_CLK>,
|
||||
<&gcc GCC_Q6_AXIM_CLK>,
|
||||
<&gcc GCC_Q6_AXIM2_CLK>,
|
||||
<&gcc GCC_Q6_AHB_CLK>,
|
||||
<&gcc GCC_Q6_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_S_CLK>;
|
||||
clock-names = "gcc_q6_axis_clk",
|
||||
"gcc_wcss_ecahb_clk",
|
||||
"gcc_q6_axim_clk",
|
||||
"gcc_q6_axim2_clk",
|
||||
"gcc_q6_ahb_clk",
|
||||
"gcc_q6_ahb_s_clk",
|
||||
"gcc_wcss_axi_s_clk";
|
||||
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>,
|
||||
<&q6_caldb_region>;
|
||||
|
||||
qcom,rproc = <&q6v5_wcss>;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
|
||||
<0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
status = "ok";
|
||||
q6_wcss_pd1: remoteproc_pd1@4ab000 {
|
||||
compatible = "qcom,ipq5018-wcss-ahb-mpd";
|
||||
reg = <0x4ab000 0x20>;
|
||||
reg-names = "rmb";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_BCR>,
|
||||
<&gcc GCC_CE_BCR>;
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_reset",
|
||||
"ce_reset";
|
||||
|
||||
clocks = <&gcc GCC_WCSS_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_ACMT_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_M_CLK>;
|
||||
clock-names = "gcc_wcss_ahb_s_clk",
|
||||
"gcc_wcss_acmt_clk",
|
||||
"gcc_wcss_axi_m_clk";
|
||||
|
||||
qcom,halt-regs = <&tcsr_q6_block 0xa000 0xd000 0x0>;
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
pinctrl-names = "default";
|
||||
// status = "disabled";
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "ok";
|
||||
device-power-gpio = <&tlmm 24 1>;
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
|
||||
&blsp1_uart1 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&ssuniphy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
perst-gpio = <&tlmm 18 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
status = "ok";
|
||||
perst-gpio = <&tlmm 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&wcss {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x2phy {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "ok";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
qrtr_instance_id = <0x20>;
|
||||
qti,disable-rddm-prealloc;
|
||||
qti,rddm-seg-len = <0x1000>;
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
#if defined(__CNSS2__)
|
||||
memory-region = <0>,<&mhi_region1>;
|
||||
#else
|
||||
base-addr = <0x4CB00000>;
|
||||
m3-dump-addr = <0x4DF00000>;
|
||||
etr-addr = <0x4E000000>;
|
||||
qcom,caldb-addr = <0x4E100000>;
|
||||
pageable-addr = <0x4E900000>;
|
||||
qcom,tgt-mem-mode = <0x1>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
qcom,rproc = <&q6_wcss_pd1>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
qcom,board_id = <0x24>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi3 {
|
||||
/* QCN9000 5G */
|
||||
board_id = <0xa0>;
|
||||
hremote_node = <&qcn9000_pcie0>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* QCN9000 tgt-mem-mode=2 layout - 17MB
|
||||
* +=========+==============+=========+
|
||||
* | Region | Start Offset | Size |
|
||||
* +---------+--------------+---------+
|
||||
* | HREMOTE | 0x4C900000 | 11MB |
|
||||
* +---------+--------------+---------+
|
||||
* | M3 Dump | 0x4D400000 | 1MB |
|
||||
* +---------+--------------+---------+
|
||||
* | ETR | 0x4D500000 | 1MB |
|
||||
* +---------+--------------+---------+
|
||||
* | Pageable| 0x4D600000 | 4MB |
|
||||
* +==================================+
|
||||
*/
|
||||
base-addr = <0x4C900000>;
|
||||
m3-dump-addr = <0x4D400000>;
|
||||
etr-addr = <0x4D500000>;
|
||||
caldb-addr = <0>;
|
||||
pageable-addr = <0x4D600000>;
|
||||
caldb-size = <0>;
|
||||
hremote-size = <0xB00000>;
|
||||
tgt-mem-mode = <0x2>;
|
||||
pageable-size = <0x400000>;
|
||||
#elif __IPQ_MEM_PROFILE_512_MB__
|
||||
/* QCN9000 tgt-mem-mode=1 layout - 26MB
|
||||
* +=========+==============+=========+
|
||||
* | Region | Start Offset | Size |
|
||||
* +---------+--------------+---------+
|
||||
* | HREMOTE | 0x4CB00000 | 12MB |
|
||||
* +---------+--------------+---------+
|
||||
* | M3 Dump | 0x4D700000 | 1MB |
|
||||
* +---------+--------------+---------+
|
||||
* | ETR | 0x4D800000 | 1MB |
|
||||
* +---------+--------------+---------+
|
||||
* | Caldb | 0x4D900000 | 8MB |
|
||||
* +---------+--------------+---------+
|
||||
* | Pageable| 0x4E100000 | 4MB |
|
||||
* +==================================+
|
||||
*/
|
||||
base-addr = <0x4CB00000>;
|
||||
m3-dump-addr = <0x4D700000>;
|
||||
etr-addr = <0x4D800000>;
|
||||
caldb-addr = <0x4D900000>;
|
||||
pageable-addr = <0x4E100000>;
|
||||
caldb-size = <0x800000>;
|
||||
hremote-size = <0xC00000>;
|
||||
tgt-mem-mode = <0x1>;
|
||||
pageable-size = <0x400000>;
|
||||
#else
|
||||
/* QCN9000 tgt-mem-mode=0 layout - 53MB
|
||||
* +=========+==============+=========+
|
||||
* | Region | Start Offset | Size |
|
||||
* +---------+--------------+---------+
|
||||
* | HREMOTE | 0x4CB00000 | 35MB |
|
||||
* +---------+--------------+---------+
|
||||
* | M3 Dump | 0x4EE00000 | 1MB |
|
||||
* +---------+--------------+---------+
|
||||
* | ETR | 0x4EF00000 | 1MB |
|
||||
* +---------+--------------+---------+
|
||||
* | Caldb | 0x4F000000 | 8MB |
|
||||
* +---------+--------------+---------+
|
||||
* | Pageable| 0x4F800000 | 8MB |
|
||||
* +==================================+
|
||||
*/
|
||||
base-addr = <0x4CB00000>;
|
||||
m3-dump-addr = <0x4EE00000>;
|
||||
etr-addr = <0x4EF00000>;
|
||||
caldb-addr = <0x4F000000>;
|
||||
pageable-addr = <0x4F800000>;
|
||||
hremote-size = <0x2300000>;
|
||||
caldb-size = <0x800000>;
|
||||
tgt-mem-mode = <0x0>;
|
||||
pageable-size = <0x800000>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
@@ -1,941 +0,0 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "ipq5018.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Indio UM-525AXM";
|
||||
compatible = "indio,um-525axm", "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
//led-failsafe = &led_red;
|
||||
//led-running = &led_green;
|
||||
//led-upgrade = &led_green;
|
||||
//led-gateway = &led_blue;
|
||||
//led-factory = &led_blue;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
bootargs-append = " swiotlb=1";
|
||||
#else
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
#endif
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* 256 MB Profile
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D300000 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E400000 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4F300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F400000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4500000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x1400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F400000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 14MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | Caldb | 0x4D400000 | 2MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D600000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E600000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E700000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | Caldb | 0x4E800000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4ED00000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4FD00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4FE00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | Caldb | 0x4FF00000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x5400000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xE00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D400000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D600000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E600000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4ED00000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FD00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FF00000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
gpio-watchdog {
|
||||
compatible = "linux,wdt-gpio";
|
||||
gpios = <&tlmm 27 GPIO_ACTIVE_LOW>;
|
||||
hw_algo = "toggle";
|
||||
hw_margin_ms = <5000>;
|
||||
always-running;
|
||||
};
|
||||
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
blsp1_uart2: serial@78b0000 {
|
||||
pinctrl-0 = <&blsp1_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 39 0>;
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <28>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-instance {
|
||||
num_devices = <0x1>;
|
||||
ess-switch@0x39c00000 {
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
mdiobus = <&mdio0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
port_mac_sel = "QGMAC_PORT";
|
||||
};
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
};
|
||||
ess-switch1@1 {
|
||||
compatible = "qcom,ess-switch-qca83xx";
|
||||
device_id = <1>;
|
||||
switch_access_mode = "mdio";
|
||||
mdio-bus = <&mdio1>;
|
||||
reset_gpio = <0x28>;
|
||||
switch_cpu_bmp = <0x40>; /* cpu port bitmap */
|
||||
switch_lan_bmp = <0x1e>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x0>; /* wan port bitmap */
|
||||
qca,ar8327-initvals = <
|
||||
0x00004 0x7600000 /* PAD0_MODE */
|
||||
0x00008 0x1000000 /* PAD5_MODE */
|
||||
0x0000c 0x80 /* PAD6_MODE */
|
||||
0x00010 0x2613a0 /* PORT6 FORCE MODE*/
|
||||
0x000e4 0xaa545 /* MAC_POWER_SEL */
|
||||
0x000e0 0xc74164de /* SGMII_CTRL */
|
||||
0x0007c 0x4e /* PORT0_STATUS */
|
||||
0x00094 0x4e /* PORT6_STATUS */
|
||||
>;
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <28>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <28>;
|
||||
mdio-bus = <&mdio1>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nss-macsec1 {
|
||||
compatible = "qcom,nss-macsec";
|
||||
phy_addr = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
};
|
||||
|
||||
lpass: lpass@0xA000000{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm: pcm@0xA3C0000{
|
||||
pinctrl-0 = <&audio_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm_lb: pcm_lb@0 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
blsp0_uart_pins: uart_pins {
|
||||
blsp0_uart_rx_tx {
|
||||
pins = "gpio20", "gpio21";
|
||||
function = "blsp0_uart0";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp1_uart_pins: blsp1_uart_pins {
|
||||
blsp1_uart_rx_tx {
|
||||
pins = "gpio22", "gpio24", "gpio23", "gpio25";
|
||||
function = "blsp1_uart2";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_0 {
|
||||
pins = "gpio7";
|
||||
function = "qspi0";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_1 {
|
||||
pins = "gpio6";
|
||||
function = "qspi1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_2 {
|
||||
pins = "gpio5";
|
||||
function = "qspi2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_3 {
|
||||
pins = "gpio4";
|
||||
function = "qspi3";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
phy_led_pins: phy_led_pins {
|
||||
gephy_led_pin {
|
||||
pins = "gpio46";
|
||||
function = "led0";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio25";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio26";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
reset_button {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
audio_pins: audio_pinmux {
|
||||
};
|
||||
leds_pins: leds_pins {
|
||||
led_5g {
|
||||
pins = "gpio34";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_2g {
|
||||
pins = "gpio33";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_sys {
|
||||
pins = "gpio26";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_onekey {
|
||||
pins = "gpio28";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led_blue: led@34 {
|
||||
label = "led_5g";
|
||||
gpios = <&tlmm 34 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_5g";
|
||||
default-state = "off";
|
||||
};
|
||||
led_green: led@33 {
|
||||
label = "led_2g";
|
||||
gpios = <&tlmm 33 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_2g";
|
||||
default-state = "off";
|
||||
};
|
||||
led_red: led@26 {
|
||||
label = "led_sys";
|
||||
gpios = <&tlmm 26 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_sys";
|
||||
default-state = "off";
|
||||
};
|
||||
led@28 {
|
||||
label = "led_onekey";
|
||||
gpios = <&tlmm 28 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_onekey";
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&q6v5_wcss {
|
||||
compatible = "qcom,ipq5018-q6-mpd";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
reg = <0x0cd00000 0x4040>,
|
||||
<0x1938000 0x8>,
|
||||
<0x193d204 0x4>;
|
||||
reg-names = "qdsp6",
|
||||
"tcsr-msip",
|
||||
"tcsr-q6";
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_Q6_BCR>;
|
||||
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_q6_reset";
|
||||
|
||||
clocks = <&gcc GCC_Q6_AXIS_CLK>,
|
||||
<&gcc GCC_WCSS_ECAHB_CLK>,
|
||||
<&gcc GCC_Q6_AXIM_CLK>,
|
||||
<&gcc GCC_Q6_AXIM2_CLK>,
|
||||
<&gcc GCC_Q6_AHB_CLK>,
|
||||
<&gcc GCC_Q6_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_S_CLK>;
|
||||
clock-names = "gcc_q6_axis_clk",
|
||||
"gcc_wcss_ecahb_clk",
|
||||
"gcc_q6_axim_clk",
|
||||
"gcc_q6_axim2_clk",
|
||||
"gcc_q6_ahb_clk",
|
||||
"gcc_q6_ahb_s_clk",
|
||||
"gcc_wcss_axi_s_clk";
|
||||
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>,
|
||||
<&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
qcom,rproc = <&q6v5_wcss>;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
|
||||
<0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
status = "ok";
|
||||
q6_wcss_pd1: remoteproc_pd1@4ab000 {
|
||||
compatible = "qcom,ipq5018-wcss-ahb-mpd";
|
||||
reg = <0x4ab000 0x20>;
|
||||
reg-names = "rmb";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_BCR>,
|
||||
<&gcc GCC_CE_BCR>;
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_reset",
|
||||
"ce_reset";
|
||||
|
||||
clocks = <&gcc GCC_WCSS_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_ACMT_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_M_CLK>;
|
||||
clock-names = "gcc_wcss_ahb_s_clk",
|
||||
"gcc_wcss_acmt_clk",
|
||||
"gcc_wcss_axi_m_clk";
|
||||
|
||||
qcom,halt-regs = <&tcsr_q6_block 0xa000 0xd000 0x0>;
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd2: remoteproc_pd2 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd3: remoteproc_pd3 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 24 0>,
|
||||
<&wcss_smp2p_in 25 0>,
|
||||
<&wcss_smp2p_in 28 0>,
|
||||
<&wcss_smp2p_in 27 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 24>,
|
||||
<&wcss_smp2p_out 25>,
|
||||
<&wcss_smp2p_out 26>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
qcom,rproc = <&q6_wcss_pd1>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x24>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 5G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd2";
|
||||
qcom,rproc = <&q6_wcss_pd2>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x50>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4D600000 0x4D600000 0x4D300000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4E800000 0x4E800000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>;
|
||||
#endif
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&wifi2 {
|
||||
/* QCN6122 6G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
qcom,rproc = <&q6_wcss_pd3>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0xb0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
||||
&usb3 {
|
||||
status = "ok";
|
||||
device-power-gpio = <&tlmm 24 1>;
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
#status = "disabled";
|
||||
#perst-gpio = <&tlmm 18 1>;
|
||||
perst-gpio = <&tlmm 18 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
#status = "disabled";
|
||||
#perst-gpio = <&tlmm 15 1>;
|
||||
perst-gpio = <&tlmm 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,941 +0,0 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "ipq5018.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Indio UM-525AXP";
|
||||
compatible = "indio,um-525axp", "qcom,ipq5018-mp03.5-c1", "qcom,ipq5018";
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
//led-failsafe = &led_red;
|
||||
//led-running = &led_green;
|
||||
//led-upgrade = &led_green;
|
||||
//led-gateway = &led_blue;
|
||||
//led-factory = &led_blue;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
bootargs-append = " swiotlb=1";
|
||||
#else
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
#endif
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
/* 256 MB Profile
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 8MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x40800000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D300000 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E400000 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4F300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F400000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4500000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x1400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D100000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D100000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F400000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | NSS | 0x40000000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Linux | 0x41000000 | Depends on total memory |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | uboot | 0x4A600000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | SBL | 0x4AA00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | smem | 0x4AB00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | TZ | 0x4AC00000 | 4MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | Q6 | | |
|
||||
* | code/ | 0x4B000000 | 20MB |
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 14MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | Caldb | 0x4D400000 | 2MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D600000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E600000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E700000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | Caldb | 0x4E800000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4ED00000 | 16MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4FD00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4FE00000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | Caldb | 0x4FF00000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x5400000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 01400000>;
|
||||
};
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xE00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D400000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D600000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E600000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4ED00000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FD00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FE00000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FF00000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
soc {
|
||||
gpio-watchdog {
|
||||
compatible = "linux,wdt-gpio";
|
||||
gpios = <&tlmm 27 GPIO_ACTIVE_LOW>;
|
||||
hw_algo = "toggle";
|
||||
hw_margin_ms = <5000>;
|
||||
always-running;
|
||||
};
|
||||
|
||||
serial@78af000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
blsp1_uart2: serial@78b0000 {
|
||||
pinctrl-0 = <&blsp1_uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
qpic_bam: dma@7984000{
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand: qpic-nand@79b0000 {
|
||||
pinctrl-0 = <&qspi_nand_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi_0: spi@78b5000 { /* BLSP1 QUP0 */
|
||||
pinctrl-0 = <&blsp0_spi_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
mdio0: mdio@88000 {
|
||||
status = "ok";
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <7>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1: mdio@90000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&mdio1_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 39 0>;
|
||||
|
||||
ethernet-phy@0 {
|
||||
reg = <28>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-instance {
|
||||
num_devices = <0x1>;
|
||||
ess-switch@0x39c00000 {
|
||||
switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/
|
||||
cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
mdiobus = <&mdio0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
port_mac_sel = "QGMAC_PORT";
|
||||
};
|
||||
};
|
||||
led_source@0 {
|
||||
source = <0>;
|
||||
mode = "normal";
|
||||
speed = "all";
|
||||
blink_en = "enable";
|
||||
active = "high";
|
||||
};
|
||||
};
|
||||
ess-switch1@1 {
|
||||
compatible = "qcom,ess-switch-qca83xx";
|
||||
device_id = <1>;
|
||||
switch_access_mode = "mdio";
|
||||
mdio-bus = <&mdio1>;
|
||||
reset_gpio = <0x28>;
|
||||
switch_cpu_bmp = <0x40>; /* cpu port bitmap */
|
||||
switch_lan_bmp = <0x1e>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x0>; /* wan port bitmap */
|
||||
qca,ar8327-initvals = <
|
||||
0x00004 0x7600000 /* PAD0_MODE */
|
||||
0x00008 0x1000000 /* PAD5_MODE */
|
||||
0x0000c 0x80 /* PAD6_MODE */
|
||||
0x00010 0x2613a0 /* PORT6 FORCE MODE*/
|
||||
0x000e4 0xaa545 /* MAC_POWER_SEL */
|
||||
0x000e0 0xc74164de /* SGMII_CTRL */
|
||||
0x0007c 0x4e /* PORT0_STATUS */
|
||||
0x00094 0x4e /* PORT6_STATUS */
|
||||
>;
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <28>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <1>;
|
||||
reg = <0x39C00000 0x10000>;
|
||||
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <7>;
|
||||
mdio-bus = <&mdio0>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
clock-names = "nss-snoc-gmac-axi-clk";
|
||||
qcom,id = <2>;
|
||||
reg = <0x39D00000 0x10000>;
|
||||
interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
|
||||
qcom,mactype = <2>;
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <28>;
|
||||
mdio-bus = <&mdio1>;
|
||||
local-mac-address = [000000000000];
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
qcom,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nss-macsec1 {
|
||||
compatible = "qcom,nss-macsec";
|
||||
phy_addr = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
};
|
||||
|
||||
lpass: lpass@0xA000000{
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm: pcm@0xA3C0000{
|
||||
pinctrl-0 = <&audio_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pcm_lb: pcm_lb@0 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
blsp0_uart_pins: uart_pins {
|
||||
blsp0_uart_rx_tx {
|
||||
pins = "gpio20", "gpio21";
|
||||
function = "blsp0_uart0";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp1_uart_pins: blsp1_uart_pins {
|
||||
blsp1_uart_rx_tx {
|
||||
pins = "gpio22", "gpio24", "gpio23", "gpio25";
|
||||
function = "blsp1_uart2";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
blsp0_spi_pins: blsp0_spi_pins {
|
||||
mux {
|
||||
pins = "gpio10", "gpio11", "gpio12", "gpio13";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
qspi_nand_pins: qspi_nand_pins {
|
||||
qspi_clock {
|
||||
pins = "gpio9";
|
||||
function = "qspi_clk";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_cs {
|
||||
pins = "gpio8";
|
||||
function = "qspi_cs";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_0 {
|
||||
pins = "gpio7";
|
||||
function = "qspi0";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_1 {
|
||||
pins = "gpio6";
|
||||
function = "qspi1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_2 {
|
||||
pins = "gpio5";
|
||||
function = "qspi2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_3 {
|
||||
pins = "gpio4";
|
||||
function = "qspi3";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
mdio1_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio36";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
mux_1 {
|
||||
pins = "gpio37";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
phy_led_pins: phy_led_pins {
|
||||
gephy_led_pin {
|
||||
pins = "gpio46";
|
||||
function = "led0";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins: i2c_pins {
|
||||
i2c_scl {
|
||||
pins = "gpio25";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
i2c_sda {
|
||||
pins = "gpio26";
|
||||
function = "blsp2_i2c1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
reset_button {
|
||||
pins = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
audio_pins: audio_pinmux {
|
||||
};
|
||||
leds_pins: leds_pins {
|
||||
led_5g {
|
||||
pins = "gpio34";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_2g {
|
||||
pins = "gpio33";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_sys {
|
||||
pins = "gpio26";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_onekey {
|
||||
pins = "gpio28";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led_blue: led@34 {
|
||||
label = "led_5g";
|
||||
gpios = <&tlmm 34 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_5g";
|
||||
default-state = "off";
|
||||
};
|
||||
led_green: led@33 {
|
||||
label = "led_2g";
|
||||
gpios = <&tlmm 33 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_2g";
|
||||
default-state = "off";
|
||||
};
|
||||
led_red: led@26 {
|
||||
label = "led_sys";
|
||||
gpios = <&tlmm 26 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_sys";
|
||||
default-state = "off";
|
||||
};
|
||||
led@28 {
|
||||
label = "led_onekey";
|
||||
gpios = <&tlmm 28 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_onekey";
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&q6v5_wcss {
|
||||
compatible = "qcom,ipq5018-q6-mpd";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
reg = <0x0cd00000 0x4040>,
|
||||
<0x1938000 0x8>,
|
||||
<0x193d204 0x4>;
|
||||
reg-names = "qdsp6",
|
||||
"tcsr-msip",
|
||||
"tcsr-q6";
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_Q6_BCR>;
|
||||
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_q6_reset";
|
||||
|
||||
clocks = <&gcc GCC_Q6_AXIS_CLK>,
|
||||
<&gcc GCC_WCSS_ECAHB_CLK>,
|
||||
<&gcc GCC_Q6_AXIM_CLK>,
|
||||
<&gcc GCC_Q6_AXIM2_CLK>,
|
||||
<&gcc GCC_Q6_AHB_CLK>,
|
||||
<&gcc GCC_Q6_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_S_CLK>;
|
||||
clock-names = "gcc_q6_axis_clk",
|
||||
"gcc_wcss_ecahb_clk",
|
||||
"gcc_q6_axim_clk",
|
||||
"gcc_q6_axim2_clk",
|
||||
"gcc_q6_ahb_clk",
|
||||
"gcc_q6_ahb_s_clk",
|
||||
"gcc_wcss_axi_s_clk";
|
||||
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_mem_regions>, <&q6_etr_region>,
|
||||
<&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
qcom,rproc = <&q6v5_wcss>;
|
||||
qcom,bootargs_smem = <507>;
|
||||
boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>,
|
||||
<0x2 0x4 0x2 0x12 0x0 0x0>;
|
||||
status = "ok";
|
||||
q6_wcss_pd1: remoteproc_pd1@4ab000 {
|
||||
compatible = "qcom,ipq5018-wcss-ahb-mpd";
|
||||
reg = <0x4ab000 0x20>;
|
||||
reg-names = "rmb";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "IPQ5018/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 8 0>,
|
||||
<&wcss_smp2p_in 9 0>,
|
||||
<&wcss_smp2p_in 12 0>,
|
||||
<&wcss_smp2p_in 11 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
resets = <&gcc GCC_WCSSAON_RESET>,
|
||||
<&gcc GCC_WCSS_BCR>,
|
||||
<&gcc GCC_CE_BCR>;
|
||||
reset-names = "wcss_aon_reset",
|
||||
"wcss_reset",
|
||||
"ce_reset";
|
||||
|
||||
clocks = <&gcc GCC_WCSS_AHB_S_CLK>,
|
||||
<&gcc GCC_WCSS_ACMT_CLK>,
|
||||
<&gcc GCC_WCSS_AXI_M_CLK>;
|
||||
clock-names = "gcc_wcss_ahb_s_clk",
|
||||
"gcc_wcss_acmt_clk",
|
||||
"gcc_wcss_axi_m_clk";
|
||||
|
||||
qcom,halt-regs = <&tcsr_q6_block 0xa000 0xd000 0x0>;
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 8>,
|
||||
<&wcss_smp2p_out 9>,
|
||||
<&wcss_smp2p_out 10>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>, <&m3_dump>,
|
||||
<&q6_etr_region>, <&q6_caldb_region>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd2: remoteproc_pd2 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
m3_firmware = "qcn6122/m3_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 16 0>,
|
||||
<&wcss_smp2p_in 17 0>,
|
||||
<&wcss_smp2p_in 20 0>,
|
||||
<&wcss_smp2p_in 19 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 16>,
|
||||
<&wcss_smp2p_out 17>,
|
||||
<&wcss_smp2p_out 18>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>,
|
||||
<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
q6_wcss_pd3: remoteproc_pd3 {
|
||||
compatible = "qcom,ipq5018-wcss-pcie-mpd";
|
||||
firmware = "IPQ5018/q6_fw.mdt";
|
||||
interrupts-extended = <&wcss_smp2p_in 24 0>,
|
||||
<&wcss_smp2p_in 25 0>,
|
||||
<&wcss_smp2p_in 28 0>,
|
||||
<&wcss_smp2p_in 27 0>;
|
||||
interrupt-names = "fatal",
|
||||
"ready",
|
||||
"spawn-ack",
|
||||
"stop-ack";
|
||||
|
||||
qcom,smem-states = <&wcss_smp2p_out 24>,
|
||||
<&wcss_smp2p_out 25>,
|
||||
<&wcss_smp2p_out 26>;
|
||||
qcom,smem-state-names = "shutdown",
|
||||
"stop",
|
||||
"spawn";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>,
|
||||
<&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
&i2c_0 {
|
||||
pinctrl-0 = <&i2c_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
/* IPQ5018 */
|
||||
qcom,multipd_arch;
|
||||
qcom,rproc = <&q6_wcss_pd1>;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd1";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x24>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4D400000 0x4D400000 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
/* QCN6122 5G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd2";
|
||||
qcom,rproc = <&q6_wcss_pd2>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x50>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4D600000 0x4D600000 0x4D300000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4E800000 0x4E800000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>;
|
||||
#endif
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&wifi2 {
|
||||
/* QCN6122 6G */
|
||||
qcom,multipd_arch;
|
||||
qcom,userpd-subsys-name = "q6v5_wcss_userpd3";
|
||||
qcom,rproc = <&q6_wcss_pd3>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0xb0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
||||
&usb3 {
|
||||
status = "ok";
|
||||
device-power-gpio = <&tlmm 24 1>;
|
||||
};
|
||||
|
||||
&dwc_0 {
|
||||
/delete-property/ #phy-cells;
|
||||
/delete-property/ phys;
|
||||
/delete-property/ phy-names;
|
||||
};
|
||||
&hs_m31phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&eud {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&pcie_x1 {
|
||||
#status = "disabled";
|
||||
#perst-gpio = <&tlmm 18 1>;
|
||||
perst-gpio = <&tlmm 18 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
#status = "disabled";
|
||||
#perst-gpio = <&tlmm 15 1>;
|
||||
perst-gpio = <&tlmm 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x1_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_0: qcom,mhi@0 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
};
|
||||
};
|
||||
|
||||
&pcie_x2_rp {
|
||||
status = "disabled";
|
||||
|
||||
mhi_1: qcom,mhi@1 {
|
||||
reg = <0 0 0 0 0 >;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -151,14 +151,6 @@
|
||||
no-map;
|
||||
reg = <0x0 0x4F000000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
ramoops: ramoops@4f100000 {
|
||||
compatible = "ramoops";
|
||||
reg = <0x0 0x4f100000 0x0 0x80000>;
|
||||
record-size = <0x20000>;
|
||||
console-size = <0x20000>;
|
||||
pmsg-size = <0x20000>;
|
||||
};
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
@@ -293,13 +285,6 @@
|
||||
reg = <0x0 0x4F800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
ramoops: ramoops@4fd00000 {
|
||||
compatible = "ramoops";
|
||||
reg = <0x0 0x4fd00000 0x0 0x80000>;
|
||||
record-size = <0x20000>;
|
||||
console-size = <0x20000>;
|
||||
pmsg-size = <0x20000>;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -151,14 +151,6 @@
|
||||
no-map;
|
||||
reg = <0x0 0x4F000000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
ramoops: ramoops@4f100000 {
|
||||
compatible = "ramoops";
|
||||
reg = <0x0 0x4f100000 0x0 0x80000>;
|
||||
record-size = <0x20000>;
|
||||
console-size = <0x20000>;
|
||||
pmsg-size = <0x20000>;
|
||||
};
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
@@ -293,13 +285,6 @@
|
||||
reg = <0x0 0x4F800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
ramoops: ramoops@4fd00000 {
|
||||
compatible = "ramoops";
|
||||
reg = <0x0 0x4fd00000 0x0 0x80000>;
|
||||
record-size = <0x20000>;
|
||||
console-size = <0x20000>;
|
||||
pmsg-size = <0x20000>;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -408,8 +393,8 @@
|
||||
mdio-bus = <&mdio1>;
|
||||
reset_gpio = <&tlmm 0x26 0>;
|
||||
switch_cpu_bmp = <0x40>; /* cpu port bitmap (Port 6 GMAC) */
|
||||
switch_lan_bmp = <0x1c>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x20>; /* wan port bitmap */
|
||||
switch_lan_bmp = <0x3c>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x0>; /* wan port bitmap */
|
||||
qca,ar8327-initvals = <
|
||||
0x00004 0x7600000 /* PAD0_MODE */
|
||||
0x00008 0x1000000 /* PAD5_MODE */
|
||||
|
||||
@@ -154,14 +154,6 @@
|
||||
no-map;
|
||||
reg = <0x0 0x4F000000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
ramoops: ramoops@4f100000 {
|
||||
compatible = "ramoops";
|
||||
reg = <0x0 0x4f100000 0x0 0x80000>;
|
||||
record-size = <0x20000>;
|
||||
console-size = <0x20000>;
|
||||
pmsg-size = <0x20000>;
|
||||
};
|
||||
#else
|
||||
/* 512MB/1GB Profiles
|
||||
* +==========+==============+=========================+
|
||||
@@ -296,13 +288,6 @@
|
||||
reg = <0x0 0x4F800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
ramoops: ramoops@4fd00000 {
|
||||
compatible = "ramoops";
|
||||
reg = <0x0 0x4fd00000 0x0 0x80000>;
|
||||
record-size = <0x20000>;
|
||||
console-size = <0x20000>;
|
||||
pmsg-size = <0x20000>;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -93,42 +93,6 @@ define Device/edgecore_eap104
|
||||
endef
|
||||
TARGET_DEVICES += edgecore_eap104
|
||||
|
||||
define Device/indio_um-325ax-v2
|
||||
DEVICE_TITLE := Indio UM-325ax-V2
|
||||
DEVICE_DTS := qcom-ipq5018-indio-um-325ax-v2
|
||||
SUPPORTED_DEVICES := indio,um-325ax-v2
|
||||
DEVICE_PACKAGES := ath11k-wifi-indio-um-325ax-v2 ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122
|
||||
DEVICE_DTS_CONFIG := config@mp03.5-c1
|
||||
endef
|
||||
TARGET_DEVICES += indio_um-325ax-v2
|
||||
|
||||
define Device/indio_um-335ax
|
||||
DEVICE_TITLE := Indio UM-335ax
|
||||
DEVICE_DTS := qcom-ipq5018-indio-um-335ax
|
||||
SUPPORTED_DEVICES := indio,um-335ax
|
||||
DEVICE_PACKAGES := ath11k-wifi-indio-um-335ax ath11k-firmware-qcn9000 ath11k-firmware-ipq50xx-spruce
|
||||
DEVICE_DTS_CONFIG := config@mp03.1
|
||||
endef
|
||||
TARGET_DEVICES += indio_um-335ax
|
||||
|
||||
define Device/indio_um-525axp
|
||||
DEVICE_TITLE := Indio UM-525axp
|
||||
DEVICE_DTS := qcom-ipq5018-indio-um-525axp
|
||||
SUPPORTED_DEVICES := indio,um-525axp
|
||||
DEVICE_PACKAGES := ath11k-wifi-indio-um-525axp ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122
|
||||
DEVICE_DTS_CONFIG := config@mp03.5-c1
|
||||
endef
|
||||
TARGET_DEVICES += indio_um-525axp
|
||||
|
||||
define Device/indio_um-525axm
|
||||
DEVICE_TITLE := Indio UM-525axm
|
||||
DEVICE_DTS := qcom-ipq5018-indio-um-525axm
|
||||
SUPPORTED_DEVICES := indio,um-525axm
|
||||
DEVICE_PACKAGES := ath11k-wifi-indio-um-525axm ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122
|
||||
DEVICE_DTS_CONFIG := config@mp03.5-c1
|
||||
endef
|
||||
TARGET_DEVICES += indio_um-525axm
|
||||
|
||||
define Device/udaya_a6_id2
|
||||
DEVICE_TITLE := Udaya A6 - ID2
|
||||
DEVICE_DTS := qcom-ipq5018-udaya-a6-id2
|
||||
|
||||
@@ -242,17 +242,3 @@ define KernelPackage/bootconfig/description
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,bootconfig))
|
||||
|
||||
define KernelPackage/mdio-qca
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Model for MDIO to QCA PHY connection
|
||||
KCONFIG:=CONFIG_MDIO_QCA
|
||||
FILES:=$(LINUX_DIR)/drivers/net/phy/mdio-qca.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,mdio-qca)
|
||||
endef
|
||||
|
||||
define KernelPackage/mdio-qca/description
|
||||
This driver supports the MDIO interface found in Qualcomm Atheros ipq Soc chip.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,mdio-qca))
|
||||
|
||||
@@ -20,7 +20,6 @@ qcom_setup_interfaces()
|
||||
ucidef_set_interface_wan "eth0 eth1"
|
||||
ucidef_set_interface_lan ""
|
||||
;;
|
||||
indio,um-310ax-v1|\
|
||||
yuncore,ax840)
|
||||
ucidef_set_interface_lan "eth0"
|
||||
ucidef_set_interface_wan "eth1"
|
||||
@@ -80,7 +79,6 @@ qcom_setup_macs()
|
||||
emplus,wap386v2)
|
||||
wan_mac=$(cat /sys/class/net/eth0/address)
|
||||
;;
|
||||
indio,um-310ax-v1|\
|
||||
yuncore,ax840)
|
||||
wan_mac=$(cat /sys/class/net/eth1/address)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
|
||||
@@ -82,7 +82,6 @@ case "$FIRMWARE" in
|
||||
hfcl,ion4x_2|\
|
||||
hfcl,ion4x_3|\
|
||||
hfcl,ion4xe|\
|
||||
indio,um-310ax-v1|\
|
||||
wallys,dr6018|\
|
||||
wallys,dr6018-v4|\
|
||||
yuncore,ax840|\
|
||||
|
||||
@@ -119,7 +119,6 @@ platform_check_image() {
|
||||
cig,wf196|\
|
||||
glinet,ax1800|\
|
||||
glinet,axt1800|\
|
||||
indio,um-310ax-v1|\
|
||||
wallys,dr6018|\
|
||||
wallys,dr6018-v4|\
|
||||
edgecore,eap101|\
|
||||
@@ -157,7 +156,6 @@ platform_do_upgrade() {
|
||||
;;
|
||||
glinet,ax1800|\
|
||||
glinet,axt1800|\
|
||||
indio,um-310ax-v1|\
|
||||
wallys,dr6018|\
|
||||
wallys,dr6018-v4|\
|
||||
yuncore,ax840|\
|
||||
|
||||
@@ -1,321 +0,0 @@
|
||||
/dts-v1/;
|
||||
/*
|
||||
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "ipq6018.dtsi"
|
||||
#include "ipq6018-cpr-regulator.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Indio UM-310AX V1";
|
||||
compatible = "indio,um-310ax-v1", "qcom,ipq6018-cp03", "qcom,ipq6018";
|
||||
interrupt-parent = <&intc>;
|
||||
qcom,msm-id = <0x1A5 0x0>;
|
||||
|
||||
aliases {
|
||||
/*
|
||||
* Aliases as required by u-boot
|
||||
* to patch MAC addresses
|
||||
*/
|
||||
ethernet0 = "/soc/dp2";
|
||||
ethernet1 = "/soc/dp1";
|
||||
led-boot = &led_system;
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
led-upgrade = &led_system;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyMSM0,115200,n8 rw init=/init";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
bootargs-append = " swiotlb=1";
|
||||
#else
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* +=========+==============+========================+
|
||||
* | | | |
|
||||
* | Region | Start Offset | Size |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | Linux | 0x41000000 | 139MB |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +--------+--------------+-------------------------+
|
||||
* | TZ App | 0x49B00000 | 6MB |
|
||||
* +--------+--------------+-------------------------+
|
||||
*
|
||||
* From the available 145 MB for Linux in the first 256 MB,
|
||||
* we are reserving 6 MB for TZAPP.
|
||||
*
|
||||
* Refer arch/arm64/boot/dts/qcom/qcom-ipq6018-memory.dtsi
|
||||
* for memory layout.
|
||||
*/
|
||||
|
||||
/* TZAPP is enabled only in default memory profile */
|
||||
#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__)
|
||||
reserved-memory {
|
||||
tzapp:tzapp@49B00000 { /* TZAPPS */
|
||||
no-map;
|
||||
reg = <0x0 0x49B00000 0x0 0x00600000>;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
uart_pins: uart_pins {
|
||||
mux {
|
||||
pins = "gpio44", "gpio45";
|
||||
function = "blsp2_uart";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
spi_0_pins: spi_0_pins {
|
||||
mux {
|
||||
pins = "gpio38", "gpio39", "gpio40", "gpio41";
|
||||
function = "blsp0_spi";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
wps_button {
|
||||
pins = "gpio9";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
mdio_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio64";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
mux_1 {
|
||||
pins = "gpio65";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
mux_2 {
|
||||
pins = "gpio75";
|
||||
function = "gpio";
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
leds_pins: leds_pins {
|
||||
led_blue {
|
||||
pins = "gpio35";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
led_green {
|
||||
pins = "gpio37";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
led_red {
|
||||
pins = "gpio32";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
rst_button {
|
||||
pins = "gpio19";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
mdio@90000 {
|
||||
pinctrl-0 = <&mdio_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 75 0>;
|
||||
status = "ok";
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <3>;
|
||||
};
|
||||
phy1: ethernet-phy@1 {
|
||||
reg = <4>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-switch@3a000000 {
|
||||
switch_cpu_bmp = <0x01>; /* cpu port bitmap */
|
||||
switch_lan_bmp = <0x10>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x20>; /* wan port bitmap */
|
||||
switch_inner_bmp = <0x80>; /*inner port bitmap*/
|
||||
switch_mac_mode = <0x00>; /* mac mode for uniphy instance0*/
|
||||
switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/
|
||||
switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/
|
||||
|
||||
qcom,port_phyinfo {
|
||||
port@3 {
|
||||
port_id = <0x04>;
|
||||
phy_address = <0x03>;
|
||||
};
|
||||
|
||||
port@4 {
|
||||
port_id = <0x05>;
|
||||
phy_address = <0x04>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dp1 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
qcom,id = <0x04>;
|
||||
reg = <0x3a001600 0x200>;
|
||||
qcom,mactype = <0x00>;
|
||||
local-mac-address = [00 00 00 00 00 00];
|
||||
qcom,link-poll = <0x01>;
|
||||
qcom,phy-mdio-addr = <0x03>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
qcom,id = <0x05>;
|
||||
reg = <0x3a001800 0x200>;
|
||||
qcom,mactype = <0x00>;
|
||||
local-mac-address = [00 00 00 00 00 00];
|
||||
qcom,link-poll = <0x01>;
|
||||
qcom,phy-mdio-addr = <0x04>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led_system: system {
|
||||
label = "ax860:green:system";
|
||||
gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
wlan2g {
|
||||
label = "ax860:blue:wlan2g";
|
||||
gpio = <&tlmm 35 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
wlan5g {
|
||||
label = "ax860:red:wlan5g";
|
||||
gpio = <&tlmm 32 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&blsp1_uart3 {
|
||||
pinctrl-0 = <&uart_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&spi_0 {
|
||||
pinctrl-0 = <&spi_0_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
status = "ok";
|
||||
|
||||
m25p80@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
compatible = "n25q128a11";
|
||||
linux,modalias = "m25p80", "n25q128a11";
|
||||
spi-max-frequency = <50000000>;
|
||||
use-default-sizes;
|
||||
};
|
||||
};
|
||||
|
||||
&qpic_bam {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qpic_nand {
|
||||
status = "ok";
|
||||
|
||||
nand@0 {
|
||||
reg = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
nand-ecc-strength = <4>;
|
||||
nand-ecc-step-size = <512>;
|
||||
nand-bus-width = <8>;
|
||||
};
|
||||
};
|
||||
|
||||
&ssphy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&qusb_phy_0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&usb3 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
&nss_crypto {
|
||||
status = "ok";
|
||||
};
|
||||
@@ -92,7 +92,7 @@ define Device/indio_um-310ax-v1
|
||||
SUPPORTED_DEVICES := indio,um-310ax-v1
|
||||
DEVICE_PACKAGES := ath11k-wifi-indio-um-310ax-v1 uboot-env
|
||||
endef
|
||||
TARGET_DEVICES += indio_um-310ax-v1
|
||||
#TARGET_DEVICES += indio_um-310ax-v1
|
||||
|
||||
define Device/indio_um-510axp-v1
|
||||
DEVICE_TITLE := Indio UM-510AXP V1
|
||||
|
||||
@@ -14,8 +14,7 @@ cig,wf194c4)
|
||||
;;
|
||||
edgecore,eap102|\
|
||||
edgecore,oap102|\
|
||||
edgecore,oap103|\
|
||||
indio,um-345ax)
|
||||
edgecore,oap103)
|
||||
ucidef_set_led_netdev "poe" "poe" "green:wan" "eth0"
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tpt"
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tpt"
|
||||
|
||||
@@ -18,8 +18,7 @@ qcom_setup_interfaces()
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_set_interface_lan ""
|
||||
;;
|
||||
cig,wf194c4|\
|
||||
indio,um-345ax)
|
||||
cig,wf194c4)
|
||||
ucidef_set_interface_lan "eth0"
|
||||
ucidef_set_interface_wan "eth1"
|
||||
;;
|
||||
|
||||
@@ -73,7 +73,6 @@ case "$FIRMWARE" in
|
||||
edgecore,oap103 |\
|
||||
edgecore,eap106 |\
|
||||
emplus,wap380c|\
|
||||
indio,um-345ax|\
|
||||
qcom,ipq807x-hk01|\
|
||||
qcom,ipq807x-hk14|\
|
||||
tplink,ex227|\
|
||||
@@ -108,8 +107,7 @@ ath11k-macs)
|
||||
edgecore,eap102|\
|
||||
edgecore,oap102|\
|
||||
edgecore,oap103|\
|
||||
edgecore,eap106|\
|
||||
indio,um-345ax)
|
||||
edgecore,eap106)
|
||||
ath11k_generate_macs
|
||||
;;
|
||||
cig,wf196)
|
||||
|
||||
@@ -30,7 +30,6 @@ platform_check_image() {
|
||||
edgecore,oap103|\
|
||||
edgecore,eap106|\
|
||||
emplus,wap380c|\
|
||||
indio,um-345ax|\
|
||||
sonicfi,rap650c|\
|
||||
tplink,ex227|\
|
||||
tplink,ex447)
|
||||
@@ -62,8 +61,7 @@ platform_do_upgrade() {
|
||||
tplink,ex447)
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
edgecore,eap106|\
|
||||
indio,um-345ax)
|
||||
edgecore,eap106)
|
||||
CI_UBIPART="rootfs1"
|
||||
[ "$(find_mtd_chardev rootfs)" ] && CI_UBIPART="rootfs"
|
||||
nand_upgrade_tar "$1"
|
||||
|
||||
@@ -1,713 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2025, Shubham Vishwakarma <shubhamvis98@fossfrog.in>
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "ipq8074.dtsi"
|
||||
#include "ipq8074-ac-cpu.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Indio UM-345AX";
|
||||
compatible = "indio,um-345ax", "qcom,ipq807x-hk09", "qcom,ipq807x";
|
||||
qcom,msm-id = <0x178 0x0>;
|
||||
interrupt-parent = <&intc>;
|
||||
|
||||
aliases {
|
||||
serial0 = &blsp1_uart5;
|
||||
/* Aliases as required by u-boot to patch MAC addresses */
|
||||
ethernet1 = "/soc/dp5";
|
||||
ethernet0 = "/soc/dp6";
|
||||
|
||||
led-boot = &led_red;
|
||||
led-failsafe = &led_red;
|
||||
led-running = &led_green;
|
||||
led-upgrade = &led_green;
|
||||
led-gateway = &led_blue;
|
||||
led-factory = &led_blue;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0";
|
||||
};
|
||||
|
||||
soc {
|
||||
pinctrl@1000000 {
|
||||
pinctrl-0 = <&mcu_rst &mcu_rsv &usb_rear_pwr &usb_side_pwr &usb_hub_rst>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
mcu_rst: mcu_rst_pins {
|
||||
pins = "gpio54";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
output-low;
|
||||
};
|
||||
|
||||
mcu_rsv: mcu_rsv_pins {
|
||||
pins = "gpio56";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
usb_rear_pwr: usb_rear_pwr_pins {
|
||||
pins = "gpio29";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
output-high;
|
||||
};
|
||||
|
||||
usb_side_pwr: usb_side_pwr_pins {
|
||||
pins = "gpio30";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
output-high;
|
||||
};
|
||||
|
||||
usb_hub_rst: usb_hub_rst_pins {
|
||||
pins = "gpio55";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
output-high;
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
reset_button {
|
||||
pins = "gpio57";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
mdio_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
pins = "gpio68";
|
||||
function = "mdc";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
mux_1 {
|
||||
pins = "gpio69";
|
||||
function = "mdio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
mux_2 {
|
||||
pins = "gpio25";
|
||||
function = "gpio";
|
||||
bias-pull-up;
|
||||
};
|
||||
mux_3 {
|
||||
pins = "gpio44";
|
||||
function = "gpio";
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
led_pins: led_pins {
|
||||
led_red {
|
||||
pins = "gpio0";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
led_2g {
|
||||
pins = "gpio2";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
|
||||
led_5g {
|
||||
pins = "gpio9";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
serial@78b3000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
spi@78b5000 {
|
||||
status = "ok";
|
||||
pinctrl-0 = <&spi_0_pins>;
|
||||
pinctrl-names = "default";
|
||||
cs-select = <0>;
|
||||
|
||||
m25p80@0 {
|
||||
compatible = "n25q128a11";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
spi-max-frequency = <50000000>;
|
||||
};
|
||||
};
|
||||
|
||||
dma@7984000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nand@79b0000 {
|
||||
status = "ok";
|
||||
|
||||
nand@0 {
|
||||
reg = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
nand-ecc-strength = <4>;
|
||||
nand-ecc-step-size = <512>;
|
||||
nand-bus-width = <8>;
|
||||
};
|
||||
};
|
||||
|
||||
qusb@79000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
ssphy@78000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
usb3@8A00000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
usb3@8C00000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
qusb@59000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
ssphy@58000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
usb3@8C00000 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
status = "ok";
|
||||
|
||||
button@1 {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 57 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
mdio: mdio@90000 {
|
||||
pinctrl-0 = <&mdio_pins>;
|
||||
pinctrl-names = "default";
|
||||
phy-reset-gpio = <&tlmm 37 0 &tlmm 25 1 &tlmm 44 1>;
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
};
|
||||
phy1: ethernet-phy@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
phy2: ethernet-phy@2 {
|
||||
reg = <2>;
|
||||
};
|
||||
phy3: ethernet-phy@3 {
|
||||
reg = <3>;
|
||||
};
|
||||
phy4: ethernet-phy@4 {
|
||||
reg = <24>;
|
||||
};
|
||||
phy5: ethernet-phy@5 {
|
||||
reg = <28>;
|
||||
};
|
||||
};
|
||||
|
||||
ess-switch@3a000000 {
|
||||
switch_cpu_bmp = <0x1>; /* cpu port bitmap */
|
||||
switch_lan_bmp = <0x3e>; /* lan port bitmap */
|
||||
switch_wan_bmp = <0x40>; /* wan port bitmap */
|
||||
switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
|
||||
switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/
|
||||
switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/
|
||||
bm_tick_mode = <0>; /* bm tick mode */
|
||||
tm_tick_mode = <0>; /* tm tick mode */
|
||||
qcom,port_phyinfo {
|
||||
port@0 {
|
||||
port_id = <1>;
|
||||
phy_address = <0>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <2>;
|
||||
phy_address = <1>;
|
||||
};
|
||||
port@2 {
|
||||
port_id = <3>;
|
||||
phy_address = <2>;
|
||||
};
|
||||
port@3 {
|
||||
port_id = <4>;
|
||||
phy_address = <3>;
|
||||
};
|
||||
port@4 {
|
||||
port_id = <5>;
|
||||
phy_address = <24>;
|
||||
port_mac_sel = "QGMAC_PORT";
|
||||
};
|
||||
port@5 {
|
||||
port_id = <6>;
|
||||
phy_address = <28>;
|
||||
port_mac_sel = "QGMAC_PORT";
|
||||
};
|
||||
};
|
||||
port_scheduler_resource {
|
||||
port@0 {
|
||||
port_id = <0>;
|
||||
ucast_queue = <0 143>;
|
||||
mcast_queue = <256 271>;
|
||||
l0sp = <0 35>;
|
||||
l0cdrr = <0 47>;
|
||||
l0edrr = <0 47>;
|
||||
l1cdrr = <0 7>;
|
||||
l1edrr = <0 7>;
|
||||
};
|
||||
port@1 {
|
||||
port_id = <1>;
|
||||
ucast_queue = <144 159>;
|
||||
mcast_queue = <272 275>;
|
||||
l0sp = <36 39>;
|
||||
l0cdrr = <48 63>;
|
||||
l0edrr = <48 63>;
|
||||
l1cdrr = <8 11>;
|
||||
l1edrr = <8 11>;
|
||||
};
|
||||
port@2 {
|
||||
port_id = <2>;
|
||||
ucast_queue = <160 175>;
|
||||
mcast_queue = <276 279>;
|
||||
l0sp = <40 43>;
|
||||
l0cdrr = <64 79>;
|
||||
l0edrr = <64 79>;
|
||||
l1cdrr = <12 15>;
|
||||
l1edrr = <12 15>;
|
||||
};
|
||||
port@3 {
|
||||
port_id = <3>;
|
||||
ucast_queue = <176 191>;
|
||||
mcast_queue = <280 283>;
|
||||
l0sp = <44 47>;
|
||||
l0cdrr = <80 95>;
|
||||
l0edrr = <80 95>;
|
||||
l1cdrr = <16 19>;
|
||||
l1edrr = <16 19>;
|
||||
};
|
||||
port@4 {
|
||||
port_id = <4>;
|
||||
ucast_queue = <192 207>;
|
||||
mcast_queue = <284 287>;
|
||||
l0sp = <48 51>;
|
||||
l0cdrr = <96 111>;
|
||||
l0edrr = <96 111>;
|
||||
l1cdrr = <20 23>;
|
||||
l1edrr = <20 23>;
|
||||
};
|
||||
port@5 {
|
||||
port_id = <5>;
|
||||
ucast_queue = <208 223>;
|
||||
mcast_queue = <288 291>;
|
||||
l0sp = <52 55>;
|
||||
l0cdrr = <112 127>;
|
||||
l0edrr = <112 127>;
|
||||
l1cdrr = <24 27>;
|
||||
l1edrr = <24 27>;
|
||||
};
|
||||
port@6 {
|
||||
port_id = <6>;
|
||||
ucast_queue = <224 239>;
|
||||
mcast_queue = <292 295>;
|
||||
l0sp = <56 59>;
|
||||
l0cdrr = <128 143>;
|
||||
l0edrr = <128 143>;
|
||||
l1cdrr = <28 31>;
|
||||
l1edrr = <28 31>;
|
||||
};
|
||||
port@7 {
|
||||
port_id = <7>;
|
||||
ucast_queue = <240 255>;
|
||||
mcast_queue = <296 299>;
|
||||
l0sp = <60 63>;
|
||||
l0cdrr = <144 159>;
|
||||
l0edrr = <144 159>;
|
||||
l1cdrr = <32 35>;
|
||||
l1edrr = <32 35>;
|
||||
};
|
||||
};
|
||||
port_scheduler_config {
|
||||
port@0 {
|
||||
port_id = <0>;
|
||||
l1scheduler {
|
||||
group@0 {
|
||||
sp = <0 1>; /*L0 SPs*/
|
||||
/*cpri cdrr epri edrr*/
|
||||
cfg = <0 0 0 0>;
|
||||
};
|
||||
};
|
||||
l0scheduler {
|
||||
group@0 {
|
||||
/*unicast queues*/
|
||||
ucast_queue = <0 4 8>;
|
||||
/*multicast queues*/
|
||||
mcast_queue = <256 260>;
|
||||
/*sp cpri cdrr epri edrr*/
|
||||
cfg = <0 0 0 0 0>;
|
||||
};
|
||||
group@1 {
|
||||
ucast_queue = <1 5 9>;
|
||||
mcast_queue = <257 261>;
|
||||
cfg = <0 1 1 1 1>;
|
||||
};
|
||||
group@2 {
|
||||
ucast_queue = <2 6 10>;
|
||||
mcast_queue = <258 262>;
|
||||
cfg = <0 2 2 2 2>;
|
||||
};
|
||||
group@3 {
|
||||
ucast_queue = <3 7 11>;
|
||||
mcast_queue = <259 263>;
|
||||
cfg = <0 3 3 3 3>;
|
||||
};
|
||||
};
|
||||
};
|
||||
port@1 {
|
||||
port_id = <1>;
|
||||
l1scheduler {
|
||||
group@0 {
|
||||
sp = <36>;
|
||||
cfg = <0 8 0 8>;
|
||||
};
|
||||
group@1 {
|
||||
sp = <37>;
|
||||
cfg = <1 9 1 9>;
|
||||
};
|
||||
};
|
||||
l0scheduler {
|
||||
group@0 {
|
||||
ucast_queue = <144>;
|
||||
ucast_loop_pri = <16>;
|
||||
mcast_queue = <272>;
|
||||
mcast_loop_pri = <4>;
|
||||
cfg = <36 0 48 0 48>;
|
||||
};
|
||||
};
|
||||
};
|
||||
port@2 {
|
||||
port_id = <2>;
|
||||
l1scheduler {
|
||||
group@0 {
|
||||
sp = <40>;
|
||||
cfg = <0 12 0 12>;
|
||||
};
|
||||
group@1 {
|
||||
sp = <41>;
|
||||
cfg = <1 13 1 13>;
|
||||
};
|
||||
};
|
||||
l0scheduler {
|
||||
group@0 {
|
||||
ucast_queue = <160>;
|
||||
ucast_loop_pri = <16>;
|
||||
mcast_queue = <276>;
|
||||
mcast_loop_pri = <4>;
|
||||
cfg = <40 0 64 0 64>;
|
||||
};
|
||||
};
|
||||
};
|
||||
port@3 {
|
||||
port_id = <3>;
|
||||
l1scheduler {
|
||||
group@0 {
|
||||
sp = <44>;
|
||||
cfg = <0 16 0 16>;
|
||||
};
|
||||
group@1 {
|
||||
sp = <45>;
|
||||
cfg = <1 17 1 17>;
|
||||
};
|
||||
};
|
||||
l0scheduler {
|
||||
group@0 {
|
||||
ucast_queue = <176>;
|
||||
ucast_loop_pri = <16>;
|
||||
mcast_queue = <280>;
|
||||
mcast_loop_pri = <4>;
|
||||
cfg = <44 0 80 0 80>;
|
||||
};
|
||||
};
|
||||
};
|
||||
port@4 {
|
||||
port_id = <4>;
|
||||
l1scheduler {
|
||||
group@0 {
|
||||
sp = <48>;
|
||||
cfg = <0 20 0 20>;
|
||||
};
|
||||
group@1 {
|
||||
sp = <49>;
|
||||
cfg = <1 21 1 21>;
|
||||
};
|
||||
};
|
||||
l0scheduler {
|
||||
group@0 {
|
||||
ucast_queue = <192>;
|
||||
ucast_loop_pri = <16>;
|
||||
mcast_queue = <284>;
|
||||
mcast_loop_pri = <4>;
|
||||
cfg = <48 0 96 0 96>;
|
||||
};
|
||||
};
|
||||
};
|
||||
port@5 {
|
||||
port_id = <5>;
|
||||
l1scheduler {
|
||||
group@0 {
|
||||
sp = <52>;
|
||||
cfg = <0 24 0 24>;
|
||||
};
|
||||
group@1 {
|
||||
sp = <53>;
|
||||
cfg = <1 25 1 25>;
|
||||
};
|
||||
};
|
||||
l0scheduler {
|
||||
group@0 {
|
||||
ucast_queue = <208>;
|
||||
ucast_loop_pri = <16>;
|
||||
mcast_queue = <288>;
|
||||
mcast_loop_pri = <4>;
|
||||
cfg = <52 0 112 0 112>;
|
||||
};
|
||||
};
|
||||
};
|
||||
port@6 {
|
||||
port_id = <6>;
|
||||
l1scheduler {
|
||||
group@0 {
|
||||
sp = <56>;
|
||||
cfg = <0 28 0 28>;
|
||||
};
|
||||
group@1 {
|
||||
sp = <57>;
|
||||
cfg = <1 29 1 29>;
|
||||
};
|
||||
};
|
||||
l0scheduler {
|
||||
group@0 {
|
||||
ucast_queue = <224>;
|
||||
ucast_loop_pri = <16>;
|
||||
mcast_queue = <292>;
|
||||
mcast_loop_pri = <4>;
|
||||
cfg = <56 0 128 0 128>;
|
||||
};
|
||||
};
|
||||
};
|
||||
port@7 {
|
||||
port_id = <7>;
|
||||
l1scheduler {
|
||||
group@0 {
|
||||
sp = <60>;
|
||||
cfg = <0 32 0 32>;
|
||||
};
|
||||
group@1 {
|
||||
sp = <61>;
|
||||
cfg = <1 33 1 33>;
|
||||
};
|
||||
};
|
||||
l0scheduler {
|
||||
group@0 {
|
||||
ucast_queue = <240>;
|
||||
ucast_loop_pri = <16>;
|
||||
mcast_queue = <296>;
|
||||
cfg = <60 0 144 0 144>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dp6 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
qcom,id = <6>;
|
||||
reg = <0x3a001800 0x200>;
|
||||
qcom,mactype = <0>;
|
||||
local-mac-address = [000000000000];
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <28>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
dp5 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
qcom,id = <5>;
|
||||
reg = <0x3a001a00 0x200>;
|
||||
qcom,mactype = <0>;
|
||||
local-mac-address = [000000000000];
|
||||
qcom,link-poll = <1>;
|
||||
qcom,phy-mdio-addr = <24>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led_red: led_sys {
|
||||
label = "led_sys";
|
||||
gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "off";
|
||||
linux,default-trigger = "led_pwr";
|
||||
};
|
||||
|
||||
led_green: led_2g {
|
||||
label = "led_2g";
|
||||
gpio = <&tlmm 2 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "off";
|
||||
};
|
||||
|
||||
led_blue: led_5g {
|
||||
label = "led_5g";
|
||||
gpio = <&tlmm 9 GPIO_ACTIVE_HIGH>;
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
nss-macsec0 {
|
||||
compatible = "qcom,nss-macsec";
|
||||
phy_addr = <0x18>;
|
||||
mdiobus = <&mdio>;
|
||||
};
|
||||
nss-macsec1 {
|
||||
compatible = "qcom,nss-macsec";
|
||||
phy_addr = <0x1c>;
|
||||
mdiobus = <&mdio>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&apc_cpr {
|
||||
/* Same CPR configuration as OAK */
|
||||
compatible = "qcom,cpr4-ipq817x-apss-regulator";
|
||||
|
||||
thread@0 {
|
||||
apc_vreg: regulator {
|
||||
regulator-min-microvolt = <1>;
|
||||
regulator-max-microvolt = <2>;
|
||||
qcom,cpr-fuse-corners = <2>;
|
||||
qcom,cpr-corners = <3>;
|
||||
qcom,cpr-speed-bin-corners = <3>;
|
||||
qcom,cpr-corner-fmax-map = <1 3>;
|
||||
|
||||
qcom,cpr-voltage-ceiling =
|
||||
<840000 904000 944000>;
|
||||
qcom,cpr-voltage-floor =
|
||||
<592000 648000 712000>;
|
||||
qcom,corner-frequencies =
|
||||
<1017600000 1382400000 1382400000>;
|
||||
|
||||
qcom,cpr-open-loop-voltage-fuse-adjustment-0 =
|
||||
/* Speed bin 0; CPR rev 0..7 */
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>;
|
||||
|
||||
qcom,cpr-open-loop-voltage-fuse-adjustment-1 =
|
||||
/* Speed bin 0; CPR rev 0..7 */
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 20000 26000>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>;
|
||||
|
||||
qcom,cpr-open-loop-voltage-fuse-adjustment-v2-0 =
|
||||
/* Speed bin 0; CPR rev 0..7 */
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>;
|
||||
|
||||
qcom,cpr-open-loop-voltage-fuse-adjustment-v2-1 =
|
||||
/* Speed bin 0; CPR rev 0..7 */
|
||||
< 0 0>,
|
||||
< 0 7000>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>,
|
||||
< 0 0>;
|
||||
|
||||
qcom,cpr-floor-to-ceiling-max-range =
|
||||
< 40000 40000 40000>,
|
||||
< 40000 40000 40000>,
|
||||
< 40000 40000 40000>,
|
||||
< 40000 40000 40000>,
|
||||
< 40000 40000 40000>,
|
||||
< 40000 40000 40000>,
|
||||
< 40000 40000 40000>,
|
||||
< 40000 40000 40000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&npu_cpr {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&nss0 {
|
||||
qcom,low-frequency = <187200000>;
|
||||
qcom,mid-frequency = <748800000>;
|
||||
qcom,max-frequency = <1497600000>;
|
||||
};
|
||||
|
||||
&nss0 {
|
||||
npu-supply = <&dummy_reg>;
|
||||
mx-supply = <&dummy_reg>;
|
||||
};
|
||||
|
||||
&wifi0 {
|
||||
qcom,board_id = <0x92>;
|
||||
};
|
||||
|
||||
&wifi1 {
|
||||
qcom,board_id = <0x292>;
|
||||
};
|
||||
@@ -66,15 +66,6 @@ define Device/emplus_wap380c
|
||||
endef
|
||||
TARGET_DEVICES += emplus_wap380c
|
||||
|
||||
define Device/indio_um-345ax
|
||||
DEVICE_TITLE := Indio UM-345AX
|
||||
DEVICE_DTS := qcom-ipq807x-indio-um-345ax
|
||||
DEVICE_DTS_CONFIG=config@hk09
|
||||
SUPPORTED_DEVICES := indio,um-345ax
|
||||
DEVICE_PACKAGES := ath11k-wifi-indio-um-345ax uboot-envtools
|
||||
endef
|
||||
TARGET_DEVICES += indio_um-345ax
|
||||
|
||||
define Device/sonicfi_rap650c
|
||||
DEVICE_TITLE := SonicFi RAP650C
|
||||
DEVICE_DTS := qcom-ipq807x-rap650c
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
--- a/include/init/ssdk_plat.h
|
||||
+++ b/include/init/ssdk_plat.h
|
||||
@@ -330,6 +330,7 @@ struct qca_phy_priv {
|
||||
struct mii_bus *miibus;
|
||||
/*qca808x_end*/
|
||||
u64 *mib_counters;
|
||||
+ a_uint32_t mib_loop_cnt;
|
||||
/* dump buf */
|
||||
a_uint8_t buf[2048];
|
||||
a_uint32_t link_polling_required;
|
||||
--- a/src/ref/ref_mib.c
|
||||
+++ b/src/ref/ref_mib.c
|
||||
@@ -479,39 +479,37 @@ qca_ar8327_sw_get_port_mib(struct switch
|
||||
#endif
|
||||
|
||||
int
|
||||
-_qca_ar8327_sw_capture_port_tx_counter(struct qca_phy_priv *priv, int port)
|
||||
+_qca_ar8327_sw_capture_port_tx_counter(a_uint32_t dev_id, int port)
|
||||
{
|
||||
fal_mib_info_t mib_Info;
|
||||
|
||||
memset(&mib_Info, 0, sizeof(fal_mib_info_t));
|
||||
- fal_get_tx_mib_info(priv->device_id, port, &mib_Info);
|
||||
+ fal_get_tx_mib_info(dev_id, port, &mib_Info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
-_qca_ar8327_sw_capture_port_rx_counter(struct qca_phy_priv *priv, int port)
|
||||
+_qca_ar8327_sw_capture_port_rx_counter(a_uint32_t dev_id, int port)
|
||||
{
|
||||
fal_mib_info_t mib_Info;
|
||||
|
||||
memset(&mib_Info, 0, sizeof(fal_mib_info_t));
|
||||
- fal_get_rx_mib_info(priv->device_id, port, &mib_Info);
|
||||
+ fal_get_rx_mib_info(dev_id, port, &mib_Info);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
qca_ar8327_sw_mib_task(struct qca_phy_priv *priv)
|
||||
{
|
||||
- static int loop = 0;
|
||||
-
|
||||
mutex_lock(&priv->reg_mutex);
|
||||
- if ((loop % 2) == 0)
|
||||
- _qca_ar8327_sw_capture_port_rx_counter(priv, loop/2);
|
||||
+ if ((priv->mib_loop_cnt % 2) == 0)
|
||||
+ _qca_ar8327_sw_capture_port_rx_counter(priv->device_id, priv->mib_loop_cnt/2);
|
||||
else
|
||||
- _qca_ar8327_sw_capture_port_tx_counter(priv, loop/2);
|
||||
+ _qca_ar8327_sw_capture_port_tx_counter(priv->device_id, priv->mib_loop_cnt/2);
|
||||
|
||||
- if(++loop == (2 * (priv->ports))) {
|
||||
- loop = 0;
|
||||
+ if(++priv->mib_loop_cnt == (2 * (priv->ports))) {
|
||||
+ priv->mib_loop_cnt = 0;
|
||||
}
|
||||
|
||||
mutex_unlock(&priv->reg_mutex);
|
||||
@@ -200,7 +200,7 @@
|
||||
phy-mode = "sgmii";
|
||||
full-duplex;
|
||||
pause;
|
||||
airoha,surge = <0>;
|
||||
airoha,surge = <1>;
|
||||
airoha,polarity = <2>;
|
||||
};
|
||||
|
||||
|
||||
@@ -169,8 +169,7 @@
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <0>;
|
||||
phy-mode = "sgmii";
|
||||
phy-handle = <&phy30>;
|
||||
phy-handle2 = <&phy1>;
|
||||
phy-handle = <&phy1>; // add phy handler
|
||||
mtd-mac-address = <&factory 0x24>;
|
||||
};
|
||||
|
||||
@@ -194,16 +193,6 @@
|
||||
nvmem-cell-names = "phy-cal-data";
|
||||
};
|
||||
|
||||
phy30: ethernet-phy@30 { // AN8801SB
|
||||
compatible = "ethernet-phy-idc0ff.0421";
|
||||
reg = <30>; //0x1e
|
||||
phy-mode = "sgmii";
|
||||
full-duplex;
|
||||
pause;
|
||||
airoha,surge = <0>;
|
||||
airoha,polarity = <2>;
|
||||
};
|
||||
|
||||
phy1: ethernet-phy@1 {
|
||||
compatible = "ethernet-phy-id03a2.9471";
|
||||
reg = <24>; // set phy address to 0x18
|
||||
@@ -211,8 +200,9 @@
|
||||
reset-assert-us = <600>;
|
||||
reset-deassert-us = <20000>;
|
||||
phy-mode = "sgmii";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
&hnat {
|
||||
|
||||
@@ -34,11 +34,13 @@ case "$board" in
|
||||
|
||||
if [ -f "$phy0_file" ]; then
|
||||
check_phy0=$(cat $phy0_file)
|
||||
echo "check_phy0 = $check_phy0"
|
||||
[ "$check_phy0" == 0 ] && echo 1 > $phy0_file
|
||||
fi
|
||||
|
||||
if [ -f "$phy1_file" ]; then
|
||||
check_phy1=$(cat $phy1_file)
|
||||
echo "check_phy1 = $check_phy1"
|
||||
[ "$check_phy1" == 0 ] && echo 1 > $phy1_file
|
||||
fi
|
||||
|
||||
|
||||
42
feeds/mediatek/fitblk/Makefile
Normal file
42
feeds/mediatek/fitblk/Makefile
Normal file
@@ -0,0 +1,42 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fitblk
|
||||
PKG_RELEASE:=2
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fitblk
|
||||
HIDDEN:=1
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
TITLE:=fitblk firmware release tool
|
||||
endef
|
||||
|
||||
define Package/fitblk/description
|
||||
Release uImage.FIT block devices using ioctl.
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
CC="$(TARGET_CC)" \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall -Werror" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
endef
|
||||
|
||||
define Package/fitblk/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fitblk $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade
|
||||
$(INSTALL_DATA) ./files/fit.sh $(1)/lib/upgrade
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fitblk))
|
||||
63
feeds/mediatek/fitblk/files/fit.sh
Normal file
63
feeds/mediatek/fitblk/files/fit.sh
Normal file
@@ -0,0 +1,63 @@
|
||||
export_fitblk_bootdev() {
|
||||
[ -e /sys/firmware/devicetree/base/chosen/rootdisk ] || return
|
||||
|
||||
local rootdisk="$(cat /sys/firmware/devicetree/base/chosen/rootdisk)"
|
||||
local handle bootdev
|
||||
|
||||
for handle in /sys/class/mtd/mtd*/of_node/volumes/*/phandle; do
|
||||
[ ! -e "$handle" ] && continue
|
||||
if [ "$rootdisk" = "$(cat "$handle")" ]; then
|
||||
if [ -e "${handle%/phandle}/volname" ]; then
|
||||
export CI_KERNPART="$(cat "${handle%/phandle}/volname")"
|
||||
elif [ -e "${handle%/phandle}/volid" ]; then
|
||||
export CI_KERNVOLID="$(cat "${handle%/phandle}/volid")"
|
||||
else
|
||||
return
|
||||
fi
|
||||
export CI_UBIPART="$(cat "${handle%%/of_node*}/name")"
|
||||
export CI_METHOD="ubi"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for handle in /sys/class/mtd/mtd*/of_node/phandle; do
|
||||
[ ! -e "$handle" ] && continue
|
||||
if [ "$rootdisk" = "$(cat $handle)" ]; then
|
||||
bootdev="${handle%/of_node/phandle}"
|
||||
bootdev="${bootdev#/sys/class/mtd/}"
|
||||
export PART_NAME="/dev/$bootdev"
|
||||
export CI_METHOD="default"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for handle in /sys/class/block/*/of_node/phandle; do
|
||||
[ ! -e "$handle" ] && continue
|
||||
if [ "$rootdisk" = "$(cat $handle)" ]; then
|
||||
bootdev="${handle%/of_node/phandle}"
|
||||
bootdev="${bootdev#/sys/class/block/}"
|
||||
export EMMC_KERN_DEV="/dev/$bootdev"
|
||||
export CI_METHOD="emmc"
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
fit_do_upgrade() {
|
||||
export_fitblk_bootdev
|
||||
[ -n "$CI_METHOD" ] || return 1
|
||||
[ -e /dev/fit0 ] && fitblk /dev/fit0
|
||||
[ -e /dev/fitrw ] && fitblk /dev/fitrw
|
||||
|
||||
case "$CI_METHOD" in
|
||||
emmc)
|
||||
emmc_do_upgrade "$1"
|
||||
;;
|
||||
default)
|
||||
default_do_upgrade "$1"
|
||||
;;
|
||||
ubi)
|
||||
nand_do_upgrade "$1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
24
feeds/mediatek/fitblk/patches/100-header.patch
Normal file
24
feeds/mediatek/fitblk/patches/100-header.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
--- a/fitblk.c
|
||||
+++ b/fitblk.c
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
-#include <linux/fitblk.h>
|
||||
+#include "fitblk.h"
|
||||
|
||||
static int fitblk_release(char *device)
|
||||
{
|
||||
--- /dev/null
|
||||
+++ b/fitblk.h
|
||||
@@ -0,0 +1,10 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
|
||||
+#ifndef _LINUX_FITBLK_H
|
||||
+#define _LINUX_FITBLK_H
|
||||
+
|
||||
+/*
|
||||
+ * IOCTL commands --- we will commandeer 0x46 ('F')
|
||||
+ */
|
||||
+#define FITBLK_RELEASE 0x4600
|
||||
+
|
||||
+#endif /* _LINUX_FITBLK_H */
|
||||
7
feeds/mediatek/fitblk/src/Makefile
Normal file
7
feeds/mediatek/fitblk/src/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
all: fitblk
|
||||
|
||||
fitblk:
|
||||
$(CC) $(CFLAGS) -o $@ fitblk.c $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
rm -f fitblk
|
||||
45
feeds/mediatek/fitblk/src/fitblk.c
Normal file
45
feeds/mediatek/fitblk/src/fitblk.c
Normal file
@@ -0,0 +1,45 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/fitblk.h>
|
||||
|
||||
static int fitblk_release(char *device)
|
||||
{
|
||||
int fd, ret;
|
||||
|
||||
fd = open(device, O_RDONLY);
|
||||
if (fd == -1)
|
||||
return errno;
|
||||
|
||||
ret = ioctl(fd, FITBLK_RELEASE, NULL);
|
||||
close(fd);
|
||||
|
||||
if (ret == -1)
|
||||
return errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argp[])
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Release uImage.FIT sub-image block device\n");
|
||||
fprintf(stderr, "Syntax: %s /dev/fitXXX\n", argp[0]);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = fitblk_release(argp[1]);
|
||||
if (ret)
|
||||
fprintf(stderr, "fitblk: error releasing %s: %s\n", argp[1],
|
||||
strerror(ret));
|
||||
else
|
||||
fprintf(stderr, "fitblk: %s released\n", argp[1]);
|
||||
|
||||
return ret;
|
||||
}
|
||||
141
feeds/mediatek/fstools/Makefile
Normal file
141
feeds/mediatek/fstools/Makefile
Normal file
@@ -0,0 +1,141 @@
|
||||
#
|
||||
# Copyright (C) 2014-2015 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:=fstools
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
|
||||
PKG_MIRROR_HASH:=8fd5e2a582114c07066cabf90cf490c749735ee9839c3e13149b71aaab8ba522
|
||||
PKG_SOURCE_DATE:=2024-07-14
|
||||
PKG_SOURCE_VERSION:=408c2cc48e6694446c89da7f8121b399063e1067
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
PKG_BUILD_DEPENDS := util-linux
|
||||
PKG_CONFIG_DEPENDS := CONFIG_NAND_SUPPORT CONFIG_FSTOOLS_UBIFS_EXTROOT
|
||||
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_UBIFS_EXTROOT),-DCMAKE_UBIFS_EXTROOT=y)
|
||||
CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_OVL_MOUNT_FULL_ACCESS_TIME),-DCMAKE_OVL_MOUNT_FULL_ACCESS_TIME=y)
|
||||
CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_OVL_MOUNT_COMPRESS_ZLIB),-DCMAKE_OVL_MOUNT_COMPRESS_ZLIB=y)
|
||||
|
||||
define Package/fstools
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
DEPENDS:=+ubox +NAND_SUPPORT:ubi-utils
|
||||
TITLE:=OpenWrt filesystem tools
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/fstools/config
|
||||
config FSTOOLS_UBIFS_EXTROOT
|
||||
depends on PACKAGE_fstools
|
||||
depends on NAND_SUPPORT
|
||||
bool "Support extroot functionality with UBIFS"
|
||||
default y
|
||||
help
|
||||
This option makes it possible to use extroot functionality if the root filesystem resides on an UBIFS partition
|
||||
|
||||
config FSTOOLS_OVL_MOUNT_FULL_ACCESS_TIME
|
||||
depends on PACKAGE_fstools
|
||||
bool "Full access time accounting"
|
||||
default n
|
||||
help
|
||||
This option enables the full access time accounting (warning: it will increase the flash writes).
|
||||
|
||||
config FSTOOLS_OVL_MOUNT_COMPRESS_ZLIB
|
||||
depends on PACKAGE_fstools
|
||||
bool "Compress using zlib"
|
||||
default n
|
||||
help
|
||||
This option enables the compression using zlib on the storage device.
|
||||
endef
|
||||
|
||||
define Package/snapshot-tool
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
TITLE:=rootfs snapshoting tool
|
||||
DEPENDS:=+libubox +fstools
|
||||
endef
|
||||
|
||||
define Package/block-mount/conffiles
|
||||
/etc/config/fstab
|
||||
endef
|
||||
|
||||
define Package/block-mount
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
TITLE:=Block device mounting and checking
|
||||
DEPENDS:=+ubox +libubox +libuci +libblobmsg-json +libjson-c
|
||||
endef
|
||||
|
||||
define Package/blockd
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
TITLE:=Block device automounting
|
||||
DEPENDS:=+block-mount +fstools +libubus +kmod-fs-autofs4 +libblobmsg-json +libjson-c
|
||||
endef
|
||||
|
||||
define Package/fstools/install
|
||||
$(INSTALL_DIR) $(1)/sbin $(1)/lib
|
||||
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset} $(1)/sbin/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/
|
||||
$(LN) jffs2reset $(1)/sbin/jffs2mark
|
||||
endef
|
||||
|
||||
define Package/snapshot-tool/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snapshot_tool $(1)/sbin/
|
||||
$(INSTALL_BIN) ./files/snapshot $(1)/sbin/
|
||||
endef
|
||||
|
||||
define Package/block-mount/install
|
||||
$(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/
|
||||
|
||||
$(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab
|
||||
$(INSTALL_CONF) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab
|
||||
$(INSTALL_CONF) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount
|
||||
$(INSTALL_CONF) ./files/media-change.hotplug $(1)/etc/hotplug.d/block/00-media-change
|
||||
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/
|
||||
$(LN) ../../sbin/block $(1)/usr/sbin/swapon
|
||||
$(LN) ../../sbin/block $(1)/usr/sbin/swapoff
|
||||
|
||||
endef
|
||||
|
||||
define Package/blockd/install
|
||||
$(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blockd $(1)/sbin/
|
||||
$(INSTALL_BIN) ./files/blockd.init $(1)/etc/init.d/blockd
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libubi-utils.a $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fstools))
|
||||
$(eval $(call BuildPackage,snapshot-tool))
|
||||
$(eval $(call BuildPackage,block-mount))
|
||||
$(eval $(call BuildPackage,blockd))
|
||||
22
feeds/mediatek/fstools/files/blockd.init
Executable file
22
feeds/mediatek/fstools/files/blockd.init
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/sbin/blockd
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "fstab"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
block autofs start
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param watch block
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
2
feeds/mediatek/fstools/files/fstab.default
Normal file
2
feeds/mediatek/fstools/files/fstab.default
Normal file
@@ -0,0 +1,2 @@
|
||||
[ ! -f /etc/config/fstab ] && ( block detect > /etc/config/fstab )
|
||||
exit 0
|
||||
22
feeds/mediatek/fstools/files/fstab.init
Normal file
22
feeds/mediatek/fstools/files/fstab.init
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2013-2020 OpenWrt.org
|
||||
|
||||
START=11
|
||||
|
||||
boot() {
|
||||
/sbin/block mount
|
||||
}
|
||||
|
||||
start() {
|
||||
return 0
|
||||
}
|
||||
|
||||
restart() {
|
||||
return 0
|
||||
}
|
||||
|
||||
stop() {
|
||||
/sbin/block umount
|
||||
}
|
||||
8
feeds/mediatek/fstools/files/media-change.hotplug
Normal file
8
feeds/mediatek/fstools/files/media-change.hotplug
Normal file
@@ -0,0 +1,8 @@
|
||||
[ -n "$DISK_MEDIA_CHANGE" ] && /sbin/block info
|
||||
|
||||
if [ "$ACTION" = "add" -a "$DEVTYPE" = "disk" ]; then
|
||||
case "$DEVNAME" in
|
||||
mtd*) : ;;
|
||||
*) echo 2000 > /sys/block/$DEVNAME/events_poll_msecs ;;
|
||||
esac
|
||||
fi
|
||||
1
feeds/mediatek/fstools/files/mount.hotplug
Normal file
1
feeds/mediatek/fstools/files/mount.hotplug
Normal file
@@ -0,0 +1 @@
|
||||
[ "$ACTION" = "add" -o "$ACTION" = "remove" ] && /sbin/block hotplug
|
||||
113
feeds/mediatek/fstools/files/snapshot
Normal file
113
feeds/mediatek/fstools/files/snapshot
Normal file
@@ -0,0 +1,113 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2014 OpenWrt.org
|
||||
|
||||
|
||||
do_snapshot_unpack() {
|
||||
echo "- snapshot -"
|
||||
mkdir /tmp/snapshot
|
||||
cd /tmp/snapshot
|
||||
snapshot_tool read
|
||||
block=`ls block*.tar.gz 2> /dev/null`
|
||||
[ -z "$block" ] || for a in $block; do
|
||||
tar xzf $a -C /
|
||||
rm -f $a
|
||||
done
|
||||
}
|
||||
|
||||
do_config_unpack() {
|
||||
echo "- config -"
|
||||
snapshot_tool config_read
|
||||
[ -f /tmp/config.tar.gz ] && {
|
||||
tar xzf /tmp/config.tar.gz -C /
|
||||
rm -f /tmp/config.tar.gz
|
||||
}
|
||||
}
|
||||
|
||||
do_snapshot_push() {
|
||||
cd /volatile/upper
|
||||
tar czf /tmp/snapshot.tar.gz *
|
||||
snapshot_tool write
|
||||
reboot
|
||||
}
|
||||
|
||||
do_config_push() {
|
||||
cd /volatile/upper
|
||||
tar czf /tmp/config.tar.gz *
|
||||
snapshot_tool config_write
|
||||
}
|
||||
|
||||
do_snapshot_upgrade() {
|
||||
opkg update
|
||||
[ $? -eq 0 ] || exit 1
|
||||
|
||||
opkg list-upgradable
|
||||
[ $? -eq 0 ] || exit 2
|
||||
|
||||
UPDATES=`opkg list-upgradable | cut -d" " -f1`
|
||||
[ -z "${UPDATES}" ] && exit 0
|
||||
|
||||
opkg upgrade ${UPDATES}
|
||||
[ $? -eq 0 ] || exit 3
|
||||
|
||||
do_snapshot_push
|
||||
sleep 5
|
||||
reboot
|
||||
sleep 10
|
||||
}
|
||||
|
||||
do_convert_jffs2() {
|
||||
snapshot_tool write
|
||||
sleep 2
|
||||
reboot -f
|
||||
}
|
||||
|
||||
do_convert() {
|
||||
. /lib/functions.sh
|
||||
. /lib/upgrade/common.sh
|
||||
|
||||
cd /overlay/upper
|
||||
tar czf /tmp/snapshot.tar.gz *
|
||||
|
||||
install_bin /sbin/upgraded
|
||||
ubus call system sysupgrade "{
|
||||
\"prefix\": \"$RAM_ROOT\",
|
||||
\"path\": \"\",
|
||||
\"command\": \". /sbin/snapshot; do_convert_jffs2\"
|
||||
}"
|
||||
}
|
||||
|
||||
[ -n "$(cat /proc/mounts|grep /overlay|grep jffs2)" ] && {
|
||||
case $1 in
|
||||
convert)
|
||||
do_convert
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
[ -d /volatile/upper ] && {
|
||||
case $1 in
|
||||
push)
|
||||
do_snapshot_push
|
||||
;;
|
||||
config)
|
||||
do_config_push
|
||||
;;
|
||||
upgrade)
|
||||
do_snapshot_upgrade
|
||||
;;
|
||||
info)
|
||||
snapshot_tool info
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
[ "$SNAPSHOT" = "magic" ] && {
|
||||
case $1 in
|
||||
unpack)
|
||||
do_snapshot_unpack
|
||||
;;
|
||||
config_unpack)
|
||||
do_config_unpack
|
||||
;;
|
||||
esac
|
||||
}
|
||||
39
feeds/mediatek/gpio-button-hotplug/Makefile
Normal file
39
feeds/mediatek/gpio-button-hotplug/Makefile
Normal file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# Copyright (C) 2008-2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=gpio-button-hotplug
|
||||
PKG_RELEASE:=5
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/gpio-button-hotplug
|
||||
SUBMENU:=GPIO support
|
||||
TITLE:=Simple GPIO Button Hotplug driver
|
||||
FILES:=$(PKG_BUILD_DIR)/gpio-button-hotplug.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,gpio-button-hotplug,1)
|
||||
KCONFIG:=
|
||||
endef
|
||||
|
||||
define KernelPackage/gpio-button-hotplug/description
|
||||
This is a replacement for the following in-kernel drivers:
|
||||
1) gpio_keys (KEYBOARD_GPIO)
|
||||
2) gpio_keys_polled (KEYBOARD_GPIO_POLLED)
|
||||
|
||||
Instead of generating input events (like in-kernel drivers do) it generates
|
||||
uevent-s and broadcasts them. This allows disabling input subsystem which is
|
||||
an overkill for OpenWrt simple needs.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" modules
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,gpio-button-hotplug))
|
||||
1
feeds/mediatek/gpio-button-hotplug/src/Makefile
Normal file
1
feeds/mediatek/gpio-button-hotplug/src/Makefile
Normal file
@@ -0,0 +1 @@
|
||||
obj-m += gpio-button-hotplug.o
|
||||
737
feeds/mediatek/gpio-button-hotplug/src/gpio-button-hotplug.c
Normal file
737
feeds/mediatek/gpio-button-hotplug/src/gpio-button-hotplug.c
Normal file
@@ -0,0 +1,737 @@
|
||||
/*
|
||||
* GPIO Button Hotplug driver
|
||||
*
|
||||
* Copyright (C) 2012 Felix Fietkau <nbd@nbd.name>
|
||||
* Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
|
||||
*
|
||||
* Based on the diag.c - GPIO interface driver for Broadcom boards
|
||||
* Copyright (C) 2006 Mike Baker <mbm@openwrt.org>,
|
||||
* Copyright (C) 2006-2007 Felix Fietkau <nbd@nbd.name>
|
||||
* Copyright (C) 2008 Andy Boyett <agb@openwrt.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 as published
|
||||
* by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/kmod.h>
|
||||
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/gpio_keys.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
|
||||
#define BH_SKB_SIZE 2048
|
||||
|
||||
#define DRV_NAME "gpio-keys"
|
||||
#define PFX DRV_NAME ": "
|
||||
|
||||
struct bh_event {
|
||||
const char *name;
|
||||
unsigned int type;
|
||||
char *action;
|
||||
unsigned long seen;
|
||||
|
||||
struct sk_buff *skb;
|
||||
struct work_struct work;
|
||||
};
|
||||
|
||||
struct bh_map {
|
||||
unsigned int code;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct gpio_keys_button_data {
|
||||
struct delayed_work work;
|
||||
unsigned long seen;
|
||||
int map_entry;
|
||||
int last_state;
|
||||
int count;
|
||||
int threshold;
|
||||
int can_sleep;
|
||||
int irq;
|
||||
unsigned int software_debounce;
|
||||
struct gpio_desc *gpiod;
|
||||
const struct gpio_keys_button *b;
|
||||
};
|
||||
|
||||
extern u64 uevent_next_seqnum(void);
|
||||
|
||||
#define BH_MAP(_code, _name) \
|
||||
{ \
|
||||
.code = (_code), \
|
||||
.name = (_name), \
|
||||
}
|
||||
|
||||
static struct bh_map button_map[] = {
|
||||
BH_MAP(BTN_0, "BTN_0"),
|
||||
BH_MAP(BTN_1, "BTN_1"),
|
||||
BH_MAP(BTN_2, "BTN_2"),
|
||||
BH_MAP(BTN_3, "BTN_3"),
|
||||
BH_MAP(BTN_4, "BTN_4"),
|
||||
BH_MAP(BTN_5, "BTN_5"),
|
||||
BH_MAP(BTN_6, "BTN_6"),
|
||||
BH_MAP(BTN_7, "BTN_7"),
|
||||
BH_MAP(BTN_8, "BTN_8"),
|
||||
BH_MAP(BTN_9, "BTN_9"),
|
||||
BH_MAP(KEY_BRIGHTNESS_ZERO, "brightness_zero"),
|
||||
BH_MAP(KEY_CONFIG, "config"),
|
||||
BH_MAP(KEY_COPY, "copy"),
|
||||
BH_MAP(KEY_EJECTCD, "eject"),
|
||||
BH_MAP(KEY_HELP, "help"),
|
||||
BH_MAP(KEY_LIGHTS_TOGGLE, "lights_toggle"),
|
||||
BH_MAP(KEY_PHONE, "phone"),
|
||||
BH_MAP(KEY_POWER, "power"),
|
||||
BH_MAP(KEY_POWER2, "reboot"),
|
||||
BH_MAP(KEY_RESTART, "reset"),
|
||||
BH_MAP(KEY_RFKILL, "rfkill"),
|
||||
BH_MAP(KEY_VIDEO, "video"),
|
||||
BH_MAP(KEY_VOLUMEDOWN, "volume_down"),
|
||||
BH_MAP(KEY_VOLUMEUP, "volume_up"),
|
||||
BH_MAP(KEY_WIMAX, "wwan"),
|
||||
BH_MAP(KEY_WLAN, "wlan"),
|
||||
BH_MAP(KEY_WPS_BUTTON, "wps"),
|
||||
BH_MAP(KEY_VENDOR, "vendor"),
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------------*/
|
||||
|
||||
static __printf(3, 4)
|
||||
int bh_event_add_var(struct bh_event *event, int argv, const char *format, ...)
|
||||
{
|
||||
char buf[128];
|
||||
char *s;
|
||||
va_list args;
|
||||
int len;
|
||||
|
||||
if (argv)
|
||||
return 0;
|
||||
|
||||
va_start(args, format);
|
||||
len = vsnprintf(buf, sizeof(buf), format, args);
|
||||
va_end(args);
|
||||
|
||||
if (len >= sizeof(buf)) {
|
||||
WARN(1, "buffer size too small");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
s = skb_put(event->skb, len + 1);
|
||||
strcpy(s, buf);
|
||||
|
||||
pr_debug(PFX "added variable '%s'\n", s);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int button_hotplug_fill_event(struct bh_event *event)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bh_event_add_var(event, 0, "HOME=%s", "/");
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = bh_event_add_var(event, 0, "PATH=%s",
|
||||
"/sbin:/bin:/usr/sbin:/usr/bin");
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = bh_event_add_var(event, 0, "SUBSYSTEM=%s", "button");
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = bh_event_add_var(event, 0, "ACTION=%s", event->action);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = bh_event_add_var(event, 0, "BUTTON=%s", event->name);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (event->type == EV_SW) {
|
||||
ret = bh_event_add_var(event, 0, "TYPE=%s", "switch");
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = bh_event_add_var(event, 0, "SEEN=%ld", event->seen);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = bh_event_add_var(event, 0, "SEQNUM=%llu", uevent_next_seqnum());
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void button_hotplug_work(struct work_struct *work)
|
||||
{
|
||||
struct bh_event *event = container_of(work, struct bh_event, work);
|
||||
int ret = 0;
|
||||
|
||||
event->skb = alloc_skb(BH_SKB_SIZE, GFP_KERNEL);
|
||||
if (!event->skb)
|
||||
goto out_free_event;
|
||||
|
||||
ret = bh_event_add_var(event, 0, "%s@", event->action);
|
||||
if (ret)
|
||||
goto out_free_skb;
|
||||
|
||||
ret = button_hotplug_fill_event(event);
|
||||
if (ret)
|
||||
goto out_free_skb;
|
||||
|
||||
NETLINK_CB(event->skb).dst_group = 1;
|
||||
broadcast_uevent(event->skb, 0, 1, GFP_KERNEL);
|
||||
|
||||
out_free_skb:
|
||||
if (ret) {
|
||||
pr_err(PFX "work error %d\n", ret);
|
||||
kfree_skb(event->skb);
|
||||
}
|
||||
out_free_event:
|
||||
kfree(event);
|
||||
}
|
||||
|
||||
static int button_hotplug_create_event(const char *name, unsigned int type,
|
||||
unsigned long seen, int pressed)
|
||||
{
|
||||
struct bh_event *event;
|
||||
|
||||
pr_debug(PFX "create event, name=%s, seen=%lu, pressed=%d\n",
|
||||
name, seen, pressed);
|
||||
|
||||
event = kzalloc(sizeof(*event), GFP_KERNEL);
|
||||
if (!event)
|
||||
return -ENOMEM;
|
||||
|
||||
event->name = name;
|
||||
event->type = type;
|
||||
event->seen = seen;
|
||||
event->action = pressed ? "pressed" : "released";
|
||||
|
||||
INIT_WORK(&event->work, (void *)(void *)button_hotplug_work);
|
||||
schedule_work(&event->work);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------*/
|
||||
|
||||
static int button_get_index(unsigned int code)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(button_map); i++)
|
||||
if (button_map[i].code == code)
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int gpio_button_get_value(struct gpio_keys_button_data *bdata)
|
||||
{
|
||||
int val;
|
||||
|
||||
if (bdata->can_sleep)
|
||||
val = !!gpiod_get_value_cansleep(bdata->gpiod);
|
||||
else
|
||||
val = !!gpiod_get_value(bdata->gpiod);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static void gpio_keys_handle_button(struct gpio_keys_button_data *bdata)
|
||||
{
|
||||
unsigned int type = bdata->b->type ?: EV_KEY;
|
||||
int state = gpio_button_get_value(bdata);
|
||||
unsigned long seen = jiffies;
|
||||
|
||||
pr_debug(PFX "event type=%u, code=%u, pressed=%d\n",
|
||||
type, bdata->b->code, state);
|
||||
|
||||
/* is this the initialization state? */
|
||||
if (bdata->last_state == -1) {
|
||||
/*
|
||||
* Don't advertise unpressed buttons on initialization.
|
||||
* Just save their state and continue otherwise this
|
||||
* can cause OpenWrt to enter failsafe.
|
||||
*/
|
||||
if (type == EV_KEY && state == 0)
|
||||
goto set_state;
|
||||
/*
|
||||
* But we are very interested in pressed buttons and
|
||||
* initial switch state. These will be reported to
|
||||
* userland.
|
||||
*/
|
||||
} else if (bdata->last_state == state) {
|
||||
/* reset asserted counter (only relevant for polled keys) */
|
||||
bdata->count = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (bdata->count < bdata->threshold) {
|
||||
bdata->count++;
|
||||
return;
|
||||
}
|
||||
|
||||
if (bdata->seen == 0)
|
||||
bdata->seen = seen;
|
||||
|
||||
button_hotplug_create_event(button_map[bdata->map_entry].name, type,
|
||||
(seen - bdata->seen) / HZ, state);
|
||||
bdata->seen = seen;
|
||||
|
||||
set_state:
|
||||
bdata->last_state = state;
|
||||
bdata->count = 0;
|
||||
}
|
||||
|
||||
struct gpio_keys_button_dev {
|
||||
int polled;
|
||||
struct delayed_work work;
|
||||
|
||||
struct device *dev;
|
||||
struct gpio_keys_platform_data *pdata;
|
||||
struct gpio_keys_button_data data[];
|
||||
};
|
||||
|
||||
static void gpio_keys_polled_queue_work(struct gpio_keys_button_dev *bdev)
|
||||
{
|
||||
struct gpio_keys_platform_data *pdata = bdev->pdata;
|
||||
unsigned long delay = msecs_to_jiffies(pdata->poll_interval);
|
||||
|
||||
if (delay >= HZ)
|
||||
delay = round_jiffies_relative(delay);
|
||||
schedule_delayed_work(&bdev->work, delay);
|
||||
}
|
||||
|
||||
static void gpio_keys_polled_poll(struct work_struct *work)
|
||||
{
|
||||
struct gpio_keys_button_dev *bdev =
|
||||
container_of(work, struct gpio_keys_button_dev, work.work);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < bdev->pdata->nbuttons; i++) {
|
||||
struct gpio_keys_button_data *bdata = &bdev->data[i];
|
||||
|
||||
if (bdata->gpiod)
|
||||
gpio_keys_handle_button(bdata);
|
||||
}
|
||||
gpio_keys_polled_queue_work(bdev);
|
||||
}
|
||||
|
||||
static void gpio_keys_polled_close(struct gpio_keys_button_dev *bdev)
|
||||
{
|
||||
struct gpio_keys_platform_data *pdata = bdev->pdata;
|
||||
|
||||
cancel_delayed_work_sync(&bdev->work);
|
||||
|
||||
if (pdata->disable)
|
||||
pdata->disable(bdev->dev);
|
||||
}
|
||||
|
||||
static void gpio_keys_irq_work_func(struct work_struct *work)
|
||||
{
|
||||
struct gpio_keys_button_data *bdata = container_of(work,
|
||||
struct gpio_keys_button_data, work.work);
|
||||
|
||||
gpio_keys_handle_button(bdata);
|
||||
}
|
||||
|
||||
static irqreturn_t button_handle_irq(int irq, void *_bdata)
|
||||
{
|
||||
struct gpio_keys_button_data *bdata =
|
||||
(struct gpio_keys_button_data *) _bdata;
|
||||
|
||||
mod_delayed_work(system_wq, &bdata->work,
|
||||
msecs_to_jiffies(bdata->software_debounce));
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static struct gpio_keys_platform_data *
|
||||
gpio_keys_get_devtree_pdata(struct device *dev)
|
||||
{
|
||||
struct device_node *node, *pp;
|
||||
struct gpio_keys_platform_data *pdata;
|
||||
struct gpio_keys_button *button;
|
||||
int nbuttons;
|
||||
int i = 0;
|
||||
|
||||
node = dev->of_node;
|
||||
if (!node)
|
||||
return NULL;
|
||||
|
||||
nbuttons = of_get_available_child_count(node);
|
||||
if (nbuttons == 0)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
pdata = devm_kzalloc(dev, sizeof(*pdata) + nbuttons * (sizeof *button),
|
||||
GFP_KERNEL);
|
||||
if (!pdata)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
pdata->buttons = (struct gpio_keys_button *)(pdata + 1);
|
||||
pdata->nbuttons = nbuttons;
|
||||
|
||||
pdata->rep = !!of_get_property(node, "autorepeat", NULL);
|
||||
of_property_read_u32(node, "poll-interval", &pdata->poll_interval);
|
||||
|
||||
for_each_available_child_of_node(node, pp) {
|
||||
button = (struct gpio_keys_button *)(&pdata->buttons[i++]);
|
||||
|
||||
if (of_property_read_u32(pp, "linux,code", &button->code)) {
|
||||
dev_err(dev, "Button node '%s' without keycode\n",
|
||||
pp->full_name);
|
||||
of_node_put(pp);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
button->desc = of_get_property(pp, "label", NULL);
|
||||
|
||||
if (of_property_read_u32(pp, "linux,input-type", &button->type))
|
||||
button->type = EV_KEY;
|
||||
|
||||
button->wakeup = !!of_get_property(pp, "gpio-key,wakeup", NULL);
|
||||
|
||||
if (of_property_read_u32(pp, "debounce-interval",
|
||||
&button->debounce_interval))
|
||||
button->debounce_interval = 5;
|
||||
|
||||
button->irq = irq_of_parse_and_map(pp, 0);
|
||||
button->gpio = -ENOENT; /* mark this as device-tree */
|
||||
}
|
||||
|
||||
return pdata;
|
||||
}
|
||||
|
||||
static struct of_device_id gpio_keys_of_match[] = {
|
||||
{ .compatible = "gpio-keys", },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, gpio_keys_of_match);
|
||||
|
||||
static struct of_device_id gpio_keys_polled_of_match[] = {
|
||||
{ .compatible = "gpio-keys-polled", },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, gpio_keys_polled_of_match);
|
||||
|
||||
#else
|
||||
|
||||
static inline struct gpio_keys_platform_data *
|
||||
gpio_keys_get_devtree_pdata(struct device *dev)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int gpio_keys_button_probe(struct platform_device *pdev,
|
||||
struct gpio_keys_button_dev **_bdev, int polled)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct gpio_keys_platform_data *pdata = dev_get_platdata(dev);
|
||||
struct gpio_keys_button_dev *bdev;
|
||||
struct gpio_keys_button *buttons;
|
||||
struct device_node *prev = NULL;
|
||||
int error = 0;
|
||||
int i;
|
||||
|
||||
if (!pdata) {
|
||||
pdata = gpio_keys_get_devtree_pdata(dev);
|
||||
if (IS_ERR(pdata))
|
||||
return PTR_ERR(pdata);
|
||||
if (!pdata) {
|
||||
dev_err(dev, "missing platform data\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
if (polled && !pdata->poll_interval) {
|
||||
dev_err(dev, "missing poll_interval value\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
buttons = devm_kzalloc(dev, pdata->nbuttons * sizeof(struct gpio_keys_button),
|
||||
GFP_KERNEL);
|
||||
if (!buttons) {
|
||||
dev_err(dev, "no memory for button data\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memcpy(buttons, pdata->buttons, pdata->nbuttons * sizeof(struct gpio_keys_button));
|
||||
|
||||
bdev = devm_kzalloc(dev, sizeof(struct gpio_keys_button_dev) +
|
||||
pdata->nbuttons * sizeof(struct gpio_keys_button_data),
|
||||
GFP_KERNEL);
|
||||
if (!bdev) {
|
||||
dev_err(dev, "no memory for private data\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
bdev->polled = polled;
|
||||
|
||||
for (i = 0; i < pdata->nbuttons; i++) {
|
||||
struct gpio_keys_button *button = &buttons[i];
|
||||
struct gpio_keys_button_data *bdata = &bdev->data[i];
|
||||
const char *desc = button->desc ? button->desc : DRV_NAME;
|
||||
|
||||
if (button->wakeup) {
|
||||
dev_err(dev, "does not support wakeup\n");
|
||||
error = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
bdata->map_entry = button_get_index(button->code);
|
||||
if (bdata->map_entry < 0) {
|
||||
dev_err(dev, "does not support key code:%u\n",
|
||||
button->code);
|
||||
error = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!(button->type == 0 || button->type == EV_KEY ||
|
||||
button->type == EV_SW)) {
|
||||
dev_err(dev, "only supports buttons or switches\n");
|
||||
error = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (button->irq) {
|
||||
dev_err(dev, "skipping button %s (only gpio buttons supported)\n",
|
||||
button->desc);
|
||||
bdata->b = &pdata->buttons[i];
|
||||
continue;
|
||||
}
|
||||
|
||||
if (gpio_is_valid(button->gpio)) {
|
||||
/* legacy platform data... but is it the lookup table? */
|
||||
bdata->gpiod = devm_gpiod_get_index(dev, desc, i,
|
||||
GPIOD_IN);
|
||||
if (IS_ERR(bdata->gpiod)) {
|
||||
/* or the legacy (button->gpio is good) way? */
|
||||
error = devm_gpio_request_one(dev,
|
||||
button->gpio, GPIOF_IN | (
|
||||
button->active_low ? GPIOF_ACTIVE_LOW :
|
||||
0), desc);
|
||||
if (error) {
|
||||
dev_err_probe(dev, error,
|
||||
"unable to claim gpio %d",
|
||||
button->gpio);
|
||||
goto out;
|
||||
}
|
||||
|
||||
bdata->gpiod = gpio_to_desc(button->gpio);
|
||||
}
|
||||
} else {
|
||||
/* Device-tree */
|
||||
struct device_node *child =
|
||||
of_get_next_child(dev->of_node, prev);
|
||||
|
||||
bdata->gpiod = devm_fwnode_gpiod_get(dev,
|
||||
of_fwnode_handle(child), NULL, GPIOD_IN,
|
||||
desc);
|
||||
|
||||
prev = child;
|
||||
}
|
||||
|
||||
if (IS_ERR_OR_NULL(bdata->gpiod)) {
|
||||
error = IS_ERR(bdata->gpiod) ? PTR_ERR(bdata->gpiod) :
|
||||
-EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
bdata->can_sleep = gpiod_cansleep(bdata->gpiod);
|
||||
bdata->last_state = -1; /* Unknown state on boot */
|
||||
|
||||
if (bdev->polled) {
|
||||
bdata->threshold = DIV_ROUND_UP(button->debounce_interval,
|
||||
pdata->poll_interval);
|
||||
} else {
|
||||
/* bdata->threshold = 0; already initialized */
|
||||
|
||||
if (button->debounce_interval) {
|
||||
error = gpiod_set_debounce(bdata->gpiod,
|
||||
button->debounce_interval * 1000);
|
||||
/*
|
||||
* use timer if gpiolib doesn't provide
|
||||
* debounce.
|
||||
*/
|
||||
if (error < 0) {
|
||||
bdata->software_debounce =
|
||||
button->debounce_interval;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bdata->b = &pdata->buttons[i];
|
||||
}
|
||||
|
||||
bdev->dev = &pdev->dev;
|
||||
bdev->pdata = pdata;
|
||||
platform_set_drvdata(pdev, bdev);
|
||||
|
||||
*_bdev = bdev;
|
||||
error = 0;
|
||||
|
||||
out:
|
||||
of_node_put(prev);
|
||||
return error;
|
||||
}
|
||||
|
||||
static int gpio_keys_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct gpio_keys_platform_data *pdata;
|
||||
struct gpio_keys_button_dev *bdev;
|
||||
int ret, i;
|
||||
|
||||
ret = gpio_keys_button_probe(pdev, &bdev, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pdata = bdev->pdata;
|
||||
for (i = 0; i < pdata->nbuttons; i++) {
|
||||
const struct gpio_keys_button *button = &pdata->buttons[i];
|
||||
struct gpio_keys_button_data *bdata = &bdev->data[i];
|
||||
unsigned long irqflags = IRQF_ONESHOT;
|
||||
|
||||
INIT_DELAYED_WORK(&bdata->work, gpio_keys_irq_work_func);
|
||||
|
||||
if (!button->irq) {
|
||||
bdata->irq = gpiod_to_irq(bdata->gpiod);
|
||||
if (bdata->irq < 0) {
|
||||
dev_err(&pdev->dev, "failed to get irq for gpio:%d\n",
|
||||
button->gpio);
|
||||
continue;
|
||||
}
|
||||
|
||||
irqflags |= IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
|
||||
} else {
|
||||
bdata->irq = button->irq;
|
||||
}
|
||||
|
||||
schedule_delayed_work(&bdata->work,
|
||||
msecs_to_jiffies(bdata->software_debounce));
|
||||
|
||||
ret = devm_request_threaded_irq(&pdev->dev,
|
||||
bdata->irq, NULL, button_handle_irq,
|
||||
irqflags, dev_name(&pdev->dev), bdata);
|
||||
if (ret < 0) {
|
||||
bdata->irq = 0;
|
||||
dev_err(&pdev->dev, "failed to request irq:%d for gpio:%d\n",
|
||||
bdata->irq, button->gpio);
|
||||
continue;
|
||||
} else {
|
||||
dev_dbg(&pdev->dev, "gpio:%d has irq:%d\n",
|
||||
button->gpio, bdata->irq);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gpio_keys_polled_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct gpio_keys_platform_data *pdata;
|
||||
struct gpio_keys_button_dev *bdev;
|
||||
int ret;
|
||||
|
||||
ret = gpio_keys_button_probe(pdev, &bdev, 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
INIT_DELAYED_WORK(&bdev->work, gpio_keys_polled_poll);
|
||||
|
||||
pdata = bdev->pdata;
|
||||
if (pdata->enable)
|
||||
pdata->enable(bdev->dev);
|
||||
|
||||
gpio_keys_polled_queue_work(bdev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void gpio_keys_irq_close(struct gpio_keys_button_dev *bdev)
|
||||
{
|
||||
struct gpio_keys_platform_data *pdata = bdev->pdata;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < pdata->nbuttons; i++) {
|
||||
struct gpio_keys_button_data *bdata = &bdev->data[i];
|
||||
|
||||
disable_irq(bdata->irq);
|
||||
cancel_delayed_work_sync(&bdata->work);
|
||||
}
|
||||
}
|
||||
|
||||
static int gpio_keys_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct gpio_keys_button_dev *bdev = platform_get_drvdata(pdev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
if (bdev->polled)
|
||||
gpio_keys_polled_close(bdev);
|
||||
else
|
||||
gpio_keys_irq_close(bdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver gpio_keys_driver = {
|
||||
.probe = gpio_keys_probe,
|
||||
.remove = gpio_keys_remove,
|
||||
.driver = {
|
||||
.name = "gpio-keys",
|
||||
.of_match_table = of_match_ptr(gpio_keys_of_match),
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_driver gpio_keys_polled_driver = {
|
||||
.probe = gpio_keys_polled_probe,
|
||||
.remove = gpio_keys_remove,
|
||||
.driver = {
|
||||
.name = "gpio-keys-polled",
|
||||
.of_match_table = of_match_ptr(gpio_keys_polled_of_match),
|
||||
},
|
||||
};
|
||||
|
||||
static int __init gpio_button_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = platform_driver_register(&gpio_keys_driver);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = platform_driver_register(&gpio_keys_polled_driver);
|
||||
if (ret)
|
||||
platform_driver_unregister(&gpio_keys_driver);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void __exit gpio_button_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&gpio_keys_driver);
|
||||
platform_driver_unregister(&gpio_keys_polled_driver);
|
||||
}
|
||||
|
||||
module_init(gpio_button_init);
|
||||
module_exit(gpio_button_exit);
|
||||
|
||||
MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
|
||||
MODULE_AUTHOR("Felix Fietkau <nbd@nbd.name>");
|
||||
MODULE_DESCRIPTION("Polled GPIO Buttons hotplug driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_ALIAS("platform:" DRV_NAME);
|
||||
42
feeds/mediatek/linux-firmware/Makefile
Normal file
42
feeds/mediatek/linux-firmware/Makefile
Normal file
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# Copyright (C) 2014 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:=linux-firmware
|
||||
PKG_VERSION:=20241110
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_HASH:=32e6d3eb5c7fcb69fe5d58976c6deafa0d6552719c6e74835064aff049d25bd7
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
SCAN_DEPS = *.mk
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
RSTRIP:=:
|
||||
STRIP:=:
|
||||
|
||||
define Package/firmware-default
|
||||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
URL:=http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git
|
||||
TITLE:=$(1)
|
||||
DEPENDS:=$(2)
|
||||
LICENSE_FILES:=$(3)
|
||||
LICENSE:=$(4)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
||||
endef
|
||||
|
||||
include $(wildcard ./*.mk)
|
||||
#$(eval $(call BuildPackage,linux-firmware))
|
||||
17
feeds/mediatek/linux-firmware/airoha.mk
Normal file
17
feeds/mediatek/linux-firmware/airoha.mk
Normal file
@@ -0,0 +1,17 @@
|
||||
Package/airoha-en8811h-firmware = $(call Package/firmware-default,Airoha EN8811H 2.5G Ethernet PHY firmware,,LICENSE.airoha)
|
||||
define Package/airoha-en8811h-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/airoha
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/airoha/EthMD32.dm.bin \
|
||||
$(PKG_BUILD_DIR)/airoha/EthMD32.DSP.bin \
|
||||
$(1)/lib/firmware/airoha
|
||||
ifneq ($(CONFIG_TARGET_mediatek_filogic),)
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
cat \
|
||||
$(PKG_BUILD_DIR)/airoha/EthMD32.dm.bin \
|
||||
$(PKG_BUILD_DIR)/airoha/EthMD32.DSP.bin \
|
||||
> $(STAGING_DIR_IMAGE)/EthMD32.bin
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,airoha-en8811h-firmware))
|
||||
29
feeds/mediatek/linux-firmware/amd.mk
Normal file
29
feeds/mediatek/linux-firmware/amd.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
Package/amd64-microcode = $(call Package/firmware-default,AMD64 CPU microcode,,LICENSE.amd-ucode)
|
||||
define Package/amd64-microcode/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/amd-ucode
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/amd-ucode/*.bin \
|
||||
$(1)/lib/firmware/amd-ucode
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,amd64-microcode))
|
||||
|
||||
Package/amdgpu-firmware = $(call Package/firmware-default,AMDGPU Video Driver firmware,,LICENSE.amdgpura)
|
||||
define Package/amdgpu-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/amdgpu
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/amdgpu/*.bin \
|
||||
$(1)/lib/firmware/amdgpu
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,amdgpu-firmware))
|
||||
|
||||
Package/radeon-firmware = $(call Package/firmware-default,Radeon Video Driver firmware,,LICENSE.radeon)
|
||||
define Package/radeon-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/radeon
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/radeon/*.bin \
|
||||
$(1)/lib/firmware/radeon
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,radeon-firmware))
|
||||
214
feeds/mediatek/linux-firmware/broadcom.mk
Normal file
214
feeds/mediatek/linux-firmware/broadcom.mk
Normal file
@@ -0,0 +1,214 @@
|
||||
Package/brcmfmac-firmware-4339-sdio = $(call Package/firmware-default,Broadcom 4339 FullMAC SDIO firmware,,LICENCE.cypressb)
|
||||
define Package/brcmfmac-firmware-4339-sdio/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/cypress
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/cypress/cyfmac4339-sdio.bin \
|
||||
$(1)/lib/firmware/cypress/
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(LN) \
|
||||
../cypress/cyfmac4339-sdio.bin \
|
||||
$(1)/lib/firmware/brcm/brcmfmac4339-sdio.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-firmware-4339-sdio))
|
||||
|
||||
Package/brcmfmac-firmware-43602a1-pcie = $(call Package/firmware-default,Broadcom 43602a1 FullMAC PCIe firmware,,LICENCE.broadcom_bcm43xx)
|
||||
define Package/brcmfmac-firmware-43602a1-pcie/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43602-pcie.ap.bin \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43602-pcie.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-firmware-43602a1-pcie))
|
||||
|
||||
Package/brcmfmac-firmware-4366b1-pcie = $(call Package/firmware-default,Broadcom 4366b1 FullMAC PCIe firmware,,LICENCE.broadcom_bcm43xx)
|
||||
define Package/brcmfmac-firmware-4366b1-pcie/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac4366b-pcie.bin \
|
||||
$(1)/lib/firmware/brcm/
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-firmware-4366b1-pcie))
|
||||
|
||||
Package/brcmfmac-firmware-4366c0-pcie = $(call Package/firmware-default,Broadcom 4366c0 FullMAC PCIe firmware,,LICENCE.broadcom_bcm43xx)
|
||||
define Package/brcmfmac-firmware-4366c0-pcie/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac4366c-pcie.bin \
|
||||
$(1)/lib/firmware/brcm/
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-firmware-4366c0-pcie))
|
||||
|
||||
Package/brcmfmac-firmware-4329-sdio = $(call Package/firmware-default,Broadcom BCM4329 FullMac SDIO firmware,,LICENCE.broadcom_bcm43xx)
|
||||
define Package/brcmfmac-firmware-4329-sdio/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac4329-sdio.bin \
|
||||
$(1)/lib/firmware/brcm/brcmfmac4329-sdio.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-firmware-4329-sdio))
|
||||
|
||||
Package/brcmfmac-nvram-43430-sdio = $(call Package/firmware-default,Broadcom BCM43430 SDIO NVRAM,,LICENCE.broadcom_bcm43xx)
|
||||
define Package/brcmfmac-nvram-43430-sdio/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.AP6212.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(LN) \
|
||||
brcmfmac43430-sdio.AP6212.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.sinovoip,bpi-m2-plus.txt
|
||||
$(LN) \
|
||||
brcmfmac43430-sdio.AP6212.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt
|
||||
$(LN) \
|
||||
brcmfmac43430-sdio.AP6212.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.sinovoip,bpi-m2-ultra.txt
|
||||
$(LN) \
|
||||
brcmfmac43430-sdio.AP6212.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.sinovoip,bpi-m3.txt
|
||||
$(LN) \
|
||||
brcmfmac43430-sdio.AP6212.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.friendlyarm,nanopi-r1.txt
|
||||
$(LN) \
|
||||
brcmfmac43430-sdio.AP6212.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.starfive,visionfive-v1.txt
|
||||
$(LN) \
|
||||
brcmfmac43430-sdio.AP6212.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.beagle,beaglev-starlight-jh7100-a1.txt
|
||||
$(LN) \
|
||||
brcmfmac43430-sdio.AP6212.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.beagle,beaglev-starlight-jh7100-r0.txt
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.Hampoo-D2D3_Vi8A1.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.MUR1DX.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(LN) \
|
||||
brcmfmac43430-sdio.raspberrypi,3-model-b.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.txt
|
||||
$(LN) \
|
||||
brcmfmac43430-sdio.raspberrypi,3-model-b.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-2-w.txt
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-nvram-43430-sdio))
|
||||
|
||||
Package/brcmfmac-firmware-43430a0-sdio = $(call Package/firmware-default,Broadcom BCM43430a0 FullMac SDIO firmware,,LICENCE.broadcom_bcm43xx)
|
||||
define Package/brcmfmac-firmware-43430a0-sdio/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43430a0-sdio.bin \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430a0-sdio.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-firmware-43430a0-sdio))
|
||||
|
||||
Package/brcmfmac-nvram-43455-sdio = $(call Package/firmware-default,Broadcom BCM43455 SDIO NVRAM,,LICENCE.broadcom_bcm43xx)
|
||||
define Package/brcmfmac-nvram-43455-sdio/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.acepc-t8.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,3-model-a-plus.txt
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.raspberrypi,4-model-b.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.raspberrypi,4-model-b.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.Raspberry\ Pi\ Foundation-Raspberry\ Pi\ 4\ Model\ B.txt
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.raspberrypi,4-model-b.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,5-model-b.txt
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.raspberrypi,4-model-b.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,5-compute-module.txt
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.raspberrypi,4-model-b.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.Raspberry\ Pi\ Foundation-Raspberry\ Pi\ Compute\ Module\ 4.txt
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.raspberrypi,4-model-b.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.Raspberry\ Pi\ Foundation-Raspberry\ Pi\ 5\ Model\ B.txt
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.raspberrypi,4-model-b.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.Raspberry\ Pi\ Foundation-Raspberry\ Pi\ Compute\ Module\ 5.txt
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.MINIX-NEO\ Z83-4.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.AW-CM256SM.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.AW-CM256SM.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.beagle,am5729-beagleboneai.txt
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.AW-CM256SM.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.pine64,pinebook-pro.txt
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.AW-CM256SM.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.pine64,pinephone-pro.txt
|
||||
$(LN) \
|
||||
brcmfmac43455-sdio.AW-CM256SM.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43455-sdio.pine64,quartz64-b.txt
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-nvram-43455-sdio))
|
||||
|
||||
Package/brcmfmac-nvram-4356-sdio = $(call Package/firmware-default,Broadcom BCM4356 SDIO NVRAM,,LICENCE.broadcom_bcm43xx)
|
||||
define Package/brcmfmac-nvram-4356-sdio/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac4356-sdio.AP6356S.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(LN) \
|
||||
brcmfmac4356-sdio.AP6356S.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac4356-sdio.friendlyarm,nanopc-t4.txt
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-nvram-4356-sdio))
|
||||
|
||||
Package/brcmfmac-firmware-usb = $(call Package/firmware-default,Broadcom BCM43xx fullmac USB firmware,,LICENCE.broadcom_bcm43xx)
|
||||
define Package/brcmfmac-firmware-usb/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43236b.bin \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43143.bin \
|
||||
$(1)/lib/firmware/brcm/
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-firmware-usb))
|
||||
|
||||
Package/brcmsmac-firmware = $(call Package/firmware-default,Broadcom BCM43xx softmac PCIe firmware,,LICENCE.broadcom_bcm43xx)
|
||||
define Package/brcmsmac-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx-0.fw \
|
||||
$(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/brcm/bcm43xx_hdr-0.fw \
|
||||
$(1)/lib/firmware/brcm/
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmsmac-firmware))
|
||||
|
||||
Package/bnx2-firmware = $(call Package/firmware-default,Broadcom BCM5706/5708/5709/5716 firmware)
|
||||
define Package/bnx2-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/bnx2
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/bnx2/* \
|
||||
$(1)/lib/firmware/bnx2/
|
||||
endef
|
||||
$(eval $(call BuildPackage,bnx2-firmware))
|
||||
|
||||
Package/bnx2x-firmware = $(call Package/firmware-default,=QLogic 5771x/578xx firmware)
|
||||
define Package/bnx2x-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/bnx2x
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/bnx2x/* \
|
||||
$(1)/lib/firmware/bnx2x/
|
||||
endef
|
||||
$(eval $(call BuildPackage,bnx2x-firmware))
|
||||
10
feeds/mediatek/linux-firmware/cis.mk
Normal file
10
feeds/mediatek/linux-firmware/cis.mk
Normal file
@@ -0,0 +1,10 @@
|
||||
Package/aircard-pcmcia-firmware = $(call Package/firmware-default,Sierra Wireless Aircard 555/7xx/8x0 firmware)
|
||||
define Package/aircard-pcmcia-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/cis
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/cis/SW_555_SER.cis \
|
||||
$(PKG_BUILD_DIR)/cis/SW_7xx_SER.cis \
|
||||
$(PKG_BUILD_DIR)/cis/SW_8xx_SER.cis \
|
||||
$(1)/lib/firmware/cis
|
||||
endef
|
||||
$(eval $(call BuildPackage,aircard-pcmcia-firmware))
|
||||
12
feeds/mediatek/linux-firmware/edgeport.mk
Normal file
12
feeds/mediatek/linux-firmware/edgeport.mk
Normal file
@@ -0,0 +1,12 @@
|
||||
Package/edgeport-firmware = $(call Package/firmware-default,USB Inside Out Edgeport Serial Driver firmware)
|
||||
define Package/edgeport-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/edgeport
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/edgeport/boot.fw \
|
||||
$(PKG_BUILD_DIR)/edgeport/boot2.fw \
|
||||
$(PKG_BUILD_DIR)/edgeport/down.fw \
|
||||
$(PKG_BUILD_DIR)/edgeport/down2.fw \
|
||||
$(1)/lib/firmware/edgeport
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,edgeport-firmware))
|
||||
272
feeds/mediatek/linux-firmware/intel.mk
Normal file
272
feeds/mediatek/linux-firmware/intel.mk
Normal file
@@ -0,0 +1,272 @@
|
||||
Package/ibt-firmware = $(call Package/firmware-default,Intel bluetooth firmware)
|
||||
define Package/ibt-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/intel
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/intel/*.bseq \
|
||||
$(PKG_BUILD_DIR)/intel/ibt*.sfi \
|
||||
$(PKG_BUILD_DIR)/intel/ibt*.ddc \
|
||||
$(1)/lib/firmware/intel
|
||||
endef
|
||||
$(eval $(call BuildPackage,ibt-firmware))
|
||||
|
||||
Package/iwl3945-firmware = $(call Package/firmware-default,Intel IWL3945 firmware)
|
||||
define Package/iwl3945-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-3945-2.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwl3945-firmware))
|
||||
|
||||
Package/iwl4965-firmware = $(call Package/firmware-default,Intel IWL4965 firmware)
|
||||
define Package/iwl4965-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-4965-2.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwl4965-firmware))
|
||||
|
||||
Package/iwlwifi-firmware-iwl100 = $(call Package/firmware-default,Intel Centrino Wireless-N 100 firmware)
|
||||
define Package/iwlwifi-firmware-iwl100/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-100-5.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl100))
|
||||
|
||||
Package/iwlwifi-firmware-iwl1000 = $(call Package/firmware-default,Intel Centrino Wireless-N 1000 firmware)
|
||||
define Package/iwlwifi-firmware-iwl1000/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-1000-5.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl1000))
|
||||
|
||||
Package/iwlwifi-firmware-iwl105 = $(call Package/firmware-default,Intel Centrino Wireless-N 105 firmware)
|
||||
define Package/iwlwifi-firmware-iwl105/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-105-6.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl105))
|
||||
|
||||
Package/iwlwifi-firmware-iwl135 = $(call Package/firmware-default,Intel Centrino Wireless-N 135 firmware)
|
||||
define Package/iwlwifi-firmware-iwl135/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-135-6.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl135))
|
||||
|
||||
Package/iwlwifi-firmware-iwl2000 = $(call Package/firmware-default,Intel Centrino Wireless-N 2200 firmware)
|
||||
define Package/iwlwifi-firmware-iwl2000/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-2000-6.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl2000))
|
||||
|
||||
Package/iwlwifi-firmware-iwl2030 = $(call Package/firmware-default,Intel Centrino Wireless-N 2230 firmware)
|
||||
define Package/iwlwifi-firmware-iwl2030/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-2030-6.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl2030))
|
||||
|
||||
Package/iwlwifi-firmware-iwl3160 = $(call Package/firmware-default,Intel Wireless 3160 firmware)
|
||||
define Package/iwlwifi-firmware-iwl3160/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-3160-17.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl3160))
|
||||
|
||||
Package/iwlwifi-firmware-iwl3168 = $(call Package/firmware-default,Intel Wireless 3168 firmware)
|
||||
define Package/iwlwifi-firmware-iwl3168/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-3168-29.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl3168))
|
||||
|
||||
Package/iwlwifi-firmware-iwl5000 = $(call Package/firmware-default,Intel Wireless 5100AGN 5300AGN and 5350AGN firmware)
|
||||
define Package/iwlwifi-firmware-iwl5000/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-5000-5.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl5000))
|
||||
|
||||
Package/iwlwifi-firmware-iwl5150 = $(call Package/firmware-default,Intel Wireless Wi-Fi 5150AGN firmware)
|
||||
define Package/iwlwifi-firmware-iwl5150/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-5150-2.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl5150))
|
||||
|
||||
Package/iwlwifi-firmware-iwl6000g2 = $(call Package/firmware-default,Intel Centrino 6300 and 6200 firmware)
|
||||
define Package/iwlwifi-firmware-iwl6000g2/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-6000-4.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl6000g2))
|
||||
|
||||
Package/iwlwifi-firmware-iwl6000g2a = $(call Package/firmware-default,Intel Centrino 6205 firmware)
|
||||
define Package/iwlwifi-firmware-iwl6000g2a/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-6000g2a-6.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl6000g2a))
|
||||
|
||||
Package/iwlwifi-firmware-iwl6000g2b = $(call Package/firmware-default,Intel Centrino 6230 1030 130 and 6235 firmware)
|
||||
define Package/iwlwifi-firmware-iwl6000g2b/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-6000g2b-6.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl6000g2b))
|
||||
|
||||
Package/iwlwifi-firmware-iwl6050 = $(call Package/firmware-default,Intel Centrino 6150 and 6250 firmware)
|
||||
define Package/iwlwifi-firmware-iwl6050/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-6050-5.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl6050))
|
||||
|
||||
Package/iwlwifi-firmware-iwl7260 = $(call Package/firmware-default,Intel Wireless 7260 firmware)
|
||||
define Package/iwlwifi-firmware-iwl7260/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-7260-17.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl7260))
|
||||
|
||||
Package/iwlwifi-firmware-iwl7265 = $(call Package/firmware-default,Intel Wireless 7265 firmware)
|
||||
define Package/iwlwifi-firmware-iwl7265/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-7265-17.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl7265))
|
||||
|
||||
Package/iwlwifi-firmware-iwl7265d = $(call Package/firmware-default,Intel Wireless 7265D and 3165 firmware)
|
||||
define Package/iwlwifi-firmware-iwl7265d/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-7265D-29.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl7265d))
|
||||
|
||||
Package/iwlwifi-firmware-iwl8260c = $(call Package/firmware-default,Intel Wireless 8260 and 4165 firmware)
|
||||
define Package/iwlwifi-firmware-iwl8260c/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-8000C-36.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl8260c))
|
||||
|
||||
Package/iwlwifi-firmware-iwl8265 = $(call Package/firmware-default,Intel Wireless 8265 firmware)
|
||||
define Package/iwlwifi-firmware-iwl8265/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-8265-36.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl8265))
|
||||
|
||||
Package/iwlwifi-firmware-iwl9000 = $(call Package/firmware-default,Intel Wireless 9000 firmware)
|
||||
define Package/iwlwifi-firmware-iwl9000/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-9000-pu-b0-jf-b0-46.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl9000))
|
||||
|
||||
Package/iwlwifi-firmware-iwl9260 = $(call Package/firmware-default,Intel Wireless 9260 firmware)
|
||||
define Package/iwlwifi-firmware-iwl9260/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-9260-th-b0-jf-b0-46.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-iwl9260))
|
||||
|
||||
Package/iwlwifi-firmware-ax101 = $(call Package/firmware-default,Intel AX101 firmware)
|
||||
define Package/iwlwifi-firmware-ax101/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-so-a0-hr-b0-89.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-ax101))
|
||||
|
||||
Package/iwlwifi-firmware-ax200 = $(call Package/firmware-default,Intel AX200 firmware)
|
||||
define Package/iwlwifi-firmware-ax200/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-cc-a0-77.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-ax200))
|
||||
|
||||
Package/iwlwifi-firmware-ax201 = $(call Package/firmware-default,Intel AX201 firmware)
|
||||
define Package/iwlwifi-firmware-ax201/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-QuZ-a0-hr-b0-77.ucode $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-ax201))
|
||||
|
||||
Package/iwlwifi-firmware-ax210 = $(call Package/firmware-default,Intel AX210 firmware)
|
||||
define Package/iwlwifi-firmware-ax210/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-ty-a0-gf-a0-89.ucode $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-ty-a0-gf-a0.pnvm $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-ax210))
|
||||
|
||||
Package/iwlwifi-firmware-ax411 = $(call Package/firmware-default,Intel AX411 firmware)
|
||||
define Package/iwlwifi-firmware-ax411/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-so-a0-gf4-a0-89.ucode $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-so-a0-gf4-a0.pnvm $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-ax411))
|
||||
|
||||
Package/iwlwifi-firmware-be200 = $(call Package/firmware-default,Intel BE200 firmware)
|
||||
define Package/iwlwifi-firmware-be200/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-gl-c0-fm-c0-92.ucode $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-gl-c0-fm-c0.pnvm $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,iwlwifi-firmware-be200))
|
||||
|
||||
Package/e100-firmware = $(call Package/firmware-default,Intel e100)
|
||||
define Package/e100-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/e100
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/e100/d101m_ucode.bin $(1)/lib/firmware/e100/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/e100/d101s_ucode.bin $(1)/lib/firmware/e100/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/e100/d102e_ucode.bin $(1)/lib/firmware/e100/
|
||||
endef
|
||||
$(eval $(call BuildPackage,e100-firmware))
|
||||
|
||||
i915_deps:=+i915-firmware-dmc +i915-firmware-guc +i915-firmware-huc +i915-firmware-gsc
|
||||
Package/i915-firmware = $(call Package/firmware-default,Intel I915 firmware \(meta package\),$(i915_deps),LICENSE.i915)
|
||||
define Package/i915-firmware/install
|
||||
true
|
||||
endef
|
||||
$(eval $(call BuildPackage,i915-firmware))
|
||||
|
||||
Package/i915-firmware-dmc = $(call Package/firmware-default,Intel I915 DMC firmware,,LICENSE.i915)
|
||||
define Package/i915-firmware-dmc/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/i915
|
||||
for f in $(PKG_BUILD_DIR)/i915/*_dmc*.bin; do \
|
||||
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
|
||||
if [ "$$$$t" = dmc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
|
||||
done
|
||||
endef
|
||||
$(eval $(call BuildPackage,i915-firmware-dmc))
|
||||
|
||||
Package/i915-firmware-guc = $(call Package/firmware-default,Intel I915 GUC firmware,,LICENSE.i915)
|
||||
define Package/i915-firmware-guc/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/i915
|
||||
for f in $(PKG_BUILD_DIR)/i915/*_guc*.bin; do \
|
||||
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
|
||||
if [ "$$$$t" = guc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
|
||||
done
|
||||
endef
|
||||
$(eval $(call BuildPackage,i915-firmware-guc))
|
||||
|
||||
Package/i915-firmware-huc = $(call Package/firmware-default,Intel I915 HUC firmware,,LICENSE.i915)
|
||||
define Package/i915-firmware-huc/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/i915
|
||||
for f in $(PKG_BUILD_DIR)/i915/*_huc*.bin; do \
|
||||
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
|
||||
if [ "$$$$t" = huc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
|
||||
done
|
||||
endef
|
||||
$(eval $(call BuildPackage,i915-firmware-huc))
|
||||
|
||||
Package/i915-firmware-gsc = $(call Package/firmware-default,Intel I915 GSC firmware,,LICENSE.i915)
|
||||
define Package/i915-firmware-gsc/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/i915
|
||||
for f in $(PKG_BUILD_DIR)/i915/*_gsc*.bin; do \
|
||||
t=`echo $$$${f##*/} | cut -d_ -f2 | cut -d. -f1`; \
|
||||
if [ "$$$$t" = gsc ]; then $(CP) $$$$f $(1)/lib/firmware/i915/; fi \
|
||||
done
|
||||
endef
|
||||
$(eval $(call BuildPackage,i915-firmware-gsc))
|
||||
72
feeds/mediatek/linux-firmware/marvell.mk
Normal file
72
feeds/mediatek/linux-firmware/marvell.mk
Normal file
@@ -0,0 +1,72 @@
|
||||
Package/mwl8k-firmware = $(call Package/firmware-default,Marvell 8366/8687 firmware,,LICENCE.Marvell)
|
||||
define Package/mwl8k-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mwl8k
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mwl8k/fmimage_8366_ap-3.fw \
|
||||
$(PKG_BUILD_DIR)/mwl8k/fmimage_8366.fw \
|
||||
$(PKG_BUILD_DIR)/mwl8k/helper_8366.fw \
|
||||
$(PKG_BUILD_DIR)/mwl8k/fmimage_8687.fw \
|
||||
$(PKG_BUILD_DIR)/mwl8k/helper_8687.fw \
|
||||
$(1)/lib/firmware/mwl8k/
|
||||
endef
|
||||
$(eval $(call BuildPackage,mwl8k-firmware))
|
||||
|
||||
Package/mwifiex-pcie-firmware = $(call Package/firmware-default,Marvell 8897 firmware,,LICENCE.Marvell)
|
||||
define Package/mwifiex-pcie-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mrvl
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mrvl/pcie8897_uapsta.bin \
|
||||
$(1)/lib/firmware/mrvl/
|
||||
endef
|
||||
$(eval $(call BuildPackage,mwifiex-pcie-firmware))
|
||||
|
||||
Package/mwifiex-sdio-firmware = $(call Package/firmware-default,Marvell 8887/8997 firmware,,LICENCE.Marvell)
|
||||
define Package/mwifiex-sdio-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mrvl
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mrvl/sd8887_uapsta.bin \
|
||||
$(PKG_BUILD_DIR)/mrvl/sdsd8997_combo_v4.bin \
|
||||
$(1)/lib/firmware/mrvl/
|
||||
ln -s ../mrvl/sdsd8997_combo_v4.bin $(1)/lib/firmware/mrvl/sd8997_uapsta.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,mwifiex-sdio-firmware))
|
||||
|
||||
Package/libertas-usb-firmware = $(call Package/firmware-default,Marvell 8388/8682 USB firmware,,LICENCE.Marvell)
|
||||
define Package/libertas-usb-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/libertas
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/libertas/usb8388_v9.bin \
|
||||
$(PKG_BUILD_DIR)/libertas/usb8682.bin \
|
||||
$(1)/lib/firmware/libertas/
|
||||
endef
|
||||
$(eval $(call BuildPackage,libertas-usb-firmware))
|
||||
|
||||
Package/libertas-sdio-firmware = $(call Package/firmware-default,Marvell 8385/8686/8688 SDIO firmware,,LICENCE.Marvell)
|
||||
define Package/libertas-sdio-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/libertas
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/libertas/sd8385_helper.bin \
|
||||
$(PKG_BUILD_DIR)/libertas/sd8385.bin \
|
||||
$(PKG_BUILD_DIR)/libertas/sd8686_v9_helper.bin \
|
||||
$(PKG_BUILD_DIR)/libertas/sd8686_v9.bin \
|
||||
$(1)/lib/firmware/libertas
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mrvl
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mrvl/sd8688_helper.bin \
|
||||
$(PKG_BUILD_DIR)/mrvl/sd8688.bin \
|
||||
$(1)/lib/firmware/mrvl
|
||||
ln -s ../mrvl/sd8688_helper.bin $(1)/lib/firmware/libertas/sd8688_helper.bin
|
||||
ln -s ../mrvl/sd8688.bin $(1)/lib/firmware/libertas/sd8688.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,libertas-sdio-firmware))
|
||||
|
||||
Package/libertas-spi-firmware = $(call Package/firmware-default,Marvell 8686 SPI firmware,,LICENCE.Marvell)
|
||||
define Package/libertas-spi-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/libertas
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/libertas/gspi8686_v9_helper.bin \
|
||||
$(PKG_BUILD_DIR)/libertas/gspi8686_v9.bin \
|
||||
$(1)/lib/firmware/libertas
|
||||
endef
|
||||
$(eval $(call BuildPackage,libertas-spi-firmware))
|
||||
|
||||
108
feeds/mediatek/linux-firmware/mediatek.mk
Normal file
108
feeds/mediatek/linux-firmware/mediatek.mk
Normal file
@@ -0,0 +1,108 @@
|
||||
Package/mt7601u-firmware = $(call Package/firmware-default,MediaTek MT7601U firmware,,LICENCE.mediatek)
|
||||
define Package/mt7601u-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mediatek
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mediatek/mt7601u.bin \
|
||||
$(1)/lib/firmware/mediatek
|
||||
endef
|
||||
$(eval $(call BuildPackage,mt7601u-firmware))
|
||||
|
||||
Package/rt2800-pci-firmware = $(call Package/firmware-default,Ralink RT28xx/3xxx PCI/SoC firmware)
|
||||
define Package/rt2800-pci-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/rt2860.bin \
|
||||
$(PKG_BUILD_DIR)/rt3290.bin \
|
||||
$(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,rt2800-pci-firmware))
|
||||
|
||||
Package/rt2800-usb-firmware = $(call Package/firmware-default,Ralink RT28xx/3xxx USB firmware)
|
||||
define Package/rt2800-usb-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2870.bin $(1)/lib/firmware/
|
||||
endef
|
||||
$(eval $(call BuildPackage,rt2800-usb-firmware))
|
||||
|
||||
Package/rt61-pci-firmware = $(call Package/firmware-default,Ralink RT2561 firmware)
|
||||
define Package/rt61-pci-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/rt2561.bin \
|
||||
$(PKG_BUILD_DIR)/rt2561s.bin \
|
||||
$(PKG_BUILD_DIR)/rt2661.bin \
|
||||
$(1)/lib/firmware/
|
||||
endef
|
||||
$(eval $(call BuildPackage,rt61-pci-firmware))
|
||||
|
||||
Package/rt73-usb-firmware = $(call Package/firmware-default,Ralink RT2573 firmware)
|
||||
define Package/rt73-usb-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
|
||||
endef
|
||||
$(eval $(call BuildPackage,rt73-usb-firmware))
|
||||
|
||||
Package/mt7622bt-firmware = $(call Package/firmware-default,mt7622bt firmware,,LICENCE.mediatek)
|
||||
define Package/mt7622bt-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mediatek
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mediatek/mt7622pr2h.bin \
|
||||
$(1)/lib/firmware/mediatek
|
||||
endef
|
||||
$(eval $(call BuildPackage,mt7622bt-firmware))
|
||||
|
||||
Package/mt7921bt-firmware = $(call Package/firmware-default,mt7921bt firmware,,LICENCE.mediatek)
|
||||
define Package/mt7921bt-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mediatek
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin \
|
||||
$(1)/lib/firmware/mediatek
|
||||
endef
|
||||
$(eval $(call BuildPackage,mt7921bt-firmware))
|
||||
|
||||
Package/mt7922bt-firmware = $(call Package/firmware-default,mt7922bt firmware,,LICENCE.mediatek)
|
||||
define Package/mt7922bt-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mediatek
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin \
|
||||
$(1)/lib/firmware/mediatek
|
||||
endef
|
||||
$(eval $(call BuildPackage,mt7922bt-firmware))
|
||||
|
||||
Package/mt7981-wo-firmware = $(call Package/firmware-default,MT7981 offload firmware,,LICENCE.mediatek)
|
||||
define Package/mt7981-wo-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mediatek
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mediatek/mt7981_wo.bin \
|
||||
$(1)/lib/firmware/mediatek
|
||||
endef
|
||||
$(eval $(call BuildPackage,mt7981-wo-firmware))
|
||||
|
||||
Package/mt7986-wo-firmware = $(call Package/firmware-default,MT7986 offload firmware,,LICENCE.mediatek)
|
||||
define Package/mt7986-wo-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mediatek
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mediatek/mt7986_wo_0.bin \
|
||||
$(PKG_BUILD_DIR)/mediatek/mt7986_wo_1.bin \
|
||||
$(1)/lib/firmware/mediatek
|
||||
endef
|
||||
$(eval $(call BuildPackage,mt7986-wo-firmware))
|
||||
|
||||
Package/mt7988-2p5g-phy-firmware = $(call Package/firmware-default,MT7988 built-in 2.5G Ethernet PHY firmware,,LICENCE.mediatek)
|
||||
define Package/mt7988-2p5g-phy-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7988
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mediatek/mt7988/i2p5ge-phy-pmb.bin \
|
||||
$(1)/lib/firmware/mediatek/mt7988
|
||||
endef
|
||||
$(eval $(call BuildPackage,mt7988-2p5g-phy-firmware))
|
||||
|
||||
Package/mt7988-wo-firmware = $(call Package/firmware-default,MT7988 offload firmware,,LICENCE.mediatek)
|
||||
define Package/mt7988-wo-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7988
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/mediatek/mt7988/mt7988_wo_0.bin \
|
||||
$(PKG_BUILD_DIR)/mediatek/mt7988/mt7988_wo_1.bin \
|
||||
$(1)/lib/firmware/mediatek/mt7988
|
||||
endef
|
||||
$(eval $(call BuildPackage,mt7988-wo-firmware))
|
||||
39
feeds/mediatek/linux-firmware/mellanox.mk
Normal file
39
feeds/mediatek/linux-firmware/mellanox.mk
Normal file
@@ -0,0 +1,39 @@
|
||||
Package/mlxsw_spectrum-firmware = $(call Package/firmware-default,Mellanox Spectrum firmware)
|
||||
define Package/mlxsw_spectrum-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mellanox
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/mellanox/mlxsw_spectrum-*.mfa2 \
|
||||
$(1)/lib/firmware/mellanox
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mlxsw_spectrum-firmware))
|
||||
|
||||
Package/mlxsw_spectrum2-firmware = $(call Package/firmware-default,Mellanox Spectrum-2 firmware)
|
||||
define Package/mlxsw_spectrum2-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mellanox
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/mellanox/mlxsw_spectrum2-*.mfa2 \
|
||||
$(1)/lib/firmware/mellanox
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mlxsw_spectrum2-firmware))
|
||||
|
||||
Package/mlxsw_spectrum3-firmware = $(call Package/firmware-default,Mellanox Spectrum-3 firmware)
|
||||
define Package/mlxsw_spectrum3-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mellanox
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/mellanox/mlxsw_spectrum3-*.mfa2 \
|
||||
$(1)/lib/firmware/mellanox
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mlxsw_spectrum3-firmware))
|
||||
|
||||
Package/mlxsw_spectrum4-firmware = $(call Package/firmware-default,Mellanox Spectrum-4 firmware)
|
||||
define Package/mlxsw_spectrum4-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/mellanox
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/mellanox/mlxsw_spectrum4-*.mfa2 \
|
||||
$(1)/lib/firmware/mellanox
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mlxsw_spectrum4-firmware))
|
||||
9
feeds/mediatek/linux-firmware/misc.mk
Normal file
9
feeds/mediatek/linux-firmware/misc.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
Package/eip197-mini-firmware = $(call Package/firmware-default,Inside Secure EIP197 mini firmware)
|
||||
define Package/eip197-mini-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/inside-secure/eip197_minifw
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ifpp.bin \
|
||||
$(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ipue.bin \
|
||||
$(1)/lib/firmware/inside-secure/eip197_minifw
|
||||
endef
|
||||
$(eval $(call BuildPackage,eip197-mini-firmware))
|
||||
47
feeds/mediatek/linux-firmware/qca.mk
Normal file
47
feeds/mediatek/linux-firmware/qca.mk
Normal file
@@ -0,0 +1,47 @@
|
||||
Package/ar3k-firmware = $(call Package/firmware-default,ath3k firmware,,LICENSE.QualcommAtheros_ar3k)
|
||||
define Package/ar3k-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ar3k
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/ar3k/*.dfu \
|
||||
$(1)/lib/firmware/ar3k
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/qca
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/qca/*.bin \
|
||||
$(1)/lib/firmware/qca
|
||||
endef
|
||||
$(eval $(call BuildPackage,ar3k-firmware))
|
||||
|
||||
|
||||
Package/ath6k-firmware = $(call Package/firmware-default,AR600X firmware)
|
||||
define Package/ath6k-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath6k
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/ath6k/* \
|
||||
$(1)/lib/firmware/ath6k
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath6k-firmware))
|
||||
|
||||
Package/ath9k-htc-firmware = $(call Package/firmware-default,AR9271/AR7010 firmware,,LICENCE.open-ath9k-htc-firmware)
|
||||
define Package/ath9k-htc-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath9k_htc
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath9k_htc/htc_9271-1.4.0.fw \
|
||||
$(PKG_BUILD_DIR)/ath9k_htc/htc_7010-1.4.0.fw \
|
||||
$(1)/lib/firmware/ath9k_htc
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath9k-htc-firmware))
|
||||
|
||||
Package/carl9170-firmware = $(call Package/firmware-default,AR9170 firmware,,carl9170fw/GPL)
|
||||
define Package/carl9170-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/carl9170-1.fw $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,carl9170-firmware))
|
||||
|
||||
Package/wil6210-firmware = $(call Package/firmware-default,wil6210 firmware)
|
||||
define Package/wil6210-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/wil6210.fw $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/wil6210.brd $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,wil6210-firmware))
|
||||
138
feeds/mediatek/linux-firmware/qca_ath10k.mk
Normal file
138
feeds/mediatek/linux-firmware/qca_ath10k.mk
Normal file
@@ -0,0 +1,138 @@
|
||||
Package/ath10k-board-qca4019 = $(call Package/firmware-default,ath10k qca4019 board firmware,,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-board-qca4019/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA4019/hw1.0/board-2.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-board-qca4019))
|
||||
Package/ath10k-firmware-qca4019 = $(call Package/firmware-default,ath10k qca4019 firmware,,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-firmware-qca4019/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA4019/hw1.0/firmware-5.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-firmware-qca4019))
|
||||
|
||||
Package/ath10k-board-qca9377 = $(call Package/firmware-default,ath10k qca9377 board firmware,,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-board-qca9377/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9377/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA9377/hw1.0/board-2.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA9377/hw1.0/
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-board-qca9377))
|
||||
Package/ath10k-firmware-qca9377 = $(call Package/firmware-default,ath10k qca9377 firmware,+ath10k-board-qca9377,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-firmware-qca9377/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9377/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA9377/hw1.0/firmware-6.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA9377/hw1.0/firmware-6.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-firmware-qca9377))
|
||||
|
||||
Package/ath10k-board-qca9887 = $(call Package/firmware-default,ath10k qca9887 board firmware,,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-board-qca9887/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA9887/hw1.0/board.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-board-qca9887))
|
||||
Package/ath10k-firmware-qca9887 = $(call Package/firmware-default,ath10k qca9887 firmware,+ath10k-board-qca9887,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-firmware-qca9887/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA9887/hw1.0/firmware-5.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/firmware-5.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-firmware-qca9887))
|
||||
|
||||
Package/ath10k-board-qca9888 = $(call Package/firmware-default,ath10k qca9888 board firmware,,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-board-qca9888/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA9888/hw2.0/board-2.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-board-qca9888))
|
||||
Package/ath10k-firmware-qca9888 = $(call Package/firmware-default,ath10k qca9888 firmware,+ath10k-board-qca9888,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-firmware-qca9888/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA9888/hw2.0/firmware-5.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/firmware-5.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-firmware-qca9888))
|
||||
|
||||
Package/ath10k-board-qca988x = $(call Package/firmware-default,ath10k qca988x board firmware,,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-board-qca988x/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA988X/hw2.0/board.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-board-qca988x))
|
||||
Package/ath10k-firmware-qca988x = $(call Package/firmware-default,ath10k qca988x firmware,+ath10k-board-qca988x,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-firmware-qca988x/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA988X/hw2.0/firmware-5.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-firmware-qca988x))
|
||||
|
||||
Package/ath10k-firmware-qca6174 = $(call Package/firmware-default,ath10k qca6174 firmware,,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-firmware-qca6174/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA6174/hw2.1
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA6174/hw2.1/board-2.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA6174/hw2.1/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA6174/hw2.1/firmware-5.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA6174/hw2.1/firmware-5.bin
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA6174/hw3.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA6174/hw3.0/board-2.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA6174/hw3.0/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA6174/hw3.0/firmware-6.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA6174/hw3.0/firmware-6.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-firmware-qca6174))
|
||||
|
||||
Package/ath10k-board-qca99x0 = $(call Package/firmware-default,ath10k qca99x0 board firmware,,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-board-qca99x0/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA99X0/hw2.0/board-2.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-board-qca99x0))
|
||||
|
||||
Package/ath10k-firmware-qca99x0 = $(call Package/firmware-default,ath10k qca99x0 firmware,+ath10k-board-qca99x0,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-firmware-qca99x0/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA99X0/hw2.0/firmware-5.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/firmware-5.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-firmware-qca99x0))
|
||||
|
||||
Package/ath10k-board-qca9984 = $(call Package/firmware-default,ath10k qca9984 board firmware,,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-board-qca9984/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA9984/hw1.0/board-2.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-board-qca9984))
|
||||
Package/ath10k-firmware-qca9984 = $(call Package/firmware-default,ath10k qca9984 firmware,+ath10k-board-qca9984,LICENSE.QualcommAtheros_ath10k)
|
||||
define Package/ath10k-firmware-qca9984/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath10k/QCA9984/hw1.0/firmware-5.bin \
|
||||
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath10k-firmware-qca9984))
|
||||
28
feeds/mediatek/linux-firmware/qca_ath11k.mk
Normal file
28
feeds/mediatek/linux-firmware/qca_ath11k.mk
Normal file
@@ -0,0 +1,28 @@
|
||||
Package/ath11k-firmware-qca6390 = $(call Package/firmware-default,QCA6390 ath11k firmware,,LICENCE.atheros_firmware)
|
||||
define Package/ath11k-firmware-qca6390/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCA6390/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k/QCA6390/hw2.0/* $(1)/lib/firmware/ath11k/QCA6390/hw2.0/
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath11k-firmware-qca6390))
|
||||
|
||||
Package/ath11k-firmware-wcn6750 = $(call Package/firmware-default,WCN6750 ath11k firmware,,LICENCE.atheros_firmware)
|
||||
define Package/ath11k-firmware-wcn6750/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/WCN6750/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/board-2.bin $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/Notice.txt $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/sc7280/wpss.mbn $(1)/lib/firmware/ath11k/WCN6750/hw1.0/
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath11k-firmware-wcn6750))
|
||||
|
||||
Package/ath11k-firmware-wcn6855 = $(call Package/firmware-default,WCN6855 ath11k firmware,,LICENCE.atheros_firmware)
|
||||
define Package/ath11k-firmware-wcn6855/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/WCN6855/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k/WCN6855/hw2.0/* $(1)/lib/firmware/ath11k/WCN6855/hw2.0/
|
||||
$(LN) ./hw2.0 $(1)/lib/firmware/ath11k/WCN6855/hw2.1
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath11k-firmware-wcn6855))
|
||||
7
feeds/mediatek/linux-firmware/qca_ath12k.mk
Normal file
7
feeds/mediatek/linux-firmware/qca_ath12k.mk
Normal file
@@ -0,0 +1,7 @@
|
||||
Package/ath12k-firmware-wcn7850 = $(call Package/firmware-default,WCN7850 ath12k firmware)
|
||||
define Package/ath12k-firmware-wcn7850/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath12k/WCN7850/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath12k/WCN7850/hw2.0/* $(1)/lib/firmware/ath12k/WCN7850/hw2.0/
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath12k-firmware-wcn7850))
|
||||
220
feeds/mediatek/linux-firmware/realtek.mk
Normal file
220
feeds/mediatek/linux-firmware/realtek.mk
Normal file
@@ -0,0 +1,220 @@
|
||||
Package/r8152-firmware = $(call Package/firmware-default,RealTek RTL8152 firmware)
|
||||
define Package/r8152-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtl_nic
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/rtl_nic/rtl8153* \
|
||||
$(PKG_BUILD_DIR)/rtl_nic/rtl8156* \
|
||||
$(1)/lib/firmware/rtl_nic
|
||||
endef
|
||||
$(eval $(call BuildPackage,r8152-firmware))
|
||||
|
||||
Package/r8169-firmware = $(call Package/firmware-default,RealTek RTL8169 firmware)
|
||||
define Package/r8169-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtl_nic
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/rtl_nic/rtl810* \
|
||||
$(PKG_BUILD_DIR)/rtl_nic/rtl812* \
|
||||
$(PKG_BUILD_DIR)/rtl_nic/rtl8168* \
|
||||
$(PKG_BUILD_DIR)/rtl_nic/rtl84* \
|
||||
$(1)/lib/firmware/rtl_nic
|
||||
endef
|
||||
$(eval $(call BuildPackage,r8169-firmware))
|
||||
|
||||
Package/rtl8188eu-firmware = $(call Package/firmware-default,RealTek RTL8188EU firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8188eu-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/rtlwifi/rtl8188eufw.bin \
|
||||
$(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8188eu-firmware))
|
||||
|
||||
Package/rtl8188fu-firmware = $(call Package/firmware-default,RealTek RTL8188FU firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8188fu-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/rtlwifi/rtl8188fufw.bin \
|
||||
$(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8188fu-firmware))
|
||||
|
||||
Package/rtl8192ce-firmware = $(call Package/firmware-default,RealTek RTL8192CE firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8192ce-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cfw.bin $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cfwU.bin $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cfwU_B.bin $(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8192ce-firmware))
|
||||
|
||||
Package/rtl8192cu-firmware = $(call Package/firmware-default,RealTek RTL8192CU firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8192cu-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cufw.bin $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cufw_A.bin $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cufw_B.bin $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192cufw_TMSC.bin $(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8192cu-firmware))
|
||||
|
||||
Package/rtl8192de-firmware = $(call Package/firmware-default,RealTek RTL8192DE firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8192de-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192defw.bin $(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8192de-firmware))
|
||||
|
||||
Package/rtl8192du-firmware = $(call Package/firmware-default,RealTek RTL8192DU firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8192du-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192dufw.bin $(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8192du-firmware))
|
||||
|
||||
Package/rtl8192eu-firmware = $(call Package/firmware-default,RealTek RTL8192EU firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8192eu-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192eu_nic.bin $(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8192eu-firmware))
|
||||
|
||||
Package/rtl8192se-firmware = $(call Package/firmware-default,RealTek RTL8192SE firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8192se-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8192sefw.bin $(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8192se-firmware))
|
||||
|
||||
Package/rtl8723au-firmware = $(call Package/firmware-default,RealTek RTL8723AU firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8723au-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8723aufw_A.bin $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8723aufw_B.bin $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8723aufw_B_NoBT.bin $(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8723au-firmware))
|
||||
|
||||
Package/rtl8723be-firmware = $(call Package/firmware-default,RealTek RTL8723BE firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8723be-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8723befw_36.bin $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8723befw.bin $(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8723be-firmware))
|
||||
|
||||
Package/rtl8723bu-firmware = $(call Package/firmware-default,RealTek RTL8723BU firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8723bu-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8723bu_nic.bin $(1)/lib/firmware/rtlwifi
|
||||
ln -s rtl8723bu_nic.bin $(1)/lib/firmware/rtlwifi/rtl8723bs_nic.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8723bu-firmware))
|
||||
|
||||
Package/rtl8723de-firmware = $(call Package/firmware-default,RealTek RTL8723DE firmware)
|
||||
define Package/rtl8723de-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8723d_fw.bin $(1)/lib/firmware/rtw88
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8723de-firmware))
|
||||
|
||||
Package/rtl8761a-firmware = $(call Package/firmware-default,RealTek RTL8761A firmware)
|
||||
define Package/rtl8761a-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtl_bt
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtl_bt/rtl8761a_fw.bin $(1)/lib/firmware/rtl_bt
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8761a-firmware))
|
||||
|
||||
Package/rtl8761b-firmware = $(call Package/firmware-default,RealTek RTL8761B firmware)
|
||||
define Package/rtl8761b-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtl_bt
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtl_bt/rtl8761b_config.bin $(1)/lib/firmware/rtl_bt
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtl_bt/rtl8761b_fw.bin $(1)/lib/firmware/rtl_bt
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8761b-firmware))
|
||||
|
||||
Package/rtl8761bu-firmware = $(call Package/firmware-default,RealTek RTL8761BU firmware)
|
||||
define Package/rtl8761bu-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtl_bt
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtl_bt/rtl8761bu_config.bin $(1)/lib/firmware/rtl_bt
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtl_bt/rtl8761bu_fw.bin $(1)/lib/firmware/rtl_bt
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8761bu-firmware))
|
||||
|
||||
Package/rtl8812a-firmware = $(call Package/firmware-default,RealTek RTL8812AU firmware)
|
||||
define Package/rtl8812a-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8812a_fw.bin $(1)/lib/firmware/rtw88
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8812a-firmware))
|
||||
|
||||
Package/rtl8821a-firmware = $(call Package/firmware-default,RealTek RTL8821AU firmware)
|
||||
define Package/rtl8821a-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8821a_fw.bin $(1)/lib/firmware/rtw88
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8821a-firmware))
|
||||
|
||||
Package/rtl8821ae-firmware = $(call Package/firmware-default,RealTek RTL8821AE firmware,,LICENCE.rtlwifi_firmware.txt)
|
||||
define Package/rtl8821ae-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8821aefw_29.bin $(1)/lib/firmware/rtlwifi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtlwifi/rtl8821aefw_wowlan.bin $(1)/lib/firmware/rtlwifi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8821ae-firmware))
|
||||
|
||||
Package/rtl8821ce-firmware = $(call Package/firmware-default,RealTek RTL8821CE firmware)
|
||||
define Package/rtl8821ce-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8821c_fw.bin $(1)/lib/firmware/rtw88
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8821ce-firmware))
|
||||
|
||||
Package/rtl8822be-firmware = $(call Package/firmware-default,RealTek RTL8822BE firmware)
|
||||
define Package/rtl8822be-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8822b_fw.bin $(1)/lib/firmware/rtw88
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8822be-firmware))
|
||||
|
||||
Package/rtl8822ce-firmware = $(call Package/firmware-default,RealTek RTL8822CE firmware)
|
||||
define Package/rtl8822ce-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw88
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8822c_fw.bin $(1)/lib/firmware/rtw88
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8822c_wow_fw.bin $(1)/lib/firmware/rtw88
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8822ce-firmware))
|
||||
|
||||
Package/rtl8851be-firmware = $(call Package/firmware-default,RealTek RTL8851BE firmware)
|
||||
define Package/rtl8851be-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw89
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8851b_fw.bin $(1)/lib/firmware/rtw89
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8851be-firmware))
|
||||
|
||||
Package/rtl8852ae-firmware = $(call Package/firmware-default,RealTek RTL8852AE firmware)
|
||||
define Package/rtl8852ae-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw89
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8852a_fw.bin $(1)/lib/firmware/rtw89
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8852ae-firmware))
|
||||
|
||||
Package/rtl8852be-firmware = $(call Package/firmware-default,RealTek RTL8852BE firmware)
|
||||
define Package/rtl8852be-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw89
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8852b_fw-1.bin $(1)/lib/firmware/rtw89
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8852be-firmware))
|
||||
|
||||
Package/rtl8852ce-firmware = $(call Package/firmware-default,RealTek RTL8852CE firmware)
|
||||
define Package/rtl8852ce-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw89
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8852c_fw.bin $(1)/lib/firmware/rtw89
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8852ce-firmware))
|
||||
|
||||
Package/rtl8922ae-firmware = $(call Package/firmware-default,RealTek RTL8922AE firmware)
|
||||
define Package/rtl8922ae-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rtw89
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8922a_fw.bin $(1)/lib/firmware/rtw89
|
||||
endef
|
||||
$(eval $(call BuildPackage,rtl8922ae-firmware))
|
||||
6
feeds/mediatek/linux-firmware/rsi.mk
Normal file
6
feeds/mediatek/linux-firmware/rsi.mk
Normal file
@@ -0,0 +1,6 @@
|
||||
Package/rs9113-firmware = $(call Package/firmware-default,RedPine Signals rs9113 firmware)
|
||||
define Package/rs9113-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/rsi
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rsi/rs9113_wlan_qspi.rps $(1)/lib/firmware/rsi
|
||||
endef
|
||||
$(eval $(call BuildPackage,rs9113-firmware))
|
||||
39
feeds/mediatek/linux-firmware/ti.mk
Normal file
39
feeds/mediatek/linux-firmware/ti.mk
Normal file
@@ -0,0 +1,39 @@
|
||||
Package/wl12xx-firmware = $(call Package/firmware-default,TI WL12xx firmware,,LICENCE.ti-connectivity)
|
||||
define Package/wl12xx-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ti-connectivity/wl127x-fw-5-mr.bin \
|
||||
$(PKG_BUILD_DIR)/ti-connectivity/wl127x-fw-5-plt.bin \
|
||||
$(PKG_BUILD_DIR)/ti-connectivity/wl127x-fw-5-sr.bin \
|
||||
$(PKG_BUILD_DIR)/ti-connectivity/wl127x-nvs.bin \
|
||||
$(PKG_BUILD_DIR)/ti-connectivity/wl128x-fw-5-mr.bin \
|
||||
$(PKG_BUILD_DIR)/ti-connectivity/wl128x-fw-5-plt.bin \
|
||||
$(PKG_BUILD_DIR)/ti-connectivity/wl128x-fw-5-sr.bin \
|
||||
$(PKG_BUILD_DIR)/ti-connectivity/wl128x-nvs.bin \
|
||||
$(1)/lib/firmware/ti-connectivity
|
||||
ln -s wl127x-nvs.bin $(1)/lib/firmware/ti-connectivity/wl1271-nvs.bin
|
||||
endef
|
||||
$(eval $(call BuildPackage,wl12xx-firmware))
|
||||
|
||||
Package/wl18xx-firmware = $(call Package/firmware-default,TI WL18xx firmware,,LICENCE.ti-connectivity)
|
||||
define Package/wl18xx-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ti-connectivity/wl18xx-fw-4.bin \
|
||||
$(1)/lib/firmware/ti-connectivity
|
||||
endef
|
||||
$(eval $(call BuildPackage,wl18xx-firmware))
|
||||
|
||||
Package/ti-3410-firmware = $(call Package/firmware-default,TI 3410 firmware)
|
||||
define Package/ti-3410-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/ti_3410.fw $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,ti-3410-firmware))
|
||||
|
||||
Package/ti-5052-firmware = $(call Package/firmware-default,TI 5052 firmware)
|
||||
define Package/ti-5052-firmware/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/ti_5052.fw $(1)/lib/firmware
|
||||
endef
|
||||
$(eval $(call BuildPackage,ti-5052-firmware))
|
||||
@@ -0,0 +1,56 @@
|
||||
From 4c8a49854130da0117a0fdb858551824919a2389 Mon Sep 17 00:00:00 2001
|
||||
From: Ingo Molnar <mingo@kernel.org>
|
||||
Date: Tue, 27 Feb 2024 09:58:15 +0100
|
||||
Subject: [PATCH] smp: Avoid 'setup_max_cpus' namespace collision/shadowing
|
||||
|
||||
bringup_nonboot_cpus() gets passed the 'setup_max_cpus'
|
||||
variable in init/main.c - which is also the name of the parameter,
|
||||
shadowing the name.
|
||||
|
||||
To reduce confusion and to allow the 'setup_max_cpus' value
|
||||
to be #defined in the <linux/smp.h> header, use the 'max_cpus'
|
||||
name for the function parameter name.
|
||||
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: linux-kernel@vger.kernel.org
|
||||
---
|
||||
include/linux/cpu.h | 2 +-
|
||||
kernel/cpu.c | 6 +++---
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/include/linux/cpu.h
|
||||
+++ b/include/linux/cpu.h
|
||||
@@ -109,7 +109,7 @@ void notify_cpu_starting(unsigned int cp
|
||||
extern void cpu_maps_update_begin(void);
|
||||
extern void cpu_maps_update_done(void);
|
||||
int bringup_hibernate_cpu(unsigned int sleep_cpu);
|
||||
-void bringup_nonboot_cpus(unsigned int setup_max_cpus);
|
||||
+void bringup_nonboot_cpus(unsigned int max_cpus);
|
||||
|
||||
#else /* CONFIG_SMP */
|
||||
#define cpuhp_tasks_frozen 0
|
||||
--- a/kernel/cpu.c
|
||||
+++ b/kernel/cpu.c
|
||||
@@ -1905,17 +1905,17 @@ static bool __init cpuhp_bringup_cpus_pa
|
||||
static inline bool cpuhp_bringup_cpus_parallel(unsigned int ncpus) { return false; }
|
||||
#endif /* CONFIG_HOTPLUG_PARALLEL */
|
||||
|
||||
-void __init bringup_nonboot_cpus(unsigned int setup_max_cpus)
|
||||
+void __init bringup_nonboot_cpus(unsigned int max_cpus)
|
||||
{
|
||||
- if (!setup_max_cpus)
|
||||
+ if (!max_cpus)
|
||||
return;
|
||||
|
||||
/* Try parallel bringup optimization if enabled */
|
||||
- if (cpuhp_bringup_cpus_parallel(setup_max_cpus))
|
||||
+ if (cpuhp_bringup_cpus_parallel(max_cpus))
|
||||
return;
|
||||
|
||||
/* Full per CPU serialized bringup */
|
||||
- cpuhp_bringup_mask(cpu_present_mask, setup_max_cpus, CPUHP_ONLINE);
|
||||
+ cpuhp_bringup_mask(cpu_present_mask, max_cpus, CPUHP_ONLINE);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP_SMP
|
||||
@@ -0,0 +1,58 @@
|
||||
From 443df175be581618d6ff781dc3af3aa1a9ba789d Mon Sep 17 00:00:00 2001
|
||||
From: Tony Ambardar <Tony.Ambardar@gmail.com>
|
||||
Date: Fri, 31 May 2024 23:55:55 -0700
|
||||
Subject: [PATCH 1/2] compiler_types.h: Define __retain for
|
||||
__attribute__((__retain__))
|
||||
|
||||
Some code includes the __used macro to prevent functions and data from
|
||||
being optimized out. This macro implements __attribute__((__used__)), which
|
||||
operates at the compiler and IR-level, and so still allows a linker to
|
||||
remove objects intended to be kept.
|
||||
|
||||
Compilers supporting __attribute__((__retain__)) can address this gap by
|
||||
setting the flag SHF_GNU_RETAIN on the section of a function/variable,
|
||||
indicating to the linker the object should be retained. This attribute is
|
||||
available since gcc 11, clang 13, and binutils 2.36.
|
||||
|
||||
Provide a __retain macro implementing __attribute__((__retain__)), whose
|
||||
first user will be the '__bpf_kfunc' tag.
|
||||
|
||||
Link: https://lore.kernel.org/bpf/ZlmGoT9KiYLZd91S@krava/T/
|
||||
Cc: stable@vger.kernel.org # v6.6+
|
||||
Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
|
||||
---
|
||||
include/linux/compiler_types.h | 23 +++++++++++++++++++++++
|
||||
1 file changed, 23 insertions(+)
|
||||
|
||||
--- a/include/linux/compiler_types.h
|
||||
+++ b/include/linux/compiler_types.h
|
||||
@@ -145,6 +145,29 @@ static inline void __chk_io_ptr(const vo
|
||||
#define __has_builtin(x) (0)
|
||||
#endif
|
||||
|
||||
+/*
|
||||
+ * Annotating a function/variable with __retain tells the compiler to place
|
||||
+ * the object in its own section and set the flag SHF_GNU_RETAIN. This flag
|
||||
+ * instructs the linker to retain the object during garbage-cleanup or LTO
|
||||
+ * phases.
|
||||
+ *
|
||||
+ * Note that the __used macro is also used to prevent functions or data
|
||||
+ * being optimized out, but operates at the compiler/IR-level and may still
|
||||
+ * allow unintended removal of objects during linking.
|
||||
+ *
|
||||
+ * Optional: only supported since gcc >= 11, clang >= 13
|
||||
+ *
|
||||
+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-retain-function-attribute
|
||||
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#retain
|
||||
+ */
|
||||
+#if __has_attribute(__retain__) && \
|
||||
+ (defined(CONFIG_LD_DEAD_CODE_DATA_ELIMINATION) || \
|
||||
+ defined(CONFIG_LTO_CLANG))
|
||||
+# define __retain __attribute__((__retain__))
|
||||
+#else
|
||||
+# define __retain
|
||||
+#endif
|
||||
+
|
||||
/* Compiler specific macros. */
|
||||
#ifdef __clang__
|
||||
#include <linux/compiler-clang.h>
|
||||
@@ -0,0 +1,65 @@
|
||||
From ac507ed9882fd91a94657d68fe9ceac04b957103 Mon Sep 17 00:00:00 2001
|
||||
From: Tony Ambardar <Tony.Ambardar@gmail.com>
|
||||
Date: Sat, 1 Jun 2024 00:00:21 -0700
|
||||
Subject: [PATCH 2/2] bpf: Harden __bpf_kfunc tag against linker kfunc removal
|
||||
|
||||
BPF kfuncs are often not directly referenced and may be inadvertently
|
||||
removed by optimization steps during kernel builds, thus the __bpf_kfunc
|
||||
tag mitigates against this removal by including the __used macro. However,
|
||||
this macro alone does not prevent removal during linking, and may still
|
||||
yield build warnings (e.g. on mips64el):
|
||||
|
||||
LD vmlinux
|
||||
BTFIDS vmlinux
|
||||
WARN: resolve_btfids: unresolved symbol bpf_verify_pkcs7_signature
|
||||
WARN: resolve_btfids: unresolved symbol bpf_lookup_user_key
|
||||
WARN: resolve_btfids: unresolved symbol bpf_lookup_system_key
|
||||
WARN: resolve_btfids: unresolved symbol bpf_key_put
|
||||
WARN: resolve_btfids: unresolved symbol bpf_iter_task_next
|
||||
WARN: resolve_btfids: unresolved symbol bpf_iter_css_task_new
|
||||
WARN: resolve_btfids: unresolved symbol bpf_get_file_xattr
|
||||
WARN: resolve_btfids: unresolved symbol bpf_ct_insert_entry
|
||||
WARN: resolve_btfids: unresolved symbol bpf_cgroup_release
|
||||
WARN: resolve_btfids: unresolved symbol bpf_cgroup_from_id
|
||||
WARN: resolve_btfids: unresolved symbol bpf_cgroup_acquire
|
||||
WARN: resolve_btfids: unresolved symbol bpf_arena_free_pages
|
||||
NM System.map
|
||||
SORTTAB vmlinux
|
||||
OBJCOPY vmlinux.32
|
||||
|
||||
Update the __bpf_kfunc tag to better guard against linker optimization by
|
||||
including the new __retain compiler macro, which fixes the warnings above.
|
||||
|
||||
Verify the __retain macro with readelf by checking object flags for 'R':
|
||||
|
||||
$ readelf -Wa kernel/trace/bpf_trace.o
|
||||
Section Headers:
|
||||
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
|
||||
...
|
||||
[178] .text.bpf_key_put PROGBITS 00000000 6420 0050 00 AXR 0 0 8
|
||||
...
|
||||
Key to Flags:
|
||||
...
|
||||
R (retain), D (mbind), p (processor specific)
|
||||
|
||||
Link: https://lore.kernel.org/bpf/ZlmGoT9KiYLZd91S@krava/T/
|
||||
Reported-by: kernel test robot <lkp@intel.com>
|
||||
Closes: https://lore.kernel.org/r/202401211357.OCX9yllM-lkp@intel.com/
|
||||
Fixes: 57e7c169cd6a ("bpf: Add __bpf_kfunc tag for marking kernel functions as kfuncs")
|
||||
Cc: stable@vger.kernel.org # v6.6+
|
||||
Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
|
||||
---
|
||||
include/linux/btf.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/include/linux/btf.h
|
||||
+++ b/include/linux/btf.h
|
||||
@@ -81,7 +81,7 @@
|
||||
* as to avoid issues such as the compiler inlining or eliding either a static
|
||||
* kfunc, or a global kfunc in an LTO build.
|
||||
*/
|
||||
-#define __bpf_kfunc __used noinline
|
||||
+#define __bpf_kfunc __used __retain noinline
|
||||
|
||||
/*
|
||||
* Return the name of the passed struct, if exists, or halt the build if for
|
||||
@@ -0,0 +1,51 @@
|
||||
From 65033574ade97afccba074d837fd269903a83a9a Mon Sep 17 00:00:00 2001
|
||||
From: Catalin Marinas <catalin.marinas@arm.com>
|
||||
Date: Thu, 5 Oct 2023 16:40:30 +0100
|
||||
Subject: [PATCH] arm64: swiotlb: Reduce the default size if no ZONE_DMA
|
||||
bouncing needed
|
||||
|
||||
With CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC enabled, the arm64 kernel still
|
||||
allocates the default SWIOTLB buffer (64MB) even if ZONE_DMA is disabled
|
||||
or all the RAM fits into this zone. However, this potentially wastes a
|
||||
non-negligible amount of memory on platforms with little RAM.
|
||||
|
||||
Reduce the SWIOTLB size to 1MB per 1GB of RAM if only needed for
|
||||
kmalloc() buffer bouncing.
|
||||
|
||||
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
|
||||
Suggested-by: Ross Burton <ross.burton@arm.com>
|
||||
Cc: Ross Burton <ross.burton@arm.com>
|
||||
Cc: Will Deacon <will@kernel.org>
|
||||
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
|
||||
---
|
||||
arch/arm64/mm/init.c | 11 ++++++++++-
|
||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/mm/init.c
|
||||
+++ b/arch/arm64/mm/init.c
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <linux/nodemask.h>
|
||||
#include <linux/initrd.h>
|
||||
#include <linux/gfp.h>
|
||||
+#include <linux/math.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/sort.h>
|
||||
#include <linux/of.h>
|
||||
@@ -493,8 +494,16 @@ void __init mem_init(void)
|
||||
{
|
||||
bool swiotlb = max_pfn > PFN_DOWN(arm64_dma_phys_limit);
|
||||
|
||||
- if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC))
|
||||
+ if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC) && !swiotlb) {
|
||||
+ /*
|
||||
+ * If no bouncing needed for ZONE_DMA, reduce the swiotlb
|
||||
+ * buffer for kmalloc() bouncing to 1MB per 1GB of RAM.
|
||||
+ */
|
||||
+ unsigned long size =
|
||||
+ DIV_ROUND_UP(memblock_phys_mem_size(), 1024);
|
||||
+ swiotlb_adjust_size(min(swiotlb_size_or_default(), size));
|
||||
swiotlb = true;
|
||||
+ }
|
||||
|
||||
swiotlb_init(swiotlb, SWIOTLB_VERBOSE);
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
From 66a5c40f60f5d88ad8d47ba6a4ba05892853fa1f Mon Sep 17 00:00:00 2001
|
||||
From: Tanzir Hasan <tanzirh@google.com>
|
||||
Date: Tue, 26 Dec 2023 18:00:00 +0000
|
||||
Subject: [PATCH] kernel.h: removed REPEAT_BYTE from kernel.h
|
||||
|
||||
This patch creates wordpart.h and includes it in asm/word-at-a-time.h
|
||||
for all architectures. WORD_AT_A_TIME_CONSTANTS depends on kernel.h
|
||||
because of REPEAT_BYTE. Moving this to another header and including it
|
||||
where necessary allows us to not include the bloated kernel.h. Making
|
||||
this implicit dependency on REPEAT_BYTE explicit allows for later
|
||||
improvements in the lib/string.c inclusion list.
|
||||
|
||||
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
|
||||
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
|
||||
Signed-off-by: Tanzir Hasan <tanzirh@google.com>
|
||||
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
|
||||
Link: https://lore.kernel.org/r/20231226-libstringheader-v6-1-80aa08c7652c@google.com
|
||||
Signed-off-by: Kees Cook <keescook@chromium.org>
|
||||
---
|
||||
arch/arm/include/asm/word-at-a-time.h | 3 ++-
|
||||
arch/arm64/include/asm/word-at-a-time.h | 3 ++-
|
||||
arch/powerpc/include/asm/word-at-a-time.h | 4 ++--
|
||||
arch/riscv/include/asm/word-at-a-time.h | 3 ++-
|
||||
arch/s390/include/asm/word-at-a-time.h | 3 ++-
|
||||
arch/sh/include/asm/word-at-a-time.h | 2 ++
|
||||
arch/x86/include/asm/word-at-a-time.h | 3 ++-
|
||||
arch/x86/kvm/mmu/mmu.c | 1 +
|
||||
fs/namei.c | 2 +-
|
||||
include/asm-generic/word-at-a-time.h | 3 ++-
|
||||
include/linux/kernel.h | 8 --------
|
||||
include/linux/wordpart.h | 13 +++++++++++++
|
||||
12 files changed, 31 insertions(+), 17 deletions(-)
|
||||
create mode 100644 include/linux/wordpart.h
|
||||
|
||||
--- a/arch/arm/include/asm/word-at-a-time.h
|
||||
+++ b/arch/arm/include/asm/word-at-a-time.h
|
||||
@@ -8,7 +8,8 @@
|
||||
* Little-endian word-at-a-time zero byte handling.
|
||||
* Heavily based on the x86 algorithm.
|
||||
*/
|
||||
-#include <linux/kernel.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/wordpart.h>
|
||||
|
||||
struct word_at_a_time {
|
||||
const unsigned long one_bits, high_bits;
|
||||
--- a/arch/arm64/include/asm/word-at-a-time.h
|
||||
+++ b/arch/arm64/include/asm/word-at-a-time.h
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
#ifndef __AARCH64EB__
|
||||
|
||||
-#include <linux/kernel.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/wordpart.h>
|
||||
|
||||
struct word_at_a_time {
|
||||
const unsigned long one_bits, high_bits;
|
||||
--- a/arch/powerpc/include/asm/word-at-a-time.h
|
||||
+++ b/arch/powerpc/include/asm/word-at-a-time.h
|
||||
@@ -4,8 +4,8 @@
|
||||
/*
|
||||
* Word-at-a-time interfaces for PowerPC.
|
||||
*/
|
||||
-
|
||||
-#include <linux/kernel.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/wordpart.h>
|
||||
#include <asm/asm-compat.h>
|
||||
#include <asm/extable.h>
|
||||
|
||||
--- a/arch/sh/include/asm/word-at-a-time.h
|
||||
+++ b/arch/sh/include/asm/word-at-a-time.h
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
# include <asm-generic/word-at-a-time.h>
|
||||
#else
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/wordpart.h>
|
||||
/*
|
||||
* Little-endian version cribbed from x86.
|
||||
*/
|
||||
--- a/arch/x86/include/asm/word-at-a-time.h
|
||||
+++ b/arch/x86/include/asm/word-at-a-time.h
|
||||
@@ -2,7 +2,8 @@
|
||||
#ifndef _ASM_WORD_AT_A_TIME_H
|
||||
#define _ASM_WORD_AT_A_TIME_H
|
||||
|
||||
-#include <linux/kernel.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/wordpart.h>
|
||||
|
||||
/*
|
||||
* This is largely generic for little-endian machines, but the
|
||||
--- a/arch/x86/kvm/mmu/mmu.c
|
||||
+++ b/arch/x86/kvm/mmu/mmu.c
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <linux/kern_levels.h>
|
||||
#include <linux/kstrtox.h>
|
||||
#include <linux/kthread.h>
|
||||
+#include <linux/wordpart.h>
|
||||
|
||||
#include <asm/page.h>
|
||||
#include <asm/memtype.h>
|
||||
--- a/fs/namei.c
|
||||
+++ b/fs/namei.c
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/export.h>
|
||||
-#include <linux/kernel.h>
|
||||
#include <linux/slab.h>
|
||||
+#include <linux/wordpart.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/namei.h>
|
||||
--- a/include/asm-generic/word-at-a-time.h
|
||||
+++ b/include/asm-generic/word-at-a-time.h
|
||||
@@ -2,7 +2,8 @@
|
||||
#ifndef _ASM_WORD_AT_A_TIME_H
|
||||
#define _ASM_WORD_AT_A_TIME_H
|
||||
|
||||
-#include <linux/kernel.h>
|
||||
+#include <linux/bitops.h>
|
||||
+#include <linux/wordpart.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#ifdef __BIG_ENDIAN
|
||||
--- a/include/linux/kernel.h
|
||||
+++ b/include/linux/kernel.h
|
||||
@@ -38,14 +38,6 @@
|
||||
|
||||
#define STACK_MAGIC 0xdeadbeef
|
||||
|
||||
-/**
|
||||
- * REPEAT_BYTE - repeat the value @x multiple times as an unsigned long value
|
||||
- * @x: value to repeat
|
||||
- *
|
||||
- * NOTE: @x is not checked for > 0xff; larger values produce odd results.
|
||||
- */
|
||||
-#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
|
||||
-
|
||||
/* generic data direction definitions */
|
||||
#define READ 0
|
||||
#define WRITE 1
|
||||
--- /dev/null
|
||||
+++ b/include/linux/wordpart.h
|
||||
@@ -0,0 +1,13 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0 */
|
||||
+
|
||||
+#ifndef _LINUX_WORDPART_H
|
||||
+#define _LINUX_WORDPART_H
|
||||
+/**
|
||||
+ * REPEAT_BYTE - repeat the value @x multiple times as an unsigned long value
|
||||
+ * @x: value to repeat
|
||||
+ *
|
||||
+ * NOTE: @x is not checked for > 0xff; larger values produce odd results.
|
||||
+ */
|
||||
+#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
|
||||
+
|
||||
+#endif // _LINUX_WORDPART_H
|
||||
@@ -0,0 +1,107 @@
|
||||
From adeb04362d74188c1e22ccb824b15a0a7b3de2f4 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
Date: Wed, 14 Feb 2024 19:26:32 +0200
|
||||
Subject: [PATCH] kernel.h: Move upper_*_bits() and lower_*_bits() to
|
||||
wordpart.h
|
||||
|
||||
The wordpart.h header is collecting APIs related to the handling
|
||||
parts of the word (usually in byte granularity). The upper_*_bits()
|
||||
and lower_*_bits() are good candidates to be moved to there.
|
||||
|
||||
This helps to clean up header dependency hell with regard to kernel.h
|
||||
as the latter gathers completely unrelated stuff together and slows
|
||||
down compilation (especially when it's included into other header).
|
||||
|
||||
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
Link: https://lore.kernel.org/r/20240214172752.3605073-1-andriy.shevchenko@linux.intel.com
|
||||
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
|
||||
Signed-off-by: Kees Cook <keescook@chromium.org>
|
||||
---
|
||||
include/linux/kernel.h | 30 ++----------------------------
|
||||
include/linux/wordpart.h | 29 +++++++++++++++++++++++++++++
|
||||
2 files changed, 31 insertions(+), 28 deletions(-)
|
||||
|
||||
--- a/include/linux/kernel.h
|
||||
+++ b/include/linux/kernel.h
|
||||
@@ -32,6 +32,8 @@
|
||||
#include <linux/sprintf.h>
|
||||
#include <linux/static_call_types.h>
|
||||
#include <linux/instruction_pointer.h>
|
||||
+#include <linux/wordpart.h>
|
||||
+
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#include <uapi/linux/kernel.h>
|
||||
@@ -57,34 +59,6 @@
|
||||
} \
|
||||
)
|
||||
|
||||
-/**
|
||||
- * upper_32_bits - return bits 32-63 of a number
|
||||
- * @n: the number we're accessing
|
||||
- *
|
||||
- * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress
|
||||
- * the "right shift count >= width of type" warning when that quantity is
|
||||
- * 32-bits.
|
||||
- */
|
||||
-#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
|
||||
-
|
||||
-/**
|
||||
- * lower_32_bits - return bits 0-31 of a number
|
||||
- * @n: the number we're accessing
|
||||
- */
|
||||
-#define lower_32_bits(n) ((u32)((n) & 0xffffffff))
|
||||
-
|
||||
-/**
|
||||
- * upper_16_bits - return bits 16-31 of a number
|
||||
- * @n: the number we're accessing
|
||||
- */
|
||||
-#define upper_16_bits(n) ((u16)((n) >> 16))
|
||||
-
|
||||
-/**
|
||||
- * lower_16_bits - return bits 0-15 of a number
|
||||
- * @n: the number we're accessing
|
||||
- */
|
||||
-#define lower_16_bits(n) ((u16)((n) & 0xffff))
|
||||
-
|
||||
struct completion;
|
||||
struct user;
|
||||
|
||||
--- a/include/linux/wordpart.h
|
||||
+++ b/include/linux/wordpart.h
|
||||
@@ -2,6 +2,35 @@
|
||||
|
||||
#ifndef _LINUX_WORDPART_H
|
||||
#define _LINUX_WORDPART_H
|
||||
+
|
||||
+/**
|
||||
+ * upper_32_bits - return bits 32-63 of a number
|
||||
+ * @n: the number we're accessing
|
||||
+ *
|
||||
+ * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress
|
||||
+ * the "right shift count >= width of type" warning when that quantity is
|
||||
+ * 32-bits.
|
||||
+ */
|
||||
+#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
|
||||
+
|
||||
+/**
|
||||
+ * lower_32_bits - return bits 0-31 of a number
|
||||
+ * @n: the number we're accessing
|
||||
+ */
|
||||
+#define lower_32_bits(n) ((u32)((n) & 0xffffffff))
|
||||
+
|
||||
+/**
|
||||
+ * upper_16_bits - return bits 16-31 of a number
|
||||
+ * @n: the number we're accessing
|
||||
+ */
|
||||
+#define upper_16_bits(n) ((u16)((n) >> 16))
|
||||
+
|
||||
+/**
|
||||
+ * lower_16_bits - return bits 0-15 of a number
|
||||
+ * @n: the number we're accessing
|
||||
+ */
|
||||
+#define lower_16_bits(n) ((u16)((n) & 0xffff))
|
||||
+
|
||||
/**
|
||||
* REPEAT_BYTE - repeat the value @x multiple times as an unsigned long value
|
||||
* @x: value to repeat
|
||||
@@ -0,0 +1,206 @@
|
||||
From 8cd2accb71f5eb8e92d775fc1978d3779875c2e5 Mon Sep 17 00:00:00 2001
|
||||
From: Baoquan He <bhe@redhat.com>
|
||||
Date: Fri, 8 Dec 2023 15:30:34 +0800
|
||||
Subject: [PATCH] mips, kexec: fix the incorrect ifdeffery and dependency of
|
||||
CONFIG_KEXEC
|
||||
|
||||
The select of KEXEC for CRASH_DUMP in kernel/Kconfig.kexec will be
|
||||
dropped, then compiling errors will be triggered if below config items are
|
||||
set:
|
||||
|
||||
===
|
||||
CONFIG_CRASH_CORE=y
|
||||
CONFIG_KEXEC_CORE=y
|
||||
CONFIG_CRASH_DUMP=y
|
||||
===
|
||||
|
||||
--------------------------------------------------------------------
|
||||
mipsel-linux-ld: kernel/kexec_core.o: in function `kimage_free':
|
||||
kernel/kexec_core.c:(.text+0x2200): undefined reference to `machine_kexec_cleanup'
|
||||
mipsel-linux-ld: kernel/kexec_core.o: in function `__crash_kexec':
|
||||
kernel/kexec_core.c:(.text+0x2480): undefined reference to `machine_crash_shutdown'
|
||||
mipsel-linux-ld: kernel/kexec_core.c:(.text+0x2488): undefined reference to `machine_kexec'
|
||||
mipsel-linux-ld: kernel/kexec_core.o: in function `kernel_kexec':
|
||||
kernel/kexec_core.c:(.text+0x29b8): undefined reference to `machine_shutdown'
|
||||
mipsel-linux-ld: kernel/kexec_core.c:(.text+0x29c0): undefined reference to `machine_kexec'
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Here, change the dependency of building kexec_core related object files,
|
||||
and the ifdeffery in mips from CONFIG_KEXEC to CONFIG_KEXEC_CORE.
|
||||
|
||||
Link: https://lkml.kernel.org/r/20231208073036.7884-4-bhe@redhat.com
|
||||
Signed-off-by: Baoquan He <bhe@redhat.com>
|
||||
Reported-by: kernel test robot <lkp@intel.com>
|
||||
Closes: https://lore.kernel.org/oe-kbuild-all/202311302042.sn8cDPIX-lkp@intel.com/
|
||||
Cc: Eric DeVolder <eric_devolder@yahoo.com>
|
||||
Cc: Ignat Korchagin <ignat@cloudflare.com>
|
||||
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
|
||||
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
---
|
||||
arch/mips/cavium-octeon/smp.c | 4 ++--
|
||||
arch/mips/include/asm/kexec.h | 2 +-
|
||||
arch/mips/include/asm/smp-ops.h | 2 +-
|
||||
arch/mips/include/asm/smp.h | 2 +-
|
||||
arch/mips/kernel/Makefile | 2 +-
|
||||
arch/mips/kernel/smp-bmips.c | 4 ++--
|
||||
arch/mips/kernel/smp-cps.c | 10 +++++-----
|
||||
arch/mips/loongson64/reset.c | 4 ++--
|
||||
arch/mips/loongson64/smp.c | 2 +-
|
||||
9 files changed, 16 insertions(+), 16 deletions(-)
|
||||
|
||||
--- a/arch/mips/cavium-octeon/smp.c
|
||||
+++ b/arch/mips/cavium-octeon/smp.c
|
||||
@@ -422,7 +422,7 @@ static const struct plat_smp_ops octeon_
|
||||
.cpu_disable = octeon_cpu_disable,
|
||||
.cpu_die = octeon_cpu_die,
|
||||
#endif
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
.kexec_nonboot_cpu = kexec_nonboot_cpu_jump,
|
||||
#endif
|
||||
};
|
||||
@@ -502,7 +502,7 @@ static const struct plat_smp_ops octeon_
|
||||
.cpu_disable = octeon_cpu_disable,
|
||||
.cpu_die = octeon_cpu_die,
|
||||
#endif
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
.kexec_nonboot_cpu = kexec_nonboot_cpu_jump,
|
||||
#endif
|
||||
};
|
||||
--- a/arch/mips/include/asm/kexec.h
|
||||
+++ b/arch/mips/include/asm/kexec.h
|
||||
@@ -31,7 +31,7 @@ static inline void crash_setup_regs(stru
|
||||
prepare_frametrace(newregs);
|
||||
}
|
||||
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
struct kimage;
|
||||
extern unsigned long kexec_args[4];
|
||||
extern int (*_machine_kexec_prepare)(struct kimage *);
|
||||
--- a/arch/mips/include/asm/smp-ops.h
|
||||
+++ b/arch/mips/include/asm/smp-ops.h
|
||||
@@ -35,7 +35,7 @@ struct plat_smp_ops {
|
||||
void (*cpu_die)(unsigned int cpu);
|
||||
void (*cleanup_dead_cpu)(unsigned cpu);
|
||||
#endif
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
void (*kexec_nonboot_cpu)(void);
|
||||
#endif
|
||||
};
|
||||
--- a/arch/mips/include/asm/smp.h
|
||||
+++ b/arch/mips/include/asm/smp.h
|
||||
@@ -93,7 +93,7 @@ static inline void __cpu_die(unsigned in
|
||||
extern void __noreturn play_dead(void);
|
||||
#endif
|
||||
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
static inline void kexec_nonboot_cpu(void)
|
||||
{
|
||||
extern const struct plat_smp_ops *mp_ops; /* private */
|
||||
--- a/arch/mips/kernel/Makefile
|
||||
+++ b/arch/mips/kernel/Makefile
|
||||
@@ -90,7 +90,7 @@ obj-$(CONFIG_GPIO_TXX9) += gpio_txx9.o
|
||||
|
||||
obj-$(CONFIG_RELOCATABLE) += relocate.o
|
||||
|
||||
-obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o
|
||||
+obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o relocate_kernel.o crash.o
|
||||
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
|
||||
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
||||
obj-$(CONFIG_EARLY_PRINTK_8250) += early_printk_8250.o
|
||||
--- a/arch/mips/kernel/smp-bmips.c
|
||||
+++ b/arch/mips/kernel/smp-bmips.c
|
||||
@@ -434,7 +434,7 @@ const struct plat_smp_ops bmips43xx_smp_
|
||||
.cpu_disable = bmips_cpu_disable,
|
||||
.cpu_die = bmips_cpu_die,
|
||||
#endif
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
.kexec_nonboot_cpu = kexec_nonboot_cpu_jump,
|
||||
#endif
|
||||
};
|
||||
@@ -451,7 +451,7 @@ const struct plat_smp_ops bmips5000_smp_
|
||||
.cpu_disable = bmips_cpu_disable,
|
||||
.cpu_die = bmips_cpu_die,
|
||||
#endif
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
.kexec_nonboot_cpu = kexec_nonboot_cpu_jump,
|
||||
#endif
|
||||
};
|
||||
--- a/arch/mips/kernel/smp-cps.c
|
||||
+++ b/arch/mips/kernel/smp-cps.c
|
||||
@@ -395,7 +395,7 @@ static void cps_smp_finish(void)
|
||||
local_irq_enable();
|
||||
}
|
||||
|
||||
-#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_KEXEC)
|
||||
+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_KEXEC_CORE)
|
||||
|
||||
enum cpu_death {
|
||||
CPU_DEATH_HALT,
|
||||
@@ -432,7 +432,7 @@ static void cps_shutdown_this_cpu(enum c
|
||||
}
|
||||
}
|
||||
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
|
||||
static void cps_kexec_nonboot_cpu(void)
|
||||
{
|
||||
@@ -442,9 +442,9 @@ static void cps_kexec_nonboot_cpu(void)
|
||||
cps_shutdown_this_cpu(CPU_DEATH_POWER);
|
||||
}
|
||||
|
||||
-#endif /* CONFIG_KEXEC */
|
||||
+#endif /* CONFIG_KEXEC_CORE */
|
||||
|
||||
-#endif /* CONFIG_HOTPLUG_CPU || CONFIG_KEXEC */
|
||||
+#endif /* CONFIG_HOTPLUG_CPU || CONFIG_KEXEC_CORE */
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
|
||||
@@ -613,7 +613,7 @@ static const struct plat_smp_ops cps_smp
|
||||
.cpu_die = cps_cpu_die,
|
||||
.cleanup_dead_cpu = cps_cleanup_dead_cpu,
|
||||
#endif
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
.kexec_nonboot_cpu = cps_kexec_nonboot_cpu,
|
||||
#endif
|
||||
};
|
||||
--- a/arch/mips/loongson64/reset.c
|
||||
+++ b/arch/mips/loongson64/reset.c
|
||||
@@ -39,7 +39,7 @@ static int firmware_poweroff(struct sys_
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
|
||||
/* 0X80000000~0X80200000 is safe */
|
||||
#define MAX_ARGS 64
|
||||
@@ -152,7 +152,7 @@ static int __init mips_reboot_setup(void
|
||||
firmware_poweroff, NULL);
|
||||
}
|
||||
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
kexec_argv = kmalloc(KEXEC_ARGV_SIZE, GFP_KERNEL);
|
||||
if (WARN_ON(!kexec_argv))
|
||||
return -ENOMEM;
|
||||
--- a/arch/mips/loongson64/smp.c
|
||||
+++ b/arch/mips/loongson64/smp.c
|
||||
@@ -883,7 +883,7 @@ const struct plat_smp_ops loongson3_smp_
|
||||
.cpu_disable = loongson3_cpu_disable,
|
||||
.cpu_die = loongson3_cpu_die,
|
||||
#endif
|
||||
-#ifdef CONFIG_KEXEC
|
||||
+#ifdef CONFIG_KEXEC_CORE
|
||||
.kexec_nonboot_cpu = kexec_nonboot_cpu_jump,
|
||||
#endif
|
||||
};
|
||||
@@ -0,0 +1,171 @@
|
||||
From a5c05453a13ab324ad8719e8a23dfb6af01f3652 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 20 Jun 2024 17:26:42 +0200
|
||||
Subject: [PATCH 1/4] mips: bmips: rework and cache CBR addr handling
|
||||
|
||||
Rework the handling of the CBR address and cache it. This address
|
||||
doesn't change and can be cached instead of reading the register every
|
||||
time.
|
||||
|
||||
This is in preparation of permitting to tweak the CBR address in DT with
|
||||
broken SoC or bootloader.
|
||||
|
||||
bmips_cbr_addr is defined in setup.c for each arch to keep compatibility
|
||||
with legacy brcm47xx/brcm63xx and generic BMIPS target.
|
||||
|
||||
Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||
---
|
||||
arch/mips/bcm47xx/prom.c | 3 +++
|
||||
arch/mips/bcm47xx/setup.c | 4 ++++
|
||||
arch/mips/bcm63xx/prom.c | 3 +++
|
||||
arch/mips/bcm63xx/setup.c | 4 ++++
|
||||
arch/mips/bmips/dma.c | 2 +-
|
||||
arch/mips/bmips/setup.c | 7 ++++++-
|
||||
arch/mips/include/asm/bmips.h | 1 +
|
||||
arch/mips/kernel/smp-bmips.c | 4 ++--
|
||||
8 files changed, 24 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/arch/mips/bcm47xx/prom.c
|
||||
+++ b/arch/mips/bcm47xx/prom.c
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <linux/ssb/ssb_driver_chipcommon.h>
|
||||
#include <linux/ssb/ssb_regs.h>
|
||||
#include <linux/smp.h>
|
||||
+#include <asm/bmips.h>
|
||||
#include <asm/bootinfo.h>
|
||||
#include <bcm47xx.h>
|
||||
#include <bcm47xx_board.h>
|
||||
@@ -109,6 +110,8 @@ static __init void prom_init_mem(void)
|
||||
|
||||
void __init prom_init(void)
|
||||
{
|
||||
+ /* Cache CBR addr before CPU/DMA setup */
|
||||
+ bmips_cbr_addr = BMIPS_GET_CBR();
|
||||
prom_init_mem();
|
||||
setup_8250_early_printk_port(CKSEG1ADDR(BCM47XX_SERIAL_ADDR), 0, 0);
|
||||
}
|
||||
--- a/arch/mips/bcm47xx/setup.c
|
||||
+++ b/arch/mips/bcm47xx/setup.c
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <linux/ssb/ssb.h>
|
||||
#include <linux/ssb/ssb_embedded.h>
|
||||
#include <linux/bcma/bcma_soc.h>
|
||||
+#include <asm/bmips.h>
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/idle.h>
|
||||
#include <asm/prom.h>
|
||||
@@ -45,6 +46,9 @@
|
||||
#include <bcm47xx.h>
|
||||
#include <bcm47xx_board.h>
|
||||
|
||||
+/* CBR addr doesn't change and we can cache it */
|
||||
+void __iomem *bmips_cbr_addr __read_mostly;
|
||||
+
|
||||
union bcm47xx_bus bcm47xx_bus;
|
||||
EXPORT_SYMBOL(bcm47xx_bus);
|
||||
|
||||
--- a/arch/mips/bcm63xx/prom.c
|
||||
+++ b/arch/mips/bcm63xx/prom.c
|
||||
@@ -22,6 +22,9 @@ void __init prom_init(void)
|
||||
{
|
||||
u32 reg, mask;
|
||||
|
||||
+ /* Cache CBR addr before CPU/DMA setup */
|
||||
+ bmips_cbr_addr = BMIPS_GET_CBR();
|
||||
+
|
||||
bcm63xx_cpu_init();
|
||||
|
||||
/* stop any running watchdog */
|
||||
--- a/arch/mips/bcm63xx/setup.c
|
||||
+++ b/arch/mips/bcm63xx/setup.c
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/pm.h>
|
||||
+#include <asm/bmips.h>
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/time.h>
|
||||
#include <asm/reboot.h>
|
||||
@@ -22,6 +23,9 @@
|
||||
#include <bcm63xx_io.h>
|
||||
#include <bcm63xx_gpio.h>
|
||||
|
||||
+/* CBR addr doesn't change and we can cache it */
|
||||
+void __iomem *bmips_cbr_addr __read_mostly;
|
||||
+
|
||||
void bcm63xx_machine_halt(void)
|
||||
{
|
||||
pr_info("System halted\n");
|
||||
--- a/arch/mips/bmips/dma.c
|
||||
+++ b/arch/mips/bmips/dma.c
|
||||
@@ -9,7 +9,7 @@ bool bmips_rac_flush_disable;
|
||||
|
||||
void arch_sync_dma_for_cpu_all(void)
|
||||
{
|
||||
- void __iomem *cbr = BMIPS_GET_CBR();
|
||||
+ void __iomem *cbr = bmips_cbr_addr;
|
||||
u32 cfg;
|
||||
|
||||
if (boot_cpu_type() != CPU_BMIPS3300 &&
|
||||
--- a/arch/mips/bmips/setup.c
|
||||
+++ b/arch/mips/bmips/setup.c
|
||||
@@ -34,6 +34,9 @@
|
||||
#define REG_BCM6328_OTP ((void __iomem *)CKSEG1ADDR(0x1000062c))
|
||||
#define BCM6328_TP1_DISABLED BIT(9)
|
||||
|
||||
+/* CBR addr doesn't change and we can cache it */
|
||||
+void __iomem *bmips_cbr_addr __read_mostly;
|
||||
+
|
||||
extern bool bmips_rac_flush_disable;
|
||||
|
||||
static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000;
|
||||
@@ -111,7 +114,7 @@ static void bcm6358_quirks(void)
|
||||
* because the bootloader is not initializing it properly.
|
||||
*/
|
||||
bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31)) ||
|
||||
- !!BMIPS_GET_CBR();
|
||||
+ !!bmips_cbr_addr;
|
||||
}
|
||||
|
||||
static void bcm6368_quirks(void)
|
||||
@@ -144,6 +147,8 @@ static void __init bmips_init_cfe(void)
|
||||
|
||||
void __init prom_init(void)
|
||||
{
|
||||
+ /* Cache CBR addr before CPU/DMA setup */
|
||||
+ bmips_cbr_addr = BMIPS_GET_CBR();
|
||||
bmips_init_cfe();
|
||||
bmips_cpu_setup();
|
||||
register_bmips_smp_ops();
|
||||
--- a/arch/mips/include/asm/bmips.h
|
||||
+++ b/arch/mips/include/asm/bmips.h
|
||||
@@ -81,6 +81,7 @@ extern char bmips_smp_movevec[];
|
||||
extern char bmips_smp_int_vec[];
|
||||
extern char bmips_smp_int_vec_end[];
|
||||
|
||||
+extern void __iomem *bmips_cbr_addr;
|
||||
extern int bmips_smp_enabled;
|
||||
extern int bmips_cpu_offset;
|
||||
extern cpumask_t bmips_booted_mask;
|
||||
--- a/arch/mips/kernel/smp-bmips.c
|
||||
+++ b/arch/mips/kernel/smp-bmips.c
|
||||
@@ -518,7 +518,7 @@ static void bmips_set_reset_vec(int cpu,
|
||||
info.val = val;
|
||||
bmips_set_reset_vec_remote(&info);
|
||||
} else {
|
||||
- void __iomem *cbr = BMIPS_GET_CBR();
|
||||
+ void __iomem *cbr = bmips_cbr_addr;
|
||||
|
||||
if (cpu == 0)
|
||||
__raw_writel(val, cbr + BMIPS_RELO_VECTOR_CONTROL_0);
|
||||
@@ -591,7 +591,7 @@ asmlinkage void __weak plat_wired_tlb_se
|
||||
|
||||
void bmips_cpu_setup(void)
|
||||
{
|
||||
- void __iomem __maybe_unused *cbr = BMIPS_GET_CBR();
|
||||
+ void __iomem __maybe_unused *cbr = bmips_cbr_addr;
|
||||
u32 __maybe_unused cfg;
|
||||
|
||||
switch (current_cpu_type()) {
|
||||
@@ -0,0 +1,111 @@
|
||||
From b95b30e50aed225d26e20737873ae2404941901c Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 20 Jun 2024 17:26:44 +0200
|
||||
Subject: [PATCH 3/4] mips: bmips: setup: make CBR address configurable
|
||||
|
||||
Add support to provide CBR address from DT to handle broken
|
||||
SoC/Bootloader that doesn't correctly init it. This permits to use the
|
||||
RAC flush even in these condition.
|
||||
|
||||
To provide a CBR address from DT, the property "brcm,bmips-cbr-reg"
|
||||
needs to be set in the "cpus" node. On DT init, this property presence
|
||||
will be checked and will set the bmips_cbr_addr value accordingly. Also
|
||||
bmips_rac_flush_disable will be set to false as RAC flush can be
|
||||
correctly supported.
|
||||
|
||||
The CBR address from DT will overwrite the cached one and the
|
||||
one set in the CBR register will be ignored.
|
||||
|
||||
Also the DT CBR address is validated on being outside DRAM window.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
||||
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||
---
|
||||
arch/mips/bcm47xx/setup.c | 6 +++++-
|
||||
arch/mips/bcm63xx/setup.c | 6 +++++-
|
||||
arch/mips/bmips/setup.c | 30 ++++++++++++++++++++++++++++--
|
||||
3 files changed, 38 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/arch/mips/bcm47xx/setup.c
|
||||
+++ b/arch/mips/bcm47xx/setup.c
|
||||
@@ -46,7 +46,11 @@
|
||||
#include <bcm47xx.h>
|
||||
#include <bcm47xx_board.h>
|
||||
|
||||
-/* CBR addr doesn't change and we can cache it */
|
||||
+/*
|
||||
+ * CBR addr doesn't change and we can cache it.
|
||||
+ * For broken SoC/Bootloader CBR addr might also be provided via DT
|
||||
+ * with "brcm,bmips-cbr-reg" in the "cpus" node.
|
||||
+ */
|
||||
void __iomem *bmips_cbr_addr __read_mostly;
|
||||
|
||||
union bcm47xx_bus bcm47xx_bus;
|
||||
--- a/arch/mips/bcm63xx/setup.c
|
||||
+++ b/arch/mips/bcm63xx/setup.c
|
||||
@@ -23,7 +23,11 @@
|
||||
#include <bcm63xx_io.h>
|
||||
#include <bcm63xx_gpio.h>
|
||||
|
||||
-/* CBR addr doesn't change and we can cache it */
|
||||
+/*
|
||||
+ * CBR addr doesn't change and we can cache it.
|
||||
+ * For broken SoC/Bootloader CBR addr might also be provided via DT
|
||||
+ * with "brcm,bmips-cbr-reg" in the "cpus" node.
|
||||
+ */
|
||||
void __iomem *bmips_cbr_addr __read_mostly;
|
||||
|
||||
void bcm63xx_machine_halt(void)
|
||||
--- a/arch/mips/bmips/setup.c
|
||||
+++ b/arch/mips/bmips/setup.c
|
||||
@@ -34,7 +34,11 @@
|
||||
#define REG_BCM6328_OTP ((void __iomem *)CKSEG1ADDR(0x1000062c))
|
||||
#define BCM6328_TP1_DISABLED BIT(9)
|
||||
|
||||
-/* CBR addr doesn't change and we can cache it */
|
||||
+/*
|
||||
+ * CBR addr doesn't change and we can cache it.
|
||||
+ * For broken SoC/Bootloader CBR addr might also be provided via DT
|
||||
+ * with "brcm,bmips-cbr-reg" in the "cpus" node.
|
||||
+ */
|
||||
void __iomem *bmips_cbr_addr __read_mostly;
|
||||
|
||||
extern bool bmips_rac_flush_disable;
|
||||
@@ -208,13 +212,35 @@ void __init plat_mem_setup(void)
|
||||
void __init device_tree_init(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
+ u32 addr;
|
||||
|
||||
unflatten_and_copy_device_tree();
|
||||
|
||||
/* Disable SMP boot unless both CPUs are listed in DT and !disabled */
|
||||
np = of_find_node_by_name(NULL, "cpus");
|
||||
- if (np && of_get_available_child_count(np) <= 1)
|
||||
+ if (!np)
|
||||
+ return;
|
||||
+
|
||||
+ if (of_get_available_child_count(np) <= 1)
|
||||
bmips_smp_enabled = 0;
|
||||
+
|
||||
+ /* Check if DT provide a CBR address */
|
||||
+ if (of_property_read_u32(np, "brcm,bmips-cbr-reg", &addr))
|
||||
+ goto exit;
|
||||
+
|
||||
+ /* Make sure CBR address is outside DRAM window */
|
||||
+ if (addr >= (u32)memblock_start_of_DRAM() &&
|
||||
+ addr < (u32)memblock_end_of_DRAM()) {
|
||||
+ WARN(1, "DT CBR %x inside DRAM window. Ignoring DT CBR.\n",
|
||||
+ addr);
|
||||
+ goto exit;
|
||||
+ }
|
||||
+
|
||||
+ bmips_cbr_addr = (void __iomem *)addr;
|
||||
+ /* Since CBR is provided by DT, enable RAC flush */
|
||||
+ bmips_rac_flush_disable = false;
|
||||
+
|
||||
+exit:
|
||||
of_node_put(np);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
From 04f38d1a4db017f17e82442727b91ce03dd72759 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= <dgcbueu@gmail.com>
|
||||
Date: Thu, 20 Jun 2024 17:26:45 +0200
|
||||
Subject: [PATCH 4/4] mips: bmips: enable RAC on BMIPS4350
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The data RAC is left disabled by the bootloader in some SoCs, at least in
|
||||
the core it boots from.
|
||||
Enabling this feature increases the performance up to +30% depending on the
|
||||
task.
|
||||
|
||||
Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
|
||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
[ rework code and reduce code duplication ]
|
||||
Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||
---
|
||||
arch/mips/kernel/smp-bmips.c | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
--- a/arch/mips/kernel/smp-bmips.c
|
||||
+++ b/arch/mips/kernel/smp-bmips.c
|
||||
@@ -592,6 +592,7 @@ asmlinkage void __weak plat_wired_tlb_se
|
||||
void bmips_cpu_setup(void)
|
||||
{
|
||||
void __iomem __maybe_unused *cbr = bmips_cbr_addr;
|
||||
+ u32 __maybe_unused rac_addr;
|
||||
u32 __maybe_unused cfg;
|
||||
|
||||
switch (current_cpu_type()) {
|
||||
@@ -620,6 +621,23 @@ void bmips_cpu_setup(void)
|
||||
__raw_readl(cbr + BMIPS_RAC_ADDRESS_RANGE);
|
||||
break;
|
||||
|
||||
+ case CPU_BMIPS4350:
|
||||
+ rac_addr = BMIPS_RAC_CONFIG_1;
|
||||
+
|
||||
+ if (!(read_c0_brcm_cmt_local() & (1 << 31)))
|
||||
+ rac_addr = BMIPS_RAC_CONFIG;
|
||||
+
|
||||
+ /* Enable data RAC */
|
||||
+ cfg = __raw_readl(cbr + rac_addr);
|
||||
+ __raw_writel(cfg | 0xf, cbr + rac_addr);
|
||||
+ __raw_readl(cbr + rac_addr);
|
||||
+
|
||||
+ /* Flush stale data out of the readahead cache */
|
||||
+ cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
|
||||
+ __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
|
||||
+ __raw_readl(cbr + BMIPS_RAC_CONFIG);
|
||||
+ break;
|
||||
+
|
||||
case CPU_BMIPS4380:
|
||||
/* CBG workaround for early BMIPS4380 CPUs */
|
||||
switch (read_c0_prid()) {
|
||||
@@ -0,0 +1,36 @@
|
||||
From 8e7daa85641c9559c113f6b217bdc923397de77c Mon Sep 17 00:00:00 2001
|
||||
From: William Zhang <william.zhang@broadcom.com>
|
||||
Date: Thu, 22 Feb 2024 19:47:58 -0800
|
||||
Subject: [PATCH] mtd: rawnand: brcmnand: Support write protection setting from
|
||||
dts
|
||||
|
||||
The write protection feature is controlled by the module parameter wp_on
|
||||
with default set to enabled. But not all the board use this feature
|
||||
especially in BCMBCA broadband board. And module parameter is not
|
||||
sufficient as different board can have different option. Add a device
|
||||
tree property and allow this feature to be configured through the board
|
||||
dts on per board basis.
|
||||
|
||||
Signed-off-by: William Zhang <william.zhang@broadcom.com>
|
||||
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
||||
Reviewed-by: Kamal Dasu <kamal.dasu@broadcom.com>
|
||||
Reviewed-by: David Regan <dregan@broadcom.com>
|
||||
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
Link: https://lore.kernel.org/linux-mtd/20240223034758.13753-14-william.zhang@broadcom.com
|
||||
---
|
||||
drivers/mtd/nand/raw/brcmnand/brcmnand.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
|
||||
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
|
||||
@@ -3194,6 +3194,10 @@ int brcmnand_probe(struct platform_devic
|
||||
/* Disable XOR addressing */
|
||||
brcmnand_rmw_reg(ctrl, BRCMNAND_CS_XOR, 0xff, 0, 0);
|
||||
|
||||
+ /* Check if the board connects the WP pin */
|
||||
+ if (of_property_read_bool(dn, "brcm,wp-not-connected"))
|
||||
+ wp_on = 0;
|
||||
+
|
||||
if (ctrl->features & BRCMNAND_HAS_WP) {
|
||||
/* Permanently disable write protection */
|
||||
if (wp_on == 2)
|
||||
@@ -0,0 +1,123 @@
|
||||
From 25d88bfd35bac3196eafa666e3b05033b46ffa21 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Tue, 19 Dec 2023 02:32:00 +0000
|
||||
Subject: [PATCH 1/8] dt-bindings: mtd: add basic bindings for UBI
|
||||
|
||||
Add basic bindings for UBI devices and volumes.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Rob Herring <robh@kernel.org>
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
---
|
||||
.../bindings/mtd/partitions/linux,ubi.yaml | 65 +++++++++++++++++++
|
||||
.../bindings/mtd/partitions/ubi-volume.yaml | 35 ++++++++++
|
||||
2 files changed, 100 insertions(+)
|
||||
create mode 100644 Documentation/devicetree/bindings/mtd/partitions/linux,ubi.yaml
|
||||
create mode 100644 Documentation/devicetree/bindings/mtd/partitions/ubi-volume.yaml
|
||||
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/mtd/partitions/linux,ubi.yaml
|
||||
@@ -0,0 +1,65 @@
|
||||
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
||||
+%YAML 1.2
|
||||
+---
|
||||
+$id: http://devicetree.org/schemas/mtd/partitions/linux,ubi.yaml#
|
||||
+$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
+
|
||||
+title: Unsorted Block Images
|
||||
+
|
||||
+description: |
|
||||
+ UBI ("Unsorted Block Images") is a volume management system for raw
|
||||
+ flash devices which manages multiple logical volumes on a single
|
||||
+ physical flash device and spreads the I/O load (i.e wear-leveling)
|
||||
+ across the whole flash chip.
|
||||
+
|
||||
+maintainers:
|
||||
+ - Daniel Golle <daniel@makrotopia.org>
|
||||
+
|
||||
+allOf:
|
||||
+ - $ref: partition.yaml#
|
||||
+
|
||||
+properties:
|
||||
+ compatible:
|
||||
+ const: linux,ubi
|
||||
+
|
||||
+ volumes:
|
||||
+ type: object
|
||||
+ description: UBI Volumes
|
||||
+
|
||||
+ patternProperties:
|
||||
+ "^ubi-volume-.*$":
|
||||
+ $ref: /schemas/mtd/partitions/ubi-volume.yaml#
|
||||
+
|
||||
+ unevaluatedProperties: false
|
||||
+
|
||||
+required:
|
||||
+ - compatible
|
||||
+
|
||||
+unevaluatedProperties: false
|
||||
+
|
||||
+examples:
|
||||
+ - |
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ reg = <0x0 0x100000>;
|
||||
+ label = "bootloader";
|
||||
+ read-only;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ reg = <0x100000 0x1ff00000>;
|
||||
+ label = "ubi";
|
||||
+ compatible = "linux,ubi";
|
||||
+
|
||||
+ volumes {
|
||||
+ ubi-volume-caldata {
|
||||
+ volid = <2>;
|
||||
+ volname = "rf";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/mtd/partitions/ubi-volume.yaml
|
||||
@@ -0,0 +1,35 @@
|
||||
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
||||
+%YAML 1.2
|
||||
+---
|
||||
+$id: http://devicetree.org/schemas/mtd/partitions/ubi-volume.yaml#
|
||||
+$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
+
|
||||
+title: UBI volume
|
||||
+
|
||||
+description: |
|
||||
+ This binding describes a single UBI volume. Volumes can be matches either
|
||||
+ by their ID or their name, or both.
|
||||
+
|
||||
+maintainers:
|
||||
+ - Daniel Golle <daniel@makrotopia.org>
|
||||
+
|
||||
+properties:
|
||||
+ volid:
|
||||
+ $ref: /schemas/types.yaml#/definitions/uint32
|
||||
+ description:
|
||||
+ Match UBI volume ID
|
||||
+
|
||||
+ volname:
|
||||
+ $ref: /schemas/types.yaml#/definitions/string
|
||||
+ description:
|
||||
+ Match UBI volume ID
|
||||
+
|
||||
+anyOf:
|
||||
+ - required:
|
||||
+ - volid
|
||||
+
|
||||
+ - required:
|
||||
+ - volname
|
||||
+
|
||||
+# This is a generic file other binding inherit from and extend
|
||||
+additionalProperties: true
|
||||
@@ -0,0 +1,50 @@
|
||||
From 95b113222b5164ac0887eb5c514ff3970a0136f0 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Tue, 19 Dec 2023 02:32:11 +0000
|
||||
Subject: [PATCH 2/8] dt-bindings: mtd: ubi-volume: allow UBI volumes to
|
||||
provide NVMEM
|
||||
|
||||
UBI volumes may be used to contain NVMEM bits, typically device MAC
|
||||
addresses or wireless radio calibration data.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Rob Herring <robh@kernel.org>
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
---
|
||||
.../devicetree/bindings/mtd/partitions/linux,ubi.yaml | 10 ++++++++++
|
||||
.../devicetree/bindings/mtd/partitions/ubi-volume.yaml | 5 +++++
|
||||
2 files changed, 15 insertions(+)
|
||||
|
||||
--- a/Documentation/devicetree/bindings/mtd/partitions/linux,ubi.yaml
|
||||
+++ b/Documentation/devicetree/bindings/mtd/partitions/linux,ubi.yaml
|
||||
@@ -59,6 +59,16 @@ examples:
|
||||
ubi-volume-caldata {
|
||||
volid = <2>;
|
||||
volname = "rf";
|
||||
+
|
||||
+ nvmem-layout {
|
||||
+ compatible = "fixed-layout";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ eeprom@0 {
|
||||
+ reg = <0x0 0x1000>;
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
};
|
||||
};
|
||||
--- a/Documentation/devicetree/bindings/mtd/partitions/ubi-volume.yaml
|
||||
+++ b/Documentation/devicetree/bindings/mtd/partitions/ubi-volume.yaml
|
||||
@@ -24,6 +24,11 @@ properties:
|
||||
description:
|
||||
Match UBI volume ID
|
||||
|
||||
+ nvmem-layout:
|
||||
+ $ref: /schemas/nvmem/layouts/nvmem-layout.yaml#
|
||||
+ description:
|
||||
+ This container may reference an NVMEM layout parser.
|
||||
+
|
||||
anyOf:
|
||||
- required:
|
||||
- volid
|
||||
@@ -0,0 +1,285 @@
|
||||
From 2bba1cdcfcd2907d0696cc0139f1bd078d36ee81 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Tue, 19 Dec 2023 02:32:35 +0000
|
||||
Subject: [PATCH 3/8] mtd: ubi: block: use notifier to create ubiblock from
|
||||
parameter
|
||||
|
||||
Use UBI_VOLUME_ADDED notification to create ubiblock device specified
|
||||
on kernel cmdline or module parameter.
|
||||
This makes thing more simple and has the advantage that ubiblock devices
|
||||
on volumes which are not present at the time the ubi module is probed
|
||||
will still be created.
|
||||
|
||||
Suggested-by: Zhihao Cheng <chengzhihao1@huawei.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
---
|
||||
drivers/mtd/ubi/block.c | 136 ++++++++++++++++++++--------------------
|
||||
drivers/mtd/ubi/kapi.c | 54 +++++++++++-----
|
||||
drivers/mtd/ubi/ubi.h | 1 +
|
||||
3 files changed, 106 insertions(+), 85 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/ubi/block.c
|
||||
+++ b/drivers/mtd/ubi/block.c
|
||||
@@ -65,10 +65,10 @@ struct ubiblock_pdu {
|
||||
};
|
||||
|
||||
/* Numbers of elements set in the @ubiblock_param array */
|
||||
-static int ubiblock_devs __initdata;
|
||||
+static int ubiblock_devs;
|
||||
|
||||
/* MTD devices specification parameters */
|
||||
-static struct ubiblock_param ubiblock_param[UBIBLOCK_MAX_DEVICES] __initdata;
|
||||
+static struct ubiblock_param ubiblock_param[UBIBLOCK_MAX_DEVICES];
|
||||
|
||||
struct ubiblock {
|
||||
struct ubi_volume_desc *desc;
|
||||
@@ -532,6 +532,70 @@ static int ubiblock_resize(struct ubi_vo
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static bool
|
||||
+match_volume_desc(struct ubi_volume_info *vi, const char *name, int ubi_num, int vol_id)
|
||||
+{
|
||||
+ int err, len, cur_ubi_num, cur_vol_id;
|
||||
+
|
||||
+ if (ubi_num == -1) {
|
||||
+ /* No ubi num, name must be a vol device path */
|
||||
+ err = ubi_get_num_by_path(name, &cur_ubi_num, &cur_vol_id);
|
||||
+ if (err || vi->ubi_num != cur_ubi_num || vi->vol_id != cur_vol_id)
|
||||
+ return false;
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ if (vol_id == -1) {
|
||||
+ /* Got ubi_num, but no vol_id, name must be volume name */
|
||||
+ if (vi->ubi_num != ubi_num)
|
||||
+ return false;
|
||||
+
|
||||
+ len = strnlen(name, UBI_VOL_NAME_MAX + 1);
|
||||
+ if (len < 1 || vi->name_len != len)
|
||||
+ return false;
|
||||
+
|
||||
+ if (strcmp(name, vi->name))
|
||||
+ return false;
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ if (vi->ubi_num != ubi_num)
|
||||
+ return false;
|
||||
+
|
||||
+ if (vi->vol_id != vol_id)
|
||||
+ return false;
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+ubiblock_create_from_param(struct ubi_volume_info *vi)
|
||||
+{
|
||||
+ int i, ret = 0;
|
||||
+ struct ubiblock_param *p;
|
||||
+
|
||||
+ /*
|
||||
+ * Iterate over ubiblock cmdline parameters. If a parameter matches the
|
||||
+ * newly added volume create the ubiblock device for it.
|
||||
+ */
|
||||
+ for (i = 0; i < ubiblock_devs; i++) {
|
||||
+ p = &ubiblock_param[i];
|
||||
+
|
||||
+ if (!match_volume_desc(vi, p->name, p->ubi_num, p->vol_id))
|
||||
+ continue;
|
||||
+
|
||||
+ ret = ubiblock_create(vi);
|
||||
+ if (ret) {
|
||||
+ pr_err(
|
||||
+ "UBI: block: can't add '%s' volume on ubi%d_%d, err=%d\n",
|
||||
+ vi->name, p->ubi_num, p->vol_id, ret);
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int ubiblock_notify(struct notifier_block *nb,
|
||||
unsigned long notification_type, void *ns_ptr)
|
||||
{
|
||||
@@ -539,10 +603,7 @@ static int ubiblock_notify(struct notifi
|
||||
|
||||
switch (notification_type) {
|
||||
case UBI_VOLUME_ADDED:
|
||||
- /*
|
||||
- * We want to enforce explicit block device creation for
|
||||
- * volumes, so when a volume is added we do nothing.
|
||||
- */
|
||||
+ ubiblock_create_from_param(&nt->vi);
|
||||
break;
|
||||
case UBI_VOLUME_REMOVED:
|
||||
ubiblock_remove(&nt->vi);
|
||||
@@ -568,56 +629,6 @@ static struct notifier_block ubiblock_no
|
||||
.notifier_call = ubiblock_notify,
|
||||
};
|
||||
|
||||
-static struct ubi_volume_desc * __init
|
||||
-open_volume_desc(const char *name, int ubi_num, int vol_id)
|
||||
-{
|
||||
- if (ubi_num == -1)
|
||||
- /* No ubi num, name must be a vol device path */
|
||||
- return ubi_open_volume_path(name, UBI_READONLY);
|
||||
- else if (vol_id == -1)
|
||||
- /* No vol_id, must be vol_name */
|
||||
- return ubi_open_volume_nm(ubi_num, name, UBI_READONLY);
|
||||
- else
|
||||
- return ubi_open_volume(ubi_num, vol_id, UBI_READONLY);
|
||||
-}
|
||||
-
|
||||
-static void __init ubiblock_create_from_param(void)
|
||||
-{
|
||||
- int i, ret = 0;
|
||||
- struct ubiblock_param *p;
|
||||
- struct ubi_volume_desc *desc;
|
||||
- struct ubi_volume_info vi;
|
||||
-
|
||||
- /*
|
||||
- * If there is an error creating one of the ubiblocks, continue on to
|
||||
- * create the following ubiblocks. This helps in a circumstance where
|
||||
- * the kernel command-line specifies multiple block devices and some
|
||||
- * may be broken, but we still want the working ones to come up.
|
||||
- */
|
||||
- for (i = 0; i < ubiblock_devs; i++) {
|
||||
- p = &ubiblock_param[i];
|
||||
-
|
||||
- desc = open_volume_desc(p->name, p->ubi_num, p->vol_id);
|
||||
- if (IS_ERR(desc)) {
|
||||
- pr_err(
|
||||
- "UBI: block: can't open volume on ubi%d_%d, err=%ld\n",
|
||||
- p->ubi_num, p->vol_id, PTR_ERR(desc));
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- ubi_get_volume_info(desc, &vi);
|
||||
- ubi_close_volume(desc);
|
||||
-
|
||||
- ret = ubiblock_create(&vi);
|
||||
- if (ret) {
|
||||
- pr_err(
|
||||
- "UBI: block: can't add '%s' volume on ubi%d_%d, err=%d\n",
|
||||
- vi.name, p->ubi_num, p->vol_id, ret);
|
||||
- continue;
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static void ubiblock_remove_all(void)
|
||||
{
|
||||
struct ubiblock *next;
|
||||
@@ -643,18 +654,7 @@ int __init ubiblock_init(void)
|
||||
if (ubiblock_major < 0)
|
||||
return ubiblock_major;
|
||||
|
||||
- /*
|
||||
- * Attach block devices from 'block=' module param.
|
||||
- * Even if one block device in the param list fails to come up,
|
||||
- * still allow the module to load and leave any others up.
|
||||
- */
|
||||
- ubiblock_create_from_param();
|
||||
-
|
||||
- /*
|
||||
- * Block devices are only created upon user requests, so we ignore
|
||||
- * existing volumes.
|
||||
- */
|
||||
- ret = ubi_register_volume_notifier(&ubiblock_notifier, 1);
|
||||
+ ret = ubi_register_volume_notifier(&ubiblock_notifier, 0);
|
||||
if (ret)
|
||||
goto err_unreg;
|
||||
return 0;
|
||||
--- a/drivers/mtd/ubi/kapi.c
|
||||
+++ b/drivers/mtd/ubi/kapi.c
|
||||
@@ -280,6 +280,41 @@ struct ubi_volume_desc *ubi_open_volume_
|
||||
EXPORT_SYMBOL_GPL(ubi_open_volume_nm);
|
||||
|
||||
/**
|
||||
+ * ubi_get_num_by_path - get UBI device and volume number from device path
|
||||
+ * @pathname: volume character device node path
|
||||
+ * @ubi_num: pointer to UBI device number to be set
|
||||
+ * @vol_id: pointer to UBI volume ID to be set
|
||||
+ *
|
||||
+ * Returns 0 on success and sets ubi_num and vol_id, returns error otherwise.
|
||||
+ */
|
||||
+int ubi_get_num_by_path(const char *pathname, int *ubi_num, int *vol_id)
|
||||
+{
|
||||
+ int error;
|
||||
+ struct path path;
|
||||
+ struct kstat stat;
|
||||
+
|
||||
+ error = kern_path(pathname, LOOKUP_FOLLOW, &path);
|
||||
+ if (error)
|
||||
+ return error;
|
||||
+
|
||||
+ error = vfs_getattr(&path, &stat, STATX_TYPE, AT_STATX_SYNC_AS_STAT);
|
||||
+ path_put(&path);
|
||||
+ if (error)
|
||||
+ return error;
|
||||
+
|
||||
+ if (!S_ISCHR(stat.mode))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ *ubi_num = ubi_major2num(MAJOR(stat.rdev));
|
||||
+ *vol_id = MINOR(stat.rdev) - 1;
|
||||
+
|
||||
+ if (*vol_id < 0 || *ubi_num < 0)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* ubi_open_volume_path - open UBI volume by its character device node path.
|
||||
* @pathname: volume character device node path
|
||||
* @mode: open mode
|
||||
@@ -290,32 +325,17 @@ EXPORT_SYMBOL_GPL(ubi_open_volume_nm);
|
||||
struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode)
|
||||
{
|
||||
int error, ubi_num, vol_id;
|
||||
- struct path path;
|
||||
- struct kstat stat;
|
||||
|
||||
dbg_gen("open volume %s, mode %d", pathname, mode);
|
||||
|
||||
if (!pathname || !*pathname)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
- error = kern_path(pathname, LOOKUP_FOLLOW, &path);
|
||||
- if (error)
|
||||
- return ERR_PTR(error);
|
||||
-
|
||||
- error = vfs_getattr(&path, &stat, STATX_TYPE, AT_STATX_SYNC_AS_STAT);
|
||||
- path_put(&path);
|
||||
+ error = ubi_get_num_by_path(pathname, &ubi_num, &vol_id);
|
||||
if (error)
|
||||
return ERR_PTR(error);
|
||||
|
||||
- if (!S_ISCHR(stat.mode))
|
||||
- return ERR_PTR(-EINVAL);
|
||||
-
|
||||
- ubi_num = ubi_major2num(MAJOR(stat.rdev));
|
||||
- vol_id = MINOR(stat.rdev) - 1;
|
||||
-
|
||||
- if (vol_id >= 0 && ubi_num >= 0)
|
||||
- return ubi_open_volume(ubi_num, vol_id, mode);
|
||||
- return ERR_PTR(-ENODEV);
|
||||
+ return ubi_open_volume(ubi_num, vol_id, mode);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ubi_open_volume_path);
|
||||
|
||||
--- a/drivers/mtd/ubi/ubi.h
|
||||
+++ b/drivers/mtd/ubi/ubi.h
|
||||
@@ -956,6 +956,7 @@ void ubi_free_internal_volumes(struct ub
|
||||
void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di);
|
||||
void ubi_do_get_volume_info(struct ubi_device *ubi, struct ubi_volume *vol,
|
||||
struct ubi_volume_info *vi);
|
||||
+int ubi_get_num_by_path(const char *pathname, int *ubi_num, int *vol_id);
|
||||
/* scan.c */
|
||||
int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb,
|
||||
int pnum, const struct ubi_vid_hdr *vid_hdr);
|
||||
@@ -0,0 +1,205 @@
|
||||
From 6e331888643887ce85657527bc03f97d46235e71 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Tue, 19 Dec 2023 02:33:14 +0000
|
||||
Subject: [PATCH 4/8] mtd: ubi: attach from device tree
|
||||
|
||||
Introduce device tree compatible 'linux,ubi' and attach compatible MTD
|
||||
devices using the MTD add notifier. This is needed for a UBI device to
|
||||
be available early at boot (and not only after late_initcall), so
|
||||
volumes on them can be used eg. as NVMEM providers for other drivers.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
---
|
||||
drivers/mtd/ubi/build.c | 135 ++++++++++++++++++++++++++++------------
|
||||
1 file changed, 96 insertions(+), 39 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/ubi/build.c
|
||||
+++ b/drivers/mtd/ubi/build.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <linux/log2.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/kernel.h>
|
||||
+#include <linux/of.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/major.h>
|
||||
#include "ubi.h"
|
||||
@@ -1214,43 +1215,43 @@ static struct mtd_info * __init open_mtd
|
||||
return mtd;
|
||||
}
|
||||
|
||||
-static int __init ubi_init(void)
|
||||
+static void ubi_notify_add(struct mtd_info *mtd)
|
||||
{
|
||||
- int err, i, k;
|
||||
+ struct device_node *np = mtd_get_of_node(mtd);
|
||||
+ int err;
|
||||
|
||||
- /* Ensure that EC and VID headers have correct size */
|
||||
- BUILD_BUG_ON(sizeof(struct ubi_ec_hdr) != 64);
|
||||
- BUILD_BUG_ON(sizeof(struct ubi_vid_hdr) != 64);
|
||||
+ if (!of_device_is_compatible(np, "linux,ubi"))
|
||||
+ return;
|
||||
|
||||
- if (mtd_devs > UBI_MAX_DEVICES) {
|
||||
- pr_err("UBI error: too many MTD devices, maximum is %d\n",
|
||||
- UBI_MAX_DEVICES);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
+ /*
|
||||
+ * we are already holding &mtd_table_mutex, but still need
|
||||
+ * to bump refcount
|
||||
+ */
|
||||
+ err = __get_mtd_device(mtd);
|
||||
+ if (err)
|
||||
+ return;
|
||||
|
||||
- /* Create base sysfs directory and sysfs files */
|
||||
- err = class_register(&ubi_class);
|
||||
+ /* called while holding mtd_table_mutex */
|
||||
+ mutex_lock_nested(&ubi_devices_mutex, SINGLE_DEPTH_NESTING);
|
||||
+ err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0, false);
|
||||
+ mutex_unlock(&ubi_devices_mutex);
|
||||
if (err < 0)
|
||||
- return err;
|
||||
-
|
||||
- err = misc_register(&ubi_ctrl_cdev);
|
||||
- if (err) {
|
||||
- pr_err("UBI error: cannot register device\n");
|
||||
- goto out;
|
||||
- }
|
||||
+ __put_mtd_device(mtd);
|
||||
+}
|
||||
|
||||
- ubi_wl_entry_slab = kmem_cache_create("ubi_wl_entry_slab",
|
||||
- sizeof(struct ubi_wl_entry),
|
||||
- 0, 0, NULL);
|
||||
- if (!ubi_wl_entry_slab) {
|
||||
- err = -ENOMEM;
|
||||
- goto out_dev_unreg;
|
||||
- }
|
||||
+static void ubi_notify_remove(struct mtd_info *mtd)
|
||||
+{
|
||||
+ /* do nothing for now */
|
||||
+}
|
||||
|
||||
- err = ubi_debugfs_init();
|
||||
- if (err)
|
||||
- goto out_slab;
|
||||
+static struct mtd_notifier ubi_mtd_notifier = {
|
||||
+ .add = ubi_notify_add,
|
||||
+ .remove = ubi_notify_remove,
|
||||
+};
|
||||
|
||||
+static int __init ubi_init_attach(void)
|
||||
+{
|
||||
+ int err, i, k;
|
||||
|
||||
/* Attach MTD devices */
|
||||
for (i = 0; i < mtd_devs; i++) {
|
||||
@@ -1298,25 +1299,79 @@ static int __init ubi_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
+ return 0;
|
||||
+
|
||||
+out_detach:
|
||||
+ for (k = 0; k < i; k++)
|
||||
+ if (ubi_devices[k]) {
|
||||
+ mutex_lock(&ubi_devices_mutex);
|
||||
+ ubi_detach_mtd_dev(ubi_devices[k]->ubi_num, 1);
|
||||
+ mutex_unlock(&ubi_devices_mutex);
|
||||
+ }
|
||||
+ return err;
|
||||
+}
|
||||
+#ifndef CONFIG_MTD_UBI_MODULE
|
||||
+late_initcall(ubi_init_attach);
|
||||
+#endif
|
||||
+
|
||||
+static int __init ubi_init(void)
|
||||
+{
|
||||
+ int err;
|
||||
+
|
||||
+ /* Ensure that EC and VID headers have correct size */
|
||||
+ BUILD_BUG_ON(sizeof(struct ubi_ec_hdr) != 64);
|
||||
+ BUILD_BUG_ON(sizeof(struct ubi_vid_hdr) != 64);
|
||||
+
|
||||
+ if (mtd_devs > UBI_MAX_DEVICES) {
|
||||
+ pr_err("UBI error: too many MTD devices, maximum is %d\n",
|
||||
+ UBI_MAX_DEVICES);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ /* Create base sysfs directory and sysfs files */
|
||||
+ err = class_register(&ubi_class);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+
|
||||
+ err = misc_register(&ubi_ctrl_cdev);
|
||||
+ if (err) {
|
||||
+ pr_err("UBI error: cannot register device\n");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ ubi_wl_entry_slab = kmem_cache_create("ubi_wl_entry_slab",
|
||||
+ sizeof(struct ubi_wl_entry),
|
||||
+ 0, 0, NULL);
|
||||
+ if (!ubi_wl_entry_slab) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto out_dev_unreg;
|
||||
+ }
|
||||
+
|
||||
+ err = ubi_debugfs_init();
|
||||
+ if (err)
|
||||
+ goto out_slab;
|
||||
+
|
||||
err = ubiblock_init();
|
||||
if (err) {
|
||||
pr_err("UBI error: block: cannot initialize, error %d\n", err);
|
||||
|
||||
/* See comment above re-ubi_is_module(). */
|
||||
if (ubi_is_module())
|
||||
- goto out_detach;
|
||||
+ goto out_slab;
|
||||
+ }
|
||||
+
|
||||
+ register_mtd_user(&ubi_mtd_notifier);
|
||||
+
|
||||
+ if (ubi_is_module()) {
|
||||
+ err = ubi_init_attach();
|
||||
+ if (err)
|
||||
+ goto out_mtd_notifier;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
-out_detach:
|
||||
- for (k = 0; k < i; k++)
|
||||
- if (ubi_devices[k]) {
|
||||
- mutex_lock(&ubi_devices_mutex);
|
||||
- ubi_detach_mtd_dev(ubi_devices[k]->ubi_num, 1);
|
||||
- mutex_unlock(&ubi_devices_mutex);
|
||||
- }
|
||||
- ubi_debugfs_exit();
|
||||
+out_mtd_notifier:
|
||||
+ unregister_mtd_user(&ubi_mtd_notifier);
|
||||
out_slab:
|
||||
kmem_cache_destroy(ubi_wl_entry_slab);
|
||||
out_dev_unreg:
|
||||
@@ -1326,13 +1381,15 @@ out:
|
||||
pr_err("UBI error: cannot initialize UBI, error %d\n", err);
|
||||
return err;
|
||||
}
|
||||
-late_initcall(ubi_init);
|
||||
+device_initcall(ubi_init);
|
||||
+
|
||||
|
||||
static void __exit ubi_exit(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
ubiblock_exit();
|
||||
+ unregister_mtd_user(&ubi_mtd_notifier);
|
||||
|
||||
for (i = 0; i < UBI_MAX_DEVICES; i++)
|
||||
if (ubi_devices[i]) {
|
||||
@@ -0,0 +1,180 @@
|
||||
From 924731fbed3247e3b82b8ab17db587ee28c2e781 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Tue, 19 Dec 2023 02:33:24 +0000
|
||||
Subject: [PATCH 5/8] mtd: ubi: introduce pre-removal notification for UBI
|
||||
volumes
|
||||
|
||||
Introduce a new notification type UBI_VOLUME_SHUTDOWN to inform users
|
||||
that a volume is just about to be removed.
|
||||
This is needed because users (such as the NVMEM subsystem) expect that
|
||||
at the time their removal function is called, the parenting device is
|
||||
still available (for removal of sysfs nodes, for example, in case of
|
||||
NVMEM which otherwise WARNs on volume removal).
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
---
|
||||
drivers/mtd/ubi/build.c | 19 ++++++++++++++-----
|
||||
drivers/mtd/ubi/kapi.c | 2 +-
|
||||
drivers/mtd/ubi/ubi.h | 2 ++
|
||||
drivers/mtd/ubi/vmt.c | 17 +++++++++++++++--
|
||||
include/linux/mtd/ubi.h | 2 ++
|
||||
5 files changed, 34 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/mtd/ubi/build.c
|
||||
+++ b/drivers/mtd/ubi/build.c
|
||||
@@ -91,7 +91,7 @@ static struct ubi_device *ubi_devices[UB
|
||||
/* Serializes UBI devices creations and removals */
|
||||
DEFINE_MUTEX(ubi_devices_mutex);
|
||||
|
||||
-/* Protects @ubi_devices and @ubi->ref_count */
|
||||
+/* Protects @ubi_devices, @ubi->ref_count and @ubi->is_dead */
|
||||
static DEFINE_SPINLOCK(ubi_devices_lock);
|
||||
|
||||
/* "Show" method for files in '/<sysfs>/class/ubi/' */
|
||||
@@ -259,6 +259,9 @@ struct ubi_device *ubi_get_device(int ub
|
||||
|
||||
spin_lock(&ubi_devices_lock);
|
||||
ubi = ubi_devices[ubi_num];
|
||||
+ if (ubi && ubi->is_dead)
|
||||
+ ubi = NULL;
|
||||
+
|
||||
if (ubi) {
|
||||
ubi_assert(ubi->ref_count >= 0);
|
||||
ubi->ref_count += 1;
|
||||
@@ -296,7 +299,7 @@ struct ubi_device *ubi_get_by_major(int
|
||||
spin_lock(&ubi_devices_lock);
|
||||
for (i = 0; i < UBI_MAX_DEVICES; i++) {
|
||||
ubi = ubi_devices[i];
|
||||
- if (ubi && MAJOR(ubi->cdev.dev) == major) {
|
||||
+ if (ubi && !ubi->is_dead && MAJOR(ubi->cdev.dev) == major) {
|
||||
ubi_assert(ubi->ref_count >= 0);
|
||||
ubi->ref_count += 1;
|
||||
get_device(&ubi->dev);
|
||||
@@ -325,7 +328,7 @@ int ubi_major2num(int major)
|
||||
for (i = 0; i < UBI_MAX_DEVICES; i++) {
|
||||
struct ubi_device *ubi = ubi_devices[i];
|
||||
|
||||
- if (ubi && MAJOR(ubi->cdev.dev) == major) {
|
||||
+ if (ubi && !ubi->is_dead && MAJOR(ubi->cdev.dev) == major) {
|
||||
ubi_num = ubi->ubi_num;
|
||||
break;
|
||||
}
|
||||
@@ -512,7 +515,7 @@ static void ubi_free_volumes_from(struct
|
||||
int i;
|
||||
|
||||
for (i = from; i < ubi->vtbl_slots + UBI_INT_VOL_COUNT; i++) {
|
||||
- if (!ubi->volumes[i])
|
||||
+ if (!ubi->volumes[i] || ubi->volumes[i]->is_dead)
|
||||
continue;
|
||||
ubi_eba_replace_table(ubi->volumes[i], NULL);
|
||||
ubi_fastmap_destroy_checkmap(ubi->volumes[i]);
|
||||
@@ -1094,7 +1097,6 @@ int ubi_detach_mtd_dev(int ubi_num, int
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock(&ubi_devices_lock);
|
||||
- put_device(&ubi->dev);
|
||||
ubi->ref_count -= 1;
|
||||
if (ubi->ref_count) {
|
||||
if (!anyway) {
|
||||
@@ -1105,6 +1107,13 @@ int ubi_detach_mtd_dev(int ubi_num, int
|
||||
ubi_err(ubi, "%s reference count %d, destroy anyway",
|
||||
ubi->ubi_name, ubi->ref_count);
|
||||
}
|
||||
+ ubi->is_dead = true;
|
||||
+ spin_unlock(&ubi_devices_lock);
|
||||
+
|
||||
+ ubi_notify_all(ubi, UBI_VOLUME_SHUTDOWN, NULL);
|
||||
+
|
||||
+ spin_lock(&ubi_devices_lock);
|
||||
+ put_device(&ubi->dev);
|
||||
ubi_devices[ubi_num] = NULL;
|
||||
spin_unlock(&ubi_devices_lock);
|
||||
|
||||
--- a/drivers/mtd/ubi/kapi.c
|
||||
+++ b/drivers/mtd/ubi/kapi.c
|
||||
@@ -152,7 +152,7 @@ struct ubi_volume_desc *ubi_open_volume(
|
||||
|
||||
spin_lock(&ubi->volumes_lock);
|
||||
vol = ubi->volumes[vol_id];
|
||||
- if (!vol)
|
||||
+ if (!vol || vol->is_dead)
|
||||
goto out_unlock;
|
||||
|
||||
err = -EBUSY;
|
||||
--- a/drivers/mtd/ubi/ubi.h
|
||||
+++ b/drivers/mtd/ubi/ubi.h
|
||||
@@ -345,6 +345,7 @@ struct ubi_volume {
|
||||
int writers;
|
||||
int exclusive;
|
||||
int metaonly;
|
||||
+ bool is_dead;
|
||||
|
||||
int reserved_pebs;
|
||||
int vol_type;
|
||||
@@ -564,6 +565,7 @@ struct ubi_device {
|
||||
spinlock_t volumes_lock;
|
||||
int ref_count;
|
||||
int image_seq;
|
||||
+ bool is_dead;
|
||||
|
||||
int rsvd_pebs;
|
||||
int avail_pebs;
|
||||
--- a/drivers/mtd/ubi/vmt.c
|
||||
+++ b/drivers/mtd/ubi/vmt.c
|
||||
@@ -59,7 +59,7 @@ static ssize_t vol_attribute_show(struct
|
||||
struct ubi_device *ubi = vol->ubi;
|
||||
|
||||
spin_lock(&ubi->volumes_lock);
|
||||
- if (!ubi->volumes[vol->vol_id]) {
|
||||
+ if (!ubi->volumes[vol->vol_id] || ubi->volumes[vol->vol_id]->is_dead) {
|
||||
spin_unlock(&ubi->volumes_lock);
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ int ubi_create_volume(struct ubi_device
|
||||
|
||||
/* Ensure that the name is unique */
|
||||
for (i = 0; i < ubi->vtbl_slots; i++)
|
||||
- if (ubi->volumes[i] &&
|
||||
+ if (ubi->volumes[i] && !ubi->volumes[i]->is_dead &&
|
||||
ubi->volumes[i]->name_len == req->name_len &&
|
||||
!strcmp(ubi->volumes[i]->name, req->name)) {
|
||||
ubi_err(ubi, "volume \"%s\" exists (ID %d)",
|
||||
@@ -352,6 +352,19 @@ int ubi_remove_volume(struct ubi_volume_
|
||||
err = -EBUSY;
|
||||
goto out_unlock;
|
||||
}
|
||||
+
|
||||
+ /*
|
||||
+ * Mark volume as dead at this point to prevent that anyone
|
||||
+ * can take a reference to the volume from now on.
|
||||
+ * This is necessary as we have to release the spinlock before
|
||||
+ * calling ubi_volume_notify.
|
||||
+ */
|
||||
+ vol->is_dead = true;
|
||||
+ spin_unlock(&ubi->volumes_lock);
|
||||
+
|
||||
+ ubi_volume_notify(ubi, vol, UBI_VOLUME_SHUTDOWN);
|
||||
+
|
||||
+ spin_lock(&ubi->volumes_lock);
|
||||
ubi->volumes[vol_id] = NULL;
|
||||
spin_unlock(&ubi->volumes_lock);
|
||||
|
||||
--- a/include/linux/mtd/ubi.h
|
||||
+++ b/include/linux/mtd/ubi.h
|
||||
@@ -192,6 +192,7 @@ struct ubi_device_info {
|
||||
* or a volume was removed)
|
||||
* @UBI_VOLUME_RESIZED: a volume has been re-sized
|
||||
* @UBI_VOLUME_RENAMED: a volume has been re-named
|
||||
+ * @UBI_VOLUME_SHUTDOWN: a volume is going to removed, shutdown users
|
||||
* @UBI_VOLUME_UPDATED: data has been written to a volume
|
||||
*
|
||||
* These constants define which type of event has happened when a volume
|
||||
@@ -202,6 +203,7 @@ enum {
|
||||
UBI_VOLUME_REMOVED,
|
||||
UBI_VOLUME_RESIZED,
|
||||
UBI_VOLUME_RENAMED,
|
||||
+ UBI_VOLUME_SHUTDOWN,
|
||||
UBI_VOLUME_UPDATED,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
From 1c54542170819e36baa43c17ca55bb3d7da89a53 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Tue, 19 Dec 2023 02:33:38 +0000
|
||||
Subject: [PATCH 6/8] mtd: ubi: populate ubi volume fwnode
|
||||
|
||||
Look for the 'volumes' subnode of an MTD partition attached to a UBI
|
||||
device and attach matching child nodes to UBI volumes.
|
||||
This allows UBI volumes to be referenced in device tree, e.g. for use
|
||||
as NVMEM providers.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
---
|
||||
drivers/mtd/ubi/vmt.c | 27 +++++++++++++++++++++++++++
|
||||
1 file changed, 27 insertions(+)
|
||||
|
||||
--- a/drivers/mtd/ubi/vmt.c
|
||||
+++ b/drivers/mtd/ubi/vmt.c
|
||||
@@ -124,6 +124,31 @@ static void vol_release(struct device *d
|
||||
kfree(vol);
|
||||
}
|
||||
|
||||
+static struct fwnode_handle *find_volume_fwnode(struct ubi_volume *vol)
|
||||
+{
|
||||
+ struct fwnode_handle *fw_vols, *fw_vol;
|
||||
+ const char *volname;
|
||||
+ u32 volid;
|
||||
+
|
||||
+ fw_vols = device_get_named_child_node(vol->dev.parent->parent, "volumes");
|
||||
+ if (!fw_vols)
|
||||
+ return NULL;
|
||||
+
|
||||
+ fwnode_for_each_child_node(fw_vols, fw_vol) {
|
||||
+ if (!fwnode_property_read_string(fw_vol, "volname", &volname) &&
|
||||
+ strncmp(volname, vol->name, vol->name_len))
|
||||
+ continue;
|
||||
+
|
||||
+ if (!fwnode_property_read_u32(fw_vol, "volid", &volid) &&
|
||||
+ vol->vol_id != volid)
|
||||
+ continue;
|
||||
+
|
||||
+ return fw_vol;
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* ubi_create_volume - create volume.
|
||||
* @ubi: UBI device description object
|
||||
@@ -223,6 +248,7 @@ int ubi_create_volume(struct ubi_device
|
||||
vol->name_len = req->name_len;
|
||||
memcpy(vol->name, req->name, vol->name_len);
|
||||
vol->ubi = ubi;
|
||||
+ device_set_node(&vol->dev, find_volume_fwnode(vol));
|
||||
|
||||
/*
|
||||
* Finish all pending erases because there may be some LEBs belonging
|
||||
@@ -605,6 +631,7 @@ int ubi_add_volume(struct ubi_device *ub
|
||||
vol->dev.class = &ubi_class;
|
||||
vol->dev.groups = volume_dev_groups;
|
||||
dev_set_name(&vol->dev, "%s_%d", ubi->ubi_name, vol->vol_id);
|
||||
+ device_set_node(&vol->dev, find_volume_fwnode(vol));
|
||||
err = device_register(&vol->dev);
|
||||
if (err) {
|
||||
cdev_del(&vol->cdev);
|
||||
@@ -0,0 +1,244 @@
|
||||
From 15fc7dc926c91c871f6c0305b2938dbdeb14203b Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Tue, 19 Dec 2023 02:33:48 +0000
|
||||
Subject: [PATCH 7/8] mtd: ubi: provide NVMEM layer over UBI volumes
|
||||
|
||||
In an ideal world we would like UBI to be used where ever possible on a
|
||||
NAND chip. And with UBI support in ARM Trusted Firmware and U-Boot it
|
||||
is possible to achieve an (almost-)all-UBI flash layout. Hence the need
|
||||
for a way to also use UBI volumes to store board-level constants, such
|
||||
as MAC addresses and calibration data of wireless interfaces.
|
||||
|
||||
Add UBI volume NVMEM driver module exposing UBI volumes as NVMEM
|
||||
providers. Allow UBI devices to have a "volumes" firmware subnode with
|
||||
volumes which may be compatible with "nvmem-cells".
|
||||
Access to UBI volumes via the NVMEM interface at this point is
|
||||
read-only, and it is slow, opening and closing the UBI volume for each
|
||||
access due to limitations of the NVMEM provider API.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
---
|
||||
drivers/mtd/ubi/Kconfig | 12 +++
|
||||
drivers/mtd/ubi/Makefile | 1 +
|
||||
drivers/mtd/ubi/nvmem.c | 188 +++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 201 insertions(+)
|
||||
create mode 100644 drivers/mtd/ubi/nvmem.c
|
||||
|
||||
--- a/drivers/mtd/ubi/Kconfig
|
||||
+++ b/drivers/mtd/ubi/Kconfig
|
||||
@@ -104,4 +104,16 @@ config MTD_UBI_BLOCK
|
||||
|
||||
If in doubt, say "N".
|
||||
|
||||
+config MTD_UBI_NVMEM
|
||||
+ tristate "UBI virtual NVMEM"
|
||||
+ default n
|
||||
+ depends on NVMEM
|
||||
+ help
|
||||
+ This option enabled an additional driver exposing UBI volumes as NVMEM
|
||||
+ providers, intended for platforms where UBI is part of the firmware
|
||||
+ specification and used to store also e.g. MAC addresses or board-
|
||||
+ specific Wi-Fi calibration data.
|
||||
+
|
||||
+ If in doubt, say "N".
|
||||
+
|
||||
endif # MTD_UBI
|
||||
--- a/drivers/mtd/ubi/Makefile
|
||||
+++ b/drivers/mtd/ubi/Makefile
|
||||
@@ -7,3 +7,4 @@ ubi-$(CONFIG_MTD_UBI_FASTMAP) += fastmap
|
||||
ubi-$(CONFIG_MTD_UBI_BLOCK) += block.o
|
||||
|
||||
obj-$(CONFIG_MTD_UBI_GLUEBI) += gluebi.o
|
||||
+obj-$(CONFIG_MTD_UBI_NVMEM) += nvmem.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/mtd/ubi/nvmem.c
|
||||
@@ -0,0 +1,188 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
+/*
|
||||
+ * Copyright (c) 2023 Daniel Golle <daniel@makrotopia.org>
|
||||
+ */
|
||||
+
|
||||
+/* UBI NVMEM provider */
|
||||
+#include "ubi.h"
|
||||
+#include <linux/nvmem-provider.h>
|
||||
+#include <asm/div64.h>
|
||||
+
|
||||
+/* List of all NVMEM devices */
|
||||
+static LIST_HEAD(nvmem_devices);
|
||||
+static DEFINE_MUTEX(devices_mutex);
|
||||
+
|
||||
+struct ubi_nvmem {
|
||||
+ struct nvmem_device *nvmem;
|
||||
+ int ubi_num;
|
||||
+ int vol_id;
|
||||
+ int usable_leb_size;
|
||||
+ struct list_head list;
|
||||
+};
|
||||
+
|
||||
+static int ubi_nvmem_reg_read(void *priv, unsigned int from,
|
||||
+ void *val, size_t bytes)
|
||||
+{
|
||||
+ int err = 0, lnum = from, offs, bytes_left = bytes, to_read;
|
||||
+ struct ubi_nvmem *unv = priv;
|
||||
+ struct ubi_volume_desc *desc;
|
||||
+
|
||||
+ desc = ubi_open_volume(unv->ubi_num, unv->vol_id, UBI_READONLY);
|
||||
+ if (IS_ERR(desc))
|
||||
+ return PTR_ERR(desc);
|
||||
+
|
||||
+ offs = do_div(lnum, unv->usable_leb_size);
|
||||
+ while (bytes_left) {
|
||||
+ to_read = unv->usable_leb_size - offs;
|
||||
+
|
||||
+ if (to_read > bytes_left)
|
||||
+ to_read = bytes_left;
|
||||
+
|
||||
+ err = ubi_read(desc, lnum, val, offs, to_read);
|
||||
+ if (err)
|
||||
+ break;
|
||||
+
|
||||
+ lnum += 1;
|
||||
+ offs = 0;
|
||||
+ bytes_left -= to_read;
|
||||
+ val += to_read;
|
||||
+ }
|
||||
+ ubi_close_volume(desc);
|
||||
+
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ return bytes_left == 0 ? 0 : -EIO;
|
||||
+}
|
||||
+
|
||||
+static int ubi_nvmem_add(struct ubi_volume_info *vi)
|
||||
+{
|
||||
+ struct device_node *np = dev_of_node(vi->dev);
|
||||
+ struct nvmem_config config = {};
|
||||
+ struct ubi_nvmem *unv;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!np)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (!of_get_child_by_name(np, "nvmem-layout"))
|
||||
+ return 0;
|
||||
+
|
||||
+ if (WARN_ON_ONCE(vi->usable_leb_size <= 0) ||
|
||||
+ WARN_ON_ONCE(vi->size <= 0))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ unv = kzalloc(sizeof(struct ubi_nvmem), GFP_KERNEL);
|
||||
+ if (!unv)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ config.id = NVMEM_DEVID_NONE;
|
||||
+ config.dev = vi->dev;
|
||||
+ config.name = dev_name(vi->dev);
|
||||
+ config.owner = THIS_MODULE;
|
||||
+ config.priv = unv;
|
||||
+ config.reg_read = ubi_nvmem_reg_read;
|
||||
+ config.size = vi->usable_leb_size * vi->size;
|
||||
+ config.word_size = 1;
|
||||
+ config.stride = 1;
|
||||
+ config.read_only = true;
|
||||
+ config.root_only = true;
|
||||
+ config.ignore_wp = true;
|
||||
+ config.of_node = np;
|
||||
+
|
||||
+ unv->ubi_num = vi->ubi_num;
|
||||
+ unv->vol_id = vi->vol_id;
|
||||
+ unv->usable_leb_size = vi->usable_leb_size;
|
||||
+ unv->nvmem = nvmem_register(&config);
|
||||
+ if (IS_ERR(unv->nvmem)) {
|
||||
+ ret = dev_err_probe(vi->dev, PTR_ERR(unv->nvmem),
|
||||
+ "Failed to register NVMEM device\n");
|
||||
+ kfree(unv);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ mutex_lock(&devices_mutex);
|
||||
+ list_add_tail(&unv->list, &nvmem_devices);
|
||||
+ mutex_unlock(&devices_mutex);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void ubi_nvmem_remove(struct ubi_volume_info *vi)
|
||||
+{
|
||||
+ struct ubi_nvmem *unv_c, *unv = NULL;
|
||||
+
|
||||
+ mutex_lock(&devices_mutex);
|
||||
+ list_for_each_entry(unv_c, &nvmem_devices, list)
|
||||
+ if (unv_c->ubi_num == vi->ubi_num && unv_c->vol_id == vi->vol_id) {
|
||||
+ unv = unv_c;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (!unv) {
|
||||
+ mutex_unlock(&devices_mutex);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ list_del(&unv->list);
|
||||
+ mutex_unlock(&devices_mutex);
|
||||
+ nvmem_unregister(unv->nvmem);
|
||||
+ kfree(unv);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * nvmem_notify - UBI notification handler.
|
||||
+ * @nb: registered notifier block
|
||||
+ * @l: notification type
|
||||
+ * @ns_ptr: pointer to the &struct ubi_notification object
|
||||
+ */
|
||||
+static int nvmem_notify(struct notifier_block *nb, unsigned long l,
|
||||
+ void *ns_ptr)
|
||||
+{
|
||||
+ struct ubi_notification *nt = ns_ptr;
|
||||
+
|
||||
+ switch (l) {
|
||||
+ case UBI_VOLUME_RESIZED:
|
||||
+ ubi_nvmem_remove(&nt->vi);
|
||||
+ fallthrough;
|
||||
+ case UBI_VOLUME_ADDED:
|
||||
+ ubi_nvmem_add(&nt->vi);
|
||||
+ break;
|
||||
+ case UBI_VOLUME_SHUTDOWN:
|
||||
+ ubi_nvmem_remove(&nt->vi);
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+ return NOTIFY_OK;
|
||||
+}
|
||||
+
|
||||
+static struct notifier_block nvmem_notifier = {
|
||||
+ .notifier_call = nvmem_notify,
|
||||
+};
|
||||
+
|
||||
+static int __init ubi_nvmem_init(void)
|
||||
+{
|
||||
+ return ubi_register_volume_notifier(&nvmem_notifier, 0);
|
||||
+}
|
||||
+
|
||||
+static void __exit ubi_nvmem_exit(void)
|
||||
+{
|
||||
+ struct ubi_nvmem *unv, *tmp;
|
||||
+
|
||||
+ mutex_lock(&devices_mutex);
|
||||
+ list_for_each_entry_safe(unv, tmp, &nvmem_devices, list) {
|
||||
+ nvmem_unregister(unv->nvmem);
|
||||
+ list_del(&unv->list);
|
||||
+ kfree(unv);
|
||||
+ }
|
||||
+ mutex_unlock(&devices_mutex);
|
||||
+
|
||||
+ ubi_unregister_volume_notifier(&nvmem_notifier);
|
||||
+}
|
||||
+
|
||||
+module_init(ubi_nvmem_init);
|
||||
+module_exit(ubi_nvmem_exit);
|
||||
+MODULE_DESCRIPTION("NVMEM layer over UBI volumes");
|
||||
+MODULE_AUTHOR("Daniel Golle");
|
||||
+MODULE_LICENSE("GPL");
|
||||
@@ -0,0 +1,34 @@
|
||||
From 04231c61dcd51db0f12061e49bb761b197109f2f Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Thu, 29 Feb 2024 03:47:24 +0000
|
||||
Subject: [PATCH 8/8] mtd: ubi: fix NVMEM over UBI volumes on 32-bit systems
|
||||
|
||||
A compiler warning related to sizeof(int) != 8 when calling do_div()
|
||||
is triggered when building on 32-bit platforms.
|
||||
Address this by using integer types having a well-defined size.
|
||||
|
||||
Fixes: 3ce485803da1 ("mtd: ubi: provide NVMEM layer over UBI volumes")
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
|
||||
Tested-by: Randy Dunlap <rdunlap@infradead.org>
|
||||
Signed-off-by: Richard Weinberger <richard@nod.at>
|
||||
---
|
||||
drivers/mtd/ubi/nvmem.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/mtd/ubi/nvmem.c
|
||||
+++ b/drivers/mtd/ubi/nvmem.c
|
||||
@@ -23,9 +23,12 @@ struct ubi_nvmem {
|
||||
static int ubi_nvmem_reg_read(void *priv, unsigned int from,
|
||||
void *val, size_t bytes)
|
||||
{
|
||||
- int err = 0, lnum = from, offs, bytes_left = bytes, to_read;
|
||||
+ size_t to_read, bytes_left = bytes;
|
||||
struct ubi_nvmem *unv = priv;
|
||||
struct ubi_volume_desc *desc;
|
||||
+ uint32_t offs;
|
||||
+ uint64_t lnum = from;
|
||||
+ int err = 0;
|
||||
|
||||
desc = ubi_open_volume(unv->ubi_num, unv->vol_id, UBI_READONLY);
|
||||
if (IS_ERR(desc))
|
||||
@@ -0,0 +1,53 @@
|
||||
From 03cb793b26834ddca170ba87057c8f883772dd45 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 3 Oct 2024 00:11:41 +0200
|
||||
Subject: [PATCH 1/5] block: add support for defining read-only partitions
|
||||
|
||||
Add support for defining read-only partitions and complete support for
|
||||
it in the cmdline partition parser as the additional "ro" after a
|
||||
partition is scanned but never actually applied.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Christoph Hellwig <hch@lst.de>
|
||||
Link: https://lore.kernel.org/r/20241002221306.4403-2-ansuelsmth@gmail.com
|
||||
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
||||
---
|
||||
block/blk.h | 1 +
|
||||
block/partitions/cmdline.c | 3 +++
|
||||
block/partitions/core.c | 3 +++
|
||||
3 files changed, 7 insertions(+)
|
||||
|
||||
--- a/block/blk.h
|
||||
+++ b/block/blk.h
|
||||
@@ -424,6 +424,7 @@ void blk_free_ext_minor(unsigned int min
|
||||
#define ADDPART_FLAG_NONE 0
|
||||
#define ADDPART_FLAG_RAID 1
|
||||
#define ADDPART_FLAG_WHOLEDISK 2
|
||||
+#define ADDPART_FLAG_READONLY 4
|
||||
int bdev_add_partition(struct gendisk *disk, int partno, sector_t start,
|
||||
sector_t length);
|
||||
int bdev_del_partition(struct gendisk *disk, int partno);
|
||||
--- a/block/partitions/cmdline.c
|
||||
+++ b/block/partitions/cmdline.c
|
||||
@@ -237,6 +237,9 @@ static int add_part(int slot, struct cmd
|
||||
put_partition(state, slot, subpart->from >> 9,
|
||||
subpart->size >> 9);
|
||||
|
||||
+ if (subpart->flags & PF_RDONLY)
|
||||
+ state->parts[slot].flags |= ADDPART_FLAG_READONLY;
|
||||
+
|
||||
info = &state->parts[slot].info;
|
||||
|
||||
strscpy(info->volname, subpart->name, sizeof(info->volname));
|
||||
--- a/block/partitions/core.c
|
||||
+++ b/block/partitions/core.c
|
||||
@@ -392,6 +392,9 @@ static struct block_device *add_partitio
|
||||
goto out_del;
|
||||
}
|
||||
|
||||
+ if (flags & ADDPART_FLAG_READONLY)
|
||||
+ bdev->bd_read_only = true;
|
||||
+
|
||||
/* everything is up and running, commence */
|
||||
err = xa_insert(&disk->part_tbl, partno, bdev, GFP_KERNEL);
|
||||
if (err)
|
||||
@@ -0,0 +1,94 @@
|
||||
From e5f587242b6072ffab4f4a084a459a59f3035873 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 3 Oct 2024 00:11:43 +0200
|
||||
Subject: [PATCH 3/5] block: introduce add_disk_fwnode()
|
||||
|
||||
Introduce add_disk_fwnode() as a replacement of device_add_disk() that
|
||||
permits to pass and attach a fwnode to disk dev.
|
||||
|
||||
This variant can be useful for eMMC that might have the partition table
|
||||
for the disk defined in DT. A parser can later make use of the attached
|
||||
fwnode to parse the related table and init the hardcoded partition for
|
||||
the disk.
|
||||
|
||||
device_add_disk() is converted to a simple wrapper of add_disk_fwnode()
|
||||
with the fwnode entry set as NULL.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Christoph Hellwig <hch@lst.de>
|
||||
Link: https://lore.kernel.org/r/20241002221306.4403-4-ansuelsmth@gmail.com
|
||||
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
||||
---
|
||||
block/genhd.c | 28 ++++++++++++++++++++++++----
|
||||
include/linux/blkdev.h | 3 +++
|
||||
2 files changed, 27 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/block/genhd.c
|
||||
+++ b/block/genhd.c
|
||||
@@ -383,16 +383,18 @@ int disk_scan_partitions(struct gendisk
|
||||
}
|
||||
|
||||
/**
|
||||
- * device_add_disk - add disk information to kernel list
|
||||
+ * add_disk_fwnode - add disk information to kernel list with fwnode
|
||||
* @parent: parent device for the disk
|
||||
* @disk: per-device partitioning information
|
||||
* @groups: Additional per-device sysfs groups
|
||||
+ * @fwnode: attached disk fwnode
|
||||
*
|
||||
* This function registers the partitioning information in @disk
|
||||
- * with the kernel.
|
||||
+ * with the kernel. Also attach a fwnode to the disk device.
|
||||
*/
|
||||
-int __must_check device_add_disk(struct device *parent, struct gendisk *disk,
|
||||
- const struct attribute_group **groups)
|
||||
+int __must_check add_disk_fwnode(struct device *parent, struct gendisk *disk,
|
||||
+ const struct attribute_group **groups,
|
||||
+ struct fwnode_handle *fwnode)
|
||||
|
||||
{
|
||||
struct device *ddev = disk_to_dev(disk);
|
||||
@@ -451,6 +453,8 @@ int __must_check device_add_disk(struct
|
||||
ddev->parent = parent;
|
||||
ddev->groups = groups;
|
||||
dev_set_name(ddev, "%s", disk->disk_name);
|
||||
+ if (fwnode)
|
||||
+ device_set_node(ddev, fwnode);
|
||||
if (!(disk->flags & GENHD_FL_HIDDEN))
|
||||
ddev->devt = MKDEV(disk->major, disk->first_minor);
|
||||
ret = device_add(ddev);
|
||||
@@ -552,6 +556,22 @@ out_exit_elevator:
|
||||
elevator_exit(disk->queue);
|
||||
return ret;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(add_disk_fwnode);
|
||||
+
|
||||
+/**
|
||||
+ * device_add_disk - add disk information to kernel list
|
||||
+ * @parent: parent device for the disk
|
||||
+ * @disk: per-device partitioning information
|
||||
+ * @groups: Additional per-device sysfs groups
|
||||
+ *
|
||||
+ * This function registers the partitioning information in @disk
|
||||
+ * with the kernel.
|
||||
+ */
|
||||
+int __must_check device_add_disk(struct device *parent, struct gendisk *disk,
|
||||
+ const struct attribute_group **groups)
|
||||
+{
|
||||
+ return add_disk_fwnode(parent, disk, groups, NULL);
|
||||
+}
|
||||
EXPORT_SYMBOL(device_add_disk);
|
||||
|
||||
static void blk_report_disk_dead(struct gendisk *disk, bool surprise)
|
||||
--- a/include/linux/blkdev.h
|
||||
+++ b/include/linux/blkdev.h
|
||||
@@ -741,6 +741,9 @@ static inline unsigned int blk_queue_dep
|
||||
#define for_each_bio(_bio) \
|
||||
for (; _bio; _bio = _bio->bi_next)
|
||||
|
||||
+int __must_check add_disk_fwnode(struct device *parent, struct gendisk *disk,
|
||||
+ const struct attribute_group **groups,
|
||||
+ struct fwnode_handle *fwnode);
|
||||
int __must_check device_add_disk(struct device *parent, struct gendisk *disk,
|
||||
const struct attribute_group **groups);
|
||||
static inline int __must_check add_disk(struct gendisk *disk)
|
||||
@@ -0,0 +1,104 @@
|
||||
From 45ff6c340ddfc2dade74d5b7a8962c778ab7042c Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 3 Oct 2024 00:11:44 +0200
|
||||
Subject: [PATCH 4/5] mmc: block: attach partitions fwnode if found in mmc-card
|
||||
|
||||
Attach partitions fwnode if found in mmc-card and register disk with it.
|
||||
|
||||
This permits block partition to reference the node and register a
|
||||
partition table defined in DT for the special case for embedded device
|
||||
that doesn't have a partition table flashed but have an hardcoded
|
||||
partition table passed from the system.
|
||||
|
||||
JEDEC BOOT partition boot0/boot1 are supported but in DT we refer with
|
||||
the JEDEC name of boot1 and boot2 to better adhere to documentation.
|
||||
|
||||
Also JEDEC GP partition gp0/1/2/3 are supported but in DT we refer with
|
||||
the JEDEC name of gp1/2/3/4 to better adhere to documentration.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20241002221306.4403-5-ansuelsmth@gmail.com
|
||||
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
||||
---
|
||||
drivers/mmc/core/block.c | 55 +++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 54 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/mmc/core/block.c
|
||||
+++ b/drivers/mmc/core/block.c
|
||||
@@ -2455,6 +2455,56 @@ static inline int mmc_blk_readonly(struc
|
||||
!(card->csd.cmdclass & CCC_BLOCK_WRITE);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Search for a declared partitions node for the disk in mmc-card related node.
|
||||
+ *
|
||||
+ * This is to permit support for partition table defined in DT in special case
|
||||
+ * where a partition table is not written in the disk and is expected to be
|
||||
+ * passed from the running system.
|
||||
+ *
|
||||
+ * For the user disk, "partitions" node is searched.
|
||||
+ * For the special HW disk, "partitions-" node with the appended name is used
|
||||
+ * following this conversion table (to adhere to JEDEC naming)
|
||||
+ * - boot0 -> partitions-boot1
|
||||
+ * - boot1 -> partitions-boot2
|
||||
+ * - gp0 -> partitions-gp1
|
||||
+ * - gp1 -> partitions-gp2
|
||||
+ * - gp2 -> partitions-gp3
|
||||
+ * - gp3 -> partitions-gp4
|
||||
+ */
|
||||
+static struct fwnode_handle *mmc_blk_get_partitions_node(struct device *mmc_dev,
|
||||
+ const char *subname)
|
||||
+{
|
||||
+ const char *node_name = "partitions";
|
||||
+
|
||||
+ if (subname) {
|
||||
+ mmc_dev = mmc_dev->parent;
|
||||
+
|
||||
+ /*
|
||||
+ * Check if we are allocating a BOOT disk boot0/1 disk.
|
||||
+ * In DT we use the JEDEC naming boot1/2.
|
||||
+ */
|
||||
+ if (!strcmp(subname, "boot0"))
|
||||
+ node_name = "partitions-boot1";
|
||||
+ if (!strcmp(subname, "boot1"))
|
||||
+ node_name = "partitions-boot2";
|
||||
+ /*
|
||||
+ * Check if we are allocating a GP disk gp0/1/2/3 disk.
|
||||
+ * In DT we use the JEDEC naming gp1/2/3/4.
|
||||
+ */
|
||||
+ if (!strcmp(subname, "gp0"))
|
||||
+ node_name = "partitions-gp1";
|
||||
+ if (!strcmp(subname, "gp1"))
|
||||
+ node_name = "partitions-gp2";
|
||||
+ if (!strcmp(subname, "gp2"))
|
||||
+ node_name = "partitions-gp3";
|
||||
+ if (!strcmp(subname, "gp3"))
|
||||
+ node_name = "partitions-gp4";
|
||||
+ }
|
||||
+
|
||||
+ return device_get_named_child_node(mmc_dev, node_name);
|
||||
+}
|
||||
+
|
||||
static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
|
||||
struct device *parent,
|
||||
sector_t size,
|
||||
@@ -2463,6 +2513,7 @@ static struct mmc_blk_data *mmc_blk_allo
|
||||
int area_type,
|
||||
unsigned int part_type)
|
||||
{
|
||||
+ struct fwnode_handle *disk_fwnode;
|
||||
struct mmc_blk_data *md;
|
||||
int devidx, ret;
|
||||
char cap_str[10];
|
||||
@@ -2568,7 +2619,9 @@ static struct mmc_blk_data *mmc_blk_allo
|
||||
/* used in ->open, must be set before add_disk: */
|
||||
if (area_type == MMC_BLK_DATA_AREA_MAIN)
|
||||
dev_set_drvdata(&card->dev, md);
|
||||
- ret = device_add_disk(md->parent, md->disk, mmc_disk_attr_groups);
|
||||
+ disk_fwnode = mmc_blk_get_partitions_node(parent, subname);
|
||||
+ ret = add_disk_fwnode(md->parent, md->disk, mmc_disk_attr_groups,
|
||||
+ disk_fwnode);
|
||||
if (ret)
|
||||
goto err_put_disk;
|
||||
return md;
|
||||
@@ -0,0 +1,200 @@
|
||||
From 884555b557e5e6d41c866e2cd8d7b32f50ec974b Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 3 Oct 2024 00:11:45 +0200
|
||||
Subject: [PATCH 5/5] block: add support for partition table defined in OF
|
||||
|
||||
Add support for partition table defined in Device Tree. Similar to how
|
||||
it's done with MTD, add support for defining a fixed partition table in
|
||||
device tree.
|
||||
|
||||
A common scenario for this is fixed block (eMMC) embedded devices that
|
||||
have no MBR or GPT partition table to save storage space. Bootloader
|
||||
access the block device with absolute address of data.
|
||||
|
||||
This is to complete the functionality with an equivalent implementation
|
||||
with providing partition table with bootargs, for case where the booargs
|
||||
can't be modified and tweaking the Device Tree is the only solution to
|
||||
have an usabe partition table.
|
||||
|
||||
The implementation follow the fixed-partitions parser used on MTD
|
||||
devices where a "partitions" node is expected to be declared with
|
||||
"fixed-partitions" compatible in the OF node of the disk device
|
||||
(mmc-card for eMMC for example) and each child node declare a label
|
||||
and a reg with offset and size. If label is not declared, the node name
|
||||
is used as fallback. Eventually is also possible to declare the read-only
|
||||
property to flag the partition as read-only.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Christoph Hellwig <hch@lst.de>
|
||||
Link: https://lore.kernel.org/r/20241002221306.4403-6-ansuelsmth@gmail.com
|
||||
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
||||
---
|
||||
block/partitions/Kconfig | 9 ++++
|
||||
block/partitions/Makefile | 1 +
|
||||
block/partitions/check.h | 1 +
|
||||
block/partitions/core.c | 3 ++
|
||||
block/partitions/of.c | 110 ++++++++++++++++++++++++++++++++++++++
|
||||
5 files changed, 124 insertions(+)
|
||||
create mode 100644 block/partitions/of.c
|
||||
|
||||
--- a/block/partitions/Kconfig
|
||||
+++ b/block/partitions/Kconfig
|
||||
@@ -270,4 +270,13 @@ config CMDLINE_PARTITION
|
||||
Say Y here if you want to read the partition table from bootargs.
|
||||
The format for the command line is just like mtdparts.
|
||||
|
||||
+config OF_PARTITION
|
||||
+ bool "Device Tree partition support" if PARTITION_ADVANCED
|
||||
+ depends on OF
|
||||
+ help
|
||||
+ Say Y here if you want to enable support for partition table
|
||||
+ defined in Device Tree. (mainly for eMMC)
|
||||
+ The format for the device tree node is just like MTD fixed-partition
|
||||
+ schema.
|
||||
+
|
||||
endmenu
|
||||
--- a/block/partitions/Makefile
|
||||
+++ b/block/partitions/Makefile
|
||||
@@ -12,6 +12,7 @@ obj-$(CONFIG_CMDLINE_PARTITION) += cmdli
|
||||
obj-$(CONFIG_MAC_PARTITION) += mac.o
|
||||
obj-$(CONFIG_LDM_PARTITION) += ldm.o
|
||||
obj-$(CONFIG_MSDOS_PARTITION) += msdos.o
|
||||
+obj-$(CONFIG_OF_PARTITION) += of.o
|
||||
obj-$(CONFIG_OSF_PARTITION) += osf.o
|
||||
obj-$(CONFIG_SGI_PARTITION) += sgi.o
|
||||
obj-$(CONFIG_SUN_PARTITION) += sun.o
|
||||
--- a/block/partitions/check.h
|
||||
+++ b/block/partitions/check.h
|
||||
@@ -62,6 +62,7 @@ int karma_partition(struct parsed_partit
|
||||
int ldm_partition(struct parsed_partitions *state);
|
||||
int mac_partition(struct parsed_partitions *state);
|
||||
int msdos_partition(struct parsed_partitions *state);
|
||||
+int of_partition(struct parsed_partitions *state);
|
||||
int osf_partition(struct parsed_partitions *state);
|
||||
int sgi_partition(struct parsed_partitions *state);
|
||||
int sun_partition(struct parsed_partitions *state);
|
||||
--- a/block/partitions/core.c
|
||||
+++ b/block/partitions/core.c
|
||||
@@ -43,6 +43,9 @@ static int (*const check_part[])(struct
|
||||
#ifdef CONFIG_CMDLINE_PARTITION
|
||||
cmdline_partition,
|
||||
#endif
|
||||
+#ifdef CONFIG_OF_PARTITION
|
||||
+ of_partition, /* cmdline have priority to OF */
|
||||
+#endif
|
||||
#ifdef CONFIG_EFI_PARTITION
|
||||
efi_partition, /* this must come before msdos */
|
||||
#endif
|
||||
--- /dev/null
|
||||
+++ b/block/partitions/of.c
|
||||
@@ -0,0 +1,110 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+
|
||||
+#include <linux/blkdev.h>
|
||||
+#include <linux/major.h>
|
||||
+#include <linux/of.h>
|
||||
+#include <linux/string.h>
|
||||
+#include "check.h"
|
||||
+
|
||||
+static int validate_of_partition(struct device_node *np, int slot)
|
||||
+{
|
||||
+ u64 offset, size;
|
||||
+ int len;
|
||||
+
|
||||
+ const __be32 *reg = of_get_property(np, "reg", &len);
|
||||
+ int a_cells = of_n_addr_cells(np);
|
||||
+ int s_cells = of_n_size_cells(np);
|
||||
+
|
||||
+ /* Make sure reg len match the expected addr and size cells */
|
||||
+ if (len / sizeof(*reg) != a_cells + s_cells)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ /* Validate offset conversion from bytes to sectors */
|
||||
+ offset = of_read_number(reg, a_cells);
|
||||
+ if (offset % SECTOR_SIZE)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ /* Validate size conversion from bytes to sectors */
|
||||
+ size = of_read_number(reg + a_cells, s_cells);
|
||||
+ if (!size || size % SECTOR_SIZE)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void add_of_partition(struct parsed_partitions *state, int slot,
|
||||
+ struct device_node *np)
|
||||
+{
|
||||
+ struct partition_meta_info *info;
|
||||
+ char tmp[sizeof(info->volname) + 4];
|
||||
+ const char *partname;
|
||||
+ int len;
|
||||
+
|
||||
+ const __be32 *reg = of_get_property(np, "reg", &len);
|
||||
+ int a_cells = of_n_addr_cells(np);
|
||||
+ int s_cells = of_n_size_cells(np);
|
||||
+
|
||||
+ /* Convert bytes to sector size */
|
||||
+ u64 offset = of_read_number(reg, a_cells) / SECTOR_SIZE;
|
||||
+ u64 size = of_read_number(reg + a_cells, s_cells) / SECTOR_SIZE;
|
||||
+
|
||||
+ put_partition(state, slot, offset, size);
|
||||
+
|
||||
+ if (of_property_read_bool(np, "read-only"))
|
||||
+ state->parts[slot].flags |= ADDPART_FLAG_READONLY;
|
||||
+
|
||||
+ /*
|
||||
+ * Follow MTD label logic, search for label property,
|
||||
+ * fallback to node name if not found.
|
||||
+ */
|
||||
+ info = &state->parts[slot].info;
|
||||
+ partname = of_get_property(np, "label", &len);
|
||||
+ if (!partname)
|
||||
+ partname = of_get_property(np, "name", &len);
|
||||
+ strscpy(info->volname, partname, sizeof(info->volname));
|
||||
+
|
||||
+ snprintf(tmp, sizeof(tmp), "(%s)", info->volname);
|
||||
+ strlcat(state->pp_buf, tmp, PAGE_SIZE);
|
||||
+}
|
||||
+
|
||||
+int of_partition(struct parsed_partitions *state)
|
||||
+{
|
||||
+ struct device *ddev = disk_to_dev(state->disk);
|
||||
+ struct device_node *np;
|
||||
+ int slot;
|
||||
+
|
||||
+ struct device_node *partitions_np = of_node_get(ddev->of_node);
|
||||
+
|
||||
+ if (!partitions_np ||
|
||||
+ !of_device_is_compatible(partitions_np, "fixed-partitions"))
|
||||
+ return 0;
|
||||
+
|
||||
+ slot = 1;
|
||||
+ /* Validate parition offset and size */
|
||||
+ for_each_child_of_node(partitions_np, np) {
|
||||
+ if (validate_of_partition(np, slot)) {
|
||||
+ of_node_put(np);
|
||||
+ of_node_put(partitions_np);
|
||||
+
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ slot++;
|
||||
+ }
|
||||
+
|
||||
+ slot = 1;
|
||||
+ for_each_child_of_node(partitions_np, np) {
|
||||
+ if (slot >= state->limit) {
|
||||
+ of_node_put(np);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ add_of_partition(state, slot, np);
|
||||
+
|
||||
+ slot++;
|
||||
+ }
|
||||
+
|
||||
+ strlcat(state->pp_buf, "\n", PAGE_SIZE);
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
@@ -0,0 +1,146 @@
|
||||
From 49c8e854869d673df8452f24dfa8989cd0f615a8 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Kurbanov <mmkurbanov@salutedevices.com>
|
||||
Date: Mon, 2 Oct 2023 17:04:58 +0300
|
||||
Subject: [PATCH] mtd: spinand: add support for FORESEE F35SQA002G
|
||||
|
||||
Add support for FORESEE F35SQA002G SPI NAND.
|
||||
Datasheet:
|
||||
https://www.longsys.com/uploads/LM-00006FORESEEF35SQA002GDatasheet_1650183701.pdf
|
||||
|
||||
Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
|
||||
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
Link: https://lore.kernel.org/linux-mtd/20231002140458.147605-1-mmkurbanov@salutedevices.com
|
||||
---
|
||||
drivers/mtd/nand/spi/Makefile | 2 +-
|
||||
drivers/mtd/nand/spi/core.c | 1 +
|
||||
drivers/mtd/nand/spi/foresee.c | 95 ++++++++++++++++++++++++++++++++++
|
||||
include/linux/mtd/spinand.h | 1 +
|
||||
4 files changed, 98 insertions(+), 1 deletion(-)
|
||||
create mode 100644 drivers/mtd/nand/spi/foresee.c
|
||||
|
||||
--- a/drivers/mtd/nand/spi/Makefile
|
||||
+++ b/drivers/mtd/nand/spi/Makefile
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
-spinand-objs := core.o alliancememory.o ato.o esmt.o gigadevice.o macronix.o
|
||||
+spinand-objs := core.o alliancememory.o ato.o esmt.o foresee.o gigadevice.o macronix.o
|
||||
spinand-objs += micron.o paragon.o toshiba.o winbond.o xtx.o
|
||||
obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
|
||||
--- a/drivers/mtd/nand/spi/core.c
|
||||
+++ b/drivers/mtd/nand/spi/core.c
|
||||
@@ -940,6 +940,7 @@ static const struct spinand_manufacturer
|
||||
&alliancememory_spinand_manufacturer,
|
||||
&ato_spinand_manufacturer,
|
||||
&esmt_c8_spinand_manufacturer,
|
||||
+ &foresee_spinand_manufacturer,
|
||||
&gigadevice_spinand_manufacturer,
|
||||
¯onix_spinand_manufacturer,
|
||||
µn_spinand_manufacturer,
|
||||
--- /dev/null
|
||||
+++ b/drivers/mtd/nand/spi/foresee.c
|
||||
@@ -0,0 +1,95 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
|
||||
+/*
|
||||
+ * Copyright (c) 2023, SberDevices. All Rights Reserved.
|
||||
+ *
|
||||
+ * Author: Martin Kurbanov <mmkurbanov@salutedevices.com>
|
||||
+ */
|
||||
+
|
||||
+#include <linux/device.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/mtd/spinand.h>
|
||||
+
|
||||
+#define SPINAND_MFR_FORESEE 0xCD
|
||||
+
|
||||
+static SPINAND_OP_VARIANTS(read_cache_variants,
|
||||
+ SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
|
||||
+ SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
|
||||
+ SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
|
||||
+ SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
|
||||
+
|
||||
+static SPINAND_OP_VARIANTS(write_cache_variants,
|
||||
+ SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
|
||||
+ SPINAND_PROG_LOAD(true, 0, NULL, 0));
|
||||
+
|
||||
+static SPINAND_OP_VARIANTS(update_cache_variants,
|
||||
+ SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
|
||||
+ SPINAND_PROG_LOAD(false, 0, NULL, 0));
|
||||
+
|
||||
+static int f35sqa002g_ooblayout_ecc(struct mtd_info *mtd, int section,
|
||||
+ struct mtd_oob_region *region)
|
||||
+{
|
||||
+ return -ERANGE;
|
||||
+}
|
||||
+
|
||||
+static int f35sqa002g_ooblayout_free(struct mtd_info *mtd, int section,
|
||||
+ struct mtd_oob_region *region)
|
||||
+{
|
||||
+ if (section)
|
||||
+ return -ERANGE;
|
||||
+
|
||||
+ /* Reserve 2 bytes for the BBM. */
|
||||
+ region->offset = 2;
|
||||
+ region->length = 62;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct mtd_ooblayout_ops f35sqa002g_ooblayout = {
|
||||
+ .ecc = f35sqa002g_ooblayout_ecc,
|
||||
+ .free = f35sqa002g_ooblayout_free,
|
||||
+};
|
||||
+
|
||||
+static int f35sqa002g_ecc_get_status(struct spinand_device *spinand, u8 status)
|
||||
+{
|
||||
+ struct nand_device *nand = spinand_to_nand(spinand);
|
||||
+
|
||||
+ switch (status & STATUS_ECC_MASK) {
|
||||
+ case STATUS_ECC_NO_BITFLIPS:
|
||||
+ return 0;
|
||||
+
|
||||
+ case STATUS_ECC_HAS_BITFLIPS:
|
||||
+ return nanddev_get_ecc_conf(nand)->strength;
|
||||
+
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /* More than 1-bit error was detected in one or more sectors and
|
||||
+ * cannot be corrected.
|
||||
+ */
|
||||
+ return -EBADMSG;
|
||||
+}
|
||||
+
|
||||
+static const struct spinand_info foresee_spinand_table[] = {
|
||||
+ SPINAND_INFO("F35SQA002G",
|
||||
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x72, 0x72),
|
||||
+ NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 1, 1, 1),
|
||||
+ NAND_ECCREQ(1, 512),
|
||||
+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
|
||||
+ &write_cache_variants,
|
||||
+ &update_cache_variants),
|
||||
+ SPINAND_HAS_QE_BIT,
|
||||
+ SPINAND_ECCINFO(&f35sqa002g_ooblayout,
|
||||
+ f35sqa002g_ecc_get_status)),
|
||||
+};
|
||||
+
|
||||
+static const struct spinand_manufacturer_ops foresee_spinand_manuf_ops = {
|
||||
+};
|
||||
+
|
||||
+const struct spinand_manufacturer foresee_spinand_manufacturer = {
|
||||
+ .id = SPINAND_MFR_FORESEE,
|
||||
+ .name = "FORESEE",
|
||||
+ .chips = foresee_spinand_table,
|
||||
+ .nchips = ARRAY_SIZE(foresee_spinand_table),
|
||||
+ .ops = &foresee_spinand_manuf_ops,
|
||||
+};
|
||||
--- a/include/linux/mtd/spinand.h
|
||||
+++ b/include/linux/mtd/spinand.h
|
||||
@@ -263,6 +263,7 @@ struct spinand_manufacturer {
|
||||
extern const struct spinand_manufacturer alliancememory_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer ato_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer;
|
||||
+extern const struct spinand_manufacturer foresee_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer gigadevice_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer macronix_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer micron_spinand_manufacturer;
|
||||
@@ -0,0 +1,38 @@
|
||||
From ae461cde5c559675fc4c0ba351c7c31ace705f56 Mon Sep 17 00:00:00 2001
|
||||
From: Bohdan Chubuk <chbgdn@gmail.com>
|
||||
Date: Sun, 10 Nov 2024 22:50:47 +0200
|
||||
Subject: [PATCH] mtd: spinand: add support for FORESEE F35SQA001G
|
||||
|
||||
Add support for FORESEE F35SQA001G SPI NAND.
|
||||
|
||||
Similar to F35SQA002G, but differs in capacity.
|
||||
Datasheet:
|
||||
- https://cdn.ozdisan.com/ETicaret_Dosya/704795_871495.pdf
|
||||
|
||||
Tested on Xiaomi AX3000T flashed with OpenWRT.
|
||||
|
||||
Signed-off-by: Bohdan Chubuk <chbgdn@gmail.com>
|
||||
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
||||
---
|
||||
drivers/mtd/nand/spi/foresee.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
--- a/drivers/mtd/nand/spi/foresee.c
|
||||
+++ b/drivers/mtd/nand/spi/foresee.c
|
||||
@@ -81,6 +81,16 @@ static const struct spinand_info foresee
|
||||
SPINAND_HAS_QE_BIT,
|
||||
SPINAND_ECCINFO(&f35sqa002g_ooblayout,
|
||||
f35sqa002g_ecc_get_status)),
|
||||
+ SPINAND_INFO("F35SQA001G",
|
||||
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x71, 0x71),
|
||||
+ NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
|
||||
+ NAND_ECCREQ(1, 512),
|
||||
+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
|
||||
+ &write_cache_variants,
|
||||
+ &update_cache_variants),
|
||||
+ SPINAND_HAS_QE_BIT,
|
||||
+ SPINAND_ECCINFO(&f35sqa002g_ooblayout,
|
||||
+ f35sqa002g_ecc_get_status)),
|
||||
};
|
||||
|
||||
static const struct spinand_manufacturer_ops foresee_spinand_manuf_ops = {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user