mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 10:28:06 +00:00 
			
		
		
		
	ipq807x: Add WF-660a support
Fixes: WIFI-12280 Signed-off-by: Ken <xshi@actiontec.com>
This commit is contained in:
		| @@ -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" | ||||
|   | ||||
| @@ -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 | ||||
| 		;; | ||||
|   | ||||
| @@ -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 | ||||
| 		;; | ||||
|   | ||||
| @@ -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" | ||||
| @@ -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 <dt-bindings/input/input.h> | ||||
| #include <dt-bindings/gpio/gpio.h> | ||||
|  | ||||
| / { | ||||
| 	#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 = <KEY_WPS_BUTTON>; | ||||
| 			gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; | ||||
| 			linux,input-type = <1>; | ||||
| 			debounce-interval = <60>; | ||||
| 		}; | ||||
| 		reset { | ||||
| 			label = "reset"; | ||||
| 			linux,code = <KEY_POWER>; | ||||
| 			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 = <GIC_SPI 299 IRQ_TYPE_LEVEL_HIGH>; | ||||
| 	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"; | ||||
| }; | ||||
							
								
								
									
										120
									
								
								feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										120
									
								
								feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq6018-cig-wf660a.dts
									
									
									
									
									
										Executable file
									
								
							| @@ -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 | ||||
| @@ -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 | ||||
|   | ||||
| @@ -12,6 +12,7 @@ cig,wf194c4|\ | ||||
| cig,wf194c|\ | ||||
| cig,wf610d|\ | ||||
| cig,wf808|\ | ||||
| cig,wf660a|\ | ||||
| cig,wf196) | ||||
| 	ucidef_set_wifi_country 'US' | ||||
| 	;; | ||||
|   | ||||
| @@ -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)) | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								feeds/wifi-ax/ath11k-wifi/board-cig-wf660a.bin.IPQ6018
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								feeds/wifi-ax/ath11k-wifi/board-cig-wf660a.bin.IPQ6018
									
									
									
									
									
										Executable file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										78
									
								
								patches/ipq807x/0008-Add-fw_printenv-support-for-EMMC.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								patches/ipq807x/0008-Add-fw_printenv-support-for-EMMC.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,78 @@ | ||||
| From 3353a474f9cda9a61101c7f57cec2b991503c73e Mon Sep 17 00:00:00 2001 | ||||
| From: Ken <xshi@actiontec.com> | ||||
| 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 | ||||
|  | ||||
							
								
								
									
										27
									
								
								profiles/cig_wf660a.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								profiles/cig_wf660a.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -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 | ||||
		Reference in New Issue
	
	Block a user
	 Ken
					Ken