From 43fa167f14c851ddfc58ca07c0ff09e8601ea729 Mon Sep 17 00:00:00 2001 From: Ken Date: Mon, 13 Feb 2023 11:07:22 +0800 Subject: [PATCH] ipq807x: Add WF-660a support Fixes: WIFI-12280 Signed-off-by: Ken --- .../ipq807x/base-files/etc/board.d/02_network | 3 + .../etc/hotplug.d/firmware/10-ath11k-caldata | 2 + .../base-files/lib/upgrade/platform.sh | 20 + .../arm/boot/dts/qcom-ipq6018-cig-wf660a.dts | 18 + .../qcom/qcom-ipq6018-cig-wf660a-cp01.dtsi | 590 ++++++++++++++++++ .../boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts | 120 ++++ feeds/ipq807x/ipq807x/image/ipq60xx.mk | 11 + .../files/etc/board.d/04-regdm | 1 + feeds/wifi-ax/ath11k-wifi/Makefile | 2 + .../ath11k-wifi/board-cig-wf660a.bin.IPQ6018 | Bin 0 -> 65536 bytes ...008-Add-fw_printenv-support-for-EMMC.patch | 78 +++ profiles/cig_wf660a.yml | 27 + 12 files changed, 872 insertions(+) create mode 100644 feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf660a.dts create mode 100755 feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a-cp01.dtsi create mode 100755 feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts create mode 100755 feeds/wifi-ax/ath11k-wifi/board-cig-wf660a.bin.IPQ6018 create mode 100644 patches/ipq807x/0008-Add-fw_printenv-support-for-EMMC.patch create mode 100644 profiles/cig_wf660a.yml diff --git a/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network b/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network index 7d1ccdc65..402260f1a 100755 --- a/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network +++ b/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network @@ -59,6 +59,9 @@ qcom_setup_interfaces() ucidef_set_interface_lan "eth1" ucidef_set_interface_wan "eth0" ;; + cig,wf660a) + ucidef_set_interface_lan "eth0" + ;; yuncore,fap650) ucidef_set_interface_lan "eth3 eth2 eth1 eth0" ucidef_set_interface_wan "eth4" diff --git a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata index 335709ae0..e87ad9f0d 100755 --- a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata +++ b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata @@ -102,6 +102,7 @@ case "$FIRMWARE" in case "$board" in cig,wf188|\ cig,wf188n|\ + cig,wf660a|\ edgecore,eap101|\ hfcl,ion4xi|\ hfcl,ion4x_2|\ @@ -190,6 +191,7 @@ ath11k-macs) indio,um-310ax-v1|\ indio,um-510axp-v1|\ indio,um-510axm-v1|\ + cig,wf660a|\ cig,wf188n) ath11k_generate_macs ;; diff --git a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh b/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh index 0531956f7..15653f21b 100755 --- a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh +++ b/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh @@ -50,6 +50,22 @@ do_flash_emmc() { tar Oxf $tar_file ${board_dir}/$part | dd of=${emmcblock} } +emmc_do_upgrade_cig() { + local tar_file="$1" + + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + do_flash_emmc $tar_file '0:HLOS_1' $board_dir kernel + do_flash_emmc $tar_file 'rootfs_1' $board_dir root + + local emmcblock="$(find_mmc_part "rootfs_data")" + if [ -e "$emmcblock" ]; then + mkfs.ext4 -F "$emmcblock" + fi +} + + emmc_do_upgrade() { local tar_file="$1" @@ -69,6 +85,7 @@ platform_check_image() { board=$(board_name) case $board in cig,wf188|\ + cig,wf660a|\ cig,wf188n|\ cig,wf194c|\ cig,wf194c4|\ @@ -118,6 +135,9 @@ platform_do_upgrade() { cig,wf188) qca_do_upgrade $1 ;; + cig,wf660a) + emmc_do_upgrade_cig $1 + ;; motorola,q14) emmc_do_upgrade $1 ;; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf660a.dts b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf660a.dts new file mode 100644 index 000000000..3ffe26489 --- /dev/null +++ b/feeds/ipq807x/ipq807x/files/arch/arm/boot/dts/qcom-ipq6018-cig-wf660a.dts @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2019, 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 "../../../arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts" +#include "qcom-ipq6018.dtsi" diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a-cp01.dtsi b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a-cp01.dtsi new file mode 100755 index 000000000..a21418f8a --- /dev/null +++ b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a-cp01.dtsi @@ -0,0 +1,590 @@ +/* + * Copyright (c) 2019, 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 "qcom-ipq6018.dtsi" +#include +#include + +/ { + #address-cells = <0x2>; + #size-cells = <0x2>; + compatible = "cig,wf660a", "qcom,ipq6018-cp01", "qcom,ipq6018"; + interrupt-parent = <&intc>; + qcom,msm-id = <0x192 0x0>, <0x193 0x0>; + + aliases { + serial0 = &blsp1_uart3; + serial1 = &blsp1_uart2; + sdhc1 = &sdhc_1; + /* + * Aliases as required by u-boot + * to patch MAC addresses + */ + ethernet0 = "/soc/dp1"; + ethernet1 = "/soc/dp2"; + ethernet2 = "/soc/dp3"; + ethernet3 = "/soc/dp4"; + ethernet4 = "/soc/dp5"; + }; + + 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 + }; + +}; + +&tlmm { + pinctrl-0 = <&sd_ldo_pins>; + pinctrl-names = "default"; + + uart_pins: uart_pins { + mux { + pins = "gpio44", "gpio45"; + function = "blsp2_uart"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + sd_ldo_pins: sd_ldo_pins { + mux { + pins = "gpio66"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + output-low; + }; + }; + + spi_0_pins: spi_0_pins { + mux { + pins = "gpio38", "gpio39", "gpio40", "gpio41"; + function = "blsp0_spi"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + spi_1_pins: spi_1_pins { + mux { + pins = "gpio69", "gpio71", "gpio72"; + function = "blsp1_spi"; + drive-strength = <8>; + bias-pull-down; + }; + spi_cs { + pins = "gpio70"; + function = "blsp1_spi"; + drive-strength = <8>; + bias-disable; + }; + quartz_interrupt { + pins = "gpio78"; + function = "gpio"; + input; + bias-disable; + }; + quartz_reset { + pins = "gpio79"; + function = "gpio"; + output-low; + bias-disable; + }; + + }; + + qpic_pins: qpic_pins { + data_0 { + pins = "gpio15"; + function = "qpic_pad0"; + drive-strength = <8>; + bias-pull-down; + }; + data_1 { + pins = "gpio12"; + function = "qpic_pad1"; + drive-strength = <8>; + bias-pull-down; + }; + data_2 { + pins = "gpio13"; + function = "qpic_pad2"; + drive-strength = <8>; + bias-pull-down; + }; + data_3 { + pins = "gpio14"; + function = "qpic_pad3"; + drive-strength = <8>; + bias-pull-down; + }; + data_4 { + pins = "gpio5"; + function = "qpic_pad4"; + drive-strength = <8>; + bias-pull-down; + }; + data_5 { + pins = "gpio6"; + function = "qpic_pad5"; + drive-strength = <8>; + bias-pull-down; + }; + data_6 { + pins = "gpio7"; + function = "qpic_pad6"; + drive-strength = <8>; + bias-pull-down; + }; + data_7 { + pins = "gpio8"; + function = "qpic_pad7"; + drive-strength = <8>; + bias-pull-down; + }; + qpic_pad { + pins = "gpio1", "gpio3", "gpio4", + "gpio10", "gpio11", "gpio17"; + function = "qpic_pad"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + sd_pins: sd_pins { + mux { + pins = "gpio62"; + function = "sd_card"; + drive-strength = <8>; + bias-pull-up; + }; + }; + + extcon_usb_pins: extcon_usb_pins { + mux { + pins = "gpio26"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + }; + + button_pins: button_pins { + wps_button { + pins = "gpio9"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; + reset_button { + pins = "gpio19"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; + }; + + 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; + }; + mux_3 { + pins = "gpio77"; + function = "gpio"; + bias-pull-up; + }; + }; + + leds_pins: leds_pins { + led_5g { + pins = "gpio35"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + led_2g { + pins = "gpio37"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + led_usb0 { + pins = "gpio50"; + function = "gpio"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + hsuart_pins: hsuart_pins { + mux { + pins = "gpio71", "gpio72"; + function = "blsp1_uart"; + drive-strength = <8>; + bias-disable; + }; + }; + + btcoex_pins: btcoex_pins { + mux_0 { + pins = "gpio51"; + function = "pta1_1"; + drive-strength = <6>; + bias-pull-down; + }; + mux_1 { + pins = "gpio53"; + function = "pta1_0"; + drive-strength = <6>; + bias-pull-down; + }; + mux_2 { + pins = "gpio52"; + function = "pta1_2"; + drive-strength = <6>; + bias-pull-down; + }; + }; + pwm_pins: pwm_pinmux { + mux_1 { + pins = "gpio22"; + function = "pwm02"; + drive-strength = <8>; + }; + mux_2 { + pins = "gpio23"; + function = "pwm12"; + drive-strength = <8>; + }; + mux_3 { + pins = "gpio24"; + function = "pwm22"; + drive-strength = <8>; + }; + + }; +}; + +&soc { + pwm { + pinctrl-0 = <&pwm_pins>; + pinctrl-names = "default"; + used-pwm-indices = <1>, <1>, <1>, <0>; + status = "ok"; + }; + extcon_usb: extcon_usb { + pinctrl-0 = <&extcon_usb_pins>; + pinctrl-names = "default"; + id-gpio = <&tlmm 26 GPIO_ACTIVE_LOW>; + status = "ok"; + }; + + mdio: mdio@90000 { + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + phy-reset-gpio = <&tlmm 75 0 &tlmm 77 1>; + status = "ok"; + 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 = <0x1c>; + }; + }; + + dp1 { + device_type = "network"; + compatible = "qcom,nss-dp"; + qcom,id = <1>; + reg = <0x3a001000 0x200>; + qcom,mactype = <0>; + local-mac-address = [000000000000]; + qcom,link-poll = <1>; + qcom,phy-mdio-addr = <0>; + phy-mode = "sgmii"; + }; + + dp2 { + device_type = "network"; + compatible = "qcom,nss-dp"; + qcom,id = <2>; + reg = <0x3a001200 0x200>; + qcom,mactype = <0>; + local-mac-address = [000000000000]; + qcom,link-poll = <1>; + qcom,phy-mdio-addr = <1>; + phy-mode = "sgmii"; + }; + + dp3 { + device_type = "network"; + compatible = "qcom,nss-dp"; + qcom,id = <3>; + reg = <0x3a001400 0x200>; + qcom,mactype = <0>; + local-mac-address = [000000000000]; + qcom,link-poll = <1>; + qcom,phy-mdio-addr = <2>; + phy-mode = "sgmii"; + }; + + dp4 { + device_type = "network"; + compatible = "qcom,nss-dp"; + qcom,id = <4>; + reg = <0x3a001600 0x200>; + qcom,mactype = <0>; + local-mac-address = [000000000000]; + qcom,link-poll = <1>; + qcom,phy-mdio-addr = <3>; + phy-mode = "sgmii"; + }; + + dp5 { + device_type = "network"; + compatible = "qcom,nss-dp"; + qcom,id = <5>; + reg = <0x3a001800 0x200>; + qcom,mactype = <0>; + local-mac-address = [000000000000]; + qcom,link-poll = <1>; + qcom,phy-mdio-addr = <28>; + phy-mode = "sgmii"; + }; + + nss-macsec0 { + compatible = "qcom,nss-macsec"; + phy_addr = <0x1c>; + phy_access_mode = <0>; + mdiobus = <&mdio>; + }; + + ess-switch@3a000000 { + switch_cpu_bmp = <0x1>; /* cpu port bitmap */ + switch_lan_bmp = <0x1e>; /* lan port bitmap */ + switch_wan_bmp = <0x20>; /* wan port bitmap */ + switch_inner_bmp = <0xc0>; /*inner port bitmap*/ + switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ + switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ + switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ + 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 = <0x1c>; + port_mac_sel = "QGMAC_PORT"; + }; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; + linux,input-type = <1>; + debounce-interval = <60>; + }; + reset { + label = "reset"; + linux,code = ; + 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@35 { + label = "led_5g"; + gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "led_5g"; + default-state = "off"; + }; + led@37 { + label = "led_2g"; + gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "led_2g"; + default-state = "off"; + }; + led@50 { + label = "led_usb0"; + gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usb-host"; + default-state = "off"; + }; + }; + +i2c_4: i2c@78b9000 { + compatible = "qcom,i2c-qup-v2.2.1"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x78b9000 0x600>; + interrupts = ; + clocks = <&gcc GCC_BLSP1_AHB_CLK>,<&gcc GCC_BLSP1_QUP5_I2C_APPS_CLK>; + clock-names = "iface", "core"; + clock-frequency = <100000>; + dmas = <&blsp_dma 21>, <&blsp_dma 20>; + dma-names = "rx", "tx"; + status = "disabled"; +}; +}; + +&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; + }; +}; + +&blsp1_uart2 { + pinctrl-0 = <&hsuart_pins>; + pinctrl-names = "default"; + status = "ok"; +}; + +&spi_1 { /* BLSP1 QUP1 */ + pinctrl-0 = <&spi_1_pins>; + pinctrl-names = "default"; + cs-select = <0>; + quartz-reset-gpio = <&tlmm 79 1>; + status = "disabled"; + spidev1: spi@1 { + compatible = "qca,spidev"; + reg = <0>; + spi-max-frequency = <24000000>; + }; +}; + + +&qpic_bam { + status = "ok"; +}; + +&nand { + pinctrl-0 = <&qpic_pins>; + pinctrl-names = "default"; + status = "disable"; +}; + +&ssphy_0 { + status = "ok"; +}; + +&qusb_phy_0 { + status = "ok"; +}; + +&qusb_phy_1 { + status = "ok"; +}; + +&usb2 { + status = "ok"; +}; + +&usb3 { + status = "ok"; +}; + +&nss_crypto { + status = "ok"; +}; + +&pcie_phy { + status = "ok"; +}; + +&pcie0 { +#if defined(__CNSS2__) + status = "ok"; +#endif +}; + +&qpic_lcd { + status = "ok"; +}; + +&qpic_lcd_panel { + status = "ok"; +}; diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts new file mode 100755 index 000000000..470b891e7 --- /dev/null +++ b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts @@ -0,0 +1,120 @@ +/dts-v1/; +/* + * Copyright (c) 2019, 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 "qcom-ipq6018-cig-wf660a-cp01.dtsi" +#include "qcom-ipq6018-rpm-regulator.dtsi" +#include "qcom-ipq6018-cpr-regulator.dtsi" +#include "qcom-ipq6018-cp-cpu.dtsi" + +/ { + model = "Cigtech WF-660a"; + + /* + * +=========+==============+========================+ + * | | | | + * | 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 in default memory profile only */ +#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 { + i2c_0_pins: i2c_0_pins { + mux { + pins = "gpio69", "gpio70"; + function = "blsp1_i2c"; + drive-strength = <8>; + bias-pull-down; + }; + }; + i2c_1_pins: i2c_1_pins { + mux { + pins = "gpio42", "gpio43"; + function = "blsp2_i2c"; + drive-strength = <8>; + bias-pull-down; + }; + }; + i2c_4_pins: i2c_4_pins { + mux { + pins = "gpio55", "gpio56"; + function = "blsp4_i2c"; + drive-strength = <8>; + bias-pull-down; + }; + }; + +}; + +&i2c_0 { + pinctrl-0 = <&i2c_0_pins>; + pinctrl-names = "default"; + status = "ok"; +}; + + +&i2c_1 { + pinctrl-0 = <&i2c_1_pins>; + pinctrl-names = "default"; + status = "ok"; +}; + +&i2c_4 { + pinctrl-0 = <&i2c_4_pins>; + pinctrl-names = "default"; + status = "ok"; +}; + +&sdhc_1 { + status = "ok"; +}; + +/* TZAPP is enabled in default memory profile only */ +#if !defined(__IPQ_MEM_PROFILE_256_MB__) && !defined(__IPQ_MEM_PROFILE_512_MB__) +&qseecom { + mem-start = <0x49B00000>; + mem-size = <0x600000>; + status = "ok"; +}; +#endif diff --git a/feeds/ipq807x/ipq807x/image/ipq60xx.mk b/feeds/ipq807x/ipq807x/image/ipq60xx.mk index c7588ebde..4aafe84fc 100644 --- a/feeds/ipq807x/ipq807x/image/ipq60xx.mk +++ b/feeds/ipq807x/ipq807x/image/ipq60xx.mk @@ -2,6 +2,17 @@ KERNEL_LOADADDR := 0x41008000 DEVICE_VARS += CE_TYPE +define Device/cig_wf660a + DEVICE_TITLE := Cigtech WF-660a + DEVICE_DTS := qcom-ipq6018-cig-wf660a + SUPPORTED_DEVICES := cig,wf660a + DEVICE_DTS_CONFIG := config@cp01-c1 + DEVICE_PACKAGES := ath11k-wifi-cig-wf660a uboot-env uboot-envtools + IMAGES := sysupgrade.tar mmc-factory.bin + IMAGE/mmc-factory.bin := append-ubi | qsdk-ipq-factory-mmc +endef +TARGET_DEVICES += cig_wf660a + define Device/cig_wf188n DEVICE_TITLE := Cigtech WF-188n DEVICE_DTS := qcom-ipq6018-cig-wf188n diff --git a/feeds/ucentral/ucentral-schema/files/etc/board.d/04-regdm b/feeds/ucentral/ucentral-schema/files/etc/board.d/04-regdm index e5bf5e45c..170a79a57 100755 --- a/feeds/ucentral/ucentral-schema/files/etc/board.d/04-regdm +++ b/feeds/ucentral/ucentral-schema/files/etc/board.d/04-regdm @@ -12,6 +12,7 @@ cig,wf194c4|\ cig,wf194c|\ cig,wf610d|\ cig,wf808|\ +cig,wf660a|\ cig,wf196) ucidef_set_wifi_country 'US' ;; diff --git a/feeds/wifi-ax/ath11k-wifi/Makefile b/feeds/wifi-ax/ath11k-wifi/Makefile index 2c85bd9d4..1d082cfe5 100644 --- a/feeds/wifi-ax/ath11k-wifi/Makefile +++ b/feeds/wifi-ax/ath11k-wifi/Makefile @@ -26,6 +26,7 @@ endef ALLWIFIBOARDS:= \ cig-wf188 \ cig-wf188n \ + cig-wf660a \ cig-wf194c \ cig-wf194c4 \ cig-wf196 \ @@ -236,6 +237,7 @@ endef $(eval $(call generate-ath11k-wifi-package,cig-wf188,Cigtech WF188)) $(eval $(call generate-ath11k-wifi-package,cig-wf188n,Cigtech WF188n)) +$(eval $(call generate-ath11k-wifi-package,cig-wf660a,Cigtech WF660a)) $(eval $(call generate-ath11k-wifi-package,cig-wf194c,Cigtech WF194c)) $(eval $(call generate-ath11k-wifi-package,cig-wf194c4,Cigtech WF194c4)) $(eval $(call generate-ath11k-wifi-package,cig-wf196,Cigtech WF196)) diff --git a/feeds/wifi-ax/ath11k-wifi/board-cig-wf660a.bin.IPQ6018 b/feeds/wifi-ax/ath11k-wifi/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d1i>MqKF&SDGoX zKStb{i>|6NJg`47U+kAPW&nHsMOFaL&m{@d%dGh3_=(w#7B4gO2!Gvu8U9s2*Z)ep ze+Uk1x1M5J&|Wi+V$-1vyPf{UmVY1O>oO(uR8Q`bDFvYh%kEP75k8Y$Dl=B|R0=2s zMyEg;etX8Ua^=dX?&A6=Arq3@!P6o>z( z=3*{c($z10U;CDx-ZMk~Z`|&^=P}i3cz=>5GbbmsF_J&`=4C+-4 zN&%&SQa~x76i^C`rvlm19)9a^JO@&-l>$lurGQf4l2KrWoVZBlnj`OBB$ +Date: Tue, 7 Feb 2023 14:39:52 +0800 +Subject: [PATCH] Add fw_printenv support for EMMC + +--- + package/base-files/files/lib/functions.sh | 13 ++++++++++++ + package/boot/uboot-envtools/files/ipq807x | 24 +++++++++++++++++++---- + 2 files changed, 33 insertions(+), 4 deletions(-) + +diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh +index 2bad45324f..415e0763ed 100644 +--- a/package/base-files/files/lib/functions.sh ++++ b/package/base-files/files/lib/functions.sh +@@ -32,6 +32,19 @@ xor() { + printf "%0${retlen}x" "$ret" + } + ++find_mmc_part() { ++ local DEVNAME PARTNAME ++ if grep -q "$1" /proc/mtd; then ++ echo "" && return 0 ++ fi ++ ++ for DEVNAME in /sys/block/mmcblk*/mmcblk*p*; do ++ PARTNAME=$(grep PARTNAME ${DEVNAME}/uevent | cut -f2 -d'=') ++ [ "$PARTNAME" = "$1" ] && echo "/dev/$(basename $DEVNAME)" && return 0 ++ done ++} ++ ++ + append() { + local var="$1" + local value="$2" +diff --git a/package/boot/uboot-envtools/files/ipq807x b/package/boot/uboot-envtools/files/ipq807x +index 84ed73f288..539cafb3fd 100644 +--- a/package/boot/uboot-envtools/files/ipq807x ++++ b/package/boot/uboot-envtools/files/ipq807x +@@ -13,16 +13,32 @@ ubootenv_mtdinfo () { + mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}') + mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}') + nor_flash=$(find /sys/bus/spi/devices/*/mtd -name ${mtd_dev}) +- +- if [ -n "$nor_flash" ]; then ++ found_emmc=0 ++ ++ if [ -z "$UBOOTENV_PART" ]; then ++ mtd_dev=$(echo $(find_mmc_part "0:APPSBLENV") | sed 's/^.\{5\}//') ++ if [ -n "$mtd_dev" ]; then ++ EMMC_UBOOTENV_PART=$(cat /proc/partitions | grep $mtd_dev) ++ #convert block to bytes ++ emmc_ubootenv_size=`expr $(echo $EMMC_UBOOTENV_PART | awk '{print $3}') \* 1024` ++ ubootenv_size=0x`printf "%x" $emmc_ubootenv_size` ++ found_emmc=1 ++ fi ++ mtd_erase="" ++ ++ elif [ -n "$nor_flash" ]; then + ubootenv_size=$mtd_size + else + # size is fixed to 0x40000 in u-boot + ubootenv_size=0x40000 + fi ++ if [ $found_emmc -eq 0 ]; then ++ sectors=$(printf '0x%x' $(( $ubootenv_size / $mtd_erase ))) ++ echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors ++ else ++ echo /dev/$mtd_dev 0x0 $ubootenv_size ++ fi + +- sectors=$(printf '0x%x' $(( $ubootenv_size / $mtd_erase ))) +- echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors + } + + case "$board" in +-- +2.34.1 + diff --git a/profiles/cig_wf660a.yml b/profiles/cig_wf660a.yml new file mode 100644 index 000000000..79120da38 --- /dev/null +++ b/profiles/cig_wf660a.yml @@ -0,0 +1,27 @@ +--- +profile: cig_wf660a +target: ipq807x +subtarget: ipq60xx +description: Build image for the Cigtech WF660a +image: bin/targets/ipq807x/ipq60xx/openwrt-ipq807x-cig_wf660a-squashfs-sysupgrade.tar +feeds: + - name: ipq807x + path: ../../feeds/ipq807x +packages: + - e2fsprogs + - ath11k-fwtest + - ftm +include: + - wifi-ax + - ucentral-ap + +diffconfig: | + CONFIG_PACKAGE_libblkid=y + CONFIG_PACKAGE_libext2fs=y + CONFIG_PACKAGE_libuuid=y + CONFIG_PACKAGE_libcomerr=y + CONFIG_PACKAGE_libss=y + CONFIG_PACKAGE_i2c-tools=y + CONFIG_PACKAGE_libi2c=y + CONFIG_BUSYBOX_DEFAULT_STTY=y + CONFIG_PACKAGE_kmod-i2c-core=y