Hello Nico Huber, Patrick Georgi,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/42548
to review the following change.
Change subject: Add qc_blobs repository
......................................................................
Add qc_blobs repository
This patch adds a separate blobs repository for Qualcomm blobs,
analogous to the existing AMD blobs. Qualcomm's binary licenses allow
files to be redistributed and used by anyone, but they explicitly
require the user to agree to the license terms when just *downloading*
the binary (even if they're not using them to build any firmware). Some
community members do not like to have to agree to licenses for files
they're not actually using, so we are keeping these files separate from
the main blobs repository and adding an extra Kconfig to make sure the
user is aware of and must explicitly agree to this before downloading
these files.
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: I247746c1b633343064c9f32ef1556000475d6c4a
---
M .gitmodules
A 3rdparty/qc_blobs
M Makefile.inc
M src/Kconfig
M util/abuild/abuild
M util/release/build-release
6 files changed, 31 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/48/42548/1
diff --git a/.gitmodules b/.gitmodules
index 9545bb6..bc4a6eb 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -46,3 +46,8 @@
path = 3rdparty/cmocka
url = ../cmocka.git
update = none
+[submodule "3rdparty/qc_blobs"]
+ path = 3rdparty/qc_blobs
+ url = ../qc_blobs.git
+ update = none
+ ignore = dirty
diff --git a/3rdparty/qc_blobs b/3rdparty/qc_blobs
new file mode 160000
index 0000000..126fef6
--- /dev/null
+++ b/3rdparty/qc_blobs
@@ -0,0 +1 @@
+Subproject commit 126fef6b996237403039aa603945fc4caa75c8d6
diff --git a/Makefile.inc b/Makefile.inc
index 86335d9..605913a 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -195,6 +195,9 @@
ifeq ($(CONFIG_USE_AMD_BLOBS),y)
forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/amd_blobs))
endif
+ifeq ($(CONFIG_USE_QC_BLOBS),y)
+forgetthis:=$(if $(GIT),$(shell git submodule update --init --checkout 3rdparty/qc_blobs))
+endif
endif
UPDATED_SUBMODULES:=1
COREBOOT_EXPORTS += UPDATED_SUBMODULES
diff --git a/src/Kconfig b/src/Kconfig
index 621a582..30ab68a 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -234,6 +234,26 @@
Note that for some products, omitting PSP, SMU images, or other items
may result in a nonbooting coreboot.rom.
+config USE_QC_BLOBS
+ bool "Allow QC blobs repository (selecting this agrees to the license)
+ depends on USE_BLOBS
+ help
+ This draws in the qc_blobs repository, which contains binary files
+ distributed by Qualcomm that are required to build firmware for
+ certain Qualcomm SoCs (including QcLib, QC-SEC, qtiseclib and QUP
+ firmware). If you say Y here you are implicitly agreeing to the
+ license agreements of all files in this repository (which you can
+ browse at https://review.coreboot.org/cgit/qc_blobs.git/tree/ ).
+
+ *******************************************************************
+ PLEASE MAKE SURE YOU READ ALL 'LICENSE' FILES IN ALL SUBDIRECTORIES
+ OF THIS REPOSITORY AND AGREE TO THEIR TERMS BEFORE SELECTING THIS!
+ *******************************************************************
+
+ Not selecting this option means certain Qualcomm SoCs and related
+ mainboards cannot be built and will be hidden from the "Mainboards"
+ section.
+
config COVERAGE
bool "Code coverage support"
depends on COMPILER_GCC
diff --git a/util/abuild/abuild b/util/abuild/abuild
index 022567d..55d441f 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -714,7 +714,7 @@
shift;;
-B|--blobs) shift
customizing="${customizing}, blobs"
- configoptions="${configoptions}CONFIG_USE_AMD_BLOBS=y\nCONFIG_ADD_FSP_BINARIES=y\n"
+ configoptions="${configoptions}CONFIG_USE_AMD_BLOBS=y\nCONFIG_USE_QC_BLOBS=y\nCONFIG_ADD_FSP_BINARIES=y\n"
;;
-A|--any-toolchain) shift
customizing="${customizing}, any-toolchain"
diff --git a/util/release/build-release b/util/release/build-release
index 7ca6001..ce8e600 100755
--- a/util/release/build-release
+++ b/util/release/build-release
@@ -72,6 +72,7 @@
exclude_paths+="3rdparty/fsp "
exclude_paths+="3rdparty/intel-microcode "
exclude_paths+="3rdparty/amd_blobs "
+exclude_paths+="3rdparty/qc_blobs "
for i in ${exclude_paths}; do
blobs_paths+="coreboot-${VERSION_NAME}/${i} "
exclude_opts+="--exclude=coreboot-${VERSION_NAME}/${i} "
--
To view, visit https://review.coreboot.org/c/coreboot/+/42548
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I247746c1b633343064c9f32ef1556000475d6c4a
Gerrit-Change-Number: 42548
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Hello Martin Roth, Marc Jones, Johnny Lin, Angel Pons,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/45773
to review the following change.
Change subject: [RFC] vpd: Add vpd_get_int() function
......................................................................
[RFC] vpd: Add vpd_get_int() function
Change-Id: I1c1b5710a5236fe4a3bdda1fc978393e636e9817
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M src/drivers/vpd/vpd.c
M src/drivers/vpd/vpd.h
2 files changed, 32 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/73/45773/1
diff --git a/src/drivers/vpd/vpd.c b/src/drivers/vpd/vpd.c
index c332a6e..d3ff370 100644
--- a/src/drivers/vpd/vpd.c
+++ b/src/drivers/vpd/vpd.c
@@ -3,10 +3,12 @@
#include <assert.h>
#include <console/console.h>
#include <cbmem.h>
+#include <ctype.h>
#include <fmap.h>
#include <program_loading.h>
#include <string.h>
#include <timestamp.h>
+#include <types.h>
#include "vpd.h"
#include "vpd_decode.h"
@@ -274,4 +276,25 @@
return false;
}
+/*
+ * Find value of integer type by vpd key.
+ *
+ * Expects to find a decimal string, trailing chars are ignored.
+ * Returns true if the key is found and the value is not too long and
+ * starts with a decimal digit. Leaves `val` untouched if unsuccessful.
+ */
+bool vpd_get_int(const char *const key, const enum vpd_region region, int *const val)
+{
+ char value[11];
+
+ if (!vpd_gets(key, value, sizeof(value), region))
+ return false;
+
+ if (!isdigit(*value))
+ return false;
+
+ *val = (int)atol(value);
+ return true;
+}
+
ROMSTAGE_CBMEM_INIT_HOOK(cbmem_add_cros_vpd)
diff --git a/src/drivers/vpd/vpd.h b/src/drivers/vpd/vpd.h
index 25e0aed..817867a 100644
--- a/src/drivers/vpd/vpd.h
+++ b/src/drivers/vpd/vpd.h
@@ -50,4 +50,13 @@
bool vpd_get_bool(const char *key, enum vpd_region region,
uint8_t *val);
+/*
+ * Find value of integer type by vpd key.
+ *
+ * Expects to find a decimal string, trailing chars are ignored.
+ * Returns true if the key is found and the value is not too long and
+ * starts with a decimal digit.
+ */
+bool vpd_get_int(const char *key, enum vpd_region region, int *val);
+
#endif /* __VPD_H__ */
--
To view, visit https://review.coreboot.org/c/coreboot/+/45773
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1c1b5710a5236fe4a3bdda1fc978393e636e9817
Gerrit-Change-Number: 45773
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Johnny Lin <Johnny_Lin(a)wiwynn.com>
Gerrit-Reviewer: Marc Jones <marc.jones(a)amd.corp-partner.google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30957
Change subject: superio/ite: Add and use it8528e
......................................................................
superio/ite: Add and use it8528e
* Add SuperIO ITE8528E
* Use ITE8528E to configure serial on wedge100s
TODO: Add support for accessing EC space.
Tested on wedge100s. The serial works without CONFIG_CONSOLE_SERIAL.
Change-Id: I72aa756e123d6f99d9ef4fe955c4b7f1be25d547
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/mainboard/ocp/wedge100s/Kconfig
M src/mainboard/ocp/wedge100s/devicetree.cb
M src/superio/ite/Makefile.inc
A src/superio/ite/it8528e/Kconfig
A src/superio/ite/it8528e/Makefile.inc
A src/superio/ite/it8528e/chip.h
A src/superio/ite/it8528e/it8528e.h
A src/superio/ite/it8528e/superio.c
8 files changed, 226 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/30957/1
diff --git a/src/mainboard/ocp/wedge100s/Kconfig b/src/mainboard/ocp/wedge100s/Kconfig
index ce9c097..6224340 100644
--- a/src/mainboard/ocp/wedge100s/Kconfig
+++ b/src/mainboard/ocp/wedge100s/Kconfig
@@ -16,6 +16,7 @@
select MAINBOARD_HAS_LPC_TPM
select MAINBOARD_HAS_TPM1
select DRIVERS_UART_8250IO
+ select SUPERIO_ITE_IT8528E
config VBOOT
select VBOOT_VBNV_CMOS
diff --git a/src/mainboard/ocp/wedge100s/devicetree.cb b/src/mainboard/ocp/wedge100s/devicetree.cb
index 3d66d0d..fc6dccc 100644
--- a/src/mainboard/ocp/wedge100s/devicetree.cb
+++ b/src/mainboard/ocp/wedge100s/devicetree.cb
@@ -11,6 +11,58 @@
chip drivers/pc80/tpm
device pnp 0c31.0 on end
end
+ chip superio/ite/it8528e
+ # COM1, routed to COM-e header
+ device pnp 6e.1 on
+ io 0x60 = 0x3f8
+ irq 0x70 = 4
+ end
+ # COM2, routed to COM-e header
+ device pnp 6e.2 on
+ io 0x60 = 0x2f8
+ irq 0x70 = 3
+ end
+ device pnp 6e.4 off end
+ device pnp 6e.5 off end
+ device pnp 6e.6 off end
+ device pnp 6e.a off end
+ device pnp 6e.f off end
+ device pnp 6e.10 off
+ io 0x60 = 0x70
+ io 0x62 = 0x72
+ irq 0x70 = 8
+ end
+ device pnp 6e.11 off
+ io 0x60 = 0x620
+ io 0x62 = 0x660
+ irq 0x70 = 1
+ end
+ device pnp 6e.12 off
+ io 0x60 = 0x680
+ io 0x62 = 0x6c0
+ irq 0x70 = 1
+ end
+ device pnp 6e.13 off
+ io 0x60 = 0x300
+ irq 0x70 = 2
+ end
+ device pnp 6e.14 off end
+ device pnp 6e.17 off
+ io 0x60 = 0x6a0
+ io 0x62 = 0x6e0
+ irq 0x70 = 1
+ end
+ device pnp 6e.18 off
+ io 0x60 = 0x740
+ io 0x62 = 0x780
+ irq 0x70 = 1
+ end
+ device pnp 6e.19 off
+ io 0x60 = 0x7a0
+ io 0x62 = 0x7c0
+ irq 0x70 = 1
+ end
+ end #superio/ite/it8528e
end # LPC Bridge
device pci 1f.2 on end # SATA Controller
device pci 1f.3 on end # SMBus Controller
diff --git a/src/superio/ite/Makefile.inc b/src/superio/ite/Makefile.inc
index e73fd71..551abe9 100644
--- a/src/superio/ite/Makefile.inc
+++ b/src/superio/ite/Makefile.inc
@@ -20,6 +20,7 @@
## include generic ite environment controller driver
ramstage-$(CONFIG_SUPERIO_ITE_ENV_CTRL) += common/env_ctrl.c
+subdirs-y += it8528e
subdirs-y += it8623e
subdirs-y += it8671f
subdirs-y += it8712f
diff --git a/src/superio/ite/it8528e/Kconfig b/src/superio/ite/it8528e/Kconfig
new file mode 100644
index 0000000..3815c28
--- /dev/null
+++ b/src/superio/ite/it8528e/Kconfig
@@ -0,0 +1,18 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2019 Patrick Rudolph <patrick.rudolph(a)9elements.com>
+##
+## 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.
+##
+
+config SUPERIO_ITE_IT8528E
+ bool
+ select SUPERIO_ITE_COMMON_PRE_RAM
diff --git a/src/superio/ite/it8528e/Makefile.inc b/src/superio/ite/it8528e/Makefile.inc
new file mode 100644
index 0000000..def04e5
--- /dev/null
+++ b/src/superio/ite/it8528e/Makefile.inc
@@ -0,0 +1,17 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2019 Patrick Rudolph <patrick.rudolph(a)9elements.com>
+##
+## 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; either version 2 of the License, or
+## (at your option) any later version.
+##
+## 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.
+##
+
+ramstage-$(CONFIG_SUPERIO_ITE_IT8528E) += superio.c
diff --git a/src/superio/ite/it8528e/chip.h b/src/superio/ite/it8528e/chip.h
new file mode 100644
index 0000000..ef7e14f
--- /dev/null
+++ b/src/superio/ite/it8528e/chip.h
@@ -0,0 +1,26 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Patrick Rudolph <patrick.rudolph(a)9elements.com>
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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 SUPERIO_ITE_IT8528E_CHIP_H
+#define SUPERIO_ITE_IT8528E_CHIP_H
+
+#include <superio/ite/common/env_ctrl_chip.h>
+
+struct superio_ite_it8528e_config {
+ // FIXME: Add support for EC
+};
+
+#endif /* SUPERIO_ITE_IT8528E_CHIP_H */
diff --git a/src/superio/ite/it8528e/it8528e.h b/src/superio/ite/it8528e/it8528e.h
new file mode 100644
index 0000000..7b19349
--- /dev/null
+++ b/src/superio/ite/it8528e/it8528e.h
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Patrick Rudolph <patrick.rudolph(a)9elements.com>
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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 SUPERIO_ITE_IT8528E_H
+#define SUPERIO_ITE_IT8528E_H
+
+#define IT8528E_SP1 0x01 /* Com1 */
+#define IT8528E_SP2 0x02 /* Com2 */
+#define IT8528E_SWUC 0x04 /* System Wake-Up */
+#define IT8528E_KBCM 0x05 /* PS/2 mouse */
+#define IT8528E_KBCK 0x06 /* PS/2 keyboard */
+#define IT8528E_IR 0x0a /* Consumer IR */
+#define IT8528E_SMFI 0x0f /* Shared Memory/Flash Interface */
+#define IT8528E_RTCT 0x10 /* RTC-like Timer */
+#define IT8528E_PMC1 0x11 /* Power Management Channel 1 */
+#define IT8528E_PMC2 0x12 /* Power Management Channel 2 */
+#define IT8528E_SSPI 0x13 /* Serial Periphial Interface */
+#define IT8528E_PECI 0x14 /* Platform EC Interface */
+#define IT8528E_PMC3 0x17 /* Power Management Channel 3 */
+#define IT8528E_PMC4 0x18 /* Power Management Channel 4 */
+#define IT8528E_PMC5 0x19 /* Power Management Channel 5 */
+
+
+#endif /* SUPERIO_ITE_IT8528E_H */
diff --git a/src/superio/ite/it8528e/superio.c b/src/superio/ite/it8528e/superio.c
new file mode 100644
index 0000000..ae2a8e9
--- /dev/null
+++ b/src/superio/ite/it8528e/superio.c
@@ -0,0 +1,74 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
+ * Copyright (C) 2007 Philipp Degler <pdegler(a)rumms.uni-mannheim.de>
+ * Copyright (C) 2017 Gergely Kiss <mail.gery(a)gmail.com>
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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 <device/device.h>
+#include <device/pnp.h>
+#include <arch/io.h>
+#include <stdlib.h>
+#include <superio/conf_mode.h>
+
+#include "chip.h"
+#include "it8528e.h"
+
+static void it8528e_init(struct device *dev)
+{
+ // FIXME: Init EC
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_alt_enable,
+ .init = it8528e_init,
+ .ops_pnp_mode = &pnp_conf_mode_870155_aa,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { NULL, IT8528E_SP1, PNP_IO0 | PNP_IRQ0, 0x0ff8, },
+ { NULL, IT8528E_SP2, PNP_IO0 | PNP_IRQ0, 0x0ff8, },
+ { NULL, IT8528E_SWUC, PNP_IO0 | PNP_IRQ0, 0xfff0, },
+ { NULL, IT8528E_KBCM, PNP_IRQ0, },
+ /* Documentation: Programm io0 = 0x60 and io1 = 0x64 */
+ { NULL, IT8528E_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff, },
+ { NULL, IT8528E_IR, PNP_IO0 | PNP_IRQ0, 0xfff8, },
+ { NULL, IT8528E_SMFI, PNP_IO0 | PNP_IRQ0, 0xfff0, },
+ /* Documentation: Programm io0 = 0x70 and io1 = 0x272 */
+ { NULL, IT8528E_RTCT, PNP_IO0 | PNP_IO1 | PNP_IO2 | PNP_IO3 | PNP_IRQ0,
+ 0xfffe, 0xfffe, 0xfffe, 0xfffe},
+ /* Documentation: Programm io0 = 0x62 and io1 = 0x66 */
+ { NULL, IT8528E_PMC1, PNP_IO0 | PNP_IO1 | PNP_IRQ0 , 0x07ff, 0x07ff },
+ { NULL, IT8528E_PMC2, PNP_IO0 | PNP_IO1 | PNP_IO2 | PNP_IRQ0 , 0x07fc,
+ 0x07fc, 0xfff0 },
+ /* Documentation is unclear if PMC3-5 have LPC I/O decoding support */
+ { NULL, IT8528E_PMC3, PNP_IO0 | PNP_IO1 | PNP_IRQ0 , 0x07ff, 0x07ff },
+ { NULL, IT8528E_PMC4, PNP_IO0 | PNP_IO1 | PNP_IRQ0 , 0x07ff, 0x07ff },
+ { NULL, IT8528E_PMC5, PNP_IO0 | PNP_IO1 | PNP_IRQ0 , 0x07ff, 0x07ff },
+ { NULL, IT8528E_SSPI, PNP_IO0 | PNP_IRQ0, 0xfff8 },
+ { NULL, IT8528E_PECI, PNP_IO0 , 0xfff8 },
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
+}
+
+struct chip_operations superio_ite_it8528e_ops = {
+ CHIP_NAME("ITE IT8528E Super I/O")
+ .enable_dev = enable_dev,
+};
--
To view, visit https://review.coreboot.org/c/coreboot/+/30957
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I72aa756e123d6f99d9ef4fe955c4b7f1be25d547
Gerrit-Change-Number: 30957
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38002 )
Change subject: drivers/ipmi: Add Supermicro OEM commands
......................................................................
drivers/ipmi: Add Supermicro OEM commands
Add a new driver for OEM commands an select if from x11-lga1151-series.
The driver communicates the BIOS version and date to the BMC using OEM
commands. The command should be supported on all X11 series, but might
work with older BMC, too.
Tested on X11SSH-TF:
The BIOS version strings are updated on boot and are visible in the
BMC web UI.
Change-Id: I51c22f83383affb70abb0efbcdc33ea925b5ff9f
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/drivers/ipmi/Kconfig
M src/drivers/ipmi/Makefile.inc
M src/drivers/ipmi/ipmi_kcs_ops.c
A src/drivers/ipmi/ipmi_supermicro_oem.h
A src/drivers/ipmi/supermicro_oem.c
M src/mainboard/supermicro/x11-lga1151-series/Kconfig
6 files changed, 121 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/38002/1
diff --git a/src/drivers/ipmi/Kconfig b/src/drivers/ipmi/Kconfig
index 0f7152d..e098bc8 100644
--- a/src/drivers/ipmi/Kconfig
+++ b/src/drivers/ipmi/Kconfig
@@ -8,3 +8,14 @@
depends on IPMI_KCS
help
KCS status and command register IO port address spacing
+
+config DRIVER_SUPERMICRO_IPMI_OEM
+ bool "Supermicro IPMI OEM BMC support"
+ depends on IPMI_KCS
+ default n
+ help
+ Tested on X11SSH only. Different BMCs might have different OEM
+ commands.
+ The following features are implemented:
+ * Communicates the BIOS version to the BMC
+ * Communicates the BIOS date to the BMC
diff --git a/src/drivers/ipmi/Makefile.inc b/src/drivers/ipmi/Makefile.inc
index 9d5b3d4..9fccccf 100644
--- a/src/drivers/ipmi/Makefile.inc
+++ b/src/drivers/ipmi/Makefile.inc
@@ -1,3 +1,4 @@
ramstage-$(CONFIG_IPMI_KCS) += ipmi_kcs.c
ramstage-$(CONFIG_IPMI_KCS) += ipmi_kcs_ops.c
ramstage-$(CONFIG_IPMI_KCS) += ipmi_ops.c
+ramstage-$(CONFIG_DRIVER_SUPERMICRO_IPMI_OEM) += supermicro_oem.c
diff --git a/src/drivers/ipmi/ipmi_kcs_ops.c b/src/drivers/ipmi/ipmi_kcs_ops.c
index 5cb8995..ba8487f 100644
--- a/src/drivers/ipmi/ipmi_kcs_ops.c
+++ b/src/drivers/ipmi/ipmi_kcs_ops.c
@@ -34,6 +34,7 @@
#include <delay.h>
#include <timer.h>
#include "ipmi_kcs.h"
+#include "ipmi_supermicro_oem.h"
#include "chip.h"
/* 4 bit encoding */
@@ -170,6 +171,12 @@
/* Don't write tables if communication failed */
dev->enabled = 0;
}
+
+ if (!dev->enabled)
+ return;
+
+ if (CONFIG(DRIVER_SUPERMICRO_IPMI_OEM))
+ supermicro_ipmi_oem(dev->path.pnp.port);
}
#if CONFIG(HAVE_ACPI_TABLES)
diff --git a/src/drivers/ipmi/ipmi_supermicro_oem.h b/src/drivers/ipmi/ipmi_supermicro_oem.h
new file mode 100644
index 0000000..742b97d
--- /dev/null
+++ b/src/drivers/ipmi/ipmi_supermicro_oem.h
@@ -0,0 +1,20 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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 __IPMI_SUPERMICRO_OEM_H
+#define __IPMI_SUPERMICRO_OEM_H
+
+void supermicro_ipmi_oem(const uint16_t kcs_port);
+
+#endif /* __IPMI_SUPERMICRO_OEM_H */
diff --git a/src/drivers/ipmi/supermicro_oem.c b/src/drivers/ipmi/supermicro_oem.c
new file mode 100644
index 0000000..ea01fef
--- /dev/null
+++ b/src/drivers/ipmi/supermicro_oem.c
@@ -0,0 +1,81 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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 <types.h>
+
+#include <console/console.h>
+#include <drivers/ipmi/ipmi_kcs.h>
+#include <string.h>
+#include <build.h>
+#include "ipmi_supermicro_oem.h"
+
+#define IPMI_NETFN_OEM 0x30
+#define IPMI_LUN0_AC_SET_BIOS_VER 0x100
+#define IPMI_LUN0_AC_SET_BIOS_DATE 0x101
+#define IPMI_LUN0_SET_BIOS_STRING 0xac
+
+struct ipmi_oem_set_bios_str {
+ uint16_t ver;
+ char str[16]; // NULL terminated string
+} __packed;
+
+static void set_coreboot_ver(const uint16_t kcs_port)
+{
+ const char *coreboot_ver = COREBOOT_VERSION;
+ struct ipmi_oem_set_bios_str bios_ver;
+ struct ipmi_rsp rsp;
+ int ret;
+ size_t i;
+
+ /* Only 8 charactars are visible in UI. Cut of on first dash */
+ for (i = 0; i < 15; i++) {
+ if (coreboot_ver[i] == '-')
+ break;
+ bios_ver.str[i] = coreboot_ver[i];
+ }
+ bios_ver.str[i] = 0;
+ bios_ver.ver = IPMI_LUN0_AC_SET_BIOS_VER;
+
+ ret = ipmi_kcs_message(kcs_port, IPMI_NETFN_OEM, 0, IPMI_LUN0_SET_BIOS_STRING,
+ (const unsigned char *) &bios_ver, sizeof(bios_ver),
+ (unsigned char *) &rsp, sizeof(rsp));
+ if (ret < sizeof(rsp) || rsp.completion_code) {
+ printk(BIOS_ERR, "BMC_IPMI: %s command failed (ret=%d resp=0x%x)\n",
+ __func__, ret, rsp.completion_code);
+ }
+}
+
+static void set_coreboot_date(const uint16_t kcs_port)
+{
+ struct ipmi_oem_set_bios_str bios_ver;
+ struct ipmi_rsp rsp;
+ int ret;
+
+ strncpy(bios_ver.str, COREBOOT_DMI_DATE, 15);
+ bios_ver.str[15] = 0;
+ bios_ver.ver = IPMI_LUN0_AC_SET_BIOS_DATE;
+
+ ret = ipmi_kcs_message(kcs_port, IPMI_NETFN_OEM, 0, IPMI_LUN0_SET_BIOS_STRING,
+ (const unsigned char *) &bios_ver, sizeof(bios_ver),
+ (unsigned char *) &rsp, sizeof(rsp));
+ if (ret < sizeof(rsp) || rsp.completion_code) {
+ printk(BIOS_ERR, "BMC_IPMI: %s command failed (ret=%d resp=0x%x)\n",
+ __func__, ret, rsp.completion_code);
+ }
+}
+
+void supermicro_ipmi_oem(const uint16_t kcs_port)
+{
+ set_coreboot_ver(kcs_port);
+ set_coreboot_date(kcs_port);
+}
diff --git a/src/mainboard/supermicro/x11-lga1151-series/Kconfig b/src/mainboard/supermicro/x11-lga1151-series/Kconfig
index 5a99f7a..53ae398 100644
--- a/src/mainboard/supermicro/x11-lga1151-series/Kconfig
+++ b/src/mainboard/supermicro/x11-lga1151-series/Kconfig
@@ -12,6 +12,7 @@
select SUPERIO_ASPEED_AST2400
select GENERATE_SMBIOS_TABLES
select IPMI_KCS
+ select DRIVER_SUPERMICRO_IPMI_OEM
select MAINBOARD_NO_FSP_GOP
select SUPERIO_ASPEED_HAS_UART_DELAY_WORKAROUND
select NO_FADT_8042
--
To view, visit https://review.coreboot.org/c/coreboot/+/38002
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I51c22f83383affb70abb0efbcdc33ea925b5ff9f
Gerrit-Change-Number: 38002
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Sam Lewis has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44389 )
Change subject: Documentation: Add Beaglebone Black documentation
......................................................................
Documentation: Add Beaglebone Black documentation
Change-Id: If1a9808d1f20ee61048182d416f25e9a81c631af
Signed-off-by: Sam Lewis <sam.vr.lewis(a)gmail.com>
---
M Documentation/mainboard/index.md
A Documentation/mainboard/ti/beaglebone-black.md
2 files changed, 134 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/44389/1
diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md
index 3a7dd31..19e2d08 100644
--- a/Documentation/mainboard/index.md
+++ b/Documentation/mainboard/index.md
@@ -158,6 +158,10 @@
- [Lemur Pro](system76/lemp9.md)
+## Texas Instruments
+
+- [Beaglebone Black](ti/beaglebone-black.md)
+
## UP
- [Squared](up/squared/index.md)
diff --git a/Documentation/mainboard/ti/beaglebone-black.md b/Documentation/mainboard/ti/beaglebone-black.md
new file mode 100644
index 0000000..d63b6b5
--- /dev/null
+++ b/Documentation/mainboard/ti/beaglebone-black.md
@@ -0,0 +1,130 @@
+# Beaglebone Black
+This page gives some details about the [BeagleBone Black] coreboot port and
+describes how to build and run it.
+
+The port currently only supports booting coreboot from a micro SD card and has
+some other limitations listed below.
+
+## Supported Boards
+The Beaglebone port supports the following boards:
+
+- Beaglebone Black
+- Beaglebone Black Wireless
+- Beaglebone Pocket (untested, may need tweaking)
+- Beaglebone Blue (untested, may need tweaking)
+- Beaglebone Original (untested, may need tweaking)
+
+## Use Cases
+This port was primarily developed as a learning exercise and there is
+potentially little reason to use it compared to the defacto bootloader choice of
+U-Boot. However, it does have some interesting practical use cases compared to
+U-Boot:
+
+1. Choosing coreboot as a lightweight alternative to U-Boot. In this case,
+ coreboot is used to do the absolute minimum necessary to boot Linux, forgoing
+ some U-Boot features and functionality. Complex boot logic can then instead
+ be moved into Linux where it can be more flexibly and safely executed. This
+ is essentially the LinuxBoot philosophy. U-Boot "Falcon mode" has similar
+ goals to this as well.
+2. Facilitating experimenting with coreboot on real hardware. The Beaglebone
+ Black is widely available at a low pricepoint (~$65) making it a great way to
+ experiment with coreboot on real ARMv7 hardware. It also works well as a
+ development platform as it has exposed pads for JTAG and, due to the way it
+ boots, is effectively impossible to brick.
+
+## Quickstart
+1. Run `make menuconfig` and select _TI_/_Beaglebone Black_ in the _Mainboard_
+ menu.
+2. Add a payload as normal.
+3. Run `make`.
+4. Copy the resulting `build/MLO` file to the micro SD card at offset 128k - ie
+ `dd if=build/MLO of=/dev/sdcard seek=1 bs=128k`.
+
+**NOTE**: By default, the Beaglebone is configured to try to boot first from
+eMMC before booting from SD card. To ensure that the Beaglebone boots from SD,
+either erase the internal eMMC or hold the _S2_ button while powering on (note
+that this has to be while powering on - ie when plugging in the USB or DC barrel
+jack - the boot order doesn't change on reset) to prioritize SD in the boot
+order.
+
+## Serial Console
+By default, coreboot uses UART0 as the serial console. UART0 is available
+through the J1 header on both the Beaglebone Black and Beaglebone Black
+Wireless. The serial runs at 3.3V and 115200 8n1.
+
+The pin mapping is shown below for J1.
+
+ ```eval_rst
+ +----------------------------+------------+
+ | Pin number | Function |
+ +============================+============+
+ | 1 (Closest to barrel jack) | GND |
+ +----------------------------+------------+
+ | 4 | RX |
+ +----------------------------+------------+
+ | 5 | TX |
+ +----------------------------+------------+
+ ```
+
+## Boot Process
+The AM335x contains ROM code to allow booting in a number of different
+configurations. More information about the boot ROM code can be found in the
+AM335x technical reference manual (_SPRUH73Q_) in the _Initialization_ section.
+
+This coreboot port is currently configured to boot in "SD Raw Mode" where the
+boot binary, with header ("Table of Contents" in TI's nomenclature), is placed
+at the offset of 0x20000 (128KB) on the SD card. The boot ROM loads the coreboot
+bootblock stage into SRAM and executes it.
+
+The bootblock and subsequent romstage and ramstage coreboot stages expect that
+the coreboot image, containing the CBFS, is located at 0x20000 on the SD card. All
+stages directly read from the SD card in order to load the next stage in
+sequence.
+
+## Clock Initialization and PMIC
+To simplify the port, the TPS65217C Power Management IC (PMIC) on the Beaglebone
+Black is not configured by coreboot. By default, the PMIC reset values for
+VDD_MPU (1.1V) and VDD_CORE (1.8V) are within the Operating Performance Point
+(OPP) for the MPU PLL configuration set by the boot ROM of 500 MHz.
+
+When using Linux as a payload, the kernel will appropriately scale the core
+voltages for the desired MPU clock frequency as defined in the device tree.
+
+One significant difference because of this to the U-Boot port is that the DCDC1
+rail that powers the DDR3 RAM will be 1.5V by default. The Micron DDR3 supports
+both 1.35V and 1.5V and U-Boot makes use of this by setting it to 1.35V to
+conserve power. Fortunately, Linux is again able to configure this rail but it
+involves adding an entry to the device tree:
+
+```
+&dcdc1_reg {
+ regulator-name = "vdd_ddr3";
+ regulator-min-microvolt = <1350000>;
+ regulator-max-microvolt = <1350000>;
+ regulator-boot-on;
+ regulator-always-on;
+};
+```
+
+If this port was to be extended to work with boards or SoCs with different
+requirements for the MPU clock frequency or different Operating Performance
+Points, then the port may need to be extended to set the core voltages and MPU
+PLL within coreboot, prior to loading a payload. Extending coreboot so that it
+can configure the PMIC would also be necessary if there was a requirement for
+coreboot to run at a different MPU frequency than the 500 MHz set by the boot
+ROM.
+
+# Todo
+- Allow coreboot to run from the Beaglebone Black's internal eMMC. This would
+ require updating the mmc.c driver to support running from both SD and eMMC.
+- Support the boot ROMs "FAT mode" so that the coreboot binary can be placed on
+ a FAT partition.
+- Increase the MMC read speed, it currently takes ~15s to read ~20MB which is a
+ bit slow. To do this, it should be possible to update the MMC driver to:
+ - Increase the supported blocksize (currently is always set to 1)
+ - Support 4-bit data width (currently only supports 1-bit data width)
+- Convert the while loops in the MMC driver to timeout so that coreboot does not
+ hang on a bad SD card or when the SD card is removed during boot.
+
+
+[Beaglebone Black]: https://beagleboard.org/black
\ No newline at end of file
--
To view, visit https://review.coreboot.org/c/coreboot/+/44389
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If1a9808d1f20ee61048182d416f25e9a81c631af
Gerrit-Change-Number: 44389
Gerrit-PatchSet: 1
Gerrit-Owner: Sam Lewis <sam.vr.lewis(a)gmail.com>
Gerrit-MessageType: newchange