Nico Huber has submitted this change. ( https://review.coreboot.org/c/libgfxinit/+/35719 )
Change subject: gma: Automatically update CDClk and dot clocks
......................................................................
gma: Automatically update CDClk and dot clocks
Dot clocks should be limited, depending on CDClk. This comes with a
caveat: if a display only works at a specific refresh rate, we will
likely fail without knowing. It seems to be better, though, to try
at least. We can implement a config switch controlling this beha-
viour, later, if needed.
If we can raise / lower CDClk with a given set of dot clocks, we
have to disable all pipes first, then switch CDClk, and finally
enable all pipes with their new configuration.
Calling Update_Outputs() with all pipe configs disabled may disable
the CDClk. So we have to ensure it is enabled when trying to probe
for displays.
Change-Id: I375f2bd37c921cd5ed4b0094247df5a34a087188
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/35719
Reviewed-by: Angel Pons <th3fanbus(a)gmail.com>
Reviewed-by: Matt DeVillier <matt.devillier(a)gmail.com>
Reviewed-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M common/hw-gfx-gma-display_probing.adb
M common/hw-gfx-gma.adb
2 files changed, 16 insertions(+), 2 deletions(-)
Approvals:
Nico Huber: Verified
Matt DeVillier: Looks good to me, but someone else must approve
Arthur Heymans: Looks good to me, approved
Angel Pons: Looks good to me, approved
diff --git a/common/hw-gfx-gma-display_probing.adb b/common/hw-gfx-gma-display_probing.adb
index d21b277..74e2ad8 100644
--- a/common/hw-gfx-gma-display_probing.adb
+++ b/common/hw-gfx-gma-display_probing.adb
@@ -63,12 +63,13 @@
for I in 1 .. 2 loop
if Config_Helpers.To_Display_Type (Port) = DP then
- -- May need power to read edid
+ -- May need power and CDClk to read EDID
declare
Temp_Configs : Pipe_Configs := Cur_Configs;
begin
Temp_Configs (Primary).Port := Port;
Power_And_Clocks.Power_Up (Cur_Configs, Temp_Configs);
+ Power_And_Clocks.Enable_CDClk;
end;
declare
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb
index 3221e3e..8d58841 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -223,6 +223,7 @@
Display_Controller.Null_Scaler_Reservation;
Update_Power : Boolean := False;
+ Update_CDClk : Boolean;
Old_Configs,
New_Configs : Pipe_Configs;
@@ -280,6 +281,10 @@
(New_Configs (P).Framebuffer, New_Configs (P).Mode));
end loop;
+ -- limit dotclocks to maximum CDClk, if we are about
+ -- to switch CDClk, all pipes have to be disabled
+ Power_And_Clocks.Limit_Dotclocks (New_Configs, Update_CDClk);
+
-- disable all pipes that changed or had a hot-plug event
for Pipe in Pipe_Index loop
declare
@@ -290,7 +295,10 @@
if Cur_Config.Port /= Disabled then
Check_HPD (Cur_Config.Port, Unplug_Detected);
- if Full_Update (Cur_Config, New_Config) or Unplug_Detected then
+ if Update_CDClk or
+ Unplug_Detected or
+ Full_Update (Cur_Config, New_Config)
+ then
Disable_Output (Pipe, Cur_Config);
Cur_Config.Port := Disabled;
Update_Power := True;
@@ -299,6 +307,11 @@
end;
end loop;
+ -- switch CDClk if necessary and possible, limit dotclocks accordingly
+ if Update_CDClk then
+ Power_And_Clocks.Update_CDClk (New_Configs);
+ end if;
+
-- enable all pipes that changed and should be active
for Pipe in Pipe_Index loop
declare
--
To view, visit https://review.coreboot.org/c/libgfxinit/+/35719
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-Change-Id: I375f2bd37c921cd5ed4b0094247df5a34a087188
Gerrit-Change-Number: 35719
Gerrit-PatchSet: 5
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: merged
Wim Vervoorn has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36095 )
Change subject: mb/facebook/fbg1701: separate cpld support
......................................................................
mb/facebook/fbg1701: separate cpld support
Move all code involving the cpld to a single file.
BUG=N/A
TEST=tested on fbg1701 board
Change-Id: I9ee9a2c605e8b63baa7d64af92f45aa07e0d9d9e
Signed-off-by: Wim Vervoorn <wvervoorn(a)eltan.com>
---
M src/mainboard/facebook/fbg1701/Makefile.inc
A src/mainboard/facebook/fbg1701/cpld.c
A src/mainboard/facebook/fbg1701/cpld.h
M src/mainboard/facebook/fbg1701/mainboard.c
M src/mainboard/facebook/fbg1701/mainboard.h
M src/mainboard/facebook/fbg1701/onboard.h
M src/mainboard/facebook/fbg1701/ramstage.c
7 files changed, 72 insertions(+), 25 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/36095/1
diff --git a/src/mainboard/facebook/fbg1701/Makefile.inc b/src/mainboard/facebook/fbg1701/Makefile.inc
index c414470..7341291 100644
--- a/src/mainboard/facebook/fbg1701/Makefile.inc
+++ b/src/mainboard/facebook/fbg1701/Makefile.inc
@@ -24,6 +24,7 @@
bootblock-$(CONFIG_C_ENVIRONMENT_BOOTBLOCK) += com_init.c
+ramstage-y += cpld.c
ramstage-y += gpio.c
ramstage-y += hda_verb.c
ramstage-y += irqroute.c
@@ -31,6 +32,8 @@
ramstage-y += ramstage.c
ramstage-y += w25q64.c
+romstage-y += cpld.c
+
cbfs-files-$(CONFIG_FSP1_1_DISPLAY_LOGO) += logo.bmp
logo.bmp-file := $(call strip_quotes,$(CONFIG_FSP1_1_LOGO_FILE_NAME))
logo.bmp-type := raw
diff --git a/src/mainboard/facebook/fbg1701/cpld.c b/src/mainboard/facebook/fbg1701/cpld.c
new file mode 100644
index 0000000..7d1117f
--- /dev/null
+++ b/src/mainboard/facebook/fbg1701/cpld.c
@@ -0,0 +1,39 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 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 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/io.h>
+#include "cpld.h"
+
+/* CPLD definitions */
+#define CPLD_PCB_VERSION_PORT 0x283
+#define CPLD_PCB_VERSION_MASK 0xF0
+#define CPLD_PCB_VERSION_BIT 4
+
+#define CPLD_RESET_PORT 0x287
+#define CPLD_CMD_RESET_DSI_BRIDGE_ACTIVE 0x20
+#define CPLD_CMD_RESET_DSI_BRIDGE_INACTIVE 0x00
+
+/* Reset DSI bridge */
+void cpld_reset_bridge(void)
+{
+ outb(CPLD_CMD_RESET_DSI_BRIDGE_ACTIVE, CPLD_RESET_PORT);
+ outb(CPLD_CMD_RESET_DSI_BRIDGE_INACTIVE, CPLD_RESET_PORT);
+}
+
+/* Read PCB version */
+unsigned int cpld_read_pcb_version(void)
+{
+ return ((inb(CPLD_PCB_VERSION_PORT) & CPLD_PCB_VERSION_MASK) >> CPLD_PCB_VERSION_BIT);
+}
diff --git a/src/mainboard/facebook/fbg1701/cpld.h b/src/mainboard/facebook/fbg1701/cpld.h
new file mode 100644
index 0000000..9604cfb
--- /dev/null
+++ b/src/mainboard/facebook/fbg1701/cpld.h
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 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 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 CPLD_H
+#define CPLD_H
+
+unsigned int cpld_read_pcb_version(void);
+void cpld_reset_bridge(void);
+
+#endif
diff --git a/src/mainboard/facebook/fbg1701/mainboard.c b/src/mainboard/facebook/fbg1701/mainboard.c
index a8cb34c..8524b24 100644
--- a/src/mainboard/facebook/fbg1701/mainboard.c
+++ b/src/mainboard/facebook/fbg1701/mainboard.c
@@ -16,10 +16,7 @@
* GNU General Public License for more details.
*/
-#include <arch/io.h>
#include <device/device.h>
-#include "mainboard.h"
-#include "onboard.h"
/*
* Declare the resources we are using
@@ -39,13 +36,6 @@
res->flags = IORESOURCE_IRQ | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
}
-/* Read PCB version */
-unsigned int mainboard_read_pcb_version(void)
-{
- return ((inb(CPLD_PCB_VERSION_PORT) & CPLD_PCB_VERSION_MASK) >>
- CPLD_PCB_VERSION_BIT);
-}
-
/*
* mainboard_enable is executed as first thing after
* enumerate_buses().
diff --git a/src/mainboard/facebook/fbg1701/mainboard.h b/src/mainboard/facebook/fbg1701/mainboard.h
index 3cace54..82f1b99 100644
--- a/src/mainboard/facebook/fbg1701/mainboard.h
+++ b/src/mainboard/facebook/fbg1701/mainboard.h
@@ -1,7 +1,7 @@
/*
* This file is part of the coreboot project.
*
- * 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 published by
@@ -16,7 +16,6 @@
#ifndef MAINBOARD_H
#define MAINBOARD_H
-unsigned int mainboard_read_pcb_version(void);
void *load_logo(size_t *logo_size);
#endif
diff --git a/src/mainboard/facebook/fbg1701/onboard.h b/src/mainboard/facebook/fbg1701/onboard.h
index 2c78d15..cb784da 100644
--- a/src/mainboard/facebook/fbg1701/onboard.h
+++ b/src/mainboard/facebook/fbg1701/onboard.h
@@ -21,15 +21,6 @@
/* SD CARD gpio */
#define SDCARD_CD 81 /* Not used */
-
-/* CPLD definitions */
-#define CPLD_PCB_VERSION_PORT 0x283
-#define CPLD_PCB_VERSION_MASK 0xF0
-#define CPLD_PCB_VERSION_BIT 4
-
-#define CPLD_RESET_PORT 0x287
-#define CPLD_CMD_RESET_DSI_BRIDGE_ACTIVE 0x20
-#define CPLD_CMD_RESET_DSI_BRIDGE_INACTIVE 0x00
#define ITE8528_CMD_PORT 0x6E
#define ITE8528_DATA_PORT 0x6F
diff --git a/src/mainboard/facebook/fbg1701/ramstage.c b/src/mainboard/facebook/fbg1701/ramstage.c
index 980a6cc..e2b4ac3 100644
--- a/src/mainboard/facebook/fbg1701/ramstage.c
+++ b/src/mainboard/facebook/fbg1701/ramstage.c
@@ -19,7 +19,7 @@
#include <soc/ramstage.h>
#include <soc/smbus.h>
#include "mainboard.h"
-#include "onboard.h"
+#include "cpld.h"
struct edp_data {
u8 payload_length;
@@ -326,16 +326,19 @@
{
const struct edp_data *edptable;
unsigned int loops;
+ unsigned int pcb_version;
int status;
- if (mainboard_read_pcb_version() < 7)
+ pcb_version = cpld_read_pcb_version();
+ printk(BIOS_DEBUG, "PCB version: %x\n", pcb_version);
+
+ if (pcb_version < 7)
edptable = b101uan01_table;
else
edptable = b101uan08_table;
/* reset bridge */
- outb(CPLD_CMD_RESET_DSI_BRIDGE_ACTIVE, CPLD_RESET_PORT);
- outb(CPLD_CMD_RESET_DSI_BRIDGE_INACTIVE, CPLD_RESET_PORT);
+ cpld_reset_bridge();
while (edptable->payload_length) {
loops = 5;
--
To view, visit https://review.coreboot.org/c/coreboot/+/36095
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I9ee9a2c605e8b63baa7d64af92f45aa07e0d9d9e
Gerrit-Change-Number: 36095
Gerrit-PatchSet: 1
Gerrit-Owner: Wim Vervoorn
Gerrit-MessageType: newchange
Hung-Te Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36088 )
Change subject: mb/google: Reduce size of GBB section
......................................................................
mb/google: Reduce size of GBB section
Chrome OS firmware images have moved bitmap resources from GBB into CBFS
for a long time, so the GBB should only hold firmware keys and HWID,
that is usually less than 4k.
ARM boards usually limit GBB to 0x2f00 (see gru, cheza and kukui) but
many recent x86 simply copy from old settings and may run out of space
when we want to add more resources, for example EC RO software sync.
One thing to address is that changing GBB section (inside RO) implies RO
update, so this change should not be cherry-picked back to old firmware
branches if some devices were already shipped.
BRANCH=none
BUG=None
TEST=make # board=darllion,hatch,kahlee,octopus,sarien
Change-Id: I615cd7b53b556019f2d54d0df7ac2723d36ee6cf
Signed-off-by: Hung-Te Lin <hungte(a)chromium.org>
---
M src/mainboard/google/drallion/chromeos.fmd
M src/mainboard/google/hatch/chromeos-16MiB.fmd
M src/mainboard/google/hatch/chromeos.fmd
M src/mainboard/google/kahlee/variants/baseboard/chromeos.fmd
M src/mainboard/google/octopus/chromeos.fmd
M src/mainboard/google/sarien/chromeos.fmd
6 files changed, 12 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/36088/1
diff --git a/src/mainboard/google/drallion/chromeos.fmd b/src/mainboard/google/drallion/chromeos.fmd
index 8bab919..d51724b 100644
--- a/src/mainboard/google/drallion/chromeos.fmd
+++ b/src/mainboard/google/drallion/chromeos.fmd
@@ -40,8 +40,8 @@
FMAP@0x0 0x800
RO_FRID@0x800 0x40
RO_FRID_PAD@0x840 0x7c0
- GBB@0x1000 0xef000
- COREBOOT(CBFS)@0xf0000 0x300000
+ GBB@0x1000 0xf000
+ COREBOOT(CBFS)@0x4000 0x3ec000
}
}
}
diff --git a/src/mainboard/google/hatch/chromeos-16MiB.fmd b/src/mainboard/google/hatch/chromeos-16MiB.fmd
index eb92bb0..8880a4f 100644
--- a/src/mainboard/google/hatch/chromeos-16MiB.fmd
+++ b/src/mainboard/google/hatch/chromeos-16MiB.fmd
@@ -35,8 +35,8 @@
FMAP@0x0 0x800
RO_FRID@0x800 0x40
RO_FRID_PAD@0x840 0x7c0
- GBB@0x1000 0xef000
- COREBOOT(CBFS)@0xf0000 0x30c000
+ GBB@0x1000 0x3000
+ COREBOOT(CBFS)@0x4000 0x3f8000
}
}
}
diff --git a/src/mainboard/google/hatch/chromeos.fmd b/src/mainboard/google/hatch/chromeos.fmd
index 45dbc81..8368b0a 100644
--- a/src/mainboard/google/hatch/chromeos.fmd
+++ b/src/mainboard/google/hatch/chromeos.fmd
@@ -39,8 +39,8 @@
FMAP@0x0 0x800
RO_FRID@0x800 0x40
RO_FRID_PAD@0x840 0x7c0
- GBB@0x1000 0xef000
- COREBOOT(CBFS)@0xf0000 0x30c000
+ GBB@0x1000 0x3000
+ COREBOOT(CBFS)@0x4000 0x3f8000
}
}
}
diff --git a/src/mainboard/google/kahlee/variants/baseboard/chromeos.fmd b/src/mainboard/google/kahlee/variants/baseboard/chromeos.fmd
index b746545..d7d0a88 100644
--- a/src/mainboard/google/kahlee/variants/baseboard/chromeos.fmd
+++ b/src/mainboard/google/kahlee/variants/baseboard/chromeos.fmd
@@ -33,8 +33,8 @@
FMAP@0x0 0x800
RO_FRID@0x800 0x40
RO_FRID_PAD@0x840 0x7c0
- GBB@0x1000 0x70000
- COREBOOT(CBFS)@0x71000 0x210000
+ GBB@0x1000 0x3000
+ COREBOOT(CBFS)@0x4000 0x27d000
}
}
}
diff --git a/src/mainboard/google/octopus/chromeos.fmd b/src/mainboard/google/octopus/chromeos.fmd
index fbdafaa..332465a 100644
--- a/src/mainboard/google/octopus/chromeos.fmd
+++ b/src/mainboard/google/octopus/chromeos.fmd
@@ -7,8 +7,8 @@
FMAP@0x0 0x800
RO_FRID@0x800 0x40
RO_FRID_PAD@0x840 0x7c0
- COREBOOT(CBFS)@0x1000 0x1bb000
- GBB@0x1bc000 0x40000
+ COREBOOT(CBFS)@0x1000 0x1f8000
+ GBB@0x1f9000 0x3000
}
}
MISC_RW@0x400000 0x30000 {
diff --git a/src/mainboard/google/sarien/chromeos.fmd b/src/mainboard/google/sarien/chromeos.fmd
index ece0eda..65a915a 100644
--- a/src/mainboard/google/sarien/chromeos.fmd
+++ b/src/mainboard/google/sarien/chromeos.fmd
@@ -41,8 +41,8 @@
FMAP@0x0 0x800
RO_FRID@0x800 0x40
RO_FRID_PAD@0x840 0x7c0
- GBB@0x1000 0xef000
- COREBOOT(CBFS)@0xf0000 0x300000
+ GBB@0x1000 0x3000
+ COREBOOT(CBFS)@0x4000 0x3ec000
}
}
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/36088
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I615cd7b53b556019f2d54d0df7ac2723d36ee6cf
Gerrit-Change-Number: 36088
Gerrit-PatchSet: 1
Gerrit-Owner: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-MessageType: newchange