From ccc5651c99fd3049e663cde4eb9609dd6342361d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 21 Apr 2025 13:52:29 -0500 Subject: [PATCH] altera-cyclone-v/contrib/.../hwmgr/*.c: Fix warnings Some of these were missing prototypes. Usually this could be addressed by adding static or conditionally compiling unused functions out. --- .../contrib/hwlib/src/hwmgr/alt_clock_manager.c | 11 +++++++++++ .../contrib/hwlib/src/hwmgr/alt_dma.c | 2 ++ .../contrib/hwlib/src/hwmgr/alt_i2c.c | 3 +++ .../contrib/hwlib/src/hwmgr/alt_qspi.c | 2 ++ 4 files changed, 18 insertions(+) diff --git a/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_clock_manager.c b/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_clock_manager.c index 5753c04763..436a733971 100644 --- a/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_clock_manager.c +++ b/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_clock_manager.c @@ -289,6 +289,9 @@ inline static void alt_clk_mgr_wait(void* reg, uint32_t cnt) // how many loops to wait for the SDRAM clock to come around // to zero and allow for writing a new divisor ratio to it +#ifdef __rtems__ +static +#endif /* __rtems__ */ ALT_STATUS_CODE alt_clk_plls_settle_wait(void) { int32_t i = ALT_BYPASS_TIMEOUT_CNT; @@ -805,6 +808,9 @@ ALT_STATUS_CODE alt_clk_pll_is_bypassed(ALT_CLK_t pll) /* alt_clk_pll_source_get() returns the current input of the specified PLL. */ /****************************************************************************************/ +#ifdef __rtems__ +static +#endif /* __rtems__ */ ALT_CLK_t alt_clk_pll_source_get(ALT_CLK_t pll) { ALT_CLK_t ret = ALT_CLK_UNKNOWN; @@ -5131,6 +5137,7 @@ ALT_STATUS_CODE alt_clk_group_cfg_raw_set(const ALT_CLK_GROUP_RAW_CFG_t * clk_gr // // alt_clk_id_to_string() converts a clock ID to a text string. // +#ifndef __rtems__ ALT_STATUS_CODE alt_clk_id_to_string(ALT_CLK_t clk_id, char * output, size_t size) { char * name = NULL; @@ -5398,11 +5405,15 @@ ALT_STATUS_CODE alt_clk_id_to_string(ALT_CLK_t clk_id, char * output, size_t siz return ALT_E_BAD_ARG; } } +#endif /* __rtems__ */ // // alt_clk_pll_cntr_maxfreq_recalc() recalculate the maxmum frequency of the specified clock. // +#ifdef __rtems__ +static +#endif /* __rtems__ */ ALT_STATUS_CODE alt_clk_pll_cntr_maxfreq_recalc(ALT_CLK_t clk, ALT_PLL_CNTR_FREQMAX_t * maxfreq) { ALT_STATUS_CODE ret = ALT_E_BAD_ARG; diff --git a/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_dma.c b/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_dma.c index 9f5ad0c88b..bf7346e157 100644 --- a/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_dma.c +++ b/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_dma.c @@ -3693,6 +3693,7 @@ ALT_STATUS_CODE alt_dma_periph_to_memory(ALT_DMA_CHANNEL_t channel, ///// +#ifndef __rtems__ static bool alt_dma_is_init(void) { uint32_t permodrst = alt_read_word(ALT_RSTMGR_PERMODRST_ADDR); @@ -3753,3 +3754,4 @@ ALT_STATUS_CODE alt_dma_ecc_start(void * block, size_t size) return ALT_E_SUCCESS; } +#endif /* __rtems__ */ diff --git a/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_i2c.c b/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_i2c.c index 95495e28d9..ef6ae2327d 100644 --- a/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_i2c.c +++ b/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_i2c.c @@ -1086,6 +1086,9 @@ ALT_STATUS_CODE alt_i2c_master_transmit(ALT_I2C_DEV_t *i2c_dev, return status; } +#ifdef __rtems__ +static +#endif ALT_STATUS_CODE alt_i2c_master_receive_helper(ALT_I2C_DEV_t *i2c_dev, uint8_t * buffer, size_t size, diff --git a/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_qspi.c b/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_qspi.c index 5f78fe06cd..945d24732c 100644 --- a/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_qspi.c +++ b/bsps/arm/altera-cyclone-v/contrib/hwlib/src/hwmgr/alt_qspi.c @@ -2415,6 +2415,7 @@ ALT_STATUS_CODE alt_qspi_device_bank_select(uint32_t bank) ///// +#ifndef __rtems__ static bool alt_qspi_is_enabled(void) { uint32_t cfg = alt_read_word(ALT_QSPI_CFG_ADDR); @@ -2623,3 +2624,4 @@ ALT_STATUS_CODE alt_qspi_ecc_start(void * block, size_t size) return status; } +#endif