Erin Lo has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31516
Change subject: google/kukui: boot up sspm
......................................................................
google/kukui: boot up sspm
Load sspm firmware form cbfs and bring up it.
BUG=b:80501386
BRANCH=none
Test=Boots correctly on Kukui.
Change-Id: I4ae6034454326f5115cd3948819adc448b67fb1c
Signed-off-by: Erin Lo <erin.lo(a)mediatek.com>
---
M src/mainboard/google/kukui/Kconfig
M src/mainboard/google/kukui/Makefile.inc
M src/mainboard/google/kukui/mainboard.c
M src/soc/mediatek/mt8183/Makefile.inc
M src/soc/mediatek/mt8183/include/soc/addressmap.h
A src/soc/mediatek/mt8183/include/soc/sspm.h
A src/soc/mediatek/mt8183/sspm.c
7 files changed, 94 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/31516/1
diff --git a/src/mainboard/google/kukui/Kconfig b/src/mainboard/google/kukui/Kconfig
index 9f477e5..0dcdb20 100644
--- a/src/mainboard/google/kukui/Kconfig
+++ b/src/mainboard/google/kukui/Kconfig
@@ -65,4 +65,8 @@
default "KUKUI TEST 9847" if BOARD_GOOGLE_KUKUI
default "FLAPJACK TEST 4147" if BOARD_GOOGLE_FLAPJACK
+config SSPM_BIN_FILE
+ string "SSPM BIN FILE"
+ default ""
+
endif
diff --git a/src/mainboard/google/kukui/Makefile.inc b/src/mainboard/google/kukui/Makefile.inc
index a0556c1..565c3f7 100644
--- a/src/mainboard/google/kukui/Makefile.inc
+++ b/src/mainboard/google/kukui/Makefile.inc
@@ -25,3 +25,8 @@
ramstage-y += mainboard.c
ramstage-y += memlayout.ld
ramstage-y += reset.c
+
+cbfs-files-y += sspm
+sspm-file := $(call strip_quotes,$(CONFIG_SSPM_BIN_FILE))
+sspm-type := raw
+sspm-compression :=$(CBFS_COMPRESS_FLAG)
diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c
index e1d8f5f..5aaab8b 100644
--- a/src/mainboard/google/kukui/mainboard.c
+++ b/src/mainboard/google/kukui/mainboard.c
@@ -13,10 +13,13 @@
* GNU General Public License for more details.
*/
+#include <console/console.h>
+#include <cbfs.h>
#include <device/device.h>
#include <soc/gpio.h>
#include <soc/mmu_operations.h>
#include <soc/usb.h>
+#include <soc/sspm.h>
static void configure_emmc(void)
{
@@ -37,10 +40,29 @@
setup_usb_host();
}
+#define BUF_SIZE (64 * KiB)
+unsigned char buf[BUF_SIZE];
+
+static void sspm_boot(void)
+{
+ size_t fw_size = cbfs_boot_load_file("sspm", buf, sizeof(buf),
+ CBFS_TYPE_RAW);
+
+ if (fw_size == 0)
+ printk(BIOS_DEBUG, "no sspm\n");
+ else
+ printk(BIOS_DEBUG, "sspm[0]=%#x, [%zd]=%#x\n",
+ buf[0], fw_size - 1, buf[fw_size - 1]);
+
+ sspm_init(buf, BUF_SIZE);
+
+}
+
static void mainboard_init(struct device *dev)
{
configure_emmc();
configure_usb();
+ sspm_boot();
}
static void mainboard_enable(struct device *dev)
diff --git a/src/soc/mediatek/mt8183/Makefile.inc b/src/soc/mediatek/mt8183/Makefile.inc
index 5770a83..199b22d 100644
--- a/src/soc/mediatek/mt8183/Makefile.inc
+++ b/src/soc/mediatek/mt8183/Makefile.inc
@@ -49,6 +49,7 @@
ramstage-y += ../common/uart.c
ramstage-y += ../common/usb.c
ramstage-y += ../common/wdt.c
+ramstage-y += sspm.c
CPPFLAGS_common += -Isrc/soc/mediatek/mt8183/include
CPPFLAGS_common += -Isrc/soc/mediatek/common/include
diff --git a/src/soc/mediatek/mt8183/include/soc/addressmap.h b/src/soc/mediatek/mt8183/include/soc/addressmap.h
index d41b2b9..f812224 100644
--- a/src/soc/mediatek/mt8183/include/soc/addressmap.h
+++ b/src/soc/mediatek/mt8183/include/soc/addressmap.h
@@ -34,6 +34,7 @@
EMI_BASE = IO_PHYS + 0x00219000,
EMI_MPU_BASE = IO_PHYS + 0x00226000,
DRAMC_CH_BASE = IO_PHYS + 0x00228000,
+ SSPM_BASE = IO_PHYS + 0x00440000,
AUXADC_BASE = IO_PHYS + 0x01001000,
UART0_BASE = IO_PHYS + 0x01002000,
SPI0_BASE = IO_PHYS + 0x0100A000,
diff --git a/src/soc/mediatek/mt8183/include/soc/sspm.h b/src/soc/mediatek/mt8183/include/soc/sspm.h
new file mode 100644
index 0000000..f006ca2
--- /dev/null
+++ b/src/soc/mediatek/mt8183/include/soc/sspm.h
@@ -0,0 +1,28 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 MediaTek 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 SOC_MEDIATEK_MT8183_SSPM_H
+#define SOC_MEDIATEK_MT8183_SSPM_H
+
+#include <soc/addressmap.h>
+#include <types.h>
+
+struct mt8183_sspm_regs {
+ u32 sw_rstn;
+};
+static struct mt8183_sspm_regs *const mt8183_sspm = (void *)SSPM_BASE;
+#define CFG_SSPM_SRAM 0x10400000
+s32 sspm_init(unsigned char *buf, int len);
+#endif /* SOC_MEDIATEK_MT8183_SSPM_H */
diff --git a/src/soc/mediatek/mt8183/sspm.c b/src/soc/mediatek/mt8183/sspm.c
new file mode 100644
index 0000000..a42a0f5
--- /dev/null
+++ b/src/soc/mediatek/mt8183/sspm.c
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 MediaTek 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 <arch/barrier.h>
+#include <arch/io.h>
+#include <soc/gpio.h>
+#include <soc/sspm.h>
+#include <string.h>
+
+#define SSPM_UART 1
+s32 sspm_init(unsigned char *buf, int len)
+{
+ memcpy((void*)CFG_SSPM_SRAM, buf, len);
+#if SSPM_UART
+ gpio_set_mode(GPIO(EINT4), PAD_EINT4_FUNC_SSPM_UTXD_AO);
+ gpio_set_mode(GPIO(EINT5), PAD_EINT5_FUNC_SSPM_URXD_AO);
+#endif
+ mb();
+ write32(&mt8183_sspm->sw_rstn, 0x1);
+ return 0;
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/31516
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4ae6034454326f5115cd3948819adc448b67fb1c
Gerrit-Change-Number: 31516
Gerrit-PatchSet: 1
Gerrit-Owner: Erin Lo <erin.lo(a)mediatek.com>
Gerrit-MessageType: newchange
Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/libgfxinit/+/31453
Change subject: gma: Add more PCI IDs for Coffee/Whiskey/Amber Lake
......................................................................
gma: Add more PCI IDs for Coffee/Whiskey/Amber Lake
These seem to be 100% compatible to Kaby Lake wrt. modesetting. So
treat them as the latter for now.
Untested. Didn't look at documented workarounds, yet.
Change-Id: If01883ba95246f9bfd66049772597e0317e294d2
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M common/hw-gfx-gma-config.ads.template
1 file changed, 18 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/53/31453/1
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index d91d9c7..c3f3a7c 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -390,6 +390,14 @@
(Device_Id and 16#ffcf#) = 16#590b# or
(Device_Id and 16#ffcf#) = 16#590d#);
+ function Is_Coffee_Lake_Y_AML (Device_Id : Word16) return Boolean is
+ (Device_Id = 16#87ca#);
+ -- Including Whiskey Lake:
+ function Is_Coffee_Lake_U (Device_Id : Word16) return Boolean is
+ ((Device_Id and 16#fff0#) = 16#3ea0#);
+ function Is_Coffee_Lake (Device_Id : Word16) return Boolean is
+ ((Device_Id and 16#fff0#) = 16#3e90#);
+
function Is_GPU (Device_Id : Word16; CPU : CPU_Type; CPU_Var : CPU_Variant)
return Boolean is
(case CPU is
@@ -412,10 +420,16 @@
when ULT => Is_Skylake_U (Device_Id),
when ULX => Is_Skylake_Y (Device_Id)),
when Kabylake => (case CPU_Var is
- when Normal => Is_Kaby_Lake (Device_Id),
- when ULT => Is_Kaby_Lake_U (Device_Id),
- when ULX => Is_Kaby_Lake_Y (Device_Id) or
- Is_Kaby_Lake_Y_AML (Device_Id)));
+ when Normal =>
+ Is_Kaby_Lake (Device_Id) or
+ Is_Coffee_Lake (Device_Id),
+ when ULT =>
+ Is_Kaby_Lake_U (Device_Id) or
+ Is_Coffee_Lake_U (Device_Id),
+ when ULX =>
+ Is_Kaby_Lake_Y (Device_Id) or
+ Is_Kaby_Lake_Y_AML (Device_Id) or
+ Is_Coffee_Lake_Y_AML (Device_Id)));
function Compatible_GPU (Device_Id : Word16) return Boolean is
(Is_GPU (Device_Id, CPU, CPU_Var));
--
To view, visit https://review.coreboot.org/c/libgfxinit/+/31453
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-Change-Id: If01883ba95246f9bfd66049772597e0317e294d2
Gerrit-Change-Number: 31453
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: newchange
Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/libgfxinit/+/31454
Change subject: gma: Publish Read_EDID()
......................................................................
gma: Publish Read_EDID()
Might be useful in coreboot to read the raw EDID.
Change-Id: I13d28a4434de3b0699a3475dd96febfdf75639f0
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M common/hw-gfx-gma-display_probing.adb
M common/hw-gfx-gma-display_probing.ads
M common/hw-gfx-gma.ads
3 files changed, 11 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/54/31454/1
diff --git a/common/hw-gfx-gma-display_probing.adb b/common/hw-gfx-gma-display_probing.adb
index 9f756f6..cd2a452 100644
--- a/common/hw-gfx-gma-display_probing.adb
+++ b/common/hw-gfx-gma-display_probing.adb
@@ -13,7 +13,6 @@
--
with HW.GFX.I2C;
-with HW.GFX.EDID;
with HW.GFX.GMA.Config;
with HW.GFX.GMA.Config_Helpers;
with HW.GFX.GMA.I2C;
@@ -56,8 +55,6 @@
(Raw_EDID : out EDID.Raw_EDID_Data;
Port : in Active_Port_Type;
Success : out Boolean)
- with
- Post => (if Success then EDID.Valid (Raw_EDID))
is
Raw_EDID_Length : GFX.I2C.Transfer_Length := Raw_EDID'Length;
begin
diff --git a/common/hw-gfx-gma-display_probing.ads b/common/hw-gfx-gma-display_probing.ads
index f5cd839..e51de88 100644
--- a/common/hw-gfx-gma-display_probing.ads
+++ b/common/hw-gfx-gma-display_probing.ads
@@ -12,6 +12,8 @@
-- GNU General Public License for more details.
--
+with HW.GFX.EDID;
+
package HW.GFX.GMA.Display_Probing
is
@@ -20,6 +22,13 @@
All_Ports : constant Port_List :=
(DP1, DP2, DP3, HDMI1, HDMI2, HDMI3, Analog, Internal);
+ procedure Read_EDID
+ (Raw_EDID : out EDID.Raw_EDID_Data;
+ Port : in Active_Port_Type;
+ Success : out Boolean)
+ with
+ Post => (if Success then EDID.Valid (Raw_EDID));
+
procedure Scan_Ports
(Configs : out Pipe_Configs;
Ports : in Port_List := All_Ports;
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index 7ca0ca1..d3792a2 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -57,6 +57,8 @@
HDMI2, -- or DVI
HDMI3, -- or DVI
Analog);
+ subtype Active_Port_Type is Port_Type
+ range Port_Type'Succ (Disabled) .. Port_Type'Last;
type Cursor_Mode is (No_Cursor, ARGB_Cursor);
type Cursor_Size is (Cursor_64x64, Cursor_128x128, Cursor_256x256);
@@ -171,9 +173,6 @@
----------------------------------------------------------------------------
-- Internal representation of a single pipe's configuration
- subtype Active_Port_Type is Port_Type
- range Port_Type'Succ (Disabled) .. Port_Type'Last;
-
type GPU_Port is (DIGI_A, DIGI_B, DIGI_C, DIGI_D, DIGI_E, LVDS, VGA);
subtype Digital_Port is GPU_Port range DIGI_A .. DIGI_E;
--
To view, visit https://review.coreboot.org/c/libgfxinit/+/31454
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-Change-Id: I13d28a4434de3b0699a3475dd96febfdf75639f0
Gerrit-Change-Number: 31454
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: newchange
Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/libgfxinit/+/31452
Change subject: gma: Add support for ULX variants
......................................................................
gma: Add support for ULX variants
On Haswell and Broadwell, the ULX variants differ only in the available
CD clock frequencies and, on Haswell, the maximum DP link rate. On newer
generations (Skylake+), they differ only in output buffer tuning.
Also update the PCI IDs from Haswell to Skylake.
Still untested, which was the original reason to skip ULX.
Change-Id: I08e6689ff8c0f2d58b51363886d4cab956f44e03
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M common/haswell/hw-gfx-gma-plls.adb
M common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
M common/hw-gfx-gma-config.ads.template
M common/hw-gfx-gma.ads
M common/skylake/hw-gfx-gma-connectors-ddi-buffers.adb
5 files changed, 136 insertions(+), 46 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/52/31452/1
diff --git a/common/haswell/hw-gfx-gma-plls.adb b/common/haswell/hw-gfx-gma-plls.adb
index 3a91bdd..0450238 100644
--- a/common/haswell/hw-gfx-gma-plls.adb
+++ b/common/haswell/hw-gfx-gma-plls.adb
@@ -1,5 +1,5 @@
--
--- Copyright (C) 2015-2016 secunet Security Networks AG
+-- Copyright (C) 2015-2016, 2019 secunet Security Networks 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
@@ -12,6 +12,7 @@
-- GNU General Public License for more details.
--
+with HW.GFX.GMA.Config;
with HW.GFX.GMA.PLLs.LCPLL;
with HW.GFX.GMA.PLLs.WRPLL;
@@ -87,8 +88,13 @@
PLL := Invalid;
Success := True;
elsif Port_Cfg.Display = DP then
- PLL := LCPLL.Fixed_LCPLLs (Port_Cfg.DP.Bandwidth);
- Success := True;
+ if Port_Cfg.DP.Bandwidth <= Config.DP_Max_Link_Rate then
+ PLL := LCPLL.Fixed_LCPLLs (Port_Cfg.DP.Bandwidth);
+ Success := True;
+ else
+ PLL := Invalid;
+ Success := False;
+ end if;
else
Alloc_Configurable (Port_Cfg.Mode, PLL, Success);
end if;
diff --git a/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb b/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
index 88f2b22..ef6d568 100644
--- a/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
+++ b/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
@@ -298,7 +298,7 @@
procedure Initialize
is
- Iboost_Value : constant Word32 := 1;
+ Iboost_Value : constant := Config.DDI_Buffer_Iboost;
begin
if Config.Has_DDI_Buffer_Trans then
declare
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index a922b05..b190a78 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -1,5 +1,5 @@
--
--- Copyright (C) 2015-2018 secunet Security Networks AG
+-- Copyright (C) 2015-2019 secunet Security Networks 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
@@ -42,6 +42,8 @@
Have_DVI_I : constant Boolean := Analog_I2C_Port /= PCH_DAC;
Has_Presence_Straps : constant Boolean := CPU /= Broxton;
Is_ULT : constant Boolean := CPU_Var = ULT;
+ Is_ULX : constant Boolean := CPU_Var = ULX;
+ Is_LP : constant Boolean := Is_ULT or Is_ULX;
----- CPU pipe: --------
Has_Tertiary_Pipe : constant Boolean := CPU >= Ivybridge;
@@ -74,7 +76,7 @@
Has_PCH : constant Boolean := CPU /= Broxton and CPU /= G45;
Has_PCH_DAC : constant Boolean := CPU in Ironlake .. Ivybridge or
(CPU in Haswell .. Broadwell
- and not Is_ULT);
+ and not Is_LP);
Has_PCH_Aux_Channels : constant Boolean := CPU in Ironlake .. Broadwell;
@@ -98,13 +100,13 @@
Has_Per_DDI_Clock_Sel : constant Boolean := CPU in Haswell .. Broadwell;
Has_HOTPLUG_CTL : constant Boolean := CPU in Haswell .. Broadwell;
Has_SHOTPLUG_CTL_A : constant Boolean := (CPU in Haswell .. Broadwell
- and Is_ULT) or
+ and Is_LP) or
CPU >= Skylake;
Has_DDI_PHYs : constant Boolean := CPU = Broxton;
Has_DDI_D : constant Boolean := CPU >= Haswell and
- not Is_ULT and
+ not Is_LP and
not Has_DDI_PHYs;
Has_DDI_E : constant Boolean := -- might be disabled by x4 eDP
Has_DDI_D;
@@ -122,7 +124,7 @@
Has_PCH_GMBUS : constant Boolean := CPU >= Ironlake;
----- Power: -----------
- Has_IPS : constant Boolean := (CPU = Haswell and Is_ULT) or
+ Has_IPS : constant Boolean := (CPU = Haswell and Is_LP) or
CPU = Broadwell;
Has_IPS_CTL_Mailbox : constant Boolean := CPU = Broadwell;
@@ -220,6 +222,8 @@
----------------------------------------------------------------------------
+ DDI_Buffer_Iboost : constant := (if Is_ULX then 3 else 1);
+
Default_DDI_HDMI_Buffer_Translation : constant DDI_HDMI_Buf_Trans_Range :=
(case CPU is
when Haswell => 6,
@@ -233,11 +237,11 @@
Default_CDClk_Freq : constant Frequency_Type :=
(case CPU is
when G45 => 320_000_000, -- unused
- when Ironlake |
- Haswell |
- Broadwell => 450_000_000,
+ when Ironlake => 450_000_000,
when Sandybridge |
Ivybridge => 400_000_000,
+ when Haswell |
+ Broadwell => (if Is_ULX then 337_500_000 else 450_000_000),
when Broxton => 288_000_000,
when Skylake => 337_500_000);
@@ -248,7 +252,7 @@
Sandybridge |
Ivybridge => 125_000_000,
when Haswell |
- Broadwell => (if Is_ULT then 24_000_000 else 125_000_000),
+ Broadwell => (if Is_LP then 24_000_000 else 125_000_000),
when Broxton => Frequency_Type'First, -- none needed
when Skylake => 24_000_000);
@@ -286,6 +290,11 @@
----------------------------------------------------------------------------
+ DP_Max_Link_Rate : constant DP_Bandwidth :=
+ (if CPU < Haswell or (CPU = Haswell and Is_ULX)
+ then DP_Bandwidth_2_7
+ else DP_Bandwidth_5_4);
+
-- FIXME: Unknown for Broxton, Linux' i915 contains a fixme too :-D
HDMI_Max_Clock_24bpp : constant Frequency_Type :=
(if CPU >= Haswell then 300_000_000 else 225_000_000);
@@ -318,15 +327,50 @@
use type HW.Word16;
- function Is_Broadwell_H (Device_Id : Word16) return Boolean is
- (Device_Id = 16#1612# or Device_Id = 16#1622# or Device_Id = 16#162a#);
+ -- GMA PCI IDs:
+ --
+ -- Rather catch too much here than too little, it's
+ -- mostly used to distinguish generations. Best public
+ -- reference for these IDs is Linux' i915.
+ --
+ -- Since Sandybridge, bits 4 and 5 encode the compu-
+ -- tational capabilities and can mostly be ignored.
+ -- From Haswell on, we have to distinguish between
+ -- Normal, ULT (U CPU lines) and ULX (Y CPU lines).
+ function Is_Haswell_Y (Device_Id : Word16) return Boolean is
+ ((Device_Id and 16#ffef#) = 16#0a0e#);
+ function Is_Haswell_U (Device_Id : Word16) return Boolean is
+ (((Device_Id and 16#ffc3#) = 16#0a02# or
+ (Device_Id and 16#ffcf#) = 16#0a0b#) and
+ not Is_Haswell_Y (Device_Id));
+ function Is_Haswell (Device_Id : Word16) return Boolean is
+ ((Device_Id and 16#ffc3#) = 16#0402# or
+ (Device_Id and 16#ffcf#) = 16#040b# or
+ (Device_Id and 16#ffc3#) = 16#0c02# or
+ (Device_Id and 16#ffcf#) = 16#0c0b# or
+ (Device_Id and 16#ffc3#) = 16#0d02# or
+ (Device_Id and 16#ffcf#) = 16#0d0b#);
+
+ function Is_Broadwell_Y (Device_Id : Word16) return Boolean is
+ ((Device_Id and 16#ffcf#) = 16#160e#);
+ function Is_Broadwell_U (Device_Id : Word16) return Boolean is
+ ((Device_Id and 16#ffcf#) = 16#1606# or
+ (Device_Id and 16#ffcf#) = 16#160b#);
+ function Is_Broadwell (Device_Id : Word16) return Boolean is
+ ((Device_Id and 16#ffc7#) = 16#1602# or
+ (Device_Id and 16#ffcf#) = 16#160d#);
+
+ function Is_Skylake_Y (Device_Id : Word16) return Boolean is
+ ((Device_Id and 16#ffcf#) = 16#190e#);
function Is_Skylake_U (Device_Id : Word16) return Boolean is
- (Device_Id = 16#1906# or Device_Id = 16#1916# or Device_Id = 16#1923# or
- Device_Id = 16#1926# or Device_Id = 16#1927#);
+ ((Device_Id and 16#ffc9#) = 16#1901# or
+ (Device_Id and 16#ffcf#) = 16#1906#);
+ function Is_Skylake (Device_Id : Word16) return Boolean is
+ ((Device_Id and 16#ffc7#) = 16#1902# or
+ (Device_Id and 16#ffcf#) = 16#190b# or
+ (Device_Id and 16#ffcf#) = 16#190d#);
- -- Rather catch too much here than too little,
- -- it's only used to distinguish generations.
function Is_GPU (Device_Id : Word16; CPU : CPU_Type; CPU_Var : CPU_Variant)
return Boolean is
(case CPU is
@@ -335,25 +379,19 @@
when Ironlake => (Device_Id and 16#fff3#) = 16#0042#,
when Sandybridge => (Device_Id and 16#ffc2#) = 16#0102#,
when Ivybridge => (Device_Id and 16#ffc3#) = 16#0142#,
- when Haswell =>
- (case CPU_Var is
- when Normal => (Device_Id and 16#ffc3#) = 16#0402# or
- (Device_Id and 16#ffc3#) = 16#0d02#,
- when ULT => (Device_Id and 16#ffc3#) = 16#0a02#),
- when Broadwell => ((Device_Id and 16#ffc3#) = 16#1602# or
- (Device_Id and 16#ffcf#) = 16#160b# or
- (Device_Id and 16#ffcf#) = 16#160d#) and
- (case CPU_Var is
- when Normal => Is_Broadwell_H (Device_Id),
- when ULT => not Is_Broadwell_H (Device_Id)),
+ when Haswell => (case CPU_Var is
+ when Normal => Is_Haswell (Device_Id),
+ when ULT => Is_Haswell_U (Device_Id),
+ when ULX => Is_Haswell_Y (Device_Id)),
+ when Broadwell => (case CPU_Var is
+ when Normal => Is_Broadwell (Device_Id),
+ when ULT => Is_Broadwell_U (Device_Id),
+ when ULX => Is_Broadwell_Y (Device_Id)),
when Broxton => (Device_Id and 16#fffe#) = 16#5a84#,
- when Skylake => ((Device_Id and 16#ffc3#) = 16#1902# or
- (Device_Id and 16#ffcf#) = 16#190b# or
- (Device_Id and 16#ffcf#) = 16#190d# or
- (Device_Id and 16#fff9#) = 16#1921#) and
- (case CPU_Var is
- when Normal => not Is_Skylake_U (Device_Id),
- when ULT => Is_Skylake_U (Device_Id)));
+ when Skylake => (case CPU_Var is
+ when Normal => Is_Skylake (Device_Id),
+ when ULT => Is_Skylake_U (Device_Id),
+ when ULX => Is_Skylake_Y (Device_Id)));
function Compatible_GPU (Device_Id : Word16) return Boolean is
(Is_GPU (Device_Id, CPU, CPU_Var));
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index 1f81ece..d9023ad 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -44,7 +44,7 @@
Broxton,
Skylake);
- type CPU_Variant is (Normal, ULT);
+ type CPU_Variant is (Normal, ULT, ULX);
type Port_Type is
(Disabled,
diff --git a/common/skylake/hw-gfx-gma-connectors-ddi-buffers.adb b/common/skylake/hw-gfx-gma-connectors-ddi-buffers.adb
index 5e72a3b..6ab755b 100644
--- a/common/skylake/hw-gfx-gma-connectors-ddi-buffers.adb
+++ b/common/skylake/hw-gfx-gma-connectors-ddi-buffers.adb
@@ -1,5 +1,5 @@
--
--- Copyright (C) 2017 secunet Security Networks AG
+-- Copyright (C) 2017, 2019 secunet Security Networks 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
@@ -51,6 +51,18 @@
16#0000_5013#, 16#0000_009f#,
16#0000_0018#, 16#0000_00df#);
+ Skylake_Y_Trans_EDP : constant Buf_Trans_Array :=
+ (16#0000_0018#, 16#0000_00a8#,
+ 16#0000_4013#, 16#0000_00ab#,
+ 16#0000_7011#, 16#0000_00a4#,
+ 16#0000_9010#, 16#0000_00df#,
+ 16#0000_0018#, 16#0000_00aa#,
+ 16#0000_6013#, 16#0000_00a4#,
+ 16#0000_7011#, 16#0000_009d#,
+ 16#0000_0018#, 16#0000_00a0#,
+ 16#0000_6012#, 16#0000_00df#,
+ 16#0000_0018#, 16#0000_008a#);
+
Skylake_Trans_DP : constant Buf_Trans_Array :=
(16#0000_2016#, 16#0000_00a0#,
16#0000_5012#, 16#0000_009b#,
@@ -75,6 +87,18 @@
16#8000_5012#, 16#0000_00c0#,
others => 0);
+ Skylake_Y_Trans_DP : constant Buf_Trans_Array :=
+ (16#0000_0018#, 16#0000_00a2#,
+ 16#0000_5012#, 16#0000_0088#,
+ 16#8000_7011#, 16#0000_00cd#,
+ 16#8000_9010#, 16#0000_00c0#,
+ 16#0000_0018#, 16#0000_009d#,
+ 16#8000_5012#, 16#0000_00c0#,
+ 16#8000_7011#, 16#0000_00c0#,
+ 16#0000_0018#, 16#0000_0088#,
+ 16#8000_5012#, 16#0000_00c0#,
+ others => 0);
+
Skylake_Trans_HDMI : constant HDMI_Buf_Trans_Array :=
((16#0000_0018#, 16#0000_00ac#),
(16#0000_5012#, 16#0000_009d#),
@@ -88,6 +112,19 @@
(16#8000_3015#, 16#0000_00c0#),
(16#8000_0018#, 16#0000_00c0#));
+ Skylake_Y_Trans_HDMI : constant HDMI_Buf_Trans_Array :=
+ ((16#0000_0018#, 16#0000_00a1#),
+ (16#0000_5012#, 16#0000_00df#),
+ (16#8000_7011#, 16#0000_00cb#),
+ (16#0000_0018#, 16#0000_00a4#),
+ (16#0000_0018#, 16#0000_009d#),
+ (16#0000_4013#, 16#0000_0080#),
+ (16#8000_6013#, 16#0000_00c0#),
+ (16#0000_0018#, 16#0000_008a#),
+ (16#8000_3015#, 16#0000_00c0#),
+ (16#8000_3015#, 16#0000_00c0#),
+ (16#8000_0018#, 16#0000_00c0#));
+
----------------------------------------------------------------------------
procedure Translations (Trans : out Buf_Trans_Array; Port : Digital_Port)
@@ -101,17 +138,26 @@
else Config.Default_DDI_HDMI_Buffer_Translation);
begin
Trans :=
- (if not Config.Is_ULT then
+ (if Config.Is_ULX then
(if DDIA_Low_Voltage_Swing
- then Skylake_Trans_EDP
- else Skylake_Trans_DP)
- else
+ then Skylake_Y_Trans_EDP
+ else Skylake_Y_Trans_DP)
+ elsif Config.Is_ULT then
(if DDIA_Low_Voltage_Swing
then Skylake_U_Trans_EDP
- else Skylake_U_Trans_DP));
+ else Skylake_U_Trans_DP)
+ else
+ (if DDIA_Low_Voltage_Swing
+ then Skylake_Trans_EDP
+ else Skylake_Trans_DP));
if not DDIA_Low_Voltage_Swing then
- Trans (18) := Skylake_Trans_HDMI (HDMI_Trans).Trans1;
- Trans (19) := Skylake_Trans_HDMI (HDMI_Trans).Trans2;
+ if Config.Is_ULX then
+ Trans (18) := Skylake_Y_Trans_HDMI (HDMI_Trans).Trans1;
+ Trans (19) := Skylake_Y_Trans_HDMI (HDMI_Trans).Trans2;
+ else
+ Trans (18) := Skylake_Trans_HDMI (HDMI_Trans).Trans1;
+ Trans (19) := Skylake_Trans_HDMI (HDMI_Trans).Trans2;
+ end if;
end if;
end Translations;
--
To view, visit https://review.coreboot.org/c/libgfxinit/+/31452
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-Change-Id: I08e6689ff8c0f2d58b51363886d4cab956f44e03
Gerrit-Change-Number: 31452
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: newchange
Frans Hendriks has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30831
Change subject: vendorcode/eltan Add hashing library used for measured and verified boot.
......................................................................
vendorcode/eltan Add hashing library used for measured and verified boot.
To avoid having the whole 3rdparty/vboot/firmware included a small hashing library
has been created.
Create library which is a 'wrapper' using only sha1, sha256 and sha512 of
3rdparty/vboot/firmware.
Fucntions cb_sha1(), cb_sha256() and cb_sha512 can be used for hashing.
BUG=N/A
TEST=Created binary and verify logging on Facebok FBG-1701
Change-Id: If828bde54c79e836a5b05ff0447645d7e06e819a
Signed-off-by: Frans Hendriks <fhendriks(a)eltan.com>
---
A src/vendorcode/eltan/security/include/cb_sha1.h
A src/vendorcode/eltan/security/include/cb_sha256.h
A src/vendorcode/eltan/security/include/cb_sha512.h
A src/vendorcode/eltan/security/include/cryptolib.h
A src/vendorcode/eltan/security/lib/Makefile.inc
A src/vendorcode/eltan/security/lib/cb_sha1.c
A src/vendorcode/eltan/security/lib/cb_sha256.c
A src/vendorcode/eltan/security/lib/cb_sha512.c
8 files changed, 297 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/30831/1
diff --git a/src/vendorcode/eltan/security/include/cb_sha1.h b/src/vendorcode/eltan/security/include/cb_sha1.h
new file mode 100644
index 0000000..3b72355
--- /dev/null
+++ b/src/vendorcode/eltan/security/include/cb_sha1.h
@@ -0,0 +1,21 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018. Eltan B.V.
+ *
+ * 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 __SECURITY_SHA1_H__
+#define __SECURITY_SHA1_H__
+
+uint8_t *cb_sha1(const uint8_t *data, uint64_t len, uint8_t *digest);
+
+#endif
diff --git a/src/vendorcode/eltan/security/include/cb_sha256.h b/src/vendorcode/eltan/security/include/cb_sha256.h
new file mode 100644
index 0000000..3b45f73
--- /dev/null
+++ b/src/vendorcode/eltan/security/include/cb_sha256.h
@@ -0,0 +1,23 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018. Eltan B.V.
+ *
+ * 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 __SECURITY_SHA256_H__
+#define __SECURITY_SHA256_H__
+
+uint8_t *cb_sha256(const uint8_t *data, uint64_t len, uint8_t *digest);
+uint8_t *cb_sha256_ex(const uint8_t *data, uint64_t len, uint8_t *digest,
+ bool endian);
+
+#endif
diff --git a/src/vendorcode/eltan/security/include/cb_sha512.h b/src/vendorcode/eltan/security/include/cb_sha512.h
new file mode 100644
index 0000000..a383cf0
--- /dev/null
+++ b/src/vendorcode/eltan/security/include/cb_sha512.h
@@ -0,0 +1,23 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018. Eltan B.V.
+ *
+ * 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 __SECURITY_SHA512_H__
+#define __SECURITY_SHA512_H__
+
+uint8_t *cb_sha512(const uint8_t *data, uint64_t len, uint8_t *digest);
+uint8_t *cb_sha512_ex(const uint8_t *data, uint64_t len, uint8_t *digest,
+ bool endian);
+
+#endif
diff --git a/src/vendorcode/eltan/security/include/cryptolib.h b/src/vendorcode/eltan/security/include/cryptolib.h
new file mode 100644
index 0000000..ac1668a
--- /dev/null
+++ b/src/vendorcode/eltan/security/include/cryptolib.h
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018. Eltan B.V.
+ *
+ * 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 __SECURITY_CRYPTOLIB_H__
+#define __SECURITY_CRYPTOLIB_H__
+
+#define NEED_VB2_SHA_LIBRARY
+
+#include <2rsa.h>
+#include <vb21_common.h>
+#include <vb2_api.h>
+
+#include "cb_sha1.h"
+#include "cb_sha512.h"
+#include "cb_sha256.h"
+
+#endif
\ No newline at end of file
diff --git a/src/vendorcode/eltan/security/lib/Makefile.inc b/src/vendorcode/eltan/security/lib/Makefile.inc
new file mode 100644
index 0000000..9e2fc39
--- /dev/null
+++ b/src/vendorcode/eltan/security/lib/Makefile.inc
@@ -0,0 +1,52 @@
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2018 Eltan B.V.
+#
+# 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.
+#
+
+SECURITYLIB_INCLUDES = -I3rdparty/vboot/firmware/2lib/include -I3rdparty/vboot/firmware/lib21/include
+
+CPPFLAGS_common+=$(SECURITYLIB_INCLUDES)
+
+ifeq ($(CONFIG_VERIFIED_BOOT),y)
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/2lib/2common.c
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/2lib/2rsa.c
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/2lib/2sha_utility.c
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/lib21/packed_key.c
+ifeq ($(CONFIG_VERIFIED_BOOT_USE_SHA512),y)
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += cb_sha512.c
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/2lib/2sha512.c
+else
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += cb_sha256.c
+bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += $(top)/3rdparty/vboot/firmware/2lib/2sha256.c
+endif
+endif
+
+ifeq ($(CONFIG_MBOOT),y)
+ramstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha1.c
+ramstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha512.c
+ramstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha256.c
+ramstage-y += cb_sha1.c
+ramstage-y += cb_sha512.c
+ramstage-y += cb_sha256.c
+
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2common.c
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2rsa.c
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha1.c
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha256.c
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha512.c
+romstage-y += $(top)/3rdparty/vboot/firmware/2lib/2sha_utility.c
+romstage-y += $(top)/3rdparty/vboot/firmware/lib21/packed_key.c
+romstage-y += cb_sha1.c
+romstage-y += cb_sha512.c
+romstage-y += cb_sha256.c
+endif
\ No newline at end of file
diff --git a/src/vendorcode/eltan/security/lib/cb_sha1.c b/src/vendorcode/eltan/security/lib/cb_sha1.c
new file mode 100644
index 0000000..fd96943
--- /dev/null
+++ b/src/vendorcode/eltan/security/lib/cb_sha1.c
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Eltan B.V.
+ *
+ * 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 <cryptolib.h>
+
+uint8_t *cb_sha1(const uint8_t *data, uint64_t len, uint8_t *digest)
+{
+ struct vb2_sha1_context ctx;
+
+ vb2_sha1_init(&ctx);
+ vb2_sha1_update(&ctx, data, len);
+ vb2_sha1_finalize(&ctx, digest);
+
+ return digest;
+}
diff --git a/src/vendorcode/eltan/security/lib/cb_sha256.c b/src/vendorcode/eltan/security/lib/cb_sha256.c
new file mode 100644
index 0000000..b02ebb2
--- /dev/null
+++ b/src/vendorcode/eltan/security/lib/cb_sha256.c
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Eltan B.V.
+ *
+ * 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 <cryptolib.h>
+
+uint8_t *cb_sha256_ex(const uint8_t *data, uint64_t len, uint8_t *digest,
+ bool endian)
+{
+ int i;
+ const uint8_t *input_ptr;
+ uint8_t result[VB2_SHA256_DIGEST_SIZE];
+ uint8_t *result_ptr;
+ uint64_t remaining_len;
+ struct vb2_sha256_context ctx;
+
+ vb2_sha256_init(&ctx);
+
+ input_ptr = data;
+ remaining_len = len;
+
+ /* Process data in at most UINT32_MAX byte chunks at a time. */
+ while (remaining_len) {
+ uint32_t block_size;
+ block_size = (uint32_t) ((remaining_len >= UINT32_MAX) ?
+ UINT32_MAX : remaining_len);
+ vb2_sha256_update(&ctx, input_ptr, block_size);
+ remaining_len -= block_size;
+ input_ptr += block_size;
+ }
+
+ result_ptr = result;
+ vb2_sha256_finalize(&ctx, result_ptr);
+ for (i = 0; i < VB2_SHA256_DIGEST_SIZE; ++i) {
+ if (endian) {
+ /* use big endian here */
+ digest[i] = *result_ptr++;
+ } else {
+ /* use little endian here */
+ digest[VB2_SHA256_DIGEST_SIZE - i - 1] = *result_ptr++;
+ }
+ }
+ return digest;
+}
+
+uint8_t *cb_sha256(const uint8_t *data, uint64_t len, uint8_t *digest)
+{
+ /* Returned the little endian SHA256 digest */
+ return cb_sha256_ex(data, len, digest, 0);
+}
\ No newline at end of file
diff --git a/src/vendorcode/eltan/security/lib/cb_sha512.c b/src/vendorcode/eltan/security/lib/cb_sha512.c
new file mode 100644
index 0000000..9d713e7
--- /dev/null
+++ b/src/vendorcode/eltan/security/lib/cb_sha512.c
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Eltan B.V.
+ *
+ * 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 <cryptolib.h>
+
+uint8_t *cb_sha512_ex(const uint8_t *data, uint64_t len, uint8_t *digest,
+ bool endian)
+{
+ int i;
+ const uint8_t *input_ptr;
+ uint8_t result[VB2_SHA512_DIGEST_SIZE];
+ uint8_t *result_ptr;
+ uint64_t remaining_len;
+ struct vb2_sha512_context ctx;
+
+ vb2_sha512_init(&ctx);
+
+ input_ptr = data;
+ remaining_len = len;
+
+ /* Process data in at most UINT32_MAX byte chunks at a time. */
+ while (remaining_len) {
+ uint32_t block_size;
+ block_size = (uint32_t) ((remaining_len >= UINT32_MAX) ?
+ UINT32_MAX : remaining_len);
+ vb2_sha512_update(&ctx, input_ptr, block_size);
+ remaining_len -= block_size;
+ input_ptr += block_size;
+ }
+
+ result_ptr = result;
+ vb2_sha512_finalize(&ctx, result_ptr);
+ for (i = 0; i < VB2_SHA512_DIGEST_SIZE; ++i) {
+ if (endian) {
+ /* use big endian here */
+ digest[i] = *result_ptr++;
+ } else {
+ /* use little endian here */
+ digest[VB2_SHA512_DIGEST_SIZE - i - 1] = *result_ptr++;
+ }
+ }
+ return digest;
+}
+
+uint8_t *cb_sha512(const uint8_t *data, uint64_t len, uint8_t *digest)
+{
+ /* Returned the little endian SHA512 digest */
+ return cb_sha512_ex(data, len, digest, 0);
+}
\ No newline at end of file
--
To view, visit https://review.coreboot.org/c/coreboot/+/30831
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If828bde54c79e836a5b05ff0447645d7e06e819a
Gerrit-Change-Number: 30831
Gerrit-PatchSet: 1
Gerrit-Owner: Frans Hendriks <fhendriks(a)eltan.com>
Gerrit-MessageType: newchange
Frans Hendriks has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31822
Change subject: soc/intel/braswell/acpi/lpc.asl: Allocate used ROM size only
......................................................................
soc/intel/braswell/acpi/lpc.asl: Allocate used ROM size only
Fixed ROM area is allocated.
Reduce the ROM size using CONFIG_COREBOOT_ROMSIZE.
BUG=N/A
TEST=Facebook FBG-1701 booting Embedded Linux
Change-Id: I7a47bf2600f546271c5a65641d29f868ff2748bf
Signed-off-by: Frans Hendriks <fhendriks(a)eltan.com>
---
M src/soc/intel/braswell/acpi/lpc.asl
1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/31822/1
diff --git a/src/soc/intel/braswell/acpi/lpc.asl b/src/soc/intel/braswell/acpi/lpc.asl
index 6b2ecec..a28eb38 100644
--- a/src/soc/intel/braswell/acpi/lpc.asl
+++ b/src/soc/intel/braswell/acpi/lpc.asl
@@ -3,7 +3,7 @@
*
* Copyright (C) 2007-2009 coresystems GmbH
* Copyright (C) 2013 Google Inc.
- * Copyright (C) 2018 Eltan B.V.
+ * Copyright (C) 2018-2019 Eltan B.V.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -44,7 +44,10 @@
Name (_HID, EISAID("INT0800"))
Name (_CRS, ResourceTemplate()
{
- Memory32Fixed(ReadOnly, 0xff000000, 0x01000000)
+ Memory32Fixed(ReadOnly, 0xffffffff -
+ (CONFIG_COREBOOT_ROMSIZE_KB*1024) + 1,
+ CONFIG_COREBOOT_ROMSIZE_KB*1024)
+
})
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/31822
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7a47bf2600f546271c5a65641d29f868ff2748bf
Gerrit-Change-Number: 31822
Gerrit-PatchSet: 1
Gerrit-Owner: Frans Hendriks <fhendriks(a)eltan.com>
Gerrit-MessageType: newchange