Hung-Te Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34516 )
Change subject: mb/google/kukui: Add PS8640 based panel for Jacuzzi ......................................................................
mb/google/kukui: Add PS8640 based panel for Jacuzzi
* WIP. DO NOT SUBMIT. *
The Jacuzzi has a PS8640 MIPI bridge and will retrieve EDID via EDP dynamically.
BUG=None TEST=emerge-jacuzzi coreboot
Change-Id: I85aac5255e6a3e6019299670486214ecffbf9801 --- M 3rdparty/blobs M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_jacuzzi.c 4 files changed, 70 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/34516/1
diff --git a/3rdparty/blobs b/3rdparty/blobs index ca6cfcd..d7600dd 160000 --- a/3rdparty/blobs +++ b/3rdparty/blobs @@ -1 +1 @@ -Subproject commit ca6cfcdbe1cdeb38c2622ee2e5236cc4657e3377 +Subproject commit d7600dd8718a076f0f9a89e53968b484254624dc diff --git a/src/mainboard/google/kukui/Makefile.inc b/src/mainboard/google/kukui/Makefile.inc index 727f889..2c35569 100644 --- a/src/mainboard/google/kukui/Makefile.inc +++ b/src/mainboard/google/kukui/Makefile.inc @@ -26,4 +26,5 @@ ramstage-y += memlayout.ld ramstage-$(CONFIG_BOARD_GOOGLE_KRANE) += panel_krane.c ramstage-$(CONFIG_BOARD_GOOGLE_KUKUI) += panel_kukui.c +ramstage-$(CONFIG_BOARD_GOOGLE_JACUZZI) += panel_jacuzzi.c ramstage-y += reset.c diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c index b4b9dbd..84a584a 100644 --- a/src/mainboard/google/kukui/mainboard.c +++ b/src/mainboard/google/kukui/mainboard.c @@ -75,8 +75,20 @@ gpio_output(GPIO(DISP_PWM), 0); }
+#define GPIO_PP3300_LCM_EN GPIO(SIM2_SIO) /* 35 */ +#define GPIO_PP1200_MIPIBRDG_EN GPIO(BPI_OLAT1) /* 54 */ +#define GPIO_VDDIO_MIPIBRDG_EN GPIO(SIM2_SCLK) /* 37 */ +#define GPIO_LCM_RST_L_1V8 GPIO(LCM_RST) /* 45 */ +#define GPIO_MIPIBRDG_RST_L_1V8 GPIO(BPI_BUS3) /* 73 */ + static void configure_panel_power(void) { + static int done = 0; + + if (done) + return; + done = 1; + if (CONFIG(BOARD_GOOGLE_KUKUI) && board_id() < 2) { gpio_output(GPIO(LCM_RST), 0); udelay(100); @@ -85,6 +97,21 @@ return; }
+ if (CONFIG(BOARD_GOOGLE_JACUZZI)) { + gpio_output(GPIO_PP3300_LCM_EN, 1); + gpio_output(GPIO_VDDIO_MIPIBRDG_EN, 1); + gpio_output(GPIO_MIPIBRDG_RST_L_1V8, 0); + + gpio_output(GPIO_PP1200_MIPIBRDG_EN, 1); + /* Delay for PP1200_MIPIBRDG_EN to stablize */ + mdelay(2); + gpio_output(GPIO_LCM_RST_L_1V8, 1); + gpio_output(GPIO_MIPIBRDG_RST_L_1V8, 1); + /* for level shift(1.8V to 3.3V) on */ + udelay(100); + return; + } + gpio_output(GPIO(LCM_RST), 0); gpio_output(GPIO(BPI_BUS3), 0); gpio_output(GPIO(MISC_BSI_CK_3), 1); @@ -109,6 +136,9 @@ if (CONFIG(BOARD_GOOGLE_KUKUI)) panel_id = board_id() < 2 ? 1 : 0;
+ if (CONFIG(BOARD_GOOGLE_JACUZZI)) + configure_panel_power(); + struct panel_description *panel = get_panel_description(panel_id); if (!panel) { printk(BIOS_ERR, "%s: Panel %d is not supported.\n", diff --git a/src/mainboard/google/kukui/panel_jacuzzi.c b/src/mainboard/google/kukui/panel_jacuzzi.c new file mode 100644 index 0000000..1a8c8eb --- /dev/null +++ b/src/mainboard/google/kukui/panel_jacuzzi.c @@ -0,0 +1,38 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2019 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <drivers/parade/ps8640/ps8640.h> +#include <edid.h> +#include <soc/i2c.h> + +#include "panel.h" + +static struct panel_description jacuzzi_panel = { + .name = "EDP via PS8640", +}; + +struct panel_description *get_panel_description(int panel_id) +{ + /* Jacuzzi uses PS8640 MIPI bridge to find real panel info. */ + u8 i2c_bus = 4, i2c_addr = 8; + mtk_i2c_bus_init(i2c_bus); + + ps8640_init(i2c_bus, i2c_addr); + if (ps8640_get_edid(i2c_bus, i2c_addr, &jacuzzi_panel.edid)) { + printk(BIOS_ERR, "Can't get panel's edid\n"); + return NULL; + } + return &jacuzzi_panel; +}