"Mali_PP0_MMU_IRQ";
};
dwc_control_usb: dwc-control-usb@20008000 {
- compatible = "rockchip,rk3188-dwc-control-usb";
+ compatible = "rockchip,rk3036-dwc-control-usb";
interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "otg_bvalid";
- //gpios = <&gpio0 GPIO_C0 GPIO_ACTIVE_LOW>, <&gpio3 GPIO_D5 GPIO_ACTIVE_LOW>;
clocks = <&clk_gates9 13>;
clock-names = "hclk_usb_peri";
rockchip,remote_wakeup;
rockchip,usb_irq_wakeup;
-
+ resets = <&reset RK3036_RST_USBPOR>;
+ reset-names = "usbphy_por";
usb_bc{
compatible = "rockchip,ctrl";
rk_usb,bvalid = <0x14c 8 1>;
rk_usb,softctrl = <0x17c 0 1>;
rk_usb,opmode = <0x17c 2 2>;
rk_usb,xcvrsel = <0x17c 4 2>;
- rk_usb,termsel = <0x118 6 1>;
+ rk_usb,termsel = <0x17c 6 1>;
};
};
usb0: usb@10180000 {
- compatible = "rockchip,rk3188_usb20_otg";
+ compatible = "rockchip,rk3036_usb20_otg";
reg = <0x10180000 0x40000>;
interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk_gates1 5>, <&clk_gates5 13>;
clock-names = "clk_usbphy0", "hclk_usb0";
+ resets = <&reset RK3036_RST_USBOTG0>, <&reset RK3036_RST_UTMI0>,
+ <&reset RK3036_RST_OTGC0>;
+ reset-names = "otg_ahb", "otg_phy", "otg_controller";
/*0 - Normal, 1 - Force Host, 2 - Force Device*/
rockchip,usb-mode = <0>;
};
usb1: usb@101c0000 {
- compatible = "rockchip,rk3188_usb20_host";
+ compatible = "rockchip,rk3036_usb20_host";
reg = <0x101c0000 0x40000>;
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk_gates1 6>, <&clk_gates7 3>;
clock-names = "clk_usbphy1", "hclk_usb1";
+ resets = <&reset RK3036_RST_USBOTG1>, <&reset RK3036_RST_UTMI1>,
+ <&reset RK3036_RST_OTGC1>;
+ reset-names = "host_ahb", "host_phy", "host_controller";
};
fb: fb{
}
}
-static void usb20otg_soft_reset(void)
+static void usb20otg_soft_reset(void *pdata, enum rkusb_rst_flag rst_type)
{
- writel(UOC_HIWORD_UPDATE(0x1, 0x3, 0),
- RK_GRF_VIRT + RK3036_GRF_UOC0_CON5);
- writel(UOC_HIWORD_UPDATE(0x1, 0x3, 0),
- RK_GRF_VIRT + RK3036_GRF_UOC1_CON5);
- /* cru_set_soft_reset(SOFT_RST_USBPOR, true); */
- writel(UOC_HIWORD_UPDATE(0x1, 0x1, 9),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST6_CON);
- /* cru_set_soft_reset(SOFT_RST_UTMI0, true); */
- writel(UOC_HIWORD_UPDATE(0x1, 0x1, 7),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST6_CON);
- /* cru_set_soft_reset(SOFT_RST_UTMI1, true); */
- writel(UOC_HIWORD_UPDATE(0x1, 0x1, 8),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST6_CON);
-
- udelay(15);
-
- writel(UOC_HIWORD_UPDATE(0x2, 0x3, 0),
- RK_GRF_VIRT + RK3036_GRF_UOC0_CON5);
- writel(UOC_HIWORD_UPDATE(0x2, 0x3, 0),
- RK_GRF_VIRT + RK3036_GRF_UOC1_CON5);
-
- udelay(1500);
- /* cru_set_soft_reset(SOFT_RST_USBPOR, false); */
- writel(UOC_HIWORD_UPDATE(0x0, 0x1, 9),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST6_CON);
- udelay(2);
- /* cru_set_soft_reset(SOFT_RST_UTMI0, false); */
- writel(UOC_HIWORD_UPDATE(0x0, 0x1, 7),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST6_CON);
- /* cru_set_soft_reset(SOFT_RST_UTMI1, false); */
- writel(UOC_HIWORD_UPDATE(0x0, 0x1, 8),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST6_CON);
-
- /* ctrler reset */
- /* cru_set_soft_reset(SOFT_RST_OTGC0, true); */
- writel(UOC_HIWORD_UPDATE(0x1, 0x1, 7),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST4_CON);
- /* cru_set_soft_reset(SOFT_RST_OTGC1, true); */
- writel(UOC_HIWORD_UPDATE(0x1, 0x1, 10),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST4_CON);
- udelay(2);
-
- /* cru_set_soft_reset(SOFT_RST_USBOTG0, true); */
- writel(UOC_HIWORD_UPDATE(0x1, 0x1, 5),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST4_CON);
- /* cru_set_soft_reset(SOFT_RST_USBOTG1, true); */
- writel(UOC_HIWORD_UPDATE(0x1, 0x1, 8),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST4_CON);
- udelay(2);
- /*
- cru_set_soft_reset(SOFT_RST_OTGC0,false);
- cru_set_soft_reset(SOFT_RST_OTGC1,false);
- ru_set_soft_reset(SOFT_RST_USBOTG0,false);
- cru_set_soft_reset(SOFT_RST_USBOTG1,false);
- */
- writel(UOC_HIWORD_UPDATE(0x0, 0x1, 7),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST4_CON);
- writel(UOC_HIWORD_UPDATE(0x0, 0x1, 10),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST4_CON);
- writel(UOC_HIWORD_UPDATE(0x0, 0x1, 5),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST4_CON);
- writel(UOC_HIWORD_UPDATE(0x0, 0x1, 8),
- RK_CRU_VIRT + RK3036_CRU_SOFTRST4_CON);
+ struct dwc_otg_platform_data *usbpdata = pdata;
+ struct reset_control *rst_otg_h, *rst_otg_p, *rst_otg_c;
+
+ rst_otg_h = devm_reset_control_get(usbpdata->dev, "otg_ahb");
+ rst_otg_p = devm_reset_control_get(usbpdata->dev, "otg_phy");
+ rst_otg_c = devm_reset_control_get(usbpdata->dev, "otg_controller");
+ if (IS_ERR(rst_otg_h) || IS_ERR(rst_otg_p) || IS_ERR(rst_otg_c)) {
+ dev_err(usbpdata->dev, "Fail to get reset control from dts\n");
+ return;
+ }
+
+ switch(rst_type) {
+ case RST_POR:
+ /* PHY reset */
+ writel(UOC_HIWORD_UPDATE(0x1, 0x3, 0),
+ RK_GRF_VIRT + RK3036_GRF_UOC0_CON5);
+ reset_control_assert(rst_otg_p);
+ udelay(15);
+ writel(UOC_HIWORD_UPDATE(0x2, 0x3, 0),
+ RK_GRF_VIRT + RK3036_GRF_UOC0_CON5);
+ udelay(1500);
+ reset_control_deassert(rst_otg_p);
+ udelay(2);
+
+ /* Controller reset */
+ reset_control_assert(rst_otg_c);
+ reset_control_assert(rst_otg_h);
+
+ udelay(2);
+
+ reset_control_deassert(rst_otg_c);
+ reset_control_deassert(rst_otg_h);
+ break;
+
+ default:
+ break;
+ }
}
static void usb20otg_clock_init(void *pdata)
}
}
-static void usb20host_soft_reset(void)
+static void usb20host_soft_reset(void *pdata, enum rkusb_rst_flag rst_type)
{
- ;
+ struct dwc_otg_platform_data *usbpdata = pdata;
+ struct reset_control *rst_host_h, *rst_host_p, *rst_host_c;
+
+ rst_host_h = devm_reset_control_get(usbpdata->dev, "host_ahb");
+ rst_host_p = devm_reset_control_get(usbpdata->dev, "host_phy");
+ rst_host_c = devm_reset_control_get(usbpdata->dev, "host_controller");
+ if (IS_ERR(rst_host_h) || IS_ERR(rst_host_p) || IS_ERR(rst_host_c)) {
+ dev_err(usbpdata->dev, "Fail to get reset control from dts\n");
+ return;
+ }
+
+ switch(rst_type) {
+ case RST_POR:
+ /* PHY reset */
+ writel(UOC_HIWORD_UPDATE(0x1, 0x3, 0),
+ RK_GRF_VIRT + RK3036_GRF_UOC1_CON5);
+ reset_control_assert(rst_host_p);
+ udelay(15);
+ writel(UOC_HIWORD_UPDATE(0x2, 0x3, 0),
+ RK_GRF_VIRT + RK3036_GRF_UOC1_CON5);
+
+ udelay(1500);
+ reset_control_deassert(rst_host_p);
+
+ /* Controller reset */
+ reset_control_assert(rst_host_c);
+ reset_control_assert(rst_host_h);
+
+ udelay(5);
+
+ reset_control_deassert(rst_host_c);
+ reset_control_deassert(rst_host_h);
+ break;
+
+ default:
+ break;
+ }
}
static void usb20host_clock_init(void *pdata)