Advertisement
SnarlingFox

WSQ50 Testing DTS with NVMEM

Nov 28th, 2023
620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.30 KB | None | 0 0
  1. // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  2.  
  3. #include "qcom-ipq4019.dtsi"
  4. #include <dt-bindings/gpio/gpio.h>
  5. #include <dt-bindings/input/input.h>
  6. #include <dt-bindings/input/linux-event-codes.h>
  7. #include <dt-bindings/soc/qcom,tcsr.h>
  8. #include <dt-bindings/leds/common.h>
  9.  
  10. / {
  11.     model = "Zyxel WSQ50";
  12.     compatible = "zyxel,wsq50";
  13.  
  14.     aliases {
  15.         led-boot = &status_green;
  16.         led-boot-aux1 = &status_red;
  17.         led-boot-aux2 = &status_blue;
  18.         led-running = &status_green;
  19.         led-running-aux1 = &status_red;
  20.         led-running-aux2 = &status_blue;
  21.         led-failsafe = &status_red;
  22.         led-upgrade = &status_blue;
  23.     };
  24.  
  25.     chosen {
  26.         bootargs-append = " clk_ignore_unused fstools_ignore_partname=1";
  27.         stdout-path = &blsp1_uart1;
  28.     };
  29.  
  30.     keys {
  31.         compatible = "gpio-keys";
  32.  
  33.         reset {
  34.             label = "reset";
  35.             gpios = <&tlmm 0x12 GPIO_ACTIVE_LOW>;
  36.             linux,code = <KEY_RESTART>;
  37.         };
  38.     };
  39.  
  40.     soc {
  41.         tcsr@1949000 {
  42.             reg = <0x1949000 0x100>;
  43.             compatible = "qcom,tcsr";
  44.             qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
  45.         };
  46.  
  47.         tcsr@194b000 {
  48.             reg = <0x194b000 0x100>;
  49.             compatible = "qcom,tcsr";
  50.             qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
  51.         };
  52.  
  53.         ess_tcsr@1953000 {
  54.             reg = <0x1953000 0x1000>;
  55.             compatible = "qcom,tcsr";
  56.             qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
  57.         };
  58.  
  59.         tcsr@1957000 {
  60.             reg = <0x1957000 0x100>;
  61.             compatible = "qcom,tcsr";
  62.             qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
  63.         };
  64.     };
  65. };
  66.  
  67. &tlmm {
  68.     serial1_pins: serial1_pinmux {
  69.         pins = "gpio16", "gpio17";
  70.         function = "blsp_uart1";
  71.         bias-disable;
  72.     };
  73.  
  74.     serial2_pins: serial2_pinmux {
  75.         pins = "gpio8", "gpio9", "gpio10", "gpio11";
  76.         function = "blsp_uart2";
  77.         bias-disable;
  78.     };
  79.  
  80.     led_pins: led_pinmux {
  81.         pins = "gpio44", "gpio45", "gpio46";
  82.         output-high;
  83.         bias-pull-up;
  84.     };
  85. };
  86.  
  87. &blsp_dma {
  88.     status = "okay";
  89. };
  90.  
  91. &blsp1_i2c3 {
  92.     status = "okay";
  93.  
  94.     tricolor: lp5562@30 {
  95.         #address-cells = <1>;
  96.         #size-cells = <0>;
  97.         compatible = "ti,lp5562";
  98.         reg = <0x30>;
  99.         clock-mode = /bits/ 8 <1>;
  100.  
  101.         status_red: chan@0 {
  102.             reg = <0>;
  103.             chan-name = "red:status";
  104.             led-cur = /bits/ 8 <192>;
  105.             max-cur = /bits/ 8 <255>;
  106.             color = <LED_COLOR_ID_RED>;
  107.         };
  108.  
  109.         status_green: chan@1 {
  110.             reg = <1>;
  111.             chan-name = "green:status";
  112.             led-cur = /bits/ 8 <92>;
  113.             max-cur = /bits/ 8 <255>;
  114.             color = <LED_COLOR_ID_GREEN>;
  115.         };
  116.  
  117.         status_blue: chan@2 {
  118.             reg = <2>;
  119.             chan-name = "blue:status";
  120.             led-cur = /bits/ 8 <255>;
  121.             max-cur = /bits/ 8 <255>;
  122.             color = <LED_COLOR_ID_BLUE>;
  123.         };
  124.     };
  125. };
  126.  
  127. &blsp1_spi1 {
  128.     status = "okay";
  129.  
  130.     flash@0 {
  131.         reg = <0>;
  132.         compatible = "jedec,spi-nor";
  133.         spi-max-frequency = <24000000>;
  134.  
  135.         partitions {
  136.             #address-cells = <1>;
  137.             #size-cells = <1>;
  138.             compatible = "fixed-partitions";
  139.  
  140.             partition0@0 {
  141.                 label = "0:QSEE";
  142.                 reg = <0x00060000 0x00060000>;
  143.                 read-only;
  144.             };
  145.  
  146.             partition1@E0000 {
  147.                 label = "u-boot";
  148.                 reg = <0x000E0000 0x00080000>;
  149.                 read-only;
  150.             };
  151.  
  152.             partition2@160000 {
  153.                 label = "u-boot-env";
  154.                 reg = <0x00160000 0x00010000>;
  155.             };
  156.  
  157.             partition3@170000 {
  158.                 label = "0:ART";
  159.                 reg = <0x00170000 0x00010000>;
  160.                 read-only;
  161.  
  162.                 nvmem-layout {
  163.                     compatible = "fixed-layout";
  164.                     #address-cells = <1>;
  165.                     #size-cells = <1>;
  166.  
  167.                     macaddr_gmac0: macaddr@0 {
  168.                         compatible = "mac-base";
  169.                         reg = <0x0 0x6>;
  170.                         #nvmem-cell-cells = <1>;
  171.                     };
  172.  
  173.                     macaddr_gmac1: macaddr@6 {
  174.                         reg = <0x6 0x6>;
  175.                     };
  176.  
  177.                     precal_wifi0: precal@1000 {
  178.                         reg = <0x1000 0x2f20>;
  179.                     };
  180.  
  181.                     macaddr_wifi0: macaddr@1006 {
  182.                         reg = <0x1006 0x6>;
  183.                     };
  184.  
  185.                     precal_wifi1: precal@5000 {
  186.                         reg = <0x5000 0x2f20>;
  187.                     };
  188.  
  189.                     macaddr_wifi1: macaddr@5006 {
  190.                         reg = <0x5006 0x6>;
  191.                     };
  192.  
  193.                     precal_wifi2: precal@9000 {
  194.                         reg = <0x9000 0x2f20>;
  195.                     };
  196.  
  197.                     macaddr_wifi2: macaddr@9006 {
  198.                         reg = <0x9006 0x6>;
  199.                     };
  200.                 };
  201.             };
  202.  
  203.             partition4@180000 {
  204.                 label = "dualflag";
  205.                 reg = <0x00180000 0x00010000>;
  206.             };
  207.  
  208.             partition5@190000 {
  209.                 label = "CRT";
  210.                 reg = <0x00190000 0x00010000>;
  211.                 read-only;
  212.             };
  213.  
  214.             partition6@1A0000 {
  215.                 label = "reserved";
  216.                 reg = <0x001A0000 0x00260000>;
  217.             };
  218.         };
  219.     };
  220. };
  221.  
  222. &blsp1_uart1 {
  223.     pinctrl-0 = <&serial1_pins>;
  224.     pinctrl-names = "default";
  225.     status = "okay";
  226. };
  227.  
  228. &blsp1_uart2 {
  229.     pinctrl-0 = <&serial2_pins>;
  230.     pinctrl-names = "default";
  231.     status = "okay";
  232. };
  233.  
  234. &cryptobam {
  235.     status = "okay";
  236. };
  237.  
  238. &gmac {
  239.     status = "okay";
  240. };
  241.  
  242. &mdio {
  243.     status = "okay";
  244. };
  245.  
  246. &prng {
  247.     status = "okay";
  248. };
  249.  
  250. &sdhci {
  251.     status = "okay";
  252.     non-removable;
  253. };
  254.  
  255. &switch {
  256.     status = "okay";
  257. };
  258.  
  259. &swport2 {
  260.     status = "okay";
  261.     nvmem-cell-names = "mac-address";
  262.     nvmem-cells = <&macaddr_gmac1>;
  263.     label = "lan3";
  264. };
  265.  
  266. &swport3 {
  267.     status = "okay";
  268.     nvmem-cell-names = "mac-address";
  269.     nvmem-cells = <&macaddr_gmac1>;
  270.     label = "lan2";
  271. };
  272.  
  273. &swport4 {
  274.     status = "okay";
  275.     nvmem-cell-names = "mac-address";
  276.     nvmem-cells = <&macaddr_gmac1>;
  277.     label = "lan1";
  278. };
  279.  
  280. &swport5 { /* WAN */
  281.     status = "okay";
  282.     nvmem-cell-names = "mac-address";
  283.     nvmem-cells = <&macaddr_gmac0 0>;
  284. };
  285.  
  286. &wifi0 {
  287.     status = "okay";
  288.     nvmem-cell-names = "pre-calibration", "mac-address";
  289.     nvmem-cells = <&precal_wifi0>, <&macaddr_wifi0>;
  290.     qcom,ath10k-calibration-variant = "Zyxel-WSQ50";
  291. };
  292.  
  293. &wifi1 {
  294.     status = "okay";
  295.     nvmem-cell-names = "pre-calibration", "mac-address";
  296.     nvmem-cells = <&precal_wifi1>, <&macaddr_wifi1>;
  297.     qcom,ath10k-calibration-variant = "Zyxel-WSQ50";
  298. };
  299.  
  300. &pcie0 { /* QCA9984 */
  301.     status = "okay";
  302.     perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>;
  303.     wake-gpio = <&tlmm 40 GPIO_ACTIVE_LOW>;
  304.     clkreq-gpio = <&tlmm 39 GPIO_ACTIVE_LOW>;
  305.  
  306.     bridge@0,0 {
  307.         #address-cells = <3>;
  308.         #size-cells = <2>;
  309.         reg = <0x00000000 0 0 0 0>;
  310.         ranges;
  311.  
  312.         wifi2: wifi@1,0 {
  313.             reg = <0x00010000 0 0 0 0>;
  314.             ieee80211-freq-limit = <5170000 5875000>;
  315.             compatible = "qcom,ath10k";
  316.             nvmem-cell-names = "pre-calibration", "mac-address";
  317.             nvmem-cells = <&precal_wifi2>, <&macaddr_wifi2>;
  318.             qcom,ath10k-calibration-variant = "Zyxel-WSQ50";
  319.         };
  320.     };
  321. };
  322.  
  323. &usb2 {
  324.     status = "okay";
  325. };
  326.  
  327. &usb2_hs_phy {
  328.     status = "okay";
  329. };
  330.  
  331. &usb3 {
  332.     status = "okay";
  333. };
  334.  
  335. &usb3_hs_phy {
  336.     status = "okay";
  337. };
  338.  
  339. &usb3_ss_phy {
  340.     status = "okay";
  341. };
  342.  
  343. &watchdog {
  344.     status = "okay";
  345. };
  346.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement