From 91cb53bf459cb247d070bd3e655b99a3a8ea44c9 Mon Sep 17 00:00:00 2001 From: Greg V Date: Wed, 26 Jun 2019 14:03:27 +0300 Subject: [PATCH 1/4] Add missing ifdefs for weak pragmas Clang doesn't like #pragma weak for undefined symbols --- plat/common/plat_bl_common.c | 2 ++ plat/marvell/common/marvell_bl2_setup.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plat/common/plat_bl_common.c b/plat/common/plat_bl_common.c index b471a7e7b5..b4895310e3 100644 --- a/plat/common/plat_bl_common.c +++ b/plat/common/plat_bl_common.c @@ -18,8 +18,10 @@ #pragma weak bl2_el3_plat_prepare_exit #pragma weak plat_error_handler #pragma weak bl2_plat_preload_setup +#if LOAD_IMAGE_V2 #pragma weak bl2_plat_handle_pre_image_load #pragma weak bl2_plat_handle_post_image_load +#endif #pragma weak plat_try_next_boot_source void bl2_el3_plat_prepare_exit(void) diff --git a/plat/marvell/common/marvell_bl2_setup.c b/plat/marvell/common/marvell_bl2_setup.c index 7c87ce3384..aa9eaba221 100644 --- a/plat/marvell/common/marvell_bl2_setup.c +++ b/plat/marvell/common/marvell_bl2_setup.c @@ -47,7 +47,9 @@ static bl2_to_bl31_params_mem_t bl31_params_mem; #pragma weak bl2_plat_flush_bl31_params #pragma weak bl2_plat_set_bl31_ep_info #pragma weak bl2_plat_get_scp_bl2_meminfo +#ifdef BL32_BASE #pragma weak bl2_plat_get_bl32_meminfo +#endif #pragma weak bl2_plat_set_bl32_ep_info #pragma weak bl2_plat_get_bl33_meminfo #pragma weak bl2_plat_set_bl33_ep_info From 184f117ee428b49f5aac1a0db364bbadc22672f1 Mon Sep 17 00:00:00 2001 From: Greg V Date: Wed, 26 Jun 2019 14:04:32 +0300 Subject: [PATCH 2/4] Ignore bogus clang diagnostic failures Missing braces is a known clang bug https://bugs.llvm.org/show_bug.cgi?id=21629 --- drivers/marvell/comphy/phy-comphy-cp110.c | 3 +++ plat/marvell/a8k/common/plat_pm.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/marvell/comphy/phy-comphy-cp110.c b/drivers/marvell/comphy/phy-comphy-cp110.c index 8aa9829c07..0035befc7f 100644 --- a/drivers/marvell/comphy/phy-comphy-cp110.c +++ b/drivers/marvell/comphy/phy-comphy-cp110.c @@ -80,7 +80,10 @@ enum pcie_link_width { PCIE_LNK_WIDTH_UNKNOWN = 0xFF, }; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-braces" _Bool rx_trainng_done[AP_NUM][CP_NUM][MAX_LANE_NR] = {0}; +#pragma clang diagnostic pop static void mvebu_cp110_get_ap_and_cp_nr(uint8_t *ap_nr, uint8_t *cp_nr, uint64_t comphy_base) { diff --git a/plat/marvell/a8k/common/plat_pm.c b/plat/marvell/a8k/common/plat_pm.c index e57c54a95d..dfb9780eeb 100644 --- a/plat/marvell/a8k/common/plat_pm.c +++ b/plat/marvell/a8k/common/plat_pm.c @@ -761,6 +761,8 @@ __dead2 a8k_pwr_domain_pwr_down_wfi(const psci_power_state_t *target_state) * At this stage any access to DRAM (procedure call) will * release it from the self-refresh mode */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wasm-operand-widths" __asm__ volatile ( /* Align to a cache line */ " .balign 64\n\t" @@ -784,6 +786,7 @@ __dead2 a8k_pwr_domain_pwr_down_wfi(const psci_power_state_t *target_state) : : [srcmd] "r" (srcmd), [sdram_reg] "r" (sdram_reg), [gpio_addr] "r" (gpio_addr), [gpio_data] "r" (gpio_data) : "x1"); +#pragma clang diagnostic pop panic(); } From 3a1c2b6e37c14e67c5762b8e19252166b1330565 Mon Sep 17 00:00:00 2001 From: Greg V Date: Wed, 26 Jun 2019 14:04:50 +0300 Subject: [PATCH 3/4] More clang diagnostic fixes --- drivers/marvell/i2c/a8k_i2c.c | 2 +- lib/locks/bakery/bakery_lock_normal.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/marvell/i2c/a8k_i2c.c b/drivers/marvell/i2c/a8k_i2c.c index 72a773162c..dfab663fd0 100644 --- a/drivers/marvell/i2c/a8k_i2c.c +++ b/drivers/marvell/i2c/a8k_i2c.c @@ -95,7 +95,7 @@ static int marvell_i2c_interrupt_get(void) /* get the interrupt flag bit */ reg = mmio_read_32((uintptr_t)&base->control); reg &= I2C_CONTROL_IFLG; - return reg && I2C_CONTROL_IFLG; + return reg & I2C_CONTROL_IFLG; } static int marvell_i2c_wait_interrupt(void) diff --git a/lib/locks/bakery/bakery_lock_normal.c b/lib/locks/bakery/bakery_lock_normal.c index 37697f521a..379e168e7e 100644 --- a/lib/locks/bakery/bakery_lock_normal.c +++ b/lib/locks/bakery/bakery_lock_normal.c @@ -67,6 +67,7 @@ IMPORT_SYM(uintptr_t, __PERCPU_BAKERY_LOCK_SIZE__, PERCPU_BAKERY_LOCK_SIZE); dccivac((uintptr_t)addr) /* Helper function to check if the lock is acquired */ +__attribute__((unused)) static inline int is_lock_acquired(const bakery_info_t *my_bakery_info, int is_cached) { From 1aa61c9b18c81076d1633f8fbd41d332701bb721 Mon Sep 17 00:00:00 2001 From: Greg V Date: Wed, 26 Jun 2019 14:05:35 +0300 Subject: [PATCH 4/4] Use $(MAKE) instead of 'make' for nested calls On FreeBSD, GNU make is 'gmake'. Using $(MAKE) ensures calling the same make the current file is called with. --- ble/ble.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ble/ble.mk b/ble/ble.mk index 931690570a..94f73d3aee 100644 --- a/ble/ble.mk +++ b/ble/ble.mk @@ -27,4 +27,4 @@ BLE_LINKERFILE := $(BLE_PATH)/ble.ld.S FORCE: $(MV_DDR_LIB): FORCE - @+make -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(PLAT_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(CURDIR)/$(BUILD_PLAT)/ble + @+$(MAKE) -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(PLAT_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(CURDIR)/$(BUILD_PLAT)/ble