comfast_cf-e530n: qca953x_common
@$(call config_init,Comfast CF-E530N,cf-e530n,8,17,1,QCA_QCA953X_SOC)
@$(call define_add,CONFIG_FOR_COMFAST_CF_E530N,1)
+ @$(call define_add,CONFIG_USB,1)
@$(call define_add,CFG_ATHRS27_PHY,1)
@$(call define_add,CFG_ATH_GMAC_NMACS,2)
@$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
p2w_r602n: qca953x_common
@$(call config_init,P&W R602N,r602n,16,17,1,QCA_QCA953X_SOC)
@$(call define_add,CONFIG_FOR_P2W_R602N,1)
+ @$(call define_add,CONFIG_USB,1)
@$(call define_add,CFG_ATHRS27_PHY,1)
@$(call define_add,CFG_ATH_GMAC_NMACS,2)
@$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
tp-link_tl-mr3420_v3: qca953x_common lsdk_kernel
@$(call config_init,TP-Link TL-MR3420 v3,tl-mr3420-v3,4,12,1,QCA_QCA953X_SOC)
@$(call define_add,CONFIG_FOR_TPLINK_MR3420_V3,1)
+ @$(call define_add,CONFIG_USB,1)
@$(call define_add,CFG_ATHRS27_PHY,1)
@$(call define_add,CFG_ATH_GMAC_NMACS,2)
@$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
tp-link_tl-mr6400_v1v2: qca953x_common lsdk_kernel
@$(call config_init,TP-Link TL-MR6400 v1/v2,tl-mr6400-v1v2,8,12,1,QCA_QCA953X_SOC)
@$(call define_add,CONFIG_FOR_TPLINK_MR6400_V1V2,1)
+ @$(call define_add,CONFIG_USB,1)
@$(call define_add,CONFIG_QCA_ETH_PHY_SWAP,1)
@$(call define_add,CFG_ATHRS27_PHY,1)
@$(call define_add,CFG_ATH_GMAC_NMACS,2)
tp-link_tl-wr810n: qca953x_common lsdk_kernel
@$(call config_init,TP-Link TL-WR810N,tl-wr810n,8,12,1,QCA_QCA953X_SOC)
@$(call define_add,CONFIG_FOR_TPLINK_WR810N,1)
+ @$(call define_add,CONFIG_USB,1)
@$(call define_add,CFG_ATHRS27_PHY,1)
@$(call define_add,CFG_ATH_GMAC_NMACS,2)
@$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
tp-link_tl-wr820n_CN: qca953x_common lsdk_kernel
@$(call config_init,TP-Link TL-WR820N CN,tl-wr820n,4,12,1,QCA_QCA953X_SOC)
@$(call define_add,CONFIG_FOR_TPLINK_WR820N_CN,1)
+ @$(call define_add,CONFIG_USB,1)
@$(call define_add,CFG_ATHRS27_PHY,1)
@$(call define_add,CFG_ATH_GMAC_NMACS,2)
@$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
tp-link_tl-wr842n_v3: qca953x_common lsdk_kernel
@$(call config_init,TP-Link TL-WR842N/D v3,tl-wr842nd-v3,16,1,1,QCA_QCA953X_SOC)
@$(call define_add,CONFIG_FOR_TPLINK_WR842N_V3,1)
+ @$(call define_add,CONFIG_USB,1)
@$(call define_add,CFG_ATHRS27_PHY,1)
@$(call define_add,CFG_ATH_GMAC_NMACS,2)
@$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
tp-link_tl-wr902ac_v1: qca953x_common lsdk_kernel
@$(call config_init,TP-Link TL-WR902AC,tl-wr902ac,8,3,1,QCA_QCA953X_SOC)
@$(call define_add,CONFIG_FOR_TPLINK_WR902AC_V1,1)
+ @$(call define_add,CONFIG_USB,1)
@$(call define_add,CFG_ATHRS27_PHY,1)
@$(call define_add,CFG_ATH_GMAC_NMACS,2)
@$(call define_add,CONFIG_PCI,1)
wallys_dr531: qca953x_common
@$(call config_init,Wallys DR531,dr531,8,17,1,QCA_QCA953X_SOC)
@$(call define_add,CONFIG_FOR_WALLYS_DR531,1)
+ @$(call define_add,CONFIG_USB,1)
@$(call define_add,CFG_ATHRS27_PHY,1)
@$(call define_add,CFG_ATH_GMAC_NMACS,2)
@$(call define_add,CONFIG_PCI,1)
zbtlink_zbt-we1526: qca953x_common
@$(call config_init,Zbtlink ZBT-WE1526,zbt-we1526,16,17,1,QCA_QCA953X_SOC)
@$(call define_add,CONFIG_FOR_ZBTLINK_ZBT_WE1526,1)
+ @$(call define_add,CONFIG_USB,1)
@$(call define_add,CFG_ATHRS27_PHY,1)
@$(call define_add,CFG_ATH_GMAC_NMACS,2)
@$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
--- /dev/null
+/*
+ * Copyright (C) 2017 Piotr Dymacz <piotr@dymacz.pl>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <config.h>
+#include <common.h>
+#include <asm/addrspace.h>
+#include <soc/qca_soc_common.h>
+
+#if defined(CONFIG_USB)
+
+void usb_init(void)
+{
+#if (SOC_TYPE & QCA_QCA953X_SOC)
+ u32 val;
+
+ /* Select REFCLK USB PLL input */
+ val = qca_soc_reg_read(QCA_PLL_SWITCH_CLK_CTRL_REG);
+ val &= ~QCA_PLL_SWITCH_CLK_CTRL_USB_CLK_SEL_MASK;
+
+ if (qca_xtal_is_40mhz())
+ val |= (QCA_PLL_SWITCH_CLK_CTRL_USB_CLK_SEL_40M_VAL
+ << QCA_PLL_SWITCH_CLK_CTRL_USB_CLK_SEL_SHIFT);
+ else
+ val |= (QCA_PLL_SWITCH_CLK_CTRL_USB_CLK_SEL_25M_VAL
+ << QCA_PLL_SWITCH_CLK_CTRL_USB_CLK_SEL_SHIFT);
+
+ qca_soc_reg_write(QCA_PLL_SWITCH_CLK_CTRL_REG, val);
+ udelay(1000);
+
+ /* Take out USB PHY/HOST/PLL out of reset */
+ qca_soc_reg_read_set(QCA_RST_RESET_REG,
+ QCA_RST_RESET_USB_PHY_SUSPEND_ORIDE_MASK);
+ udelay(1000);
+
+ qca_soc_reg_read_clear(QCA_RST_RESET_REG,
+ QCA_RST_RESET_USB_PHY_ARST_MASK);
+ udelay(1000);
+
+ qca_soc_reg_read_clear(QCA_RST_RESET_REG,
+ QCA_RST_RESET_USB_PHY_RST_MASK);
+ udelay(1000);
+
+ qca_soc_reg_read_clear(QCA_RST_RESET_REG,
+ QCA_RST_RESET_USB_HOST_RST_MASK);
+ udelay(1000);
+
+ qca_soc_reg_read_clear(QCA_RST_RESET_REG,
+ QCA_RST_RESET_USB_PHY_PLLPWD_EXT_MASK);
+ udelay(10);
+#endif
+}
+
+#endif /* defined(CONFIG_USB) */