coreboot-gerrit
Threads by month
- ----- 2025 -----
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
April 2020
- 1 participants
- 2501 discussions

Change in coreboot[master]: nb/amd/agesa: select ROMSTAGE_CACHED_CBMEM
by Arthur Heymans (Code Review) Feb. 20, 2024
by Arthur Heymans (Code Review) Feb. 20, 2024
Feb. 20, 2024
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37198 )
Change subject: nb/amd/agesa: select ROMSTAGE_CACHED_CBMEM
......................................................................
nb/amd/agesa: select ROMSTAGE_CACHED_CBMEM
AGESA sets up MTRR's to cache the whole dram, so decompressing
postcar stage to cbmem should be fast and is now selected by
default.
Change-Id: I62ffe1bd646e9ddad77be240f030601790f4da4b
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/northbridge/amd/agesa/family14/Kconfig
M src/northbridge/amd/agesa/family15tn/Kconfig
M src/northbridge/amd/agesa/family16kb/Kconfig
3 files changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/98/37198/1
diff --git a/src/northbridge/amd/agesa/family14/Kconfig b/src/northbridge/amd/agesa/family14/Kconfig
index 173714f..cfafb23 100644
--- a/src/northbridge/amd/agesa/family14/Kconfig
+++ b/src/northbridge/amd/agesa/family14/Kconfig
@@ -14,6 +14,7 @@
##
config NORTHBRIDGE_AMD_AGESA_FAMILY14
bool
+ select ROMSTAGE_CACHED_CBMEM
if NORTHBRIDGE_AMD_AGESA_FAMILY14
diff --git a/src/northbridge/amd/agesa/family15tn/Kconfig b/src/northbridge/amd/agesa/family15tn/Kconfig
index a0841eb..e6a469f 100644
--- a/src/northbridge/amd/agesa/family15tn/Kconfig
+++ b/src/northbridge/amd/agesa/family15tn/Kconfig
@@ -14,6 +14,7 @@
##
config NORTHBRIDGE_AMD_AGESA_FAMILY15_TN
bool
+ select ROMSTAGE_CACHED_CBMEM
if NORTHBRIDGE_AMD_AGESA_FAMILY15_TN
diff --git a/src/northbridge/amd/agesa/family16kb/Kconfig b/src/northbridge/amd/agesa/family16kb/Kconfig
index 2be2fd3..e34ef60 100644
--- a/src/northbridge/amd/agesa/family16kb/Kconfig
+++ b/src/northbridge/amd/agesa/family16kb/Kconfig
@@ -15,6 +15,7 @@
##
config NORTHBRIDGE_AMD_AGESA_FAMILY16_KB
bool
+ select ROMSTAGE_CACHED_CBMEM
if NORTHBRIDGE_AMD_AGESA_FAMILY16_KB
--
To view, visit https://review.coreboot.org/c/coreboot/+/37198
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I62ffe1bd646e9ddad77be240f030601790f4da4b
Gerrit-Change-Number: 37198
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
6
28

Change in coreboot[master]: boot_device: Add boot_device_lockdown
by Patrick Rudolph (Code Review) Sept. 28, 2023
by Patrick Rudolph (Code Review) Sept. 28, 2023
Sept. 28, 2023
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39925 )
Change subject: boot_device: Add boot_device_lockdown
......................................................................
boot_device: Add boot_device_lockdown
Add a new method to lock the SPI protected range registers.
This allows to lock the SPI controller early, which can be used to
write-protect the WP_RO region in bootblock before handing of control
to the later stages not protected by WP_RO.
In conjunction with VBOOT and BOOTMEDIA_LOCK_CONTROLLER_RO_VBOOT_RO this
enables a secure boot mechanism on non CHROMEOS enabled devices.
Change-Id: I9d3a80a2e278c77212e1fba5236ea639ea018837
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/drivers/spi/boot_device_rw_nommap.c
M src/drivers/spi/spi_flash.c
M src/include/boot_device.h
M src/include/spi-generic.h
M src/include/spi_flash.h
M src/lib/boot_device.c
M src/security/lockdown/lockdown.c
M src/soc/intel/common/block/fast_spi/fast_spi_flash.c
M src/soc/intel/common/pch/lockdown/lockdown.c
M src/southbridge/intel/bd82x6x/lpc.c
M src/southbridge/intel/common/finalize.c
M src/southbridge/intel/common/spi.c
M src/southbridge/intel/ibexpeak/lpc.c
M src/southbridge/intel/lynxpoint/lpc.c
14 files changed, 82 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/39925/1
diff --git a/src/drivers/spi/boot_device_rw_nommap.c b/src/drivers/spi/boot_device_rw_nommap.c
index 5de9a71..be90318 100644
--- a/src/drivers/spi/boot_device_rw_nommap.c
+++ b/src/drivers/spi/boot_device_rw_nommap.c
@@ -133,3 +133,12 @@
return spi_flash_ctrlr_protect_region(boot_dev,
region_device_region(rd), ctrlr_pr);
}
+
+int boot_device_lockdown(void)
+{
+ const struct spi_flash *boot_dev = boot_device_spi_flash();
+ if (boot_dev == NULL)
+ return -1;
+
+ return spi_flash_ctrlr_lockdown(boot_dev);
+}
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c
index 5149829..6fdda2c 100644
--- a/src/drivers/spi/spi_flash.c
+++ b/src/drivers/spi/spi_flash.c
@@ -707,6 +707,17 @@
return -1;
}
+int spi_flash_ctrlr_lockdown(const struct spi_flash *flash)
+{
+ if (!flash || !flash->spi.ctrlr)
+ return -1;
+
+ if (flash->spi.ctrlr->lockdown)
+ return flash->spi.ctrlr->lockdown(flash);
+
+ return -1;
+}
+
int spi_flash_vector_helper(const struct spi_slave *slave,
struct spi_op vectors[], size_t count,
int (*func)(const struct spi_slave *slave, const void *dout,
diff --git a/src/include/boot_device.h b/src/include/boot_device.h
index a31fdff..d813f16 100644
--- a/src/include/boot_device.h
+++ b/src/include/boot_device.h
@@ -68,6 +68,11 @@
const enum bootdev_prot_type type);
/*
+ * Lock the controller after all WP regions have been set.
+ */
+int boot_device_lockdown(void);
+
+/*
* Initialize the boot device. This may be called multiple times within
* a stage so boot device implementations should account for this behavior.
**/
diff --git a/src/include/spi-generic.h b/src/include/spi-generic.h
index 3022886..7c2a9d8 100644
--- a/src/include/spi-generic.h
+++ b/src/include/spi-generic.h
@@ -156,6 +156,8 @@
* flash_probe: Specialized probe function provided by SPI flash
* controllers.
* flash_protect: Protect a region of flash using the SPI flash controller.
+ * lockdown: Enable protected regions. flash_protect will return an error after
+ * calling this function.
*/
struct spi_ctrlr {
int (*claim_bus)(const struct spi_slave *slave);
@@ -174,6 +176,7 @@
int (*flash_protect)(const struct spi_flash *flash,
const struct region *region,
const enum ctrlr_prot_type type);
+ int (*lockdown)(const struct spi_flash *flash);
};
/*-----------------------------------------------------------------------
diff --git a/src/include/spi_flash.h b/src/include/spi_flash.h
index c74ceae..9c1a5f7 100644
--- a/src/include/spi_flash.h
+++ b/src/include/spi_flash.h
@@ -227,6 +227,12 @@
const enum ctrlr_prot_type type);
/*
+ * Lock down the SPI controller.
+ * Modifying protected protected regions will become impossible.
+ */
+int spi_flash_ctrlr_lockdown(const struct spi_flash *flash);
+
+/*
* This function is provided to support spi flash command-response transactions.
* Only 2 vectors are supported and the 'func' is called with appropriate
* write and read buffers together. This can be used for chipsets that
diff --git a/src/lib/boot_device.c b/src/lib/boot_device.c
index dfb4066..81b1825 100644
--- a/src/lib/boot_device.c
+++ b/src/lib/boot_device.c
@@ -26,6 +26,12 @@
return -1;
}
+int __weak boot_device_lockdown(void)
+{
+ /* return a failure, make aware lockdown is not implemented */
+ return -1;
+}
+
static int boot_device_subregion(const struct region *sub,
struct region_device *subrd,
const struct region_device *parent)
diff --git a/src/security/lockdown/lockdown.c b/src/security/lockdown/lockdown.c
index 3bbf75f..0396ee7 100644
--- a/src/security/lockdown/lockdown.c
+++ b/src/security/lockdown/lockdown.c
@@ -46,6 +46,11 @@
printk(BIOS_INFO, "BM-LOCKDOWN: Enabled bootmedia protection\n");
else
printk(BIOS_ERR, "BM-LOCKDOWN: Failed to enable bootmedia protection\n");
+
+ if (CONFIG(BOOTMEDIA_LOCK_CONTROLLER_RO_VBOOT_RO)) {
+ printk(BIOS_INFO, "BM-LOCKDOWN: Locking down controller\n");
+ boot_device_lockdown();
+ }
}
#if ENV_RAMSTAGE
diff --git a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
index a8afd48..4428740 100644
--- a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
+++ b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
@@ -422,9 +422,16 @@
return 0;
}
+static int fast_spi_flash_lockdown(const struct spi_flash *flash)
+{
+ fast_spi_pr_dlock();
+ return 0;
+}
+
const struct spi_ctrlr fast_spi_flash_ctrlr = {
.setup = fast_spi_flash_ctrlr_setup,
.max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE,
.flash_probe = fast_spi_flash_probe,
.flash_protect = fast_spi_flash_protect,
+ .lockdown = fast_spi_flash_lockdown,
};
diff --git a/src/soc/intel/common/pch/lockdown/lockdown.c b/src/soc/intel/common/pch/lockdown/lockdown.c
index 036cccc..de45643 100644
--- a/src/soc/intel/common/pch/lockdown/lockdown.c
+++ b/src/soc/intel/common/pch/lockdown/lockdown.c
@@ -20,6 +20,7 @@
#include <soc/pci_devs.h>
#include <soc/pcr_ids.h>
#include <soc/soc_chip.h>
+#include <boot_device.h>
#define PCR_DMI_GCS 0x274C
#define PCR_DMI_GCS_BILD (1 << 0)
@@ -63,7 +64,7 @@
fast_spi_set_opcode_menu();
/* Discrete Lock Flash PR registers */
- fast_spi_pr_dlock();
+ boot_device_lockdown();
/* Lock FAST_SPIBAR */
fast_spi_lock_bar();
diff --git a/src/southbridge/intel/bd82x6x/lpc.c b/src/southbridge/intel/bd82x6x/lpc.c
index 46ab5fc..ae0b70f 100644
--- a/src/southbridge/intel/bd82x6x/lpc.c
+++ b/src/southbridge/intel/bd82x6x/lpc.c
@@ -38,6 +38,7 @@
#include <southbridge/intel/common/pmutil.h>
#include <southbridge/intel/common/rtc.h>
#include <southbridge/intel/common/spi.h>
+#include <boot_device.h>
#define NMI_OFF 0
@@ -849,12 +850,14 @@
{
spi_finalize_ops();
+ /* Lock SPIBAR */
+ if (CONFIG(INTEL_CHIPSET_LOCKDOWN) || acpi_is_wakeup_s3())
+ boot_device_lockdown();
+
/* Call SMM finalize() handlers before resume */
if (CONFIG(HAVE_SMI_HANDLER)) {
- if (CONFIG(INTEL_CHIPSET_LOCKDOWN) ||
- acpi_is_wakeup_s3()) {
+ if (CONFIG(INTEL_CHIPSET_LOCKDOWN) || acpi_is_wakeup_s3())
outb(APM_CNT_FINALIZE, APM_CNT);
- }
}
}
diff --git a/src/southbridge/intel/common/finalize.c b/src/southbridge/intel/common/finalize.c
index 2d4d4a3..e5aa983 100644
--- a/src/southbridge/intel/common/finalize.c
+++ b/src/southbridge/intel/common/finalize.c
@@ -27,9 +27,6 @@
{
const pci_devfn_t lpc_dev = PCI_DEV(0, 0x1f, 0);
- /* Lock SPIBAR */
- RCBA32_OR(0x3804, (1 << 15));
-
if (CONFIG(SPI_FLASH_SMM))
/* Re-init SPI driver to handle locked BAR */
spi_init();
diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c
index 5e967af..ffa283b 100644
--- a/src/southbridge/intel/common/spi.c
+++ b/src/southbridge/intel/common/spi.c
@@ -1110,6 +1110,16 @@
writew_(optype, cntlr.optype);
}
+static int spi_flash_lockdown(const struct spi_flash *flash)
+{
+ if (CONFIG(SOUTHBRIDGE_INTEL_I82801GX)) {
+ writew_(readw_(&cntlr.ich7_spi->spis) | HSFS_FLOCKDN, &cntlr.ich7_spi->spis);
+ } else {
+ writew_(readw_(&cntlr.ich9_spi->spis) | HSFS_FLOCKDN, &cntlr.ich9_spi->spis);
+ }
+ return 0;
+}
+
__weak void intel_southbridge_override_spi(struct intel_swseq_spi_config *spi_config)
{
}
@@ -1119,7 +1129,7 @@
.max_xfer_size = member_size(struct ich9_spi_regs, fdata),
.flash_probe = spi_flash_programmer_probe,
.flash_protect = spi_flash_protect,
-};
+ .lockdown = spi_flash_lockdown,
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
{
diff --git a/src/southbridge/intel/ibexpeak/lpc.c b/src/southbridge/intel/ibexpeak/lpc.c
index 0062e09..c1e7904 100644
--- a/src/southbridge/intel/ibexpeak/lpc.c
+++ b/src/southbridge/intel/ibexpeak/lpc.c
@@ -38,6 +38,7 @@
#include <southbridge/intel/common/pciehp.h>
#include <southbridge/intel/common/acpi_pirq_gen.h>
#include <southbridge/intel/common/spi.h>
+#include <boot_device.h>
#define NMI_OFF 0
@@ -748,12 +749,14 @@
{
spi_finalize_ops();
+ /* Lock SPIBAR */
+ if (CONFIG(INTEL_CHIPSET_LOCKDOWN) || acpi_is_wakeup_s3())
+ boot_device_lockdown();
+
/* Call SMM finalize() handlers before resume */
if (CONFIG(HAVE_SMI_HANDLER)) {
- if (CONFIG(INTEL_CHIPSET_LOCKDOWN) ||
- acpi_is_wakeup_s3()) {
+ if (CONFIG(INTEL_CHIPSET_LOCKDOWN) || acpi_is_wakeup_s3())
outb(APM_CNT_FINALIZE, APM_CNT);
- }
}
}
diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c
index 745c231..e4ab43d 100644
--- a/src/southbridge/intel/lynxpoint/lpc.c
+++ b/src/southbridge/intel/lynxpoint/lpc.c
@@ -35,6 +35,7 @@
#include <southbridge/intel/common/acpi_pirq_gen.h>
#include <southbridge/intel/common/rtc.h>
#include <southbridge/intel/common/spi.h>
+#include <boot_device.h>
#define NMI_OFF 0
@@ -951,6 +952,10 @@
{
spi_finalize_ops();
+ /* Lock SPIBAR */
+ if (CONFIG(INTEL_CHIPSET_LOCKDOWN) || acpi_is_wakeup_s3())
+ boot_device_lockdown();
+
if (acpi_is_wakeup_s3() || CONFIG(INTEL_CHIPSET_LOCKDOWN))
outb(APM_CNT_FINALIZE, APM_CNT);
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/39925
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I9d3a80a2e278c77212e1fba5236ea639ea018837
Gerrit-Change-Number: 39925
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
5
9

Change in coreboot[master]: util: cbfstool: Add new flag 'ALIGNED' for checking alignment at buil...
by Hung-Te Lin (Code Review) Sept. 27, 2023
by Hung-Te Lin (Code Review) Sept. 27, 2023
Sept. 27, 2023
Hung-Te Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37262 )
Change subject: util: cbfstool: Add new flag 'ALIGNED' for checking alignment at build time
......................................................................
util: cbfstool: Add new flag 'ALIGNED' for checking alignment at build time
Some FMAP sections (for example MRC_VAR_CACHE, RW_DDR_TRAINING, ...) are
accessed directly by raw block I/O and must be aligned at SPI flash
erase block size (see spi_flash.c#spi_flash_erase_cmd, error "SF: Erase
offset/length not multiple of erase size").
If we don't add explicit offset to these sections in FMD files, changing
size of other sections may unexpectedly causing them to be unaligned.
This patch adds a new flag "ALIGNED" so we can declare a FMAP section as
RW_DDR_TRAINING(ALIGNED) 8k
to ensure an 8k section that its offset and size will be both aligned
at 4k.
Note: in current implementation the alignment is fixed at 4k, which is
supported on almost all SPI chipsets today.
TEST=Change bootblock from default.fmd to BOOTBLOCK(ALIGNED) 127k and build,
seeing error message:
"E: Section 'BOOTBLOCK'@0[0x1fc00] must be aligned to 0x1000"
Change-Id: I26b394590c28667a4afcd521c7caa2009b5b98a9
Signed-off-by: Hung-Te Lin <hungte(a)chromium.org>
---
M util/cbfstool/fmap_from_fmd.c
M util/cbfstool/fmd.h
M util/cbfstool/fmd_parser.c_shipped
M util/cbfstool/fmd_parser.h_shipped
M util/cbfstool/fmd_parser.y
M util/cbfstool/fmd_scanner.c_shipped
M util/cbfstool/fmd_scanner.h_shipped
M util/cbfstool/fmd_scanner.l
8 files changed, 629 insertions(+), 440 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/37262/1
diff --git a/util/cbfstool/fmap_from_fmd.c b/util/cbfstool/fmap_from_fmd.c
index 374667a..f822f7b 100644
--- a/util/cbfstool/fmap_from_fmd.c
+++ b/util/cbfstool/fmap_from_fmd.c
@@ -35,6 +35,18 @@
if (section->flags.f.preserve)
flags |= FMAP_AREA_PRESERVE;
+ if (section->flags.f.aligned) {
+ /* Currently the alignment is fixed at 4K. */
+ const int alignment = 0x1000;
+ if (absolute_watermark % alignment ||
+ section->size % alignment) {
+ ERROR("Section '%s'@%#x[%#x] must be aligned to %#x\n",
+ section->name,absolute_watermark, section->size,
+ alignment);
+ return false;
+ }
+ }
+
if (fmap_append_area(flashmap, absolute_watermark, section->size,
(uint8_t *)section->name, flags) < 0) {
ERROR("Failed to insert section '%s' into FMAP\n",
diff --git a/util/cbfstool/fmd.h b/util/cbfstool/fmd.h
index 90e6d6e..1eb3a22 100644
--- a/util/cbfstool/fmd.h
+++ b/util/cbfstool/fmd.h
@@ -33,6 +33,7 @@
struct {
int cbfs: 1; /* The section contains a CBFS area. */
int preserve: 1; /* Preserve the section before update. */
+ int aligned:1; /* The section must be aligned for block I/O. */
} f;
int v;
};
diff --git a/util/cbfstool/fmd_parser.c_shipped b/util/cbfstool/fmd_parser.c_shipped
index 2597fc6..7a5f34c 100644
--- a/util/cbfstool/fmd_parser.c_shipped
+++ b/util/cbfstool/fmd_parser.c_shipped
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4. */
+/* A Bison parser, made by GNU Bison 3.4.1. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+ 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
@@ -40,11 +41,14 @@
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
+/* Undocumented macros, especially those whose name start with YY_,
+ are private implementation details. Do not rely on them. */
+
/* Identify Bison output. */
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.4"
+#define YYBISON_VERSION "3.4.1"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -61,8 +65,8 @@
-/* Copy the first part of user declarations. */
-#line 16 "fmd_parser.y" /* yacc.c:339 */
+/* First part of user prologue. */
+#line 16 "fmd_parser.y"
#include "fmd_scanner.h"
#include "common.h"
@@ -71,13 +75,17 @@
struct flashmap_descriptor *res = NULL;
-#line 75 "y.tab.c" /* yacc.c:339 */
+#line 79 "fmd_parser.tab.c"
# ifndef YY_NULLPTR
-# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
+# if defined __cplusplus
+# if 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
# else
-# define YY_NULLPTR 0
+# define YY_NULLPTR ((void*)0)
# endif
# endif
@@ -89,10 +97,10 @@
# define YYERROR_VERBOSE 0
#endif
-/* In a future release of Bison, this section will be replaced
- by #include "y.tab.h". */
-#ifndef YY_YY_Y_TAB_H_INCLUDED
-# define YY_YY_Y_TAB_H_INCLUDED
+/* Use api.header.include to #include this header
+ instead of duplicating it here. */
+#ifndef YY_YY_FMD_PARSER_TAB_H_INCLUDED
+# define YY_YY_FMD_PARSER_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -101,7 +109,7 @@
extern int yydebug;
#endif
/* "%code requires" blocks. */
-#line 34 "fmd_parser.y" /* yacc.c:355 */
+#line 34 "fmd_parser.y"
#include "fmd.h"
#include "option.h"
@@ -126,7 +134,7 @@
struct unsigned_option size, struct descriptor_list children);
void yyerror(const char *s);
-#line 130 "y.tab.c" /* yacc.c:355 */
+#line 138 "fmd_parser.tab.c"
/* Token type. */
#ifndef YYTOKENTYPE
@@ -137,22 +145,16 @@
OCTAL = 259,
STRING = 260,
FLAG_CBFS = 261,
- FLAG_PRESERVE = 262
+ FLAG_PRESERVE = 262,
+ FLAG_ALIGNED = 263
};
#endif
-/* Tokens. */
-#define INTEGER 258
-#define OCTAL 259
-#define STRING 260
-#define FLAG_CBFS 261
-#define FLAG_PRESERVE 262
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
union YYSTYPE
{
-#line 25 "fmd_parser.y" /* yacc.c:355 */
+#line 25 "fmd_parser.y"
unsigned intval;
char *strval;
@@ -161,9 +163,9 @@
union flashmap_flags flags;
struct descriptor_list region_listhdr;
-#line 165 "y.tab.c" /* yacc.c:355 */
-};
+#line 167 "fmd_parser.tab.c"
+};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
@@ -174,11 +176,9 @@
int yyparse (void);
-#endif /* !YY_YY_Y_TAB_H_INCLUDED */
+#endif /* !YY_YY_FMD_PARSER_TAB_H_INCLUDED */
-/* Copy the second part of user declarations. */
-#line 182 "y.tab.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -199,13 +199,13 @@
#ifdef YYTYPE_UINT16
typedef YYTYPE_UINT16 yytype_uint16;
#else
-typedef unsigned short int yytype_uint16;
+typedef unsigned short yytype_uint16;
#endif
#ifdef YYTYPE_INT16
typedef YYTYPE_INT16 yytype_int16;
#else
-typedef short int yytype_int16;
+typedef short yytype_int16;
#endif
#ifndef YYSIZE_T
@@ -217,7 +217,7 @@
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
-# define YYSIZE_T unsigned int
+# define YYSIZE_T unsigned
# endif
#endif
@@ -253,15 +253,6 @@
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
#endif
-#if !defined _Noreturn \
- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-# define _Noreturn __declspec (noreturn)
-# else
-# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
-# endif
-#endif
-
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E))
@@ -269,7 +260,7 @@
# define YYUSE(E) /* empty */
#endif
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
@@ -289,6 +280,8 @@
#endif
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -420,42 +413,42 @@
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 4
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 23
+#define YYLAST 24
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 13
+#define YYNTOKENS 14
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 14
/* YYNRULES -- Number of rules. */
-#define YYNRULES 21
+#define YYNRULES 22
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 31
+#define YYNSTATES 32
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
- by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 262
+#define YYMAXUTOK 263
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, with out-of-bounds checking. */
#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+ ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex, without out-of-bounds checking. */
+ as returned by yylex. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 8, 9, 2, 2, 2, 2, 2, 2, 2, 2,
+ 9, 10, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 10, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 11, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 11, 2, 12, 2, 2, 2, 2,
+ 2, 2, 2, 12, 2, 13, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -469,16 +462,16 @@
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
- 5, 6, 7
+ 5, 6, 7, 8
};
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
- 0, 80, 80, 86, 100, 107, 108, 109, 109, 110,
- 111, 112, 113, 114, 115, 116, 117, 119, 123, 124,
- 125, 136
+ 0, 81, 81, 87, 101, 108, 109, 110, 110, 111,
+ 112, 113, 114, 115, 116, 117, 118, 119, 121, 125,
+ 126, 127, 138
};
#endif
@@ -488,8 +481,8 @@
static const char *const yytname[] =
{
"$end", "error", "$undefined", "INTEGER", "OCTAL", "STRING",
- "FLAG_CBFS", "FLAG_PRESERVE", "'('", "')'", "'@'", "'{'", "'}'",
- "$accept", "flash_chip", "flash_region", "region_name",
+ "FLAG_CBFS", "FLAG_PRESERVE", "FLAG_ALIGNED", "'('", "')'", "'@'", "'{'",
+ "'}'", "$accept", "flash_chip", "flash_region", "region_name",
"region_flags_opt", "region_flags", "region_flag", "region_offset_opt",
"region_offset", "region_size_opt", "region_size", "region_list_opt",
"region_list", "region_list_entries", YY_NULLPTR
@@ -501,15 +494,15 @@
(internal) symbol number NUM (which must be that of a token). */
static const yytype_uint16 yytoknum[] =
{
- 0, 256, 257, 258, 259, 260, 261, 262, 40, 41,
- 64, 123, 125
+ 0, 256, 257, 258, 259, 260, 261, 262, 263, 40,
+ 41, 64, 123, 125
};
# endif
-#define YYPACT_NINF -12
+#define YYPACT_NINF -13
#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-12)))
+ (!!((Yystate) == (-13)))
#define YYTABLE_NINF -1
@@ -520,10 +513,10 @@
STATE-NUM. */
static const yytype_int8 yypact[] =
{
- -1, -12, 1, -2, -12, 2, 3, -12, -12, -12,
- 0, -1, -12, -12, 4, -5, -4, -2, -12, -12,
- -12, -12, 5, -4, 3, -12, -12, 0, -12, -12,
- -12
+ 0, -13, 1, -2, -13, 3, 4, -13, -13, -13,
+ -1, 0, -13, -13, 5, -5, -4, -2, -13, -13,
+ -13, -13, -13, 2, -4, 4, -13, -13, -1, -13,
+ -13, -13
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -531,24 +524,24 @@
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 0, 4, 0, 11, 1, 0, 0, 12, 13, 16,
- 0, 0, 2, 20, 5, 0, 0, 11, 19, 21,
- 9, 10, 0, 7, 14, 6, 8, 17, 15, 3,
- 18
+ 0, 4, 0, 12, 1, 0, 0, 13, 14, 17,
+ 0, 0, 2, 21, 5, 0, 0, 12, 20, 22,
+ 9, 10, 11, 0, 7, 15, 6, 8, 18, 16,
+ 3, 19
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
- -12, -12, -6, 10, -12, -10, -12, 6, -12, -12,
- -9, -12, -11, -12
+ -13, -13, 6, 10, -13, -11, -13, 7, -13, -13,
+ -10, -13, -12, -13
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] =
{
- -1, 2, 13, 14, 17, 22, 23, 6, 7, 27,
- 10, 29, 12, 15
+ -1, 2, 13, 14, 17, 23, 24, 6, 7, 28,
+ 10, 30, 12, 15
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
@@ -556,42 +549,42 @@
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_uint8 yytable[] =
{
- 1, 4, 20, 21, 1, 8, 9, 18, 5, 19,
- 3, 11, 16, 26, 25, 28, 30, 0, 0, 0,
- 0, 0, 0, 24
+ 1, 4, 20, 21, 22, 1, 8, 9, 18, 5,
+ 3, 11, 26, 27, 16, 29, 31, 0, 0, 0,
+ 0, 19, 0, 0, 25
};
static const yytype_int8 yycheck[] =
{
- 5, 0, 6, 7, 5, 3, 3, 12, 10, 15,
- 0, 11, 8, 23, 9, 24, 27, -1, -1, -1,
- -1, -1, -1, 17
+ 5, 0, 6, 7, 8, 5, 3, 3, 13, 11,
+ 0, 12, 10, 24, 9, 25, 28, -1, -1, -1,
+ -1, 15, -1, -1, 17
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
- 0, 5, 14, 16, 0, 10, 20, 21, 3, 3,
- 23, 11, 25, 15, 16, 26, 8, 17, 12, 15,
- 6, 7, 18, 19, 20, 9, 18, 22, 23, 24,
- 25
+ 0, 5, 15, 17, 0, 11, 21, 22, 3, 3,
+ 24, 12, 26, 16, 17, 27, 9, 18, 13, 16,
+ 6, 7, 8, 19, 20, 21, 10, 19, 23, 24,
+ 25, 26
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
- 0, 13, 14, 15, 16, 17, 17, 18, 18, 19,
- 19, 20, 20, 21, 22, 22, 23, 24, 24, 25,
- 26, 26
+ 0, 14, 15, 16, 17, 18, 18, 19, 19, 20,
+ 20, 20, 21, 21, 22, 23, 23, 24, 25, 25,
+ 26, 27, 27
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 4, 5, 1, 0, 3, 1, 2, 1,
- 1, 0, 1, 2, 0, 1, 1, 0, 1, 3,
- 1, 2
+ 1, 1, 0, 1, 2, 0, 1, 1, 0, 1,
+ 3, 1, 2
};
@@ -607,22 +600,22 @@
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (yylen); \
- yystate = *yyssp; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (0)
+#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+ while (0)
/* Error token number */
#define YYTERROR 1
@@ -662,37 +655,37 @@
} while (0)
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT. |
-`----------------------------------------*/
+/*-----------------------------------.
+| Print this symbol's value on YYO. |
+`-----------------------------------*/
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
{
- FILE *yyo = yyoutput;
- YYUSE (yyo);
+ FILE *yyoutput = yyo;
+ YYUSE (yyoutput);
if (!yyvaluep)
return;
# ifdef YYPRINT
if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+ YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
# endif
YYUSE (yytype);
}
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+/*---------------------------.
+| Print this symbol on YYO. |
+`---------------------------*/
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
{
- YYFPRINTF (yyoutput, "%s %s (",
+ YYFPRINTF (yyo, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
- yy_symbol_value_print (yyoutput, yytype, yyvaluep);
- YYFPRINTF (yyoutput, ")");
+ yy_symbol_value_print (yyo, yytype, yyvaluep);
+ YYFPRINTF (yyo, ")");
}
/*------------------------------------------------------------------.
@@ -726,7 +719,7 @@
static void
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
{
- unsigned long int yylno = yyrline[yyrule];
+ unsigned long yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
@@ -737,7 +730,7 @@
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
yystos[yyssp[yyi + 1 - yynrhs]],
- &(yyvsp[(yyi + 1) - (yynrhs)])
+ &yyvsp[(yyi + 1) - (yynrhs)]
);
YYFPRINTF (stderr, "\n");
}
@@ -841,7 +834,10 @@
case '\\':
if (*++yyp != '\\')
goto do_not_strip_quotes;
- /* Fall through. */
+ else
+ goto append;
+
+ append:
default:
if (yyres)
yyres[yyn] = *yyp;
@@ -859,7 +855,7 @@
if (! yyres)
return yystrlen (yystr);
- return yystpcpy (yyres, yystr) - yyres;
+ return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
}
# endif
@@ -937,10 +933,10 @@
yyarg[yycount++] = yytname[yyx];
{
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
return 2;
- yysize = yysize1;
}
}
}
@@ -952,6 +948,7 @@
case N: \
yyformat = S; \
break
+ default: /* Avoid compiler warnings. */
YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
@@ -963,9 +960,10 @@
{
YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
return 2;
- yysize = yysize1;
}
if (*yymsg_alloc < yysize)
@@ -1091,23 +1089,33 @@
yychar = YYEMPTY; /* Cause a token to be read. */
goto yysetstate;
+
/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
+| yynewstate -- push a new state, which is found in yystate. |
`------------------------------------------------------------*/
- yynewstate:
+yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
- yysetstate:
- *yyssp = yystate;
+
+/*--------------------------------------------------------------------.
+| yynewstate -- set current state (the top of the stack) to yystate. |
+`--------------------------------------------------------------------*/
+yysetstate:
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
+ *yyssp = (yytype_int16) yystate;
if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+#else
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
-#ifdef yyoverflow
+# if defined yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
@@ -1123,14 +1131,10 @@
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
-
yyss = yyss1;
yyvs = yyvs1;
}
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
@@ -1146,35 +1150,33 @@
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-# undef YYSTACK_RELOCATE
+# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
-#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ (unsigned long) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup;
+
/*-----------.
| yybackup. |
`-----------*/
yybackup:
-
/* Do appropriate processing given the current state. Read a
lookahead token if we need one and don't already have one. */
@@ -1232,7 +1234,6 @@
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
-
goto yynewstate;
@@ -1247,7 +1248,7 @@
/*-----------------------------.
-| yyreduce -- Do a reduction. |
+| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
@@ -1267,18 +1268,18 @@
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 2:
-#line 81 "fmd_parser.y" /* yacc.c:1646 */
+ case 2:
+#line 82 "fmd_parser.y"
{
union flashmap_flags flags = { .v=0 };
if (!(res = parse_descriptor((yyvsp[-3].strval), flags, (yyvsp[-2].maybe_intval), (yyvsp[-1].maybe_intval), (yyvsp[0].region_listhdr))))
YYABORT;
}
-#line 1278 "y.tab.c" /* yacc.c:1646 */
+#line 1279 "fmd_parser.tab.c"
break;
case 3:
-#line 88 "fmd_parser.y" /* yacc.c:1646 */
+#line 89 "fmd_parser.y"
{
struct flashmap_descriptor *node = parse_descriptor((yyvsp[-4].strval), (yyvsp[-3].flags), (yyvsp[-2].maybe_intval), (yyvsp[-1].maybe_intval), (yyvsp[0].region_listhdr));
if (!node)
@@ -1291,91 +1292,97 @@
(yyval.region_ptr) = node;
}
-#line 1295 "y.tab.c" /* yacc.c:1646 */
+#line 1296 "fmd_parser.tab.c"
break;
case 4:
-#line 101 "fmd_parser.y" /* yacc.c:1646 */
+#line 102 "fmd_parser.y"
{
if (!(yyvsp[0].strval)) {
perror("E: While allocating section name");
YYABORT;
}
}
-#line 1306 "y.tab.c" /* yacc.c:1646 */
+#line 1307 "fmd_parser.tab.c"
break;
case 5:
-#line 107 "fmd_parser.y" /* yacc.c:1646 */
+#line 108 "fmd_parser.y"
{ (yyval.flags) = (union flashmap_flags){ .v=0 }; }
-#line 1312 "y.tab.c" /* yacc.c:1646 */
+#line 1313 "fmd_parser.tab.c"
break;
case 6:
-#line 108 "fmd_parser.y" /* yacc.c:1646 */
+#line 109 "fmd_parser.y"
{ (yyval.flags) = (yyvsp[-1].flags); }
-#line 1318 "y.tab.c" /* yacc.c:1646 */
+#line 1319 "fmd_parser.tab.c"
break;
case 8:
-#line 109 "fmd_parser.y" /* yacc.c:1646 */
+#line 110 "fmd_parser.y"
{ (yyval.flags).v = (yyvsp[-1].flags).v | (yyvsp[0].flags).v; }
-#line 1324 "y.tab.c" /* yacc.c:1646 */
+#line 1325 "fmd_parser.tab.c"
break;
case 9:
-#line 110 "fmd_parser.y" /* yacc.c:1646 */
+#line 111 "fmd_parser.y"
{ (yyval.flags).v = 0; (yyval.flags).f.cbfs = 1; }
-#line 1330 "y.tab.c" /* yacc.c:1646 */
+#line 1331 "fmd_parser.tab.c"
break;
case 10:
-#line 111 "fmd_parser.y" /* yacc.c:1646 */
+#line 112 "fmd_parser.y"
{ (yyval.flags).v = 0; (yyval.flags).f.preserve = 1; }
-#line 1336 "y.tab.c" /* yacc.c:1646 */
+#line 1337 "fmd_parser.tab.c"
break;
case 11:
-#line 112 "fmd_parser.y" /* yacc.c:1646 */
- { (yyval.maybe_intval) = (struct unsigned_option){false, 0}; }
-#line 1342 "y.tab.c" /* yacc.c:1646 */
+#line 113 "fmd_parser.y"
+ { (yyval.flags).v = 0; (yyval.flags).f.aligned = 1; }
+#line 1343 "fmd_parser.tab.c"
break;
- case 13:
-#line 114 "fmd_parser.y" /* yacc.c:1646 */
- { (yyval.maybe_intval) = (struct unsigned_option){true, (yyvsp[0].intval)}; }
-#line 1348 "y.tab.c" /* yacc.c:1646 */
+ case 12:
+#line 114 "fmd_parser.y"
+ { (yyval.maybe_intval) = (struct unsigned_option){false, 0}; }
+#line 1349 "fmd_parser.tab.c"
break;
case 14:
-#line 115 "fmd_parser.y" /* yacc.c:1646 */
- { (yyval.maybe_intval) = (struct unsigned_option){false, 0}; }
-#line 1354 "y.tab.c" /* yacc.c:1646 */
+#line 116 "fmd_parser.y"
+ { (yyval.maybe_intval) = (struct unsigned_option){true, (yyvsp[0].intval)}; }
+#line 1355 "fmd_parser.tab.c"
break;
- case 16:
-#line 117 "fmd_parser.y" /* yacc.c:1646 */
- { (yyval.maybe_intval) = (struct unsigned_option){true, (yyvsp[0].intval)}; }
-#line 1360 "y.tab.c" /* yacc.c:1646 */
+ case 15:
+#line 117 "fmd_parser.y"
+ { (yyval.maybe_intval) = (struct unsigned_option){false, 0}; }
+#line 1361 "fmd_parser.tab.c"
break;
case 17:
-#line 119 "fmd_parser.y" /* yacc.c:1646 */
+#line 119 "fmd_parser.y"
+ { (yyval.maybe_intval) = (struct unsigned_option){true, (yyvsp[0].intval)}; }
+#line 1367 "fmd_parser.tab.c"
+ break;
+
+ case 18:
+#line 121 "fmd_parser.y"
{
(yyval.region_listhdr) = (struct descriptor_list)
{.len = 0, .head = NULL, .tail = NULL};
}
-#line 1369 "y.tab.c" /* yacc.c:1646 */
- break;
-
- case 19:
-#line 124 "fmd_parser.y" /* yacc.c:1646 */
- { (yyval.region_listhdr) = (yyvsp[-1].region_listhdr); }
-#line 1375 "y.tab.c" /* yacc.c:1646 */
+#line 1376 "fmd_parser.tab.c"
break;
case 20:
-#line 126 "fmd_parser.y" /* yacc.c:1646 */
+#line 126 "fmd_parser.y"
+ { (yyval.region_listhdr) = (yyvsp[-1].region_listhdr); }
+#line 1382 "fmd_parser.tab.c"
+ break;
+
+ case 21:
+#line 128 "fmd_parser.y"
{
struct descriptor_node *node = malloc(sizeof(*node));
if (!node) {
@@ -1386,11 +1393,11 @@
node->next = NULL;
(yyval.region_listhdr) = (struct descriptor_list){.len = 1, .head = node, .tail = node};
}
-#line 1390 "y.tab.c" /* yacc.c:1646 */
+#line 1397 "fmd_parser.tab.c"
break;
- case 21:
-#line 137 "fmd_parser.y" /* yacc.c:1646 */
+ case 22:
+#line 139 "fmd_parser.y"
{
struct descriptor_node *node = malloc(sizeof(*node));
if (!node) {
@@ -1404,11 +1411,12 @@
(yyval.region_listhdr) = (struct descriptor_list)
{.len = (yyvsp[-1].region_listhdr).len + 1, .head = (yyvsp[-1].region_listhdr).head, .tail = node};
}
-#line 1408 "y.tab.c" /* yacc.c:1646 */
+#line 1415 "fmd_parser.tab.c"
break;
-#line 1412 "y.tab.c" /* yacc.c:1646 */
+#line 1419 "fmd_parser.tab.c"
+
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -1433,14 +1441,13 @@
/* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ {
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
+ const int yyi = yypgoto[yylhs] + *yyssp;
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
+ ? yytable[yyi]
+ : yydefgoto[yylhs]);
+ }
goto yynewstate;
@@ -1523,12 +1530,10 @@
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
-
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (/*CONSTCOND*/ 0)
- goto yyerrorlab;
+ /* Pacify compilers when the user code never invokes YYERROR and the
+ label yyerrorlab therefore never appears in user code. */
+ if (0)
+ YYERROR;
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
@@ -1590,6 +1595,7 @@
yyresult = 0;
goto yyreturn;
+
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
@@ -1597,6 +1603,7 @@
yyresult = 1;
goto yyreturn;
+
#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
@@ -1607,6 +1614,10 @@
/* Fall through. */
#endif
+
+/*-----------------------------------------------------.
+| yyreturn -- parsing is finished, return the result. |
+`-----------------------------------------------------*/
yyreturn:
if (yychar != YYEMPTY)
{
@@ -1636,7 +1647,7 @@
#endif
return yyresult;
}
-#line 151 "fmd_parser.y" /* yacc.c:1906 */
+#line 153 "fmd_parser.y"
struct flashmap_descriptor *parse_descriptor(
diff --git a/util/cbfstool/fmd_parser.h_shipped b/util/cbfstool/fmd_parser.h_shipped
index 07c0259..afe77af 100644
--- a/util/cbfstool/fmd_parser.h_shipped
+++ b/util/cbfstool/fmd_parser.h_shipped
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4. */
+/* A Bison parser, made by GNU Bison 3.4.1. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+ 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
@@ -30,8 +31,11 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-#ifndef YY_YY_Y_TAB_H_INCLUDED
-# define YY_YY_Y_TAB_H_INCLUDED
+/* Undocumented macros, especially those whose name start with YY_,
+ are private implementation details. Do not rely on them. */
+
+#ifndef YY_YY_FMD_PARSER_TAB_H_INCLUDED
+# define YY_YY_FMD_PARSER_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -40,7 +44,7 @@
extern int yydebug;
#endif
/* "%code requires" blocks. */
-#line 34 "fmd_parser.y" /* yacc.c:1909 */
+#line 34 "fmd_parser.y"
#include "fmd.h"
#include "option.h"
@@ -65,7 +69,7 @@
struct unsigned_option size, struct descriptor_list children);
void yyerror(const char *s);
-#line 69 "y.tab.h" /* yacc.c:1909 */
+#line 73 "fmd_parser.tab.h"
/* Token type. */
#ifndef YYTOKENTYPE
@@ -76,22 +80,16 @@
OCTAL = 259,
STRING = 260,
FLAG_CBFS = 261,
- FLAG_PRESERVE = 262
+ FLAG_PRESERVE = 262,
+ FLAG_ALIGNED = 263
};
#endif
-/* Tokens. */
-#define INTEGER 258
-#define OCTAL 259
-#define STRING 260
-#define FLAG_CBFS 261
-#define FLAG_PRESERVE 262
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
union YYSTYPE
{
-#line 25 "fmd_parser.y" /* yacc.c:1909 */
+#line 25 "fmd_parser.y"
unsigned intval;
char *strval;
@@ -100,9 +98,9 @@
union flashmap_flags flags;
struct descriptor_list region_listhdr;
-#line 104 "y.tab.h" /* yacc.c:1909 */
-};
+#line 102 "fmd_parser.tab.h"
+};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
@@ -113,4 +111,4 @@
int yyparse (void);
-#endif /* !YY_YY_Y_TAB_H_INCLUDED */
+#endif /* !YY_YY_FMD_PARSER_TAB_H_INCLUDED */
diff --git a/util/cbfstool/fmd_parser.y b/util/cbfstool/fmd_parser.y
index 3ba710c..2f59399 100644
--- a/util/cbfstool/fmd_parser.y
+++ b/util/cbfstool/fmd_parser.y
@@ -61,6 +61,7 @@
%token <strval> STRING
%token FLAG_CBFS
%token FLAG_PRESERVE
+%token FLAG_ALIGNED
%type <region_ptr> flash_region
%type <strval> region_name
@@ -109,6 +110,7 @@
region_flags: region_flag | region_flag region_flags { $$.v = $1.v | $2.v; };
region_flag: FLAG_CBFS { $$.v = 0; $$.f.cbfs = 1; };
region_flag: FLAG_PRESERVE { $$.v = 0; $$.f.preserve = 1; };
+region_flag: FLAG_ALIGNED { $$.v = 0; $$.f.aligned = 1; };
region_offset_opt: { $$ = (struct unsigned_option){false, 0}; }
| region_offset;
region_offset: '@' INTEGER { $$ = (struct unsigned_option){true, $2}; };
diff --git a/util/cbfstool/fmd_scanner.c_shipped b/util/cbfstool/fmd_scanner.c_shipped
index 71d541d..e0d6418 100644
--- a/util/cbfstool/fmd_scanner.c_shipped
+++ b/util/cbfstool/fmd_scanner.c_shipped
@@ -8,7 +8,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -83,10 +83,16 @@
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */
+
/* TODO: this is always defined, so inline it */
#define yyconst const
@@ -99,32 +105,26 @@
/* Returned upon end-of-file. */
#define YY_NULL 0
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN (yy_start) = 1 + 2 *
-
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
-
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin )
-
+#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
@@ -161,7 +161,7 @@
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
-
+
#define YY_LESS_LINENO(n)
#define YY_LINENO_REWIND_TO(ptr)
@@ -178,7 +178,6 @@
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -260,7 +259,6 @@
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
: NULL)
-
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
@@ -281,65 +279,59 @@
*/
static int yy_did_buffer_switch_on_eof;
-void yyrestart (FILE *input_file );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
-void yy_delete_buffer (YY_BUFFER_STATE b );
-void yy_flush_buffer (YY_BUFFER_STATE b );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
-void yypop_buffer_state (void );
+void yyrestart ( FILE *input_file );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
+void yy_delete_buffer ( YY_BUFFER_STATE b );
+void yy_flush_buffer ( YY_BUFFER_STATE b );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
+void yypop_buffer_state ( void );
-static void yyensure_buffer_stack (void );
-static void yy_load_buffer_state (void );
-static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
+static void yyensure_buffer_stack ( void );
+static void yy_load_buffer_state ( void );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
-
-void *yyalloc (yy_size_t );
-void *yyrealloc (void *,yy_size_t );
-void yyfree (void * );
+void *yyalloc ( yy_size_t );
+void *yyrealloc ( void *, yy_size_t );
+void yyfree ( void * );
#define yy_new_buffer yy_create_buffer
-
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
+ yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
-
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
+ yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
#define yywrap() (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
+typedef flex_uint8_t YY_CHAR;
FILE *yyin = NULL, *yyout = NULL;
typedef int yy_state_type;
extern int yylineno;
-
int yylineno = 1;
extern char *yytext;
@@ -348,10 +340,10 @@
#endif
#define yytext_ptr yytext
-static yy_state_type yy_get_previous_state (void );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
-static int yy_get_next_buffer (void );
-static void yynoreturn yy_fatal_error (yyconst char* msg );
+static yy_state_type yy_get_previous_state ( void );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
+static int yy_get_next_buffer ( void );
+static void yynoreturn yy_fatal_error ( const char* msg );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
@@ -362,9 +354,8 @@
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
-
-#define YY_NUM_RULES 13
-#define YY_END_OF_BUFFER 14
+#define YY_NUM_RULES 14
+#define YY_END_OF_BUFFER 15
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -372,15 +363,16 @@
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[40] =
+static const flex_int16_t yy_accept[47] =
{ 0,
- 11, 11, 11, 11, 14, 11, 1, 1, 12, 3,
- 12, 7, 8, 4, 11, 11, 11, 1, 0, 2,
- 9, 7, 11, 8, 8, 11, 11, 9, 10, 11,
- 11, 10, 5, 11, 11, 11, 11, 6, 0
+ 12, 12, 12, 12, 15, 12, 1, 1, 13, 3,
+ 13, 8, 9, 4, 12, 12, 12, 12, 1, 0,
+ 2, 10, 8, 12, 9, 9, 12, 12, 12, 10,
+ 11, 12, 12, 12, 11, 12, 5, 12, 12, 12,
+ 12, 12, 7, 12, 6, 0
} ;
-static yyconst YY_CHAR yy_ec[256] =
+static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
@@ -388,13 +380,13 @@
1, 2, 1, 1, 4, 1, 1, 1, 1, 5,
6, 1, 1, 1, 1, 1, 1, 7, 8, 8,
8, 8, 8, 8, 8, 8, 8, 1, 1, 1,
- 1, 1, 1, 9, 10, 11, 12, 10, 13, 14,
- 15, 1, 1, 1, 15, 1, 15, 1, 1, 16,
- 1, 17, 18, 1, 1, 19, 1, 20, 1, 1,
- 1, 1, 1, 1, 1, 1, 10, 10, 10, 10,
+ 1, 1, 1, 9, 10, 11, 12, 13, 14, 15,
+ 16, 1, 17, 1, 18, 19, 18, 20, 1, 21,
+ 1, 22, 23, 1, 1, 24, 1, 25, 1, 1,
+ 1, 1, 1, 1, 1, 1, 26, 26, 26, 26,
- 10, 10, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 20,
+ 26, 26, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 25,
1, 1, 9, 1, 9, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -412,54 +404,67 @@
1, 1, 1, 1, 1
} ;
-static yyconst YY_CHAR yy_meta[21] =
+static const YY_CHAR yy_meta[27] =
{ 0,
1, 2, 2, 2, 2, 2, 1, 1, 2, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1
} ;
-static yyconst flex_uint16_t yy_base[43] =
+static const flex_int16_t yy_base[50] =
{ 0,
- 0, 8, 12, 13, 63, 0, 18, 20, 59, 64,
- 64, 23, 19, 64, 50, 43, 0, 30, 56, 64,
- 20, 0, 37, 0, 0, 44, 44, 0, 41, 28,
- 24, 0, 0, 28, 22, 18, 23, 0, 64, 51,
- 0, 53
+ 0, 8, 12, 28, 57, 0, 17, 23, 53, 105,
+ 105, 43, 62, 105, 36, 43, 31, 0, 25, 49,
+ 105, 5, 0, 74, 0, 0, 31, 32, 32, 0,
+ 13, 29, 21, 20, 0, 22, 0, 27, 25, 15,
+ 23, 11, 0, 18, 0, 105, 100, 0, 102
} ;
-static yyconst flex_int16_t yy_def[43] =
+static const flex_int16_t yy_def[50] =
{ 0,
- 40, 40, 2, 2, 39, 41, 39, 39, 42, 39,
- 39, 41, 41, 39, 41, 41, 41, 39, 42, 39,
- 12, 41, 41, 13, 41, 41, 41, 41, 23, 41,
- 41, 41, 41, 41, 41, 41, 41, 41, 0, 39,
- 39, 39
+ 47, 47, 2, 2, 46, 48, 46, 46, 49, 46,
+ 46, 48, 48, 46, 48, 48, 48, 48, 46, 49,
+ 46, 12, 48, 48, 13, 48, 48, 48, 48, 48,
+ 24, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 0, 46, 46, 46
} ;
-static yyconst flex_uint16_t yy_nxt[85] =
+static const flex_int16_t yy_nxt[132] =
{ 0,
- 17, 7, 8, 9, 10, 11, 12, 13, 11, 7,
- 8, 9, 10, 11, 12, 13, 11, 14, 14, 18,
- 18, 18, 18, 15, 15, 24, 24, 16, 16, 21,
- 21, 18, 18, 25, 28, 38, 37, 22, 36, 17,
- 35, 34, 23, 29, 29, 33, 29, 29, 29, 29,
- 29, 6, 6, 19, 19, 32, 31, 30, 20, 27,
- 26, 20, 39, 5, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39
+ 18, 7, 8, 9, 10, 11, 12, 13, 11, 7,
+ 8, 9, 10, 11, 12, 13, 11, 14, 19, 19,
+ 30, 15, 30, 16, 19, 19, 19, 19, 35, 18,
+ 35, 45, 17, 14, 44, 43, 42, 15, 41, 16,
+ 40, 39, 38, 37, 36, 34, 33, 32, 17, 22,
+ 22, 21, 29, 28, 27, 21, 46, 46, 23, 46,
+ 23, 46, 46, 46, 46, 46, 46, 24, 25, 25,
+ 46, 46, 46, 46, 46, 46, 46, 26, 46, 26,
+ 31, 31, 46, 31, 31, 31, 31, 31, 31, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 31,
+
+ 6, 6, 20, 20, 5, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
+ 46
} ;
-static yyconst flex_int16_t yy_chk[85] =
+static const flex_int16_t yy_chk[132] =
{ 0,
- 41, 1, 1, 1, 1, 1, 1, 1, 1, 2,
- 2, 2, 2, 2, 2, 2, 2, 3, 4, 7,
- 7, 8, 8, 3, 4, 13, 13, 3, 4, 12,
- 12, 18, 18, 13, 21, 37, 36, 12, 35, 21,
- 34, 31, 12, 23, 23, 30, 23, 23, 23, 23,
- 23, 40, 40, 42, 42, 29, 27, 26, 19, 16,
- 15, 9, 5, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
- 39, 39, 39, 39
+ 48, 1, 1, 1, 1, 1, 1, 1, 1, 2,
+ 2, 2, 2, 2, 2, 2, 2, 3, 7, 7,
+ 22, 3, 22, 3, 8, 8, 19, 19, 31, 22,
+ 31, 44, 3, 4, 42, 41, 40, 4, 39, 4,
+ 38, 36, 34, 33, 32, 29, 28, 27, 4, 12,
+ 12, 20, 17, 16, 15, 9, 5, 0, 12, 0,
+ 12, 0, 0, 0, 0, 0, 0, 12, 13, 13,
+ 0, 0, 0, 0, 0, 0, 0, 13, 0, 13,
+ 24, 24, 0, 24, 24, 24, 24, 24, 24, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,
+
+ 47, 47, 49, 49, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
+ 46
} ;
static yy_state_type yy_last_accepting_state;
@@ -499,8 +504,9 @@
int parse_integer(char *src, int base);
int copy_string(const char *src);
+#line 508 "<stdout>"
-#line 504 "<stdout>"
+#line 510 "<stdout>"
#define INITIAL 0
#define FLAGS 1
@@ -517,36 +523,36 @@
#define YY_EXTRA_TYPE void *
#endif
-static int yy_init_globals (void );
+static int yy_init_globals ( void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int yylex_destroy (void );
+int yylex_destroy ( void );
-int yyget_debug (void );
+int yyget_debug ( void );
-void yyset_debug (int debug_flag );
+void yyset_debug ( int debug_flag );
-YY_EXTRA_TYPE yyget_extra (void );
+YY_EXTRA_TYPE yyget_extra ( void );
-void yyset_extra (YY_EXTRA_TYPE user_defined );
+void yyset_extra ( YY_EXTRA_TYPE user_defined );
-FILE *yyget_in (void );
+FILE *yyget_in ( void );
-void yyset_in (FILE * _in_str );
+void yyset_in ( FILE * _in_str );
-FILE *yyget_out (void );
+FILE *yyget_out ( void );
-void yyset_out (FILE * _out_str );
+void yyset_out ( FILE * _out_str );
- int yyget_leng (void );
+ int yyget_leng ( void );
-char *yyget_text (void );
+char *yyget_text ( void );
-int yyget_lineno (void );
+int yyget_lineno ( void );
-void yyset_lineno (int _line_number );
+void yyset_lineno ( int _line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -554,32 +560,31 @@
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int yywrap (void );
+extern "C" int yywrap ( void );
#else
-extern int yywrap (void );
+extern int yywrap ( void );
#endif
#endif
#ifndef YY_NO_UNPUT
- static void yyunput (int c,char *buf_ptr );
+ static void yyunput ( int c, char *buf_ptr );
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
+static void yy_flex_strncpy ( char *, const char *, int );
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
+static int yy_flex_strlen ( const char * );
#endif
#ifndef YY_NO_INPUT
-
#ifdef __cplusplus
-static int yyinput (void );
+static int yyinput ( void );
#else
-static int input (void );
+static int input ( void );
#endif
#endif
@@ -610,7 +615,7 @@
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -623,7 +628,7 @@
else \
{ \
errno=0; \
- while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
@@ -712,16 +717,16 @@
if ( ! YY_CURRENT_BUFFER ) {
yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer(yyin,YY_BUF_SIZE );
+ yy_create_buffer( yyin, YY_BUF_SIZE );
}
- yy_load_buffer_state( );
+ yy_load_buffer_state( );
}
{
#line 31 "fmd_scanner.l"
-#line 725 "<stdout>"
+#line 730 "<stdout>"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -748,13 +753,13 @@
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 40 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ if ( yy_current_state >= 47 )
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 64 );
+ while ( yy_base[yy_current_state] != 105 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -813,38 +818,43 @@
return FLAG_PRESERVE;
YY_BREAK
case 7:
-#line 39 "fmd_scanner.l"
-case 8:
YY_RULE_SETUP
-#line 39 "fmd_scanner.l"
-return parse_integer(yytext, 10);
+#line 38 "fmd_scanner.l"
+return FLAG_ALIGNED;
YY_BREAK
+case 8:
+#line 40 "fmd_scanner.l"
case 9:
YY_RULE_SETUP
#line 40 "fmd_scanner.l"
-return OCTAL;
+return parse_integer(yytext, 10);
YY_BREAK
case 10:
YY_RULE_SETUP
#line 41 "fmd_scanner.l"
-return parse_integer(yytext + 2, 16);
+return OCTAL;
YY_BREAK
case 11:
YY_RULE_SETUP
#line 42 "fmd_scanner.l"
-return copy_string(yytext);
+return parse_integer(yytext + 2, 16);
YY_BREAK
case 12:
YY_RULE_SETUP
#line 43 "fmd_scanner.l"
-return *yytext;
+return copy_string(yytext);
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 45 "fmd_scanner.l"
+#line 44 "fmd_scanner.l"
+return *yytext;
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 46 "fmd_scanner.l"
ECHO;
YY_BREAK
-#line 848 "<stdout>"
+#line 858 "<stdout>"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(FLAGS):
yyterminate();
@@ -923,7 +933,7 @@
{
(yy_did_buffer_switch_on_eof) = 0;
- if ( yywrap( ) )
+ if ( yywrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
@@ -1055,7 +1065,8 @@
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) );
}
else
/* Can't grow it, we don't own it. */
@@ -1087,7 +1098,7 @@
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- yyrestart(yyin );
+ yyrestart( yyin );
}
else
@@ -1104,9 +1115,12 @@
if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
(yy_n_chars) += number_to_move;
@@ -1138,10 +1152,10 @@
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 40 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ if ( yy_current_state >= 47 )
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return yy_current_state;
@@ -1166,11 +1180,11 @@
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 40 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ if ( yy_current_state >= 47 )
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
- yy_is_jam = (yy_current_state == 39);
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+ yy_is_jam = (yy_current_state == 46);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -1240,7 +1254,7 @@
else
{ /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
+ int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
@@ -1257,13 +1271,13 @@
*/
/* Reset buffer status. */
- yyrestart(yyin );
+ yyrestart( yyin );
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( yywrap( ) )
+ if ( yywrap( ) )
return 0;
if ( ! (yy_did_buffer_switch_on_eof) )
@@ -1301,11 +1315,11 @@
if ( ! YY_CURRENT_BUFFER ){
yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer(yyin,YY_BUF_SIZE );
+ yy_create_buffer( yyin, YY_BUF_SIZE );
}
- yy_init_buffer(YY_CURRENT_BUFFER,input_file );
- yy_load_buffer_state( );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file );
+ yy_load_buffer_state( );
}
/** Switch to a different input buffer.
@@ -1333,7 +1347,7 @@
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- yy_load_buffer_state( );
+ yy_load_buffer_state( );
/* We don't actually know whether we did this switch during
* EOF (yywrap()) processing, but the only time this flag
@@ -1361,22 +1375,22 @@
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_buf_size = (yy_size_t)size;
+ b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- yy_init_buffer(b,file );
+ yy_init_buffer( b, file );
return b;
}
@@ -1395,9 +1409,9 @@
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- yyfree((void *) b->yy_ch_buf );
+ yyfree( (void *) b->yy_ch_buf );
- yyfree((void *) b );
+ yyfree( (void *) b );
}
/* Initializes or reinitializes a buffer.
@@ -1409,7 +1423,7 @@
{
int oerrno = errno;
- yy_flush_buffer(b );
+ yy_flush_buffer( b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
@@ -1452,7 +1466,7 @@
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- yy_load_buffer_state( );
+ yy_load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -1483,7 +1497,7 @@
YY_CURRENT_BUFFER_LVALUE = new_buffer;
/* copied from yy_switch_to_buffer. */
- yy_load_buffer_state( );
+ yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
@@ -1502,7 +1516,7 @@
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) {
- yy_load_buffer_state( );
+ yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
}
@@ -1512,7 +1526,7 @@
*/
static void yyensure_buffer_stack (void)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) {
@@ -1569,11 +1583,11 @@
/* They forgot to leave room for the EOB's. */
return NULL;
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = NULL;
@@ -1583,7 +1597,7 @@
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- yy_switch_to_buffer(b );
+ yy_switch_to_buffer( b );
return b;
}
@@ -1596,10 +1610,10 @@
* @note If you want to scan bytes that may contain NUL values, then use
* yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
+YY_BUFFER_STATE yy_scan_string (const char * yystr )
{
- return yy_scan_bytes(yystr,(int) strlen(yystr) );
+ return yy_scan_bytes( yystr, (int) strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
@@ -1609,7 +1623,7 @@
*
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
@@ -1618,7 +1632,7 @@
/* Get memory for full buffer, including space for trailing EOB's. */
n = (yy_size_t) (_yybytes_len + 2);
- buf = (char *) yyalloc(n );
+ buf = (char *) yyalloc( n );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
@@ -1627,7 +1641,7 @@
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = yy_scan_buffer(buf,n );
+ b = yy_scan_buffer( buf, n );
if ( ! b )
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
@@ -1643,9 +1657,9 @@
#define YY_EXIT_FAILURE 2
#endif
-static void yynoreturn yy_fatal_error (yyconst char* msg )
+static void yynoreturn yy_fatal_error (const char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -1673,7 +1687,7 @@
*/
int yyget_lineno (void)
{
-
+
return yylineno;
}
@@ -1780,7 +1794,7 @@
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- yy_delete_buffer(YY_CURRENT_BUFFER );
+ yy_delete_buffer( YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
yypop_buffer_state();
}
@@ -1801,7 +1815,7 @@
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+static void yy_flex_strncpy (char* s1, const char * s2, int n )
{
int i;
@@ -1811,7 +1825,7 @@
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s )
+static int yy_flex_strlen (const char * s )
{
int n;
for ( n = 0; s[n]; ++n )
@@ -1846,8 +1860,7 @@
#define YYTABLES_NAME "yytables"
-#line 45 "fmd_scanner.l"
-
+#line 46 "fmd_scanner.l"
int parse_integer(char *src, int base)
diff --git a/util/cbfstool/fmd_scanner.h_shipped b/util/cbfstool/fmd_scanner.h_shipped
index 2a8b291..92d2c72 100644
--- a/util/cbfstool/fmd_scanner.h_shipped
+++ b/util/cbfstool/fmd_scanner.h_shipped
@@ -11,7 +11,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -86,10 +86,16 @@
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
+/* begin standard C++ headers. */
+
/* TODO: this is always defined, so inline it */
#define yyconst const
@@ -177,21 +183,21 @@
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-void yyrestart (FILE *input_file );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
-void yy_delete_buffer (YY_BUFFER_STATE b );
-void yy_flush_buffer (YY_BUFFER_STATE b );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
-void yypop_buffer_state (void );
+void yyrestart ( FILE *input_file );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
+void yy_delete_buffer ( YY_BUFFER_STATE b );
+void yy_flush_buffer ( YY_BUFFER_STATE b );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
+void yypop_buffer_state ( void );
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
-void *yyalloc (yy_size_t );
-void *yyrealloc (void *,yy_size_t );
-void yyfree (void * );
+void *yyalloc ( yy_size_t );
+void *yyrealloc ( void *, yy_size_t );
+void yyfree ( void * );
/* Begin user sect3 */
@@ -227,31 +233,31 @@
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int yylex_destroy (void );
+int yylex_destroy ( void );
-int yyget_debug (void );
+int yyget_debug ( void );
-void yyset_debug (int debug_flag );
+void yyset_debug ( int debug_flag );
-YY_EXTRA_TYPE yyget_extra (void );
+YY_EXTRA_TYPE yyget_extra ( void );
-void yyset_extra (YY_EXTRA_TYPE user_defined );
+void yyset_extra ( YY_EXTRA_TYPE user_defined );
-FILE *yyget_in (void );
+FILE *yyget_in ( void );
-void yyset_in (FILE * _in_str );
+void yyset_in ( FILE * _in_str );
-FILE *yyget_out (void );
+FILE *yyget_out ( void );
-void yyset_out (FILE * _out_str );
+void yyset_out ( FILE * _out_str );
- int yyget_leng (void );
+ int yyget_leng ( void );
-char *yyget_text (void );
+char *yyget_text ( void );
-int yyget_lineno (void );
+int yyget_lineno ( void );
-void yyset_lineno (int _line_number );
+void yyset_lineno ( int _line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -259,18 +265,18 @@
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int yywrap (void );
+extern "C" int yywrap ( void );
#else
-extern int yywrap (void );
+extern int yywrap ( void );
#endif
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
+static void yy_flex_strncpy ( char *, const char *, int );
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
+static int yy_flex_strlen ( const char * );
#endif
#ifndef YY_NO_INPUT
@@ -317,9 +323,154 @@
#undef YY_DECL
#endif
-#line 45 "fmd_scanner.l"
+#ifndef yy_create_buffer_ALREADY_DEFINED
+#undef yy_create_buffer
+#endif
+#ifndef yy_delete_buffer_ALREADY_DEFINED
+#undef yy_delete_buffer
+#endif
+#ifndef yy_scan_buffer_ALREADY_DEFINED
+#undef yy_scan_buffer
+#endif
+#ifndef yy_scan_string_ALREADY_DEFINED
+#undef yy_scan_string
+#endif
+#ifndef yy_scan_bytes_ALREADY_DEFINED
+#undef yy_scan_bytes
+#endif
+#ifndef yy_init_buffer_ALREADY_DEFINED
+#undef yy_init_buffer
+#endif
+#ifndef yy_flush_buffer_ALREADY_DEFINED
+#undef yy_flush_buffer
+#endif
+#ifndef yy_load_buffer_state_ALREADY_DEFINED
+#undef yy_load_buffer_state
+#endif
+#ifndef yy_switch_to_buffer_ALREADY_DEFINED
+#undef yy_switch_to_buffer
+#endif
+#ifndef yypush_buffer_state_ALREADY_DEFINED
+#undef yypush_buffer_state
+#endif
+#ifndef yypop_buffer_state_ALREADY_DEFINED
+#undef yypop_buffer_state
+#endif
+#ifndef yyensure_buffer_stack_ALREADY_DEFINED
+#undef yyensure_buffer_stack
+#endif
+#ifndef yylex_ALREADY_DEFINED
+#undef yylex
+#endif
+#ifndef yyrestart_ALREADY_DEFINED
+#undef yyrestart
+#endif
+#ifndef yylex_init_ALREADY_DEFINED
+#undef yylex_init
+#endif
+#ifndef yylex_init_extra_ALREADY_DEFINED
+#undef yylex_init_extra
+#endif
+#ifndef yylex_destroy_ALREADY_DEFINED
+#undef yylex_destroy
+#endif
+#ifndef yyget_debug_ALREADY_DEFINED
+#undef yyget_debug
+#endif
+#ifndef yyset_debug_ALREADY_DEFINED
+#undef yyset_debug
+#endif
+#ifndef yyget_extra_ALREADY_DEFINED
+#undef yyget_extra
+#endif
+#ifndef yyset_extra_ALREADY_DEFINED
+#undef yyset_extra
+#endif
+#ifndef yyget_in_ALREADY_DEFINED
+#undef yyget_in
+#endif
+#ifndef yyset_in_ALREADY_DEFINED
+#undef yyset_in
+#endif
+#ifndef yyget_out_ALREADY_DEFINED
+#undef yyget_out
+#endif
+#ifndef yyset_out_ALREADY_DEFINED
+#undef yyset_out
+#endif
+#ifndef yyget_leng_ALREADY_DEFINED
+#undef yyget_leng
+#endif
+#ifndef yyget_text_ALREADY_DEFINED
+#undef yyget_text
+#endif
+#ifndef yyget_lineno_ALREADY_DEFINED
+#undef yyget_lineno
+#endif
+#ifndef yyset_lineno_ALREADY_DEFINED
+#undef yyset_lineno
+#endif
+#ifndef yyget_column_ALREADY_DEFINED
+#undef yyget_column
+#endif
+#ifndef yyset_column_ALREADY_DEFINED
+#undef yyset_column
+#endif
+#ifndef yywrap_ALREADY_DEFINED
+#undef yywrap
+#endif
+#ifndef yyget_lval_ALREADY_DEFINED
+#undef yyget_lval
+#endif
+#ifndef yyset_lval_ALREADY_DEFINED
+#undef yyset_lval
+#endif
+#ifndef yyget_lloc_ALREADY_DEFINED
+#undef yyget_lloc
+#endif
+#ifndef yyset_lloc_ALREADY_DEFINED
+#undef yyset_lloc
+#endif
+#ifndef yyalloc_ALREADY_DEFINED
+#undef yyalloc
+#endif
+#ifndef yyrealloc_ALREADY_DEFINED
+#undef yyrealloc
+#endif
+#ifndef yyfree_ALREADY_DEFINED
+#undef yyfree
+#endif
+#ifndef yytext_ALREADY_DEFINED
+#undef yytext
+#endif
+#ifndef yyleng_ALREADY_DEFINED
+#undef yyleng
+#endif
+#ifndef yyin_ALREADY_DEFINED
+#undef yyin
+#endif
+#ifndef yyout_ALREADY_DEFINED
+#undef yyout
+#endif
+#ifndef yy_flex_debug_ALREADY_DEFINED
+#undef yy_flex_debug
+#endif
+#ifndef yylineno_ALREADY_DEFINED
+#undef yylineno
+#endif
+#ifndef yytables_fload_ALREADY_DEFINED
+#undef yytables_fload
+#endif
+#ifndef yytables_destroy_ALREADY_DEFINED
+#undef yytables_destroy
+#endif
+#ifndef yyTABLES_NAME_ALREADY_DEFINED
+#undef yyTABLES_NAME
+#endif
+
+#line 46 "fmd_scanner.l"
-#line 324 "fmd_scanner.h_shipped"
+#line 475 "fmd_scanner.h_shipped"
#undef yyIN_HEADER
#endif /* yyHEADER_H */
diff --git a/util/cbfstool/fmd_scanner.l b/util/cbfstool/fmd_scanner.l
index be9a5de..50adbf4 100644
--- a/util/cbfstool/fmd_scanner.l
+++ b/util/cbfstool/fmd_scanner.l
@@ -35,6 +35,7 @@
<FLAGS>\) BEGIN(INITIAL); return *yytext;
<FLAGS>CBFS return FLAG_CBFS;
<FLAGS>PRESERVE return FLAG_PRESERVE;
+<FLAGS>ALIGNED return FLAG_ALIGNED;
0{MULTIPLIER}? |
[1-9][0-9]*{MULTIPLIER}? return parse_integer(yytext, 10);
0[0-9]+{MULTIPLIER}? return OCTAL;
--
To view, visit https://review.coreboot.org/c/coreboot/+/37262
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I26b394590c28667a4afcd521c7caa2009b5b98a9
Gerrit-Change-Number: 37262
Gerrit-PatchSet: 1
Gerrit-Owner: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-MessageType: newchange
8
63

Sept. 8, 2023
Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39658 )
Change subject: [DO NOT MERGE] q1900m
......................................................................
[DO NOT MERGE] q1900m
Change-Id: Id029074e4231db231a68bc92a4210dc052bba1c9
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
---
A src/mainboard/asrock/q1900m/Kconfig
A src/mainboard/asrock/q1900m/Kconfig.name
A src/mainboard/asrock/q1900m/Makefile.inc
A src/mainboard/asrock/q1900m/acpi/dptf.asl
A src/mainboard/asrock/q1900m/acpi/ec.asl
A src/mainboard/asrock/q1900m/acpi/superio.asl
A src/mainboard/asrock/q1900m/acpi_tables.c
A src/mainboard/asrock/q1900m/board_info.txt
A src/mainboard/asrock/q1900m/devicetree.cb
A src/mainboard/asrock/q1900m/dsdt.asl
A src/mainboard/asrock/q1900m/fadt.c
A src/mainboard/asrock/q1900m/gpio.c
A src/mainboard/asrock/q1900m/irqroute.c
A src/mainboard/asrock/q1900m/irqroute.h
A src/mainboard/asrock/q1900m/mainboard.c
A src/mainboard/asrock/q1900m/romstage.c
A src/mainboard/asrock/q1900m/spd/spd0.spd.hex
A src/mainboard/asrock/q1900m/spd/spd1.spd.hex
18 files changed, 841 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/58/39658/1
diff --git a/src/mainboard/asrock/q1900m/Kconfig b/src/mainboard/asrock/q1900m/Kconfig
new file mode 100644
index 0000000..79db93c
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/Kconfig
@@ -0,0 +1,28 @@
+## SPDX-License-Identifier: GPL-2.0-only
+## This file is part of the coreboot project.
+
+if BOARD_ASROCK_Q1900M
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select SOC_INTEL_BAYTRAIL
+ select BOARD_ROMSIZE_KB_8192
+ select HAVE_ACPI_TABLES
+ select HAVE_ACPI_RESUME
+ select SUPERIO_NUVOTON_NCT6776
+ select SUPERIO_NUVOTON_NCT6776_COM_A
+ select MAINBOARD_HAS_CHROMEOS
+
+config MAINBOARD_DIR
+ string
+ default "asrock/q1900m"
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "Q1900M"
+
+config VGA_BIOS_FILE
+ string
+ default "pci8086,0f31.rom"
+
+endif
diff --git a/src/mainboard/asrock/q1900m/Kconfig.name b/src/mainboard/asrock/q1900m/Kconfig.name
new file mode 100644
index 0000000..1056ef9
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_ASROCK_Q1900M
+ bool "Q1900M"
diff --git a/src/mainboard/asrock/q1900m/Makefile.inc b/src/mainboard/asrock/q1900m/Makefile.inc
new file mode 100644
index 0000000..8947e78
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/Makefile.inc
@@ -0,0 +1,24 @@
+## SPDX-License-Identifier: GPL-2.0-only
+## This file is part of the coreboot project.
+
+SPD_BIN = $(obj)/spd.bin
+
+SPD_SOURCES = spd0
+SPD_SOURCES += spd1
+
+SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(f).spd.hex)
+
+# Include spd ROM data
+$(SPD_BIN): $(SPD_DEPS)
+ for f in $+; \
+ do for c in $$(cat $$f | grep -v ^#); \
+ do printf $$(printf '\%o' 0x$$c); \
+ done; \
+ done > $@
+
+cbfs-files-y += spd.bin
+spd.bin-file := $(SPD_BIN)
+spd.bin-type := spd
+
+ramstage-y += irqroute.c
+ramstage-y += gpio.c
diff --git a/src/mainboard/asrock/q1900m/acpi/dptf.asl b/src/mainboard/asrock/q1900m/acpi/dptf.asl
new file mode 100644
index 0000000..bdc396b
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/acpi/dptf.asl
@@ -0,0 +1,66 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#define DPTF_CPU_PASSIVE 80
+#define DPTF_CPU_CRITICAL 105
+
+#define DPTF_TSR0_SENSOR_ID 1
+#define DPTF_TSR0_SENSOR_NAME "TMP432_Internal"
+#define DPTF_TSR0_PASSIVE 48
+#define DPTF_TSR0_CRITICAL 80
+
+#define DPTF_TSR1_SENSOR_ID 2
+#define DPTF_TSR1_SENSOR_NAME "TMP432_Power_top"
+#define DPTF_TSR1_PASSIVE 60
+#define DPTF_TSR1_CRITICAL 80
+
+#define DPTF_TSR2_SENSOR_ID 3
+#define DPTF_TSR2_SENSOR_NAME "TMP432_CPU_bottom"
+#define DPTF_TSR2_PASSIVE 55
+#define DPTF_TSR2_CRITICAL 80
+
+/* Mainboard specific _PDL is 1GHz */
+Name (MPDL, 8)
+
+Name (DTRT, Package () {
+ /* CPU Throttle Effect on CPU */
+ Package () { \_SB.DPTF.TCPU, \_SB.DPTF.TCPU, 100, 50, 0, 0, 0, 0 },
+
+ /* CPU Effect on Temp Sensor 0 */
+ Package () { \_SB.DPTF.TCPU, \_SB.DPTF.TSR0, 100, 600, 0, 0, 0, 0 },
+
+#ifdef DPTF_ENABLE_CHARGER
+ /* Charger Effect on Temp Sensor 1 */
+ Package () { \_SB.DPTF.TCHG, \_SB.DPTF.TSR1, 200, 600, 0, 0, 0, 0 },
+#endif
+
+ /* CPU Effect on Temp Sensor 1 */
+ Package () { \_SB.DPTF.TCPU, \_SB.DPTF.TSR1, 100, 600, 0, 0, 0, 0 },
+
+ /* CPU Effect on Temp Sensor 2 */
+ Package () { \_SB.DPTF.TCPU, \_SB.DPTF.TSR2, 100, 600, 0, 0, 0, 0 },
+})
+
+Name (MPPC, Package ()
+{
+ 0x2, // Revision
+ Package () { // Power Limit 1
+ 0, // PowerLimitIndex, 0 for Power Limit 1
+ 1600, // PowerLimitMinimum
+ 6200, // PowerLimitMaximum
+ 1000, // TimeWindowMinimum
+ 1000, // TimeWindowMaximum
+ 200 // StepSize
+ },
+ Package () { // Power Limit 2
+ 1, // PowerLimitIndex, 1 for Power Limit 2
+ 8000, // PowerLimitMinimum
+ 8000, // PowerLimitMaximum
+ 1000, // TimeWindowMinimum
+ 1000, // TimeWindowMaximum
+ 1000 // StepSize
+ }
+})
+
+/* Include SoC DPTF */
+#include <soc/intel/baytrail/acpi/dptf/dptf.asl>
diff --git a/src/mainboard/asrock/q1900m/acpi/ec.asl b/src/mainboard/asrock/q1900m/acpi/ec.asl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/acpi/ec.asl
diff --git a/src/mainboard/asrock/q1900m/acpi/superio.asl b/src/mainboard/asrock/q1900m/acpi/superio.asl
new file mode 100644
index 0000000..e224349
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/acpi/superio.asl
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* This file is part of the coreboot project. */
+
+#define SUPERIO_DEV SIO0
+#define SUPERIO_PNP_BASE 0x2e
+#define NCT6776_SHOW_PP
+#define NCT6776_SHOW_SP1
+#define NCT6776_SHOW_KBC
+#define NCT6776_SHOW_HWM
+
+#undef NCT6776_SHOW_GPIO
+
+#include <superio/nuvoton/nct6776/acpi/superio.asl>
diff --git a/src/mainboard/asrock/q1900m/acpi_tables.c b/src/mainboard/asrock/q1900m/acpi_tables.c
new file mode 100644
index 0000000..c8a95c6
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/acpi_tables.c
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <types.h>
+#include <string.h>
+#include <arch/acpi.h>
+#include <arch/ioapic.h>
+#include <arch/smp/mpspec.h>
+#include <device/device.h>
+#include <device/pci.h>
+#include <soc/acpi.h>
+#include <soc/nvs.h>
+#include <soc/iomap.h>
+
+void acpi_create_gnvs(global_nvs_t *gnvs)
+{
+ acpi_init_gnvs(gnvs);
+}
+
+unsigned long acpi_fill_madt(unsigned long current)
+{
+ /* Local APICs */
+ current = acpi_create_madt_lapics(current);
+
+ /* IOAPIC */
+ current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, 2, IO_APIC_ADDR, 0);
+
+ current = acpi_madt_irq_overrides(current);
+
+ return current;
+}
diff --git a/src/mainboard/asrock/q1900m/board_info.txt b/src/mainboard/asrock/q1900m/board_info.txt
new file mode 100644
index 0000000..d3e1fc2
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/board_info.txt
@@ -0,0 +1,6 @@
+Category: desktop
+Board URL: https://www.asrock.com/mb/Intel/Q1900M/
+ROM package: SOIC-8
+ROM protocol: SPI
+ROM socketed: possible
+Flashrom support: y
diff --git a/src/mainboard/asrock/q1900m/devicetree.cb b/src/mainboard/asrock/q1900m/devicetree.cb
new file mode 100644
index 0000000..3085696
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/devicetree.cb
@@ -0,0 +1,118 @@
+chip soc/intel/baytrail
+
+ # SATA port enable mask (2 ports)
+ register "sata_port_map" = "0x1"
+ register "sata_ahci" = "1"
+ register "ide_legacy_combined" = "0"
+
+ # Route USB ports to XHCI
+ register "usb_route_to_xhci" = "1"
+
+ # USB Port Disable Mask
+ register "usb2_port_disable_mask" = "0"
+ register "usb3_port_disable_mask" = "0"
+
+ # USB PHY settings
+ # TODO: These values are from Baytrail and need tuning for Q1900M board
+ register "usb2_per_port_lane0" = "0x00049a09"
+ register "usb2_per_port_rcomp_hs_pullup0" = "0x0300401d"
+ register "usb2_per_port_lane1" = "0x00049a09"
+ register "usb2_per_port_rcomp_hs_pullup1" = "0x0300401d"
+ register "usb2_per_port_lane2" = "0x00049209"
+ register "usb2_per_port_rcomp_hs_pullup2" = "0x01004015"
+ register "usb2_per_port_lane3" = "0x00049a09"
+ register "usb2_per_port_rcomp_hs_pullup3" = "0x0300401d"
+ register "usb2_comp_bg" = "0x4700"
+
+ # Allow PCIe devices to wake system from suspend
+ register "pcie_wake_enable" = "1"
+
+ # Enable PIPEA as DP_C
+ #register "gpu_pipea_port_select" = "2" # DP_C
+ #register "gpu_pipea_power_cycle_delay" = "6" # 600ms
+ #register "gpu_pipea_power_on_delay" = "5000" # 500ms
+ #register "gpu_pipea_light_on_delay" = "70" # 7ms
+ #register "gpu_pipea_power_off_delay" = "500" # 50ms
+ #register "gpu_pipea_light_off_delay" = "2000" # 200ms
+
+ # VR PS2 control
+ register "vnn_ps2_enable" = "1"
+ register "vcc_ps2_enable" = "1"
+
+ # Disable SLP_X stretching after SUS power well fail.
+ register "disable_slp_x_stretch_sus_fail" = "1"
+
+ device cpu_cluster 0 on
+ device lapic 0 on end
+ end
+ device domain 0 on
+ device pci 00.0 on end # SoC router
+ device pci 02.0 on end # GFX
+ device pci 11.0 off end # SDIO
+ device pci 12.0 off end # SD
+ device pci 13.0 on end # SATA
+ device pci 14.0 on end # XHCI
+ device pci 15.0 off end # LPE
+ device pci 17.0 off end # MMC
+ device pci 18.0 off end # SIO_DMA1
+ device pci 18.1 off end # I2C1
+ device pci 18.2 off end # I2C2
+ device pci 18.3 off end # I2C3
+ device pci 18.4 off end # I2C4
+ device pci 18.5 off end # I2C5
+ device pci 18.6 off end # I2C6
+ device pci 18.7 off end # I2C7
+ device pci 1a.0 on end # TXE
+ device pci 1b.0 on end # HDA
+ device pci 1c.0 on end # PCIE_PORT1
+ device pci 1c.1 on end # PCIE_PORT2
+ device pci 1c.2 on end # PCIE_PORT3
+ device pci 1c.3 on end # PCIE_PORT4
+ device pci 1d.0 on end # EHCI
+ device pci 1e.0 off end # SIO_DMA2
+ device pci 1e.1 off end # PWM1
+ device pci 1e.2 off end # PWM2
+ device pci 1e.3 off end # HSUART1
+ device pci 1e.4 off end # HSUART2
+ device pci 1e.5 off end # SPI
+ device pci 1f.0 on # LPC Bridge
+ chip superio/nuvoton/nct6776
+ device pnp 2e.0 off end # Floppy
+ device pnp 2e.1 on # Parallel port
+ io 0x60 = 0x378
+ irq 0x70 = 5
+ drq 0x74 = 3
+ end
+ device pnp 2e.2 on # COM1
+ io 0x60 = 0x3f8
+ irq 0x70 = 4
+ end
+ device pnp 2e.3 off end # COM2, IR
+ device pnp 2e.5 off # Keyboard
+ #io 0x60 = 0x60
+ #io 0x62 = 0x64
+ #irq 0x70 = 1
+ #irq 0x72 = 12
+ end
+ device pnp 2e.6 off end # CIR
+ device pnp 2e.7 off end # GPIO6-9
+ device pnp 2e.8 off end # WDT1, GPIO0, GPIO1, GPIOA
+ device pnp 2e.9 off end # GPIO2-5
+ device pnp 2e.a on # ACPI
+ irq 0xe3 = 0x14
+ irq 0xe6 = 0x4c
+ end
+ device pnp 2e.b on # HWM, LED
+ io 0x60 = 0x0290
+ end
+ device pnp 2e.d on end # VID
+ device pnp 2e.e off end # CIR WAKE-UP
+ device pnp 2e.f off end # GPIO Push-Pull or Open-drain
+ device pnp 2e.14 off end # SVID
+ device pnp 2e.16 on end # Deep Sleep
+ device pnp 2e.17 off end # GPIOA
+ end
+ end
+ device pci 1f.3 on end # SMBus
+ end
+end
diff --git a/src/mainboard/asrock/q1900m/dsdt.asl b/src/mainboard/asrock/q1900m/dsdt.asl
new file mode 100644
index 0000000..2e9de53
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/dsdt.asl
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <arch/acpi.h>
+
+DefinitionBlock(
+ "dsdt.aml",
+ "DSDT",
+ 0x02, // DSDT revision: ACPI v2.0 and up
+ OEM_ID,
+ ACPI_TABLE_CREATOR,
+ 0x20110725 // OEM revision
+)
+{
+ #include <soc/intel/baytrail/acpi/platform.asl>
+ #include <soc/intel/baytrail/acpi/globalnvs.asl>
+ #include <cpu/intel/common/acpi/cpu.asl>
+
+ Scope (\_SB) {
+ Device (PCI0)
+ {
+ //#include <soc/intel/baytrail/acpi/northcluster.asl>
+ #include <soc/intel/baytrail/acpi/southcluster.asl>
+ }
+
+ /* Dynamic Platform Thermal Framework */
+ //#include "acpi/dptf.asl"
+ }
+
+ #include <southbridge/intel/common/acpi/sleepstates.asl>
+}
diff --git a/src/mainboard/asrock/q1900m/fadt.c b/src/mainboard/asrock/q1900m/fadt.c
new file mode 100644
index 0000000..d07d157
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/fadt.c
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <string.h>
+#include <soc/acpi.h>
+#include <version.h>
+
+void acpi_create_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt)
+{
+ acpi_header_t *header = &(fadt->header);
+
+ memset((void *) fadt, 0, sizeof(acpi_fadt_t));
+ memcpy(header->signature, "FACP", 4);
+ header->length = sizeof(acpi_fadt_t);
+ header->revision = get_acpi_table_revision(FADT);
+ memcpy(header->oem_id, OEM_ID, 6);
+ memcpy(header->oem_table_id, ACPI_TABLE_CREATOR, 8);
+ memcpy(header->asl_compiler_id, ASLC, 4);
+ header->asl_compiler_revision = asl_revision;
+
+ fadt->firmware_ctrl = (unsigned long) facs;
+ fadt->dsdt = (unsigned long) dsdt;
+ fadt->reserved = 0;
+ fadt->preferred_pm_profile = PM_DESKTOP;
+
+ fadt->x_firmware_ctl_l = (unsigned long)facs;
+ fadt->x_firmware_ctl_h = 0;
+ fadt->x_dsdt_l = (unsigned long)dsdt;
+ fadt->x_dsdt_h = 0;
+
+ acpi_fill_in_fadt(fadt);
+
+ header->checksum = acpi_checksum((void *) fadt, header->length);
+}
diff --git a/src/mainboard/asrock/q1900m/gpio.c b/src/mainboard/asrock/q1900m/gpio.c
new file mode 100644
index 0000000..c1dfef9
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/gpio.c
@@ -0,0 +1,232 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <stdlib.h>
+#include <soc/gpio.h>
+#include "irqroute.h"
+
+/*
+ * For multiplexed functions, look in EDS:
+ * 10.3 Ball Name and Function by Location
+ *
+ * Note that Pad Number differs from GPIO Number. The pads list is in the BWG Vol2 Rev1p0.
+ * Chapter 35: GPIO Handling
+ * Table 35-2: Pad Number Mapping According to Pad Name
+ */
+
+ #define GPIO_INNC GPIO_INPUT_NOPU
+ #define GPIO_FS GPIO_INPUT_NOPU
+
+/* DDI0 = HDMI; DDI1 = DVI; no backlight used on either pipe */
+
+/* NCORE GPIOs */ /* Map [15..26] to MCSI_GPIO[00..11] */
+static const struct soc_gpio_map gpncore_gpio_map[] = {
+ GPIO_FUNC2, /* [00] - HDMI DDC Detect */ // DDI0_HPD
+ GPIO_FUNC2, /* [01] - HDMI DDC Data */ // DDI0_DDCDATA
+ GPIO_FUNC2, /* [02] - HDMI DDC Clock */ // DDI0_DDCCLK
+ GPIO_INNC, /* [03] - No Connect */ // DDI0_VDDEN
+ GPIO_INNC, /* [04] - No Connect */ // DDI0_BKLTEN
+ GPIO_INNC, /* [05] - No Connect */ // DDI0_BKLTCTL
+ GPIO_FUNC2, /* [06] - DVI DDC Detect */ // DDI1_HPD
+ GPIO_FUNC2, /* [07] - DVI DDC Data */ // DDI1_DDCDATA
+ GPIO_FUNC2, /* [08] - DVI DDC Clock */ // DDI1_DDCCLK
+ GPIO_INNC, /* [09] - No Connect */ // DDI1_VDDEN
+ GPIO_INNC, /* [10] - No Connect */ // DDI1_BKLTEN
+ GPIO_INNC, /* [11] - No Connect */ // DDI1_BKLTCTL
+ GPIO_INNC, /* [12] - No Connect */ // RESERVED
+ GPIO_FS, /* [13] - No Connect */ // RESERVED (removed in EDS_Rev1p5)
+ GPIO_INNC, /* [14] - No Connect */ // RESERVED
+ GPIO_INNC, /* [15] - No Connect */ // OBSFN_C0 (XDP stuff)
+ GPIO_INNC, /* [16] - No Connect */ // XDP stuff
+ GPIO_INNC, /* [17] - No Connect */ // XDP stuff
+ GPIO_INNC, /* [18] - No Connect */ // XDP stuff
+ GPIO_INNC, /* [19] - No Connect */ // XDP stuff
+ GPIO_INNC, /* [20] - No Connect */ // XDP stuff
+ GPIO_INNC, /* [21] - No Connect */ // XDP stuff
+ GPIO_INNC, /* [22] - No Connect */ // XDP stuff
+ GPIO_INNC, /* [23] - No Connect */ // XDP stuff
+ GPIO_INNC, /* [24] - No Connect */ // Still camera 0 reset
+ GPIO_INNC, /* [25] - No Connect */ // Still camera 1 reset
+ GPIO_INNC, /* [26] - No Connect */ // Video camera reset
+ GPIO_END
+};
+
+/* SCORE GPIOs (_XX) */
+static const struct soc_gpio_map gpscore_gpio_map[] = {
+ GPIO_FS, /* [000] - SATA_GP0 */ // SHOULD BE A PULL-UP, BUT READS LOW!
+ GPIO_FS, /* [001] - SATA_GP1 */ // EXTERNAL PULL UP
+ GPIO_FUNC1, /* [002] - SATA_LED_B */ // HDD LED
+ GPIO_FUNC1, /* [003] - PCIE_CLKREQ_0 */ // CLKREQ# FOR TOP PCIE X1
+ GPIO_FUNC1, /* [004] - PCIE_CLKREQ_1 */ // CLKREQ# FOR PCIE X4
+ GPIO_FUNC1, /* [005] - PCIE_CLKREQ_2 */ // CLKREQ# FOR BOTTOM PCIE X1
+ GPIO_FUNC1, /* [006] - PCIE_CLKREQ_3 */ // CLKREQ# FOR LAN
+ GPIO_INNC, /* [007] - SD3_WP */ // NO CONNECT
+ GPIO_FUNC2, /* [008] - No Connect */ // HDA RESET
+ GPIO_FUNC2, /* [009] - No Connect */ // HDA SYNC
+ GPIO_FUNC2, /* [010] - No Connect */ // HDA CLK
+ GPIO_FUNC2, /* [011] - No Connect */ // HDA SDO
+ GPIO_FUNC2, /* [012] - No Connect */ // HDA SDI0
+ GPIO_INNC, /* [013] - No Connect */ // NO CONNECT
+ GPIO_FS, /* [014] - No Connect */ // OTE_GATE1 !!!
+ GPIO_FS, /* [015] - No Connect */ // OTE_GATE2 !!!
+ GPIO_INNC, /* [016] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [017] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [018] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [019] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [020] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [021] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [022] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [023] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [024] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [025] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [026] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [027] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [028] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [029] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [030] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [031] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [032] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [033] - SD3_CLK */ // NO CONNECT
+ GPIO_INNC, /* [034] - SD3_D0 */ // NO CONNECT
+ GPIO_INNC, /* [035] - SD3_D1 */ // NO CONNECT
+ GPIO_INNC, /* [036] - SD3_D2 */ // NO CONNECT
+ GPIO_INNC, /* [037] - SD3_D3 */ // NO CONNECT
+ GPIO_INNC, /* [038] - SD3_CD# */ // NO CONNECT
+ GPIO_INNC, /* [039] - SD3_CMD */ // NO CONNECT
+ GPIO_INNC, /* [040] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [041] - SD3_PWREN */ // NO CONNECT
+ GPIO_FUNC1, /* [042] - No Connect */ // LAD0
+ GPIO_FUNC1, /* [043] - No Connect */ // LAD1
+ GPIO_FUNC1, /* [044] - No Connect */ // LAD2
+ GPIO_FUNC1, /* [045] - No Connect */ // LAD3
+ GPIO_FUNC1, /* [046] - No Connect */ // LFRAME#
+ GPIO_FUNC1, /* [047] - No Connect */ // LPC CLOCK (TPM)
+ GPIO_FUNC1, /* [048] - No Connect */ // LPC CLOCK (SIO)
+ GPIO_FUNC1, /* [049] - No Connect */ // LPC CLKRUN#
+ GPIO_FUNC1, /* [050] - No Connect */ // SERIRQ#
+ GPIO_FUNC1, /* [051] - PCU_SMB_DATA */ // SMBUS DATA
+ GPIO_FUNC1, /* [052] - PCU_SMB_CLK */ // SMBUS CLK
+ GPIO_FUNC1, /* [053] - PCU_SMB_ALERT */ // SMBUS ALERT# (UNUSED? STRAP?)
+ GPIO_FUNC1, /* [054] - ILB_8254_SPKR */ // SPEAKER
+ GPIO_FS, /* [055] - No Connect */ // FRONT PANEL PRESENCE (PIN 4)
+ GPIO_FS, /* [056] - _56 */ // TOP SWAP (DEFEATURE)
+ GPIO_INNC, /* [057] - PCU_UART3_TXD */ // NO CONNECT
+ GPIO_INNC, /* [058] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [059] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [060] - No Connect */ // NO CONNECT
+ GPIO_FS, /* [061] - PCU_UART3_RXD */ // PCIE3_SEL !!!
+ GPIO_INNC, /* [062] - LPE_I2S_CLK */ // NO CONNECT
+ GPIO_FS, /* [063] - LPE_I2S_FRM */ // BOOT SEL STRAP
+ GPIO_INNC, /* [064] - LPE_I2S_DATIN */ // NO CONNECT
+ GPIO_FS, /* [065] - LPE_I2S_DATOUT */ // IFD OVERRIDE STRAP
+ GPIO_INNC, /* [066] - SOC_SIO_SPI_CS1 */ // NO CONNECT
+ GPIO_INNC, /* [067] - SOC_SIO_SPI_MISO */ // NO CONNECT
+ GPIO_INNC, /* [068] - SOC_SIO_SPI_MOSI */ // NO CONNECT
+ GPIO_INNC, /* [069] - SOC_SIO_SPI_CLK */ // NO CONNECT
+ GPIO_INNC, /* [070] - SIO_UART1_RXD */ // NO CONNECT
+ GPIO_INNC, /* [071] - SIO_UART1_TXD */ // NO CONNECT
+ GPIO_INNC, /* [072] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [073] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [074] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [075] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [076] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [077] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [078] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [079] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [080] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [081] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [082] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [083] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [084] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [085] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [086] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [087] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [088] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [089] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [090] - EXP_I2C_SDA */ // NO CONNECT
+ GPIO_INNC, /* [091] - EXP_I2C_SCL */ // NO CONNECT
+ GPIO_FS, /* [092] - 0R GND? */ // PCIE1_SEL !!!
+ GPIO_FS, /* [093] - 0R GND? */ // PCIE2_SEL !!!
+ GPIO_INNC, /* [094] - SOC_PWM0 */ // NO CONNECT
+ GPIO_INNC, /* [095] - SOC_PWM1 */ // NO CONNECT
+ GPIO_FUNC1, /* [096] - No Connect */ // PMC PLT CLK0
+ GPIO_FUNC1, /* [097] - No Connect */ // PMC PLT CLK1
+ GPIO_INNC, /* [098] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [099] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [100] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [101] - No Connect */ // NO CONNECT
+ GPIO_END
+};
+
+/* SSUS GPIOs () */
+static const struct soc_gpio_map gp_ssus_gpio_map[] = {
+ GPIO_FS, /* [00] - No Connect */ // RINGIN# !!!
+ GPIO_INNC, /* [01] - PMC_WAKE_PCIE[1] */ // NO CONNECT
+ GPIO_INNC, /* [02] - PMC_WAKE_PCIE[2] */ // PME# (SIO)
+ GPIO_INNC, /* [03] - PMC_WAKE_PCIE[3] */ // SMI# (SIO)
+ GPIO_INNC, /* [04] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [05] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [06] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [07] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [08] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [09] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [10] - _10_UNLOCK */ // NO CONNECT
+ GPIO_FUNC0, /* [11] - SUSPWRDNACK */ // SUSPWRDNACK
+ GPIO_FS, /* [12] - No Connect */ // NO CONNECT ???
+ GPIO_INNC, /* [13] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [14] - 14_J20 */ // NO CONNECT
+ GPIO_FUNC0, /* [15] - PMC_WAKE_PCIE[0] */ // SOC PCIE WAKE#
+ GPIO_FUNC0, /* [16] - No Connect */ // POWER BUTTON (SIO)
+ GPIO_INNC, /* [17] - No Connect */ // NO CONNECT
+ GPIO_FUNC0, /* [18] - T360 */ // SUS STAT#
+ GPIO_FUNC0, /* [19] - SOC_USB_HOST_OC0 */ // USB OC0#
+ GPIO_FUNC0, /* [20] - SOC_USB_HOST_OC1 */ // USB OC1#
+ GPIO_INNC, /* [21] - SOC_SPI_CS1B */ // NO CONNECT
+ GPIO_OUT_LOW, /* [22] - No Connect */ // MEMORY VR VCCM OV1 !!!
+ GPIO_FS, /* [23] - No Connect */ // MEMORY VR VCCM OV2 !!!
+ GPIO_INNC, /* [24] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [25] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [26] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [27] - SW450-1 */ // MBREV0
+ GPIO_INNC, /* [28] - SW450-2 */ // MBREV1
+ GPIO_INNC, /* [29] - SW450-3 */ // MBREV2
+ GPIO_INNC, /* [30] - SW450-4 */ // MBREV3
+ GPIO_INNC, /* [31] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [32] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [33] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [34] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [35] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [36] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [37] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [38] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [39] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [40] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [41] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [42] - No Connect */ // NO CONNECT
+ GPIO_INNC, /* [43] - No Connect */ // NO CONNECT
+ GPIO_END
+};
+
+/*
+static const u8 core_dedicated_irq[GPIO_MAX_DIRQS] = {
+ [I8042_IRQ_OFFSET] = I8042_IRQ_GPIO,
+};
+
+static const u8 sus_dedicated_irq[GPIO_MAX_DIRQS] = {
+ [CODEC_IRQ_OFFSET] = CODEC_IRQ_GPIO,
+};*/
+
+static struct soc_gpio_config gpio_config = {
+ .ncore = gpncore_gpio_map,
+ .score = gpscore_gpio_map,
+ .ssus = gp_ssus_gpio_map,
+ .core_dirq = NULL,
+ .sus_dirq = NULL,
+ //.core_dirq = &core_dedicated_irq,
+ //.sus_dirq = &sus_dedicated_irq,
+};
+
+struct soc_gpio_config* mainboard_get_gpios(void)
+{
+ return &gpio_config;
+}
diff --git a/src/mainboard/asrock/q1900m/irqroute.c b/src/mainboard/asrock/q1900m/irqroute.c
new file mode 100644
index 0000000..df43ee9
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/irqroute.c
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include "irqroute.h"
+
+DEFINE_IRQ_ROUTES;
diff --git a/src/mainboard/asrock/q1900m/irqroute.h b/src/mainboard/asrock/q1900m/irqroute.h
new file mode 100644
index 0000000..3944c9de
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/irqroute.h
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <soc/irq.h>
+#include <soc/pci_devs.h>
+#include <soc/pmc.h>
+
+#define PCI_DEV_PIRQ_ROUTES \
+ PCI_DEV_PIRQ_ROUTE(GFX_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(SDIO_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(SD_DEV, C, D, E, F), \
+ PCI_DEV_PIRQ_ROUTE(SATA_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(XHCI_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(LPE_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(MMC_DEV, D, E, F, G), \
+ PCI_DEV_PIRQ_ROUTE(SIO1_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(TXE_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(HDA_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(PCIE_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(EHCI_DEV, A, B, C, D), \
+ PCI_DEV_PIRQ_ROUTE(SIO2_DEV, B, C, D, E), \
+ PCI_DEV_PIRQ_ROUTE(PCU_DEV, A, B, C, D)
+
+#define PIRQ_PIC_ROUTES \
+ PIRQ_PIC(A, DISABLE), \
+ PIRQ_PIC(B, DISABLE), \
+ PIRQ_PIC(C, DISABLE), \
+ PIRQ_PIC(D, DISABLE), \
+ PIRQ_PIC(E, DISABLE), \
+ PIRQ_PIC(F, DISABLE), \
+ PIRQ_PIC(G, DISABLE), \
+ PIRQ_PIC(H, DISABLE)
+
+/* CORE bank DIRQs - up to 16 supported */
+//#define TPAD_IRQ_OFFSET 0
+//#define TOUCH_IRQ_OFFSET 1
+//#define I8042_IRQ_OFFSET 2
+//#define ALS_IRQ_OFFSET 3
+/* Corresponding SCORE GPIO pins */
+//#define TPAD_IRQ_GPIO 55
+//#define TOUCH_IRQ_GPIO 72
+//#define I8042_IRQ_GPIO 101
+//#define ALS_IRQ_GPIO 70
+
+/* SUS bank DIRQs - up to 16 supported */
+//#define CODEC_IRQ_OFFSET 0
+/* Corresponding SUS GPIO pins */
+//#define CODEC_IRQ_GPIO 9
diff --git a/src/mainboard/asrock/q1900m/mainboard.c b/src/mainboard/asrock/q1900m/mainboard.c
new file mode 100644
index 0000000..09d807d
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/mainboard.c
@@ -0,0 +1,129 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <types.h>
+#include <string.h>
+#include <device/device.h>
+#include <device/pci_def.h>
+#include <device/pci_ops.h>
+#include <console/console.h>
+#if CONFIG(VGA_ROM_RUN)
+#include <x86emu/x86emu.h>
+#endif
+#include <arch/acpi.h>
+#include <arch/interrupt.h>
+#include <boot/coreboot_tables.h>
+#include <smbios.h>
+//#include <variant/onboard.h>
+#include <soc/gpio.h>
+#include <bootstate.h>
+#include <vendorcode/google/chromeos/chromeos.h>
+
+void mainboard_suspend_resume(void)
+{
+}
+
+#if CONFIG(VGA_ROM_RUN)
+static int int15_handler(void)
+{
+ int res = 1;
+
+ printk(BIOS_DEBUG, "%s: AX=%04x BX=%04x CX=%04x DX=%04x\n",
+ __func__, X86_AX, X86_BX, X86_CX, X86_DX);
+
+ switch (X86_AX) {
+ case 0x5f34:
+ /*
+ * Set Panel Fitting Hook:
+ * bit 2 = Graphics Stretching
+ * bit 1 = Text Stretching
+ * bit 0 = Centering (do not set with bit1 or bit2)
+ * 0 = video bios default
+ */
+ X86_AX = 0x005f;
+ X86_CX = 0x0001;
+ res = 1;
+ break;
+ case 0x5f35:
+ /*
+ * Boot Display Device Hook:
+ * bit 0 = CRT
+ * bit 1 = TV
+ * bit 2 = EFP (HDMI)
+ * bit 3 = LFP (eDP)*
+ * bit 4 = CRT2
+ * bit 5 = TV2
+ * bit 6 = EFP2
+ * bit 7 = LFP2
+ */
+ X86_AX = 0x005f;
+ X86_CX = 0x0008;
+ res = 1;
+ break;
+ case 0x5f51:
+ /*
+ * Hook to select active LFP configuration:
+ * 00h = No LVDS, VBIOS does not enable LVDS
+ * 01h = Int-LVDS, LFP driven by integrated LVDS decoder
+ * 02h = SVDO-LVDS, LFP driven by SVDO decoder
+ * 03h = eDP, LFP Driven by Int-DisplayPort encoder
+ */
+ X86_AX = 0x005f;
+ X86_CX = 0x0003;
+ res = 1;
+ break;
+ case 0x5f70:
+ switch ((X86_CX >> 8) & 0xff) {
+ case 0:
+ /* Get Mux */
+ X86_AX = 0x005f;
+ X86_CX = 0x0000;
+ res = 1;
+ break;
+ case 1:
+ /* Set Mux */
+ X86_AX = 0x005f;
+ X86_CX = 0x0000;
+ res = 1;
+ break;
+ case 2:
+ /* Get SG/Non-SG mode */
+ X86_AX = 0x005f;
+ X86_CX = 0x0000;
+ res = 1;
+ break;
+ default:
+ /* Interrupt was not handled */
+ printk(BIOS_DEBUG,
+ "Unknown INT15 5f70 function: 0x%02x\n",
+ ((X86_CX >> 8) & 0xff));
+ break;
+ }
+ break;
+
+ default:
+ printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", X86_AX);
+ break;
+ }
+ return res;
+}
+#endif
+
+//static void mainboard_init(struct device *dev) {}
+
+// mainboard_enable is executed as first thing after
+// enumerate_buses().
+
+static void mainboard_enable(struct device *dev)
+{
+ //dev->ops->init = mainboard_init;
+ dev->ops->acpi_inject_dsdt_generator = chromeos_dsdt_generator;
+#if CONFIG(VGA_ROM_RUN)
+ /* Install custom int15 handler for VGA OPROM */
+ mainboard_interrupt_handlers(0x15, &int15_handler);
+#endif
+}
+
+struct chip_operations mainboard_ops = {
+ .enable_dev = mainboard_enable,
+};
diff --git a/src/mainboard/asrock/q1900m/romstage.c b/src/mainboard/asrock/q1900m/romstage.c
new file mode 100644
index 0000000..7a4d5a6
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/romstage.c
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <stdint.h>
+#include <string.h>
+#include <cbfs.h>
+#include <console/console.h>
+#include <soc/gpio.h>
+#include <soc/mrc_wrapper.h>
+#include <soc/romstage.h>
+
+void mainboard_romstage_entry(struct romstage_params *rp)
+{
+ /* I'm a bit desperate. */
+ printk(BIOS_EMERG, "AAAAAAAA WE LIVEEEEEEEEEE\n");
+ void *spd;
+ size_t spd_fsize;
+
+ struct mrc_params mp = {
+ .mainboard = {
+ .dram_type = DRAM_DDR3,
+ .dram_info_location = DRAM_INFO_SPD_MEM,
+ .weaker_odt_settings = 1,
+ .dram_is_slotted = 1,
+ .spd_addrs = {0xf0, 0x00}
+ },
+ };
+
+ spd = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD, &spd_fsize);
+
+ if (!spd)
+ die("SPD data not found.");
+
+ mp.mainboard.dram_data[0] = spd;
+ //mp.mainboard.dram_data[1] = spd;
+
+ rp->mrc_params = ∓
+ romstage_common(rp);
+}
diff --git a/src/mainboard/asrock/q1900m/spd/spd0.spd.hex b/src/mainboard/asrock/q1900m/spd/spd0.spd.hex
new file mode 100644
index 0000000..8ced790
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/spd/spd0.spd.hex
@@ -0,0 +1,17 @@
+# Hynix HMT425S6CFR6A-PBA
+92 13 0B 03 04 19 02 02 03 52 01 08 0A 00 FE 00
+69 78 69 3C 69 11 18 81 20 08 3C 3C 01 40 83 01
+00 00 00 00 00 00 00 00 00 88 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 0F 11 62 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 80 AD 01 00 00 00 00 00 00 C9 C0
+48 4D 54 34 32 35 53 36 43 46 52 36 41 2D 50 42
+20 20 4E 30 80 AD 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
diff --git a/src/mainboard/asrock/q1900m/spd/spd1.spd.hex b/src/mainboard/asrock/q1900m/spd/spd1.spd.hex
new file mode 100644
index 0000000..8ced790
--- /dev/null
+++ b/src/mainboard/asrock/q1900m/spd/spd1.spd.hex
@@ -0,0 +1,17 @@
+# Hynix HMT425S6CFR6A-PBA
+92 13 0B 03 04 19 02 02 03 52 01 08 0A 00 FE 00
+69 78 69 3C 69 11 18 81 20 08 3C 3C 01 40 83 01
+00 00 00 00 00 00 00 00 00 88 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 0F 11 62 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 80 AD 01 00 00 00 00 00 00 C9 C0
+48 4D 54 34 32 35 53 36 43 46 52 36 41 2D 50 42
+20 20 4E 30 80 AD 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
--
To view, visit https://review.coreboot.org/c/coreboot/+/39658
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id029074e4231db231a68bc92a4210dc052bba1c9
Gerrit-Change-Number: 39658
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newchange
7
21

Change in coreboot[master]: LinuxBoot: fix `make clean` for linux builds
by Alexander Couzens (Code Review) Sept. 5, 2023
by Alexander Couzens (Code Review) Sept. 5, 2023
Sept. 5, 2023
Alexander Couzens has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35438 )
Change subject: LinuxBoot: fix `make clean` for linux builds
......................................................................
LinuxBoot: fix `make clean` for linux builds
The kernel_dir variable was never correct, because targets/linux.mk
is using build directories based on the version e.g. kernel_4.19.73.
Change-Id: I749200bd32d86303ae02903afd96f730ac36b307
Signed-off-by: Alexander Couzens <lynxis(a)fe80.eu>
---
M payloads/external/LinuxBoot/Makefile
1 file changed, 1 insertion(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/35438/1
diff --git a/payloads/external/LinuxBoot/Makefile b/payloads/external/LinuxBoot/Makefile
index 5840e8e..8b81c8a 100644
--- a/payloads/external/LinuxBoot/Makefile
+++ b/payloads/external/LinuxBoot/Makefile
@@ -14,7 +14,6 @@
##
project_dir=linuxboot
-kernel_dir=$(project_dir)/kernel
unexport $(COREBOOT_EXPORTS)
@@ -65,7 +64,7 @@
linuxboot: kernel initramfs_compressed
clean:
- if [ -d "$(kernel_dir)" ]; then rm -rf $(kernel_dir); fi
+ rm -rf $(project_dir)/kernel*
rm -f $(project_dir)/u-root
rm -f $(project_dir)/initramfs*
--
To view, visit https://review.coreboot.org/c/coreboot/+/35438
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I749200bd32d86303ae02903afd96f730ac36b307
Gerrit-Change-Number: 35438
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Couzens <lynxis(a)fe80.eu>
Gerrit-MessageType: newchange
3
2

Change in coreboot[master]: soc/intel/common/block/cpu/car: Enable caching before FSP-T
by Gaggery Tsai (Code Review) Aug. 7, 2023
by Gaggery Tsai (Code Review) Aug. 7, 2023
Aug. 7, 2023
Gaggery Tsai has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38252 )
Change subject: soc/intel/common/block/cpu/car: Enable caching before FSP-T
......................................................................
soc/intel/common/block/cpu/car: Enable caching before FSP-T
This patch is required for Boot Guard enabled platform. Enable caching
before entering FSP-T.
TEST=Stitch boot guard ACM with signed KM and BPM &&
Enable FSP-T and boot all the way to the OS &&
Read MSR 0x13a and esnure boot guard verified boot and
measured boot are enabled.
Change-Id: Ie1def754f7b0024725638fcea481fd3273ef3d24
---
M src/soc/intel/common/block/cpu/car/cache_as_ram_fsp.S
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/38252/1
diff --git a/src/soc/intel/common/block/cpu/car/cache_as_ram_fsp.S b/src/soc/intel/common/block/cpu/car/cache_as_ram_fsp.S
index 091fc4a..fd22903 100644
--- a/src/soc/intel/common/block/cpu/car/cache_as_ram_fsp.S
+++ b/src/soc/intel/common/block/cpu/car/cache_as_ram_fsp.S
@@ -35,6 +35,12 @@
cache_as_ram:
post_code(0x21)
+ /* Enable caching */
+ mov %cr0, %eax
+ and $~(CR0_CD | CR0_NW), %eax
+ invd
+ mov %eax, %cr0
+
/* find fsp in cbfs */
lea fsp_name, %esi
mov $1f, %esp
--
To view, visit https://review.coreboot.org/c/coreboot/+/38252
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie1def754f7b0024725638fcea481fd3273ef3d24
Gerrit-Change-Number: 38252
Gerrit-PatchSet: 1
Gerrit-Owner: Gaggery Tsai <gaggery.tsai(a)intel.com>
Gerrit-MessageType: newchange
12
29

Change in ...coreboot[master]: mb/*/romstage: Drop defines already set by raminit code
by Patrick Rudolph (Code Review) Aug. 7, 2023
by Patrick Rudolph (Code Review) Aug. 7, 2023
Aug. 7, 2023
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32070
Change subject: mb/*/romstage: Drop defines already set by raminit code
......................................................................
mb/*/romstage: Drop defines already set by raminit code
Drop defines that are set by raminit code.
Change-Id: Ica844a70b50486b4db3744cb123b3e4b8d5bedb0
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/mainboard/asrock/h81m-hds/romstage.c
M src/mainboard/google/beltino/romstage.c
M src/mainboard/google/butterfly/romstage.c
M src/mainboard/google/link/romstage.c
M src/mainboard/google/parrot/romstage.c
M src/mainboard/google/slippy/variants/falco/romstage.c
M src/mainboard/google/slippy/variants/leon/romstage.c
M src/mainboard/google/slippy/variants/peppy/romstage.c
M src/mainboard/google/slippy/variants/wolf/romstage.c
M src/mainboard/google/stout/romstage.c
M src/mainboard/intel/dcp847ske/romstage.c
M src/mainboard/intel/emeraldlake2/romstage.c
M src/mainboard/kontron/ktqm77/romstage.c
M src/mainboard/lenovo/x220/romstage.c
M src/mainboard/roda/rv11/variants/rv11/romstage.c
M src/mainboard/roda/rv11/variants/rw11/romstage.c
M src/mainboard/samsung/lumpy/romstage.c
M src/mainboard/samsung/stumpy/romstage.c
M src/mainboard/supermicro/x10slm-f/romstage.c
19 files changed, 0 insertions(+), 265 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/32070/1
diff --git a/src/mainboard/asrock/h81m-hds/romstage.c b/src/mainboard/asrock/h81m-hds/romstage.c
index a917722..68ed658 100644
--- a/src/mainboard/asrock/h81m-hds/romstage.c
+++ b/src/mainboard/asrock/h81m-hds/romstage.c
@@ -74,20 +74,6 @@
{
struct pei_data pei_data = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = HPET_ADDR,
- .rcba = (uintptr_t)DEFAULT_RCBA,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .temp_mmio_base = 0xfed08000,
- .system_type = 1, /* desktop/server */
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xa0, 0x00, 0xa4, 0x00 },
.ec_present = 0,
.dimm_channel0_disabled = 2, /* Disable DIMM 1 on channel 0. */
diff --git a/src/mainboard/google/beltino/romstage.c b/src/mainboard/google/beltino/romstage.c
index 70a8c19..6417f0d 100644
--- a/src/mainboard/google/beltino/romstage.c
+++ b/src/mainboard/google/beltino/romstage.c
@@ -71,20 +71,6 @@
{
struct pei_data pei_data = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = HPET_ADDR,
- .rcba = (uintptr_t)DEFAULT_RCBA,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .temp_mmio_base = 0xfed08000,
- .system_type = 5, /* ULT */
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xa0, 0x00, 0xa4, 0x00 },
.ec_present = 0,
// 0 = leave channel enabled
diff --git a/src/mainboard/google/butterfly/romstage.c b/src/mainboard/google/butterfly/romstage.c
index d34b1e4..cbd9f3d 100644
--- a/src/mainboard/google/butterfly/romstage.c
+++ b/src/mainboard/google/butterfly/romstage.c
@@ -132,20 +132,6 @@
{
struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, // 0 Mobile, 1 Desktop/Server
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xA0, 0x00,0xA4,0x00 },
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 1,
diff --git a/src/mainboard/google/link/romstage.c b/src/mainboard/google/link/romstage.c
index 66a503d0..6617dc4 100644
--- a/src/mainboard/google/link/romstage.c
+++ b/src/mainboard/google/link/romstage.c
@@ -127,20 +127,6 @@
{
struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, // 0 Mobile, 1 Desktop/Server
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 1,
.ddr3lv_support = 1,
diff --git a/src/mainboard/google/parrot/romstage.c b/src/mainboard/google/parrot/romstage.c
index 76a4b4b..d76d814 100644
--- a/src/mainboard/google/parrot/romstage.c
+++ b/src/mainboard/google/parrot/romstage.c
@@ -101,20 +101,6 @@
{
struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, // 0 Mobile, 1 Desktop/Server
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xA0, 0x00,0xA4,0x00 },
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 1,
diff --git a/src/mainboard/google/slippy/variants/falco/romstage.c b/src/mainboard/google/slippy/variants/falco/romstage.c
index 25f8d27..2244119 100644
--- a/src/mainboard/google/slippy/variants/falco/romstage.c
+++ b/src/mainboard/google/slippy/variants/falco/romstage.c
@@ -109,20 +109,6 @@
{
struct pei_data pei_data = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = HPET_ADDR,
- .rcba = (uintptr_t)DEFAULT_RCBA,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .temp_mmio_base = 0xfed08000,
- .system_type = 5, /* ULT */
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xff, 0x00, 0xff, 0x00 },
.ec_present = 1,
// 0 = leave channel enabled
diff --git a/src/mainboard/google/slippy/variants/leon/romstage.c b/src/mainboard/google/slippy/variants/leon/romstage.c
index b95c6e1..35345d0 100644
--- a/src/mainboard/google/slippy/variants/leon/romstage.c
+++ b/src/mainboard/google/slippy/variants/leon/romstage.c
@@ -106,20 +106,6 @@
{
struct pei_data pei_data = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = HPET_ADDR,
- .rcba = (uintptr_t)DEFAULT_RCBA,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .temp_mmio_base = 0xfed08000,
- .system_type = 5, /* ULT */
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xff, 0x00, 0xff, 0x00 },
.ec_present = 1,
// 0 = leave channel enabled
diff --git a/src/mainboard/google/slippy/variants/peppy/romstage.c b/src/mainboard/google/slippy/variants/peppy/romstage.c
index e47edc7..a5de6c0 100644
--- a/src/mainboard/google/slippy/variants/peppy/romstage.c
+++ b/src/mainboard/google/slippy/variants/peppy/romstage.c
@@ -124,20 +124,6 @@
{
struct pei_data pei_data = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = HPET_ADDR,
- .rcba = (uintptr_t)DEFAULT_RCBA,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .temp_mmio_base = 0xfed08000,
- .system_type = 5, /* ULT */
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xff, 0x00, 0xff, 0x00 },
.ec_present = 1,
// 0 = leave channel enabled
diff --git a/src/mainboard/google/slippy/variants/wolf/romstage.c b/src/mainboard/google/slippy/variants/wolf/romstage.c
index 3125efe..5a8c972 100644
--- a/src/mainboard/google/slippy/variants/wolf/romstage.c
+++ b/src/mainboard/google/slippy/variants/wolf/romstage.c
@@ -111,20 +111,7 @@
{
struct pei_data pei_data = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = HPET_ADDR,
- .rcba = (uintptr_t)DEFAULT_RCBA,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .temp_mmio_base = 0xfed08000,
.system_type = 5, /* ULT */
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xff, 0x00, 0xff, 0x00 },
.ec_present = 1,
// 0 = leave channel enabled
diff --git a/src/mainboard/google/stout/romstage.c b/src/mainboard/google/stout/romstage.c
index 7539dd7..6e32145 100644
--- a/src/mainboard/google/stout/romstage.c
+++ b/src/mainboard/google/stout/romstage.c
@@ -137,20 +137,6 @@
{
struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, // 0 Mobile, 1 Desktop/Server
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xA0, 0x00,0xA4,0x00 },
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 1,
diff --git a/src/mainboard/intel/dcp847ske/romstage.c b/src/mainboard/intel/dcp847ske/romstage.c
index 24ec912..2043cf6 100644
--- a/src/mainboard/intel/dcp847ske/romstage.c
+++ b/src/mainboard/intel/dcp847ske/romstage.c
@@ -29,20 +29,6 @@
{
struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, // 0 Mobile, 1 Desktop/Server
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xa0, 0x00, 0xa2, 0x00 },
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 0,
diff --git a/src/mainboard/intel/emeraldlake2/romstage.c b/src/mainboard/intel/emeraldlake2/romstage.c
index 9a9fc24..8cd7ec2 100644
--- a/src/mainboard/intel/emeraldlake2/romstage.c
+++ b/src/mainboard/intel/emeraldlake2/romstage.c
@@ -94,20 +94,6 @@
{
struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, // 0 Mobile, 1 Desktop/Server
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xa0, 0x00, 0xa4, 0x00 },
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 0,
diff --git a/src/mainboard/kontron/ktqm77/romstage.c b/src/mainboard/kontron/ktqm77/romstage.c
index f778f96..e0f8954 100644
--- a/src/mainboard/kontron/ktqm77/romstage.c
+++ b/src/mainboard/kontron/ktqm77/romstage.c
@@ -80,20 +80,6 @@
{
struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, /* 0 Mobile, 1 Desktop/Server */
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xA0, 0x00,0xA4,0x00 },
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 1,
diff --git a/src/mainboard/lenovo/x220/romstage.c b/src/mainboard/lenovo/x220/romstage.c
index a5b0c81..d398d81 100644
--- a/src/mainboard/lenovo/x220/romstage.c
+++ b/src/mainboard/lenovo/x220/romstage.c
@@ -50,20 +50,6 @@
{
struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, // 0 Mobile, 1 Desktop/Server
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xa0, 0x00,0xa2,0x00 },
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 1,
diff --git a/src/mainboard/roda/rv11/variants/rv11/romstage.c b/src/mainboard/roda/rv11/variants/rv11/romstage.c
index 685e942..df679f1 100644
--- a/src/mainboard/roda/rv11/variants/rv11/romstage.c
+++ b/src/mainboard/roda/rv11/variants/rv11/romstage.c
@@ -37,20 +37,6 @@
{
const struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, // 0 Mobile, 1 Desktop/Server
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xA0, 0x00, 0xA4, 0x00 },
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 1,
diff --git a/src/mainboard/roda/rv11/variants/rw11/romstage.c b/src/mainboard/roda/rv11/variants/rw11/romstage.c
index 97d9d2b..56ac32c 100644
--- a/src/mainboard/roda/rv11/variants/rw11/romstage.c
+++ b/src/mainboard/roda/rv11/variants/rw11/romstage.c
@@ -66,20 +66,6 @@
{
const struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, // 0 Mobile, 1 Desktop/Server
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xA0, 0xA2, 0xA4, 0xA6 },
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 1,
diff --git a/src/mainboard/samsung/lumpy/romstage.c b/src/mainboard/samsung/lumpy/romstage.c
index 1080689..29fe08b 100644
--- a/src/mainboard/samsung/lumpy/romstage.c
+++ b/src/mainboard/samsung/lumpy/romstage.c
@@ -156,20 +156,6 @@
{
struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, // 0 Mobile, 1 Desktop/Server
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xa0, 0x00,0x00,0x00 },
.ts_addresses = { 0x30, 0x00, 0x00, 0x00 },
.ec_present = 1,
diff --git a/src/mainboard/samsung/stumpy/romstage.c b/src/mainboard/samsung/stumpy/romstage.c
index a8e28d6..510efbe 100644
--- a/src/mainboard/samsung/stumpy/romstage.c
+++ b/src/mainboard/samsung/stumpy/romstage.c
@@ -144,20 +144,6 @@
{
struct pei_data pei_data_template = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = CONFIG_HPET_ADDRESS,
- .rcba = (uintptr_t)DEFAULT_RCBABASE,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .thermalbase = 0xfed08000,
- .system_type = 0, // 0 Mobile, 1 Desktop/Server
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xa0, 0x00,0xa4,0x00 },
.ts_addresses = { 0x00, 0x00, 0x00, 0x00 },
.ec_present = 0,
diff --git a/src/mainboard/supermicro/x10slm-f/romstage.c b/src/mainboard/supermicro/x10slm-f/romstage.c
index 84ad047..702e8bb 100644
--- a/src/mainboard/supermicro/x10slm-f/romstage.c
+++ b/src/mainboard/supermicro/x10slm-f/romstage.c
@@ -66,20 +66,6 @@
{
struct pei_data pei_data = {
.pei_version = PEI_VERSION,
- .mchbar = (uintptr_t)DEFAULT_MCHBAR,
- .dmibar = (uintptr_t)DEFAULT_DMIBAR,
- .epbar = DEFAULT_EPBAR,
- .pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
- .smbusbar = SMBUS_IO_BASE,
- .wdbbar = 0x4000000,
- .wdbsize = 0x1000,
- .hpet_address = HPET_ADDR,
- .rcba = (uintptr_t)DEFAULT_RCBA,
- .pmbase = DEFAULT_PMBASE,
- .gpiobase = DEFAULT_GPIOBASE,
- .temp_mmio_base = 0xfed08000,
- .system_type = 1, /* desktop/server */
- .tseg_size = CONFIG_SMM_TSEG_SIZE,
.spd_addresses = { 0xa0, 0xa2, 0xa4, 0xa6 },
.ec_present = 0,
.ddr_refresh_2x = 1,
--
To view, visit https://review.coreboot.org/c/coreboot/+/32070
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ica844a70b50486b4db3744cb123b3e4b8d5bedb0
Gerrit-Change-Number: 32070
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
4
13

Change in coreboot[master]: [TESTME]x4x/i82801jx/socket_LGA775: Add x86_64 support
by Patrick Rudolph (Code Review) Aug. 7, 2023
by Patrick Rudolph (Code Review) Aug. 7, 2023
Aug. 7, 2023
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36779 )
Change subject: [TESTME]x4x/i82801jx/socket_LGA775: Add x86_64 support
......................................................................
[TESTME]x4x/i82801jx/socket_LGA775: Add x86_64 support
Use correct datasize to compile on x86_64.
Change-Id: Ib4851932975e99e06ba5650c2359a835b46d702d
Signed-off-by: Patrick Rudolph <siro(a)das-labor.org>
---
M src/arch/x86/walkcbfs.S
M src/cpu/intel/model_1067x/Kconfig
M src/cpu/intel/model_6fx/Kconfig
M src/cpu/intel/model_f3x/Kconfig
M src/cpu/intel/model_f4x/Kconfig
M src/cpu/intel/socket_LGA775/Kconfig
M src/cpu/x86/mp_init.c
M src/cpu/x86/smm/smm_module_handler.c
M src/drivers/net/atl1e.c
M src/northbridge/intel/x4x/dq_dqs.c
M src/northbridge/intel/x4x/northbridge.c
M src/northbridge/intel/x4x/raminit_ddr23.c
M src/northbridge/intel/x4x/rcven.c
M src/northbridge/intel/x4x/x4x.h
M src/southbridge/intel/common/spi.c
M src/southbridge/intel/i82801jx/hdaudio.c
M src/southbridge/intel/i82801jx/lpc.c
M src/southbridge/intel/i82801jx/sata.c
18 files changed, 63 insertions(+), 40 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/79/36779/1
diff --git a/src/arch/x86/walkcbfs.S b/src/arch/x86/walkcbfs.S
index ded6558..01382e4 100644
--- a/src/arch/x86/walkcbfs.S
+++ b/src/arch/x86/walkcbfs.S
@@ -33,6 +33,7 @@
.section .text
.global walkcbfs_asm
+.code32
/*
* input %esi: filename
diff --git a/src/cpu/intel/model_1067x/Kconfig b/src/cpu/intel/model_1067x/Kconfig
index 564a428..93604d6 100644
--- a/src/cpu/intel/model_1067x/Kconfig
+++ b/src/cpu/intel/model_1067x/Kconfig
@@ -1,9 +1,14 @@
config CPU_INTEL_MODEL_1067X
bool
- select ARCH_BOOTBLOCK_X86_32
- select ARCH_VERSTAGE_X86_32
- select ARCH_ROMSTAGE_X86_32
- select ARCH_RAMSTAGE_X86_32
+ select ARCH_BOOTBLOCK_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_VERSTAGE_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_ROMSTAGE_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_RAMSTAGE_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_BOOTBLOCK_X86_64 if ARCH_EXP_X86_64
+ select ARCH_VERSTAGE_X86_64 if ARCH_EXP_X86_64
+ select ARCH_ROMSTAGE_X86_64 if ARCH_EXP_X86_64
+ select ARCH_RAMSTAGE_X86_64 if ARCH_EXP_X86_64
+
select SMP
select SSE2
select UDELAY_TSC
diff --git a/src/cpu/intel/model_6fx/Kconfig b/src/cpu/intel/model_6fx/Kconfig
index cfd3e7c..8c86226 100644
--- a/src/cpu/intel/model_6fx/Kconfig
+++ b/src/cpu/intel/model_6fx/Kconfig
@@ -1,9 +1,14 @@
config CPU_INTEL_MODEL_6FX
bool
- select ARCH_BOOTBLOCK_X86_32
- select ARCH_VERSTAGE_X86_32
- select ARCH_ROMSTAGE_X86_32
- select ARCH_RAMSTAGE_X86_32
+ select ARCH_BOOTBLOCK_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_VERSTAGE_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_ROMSTAGE_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_RAMSTAGE_X86_32 if !ARCH_EXP_X86_64
+
+ select ARCH_BOOTBLOCK_X86_64 if ARCH_EXP_X86_64
+ select ARCH_VERSTAGE_X86_64 if ARCH_EXP_X86_64
+ select ARCH_ROMSTAGE_X86_64 if ARCH_EXP_X86_64
+ select ARCH_RAMSTAGE_X86_64 if ARCH_EXP_X86_64
select SMP
select SSE2
select UDELAY_TSC
diff --git a/src/cpu/intel/model_f3x/Kconfig b/src/cpu/intel/model_f3x/Kconfig
index 9a5e2a1..ae67337 100644
--- a/src/cpu/intel/model_f3x/Kconfig
+++ b/src/cpu/intel/model_f3x/Kconfig
@@ -1,9 +1,14 @@
config CPU_INTEL_MODEL_F3X
bool
- select ARCH_BOOTBLOCK_X86_32
- select ARCH_VERSTAGE_X86_32
- select ARCH_ROMSTAGE_X86_32
- select ARCH_RAMSTAGE_X86_32
+ select ARCH_BOOTBLOCK_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_VERSTAGE_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_ROMSTAGE_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_RAMSTAGE_X86_32 if !ARCH_EXP_X86_64
+
+ select ARCH_BOOTBLOCK_X86_64 if ARCH_EXP_X86_64
+ select ARCH_VERSTAGE_X86_64 if ARCH_EXP_X86_64
+ select ARCH_ROMSTAGE_X86_64 if ARCH_EXP_X86_64
+ select ARCH_RAMSTAGE_X86_64 if ARCH_EXP_X86_64
select SMP
select SUPPORT_CPU_UCODE_IN_CBFS
select CPU_INTEL_COMMON
diff --git a/src/cpu/intel/model_f4x/Kconfig b/src/cpu/intel/model_f4x/Kconfig
index 4ef60b5..84c6863 100644
--- a/src/cpu/intel/model_f4x/Kconfig
+++ b/src/cpu/intel/model_f4x/Kconfig
@@ -1,8 +1,12 @@
config CPU_INTEL_MODEL_F4X
bool
- select ARCH_BOOTBLOCK_X86_32
- select ARCH_VERSTAGE_X86_32
- select ARCH_ROMSTAGE_X86_32
- select ARCH_RAMSTAGE_X86_32
+ select ARCH_BOOTBLOCK_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_VERSTAGE_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_ROMSTAGE_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_RAMSTAGE_X86_32 if !ARCH_EXP_X86_64
+ select ARCH_BOOTBLOCK_X86_64 if ARCH_EXP_X86_64
+ select ARCH_VERSTAGE_X86_64 if ARCH_EXP_X86_64
+ select ARCH_ROMSTAGE_X86_64 if ARCH_EXP_X86_64
+ select ARCH_RAMSTAGE_X86_64 if ARCH_EXP_X86_64
select SMP
select SUPPORT_CPU_UCODE_IN_CBFS
diff --git a/src/cpu/intel/socket_LGA775/Kconfig b/src/cpu/intel/socket_LGA775/Kconfig
index 8b227bd..8f60d2c 100644
--- a/src/cpu/intel/socket_LGA775/Kconfig
+++ b/src/cpu/intel/socket_LGA775/Kconfig
@@ -3,6 +3,10 @@
if CPU_INTEL_SOCKET_LGA775
+config ARCH_EXP_X86_64
+ bool "Enable experimental 64bit support"
+ default n
+
config SOCKET_SPECIFIC_OPTIONS # dummy
def_bool y
select CPU_INTEL_MODEL_6FX
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index 29ae3de..ea70453 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -122,7 +122,7 @@
/* The SIPI vector is loaded at the SMM_DEFAULT_BASE. The reason is at the
* memory range is already reserved so the OS cannot use it. That region is
* free to use for AP bringup before SMM is initialized. */
-static const uint32_t sipi_vector_location = SMM_DEFAULT_BASE;
+static const uintptr_t sipi_vector_location = SMM_DEFAULT_BASE;
static const int sipi_vector_location_size = SMM_DEFAULT_SIZE;
struct mp_flight_plan {
@@ -348,16 +348,16 @@
setup_default_sipi_vector_params(sp);
/* Setup MSR table. */
- sp->msr_table_ptr = (uint32_t)&mod_loc[module_size];
+ sp->msr_table_ptr = (uintptr_t)&mod_loc[module_size];
sp->msr_count = num_msrs;
/* Provide pointer to microcode patch. */
- sp->microcode_ptr = (uint32_t)mp_params->microcode_pointer;
+ sp->microcode_ptr = (uintptr_t)mp_params->microcode_pointer;
/* Pass on abiility to load microcode in parallel. */
if (mp_params->parallel_microcode_load)
sp->microcode_lock = 0;
else
sp->microcode_lock = ~0;
- sp->c_handler = (uint32_t)&ap_init;
+ sp->c_handler = (uintptr_t)&ap_init;
ap_count = &sp->ap_count;
atomic_set(ap_count, 0);
diff --git a/src/cpu/x86/smm/smm_module_handler.c b/src/cpu/x86/smm/smm_module_handler.c
index bd4d48c..82ad37d 100644
--- a/src/cpu/x86/smm/smm_module_handler.c
+++ b/src/cpu/x86/smm/smm_module_handler.c
@@ -107,7 +107,7 @@
/* This function assumes all save states start at top of default
* SMRAM size space and are staggered down by save state size. */
- base = (void *)smm_runtime->smbase;
+ base = (void *)(uintptr_t)smm_runtime->smbase;
base += SMM_DEFAULT_SIZE;
base -= (cpu + 1) * smm_runtime->save_state_size;
diff --git a/src/drivers/net/atl1e.c b/src/drivers/net/atl1e.c
index 51470b0..d68ea0d 100644
--- a/src/drivers/net/atl1e.c
+++ b/src/drivers/net/atl1e.c
@@ -86,7 +86,7 @@
}
}
-static void program_mac_address(u32 mem_base)
+static void program_mac_address(uintptr_t mem_base)
{
u8 macstrbuf[MACLEN] = { 0 };
/* Default MAC Address of 90:e6:ba:24:f9:d2 */
@@ -110,7 +110,7 @@
printk(BIOS_DEBUG, "done\n");
}
-static int atl1e_eeprom_exist(u32 mem_base)
+static int atl1e_eeprom_exist(uintptr_t mem_base)
{
u32 value = read32((void *)mem_base + REG_SPI_FLASH_CTRL);
if (value & SPI_FLASH_CTRL_EN_VPD) {
diff --git a/src/northbridge/intel/x4x/dq_dqs.c b/src/northbridge/intel/x4x/dq_dqs.c
index ed372b5..080262e 100644
--- a/src/northbridge/intel/x4x/dq_dqs.c
+++ b/src/northbridge/intel/x4x/dq_dqs.c
@@ -178,7 +178,7 @@
static u8 test_dq_aligned(const struct sysinfo *s,
const u8 channel)
{
- u32 address;
+ uintptr_t address;
int rank, lane;
u8 count, count1;
u8 data[8];
@@ -374,7 +374,7 @@
{
int i, rank, lane;
volatile u8 data[8];
- u32 address;
+ uintptr_t address;
u8 bytelane_error = 0;
FOR_EACH_POPULATED_RANK_IN_CHANNEL(s->dimms, channel, rank) {
@@ -453,7 +453,8 @@
int do_read_training(struct sysinfo *s)
{
int loop, channel, i, lane, rank;
- u32 address, content;
+ uintptr_t address;
+ u32 content;
u8 dqs_lower[TOTAL_BYTELANES];
u8 dqs_upper[TOTAL_BYTELANES];
struct rt_dqs_setting dqs_setting[TOTAL_BYTELANES];
@@ -643,7 +644,7 @@
static void sample_dq(const struct sysinfo *s, u8 channel, u8 rank,
u8 high_found[8]) {
- u32 address = test_address(channel, rank);
+ uintptr_t address = test_address(channel, rank);
int samples, lane;
memset(high_found, 0, TOTAL_BYTELANES * sizeof(high_found[0]));
diff --git a/src/northbridge/intel/x4x/northbridge.c b/src/northbridge/intel/x4x/northbridge.c
index 39f24d3..592a2e0 100644
--- a/src/northbridge/intel/x4x/northbridge.c
+++ b/src/northbridge/intel/x4x/northbridge.c
@@ -89,7 +89,7 @@
/* cbmem_top can be shifted downwards due to alignment.
Mark the region between cbmem_top and tomk as unusable */
- delta_cbmem = tomk - ((uint32_t)cbmem_top() >> 10);
+ delta_cbmem = tomk - ((uintptr_t)cbmem_top() >> 10);
tomk -= delta_cbmem;
uma_sizek += delta_cbmem;
diff --git a/src/northbridge/intel/x4x/raminit_ddr23.c b/src/northbridge/intel/x4x/raminit_ddr23.c
index efdcbb6..31e94f4 100644
--- a/src/northbridge/intel/x4x/raminit_ddr23.c
+++ b/src/northbridge/intel/x4x/raminit_ddr23.c
@@ -1316,7 +1316,7 @@
void send_jedec_cmd(const struct sysinfo *s, u8 r, u8 ch, u8 cmd, u32 val)
{
- u32 addr = test_address(ch, r);
+ uintptr_t addr = test_address(ch, r);
u8 data8 = cmd;
u32 data32;
@@ -2160,7 +2160,7 @@
if (s->boot_path == BOOT_PATH_NORMAL) {
FOR_EACH_POPULATED_RANK(s->dimms, ch, r) {
for (bank = 0; bank < 4; bank++)
- read32((u32 *)(test_address(ch, r) | 0x800000 | (bank << 12)));
+ read32((u32 *)((uintptr_t)test_address(ch, r) | 0x800000 | (bank << 12)));
}
}
printk(BIOS_DEBUG, "Done dummy reads\n");
diff --git a/src/northbridge/intel/x4x/rcven.c b/src/northbridge/intel/x4x/rcven.c
index 36a6ebd..c41bb07 100644
--- a/src/northbridge/intel/x4x/rcven.c
+++ b/src/northbridge/intel/x4x/rcven.c
@@ -39,7 +39,7 @@
asm volatile("mfence":::);
}
-static u8 sampledqs(u32 addr, u8 lane, u8 channel)
+static u8 sampledqs(uintptr_t addr, u8 lane, u8 channel)
{
u32 sample_offset = 0x400 * channel + 0x561 + lane * 4;
diff --git a/src/northbridge/intel/x4x/x4x.h b/src/northbridge/intel/x4x/x4x.h
index 76d94c6..4809ee7 100644
--- a/src/northbridge/intel/x4x/x4x.h
+++ b/src/northbridge/intel/x4x/x4x.h
@@ -84,9 +84,9 @@
* MCHBAR
*/
-#define MCHBAR8(x) (*((volatile u8 *)(DEFAULT_MCHBAR + (x))))
-#define MCHBAR16(x) (*((volatile u16 *)(DEFAULT_MCHBAR + (x))))
-#define MCHBAR32(x) (*((volatile u32 *)(DEFAULT_MCHBAR + (x))))
+#define MCHBAR8(x) (*((volatile u8 *)((uintptr_t)DEFAULT_MCHBAR + (x))))
+#define MCHBAR16(x) (*((volatile u16 *)((uintptr_t)DEFAULT_MCHBAR + (x))))
+#define MCHBAR32(x) (*((volatile u32 *)((uintptr_t)DEFAULT_MCHBAR + (x))))
#define MCHBAR8_AND(x, and) (MCHBAR8(x) = MCHBAR8(x) & (and))
#define MCHBAR8_OR(x, or) (MCHBAR8(x) = MCHBAR8(x) | (or))
#define MCHBAR8_AND_OR(x, and, or) \
diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c
index a84a0df..a9c8863 100644
--- a/src/southbridge/intel/common/spi.c
+++ b/src/southbridge/intel/common/spi.c
@@ -275,7 +275,7 @@
{
struct ich_spi_controller *cntlr = car_get_var_ptr(&g_cntlr);
uint8_t *rcrb; /* Root Complex Register Block */
- uint32_t rcba; /* Root Complex Base Address */
+ uintptr_t rcba; /* Root Complex Base Address */
uint8_t bios_cntl;
struct ich9_spi_regs *ich9_spi;
struct ich7_spi_regs *ich7_spi;
diff --git a/src/southbridge/intel/i82801jx/hdaudio.c b/src/southbridge/intel/i82801jx/hdaudio.c
index 0628c43..2273e6c 100644
--- a/src/southbridge/intel/i82801jx/hdaudio.c
+++ b/src/southbridge/intel/i82801jx/hdaudio.c
@@ -276,10 +276,8 @@
if (!res)
return;
- // NOTE this will break as soon as the Azalia get's a bar above
- // 4G. Is there anything we can do about it?
base = res2mmio(res, 0, 0);
- printk(BIOS_DEBUG, "Azalia: base = %08x\n", (u32)base);
+ printk(BIOS_DEBUG, "Azalia: base = %p\n", base);
codec_mask = codec_detect(base);
if (codec_mask) {
diff --git a/src/southbridge/intel/i82801jx/lpc.c b/src/southbridge/intel/i82801jx/lpc.c
index a395069..412e97f 100644
--- a/src/southbridge/intel/i82801jx/lpc.c
+++ b/src/southbridge/intel/i82801jx/lpc.c
@@ -669,7 +669,7 @@
/* Add it to SSDT. */
acpigen_write_scope("\\");
- acpigen_write_name_dword("NVSA", (u32) gnvs);
+ acpigen_write_name_dword("NVSA", (u32)(uintptr_t) gnvs);
acpigen_pop_len();
}
}
diff --git a/src/southbridge/intel/i82801jx/sata.c b/src/southbridge/intel/i82801jx/sata.c
index e6e08a3..70c5e69 100644
--- a/src/southbridge/intel/i82801jx/sata.c
+++ b/src/southbridge/intel/i82801jx/sata.c
@@ -37,7 +37,7 @@
u32 reg32;
/* Initialize AHCI memory-mapped space */
- u8 *abar = (u8 *)pci_read_config32(dev, PCI_BASE_ADDRESS_5);
+ u8 *abar = (u8 *)(uintptr_t)pci_read_config32(dev, PCI_BASE_ADDRESS_5);
printk(BIOS_DEBUG, "ABAR: %p\n", abar);
/* Set AHCI access mode.
--
To view, visit https://review.coreboot.org/c/coreboot/+/36779
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib4851932975e99e06ba5650c2359a835b46d702d
Gerrit-Change-Number: 36779
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
5
15

Change in coreboot[master]: soc/intel/common/block: Update microcode for each core
by Patrick Rudolph (Code Review) Aug. 7, 2023
by Patrick Rudolph (Code Review) Aug. 7, 2023
Aug. 7, 2023
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35739 )
Change subject: soc/intel/common/block: Update microcode for each core
......................................................................
soc/intel/common/block: Update microcode for each core
On Hyper-Threading enabled platform update the microcde only once
for each core, not for each thread.
Follow Intel Software Developer Guidelines as the added comment
also states.
Change-Id: I72804753e567a137a5648ca6950009fed332531b
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/soc/intel/common/block/cpu/mp_init.c
1 file changed, 20 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/35739/1
diff --git a/src/soc/intel/common/block/cpu/mp_init.c b/src/soc/intel/common/block/cpu/mp_init.c
index 2c5061f..e7689cf 100644
--- a/src/soc/intel/common/block/cpu/mp_init.c
+++ b/src/soc/intel/common/block/cpu/mp_init.c
@@ -26,6 +26,7 @@
#include <intelblocks/fast_spi.h>
#include <intelblocks/mp_init.h>
#include <intelblocks/msr.h>
+#include <cpu/intel/common/common.h>
#include <soc/cpu.h>
static const void *microcode_patch;
@@ -44,7 +45,24 @@
static void init_one_cpu(struct device *dev)
{
soc_core_init(dev);
- intel_microcode_load_unlocked(microcode_patch);
+
+ /*
+ * Update just on the first CPU in the core. Other siblings
+ * get the update automatically according to Document: 253668-060US
+ * Intel SDM Chapter 9.11.6.3
+ * "Update in a System Supporting Intel Hyper-Threading Technology"
+ * Intel Hyper-Threading Technology has implications on the loading of the
+ * microcode update. The update must be loaded for each core in a physical
+ * processor. Thus, for a processor supporting Intel Hyper-Threading
+ * Technology, only one logical processor per core is required to load the
+ * microcode update. Each individual logical processor can independently
+ * load the update. However, MP initialization must provide some mechanism
+ * (e.g. a software semaphore) to force serialization of microcode update
+ * loads and to prevent simultaneous load attempts to the same core.
+ */
+ if (!intel_ht_sibling()) {
+ intel_microcode_load_unlocked(microcode_patch);
+ }
}
static struct device_operations cpu_dev_ops = {
@@ -141,6 +159,7 @@
if (CONFIG(USE_INTEL_FSP_MP_INIT))
return;
+ /* Update microcode on BSP */
microcode_patch = intel_microcode_find();
intel_microcode_load_unlocked(microcode_patch);
--
To view, visit https://review.coreboot.org/c/coreboot/+/35739
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I72804753e567a137a5648ca6950009fed332531b
Gerrit-Change-Number: 35739
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
9
52

Change in coreboot[master]: mb/supermicro/x10slm-f: Add new superio support to board's Kconfig
by Christoph Pomaska (Code Review) Aug. 7, 2023
by Christoph Pomaska (Code Review) Aug. 7, 2023
Aug. 7, 2023
Christoph Pomaska has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34905 )
Change subject: mb/supermicro/x10slm-f: Add new superio support to board's Kconfig
......................................................................
mb/supermicro/x10slm-f: Add new superio support to board's Kconfig
Since the superio support code didnt exist when the board was ported,
the Kconfig was not modified yet to add support for the BMC-chip.
This commit fixes the missing Kconfig entry.
Change-Id: I4f89c2ddcc00327e01d0a83fc13cfa862e6abd70
Signed-off-by: Christoph Pomaska <c.pomaska(a)hosting.de>
---
M src/mainboard/supermicro/x10slm-f/Kconfig
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/05/34905/1
diff --git a/src/mainboard/supermicro/x10slm-f/Kconfig b/src/mainboard/supermicro/x10slm-f/Kconfig
index 3945c09..6effff2 100644
--- a/src/mainboard/supermicro/x10slm-f/Kconfig
+++ b/src/mainboard/supermicro/x10slm-f/Kconfig
@@ -20,15 +20,16 @@
def_bool y
select BOARD_ROMSIZE_KB_16384
select CPU_INTEL_HASWELL
- select DRIVERS_ASPEED_AST2050 # Supports AST2400 too.
+ select SOUTHBRIDGE_INTEL_LYNXPOINT
select HAVE_ACPI_RESUME
select HAVE_ACPI_TABLES
select HAVE_OPTION_TABLE
select HAVE_CMOS_DEFAULT
select NORTHBRIDGE_INTEL_HASWELL
select SERIRQ_CONTINUOUS_MODE
- select SOUTHBRIDGE_INTEL_LYNXPOINT
- select SUPERIO_NUVOTON_NCT6776
+ select DRIVERS_ASPEED_AST2050 # Supports AST2400 too.
+ select SUPERIO_ASPEED_AST2400 # The board's BMC
+ select SUPERIO_NUVOTON_NCT6776 # the board's superio
select SUPERIO_NUVOTON_NCT6776_COM_A
config CBFS_SIZE
--
To view, visit https://review.coreboot.org/c/coreboot/+/34905
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4f89c2ddcc00327e01d0a83fc13cfa862e6abd70
Gerrit-Change-Number: 34905
Gerrit-PatchSet: 1
Gerrit-Owner: Christoph Pomaska <github(a)aufmachen.jetzt>
Gerrit-MessageType: newchange
9
45