summaryrefslogtreecommitdiff
path: root/sys/src/9/imx8/usbxhciimx.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2022-06-11 21:12:04 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2022-06-11 21:12:04 +0000
commit931ae0cfebeb46892406efc7468636e59f8110a9 (patch)
treeae94bfb7f75e49c986ae6968291d919623e17e90 /sys/src/9/imx8/usbxhciimx.c
parent276f2039a9bceb4bc23b0fa1ce3169057aac405e (diff)
imx8: mainscreen turn on!
supports the lcd panel and adds alot of infrastructure like for the ccm clock module and the i2c controllers.
Diffstat (limited to 'sys/src/9/imx8/usbxhciimx.c')
-rw-r--r--sys/src/9/imx8/usbxhciimx.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/src/9/imx8/usbxhciimx.c b/sys/src/9/imx8/usbxhciimx.c
index e08b80b19..6eebb3dfe 100644
--- a/sys/src/9/imx8/usbxhciimx.c
+++ b/sys/src/9/imx8/usbxhciimx.c
@@ -1774,6 +1774,17 @@ portreset(Hci *hp, int port, int on)
return 0;
}
+static void
+clkenable(int i, int on)
+{
+ char clk[32];
+
+ snprint(clk, sizeof(clk), "usb%d.ctrl", i+1);
+ setclkgate(clk, on);
+ snprint(clk, sizeof(clk), "usb%d.phy", i+1);
+ setclkgate(clk, on);
+}
+
static int
reset(Hci *hp)
{
@@ -1796,6 +1807,15 @@ reset(Hci *hp)
return -1;
Found:
+ if(i == 0){
+ for(i = 0; i < nelem(ctlrs); i++) clkenable(i, 0);
+ setclkrate("ccm_usb_bus_clk_root", "system_pll2_div2", 500*Mhz);
+ setclkrate("ccm_usb_core_ref_clk_root", "system_pll1_div8", 100*Mhz);
+ setclkrate("ccm_usb_phy_ref_clk_root", "system_pll1_div8", 100*Mhz);
+ i = 0;
+ }
+ clkenable(i, 1);
+
hp->init = init;
hp->dump = dump;
hp->interrupt = interrupt;