arm-trusted-firmware/drivers
Jimmy Brisson d7b5f40823 Increase type widths to satisfy width requirements
Usually, C has no problem up-converting types to larger bit sizes. MISRA
rule 10.7 requires that you not do this, or be very explicit about this.
This resolves the following required rule:

    bl1/aarch64/bl1_context_mgmt.c:81:[MISRA C-2012 Rule 10.7 (required)]<None>
    The width of the composite expression "0U | ((mode & 3U) << 2U) | 1U |
    0x3c0U" (32 bits) is less that the right hand operand
    "18446744073709547519ULL" (64 bits).

This also resolves MISRA defects such as:

    bl2/aarch64/bl2arch_setup.c:18:[MISRA C-2012 Rule 12.2 (required)]
    In the expression "3U << 20", shifting more than 7 bits, the number
    of bits in the essential type of the left expression, "3U", is
    not allowed.

Further, MISRA requires that all shifts don't overflow. The definition of
PAGE_SIZE was (1U << 12), and 1U is 8 bits. This caused about 50 issues.
This fixes the violation by changing the definition to 1UL << 12. Since
this uses 32bits, it should not create any issues for aarch32.

This patch also contains a fix for a build failure in the sun50i_a64
platform. Specifically, these misra fixes removed a single and
instruction,

    92407e73        and     x19, x19, #0xffffffff

from the cm_setup_context function caused a relocation in
psci_cpus_on_start to require a linker-generated stub. This increased the
size of the .text section and caused an alignment later on to go over a
page boundary and round up to the end of RAM before placing the .data
section. This sectionn is of non-zero size and therefore causes a link
error.

The fix included in this reorders the functions during link time
without changing their ording with respect to alignment.

Change-Id: I76b4b662c3d262296728a8b9aab7a33b02087f16
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2020-10-12 10:55:03 -05:00
..
allwinner plat/allwinner: Only enable DRIVEVBUS if really needed 2020-08-17 11:13:59 +01:00
amlogic meson: Use generic console_t data structure 2020-02-25 09:34:38 +00:00
arm Increase type widths to satisfy width requirements 2020-10-12 10:55:03 -05:00
auth Crypto library: Migrate support to MbedTLS v2.24.0 2020-10-01 11:12:18 +00:00
brcm driver: brcm: add RNG driver 2020-07-13 18:01:19 +05:30
cadence/uart/aarch64 cdns: Use generic console_t data structure 2020-02-25 09:34:38 +00:00
cfi/v2m coverity: fix MISRA violations 2020-02-18 10:47:46 -06:00
console skeletton: Use generic console_t data structure 2020-02-25 09:34:38 +00:00
coreboot/cbmem_console/aarch64 coreboot: Use generic base address 2020-02-25 09:34:38 +00:00
delay_timer include: move MHZ_TICKS_PER_SEC to utils_def.h 2020-02-20 09:25:45 -08:00
gpio Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
imx imx: Use generic console_t data structure 2020-02-25 09:34:38 +00:00
intel/soc/stratix10/io io: change seek offset to signed long long 2020-01-10 21:14:57 +01:00
io Merge "io_fip: return -ENFILE when a file is already open" into integration 2020-07-21 21:41:51 +00:00
marvell marvell: comphy: cp110: add support for USB comphy polarity invert 2020-10-04 15:56:01 +02:00
measured_boot Merge "Measured Boot Driver: Fix MISRA-C 2012 defects" into integration 2020-10-01 18:18:32 +00:00
mentor/i2c Enable -Wlogical-op always 2019-11-19 08:53:21 -06:00
mmc mmc: increase delay between ACMD41 retries 2019-10-03 11:17:31 +02:00
mtd nand: raw_nand: fix timeout issue in nand_wait_ready 2020-09-24 09:32:23 +02:00
partition drivers: partition: support different block size 2019-09-18 18:18:20 +08:00
renesas/rcar rcar: Use generic console_t data structure 2020-02-25 09:34:38 +00:00
rpi3 rpi3: gpio: Simplify GPIO setup 2020-03-17 12:44:09 +00:00
st drivers: stm32_fmc2_nand: fix incorrect error detection 2020-10-08 09:42:04 +02:00
synopsys Merge changes from topic "jc/shift-overflow" into integration 2019-07-16 10:11:27 +00:00
ti/uart 16550: Use generic console_t data structure 2020-02-25 09:34:38 +00:00
ufs drivers: ufs: Extend the delay after reset to wait for some slower chips 2019-05-13 17:11:07 -07:00