Merge changes from topic "jc/shift-overflow" into integration
authorSoby Mathew <soby.mathew@arm.com>
Tue, 16 Jul 2019 10:11:27 +0000 (10:11 +0000)
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>
Tue, 16 Jul 2019 10:11:27 +0000 (10:11 +0000)
* changes:
  Enable -Wshift-overflow=2 to check for undefined shift behavior
  Update base code to not rely on undefined overflow behaviour
  Update hisilicon drivers to not rely on undefined overflow behaviour
  Update synopsys drivers to not rely on undefined overflow behaviour
  Update imx platform to not rely on undefined overflow behaviour
  Update mediatek platform to not rely on undefined overflow behaviour
  Update layerscape platform to not rely on undefined overflow behaviour
  Update intel platform to not rely on undefined overflow behaviour
  Update rockchip platform to not rely on undefined overflow behaviour
  Update renesas platform to not rely on undefined overflow behaviour
  Update meson platform to not rely on undefined overflow behaviour
  Update marvell platform to not rely on undefined overflow behaviour

1  2 
Makefile
drivers/synopsys/emmc/dw_mmc.c

diff --combined Makefile
index c4ff53fc92e4b9bc6b0b0022d4f8c7a6b1938c43,c4730929315619c1eafe0bf3413d8a605cdbf460..aca57b697680e126d3a14606f203e599c4b83bde
+++ b/Makefile
@@@ -256,9 -256,14 +256,14 @@@ WARNINGS +=              -Wunused -Wno-unused-param
                                -Wvla
  
  ifeq ($(findstring clang,$(notdir $(CC))),)
+ # not using clang
  WARNINGS      +=              -Wunused-but-set-variable       \
                                -Wmaybe-uninitialized           \
-                               -Wpacked-bitfield-compat
+                               -Wpacked-bitfield-compat        \
+                               -Wshift-overflow=2
+ else
+ # using clang
+ WARNINGS      +=              -Wshift-overflow -Wshift-sign-overflow
  endif
  
  ifneq (${E},0)
@@@ -510,8 -515,9 +515,8 @@@ endi
  # Process platform overrideable behaviour
  ################################################################################
  
 -# Using the ARM Trusted Firmware BL2 implies that a BL33 image also needs to be
 -# supplied for the FIP and Certificate generation tools. This flag can be
 -# overridden by the platform.
 +# Using BL2 implies that a BL33 image also needs to be supplied for the FIP and
 +# Certificate generation tools. This flag can be overridden by the platform.
  ifdef BL2_SOURCES
          ifdef EL3_PAYLOAD_BASE
                  # If booting an EL3 payload there is no need for a BL33 image
index e84a9355a476f48d4b0464224d19e640eae53790,a063ad05a4c3b65222e914ab1831085a461ec553..04f467327bf91c5ee49bf988c472a6607456f7ab
@@@ -14,6 -14,7 +14,7 @@@
  #include <drivers/delay_timer.h>
  #include <drivers/mmc.h>
  #include <drivers/synopsys/dw_mmc.h>
+ #include <lib/utils_def.h>
  #include <lib/mmio.h>
  
  #define DWMMC_CTRL                    (0x00)
@@@ -55,7 -56,7 +56,7 @@@
  
  #define DWMMC_CMDARG                  (0x28)
  #define DWMMC_CMD                     (0x2c)
- #define CMD_START                     (1 << 31)
+ #define CMD_START                     (U(1) << 31)
  #define CMD_USE_HOLD_REG              (1 << 29)       /* 0 if SDR50/100 */
  #define CMD_UPDATE_CLK_ONLY           (1 << 21)
  #define CMD_SEND_INIT                 (1 << 15)
  #define IDMAC_DES0_CH                 (1 << 4)
  #define IDMAC_DES0_ER                 (1 << 5)
  #define IDMAC_DES0_CES                        (1 << 30)
- #define IDMAC_DES0_OWN                        (1 << 31)
+ #define IDMAC_DES0_OWN                        (U(1) << 31)
  #define IDMAC_DES1_BS1(x)             ((x) & 0x1fff)
  #define IDMAC_DES2_BS2(x)             (((x) & 0x1fff) << 13)
  
@@@ -425,6 -426,7 +426,6 @@@ void dw_mmc_init(dw_mmc_params_t *param
                (params->bus_width == MMC_BUS_WIDTH_8)));
  
        memcpy(&dw_params, params, sizeof(dw_mmc_params_t));
 -      mmio_write_32(dw_params.reg_base + DWMMC_FIFOTH, 0x103ff);
        dw_params.mmc_dev_type = info->mmc_dev_type;
        mmc_init(&dw_mmc_ops, params->clk_rate, params->bus_width,
                 params->flags, info);