Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Joseph <adam-FEgOTC+cuHmFhqYwkx2y8jh339VZgyU0@public.gmane.org>
To: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: [Question] rk3399-gru-kevin post-kexec() severe screen flickering
Date: Sat, 25 Jan 2020 13:24:47 -1000	[thread overview]
Message-ID: <20200125132447.48f01721@kleene> (raw)

Hello all,

My daily driver is a linux on a Samsung XE513 aka "Chromebook Plus"
aka rk3399-gru-kevin, using coreboot (loaded from SPI NOR) with a
hardwired linux kernel FIT image compiled into the coreboot.rom.
I'm moving towards this "burned-in" kernel being merely a first-stage
bootloader that loads the real kernel from non-eeprom storage, checks
its hash, and then kexec()'s it.

I've managed to get this working; the magic incantation is to add
"irqchip.gicv3_nolpi=1" for the first-stage kernel, and pull this
patch when compiling it:

  https://lore.kernel.org/patchwork/cover/933456/

This works great, except that after loading the second kernel the
screen flickers very badly and continuously.  The flicker is
especially bad if I use the touchscreen.  This doesn't happen if the
exact same "second kernel" image is booted directly out of NOR flash
by coreboot.  Is there some way to totally power down the touchscreen
digitizer, and if so would that help?  I could live without the
touchscreen if I had to.  Can cut PCB traces if necessary.

I noticed that eballetbo (to whom I am eternally grateful for all the
work he does to make mainline linux on gru-kevin possible) came across
the same problem, as documented here:

  https://freenode.irclog.whitequark.org/linux-rockchip/2018-11-20#23524255

Has there been any more progress on this?  If not, can anybody get me
pointed in the right direction to try to fix this myself?

I'm guessing the "clocks" here refer to PLL registers -- VCO taps,
dividers, etc.  I'm very familiar with that sort of stuff from the
FPGA world, although the last time I did any kernel hacking was before
devicetrees were popular.  Is there some way to brute-force dump the
state of all the rk3399's clocking-related registers so I can diff the
results from a post-kexec() and pre-kexec() kernel?

I see a lot of comments from rockchip employees about flicker being
caused by the resident ATF code deciding to fiddle with the DRAM DVFS
settings outside of the vertical blanking interval; is this relevant?
For example:

  https://groups.google.com/a/chromium.org/d/msg/chromium-os-reviews/8SD-sEw5_-Y/uJaXssVqFQAJ

On a related note, is there any way to have the ATF code delete itself
from memory after returning control to the coreboot ramstage?  I went
many months without usable suspend-to-ram and invested an absurd
amount of time before discovering that the intricate dance needed to
get the ATF to agree to suspend the machine only works with certain
versions of special branches of the ATF code.  It was a pretty unhappy
experience, and at this point I don't see the post-boot resident
portion of the ATF adding positive value.  If I can just boot linux
in EL3-secure-world after the ATF has set up the DRAM timings that
would seem to be simpler.

Thanks for any pointers,

  - a

                 reply	other threads:[~2020-01-25 23:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200125132447.48f01721@kleene \
    --to=adam-fegotc+cuhmfhqywkx2y8jh339vzgyu0@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox