Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34921 )
Change subject: arch/non-x86: Replace uses of __PRE_RAM__ ......................................................................
arch/non-x86: Replace uses of __PRE_RAM__
Since there is no __SMM__ to worry about, !defined(__PRE_RAM__) becomes just ENV_RAMSTAGE.
Change-Id: Id8918f40572497b068509b5d5a490de0435ad50b Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/arm/include/armv7/arch/cpu.h M src/arch/arm64/include/armv8/arch/cpu.h M src/arch/mips/include/arch/cpu.h M src/arch/ppc64/include/arch/cpu.h M src/arch/riscv/include/arch/cpu.h M src/arch/riscv/include/arch/memlayout.h M src/cpu/ti/am335x/uart.c M src/drivers/uart/pl011.c M src/drivers/uart/sifive.c M src/mainboard/emulation/qemu-power8/uart.c M src/soc/imgtec/pistachio/uart.c M src/soc/mediatek/common/uart.c M src/soc/nvidia/tegra/dc.h M src/soc/nvidia/tegra124/uart.c M src/soc/nvidia/tegra210/uart.c M src/soc/qualcomm/ipq40xx/uart.c M src/soc/qualcomm/ipq806x/uart.c M src/soc/qualcomm/qcs405/uart.c M src/soc/samsung/exynos5250/uart.c M src/soc/samsung/exynos5420/alternate_cbfs.c M src/soc/samsung/exynos5420/uart.c 21 files changed, 24 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/34921/1
diff --git a/src/arch/arm/include/armv7/arch/cpu.h b/src/arch/arm/include/armv7/arch/cpu.h index 22b3fb4..52bfe11 100644 --- a/src/arch/arm/include/armv7/arch/cpu.h +++ b/src/arch/arm/include/armv7/arch/cpu.h @@ -20,7 +20,7 @@
#define asmlinkage
-#if !defined(__PRE_RAM__) +#if ENV_RAMSTAGE #include <device/device.h>
struct cpu_driver { diff --git a/src/arch/arm64/include/armv8/arch/cpu.h b/src/arch/arm64/include/armv8/arch/cpu.h index 6e096cc..e1b5647 100644 --- a/src/arch/arm64/include/armv8/arch/cpu.h +++ b/src/arch/arm64/include/armv8/arch/cpu.h @@ -21,7 +21,7 @@ static inline unsigned int smp_processor_id(void) { return 0; }
-#if !defined(__PRE_RAM__) +#if ENV_RAMSTAGE struct cpu_driver { }; #endif
diff --git a/src/arch/mips/include/arch/cpu.h b/src/arch/mips/include/arch/cpu.h index 8e35908..8290c1a 100644 --- a/src/arch/mips/include/arch/cpu.h +++ b/src/arch/mips/include/arch/cpu.h @@ -18,7 +18,7 @@
#define asmlinkage
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE
#include <device/device.h>
@@ -34,7 +34,7 @@ unsigned long index; };
-#endif /* !__PRE_RAM__ */ +#endif /* ENV_RAMSTAGE */
/*************************************************************************** * The following section was copied from arch/mips/include/asm/mipsregs.h in diff --git a/src/arch/ppc64/include/arch/cpu.h b/src/arch/ppc64/include/arch/cpu.h index 1e13528..c80f65e 100644 --- a/src/arch/ppc64/include/arch/cpu.h +++ b/src/arch/ppc64/include/arch/cpu.h @@ -18,7 +18,7 @@
#define asmlinkage
-#if !defined(__PRE_RAM__) +#if ENV_RAMSTAGE #include <device/device.h>
struct cpu_driver { diff --git a/src/arch/riscv/include/arch/cpu.h b/src/arch/riscv/include/arch/cpu.h index 547cb76..529daa0 100644 --- a/src/arch/riscv/include/arch/cpu.h +++ b/src/arch/riscv/include/arch/cpu.h @@ -20,7 +20,7 @@
#define asmlinkage
-#if !defined(__PRE_RAM__) +#if ENV_RAMSTAGE #include <device/device.h>
struct cpu_driver { diff --git a/src/arch/riscv/include/arch/memlayout.h b/src/arch/riscv/include/arch/memlayout.h index 7baab76..d1e9673 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_RAMSTAGE #define CAR_STACK(addr, size) \ REGION(car_stack, addr, size, 4K) \ ALIAS_REGION(car_stack, stack) diff --git a/src/cpu/ti/am335x/uart.c b/src/cpu/ti/am335x/uart.c index 4e9d012..f42b946 100644 --- a/src/cpu/ti/am335x/uart.c +++ b/src/cpu/ti/am335x/uart.c @@ -182,7 +182,7 @@ { }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void uart_fill_lb(void *data) { struct lb_serial serial; diff --git a/src/drivers/uart/pl011.c b/src/drivers/uart/pl011.c index 4e3af52..1764f15 100644 --- a/src/drivers/uart/pl011.c +++ b/src/drivers/uart/pl011.c @@ -49,7 +49,7 @@ return read8(®s->dr); }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void uart_fill_lb(void *data) { struct lb_serial serial; diff --git a/src/drivers/uart/sifive.c b/src/drivers/uart/sifive.c index 1b0f75e..9ca669a 100644 --- a/src/drivers/uart/sifive.c +++ b/src/drivers/uart/sifive.c @@ -113,7 +113,7 @@ return 1; }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void uart_fill_lb(void *data) { /* TODO */ diff --git a/src/mainboard/emulation/qemu-power8/uart.c b/src/mainboard/emulation/qemu-power8/uart.c index 9548b7c..76c8afc 100644 --- a/src/mainboard/emulation/qemu-power8/uart.c +++ b/src/mainboard/emulation/qemu-power8/uart.c @@ -41,7 +41,7 @@ { }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void uart_fill_lb(void *data) { struct lb_serial serial; diff --git a/src/soc/imgtec/pistachio/uart.c b/src/soc/imgtec/pistachio/uart.c index a39f2ec..9d15237 100644 --- a/src/soc/imgtec/pistachio/uart.c +++ b/src/soc/imgtec/pistachio/uart.c @@ -143,7 +143,7 @@ uart8250_mem_tx_flush(CONFIG_CONSOLE_SERIAL_UART_ADDRESS); }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void uart_fill_lb(void *data) { struct lb_serial serial; diff --git a/src/soc/mediatek/common/uart.c b/src/soc/mediatek/common/uart.c index 8905c55..c1b4616 100644 --- a/src/soc/mediatek/common/uart.c +++ b/src/soc/mediatek/common/uart.c @@ -172,7 +172,7 @@ mtk_uart_tx_flush(); }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void uart_fill_lb(void *data) { struct lb_serial serial; diff --git a/src/soc/nvidia/tegra/dc.h b/src/soc/nvidia/tegra/dc.h index a9061f8..da296da 100644 --- a/src/soc/nvidia/tegra/dc.h +++ b/src/soc/nvidia/tegra/dc.h @@ -515,7 +515,7 @@ unsigned long READL(void *p); void WRITEL(unsigned long value, void *p);
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void display_startup(struct device *dev); #endif void dp_init(void *_config); diff --git a/src/soc/nvidia/tegra124/uart.c b/src/soc/nvidia/tegra124/uart.c index c9514ac..923fdd7 100644 --- a/src/soc/nvidia/tegra124/uart.c +++ b/src/soc/nvidia/tegra124/uart.c @@ -128,7 +128,7 @@ tegra124_uart_tx_flush(uart_ptr); }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void uart_fill_lb(void *data) { struct lb_serial serial; diff --git a/src/soc/nvidia/tegra210/uart.c b/src/soc/nvidia/tegra210/uart.c index a91818c..3d8e53e 100644 --- a/src/soc/nvidia/tegra210/uart.c +++ b/src/soc/nvidia/tegra210/uart.c @@ -115,7 +115,7 @@ return tegra210_uart_rx_byte(); }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void uart_fill_lb(void *data) { struct lb_serial serial; diff --git a/src/soc/qualcomm/ipq40xx/uart.c b/src/soc/qualcomm/ipq40xx/uart.c index eb3731b..6d3b72a 100644 --- a/src/soc/qualcomm/ipq40xx/uart.c +++ b/src/soc/qualcomm/ipq40xx/uart.c @@ -283,7 +283,7 @@ return byte; }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE /* TODO: Implement function */ void uart_fill_lb(void *data) { diff --git a/src/soc/qualcomm/ipq806x/uart.c b/src/soc/qualcomm/ipq806x/uart.c index 66c3103..7b70283 100644 --- a/src/soc/qualcomm/ipq806x/uart.c +++ b/src/soc/qualcomm/ipq806x/uart.c @@ -398,7 +398,7 @@ return byte; }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE /* TODO: Implement fuction */ void uart_fill_lb(void *data) { diff --git a/src/soc/qualcomm/qcs405/uart.c b/src/soc/qualcomm/qcs405/uart.c index 4a43312..d7e3bcd 100644 --- a/src/soc/qualcomm/qcs405/uart.c +++ b/src/soc/qualcomm/qcs405/uart.c @@ -287,7 +287,7 @@ } #endif
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void uart_fill_lb(void *data) { struct lb_serial serial; diff --git a/src/soc/samsung/exynos5250/uart.c b/src/soc/samsung/exynos5250/uart.c index 1b8e785..f2b4d82 100644 --- a/src/soc/samsung/exynos5250/uart.c +++ b/src/soc/samsung/exynos5250/uart.c @@ -185,7 +185,7 @@ exynos5_uart_tx_flush(uart); }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void uart_fill_lb(void *data) { struct lb_serial serial; diff --git a/src/soc/samsung/exynos5420/alternate_cbfs.c b/src/soc/samsung/exynos5420/alternate_cbfs.c index ba3f9a3..38e7cf9 100644 --- a/src/soc/samsung/exynos5420/alternate_cbfs.c +++ b/src/soc/samsung/exynos5420/alternate_cbfs.c @@ -37,11 +37,11 @@ * 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. + * have !ENV_RAMSTAGE defined) can just directly reference it there. */ static int usb_cbfs_open(void) { -#ifdef __PRE_RAM__ +#ifdef !ENV_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__ +#ifdef !ENV_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/uart.c b/src/soc/samsung/exynos5420/uart.c index b2a0edd..9c78075 100644 --- a/src/soc/samsung/exynos5420/uart.c +++ b/src/soc/samsung/exynos5420/uart.c @@ -176,7 +176,7 @@ /* Exynos5250 implements this too. */ }
-#ifndef __PRE_RAM__ +#if ENV_RAMSTAGE void uart_fill_lb(void *data) { struct lb_serial serial;
Hello ron minnich, Julius Werner, build bot (Jenkins), Philipp Hug,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34921
to look at the new patch set (#2).
Change subject: arch/non-x86: Replace uses of __PRE_RAM__ ......................................................................
arch/non-x86: Replace uses of __PRE_RAM__
Since there is no __SMM__ to worry about, !defined(__PRE_RAM__) becomes just ENV_RAMSTAGE.
Change-Id: Id8918f40572497b068509b5d5a490de0435ad50b Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/arm/include/armv7/arch/cpu.h M src/arch/arm64/include/armv8/arch/cpu.h M src/arch/mips/include/arch/cpu.h M src/arch/ppc64/include/arch/cpu.h M src/arch/riscv/include/arch/cpu.h M src/arch/riscv/include/arch/memlayout.h M src/cpu/ti/am335x/uart.c M src/drivers/uart/pl011.c M src/drivers/uart/sifive.c M src/mainboard/emulation/qemu-power8/uart.c M src/soc/imgtec/pistachio/uart.c M src/soc/mediatek/common/uart.c M src/soc/nvidia/tegra/dc.h M src/soc/nvidia/tegra124/uart.c M src/soc/nvidia/tegra210/uart.c M src/soc/qualcomm/ipq40xx/uart.c M src/soc/qualcomm/ipq806x/uart.c M src/soc/qualcomm/qcs405/uart.c M src/soc/samsung/exynos5250/uart.c M src/soc/samsung/exynos5420/alternate_cbfs.c M src/soc/samsung/exynos5420/uart.c 21 files changed, 25 insertions(+), 25 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/34921/2
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34921 )
Change subject: arch/non-x86: Replace uses of __PRE_RAM__ ......................................................................
Patch Set 2:
Patch looks good to me functionally, but is this really something we want to do? Is your goal to remove __PRE_RAM__ completely? I agree that a define that needs to be handled with #ifdef (rather than #if or if()) is ugly, but we could fix that by just creating an ENV_PRE_RAM in <rules.h> instead. I do think that the distinction of "are we in a stage that runs from DRAM" is generally useful -- even if ramstage is currently the only stage which that applies to on non-x86 boards, I wouldn't bet that that will never change in the future. Just to hedge against that possibility, I think it makes more sense to have constants that are named directly after the property you're really interested in.
And if we do intend to keep pre-RAM as a separate distinction, some of these cases should keep that rather than checking for the stage.
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34921 )
Change subject: arch/non-x86: Replace uses of __PRE_RAM__ ......................................................................
Patch Set 2:
(4 comments)
https://review.coreboot.org/c/coreboot/+/34921/2/src/arch/riscv/include/arch... File src/arch/riscv/include/arch/memlayout.h:
https://review.coreboot.org/c/coreboot/+/34921/2/src/arch/riscv/include/arch... PS2, Line 23: #if !ENV_RAMSTAGE ENV_PRE_RAM would indeed be useful here.
https://review.coreboot.org/c/coreboot/+/34921/2/src/mainboard/emulation/qem... File src/mainboard/emulation/qemu-power8/uart.c:
https://review.coreboot.org/c/coreboot/+/34921/2/src/mainboard/emulation/qem... PS2, Line 44: #if ENV_RAMSTAGE follow-up wipes these out already
https://review.coreboot.org/c/coreboot/+/34921/2/src/soc/nvidia/tegra/dc.h File src/soc/nvidia/tegra/dc.h:
https://review.coreboot.org/c/coreboot/+/34921/2/src/soc/nvidia/tegra/dc.h@5... PS2, Line 518: #if ENV_RAMSTAGE should not be needed
https://review.coreboot.org/c/coreboot/+/34921/2/src/soc/samsung/exynos5420/... File src/soc/samsung/exynos5420/alternate_cbfs.c:
https://review.coreboot.org/c/coreboot/+/34921/2/src/soc/samsung/exynos5420/... PS2, Line 44: #if !ENV_RAMSTAGE ENV_PRE_RAM here too.
Hello ron minnich, Julius Werner, build bot (Jenkins), Philipp Hug,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34921
to look at the new patch set (#3).
Change subject: arch/non-x86: Drop spurious uses of __PRE_RAM__ ......................................................................
arch/non-x86: Drop spurious uses of __PRE_RAM__
Change-Id: Id8918f40572497b068509b5d5a490de0435ad50b Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/arm/include/armv7/arch/cpu.h M src/arch/arm64/include/armv8/arch/cpu.h M src/arch/mips/include/arch/cpu.h M src/arch/ppc64/include/arch/cpu.h M src/arch/riscv/include/arch/cpu.h M src/soc/nvidia/tegra/dc.h M src/soc/qualcomm/ipq40xx/blobs_init.c M src/soc/qualcomm/ipq806x/blobs_init.c 8 files changed, 7 insertions(+), 34 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/34921/3
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34921 )
Change subject: arch/non-x86: Drop spurious uses of __PRE_RAM__ ......................................................................
Patch Set 4:
Patch Set 2:
Patch looks good to me functionally, but is this really something we want to do? Is your goal to remove __PRE_RAM__ completely? I agree that a define that needs to be handled with #ifdef (rather than #if or if()) is ugly, but we could fix that by just creating an ENV_PRE_RAM in <rules.h> instead. I do think that the distinction of "are we in a stage that runs from DRAM" is generally useful -- even if ramstage is currently the only stage which that applies to on non-x86 boards, I wouldn't bet that that will never change in the future. Just to hedge against that possibility, I think it makes more sense to have constants that are named directly after the property you're really interested in.
And if we do intend to keep pre-RAM as a separate distinction, some of these cases should keep that rather than checking for the stage.
Let's have CB:34939 for the discussion? I think this particular commit is ready for merge and not controversial.
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34921 )
Change subject: arch/non-x86: Drop spurious uses of __PRE_RAM__ ......................................................................
Patch Set 4:
(3 comments)
https://review.coreboot.org/c/coreboot/+/34921/2/src/arch/riscv/include/arch... File src/arch/riscv/include/arch/memlayout.h:
https://review.coreboot.org/c/coreboot/+/34921/2/src/arch/riscv/include/arch... PS2, Line 23: #if !ENV_RAMSTAGE
ENV_PRE_RAM would indeed be useful here.
Ack
https://review.coreboot.org/c/coreboot/+/34921/2/src/soc/nvidia/tegra/dc.h File src/soc/nvidia/tegra/dc.h:
https://review.coreboot.org/c/coreboot/+/34921/2/src/soc/nvidia/tegra/dc.h@5... PS2, Line 518: #if ENV_RAMSTAGE
should not be needed
Done
https://review.coreboot.org/c/coreboot/+/34921/2/src/soc/samsung/exynos5420/... File src/soc/samsung/exynos5420/alternate_cbfs.c:
https://review.coreboot.org/c/coreboot/+/34921/2/src/soc/samsung/exynos5420/... PS2, Line 44: #if !ENV_RAMSTAGE
ENV_PRE_RAM here too.
Will be dealt with later.
Hello ron minnich, Julius Werner, build bot (Jenkins), Philipp Hug,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34921
to look at the new patch set (#5).
Change subject: arch/non-x86: Remove use of __PRE_RAM__ ......................................................................
arch/non-x86: Remove use of __PRE_RAM__
Change-Id: Id8918f40572497b068509b5d5a490de0435ad50b Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/arm/include/armv7/arch/cpu.h M src/arch/arm64/include/armv8/arch/cpu.h M src/arch/mips/include/arch/cpu.h M src/arch/ppc64/include/arch/cpu.h M src/arch/riscv/include/arch/cpu.h M src/cpu/ti/am335x/uart.c M src/drivers/uart/pl011.c M src/drivers/uart/sifive.c M src/mainboard/emulation/qemu-power8/uart.c M src/soc/imgtec/pistachio/uart.c M src/soc/mediatek/common/uart.c M src/soc/nvidia/tegra/dc.h M src/soc/nvidia/tegra124/uart.c M src/soc/nvidia/tegra210/uart.c M src/soc/qualcomm/ipq40xx/blobs_init.c M src/soc/qualcomm/ipq40xx/uart.c M src/soc/qualcomm/ipq806x/blobs_init.c M src/soc/qualcomm/ipq806x/uart.c M src/soc/qualcomm/qcs405/uart.c M src/soc/samsung/exynos5250/uart.c M src/soc/samsung/exynos5420/uart.c 21 files changed, 7 insertions(+), 60 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/34921/5
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34921 )
Change subject: arch/non-x86: Remove use of __PRE_RAM__ ......................................................................
Patch Set 6: Code-Review+2
Kyösti Mälkki has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/34921 )
Change subject: arch/non-x86: Remove use of __PRE_RAM__ ......................................................................
arch/non-x86: Remove use of __PRE_RAM__
Change-Id: Id8918f40572497b068509b5d5a490de0435ad50b Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34921 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org --- M src/arch/arm/include/armv7/arch/cpu.h M src/arch/arm64/include/armv8/arch/cpu.h M src/arch/mips/include/arch/cpu.h M src/arch/ppc64/include/arch/cpu.h M src/arch/riscv/include/arch/cpu.h M src/cpu/ti/am335x/uart.c M src/drivers/uart/pl011.c M src/drivers/uart/sifive.c M src/mainboard/emulation/qemu-power8/uart.c M src/soc/imgtec/pistachio/uart.c M src/soc/mediatek/common/uart.c M src/soc/nvidia/tegra/dc.h M src/soc/nvidia/tegra124/uart.c M src/soc/nvidia/tegra210/uart.c M src/soc/qualcomm/ipq40xx/blobs_init.c M src/soc/qualcomm/ipq40xx/uart.c M src/soc/qualcomm/ipq806x/blobs_init.c M src/soc/qualcomm/ipq806x/uart.c M src/soc/qualcomm/qcs405/uart.c M src/soc/samsung/exynos5250/uart.c M src/soc/samsung/exynos5420/uart.c 21 files changed, 7 insertions(+), 60 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/arch/arm/include/armv7/arch/cpu.h b/src/arch/arm/include/armv7/arch/cpu.h index 22b3fb4..55ac5ea 100644 --- a/src/arch/arm/include/armv7/arch/cpu.h +++ b/src/arch/arm/include/armv7/arch/cpu.h @@ -17,12 +17,10 @@ #define __ARCH_CPU_H__
#include <stdint.h> +#include <device/device.h>
#define asmlinkage
-#if !defined(__PRE_RAM__) -#include <device/device.h> - struct cpu_driver { struct device_operations *ops; const struct cpu_device_id *id_table; @@ -34,8 +32,6 @@ uint8_t arm_model; };
-#endif - /* Primitives for CPU and MP cores. */
/* read Main Id register (MIDR) */ diff --git a/src/arch/arm64/include/armv8/arch/cpu.h b/src/arch/arm64/include/armv8/arch/cpu.h index 6e096cc..9dc9208 100644 --- a/src/arch/arm64/include/armv8/arch/cpu.h +++ b/src/arch/arm64/include/armv8/arch/cpu.h @@ -20,9 +20,6 @@
static inline unsigned int smp_processor_id(void) { return 0; }
- -#if !defined(__PRE_RAM__) struct cpu_driver { }; -#endif
#endif /* __ARCH_CPU_H__ */ diff --git a/src/arch/mips/include/arch/cpu.h b/src/arch/mips/include/arch/cpu.h index 8e35908..28f0261 100644 --- a/src/arch/mips/include/arch/cpu.h +++ b/src/arch/mips/include/arch/cpu.h @@ -16,12 +16,10 @@ #ifndef __MIPS_ARCH_CPU_H #define __MIPS_ARCH_CPU_H
-#define asmlinkage - -#ifndef __PRE_RAM__ - #include <device/device.h>
+#define asmlinkage + struct cpu_driver { struct device_operations *ops; const struct cpu_device_id *id_table; @@ -34,7 +32,6 @@ unsigned long index; };
-#endif /* !__PRE_RAM__ */
/*************************************************************************** * The following section was copied from arch/mips/include/asm/mipsregs.h in diff --git a/src/arch/ppc64/include/arch/cpu.h b/src/arch/ppc64/include/arch/cpu.h index 1e13528..23bc9a1 100644 --- a/src/arch/ppc64/include/arch/cpu.h +++ b/src/arch/ppc64/include/arch/cpu.h @@ -16,11 +16,10 @@ #ifndef __ARCH_CPU_H__ #define __ARCH_CPU_H__
-#define asmlinkage - -#if !defined(__PRE_RAM__) #include <device/device.h>
+#define asmlinkage + struct cpu_driver { struct device_operations *ops; const struct cpu_device_id *id_table; @@ -42,7 +41,6 @@ uint8_t ppc64_model; };
-#endif - struct cpu_info *cpu_info(void); + #endif /* __ARCH_CPU_H__ */ diff --git a/src/arch/riscv/include/arch/cpu.h b/src/arch/riscv/include/arch/cpu.h index 547cb76..c62199e 100644 --- a/src/arch/riscv/include/arch/cpu.h +++ b/src/arch/riscv/include/arch/cpu.h @@ -17,12 +17,10 @@ #define __ARCH_CPU_H__
#include <arch/encoding.h> +#include <device/device.h>
#define asmlinkage
-#if !defined(__PRE_RAM__) -#include <device/device.h> - struct cpu_driver { struct device_operations *ops; const struct cpu_device_id *id_table; @@ -44,8 +42,6 @@ uint8_t riscv_model; };
-#endif - static inline int supports_extension(char ext) { return read_csr(misa) & (1 << (ext - 'A')); diff --git a/src/cpu/ti/am335x/uart.c b/src/cpu/ti/am335x/uart.c index 4e9d012..f0e6f2f 100644 --- a/src/cpu/ti/am335x/uart.c +++ b/src/cpu/ti/am335x/uart.c @@ -182,7 +182,6 @@ { }
-#ifndef __PRE_RAM__ void uart_fill_lb(void *data) { struct lb_serial serial; @@ -194,4 +193,3 @@
lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -#endif diff --git a/src/drivers/uart/pl011.c b/src/drivers/uart/pl011.c index 4e3af52..ad00d7c 100644 --- a/src/drivers/uart/pl011.c +++ b/src/drivers/uart/pl011.c @@ -49,7 +49,6 @@ return read8(®s->dr); }
-#ifndef __PRE_RAM__ void uart_fill_lb(void *data) { struct lb_serial serial; @@ -63,4 +62,3 @@
lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -#endif diff --git a/src/drivers/uart/sifive.c b/src/drivers/uart/sifive.c index 1b0f75e..ca8b73b 100644 --- a/src/drivers/uart/sifive.c +++ b/src/drivers/uart/sifive.c @@ -113,9 +113,7 @@ return 1; }
-#ifndef __PRE_RAM__ void uart_fill_lb(void *data) { /* TODO */ } -#endif diff --git a/src/mainboard/emulation/qemu-power8/uart.c b/src/mainboard/emulation/qemu-power8/uart.c index 9548b7c..7c77971 100644 --- a/src/mainboard/emulation/qemu-power8/uart.c +++ b/src/mainboard/emulation/qemu-power8/uart.c @@ -41,7 +41,6 @@ { }
-#ifndef __PRE_RAM__ void uart_fill_lb(void *data) { struct lb_serial serial; @@ -53,4 +52,3 @@ lb_add_serial(&serial, data); lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -#endif diff --git a/src/soc/imgtec/pistachio/uart.c b/src/soc/imgtec/pistachio/uart.c index a39f2ec..3afd555 100644 --- a/src/soc/imgtec/pistachio/uart.c +++ b/src/soc/imgtec/pistachio/uart.c @@ -143,7 +143,6 @@ uart8250_mem_tx_flush(CONFIG_CONSOLE_SERIAL_UART_ADDRESS); }
-#ifndef __PRE_RAM__ void uart_fill_lb(void *data) { struct lb_serial serial; @@ -155,4 +154,3 @@
lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -#endif diff --git a/src/soc/mediatek/common/uart.c b/src/soc/mediatek/common/uart.c index 8905c55..d4a052f 100644 --- a/src/soc/mediatek/common/uart.c +++ b/src/soc/mediatek/common/uart.c @@ -172,7 +172,6 @@ mtk_uart_tx_flush(); }
-#ifndef __PRE_RAM__ void uart_fill_lb(void *data) { struct lb_serial serial; @@ -185,4 +184,3 @@
lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -#endif diff --git a/src/soc/nvidia/tegra/dc.h b/src/soc/nvidia/tegra/dc.h index a9061f8..56332e4 100644 --- a/src/soc/nvidia/tegra/dc.h +++ b/src/soc/nvidia/tegra/dc.h @@ -515,9 +515,7 @@ unsigned long READL(void *p); void WRITEL(unsigned long value, void *p);
-#ifndef __PRE_RAM__ void display_startup(struct device *dev); -#endif void dp_init(void *_config); void dp_enable(void *_dp); unsigned int fb_base_mb(void); diff --git a/src/soc/nvidia/tegra124/uart.c b/src/soc/nvidia/tegra124/uart.c index c9514ac..b1989dd 100644 --- a/src/soc/nvidia/tegra124/uart.c +++ b/src/soc/nvidia/tegra124/uart.c @@ -128,7 +128,6 @@ tegra124_uart_tx_flush(uart_ptr); }
-#ifndef __PRE_RAM__ void uart_fill_lb(void *data) { struct lb_serial serial; @@ -140,4 +139,3 @@
lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -#endif diff --git a/src/soc/nvidia/tegra210/uart.c b/src/soc/nvidia/tegra210/uart.c index a91818c..459cf74 100644 --- a/src/soc/nvidia/tegra210/uart.c +++ b/src/soc/nvidia/tegra210/uart.c @@ -115,7 +115,6 @@ return tegra210_uart_rx_byte(); }
-#ifndef __PRE_RAM__ void uart_fill_lb(void *data) { struct lb_serial serial; @@ -127,4 +126,3 @@
lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -#endif diff --git a/src/soc/qualcomm/ipq40xx/blobs_init.c b/src/soc/qualcomm/ipq40xx/blobs_init.c index 5cda9fc..9d608fa 100644 --- a/src/soc/qualcomm/ipq40xx/blobs_init.c +++ b/src/soc/qualcomm/ipq40xx/blobs_init.c @@ -58,8 +58,6 @@ return blob_mbn; }
-#ifdef __PRE_RAM__ - #define DDR_VERSION() ((const char *)"private build") #define MAX_DDR_VERSION_SIZE 48
@@ -120,7 +118,6 @@ return 0; }
-#else /* __PRE_RAM__ */ void start_tzbsp(void) { void *tzbsp = load_ipq_blob(CONFIG_TZ_MBN); @@ -133,4 +130,3 @@ tz_init_wrapper(0, 0, tzbsp);
} -#endif /* !__PRE_RAM__ */ diff --git a/src/soc/qualcomm/ipq40xx/uart.c b/src/soc/qualcomm/ipq40xx/uart.c index eb3731b..95e2eab 100644 --- a/src/soc/qualcomm/ipq40xx/uart.c +++ b/src/soc/qualcomm/ipq40xx/uart.c @@ -283,7 +283,6 @@ return byte; }
-#ifndef __PRE_RAM__ /* TODO: Implement function */ void uart_fill_lb(void *data) { @@ -297,4 +296,3 @@ lb_add_serial(&serial, data); lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -#endif diff --git a/src/soc/qualcomm/ipq806x/blobs_init.c b/src/soc/qualcomm/ipq806x/blobs_init.c index aa78f56..2da868b 100644 --- a/src/soc/qualcomm/ipq806x/blobs_init.c +++ b/src/soc/qualcomm/ipq806x/blobs_init.c @@ -57,8 +57,6 @@ return blob_mbn + 1; }
-#ifdef __PRE_RAM__ - #define DDR_VERSION() ((const char *)0x2a03f600) #define MAX_DDR_VERSION_SIZE 48
@@ -89,8 +87,6 @@ return 0; }
-#else /* __PRE_RAM__ */ - void start_tzbsp(void) { void *tzbsp = load_ipq_blob("tz.mbn"); @@ -152,4 +148,3 @@ (rpm_version >> 16) & 0xff, rpm_version & 0xffff); } -#endif /* !__PRE_RAM__ */ diff --git a/src/soc/qualcomm/ipq806x/uart.c b/src/soc/qualcomm/ipq806x/uart.c index 66c3103..f3e7de5 100644 --- a/src/soc/qualcomm/ipq806x/uart.c +++ b/src/soc/qualcomm/ipq806x/uart.c @@ -398,9 +398,7 @@ return byte; }
-#ifndef __PRE_RAM__ /* TODO: Implement fuction */ void uart_fill_lb(void *data) { } -#endif diff --git a/src/soc/qualcomm/qcs405/uart.c b/src/soc/qualcomm/qcs405/uart.c index 4a43312..6f95ba4 100644 --- a/src/soc/qualcomm/qcs405/uart.c +++ b/src/soc/qualcomm/qcs405/uart.c @@ -287,7 +287,6 @@ } #endif
-#ifndef __PRE_RAM__ void uart_fill_lb(void *data) { struct lb_serial serial; @@ -300,4 +299,3 @@ lb_add_serial(&serial, data); lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -#endif diff --git a/src/soc/samsung/exynos5250/uart.c b/src/soc/samsung/exynos5250/uart.c index 1b8e785..53290cf 100644 --- a/src/soc/samsung/exynos5250/uart.c +++ b/src/soc/samsung/exynos5250/uart.c @@ -185,7 +185,6 @@ exynos5_uart_tx_flush(uart); }
-#ifndef __PRE_RAM__ void uart_fill_lb(void *data) { struct lb_serial serial; @@ -197,4 +196,3 @@
lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -#endif diff --git a/src/soc/samsung/exynos5420/uart.c b/src/soc/samsung/exynos5420/uart.c index b2a0edd..41fdd0d 100644 --- a/src/soc/samsung/exynos5420/uart.c +++ b/src/soc/samsung/exynos5420/uart.c @@ -176,7 +176,6 @@ /* Exynos5250 implements this too. */ }
-#ifndef __PRE_RAM__ void uart_fill_lb(void *data) { struct lb_serial serial; @@ -190,4 +189,3 @@
lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data); } -#endif