Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16881
-gerrit
commit 79cbe8b3e8fe554356405964dc7747b79af38b5e
Author: Furquan Shaikh <furquan(a)chromium.org>
Date: Thu Sep 29 19:37:49 2016 -0700
Revert "soc/intel/apollolake: Add pmc_ipc device support"
This reverts commit 28821dbb2261267462a7e9b0cc1c23b51af2d3ee.
(https://review.coreboot.org/16649)
This change causes the kernel to boot really slow. Maybe there is an
interrupt storm that prevents the kernel from making any
progress. Reverting until the proper kernel dependency is met.
BUG=chrome-os-partner:57364
BRANCH=None
TEST=Kernels boots to prompt fine on DVT.
Change-Id: I1c9913b4476a08303f9dd887b8631601c847dcf7
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: d7014ee1bb88df7a2d7f6b3dced797fef75b252d
Original-Change-Id: I061c0b03b43b516a190b370c04888e73a410fcf1
Original-Signed-off-by: Furquan Shaikh <furquan(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/391233
Original-Reviewed-by: Duncan Laurie <dlaurie(a)google.com>
---
src/soc/intel/apollolake/acpi/pmc_ipc.asl | 57 ---------------------------
src/soc/intel/apollolake/acpi/southbridge.asl | 3 --
2 files changed, 60 deletions(-)
diff --git a/src/soc/intel/apollolake/acpi/pmc_ipc.asl b/src/soc/intel/apollolake/acpi/pmc_ipc.asl
deleted file mode 100644
index b89bebf..0000000
--- a/src/soc/intel/apollolake/acpi/pmc_ipc.asl
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2016 Intel Corp.
- *
- * 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 <soc/iomap.h>
-
-#define MAILBOX_DATA 0x7080
-#define MAILBOX_INTF 0x7084
-#define PMIO_LENGTH 0x80
-
-Device (IPC1)
-{
- Name (_HID, "INT34D2")
- Name (_CID, "INT34D2")
- Name (_DDN, "Intel(R) IPC1 Controller")
- Name (RBUF, ResourceTemplate ()
- {
- Memory32Fixed (ReadWrite, 0x0, 0x2000, IBAR)
- Memory32Fixed (ReadWrite, 0x0, 0x4, MDAT)
- Memory32Fixed (ReadWrite, 0x0, 0x4, MINF)
- IO (Decode16, ACPI_PMIO_BASE, ACPI_PMIO_BASE + PMIO_LENGTH,
- 0x04, PMIO_LENGTH)
- Memory32Fixed (ReadWrite, 0x0, 0x2000, SBAR)
- Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, , , )
- {
- PMC_INT
- }
- })
-
- Method (_CRS, 0x0, NotSerialized)
- {
- CreateDwordField (^RBUF, ^IBAR._BAS, IBAS)
- Store (PMC_BAR0, IBAS)
-
- CreateDwordField (^RBUF, ^MDAT._BAS, MDBA)
- Store (MCH_BASE_ADDR + MAILBOX_DATA, MDBA)
- CreateDwordField (^RBUF, ^MINF._BAS, MIBA)
- Store (MCH_BASE_ADDR + MAILBOX_INTF, MIBA)
-
- CreateDwordField (^RBUF, ^SBAR._BAS, SBAS)
- Store (PMC_SRAM_BASE_0, SBAS)
-
- Return (^RBUF)
- }
-}
diff --git a/src/soc/intel/apollolake/acpi/southbridge.asl b/src/soc/intel/apollolake/acpi/southbridge.asl
index f2b09c7..1c10f1a 100644
--- a/src/soc/intel/apollolake/acpi/southbridge.asl
+++ b/src/soc/intel/apollolake/acpi/southbridge.asl
@@ -40,9 +40,6 @@ Scope (\_SB)
#include "xhci.asl"
-/* PMC IPC */
-#include "pmc_ipc.asl"
-
/* LPC */
#include "lpc.asl"
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16717
-gerrit
commit 0bcdfb76da297fa3050ad6ce2f8c6e5f4b1be59a
Author: Liangfeng Wu <wulf(a)rock-chips.com>
Date: Thu Sep 15 17:16:54 2016 +0800
rockchip/rk3399: Configure USB3 controller work in USB2 only mode
During the USB2 only mode, the Type-C PHY will be held in reset
and only USB2 part logic of USB3 OTG controller and PHY may be
used over the USB2 pins on the Type-C connector to support Low,
Full and High-speed USB operation.
BRANCH=none
BUG=chrome-os-partner:56425
TEST=Go to recovery mode, plug a Type-C USB drive containing
chrome OS image into both ports in all orientations, check if
system can boot form USB.
Change-Id: Ic265c0c91c24f63b2f9c3106eb2bb277a589233b
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: a37ccc5b6019967483eac6b5a360d67bc3326e93
Original-Change-Id: I582f04f84eef447ff0ba691ce60e9461ed31cfad
Original-Signed-off-by: Liangfeng Wu <wulf(a)rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/385837
Original-Commit-Ready: Julius Werner <jwerner(a)chromium.org>
Original-Tested-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
---
src/soc/rockchip/rk3399/usb.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/soc/rockchip/rk3399/usb.c b/src/soc/rockchip/rk3399/usb.c
index f638a1e..4c731bd 100644
--- a/src/soc/rockchip/rk3399/usb.c
+++ b/src/soc/rockchip/rk3399/usb.c
@@ -17,6 +17,9 @@
#include <assert.h>
#include <console/console.h>
#include <delay.h>
+#include <soc/clock.h>
+#include <soc/grf.h>
+#include <soc/soc.h>
#include <soc/usb.h>
/* SuperSpeed over Type-C is hard. We don't care about speed in firmware: just
@@ -86,12 +89,24 @@ static void setup_dwc3(struct rockchip_usb_dwc3 *dwc3)
void reset_usb_otg0(void)
{
+ /* Keep whole USB OTG0 controller in reset, then
+ * configure controller to work in USB 2.0 only mode. */
+ write32(&cru_ptr->softrst_con[18], RK_SETBITS(1 << 5));
+ write32(&rk3399_grf->usb3otg0_con1, RK_CLRSETBITS(0xf << 12, 1 << 0));
+ write32(&cru_ptr->softrst_con[18], RK_CLRBITS(1 << 5));
+
printk(BIOS_DEBUG, "Starting DWC3 reset for USB OTG0\n");
reset_dwc3(rockchip_usb_otg0_dwc3);
}
void reset_usb_otg1(void)
{
+ /* Keep whole USB OTG1 controller in reset, then
+ * configure controller to work in USB 2.0 only mode. */
+ write32(&cru_ptr->softrst_con[18], RK_SETBITS(1 << 6));
+ write32(&rk3399_grf->usb3otg1_con1, RK_CLRSETBITS(0xf << 12, 1 << 0));
+ write32(&cru_ptr->softrst_con[18], RK_CLRBITS(1 << 6));
+
printk(BIOS_DEBUG, "Starting DWC3 reset for USB OTG1\n");
reset_dwc3(rockchip_usb_otg1_dwc3);
}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16769
-gerrit
commit 60854fe205bbd5b212b92e6fadee74a827664d34
Author: Julius Werner <jwerner(a)chromium.org>
Date: Fri Sep 23 16:07:42 2016 -0700
rockchip/rk3399: Actually remove big CPU initialization from bootblock
CL:377541 was supposed to remove the big CPU cluster initialization from
rkclk_init() in the bootblock and move it to a more suitable place in
ramstage. Except that next to all the code cleanup I did in that patch,
I seem to have forgotten to actually remove that old code.
Big thanks to Nico for spotting that in the upstream coreboot review.
BRANCH=gru
BUG=chrome-os-partner:54906
TEST=Booted Kevin.
Change-Id: I09fe948b4587536802b42329b813177439e0804f
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 77f9eaf0446b22adfca79d0adf8a0ecfd93c0040
Original-Change-Id: I13dab208225b7e43ad864f2f3cf51b3c104acd4b
Original-Reported-by: Nico Huber <nico.h(a)gmx.de>
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/389236
Original-Reviewed-by: Douglas Anderson <dianders(a)chromium.org>
---
src/soc/rockchip/rk3399/clock.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/src/soc/rockchip/rk3399/clock.c b/src/soc/rockchip/rk3399/clock.c
index b9de844..2596853 100644
--- a/src/soc/rockchip/rk3399/clock.c
+++ b/src/soc/rockchip/rk3399/clock.c
@@ -411,13 +411,6 @@ void rkclk_init(void)
rkclk_set_pll(&cru_ptr->gpll_con[0], &gpll_init_cfg);
rkclk_set_pll(&cru_ptr->cpll_con[0], &cpll_init_cfg);
- /*
- * coreboot boot from little core, but it seem if apll_b use defalut
- * 24MHz it will take a long time to enable big core, and will cause
- * a watchdog crash, so we should do apll_b initialization here
- */
- rkclk_configure_cpu(APLL_600_MHZ, true);
-
/* configure perihp aclk, hclk, pclk */
aclk_div = GPLL_HZ / PERIHP_ACLK_HZ - 1;
assert((aclk_div + 1) * PERIHP_ACLK_HZ == GPLL_HZ && aclk_div <= 0x1f);
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16712
-gerrit
commit 354fbf65564e715ad1f0f9071106e33286a394f9
Author: Simon Glass <sjg(a)chromium.org>
Date: Mon Sep 5 11:10:26 2016 -0600
rockchip: spi: Add support for 16-bit APB reads
With a SPI clock above about 24MHz the APB cannot keep up when doing
individual byte transfers. Adjust the driver to use 16-bit reads when
it can, to remove this bottleneck.
Any transaction which involves writing bytes still uses 8-bit transfers,
to simplify the code. These are the transfers that are not time-critical
since they tend to be small. The case that really matters is reading from
SPI flash.
In general we can use 16-bit reads anytime we are transferring an even
number of bytes. If the code detects an odd number of bytes, it tries to
perform the operation in two steps: once in 16-bit mode with an even
number of bytes, and once in 8-bit mode for the final byte. This allow
us to use 16-bit reads even if asked to transfer (for example) 0xf423
bytes.
The limit on in_now and out_now is adjusted to 0xfffe to avoid an extra
transfer when transferring ~>=64KB.
CQ-DEPEND=CL:383232
BUG=chrome-os-partner:56556
BRANCH=none
TEST=boot on gru and see that things still work correctly. I tested (with
extra debugging) that the 16-bit case is being picked when it should be.
Change-Id: If5effae9a84e4de06537fd594bedf7f01d6a9c88
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: ec250b4931c7d99cc014e32ab597fca948299d08
Original-Change-Id: Idc5b7e5d82cdbdc1e8fe8b2d6da819edf2d5570c
Original-Signed-off-by: Simon Glass <sjg(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/381312
Original-Commit-Ready: Julius Werner <jwerner(a)chromium.org>
Original-Tested-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
---
src/soc/rockchip/common/spi.c | 53 ++++++++++++++++++++++++++++++++-----------
1 file changed, 40 insertions(+), 13 deletions(-)
diff --git a/src/soc/rockchip/common/spi.c b/src/soc/rockchip/common/spi.c
index 7dcaaad..57e9ca1 100644
--- a/src/soc/rockchip/common/spi.c
+++ b/src/soc/rockchip/common/spi.c
@@ -149,9 +149,6 @@ void rockchip_spi_init(unsigned int bus, unsigned int speed_hz)
/* First Bit Mode */
ctrlr0 |= (SPI_FBM_MSB << SPI_FBM_OFFSET);
- /* Byte and Halfword Transform */
- ctrlr0 |= (SPI_APB_8BIT << SPI_HALF_WORLD_TX_OFFSET);
-
/* Frame Format */
ctrlr0 |= (SPI_FRF_SPI << SPI_FRF_OFFSET);
@@ -220,7 +217,7 @@ static void set_transfer_mode(struct rockchip_spi *regs,
}
/* returns 0 to indicate success, <0 otherwise */
-static int do_xfer(struct rockchip_spi *regs, const void *dout,
+static int do_xfer(struct rockchip_spi *regs, bool use_16bit, const void *dout,
unsigned int *bytes_out, void *din, unsigned int *bytes_in)
{
uint8_t *in_buf = din;
@@ -251,12 +248,23 @@ static int do_xfer(struct rockchip_spi *regs, const void *dout,
* sychronizing with the SPI clock which is pretty slow.
*/
if (*bytes_in && !(sr & SR_RF_EMPT)) {
- int todo = read32(®s->rxflr) & RXFLR_LEVEL_MASK;
-
- *bytes_in -= todo;
- xferred = todo;
- while (todo-- > 0)
- *in_buf++ = read32(®s->rxdr) & 0xff;
+ int fifo = read32(®s->rxflr) & RXFLR_LEVEL_MASK;
+ int val;
+
+ if (use_16bit)
+ xferred = fifo * 2;
+ else
+ xferred = fifo;
+ *bytes_in -= xferred;
+ while (fifo-- > 0) {
+ val = read32(®s->rxdr);
+ if (use_16bit) {
+ *in_buf++ = val & 0xff;
+ *in_buf++ = (val >> 8) & 0xff;
+ } else {
+ *in_buf++ = val & 0xff;
+ }
+ }
}
min_xfer -= xferred;
@@ -290,12 +298,31 @@ int spi_xfer(struct spi_slave *slave, const void *dout,
* seems to work fine.
*/
while (bytes_out || bytes_in) {
- unsigned int in_now = MIN(bytes_in, 0xffff);
- unsigned int out_now = MIN(bytes_out, 0xffff);
+ unsigned int in_now = MIN(bytes_in, 0xfffe);
+ unsigned int out_now = MIN(bytes_out, 0xfffe);
unsigned int in_rem, out_rem;
+ unsigned int mask;
+ bool use_16bit;
rockchip_spi_enable_chip(regs, 0);
+ /*
+ * Use 16-bit transfers for higher-speed reads. If we are
+ * transferring an odd number of bytes, try to make it even.
+ */
+ use_16bit = false;
+ if (bytes_out == 0) {
+ if ((in_now & 1) && in_now > 1)
+ in_now--;
+ if (!(in_now & 1))
+ use_16bit = true;
+ }
+ mask = SPI_APB_8BIT << SPI_HALF_WORLD_TX_OFFSET;
+ if (use_16bit)
+ clrbits_le32(®s->ctrlr0, mask);
+ else
+ setbits_le32(®s->ctrlr0, mask);
+
/* Enable/disable transmitter and receiver as needed to
* avoid sending or reading spurious bits. */
set_transfer_mode(regs, bytes_out, bytes_in);
@@ -307,7 +334,7 @@ int spi_xfer(struct spi_slave *slave, const void *dout,
in_rem = in_now;
out_rem = out_now;
- ret = do_xfer(regs, dout, &out_rem, din, &in_rem);
+ ret = do_xfer(regs, use_16bit, dout, &out_rem, din, &in_rem);
if (ret < 0)
break;