Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34982 )
Change subject: samusung/exynos: Use ENV_BEFORE_RAMSTAGE
......................................................................
samusung/exynos: Use ENV_BEFORE_RAMSTAGE
Change-Id: I9dbf0fc14516f766fd164c7308906456f2865e89
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
M src/soc/samsung/exynos5250/alternate_cbfs.c
M src/soc/samsung/exynos5420/alternate_cbfs.c
2 files changed, 16 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/34982/1
diff --git a/src/soc/samsung/exynos5250/alternate_cbfs.c b/src/soc/samsung/exynos5250/alternate_cbfs.c
index e431672..90b1a7d 100644
--- a/src/soc/samsung/exynos5250/alternate_cbfs.c
+++ b/src/soc/samsung/exynos5250/alternate_cbfs.c
@@ -35,12 +35,14 @@
* should contain all available stages/payloads/etc. It is loaded when this
* function is called a second time at the end of the romstage, and copied to
* the romstage/ramstage CBFS cache in DRAM. It will reside there for the
- * rest of the firmware's lifetime and all subsequent stages (which will not
- * have __PRE_RAM__ defined) can just directly reference it there.
+ * rest of the firmware's lifetime and all subsequent stages can just directly
+ * reference it there.
*/
static int usb_cbfs_open(void)
{
-#ifdef __PRE_RAM__
+ if (!ENV_BEFORE_RAMSTAGE)
+ return 0;
+
static int first_run = 1;
int (*irom_load_usb)(void) = *irom_load_image_from_usb_ptr;
@@ -61,7 +63,6 @@
printk(BIOS_DEBUG, "USB A-A transfer successful, CBFS image should now"
" be at %p\n", _cbfs_cache);
first_run = 0;
-#endif
return 0;
}
@@ -75,7 +76,9 @@
*/
static int sdmmc_cbfs_open(void)
{
-#ifdef __PRE_RAM__
+ if (!ENV_BEFORE_RAMSTAGE)
+ return 0;
+
/*
* In the bootblock, we just copy the small part that fits in the buffer
* and hope that it's enough (since the romstage is currently always the
@@ -100,7 +103,6 @@
printk(BIOS_DEBUG, "SDMMC read successful, CBFS image should now be"
" at %p\n", _cbfs_cache);
first_run = 0;
-#endif
return 0;
}
diff --git a/src/soc/samsung/exynos5420/alternate_cbfs.c b/src/soc/samsung/exynos5420/alternate_cbfs.c
index ba3f9a3..90d7756 100644
--- a/src/soc/samsung/exynos5420/alternate_cbfs.c
+++ b/src/soc/samsung/exynos5420/alternate_cbfs.c
@@ -36,12 +36,14 @@
* should contain all available stages/payloads/etc. It is loaded when this
* function is called a second time at the end of the romstage, and copied to
* the romstage/ramstage CBFS cache in DRAM. It will reside there for the
- * rest of the firmware's lifetime and all subsequent stages (which will not
- * have __PRE_RAM__ defined) can just directly reference it there.
+ * rest of the firmware's lifetime and all subsequent stages can just directly
+ * reference it there.
*/
static int usb_cbfs_open(void)
{
-#ifdef __PRE_RAM__
+ if (!ENV_BEFORE_RAMSTAGE)
+ return 0;
+
static int first_run = 1;
int (*irom_load_usb)(void) = *irom_load_image_from_usb_ptr;
@@ -65,7 +67,6 @@
printk(BIOS_DEBUG, "USB A-A transfer successful, CBFS image should now"
" be at %p\n", _cbfs_cache);
first_run = 0;
-#endif
return 0;
}
@@ -79,7 +80,9 @@
*/
static int sdmmc_cbfs_open(void)
{
-#ifdef __PRE_RAM__
+ if (!ENV_BEFORE_RAMSTAGE)
+ return 0;
+
/*
* In the bootblock, we just copy the small part that fits in the buffer
* and hope that it's enough (since the romstage is currently always the
@@ -107,7 +110,6 @@
printk(BIOS_DEBUG, "SDMMC read successful, CBFS image should now be"
" at %p\n", _cbfs_cache);
first_run = 0;
-#endif
return 0;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/34982
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I9dbf0fc14516f766fd164c7308906456f2865e89
Gerrit-Change-Number: 34982
Gerrit-PatchSet: 1
Gerrit-Owner: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-MessageType: newchange
Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34939 )
Change subject: Add ENV_BEFORE_RAMSTAGE
......................................................................
Add ENV_BEFORE_RAMSTAGE
Change-Id: Ibd2292f922ccb9e79d10ca9bc35797048d174287
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
M src/arch/riscv/include/arch/memlayout.h
M src/include/rules.h
M src/soc/samsung/exynos5250/alternate_cbfs.c
M src/soc/samsung/exynos5420/alternate_cbfs.c
4 files changed, 11 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/34939/1
diff --git a/src/arch/riscv/include/arch/memlayout.h b/src/arch/riscv/include/arch/memlayout.h
index 7baab76..ebedb2d 100644
--- a/src/arch/riscv/include/arch/memlayout.h
+++ b/src/arch/riscv/include/arch/memlayout.h
@@ -20,7 +20,7 @@
#define STACK(addr, size) REGION(stack, addr, size, 4096)
-#if defined(__PRE_RAM__)
+#if ENV_BEFORE_RAMSTAGE
#define CAR_STACK(addr, size) \
REGION(car_stack, addr, size, 4K) \
ALIAS_REGION(car_stack, stack)
diff --git a/src/include/rules.h b/src/include/rules.h
index 10cd715..530404d 100644
--- a/src/include/rules.h
+++ b/src/include/rules.h
@@ -266,6 +266,8 @@
#define ENV_PAYLOAD_LOADER ENV_RAMSTAGE
#endif
+#define ENV_BEFORE_RAMSTAGE (ENV_BOOTBLOCK || ENV_VERSTAGE || ENV_ROMSTAGE || ENV_POSTCAR)
+
/**
* For pre-DRAM stages and post-CAR always build with simple device model, ie.
* PCI, PNP and CPU functions operate without use of devicetree. The reason
diff --git a/src/soc/samsung/exynos5250/alternate_cbfs.c b/src/soc/samsung/exynos5250/alternate_cbfs.c
index e431672..a012837 100644
--- a/src/soc/samsung/exynos5250/alternate_cbfs.c
+++ b/src/soc/samsung/exynos5250/alternate_cbfs.c
@@ -35,12 +35,12 @@
* should contain all available stages/payloads/etc. It is loaded when this
* function is called a second time at the end of the romstage, and copied to
* the romstage/ramstage CBFS cache in DRAM. It will reside there for the
- * rest of the firmware's lifetime and all subsequent stages (which will not
- * have __PRE_RAM__ defined) can just directly reference it there.
+ * rest of the firmware's lifetime and all subsequent stages can just directly
+ * reference it there.
*/
static int usb_cbfs_open(void)
{
-#ifdef __PRE_RAM__
+#if ENV_BEFORE_RAMSTAGE
static int first_run = 1;
int (*irom_load_usb)(void) = *irom_load_image_from_usb_ptr;
@@ -75,7 +75,7 @@
*/
static int sdmmc_cbfs_open(void)
{
-#ifdef __PRE_RAM__
+#if ENV_BEFORE_RAMSTAGE
/*
* In the bootblock, we just copy the small part that fits in the buffer
* and hope that it's enough (since the romstage is currently always the
diff --git a/src/soc/samsung/exynos5420/alternate_cbfs.c b/src/soc/samsung/exynos5420/alternate_cbfs.c
index ba3f9a3..b8f3e04 100644
--- a/src/soc/samsung/exynos5420/alternate_cbfs.c
+++ b/src/soc/samsung/exynos5420/alternate_cbfs.c
@@ -36,12 +36,12 @@
* should contain all available stages/payloads/etc. It is loaded when this
* function is called a second time at the end of the romstage, and copied to
* the romstage/ramstage CBFS cache in DRAM. It will reside there for the
- * rest of the firmware's lifetime and all subsequent stages (which will not
- * have __PRE_RAM__ defined) can just directly reference it there.
+ * rest of the firmware's lifetime and all subsequent stages can just directly
+ * reference it there.
*/
static int usb_cbfs_open(void)
{
-#ifdef __PRE_RAM__
+#if ENV_BEFORE_RAMSTAGE
static int first_run = 1;
int (*irom_load_usb)(void) = *irom_load_image_from_usb_ptr;
@@ -79,7 +79,7 @@
*/
static int sdmmc_cbfs_open(void)
{
-#ifdef __PRE_RAM__
+#if ENV_BEFORE_RAMSTAGE
/*
* In the bootblock, we just copy the small part that fits in the buffer
* and hope that it's enough (since the romstage is currently always the
--
To view, visit https://review.coreboot.org/c/coreboot/+/34939
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibd2292f922ccb9e79d10ca9bc35797048d174287
Gerrit-Change-Number: 34939
Gerrit-PatchSet: 1
Gerrit-Owner: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Philipp Hug <philipp(a)hug.cx>
Gerrit-Reviewer: ron minnich <rminnich(a)gmail.com>
Gerrit-MessageType: newchange
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35004 )
Change subject: x86: Introduce RESET_VECTOR_IN_RAM option
......................................................................
Patch Set 10:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35004/10/src/Kconfig
File src/Kconfig:
https://review.coreboot.org/c/coreboot/+/35004/10/src/Kconfig@155
PS10, Line 155: config RESET_VECTOR_IN_RAM
> Can't this go in src/arch/x86/Kconfig?
It can, if we feel no other arch would soon use it. Do you want it named _RAM or _DRAM? I had suggested the former, Marshall chose the latter.
https://review.coreboot.org/c/coreboot/+/35004/10/src/arch/x86/memlayout.ld
File src/arch/x86/memlayout.ld:
https://review.coreboot.org/c/coreboot/+/35004/10/src/arch/x86/memlayout.ld…
PS10, Line 20: #if ENV_ROMSTAGE_OR_BEFORE
> Why not &&?
I would hit #error below for every !ENV_ROMSTAGE_OR_BEFORE ?
--
To view, visit https://review.coreboot.org/c/coreboot/+/35004
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I098ecf8bf200550db1e15f178f7661c1ac516dc5
Gerrit-Change-Number: 35004
Gerrit-PatchSet: 10
Gerrit-Owner: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Mon, 26 Aug 2019 20:49:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Julius Werner <jwerner(a)chromium.org>
Gerrit-MessageType: comment
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35003 )
Change subject: Split MAYBE_STATIC to _BSS and _NONZERO variants
......................................................................
Patch Set 7: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/35003
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I80485ebac94b88c5864a949b17ad1dccdfda6a40
Gerrit-Change-Number: 35003
Gerrit-PatchSet: 7
Gerrit-Owner: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Mon, 26 Aug 2019 20:31:33 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment