All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 15/17] sunxi: Ippo_q8h defconfigs: Enable the LCD panel found on these tablets.
Date: Sun, 04 Jan 2015 21:22:01 +0100	[thread overview]
Message-ID: <54A9A0E9.8000506@redhat.com> (raw)
In-Reply-To: <20150102130202.23a4dbe2@i7>

Hi,

On 02-01-15 12:02, Siarhei Siamashka wrote:

<snip>

> Now I also got LCD display in my MSI Primo81 tablet working. Because
> Allwinner A31s does not have a native MIPI DSI interface, it uses
> an extra SSD2828 bridge chip, which converts parallel LCD interface
> into MIPI DSI.

Cool!

> MIPI DSI interface is needed for the B079XAN01/LP079X01
> 7.85" IPS LCD display. Supposedly SSD2828 chip needs 1.2V on ELDO3 for
> power (based on checking the kernel sources in A31 SDK), but everything
> seems to work even without it. And the fex file also specifies
> "lcd_power" as "port:power2<1><0><default><1>" similar to A23,
> however everything power-related just happens to magically work fine
> without doing anything special. This feels very suspicious and
> abnormal :-)
>
>> Ok.
>>
>>>> As for the lcd_gpio_# entries in the fex, looking at the linux-sunxi code,
>>>> it seems that they are initialized to the value specified in the fex once,
>>>> which for the Ippo_q8h_v1_2 means setting the gpio to output high once,
>>>> which we do effectively be assigning PH7 to CONFIG_VIDEO_LCD_POWER (and
>>>> I need to test if this is really necessary).
>>>
>>> PH7 in the reference design drives LCD_RST. I guess leaving it floating
>>> doesn't assert reset in the LCD driver. IMO, LCD_RESET would be a better
>>> name. It's what schematics use.
>>
>> Ok, note that the current defconfig for the q8h is driving it, but is using
>> CONFIG_VIDEO_LCD_POWER to drive it, which certainly seems the wrong name for
>> it.
>>
>>>> I agree that this is confusing, and that we should probably add something
>>>> akin to lcd_gpio_0 to u-boot so that we've a 1:1 translation.
>>>>
>>>> A quick grep:
>>>>
>>>> [hans at shalem u-boot]$ grep -R -h lcd_gpio_0 ../sunxi-boards/sys_config |
>>>> sort | uniq
>>>> ;lcd_gpio_0          = port:PA23<0><0><default><default>
>>>> ;lcd_gpio_0          = port:PH10<1><0><2><1>
>>>> Binary file ../sunxi-boards/sys_config/a20/script.bin matches
>>>> lcd_gpio_0      =
>>>> lcd_gpio_0          =
>>>> lcd_gpio_0 =
>>>> lcd_gpio_0 = ""
>>>> lcd_gpio_0 = port:PA06<1><0><default><1>
>>>> lcd_gpio_0 = port:PH07<1><0><default><1>
>>>> lcd_gpio_0 = port:PH10<1><0><2><1>
>>>>
>>>> Shows that the port is always put in output high mode, grepping for gpio_1
>>>> returns
>>>> 2 boards which use gpio_1 (and higher):
>>>>
>>>> sys_config/a20/icou_fatty_i.fex
>>>> sys_config/a31s/msi_primo81.fex
>>>>
>>>> Both of which have a non supported cpu_if setting of 4 resp 6.
>>>>
>>>> So it seems for now we can simply add a CONFIG_VIDEO_LCD_GPIO0 and always
>>>> drive the pin specified there (if any) high, and then we're good to go.
>>>
>>> See the previous paragraph about the name.
>>
>> Although I think that it is great that you've schematics for the q8h, we do not
>> have schematics for the majority of the boards we want to support, so I think it
>> is best to stick with the CONFIG_VIDEO_LCD_GPIO# name, and add a commment to the
>> defconfig what it really is in the cases where we know what it is used for.
>
> BTW, the MSI Primo81 tablet (lcd_if=6) uses a set of four pins in the
> 'lcd_gpio_*' fex config. Three of them are used for SPI communication
> to configure the SSD2828 chip (write only). And one more pin is reset.
> The reset pin is not "lcd_gpio_0", but "lcd_gpio_2". So yes, the exact
> pin naming may depend on the "lcd_if" config variable and also maybe
> even change between different Allwinner SDK versions.

Ah interesting, I had some trouble getting the theoretically easy addition
of lvds going on my A10 tablet because the hitachi lcd used in it has a
lcd controller which needs some poking over SPI for it to power up.

> I'll submit the lcd_if=6 (LCD_IF_EXT_DSI) support code soon, but the
> original Allwinner's SPI bit-banging code needs to be reworked to get
> rid of magic constants. Given that the SSD2828 datasheet exists, this
> should be doable.

Sounds good, my own support for the hitachi lcd needed some cleanup,
which I've just completed. I've just posted the series to the mailinglist,
and it is available in my sunxi-wip branch. As you can see I've taken into
account that we also need support for the SSD2828 and made the VIDEO_LCD_PANEL
Kconfig option a choice, so adding one more special panel should be easy,
just slot it in in the Kconfig and add it to drivers/video/sunxi_lcd_panel.c

I've found a few other boards using the same hitachi panel, but they all use
the same gpios for the spi bit-banging, which seems to be a different set
from what is being used in the primo for the SSD2828, I think it is easiest to
just hardcode the gpio-s needed for the spi inside drivers/video/sunxi_lcd_panel.c
for now, based on the lcd panel type, if we ever need to make things more
flexible because some new board comes along which uses an already supported
lcd panel / conversion chip, but with a different set of gpio-s then we can
easily make things more flexible then.

> Do we really want to keep the magic CONFIG_VIDEO_LCD_GPIO# names?

Given that in your case they are being (ab)used to code spi pins, no. I'll
do a patch one of the coming days to introduce a CONFIG_VIDEO_LCD_RESET Kconfig
option, I think it would be be safe for your fex conversion script to fill that
with gpio0 for boards which only set gpio0, and just complain in case there is
more then one gpio and not do anything with the gpio-s.

Talking about your script, lcd_if = 3 is supported with my LVDS patches, this
should select CONFIG_VIDEO_LCD_PANEL_LVDS, lcd_lvds_ch, lcd_lvds_mode and
lcd_lvds_io_cross should all be 0, otherwise we're dealing with an unsupported
config. lcd_lvds_bitwidth = 0 means depth:24, lcd_lvds_bitwidth = 1 means depth:18,
for lvds this takes precedence over whatever lcd_frm sets. Note some lvds using
fex files set lcd_lvds_bitwidth = 1 without enabling dithering through lcd_frm,
this makes no sense, and the SDK kernel code even complains about it, so I've
no intention of supporting 18 bits over lvds without dithering.

Regards,

Hans

  reply	other threads:[~2015-01-04 20:22 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-24 19:06 [U-Boot] sunxi: video: Add LCD output and A13-Olinuxino VGA output support Hans de Goede
2014-12-24 19:06 ` [U-Boot] [PATCH 01/17] videomodes: Add support for refresh and pclk_khz to video_get_params() Hans de Goede
2014-12-28  9:27   ` Ian Campbell
2015-01-08 17:23   ` Anatolij Gustschin
2014-12-24 19:06 ` [U-Boot] [PATCH 02/17] sunxi: gpio: Properly sort mux defines by port number Hans de Goede
2014-12-28  9:28   ` Ian Campbell
2014-12-24 19:06 ` [U-Boot] [PATCH 03/17] sunxi: gpio: Add support for gpio pins on the AXP209 pmic Hans de Goede
2014-12-28  9:34   ` Ian Campbell
2014-12-28 10:35     ` Hans de Goede
2014-12-24 19:06 ` [U-Boot] [PATCH 04/17] sunxi: video: Drop disabling of backend / lcdc / hdmi encoder on modeset Hans de Goede
2014-12-28  9:34   ` Ian Campbell
2014-12-24 19:06 ` [U-Boot] [PATCH 05/17] sunxi: video: Improve monitor video-mode option handling Hans de Goede
2014-12-28  9:40   ` Ian Campbell
2014-12-28 10:55     ` Hans de Goede
2014-12-24 19:06 ` [U-Boot] [PATCH 06/17] sunxi: video: Prepare for lcd support Hans de Goede
2014-12-28  9:41   ` Ian Campbell
2014-12-24 19:06 ` [U-Boot] [PATCH 07/17] sunxi: video: Modify sunxi_lcdc_pll_set to work with both tcon0 and tcon1 Hans de Goede
2014-12-29 13:36   ` Ian Campbell
2014-12-24 19:06 ` [U-Boot] [PATCH 08/17] sunxi: video: Move sunxi_drc_init Hans de Goede
2014-12-25  9:08   ` Chen-Yu Tsai
2014-12-25 10:22     ` Hans de Goede
2014-12-29 13:37       ` Ian Campbell
2014-12-24 19:06 ` [U-Boot] [PATCH 09/17] sunxi: video: Add lcd output support Hans de Goede
2014-12-29 13:43   ` Ian Campbell
2014-12-31 11:59     ` Hans de Goede
2014-12-24 19:06 ` [U-Boot] [PATCH 10/17] sunxi: video: Add suppport SoCs without HDMI, e.g. the A13 and A23 Hans de Goede
2014-12-29 13:50   ` Ian Campbell
2014-12-31 12:07     ` Hans de Goede
2014-12-24 19:06 ` [U-Boot] [PATCH 11/17] sunxi: video: Add support for VGA via external DACs connected to the LCD pins Hans de Goede
2014-12-29 13:51   ` Ian Campbell
2014-12-29 19:25     ` Hans de Goede
2014-12-30  2:21       ` Chen-Yu Tsai
2014-12-30 10:21         ` Hans de Goede
2014-12-24 19:06 ` [U-Boot] [PATCH 12/17] sunxi: sunxi-common.h: Reduce bootm_size to take the framebuffer into account Hans de Goede
2014-12-29 13:52   ` Ian Campbell
2014-12-24 19:06 ` [U-Boot] [PATCH 13/17] sunxi: A13-OLinuXino defconfigs: Enable VGA output, add lcd-mode for 7" LCD Hans de Goede
2014-12-29 13:53   ` Ian Campbell
2014-12-24 19:06 ` [U-Boot] [PATCH 14/17] sunxi: Add 2 defconfigs for using the Olimex 7" lcd with olinuxino boards Hans de Goede
2014-12-29 13:55   ` Ian Campbell
2014-12-29 19:27     ` Hans de Goede
2014-12-30  7:25       ` Ian Campbell
2014-12-24 19:06 ` [U-Boot] [PATCH 15/17] sunxi: Ippo_q8h defconfigs: Enable the LCD panel found on these tablets Hans de Goede
2014-12-25 10:00   ` Chen-Yu Tsai
2014-12-25 10:59     ` Hans de Goede
2014-12-26  6:44       ` Chen-Yu Tsai
2014-12-26 10:48         ` Hans de Goede
2014-12-29 13:57         ` Ian Campbell
2014-12-29 15:56           ` Chen-Yu Tsai
2014-12-29 19:31             ` Hans de Goede
2014-12-30 10:18       ` Siarhei Siamashka
2014-12-30 10:26         ` Hans de Goede
2014-12-30 10:36           ` Hans de Goede
2014-12-30 11:25             ` Siarhei Siamashka
2014-12-31 11:22               ` Hans de Goede
2014-12-30 12:17           ` Siarhei Siamashka
2014-12-31 11:22             ` Hans de Goede
2015-01-01  2:35               ` Chen-Yu Tsai
2015-01-01 12:36                 ` Hans de Goede
2015-01-02 11:02                   ` Siarhei Siamashka
2015-01-04 20:22                     ` Hans de Goede [this message]
2015-01-01 20:03               ` Siarhei Siamashka
2015-01-01 20:15                 ` Hans de Goede
2015-01-01 21:05                   ` Siarhei Siamashka
2014-12-24 19:06 ` [U-Boot] [PATCH 16/17] sunxi: video: Remove sunxi_display.enabled variable Hans de Goede
2014-12-29 13:57   ` Ian Campbell
2014-12-24 19:06 ` [U-Boot] [PATCH 17/17] sunxi: video: Use sunxi_lcdc_get_clk_delay to calculate tcon1 delay Hans de Goede
2014-12-29 13:58   ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54A9A0E9.8000506@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.