mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 18:14:24 +00:00
Merge changes from topic "bk/warnings" into integration
* changes: docs: describe the new warning levels build: add -Wunused-const-variable=2 to W=2 build: include -Wextra in generic builds docs(porting-guide): update a reference fix(st-usb): replace redundant checks with asserts fix(brcm): add braces around bodies of conditionals fix(renesas): align incompatible function pointers fix(zynqmp): remove redundant api_version check fix: remove old-style declarations fix: unify fallthrough annotations
This commit is contained in:
commit
601e2d4325
26 changed files with 161 additions and 108 deletions
46
Makefile
46
Makefile
|
@ -350,27 +350,53 @@ ASFLAGS_aarch64 = $(march64-directive)
|
||||||
# General warnings
|
# General warnings
|
||||||
WARNINGS := -Wall -Wmissing-include-dirs -Wunused \
|
WARNINGS := -Wall -Wmissing-include-dirs -Wunused \
|
||||||
-Wdisabled-optimization -Wvla -Wshadow \
|
-Wdisabled-optimization -Wvla -Wshadow \
|
||||||
-Wno-unused-parameter -Wredundant-decls
|
-Wredundant-decls
|
||||||
|
# stricter warnings
|
||||||
|
WARNINGS += -Wextra -Wno-trigraphs
|
||||||
|
# too verbose for generic build
|
||||||
|
WARNINGS += -Wno-missing-field-initializers \
|
||||||
|
-Wno-type-limits -Wno-sign-compare \
|
||||||
|
# on clang this flag gets reset if -Wextra is set after it. No difference on gcc
|
||||||
|
WARNINGS += -Wno-unused-parameter
|
||||||
|
|
||||||
# Additional warnings
|
# Additional warnings
|
||||||
# Level 1
|
# Level 1 - infrequent warnings we should have none of
|
||||||
WARNING1 := -Wextra
|
# full -Wextra
|
||||||
WARNING1 += -Wmissing-format-attribute
|
WARNING1 += -Wsign-compare
|
||||||
WARNING1 += -Wmissing-prototypes
|
WARNING1 += -Wtype-limits
|
||||||
WARNING1 += -Wold-style-definition
|
WARNING1 += -Wmissing-field-initializers
|
||||||
|
|
||||||
# Level 2
|
# Level 2 - problematic warnings that we want
|
||||||
WARNING2 := -Waggregate-return
|
# zlib, compiler-rt, coreboot, and mbdedtls blow up with these
|
||||||
WARNING2 += -Wcast-align
|
# TODO: disable just for them and move into default build
|
||||||
WARNING2 += -Wnested-externs
|
WARNING2 += -Wold-style-definition
|
||||||
|
WARNING2 += -Wmissing-prototypes
|
||||||
|
WARNING2 += -Wmissing-format-attribute
|
||||||
|
# TF-A aims to comply with this eventually. Effort too large at present
|
||||||
|
WARNING2 += -Wundef
|
||||||
|
# currently very involved and many platforms set this off
|
||||||
|
WARNING2 += -Wunused-const-variable=2
|
||||||
|
|
||||||
|
# Level 3 - very pedantic, frequently ignored
|
||||||
WARNING3 := -Wbad-function-cast
|
WARNING3 := -Wbad-function-cast
|
||||||
|
WARNING3 += -Waggregate-return
|
||||||
|
WARNING3 += -Wnested-externs
|
||||||
|
WARNING3 += -Wcast-align
|
||||||
WARNING3 += -Wcast-qual
|
WARNING3 += -Wcast-qual
|
||||||
WARNING3 += -Wconversion
|
WARNING3 += -Wconversion
|
||||||
WARNING3 += -Wpacked
|
WARNING3 += -Wpacked
|
||||||
WARNING3 += -Wpointer-arith
|
WARNING3 += -Wpointer-arith
|
||||||
WARNING3 += -Wswitch-default
|
WARNING3 += -Wswitch-default
|
||||||
|
|
||||||
|
# Setting W is quite verbose and most warnings will be pre-existing issues
|
||||||
|
# outside of the contributor's control. Don't fail the build on them so warnings
|
||||||
|
# can be seen and hopefully addressed
|
||||||
|
ifdef W
|
||||||
|
ifneq (${W},0)
|
||||||
|
E ?= 0
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq (${W},1)
|
ifeq (${W},1)
|
||||||
WARNINGS += $(WARNING1)
|
WARNINGS += $(WARNING1)
|
||||||
else ifeq (${W},2)
|
else ifeq (${W},2)
|
||||||
|
|
|
@ -213,6 +213,12 @@ Common build options
|
||||||
|
|
||||||
- ``E``: Boolean option to make warnings into errors. Default is 1.
|
- ``E``: Boolean option to make warnings into errors. Default is 1.
|
||||||
|
|
||||||
|
When specifying higher warnings levels (``W=1`` and higher), this option
|
||||||
|
defaults to 0. This is done to encourage contributors to use them, as they
|
||||||
|
are expected to produce warnings that would otherwise fail the build. New
|
||||||
|
contributions are still expected to build with ``W=0`` and ``E=1`` (the
|
||||||
|
default).
|
||||||
|
|
||||||
- ``EL3_PAYLOAD_BASE``: This option enables booting an EL3 payload instead of
|
- ``EL3_PAYLOAD_BASE``: This option enables booting an EL3 payload instead of
|
||||||
the normal boot flow. It must specify the entry point address of the EL3
|
the normal boot flow. It must specify the entry point address of the EL3
|
||||||
payload. Please refer to the "Booting an EL3 payload" section for more
|
payload. Please refer to the "Booting an EL3 payload" section for more
|
||||||
|
@ -954,6 +960,43 @@ Common build options
|
||||||
regrouped and put in the root Makefile. This flag can take the values 0 to 3,
|
regrouped and put in the root Makefile. This flag can take the values 0 to 3,
|
||||||
each level enabling more warning options. Default is 0.
|
each level enabling more warning options. Default is 0.
|
||||||
|
|
||||||
|
This option is closely related to the ``E`` option, which enables
|
||||||
|
``-Werror``.
|
||||||
|
|
||||||
|
- ``W=0`` (default)
|
||||||
|
|
||||||
|
Enables a wide assortment of warnings, most notably ``-Wall`` and
|
||||||
|
``-Wextra``, as well as various bad practices and things that are likely to
|
||||||
|
result in errors. Includes some compiler specific flags. No warnings are
|
||||||
|
expected at this level for any build.
|
||||||
|
|
||||||
|
- ``W=1``
|
||||||
|
|
||||||
|
Enables warnings we want the generic build to include but are too time
|
||||||
|
consuming to fix at the moment. It re-enables warnings taken out for
|
||||||
|
``W=0`` builds (a few of the ``-Wextra`` additions). This level is expected
|
||||||
|
to eventually be merged into ``W=0``. Some warnings are expected on some
|
||||||
|
builds, but new contributions should not introduce new ones.
|
||||||
|
|
||||||
|
- ``W=2`` (recommended)
|
||||||
|
|
||||||
|
Enables warnings we want the generic build to include but cannot be enabled
|
||||||
|
due to external libraries. This level is expected to eventually be merged
|
||||||
|
into ``W=0``. Lots of warnings are expected, primarily from external
|
||||||
|
libraries like zlib and compiler-rt, but new controbutions should not
|
||||||
|
introduce new ones.
|
||||||
|
|
||||||
|
- ``W=3``
|
||||||
|
|
||||||
|
Enables warnings that are informative but not necessary and generally too
|
||||||
|
verbose and frequently ignored. A very large number of warnings are
|
||||||
|
expected.
|
||||||
|
|
||||||
|
The exact set of warning flags depends on the compiler and TF-A warning
|
||||||
|
level, however they are all succinctly set in the top-level Makefile. Please
|
||||||
|
refer to the `GCC`_ or `Clang`_ documentation for more information on the
|
||||||
|
individual flags.
|
||||||
|
|
||||||
- ``WARMBOOT_ENABLE_DCACHE_EARLY`` : Boolean option to enable D-cache early on
|
- ``WARMBOOT_ENABLE_DCACHE_EARLY`` : Boolean option to enable D-cache early on
|
||||||
the CPU after warm boot. This is applicable for platforms which do not
|
the CPU after warm boot. This is applicable for platforms which do not
|
||||||
require interconnect programming to enable cache coherency (eg: single
|
require interconnect programming to enable cache coherency (eg: single
|
||||||
|
@ -1161,3 +1204,5 @@ Firmware update options
|
||||||
.. _DEN0115: https://developer.arm.com/docs/den0115/latest
|
.. _DEN0115: https://developer.arm.com/docs/den0115/latest
|
||||||
.. _PSA FW update specification: https://developer.arm.com/documentation/den0118/a/
|
.. _PSA FW update specification: https://developer.arm.com/documentation/den0118/a/
|
||||||
.. _PSA DRTM specification: https://developer.arm.com/documentation/den0113/a
|
.. _PSA DRTM specification: https://developer.arm.com/documentation/den0113/a
|
||||||
|
.. _GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||||
|
.. _Clang: https://clang.llvm.org/docs/DiagnosticsReference.html
|
||||||
|
|
|
@ -2135,7 +2135,7 @@ CPUs. BL31 executes at EL3 and is responsible for:
|
||||||
|
|
||||||
#. Providing runtime firmware services. Currently, BL31 only implements a
|
#. Providing runtime firmware services. Currently, BL31 only implements a
|
||||||
subset of the Power State Coordination Interface (PSCI) API as a runtime
|
subset of the Power State Coordination Interface (PSCI) API as a runtime
|
||||||
service. See Section 3.3 below for details of porting the PSCI
|
service. See :ref:`psci_in_bl31` below for details of porting the PSCI
|
||||||
implementation.
|
implementation.
|
||||||
|
|
||||||
#. Optionally passing control to the BL32 image, pre-loaded at a platform-
|
#. Optionally passing control to the BL32 image, pre-loaded at a platform-
|
||||||
|
@ -2544,6 +2544,8 @@ Function: bool plat_get_entropy(uint64_t \*out) [mandatory]
|
||||||
This function writes entropy into storage provided by the caller. If no entropy
|
This function writes entropy into storage provided by the caller. If no entropy
|
||||||
is available, it must return false and the storage must not be written.
|
is available, it must return false and the storage must not be written.
|
||||||
|
|
||||||
|
.. _psci_in_bl31:
|
||||||
|
|
||||||
Power State Coordination Interface (in BL31)
|
Power State Coordination Interface (in BL31)
|
||||||
--------------------------------------------
|
--------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -131,38 +131,9 @@ Several build options can be used to check for security issues. Refer to the
|
||||||
overflows.
|
overflows.
|
||||||
|
|
||||||
- The ``W`` build flag can be used to enable a number of compiler warning
|
- The ``W`` build flag can be used to enable a number of compiler warning
|
||||||
options to detect potentially incorrect code.
|
options to detect potentially incorrect code. TF-A is tested with ``W=0`` but
|
||||||
|
it is recommended to develop against ``W=2`` (which will eventually become the
|
||||||
- W=0 (default value)
|
default).
|
||||||
|
|
||||||
The ``Wunused`` with ``Wno-unused-parameter``, ``Wdisabled-optimization``
|
|
||||||
and ``Wvla`` flags are enabled.
|
|
||||||
|
|
||||||
The ``Wunused-but-set-variable``, ``Wmaybe-uninitialized`` and
|
|
||||||
``Wpacked-bitfield-compat`` are GCC specific flags that are also enabled.
|
|
||||||
|
|
||||||
- W=1
|
|
||||||
|
|
||||||
Adds ``Wextra``, ``Wmissing-format-attribute``, ``Wmissing-prototypes``,
|
|
||||||
``Wold-style-definition`` and ``Wunused-const-variable``.
|
|
||||||
|
|
||||||
- W=2
|
|
||||||
|
|
||||||
Adds ``Waggregate-return``, ``Wcast-align``, ``Wnested-externs``,
|
|
||||||
``Wshadow``, ``Wlogical-op``.
|
|
||||||
|
|
||||||
- W=3
|
|
||||||
|
|
||||||
Adds ``Wbad-function-cast``, ``Wcast-qual``, ``Wconversion``, ``Wpacked``,
|
|
||||||
``Wpointer-arith``, ``Wredundant-decls`` and
|
|
||||||
``Wswitch-default``.
|
|
||||||
|
|
||||||
Refer to the GCC or Clang documentation for more information on the individual
|
|
||||||
options: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html and
|
|
||||||
https://clang.llvm.org/docs/DiagnosticsReference.html.
|
|
||||||
|
|
||||||
NB: The ``Werror`` flag is enabled by default in TF-A and can be disabled by
|
|
||||||
setting the ``E`` build flag to 0.
|
|
||||||
|
|
||||||
.. rubric:: References
|
.. rubric:: References
|
||||||
|
|
||||||
|
|
|
@ -479,10 +479,11 @@ int init_mmc_card(struct sd_handle *handle)
|
||||||
handle->device->cfg.blockSize = 512;
|
handle->device->cfg.blockSize = 512;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handle->device->ctrl.ocr & SD_CARD_HIGH_CAPACITY)
|
if (handle->device->ctrl.ocr & SD_CARD_HIGH_CAPACITY) {
|
||||||
EMMC_TRACE("Sector addressing\n");
|
EMMC_TRACE("Sector addressing\n");
|
||||||
else
|
} else {
|
||||||
EMMC_TRACE("Byte addressing\n");
|
EMMC_TRACE("Byte addressing\n");
|
||||||
|
}
|
||||||
|
|
||||||
EMMC_TRACE("Ext_CSD_storage[162]: 0x%02X Ext_CSD_storage[179]: 0x%02X\n",
|
EMMC_TRACE("Ext_CSD_storage[162]: 0x%02X Ext_CSD_storage[179]: 0x%02X\n",
|
||||||
emmc_global_buf_ptr->u.Ext_CSD_storage[162],
|
emmc_global_buf_ptr->u.Ext_CSD_storage[162],
|
||||||
|
|
|
@ -278,8 +278,9 @@ struct sd_handle *sdio_init(void)
|
||||||
|
|
||||||
SDIO_base = EMMC_CTRL_REGS_BASE_ADDR;
|
SDIO_base = EMMC_CTRL_REGS_BASE_ADDR;
|
||||||
|
|
||||||
if (SDIO_base == SDIO0_EMMCSDXC_SYSADDR)
|
if (SDIO_base == SDIO0_EMMCSDXC_SYSADDR) {
|
||||||
EMMC_TRACE(" ---> for SDIO 0 Controller\n\n");
|
EMMC_TRACE(" ---> for SDIO 0 Controller\n\n");
|
||||||
|
}
|
||||||
|
|
||||||
memset(p_sdhandle, 0, sizeof(struct sd_handle));
|
memset(p_sdhandle, 0, sizeof(struct sd_handle));
|
||||||
|
|
||||||
|
@ -290,8 +291,9 @@ struct sd_handle *sdio_init(void)
|
||||||
memset(p_sdhandle->card, 0, sizeof(struct sd_card_info));
|
memset(p_sdhandle->card, 0, sizeof(struct sd_card_info));
|
||||||
|
|
||||||
if (chal_sd_start((CHAL_HANDLE *) p_sdhandle->device,
|
if (chal_sd_start((CHAL_HANDLE *) p_sdhandle->device,
|
||||||
SD_PIO_MODE, SDIO_base, SDIO_base) != SD_OK)
|
SD_PIO_MODE, SDIO_base, SDIO_base) != SD_OK) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
set_config(p_sdhandle, SD_NORMAL_SPEED, MAX_CMD_RETRY, SD_DMA_OFF,
|
set_config(p_sdhandle, SD_NORMAL_SPEED, MAX_CMD_RETRY, SD_DMA_OFF,
|
||||||
SD_DMA_BOUNDARY_4K, EMMC_BLOCK_SIZE, EMMC_WFE_RETRY);
|
SD_DMA_BOUNDARY_4K, EMMC_BLOCK_SIZE, EMMC_WFE_RETRY);
|
||||||
|
@ -330,14 +332,16 @@ uint32_t sdio_read(struct sd_handle *p_sdhandle,
|
||||||
VERBOSE("EMMC READ: dst=0x%lx, src=0x%lx, size=0x%lx\n",
|
VERBOSE("EMMC READ: dst=0x%lx, src=0x%lx, size=0x%lx\n",
|
||||||
storage_addr, mem_addr, bytes_to_read);
|
storage_addr, mem_addr, bytes_to_read);
|
||||||
|
|
||||||
if (storage_size < bytes_to_read)
|
if (storage_size < bytes_to_read) {
|
||||||
/* Don't have sufficient storage to complete the operation */
|
/* Don't have sufficient storage to complete the operation */
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Range check non high capacity memory */
|
/* Range check non high capacity memory */
|
||||||
if ((p_sdhandle->device->ctrl.ocr & SD_CARD_HIGH_CAPACITY) == 0) {
|
if ((p_sdhandle->device->ctrl.ocr & SD_CARD_HIGH_CAPACITY) == 0) {
|
||||||
if (mem_addr > 0x80000000)
|
if (mem_addr > 0x80000000) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* High capacity card use block address mode */
|
/* High capacity card use block address mode */
|
||||||
|
@ -384,10 +388,11 @@ uint32_t sdio_read(struct sd_handle *p_sdhandle,
|
||||||
/* Update Physical address */
|
/* Update Physical address */
|
||||||
outputBuf += manual_copy_size;
|
outputBuf += manual_copy_size;
|
||||||
|
|
||||||
if (p_sdhandle->device->ctrl.ocr & SD_CARD_HIGH_CAPACITY)
|
if (p_sdhandle->device->ctrl.ocr & SD_CARD_HIGH_CAPACITY) {
|
||||||
blockAddr++;
|
blockAddr++;
|
||||||
else
|
} else {
|
||||||
blockAddr += blockSize;
|
blockAddr += blockSize;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -395,10 +400,11 @@ uint32_t sdio_read(struct sd_handle *p_sdhandle,
|
||||||
|
|
||||||
while (remSize >= blockSize) {
|
while (remSize >= blockSize) {
|
||||||
|
|
||||||
if (remSize >= SD_MAX_BLK_TRANSFER_LENGTH)
|
if (remSize >= SD_MAX_BLK_TRANSFER_LENGTH) {
|
||||||
readLen = SD_MAX_BLK_TRANSFER_LENGTH;
|
readLen = SD_MAX_BLK_TRANSFER_LENGTH;
|
||||||
else
|
} else {
|
||||||
readLen = (remSize / blockSize) * blockSize;
|
readLen = (remSize / blockSize) * blockSize;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check for overflow */
|
/* Check for overflow */
|
||||||
if ((rdCount + readLen) > storage_size ||
|
if ((rdCount + readLen) > storage_size ||
|
||||||
|
@ -409,10 +415,11 @@ uint32_t sdio_read(struct sd_handle *p_sdhandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!read_block(p_sdhandle, outputBuf, blockAddr, readLen)) {
|
if (!read_block(p_sdhandle, outputBuf, blockAddr, readLen)) {
|
||||||
if (p_sdhandle->device->ctrl.ocr & SD_CARD_HIGH_CAPACITY)
|
if (p_sdhandle->device->ctrl.ocr & SD_CARD_HIGH_CAPACITY) {
|
||||||
blockAddr += (readLen / blockSize);
|
blockAddr += (readLen / blockSize);
|
||||||
else
|
} else {
|
||||||
blockAddr += readLen;
|
blockAddr += readLen;
|
||||||
|
}
|
||||||
|
|
||||||
remSize -= readLen;
|
remSize -= readLen;
|
||||||
rdCount += readLen;
|
rdCount += readLen;
|
||||||
|
@ -463,8 +470,9 @@ static uint32_t sdio_write(struct sd_handle *p_sdhandle, uintptr_t mem_addr,
|
||||||
|
|
||||||
/* range check non high capacity memory */
|
/* range check non high capacity memory */
|
||||||
if ((p_sdhandle->device->ctrl.ocr & SD_CARD_HIGH_CAPACITY) == 0) {
|
if ((p_sdhandle->device->ctrl.ocr & SD_CARD_HIGH_CAPACITY) == 0) {
|
||||||
if (mem_addr > 0x80000000)
|
if (mem_addr > 0x80000000) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the high capacity card use block address mode */
|
/* the high capacity card use block address mode */
|
||||||
|
@ -491,11 +499,12 @@ static uint32_t sdio_write(struct sd_handle *p_sdhandle, uintptr_t mem_addr,
|
||||||
blockAddr, p_sdhandle->device->cfg.blockSize)) {
|
blockAddr, p_sdhandle->device->cfg.blockSize)) {
|
||||||
|
|
||||||
if (remSize <
|
if (remSize <
|
||||||
(p_sdhandle->device->cfg.blockSize - offset))
|
(p_sdhandle->device->cfg.blockSize - offset)) {
|
||||||
manual_copy_size = remSize;
|
manual_copy_size = remSize;
|
||||||
else
|
} else {
|
||||||
manual_copy_size =
|
manual_copy_size =
|
||||||
p_sdhandle->device->cfg.blockSize - offset;
|
p_sdhandle->device->cfg.blockSize - offset;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy((void *)((uintptr_t)
|
memcpy((void *)((uintptr_t)
|
||||||
(emmc_global_buf_ptr->u.tempbuf + offset)),
|
(emmc_global_buf_ptr->u.tempbuf + offset)),
|
||||||
|
@ -530,11 +539,12 @@ static uint32_t sdio_write(struct sd_handle *p_sdhandle, uintptr_t mem_addr,
|
||||||
inputBuf += manual_copy_size;
|
inputBuf += manual_copy_size;
|
||||||
|
|
||||||
if (p_sdhandle->device->ctrl.ocr &
|
if (p_sdhandle->device->ctrl.ocr &
|
||||||
SD_CARD_HIGH_CAPACITY)
|
SD_CARD_HIGH_CAPACITY) {
|
||||||
blockAddr++;
|
blockAddr++;
|
||||||
else
|
} else {
|
||||||
blockAddr +=
|
blockAddr +=
|
||||||
p_sdhandle->device->cfg.blockSize;
|
p_sdhandle->device->cfg.blockSize;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -136,7 +136,8 @@ static int imx_usdhc_send_cmd(struct mmc_cmd *cmd)
|
||||||
break;
|
break;
|
||||||
case MMC_CMD(18):
|
case MMC_CMD(18):
|
||||||
multiple = 1;
|
multiple = 1;
|
||||||
/* fall thru for read op */
|
/* for read op */
|
||||||
|
/* fallthrough */
|
||||||
case MMC_CMD(17):
|
case MMC_CMD(17):
|
||||||
case MMC_CMD(8):
|
case MMC_CMD(8):
|
||||||
mixctl |= MIXCTRL_DTDSEL;
|
mixctl |= MIXCTRL_DTDSEL;
|
||||||
|
@ -144,7 +145,8 @@ static int imx_usdhc_send_cmd(struct mmc_cmd *cmd)
|
||||||
break;
|
break;
|
||||||
case MMC_CMD(25):
|
case MMC_CMD(25):
|
||||||
multiple = 1;
|
multiple = 1;
|
||||||
/* fall thru for data op flag */
|
/* for data op flag */
|
||||||
|
/* fallthrough */
|
||||||
case MMC_CMD(24):
|
case MMC_CMD(24):
|
||||||
data = 1;
|
data = 1;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -269,7 +269,7 @@ static int cal_odt(const unsigned int clk,
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
const struct dynamic_odt *pdodt = NULL;
|
const struct dynamic_odt *pdodt = NULL;
|
||||||
|
|
||||||
const static struct dynamic_odt *table[2][5] = {
|
static const struct dynamic_odt *table[2][5] = {
|
||||||
{single_S, single_D, NULL, NULL},
|
{single_S, single_D, NULL, NULL},
|
||||||
{dual_SS, dual_DD, NULL, NULL},
|
{dual_SS, dual_DD, NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,7 +13,7 @@ struct phy_msg {
|
||||||
const char *msg;
|
const char *msg;
|
||||||
};
|
};
|
||||||
|
|
||||||
const static struct phy_msg messages_1d[] = {
|
static const struct phy_msg messages_1d[] = {
|
||||||
{0x00000001,
|
{0x00000001,
|
||||||
"PMU1:prbsGenCtl:%x\n"
|
"PMU1:prbsGenCtl:%x\n"
|
||||||
},
|
},
|
||||||
|
@ -1239,7 +1239,7 @@ const static struct phy_msg messages_1d[] = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const static struct phy_msg messages_2d[] = {
|
static const struct phy_msg messages_2d[] = {
|
||||||
{0x00000001,
|
{0x00000001,
|
||||||
"PMU0: Converting %d into an MR\n"
|
"PMU0: Converting %d into an MR\n"
|
||||||
},
|
},
|
||||||
|
|
|
@ -254,8 +254,7 @@ EMMC_ERROR_CODE emmc_exec_cmd(uint32_t error_mask, uint32_t *response)
|
||||||
(SD_INFO2_ALL_ERR | SD_INFO2_CLEAR));
|
(SD_INFO2_ALL_ERR | SD_INFO2_CLEAR));
|
||||||
|
|
||||||
state = ESTATE_ISSUE_CMD;
|
state = ESTATE_ISSUE_CMD;
|
||||||
/* through */
|
/* fallthrough */
|
||||||
|
|
||||||
case ESTATE_ISSUE_CMD:
|
case ESTATE_ISSUE_CMD:
|
||||||
/* ARG */
|
/* ARG */
|
||||||
SETR_32(SD_ARG, mmc_drv_obj.cmd_info.arg);
|
SETR_32(SD_ARG, mmc_drv_obj.cmd_info.arg);
|
||||||
|
@ -454,8 +453,8 @@ EMMC_ERROR_CODE emmc_exec_cmd(uint32_t error_mask, uint32_t *response)
|
||||||
SETR_32(SD_STOP, 0x00000000U);
|
SETR_32(SD_STOP, 0x00000000U);
|
||||||
mmc_drv_obj.during_dma_transfer = FALSE;
|
mmc_drv_obj.during_dma_transfer = FALSE;
|
||||||
}
|
}
|
||||||
/* through */
|
|
||||||
|
|
||||||
|
/* fallthrough */
|
||||||
case ESTATE_ERROR:
|
case ESTATE_ERROR:
|
||||||
if (err_not_care_flag == TRUE) {
|
if (err_not_care_flag == TRUE) {
|
||||||
mmc_drv_obj.during_cmd_processing = FALSE;
|
mmc_drv_obj.during_cmd_processing = FALSE;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "rcar_def.h"
|
#include "rcar_def.h"
|
||||||
#include "rom_api.h"
|
#include "rom_api.h"
|
||||||
|
|
||||||
typedef uint32_t(*rom_secure_boot_api_f) (uint32_t *key, uint32_t *cert,
|
typedef uint32_t(*rom_secure_boot_api_f) (uint32_t key, uint32_t cert,
|
||||||
rom_read_flash_f pFuncReadFlash);
|
rom_read_flash_f pFuncReadFlash);
|
||||||
|
|
||||||
typedef uint32_t(*rom_get_lcs_api_f) (uint32_t *lcs);
|
typedef uint32_t(*rom_get_lcs_api_f) (uint32_t *lcs);
|
||||||
|
@ -68,7 +68,7 @@ static uint32_t get_table_index(void)
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t rcar_rom_secure_boot_api(uint32_t *key, uint32_t *cert,
|
uint32_t rcar_rom_secure_boot_api(uint32_t key, uint32_t cert,
|
||||||
rom_read_flash_f read_flash)
|
rom_read_flash_f read_flash)
|
||||||
{
|
{
|
||||||
static const uintptr_t rom_api_table[API_TABLE_MAX] = {
|
static const uintptr_t rom_api_table[API_TABLE_MAX] = {
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define LCS_FA (0x7U)
|
#define LCS_FA (0x7U)
|
||||||
|
|
||||||
typedef uint32_t(*rom_read_flash_f) (uint64_t src, uint8_t *dst, uint32_t len);
|
typedef uint32_t(*rom_read_flash_f) (uint64_t src, uint8_t *dst, uint32_t len);
|
||||||
uint32_t rcar_rom_secure_boot_api(uint32_t *key, uint32_t *cert,
|
uint32_t rcar_rom_secure_boot_api(uint32_t key, uint32_t cert,
|
||||||
rom_read_flash_f f);
|
rom_read_flash_f f);
|
||||||
uint32_t rcar_rom_get_lcs(uint32_t *lcs);
|
uint32_t rcar_rom_get_lcs(uint32_t *lcs);
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <arch_helpers.h>
|
#include <arch_helpers.h>
|
||||||
|
@ -794,7 +795,7 @@ static enum usb_action usb_dwc2_it_handler(void *handle, uint32_t *param)
|
||||||
uint32_t epint;
|
uint32_t epint;
|
||||||
uint32_t epnum;
|
uint32_t epnum;
|
||||||
uint32_t temp;
|
uint32_t temp;
|
||||||
enum usb_status ret;
|
enum usb_status __unused ret;
|
||||||
|
|
||||||
if (usb_dwc2_get_mode(handle) != USB_OTG_MODE_DEVICE) {
|
if (usb_dwc2_get_mode(handle) != USB_OTG_MODE_DEVICE) {
|
||||||
return USB_NOTHING;
|
return USB_NOTHING;
|
||||||
|
@ -947,9 +948,7 @@ static enum usb_action usb_dwc2_it_handler(void *handle, uint32_t *param)
|
||||||
|
|
||||||
/* Setup EP0 to receive SETUP packets */
|
/* Setup EP0 to receive SETUP packets */
|
||||||
ret = usb_dwc2_ep0_out_start(handle);
|
ret = usb_dwc2_ep0_out_start(handle);
|
||||||
if (ret != USBD_OK) {
|
assert(ret == USBD_OK);
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
mmio_write_32(usb_base_addr + OTG_GINTSTS, OTG_GINTSTS_USBRST);
|
mmio_write_32(usb_base_addr + OTG_GINTSTS, OTG_GINTSTS_USBRST);
|
||||||
|
|
||||||
|
@ -959,9 +958,7 @@ static enum usb_action usb_dwc2_it_handler(void *handle, uint32_t *param)
|
||||||
/* Handle enumeration done interrupt */
|
/* Handle enumeration done interrupt */
|
||||||
if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_ENUMDNE) != 0U) {
|
if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_ENUMDNE) != 0U) {
|
||||||
ret = usb_dwc2_activate_setup(handle);
|
ret = usb_dwc2_activate_setup(handle);
|
||||||
if (ret != USBD_OK) {
|
assert(ret == USBD_OK);
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
mmio_clrbits_32(usb_base_addr + OTG_GUSBCFG, OTG_GUSBCFG_TRDT);
|
mmio_clrbits_32(usb_base_addr + OTG_GUSBCFG, OTG_GUSBCFG_TRDT);
|
||||||
|
|
||||||
|
|
|
@ -209,6 +209,7 @@ loop:
|
||||||
break;
|
break;
|
||||||
case 'X':
|
case 'X':
|
||||||
capitalise = true;
|
capitalise = true;
|
||||||
|
/* fallthrough */
|
||||||
case 'x':
|
case 'x':
|
||||||
unum = get_unum_va_args(args, l_count);
|
unum = get_unum_va_args(args, l_count);
|
||||||
unsigned_num_print(&s, n, &chars_printed,
|
unsigned_num_print(&s, n, &chars_printed,
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#if defined(PLAT_imx8qm) || defined(PLAT_imx8qx)
|
#if defined(PLAT_imx8qm) || defined(PLAT_imx8qx)
|
||||||
|
|
||||||
#ifdef PLAT_imx8qm
|
#ifdef PLAT_imx8qm
|
||||||
const static int ap_cluster_index[PLATFORM_CLUSTER_COUNT] = {
|
static const int ap_cluster_index[PLATFORM_CLUSTER_COUNT] = {
|
||||||
SC_R_A53, SC_R_A72,
|
SC_R_A53, SC_R_A72,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -62,7 +62,7 @@ static entry_point_info_t bl33_image_ep_info;
|
||||||
#error "Provide proper UART number in IMX_DEBUG_UART"
|
#error "Provide proper UART number in IMX_DEBUG_UART"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const static int imx8qm_cci_map[] = {
|
static const int imx8qm_cci_map[] = {
|
||||||
CLUSTER0_CCI_SLVAE_IFACE,
|
CLUSTER0_CCI_SLVAE_IFACE,
|
||||||
CLUSTER1_CCI_SLVAE_IFACE
|
CLUSTER1_CCI_SLVAE_IFACE
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define SYSTEM_PWR_STATE(state) \
|
#define SYSTEM_PWR_STATE(state) \
|
||||||
((state)->pwr_domain_state[PLAT_MAX_PWR_LVL])
|
((state)->pwr_domain_state[PLAT_MAX_PWR_LVL])
|
||||||
|
|
||||||
const static int ap_core_index[PLATFORM_CORE_COUNT] = {
|
static const int ap_core_index[PLATFORM_CORE_COUNT] = {
|
||||||
SC_R_A53_0, SC_R_A53_1, SC_R_A53_2,
|
SC_R_A53_0, SC_R_A53_1, SC_R_A53_2,
|
||||||
SC_R_A53_3, SC_R_A72_0, SC_R_A72_1,
|
SC_R_A53_3, SC_R_A72_0, SC_R_A72_1,
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#include "../../common/sci/imx8_mu.h"
|
#include "../../common/sci/imx8_mu.h"
|
||||||
|
|
||||||
const static int ap_core_index[PLATFORM_CORE_COUNT] = {
|
static const int ap_core_index[PLATFORM_CORE_COUNT] = {
|
||||||
SC_R_A35_0, SC_R_A35_1, SC_R_A35_2, SC_R_A35_3
|
SC_R_A35_0, SC_R_A35_1, SC_R_A35_2, SC_R_A35_3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
x3 = x3 & MASK_32_BIT; \
|
x3 = x3 & MASK_32_BIT; \
|
||||||
x4 = x4 & MASK_32_BIT; \
|
x4 = x4 & MASK_32_BIT; \
|
||||||
} \
|
} \
|
||||||
|
/* fallthrough */ \
|
||||||
case _smc_id##_AARCH64: \
|
case _smc_id##_AARCH64: \
|
||||||
{ \
|
{ \
|
||||||
if (_smc_id##_descriptor_index < 0) { \
|
if (_smc_id##_descriptor_index < 0) { \
|
||||||
|
|
|
@ -20,7 +20,7 @@ extern uint64_t tegra_bl31_phys_base;
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Array to hold stream_id override config register offsets
|
* Array to hold stream_id override config register offsets
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
const static uint32_t tegra186_streamid_override_regs[] = {
|
static const uint32_t tegra186_streamid_override_regs[] = {
|
||||||
MC_STREAMID_OVERRIDE_CFG_SDMMCRA,
|
MC_STREAMID_OVERRIDE_CFG_SDMMCRA,
|
||||||
MC_STREAMID_OVERRIDE_CFG_SDMMCRAA,
|
MC_STREAMID_OVERRIDE_CFG_SDMMCRAA,
|
||||||
MC_STREAMID_OVERRIDE_CFG_SDMMCR,
|
MC_STREAMID_OVERRIDE_CFG_SDMMCR,
|
||||||
|
@ -34,7 +34,7 @@ const static uint32_t tegra186_streamid_override_regs[] = {
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Array to hold the security configs for stream IDs
|
* Array to hold the security configs for stream IDs
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
const static mc_streamid_security_cfg_t tegra186_streamid_sec_cfgs[] = {
|
static const mc_streamid_security_cfg_t tegra186_streamid_sec_cfgs[] = {
|
||||||
mc_make_sec_cfg(SCEW, NON_SECURE, NO_OVERRIDE, DISABLE),
|
mc_make_sec_cfg(SCEW, NON_SECURE, NO_OVERRIDE, DISABLE),
|
||||||
mc_make_sec_cfg(AFIR, NON_SECURE, OVERRIDE, DISABLE),
|
mc_make_sec_cfg(AFIR, NON_SECURE, OVERRIDE, DISABLE),
|
||||||
mc_make_sec_cfg(AFIW, NON_SECURE, OVERRIDE, DISABLE),
|
mc_make_sec_cfg(AFIW, NON_SECURE, OVERRIDE, DISABLE),
|
||||||
|
@ -112,7 +112,7 @@ const static mc_streamid_security_cfg_t tegra186_streamid_sec_cfgs[] = {
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Array to hold the transaction override configs
|
* Array to hold the transaction override configs
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
const static mc_txn_override_cfg_t tegra186_txn_override_cfgs[] = {
|
static const mc_txn_override_cfg_t tegra186_txn_override_cfgs[] = {
|
||||||
mc_make_txn_override_cfg(BPMPW, CGID_TAG_ADR),
|
mc_make_txn_override_cfg(BPMPW, CGID_TAG_ADR),
|
||||||
mc_make_txn_override_cfg(EQOSW, CGID_TAG_ADR),
|
mc_make_txn_override_cfg(EQOSW, CGID_TAG_ADR),
|
||||||
mc_make_txn_override_cfg(NVJPGSWR, CGID_TAG_ADR),
|
mc_make_txn_override_cfg(NVJPGSWR, CGID_TAG_ADR),
|
||||||
|
|
|
@ -350,7 +350,7 @@ static int _pwr_state_validate(uint32_t pwr_state,
|
||||||
else if (SOC_SYSTEM_STANDBY)
|
else if (SOC_SYSTEM_STANDBY)
|
||||||
state->pwr_domain_state[PLAT_MAX_LVL] =
|
state->pwr_domain_state[PLAT_MAX_LVL] =
|
||||||
PLAT_MAX_RET_STATE;
|
PLAT_MAX_RET_STATE;
|
||||||
/* intentional fall-thru condition */
|
/* fallthrough */
|
||||||
case PWR_STATE_LVL_SYS:
|
case PWR_STATE_LVL_SYS:
|
||||||
if (pwrdn && SOC_SYSTEM_PWR_DWN)
|
if (pwrdn && SOC_SYSTEM_PWR_DWN)
|
||||||
state->pwr_domain_state[PLAT_SYS_LVL] =
|
state->pwr_domain_state[PLAT_SYS_LVL] =
|
||||||
|
@ -358,7 +358,7 @@ static int _pwr_state_validate(uint32_t pwr_state,
|
||||||
else if (SOC_SYSTEM_STANDBY)
|
else if (SOC_SYSTEM_STANDBY)
|
||||||
state->pwr_domain_state[PLAT_SYS_LVL] =
|
state->pwr_domain_state[PLAT_SYS_LVL] =
|
||||||
PLAT_MAX_RET_STATE;
|
PLAT_MAX_RET_STATE;
|
||||||
/* intentional fall-thru condition */
|
/* fallthrough */
|
||||||
case PWR_STATE_LVL_CLSTR:
|
case PWR_STATE_LVL_CLSTR:
|
||||||
if (pwrdn && SOC_CLUSTER_PWR_DWN)
|
if (pwrdn && SOC_CLUSTER_PWR_DWN)
|
||||||
state->pwr_domain_state[PLAT_CLSTR_LVL] =
|
state->pwr_domain_state[PLAT_CLSTR_LVL] =
|
||||||
|
@ -366,7 +366,7 @@ static int _pwr_state_validate(uint32_t pwr_state,
|
||||||
else if (SOC_CLUSTER_STANDBY)
|
else if (SOC_CLUSTER_STANDBY)
|
||||||
state->pwr_domain_state[PLAT_CLSTR_LVL] =
|
state->pwr_domain_state[PLAT_CLSTR_LVL] =
|
||||||
PLAT_MAX_RET_STATE;
|
PLAT_MAX_RET_STATE;
|
||||||
/* intentional fall-thru condition */
|
/* fallthrough */
|
||||||
case PWR_STATE_LVL_CORE:
|
case PWR_STATE_LVL_CORE:
|
||||||
stat = PSCI_E_SUCCESS;
|
stat = PSCI_E_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#define IPI_BIT_MASK(I) (ipi_table[(I)].ipi_bit_mask)
|
#define IPI_BIT_MASK(I) (ipi_table[(I)].ipi_bit_mask)
|
||||||
|
|
||||||
/* IPI configuration table */
|
/* IPI configuration table */
|
||||||
const static struct ipi_config *ipi_table;
|
static const struct ipi_config *ipi_table;
|
||||||
|
|
||||||
/* Total number of IPI */
|
/* Total number of IPI */
|
||||||
static uint32_t ipi_total;
|
static uint32_t ipi_total;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <lib/mmio.h>
|
#include <lib/mmio.h>
|
||||||
|
|
||||||
/* versal ipi configuration table */
|
/* versal ipi configuration table */
|
||||||
const static struct ipi_config versal_ipi_table[] = {
|
static const struct ipi_config versal_ipi_table[] = {
|
||||||
/* A72 IPI */
|
/* A72 IPI */
|
||||||
[IPI_ID_APU] = {
|
[IPI_ID_APU] = {
|
||||||
.ipi_bit_mask = IPI0_TRIG_BIT,
|
.ipi_bit_mask = IPI0_TRIG_BIT,
|
||||||
|
|
|
@ -334,22 +334,18 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
|
||||||
SMC_RET1(handle, (uint64_t)ret);
|
SMC_RET1(handle, (uint64_t)ret);
|
||||||
|
|
||||||
case PM_GET_API_VERSION:
|
case PM_GET_API_VERSION:
|
||||||
/* Check is PM API version already verified */
|
if (ipi_irq_flag == 0U) {
|
||||||
if (pm_ctx.api_version >= PM_VERSION) {
|
/*
|
||||||
if (ipi_irq_flag == 0U) {
|
* Enable IPI IRQ
|
||||||
/*
|
* assume the rich OS is OK to handle callback IRQs now.
|
||||||
* Enable IPI IRQ
|
* Even if we were wrong, it would not enable the IRQ in
|
||||||
* assume the rich OS is OK to handle callback IRQs now.
|
* the GIC.
|
||||||
* Even if we were wrong, it would not enable the IRQ in
|
*/
|
||||||
* the GIC.
|
pm_ipi_irq_enable(primary_proc);
|
||||||
*/
|
ipi_irq_flag = 1U;
|
||||||
pm_ipi_irq_enable(primary_proc);
|
|
||||||
ipi_irq_flag = 1U;
|
|
||||||
}
|
|
||||||
SMC_RET1(handle, (uint64_t)PM_RET_SUCCESS |
|
|
||||||
((uint64_t)pm_ctx.api_version << 32));
|
|
||||||
}
|
}
|
||||||
|
SMC_RET1(handle, (uint64_t)PM_RET_SUCCESS |
|
||||||
|
((uint64_t)pm_ctx.api_version << 32));
|
||||||
case PM_FPGA_LOAD:
|
case PM_FPGA_LOAD:
|
||||||
ret = pm_fpga_load(pm_arg[0], pm_arg[1], pm_arg[2], pm_arg[3]);
|
ret = pm_fpga_load(pm_arg[0], pm_arg[1], pm_arg[2], pm_arg[3]);
|
||||||
SMC_RET1(handle, (uint64_t)ret);
|
SMC_RET1(handle, (uint64_t)ret);
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <plat_private.h>
|
#include <plat_private.h>
|
||||||
|
|
||||||
/* Zynqmp ipi configuration table */
|
/* Zynqmp ipi configuration table */
|
||||||
const static struct ipi_config zynqmp_ipi_table[] = {
|
static const struct ipi_config zynqmp_ipi_table[] = {
|
||||||
/* APU IPI */
|
/* APU IPI */
|
||||||
{
|
{
|
||||||
.ipi_bit_mask = 0x1,
|
.ipi_bit_mask = 0x1,
|
||||||
|
|
|
@ -868,7 +868,8 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
|
||||||
FFA_ERROR_NOT_SUPPORTED);
|
FFA_ERROR_NOT_SUPPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fall through to forward the call to the other world */
|
/* Forward the call to the other world */
|
||||||
|
/* fallthrough */
|
||||||
case FFA_MSG_SEND:
|
case FFA_MSG_SEND:
|
||||||
case FFA_MSG_SEND_DIRECT_RESP_SMC64:
|
case FFA_MSG_SEND_DIRECT_RESP_SMC64:
|
||||||
case FFA_MEM_DONATE_SMC32:
|
case FFA_MEM_DONATE_SMC32:
|
||||||
|
@ -908,7 +909,8 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
|
||||||
spmd_spm_core_sync_exit(0ULL);
|
spmd_spm_core_sync_exit(0ULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fall through to forward the call to the other world */
|
/* Forward the call to the other world */
|
||||||
|
/* fallthrough */
|
||||||
case FFA_INTERRUPT:
|
case FFA_INTERRUPT:
|
||||||
case FFA_MSG_YIELD:
|
case FFA_MSG_YIELD:
|
||||||
/* This interface must be invoked only by the Secure world */
|
/* This interface must be invoked only by the Secure world */
|
||||||
|
|
Loading…
Add table
Reference in a new issue