From c42a613ff52d9cda91abaa5fa86ec4fd5b50aba6 Mon Sep 17 00:00:00 2001 From: Werner Zeh Date: Thu, 12 Feb 2015 12:40:15 +0100 Subject: mainboard/siemens/mc_tcu3: Add new mainboard. This mainboard is based on Intel's Bayleybay board which uses Bay Trail CPU with Intel FSP. It has one USB3.0 interface, 4 USB2.0 interfaces, up to two Ethernet ports and a LVDS connection for LCD panels. The board is equipped with 512 MB of DDR3 in a memory down configuration. This board boots into Ubuntu/Lubuntu 14.10 using SeaBIOS, but other OSes should work as well (but are not tested). It has a version.hex file which is needed for our OS and has no hardware functionality. Change-Id: I94401bbd1d61ec69703de38ae1bc97969c5d979e Signed-off-by: Werner Zeh Reviewed-on: http://review.coreboot.org/8430 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/mainboard/siemens/mc_tcu3/lcd_panel.c | 94 +++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 src/mainboard/siemens/mc_tcu3/lcd_panel.c (limited to 'src/mainboard/siemens/mc_tcu3/lcd_panel.c') diff --git a/src/mainboard/siemens/mc_tcu3/lcd_panel.c b/src/mainboard/siemens/mc_tcu3/lcd_panel.c new file mode 100644 index 0000000000..1dc429ec04 --- /dev/null +++ b/src/mainboard/siemens/mc_tcu3/lcd_panel.c @@ -0,0 +1,94 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2014 Siemens AG + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include +#include +#include "modhwinfo.h" +#include "baytrail/gpio.h" +#include "lcd_panel.h" +#include "ptn3460.h" + +/** \brief Reads GPIOs used for LCD panel encoding and returns the 4 bit value + * @param no parameters + * @return LCD panel type encoded in 4 bits + */ +u8 get_lcd_panel_type(void) +{ + u8 lcd_type_gpio; + + lcd_type_gpio = ((read_ssus_gpio(LCD_TYPE_GPIO_BIT3) << 3) | + (read_ssus_gpio(LCD_TYPE_GPIO_BIT2) << 2) | + (read_ssus_gpio(LCD_TYPE_GPIO_BIT1) << 1) | + (read_ssus_gpio(LCD_TYPE_GPIO_BIT0))); + /* There is an inverter in this signals so we need to invert them as well */ + return ((~lcd_type_gpio) & 0x0f); +} + +/** \brief Setup LCD panel + * @param no parameters + * @return 0 on success otherwise error value + */ +int setup_lcd_panel(void) +{ + u8 lcd_type; + int status; + struct edidinfo *eib = NULL; + struct shortinfo *sib = NULL; + char blockname[33]; + + lcd_type = get_lcd_panel_type(); + printk(BIOS_INFO, "LCD: Found panel type %d\n", lcd_type); + switch (lcd_type) { + case LCD_PANEL_TYPE_10_INCH: + strcpy(blockname, "hwinfo10.hex"); + break; + case LCD_PANEL_TYPE_12_INCH: + strcpy(blockname, "hwinfo12.hex"); + break; + case LCD_PANEL_TYPE_15_INCH: + strcpy(blockname, "hwinfo15.hex"); + break; + case LCD_PANEL_TYPE_19_INCH: + strcpy(blockname, "hwinfo19.hex"); + break; + case LCD_PANEL_TYPE_EDID: + strcpy(blockname, "hwinfo.hex"); + break; + default: + printk(BIOS_ERR, "LCD: No supported panel found.\n"); + status = 1; + break; + } + + /* Now that we have the panel type, get the matching block and setup */ + /* the DP2LVDS converter accordingly */ + eib = get_edidinfo(blockname); + sib = get_shortinfo(blockname); + + if ((!eib) || (!sib)) { + printk(BIOS_ERR, "LCD: Info block named \"%s\" not found!\n", blockname); + status = 1; + } else { + printk(BIOS_INFO, "LCD: Found SIB at 0x%x, EIB at 0x%x\n", + (int)sib, (int)eib); + status = ptn3460_init(lcd_type, eib, sib); + printk(BIOS_INFO, "LCD: Setup PTN with status 0x%x\n", status); + } + return status; +} -- cgit v1.2.3