Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: phy: samsung: Add support HSIC on Exynos4X12

This patch adds to enable High Speed Inter Chip on Exynos4X12. Both channels
are controlled by usbphy driver based on the patch series of usbphy driver
submitted by Tomasz Figa.

[1] https://patchwork.kernel.org/patch/2576121
[2] https://patchwork.kernel.org/patch/2576131
[3] https://patchwork.kernel.org/patch/2576141
[4] https://patchwork.kernel.org/patch/2576151
[5] https://patchwork.kernel.org/patch/2576161
[6] https://patchwork.kernel.org/patch/2576171

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

authored by

Dongjin Kim and committed by
Felipe Balbi
6d3d61f8 7a22cc97

+26 -2
+5
drivers/usb/phy/phy-samsung-usb.c
··· 100 100 reg_val |= en_mask; 101 101 102 102 writel(reg_val, reg); 103 + 104 + if (sphy->drv_data->cpu_type == TYPE_EXYNOS4X12) { 105 + writel(reg_val, sphy->pmuregs + EXYNOS4X12_PHY_HSIC_CTRL0); 106 + writel(reg_val, sphy->pmuregs + EXYNOS4X12_PHY_HSIC_CTRL1); 107 + } 103 108 } 104 109 EXPORT_SYMBOL_GPL(samsung_usbphy_set_isolation_4210); 105 110
+10
drivers/usb/phy/phy-samsung-usb.h
··· 47 47 #define RSTCON_HLINK_SWRST (0x1 << 1) 48 48 #define RSTCON_SWRST (0x1 << 0) 49 49 50 + /* EXYNOS4X12 */ 51 + #define EXYNOS4X12_PHY_HSIC_CTRL0 (0x04) 52 + #define EXYNOS4X12_PHY_HSIC_CTRL1 (0x08) 53 + 54 + #define PHYPWR_NORMAL_MASK_HSIC1 (0x7 << 12) 55 + #define PHYPWR_NORMAL_MASK_HSIC0 (0x7 << 9) 56 + #define PHYPWR_NORMAL_MASK_PHY1 (0x7 << 6) 57 + 58 + #define RSTCON_HOSTPHY_SWRST (0xf << 3) 59 + 50 60 /* EXYNOS5 */ 51 61 #define EXYNOS5_PHY_HOST_CTRL0 (0x00) 52 62
+11 -2
drivers/usb/phy/phy-samsung-usb2.c
··· 176 176 phypwr &= ~PHYPWR_NORMAL_MASK; 177 177 rstcon |= RSTCON_SWRST; 178 178 break; 179 - case TYPE_EXYNOS4210: 180 179 case TYPE_EXYNOS4X12: 180 + phypwr &= ~(PHYPWR_NORMAL_MASK_HSIC0 | 181 + PHYPWR_NORMAL_MASK_HSIC1 | 182 + PHYPWR_NORMAL_MASK_PHY1); 183 + rstcon |= RSTCON_HOSTPHY_SWRST; 184 + case TYPE_EXYNOS4210: 181 185 phypwr &= ~PHYPWR_NORMAL_MASK_PHY0; 182 186 rstcon |= RSTCON_SWRST; 183 187 default: ··· 194 190 /* reset all ports of PHY and Link */ 195 191 writel(rstcon, regs + SAMSUNG_RSTCON); 196 192 udelay(10); 193 + if (sphy->drv_data->cpu_type == TYPE_EXYNOS4X12) 194 + rstcon &= ~RSTCON_HOSTPHY_SWRST; 197 195 rstcon &= ~RSTCON_SWRST; 198 196 writel(rstcon, regs + SAMSUNG_RSTCON); 199 197 } ··· 246 240 case TYPE_S3C64XX: 247 241 phypwr |= PHYPWR_NORMAL_MASK; 248 242 break; 249 - case TYPE_EXYNOS4210: 250 243 case TYPE_EXYNOS4X12: 244 + phypwr |= (PHYPWR_NORMAL_MASK_HSIC0 | 245 + PHYPWR_NORMAL_MASK_HSIC1 | 246 + PHYPWR_NORMAL_MASK_PHY1); 247 + case TYPE_EXYNOS4210: 251 248 phypwr |= PHYPWR_NORMAL_MASK_PHY0; 252 249 default: 253 250 break;