diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-06-11 21:12:04 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-06-11 21:12:04 +0000 |
commit | 931ae0cfebeb46892406efc7468636e59f8110a9 (patch) | |
tree | ae94bfb7f75e49c986ae6968291d919623e17e90 /sys/src/9/imx8/uartimx.c | |
parent | 276f2039a9bceb4bc23b0fa1ce3169057aac405e (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/uartimx.c')
-rw-r--r-- | sys/src/9/imx8/uartimx.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/src/9/imx8/uartimx.c b/sys/src/9/imx8/uartimx.c index 5d6e0d2f1..c7173f423 100644 --- a/sys/src/9/imx8/uartimx.c +++ b/sys/src/9/imx8/uartimx.c @@ -315,17 +315,35 @@ interrupt(Ureg*, void *arg) } static void +clkenable(Uart *u, int on) +{ + char clk[32]; + + snprint(clk, sizeof(clk), "%s.ipg_perclk", u->name); + if(on) setclkrate(clk, "osc_25m_ref_clk", u->freq); + setclkgate(clk, on); +} + +static void disable(Uart *u) { u32int *regs = u->regs; + + if(u->console) + return; /* avoid glitch */ + regs[UCR1] = 0; + clkenable(u, 0); } static void enable(Uart *u, int ie) { disable(u); + clkenable(u, 1); + if(ie) intrenable(IRQuart1, interrupt, u, BUSUNKNOWN, u->name); + config(u); } |