[U-Boot] [RFC PATCH 2/3] sunxi: video: Add video driver for H3 SoC
Jernej Škrabec
jernej.skrabec at siol.net
Tue Dec 13 21:13:11 CET 2016
Hi,
On Tue, Dec 13, 2016 at 16:40:55 CET, Maxime Ripard wrote:
> Hi,
>
> On Tue, Dec 13, 2016 at 01:36:29AM +0100, Jernej Skrabec wrote:
> > This patch adds support for hdmi output. It is designed in the same
> > way as video driver for older Allwinner SoCs.
> >
> > First it checks if monitor is attached. If it is, recommended
> > timings are read from EDID. After that, DE2, TCON and HDMI are
> > configured according to this timings.
> >
> > 32MB of RAM is used for framebuffer. This is just enough to support
> > 4K resolution.
> >
> > SimpleFB is also supported by this driver.
> >
> > Signed-off-by: Jernej Skrabec <jernej.skrabec at siol.net>
>
> From the linux discussion, I recall that you said that the TCON was
> still the same, and the HDMI was something that could be shared with
> the Rockchip implementation. Did you look into sharing the TCON code
> (for example using a small "library" to share the functions) and to
> reuse Rockchip's HDMI code?
For now, I only reused one TCON function and some defines. I tought that split
would be better done a bit later, when the driver will get support for LCD
screens (A64, for example). At that time TCON code would also be refactored to
be more generic and properly tested that it can be used with both drivers.
Unfortunatelly, I don't have any board with older SoC for testing.
While I took Rockchip HDMI code for reference, it can't be easily reused.
First of, it uses DT nodes. I guess I could write DT binding or modify
existing driver to work without it. Second issue here is same as in Linux, PHY
code is tightly coupled with controller code, so it needs to be decoupled
first. Thirdly, and in my opinion most annoying, Rockchip driver uses 32 bit
aligned registers, but H3 does not. This also means a lot of work to make it
more generic. Actually, H3 is more similar to i.MX6 HDMI in this regard, but
driver's code is scattered throughout multiple files (search for mxc_hdmi.h
inclusion). It is certainly doable, but it will take much more time.
Basically, U-Boot already has two drivers for DWC HDMI and with this patch it
will get third. Merging all three implementations into one would be very
tedious, but very desirable goal. I must state that I didn't really try to
understand i.MX6 HDMI code at all, so I don't now how hard it would be to pull
it out.
By the way, did you get cover letter?
Best regards,
Jernej Skrabec
>
> Thanks,
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
More information about the U-Boot
mailing list