phy: sun4i-usb: Call phy_passby even for PHY#0
Subsystems (2)
PATCH v2 1/4 phy: sun4i-usb: Call phy_passby even for PHY#0
On newer Allwinner SoC, there is a pair of EHCI/OHCI USB hosts for OTG host mode. USB PHY passby must be configured for its corresponding PHY. so we can call for PHY#0. on the other hand in past usb-phy code the same thing can be restricted for Lower SoC's, other than H3/H5/A64.
Now there is no need to restrict usb passby since the phy driver is DT enabled, and the respective phy calls will trigger based DT information initiated by the drivers.
---
Changes for v2:
- update commit message, suggested by 'Chen-Yu'
drivers/phy/allwinner/phy-sun4i-usb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/phy/allwinner/phy-sun4i-usb.c +1 -2
@@ -300,8 +300,7 @@ static int sun4i_usb_phy_init(struct phy *phy) data->cfg->disc_thresh, PHY_DISCON_TH_LEN); } -if (usb_phy->id !=0 ) -sun4i_usb_phy_passby (phy, true); +sun4i_usb_phy_passby (phy, true);sun4i_usb_phy0_reroute (data, true);
Signature · 1 line
2.17.1
PATCH v2 2/4 phy: sun4i-usb: Remove usb_clk_cfg set in probe
usb_clk_cfg is setting CTRL_PHYGATE bit value in probe which is BIT 0 for sun4i, 6i and 8 for a83t but all these were handling in phy ops init exit calls.
---
Changes for v2:
- none
drivers/phy/allwinner/phy-sun4i-usb.c | 2 -- 1 file changed, 2 deletions(-)
drivers/phy/allwinner/phy-sun4i-usb.c +0 -2
@@ -462,8 +462,6 @@ static int sun4i_usb_phy_probe(struct udevice *dev) phy->rst_mask = info->rst_mask; }; -setbits_le32 (&data->ccm->usb_clk_cfg,CCM_USB_CTRL_PHYGATE ); -debug ("Allwinner Sun4I USB PHY driver loaded\n" );return 0 ; }
Signature · 1 line
2.17.1
PATCH v2 3/4 phy: sun4i-usb: Update PHY#3 rst_mask only for H3_H5
In reply to Jagan TekiOnly H3 and H5 have 4 PHYS so restrict rst_mask only for them by checking PHY id as 3 and update the proper bits.
---
Changes for v2:
- update rst_mask value for H3_H5
drivers/phy/allwinner/phy-sun4i-usb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/phy/allwinner/phy-sun4i-usb.c +2 -3
@@ -117,9 +117,6 @@ struct sun4i_usb_phy_info { .gpio_vbus = CONFIG_USB3_VBUS_PIN, .gpio_vbus_det = NULL, .gpio_id_det = NULL, -#ifdef CONFIG_MACH_SUN6I - .rst_mask = (CCM_USB_CTRL_PHY3_RST | CCM_USB_CTRL_PHY3_CLK), -#endif }, };
@@ -460,6 +457,8 @@ static int sun4i_usb_phy_probe(struct udevice *dev) phy->id = i; phy->rst_mask = info->rst_mask; +if ((data->cfg->type == sun8i_h3_phy) && (phy->id ==3 )) + phy->rst_mask = (BIT (3 ) |BIT (11 )); };debug ("Allwinner Sun4I USB PHY driver loaded\n" );
Signature · 1 line
2.17.1
PATCH v2 4/4 configs: sunxi: Drop CONFIG_SUNXI_USB_PHYS
In reply to Jagan TekiNow number of PHY on Allwinner is handling via dt data, drivers at phy/allwinner/phy-sun4i-usb.c
---
Changes for v2:
- new patch
include/configs/sun4i.h | 2 -- include/configs/sun50i.h | 2 -- include/configs/sun5i.h | 2 -- include/configs/sun6i.h | 2 -- include/configs/sun7i.h | 2 -- include/configs/sun8i.h | 10 ---------- scripts/config_whitelist.txt | 1 - 7 files changed, 21 deletions(-)
include/configs/sun4i.h +0 -2
@@ -15,8 +15,6 @@#define CONFIG_USB_EHCI_SUNXI #endif -#define CONFIG_SUNXI_USB_PHYS 3 -/* * Include common sunxi configuration where most the settings are */
include/configs/sun50i.h +0 -2
@@ -15,8 +15,6 @@#define CONFIG_USB_MAX_CONTROLLER_COUNT 1#endif -#define CONFIG_SUNXI_USB_PHYS 1 -#define GICD_BASE 0x1c81000#define GICC_BASE 0x1c82000
include/configs/sun5i.h +0 -2
@@ -15,8 +15,6 @@#define CONFIG_USB_EHCI_SUNXI #endif -#define CONFIG_SUNXI_USB_PHYS 2 -/* * Include common sunxi configuration where most the settings are */
include/configs/sun6i.h +0 -2
@@ -18,8 +18,6 @@#define CONFIG_USB_EHCI_SUNXI #endif -#define CONFIG_SUNXI_USB_PHYS 3 -#define CONFIG_ARMV7_SECURE_BASE SUNXI_SRAM_B_BASE#define CONFIG_ARMV7_SECURE_MAX_SIZE (64 * 1024)/* 64 KB */
include/configs/sun7i.h +0 -2
@@ -16,8 +16,6 @@#define CONFIG_USB_EHCI_SUNXI #endif -#define CONFIG_SUNXI_USB_PHYS 3 -#define CONFIG_ARMV7_SECURE_BASE SUNXI_SRAM_B_BASE#define CONFIG_ARMV7_SECURE_MAX_SIZE (64 * 1024)/* 64 KB */
include/configs/sun8i.h +0 -10
@@ -16,16 +16,6 @@#define CONFIG_USB_EHCI_SUNXI #endif -#ifdef CONFIG_MACH_SUN8I_H3 -#define CONFIG_SUNXI_USB_PHYS 4 -#elif definedCONFIG_MACH_SUN8I_A83T -#define CONFIG_SUNXI_USB_PHYS 3 -#elif definedCONFIG_MACH_SUN8I_V3S -#define CONFIG_SUNXI_USB_PHYS 1 -#else -#define CONFIG_SUNXI_USB_PHYS 2 -#endif -/* * Include common sunxi configuration where most the settings are */
scripts/config_whitelist.txt +0 -1
@@ -2017,7 +2017,6 @@ CONFIG_ST_SMI CONFIG_SUNXI_AHCI CONFIG_SUNXI_GPIO CONFIG_SUNXI_MAX_FB_SIZE -CONFIG_SUNXI_USB_PHYS CONFIG_SUPERH_ON_CHIP_R8A66597 CONFIG_SUPPORT_EMMC_BOOT CONFIG_SUVD3
Signature · 1 line
2.17.1
PATCH v2 4/4 configs: sunxi: Drop CONFIG_SUNXI_USB_PHYS
Quoted 5 lines · Jagan Teki
Now number of PHY on Allwinner is handling via dt data, drivers at
phy/allwinner/phy-sun4i-usb.cSigned-off-by Jagan Teki <[email protected]>---
Applied all.