the following patch was just integrated into master:
commit e7de6fb162bb9a7c0551027514596d6d7f45421b
Author: Furquan Shaikh <furquan(a)google.com>
Date: Sun Aug 14 21:50:50 2016 -0700
intel/apollolake: Fix check for return value of pmc_gpe_route_to_gpio
pmc_gpe_route_to_gpio returns -1 on error. However, the value was being
stored in unsigned int and compared against -1. Fix this by using local
variable ret.
Change-Id: I5ec824949d4ee0fbdbb2ffdc9fc9d4762455b27b
Reported-by: Coverity ID 1357443, 1357442, 1357441
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
Reviewed-on: https://review.coreboot.org/16218
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
See https://review.coreboot.org/16218 for details.
-gerrit
hakim giydan (hgiydan(a)marvell.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16161
-gerrit
commit 92bd5e2422b552b2931982fd0b326fe32c7a2961
Author: Hakim Giydan <hgiydan(a)marvell.com>
Date: Wed Aug 17 14:25:43 2016 -0700
soc/marvell/mvmap2315: Add NVM driver
This driver uses BootROM callback to read and write
to the nvm using I2C.
Testing: booted successfully.
Change-Id: I8639af3e004f6631d7e596507c106159835f979f
Signed-off-by: Hakim Giydan <hgiydan(a)marvell.com>
---
src/soc/marvell/mvmap2315/Makefile.inc | 1 +
src/soc/marvell/mvmap2315/include/soc/nvm.h | 25 +++++++
src/soc/marvell/mvmap2315/nvm.c | 105 ++++++++++++++++++++++++++++
3 files changed, 131 insertions(+)
diff --git a/src/soc/marvell/mvmap2315/Makefile.inc b/src/soc/marvell/mvmap2315/Makefile.inc
index 0d1ef2b..e16286b 100644
--- a/src/soc/marvell/mvmap2315/Makefile.inc
+++ b/src/soc/marvell/mvmap2315/Makefile.inc
@@ -27,6 +27,7 @@ bootblock-y += gpio.c
bootblock-y += flash.c
bootblock-y += load_validate.c
bootblock-y += media.c
+bootblock-y += nvm.c
bootblock-y += pinmux.c
bootblock-y += pmic.c
bootblock-y += reset.c
diff --git a/src/soc/marvell/mvmap2315/include/soc/nvm.h b/src/soc/marvell/mvmap2315/include/soc/nvm.h
new file mode 100644
index 0000000..ede0d97
--- /dev/null
+++ b/src/soc/marvell/mvmap2315/include/soc/nvm.h
@@ -0,0 +1,25 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Marvell, 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_MARVELL_MVMAP2315_NVM_H__
+#define __SOC_MARVELL_MVMAP2315_NVM_H__
+
+#define MVMAP2315_NVM_LOCKDOWN_FLAG BIT(0)
+
+u32 nvm_init(void);
+u32 nvm_read(u32 offset, u32 *buffer, u32 size);
+u32 nvm_write(u32 offset, u32 *buffer, u32 size);
+void nvm_lockdown(void);
+
+#endif /* __SOC_MARVELL_MVMAP2315_NVM_H__ */
diff --git a/src/soc/marvell/mvmap2315/nvm.c b/src/soc/marvell/mvmap2315/nvm.c
new file mode 100644
index 0000000..7e33e98
--- /dev/null
+++ b/src/soc/marvell/mvmap2315/nvm.c
@@ -0,0 +1,105 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Marvell, 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 <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <arch/io.h>
+#include <console/console.h>
+#include <soc/bdb.h>
+#include <soc/clock.h>
+#include <soc/flash.h>
+#include <soc/load_validate.h>
+#include <soc/nvm.h>
+
+struct flash_ops nvm_callbacks = {
+ .init = (void *)MVMAP2315_FLASH_INIT,
+ .read = (void *)MVMAP2315_FLASH_READ,
+ .write = (void *)MVMAP2315_FLASH_WRITE,
+};
+
+static void set_nvm_parameters(struct flash_params *eeprom_info, u32 offset,
+ u32 *buffer, u32 size)
+{
+ eeprom_info->offset = offset;
+ eeprom_info->buff = (u32)buffer;
+ eeprom_info->size = size;
+ eeprom_info->id = 0x0;
+ eeprom_info->partition = 0x0;
+}
+
+u32 nvm_init(void)
+{
+ int rc;
+
+ clrbits_le32(&mvmap2315_apmu_clk->apaonclk_sdmmc_clkgenconfig,
+ MVMAP2315_SDMMC_CLK_RSTN);
+ setbits_le32(&mvmap2315_apmu_clk->apaonclk_sdmmc_clkgenconfig,
+ MVMAP2315_SDMMC_CLK_RSTN);
+
+ rc = nvm_callbacks.init(MVMAP2315_EEPROM, 0, 0);
+
+ if (rc)
+ printk(BIOS_DEBUG, "nvm_init failed with rc=%x.\n", rc);
+
+ return rc;
+}
+
+u32 nvm_read(u32 offset, u32 *buffer, u32 size)
+{
+ struct flash_params eeprom_read_info;
+ u32 rc;
+
+ set_nvm_parameters(&eeprom_read_info, offset, buffer, size);
+
+ rc = nvm_init();
+
+ if (rc)
+ return rc;
+
+ rc = nvm_callbacks.read(MVMAP2315_EEPROM, 0, &eeprom_read_info);
+
+ if (rc)
+ printk(BIOS_INFO, "nvm_read callback failed, rc=%x\n", rc);
+
+ return rc;
+}
+
+u32 nvm_write(u32 offset, u32 *buffer, u32 size)
+{
+ struct flash_params eeprom_read_info;
+ u32 rc;
+
+ set_nvm_parameters(&eeprom_read_info, offset, buffer, size);
+
+ rc = nvm_init();
+
+ if (rc)
+ return rc;
+
+ rc = nvm_callbacks.write(MVMAP2315_EEPROM, 0, &eeprom_read_info);
+
+ if (rc)
+ printk(BIOS_INFO, "nvm_write callback failed, rc=%x\n", rc);
+
+ return rc;
+}
+
+void nvm_lockdown(void)
+{
+ setbits_le32(&mvmap2315_mcu_secconfig->boot_hw_lockdown_nvm,
+ MVMAP2315_NVM_LOCKDOWN_FLAG);
+}
the following patch was just integrated into master:
commit 91f6e679ccce9cf90c98608fc2c24aef44db5bf0
Author: Julius Werner <jwerner(a)chromium.org>
Date: Thu Aug 11 16:37:57 2016 -0700
google/gru: Add new PWM regulator duty numbers for revision 6
We're changing the PWM regulator bounds on Kevin from rev6 onwards, so
we'll need to use different duty cycle values for them. We really want a
proper PWM regulator driver that can calculate these values
automatically from voltages, but until we have that this patch just
hardcodes the new numbers in.
(Yes, this is a patch for the mainboard/google/gru board family that only
touches a file from the rockchip/rk3399 SoC. That too is something
that'll be fixed up in a later CL.)
BRANCH=None
BUG=chrome-os-partner:54888
TEST=Booted Kevin rev4 (for whatever that's worth...).
Change-Id: Ibb6ab5c6517d83ffb5e32cb17d0de33e8ec10293
Signed-off-by: Martin Roth <martinroth(a)chromium.org>
Original-Commit-Id: 4cb2a939295e2b6443c5dbd3374982224322304b
Original-Change-Id: I8757cc54f2478d20bb948a1a0a7398b0404a7b1f
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/368410
Original-Commit-Ready: Dan Shi <dshi(a)chromium.org>
Original-Reviewed-by: Douglas Anderson <dianders(a)chromium.org>
Reviewed-on: https://review.coreboot.org/16235
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
See https://review.coreboot.org/16235 for details.
-gerrit