board: rockchip: Add panel auto-detection for Anbernic RGxx3
authorChris Morgan <macromorgan@hotmail.com>
Mon, 15 May 2023 16:00:30 +0000 (11:00 -0500)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 28 Jul 2023 10:45:02 +0000 (18:45 +0800)
commitff27afedff95f25bcd3c3ce90a4f35ea16b37e55
treea50d04d914c692ae97c2d32aba8cf0e39609c15e
parentb190381418c4850c5f0fb0cc43f3843f9d864ae0
board: rockchip: Add panel auto-detection for Anbernic RGxx3

Add support to automatically detect the panel for the Anbernic RGxx3.
This is done by creating a "pseudo driver" that provides only the bare
minimum to start the DSI controller and DSI DPHY. Once started, we then
can query the panel for its panel ID and compare it to a table of known
values. The panel compatible string (which corresponds to the upstream
Linux driver) is then defined as an environment variable "panel". The
panel compatible string is also changed automatically via an
ft_board_setup() call if what is detected differs from what is in the
loaded tree. This way, end users can use the same bootloader without
having to worry about which panel they have (as there is no obvious
way of knowing).

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c