diff --git a/arch/arm64/boot/dts/amlogic/axg_s400.dts b/arch/arm64/boot/dts/amlogic/axg_s400.dts index 341d19f24b28..589c03c0aad4 100644 --- a/arch/arm64/boot/dts/amlogic/axg_s400.dts +++ b/arch/arm64/boot/dts/amlogic/axg_s400.dts @@ -303,13 +303,20 @@ compatible = "amlogic, aml_wifi"; dev_name = "aml_wifi"; status = "okay"; - interrupt_pin = <&gpio GPIOX_7 GPIO_ACTIVE_HIGH>; - interrupts = < 0 68 4>; + interrupt_pin = <&gpio GPIOX_6 GPIO_ACTIVE_HIGH>; + interrupts = < 0 67 4>; irq_trigger_type = "GPIO_IRQ_LOW"; - power_on_pin = <&gpio GPIOX_6 GPIO_ACTIVE_HIGH>; -// pinctrl-names = "wifi_32k_pins"; -// pinctrl-0 = <&wifi_32k_pins>; -// pwm_config = <&wifi_pwm_conf>; + power_on_pin = <&gpio GPIOX_7 GPIO_ACTIVE_HIGH>; + pinctrl-names = "wifi_32k_pins"; + pinctrl-0 = <&wifi_32k_pins>; + pwm_config = <&wifi_pwm_conf>; + }; + + wifi_pwm_conf:wifi_pwm_conf{ + pwm_channel1 = ; + pwm_channel2 = ; + pwm_channel1_conf = <30541 15270 6>; + pwm_channel2_conf = <30518 15259 9>; }; sd_emmc_c: emmc@ffe07000 { diff --git a/arch/arm64/boot/dts/amlogic/axg_s420.dts b/arch/arm64/boot/dts/amlogic/axg_s420.dts index 85b774b70220..7686b4604039 100644 --- a/arch/arm64/boot/dts/amlogic/axg_s420.dts +++ b/arch/arm64/boot/dts/amlogic/axg_s420.dts @@ -245,9 +245,16 @@ interrupts = < 0 67 4>; irq_trigger_type = "GPIO_IRQ_LOW"; power_on_pin = <&gpio GPIOX_7 GPIO_ACTIVE_HIGH>; -// pinctrl-names = "wifi_32k_pins"; -// pinctrl-0 = <&wifi_32k_pins>; -// pwm_config = <&wifi_pwm_conf>; + pinctrl-names = "wifi_32k_pins"; + pinctrl-0 = <&wifi_32k_pins>; + pwm_config = <&wifi_pwm_conf>; + }; + + wifi_pwm_conf:wifi_pwm_conf{ + pwm_channel1 = ; + pwm_channel2 = ; + pwm_channel1_conf = <30541 15270 6>; + pwm_channel2_conf = <30518 15259 9>; }; sd_emmc_c: emmc@ffe07000 { status = "disabled"; diff --git a/arch/arm64/boot/dts/amlogic/gxl_p212_1g.dts b/arch/arm64/boot/dts/amlogic/gxl_p212_1g.dts index 490c248dee4c..13ba49c0d671 100644 --- a/arch/arm64/boot/dts/amlogic/gxl_p212_1g.dts +++ b/arch/arm64/boot/dts/amlogic/gxl_p212_1g.dts @@ -152,15 +152,15 @@ power_on_pin = <&gpio GPIOX_6 GPIO_ACTIVE_HIGH>; pinctrl-names = "wifi_32k_pins"; pinctrl-0 = <&wifi_32k_pins>; -// pwm_config = <&wifi_pwm_conf>; + pwm_config = <&wifi_pwm_conf>; }; -// wifi_pwm_conf:wifi_pwm_conf{ -// pwm_channel1 = ; -// pwm_channel2 = ; -// pwm_channel1_conf = <30541 15270 6>; -// pwm_channel2_conf = <30518 15259 9>; -// }; + wifi_pwm_conf:wifi_pwm_conf{ + pwm_channel1 = ; + pwm_channel2 = ; + pwm_channel1_conf = <30541 15270 6>; + pwm_channel2_conf = <30518 15259 9>; + }; sd_emmc_c: emmc@d0074000 { status = "okay"; diff --git a/arch/arm64/boot/dts/amlogic/gxl_p212_2g.dts b/arch/arm64/boot/dts/amlogic/gxl_p212_2g.dts index 59cd4893dbec..7ba4bc095acc 100644 --- a/arch/arm64/boot/dts/amlogic/gxl_p212_2g.dts +++ b/arch/arm64/boot/dts/amlogic/gxl_p212_2g.dts @@ -153,15 +153,15 @@ power_on_pin = <&gpio GPIOX_6 GPIO_ACTIVE_HIGH>; pinctrl-names = "wifi_32k_pins"; pinctrl-0 = <&wifi_32k_pins>; -// pwm_config = <&wifi_pwm_conf>; + pwm_config = <&wifi_pwm_conf>; }; -// wifi_pwm_conf:wifi_pwm_conf{ -// pwm_channel1 = ; -// pwm_channel2 = ; -// pwm_channel1_conf = <30541 15270 6>; -// pwm_channel2_conf = <30518 15259 9>; -// }; + wifi_pwm_conf:wifi_pwm_conf{ + pwm_channel1 = ; + pwm_channel2 = ; + pwm_channel1_conf = <30541 15270 6>; + pwm_channel2_conf = <30518 15259 9>; + }; sd_emmc_c: emmc@d0074000 { status = "okay"; diff --git a/arch/arm64/boot/dts/amlogic/gxl_p400_2g.dts b/arch/arm64/boot/dts/amlogic/gxl_p400_2g.dts index 9e85528d2672..e10aab9a00e8 100644 --- a/arch/arm64/boot/dts/amlogic/gxl_p400_2g.dts +++ b/arch/arm64/boot/dts/amlogic/gxl_p400_2g.dts @@ -80,15 +80,15 @@ power_on_pin = <&gpio GPIOX_6 GPIO_ACTIVE_HIGH>; pinctrl-names = "wifi_32k_pins"; pinctrl-0 = <&wifi_32k_pins>; -// pwm_config = <&wifi_pwm_conf>; + pwm_config = <&wifi_pwm_conf>; }; -// wifi_pwm_conf:wifi_pwm_conf{ -// pwm_channel1 = ; -// pwm_channel2 = ; -// pwm_channel1_conf = <30541 15270 6>; -// pwm_channel2_conf = <30518 15259 9>; -// }; + wifi_pwm_conf:wifi_pwm_conf{ + pwm_channel1 = ; + pwm_channel2 = ; + pwm_channel1_conf = <30541 15270 6>; + pwm_channel2_conf = <30518 15259 9>; + }; sd_emmc_c: emmc@d0074000 { status = "okay"; diff --git a/arch/arm64/boot/dts/amlogic/gxl_p401_2g.dts b/arch/arm64/boot/dts/amlogic/gxl_p401_2g.dts index 96ccf2aee015..9b4e87dcf5e1 100644 --- a/arch/arm64/boot/dts/amlogic/gxl_p401_2g.dts +++ b/arch/arm64/boot/dts/amlogic/gxl_p401_2g.dts @@ -80,15 +80,15 @@ power_on_pin = <&gpio GPIOX_6 GPIO_ACTIVE_HIGH>; pinctrl-names = "wifi_32k_pins"; pinctrl-0 = <&wifi_32k_pins>; -// pwm_config = <&wifi_pwm_conf>; + pwm_config = <&wifi_pwm_conf>; }; -// wifi_pwm_conf:wifi_pwm_conf{ -// pwm_channel1 = ; -// pwm_channel2 = ; -// pwm_channel1_conf = <30541 15270 6>; -// pwm_channel2_conf = <30518 15259 9>; -// }; + wifi_pwm_conf:wifi_pwm_conf{ + pwm_channel1 = ; + pwm_channel2 = ; + pwm_channel1_conf = <30541 15270 6>; + pwm_channel2_conf = <30518 15259 9>; + }; sd_emmc_c: emmc@d0074000 { status = "disabled"; diff --git a/arch/arm64/boot/dts/amlogic/gxl_skt.dts b/arch/arm64/boot/dts/amlogic/gxl_skt.dts index a8486f3ec2ee..3b225f2ba3d7 100644 --- a/arch/arm64/boot/dts/amlogic/gxl_skt.dts +++ b/arch/arm64/boot/dts/amlogic/gxl_skt.dts @@ -145,15 +145,15 @@ power_on_pin = <&gpio GPIOX_6 GPIO_ACTIVE_HIGH>; pinctrl-names = "wifi_32k_pins"; pinctrl-0 = <&wifi_32k_pins>; -// pwm_config = <&wifi_pwm_conf>; + pwm_config = <&wifi_pwm_conf>; }; -// wifi_pwm_conf:wifi_pwm_conf{ -// pwm_channel1 = ; -// pwm_channel2 = ; -// pwm_channel1_conf = <30541 15270 6>; -// pwm_channel2_conf = <30518 15259 9>; -// }; + wifi_pwm_conf:wifi_pwm_conf{ + pwm_channel1 = ; + pwm_channel2 = ; + pwm_channel1_conf = <30541 15270 6>; + pwm_channel2_conf = <30518 15259 9>; + }; sd_emmc_c: emmc@d0074000 { status = "okay"; diff --git a/arch/arm64/boot/dts/amlogic/mesonaxg.dtsi b/arch/arm64/boot/dts/amlogic/mesonaxg.dtsi index ae517226733e..d37e5aa50d72 100644 --- a/arch/arm64/boot/dts/amlogic/mesonaxg.dtsi +++ b/arch/arm64/boot/dts/amlogic/mesonaxg.dtsi @@ -764,5 +764,12 @@ }; }; + wifi_32k_pins:wifi_32k_pins { + mux { + groups ="GPIOX_20"; + function = "pwm_a"; + }; + }; + }; /* end of pinctrl_periphs */ diff --git a/arch/arm64/configs/meson64_defconfig b/arch/arm64/configs/meson64_defconfig index 3c40036ad51f..2846bd522bab 100644 --- a/arch/arm64/configs/meson64_defconfig +++ b/arch/arm64/configs/meson64_defconfig @@ -188,6 +188,7 @@ CONFIG_BT_HIDP=y CONFIG_BT_HCIUART=y CONFIG_BT_HCIUART_H4=y CONFIG_CFG80211=y +CONFIG_CFG80211_WEXT=y CONFIG_MAC80211=y CONFIG_RFKILL=y CONFIG_AMLOGIC_DRIVER=y @@ -331,6 +332,9 @@ CONFIG_PPPOE=y CONFIG_PPPOL2TP=y CONFIG_PPP_ASYNC=y CONFIG_USB_USBNET=y +CONFIG_ATH_COMMON=m +CONFIG_ATH10K=m +CONFIG_ATH10K_PCI=m CONFIG_INPUT_POLLDEV=y CONFIG_INPUT_EVDEV=y CONFIG_INPUT_JOYSTICK=y diff --git a/drivers/amlogic/wifi/wifi_dt.c b/drivers/amlogic/wifi/wifi_dt.c index 8acd1fc0d470..9c2df8f07a6e 100644 --- a/drivers/amlogic/wifi/wifi_dt.c +++ b/drivers/amlogic/wifi/wifi_dt.c @@ -461,14 +461,14 @@ int pwm_double_channel_conf_dt(struct wifi_plat_info *plat) if (ret) { pr_err("not match wifi_pwm_config node\n"); return -1; + } else { + pwm_phandle = val; + np_wifi_pwm_conf = of_find_node_by_phandle(pwm_phandle); + if (!np_wifi_pwm_conf) { + pr_err("can't find wifi_pwm_config node\n"); + return -1; + } } - pwm_phandle = val; - np_wifi_pwm_conf = of_find_node_by_phandle(pwm_phandle); - if (!np_wifi_pwm_conf) { - pr_err("can't find wifi_pwm_config node\n"); - return -1; - } - ret = of_property_read_u32(np_wifi_pwm_conf, "pwm_channel1", &(plat->gxtv_conf.pwm_channel1)); @@ -648,36 +648,12 @@ static int wifi_dev_probe(struct platform_device *pdev) if (of_get_property(pdev->dev.of_node, "pinctrl-names", NULL)) { unsigned int pwm_misc; - unsigned int pwm_time_count; - if (get_cpu_type() >= MESON_CPU_MAJOR_ID_GXTVBB) { - WIFI_INFO("set pwm as 32k output"); - aml_write_cbus(0x21b0, 0x16d016e); - aml_write_cbus(0x21b5, 0x16d016d); - - pwm_time_count = aml_read_cbus(0x21b4); - pwm_time_count &= ~(0xffff << 16); - pwm_time_count |= ((3 << 16) | (2 << 24)); - aml_write_cbus(0x21b4, pwm_time_count); - - pwm_misc = aml_read_cbus(0x21b2); - pwm_misc &= ~((0x7f << 8) | (3 << 4) | - (1 << 2) | (1 << 0)); - pwm_misc |= ((3 << 24) | (1 << 15) | - (0 << 8) | (0 << 4)); - aml_write_cbus(0x21b2, (pwm_misc | (1 << 0))); - + pwm_double_channel_conf_dt(plat); + pwm_double_channel_conf(plat); } else if (get_cpu_type() == MESON_CPU_MAJOR_ID_GXBB) { - - WIFI_INFO("set pwm as 32k output"); - aml_write_cbus(0x21b0, 0x7f107f2); - pwm_misc = aml_read_cbus(0x21b2); - pwm_misc &= ~((0x7f << 8) | (3 << 4) | - (1 << 2) | (1 << 0)); - pwm_misc |= ((1 << 15) | (4 << 8) | (3 << 4)); - aml_write_cbus(0x21b2, pwm_misc); - aml_write_cbus(0x21b2, (pwm_misc | (1 << 0))); - + pwm_single_channel_conf_dt(plat); + pwm_single_channel_conf(plat); } else if (get_cpu_type() == MESON_CPU_MAJOR_ID_M8B) { WIFI_INFO("set pwm as 32k output");