interrupt-names = "otg_id", "otg_bvalid",
"otg_linestate", "host0_linestate",
"host1_linestate";
- /*gpios = <&gpio0 GPIO_B6 GPIO_ACTIVE_LOW>,*//*HOST_VBUS_DRV*/
- /* <&gpio0 GPIO_B4 GPIO_ACTIVE_LOW>;*//*OTG_VBUS_DRV*/
+ gpios = <&gpio0 GPIO_B6 GPIO_ACTIVE_LOW>,/*HOST_VBUS_DRV*/
+ <&gpio0 GPIO_B4 GPIO_ACTIVE_LOW>;/*OTG_VBUS_DRV*/
/*clocks = <&clk_gates7 9>;*/
/*clock-names = "hclk_usb_peri";*/
rockchip,remote_wakeup;
};
usb2: usb@ff500000 {
- compatible = "rockchip,rk3288_usbhs_host";
- reg = <0xff500000 0x40000>;
+ compatible = "rockchip,rk3288_rk_ehci_host";
+ reg = <0xff500000 0x20000>;
+ interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
/*clocks = <&clk_gates13 6>, <&clk_gates7 7>;*/
/*clock-names = "clk_usbphy2", "hclk_usb2";*/
- #address-cells = <1>;
- #size-cells = <1>;
- ranges;
-
- ehci: ehci@ff500000 {
- compatible = "rockchip,rk3288_rk_ehci_host";
- reg = <0xff500000 0x20000>;
- interrupt-parent = <&gic>;
- interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
- };
+ };
- ohci: ohci@ff520000 {
- compatible = "rockchip,rk3288_rk_ohci_host";
- reg = <0xff520000 0x20000>;
- interrupt-parent = <&gic>;
- interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
- };
+ usb3: usb@ff520000 {
+ compatible = "rockchip,rk3288_rk_ohci_host";
+ reg = <0xff520000 0x20000>;
+ interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
+ /*clocks = <&clk_gates13 6>, <&clk_gates7 7>;*/
+ /*clock-names = "clk_usbphy3", "hclk_usb3";*/
};
hsic: hsic@ff5c0000 {
/* other haredware init,include:
* DRV_VBUS GPIO init */
- /*if(gpio_get_value(control_usb->otg_gpios->gpio)){
+ if(gpio_get_value(control_usb->otg_gpios->gpio)){
gpio_set_value(control_usb->otg_gpios->gpio, 0);
- }*/
+ }
}
static void usb20otg_phy_suspend(void* pdata, int suspend)
#endif
static void usb20otg_power_enable(int enable)
-{ /*
+{
if(0 == enable){//disable otg_drv power
gpio_set_value(control_usb->otg_gpios->gpio, 0);
}else if(1 == enable){//enable otg_drv power
gpio_set_value(control_usb->otg_gpios->gpio, 1);
- }*/
+ }
}
/* other haredware init,include:
* DRV_VBUS GPIO init */
- /*if(!gpio_get_value(control_usb->host_gpios->gpio)){
+ if(!gpio_get_value(control_usb->host_gpios->gpio)){
gpio_set_value(control_usb->host_gpios->gpio, 1);
- }*/
+ }
}
static void usb20host_phy_suspend(void* pdata, int suspend)
}
static void usb20host_power_enable(int enable)
-{ /*
+{
if(0 == enable){//disable host_drv power
//do not disable power in default
}else if(1 == enable){//enable host_drv power
gpio_set_value(control_usb->host_gpios->gpio, 1);
- }*/
+ }
}
/* usb phy config init */
/* DRV_VBUS GPIO init */
- /*if(!gpio_get_value(control_usb->host_gpios->gpio)){
+ if(!gpio_get_value(control_usb->host_gpios->gpio)){
gpio_set_value(control_usb->host_gpios->gpio, 1);
- }*/
+ }
}
static void rk_ehci_clock_init(void* pdata)
struct rkehci_platform_data *usbpdata=pdata;
struct clk* ahbclk,*phyclk;
- ahbclk = of_clk_get_by_name(of_get_parent(usbpdata->dev.of_node), "hclk_usb2");
+ ahbclk = devm_clk_get(usbpdata->dev, "hclk_usb2");
if (IS_ERR(ahbclk)) {
dev_err(usbpdata->dev, "Failed to get hclk_usb2\n");
return;
}
- phyclk = of_clk_get_by_name(of_get_parent(usbpdata->dev.of_node), "clk_usbphy2");
+ phyclk = devm_clk_get(usbpdata->dev, "clk_usbphy2");
if (IS_ERR(phyclk)) {
dev_err(usbpdata->dev, "Failed to get clk_usbphy2\n");
return;
/* usb phy config init */
/* DRV_VBUS GPIO init */
- /*if(!gpio_get_value(control_usb->host_gpios->gpio)){
+ if(!gpio_get_value(control_usb->host_gpios->gpio)){
gpio_set_value(control_usb->host_gpios->gpio, 1);
- }*/
+ }
}
static void rk_ohci_clock_init(void* pdata)
struct rkehci_platform_data *usbpdata=pdata;
struct clk* ahbclk,*phyclk;
- ahbclk = of_clk_get_by_name(of_get_parent(usbpdata->dev.of_node), "hclk_usb2");
+ ahbclk =devm_clk_get(usbpdata->dev, "hclk_usb3");
if (IS_ERR(ahbclk)) {
- dev_err(usbpdata->dev, "Failed to get hclk_usb2\n");
+ dev_err(usbpdata->dev, "Failed to get hclk_usb3\n");
return;
}
- phyclk = of_clk_get_by_name(of_get_parent(usbpdata->dev.of_node), "clk_usbphy2");
+ phyclk = devm_clk_get(usbpdata->dev, "clk_usbphy3");;
if (IS_ERR(phyclk)) {
- dev_err(usbpdata->dev, "Failed to get clk_usbphy2\n");
+ dev_err(usbpdata->dev, "Failed to get clk_usbphy3\n");
return;
}
dev_err(&pdev->dev, "Failed to ioremap usb grf\n");
goto err2;
}
-/*
+
control_usb->host_gpios = devm_kzalloc(&pdev->dev, sizeof(struct gpio), GFP_KERNEL);
if(!control_usb->host_gpios){
dev_err(&pdev->dev, "unable to alloc memory for host_gpios\n");
goto err2;
}
gpio_direction_output(control_usb->otg_gpios->gpio, 0);
-*/
+
/* disable for debug
ret = otg_irq_detect_init(pdev);
if (ret < 0)
pldata->soft_reset();
usb_add_hcd(hcd, hcd->irq, IRQF_DISABLED | IRQF_SHARED);
ehci_port_power(ehci, 1);
- writel_relaxed(0x1d4d ,hcd->regs +0x90);
- writel_relaxed(0x4 ,hcd->regs +0xa0);
- dsb();
+// writel_relaxed(0x1d4d ,hcd->regs +0x90);
+// writel_relaxed(0x4 ,hcd->regs +0xa0);
+// dsb();
break;
default:
break;
g_ehci = ehci;
ehci_port_power(ehci, 1);
- writel_relaxed(0x1d4d ,hcd->regs +0x90);
- writel_relaxed(0x4 ,hcd->regs +0xa0);
- dsb();
+// writel_relaxed(0x1d4d ,hcd->regs +0x90);
+// writel_relaxed(0x4 ,hcd->regs +0xa0);
+// dsb();
printk("%s ok\n", __func__);