Felix Singer has submitted this change. ( https://review.coreboot.org/c/coreboot/+/67062?usp=email )
Change subject: soc/ibm/power9/*: add file structure for SOC ......................................................................
soc/ibm/power9/*: add file structure for SOC
Boot device is stubbed to be able to build boards without errors.
Change-Id: Ie74b1e34f9aebe151d0fdb0e95c003510fd864c3 Signed-off-by: Igor Bagnucki bagnucki02@gmail.com Signed-off-by: Krystian Hebel krystian.hebel@3mdeb.com Signed-off-by: Sergii Dmytruk sergii.dmytruk@3mdeb.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/67062 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Felix Singer service+coreboot-gerrit@felixsinger.de --- A src/soc/ibm/power9/Kconfig A src/soc/ibm/power9/Makefile.mk A src/soc/ibm/power9/bootblock.c A src/soc/ibm/power9/cbmem.c A src/soc/ibm/power9/chip.c A src/soc/ibm/power9/rom_media.c A src/soc/ibm/power9/romstage.c A src/soc/ibm/power9/timer.c 8 files changed, 97 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Singer: Looks good to me, approved
diff --git a/src/soc/ibm/power9/Kconfig b/src/soc/ibm/power9/Kconfig new file mode 100644 index 0000000..9f3323b --- /dev/null +++ b/src/soc/ibm/power9/Kconfig @@ -0,0 +1,14 @@ +## SPDX-License-Identifier: GPL-2.0-only + +config SOC_IBM_POWER9 + bool + select ARCH_BOOTBLOCK_PPC64 + select ARCH_VERSTAGE_PPC64 + select ARCH_ROMSTAGE_PPC64 + select ARCH_RAMSTAGE_PPC64 + help + This SoC is the minimal template working on POWER9 Talos II platform. + +if SOC_IBM_POWER9 + # nothing here yet +endif diff --git a/src/soc/ibm/power9/Makefile.mk b/src/soc/ibm/power9/Makefile.mk new file mode 100644 index 0000000..84a40f9 --- /dev/null +++ b/src/soc/ibm/power9/Makefile.mk @@ -0,0 +1,17 @@ +## SPDX-License-Identifier: GPL-2.0-only + +ifeq ($(CONFIG_SOC_IBM_POWER9),y) + +bootblock-y += bootblock.c +bootblock-y += rom_media.c + +romstage-y += cbmem.c +romstage-y += rom_media.c +romstage-y += romstage.c + +ramstage-y += cbmem.c +ramstage-y += chip.c +ramstage-y += rom_media.c +ramstage-y += timer.c + +endif diff --git a/src/soc/ibm/power9/bootblock.c b/src/soc/ibm/power9/bootblock.c new file mode 100644 index 0000000..8621728 --- /dev/null +++ b/src/soc/ibm/power9/bootblock.c @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <bootblock_common.h> + +void bootblock_soc_early_init(void) +{ +} diff --git a/src/soc/ibm/power9/cbmem.c b/src/soc/ibm/power9/cbmem.c new file mode 100644 index 0000000..9543c45 --- /dev/null +++ b/src/soc/ibm/power9/cbmem.c @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <cbmem.h> + +uintptr_t cbmem_top_chipset(void) +{ + /* + * Smallest reported to be working (but not officially supported) DIMM is + * 4GB. This means that we always have at least as much available. Last + * 256MB are reserved for hostboot/coreboot (OCC and HOMER images). + * + * TODO: implement this properly after RAM is detected. + */ + return 4ull * GiB - 256 * MiB; +} diff --git a/src/soc/ibm/power9/chip.c b/src/soc/ibm/power9/chip.c new file mode 100644 index 0000000..f93c216 --- /dev/null +++ b/src/soc/ibm/power9/chip.c @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <cbmem.h> +#include <device/device.h> + +static void enable_soc_dev(struct device *dev) +{ + ram_range(dev, 0, 0, cbmem_top_chipset()); + /* This is for OCC and HOMER images */ + reserved_ram_range(dev, 1, cbmem_top_chipset(), 256 * MiB); +} + +struct chip_operations soc_ibm_power9_ops = { + .name = "POWER9", + .enable_dev = enable_soc_dev, +}; diff --git a/src/soc/ibm/power9/rom_media.c b/src/soc/ibm/power9/rom_media.c new file mode 100644 index 0000000..c07af1b --- /dev/null +++ b/src/soc/ibm/power9/rom_media.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <boot_device.h> + +const struct region_device *boot_device_ro(void) +{ + return NULL; +} diff --git a/src/soc/ibm/power9/romstage.c b/src/soc/ibm/power9/romstage.c new file mode 100644 index 0000000..4a3ed83 --- /dev/null +++ b/src/soc/ibm/power9/romstage.c @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <cbmem.h> +#include <console/console.h> +#include <program_loading.h> + +void main(void) +{ + console_init(); + cbmem_initialize_empty(); + run_ramstage(); +} diff --git a/src/soc/ibm/power9/timer.c b/src/soc/ibm/power9/timer.c new file mode 100644 index 0000000..9a283e3 --- /dev/null +++ b/src/soc/ibm/power9/timer.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <delay.h> + +void init_timer(void) +{ + /* No need to do anything here as long as udelay() is implemented via monolitic timer */ +}