Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31566
Change subject: soc/cavium/common: Make ecam0_get_bar_val common
......................................................................
soc/cavium/common: Make ecam0_get_bar_val common
Move ecam0_get_bar_val into the common folder and make it public.
Compile it for romstage and ramstage.
To be used by romstage PCI code.
Tested on OpenCellular Elgon.
Change-Id: I18b1ede56795bf8c1f9476592291b8ea610eccd4
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/soc/cavium/cn81xx/ecam0.c
M src/soc/cavium/common/Makefile.inc
A src/soc/cavium/common/ecam.c
A src/soc/cavium/common/include/soc/ecam.h
4 files changed, 108 insertions(+), 45 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/66/31566/1
diff --git a/src/soc/cavium/cn81xx/ecam0.c b/src/soc/cavium/cn81xx/ecam0.c
index 6747fa6..0ce0c8f 100644
--- a/src/soc/cavium/cn81xx/ecam0.c
+++ b/src/soc/cavium/cn81xx/ecam0.c
@@ -22,6 +22,7 @@
#include <device/pci_ops.h>
#include <soc/addressmap.h>
#include <soc/cavium/common/pci/chip.h>
+#include <soc/ecam.h>
#include <assert.h>
#define CAVM_PCCPF_XXX_VSEC_CTL 0x108
@@ -137,50 +138,6 @@
}
/**
- * Get PCI BAR address from cavium specific extended capability.
- * Use regular BAR if not found in extended capability space.
- *
- * @return The pyhsical address of the BAR, zero on error
- */
-static uint64_t get_bar_val(struct device *dev, u8 bar)
-{
- size_t cap_offset = pci_find_capability(dev, 0x14);
- uint64_t h, l, ret = 0;
- if (cap_offset) {
- /* Found EA */
- u8 es, bei;
- u8 ne = pci_read_config8(dev, cap_offset + 2) & 0x3f;
-
- cap_offset += 4;
- while (ne) {
- uint32_t dw0 = pci_read_config32(dev, cap_offset);
-
- es = dw0 & 7;
- bei = (dw0 >> 4) & 0xf;
- if (bei == bar) {
- h = 0;
- l = pci_read_config32(dev, cap_offset + 4);
- if (l & 2)
- h = pci_read_config32(dev,
- cap_offset + 12);
- ret = (h << 32) | (l & ~0xfull);
- break;
- }
- cap_offset += (es + 1) * 4;
- ne--;
- }
- } else {
- h = 0;
- l = pci_read_config32(dev, bar * 4 + PCI_BASE_ADDRESS_0);
- if (l & 4)
- h = pci_read_config32(dev, bar * 4 + PCI_BASE_ADDRESS_0
- + 4);
- ret = (h << 32) | (l & ~0xfull);
- }
- return ret;
-}
-
-/**
* pci_enable_msix - configure device's MSI-X capability structure
* @dev: pointer to the pci_dev data structure of MSI-X device function
* @entries: pointer to an array of MSI-X entries
@@ -237,7 +194,7 @@
dev_path(dev));
return -1;
}
- bar = get_bar_val(dev, bar_idx);
+ bar = ecam0_get_bar_val(dev, bar_idx);
if (!bar) {
printk(BIOS_ERR, "ERROR: %s: Failed to find MSI-X bar\n",
dev_path(dev));
diff --git a/src/soc/cavium/common/Makefile.inc b/src/soc/cavium/common/Makefile.inc
index ecde220..96e38c3 100644
--- a/src/soc/cavium/common/Makefile.inc
+++ b/src/soc/cavium/common/Makefile.inc
@@ -25,11 +25,13 @@
# romstage
romstage-y += bdk-coreboot.c
+romstage-y += ecam.c
################################################################################
# ramstage
ramstage-y += bdk-coreboot.c
+ramstage-y += ecam.c
CPPFLAGS_common += -Isrc/soc/cavium/common/include
diff --git a/src/soc/cavium/common/ecam.c b/src/soc/cavium/common/ecam.c
new file mode 100644
index 0000000..af93a8a
--- /dev/null
+++ b/src/soc/cavium/common/ecam.c
@@ -0,0 +1,74 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2018 Facebook, Inc.
+ * Copyright 2003-2017 Cavium Inc. <support(a)cavium.com>
+ * Copyright 2019 9elements Agency GmbH
+ *
+ * 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.
+ *
+ * Derived from Cavium's BSD-3 Clause OCTEONTX-SDK-6.2.0.
+ */
+
+#include <arch/io.h>
+#include <device/pci_ops.h>
+#include <device/pci_def.h>
+#include <device/pci.h>
+#include <soc/addressmap.h>
+#include <soc/ecam.h>
+#include <assert.h>
+
+/**
+ * Get PCI BAR address from cavium specific extended capability.
+ * Use regular BAR if not found in extended capability space.
+ *
+ * @return The pyhsical address of the BAR, zero on error
+ */
+#ifdef __SIMPLE_DEVICE__
+uint64_t ecam0_get_bar_val(pci_devfn_t dev, u8 bar)
+#else
+uint64_t ecam0_get_bar_val(struct device *dev, u8 bar)
+#endif
+{
+ size_t cap_offset = pci_find_capability(dev, 0x14);
+ uint64_t h, l, ret = 0;
+ if (cap_offset) {
+ /* Found EA */
+ u8 es, bei;
+ u8 ne = pci_read_config8(dev, cap_offset + 2) & 0x3f;
+
+ cap_offset += 4;
+ while (ne) {
+ uint32_t dw0 = pci_read_config32(dev, cap_offset);
+
+ es = dw0 & 7;
+ bei = (dw0 >> 4) & 0xf;
+ if (bei == bar) {
+ h = 0;
+ l = pci_read_config32(dev, cap_offset + 4);
+ if (l & 2)
+ h = pci_read_config32(dev,
+ cap_offset + 12);
+ ret = (h << 32) | (l & ~0xfull);
+ break;
+ }
+ cap_offset += (es + 1) * 4;
+ ne--;
+ }
+ } else {
+ h = 0;
+ l = pci_read_config32(dev, bar * 4 + PCI_BASE_ADDRESS_0);
+ if (l & 4)
+ h = pci_read_config32(dev, bar * 4 + PCI_BASE_ADDRESS_0
+ + 4);
+ ret = (h << 32) | (l & ~0xfull);
+ }
+ return ret;
+}
diff --git a/src/soc/cavium/common/include/soc/ecam.h b/src/soc/cavium/common/include/soc/ecam.h
new file mode 100644
index 0000000..16e3d27
--- /dev/null
+++ b/src/soc/cavium/common/include/soc/ecam.h
@@ -0,0 +1,30 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2018-present Facebook, Inc.
+ * Copyright 2019 9elements Agency GmbH
+ *
+ * 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 __COREBOOT_SRC_SOC_CAVIUM_COMMON_INCLUDE_SOC_ECAM_H
+#define __COREBOOT_SRC_SOC_CAVIUM_COMMON_INCLUDE_SOC_ECAM_H
+
+#ifdef __SIMPLE_DEVICE__
+#include <device/pci_type.h>
+
+uint64_t ecam0_get_bar_val(pci_devfn_t dev, u8 bar);
+#else
+#include <device/device.h>
+
+uint64_t ecam0_get_bar_val(struct device *dev, u8 bar);
+#endif
+
+#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/31566
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I18b1ede56795bf8c1f9476592291b8ea610eccd4
Gerrit-Change-Number: 31566
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Hello Patrick Rudolph, Aaron Durbin, Subrata Banik, Krishna P Bhat D, Balaji Manigandan, Wonkyu Kim, Maulik V Vaghela, Duncan Laurie, Rizwan Qureshi, Shelley Chen, build bot (Jenkins), Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31234
to look at the new patch set (#8).
Change subject: soc/intel/common: Include cometlake PCH IDs
......................................................................
soc/intel/common: Include cometlake PCH IDs
Add cometlake specific PCH IDs
Change-Id: I18dda48cee29213aa66c0ccddf3da31f0f489d2f
Signed-off-by: Ronak Kanabar <ronak.kanabar(a)intel.com>
---
M src/include/device/pci_ids.h
M src/soc/intel/cannonlake/bootblock/report_platform.c
M src/soc/intel/common/block/cse/cse.c
M src/soc/intel/common/block/hda/hda.c
M src/soc/intel/common/block/i2c/i2c.c
M src/soc/intel/common/block/lpc/lpc.c
M src/soc/intel/common/block/p2sb/p2sb.c
M src/soc/intel/common/block/pcie/pcie.c
M src/soc/intel/common/block/pmc/pmc.c
M src/soc/intel/common/block/sata/sata.c
M src/soc/intel/common/block/scs/sd.c
M src/soc/intel/common/block/smbus/smbus.c
M src/soc/intel/common/block/spi/spi.c
M src/soc/intel/common/block/sram/sram.c
M src/soc/intel/common/block/uart/uart.c
M src/soc/intel/common/block/xdci/xdci.c
M src/soc/intel/common/block/xhci/xhci.c
17 files changed, 100 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/31234/8
--
To view, visit https://review.coreboot.org/c/coreboot/+/31234
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I18dda48cee29213aa66c0ccddf3da31f0f489d2f
Gerrit-Change-Number: 31234
Gerrit-PatchSet: 8
Gerrit-Owner: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Balaji Manigandan <balaji.manigandan(a)intel.com>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Krishna P Bhat D <krishna.p.bhat.d(a)intel.com>
Gerrit-Reviewer: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: Shelley Chen <shchen(a)google.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Wonkyu Kim <wonkyu.kim(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
You-Cheng Syu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31586 )
Change subject: flapjack: get sku_id from ec (cbi)
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://review.coreboot.org/c/coreboot/+/31586
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iad7a52df38e2045abbdded8ba0a1f1544de961fc
Gerrit-Change-Number: 31586
Gerrit-PatchSet: 1
Gerrit-Owner: YH Lin <yueherngl(a)google.com>
Gerrit-Reviewer: Daisuke Nojiri <dnojiri(a)chromium.org>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Nick Sanders <nsanders(a)chromium.org>
Gerrit-Reviewer: YH Lin <yueherngl(a)google.com>
Gerrit-Reviewer: You-Cheng Syu <youcheng(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Mon, 25 Feb 2019 07:00:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Werner Zeh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31518
Change subject: vendorcode/siemens: Save currently open hwi file name
......................................................................
vendorcode/siemens: Save currently open hwi file name
On every call of hwilib_find_blocks() the CBFS file will be mapped and
the contents are parsed to get the offsets for every single block. This
is not needed if the CBFS file name is the same for the different calls.
This patch adds a storage for the currently open CBFS file name in
CAR_GLOBAL and checks on each call if the file to open is already open.
If yes, the file will not be mapped again which saves execution time.
Test=Booted mc_tcu3, mc_bdx1 and mc_apl1 and verified that hwinfo.hex
is only mapped once across several following hwilib_find_blocks() calls.
In addition a test was done to ensure that files with different names
get mapped correctly.
Change-Id: Id69e0f6c914c2b8e4551fd8a4fb7d452d176afb3
Signed-off-by: Werner Zeh <werner.zeh(a)siemens.com>
---
M src/vendorcode/siemens/hwilib/hwilib.c
1 file changed, 19 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/18/31518/1
diff --git a/src/vendorcode/siemens/hwilib/hwilib.c b/src/vendorcode/siemens/hwilib/hwilib.c
index f15937b..b618304 100644
--- a/src/vendorcode/siemens/hwilib/hwilib.c
+++ b/src/vendorcode/siemens/hwilib/hwilib.c
@@ -1,7 +1,7 @@
/*
* This file is part of the coreboot project.
*
- * Copyright (C) 2014 Siemens AG
+ * Copyright (C) 2014-2019 Siemens AG
*
* 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
@@ -39,6 +39,7 @@
#define EIB_FEATRUE_OFFSET 0x00e
#define LEN_MAGIC_NUM 0x007
#define BLOCK_MAGIC "H1W2M3I"
+#define HWI_MAX_NAME_LEN 32
/* Define all supported block types. */
enum {
@@ -79,6 +80,9 @@
*/
static uint16_t all_blk_size[MAX_BLOCK_NUM] CAR_GLOBAL;
+/* Storage for the cbfs file name of the currently open hwi file. */
+static char current_hwi[HWI_MAX_NAME_LEN] CAR_GLOBAL;
+
static uint32_t hwilib_read_bytes (const struct param_info *param, uint8_t *dst,
uint32_t maxlen);
@@ -469,11 +473,21 @@
uint32_t next_offset = 1;
uint8_t **blk_ptr = car_get_var_ptr(&all_blocks[0]);
uint16_t *all_blk_size_ptr = car_get_var_ptr(&all_blk_size[0]);
+ char *curr_hwi_name_ptr = car_get_var_ptr(¤t_hwi);
size_t filesize = 0;
/* Check for a valid parameter */
if (!hwi_filename)
return CB_ERR_ARG;
+ /* Check if this file is already open. If yes, just leave as there is
+ * nothing left to do here. */
+ if (curr_hwi_name_ptr &&
+ !strncmp(curr_hwi_name_ptr, hwi_filename, HWI_MAX_NAME_LEN)) {
+ printk(BIOS_SPEW, "HWILIB: File \"%s\" already open.\n",
+ hwi_filename);
+ return CB_SUCCESS;
+ }
+
ptr = cbfs_boot_map_with_leak(hwi_filename, CBFS_TYPE_RAW, &filesize);
if (!ptr) {
printk(BIOS_ERR,"HWILIB: Missing file \"%s\" in cbfs.\n",
@@ -533,8 +547,11 @@
}
/* We should have found at least one valid block */
if (blk_ptr[BLK_HIB] || blk_ptr[BLK_SIB] || blk_ptr[BLK_EIB] ||
- blk_ptr[BLK_XIB])
+ blk_ptr[BLK_XIB]) {
+ /* Save currently opened hwi filename. */
+ strncpy(curr_hwi_name_ptr, hwi_filename, HWI_MAX_NAME_LEN);
return CB_SUCCESS;
+ }
else
return CB_ERR;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/31518
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id69e0f6c914c2b8e4551fd8a4fb7d452d176afb3
Gerrit-Change-Number: 31518
Gerrit-PatchSet: 1
Gerrit-Owner: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-MessageType: newchange
YH Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31585 )
Change subject: ec/google/chromeec: fix the error status passing for cbi
......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/31585/1//COMMIT_MSG
Commit Message:
https://review.coreboot.org/#/c/31585/1//COMMIT_MSG@8
PS1, Line 8:
: google_chromeec_command() can return non-zero number (both positive
: and negative) to indicate error.
> That should be fixed instead, shouldn’t it? The convention is, that errors are negative?
Hmmm. Other than the places being modified, all seem to be checking for non-zero as error. So I'm assuming non-zero indicates error (either positive or negative)?
--
To view, visit https://review.coreboot.org/c/coreboot/+/31585
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7f0a8a61d01d942cba57036a17dd527fdbbf940c
Gerrit-Change-Number: 31585
Gerrit-PatchSet: 1
Gerrit-Owner: YH Lin <yueherngl(a)google.com>
Gerrit-Reviewer: Daisuke Nojiri <dnojiri(a)chromium.org>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: YH Lin <yueherngl(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Mon, 25 Feb 2019 03:02:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: comment