diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-07-03 16:13:19 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-07-03 16:13:19 +0000 |
commit | c5cf9b3e26033272c5f57b9a860c335e63786045 (patch) | |
tree | 1d27cb0ef5050dba4a103e9c9441b21349fc544c /sys/src/9/imx8 | |
parent | 940e3165d31370871e66e0ae2cce13f010cb26ba (diff) |
imx8: qos magic to avoid interference between pcie and lcdif
when writing to the nvme ssd, the screen can glitch out.
found this in linux lcdif driver (mxcfb) that appears to
resolve the issue.
the QoSc registers are all completely undocumented tho :-(
Diffstat (limited to 'sys/src/9/imx8')
-rw-r--r-- | sys/src/9/imx8/pciimx.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/src/9/imx8/pciimx.c b/sys/src/9/imx8/pciimx.c index fbfca1546..ac1357af8 100644 --- a/sys/src/9/imx8/pciimx.c +++ b/sys/src/9/imx8/pciimx.c @@ -410,6 +410,34 @@ pcicfginit(void) rootinit(&ctlrs[1]); } +/* undocumented magic to avoid interference between lcdif and pcie */ +static void +qosmagic(void) +{ + static u32int *qosc = (u32int*)(VIRTIO + 0x7f0000); + + /* unlock */ + qosc[0x0000/4] = 0x0; + qosc[0x0000/4] = 0x1; + qosc[0x0060/4] = 0x0; + + /* pci1 */ + qosc[0x1000/4] = 0x0; + qosc[0x1000/4] = 0x1; + qosc[0x1050/4] = 0x01010100; + qosc[0x1060/4] = 0x01010100; + qosc[0x1070/4] = 0x01010100; + qosc[0x1000/4] = 0x1; + + /* pcie2 */ + qosc[0x2000/4] = 0x0; + qosc[0x2000/4] = 0x1; + qosc[0x2050/4] = 0x01010100; + qosc[0x2060/4] = 0x01010100; + qosc[0x2070/4] = 0x01010100; + qosc[0x2000/4] = 0x1; +} + enum { SRC_PCIEPHY_RCR = 0x2C/4, SRC_PCIE2_RCR = 0x48/4, @@ -494,4 +522,6 @@ pciimxlink(void) resetc[SRC_PCIE2_RCR] &= ~(PCIE_BTN | PCIE_G_RST); pcicfginit(); + + qosmagic(); } |