Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16767
-gerrit
commit 9c738c3789e049a35d497352f552280d48da1580
Author: Suresh Rajashekara <sureshraj(a)google.com>
Date: Thu Sep 22 08:20:16 2016 -0700
Gale: Fixing the orange color to match the UX doc
UX Doc = go/gale-hw-ui
This color wasn't changed earlier as the change wasn't done in
the OS also. However, since we cannot change this later in FW
(but OS can change anytime), I am making this change after discussing
with the UX team.
BUG=b:31501528, b:31633562
TEST=Change the device state to 'recovery mode' to observe the new
color.
BRANCH=none
Change-Id: Ia91f14eb77492095cb41a9de0bb9790e72aa4851
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 36a3d8c6eabbc0b23d0a15d5bddc5ed3bdeebe70
Original-Change-Id: I88768b94cf91804a6005e44b1a168e059698ec4b
Original-Signed-off-by: Suresh Rajashekara <sureshraj(a)google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/388206
Original-Commit-Ready: Suresh Rajashekara <sureshraj(a)chromium.org>
Original-Tested-by: Suresh Rajashekara <sureshraj(a)chromium.org>
Original-Reviewed-by: Christopher Book <cbook(a)chromium.org>
Original-Reviewed-by: Kan Yan <kyan(a)google.com>
---
src/drivers/i2c/ww_ring/ww_ring_programs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/drivers/i2c/ww_ring/ww_ring_programs.c b/src/drivers/i2c/ww_ring/ww_ring_programs.c
index fb74a1b..0c70e10 100644
--- a/src/drivers/i2c/ww_ring/ww_ring_programs.c
+++ b/src/drivers/i2c/ww_ring/ww_ring_programs.c
@@ -170,8 +170,8 @@ static const TiLp55231Program blink_wipeout1_program = {
static const uint8_t blink_recovery1_text[] = {
0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x90, 0x02,
0x94, 0x02, 0x9f, 0x80, 0x98, 255, 0x84, 0x62,
- 0x9f, 0x81, 0x98, 50, 0x84, 0x62, 0x9f, 0x82,
- 0x98, 0, 0x84, 0x62, 0x4c, 0x00, 0x86, 0x2c,
+ 0x9f, 0x81, 0x98, 100, 0x84, 0x62, 0x9f, 0x82,
+ 0x98, 10, 0x84, 0x62, 0x4c, 0x00, 0x86, 0x2c,
0x40, 0x00, 0x9f, 0x81, 0x40, 0x00, 0x9f, 0x80,
0x40, 0x00, 0x4c, 0x00, 0x86, 0x49, 0xa0, 0x03,
0xc0, 0x00, 0xc0, 0x00, 0x00,
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 bdc9ad26d345e915b51607f6c63dea0ac3f82c84
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/16712
-gerrit
commit fca9e671cb54edae9ec073fa5082ceba50cd9f4e
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;
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16715
-gerrit
commit f095d667887191c0fe6b83d3d3c88589883f9bbc
Author: Julius Werner <jwerner(a)chromium.org>
Date: Mon Sep 12 16:02:33 2016 -0700
google/gru: Shrink RW_ELOG region to 4KB
Since there's currently a limitation in coreboot's code that prevents
more than 4KB to be used by the eventlog anyway, this patch shrinks the
available RW_ELOG area in the FMAP for Gru down to 4KB. This may prove
prudent later if we ever resolve that limitation, so that tools can rely
on the area in the FMAP being the same as the area actually used by the
read-only firmware code on these boards.
BRANCH=gru
BUG=chrome-os-partner:55593
TEST=Booted Kevin, confirmed that eventlog got written normally. Ran a
reboot loop to exhaust eventlog space, confirmed that the shrink code
kicks in as expected before reaching 4KB.
Change-Id: I3c55d836c72486665a19783fe98ce9e0df174b6d
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 05efb82ca00703fd92d925ebf717738e37295c18
Original-Change-Id: Ia2617681f9394e953f5beb4abf419fe8d97e6d3e
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/384585
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Reviewed-by: Simon Glass <sjg(a)google.com>
---
src/mainboard/google/gru/chromeos.fmd | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mainboard/google/gru/chromeos.fmd b/src/mainboard/google/gru/chromeos.fmd
index bf30ddf..2200fa7 100644
--- a/src/mainboard/google/gru/chromeos.fmd
+++ b/src/mainboard/google/gru/chromeos.fmd
@@ -20,7 +20,8 @@ FLASH@0x0 0x800000 {
FW_MAIN_B(CBFS)@0x2000 0xe5f00
RW_FWID_B@0xe7f00 0x100
}
- RW_ELOG@0x5d8000 0x8000
+ RW_ELOG@0x5d8000 0x1000
+ RW_UNUSED@0x5d9000 0x7000
RW_SHARED@0x5e0000 0x10000 {
SHARED_DATA@0x0 0x10000
}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16714
-gerrit
commit b1bbda8d8a9234bff64e92ee784ac75bc2541e7f
Author: Julius Werner <jwerner(a)chromium.org>
Date: Mon Sep 12 15:46:02 2016 -0700
rockchip/rk3399: Move TTB to the end of SRAM
We found that we may want to load some components of BL31 on the RK3399
into SRAM. As usual, these components may not overlap any coreboot
regions still in use at that time, as is already statically checked by
the check-ramstage-overlaps rule in Makefile.inc.
On RK3399, the only such regions are TTB and STACK. This patch moves the
TTB region back to the end of SRAM (right before STACK), so that a large
contiguous region of SRAM before that remains usable for BL31.
BRANCH=gru
BUG=None
TEST=Booted Kevin.
Change-Id: I1689d0280d79bad805fea5fc3759c2ae3ba24915
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 1d4c6c6f6cc0efe97d6962a81e309a1c040d1def
Original-Change-Id: I37c94f2460ef63aec4526caabe58f35ae851bab0
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/384635
Original-Reviewed-by: Simon Glass <sjg(a)google.com>
---
src/soc/rockchip/rk3399/include/soc/memlayout.ld | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/soc/rockchip/rk3399/include/soc/memlayout.ld b/src/soc/rockchip/rk3399/include/soc/memlayout.ld
index 54cfbe1..ef8d29d 100644
--- a/src/soc/rockchip/rk3399/include/soc/memlayout.ld
+++ b/src/soc/rockchip/rk3399/include/soc/memlayout.ld
@@ -34,9 +34,9 @@ SECTIONS
TIMESTAMP(0xFF8C1C00, 1K)
BOOTBLOCK(0xFF8C2004, 36K - 4)
PRERAM_CBFS_CACHE(0xFF8CB000, 4K)
- TTB(0xFF8CC000, 24K)
- OVERLAP_VERSTAGE_ROMSTAGE(0xFF8D2000, 92K)
- VBOOT2_WORK(0XFF8E9000, 12K)
+ OVERLAP_VERSTAGE_ROMSTAGE(0xFF8CC000, 92K)
+ VBOOT2_WORK(0XFF8E3000, 12K)
+ TTB(0xFF8E6000, 24K)
STACK(0xFF8EC000, 16K)
SRAM_END(0xFF8F0000)
}