aboutsummaryrefslogtreecommitdiff
path: root/plat/layerscape/board
diff options
context:
space:
mode:
authorJustin Chadwell <justin.chadwell@arm.com>2019-07-03 14:13:34 +0100
committerJustin Chadwell <justin.chadwell@arm.com>2019-07-11 12:10:58 +0100
commit9e4afb0272615a1c5f11d8371fd82c41a19499d5 (patch)
tree31032a1867c39ebfcee7969a4d2b29cac6f42465 /plat/layerscape/board
parent36cfbf3ca28be833116a1ac7c7c1b98da50db95a (diff)
downloadtrusted-firmware-a-9e4afb0272615a1c5f11d8371fd82c41a19499d5.tar.gz
Update layerscape platform to not rely on undefined overflow behaviour
This consists of ensuring that the left operand of each shift is unsigned when the operation might overflow into the sign bit. Change-Id: Ib63ef6e2e4616dd56828bfd3800d5fe2df109934 Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
Diffstat (limited to 'plat/layerscape/board')
-rw-r--r--plat/layerscape/board/ls1043/ls1043_psci.c4
-rw-r--r--plat/layerscape/board/ls1043/ls_gic.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/plat/layerscape/board/ls1043/ls1043_psci.c b/plat/layerscape/board/ls1043/ls1043_psci.c
index d6429c3261..8e282cbad8 100644
--- a/plat/layerscape/board/ls1043/ls1043_psci.c
+++ b/plat/layerscape/board/ls1043/ls1043_psci.c
@@ -66,12 +66,12 @@ static void ls1043_reset_core(int core_pos)
dsb();
/* enable core soft reset */
mmio_write_32(LS_SCFG_BASE + LS_SCFG_CORESRENCR_OFFSET,
- htobe32(1 << 31));
+ htobe32(1U << 31));
dsb();
isb();
/* reset core */
mmio_write_32(LS_SCFG_BASE + LS_SCFG_CORE0_SFT_RST_OFFSET +
- core_pos * 4, htobe32(1 << 31));
+ core_pos * 4, htobe32(1U << 31));
mdelay(10);
}
diff --git a/plat/layerscape/board/ls1043/ls_gic.c b/plat/layerscape/board/ls1043/ls_gic.c
index 3d8b262d29..cba55caffd 100644
--- a/plat/layerscape/board/ls1043/ls_gic.c
+++ b/plat/layerscape/board/ls1043/ls_gic.c
@@ -35,7 +35,7 @@ void get_gic_offset(uint32_t *gicc_base, uint32_t *gicd_base)
soc_dev_id == (SVR_LS1043AE << 8)) &&
((val & 0xff) == REV1_1)) {
val = be32toh(mmio_read_32((uintptr_t)gic_align));
- if (val & (1 << GIC_ADDR_BIT)) {
+ if (val & (1U << GIC_ADDR_BIT)) {
*gicc_base = GICC_BASE;
*gicd_base = GICD_BASE;
} else {