Re: [U-Boot] [PATCH 0/8] video: Add support for SSD2828 (parallel LCD to MIPI bridge)

2015-01-11 Thread Siarhei Siamashka
On Fri, 09 Jan 2015 16:35:09 +0100
Hans de Goede hdego...@redhat.com wrote:

 Hi,
 
 On 09-01-15 11:01, Siarhei Siamashka wrote:
  Hello,
 
  This patchset adds support for the Solomon Systech SSD2828 bridge chip,
  which is used to convert parallel LCD interface into MIPI DSI interface
  and drive MIPI LCD display in some tablets. In particular, this allows
  to have a working LCD display in my Allwinner A31s based MSI Primo81 tablet.
 
  The core of the SSD2828 support code is generic and should work with
  any SoC (as long as the hardware supports the standard u-boot GPIO API).
  It also does not have any hardcoded assumptions about the MSI Primo81
  display and should be able to drive any MIPI LCD panel (as long as the
  number of data lanes and the bitrate per lane is provided in the
  config struct). The code tries to follow the standard power-up sequence
  described in the SSD2828 datasheet. However it has been tested only
  on my MSI Primo81 tablet so far.
 
  The sunxi specific part includes a small glue code in the sunxi display
  driver and the defconfig update for the MSI Primo81 tablet.
 
  This can be applied after
   http://lists.denx.de/pipermail/u-boot/2015-January/200753.html
  'sunxi: video: Add lvds support' patchset to the 'next' branch
  in the u-boot-sunxi repository.
 
  And here is a bonus picture :-)
   http://linux-sunxi.org/File:MSI_Primo81_and_LCD_support_in_u-boot.jpg
 
 Cool :)
 
 
  Siarhei Siamashka (8):
 sunxi: axp221: Add ELDO[1-3] support
 include: Add header file with MIPI DSI constants from the Linux kernel
 video: Add support for SSD2828 (parallel LCD to MIPI bridge)
 video: sunxi: Hook up SSD2828 with the sunxi video driver
 sun6i: Add LCD display support for MSI Primo81 tablet
 video: ssd2828: Allow using 'pclk' as the PLL clock source
 video: sunxi: Switch from 'tx_clk' to 'pclk' for SSD2828
 video: ssd2828: Use MIPI DCS commands to retrieve the LCD panel id
 
 Thanks for working on this!
 
 Overall this looks good. Looks like you did a better job then I did with
 the Hitachi tx18d42vm LCD panel support, esp. wrt making things generic
 rather then sunxi specific.
 
 So assuming the Ian will ack v2 of my lvds patch I suggest that we merge
 my lvds patch, then your patches (pending an ack from Anatolij) and then I
 respin my Hitachi tx18d42vm LCD panel patch following your patches as an
 example.
 
 I've also reviewed all of your patches. I've one change request, can you
 please move all of the board/sunxi/Kconfig changes except for the last
 hunk to drivers/video/Kconfig, if we go the generic route we should also
 make the Kconfig stuff generic.
 This also means dropping the
 select VIDEO_LCD_IF_PARALLEL from config VIDEO_LCD_SSD2828 and adding
 it to config VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828, as that
 option is the only one which will stay in board/sunxi/Kconfig and
 VIDEO_LCD_IF_PARALLEL is sunxi specific.
 
 The changes to drivers/video/Kconfig should then become part of the
 video: Add support for SSD2828 (parallel LCD to MIPI bridge) commit.

Thanks. This sounds like a good plan. Will do it.

 With that changed patches 1-7 are:
 
 Acked-by: Hans de Goede hdego...@redhat.com
 
 I'm not 100% sure about patch 8, I can see this being useful for
 debugging but not for normal use, and as you said it may (theoretically)
 be unsafe with some panels. Maybe keep the patch, but #ifdef DEBUG the
 entire code block it adds ?

I'm also somewhat disappointed by the panel id reading functionality
provided by MIPI. I surely had better expectations. But the standard
MIPI_DCS_GET_DISPLAY_ID and MIPI_DCS_READ_DDB_START commands still
could be safely used, even though they do not happen to return
anything interesting on MSI Primo81.

The non-standard commands are indeed potentially unsafe and could
be probably hidden under a Kconfig option (are we adding too many
of them?) or under #ifdef DEBUG.


After posting the patch series, I have also noticed that the
http://linux-sunxi.org/ICOU_Fatty_I tablet is also using SSD2828.
Appears that 'lcd_if=4' in the A20 FEX dialect means the same as
'lcd_if=6' in the A31 FEX dialect. This Fatty tablet is using 6 gpio
pins for LCD configuration (compared to just 4 pins in Primo81).
One is an extra reset pin (ssd2828 reset and lcd panel reset are
handled separately). One more pin is set as output and driven low
(maybe something related to enabling ssd2828 power on A20?). I have
contacted the tablet owner to ask about this tablet whereabouts and
would really like to get test results from this Fatty tablet before
landing the ssd2828 patches. Hopefully it's a matter of a few days
at most.

Additionally, the Allwinner reference A20 tablet schematics
(a20_pad_std_v1_1.pdf on the Internet) has a page dedicated
to the use of SSD2828QN4, which is very insightful. I wish I
had discovered this earlier.

-- 
Best regards,
Siarhei Siamashka
___
U-Boot mailing 

Re: [U-Boot] [PATCH 0/8] video: Add support for SSD2828 (parallel LCD to MIPI bridge)

2015-01-10 Thread Hans de Goede

Hi,

On 09-01-15 16:35, Hans de Goede wrote:

Hi,

On 09-01-15 11:01, Siarhei Siamashka wrote:

Hello,

This patchset adds support for the Solomon Systech SSD2828 bridge chip,
which is used to convert parallel LCD interface into MIPI DSI interface
and drive MIPI LCD display in some tablets. In particular, this allows
to have a working LCD display in my Allwinner A31s based MSI Primo81 tablet.

The core of the SSD2828 support code is generic and should work with
any SoC (as long as the hardware supports the standard u-boot GPIO API).
It also does not have any hardcoded assumptions about the MSI Primo81
display and should be able to drive any MIPI LCD panel (as long as the
number of data lanes and the bitrate per lane is provided in the
config struct). The code tries to follow the standard power-up sequence
described in the SSD2828 datasheet. However it has been tested only
on my MSI Primo81 tablet so far.

The sunxi specific part includes a small glue code in the sunxi display
driver and the defconfig update for the MSI Primo81 tablet.

This can be applied after
 http://lists.denx.de/pipermail/u-boot/2015-January/200753.html
'sunxi: video: Add lvds support' patchset to the 'next' branch
in the u-boot-sunxi repository.

And here is a bonus picture :-)
 http://linux-sunxi.org/File:MSI_Primo81_and_LCD_support_in_u-boot.jpg


Cool :)


I've just pushed v2 of my lvds-patch to u-boot-sunxi/next with Anatolij's
ack, and I see that Anatolij has also reviewed this series, when you do
a v2 please base it on top of u-boot-sunxi/next.

Thanks,

Hans

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


Re: [U-Boot] [PATCH 0/8] video: Add support for SSD2828 (parallel LCD to MIPI bridge)

2015-01-10 Thread Ian Campbell
On Fri, 2015-01-09 at 16:35 +0100, Hans de Goede wrote:
 So assuming the Ian will ack v2 of my lvds patch 

Just done, assuming those were the patches you meant...

 With that changed patches 1-7 are:
 
 Acked-by: Hans de Goede hdego...@redhat.com

Hence I wasn't planning on looking into this series further, please let
me know if my opinion is wanted...

Ian.

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


Re: [U-Boot] [PATCH 0/8] video: Add support for SSD2828 (parallel LCD to MIPI bridge)

2015-01-09 Thread Hans de Goede

Hi,

On 09-01-15 11:01, Siarhei Siamashka wrote:

Hello,

This patchset adds support for the Solomon Systech SSD2828 bridge chip,
which is used to convert parallel LCD interface into MIPI DSI interface
and drive MIPI LCD display in some tablets. In particular, this allows
to have a working LCD display in my Allwinner A31s based MSI Primo81 tablet.

The core of the SSD2828 support code is generic and should work with
any SoC (as long as the hardware supports the standard u-boot GPIO API).
It also does not have any hardcoded assumptions about the MSI Primo81
display and should be able to drive any MIPI LCD panel (as long as the
number of data lanes and the bitrate per lane is provided in the
config struct). The code tries to follow the standard power-up sequence
described in the SSD2828 datasheet. However it has been tested only
on my MSI Primo81 tablet so far.

The sunxi specific part includes a small glue code in the sunxi display
driver and the defconfig update for the MSI Primo81 tablet.

This can be applied after
 http://lists.denx.de/pipermail/u-boot/2015-January/200753.html
'sunxi: video: Add lvds support' patchset to the 'next' branch
in the u-boot-sunxi repository.

And here is a bonus picture :-)
 http://linux-sunxi.org/File:MSI_Primo81_and_LCD_support_in_u-boot.jpg


Cool :)



Siarhei Siamashka (8):
   sunxi: axp221: Add ELDO[1-3] support
   include: Add header file with MIPI DSI constants from the Linux kernel
   video: Add support for SSD2828 (parallel LCD to MIPI bridge)
   video: sunxi: Hook up SSD2828 with the sunxi video driver
   sun6i: Add LCD display support for MSI Primo81 tablet
   video: ssd2828: Allow using 'pclk' as the PLL clock source
   video: sunxi: Switch from 'tx_clk' to 'pclk' for SSD2828
   video: ssd2828: Use MIPI DCS commands to retrieve the LCD panel id


Thanks for working on this!

Overall this looks good. Looks like you did a better job then I did with
the Hitachi tx18d42vm LCD panel support, esp. wrt making things generic
rather then sunxi specific.

So assuming the Ian will ack v2 of my lvds patch I suggest that we merge
my lvds patch, then your patches (pending an ack from Anatolij) and then I
respin my Hitachi tx18d42vm LCD panel patch following your patches as an
example.

I've also reviewed all of your patches. I've one change request, can you
please move all of the board/sunxi/Kconfig changes except for the last
hunk to drivers/video/Kconfig, if we go the generic route we should also
make the Kconfig stuff generic. This also means dropping the
select VIDEO_LCD_IF_PARALLEL from config VIDEO_LCD_SSD2828 and adding
it to config VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828, as that
option is the only one which will stay in board/sunxi/Kconfig and
VIDEO_LCD_IF_PARALLEL is sunxi specific.

The changes to drivers/video/Kconfig should then become part of the
video: Add support for SSD2828 (parallel LCD to MIPI bridge) commit.

With that changed patches 1-7 are:

Acked-by: Hans de Goede hdego...@redhat.com

I'm not 100% sure about patch 8, I can see this being useful for
debugging but not for normal use, and as you said it may (theoretically)
be unsafe with some panels. Maybe keep the patch, but #ifdef DEBUG the
entire code block it adds ?

Regards,

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


[U-Boot] [PATCH 0/8] video: Add support for SSD2828 (parallel LCD to MIPI bridge)

2015-01-09 Thread Siarhei Siamashka
Hello,

This patchset adds support for the Solomon Systech SSD2828 bridge chip,
which is used to convert parallel LCD interface into MIPI DSI interface
and drive MIPI LCD display in some tablets. In particular, this allows
to have a working LCD display in my Allwinner A31s based MSI Primo81 tablet.

The core of the SSD2828 support code is generic and should work with
any SoC (as long as the hardware supports the standard u-boot GPIO API).
It also does not have any hardcoded assumptions about the MSI Primo81
display and should be able to drive any MIPI LCD panel (as long as the
number of data lanes and the bitrate per lane is provided in the
config struct). The code tries to follow the standard power-up sequence
described in the SSD2828 datasheet. However it has been tested only
on my MSI Primo81 tablet so far.

The sunxi specific part includes a small glue code in the sunxi display
driver and the defconfig update for the MSI Primo81 tablet.

This can be applied after
http://lists.denx.de/pipermail/u-boot/2015-January/200753.html
'sunxi: video: Add lvds support' patchset to the 'next' branch
in the u-boot-sunxi repository.

And here is a bonus picture :-)
http://linux-sunxi.org/File:MSI_Primo81_and_LCD_support_in_u-boot.jpg


Siarhei Siamashka (8):
  sunxi: axp221: Add ELDO[1-3] support
  include: Add header file with MIPI DSI constants from the Linux kernel
  video: Add support for SSD2828 (parallel LCD to MIPI bridge)
  video: sunxi: Hook up SSD2828 with the sunxi video driver
  sun6i: Add LCD display support for MSI Primo81 tablet
  video: ssd2828: Allow using 'pclk' as the PLL clock source
  video: sunxi: Switch from 'tx_clk' to 'pclk' for SSD2828
  video: ssd2828: Use MIPI DCS commands to retrieve the LCD panel id

 board/sunxi/Kconfig |  60 +
 board/sunxi/board.c |   1 +
 configs/MSI_Primo81_defconfig   |   9 +
 drivers/power/Kconfig   |  10 +
 drivers/power/axp221.c  |  51 
 drivers/video/Makefile  |   1 +
 drivers/video/ssd2828.c | 575 
 drivers/video/ssd2828.h | 128 +
 drivers/video/sunxi_display.c   |   3 +
 drivers/video/sunxi_lcd_panel.c |  37 +++
 drivers/video/sunxi_lcd_panel.h |   3 +
 include/axp221.h|   9 +
 include/mipi_display.h  | 130 +
 13 files changed, 1017 insertions(+)
 create mode 100644 drivers/video/ssd2828.c
 create mode 100644 drivers/video/ssd2828.h
 create mode 100644 include/mipi_display.h

-- 
2.0.5

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


Re: [U-Boot] [PATCH 0/8] video: Add support for SSD2828 (parallel LCD to MIPI bridge)

2015-01-09 Thread Siarhei Siamashka
On Fri,  9 Jan 2015 12:01:08 +0200
Siarhei Siamashka siarhei.siamas...@gmail.com wrote:

 Hello,
 
 This patchset adds support for the Solomon Systech SSD2828 bridge chip,
 which is used to convert parallel LCD interface into MIPI DSI interface
 and drive MIPI LCD display in some tablets. In particular, this allows
 to have a working LCD display in my Allwinner A31s based MSI Primo81 tablet.
 
 The core of the SSD2828 support code is generic and should work with
 any SoC (as long as the hardware supports the standard u-boot GPIO API).
 It also does not have any hardcoded assumptions about the MSI Primo81
 display and should be able to drive any MIPI LCD panel (as long as the
 number of data lanes and the bitrate per lane is provided in the
 config struct). The code tries to follow the standard power-up sequence
 described in the SSD2828 datasheet. However it has been tested only
 on my MSI Primo81 tablet so far.
 
 The sunxi specific part includes a small glue code in the sunxi display
 driver and the defconfig update for the MSI Primo81 tablet.
 
 This can be applied after
 http://lists.denx.de/pipermail/u-boot/2015-January/200753.html
 'sunxi: video: Add lvds support' patchset to the 'next' branch
 in the u-boot-sunxi repository.
 
 And here is a bonus picture :-)
 http://linux-sunxi.org/File:MSI_Primo81_and_LCD_support_in_u-boot.jpg
 
 
 Siarhei Siamashka (8):
   sunxi: axp221: Add ELDO[1-3] support
   include: Add header file with MIPI DSI constants from the Linux kernel
   video: Add support for SSD2828 (parallel LCD to MIPI bridge)
   video: sunxi: Hook up SSD2828 with the sunxi video driver
   sun6i: Add LCD display support for MSI Primo81 tablet
   video: ssd2828: Allow using 'pclk' as the PLL clock source
   video: sunxi: Switch from 'tx_clk' to 'pclk' for SSD2828
   video: ssd2828: Use MIPI DCS commands to retrieve the LCD panel id
 
  board/sunxi/Kconfig |  60 +
  board/sunxi/board.c |   1 +
  configs/MSI_Primo81_defconfig   |   9 +
  drivers/power/Kconfig   |  10 +
  drivers/power/axp221.c  |  51 
  drivers/video/Makefile  |   1 +
  drivers/video/ssd2828.c | 575 
 
  drivers/video/ssd2828.h | 128 +
  drivers/video/sunxi_display.c   |   3 +
  drivers/video/sunxi_lcd_panel.c |  37 +++
  drivers/video/sunxi_lcd_panel.h |   3 +
  include/axp221.h|   9 +
  include/mipi_display.h  | 130 +
  13 files changed, 1017 insertions(+)
  create mode 100644 drivers/video/ssd2828.c
  create mode 100644 drivers/video/ssd2828.h
  create mode 100644 include/mipi_display.h

Also a short recap of the events from the last days, which led
to this patch set:
1. Trying to see what needs to be done to support LCD on the
   MSI Primo81 tablet, I had a look into the Allwinner android kernel
   code from the A31 SDK. That code was pushing a small semi-magic
   blob through SPI, interleaved with a few magic delays. In fact the
   Allwinner code supports two different LCD panels in this way
   (768x1024 and another one 1280x800), each panel having its own blob.

2. The most useful part of the Allwinner code was a reference to
   ssd2828_rst, which gave away the name of the chip. Having the
   documentation for the hardware is great, because it allows to
   at least convert the magic numbers into proper named constants.

3. Also it turned out that the MISO pin is actually wired up in the
   MSI Primo81 tablet, even though the Allwinner android code never
   uses it and there are no references to this pin in the FEX file.
   So the SSD2828 hardware can actually talk back, and it was really
   easy to confirm that the hardware was indeed SSD2828.

4. If the SSD2828 chip can talk back, then maybe the LCD panel
   can talk back too? The B079XAN01.0 LCD panel datasheet had
   a teaser notice in the Power ON/OFF Sequence section:
   HS clock enable to vendor ID reading.

5. Now the question is: how to do this vendor ID reading? In fact
   MIPI specifies some standard commands exactly for this. So everything
   is supposedly very easy. Except that trying to use the standard
   panel id retrieval commands resulted in the panel just responding
   with a single zero byte. This (mis)led me to believe that there
   might have been something wrong with the clock speed setting, PHY
   tuning delays or other things, which could cause some sort of
   transmission failures in the reverse direction. Especially
   considering the hints that tLPX(MASTER) and tLPX(SLAVE) must
   be accurately matched.

6. Been reading a mountain of various MIPI related information about
   the communication protocol on both the PHY and higher level...

7. As nothing seemed to be obviously wrong, tried to search for
   the MIPI vendor ID reading methods again. Found hints that
   the vendors tend to be (ab)using the DCS commands and
   inventing something of their own. Such as