Kaka Ni has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32511
Change subject: WIP: google/kukui: elaborate panel support for Kukui family boards. ......................................................................
WIP: google/kukui: elaborate panel support for Kukui family boards.
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support it's panels.
BUG=Nne BRANCH=none TEST=build pass
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 451 insertions(+), 172 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/1
diff --git a/src/mainboard/google/kukui/Makefile.inc b/src/mainboard/google/kukui/Makefile.inc index a0556c1..ef52031 100644 --- a/src/mainboard/google/kukui/Makefile.inc +++ b/src/mainboard/google/kukui/Makefile.inc @@ -22,6 +22,8 @@
ramstage-y += boardid.c ramstage-y += chromeos.c +ramstage-y += display.c +ramstage-y += panel_kukui.c ramstage-y += mainboard.c ramstage-y += memlayout.ld ramstage-y += reset.c diff --git a/src/mainboard/google/kukui/display.c b/src/mainboard/google/kukui/display.c new file mode 100644 index 0000000..5ec6ccd --- /dev/null +++ b/src/mainboard/google/kukui/display.c @@ -0,0 +1,137 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2019 Huaqin Telecom 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 <console/console.h> +#include <delay.h> +#include <device/device.h> +#include <edid.h> +#include <gpio.h> +#include <soc/auxadc.h> +#include <soc/ddp.h> +#include <soc/dsi.h> +#include <soc/gpio.h> +#include <boardid.h> + +#include "display.h" +#include "gpio.h" + +static void _display_startup(struct edid *edid, + struct lcm_init_table *init_table, + u32 init_table_size) +{ + int ret = 0; + u32 mipi_dsi_flags; + + if ((edid == NULL) || (init_table == NULL)) { + printk(BIOS_ERR, "%s: wrong parameters\n", __func__); + return; + } + + mipi_dsi_flags = MIPI_DSI_MODE_VIDEO | + MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_LPM; + + edid_set_framebuffer_bits_per_pixel(edid, 32, 0); + + mtk_ddp_init(); + ret = mtk_dsi_init(mipi_dsi_flags, MIPI_DSI_FMT_RGB888, 4, + false, edid, init_table, init_table_size); + + if (ret < 0) { + printk(BIOS_ERR, "dsi init fail\n"); + return; + } + + mtk_ddp_mode_set(edid); + + set_vbe_mode_info_valid(edid, (uintptr_t) 0); +} + +static struct edid *get_edid(struct board_display_intf *intf) +{ + struct panel_info *info = intf->cur_panel_info; + + if (info) + return info->edid; + return NULL; +} + +static struct lcm_init_table *get_panel_init_table(struct board_display_intf + *intf, u32 *table_size) +{ + + struct panel_info *info = intf->cur_panel_info; + + if (info) { + *table_size = info->table_size; + return info->init_table; + } + + *table_size = 0; + return NULL; +} + +static const char *get_panel_name(struct board_display_intf *intf) +{ + struct panel_info *info = intf->cur_panel_info; + + if (info) + return info->panel_name; + return NULL; +} + +/* Exported Functions */ + +struct board_display_intf *get_current_display_intf(void) +{ + if (CONFIG(BOARD_GOOGLE_KUKUI)) + return &kukui_display_intf; + else + return NULL; +} + +int update_panel_info(struct board_display_intf *intf) +{ + int i; + union panel_id id = intf->get_panel_id(intf); + if (intf->is_panel_id_valid(id)) { + for (i = 0; i < intf->all_panel_info_size; ++i) { + if (id.value == intf->all_panel_info[i].disp_id.value) { + intf->cur_panel_info = &intf->all_panel_info[i]; + return 0; + } + } + } + return ERR; +} + +void configure_backlight(void) +{ + /* Configure PANEL_LCD_POWER_EN */ + gpio_output(GPIO(PERIPHERAL_EN13), 1); + gpio_output(GPIO(DISP_PWM), 1); /* DISP_PWM0 */ +} + +void display_startup(struct board_display_intf *intf) +{ + struct edid *edid; + u32 init_table_size; + struct lcm_init_table *init_table; + + edid = get_edid(intf); + init_table = get_panel_init_table(intf, &init_table_size); + printk(BIOS_INFO, "%s: name:%s init_table_size:%d\n", + __func__, get_panel_name(intf), init_table_size); + _display_startup(edid, init_table, init_table_size); +} diff --git a/src/mainboard/google/kukui/display.h b/src/mainboard/google/kukui/display.h new file mode 100644 index 0000000..33cc997 --- /dev/null +++ b/src/mainboard/google/kukui/display.h @@ -0,0 +1,95 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2019 Huaqin Telecom 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. + */ + +#ifndef __MAINBOARD_GOOGLE_DISPLAY_H__ +#define __MAINBOARD_GOOGLE_DISPLAY_H__ + +#include <soc/dsi.h> +#include <soc/gpio.h> + +#define ERR (-1) +#define OK (1) + +#define MAKE_AS_A_STRING(arg) #arg + +enum kukui_panel_id { + PANEL_KUKUI_FIRST = 0, + PANEL_KUKUI_INNOLUX = 0, + PANEL_KUKUI_P097PFG_SSD2858, + PANEL_KUKUI_UNKNOWN, + PANEL_KUKUI_COUNT, + PANEL_KUKUI_UNINITIALIZED +}; + + +union panel_id { + enum kukui_panel_id kukui_panel; + int value; +}; + +struct panel_info { + union panel_id disp_id; /* the ID for panel */ + const char *panel_name; /* display panel name */ + int voltage; /* voltage of LCM_ID */ + struct edid *edid; /* edid info of this panel */ + struct lcm_init_table *init_table; /* init command table */ + u32 table_size; /* init command table size */ +}; + +#define PANEL(_panel_id, _voltage, _edid, _init_table) \ + { \ + .disp_id = {_panel_id},\ + .panel_name = MAKE_AS_A_STRING(_panel_id),\ + .voltage = _voltage,\ + .edid = &_edid,\ + .init_table = _init_table,\ + .table_size = ARRAY_SIZE(_init_table)} \ + + +struct board_display_intf { + const char *board; /* board name */ + struct panel_info *all_panel_info; /* all supported panel info */ + u32 all_panel_info_size; /* num of supported panel */ + /* + * Runtime member + */ + struct panel_info *cur_panel_info; /* detected panel info */ + /* + * board related functions + */ + + union panel_id (*get_panel_id)(struct board_display_intf *intf); + bool (*is_panel_id_valid)(union panel_id id); + int (*backlight)(struct board_display_intf *intf); + int (*power)(struct board_display_intf *intf); +}; + +/* + * Exported functions + */ + +struct board_display_intf *get_current_display_intf(void); +int update_panel_info(struct board_display_intf *intf); +void configure_backlight(void); +void display_startup(struct board_display_intf *intf); + + +/* + * Panel Interface for boards + */ +extern struct board_display_intf kukui_display_intf; + +#endif + diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c index 7b1897d..af6ed30 100644 --- a/src/mainboard/google/kukui/mainboard.c +++ b/src/mainboard/google/kukui/mainboard.c @@ -27,6 +27,9 @@ #include <soc/mtcmos.h> #include <soc/usb.h>
+#include "display.h" +#include "gpio.h" + static void configure_emmc(void) { const gpio_t emmc_pin[] = { @@ -46,181 +49,29 @@ setup_usb_host(); }
-/* Setup backlight control pins as output pin and power-off by default */ -static void configure_backlight(void) -{ - /* Configure PANEL_LCD_POWER_EN */ - gpio_output(GPIO(PERIPHERAL_EN13), 1); - gpio_output(GPIO(DISP_PWM), 1); /* DISP_PWM0 */ -} - -static void configure_display(void) -{ - if (board_id() < 2) { - /* board from p1 */ - gpio_output(GPIO(LCM_RST), 0); - udelay(100); - gpio_output(GPIO(LCM_RST), 1); - mdelay(20); - } else { - /* board from p2 */ - gpio_output(GPIO(LCM_RST), 0); - gpio_output(GPIO(BPI_BUS3), 0); - gpio_output(GPIO(MISC_BSI_CK_3), 1); - gpio_output(GPIO(PERIPHERAL_EN9), 1); - gpio_output(GPIO(SIM2_SRST), 1); - gpio_output(GPIO(SIM2_SIO), 1); - gpio_output(GPIO(BPI_OLAT1), 1); - gpio_output(GPIO(SIM2_SCLK), 1); - mdelay(20); - gpio_output(GPIO(LCM_RST), 1); - mdelay(20); - gpio_output(GPIO(BPI_BUS3), 1); - mdelay(20); - } -} - -static const struct edid kukui_innolux_edid = { - .panel_bits_per_color = 8, - .panel_bits_per_pixel = 24, - .mode = { - .name = "768x1024@60Hz", - .pixel_clock = 56900, - .lvds_dual_channel = 0, - .refresh = 60, - .ha = 768, .hbl = 120, .hso = 40, .hspw = 40, .hborder = 0, - .va = 1024, .vbl = 44, .vso = 20, .vspw = 4, .vborder = 0, - .phsync = '-', .pvsync = '-', - .x_mm = 120, .y_mm = 160, - }, -}; - -struct lcm_init_table lcm_init_cmd[] = { - {INIT_DCS_CMD, 1, {MIPI_DCS_EXIT_SLEEP_MODE} }, - {DELAY_CMD, 120, {} }, - {INIT_DCS_CMD, 1, {MIPI_DCS_SET_DISPLAY_ON} }, - {DELAY_CMD, 120, {} }, -}; - -static const struct edid kukui_p097pfg_ssd2858_edid = { - .panel_bits_per_color = 8, - .panel_bits_per_pixel = 24, - .mode = { - .name = "1536x2048@60Hz", - .pixel_clock = 229000, - .lvds_dual_channel = 0, - .refresh = 60, - .ha = 1536, .hbl = 160, .hso = 80, .hspw = 26, .hborder = 0, - .va = 2048, .vbl = 32, .vso = 20, .vspw = 2, .vborder = 0, - .phsync = '-', .pvsync = '-', - .x_mm = 147, .y_mm = 196, - }, -}; - -struct lcm_init_table lcm_p097pfg_ssd2858_init_cmd[] = { - /* SSD2858 config */ - {INIT_GENENIC_CMD, 2, {0xff, 0x00} }, - /* LOCKCNT=0x1f4, MRX=0, POSTDIV=1 (/2} }, MULT=0x49 - * 27 Mhz => 985.5 Mhz */ - {INIT_GENENIC_CMD, 6, {0x00, 0x08, 0x01, 0xf4, 0x01, 0x49} }, - /* MTXDIV=1, SYSDIV=3 (=> 4) */ - {INIT_GENENIC_CMD, 6, {0x00, 0x0c, 0x00, 0x00, 0x00, 0x03} }, - /* MTXVPF=24bpp, MRXLS=4 lanes, MRXVB=bypass, MRXECC=1, MRXEOT=1 - * MRXEE=1 */ - {INIT_GENENIC_CMD, 6, {0x00, 0x14, 0x0c, 0x3d, 0x80, 0x0f} }, - {INIT_GENENIC_CMD, 6, {0x00, 0x20, 0x15, 0x92, 0x56, 0x7d} }, - {INIT_GENENIC_CMD, 6, {0x00, 0x24, 0x00, 0x00, 0x30, 0x00} }, - - {INIT_GENENIC_CMD, 6, {0x10, 0x08, 0x01, 0x20, 0x08, 0x45} }, - {INIT_GENENIC_CMD, 6, {0x10, 0x1c, 0x00, 0x00, 0x00, 0x00} }, - {INIT_GENENIC_CMD, 6, {0x20, 0x0c, 0x00, 0x00, 0x00, 0x04} }, - /* Pixel clock 985.5 Mhz * 0x49/0x4b = 959 Mhz */ - {INIT_GENENIC_CMD, 6, {0x20, 0x10, 0x00, 0x4b, 0x00, 0x49} }, - {INIT_GENENIC_CMD, 6, {0x20, 0xa0, 0x00, 0x00, 0x00, 0x00} }, - /* EOT=1, LPE = 0, LSOUT=4 lanes, LPD=25 */ - {INIT_GENENIC_CMD, 6, {0x60, 0x08, 0x00, 0xd9, 0x00, 0x08} }, - {INIT_GENENIC_CMD, 6, {0x60, 0x14, 0x01, 0x00, 0x01, 0x06} }, - /* DSI0 enable (default: probably not needed) */ - {INIT_GENENIC_CMD, 6, {0x60, 0x80, 0x00, 0x00, 0x00, 0x0f} }, - /* DSI1 enable */ - {INIT_GENENIC_CMD, 6, {0x60, 0xa0, 0x00, 0x00, 0x00, 0x0f} }, - - /* HSA=0x18, VSA=0x02, HBP=0x50, VBP=0x0c */ - {INIT_GENENIC_CMD, 6, {0x60, 0x0c, 0x0c, 0x50, 0x02, 0x18} }, - /* VACT= 0x800 (2048} }, VFP= 0x14, HFP=0x50 */ - {INIT_GENENIC_CMD, 6, {0x60, 0x10, 0x08, 0x00, 0x14, 0x50} }, - /* HACT=0x300 (768) */ - {INIT_GENENIC_CMD, 6, {0x60, 0x84, 0x00, 0x00, 0x03, 0x00} }, - {INIT_GENENIC_CMD, 6, {0x60, 0xa4, 0x00, 0x00, 0x03, 0x00} }, - - /* Take panel out of sleep. */ - {INIT_GENENIC_CMD, 2, {0xff, 0x01} }, - {INIT_DCS_CMD, 1, {0x11} }, - {DELAY_CMD, 120, {} }, - {INIT_DCS_CMD, 1, {0x29} }, - {DELAY_CMD, 20, {} }, - {INIT_GENENIC_CMD, 2, {0xff, 0x00} }, - - {DELAY_CMD, 120, {} }, - {INIT_DCS_CMD, 1, {0x11} }, - {DELAY_CMD, 120, {} }, - {INIT_DCS_CMD, 1, {0x29} }, - {DELAY_CMD, 20, {} }, -}; - -static void display_startup(void) -{ - int ret = 0; - u32 mipi_dsi_flags; - struct edid edid; - - if (board_id() < 2) { - edid = kukui_innolux_edid; - mipi_dsi_flags = MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_VIDEO_SYNC_PULSE | - MIPI_DSI_MODE_LPM; - } else { - edid = kukui_p097pfg_ssd2858_edid; - mipi_dsi_flags = MIPI_DSI_MODE_VIDEO | - MIPI_DSI_MODE_VIDEO_BURST | - MIPI_DSI_MODE_LPM; - } - - edid_set_framebuffer_bits_per_pixel(&edid, 32, 0); - - mtk_ddp_init(); - if (board_id() < 2) - ret = mtk_dsi_init(mipi_dsi_flags, MIPI_DSI_FMT_RGB888, 4, - false, &edid, lcm_init_cmd, - ARRAY_SIZE(lcm_init_cmd)); - else { - ret = mtk_dsi_init(mipi_dsi_flags, MIPI_DSI_FMT_RGB888, 4, - false, &edid, lcm_p097pfg_ssd2858_init_cmd, - ARRAY_SIZE(lcm_p097pfg_ssd2858_init_cmd)); - } - - if (ret < 0) { - printk(BIOS_ERR, "dsi init fail\n"); - return; - } - - mtk_ddp_mode_set(&edid); - - set_vbe_mode_info_valid(&edid, (uintptr_t)0); -} - static void mainboard_init(struct device *dev) { - if (display_init_required()) { - mtcmos_display_power_on(); - mtcmos_protect_display_bus(); + struct board_display_intf *cur_disp_intf = NULL;
- configure_backlight(); - configure_display(); - display_startup(); - } else { - printk(BIOS_INFO, "Skipping display init.\n"); - } + if (display_init_required()) { + printk(BIOS_INFO, "Starting display init.\n"); + + cur_disp_intf = get_current_display_intf(); + if (cur_disp_intf && !update_panel_info(cur_disp_intf)) { + mtcmos_display_power_on(); + mtcmos_protect_display_bus(); + + cur_disp_intf->backlight(cur_disp_intf); + cur_disp_intf->power(cur_disp_intf); + display_startup(cur_disp_intf); + } else { + printk(BIOS_ERR, + "%s: Can't find correct display interface\n", + __func__); + } + + } else + printk(BIOS_ERR, "Skipping display init.\n");
configure_emmc(); configure_usb(); diff --git a/src/mainboard/google/kukui/panel_kukui.c b/src/mainboard/google/kukui/panel_kukui.c new file mode 100644 index 0000000..28fe742 --- /dev/null +++ b/src/mainboard/google/kukui/panel_kukui.c @@ -0,0 +1,194 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2019 Huaqin Telecom 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 <console/console.h> +#include <delay.h> +#include <device/device.h> +#include <edid.h> +#include <gpio.h> +#include <soc/auxadc.h> +#include <soc/ddp.h> +#include <soc/dsi.h> +#include <soc/gpio.h> +#include <boardid.h> + +#include "display.h" +#include "gpio.h" + +static struct edid kukui_innolux_edid = { + .panel_bits_per_color = 8, + .panel_bits_per_pixel = 24, + .mode = { + .name = "768x1024@60Hz", + .pixel_clock = 56900, + .lvds_dual_channel = 0, + .refresh = 60, + .ha = 768, .hbl = 120, .hso = 40, .hspw = 40, .hborder = 0, + .va = 1024, .vbl = 44, .vso = 20, .vspw = 4, .vborder = 0, + .phsync = '-', .pvsync = '-', + .x_mm = 120, .y_mm = 160, + }, +}; + +static struct lcm_init_table lcm_init_cmd[] = { + {INIT_DCS_CMD, 1, {MIPI_DCS_EXIT_SLEEP_MODE} }, + {DELAY_CMD, 120, {} }, + {INIT_DCS_CMD, 1, {MIPI_DCS_SET_DISPLAY_ON} }, + {DELAY_CMD, 120, {} }, +}; + +static struct edid kukui_p097pfg_ssd2858_edid = { + .panel_bits_per_color = 8, + .panel_bits_per_pixel = 24, + .mode = { + .name = "1536x2048@60Hz", + .pixel_clock = 229000, + .lvds_dual_channel = 0, + .refresh = 60, + .ha = 1536, .hbl = 160, .hso = 80, .hspw = 26, .hborder = 0, + .va = 2048, .vbl = 32, .vso = 20, .vspw = 2, .vborder = 0, + .phsync = '-', .pvsync = '-', + .x_mm = 147, .y_mm = 196, + }, +}; + +struct lcm_init_table lcm_p097pfg_ssd2858_init_cmd[] = { + /* SSD2858 config */ + {INIT_GENENIC_CMD, 2, {0xff, 0x00} }, + /* LOCKCNT=0x1f4, MRX=0, POSTDIV=1 (/2} }, MULT=0x49 + * 27 Mhz => 985.5 Mhz + */ + {INIT_GENENIC_CMD, 6, {0x00, 0x08, 0x01, 0xf4, 0x01, 0x49} }, + /* MTXDIV=1, SYSDIV=3 (=> 4) */ + {INIT_GENENIC_CMD, 6, {0x00, 0x0c, 0x00, 0x00, 0x00, 0x03} }, + /* MTXVPF=24bpp, MRXLS=4 lanes, MRXVB=bypass, MRXECC=1, MRXEOT=1 + * MRXEE=1 + */ + {INIT_GENENIC_CMD, 6, {0x00, 0x14, 0x0c, 0x3d, 0x80, 0x0f} }, + {INIT_GENENIC_CMD, 6, {0x00, 0x20, 0x15, 0x92, 0x56, 0x7d} }, + {INIT_GENENIC_CMD, 6, {0x00, 0x24, 0x00, 0x00, 0x30, 0x00} }, + + {INIT_GENENIC_CMD, 6, {0x10, 0x08, 0x01, 0x20, 0x08, 0x45} }, + {INIT_GENENIC_CMD, 6, {0x10, 0x1c, 0x00, 0x00, 0x00, 0x00} }, + {INIT_GENENIC_CMD, 6, {0x20, 0x0c, 0x00, 0x00, 0x00, 0x04} }, + /* Pixel clock 985.5 Mhz * 0x49/0x4b = 959 Mhz */ + {INIT_GENENIC_CMD, 6, {0x20, 0x10, 0x00, 0x4b, 0x00, 0x49} }, + {INIT_GENENIC_CMD, 6, {0x20, 0xa0, 0x00, 0x00, 0x00, 0x00} }, + /* EOT=1, LPE = 0, LSOUT=4 lanes, LPD=25 */ + {INIT_GENENIC_CMD, 6, {0x60, 0x08, 0x00, 0xd9, 0x00, 0x08} }, + {INIT_GENENIC_CMD, 6, {0x60, 0x14, 0x01, 0x00, 0x01, 0x06} }, + /* DSI0 enable (default: probably not needed) */ + {INIT_GENENIC_CMD, 6, {0x60, 0x80, 0x00, 0x00, 0x00, 0x0f} }, + /* DSI1 enable */ + {INIT_GENENIC_CMD, 6, {0x60, 0xa0, 0x00, 0x00, 0x00, 0x0f} }, + + /* HSA=0x18, VSA=0x02, HBP=0x50, VBP=0x0c */ + {INIT_GENENIC_CMD, 6, {0x60, 0x0c, 0x0c, 0x50, 0x02, 0x18} }, + /* VACT= 0x800 (2048} }, VFP= 0x14, HFP=0x50 */ + {INIT_GENENIC_CMD, 6, {0x60, 0x10, 0x08, 0x00, 0x14, 0x50} }, + /* HACT=0x300 (768) */ + {INIT_GENENIC_CMD, 6, {0x60, 0x84, 0x00, 0x00, 0x03, 0x00} }, + {INIT_GENENIC_CMD, 6, {0x60, 0xa4, 0x00, 0x00, 0x03, 0x00} }, + + /* Take panel out of sleep. */ + {INIT_GENENIC_CMD, 2, {0xff, 0x01} }, + {INIT_DCS_CMD, 1, {0x11} }, + {DELAY_CMD, 120, {} }, + {INIT_DCS_CMD, 1, {0x29} }, + {DELAY_CMD, 20, {} }, + {INIT_GENENIC_CMD, 2, {0xff, 0x00} }, + + {DELAY_CMD, 120, {} }, + {INIT_DCS_CMD, 1, {0x11} }, + {DELAY_CMD, 120, {} }, + {INIT_DCS_CMD, 1, {0x29} }, + {DELAY_CMD, 20, {} }, +}; + +struct panel_info kukui_panel_info[] = { + PANEL(PANEL_KUKUI_INNOLUX, + 74000, + kukui_innolux_edid, + lcm_init_cmd), + PANEL(PANEL_KUKUI_P097PFG_SSD2858, + 212000, + kukui_p097pfg_ssd2858_edid, + lcm_p097pfg_ssd2858_init_cmd), + {{PANEL_KUKUI_UNKNOWN}, "PANEL_KUKUI_UNKNOWN", + 0, NULL, NULL, 0}, +}; + + +static union panel_id kukui_get_panel_id(struct board_display_intf *intf) +{ + if (board_id() < 2) + return (union panel_id)PANEL_KUKUI_INNOLUX; + else + return (union panel_id)PANEL_KUKUI_P097PFG_SSD2858; +}; + +static bool kukui_is_panel_id_valid(union panel_id id) +{ + if (id.value < PANEL_KUKUI_UNKNOWN) + return true; + return false; +}; + +static int kukui_backlight(struct board_display_intf *intf) +{ + configure_backlight(); + return 0; +}; + +static int kukui_power(struct board_display_intf *intf) +{ + + if (board_id() < 2) { + /* board from p1 */ + gpio_output(GPIO(LCM_RST), 0); + udelay(100); + gpio_output(GPIO(LCM_RST), 1); + mdelay(20); + } else { + /* board from p2 */ + gpio_output(GPIO(LCM_RST), 0); + gpio_output(GPIO(BPI_BUS3), 0); + gpio_output(GPIO(MISC_BSI_CK_3), 1); + gpio_output(GPIO(PERIPHERAL_EN9), 1); + gpio_output(GPIO(SIM2_SRST), 1); + gpio_output(GPIO(SIM2_SIO), 1); + gpio_output(GPIO(BPI_OLAT1), 1); + gpio_output(GPIO(SIM2_SCLK), 1); + mdelay(20); + gpio_output(GPIO(LCM_RST), 1); + mdelay(20); + gpio_output(GPIO(BPI_BUS3), 1); + mdelay(20); + } + + return 0; + +}; + +struct board_display_intf kukui_display_intf = { + .board = "kukui", + .all_panel_info = kukui_panel_info, + .all_panel_info_size = ARRAY_SIZE(kukui_panel_info), + .cur_panel_info = NULL, + .get_panel_id = &kukui_get_panel_id, + .is_panel_id_valid = &kukui_is_panel_id_valid, + .backlight = &kukui_backlight, + .power = &kukui_power, +};
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: WIP: google/kukui: elaborate panel support for Kukui family boards. ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/32511/1/src/mainboard/google/kukui/display.c File src/mainboard/google/kukui/display.c:
https://review.coreboot.org/#/c/32511/1/src/mainboard/google/kukui/display.c... PS1, Line 116: return ERR; return of an errno should typically be negative (ie: return -ERR)
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32511
to look at the new patch set (#2).
Change subject: WIP: google/kukui: elaborate panel support for Kukui family boards. ......................................................................
WIP: google/kukui: elaborate panel support for Kukui family boards.
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support it's panels.
BUG=Nne BRANCH=none TEST=build pass
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 450 insertions(+), 172 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/2
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: WIP: google/kukui: elaborate panel support for Kukui family boards. ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/#/c/32511/2/src/mainboard/google/kukui/display.h File src/mainboard/google/kukui/display.h:
https://review.coreboot.org/#/c/32511/2/src/mainboard/google/kukui/display.h... PS2, Line 94: #endif adding a line without newline at end of file
https://review.coreboot.org/#/c/32511/2/src/mainboard/google/kukui/display.c File src/mainboard/google/kukui/display.c:
https://review.coreboot.org/#/c/32511/2/src/mainboard/google/kukui/display.c... PS2, Line 116: return ERR; return of an errno should typically be negative (ie: return -ERR)
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32511
to look at the new patch set (#3).
Change subject: WIP: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
WIP: google/kukui: Elaborate panel support for Kukui family boards.
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support it's panels.
BUG=Nne BRANCH=none TEST=build pass
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 450 insertions(+), 172 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/3
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32511
to look at the new patch set (#4).
Change subject: WIP: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
WIP: google/kukui: Elaborate panel support for Kukui family boards.
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support it's panels.
BUG=Nne BRANCH=none TEST=build pass
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 450 insertions(+), 172 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/4
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: WIP: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/#/c/32511/4/src/mainboard/google/kukui/display.c File src/mainboard/google/kukui/display.c:
https://review.coreboot.org/#/c/32511/4/src/mainboard/google/kukui/display.c... PS4, Line 116: return ERR; return of an errno should typically be negative (ie: return -ERR)
jitao shi has uploaded a new patch set (#5) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: WIP: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
WIP: google/kukui: Elaborate panel support for Kukui family boards.
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support it's panels.
BUG=Nne BRANCH=none TEST=build pass
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 449 insertions(+), 75 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/5
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: WIP: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/#/c/32511/5/src/mainboard/google/kukui/display.c File src/mainboard/google/kukui/display.c:
https://review.coreboot.org/#/c/32511/5/src/mainboard/google/kukui/display.c... PS5, Line 116: return ERR; return of an errno should typically be negative (ie: return -ERR)
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: WIP: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/#/c/32511/6/src/mainboard/google/kukui/display.c File src/mainboard/google/kukui/display.c:
https://review.coreboot.org/#/c/32511/6/src/mainboard/google/kukui/display.c... PS6, Line 116: return ERR; return of an errno should typically be negative (ie: return -ERR)
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: WIP: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
Patch Set 7:
(1 comment)
https://review.coreboot.org/#/c/32511/7/src/mainboard/google/kukui/display.c File src/mainboard/google/kukui/display.c:
https://review.coreboot.org/#/c/32511/7/src/mainboard/google/kukui/display.c... PS7, Line 116: return ERR; return of an errno should typically be negative (ie: return -ERR)
jitao shi has uploaded a new patch set (#8) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: WIP: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
WIP: google/kukui: Elaborate panel support for Kukui family boards.
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support it's panels.
BUG=Nne BRANCH=none TEST=build pass
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 450 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/8
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: WIP: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/#/c/32511/8/src/mainboard/google/kukui/display.c File src/mainboard/google/kukui/display.c:
https://review.coreboot.org/#/c/32511/8/src/mainboard/google/kukui/display.c... PS8, Line 116: return ERR; return of an errno should typically be negative (ie: return -ERR)
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: WIP: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
Patch Set 8:
(2 comments)
https://review.coreboot.org/#/c/32511/8/src/mainboard/google/kukui/Makefile.... File src/mainboard/google/kukui/Makefile.inc:
https://review.coreboot.org/#/c/32511/8/src/mainboard/google/kukui/Makefile.... PS8, Line 26: y $(CONFIG_BOARD_GOOGLE_KUKUI)
https://review.coreboot.org/#/c/32511/8/src/mainboard/google/kukui/display.c File src/mainboard/google/kukui/display.c:
https://review.coreboot.org/#/c/32511/8/src/mainboard/google/kukui/display.c... PS8, Line 98: if (CONFIG(BOARD_GOOGLE_KUKUI)) : return &kukui_display_intf; : else : return NULL; This implies we'll need to include all interfaces for any builds. I think the right way is to move this into panel_$board.c, so kukui will only have config for kukui.
jitao shi has uploaded a new patch set (#9) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
google/kukui: Elaborate panel support for Kukui family boards.
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support it's panels.
BUG=Nne BRANCH=none TEST=build pass
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 438 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/9
jitao shi has uploaded a new patch set (#10) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
google/kukui: Elaborate panel support for Kukui family boards.
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support it's panels.
BUG=Nne BRANCH=none TEST=build pass
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 436 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/10
jitao shi has uploaded a new patch set (#12) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
google/kukui: Elaborate panel support for Kukui family boards.
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support it's panels.
BUG=Nne BRANCH=none TEST=build pass
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 436 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/12
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
Patch Set 14:
(12 comments)
https://review.coreboot.org/#/c/32511/14//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/32511/14//COMMIT_MSG@7 PS14, Line 7: google/kukui: Elaborate panel support for Kukui family boards. Please remove the dot/period at the end.
https://review.coreboot.org/#/c/32511/14//COMMIT_MSG@10 PS14, Line 10: inf information?
https://review.coreboot.org/#/c/32511/14//COMMIT_MSG@14 PS14, Line 14: it's its
https://review.coreboot.org/#/c/32511/14//COMMIT_MSG@14 PS14, Line 14: it's its
https://review.coreboot.org/#/c/32511/14//COMMIT_MSG@14 PS14, Line 14: one space
https://review.coreboot.org/#/c/32511/14/src/mainboard/google/kukui/display.... File src/mainboard/google/kukui/display.h:
https://review.coreboot.org/#/c/32511/14/src/mainboard/google/kukui/display.... PS14, Line 66: /* : * board related functions : */ Are these comments needed?
https://review.coreboot.org/#/c/32511/14/src/mainboard/google/kukui/display.... File src/mainboard/google/kukui/display.c:
PS14: Did you run this through clang-format?
https://review.coreboot.org/#/c/32511/14/src/mainboard/google/kukui/display.... PS14, Line 38: printk(BIOS_ERR, "%s: wrong parameters\n", __func__); Error messages should be more elaborate, so a user can understand it.
https://review.coreboot.org/#/c/32511/14/src/mainboard/google/kukui/display.... PS14, Line 52: printk(BIOS_ERR, "dsi init fail\n"); Maybe?
DSI initialization failed. Continue without.
https://review.coreboot.org/#/c/32511/14/src/mainboard/google/kukui/display.... PS14, Line 93: /* Exported Functions */ Are these comments neeeded?
https://review.coreboot.org/#/c/32511/14/src/mainboard/google/kukui/display.... PS14, Line 113: -1 We have error codes in coreboot. CB_SUCCESS, …
https://review.coreboot.org/#/c/32511/14/src/mainboard/google/kukui/panel_ku... File src/mainboard/google/kukui/panel_kukui.c:
https://review.coreboot.org/#/c/32511/14/src/mainboard/google/kukui/panel_ku... PS14, Line 34: .name = "768x1024@60Hz", Isn’t it landscape?
Jerry Han has uploaded a new patch set (#15) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards ......................................................................
google/kukui: Elaborate panel support for Kukui family boards
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has its own source file to support its panels.
BUG=Nne BRANCH=none TEST=build pass
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 436 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/15
Jerry Han has uploaded a new patch set (#16) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards ......................................................................
google/kukui: Elaborate panel support for Kukui family boards
There are two boards based on Kukui: Flapjack & Krane. Now the edid info and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has its own source file to support its panels.
BUG=Nne BRANCH=none TEST=build pass
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 436 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/16
jitao shi has uploaded a new patch set (#17) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
google/kukui: Elaborate panel support for Kukui family boards.
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support it's panels.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 445 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/17
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
Patch Set 17:
I agree with Hung-te, this looks way more "elaborate" than necessary. Please don't over-design this from the start, just write the differentiation you need right now, you can always add more later. You don't need to have a structure full of function pointers, just call a function (e.g. mainboard_power_panel()), implement that in both panel_kukui.c and panel_krane.c and only link one of them in.
Do we expect that Kukui and Krane will always use a 100% distinct set of panels or will there eventually be some overlap? If so, maybe we want to compile all the actual panel info unconditionally and only put the <board>_panel_info arrays into the panel_<board>.c file (so the linker GC will drop unreferenced panel info structs).
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
Patch Set 17:
Do we expect that Kukui and Krane will always use a 100% distinct set of panels
I had some quick discussion with HW teams before and they tend to believe there'll be almost no overlap. So the plan is to have panels defined in each board-specific C file, not adding another layer of panel-specific config.
If so, maybe we want to compile all the actual panel info unconditionally and only put the <board>_panel_info arrays into the panel_<board>.c file (so the linker GC will drop unreferenced panel info structs).
We feel that's not going to be the case, but can be revised anytime if that seems more reasonable in future.
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards. ......................................................................
Patch Set 17:
(3 comments)
https://review.coreboot.org/#/c/32511/17//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/32511/17//COMMIT_MSG@7 PS17, Line 7: google/kukui: Elaborate panel support for Kukui family boards. Please remove the dot/period at the end of the commit message summary.
https://review.coreboot.org/#/c/32511/17//COMMIT_MSG@14 PS17, Line 14: One space.
https://review.coreboot.org/#/c/32511/17//COMMIT_MSG@14 PS17, Line 14: it's its
jitao shi has uploaded a new patch set (#18) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards ......................................................................
google/kukui: Elaborate panel support for Kukui family boards
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support its panels.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 445 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/18
jitao shi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards ......................................................................
Patch Set 18:
(3 comments)
https://review.coreboot.org/#/c/32511/17//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/32511/17//COMMIT_MSG@7 PS17, Line 7: google/kukui: Elaborate panel support for Kukui family boards.
Please remove the dot/period at the end of the commit message summary.
Done
https://review.coreboot.org/#/c/32511/17//COMMIT_MSG@14 PS17, Line 14:
One space.
Done
https://review.coreboot.org/#/c/32511/17//COMMIT_MSG@14 PS17, Line 14: it's
its
Done
jitao shi has uploaded a new patch set (#19) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: google/kukui: Elaborate panel support for Kukui family boards ......................................................................
google/kukui: Elaborate panel support for Kukui family boards
There are two boards based on Kukui: Flapjack & Krane. Now the edid inf and init commands for panels of Kukui are in mainbard.c.
This CL would elabrate panel support for Kukui family. Each board has it's own source file to support its panels.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/Makefile.inc A src/mainboard/google/kukui/display.c A src/mainboard/google/kukui/display.h M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel_kukui.c 5 files changed, 445 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/19
Hung-Te Lin has uploaded a new patch set (#20) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 136 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/20
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 20:
(3 comments)
Rev
https://review.coreboot.org/c/coreboot/+/32511/19/src/mainboard/google/kukui... File src/mainboard/google/kukui/display.c:
https://review.coreboot.org/c/coreboot/+/32511/19/src/mainboard/google/kukui... PS19, Line 61: static struct edid *get_edid(struct board_display_intf *intf) : { : struct panel_info *info = intf->cur_panel_info; : : if (info) : return info->edid; : return NULL; : } I think this function is not needed since it's only called one time, and the intf is provided by developer so simply assert() would be sufficient. Please move it to the caller.
https://review.coreboot.org/c/coreboot/+/32511/19/src/mainboard/google/kukui... PS19, Line 84: get_panel_name this is also not needed...
https://review.coreboot.org/c/coreboot/+/32511/19/src/mainboard/google/kukui... PS19, Line 100: update_panel_info In fact we don't need to call intf->get_panel_id.
For Kukui family, the panel ID is decided by ADC (see boardid.c). We may add a new get_panel_id() calling ADC if needed, or simply do get_sku_id() >> 4.
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 20:
The latest version was revised by me, without all the over-design stuff. should be clean and easy to read.
Hung-Te Lin has uploaded a new patch set (#23) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 135 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/23
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 24:
(1 comment)
https://review.coreboot.org/c/coreboot/+/32511/24/src/mainboard/google/kukui... File src/mainboard/google/kukui/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32511/24/src/mainboard/google/kukui... PS24, Line 119: int boolean or the coreboot CB_SUCCESS/ERROR enums.
Hung-Te Lin has uploaded a new patch set (#26) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 135 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/26
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 27: Code-Review+2
Nice design! We could consider factoring some of this out into src/lib if we keep having the same problem for MIPI panels.
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 27:
(1 comment)
https://review.coreboot.org/c/coreboot/+/32511/27/src/mainboard/google/kukui... File src/mainboard/google/kukui/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32511/27/src/mainboard/google/kukui... PS27, Line 123: -1 Should it be false?
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 27: -Code-Review
(1 comment)
https://review.coreboot.org/c/coreboot/+/32511/27/src/mainboard/google/kukui... File src/mainboard/google/kukui/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32511/27/src/mainboard/google/kukui... PS27, Line 123: -1
Should it be false?
Yikes! Good catch. This is why I don't like stdbool...
Yu-Ping Wu has uploaded a new patch set (#28) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 135 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/28
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 28: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/32511/27/src/mainboard/google/kukui... File src/mainboard/google/kukui/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32511/27/src/mainboard/google/kukui... PS27, Line 123: -1
Yikes! Good catch. This is why I don't like stdbool...
Done
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 28: Code-Review+2
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 28:
Waiting for previous patches in the train to be merged before merging this.
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 28:
(16 comments)
https://review.coreboot.org/c/coreboot/+/32511/14//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/32511/14//COMMIT_MSG@7 PS14, Line 7: google/kukui: Elaborate panel support for Kukui family boards.
Please remove the dot/period at the end.
Ack
https://review.coreboot.org/c/coreboot/+/32511/14//COMMIT_MSG@10 PS14, Line 10: inf
information?
Ack
https://review.coreboot.org/c/coreboot/+/32511/14//COMMIT_MSG@14 PS14, Line 14: it's
its
Ack
https://review.coreboot.org/c/coreboot/+/32511/14//COMMIT_MSG@14 PS14, Line 14: it's
its
Ack
https://review.coreboot.org/c/coreboot/+/32511/14//COMMIT_MSG@14 PS14, Line 14:
one space
Ack
https://review.coreboot.org/c/coreboot/+/32511/8/src/mainboard/google/kukui/... File src/mainboard/google/kukui/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/32511/8/src/mainboard/google/kukui/... PS8, Line 26: y
$(CONFIG_BOARD_GOOGLE_KUKUI)
Ack
https://review.coreboot.org/c/coreboot/+/32511/14/src/mainboard/google/kukui... File src/mainboard/google/kukui/display.h:
https://review.coreboot.org/c/coreboot/+/32511/14/src/mainboard/google/kukui... PS14, Line 66: /* : * board related functions : */
Are these comments needed?
Ack
https://review.coreboot.org/c/coreboot/+/32511/8/src/mainboard/google/kukui/... File src/mainboard/google/kukui/display.c:
https://review.coreboot.org/c/coreboot/+/32511/8/src/mainboard/google/kukui/... PS8, Line 98: if (CONFIG(BOARD_GOOGLE_KUKUI)) : return &kukui_display_intf; : else : return NULL;
This implies we'll need to include all interfaces for any builds. […]
Ack
https://review.coreboot.org/c/coreboot/+/32511/8/src/mainboard/google/kukui/... PS8, Line 116: return ERR;
return of an errno should typically be negative (ie: return -ERR)
Ack
https://review.coreboot.org/c/coreboot/+/32511/14/src/mainboard/google/kukui... File src/mainboard/google/kukui/display.c:
PS14:
Did you run this through clang-format?
Ack
https://review.coreboot.org/c/coreboot/+/32511/14/src/mainboard/google/kukui... PS14, Line 38: printk(BIOS_ERR, "%s: wrong parameters\n", __func__);
Error messages should be more elaborate, so a user can understand it.
Ack
https://review.coreboot.org/c/coreboot/+/32511/14/src/mainboard/google/kukui... PS14, Line 52: printk(BIOS_ERR, "dsi init fail\n");
Maybe? […]
Ack
https://review.coreboot.org/c/coreboot/+/32511/14/src/mainboard/google/kukui... PS14, Line 93: /* Exported Functions */
Are these comments neeeded?
Ack
https://review.coreboot.org/c/coreboot/+/32511/14/src/mainboard/google/kukui... PS14, Line 113: -1
We have error codes in coreboot. […]
Ack
https://review.coreboot.org/c/coreboot/+/32511/24/src/mainboard/google/kukui... File src/mainboard/google/kukui/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32511/24/src/mainboard/google/kukui... PS24, Line 119: int
boolean or the coreboot CB_SUCCESS/ERROR enums.
Done
https://review.coreboot.org/c/coreboot/+/32511/14/src/mainboard/google/kukui... File src/mainboard/google/kukui/panel_kukui.c:
https://review.coreboot.org/c/coreboot/+/32511/14/src/mainboard/google/kukui... PS14, Line 34: .name = "768x1024@60Hz",
Isn’t it landscape?
Ack
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 28:
(3 comments)
https://review.coreboot.org/c/coreboot/+/32511/19/src/mainboard/google/kukui... File src/mainboard/google/kukui/display.c:
https://review.coreboot.org/c/coreboot/+/32511/19/src/mainboard/google/kukui... PS19, Line 61: static struct edid *get_edid(struct board_display_intf *intf) : { : struct panel_info *info = intf->cur_panel_info; : : if (info) : return info->edid; : return NULL; : }
I think this function is not needed since it's only called one time, and the intf is provided by dev […]
Ack
https://review.coreboot.org/c/coreboot/+/32511/19/src/mainboard/google/kukui... PS19, Line 84: get_panel_name
this is also not needed...
Ack
https://review.coreboot.org/c/coreboot/+/32511/19/src/mainboard/google/kukui... PS19, Line 100: update_panel_info
In fact we don't need to call intf->get_panel_id. […]
Ack
Hung-Te Lin has uploaded a new patch set (#29) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 149 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/29
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 29: Code-Review+1
Hung-Te Lin has uploaded a new patch set (#30) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 140 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/30
Hung-Te Lin has uploaded a new patch set (#31) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h M src/soc/mediatek/mt8183/ddp.c 3 files changed, 150 insertions(+), 27 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/31
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 33:
(8 comments)
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... File src/mainboard/google/kukui/panel.h:
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 33: .cmd = INIT_DCS_CMD, \ code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 34: .len = sizeof((u8[]){__VA_ARGS__}), \ code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 35: .data = {__VA_ARGS__} } code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 38: .cmd = INIT_GENERIC_CMD, \ code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 39: .len = sizeof((u8[]){__VA_ARGS__}), \ code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 40: .data = {__VA_ARGS__} } code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 43: .cmd = DELAY_CMD,\ code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 44: .len = delay, } code indent should use tabs where possible
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 33:
(8 comments)
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... File src/mainboard/google/kukui/panel.h:
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 33: .cmd = INIT_DCS_CMD, \
code indent should use tabs where possible
Done
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 34: .len = sizeof((u8[]){__VA_ARGS__}), \
code indent should use tabs where possible
Done
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 35: .data = {__VA_ARGS__} }
code indent should use tabs where possible
Done
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 38: .cmd = INIT_GENERIC_CMD, \
code indent should use tabs where possible
Done
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 39: .len = sizeof((u8[]){__VA_ARGS__}), \
code indent should use tabs where possible
Done
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 40: .data = {__VA_ARGS__} }
code indent should use tabs where possible
Done
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 43: .cmd = DELAY_CMD,\
code indent should use tabs where possible
Done
https://review.coreboot.org/c/coreboot/+/32511/33/src/mainboard/google/kukui... PS33, Line 44: .len = delay, }
code indent should use tabs where possible
Done
Hung-Te Lin has uploaded a new patch set (#34) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h M src/soc/mediatek/mt8183/ddp.c 3 files changed, 150 insertions(+), 27 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/34
Hung-Te Lin has uploaded a new patch set (#36) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h M src/soc/mediatek/mt8183/ddp.c 3 files changed, 165 insertions(+), 27 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/36
Hung-Te Lin has uploaded a new patch set (#37) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h M src/soc/mediatek/mt8183/ddp.c 3 files changed, 165 insertions(+), 27 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/37
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 38:
(2 comments)
https://review.coreboot.org/c/coreboot/+/32511/38/src/mainboard/google/kukui... File src/mainboard/google/kukui/panel.h:
https://review.coreboot.org/c/coreboot/+/32511/38/src/mainboard/google/kukui... PS38, Line 32: _INIT_DCS_CMD Let's not start the thing that we actually want to use in the panel file with an underscore (underscores are for intermediary macros hidden away in some header). I'd either just call this something else (e.g. INIT_DCS() or PANEL_INIT_DCS or something) or rename the integer constant (e.g. call the macro INIT_DCS_CMD() and the constant INIT_DCS_CMD_OPCODE or something).
https://review.coreboot.org/c/coreboot/+/32511/38/src/mainboard/google/kukui... PS38, Line 34: .len = sizeof((u8[]){__VA_ARGS__}), \ Nice, that's way more clever than what I said!
Hung-Te Lin has uploaded a new patch set (#40) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Kaka Ni nigang@huaqin.corp-partner.google.com --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h M src/soc/mediatek/mt8183/dsi.c 3 files changed, 157 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/40
Hung-Te Lin has uploaded a new patch set (#44) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Hung-Te Lin hungte@chromium.org --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 157 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/44
Hung-Te Lin has uploaded a new patch set (#48) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Hung-Te Lin hungte@chromium.org --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 157 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/48
Hung-Te Lin has uploaded a new patch set (#53) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Hung-Te Lin hungte@chromium.org --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 159 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/53
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 54: Code-Review+2
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 54:
(1 comment)
https://review.coreboot.org/c/coreboot/+/32511/54/src/mainboard/google/kukui... File src/mainboard/google/kukui/panel.h:
https://review.coreboot.org/c/coreboot/+/32511/54/src/mainboard/google/kukui... PS54, Line 23: const char *name; /* human readable name */ Why don't we just use edid.ascii_string instead?
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 55:
(3 comments)
https://review.coreboot.org/c/coreboot/+/32511/54/src/mainboard/google/kukui... File src/mainboard/google/kukui/panel.h:
https://review.coreboot.org/c/coreboot/+/32511/54/src/mainboard/google/kukui... PS54, Line 23: const char *name; /* human readable name */
Why don't we just use edid. […]
ascii_string currently holds only 13 chars, which can't fit manufacturer name + panel ID.
in fact I think the EDID parser should be refactored to always contain manufacturer name, but that's another story.
for now a pure larger char buffer would be the better idea.
https://review.coreboot.org/c/coreboot/+/32511/38/src/mainboard/google/kukui... File src/mainboard/google/kukui/panel.h:
https://review.coreboot.org/c/coreboot/+/32511/38/src/mainboard/google/kukui... PS38, Line 32: _INIT_DCS_CMD
Let's not start the thing that we actually want to use in the panel file with an underscore (undersc […]
I'm trying to make this compatible with kernel implementation. But well, removing a underline is fine.
https://review.coreboot.org/c/coreboot/+/32511/38/src/mainboard/google/kukui... PS38, Line 34: .len = sizeof((u8[]){__VA_ARGS__}), \
Nice, that's way more clever than what I said!
Ack
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 55:
(1 comment)
https://review.coreboot.org/c/coreboot/+/32511/54/src/mainboard/google/kukui... File src/mainboard/google/kukui/panel.h:
https://review.coreboot.org/c/coreboot/+/32511/54/src/mainboard/google/kukui... PS54, Line 23: const char *name; /* human readable name */
ascii_string currently holds only 13 chars, which can't fit manufacturer name + panel ID. […]
Ack
Hung-Te Lin has uploaded a new patch set (#56) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Hung-Te Lin hungte@chromium.org --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h M src/soc/mediatek/common/include/soc/dsi_common.h M src/soc/mediatek/mt8183/dsi.c 4 files changed, 165 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/56
Hung-Te Lin has uploaded a new patch set (#57) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Hung-Te Lin hungte@chromium.org --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h M src/soc/mediatek/common/include/soc/dsi_common.h M src/soc/mediatek/mt8183/dsi.c 4 files changed, 166 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/57
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 58:
(1 comment)
https://review.coreboot.org/c/coreboot/+/32511/54/src/mainboard/google/kukui... File src/mainboard/google/kukui/panel.h:
https://review.coreboot.org/c/coreboot/+/32511/54/src/mainboard/google/kukui... PS54, Line 23: const char *name; /* human readable name */
Ack
Yeah, but don't you only use it for debug messages anyway? Do we really need more than 13 chars there? Could just shave off one more special case for the eDP bridge with that.
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 60:
(1 comment)
https://review.coreboot.org/c/coreboot/+/32511/54/src/mainboard/google/kukui... File src/mainboard/google/kukui/panel.h:
https://review.coreboot.org/c/coreboot/+/32511/54/src/mainboard/google/kukui... PS54, Line 23: const char *name; /* human readable name */
Yeah, but don't you only use it for debug messages anyway? Do we really need more than 13 chars ther […]
I wanted to see the manufacturer...
but yeah, we may revise this later. let me change it to ascii_string.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 60:
(2 comments)
https://review.coreboot.org/c/coreboot/+/32511/60/src/mainboard/google/kukui... File src/mainboard/google/kukui/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32511/60/src/mainboard/google/kukui... PS60, Line 109: if (!*name) You're pointing this at an array, it can never be NULL. (I think it's fine to just display "Found ''" in that case, shouldn't happen anyway.)
https://review.coreboot.org/c/coreboot/+/32511/60/src/soc/mediatek/common/in... File src/soc/mediatek/common/include/soc/dsi_common.h:
https://review.coreboot.org/c/coreboot/+/32511/60/src/soc/mediatek/common/in... PS60, Line 73: u32 dsi_vfp_early_stop; /* Available since MT8183 */ Looks like this slipped into the wrong patch? (But I'm fine submitting it this way if you don't want to reorder again, nbd...)
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 60:
(2 comments)
https://review.coreboot.org/c/coreboot/+/32511/60/src/mainboard/google/kukui... File src/mainboard/google/kukui/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32511/60/src/mainboard/google/kukui... PS60, Line 109: if (!*name)
You're pointing this at an array, it can never be NULL. […]
Yes that's an array, so I was not testing if (name). But if the decoded EDID does not have valid field for ascii string, it can contain \0 so we may check if (*name).
https://review.coreboot.org/c/coreboot/+/32511/60/src/soc/mediatek/common/in... File src/soc/mediatek/common/include/soc/dsi_common.h:
https://review.coreboot.org/c/coreboot/+/32511/60/src/soc/mediatek/common/in... PS60, Line 73: u32 dsi_vfp_early_stop; /* Available since MT8183 */
Looks like this slipped into the wrong patch? (But I'm fine submitting it this way if you don't want […]
Done
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 61:
(1 comment)
https://review.coreboot.org/c/coreboot/+/32511/60/src/mainboard/google/kukui... File src/mainboard/google/kukui/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32511/60/src/mainboard/google/kukui... PS60, Line 109: if (!*name)
Yes that's an array, so I was not testing if (name). […]
Oh... okay, missed that. Can you write 'if (name[0] == '\0')' for clarity?
Hung-Te Lin has uploaded a new patch set (#62) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Hung-Te Lin hungte@chromium.org --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 160 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/62
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 62:
(1 comment)
https://review.coreboot.org/c/coreboot/+/32511/60/src/mainboard/google/kukui... File src/mainboard/google/kukui/mainboard.c:
https://review.coreboot.org/c/coreboot/+/32511/60/src/mainboard/google/kukui... PS60, Line 109: if (!*name)
Oh... okay, missed that. […]
Done
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
Patch Set 62: Code-Review+2
Hung-Te Lin has uploaded a new patch set (#64) to the change originally created by Kaka Ni. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Hung-Te Lin hungte@chromium.org --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 160 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/32511/64
Julius Werner has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32511 )
Change subject: mb/google/kukui: Initialize display ......................................................................
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function.
The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits.
BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui
Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Hung-Te Lin hungte@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/32511 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org --- M src/mainboard/google/kukui/mainboard.c A src/mainboard/google/kukui/panel.h 2 files changed, 160 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c index 40b8a49..7bf2580 100644 --- a/src/mainboard/google/kukui/mainboard.c +++ b/src/mainboard/google/kukui/mainboard.c @@ -13,12 +13,22 @@ * GNU General Public License for more details. */
+#include <boardid.h> +#include <bootmode.h> +#include <console/console.h> +#include <delay.h> #include <device/device.h> +#include <edid.h> +#include <gpio.h> +#include <soc/ddp.h> +#include <soc/dsi.h> #include <soc/gpio.h> #include <soc/mmu_operations.h> #include <soc/mtcmos.h> #include <soc/usb.h>
+#include "panel.h" + static void configure_emmc(void) { const gpio_t emmc_pin[] = { @@ -49,8 +59,99 @@ gpio_set_mode(GPIO(CAM_PDN0), PAD_CAM_PDN0_FUNC_I2S2_MCK); gpio_set_mode(GPIO(EINT3), PAD_EINT3_FUNC_I2S3_DO); } + +/* Default implementation for boards without panels defined yet. */ +struct panel_description __weak *get_panel_description(int panel_id) +{ + printk(BIOS_ERR, "%s: ERROR: No panels defined for board: %s.\n", + __func__, CONFIG_MAINBOARD_PART_NUMBER); + return NULL; +} + +/* Set up backlight control pins as output pin and power-off by default */ +static void configure_panel_backlight(void) +{ + gpio_output(GPIO(PERIPHERAL_EN13), 0); + gpio_output(GPIO(DISP_PWM), 0); +} + +static void power_on_panel(struct panel_description *panel) +{ + if (panel->power_on) { + panel->power_on(); + return; + } + + /* Default power sequence for most panels. */ + gpio_output(GPIO_LCM_RST_1V8, 0); + gpio_output(GPIO_PPVARP_LCD_EN, 1); + gpio_output(GPIO_PPVARN_LCD_EN, 1); + gpio_output(GPIO_PP1800_LCM_EN, 1); + gpio_output(GPIO_PP3300_LCM_EN, 1); + mdelay(6); + gpio_output(GPIO_LCM_RST_1V8, 1); + mdelay(6); +} + +static struct panel_description *get_active_panel(void) +{ + /* TODO(hungte) Create a dedicated panel_id() in board_id.c */ + int panel_id = sku_id() >> 4; + + struct panel_description *panel = get_panel_description(panel_id); + if (!panel) { + printk(BIOS_ERR, "%s: Panel %d is not supported.\n", + __func__, panel_id); + return NULL; + } + const char *mode_name = panel->edid.mode.name; + const char *name = panel->edid.ascii_string; + if (name[0] == '\0') + name = "unknown name"; + printk(BIOS_INFO, "%s: Found ID %d: '%s' %s\n", __func__, + panel_id, name, mode_name ? mode_name : "(unknown mode)"); + return panel; +} + +static bool configure_display(void) +{ + struct panel_description *panel = get_active_panel(); + if (!panel) + return false; + + mtcmos_display_power_on(); + mtcmos_protect_display_bus(); + configure_panel_backlight(); + power_on_panel(panel); + + struct edid *edid = &panel->edid; + edid_set_framebuffer_bits_per_pixel(edid, 32, 0); + mtk_ddp_init(); + u32 mipi_dsi_flags = (MIPI_DSI_MODE_VIDEO | + MIPI_DSI_MODE_VIDEO_SYNC_PULSE | + MIPI_DSI_MODE_LPM); + if (mtk_dsi_init(mipi_dsi_flags, MIPI_DSI_FMT_RGB888, 4, edid, + panel->init) < 0) { + printk(BIOS_ERR, "%s: Failed in DSI init.\n", __func__); + return false; + } + mtk_ddp_mode_set(edid); + set_vbe_mode_info_valid(edid, 0); + set_vbe_framebuffer_orientation(panel->orientation); + return true; +} + static void mainboard_init(struct device *dev) { + if (display_init_required()) { + printk(BIOS_INFO, "%s: Starting display init.\n", __func__); + if (!configure_display()) + printk(BIOS_ERR, "%s: Failed to init display.\n", + __func__); + } else { + printk(BIOS_INFO, "%s: Skipped display init.\n", __func__); + } + configure_emmc(); configure_usb(); configure_audio(); diff --git a/src/mainboard/google/kukui/panel.h b/src/mainboard/google/kukui/panel.h new file mode 100644 index 0000000..e68567d --- /dev/null +++ b/src/mainboard/google/kukui/panel.h @@ -0,0 +1,59 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2019 Huaqin Telecom 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. + */ + +#ifndef __MAINBOARD_GOOGLE_KUKUI_PANEL_H__ +#define __MAINBOARD_GOOGLE_KUKUI_PANEL_H__ + +#include <edid.h> +#include <soc/dsi.h> + +struct panel_description { + struct edid edid; /* edid info of this panel */ + enum lb_fb_orientation orientation; /* panel orientation */ + void (*power_on)(void); /* Callback to turn on panel */ + struct lcm_init_command init[]; /* table of init commands */ +}; + +/* Returns the panel description from given ID. */ +extern struct panel_description *get_panel_description(int panel_id); + +#define INIT_DCS_CMD(...) { \ + .cmd = LCM_DCS_CMD, \ + .len = sizeof((u8[]){__VA_ARGS__}), \ + .data = {__VA_ARGS__} } + +#define INIT_GENERIC_CMD(...) { \ + .cmd = LCM_GENERIC_CMD, \ + .len = sizeof((u8[]){__VA_ARGS__}), \ + .data = {__VA_ARGS__} } + +#define INIT_DELAY_CMD(delay) { \ + .cmd = LCM_DELAY_CMD,\ + .len = delay, } + +#define INIT_END_CMD { .cmd = LCM_END_CMD, } + +/* GPIO names */ +#define GPIO_LCM_RST_1V8 GPIO(LCM_RST) /* 45 */ +#define GPIO_MIPIBRDG_PWRDN_L_1V8 GPIO(LCM_RST) /* 45 */ +#define GPIO_MIPIBRDG_RST_L_1V8 GPIO(BPI_BUS3) /* 73 */ +#define GPIO_PP1200_MIPIBRDG_EN GPIO(BPI_OLAT1) /* 54 */ +#define GPIO_PP1800_LCM_EN GPIO(SIM2_SRST) /* 36 */ +#define GPIO_PP3300_LCM_EN GPIO(SIM2_SIO) /* 35 */ +#define GPIO_PPVARN_LCD_EN GPIO(PERIPHERAL_EN9) /* 166 */ +#define GPIO_PPVARP_LCD_EN GPIO(MISC_BSI_CK_3) /* 66 */ +#define GPIO_VDDIO_MIPIBRDG_EN GPIO(SIM2_SCLK) /* 37 */ + +#endif /* __MAINBOARD_GOOGLE_KUKUI_PANEL_H__ */