Isaac Christensen (isaac.christensen(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6853
-gerrit
commit 4ec143bdd073ef314278193a94e2bee2a7827f2f
Author: Julius Werner <jwerner(a)chromium.org>
Date: Tue Oct 29 11:31:40 2013 -0700
libpayload: ehci: Fix byte count in dump_td()
The dump_td() debug function in the EHCI stack incorrectly masks the
amount of transferred bytes on output... the actual field is 15 bits
wide (30:16). Let's just use the mask constant we already have for all
the other code.
Change-Id: I28c6f0ec75cc613e38d53b670645d19bf9ffe1b9
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174986
Reviewed-by: Stefan Reinauer <reinauer(a)chromium.org>
(cherry picked from commit 570077da7f16bbe2204b4a80790e4bd8fe1a2bd7)
Signed-off-by: Isaac Christensen <isaac.christensen(a)se-eng.com>
---
payloads/libpayload/drivers/usb/ehci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/payloads/libpayload/drivers/usb/ehci.c b/payloads/libpayload/drivers/usb/ehci.c
index 129b9b8..0c3e32d 100644
--- a/payloads/libpayload/drivers/usb/ehci.c
+++ b/payloads/libpayload/drivers/usb/ehci.c
@@ -54,7 +54,7 @@ static void dump_td(u32 addr)
usb_debug("|:+-----------------------------------------------+:|\n");
usb_debug("|:| Alt. Next qTD [0x%08lx] |:|\n", td->alt_next_qtd);
usb_debug("|:+-----------------------------------------------+:|\n");
- usb_debug("|:| | Bytes to Transfer | [%04ld] |:|\n", (td->token & (0x7FUL << 16)) >> 16);
+ usb_debug("|:| | Bytes to Transfer |[%05ld] |:|\n", (td->token & QTD_TOTAL_LEN_MASK) >> 16);
usb_debug("|:| | PID CODE: | [%ld] |:|\n", (td->token & (3UL << 8)) >> 8);
usb_debug("|:| | Interrupt On Complete (IOC) | [%ld] |:|\n", (td->token & (1UL << 15)) >> 15);
usb_debug("|:| | Status Active | [%ld] |:|\n", (td->token & (1UL << 7)) >> 7);
Isaac Christensen (isaac.christensen(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6834
-gerrit
commit d98f3cea43d4368e6869bdd4ea0b74a3eb770657
Author: Gabe Black <gabeblack(a)google.com>
Date: Sun Dec 8 12:48:45 2013 -0800
exynos: Install the BL1 and set the checksum in the Makefile.
Install the BL1 and set up the checksum in the Makefile instead of relying on
post processing. Import the exynos checksum script, split it in two and
simplify it significantly. Stop putting the CBFS header in the midst of the
bootblock so that it can be checksummed before CBFS is put together. Stop
saving space for it and leaving an anchor in the bootblock which nobody looks
for.
Change-Id: Icbb5a5914ece60b2827433b6dc29d80db996ea6c
Signed-off-by: Gabe Black <gabeblack(a)google.com>
Reviewed-on: https://chromium-review.googlesource.com/179229
Reviewed-by: Ronald Minnich <rminnich(a)chromium.org>
Commit-Queue: Gabe Black <gabeblack(a)chromium.org>
Tested-by: Gabe Black <gabeblack(a)chromium.org>
(cherry picked from commit aa3a416705517c0a6ddfdeb19905ac8cafb33df1)
Signed-off-by: Isaac Christensen <isaac.christensen(a)se-eng.com>
---
src/arch/arm/armv7/bootblock.S | 12 +------
src/soc/samsung/exynos5250/Kconfig | 11 +++---
src/soc/samsung/exynos5250/Makefile.inc | 17 ++++------
src/soc/samsung/exynos5420/Kconfig | 6 ++--
src/soc/samsung/exynos5420/Makefile.inc | 17 ++++------
util/exynos/fixed_cksum.py | 59 +++++++++++++++++++++++++++++++++
util/exynos/variable_cksum.py | 59 +++++++++++++++++++++++++++++++++
7 files changed, 142 insertions(+), 39 deletions(-)
diff --git a/src/arch/arm/armv7/bootblock.S b/src/arch/arm/armv7/bootblock.S
index b28a787..82bd79e 100644
--- a/src/arch/arm/armv7/bootblock.S
+++ b/src/arch/arm/armv7/bootblock.S
@@ -31,17 +31,7 @@
.section ".start", "a", %progbits
.globl _start
-_start: b reset
- .balignl 16,0xdeadbeef
-
-_cbfs_master_header:
- /* The CBFS master header is inserted by cbfstool at the first
- * aligned offset after the above anchor string is found.
- * Hence, we leave some space for it.
- */
- .skip 128 @ Assumes 64-byte alignment
-
-reset:
+_start:
/*
* Set the cpu to System mode with IRQ and FIQ disabled. Prefetch/Data
* aborts may happen early and crash before the abort handlers are
diff --git a/src/soc/samsung/exynos5250/Kconfig b/src/soc/samsung/exynos5250/Kconfig
index 2b4ad39..8d7c867 100644
--- a/src/soc/samsung/exynos5250/Kconfig
+++ b/src/soc/samsung/exynos5250/Kconfig
@@ -15,21 +15,22 @@ if CPU_SAMSUNG_EXYNOS5250
#
# 0x0000: vendor-provided BL1 (8k).
# 0x2000: bootblock
-# 0x2010-0x2090: reserved for CBFS master header.
-# 0xA000: Free for CBFS data.
+# 0x9FFC-0xA000: BL2 checksum
+# 0xA000-0xA080: reserved for CBFS master header.
+# 0xA080: Free for CBFS data.
config BOOTBLOCK_ROM_OFFSET
hex
- default 0x2000
+ default 0
config CBFS_HEADER_ROM_OFFSET
hex "offset of master CBFS header in ROM"
- default 0x2010
+ default 0x9F80
config CBFS_ROM_OFFSET
# Calculated by BOOTBLOCK_ROM_OFFSET + max bootblock size.
hex "offset of CBFS data in ROM"
- default 0x0A000
+ default 0x0A080
config SYS_SDRAM_BASE
hex
diff --git a/src/soc/samsung/exynos5250/Makefile.inc b/src/soc/samsung/exynos5250/Makefile.inc
index a15bc9c..cc89f2d 100644
--- a/src/soc/samsung/exynos5250/Makefile.inc
+++ b/src/soc/samsung/exynos5250/Makefile.inc
@@ -50,13 +50,10 @@ ramstage-y += fb.c
ramstage-y += usb.c
ramstage-y += cbmem.c
-# Run an intermediate step when producing coreboot.rom
-# that adds additional components to the final firmware
-# image outside of CBFS
-.PHONY: exynos5250_add_bl1
-$(obj)/coreboot.rom: exynos5250_add_bl1
-exynos5250_add_bl1: $(obj)/coreboot.pre
- printf " DD Adding Samsung Exynos5250 BL1\n"
- # TODO(hungte) Change this 'cpu' to soc when build scripts are changed.
- dd if=3rdparty/cpu/samsung/exynos5250/bl1.bin \
- of=$(obj)/coreboot.pre conv=notrunc >/dev/null 2>&1
+$(objcbfs)/bootblock.raw.elf: $(objcbfs)/bootblock.elf
+ cp $< $@
+
+$(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin
+ @printf " BL1, CKSUM $(subst $(obj)/,,$(@))\n"
+ util/exynos/fixed_cksum.py $< $<.cksum 32768
+ cat 3rdparty/cpu/samsung/exynos5250/bl1.bin $<.cksum > $@
diff --git a/src/soc/samsung/exynos5420/Kconfig b/src/soc/samsung/exynos5420/Kconfig
index a0d6c98..904091e 100644
--- a/src/soc/samsung/exynos5420/Kconfig
+++ b/src/soc/samsung/exynos5420/Kconfig
@@ -17,16 +17,16 @@ if CPU_SAMSUNG_EXYNOS5420
# 0x0000: vendor-provided BL1 (8k).
# 0x2000: variable length bootblock checksum header
# 0x2010: bootblock
-# 0x2020-0x20A0: reserved for CBFS master header.
+# 0x9F80-0xA000: reserved for CBFS master header.
# 0xA000: Free for CBFS data.
config BOOTBLOCK_ROM_OFFSET
hex
- default 0x2010
+ default 0
config CBFS_HEADER_ROM_OFFSET
hex "offset of master CBFS header in ROM"
- default 0x2020
+ default 0x9F80
config CBFS_ROM_OFFSET
# Calculated by BOOTBLOCK_ROM_OFFSET + max bootblock size.
diff --git a/src/soc/samsung/exynos5420/Makefile.inc b/src/soc/samsung/exynos5420/Makefile.inc
index ef77b1b..5f37e7e 100644
--- a/src/soc/samsung/exynos5420/Makefile.inc
+++ b/src/soc/samsung/exynos5420/Makefile.inc
@@ -50,13 +50,10 @@ ramstage-y += dp.c dp_lowlevel.c fimd.c
ramstage-y += usb.c
ramstage-y += cbmem.c
-# Run an intermediate step when producing coreboot.rom
-# that adds additional components to the final firmware
-# image outside of CBFS
-.PHONY: exynos5420_add_bl1
-$(obj)/coreboot.rom: exynos5420_add_bl1
-exynos5420_add_bl1: $(obj)/coreboot.pre
- printf " DD Adding Samsung Exynos5420 BL1\n"
- # TODO(hungte) Change this 'cpu' to soc when build scripts are changed.
- dd if=3rdparty/cpu/samsung/exynos5420/bl1.bin \
- of=$(obj)/coreboot.pre conv=notrunc >/dev/null 2>&1
+$(objcbfs)/bootblock.raw.elf: $(objcbfs)/bootblock.elf
+ cp $< $@
+
+$(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin
+ @printf " BL1, CKSUM $(subst $(obj)/,,$(@))\n"
+ util/exynos/variable_cksum.py $< $<.cksum
+ cat 3rdparty/cpu/samsung/exynos5420/bl1.bin $<.cksum > $@
diff --git a/util/exynos/fixed_cksum.py b/util/exynos/fixed_cksum.py
new file mode 100755
index 0000000..66da060
--- /dev/null
+++ b/util/exynos/fixed_cksum.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2013 Google Inc.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+"""
+This utility computes and fills Exynos ROM checksum (for BL1 or BL2).
+(Algorithm from U-Boot: tools/mkexynosspl.c)
+
+Input: IN OUT DATA_SIZE
+
+Output:
+
+ IN padded out to DATA_SIZE, checksum at the end, written to OUT.
+"""
+
+import struct
+import sys
+
+def main(argv):
+ if len(argv) != 4:
+ exit('usage: %s IN OUT DATA_SIZE' % argv[0])
+
+ in_name, out_name = argv[1:3]
+ size = int(argv[3], 0)
+ checksum_format = "<I"
+ with open(in_name, "rb") as in_file, open(out_name, "wb") as out_file:
+ data = in_file.read()
+ checksum_size = struct.calcsize(checksum_format)
+ data_size = size - checksum_size
+ assert len(data) <= data_size
+ checksum = struct.pack(checksum_format, sum(map(ord, data)))
+ out_file.write(data + bytearray(data_size - len(data)) + checksum)
+
+
+if __name__ == '__main__':
+ main(sys.argv)
diff --git a/util/exynos/variable_cksum.py b/util/exynos/variable_cksum.py
new file mode 100755
index 0000000..75cdc74
--- /dev/null
+++ b/util/exynos/variable_cksum.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2013 Google Inc.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+"""
+This utility computes and fills Exynos ROM checksum (for BL1 or BL2).
+(Algorithm from U-Boot: tools/mkexynosspl.c)
+
+Input: IN OUT
+
+Output:
+
+ Checksum header added to IN and written to OUT.
+ Header: uint32_t size, checksum, reserved[2].
+"""
+
+import struct
+import sys
+
+def main(argv):
+ if len(argv) != 3:
+ exit('usage: %s IN OUT' % argv[0])
+
+ in_name, out_name = argv[1:3]
+ header_format = "<IIII"
+ with open(in_name, "rb") as in_file, open(out_name, "wb") as out_file:
+ data = in_file.read()
+ header = struct.pack(header_format,
+ struct.calcsize(header_format) + len(data),
+ sum(map(ord, data)),
+ 0, 0)
+ out_file.write(header + data)
+
+
+if __name__ == '__main__':
+ main(sys.argv)
Isaac Christensen (isaac.christensen(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6784
-gerrit
commit 5bf862087e0f9325650218c464f6b4ddd25af8ed
Author: Gabe Black <gabeblack(a)google.com>
Date: Tue Oct 1 05:24:47 2013 -0700
tegra124: Switch the bootblock over the ARMv4 impelementation.
The bootblock for the tegra124 runs on the AVP coprocessor which uses the
ARMv4 architecture. Switch it over to that architecture.
Change-Id: Ie527bbff938e6148c58727d448f9c2e6862da872
Signed-off-by: Gabe Black <gabeblack(a)google.com>
Reviewed-on: https://chromium-review.googlesource.com/171402
Reviewed-by: Gabe Black <gabeblack(a)chromium.org>
Tested-by: Gabe Black <gabeblack(a)chromium.org>
Commit-Queue: Gabe Black <gabeblack(a)chromium.org>
(cherry picked from commit c1aa76b7607ee40ff848628971a97eea5393aebe)
Signed-off-by: Isaac Christensen <isaac.christensen(a)se-eng.com>
---
src/soc/nvidia/tegra124/Kconfig | 2 +-
src/soc/nvidia/tegra124/Makefile.inc | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/soc/nvidia/tegra124/Kconfig b/src/soc/nvidia/tegra124/Kconfig
index 4f33f56..4e5bd62 100644
--- a/src/soc/nvidia/tegra124/Kconfig
+++ b/src/soc/nvidia/tegra124/Kconfig
@@ -1,5 +1,5 @@
config SOC_NVIDIA_TEGRA124
- select ARCH_BOOTBLOCK_ARMV7
+ select ARCH_BOOTBLOCK_ARMV4
select ARCH_ROMSTAGE_ARMV7
select ARCH_RAMSTAGE_ARMV7
select HAVE_UART_SPECIAL
diff --git a/src/soc/nvidia/tegra124/Makefile.inc b/src/soc/nvidia/tegra124/Makefile.inc
index 34d24da..a63eb35 100644
--- a/src/soc/nvidia/tegra124/Makefile.inc
+++ b/src/soc/nvidia/tegra124/Makefile.inc
@@ -1,8 +1,5 @@
CBOOTIMAGE = cbootimage
-bootblock-c-ccopts += -marm
-bootblock-S-ccopts += -marm
-
bootblock-y += bootblock.c
bootblock-y += bootblock_asm.S
bootblock-y += cbfs.c
the following patch was just integrated into master:
commit 3a75e5e8642d05d644ee3bccb92d8657ac2dadf0
Author: Ronald G. Minnich <rminnich(a)google.com>
Date: Mon Oct 28 15:01:54 2013 -0700
Haswell/falco/peppy/slippy: continue to clean up FUI.
As a first step towards removing hardcodes from the FUI support,
change the haswell call to i915_lightup to panel_lightup, and pass the
intel_dp * as a parameter. Get rid of the scalar arguments and make
them part of intel_dp. Get rid of file-scope variables and use the
ones in the intel_dp struct. In falco, use functions that peppy
uses. Drop slippy support for FUI, it's a dead board; if this is ok
I'll remove the files next.
And, incidentally, fix the broken RGBX constant and change it to BGRX.
Change-Id: I46ef5a9ed8433382d042066ee3542af04cfc319a
Signed-off-by: Ronald G. Minnich <rminnich(a)google.com>
Reviewed-on: https://chromium-review.googlesource.com/174932
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Commit-Queue: Ronald Minnich <rminnich(a)chromium.org>
Tested-by: Ronald Minnich <rminnich(a)chromium.org>
(cherry picked from commit 1e1ed410b445c8e2b7411e163d9d6f61499dc3f6)
Signed-off-by: Isaac Christensen <isaac.christensen(a)se-eng.com>
Reviewed-on: http://review.coreboot.org/6833
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Tested-by: build bot (Jenkins)
See http://review.coreboot.org/6833 for details.
-gerrit
Isaac Christensen (isaac.christensen(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6833
-gerrit
commit 732bc9eca4f470c57a78cb78b72ad0c19865fc01
Author: Ronald G. Minnich <rminnich(a)google.com>
Date: Mon Oct 28 15:01:54 2013 -0700
Haswell/falco/peppy/slippy: continue to clean up FUI.
As a first step towards removing hardcodes from the FUI support,
change the haswell call to i915_lightup to panel_lightup, and pass the
intel_dp * as a parameter. Get rid of the scalar arguments and make
them part of intel_dp. Get rid of file-scope variables and use the
ones in the intel_dp struct. In falco, use functions that peppy
uses. Drop slippy support for FUI, it's a dead board; if this is ok
I'll remove the files next.
And, incidentally, fix the broken RGBX constant and change it to BGRX.
Change-Id: I46ef5a9ed8433382d042066ee3542af04cfc319a
Signed-off-by: Ronald G. Minnich <rminnich(a)google.com>
Reviewed-on: https://chromium-review.googlesource.com/174932
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Commit-Queue: Ronald Minnich <rminnich(a)chromium.org>
Tested-by: Ronald Minnich <rminnich(a)chromium.org>
(cherry picked from commit 1e1ed410b445c8e2b7411e163d9d6f61499dc3f6)
Signed-off-by: Isaac Christensen <isaac.christensen(a)se-eng.com>
---
src/drivers/intel/gma/i915.h | 7 ++
src/mainboard/google/falco/gma.c | 156 +++------------------------------
src/mainboard/google/falco/i915io.c | 10 +--
src/mainboard/google/falco/mainboard.h | 25 ++++++
src/mainboard/google/link/i915.c | 2 +-
src/mainboard/google/peppy/gma.c | 33 +++----
src/mainboard/google/peppy/i915io.c | 4 +-
src/mainboard/google/slippy/Kconfig | 2 -
src/northbridge/intel/haswell/gma.c | 31 ++++---
9 files changed, 76 insertions(+), 194 deletions(-)
diff --git a/src/drivers/intel/gma/i915.h b/src/drivers/intel/gma/i915.h
index a67f8eb..8161d68 100644
--- a/src/drivers/intel/gma/i915.h
+++ b/src/drivers/intel/gma/i915.h
@@ -175,6 +175,12 @@ struct intel_dp {
struct intel_dp_m_n m_n;
u32 flags;
u32 transcoder;
+ /* parameters computed by the early startup, to be used
+ * in the GMA code.
+ */
+ u8 *graphics;
+ /* physical address, not to be used directly. */
+ u64 physbase;
};
/* we may yet need these. */
@@ -278,6 +284,7 @@ u32 gtt_read(u32 reg);
int i915lightup(unsigned int physbase, unsigned int mmio,
unsigned int gfx, unsigned int init_fb);
+int panel_lightup(struct intel_dp *dp, unsigned int init_fb);
/* display.c */
void compute_display_params(struct intel_dp *dp);
diff --git a/src/mainboard/google/falco/gma.c b/src/mainboard/google/falco/gma.c
index f3316f4..4e32b28 100644
--- a/src/mainboard/google/falco/gma.c
+++ b/src/mainboard/google/falco/gma.c
@@ -43,6 +43,7 @@
#include <cpu/x86/msr.h>
#include <edid.h>
#include <drivers/intel/gma/i915.h>
+#include <northbridge/intel/haswell/haswell.h>
#include "mainboard.h"
/*
@@ -86,52 +87,6 @@
*/
#define FRAME_BUFFER_PAGES (FRAME_BUFFER_BYTES/(4096))
-static unsigned int *mmio;
-static unsigned int graphics;
-static unsigned int physbase;
-
-void ug1(int);
-void ug2(int);
-void ug22(int);
-void ug3(int);
-
-/* GTT is the Global Translation Table for the graphics pipeline.
- * It is used to translate graphics addresses to physical
- * memory addresses. As in the CPU, GTTs map 4K pages.
- * The setgtt function adds a further bit of flexibility:
- * it allows you to set a range (the first two parameters) to point
- * to a physical address (third parameter);the physical address is
- * incremented by a count (fourth parameter) for each GTT in the
- * range.
- * Why do it this way? For ultrafast startup,
- * we can point all the GTT entries to point to one page,
- * and set that page to 0s:
- * memset(physbase, 0, 4096);
- * setgtt(0, 4250, physbase, 0);
- * this takes about 2 ms, and is a win because zeroing
- * the page takes a up to 200 ms.
- * This call sets the GTT to point to a linear range of pages
- * starting at physbase.
- */
-
-#define GTT_PTE_BASE (2 << 20)
-
-static void
-setgtt(int start, int end, unsigned long base, int inc)
-{
- int i;
-
- for(i = start; i < end; i++){
- u32 word = base + i*inc;
- /* note: we've confirmed by checking
- * the values that mrc does no
- * useful setup before we run this.
- */
- gtt_write(GTT_PTE_BASE + i * 4, word|1);
- gtt_read(GTT_PTE_BASE + i * 4);
- }
-}
-
static int i915_init_done = 0;
/* fill the palette. */
@@ -145,75 +100,6 @@ static void palette(void)
}
}
-void dp_init_dim_regs(struct intel_dp *dp);
-void dp_init_dim_regs(struct intel_dp *dp)
-{
- struct edid *edid = &(dp->edid);
-
- dp->bytes_per_pixel = edid->framebuffer_bits_per_pixel / 8;
-
- dp->stride = edid->bytes_per_line;
-
- dp->htotal = (edid->ha - 1) | ((edid->ha + edid->hbl - 1) << 16);
-
- dp->hblank = (edid->ha - 1) | ((edid->ha + edid->hbl - 1) << 16);
-
- dp->hsync = (edid->ha + edid->hso - 1) |
- ((edid->ha + edid->hso + edid->hspw - 1) << 16);
-
- dp->vtotal = (edid->va - 1) | ((edid->va + edid->vbl - 1) << 16);
-
- dp->vblank = (edid->va - 1) | ((edid->va + edid->vbl - 1) << 16);
-
- dp->vsync = (edid->va + edid->vso - 1) |
- ((edid->va + edid->vso + edid->vspw - 1) << 16);
-
- /* PIPEASRC is wid-1 x ht-1 */
- dp->pipesrc = (edid->ha-1)<<16 | (edid->va-1);
-
- dp->pfa_pos = 0;
-
- dp->pfa_ctl = 0x80800000;
-
- dp->pfa_sz = (edid->ha << 16) | (edid->va);
-
- dp->flags = intel_ddi_calc_transcoder_flags(3 * 6, /* bits per color is 6 */
- dp->port,
- dp->pipe,
- dp->type,
- dp->lane_count,
- dp->pfa_sz,
- dp->edid.phsync == '+'?1:0,
- dp->edid.pvsync == '+'?1:0);
-
- dp->transcoder = intel_ddi_get_transcoder(dp->port,
- dp->pipe);
-
- intel_dp_compute_m_n(dp->pipe_bits_per_pixel,
- dp->lane_count,
- dp->edid.pixel_clock,
- dp->edid.link_clock,
- &dp->m_n);
-
- printk(BIOS_SPEW, "dp->stride = 0x%08x\n",dp->stride);
- printk(BIOS_SPEW, "dp->htotal = 0x%08x\n", dp->htotal);
- printk(BIOS_SPEW, "dp->hblank = 0x%08x\n", dp->hblank);
- printk(BIOS_SPEW, "dp->hsync = 0x%08x\n", dp->hsync);
- printk(BIOS_SPEW, "dp->vtotal = 0x%08x\n", dp->vtotal);
- printk(BIOS_SPEW, "dp->vblank = 0x%08x\n", dp->vblank);
- printk(BIOS_SPEW, "dp->vsync = 0x%08x\n", dp->vsync);
- printk(BIOS_SPEW, "dp->pipesrc = 0x%08x\n", dp->pipesrc);
- printk(BIOS_SPEW, "dp->pfa_pos = 0x%08x\n", dp->pfa_pos);
- printk(BIOS_SPEW, "dp->pfa_ctl = 0x%08x\n", dp->pfa_ctl);
- printk(BIOS_SPEW, "dp->pfa_sz = 0x%08x\n", dp->pfa_sz);
- printk(BIOS_SPEW, "dp->link_m = 0x%08x\n", dp->m_n.link_m);
- printk(BIOS_SPEW, "dp->link_n = 0x%08x\n", dp->m_n.link_n);
- printk(BIOS_SPEW, "0x6f030 = 0x%08x\n", TU_SIZE(dp->m_n.tu) | dp->m_n.gmch_m);
- printk(BIOS_SPEW, "0x6f030 = 0x%08x\n", dp->m_n.gmch_m);
- printk(BIOS_SPEW, "0x6f034 = 0x%08x\n", dp->m_n.gmch_n);
- printk(BIOS_SPEW, "dp->flags = 0x%08x\n", dp->flags);
-}
-
void mainboard_train_link(struct intel_dp *intel_dp)
{
u8 read_val;
@@ -289,25 +175,14 @@ void mainboard_set_port_clk_dp(struct intel_dp *intel_dp)
gtt_write(PORT_CLK_SEL(intel_dp->port), ddi_pll_sel);
}
-int i915lightup(unsigned int pphysbase, unsigned int pmmio,
- unsigned int pgfx, unsigned int init_fb)
+int panel_lightup(struct intel_dp *dp, unsigned int init_fb)
{
- int must_cycle_power = 0;
- struct intel_dp adp, *dp = &adp;
int i;
int edid_ok;
int pixels = FRAME_BUFFER_BYTES/64;
- mmio = (void *)pmmio;
- physbase = pphysbase;
- graphics = pgfx;
- printk(BIOS_SPEW,
- "i915lightup: graphics %p mmio %p"
- "physbase %08x\n",
- (void *)graphics, mmio, physbase);
-
void runio(struct intel_dp *dp);
- void runlinux(struct intel_dp *dp);
+
dp->gen = 8; // This is gen 8 which we believe is Haswell
dp->is_haswell = 1;
dp->DP = 0x2;
@@ -332,11 +207,12 @@ int i915lightup(unsigned int pphysbase, unsigned int pmmio,
all GTT entries point to the same page
2. Developer/Recovery mode: We do not zero out all
the pages pointed to by GTT in order to avoid wasting time */
- if (init_fb)
- setgtt(0, FRAME_BUFFER_PAGES, physbase, 4096);
- else {
- setgtt(0, FRAME_BUFFER_PAGES, physbase, 0);
- memset((void*)graphics, 0, 4096);
+ if (init_fb){
+ set_translation_table(0, FRAME_BUFFER_PAGES, dp->physbase, 4096);
+ memset((void *)dp->graphics, 0x55, FRAME_BUFFER_PAGES*4096);
+ } else {
+ set_translation_table(0, FRAME_BUFFER_PAGES, dp->physbase, 0);
+ memset((void*)dp->graphics, 0, 4096);
}
dp->address = 0x50;
@@ -355,11 +231,7 @@ int i915lightup(unsigned int pphysbase, unsigned int pmmio,
edid_ok = decode_edid(dp->rawedid, dp->edidlen, &dp->edid);
printk(BIOS_SPEW, "decode edid returns %d\n", edid_ok);
- dp->edid.link_clock = intel_dp_bw_code_to_link_rate(dp->link_bw);
-
- printk(BIOS_SPEW, "pixel_clock is %i, link_clock is %i\n",dp->edid.pixel_clock, dp->edid.link_clock);
-
- dp_init_dim_regs(dp);
+ compute_display_params(dp);
intel_ddi_set_pipe_settings(dp);
@@ -372,18 +244,12 @@ int i915lightup(unsigned int pphysbase, unsigned int pmmio,
test_gfx(dp);
- set_vbe_mode_info_valid(&dp->edid, graphics);
+ set_vbe_mode_info_valid(&dp->edid, (uintptr_t)dp->graphics);
i915_init_done = 1;
return i915_init_done;
fail:
printk(BIOS_SPEW, "Graphics could not be started;");
- if (0 && must_cycle_power){
- printk(BIOS_SPEW, "Turn off power and wait ...");
- gtt_write(PCH_PP_CONTROL,0xabcd0000);
- udelay(600000);
- gtt_write(PCH_PP_CONTROL,0xabcd000f);
- }
printk(BIOS_SPEW, "Returning.\n");
return 0;
}
diff --git a/src/mainboard/google/falco/i915io.c b/src/mainboard/google/falco/i915io.c
index aae7f29..e1479f2 100644
--- a/src/mainboard/google/falco/i915io.c
+++ b/src/mainboard/google/falco/i915io.c
@@ -28,12 +28,6 @@
#include <arch/io.h>
#include "mainboard.h"
-/* these variables will be removed when the proper support is finished in src/drivers/intel/gma/intel_dp.c */
-int index;
-u32 auxout;
-u8 auxin[20];
-u8 msg[32];
-
/* this function will either be renamed or subsumed into ./gma.c:i915_lightup */
void runio(struct intel_dp *dp);
@@ -72,7 +66,7 @@ void runio(struct intel_dp *dp)
mainboard_set_port_clk_dp(dp);
gtt_write(DSPSTRIDE(dp->plane),dp->stride);
- gtt_write(DSPCNTR(dp->plane),DISPLAY_PLANE_ENABLE|DISPPLANE_RGBX888);
+ gtt_write(DSPCNTR(dp->plane),DISPLAY_PLANE_ENABLE|DISPPLANE_BGRX888);
gtt_write(DEIIR,0x00000080);
gtt_write(TRANS_DDI_FUNC_CTL_EDP,dp->flags);
@@ -125,7 +119,7 @@ void runio(struct intel_dp *dp)
intel_dp_wait_reg(DEIIR, 0x00000000);
gtt_write(DSPSTRIDE(dp->plane),dp->stride);
- gtt_write(DSPCNTR(dp->plane),DISPLAY_PLANE_ENABLE | DISPPLANE_RGBX888);
+ gtt_write(DSPCNTR(dp->plane),DISPLAY_PLANE_ENABLE | DISPPLANE_BGRX888);
gtt_write(PCH_PP_CONTROL,EDP_BLC_ENABLE | PANEL_POWER_RESET | PANEL_POWER_ON);
diff --git a/src/mainboard/google/falco/mainboard.h b/src/mainboard/google/falco/mainboard.h
new file mode 100644
index 0000000..f47fffd
--- /dev/null
+++ b/src/mainboard/google/falco/mainboard.h
@@ -0,0 +1,25 @@
+/*
+* This file is part of the coreboot project.
+*
+* Copyright 2013 Google Inc.
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; version 2 of the License.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* 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
+*/
+
+#ifndef __MAINBOARD_H_
+#define __MAINBOARD_H_
+void mainboard_train_link(struct intel_dp *intel_dp);
+void mainboard_set_port_clk_dp(struct intel_dp *intel_dp);
+
+#endif
diff --git a/src/mainboard/google/link/i915.c b/src/mainboard/google/link/i915.c
index 8d94d36..c24c4bd 100644
--- a/src/mainboard/google/link/i915.c
+++ b/src/mainboard/google/link/i915.c
@@ -374,7 +374,7 @@ int i915lightup(const struct northbridge_intel_sandybridge_config *info,
(void *)graphics, FRAME_BUFFER_BYTES);
memset((void *)graphics, 0, FRAME_BUFFER_BYTES);
printk(BIOS_SPEW, "%ld microseconds\n", globalmicroseconds());
- set_vbe_mode_info_valid(&edid, graphics);
+ set_vbe_mode_info_valid(&edid, (uintptr_t)graphics);
i915_init_done = 1;
return i915_init_done;
}
diff --git a/src/mainboard/google/peppy/gma.c b/src/mainboard/google/peppy/gma.c
index 9c76c80..9b8a32b 100644
--- a/src/mainboard/google/peppy/gma.c
+++ b/src/mainboard/google/peppy/gma.c
@@ -87,9 +87,6 @@
*/
#define FRAME_BUFFER_PAGES (FRAME_BUFFER_BYTES/(4096))
-static unsigned int *mmio;
-static unsigned int graphics;
-static unsigned int physbase;
static int i915_init_done = 0;
@@ -155,8 +152,6 @@ static void test_gfx(struct intel_dp *dp)
green and blue. It is very useful to ensure all the initializations
are made right. Thus, to be used only for testing, not otherwise
*/
- printk(BIOS_SPEW, "TEST: graphics %p, va %d, ha %d, stride %d\n",
- (u32 *)graphics, dp->edid.va, dp->edid.ha, dp->stride);
for (i = 0; i < (dp->edid.va - 4); i++) {
u32 *l;
@@ -166,7 +161,7 @@ static void test_gfx(struct intel_dp *dp)
if (j == (dp->edid.ha/2)) {
tcolor = 0xff00;
}
- l = (u32*)(graphics + i * dp->stride + j * sizeof(tcolor));
+ l = (u32*)(dp->graphics + i * dp->stride + j * sizeof(tcolor));
memcpy(l,&tcolor,sizeof(tcolor));
}
}
@@ -196,24 +191,14 @@ void mainboard_set_port_clk_dp(struct intel_dp *intel_dp)
gtt_write(PORT_CLK_SEL(intel_dp->port), ddi_pll_sel);
}
-int i915lightup(unsigned int pphysbase, unsigned int pmmio,
- unsigned int pgfx, unsigned int init_fb)
+int panel_lightup(struct intel_dp *dp, unsigned int init_fb)
{
- int must_cycle_power = 0;
- struct intel_dp adp, *dp = &adp;
int i;
int edid_ok;
int pixels = FRAME_BUFFER_BYTES/64;
gtt_write(PCH_PP_CONTROL,0xabcd000f);
delay(1);
- mmio = (void *)pmmio;
- physbase = pphysbase;
- graphics = pgfx;
- printk(BIOS_SPEW,
- "i915lightup: graphics %p mmio %p"
- "physbase %08x\n",
- (void *)graphics, mmio, physbase);
void runio(struct intel_dp *dp);
/* hard codes -- stuff you can only know from the mainboard */
@@ -240,11 +225,12 @@ int i915lightup(unsigned int pphysbase, unsigned int pmmio,
2. Developer/Recovery mode: Set up a tasteful color
so people know we are alive. */
if (init_fb || show_test) {
- set_translation_table(0, FRAME_BUFFER_PAGES, physbase, 4096);
- memset((void *)graphics, 0x55, FRAME_BUFFER_PAGES*4096);
+ set_translation_table(0, FRAME_BUFFER_PAGES, dp->physbase,
+ 4096);
+ memset((void *)dp->graphics, 0x55, FRAME_BUFFER_PAGES*4096);
} else {
- set_translation_table(0, FRAME_BUFFER_PAGES, physbase, 0);
- memset((void*)graphics, 0, 4096);
+ set_translation_table(0, FRAME_BUFFER_PAGES, dp->physbase, 0);
+ memset((void*)dp->graphics, 0, 4096);
}
dp->address = 0x50;
@@ -279,13 +265,14 @@ int i915lightup(unsigned int pphysbase, unsigned int pmmio,
printk(BIOS_SPEW, "ha=%d, va=%d\n",dp->edid.ha, dp->edid.va);
test_gfx(dp);
- set_vbe_mode_info_valid(&dp->edid, graphics);
+ set_vbe_mode_info_valid(&dp->edid, (uintptr_t)dp->graphics);
i915_init_done = 1;
return 1;
fail:
printk(BIOS_SPEW, "Graphics could not be started;");
- if (0 && must_cycle_power){
+ /* unclear we will *ever* want to do this. */
+ if (0){
printk(BIOS_SPEW, "Turn off power and wait ...");
gtt_write(PCH_PP_CONTROL,0xabcd0000);
udelay(600000);
diff --git a/src/mainboard/google/peppy/i915io.c b/src/mainboard/google/peppy/i915io.c
index 693aed5..cf84004 100644
--- a/src/mainboard/google/peppy/i915io.c
+++ b/src/mainboard/google/peppy/i915io.c
@@ -60,7 +60,7 @@ void runio(struct intel_dp *dp, int verbose)
mainboard_set_port_clk_dp(dp);
gtt_write(DSPSTRIDE(dp->plane),dp->stride);
- gtt_write(DSPCNTR(dp->plane),DISPLAY_PLANE_ENABLE|DISPPLANE_RGBX888);
+ gtt_write(DSPCNTR(dp->plane),DISPLAY_PLANE_ENABLE|DISPPLANE_BGRX888);
gtt_write(DEIIR,0x00000080);
intel_dp_wait_reg(DEIIR, 0x00000000);
@@ -132,7 +132,7 @@ void runio(struct intel_dp *dp, int verbose)
intel_dp_wait_reg(DEIIR, 0x00000000);
gtt_write(DSPSTRIDE(dp->plane),dp->stride);
- gtt_write(DSPCNTR(dp->plane),DISPLAY_PLANE_ENABLE | DISPPLANE_RGBX888);
+ gtt_write(DSPCNTR(dp->plane),DISPLAY_PLANE_ENABLE | DISPPLANE_BGRX888);
gtt_write(PCH_PP_CONTROL,EDP_BLC_ENABLE | EDP_BLC_ENABLE | PANEL_POWER_ON);
diff --git a/src/mainboard/google/slippy/Kconfig b/src/mainboard/google/slippy/Kconfig
index 341e5bf..88bf501 100644
--- a/src/mainboard/google/slippy/Kconfig
+++ b/src/mainboard/google/slippy/Kconfig
@@ -18,8 +18,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select MAINBOARD_HAS_CHROMEOS
select EXTERNAL_MRC_BLOB
select MONOTONIC_TIMER_MSR
- select MAINBOARD_HAS_NATIVE_VGA_INIT
- select MAINBOARD_DO_NATIVE_VGA_INIT
select INTEL_DP
select INTEL_DDI
select INTEL_INT15
diff --git a/src/northbridge/intel/haswell/gma.c b/src/northbridge/intel/haswell/gma.c
index 8be25e7..015eabe 100644
--- a/src/northbridge/intel/haswell/gma.c
+++ b/src/northbridge/intel/haswell/gma.c
@@ -426,21 +426,18 @@ static void gma_pm_init_post_vbios(struct device *dev)
static void gma_func0_init(struct device *dev)
{
+#if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT
+ struct northbridge_intel_haswell_config *conf = dev->chip_info;
+ struct intel_dp dp;
+#endif
+
int lightup_ok = 0;
u32 reg32;
- u32 graphics_base; //, graphics_size;
/* IGD needs to be Bus Master */
reg32 = pci_read_config32(dev, PCI_COMMAND);
reg32 |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY | PCI_COMMAND_IO;
pci_write_config32(dev, PCI_COMMAND, reg32);
-
- /* the BAR for graphics space is a well known number for
- * sandy and ivy. And the resource code renumbers it.
- * So it's almost like having two hardcodes.
- */
- graphics_base = dev->resource_list[1].base;
-
/* Init graphics power management */
gma_pm_init_pre_vbios(dev);
@@ -449,17 +446,25 @@ static void gma_func0_init(struct device *dev)
#if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT
printk(BIOS_SPEW, "NATIVE graphics, run native enable\n");
- u32 mmiobase, physbase;
/* Default set to 1 since it might be required for
stuff like seabios */
unsigned int init_fb = 1;
- mmiobase = dev->resource_list[0].base;
- physbase = pci_read_config32(dev, 0x5c) & ~0xf;
+
+ /* the BAR for graphics space is a well known number for
+ * sandy and ivy. And the resource code renumbers it.
+ * So it's almost like having two hardcodes.
+ */
+ dp.graphics = (void *)((uintptr_t)dev->resource_list[1].base);
+ dp.physbase = pci_read_config32(dev, 0x5c) & ~0xf;
+ dp.panel_power_down_delay = conf->gpu_panel_power_down_delay;
+ dp.panel_power_up_delay = conf->gpu_panel_power_up_delay;
+ dp.panel_power_cycle_delay = conf->gpu_panel_power_cycle_delay;
+
+ dp.physbase = pci_read_config32(dev, 0x5c) & ~0xf;
#ifdef CONFIG_CHROMEOS
init_fb = developer_mode_enabled() || recovery_mode_enabled();
#endif
- lightup_ok = i915lightup(physbase, mmiobase, graphics_base, init_fb);
- if (lightup_ok)
+ lightup_ok = panel_lightup(&dp, init_fb);
gfx_set_init_done(1);
#endif
if (! lightup_ok) {