aboutsummaryrefslogtreecommitdiff
path: root/product/sgi575
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.kachhap@arm.com>2018-07-20 15:17:09 +0530
committerronald-cron-arm <39518861+ronald-cron-arm@users.noreply.github.com>2018-10-18 17:22:34 +0000
commitd6e40d31188cd11071b2e9422f60e2bf972eba39 (patch)
treec228d92091c2522d89ee699643e1c2a0d423ed13 /product/sgi575
parentb48e2b9fa6e8d63f1968fe68c90c1515e92d3909 (diff)
sgi575/mcp_romfw: Add basic support for mcp rom image
This patch adds mcp_rom, log, memory layout and mcp_rom product support. Change-Id: Id92a256c89615464dda7b1a7f6a8d773ad3f63dd Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Diffstat (limited to 'product/sgi575')
-rw-r--r--product/sgi575/mcp_romfw/config_clock.c10
-rw-r--r--product/sgi575/mcp_romfw/config_log.c58
-rw-r--r--product/sgi575/mcp_romfw/config_sgi575_rom.c17
-rw-r--r--product/sgi575/mcp_romfw/firmware.mk25
-rw-r--r--product/sgi575/mcp_romfw/fmw_memory.ld.S32
-rw-r--r--product/sgi575/product.mk3
6 files changed, 144 insertions, 1 deletions
diff --git a/product/sgi575/mcp_romfw/config_clock.c b/product/sgi575/mcp_romfw/config_clock.c
new file mode 100644
index 00000000..6e8e3309
--- /dev/null
+++ b/product/sgi575/mcp_romfw/config_clock.c
@@ -0,0 +1,10 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <fwk_module.h>
+
+const struct fwk_module_config config_clock = { 0 };
diff --git a/product/sgi575/mcp_romfw/config_log.c b/product/sgi575/mcp_romfw/config_log.c
new file mode 100644
index 00000000..f33e364a
--- /dev/null
+++ b/product/sgi575/mcp_romfw/config_log.c
@@ -0,0 +1,58 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <fwk_banner.h>
+#include <fwk_macros.h>
+#include <fwk_module.h>
+#include <fwk_module_idx.h>
+#include <mod_log.h>
+#include <mod_pl011.h>
+#include <mcp_sgi575_mmap.h>
+
+/*
+ * PL011 module
+ */
+static const struct fwk_element pl011_element_desc_table[] = {
+ [0] = {
+ .name = "uart0",
+ .data = &((struct mod_pl011_device_config) {
+ .reg_base = MCP_UART0_BASE,
+ .baud_rate_bps = 115200,
+ .clock_rate_hz = 24 * FWK_MHZ,
+ .clock_id = FWK_ID_NONE_INIT,
+ }),
+ },
+ [1] = { 0 },
+};
+
+static const struct fwk_element *get_pl011_table(fwk_id_t module_id)
+{
+ return pl011_element_desc_table;
+}
+
+struct fwk_module_config config_pl011 = {
+ .get_element_table = get_pl011_table,
+};
+
+/*
+ * Log module
+ */
+static const struct mod_log_config log_data = {
+ .device_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PL011, 0),
+ .api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_PL011, 0),
+ .log_groups = MOD_LOG_GROUP_ERROR |
+ MOD_LOG_GROUP_INFO |
+ MOD_LOG_GROUP_WARNING |
+ MOD_LOG_GROUP_DEBUG,
+ .banner = FWK_BANNER_MCP
+ FWK_BANNER_ROM_FIRMWARE
+ BUILD_VERSION_DESCRIBE_STRING "\n",
+};
+
+struct fwk_module_config config_log = {
+ .data = &log_data,
+};
diff --git a/product/sgi575/mcp_romfw/config_sgi575_rom.c b/product/sgi575/mcp_romfw/config_sgi575_rom.c
new file mode 100644
index 00000000..7666bc7a
--- /dev/null
+++ b/product/sgi575/mcp_romfw/config_sgi575_rom.c
@@ -0,0 +1,17 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <fwk_module.h>
+#include <mod_sgi575_rom.h>
+#include <mcp_sgi575_mmap_mcp.h>
+
+const struct fwk_module_config config_sgi575_rom = {
+ .data = &((struct sgi575_rom_config) {
+ .ramfw_base = MCP_RAM0_BASE,
+ .load_ram_size = 0,
+ })
+};
diff --git a/product/sgi575/mcp_romfw/firmware.mk b/product/sgi575/mcp_romfw/firmware.mk
new file mode 100644
index 00000000..618d0b3d
--- /dev/null
+++ b/product/sgi575/mcp_romfw/firmware.mk
@@ -0,0 +1,25 @@
+#
+# Arm SCP/MCP Software
+# Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+BS_FIRMWARE_CPU := cortex-m7
+BS_FIRMWARE_HAS_MULTITHREADING := no
+BS_FIRMWARE_HAS_NOTIFICATION := yes
+BS_FIRMWARE_MODULE_HEADERS_ONLY := \
+ power_domain
+
+BS_FIRMWARE_MODULES := \
+ pl011 \
+ log \
+ clock \
+ sgi575_rom
+
+BS_FIRMWARE_SOURCES := \
+ config_log.c \
+ config_clock.c \
+ config_sgi575_rom.c
+
+include $(BS_DIR)/firmware.mk
diff --git a/product/sgi575/mcp_romfw/fmw_memory.ld.S b/product/sgi575/mcp_romfw/fmw_memory.ld.S
new file mode 100644
index 00000000..1f6d4c29
--- /dev/null
+++ b/product/sgi575/mcp_romfw/fmw_memory.ld.S
@@ -0,0 +1,32 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Description:
+ * ROM firmware memory layout for the linker script.
+ */
+
+#ifndef FMW_MEMORY_LD_S
+#define FMW_MEMORY_LD_S
+
+#include <mcp_system_mmap_mcp.h>
+
+#define FIRMWARE_MEM_MODE FWK_MEM_MODE_DUAL_REGION_RELOCATION
+
+/*
+ * ROM memory
+ */
+#define FIRMWARE_MEM0_SIZE MCP_ROM_SIZE
+#define FIRMWARE_MEM0_BASE MCP_ROM_BASE
+
+/*
+ * RAM memory
+ */
+#define FIRMWARE_MEM1_SIZE MCP_RAM1_SIZE
+#define FIRMWARE_MEM1_BASE MCP_RAM1_BASE
+
+#define FIRMWARE_STACK_SIZE (1 * 1024)
+
+#endif /* FMW_MEMORY_LD_S */
diff --git a/product/sgi575/product.mk b/product/sgi575/product.mk
index c0a06fe7..c734f180 100644
--- a/product/sgi575/product.mk
+++ b/product/sgi575/product.mk
@@ -7,4 +7,5 @@
BS_PRODUCT_NAME := sgi575
BS_FIRMWARE_LIST := scp_romfw \
- scp_ramfw
+ scp_ramfw \
+ mcp_romfw