From patchwork Tue Jan 28 09:44:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 240382 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Tue, 28 Jan 2020 10:44:12 +0100 Subject: [PATCH 1/4] board: stm32mp1: board: add include for dfu In-Reply-To: <20200128094415.5768-1-patrick.delaunay@st.com> References: <20200128094415.5768-1-patrick.delaunay@st.com> Message-ID: <20200128094415.5768-2-patrick.delaunay@st.com> Add include for dfu, add prototype for set_dfu_alt_info and avoid warning when compiling with W=1. Signed-off-by: Patrick Delaunay --- board/st/stm32mp1/stm32mp1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index e82a43074f..2fecfc1b16 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include From patchwork Tue Jan 28 09:44:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 240385 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Tue, 28 Jan 2020 10:44:13 +0100 Subject: [PATCH 2/4] board: stm32mp1: change dfu function to static In-Reply-To: <20200128094415.5768-1-patrick.delaunay@st.com> References: <20200128094415.5768-1-patrick.delaunay@st.com> Message-ID: <20200128094415.5768-3-patrick.delaunay@st.com> Change the dfu functions dfu_otp_read and dfu_pmic_read to static, this patch avoids warning when compiling with W=1. Signed-off-by: Patrick Delaunay --- board/st/stm32mp1/stm32mp1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 2fecfc1b16..b6b70ce20f 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -1010,7 +1010,7 @@ void set_dfu_alt_info(char *interface, char *devstr) #include #include -int dfu_otp_read(u64 offset, u8 *buffer, long *size) +static int dfu_otp_read(u64 offset, u8 *buffer, long *size) { struct udevice *dev; int ret; @@ -1030,7 +1030,7 @@ int dfu_otp_read(u64 offset, u8 *buffer, long *size) return 0; } -int dfu_pmic_read(u64 offset, u8 *buffer, long *size) +static int dfu_pmic_read(u64 offset, u8 *buffer, long *size) { int ret; #ifdef CONFIG_PMIC_STPMIC1 From patchwork Tue Jan 28 09:44:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 240384 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Tue, 28 Jan 2020 10:44:14 +0100 Subject: [PATCH 3/4] pinctrl: stmfx: update the result type of dm_i2c_reg_read In-Reply-To: <20200128094415.5768-1-patrick.delaunay@st.com> References: <20200128094415.5768-1-patrick.delaunay@st.com> Message-ID: <20200128094415.5768-4-patrick.delaunay@st.com> Use int as result of dm_i2c_reg_read to avoid warning with W=1 (warning: comparison is always false due to limited range of data type [-Wtype-limits]) Signed-off-by: Patrick Delaunay --- drivers/pinctrl/pinctrl-stmfx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c index 0b5a0433cd..0def27166e 100644 --- a/drivers/pinctrl/pinctrl-stmfx.c +++ b/drivers/pinctrl/pinctrl-stmfx.c @@ -351,11 +351,12 @@ static int stmfx_chip_init(struct udevice *dev) int ret; struct dm_i2c_chip *chip = dev_get_parent_platdata(dev); - id = dm_i2c_reg_read(dev, STMFX_REG_CHIP_ID); - if (id < 0) { - dev_err(dev, "error reading chip id: %d\n", id); + ret = dm_i2c_reg_read(dev, STMFX_REG_CHIP_ID); + if (ret < 0) { + dev_err(dev, "error reading chip id: %d\n", ret); return ret; } + id = (u8)ret; /* * Check that ID is the complement of the I2C address: * STMFX I2C address follows the 7-bit format (MSB), that's why From patchwork Tue Jan 28 09:44:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 240386 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Tue, 28 Jan 2020 10:44:15 +0100 Subject: [PATCH 4/4] clk: stm32mp1: solve type issue in stm32mp1_lse_enable and stm32mp1_clktree In-Reply-To: <20200128094415.5768-1-patrick.delaunay@st.com> References: <20200128094415.5768-1-patrick.delaunay@st.com> Message-ID: <20200128094415.5768-5-patrick.delaunay@st.com> Solve type issue in stm32mp1_lse_enable and stm32mp1_clktree. This patch solves the warnings when compiling with W=1 on stm32mp1 board: clk_stm32mp1.c: In function ‘stm32mp1_lse_enable’: clk_stm32mp1.c:1238:15: warning: comparison of integer expressions of different signedness: ‘u32’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare] clk_stm32mp1.c:1239:13: warning: comparison of integer expressions of different signedness: ‘u32’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare] clk_stm32mp1.c: In function ‘stm32mp1_clktree’: clk_stm32mp1.c:1814:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] Signed-off-by: Patrick Delaunay --- drivers/clk/clk_stm32mp1.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/clk/clk_stm32mp1.c b/drivers/clk/clk_stm32mp1.c index da66bde41b..fd8c821e48 100644 --- a/drivers/clk/clk_stm32mp1.c +++ b/drivers/clk/clk_stm32mp1.c @@ -1218,7 +1218,7 @@ static int stm32mp1_osc_wait(int enable, fdt_addr_t rcc, u32 offset, } static void stm32mp1_lse_enable(fdt_addr_t rcc, int bypass, int digbyp, - int lsedrv) + u32 lsedrv) { u32 value; @@ -1651,8 +1651,8 @@ static int stm32mp1_clktree(struct udevice *dev) unsigned int clkdiv[CLKDIV_NB]; unsigned int pllcfg[_PLL_NB][PLLCFG_NB]; ofnode plloff[_PLL_NB]; - int ret; - int i, len; + int ret, len; + uint i; int lse_css = 0; const u32 *pkcs_cell; @@ -1698,7 +1698,8 @@ static int stm32mp1_clktree(struct udevice *dev) stm32mp1_lsi_set(rcc, 1); if (priv->osc[_LSE]) { - int bypass, digbyp, lsedrv; + int bypass, digbyp; + u32 lsedrv; struct udevice *dev = priv->osc_dev[_LSE]; bypass = dev_read_bool(dev, "st,bypass");