Move sunxi 5.16 to 5.17 (#3696)

* Add reg_ahci_5v status okay for bananapro board

* Bananapro: add AXP209 regulators

* Fix series.conf, Disable the patch that is not being applied.

* Fix linux-sunxi64-edge.config for v5.17.3

* Fix linux-sunxi-edge.config to v5.17.3

* Switch EDGE to core 5.17 for sunxi

* Remove the old rtl8723cs driver which is incompatible with the new kernel and cannot be used.

* Use AUFS if the kernel version is less than 5.16

* Print the last 20 lines of the log if the kernel compilation failed.

* Set KERNEL_VERSION_LEVEL to 5.17

Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
This commit is contained in:
The-going
2022-04-19 00:26:29 +03:00
committed by GitHub
parent a9e6e33e85
commit 7c2f24d46c
21 changed files with 335 additions and 350224 deletions

View File

@@ -0,0 +1,73 @@
From cfa6878c62aff9de3c31f6e3bb54caad61489b45 Mon Sep 17 00:00:00 2001
From: The-going <48602507+The-going@users.noreply.github.com>
Date: Wed, 13 Apr 2022 21:17:14 +0300
Subject: [PATCH] arm: dts: sun7i-a20-bananapro add AXP209 regulators
Author: Heiko Jehmlich <hje@jecons.de>
Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
---
arch/arm/boot/dts/sun7i-a20-bananapro.dts | 50 +++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/arch/arm/boot/dts/sun7i-a20-bananapro.dts b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
index 3a34fb39a..d5bc59060 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
@@ -257,3 +257,53 @@ &usbphy {
&reg_ahci_5v {
status = "okay";
};
+
+#include "axp209.dtsi"
+
+&ac_power_supply {
+ status = "okay";
+};
+
+&battery_power_supply {
+ status = "okay";
+};
+
+&reg_dcdc2 {
+ regulator-always-on;
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1450000>;
+ regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+ regulator-always-on;
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1400000>;
+ regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+ regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+ regulator-always-on;
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-name = "avcc";
+};
+
+&reg_ldo3 {
+ regulator-always-on;
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-name = "vddio-csi0";
+ regulator-ramp-delay = <1600>;
+};
+
+&reg_ldo4 {
+ regulator-always-on; /* required for SATA */
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-name = "vddio-csi1";
+};
--
2.34.1

View File

@@ -65,6 +65,14 @@ index e68748076..10ee53fba 100644
&i2c0 {
status = "okay";
@@ -227,3 +253,7 @@ &usbphy {
usb2_vbus-supply = <&reg_usb2_vbus>;
status = "okay";
};
+
+&reg_ahci_5v {
+ status = "okay";
+};
--
2.31.1

View File

@@ -605,6 +605,7 @@
patches.armbian/arm-dts-sun8i-r40-add-clk_out_a-fix-bananam2ultra.patch
patches.armbian/arm-dts-sun8i-h3-bananapi-m2-plus-add-wifi_pwrseq.patch
patches.armbian/arm-dts-sun7i-a20-bananapro-add-hdmi-connector-de.patch
patches.armbian/arm-dts-sun7i-a20-bananapro-add-AXP209-regulators.patch
patches.armbian/arm-dts-sunxi-h3-h5.dtsi-force-mmc0-bus-width.patch
patches.armbian/arm64-dts-sun50i-a64-pine64-enable-wifi-mmc1.patch
patches.armbian/arm64-dts-sun50i-h6-Add-AC200-EPHY-related-nodes.patch
@@ -694,5 +695,5 @@
patches.armbian/arm-dts-sun8i-h3-orangepi-pc-plus-add-wifi_pwrseq.patch
patches.armbian/arm64-dts-sun50i-h5-orangepi-prime-add-rtl8723cs.patch
patches.armbian/arm-dts-sun8i-h2-plus-orangepi-zero-fix-xradio-inter.patch
patches.armbian/drv-mtd-nand-disable-badblock-check-for-migration.patch
- patches.armbian/drv-mtd-nand-disable-badblock-check-for-migration.patch
patches.armbian/Fix-duplicate-nodes-for-sun50i-h5-orangepi-pc2.patch

View File

@@ -1,856 +0,0 @@
From 727d4c6e7155b838cf1cd76f3ced4bade954ad07 Mon Sep 17 00:00:00 2001
From: The-going <48602507+The-going@users.noreply.github.com>
Date: Mon, 7 Feb 2022 15:15:59 +0300
Subject: [PATCH 5/9] drv:net:rtl8723cs: platform
---
.../platform/platform_ARM_SUN50IW1P1_sdio.c | 91 +++++++++++
.../platform/platform_ARM_SUNnI_sdio.c | 135 +++++++++++++++++
.../platform/platform_ARM_SUNxI_sdio.c | 95 ++++++++++++
.../platform/platform_ARM_SUNxI_usb.c | 142 ++++++++++++++++++
.../platform/platform_ARM_WMT_sdio.c | 51 +++++++
.../rtl8723cs/platform/platform_RTK_DMP_usb.c | 36 +++++
.../platform/platform_arm_act_sdio.c | 58 +++++++
.../realtek/rtl8723cs/platform/platform_ops.c | 37 +++++
.../realtek/rtl8723cs/platform/platform_ops.h | 31 ++++
.../rtl8723cs/platform/platform_sprd_sdio.c | 89 +++++++++++
10 files changed, 765 insertions(+)
create mode 100644 drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUN50IW1P1_sdio.c
create mode 100644 drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNnI_sdio.c
create mode 100644 drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNxI_sdio.c
create mode 100644 drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNxI_usb.c
create mode 100644 drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_WMT_sdio.c
create mode 100644 drivers/net/wireless/realtek/rtl8723cs/platform/platform_RTK_DMP_usb.c
create mode 100644 drivers/net/wireless/realtek/rtl8723cs/platform/platform_arm_act_sdio.c
create mode 100644 drivers/net/wireless/realtek/rtl8723cs/platform/platform_ops.c
create mode 100644 drivers/net/wireless/realtek/rtl8723cs/platform/platform_ops.h
create mode 100644 drivers/net/wireless/realtek/rtl8723cs/platform/platform_sprd_sdio.c
diff --git a/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUN50IW1P1_sdio.c b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUN50IW1P1_sdio.c
new file mode 100644
index 000000000..8e78cce64
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUN50IW1P1_sdio.c
@@ -0,0 +1,91 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2013 Realtek Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ ******************************************************************************/
+/*
+ * Description:
+ * This file can be applied to following platforms:
+ * CONFIG_PLATFORM_ARM_SUN50IW1P1
+ */
+#include <drv_types.h>
+#ifdef CONFIG_GPIO_WAKEUP
+#include <linux/gpio.h>
+#endif
+
+#ifdef CONFIG_MMC
+#if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1)
+extern void sunxi_mmc_rescan_card(unsigned ids);
+extern void sunxi_wlan_set_power(int on);
+extern int sunxi_wlan_get_bus_index(void);
+extern int sunxi_wlan_get_oob_irq(void);
+extern int sunxi_wlan_get_oob_irq_flags(void);
+#endif
+#ifdef CONFIG_GPIO_WAKEUP
+extern unsigned int oob_irq;
+#endif
+#endif // CONFIG_MMC
+
+/*
+ * Return:
+ * 0: power on successfully
+ * others: power on failed
+ */
+int platform_wifi_power_on(void)
+{
+ int ret = 0;
+
+#ifdef CONFIG_MMC
+{
+
+#if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1)
+ int wlan_bus_index = sunxi_wlan_get_bus_index();
+ if(wlan_bus_index < 0)
+ return wlan_bus_index;
+
+ sunxi_wlan_set_power(1);
+ mdelay(100);
+ sunxi_mmc_rescan_card(wlan_bus_index);
+#endif
+ DBG_871X("%s: power up, rescan card.\n", __FUNCTION__);
+
+#ifdef CONFIG_GPIO_WAKEUP
+#if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1)
+ oob_irq = sunxi_wlan_get_oob_irq();
+#endif
+#endif // CONFIG_GPIO_WAKEUP
+}
+#endif // CONFIG_MMC
+
+ return ret;
+}
+
+void platform_wifi_power_off(void)
+{
+#ifdef CONFIG_MMC
+#if defined(CONFIG_PLATFORM_ARM_SUN50IW1P1)
+ int wlan_bus_index = sunxi_wlan_get_bus_index();
+ if(wlan_bus_index < 0)
+ return;
+
+ sunxi_mmc_rescan_card(wlan_bus_index);
+ mdelay(100);
+ sunxi_wlan_set_power(0);
+#endif
+ DBG_871X("%s: remove card, power off.\n", __FUNCTION__);
+#endif // CONFIG_MMC
+}
diff --git a/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNnI_sdio.c b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNnI_sdio.c
new file mode 100644
index 000000000..5484415c0
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNnI_sdio.c
@@ -0,0 +1,135 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2013 Realtek Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ ******************************************************************************/
+/*
+ * Description:
+ * This file can be applied to following platforms:
+ * CONFIG_PLATFORM_ARM_SUN6I
+ * CONFIG_PLATFORM_ARM_SUN7I
+ * CONFIG_PLATFORM_ARM_SUN8I
+ */
+#include <drv_types.h>
+#include <mach/sys_config.h>
+#ifdef CONFIG_GPIO_WAKEUP
+#include <linux/gpio.h>
+#endif
+
+#ifdef CONFIG_MMC
+static int sdc_id = -1;
+static signed int gpio_eint_wlan = -1;
+static u32 eint_wlan_handle = 0;
+
+#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I)
+extern void sw_mci_rescan_card(unsigned id, unsigned insert);
+#elif defined(CONFIG_PLATFORM_ARM_SUN8I)
+extern void sunxi_mci_rescan_card(unsigned id, unsigned insert);
+#endif
+
+#ifdef CONFIG_PLATFORM_ARM_SUN8I_W5P1
+extern int get_rf_mod_type(void);
+#else
+extern int wifi_pm_get_mod_type(void);
+#endif
+
+extern void wifi_pm_power(int on);
+#ifdef CONFIG_GPIO_WAKEUP
+extern unsigned int oob_irq;
+#endif
+#endif // CONFIG_MMC
+
+/*
+ * Return:
+ * 0: power on successfully
+ * others: power on failed
+ */
+int platform_wifi_power_on(void)
+{
+ int ret = 0;
+
+#ifdef CONFIG_MMC
+{
+ script_item_u val;
+ script_item_value_type_e type;
+
+#ifdef CONFIG_PLATFORM_ARM_SUN8I_W5P1
+ unsigned int mod_sel = get_rf_mod_type();
+#else
+ unsigned int mod_sel = wifi_pm_get_mod_type();
+#endif
+
+ type = script_get_item("wifi_para", "wifi_sdc_id", &val);
+ if (SCIRPT_ITEM_VALUE_TYPE_INT!=type) {
+ DBG_871X("get wifi_sdc_id failed\n");
+ ret = -1;
+ } else {
+ sdc_id = val.val;
+ DBG_871X("----- %s sdc_id: %d, mod_sel: %d\n", __FUNCTION__, sdc_id, mod_sel);
+
+#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I)
+ sw_mci_rescan_card(sdc_id, 1);
+#elif defined(CONFIG_PLATFORM_ARM_SUN8I)
+ sunxi_mci_rescan_card(sdc_id, 1);
+#endif
+ mdelay(100);
+ wifi_pm_power(1);
+
+ DBG_871X("%s: power up, rescan card.\n", __FUNCTION__);
+ }
+
+#ifdef CONFIG_GPIO_WAKEUP
+#ifdef CONFIG_PLATFORM_ARM_SUN8I_W5P1
+ type = script_get_item("wifi_para", "wl_host_wake", &val);
+#else
+#ifdef CONFIG_RTL8723B
+ type = script_get_item("wifi_para", "rtl8723bs_wl_host_wake", &val);
+#endif
+#ifdef CONFIG_RTL8188E
+ type = script_get_item("wifi_para", "rtl8189es_host_wake", &val);
+#endif
+#endif /* CONFIG_PLATFORM_ARM_SUN8I_W5P1 */
+ if (SCIRPT_ITEM_VALUE_TYPE_PIO != type) {
+ DBG_871X("No definition of wake up host PIN\n");
+ ret = -1;
+ } else {
+ gpio_eint_wlan = val.gpio.gpio;
+#ifdef CONFIG_PLATFORM_ARM_SUN8I
+ oob_irq = gpio_to_irq(gpio_eint_wlan);
+#endif
+ }
+#endif // CONFIG_GPIO_WAKEUP
+}
+#endif // CONFIG_MMC
+
+ return ret;
+}
+
+void platform_wifi_power_off(void)
+{
+#ifdef CONFIG_MMC
+#if defined(CONFIG_PLATFORM_ARM_SUN6I) ||defined(CONFIG_PLATFORM_ARM_SUN7I)
+ sw_mci_rescan_card(sdc_id, 0);
+#elif defined(CONFIG_PLATFORM_ARM_SUN8I)
+ sunxi_mci_rescan_card(sdc_id, 0);
+#endif
+ mdelay(100);
+ wifi_pm_power(0);
+
+ DBG_871X("%s: remove card, power off.\n", __FUNCTION__);
+#endif // CONFIG_MMC
+}
diff --git a/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNxI_sdio.c b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNxI_sdio.c
new file mode 100644
index 000000000..770f93506
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNxI_sdio.c
@@ -0,0 +1,95 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2013 Realtek Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ ******************************************************************************/
+#include <drv_types.h>
+
+#ifdef CONFIG_MMC_SUNXI_POWER_CONTROL
+#ifdef CONFIG_WITS_EVB_V13
+#define SDIOID 0
+#else // !CONFIG_WITS_EVB_V13
+#define SDIOID (CONFIG_CHIP_ID==1123 ? 3 : 1)
+#endif // !CONFIG_WITS_EVB_V13
+
+#define SUNXI_SDIO_WIFI_NUM_RTL8189ES 10
+extern void sunximmc_rescan_card(unsigned id, unsigned insert);
+extern int mmc_pm_get_mod_type(void);
+extern int mmc_pm_gpio_ctrl(char* name, int level);
+/*
+ * rtl8189es_shdn = port:PH09<1><default><default><0>
+ * rtl8189es_wakeup = port:PH10<1><default><default><1>
+ * rtl8189es_vdd_en = port:PH11<1><default><default><0>
+ * rtl8189es_vcc_en = port:PH12<1><default><default><0>
+ */
+
+int rtl8189es_sdio_powerup(void)
+{
+ mmc_pm_gpio_ctrl("rtl8189es_vdd_en", 1);
+ udelay(100);
+ mmc_pm_gpio_ctrl("rtl8189es_vcc_en", 1);
+ udelay(50);
+ mmc_pm_gpio_ctrl("rtl8189es_shdn", 1);
+ return 0;
+}
+
+int rtl8189es_sdio_poweroff(void)
+{
+ mmc_pm_gpio_ctrl("rtl8189es_shdn", 0);
+ mmc_pm_gpio_ctrl("rtl8189es_vcc_en", 0);
+ mmc_pm_gpio_ctrl("rtl8189es_vdd_en", 0);
+ return 0;
+}
+#endif // CONFIG_MMC_SUNXI_POWER_CONTROL
+
+/*
+ * Return:
+ * 0: power on successfully
+ * others: power on failed
+ */
+int platform_wifi_power_on(void)
+{
+ int ret = 0;
+#ifdef CONFIG_MMC_SUNXI_POWER_CONTROL
+ unsigned int mod_sel = mmc_pm_get_mod_type();
+#endif // CONFIG_MMC_SUNXI_POWER_CONTROL
+
+
+#ifdef CONFIG_MMC_SUNXI_POWER_CONTROL
+ if (mod_sel == SUNXI_SDIO_WIFI_NUM_RTL8189ES) {
+ rtl8189es_sdio_powerup();
+ sunximmc_rescan_card(SDIOID, 1);
+ printk("[rtl8189es] %s: power up, rescan card.\n", __FUNCTION__);
+ } else {
+ ret = -1;
+ printk("[rtl8189es] %s: mod_sel = %d is incorrect.\n", __FUNCTION__, mod_sel);
+ }
+#endif // CONFIG_MMC_SUNXI_POWER_CONTROL
+
+ return ret;
+}
+
+void platform_wifi_power_off(void)
+{
+#ifdef CONFIG_MMC_SUNXI_POWER_CONTROL
+ sunximmc_rescan_card(SDIOID, 0);
+#ifdef CONFIG_RTL8188E
+ rtl8189es_sdio_poweroff();
+ printk("[rtl8189es] %s: remove card, power off.\n", __FUNCTION__);
+#endif // CONFIG_RTL8188E
+#endif // CONFIG_MMC_SUNXI_POWER_CONTROL
+}
diff --git a/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNxI_usb.c b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNxI_usb.c
new file mode 100644
index 000000000..774392bdd
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_SUNxI_usb.c
@@ -0,0 +1,142 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2013 Realtek Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ ******************************************************************************/
+/*
+ * Description:
+ * This file can be applied to following platforms:
+ * CONFIG_PLATFORM_ARM_SUNXI Series platform
+ *
+ */
+
+#include <drv_types.h>
+#include <mach/sys_config.h>
+
+#ifdef CONFIG_PLATFORM_ARM_SUNxI
+extern int sw_usb_disable_hcd(__u32 usbc_no);
+extern int sw_usb_enable_hcd(__u32 usbc_no);
+static int usb_wifi_host = 2;
+#endif
+
+#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I)
+extern int sw_usb_disable_hcd(__u32 usbc_no);
+extern int sw_usb_enable_hcd(__u32 usbc_no);
+extern void wifi_pm_power(int on);
+static script_item_u item;
+#endif
+
+#ifdef CONFIG_PLATFORM_ARM_SUN8I
+extern int sunxi_usb_disable_hcd(__u32 usbc_no);
+extern int sunxi_usb_enable_hcd(__u32 usbc_no);
+extern void wifi_pm_power(int on);
+static script_item_u item;
+#endif
+
+
+int platform_wifi_power_on(void)
+{
+ int ret = 0;
+
+#ifdef CONFIG_PLATFORM_ARM_SUNxI
+#ifndef CONFIG_RTL8723A
+ {
+ /* ----------get usb_wifi_usbc_num------------- */
+ ret = script_parser_fetch("usb_wifi_para", "usb_wifi_usbc_num", (int *)&usb_wifi_host, 64);
+ if(ret != 0){
+ DBG_8192C("ERR: script_parser_fetch usb_wifi_usbc_num failed\n");
+ ret = -ENOMEM;
+ goto exit;
+ }
+ DBG_8192C("sw_usb_enable_hcd: usbc_num = %d\n", usb_wifi_host);
+ sw_usb_enable_hcd(usb_wifi_host);
+ }
+#endif //CONFIG_RTL8723A
+#endif //CONFIG_PLATFORM_ARM_SUNxI
+
+#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I)
+ {
+ script_item_value_type_e type;
+
+ type = script_get_item("wifi_para", "wifi_usbc_id", &item);
+ if(SCIRPT_ITEM_VALUE_TYPE_INT != type){
+ printk("ERR: script_get_item wifi_usbc_id failed\n");
+ ret = -ENOMEM;
+ goto exit;
+ }
+
+ printk("sw_usb_enable_hcd: usbc_num = %d\n", item.val);
+ wifi_pm_power(1);
+ mdelay(10);
+
+ #if !(defined(CONFIG_RTL8723A)) && !(defined(CONFIG_RTL8723B))
+ sw_usb_enable_hcd(item.val);
+ #endif
+ }
+#endif //defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I)
+
+#if defined(CONFIG_PLATFORM_ARM_SUN8I)
+ {
+ script_item_value_type_e type;
+
+ type = script_get_item("wifi_para", "wifi_usbc_id", &item);
+ if(SCIRPT_ITEM_VALUE_TYPE_INT != type){
+ printk("ERR: script_get_item wifi_usbc_id failed\n");
+ ret = -ENOMEM;
+ goto exit;
+ }
+
+ printk("sw_usb_enable_hcd: usbc_num = %d\n", item.val);
+ wifi_pm_power(1);
+ mdelay(10);
+
+ #if !(defined(CONFIG_RTL8723A)) && !(defined(CONFIG_RTL8723B))
+ sunxi_usb_enable_hcd(item.val);
+ #endif
+ }
+#endif //CONFIG_PLATFORM_ARM_SUN8I
+
+exit:
+ return ret;
+}
+
+void platform_wifi_power_off(void)
+{
+
+#ifdef CONFIG_PLATFORM_ARM_SUNxI
+#ifndef CONFIG_RTL8723A
+ DBG_8192C("sw_usb_disable_hcd: usbc_num = %d\n", usb_wifi_host);
+ sw_usb_disable_hcd(usb_wifi_host);
+#endif //ifndef CONFIG_RTL8723A
+#endif //CONFIG_PLATFORM_ARM_SUNxI
+
+#if defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I)
+ #if !(defined(CONFIG_RTL8723A)) && !(defined(CONFIG_RTL8723B))
+ sw_usb_disable_hcd(item.val);
+ #endif
+ wifi_pm_power(0);
+#endif //defined(CONFIG_PLATFORM_ARM_SUN6I) || defined(CONFIG_PLATFORM_ARM_SUN7I)
+
+#if defined(CONFIG_PLATFORM_ARM_SUN8I)
+ #if !(defined(CONFIG_RTL8723A)) && !(defined(CONFIG_RTL8723B))
+ sunxi_usb_disable_hcd(item.val);
+ #endif
+ wifi_pm_power(0);
+#endif //defined(CONFIG_PLATFORM_ARM_SUN8I)
+
+}
+
diff --git a/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_WMT_sdio.c b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_WMT_sdio.c
new file mode 100644
index 000000000..e994ea51d
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ARM_WMT_sdio.c
@@ -0,0 +1,51 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2013 Realtek Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ ******************************************************************************/
+#include <drv_types.h>
+#include <mach/wmt_iomux.h>
+#include <linux/gpio.h>
+
+extern void wmt_detect_sdio2(void);
+extern void force_remove_sdio2(void);
+
+int platform_wifi_power_on(void)
+{
+ int err = 0;
+ err = gpio_request(WMT_PIN_GP62_SUSGPIO1, "wifi_chip_en");
+ if (err < 0){
+ printk("request gpio for rtl8188eu failed!\n");
+ return err;
+ }
+ gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 0);//pull sus_gpio1 to 0 to open vcc_wifi.
+ printk("power on rtl8189.\n");
+ msleep(500);
+ wmt_detect_sdio2();
+ printk("[rtl8189es] %s: new card, power on.\n", __FUNCTION__);
+ return err;
+}
+
+void platform_wifi_power_off(void)
+{
+ force_remove_sdio2();
+
+ gpio_direction_output(WMT_PIN_GP62_SUSGPIO1, 1);//pull sus_gpio1 to 1 to close vcc_wifi.
+ printk("power off rtl8189.\n");
+ gpio_free(WMT_PIN_GP62_SUSGPIO1);
+ printk("[rtl8189es] %s: remove card, power off.\n", __FUNCTION__);
+}
diff --git a/drivers/net/wireless/realtek/rtl8723cs/platform/platform_RTK_DMP_usb.c b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_RTK_DMP_usb.c
new file mode 100644
index 000000000..d296641f1
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_RTK_DMP_usb.c
@@ -0,0 +1,36 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2013 Realtek Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ ******************************************************************************/
+#include <drv_types.h>
+
+int platform_wifi_power_on(void)
+{
+ int ret = 0;
+ u32 tmp;
+ tmp=readl((volatile unsigned int*)0xb801a608);
+ tmp &= 0xffffff00;
+ tmp |= 0x55;
+ writel(tmp,(volatile unsigned int*)0xb801a608);//write dummy register for 1055
+ return ret;
+}
+
+void platform_wifi_power_off(void)
+{
+}
+
diff --git a/drivers/net/wireless/realtek/rtl8723cs/platform/platform_arm_act_sdio.c b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_arm_act_sdio.c
new file mode 100644
index 000000000..539bb178c
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_arm_act_sdio.c
@@ -0,0 +1,58 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2013 Realtek Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ ******************************************************************************/
+/*
+ * Description:
+ * This file can be applied to following platforms:
+ * CONFIG_PLATFORM_ACTIONS_ATM703X
+ */
+#include <drv_types.h>
+
+#ifdef CONFIG_PLATFORM_ACTIONS_ATM705X
+extern int acts_wifi_init(void);
+extern void acts_wifi_cleanup(void);
+#endif
+
+/*
+ * Return:
+ * 0: power on successfully
+ * others: power on failed
+ */
+int platform_wifi_power_on(void)
+{
+ int ret = 0;
+
+#ifdef CONFIG_PLATFORM_ACTIONS_ATM705X
+ ret = acts_wifi_init();
+ if (unlikely(ret < 0)) {
+ pr_err("%s Failed to register the power control driver.\n", __FUNCTION__);
+ goto exit;
+ }
+#endif
+
+exit:
+ return ret;
+}
+
+void platform_wifi_power_off(void)
+{
+#ifdef CONFIG_PLATFORM_ACTIONS_ATM705X
+ acts_wifi_cleanup();
+#endif
+}
diff --git a/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ops.c b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ops.c
new file mode 100644
index 000000000..cd2f4e538
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ops.c
@@ -0,0 +1,37 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2013 Realtek Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ ******************************************************************************/
+#ifndef CONFIG_PLATFORM_OPS
+/*
+ * Return:
+ * 0: power on successfully
+ * others: power on failed
+ */
+int platform_wifi_power_on(void)
+{
+ int ret = 0;
+
+
+ return ret;
+}
+
+void platform_wifi_power_off(void)
+{
+}
+#endif // !CONFIG_PLATFORM_OPS
diff --git a/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ops.h b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ops.h
new file mode 100644
index 000000000..7b66f445f
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_ops.h
@@ -0,0 +1,31 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2013 Realtek Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ ******************************************************************************/
+#ifndef __PLATFORM_OPS_H__
+#define __PLATFORM_OPS_H__
+
+/*
+ * Return:
+ * 0: power on successfully
+ * others: power on failed
+ */
+int platform_wifi_power_on(void);
+void platform_wifi_power_off(void);
+
+#endif // __PLATFORM_OPS_H__
diff --git a/drivers/net/wireless/realtek/rtl8723cs/platform/platform_sprd_sdio.c b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_sprd_sdio.c
new file mode 100644
index 000000000..eec894503
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/platform/platform_sprd_sdio.c
@@ -0,0 +1,89 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2013 Realtek Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ ******************************************************************************/
+#include <drv_types.h>
+
+extern void sdhci_bus_scan(void);
+#ifndef ANDROID_2X
+extern int sdhci_device_attached(void);
+#endif
+
+/*
+ * Return:
+ * 0: power on successfully
+ * others: power on failed
+ */
+int platform_wifi_power_on(void)
+{
+ int ret = 0;
+
+
+#ifdef CONFIG_RTL8188E
+ rtw_wifi_gpio_wlan_ctrl(WLAN_POWER_ON);
+#endif // CONFIG_RTL8188E
+
+ /* Pull up pwd pin, make wifi leave power down mode. */
+ rtw_wifi_gpio_init();
+ rtw_wifi_gpio_wlan_ctrl(WLAN_PWDN_ON);
+
+#if (MP_DRIVER == 1) && (defined(CONFIG_RTL8723A)||defined(CONFIG_RTL8723B))
+ // Pull up BT reset pin.
+ rtw_wifi_gpio_wlan_ctrl(WLAN_BT_PWDN_ON);
+#endif
+ rtw_mdelay_os(5);
+
+ sdhci_bus_scan();
+#ifdef CONFIG_RTL8723B
+ //YJ,test,130305
+ rtw_mdelay_os(1000);
+#endif
+#ifdef ANDROID_2X
+ rtw_mdelay_os(200);
+#else // !ANDROID_2X
+ if (1) {
+ int i = 0;
+
+ for (i = 0; i <= 50; i++) {
+ msleep(10);
+ if (sdhci_device_attached())
+ break;
+ printk("%s delay times:%d\n", __func__, i);
+ }
+ }
+#endif // !ANDROID_2X
+
+ return ret;
+}
+
+void platform_wifi_power_off(void)
+{
+ /* Pull down pwd pin, make wifi enter power down mode. */
+ rtw_wifi_gpio_wlan_ctrl(WLAN_PWDN_OFF);
+ rtw_mdelay_os(5);
+ rtw_wifi_gpio_deinit();
+
+#ifdef CONFIG_RTL8188E
+ rtw_wifi_gpio_wlan_ctrl(WLAN_POWER_OFF);
+#endif // CONFIG_RTL8188E
+
+#ifdef CONFIG_WOWLAN
+ if(mmc_host)
+ mmc_host->pm_flags &= ~MMC_PM_KEEP_POWER;
+#endif // CONFIG_WOWLAN
+}
--
2.34.1

View File

@@ -1,37 +0,0 @@
From 2b9c9844aedd237394cfc692dc27f17594660dd4 Mon Sep 17 00:00:00 2001
From: The-going <48602507+The-going@users.noreply.github.com>
Date: Thu, 3 Feb 2022 11:32:27 +0300
Subject: [PATCH 1/9] drv:net:wireless:realtek Add build rtl8723cs
---
drivers/net/wireless/realtek/Kconfig | 1 +
drivers/net/wireless/realtek/Makefile | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/net/wireless/realtek/Kconfig b/drivers/net/wireless/realtek/Kconfig
index 4a1f0e64d..72e4c7446 100644
--- a/drivers/net/wireless/realtek/Kconfig
+++ b/drivers/net/wireless/realtek/Kconfig
@@ -15,6 +15,7 @@ if WLAN_VENDOR_REALTEK
source "drivers/net/wireless/realtek/rtl818x/Kconfig"
source "drivers/net/wireless/realtek/rtlwifi/Kconfig"
source "drivers/net/wireless/realtek/rtl8xxxu/Kconfig"
+source "drivers/net/wireless/realtek/rtl8723cs/Kconfig"
source "drivers/net/wireless/realtek/rtw88/Kconfig"
source "drivers/net/wireless/realtek/rtw89/Kconfig"
diff --git a/drivers/net/wireless/realtek/Makefile b/drivers/net/wireless/realtek/Makefile
index ab25419f5..c539bae2e 100644
--- a/drivers/net/wireless/realtek/Makefile
+++ b/drivers/net/wireless/realtek/Makefile
@@ -5,6 +5,7 @@
obj-$(CONFIG_RTL8180) += rtl818x/
obj-$(CONFIG_RTL8187) += rtl818x/
+obj-$(CONFIG_RTL8723CS) += rtl8723cs/
obj-$(CONFIG_RTLWIFI) += rtlwifi/
obj-$(CONFIG_RTL8XXXU) += rtl8xxxu/
obj-$(CONFIG_RTW88) += rtw88/
--
2.34.1

View File

@@ -162,18 +162,6 @@
patches.armbian/arm64-dts-sun50i-h6-orangepi-add-cpu-opp-refs.patch
patches.armbian/arm64-dts-sun50i-h6-orangepi-enable-higher-clock-regulator-max-.patch
patches.armbian/Fix-compile-error-node-not-found.patch
#
# Old driver rtl8723cs
#
patches.armbian/drv-net-wireless-realtek-Add-build-rtl8723cs.patch
patches.armbian/drv-net-rtl8723cs-base.patch
patches.armbian/drv-net-rtl8723cs-core.patch
patches.armbian/drv-net-rtl8723cs-include.patch
patches.armbian/drv-net-rtl8723cs-platform.patch
patches.armbian/drv-net-rtl8723cs-os_dep.patch
patches.armbian/drv-net-rtl8723cs-hal-base-rtl8703b-led-efuse.patch
patches.armbian/drv-net-rtl8723cs-hal-btc.patch
patches.armbian/drv-net-rtl8723cs-hal-phydm.patch
patches.armbian/drv-staging-rtl8723bs-AP-bugfix.patch
patches.armbian/arm-dts-sun8i-h3-orangepi-pc-plus-add-wifi_pwrseq.patch

View File

@@ -707,23 +707,6 @@
patches.armbian/arm64-dts-sun50i-h6-orangepi-enable-higher-clock-regulator-max-.patch
patches.armbian/Fix-compile-error-node-not-found.patch
# The old rtl8723cs driver is disabled by default.
# To use it, remove the minus "-" at the beginning of the line.
# In this case, two drivers named rtl8723cs and rtl8723cs-old
# will be created.
# You will not be able to choose one - the old or the new driver
# in the kernel configuration.
#
- patches.armbian/drv-net-wireless-realtek-Add-build-rtl8723cs.patch
- patches.armbian/drv-net-rtl8723cs-base.patch
- patches.armbian/drv-net-rtl8723cs-core.patch
- patches.armbian/drv-net-rtl8723cs-include.patch
- patches.armbian/drv-net-rtl8723cs-platform.patch
- patches.armbian/drv-net-rtl8723cs-os_dep.patch
- patches.armbian/drv-net-rtl8723cs-hal-base-rtl8703b-led-efuse.patch
- patches.armbian/drv-net-rtl8723cs-hal-btc.patch
- patches.armbian/drv-net-rtl8723cs-hal-phydm.patch
patches.armbian/drv-staging-rtl8723bs-AP-bugfix.patch
patches.armbian/arm-dts-sun8i-h3-orangepi-pc-plus-add-wifi_pwrseq.patch
patches.armbian/arm64-dts-sun50i-h5-orangepi-prime-add-rtl8723cs.patch

View File

@@ -1 +1 @@
archive/sunxi-5.16
archive/sunxi-5.17