summaryrefslogtreecommitdiff
path: root/src/soc/samsung
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/samsung')
-rw-r--r--src/soc/samsung/exynos5250/alternate_cbfs.c14
-rw-r--r--src/soc/samsung/exynos5420/alternate_cbfs.c14
2 files changed, 16 insertions, 12 deletions
diff --git a/src/soc/samsung/exynos5250/alternate_cbfs.c b/src/soc/samsung/exynos5250/alternate_cbfs.c
index e431672579..c319019eb6 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_ROMSTAGE_OR_BEFORE)
+ return 0;
+
static int first_run = 1;
int (*irom_load_usb)(void) = *irom_load_image_from_usb_ptr;
@@ -61,7 +63,6 @@ static int usb_cbfs_open(void)
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 usb_cbfs_open(void)
*/
static int sdmmc_cbfs_open(void)
{
-#ifdef __PRE_RAM__
+ if (!ENV_ROMSTAGE_OR_BEFORE)
+ 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 @@ static int sdmmc_cbfs_open(void)
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 ba3f9a3c87..fabc9cff7d 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_ROMSTAGE_OR_BEFORE)
+ return 0;
+
static int first_run = 1;
int (*irom_load_usb)(void) = *irom_load_image_from_usb_ptr;
@@ -65,7 +67,6 @@ static int usb_cbfs_open(void)
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 usb_cbfs_open(void)
*/
static int sdmmc_cbfs_open(void)
{
-#ifdef __PRE_RAM__
+ if (!ENV_ROMSTAGE_OR_BEFORE)
+ 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 @@ static int sdmmc_cbfs_open(void)
printk(BIOS_DEBUG, "SDMMC read successful, CBFS image should now be"
" at %p\n", _cbfs_cache);
first_run = 0;
-#endif
return 0;
}