Re: [U-Boot] [PATCH v3 0/6] sunxi: video: Add support for HDMI output on A64/H3/H5

2017-04-28 Thread Maxime Ripard
On Mon, Mar 27, 2017 at 07:22:28PM +0200, Jernej Skrabec wrote:
> This series implements support for HDMI output. This is done using
> DM video framework and sharing the HDMI controller code with RK3288.
> 
> Patch 1 splits out TCON code which is completely reusable on
> all Allwinner SoCs.
> 
> Patch 2 converts common TCON code to use DM video compatible timing
> structure.
> 
> Patch 3 adds all necessary clocks which are needed for Display
> Engine 2, TCON and HDMI.
> 
> Patch 4 implement actual DE2 and HDMI driver and patch 5 disables HDMI
> on all boards which don't have it (default is on).
> 

Applied patches 4 and 5 after the i2c series.

I'm doing a build test, and will push it when it's done.

Thanks a lot for your work!
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
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 0/6] sunxi: video: Add support for HDMI output on A64/H3/H5

2017-04-26 Thread Maxime Ripard
Hi Jernej,

On Tue, Apr 25, 2017 at 10:46:56PM +0200, Jernej Škrabec wrote:
> Hi Maxime,
> 
> Dne torek, 25. april 2017 ob 10:57:05 CEST je Maxime Ripard napisal(a):
> > On Mon, Apr 24, 2017 at 11:54:22PM +0200, Jernej Škrabec wrote:
> > > Hi Maxime,
> > > 
> > > Dne ponedeljek, 24. april 2017 ob 09:19:40 CEST je Maxime Ripard 
> napisal(a):
> > > > Hi Jernej,
> > > > 
> > > > On Fri, Apr 21, 2017 at 07:24:12PM +0200, Jernej Škrabec wrote:
> > > > > Dne petek, 21. april 2017 ob 09:04:13 CEST je Maxime Ripard 
> napisal(a):
> > > > > > Hi Jernej,
> > > > > > 
> > > > > > On Mon, Mar 27, 2017 at 07:22:28PM +0200, Jernej Skrabec wrote:
> > > > > > > This series implements support for HDMI output. This is done using
> > > > > > > DM video framework and sharing the HDMI controller code with
> > > > > > > RK3288.
> > > > > > > 
> > > > > > > Patch 1 splits out TCON code which is completely reusable on
> > > > > > > all Allwinner SoCs.
> > > > > > > 
> > > > > > > Patch 2 converts common TCON code to use DM video compatible
> > > > > > > timing
> > > > > > > structure.
> > > > > > > 
> > > > > > > Patch 3 adds all necessary clocks which are needed for Display
> > > > > > > Engine 2, TCON and HDMI.
> > > > > > 
> > > > > > I merged all these patches...
> > > > > > 
> > > > > > > Patch 4 implement actual DE2 and HDMI driver and patch 5 disables
> > > > > > > HDMI
> > > > > > > on all boards which don't have it (default is on).
> > > > > > 
> > > > > > But not this one, since it creates a Kconfig warning due to the
> > > > > > dependency of I2C_EDID on DM_I2C.
> > > > > > 
> > > > > > I think the current state of this discussion is that the i2c driver
> > > > > > should be converted to the DM, which seems to be stalled at the
> > > > > > moment.
> > > > > > 
> > > > > > Could you take in that patch and do the minor rework that were
> > > > > > suggested by Simon so that we can get this in ?
> > > 
> > > Sorry I missed what was suggested by Simon?
> > 
> > You have the history there:
> > https://patchwork.ozlabs.org/patch/734375/
> 
> Rework of this patch gives me a bit of a headache.
> 1. Should I remove DM reset and clk calls since they are not yet supported by 
> sunxi? If so, where should clocks be enabled? In board config?

I'd say so, yes. This is not really nice, but this is just temporary,
since we also have those patches being worked on at the moment.

> 2. SPL code uses old I2C interface for setting regulators, so all code which 
> is called only in SPL but compiled also for U-Boot proper needs to be wrapped 
> inside "#ifdef CONFIG_SPL_BUILD" or is there a better way? Example for that 
> is 
> drivers/power/sy8106a.c

I'm not aware of any way better than either having that ifdef, or
having a separate Kconfig option, but that's pretty much the same
thing.

> 3. Even if we solve everything nicely, most boards don't have anything 
> attached to I2C besides power regulators, so I2C busses won't be probed 
> anyway. This feels like a step back since you can't use i2c command unless 
> device with available DM driver is defined in DT.

This isn't really an issue for me. All the relevant busses should be
declared in the DT in the first place, so the fix for that one would
be to simply add the bus and be done with it.

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
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 0/6] sunxi: video: Add support for HDMI output on A64/H3/H5

2017-04-25 Thread Jernej Škrabec
Hi Maxime,

Dne torek, 25. april 2017 ob 10:57:05 CEST je Maxime Ripard napisal(a):
> On Mon, Apr 24, 2017 at 11:54:22PM +0200, Jernej Škrabec wrote:
> > Hi Maxime,
> > 
> > Dne ponedeljek, 24. april 2017 ob 09:19:40 CEST je Maxime Ripard 
napisal(a):
> > > Hi Jernej,
> > > 
> > > On Fri, Apr 21, 2017 at 07:24:12PM +0200, Jernej Škrabec wrote:
> > > > Dne petek, 21. april 2017 ob 09:04:13 CEST je Maxime Ripard 
napisal(a):
> > > > > Hi Jernej,
> > > > > 
> > > > > On Mon, Mar 27, 2017 at 07:22:28PM +0200, Jernej Skrabec wrote:
> > > > > > This series implements support for HDMI output. This is done using
> > > > > > DM video framework and sharing the HDMI controller code with
> > > > > > RK3288.
> > > > > > 
> > > > > > Patch 1 splits out TCON code which is completely reusable on
> > > > > > all Allwinner SoCs.
> > > > > > 
> > > > > > Patch 2 converts common TCON code to use DM video compatible
> > > > > > timing
> > > > > > structure.
> > > > > > 
> > > > > > Patch 3 adds all necessary clocks which are needed for Display
> > > > > > Engine 2, TCON and HDMI.
> > > > > 
> > > > > I merged all these patches...
> > > > > 
> > > > > > Patch 4 implement actual DE2 and HDMI driver and patch 5 disables
> > > > > > HDMI
> > > > > > on all boards which don't have it (default is on).
> > > > > 
> > > > > But not this one, since it creates a Kconfig warning due to the
> > > > > dependency of I2C_EDID on DM_I2C.
> > > > > 
> > > > > I think the current state of this discussion is that the i2c driver
> > > > > should be converted to the DM, which seems to be stalled at the
> > > > > moment.
> > > > > 
> > > > > Could you take in that patch and do the minor rework that were
> > > > > suggested by Simon so that we can get this in ?
> > 
> > Sorry I missed what was suggested by Simon?
> 
> You have the history there:
> https://patchwork.ozlabs.org/patch/734375/

Rework of this patch gives me a bit of a headache.
1. Should I remove DM reset and clk calls since they are not yet supported by 
sunxi? If so, where should clocks be enabled? In board config?

2. SPL code uses old I2C interface for setting regulators, so all code which 
is called only in SPL but compiled also for U-Boot proper needs to be wrapped 
inside "#ifdef CONFIG_SPL_BUILD" or is there a better way? Example for that is 
drivers/power/sy8106a.c

3. Even if we solve everything nicely, most boards don't have anything 
attached to I2C besides power regulators, so I2C busses won't be probed 
anyway. This feels like a step back since you can't use i2c command unless 
device with available DM driver is defined in DT.

Regards,
Jernej
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 0/6] sunxi: video: Add support for HDMI output on A64/H3/H5

2017-04-25 Thread Maxime Ripard
On Mon, Apr 24, 2017 at 11:54:22PM +0200, Jernej Škrabec wrote:
> Hi Maxime,
> 
> Dne ponedeljek, 24. april 2017 ob 09:19:40 CEST je Maxime Ripard napisal(a):
> > Hi Jernej,
> > 
> > On Fri, Apr 21, 2017 at 07:24:12PM +0200, Jernej Škrabec wrote:
> > > Dne petek, 21. april 2017 ob 09:04:13 CEST je Maxime Ripard napisal(a):
> > > > Hi Jernej,
> > > > 
> > > > On Mon, Mar 27, 2017 at 07:22:28PM +0200, Jernej Skrabec wrote:
> > > > > This series implements support for HDMI output. This is done using
> > > > > DM video framework and sharing the HDMI controller code with RK3288.
> > > > > 
> > > > > Patch 1 splits out TCON code which is completely reusable on
> > > > > all Allwinner SoCs.
> > > > > 
> > > > > Patch 2 converts common TCON code to use DM video compatible timing
> > > > > structure.
> > > > > 
> > > > > Patch 3 adds all necessary clocks which are needed for Display
> > > > > Engine 2, TCON and HDMI.
> > > > 
> > > > I merged all these patches...
> > > > 
> > > > > Patch 4 implement actual DE2 and HDMI driver and patch 5 disables HDMI
> > > > > on all boards which don't have it (default is on).
> > > > 
> > > > But not this one, since it creates a Kconfig warning due to the
> > > > dependency of I2C_EDID on DM_I2C.
> > > > 
> > > > I think the current state of this discussion is that the i2c driver
> > > > should be converted to the DM, which seems to be stalled at the
> > > > moment.
> > > > 
> > > > Could you take in that patch and do the minor rework that were
> > > > suggested by Simon so that we can get this in ?
> 
> Sorry I missed what was suggested by Simon?

You have the history there:
https://patchwork.ozlabs.org/patch/734375/

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
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 0/6] sunxi: video: Add support for HDMI output on A64/H3/H5

2017-04-24 Thread Jernej Škrabec
Hi Maxime,

Dne ponedeljek, 24. april 2017 ob 09:19:40 CEST je Maxime Ripard napisal(a):
> Hi Jernej,
> 
> On Fri, Apr 21, 2017 at 07:24:12PM +0200, Jernej Škrabec wrote:
> > Dne petek, 21. april 2017 ob 09:04:13 CEST je Maxime Ripard napisal(a):
> > > Hi Jernej,
> > > 
> > > On Mon, Mar 27, 2017 at 07:22:28PM +0200, Jernej Skrabec wrote:
> > > > This series implements support for HDMI output. This is done using
> > > > DM video framework and sharing the HDMI controller code with RK3288.
> > > > 
> > > > Patch 1 splits out TCON code which is completely reusable on
> > > > all Allwinner SoCs.
> > > > 
> > > > Patch 2 converts common TCON code to use DM video compatible timing
> > > > structure.
> > > > 
> > > > Patch 3 adds all necessary clocks which are needed for Display
> > > > Engine 2, TCON and HDMI.
> > > 
> > > I merged all these patches...
> > > 
> > > > Patch 4 implement actual DE2 and HDMI driver and patch 5 disables HDMI
> > > > on all boards which don't have it (default is on).
> > > 
> > > But not this one, since it creates a Kconfig warning due to the
> > > dependency of I2C_EDID on DM_I2C.
> > > 
> > > I think the current state of this discussion is that the i2c driver
> > > should be converted to the DM, which seems to be stalled at the
> > > moment.
> > > 
> > > Could you take in that patch and do the minor rework that were
> > > suggested by Simon so that we can get this in ?

Sorry I missed what was suggested by Simon?

> > 
> > Yes, of course. Should I also simplify the driver, because since then I
> > learned a bit more about DE2? Or should I sent follow up patch?
> 
> Which driver are you talking about? DE's or the i2c driver?

DE

> 
> If it is something that was already merged, it's better if you send
> follow up patches. If it's a patch that is still pending, then you can
> do it in that patch and resend a new version.

Ok, I will send a new version.

Regards,
Jernej
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 0/6] sunxi: video: Add support for HDMI output on A64/H3/H5

2017-04-24 Thread Maxime Ripard
Hi Jernej,

On Fri, Apr 21, 2017 at 07:24:12PM +0200, Jernej Škrabec wrote:
> Dne petek, 21. april 2017 ob 09:04:13 CEST je Maxime Ripard napisal(a):
> > Hi Jernej,
> > 
> > On Mon, Mar 27, 2017 at 07:22:28PM +0200, Jernej Skrabec wrote:
> > > This series implements support for HDMI output. This is done using
> > > DM video framework and sharing the HDMI controller code with RK3288.
> > > 
> > > Patch 1 splits out TCON code which is completely reusable on
> > > all Allwinner SoCs.
> > > 
> > > Patch 2 converts common TCON code to use DM video compatible timing
> > > structure.
> > > 
> > > Patch 3 adds all necessary clocks which are needed for Display
> > > Engine 2, TCON and HDMI.
> > 
> > I merged all these patches...
> > 
> > > Patch 4 implement actual DE2 and HDMI driver and patch 5 disables HDMI
> > > on all boards which don't have it (default is on).
> > 
> > But not this one, since it creates a Kconfig warning due to the
> > dependency of I2C_EDID on DM_I2C.
> > 
> > I think the current state of this discussion is that the i2c driver
> > should be converted to the DM, which seems to be stalled at the
> > moment.
> > 
> > Could you take in that patch and do the minor rework that were
> > suggested by Simon so that we can get this in ?
> 
> Yes, of course. Should I also simplify the driver, because since then I 
> learned a bit more about DE2? Or should I sent follow up patch?

Which driver are you talking about? DE's or the i2c driver?

If it is something that was already merged, it's better if you send
follow up patches. If it's a patch that is still pending, then you can
do it in that patch and resend a new version.

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
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 0/6] sunxi: video: Add support for HDMI output on A64/H3/H5

2017-04-21 Thread Jernej Škrabec
Dne petek, 21. april 2017 ob 09:04:13 CEST je Maxime Ripard napisal(a):
> Hi Jernej,
> 
> On Mon, Mar 27, 2017 at 07:22:28PM +0200, Jernej Skrabec wrote:
> > This series implements support for HDMI output. This is done using
> > DM video framework and sharing the HDMI controller code with RK3288.
> > 
> > Patch 1 splits out TCON code which is completely reusable on
> > all Allwinner SoCs.
> > 
> > Patch 2 converts common TCON code to use DM video compatible timing
> > structure.
> > 
> > Patch 3 adds all necessary clocks which are needed for Display
> > Engine 2, TCON and HDMI.
> 
> I merged all these patches...
> 
> > Patch 4 implement actual DE2 and HDMI driver and patch 5 disables HDMI
> > on all boards which don't have it (default is on).
> 
> But not this one, since it creates a Kconfig warning due to the
> dependency of I2C_EDID on DM_I2C.
> 
> I think the current state of this discussion is that the i2c driver
> should be converted to the DM, which seems to be stalled at the
> moment.
> 
> Could you take in that patch and do the minor rework that were
> suggested by Simon so that we can get this in ?

Yes, of course. Should I also simplify the driver, because since then I 
learned a bit more about DE2? Or should I sent follow up patch?

Regards,
Jernej
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 0/6] sunxi: video: Add support for HDMI output on A64/H3/H5

2017-04-21 Thread Maxime Ripard
Hi Jernej,

On Mon, Mar 27, 2017 at 07:22:28PM +0200, Jernej Skrabec wrote:
> This series implements support for HDMI output. This is done using
> DM video framework and sharing the HDMI controller code with RK3288.
> 
> Patch 1 splits out TCON code which is completely reusable on
> all Allwinner SoCs.
> 
> Patch 2 converts common TCON code to use DM video compatible timing
> structure.
> 
> Patch 3 adds all necessary clocks which are needed for Display
> Engine 2, TCON and HDMI.

I merged all these patches...

> Patch 4 implement actual DE2 and HDMI driver and patch 5 disables HDMI
> on all boards which don't have it (default is on).

But not this one, since it creates a Kconfig warning due to the
dependency of I2C_EDID on DM_I2C.

I think the current state of this discussion is that the i2c driver
should be converted to the DM, which seems to be stalled at the
moment.

Could you take in that patch and do the minor rework that were
suggested by Simon so that we can get this in ?

Thanks!
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
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 0/6] sunxi: video: Add support for HDMI output on A64/H3/H5

2017-03-27 Thread Jernej Skrabec
This series implements support for HDMI output. This is done using
DM video framework and sharing the HDMI controller code with RK3288.

Patch 1 splits out TCON code which is completely reusable on
all Allwinner SoCs.

Patch 2 converts common TCON code to use DM video compatible timing
structure.

Patch 3 adds all necessary clocks which are needed for Display
Engine 2, TCON and HDMI.

Patch 4 implement actual DE2 and HDMI driver and patch 5 disables HDMI
on all boards which don't have it (default is on).

Patch 6 is included here only for testing HDMI output on A64 due
to missing power regulator support (AXP803). Another option is to
use ATF which powers on HDMI. Such ATF can be found on Andre
Przywara's github.

Code was tested on OrangePi 2 & OrangePi Plus 2E (both H3),
OrangePi PC 2 (H5) and Pine64 (A64). It was tested on A10, A13 and A20
boards by others.

This series was developed on u-boot-sunxi repository with additional,
not yet merged, patch: https://patchwork.ozlabs.org/patch/735617/

All Rockchip patches were already merged to u-boot-rockchip repository
and are not yet present in u-boot-sunxi. They have to be cherry picked:
a0a2774aebdaa039ce787090c903cf47263f04c9
520c174b3564ae183f0e7c118dc8ce3770ae20b0
3bffe88d68e43b7bead12ef8020267fabc6c7ebf

Best regards,
Jernej Skrabec

Changes in v3:
- drop patch 1 because it was merged
- changed video output to 32 bpp
- collect acked by tags
- convert preprocessor symbol to Kconfig option (patch 3)
- Kconfig option in patch 4 depends on new option

Changes in v2:
- patch 1 & 2 were removed because they were merged
- collect reviewed by and tested by tags
- TCON split out patch is splitted in two patches
- fixed lcdc_enable() calls in video driver for old SoCs
- defconfigs should disable video driver, not enable it
- minor constant style fix


Icenowy Zheng (1):
  [DO NOT MERGE] sunxi: add AXP803 support

Jernej Skrabec (5):
  sunxi: video: Split out TCON code
  sunxi: video: Convert lcdc to use struct display_timing
  sunxi: Add clock support for DE2/HDMI/TCON on newer SoCs
  sunxi: video: Add A64/H3/H5 HDMI driver
  sunxi: Disable DE2 video driver where not needed

 arch/arm/include/asm/arch-sunxi/clock_sun6i.h |  54 
 arch/arm/include/asm/arch-sunxi/cpu_sun4i.h   |   8 +
 arch/arm/include/asm/arch-sunxi/display.h | 103 ---
 arch/arm/include/asm/arch-sunxi/display2.h| 124 
 arch/arm/include/asm/arch-sunxi/lcdc.h| 128 +
 arch/arm/mach-sunxi/Makefile  |   3 +
 arch/arm/mach-sunxi/clock_sun6i.c |  40 ++-
 arch/arm/mach-sunxi/pmic_bus.c|   6 +-
 arch/arm/mach-sunxi/rsb.c |   2 +-
 board/sunxi/Kconfig   |  16 ++
 board/sunxi/board.c   |  31 +-
 configs/nanopi_neo_air_defconfig  |   1 +
 configs/nanopi_neo_defconfig  |   1 +
 configs/orangepi_zero_defconfig   |   1 +
 drivers/power/Kconfig |  87 +++---
 drivers/power/Makefile|   1 +
 drivers/power/axp803.c| 256 +
 drivers/power/axp818.c|   2 +-
 drivers/video/Makefile|   2 +-
 drivers/video/sunxi/Makefile  |   9 +
 drivers/video/sunxi/lcdc.c| 209 ++
 drivers/video/sunxi/sunxi_de2.c   | 258 +
 drivers/video/{ => sunxi}/sunxi_display.c | 220 +++
 drivers/video/sunxi/sunxi_dw_hdmi.c   | 389 ++
 include/axp803.h  |  73 +
 include/axp_pmic.h|   3 +
 include/configs/sunxi-common.h|   5 +
 27 files changed, 1701 insertions(+), 331 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-sunxi/display2.h
 create mode 100644 arch/arm/include/asm/arch-sunxi/lcdc.h
 create mode 100644 drivers/power/axp803.c
 create mode 100644 drivers/video/sunxi/Makefile
 create mode 100644 drivers/video/sunxi/lcdc.c
 create mode 100644 drivers/video/sunxi/sunxi_de2.c
 rename drivers/video/{ => sunxi}/sunxi_display.c (87%)
 create mode 100644 drivers/video/sunxi/sunxi_dw_hdmi.c
 create mode 100644 include/axp803.h

-- 
2.12.1

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