Re: [U-Boot] [RFC PATCH 0/3] sunxi: video: Add support for HDMI output on H3

2017-02-05 Thread Rask Ingemann Lambertsen
On Tue, Dec 13, 2016 at 01:36:27AM +0100, Jernej Skrabec wrote:
> This patch series add support for HDMI output. Support for other,
> newer, SoCs, which also uses DE2 and same or similar HDMI controller
> and PHY can be easily added later (A83T/A64/H5/R40). Current driver
> can also be easily extended with TV out support, just like video
> driver for older Allwinner SoCs.
> 
> While driver works, I would like to get few opinions first.
> - From what I understand, drivers which supports DT are preferred.
>   Would it be better to rewrite this driver to support device tree?
> - TCON code is currently exactly the same as in driver for older
>   SoCs. Should I split it out into shared module? Also TV out code
>   seems to be similar, but I didn't manage to confirm that it works
>   as-is on H3.
> - A80 SoC is mix of older display engine and newer HDMI controller,
>   so it doesn't really work with either of sunxi video drivers. Two
>   solutions I see here are either combine both driver into one massive
>   display driver or, much better, split everything by components
>   (TCON/DE/DE2/HDMI/TV) and instantiate compatible ones. I guess this
>   is not much different than adding support for DT in drivers. Note
>   that I don't have any A80 board, I'm just thinking ahead.

I have an A80 board with HDMI connector, so I can help with testing.

Is there anywhere a list of which components are the same between
Allwinner's SoCs? If not, I'll also accept pointers to pieces of information
I can use to start a page on the wiki about it. How about the order in
which the SoCs where released?

-- 
Rask Ingemann Lambertsen
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 0/3] sunxi: video: Add support for HDMI output on H3

2016-12-17 Thread Simon Glass
Hi,

On 14 December 2016 at 01:37, Hans de Goede  wrote:
> Hi,
>
> On 13-12-16 21:28, Simon Glass wrote:
>>
>> Hi,
>>
>> On 12 December 2016 at 19:36, Jernej Skrabec 
>> wrote:
>>>
>>> This patch series add support for HDMI output. Support for other,
>>> newer, SoCs, which also uses DE2 and same or similar HDMI controller
>>> and PHY can be easily added later (A83T/A64/H5/R40). Current driver
>>> can also be easily extended with TV out support, just like video
>>> driver for older Allwinner SoCs.
>>>
>>> While driver works, I would like to get few opinions first.
>>> - From what I understand, drivers which supports DT are preferred.
>>>   Would it be better to rewrite this driver to support device tree?
>>
>>
>> Yes I think so, and in fact it should use driver model also.
>>
>> The rockchip driver provides a reasonable example of how to split the
>> driver up as you suggest below. The VIDEO driver provides the
>> top-level video interface, DISPLAY drivers provide display output for
>> the video, and you have PANEL as well for receiving the display
>> output. VIDCONSOLE works automatically to display text.
>>
>> I actually took a bit of a look at this a few weeks ago so am happy to
>> help with review or discussions.
>
>
> I'm all in favor of moving to the driver-model, but I believe that
> we first need proper support for the DE2 and new HMDI encoder in
> the kernel, so that the dt bindings are clear.
>
> Once that is in place it would be good to look into converting the
> u-boot code to the driver-model. Since that likely is going to
> take a while I think it would be good to move ahead with this
> patch set as is (with review comments addressed) and later replace
> it with a driver-model based implementation. But that is no longer
> my call :)

We can disconnect DT from driver model without too much trouble. But I
do worry about adding more code to what is there. I think it would be
better to tease apart things into separate files for each block. At
least the display driver could converted to driver model
(UCLASS_VIDEO) since FWICT it has a compatible string in the kernel.
Even if there is nothing else, that is enough to cause the driver to
be probed.

Then it is easier to build on. If we go further down the non-DM path
it will become infeasible to re-architect later.

So my suggestion is:

- Create a UCLASS_VIDEO driver and put some of the code in that
- Create UCLASS_DISPLAY drivers for the HDMI, LCD, etc. and move that
code into a separate file for each
- Use manual probing or whatever to make it work for now. In other
words, instead of doing things entirely with the DT as rockchip and
tegra do, find the display devices manually / hard coded for now.

Then when DT is sorted out it will be relatively easy to adjust things
 without wholesale rewrites.

So please let's not wait for DT bindings. It is just going to create
too much tech debt for any one person to fix.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 0/3] sunxi: video: Add support for HDMI output on H3

2016-12-14 Thread Maxime Ripard
On Wed, Dec 14, 2016 at 09:37:58AM +0100, Hans de Goede wrote:
> Hi,
> 
> On 13-12-16 21:28, Simon Glass wrote:
> > Hi,
> > 
> > On 12 December 2016 at 19:36, Jernej Skrabec  
> > wrote:
> > > This patch series add support for HDMI output. Support for other,
> > > newer, SoCs, which also uses DE2 and same or similar HDMI controller
> > > and PHY can be easily added later (A83T/A64/H5/R40). Current driver
> > > can also be easily extended with TV out support, just like video
> > > driver for older Allwinner SoCs.
> > > 
> > > While driver works, I would like to get few opinions first.
> > > - From what I understand, drivers which supports DT are preferred.
> > >   Would it be better to rewrite this driver to support device tree?
> > 
> > Yes I think so, and in fact it should use driver model also.
> > 
> > The rockchip driver provides a reasonable example of how to split the
> > driver up as you suggest below. The VIDEO driver provides the
> > top-level video interface, DISPLAY drivers provide display output for
> > the video, and you have PANEL as well for receiving the display
> > output. VIDCONSOLE works automatically to display text.
> > 
> > I actually took a bit of a look at this a few weeks ago so am happy to
> > help with review or discussions.
> 
> I'm all in favor of moving to the driver-model, but I believe that
> we first need proper support for the DE2 and new HMDI encoder in
> the kernel, so that the dt bindings are clear.

I agree, and I would even say that we shouldn't wait for that to
happen either. I don't have any objection merging it without the
driver model given how much time it took last time to have a driver
merged in the kernel for that block (with its bindings), and then
convert to the device model / DT once and when we have that.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 0/3] sunxi: video: Add support for HDMI output on H3

2016-12-14 Thread Hans de Goede

Hi,

On 13-12-16 21:28, Simon Glass wrote:

Hi,

On 12 December 2016 at 19:36, Jernej Skrabec  wrote:

This patch series add support for HDMI output. Support for other,
newer, SoCs, which also uses DE2 and same or similar HDMI controller
and PHY can be easily added later (A83T/A64/H5/R40). Current driver
can also be easily extended with TV out support, just like video
driver for older Allwinner SoCs.

While driver works, I would like to get few opinions first.
- From what I understand, drivers which supports DT are preferred.
  Would it be better to rewrite this driver to support device tree?


Yes I think so, and in fact it should use driver model also.

The rockchip driver provides a reasonable example of how to split the
driver up as you suggest below. The VIDEO driver provides the
top-level video interface, DISPLAY drivers provide display output for
the video, and you have PANEL as well for receiving the display
output. VIDCONSOLE works automatically to display text.

I actually took a bit of a look at this a few weeks ago so am happy to
help with review or discussions.


I'm all in favor of moving to the driver-model, but I believe that
we first need proper support for the DE2 and new HMDI encoder in
the kernel, so that the dt bindings are clear.

Once that is in place it would be good to look into converting the
u-boot code to the driver-model. Since that likely is going to
take a while I think it would be good to move ahead with this
patch set as is (with review comments addressed) and later replace
it with a driver-model based implementation. But that is no longer
my call :)

Regards,

Hans
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 0/3] sunxi: video: Add support for HDMI output on H3

2016-12-13 Thread Simon Glass
Hi,

On 12 December 2016 at 19:36, Jernej Skrabec  wrote:
> This patch series add support for HDMI output. Support for other,
> newer, SoCs, which also uses DE2 and same or similar HDMI controller
> and PHY can be easily added later (A83T/A64/H5/R40). Current driver
> can also be easily extended with TV out support, just like video
> driver for older Allwinner SoCs.
>
> While driver works, I would like to get few opinions first.
> - From what I understand, drivers which supports DT are preferred.
>   Would it be better to rewrite this driver to support device tree?

Yes I think so, and in fact it should use driver model also.

The rockchip driver provides a reasonable example of how to split the
driver up as you suggest below. The VIDEO driver provides the
top-level video interface, DISPLAY drivers provide display output for
the video, and you have PANEL as well for receiving the display
output. VIDCONSOLE works automatically to display text.

I actually took a bit of a look at this a few weeks ago so am happy to
help with review or discussions.

> - TCON code is currently exactly the same as in driver for older
>   SoCs. Should I split it out into shared module? Also TV out code
>   seems to be similar, but I didn't manage to confirm that it works
>   as-is on H3.
> - A80 SoC is mix of older display engine and newer HDMI controller,
>   so it doesn't really work with either of sunxi video drivers. Two
>   solutions I see here are either combine both driver into one massive
>   display driver or, much better, split everything by components
>   (TCON/DE/DE2/HDMI/TV) and instantiate compatible ones. I guess this
>   is not much different than adding support for DT in drivers. Note
>   that I don't have any A80 board, I'm just thinking ahead.
>
> Best regards,
> Jernej Skrabec
>
>
> Jernej Skrabec (3):
>   sunxi: Add clocks for DE2/HDMI/TCON
>   sunxi: video: Add video driver for H3 SoC
>   sunxi: Enable H3 video driver in defconfigs
>
>  arch/arm/include/asm/arch-sunxi/clock_sun6i.h |   43 +
>  arch/arm/include/asm/arch-sunxi/cpu_sun4i.h   |8 +
>  arch/arm/include/asm/arch-sunxi/display2.h|  377 +
>  arch/arm/mach-sunxi/clock_sun6i.c |   28 +
>  board/sunxi/Kconfig   |4 +-
>  configs/orangepi_2_defconfig  |1 +
>  configs/orangepi_lite_defconfig   |1 +
>  configs/orangepi_one_defconfig|1 +
>  configs/orangepi_pc_defconfig |1 +
>  configs/orangepi_pc_plus_defconfig|1 +
>  configs/orangepi_plus2e_defconfig |1 +
>  configs/orangepi_plus_defconfig   |1 +
>  drivers/video/Makefile|1 +
>  drivers/video/sunxi_display2.c| 1037 
> +
>  include/configs/sunxi-common.h|   17 +-
>  scripts/config_whitelist.txt  |1 +
>  16 files changed, 1516 insertions(+), 7 deletions(-)
>  create mode 100644 arch/arm/include/asm/arch-sunxi/display2.h
>  create mode 100644 drivers/video/sunxi_display2.c
>
> --
> 2.10.2
>

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH 0/3] sunxi: video: Add support for HDMI output on H3

2016-12-13 Thread Jernej Skrabec
This patch series add support for HDMI output. Support for other,
newer, SoCs, which also uses DE2 and same or similar HDMI controller
and PHY can be easily added later (A83T/A64/H5/R40). Current driver
can also be easily extended with TV out support, just like video
driver for older Allwinner SoCs.

While driver works, I would like to get few opinions first.
- From what I understand, drivers which supports DT are preferred.
  Would it be better to rewrite this driver to support device tree?
- TCON code is currently exactly the same as in driver for older
  SoCs. Should I split it out into shared module? Also TV out code
  seems to be similar, but I didn't manage to confirm that it works
  as-is on H3.
- A80 SoC is mix of older display engine and newer HDMI controller,
  so it doesn't really work with either of sunxi video drivers. Two
  solutions I see here are either combine both driver into one massive
  display driver or, much better, split everything by components
  (TCON/DE/DE2/HDMI/TV) and instantiate compatible ones. I guess this
  is not much different than adding support for DT in drivers. Note
  that I don't have any A80 board, I'm just thinking ahead.

Best regards,
Jernej Skrabec


Jernej Skrabec (3):
  sunxi: Add clocks for DE2/HDMI/TCON
  sunxi: video: Add video driver for H3 SoC
  sunxi: Enable H3 video driver in defconfigs

 arch/arm/include/asm/arch-sunxi/clock_sun6i.h |   43 +
 arch/arm/include/asm/arch-sunxi/cpu_sun4i.h   |8 +
 arch/arm/include/asm/arch-sunxi/display2.h|  377 +
 arch/arm/mach-sunxi/clock_sun6i.c |   28 +
 board/sunxi/Kconfig   |4 +-
 configs/orangepi_2_defconfig  |1 +
 configs/orangepi_lite_defconfig   |1 +
 configs/orangepi_one_defconfig|1 +
 configs/orangepi_pc_defconfig |1 +
 configs/orangepi_pc_plus_defconfig|1 +
 configs/orangepi_plus2e_defconfig |1 +
 configs/orangepi_plus_defconfig   |1 +
 drivers/video/Makefile|1 +
 drivers/video/sunxi_display2.c| 1037 +
 include/configs/sunxi-common.h|   17 +-
 scripts/config_whitelist.txt  |1 +
 16 files changed, 1516 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-sunxi/display2.h
 create mode 100644 drivers/video/sunxi_display2.c

-- 
2.10.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot