Jonathan Zhang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47055 )
Change subject: [RFC]mb/ocp/deltalake: append Linuxboot command line option
......................................................................
[RFC]mb/ocp/deltalake: append Linuxboot command line option
If Linuxboot is used as payload, and if corresponding VPD variable
is set, use the value to append Linuxboot command line option as
defined at build time.
With this, user can customize linuxboot boot behavior without needing
a different image. For example, user can increase log level.
Note that this code should not be in mainboard, I hope to get
community feedback on where it should be.
TESTED=tested on DeltaLake, with this VPD setting:
vpd -f build/coreboot.rom -i RW_VPD -s linux_command_line="loglevel=7 cpuidle.off=1"
Signed-off-by: Jonathan Zhang <jonzhang(a)fb.com>
Signed-off-by: Bryant Ou <Bryant.Ou.Q(a)gmail.com>
Change-Id: I5f5cde3957c2716864f55d70f18f47b493164ed8
---
M src/mainboard/ocp/deltalake/ramstage.c
M src/mainboard/ocp/deltalake/vpd.h
2 files changed, 49 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/47055/1
diff --git a/src/mainboard/ocp/deltalake/ramstage.c b/src/mainboard/ocp/deltalake/ramstage.c
index 9d57090..800ad5a 100644
--- a/src/mainboard/ocp/deltalake/ramstage.c
+++ b/src/mainboard/ocp/deltalake/ramstage.c
@@ -5,11 +5,13 @@
#include <bootstate.h>
#include <drivers/ipmi/ipmi_ops.h>
#include <drivers/ocp/dmi/ocp_dmi.h>
+#include <drivers/vpd/vpd.h>
#include <gpio.h>
#include <soc/lewisburg_pch_gpio_defs.h>
#include <soc/ramstage.h>
#include <soc/soc_util.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <smbios.h>
#include <device/pci_def.h>
@@ -18,10 +20,15 @@
#include <hob_iiouds.h>
#include <hob_memmap.h>
#include <cpxsp_dl_gpio.h>
+#include <program_loading.h>
#include "ipmi.h"
+#include "vpd.h"
#define SLOT_ID_LEN 2
+/* copied from util/cbfstool/linux_trampoline.h */
+#define COMMAND_LINE_LOC 0x91000
+#define LINUX_CMD_LEN 72
extern struct fru_info_str fru_strings;
static char slot_id_str[SLOT_ID_LEN];
@@ -307,3 +314,42 @@
}
BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, pull_post_complete_pin, NULL);
+
+#if CONFIG_PAYLOAD_LINUX
+/*
+ * If Linuxboot is the payload, and if LINUX_COMMAND_LINE is defined as VPD
+ * variable, use the value to append original Linux command line option as
+ * defined at build time
+ */
+void platform_segment_loaded(uintptr_t start, size_t size, int flags)
+{
+ if (start != COMMAND_LINE_LOC)
+ return;
+
+ char cmdline[LINUX_CMD_LEN] = "";
+ if (!vpd_gets(LINUX_COMMAND_LINE, cmdline, LINUX_CMD_LEN, VPD_RW_THEN_RO))
+ return;
+
+ char *orig_cmdline = strdup((char *)start);
+ char *new_cmdline = NULL;
+ size_t new_cmdline_len;
+ printk(BIOS_INFO, "Build time defined Linux command line: %s\n",
+ orig_cmdline);
+ printk(BIOS_INFO, "VPD defined Linux command line: %s\n", cmdline);
+
+ new_cmdline = strconcat(orig_cmdline, " ");
+ new_cmdline = strconcat(new_cmdline, cmdline);
+ new_cmdline_len = strlen(new_cmdline);
+ printk(BIOS_INFO, "Updated Linux command line: %s, len: %ld\n", new_cmdline, new_cmdline_len);
+ if (new_cmdline_len >= size) {
+ printk(BIOS_ERR, "Updated Linux command line has size %ld bigger than %ld.\n",
+ new_cmdline_len, size);
+ free(new_cmdline);
+ return;
+ }
+
+ memset((uint8_t *)start, 0, size);
+ memcpy((uint8_t *)start, new_cmdline, strlen(new_cmdline));
+ free(new_cmdline);
+}
+#endif
diff --git a/src/mainboard/ocp/deltalake/vpd.h b/src/mainboard/ocp/deltalake/vpd.h
index 43070c2..cb9588b 100644
--- a/src/mainboard/ocp/deltalake/vpd.h
+++ b/src/mainboard/ocp/deltalake/vpd.h
@@ -36,4 +36,7 @@
#define COREBOOT_LOG_LEVEL "coreboot_log_level"
#define COREBOOT_LOG_LEVEL_DEFAULT 4
+/* Linuxboot kernel command line */
+#define LINUX_COMMAND_LINE "linux_command_line"
+
#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/47055
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5f5cde3957c2716864f55d70f18f47b493164ed8
Gerrit-Change-Number: 47055
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Zhang <jonzhang(a)fb.com>
Gerrit-MessageType: newchange
Stefan Reinauer has uploaded this change for review. ( https://review.coreboot.org/c/em100/+/46927 )
Change subject: Add install and uninstall targets to Makefile
......................................................................
Add install and uninstall targets to Makefile
- Will install em100 to /usr/local/bin
- Will install udev rule to /etc/udev/rules.d
Assumes that there is a plugdev group
(some systems may not have it)
Signed-off-by: Alexander Amelkin <a.amelkin(a)yadro.com>
Change-Id: Ibfcd6f9f2f577b1f7d8d2d4b0a89405d38264d3d
---
M Makefile
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/27/46927/1
diff --git a/Makefile b/Makefile
index a5b8c33..14c928e 100644
--- a/Makefile
+++ b/Makefile
@@ -71,6 +71,14 @@
distclean: clean
rm -f em100pro_chips.h
+install: em100 60-dediprog-em100pro.rules
+ install -m 644 60-dediprog-em100pro.rules /etc/udev/rules.d/
+ install -s -m 750 -g plugdev em100 /usr/local/bin/
+
+uninstall: /usr/local/bin/em100
+ rm -f /etc/udev/rules.d/60-dediprog-em100pro.rules
+ rm -f /usr/local/bin/em100
+
-include .dependencies
.PHONY: clean distclean tarballs
--
To view, visit https://review.coreboot.org/c/em100/+/46927
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: em100
Gerrit-Branch: master
Gerrit-Change-Id: Ibfcd6f9f2f577b1f7d8d2d4b0a89405d38264d3d
Gerrit-Change-Number: 46927
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange