diff options
author | Chris Kay <chris.kay@arm.com> | 2020-08-06 16:36:00 +0100 |
---|---|---|
committer | jimqui01 <54316584+jimqui01@users.noreply.github.com> | 2020-09-08 11:37:54 +0100 |
commit | ae590fff9bb6f7497ccd9b6a34fad382f30b70fb (patch) | |
tree | 6f1c526ab8c60142be240f9c79351979d2a45327 /product/sgm775 | |
parent | 830f57d6d458b43ad83ef75fe314267997e49d05 (diff) |
misc: Split `log`/`pl011` configuration files
A number of platforms merge the configuration files for the `log` and
`pl011` modules. With the removal of the `log` module later on, it's
easiest to clean up this split across all the platforms.
Change-Id: Id537ddfdd244fbd69643e92967498816e10b16b4
Signed-off-by: Chris Kay <chris.kay@arm.com>
Diffstat (limited to 'product/sgm775')
-rw-r--r-- | product/sgm775/scp_ramfw/config_log.c | 39 | ||||
-rw-r--r-- | product/sgm775/scp_ramfw/config_pl011.c | 44 | ||||
-rw-r--r-- | product/sgm775/scp_ramfw/firmware.mk | 1 | ||||
-rw-r--r-- | product/sgm775/scp_romfw/config_log.c | 39 | ||||
-rw-r--r-- | product/sgm775/scp_romfw/config_pl011.c | 44 | ||||
-rw-r--r-- | product/sgm775/scp_romfw/firmware.mk | 1 |
6 files changed, 90 insertions, 78 deletions
diff --git a/product/sgm775/scp_ramfw/config_log.c b/product/sgm775/scp_ramfw/config_log.c index dce972c4..01076d98 100644 --- a/product/sgm775/scp_ramfw/config_log.c +++ b/product/sgm775/scp_ramfw/config_log.c @@ -5,51 +5,12 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include "clock_devices.h" -#include "system_mmap.h" - #include <mod_log.h> -#include <mod_pl011.h> -#include <fwk_element.h> #include <fwk_id.h> -#include <fwk_macros.h> #include <fwk_module.h> #include <fwk_module_idx.h> -#include <stddef.h> - -/* - * PL011 module - */ -static const struct fwk_element pl011_element_table[] = { - [0] = { - .name = "board-uart1", - .data = &((struct mod_pl011_device_config) { - .reg_base = BOARD_UART1_BASE, - .baud_rate_bps = 115200, - .clock_rate_hz = 24 * FWK_MHZ, - .clock_id = FWK_ID_ELEMENT_INIT( - FWK_MODULE_IDX_CLOCK, - CLOCK_DEV_IDX_FCMCLK), - .pd_id = FWK_ID_NONE_INIT, - }), - }, - [1] = { 0 }, -}; - -static const struct fwk_element *get_pl011_table(fwk_id_t module_id) -{ - return pl011_element_table; -} - -struct fwk_module_config config_pl011 = { - .elements = FWK_MODULE_DYNAMIC_ELEMENTS(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), diff --git a/product/sgm775/scp_ramfw/config_pl011.c b/product/sgm775/scp_ramfw/config_pl011.c new file mode 100644 index 00000000..15cd3e8b --- /dev/null +++ b/product/sgm775/scp_ramfw/config_pl011.c @@ -0,0 +1,44 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2017-2020, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "clock_devices.h" +#include "system_mmap.h" + +#include <mod_pl011.h> + +#include <fwk_element.h> +#include <fwk_id.h> +#include <fwk_macros.h> +#include <fwk_module.h> +#include <fwk_module_idx.h> + +static const struct fwk_element pl011_element_table[] = { + [0] = { + .name = "board-uart1", + .data = + &(struct mod_pl011_device_config){ + .reg_base = BOARD_UART1_BASE, + .baud_rate_bps = 115200, + .clock_rate_hz = 24 * FWK_MHZ, + .clock_id = FWK_ID_ELEMENT_INIT( + FWK_MODULE_IDX_CLOCK, + CLOCK_DEV_IDX_FCMCLK), + .pd_id = FWK_ID_NONE_INIT, + }, + }, + + [1] = { 0 }, +}; + +static const struct fwk_element *get_pl011_table(fwk_id_t module_id) +{ + return pl011_element_table; +} + +struct fwk_module_config config_pl011 = { + .elements = FWK_MODULE_DYNAMIC_ELEMENTS(get_pl011_table), +}; diff --git a/product/sgm775/scp_ramfw/firmware.mk b/product/sgm775/scp_ramfw/firmware.mk index 73911814..34cecf8a 100644 --- a/product/sgm775/scp_ramfw/firmware.mk +++ b/product/sgm775/scp_ramfw/firmware.mk @@ -56,6 +56,7 @@ BS_FIRMWARE_SOURCES := \ rtx_config.c \ sgm775_core.c \ config_log.c \ + config_pl011.c\ config_timer.c \ config_sgm775_ddr_phy500.c \ config_sgm775_dmc500.c \ diff --git a/product/sgm775/scp_romfw/config_log.c b/product/sgm775/scp_romfw/config_log.c index 263726e7..01076d98 100644 --- a/product/sgm775/scp_romfw/config_log.c +++ b/product/sgm775/scp_romfw/config_log.c @@ -5,51 +5,12 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include "clock_devices.h" -#include "system_mmap.h" - #include <mod_log.h> -#include <mod_pl011.h> -#include <fwk_element.h> #include <fwk_id.h> -#include <fwk_macros.h> #include <fwk_module.h> #include <fwk_module_idx.h> -#include <stddef.h> - -/* - * PL011 module - */ -static const struct fwk_element pl011_element_desc_table[] = { - [0] = { - .name = "board-uart1", - .data = &((struct mod_pl011_device_config) { - .reg_base = BOARD_UART1_BASE, - .baud_rate_bps = 115200, - .clock_rate_hz = 24 * FWK_MHZ, - .clock_id = FWK_ID_ELEMENT_INIT( - FWK_MODULE_IDX_CLOCK, - CLOCK_DEV_IDX_SYS_FCMCLK), - .pd_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 = { - .elements = FWK_MODULE_DYNAMIC_ELEMENTS(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), diff --git a/product/sgm775/scp_romfw/config_pl011.c b/product/sgm775/scp_romfw/config_pl011.c new file mode 100644 index 00000000..a742d350 --- /dev/null +++ b/product/sgm775/scp_romfw/config_pl011.c @@ -0,0 +1,44 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2017-2020, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "clock_devices.h" +#include "system_mmap.h" + +#include <mod_pl011.h> + +#include <fwk_element.h> +#include <fwk_id.h> +#include <fwk_macros.h> +#include <fwk_module.h> +#include <fwk_module_idx.h> + +static const struct fwk_element pl011_element_desc_table[] = { + [0] = { + .name = "board-uart1", + .data = + &(struct mod_pl011_device_config){ + .reg_base = BOARD_UART1_BASE, + .baud_rate_bps = 115200, + .clock_rate_hz = 24 * FWK_MHZ, + .clock_id = FWK_ID_ELEMENT_INIT( + FWK_MODULE_IDX_CLOCK, + CLOCK_DEV_IDX_SYS_FCMCLK), + .pd_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 = { + .elements = FWK_MODULE_DYNAMIC_ELEMENTS(get_pl011_table), +}; diff --git a/product/sgm775/scp_romfw/firmware.mk b/product/sgm775/scp_romfw/firmware.mk index ee112cb9..9e271f93 100644 --- a/product/sgm775/scp_romfw/firmware.mk +++ b/product/sgm775/scp_romfw/firmware.mk @@ -30,6 +30,7 @@ BS_FIRMWARE_MODULES := sid \ sds BS_FIRMWARE_SOURCES := config_log.c \ + config_pl011.c \ config_timer.c \ config_msys_rom.c \ config_sds.c \ |