Re: [PATCH] remoteproc: st: Use device_get_match_data()
On 10/9/23 23:13, Rob Herring wrote: > Use preferred device_get_match_data() instead of of_match_device() to > get the driver match data. With this, adjust the includes to explicitly > include the correct headers. > > Signed-off-by: Rob Herring > --- > drivers/remoteproc/st_remoteproc.c | 14 -- > 1 file changed, 4 insertions(+), 10 deletions(-) > > diff --git a/drivers/remoteproc/st_remoteproc.c > b/drivers/remoteproc/st_remoteproc.c > index e3ce01d98b4c..b0638f984842 100644 > --- a/drivers/remoteproc/st_remoteproc.c > +++ b/drivers/remoteproc/st_remoteproc.c > @@ -16,10 +16,9 @@ > #include > #include > #include > -#include > -#include > #include > #include > +#include > #include > #include > #include > @@ -341,7 +340,6 @@ static int st_rproc_parse_dt(struct platform_device *pdev) > static int st_rproc_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > - const struct of_device_id *match; > struct st_rproc *ddata; > struct device_node *np = dev->of_node; > struct rproc *rproc; > @@ -349,19 +347,15 @@ static int st_rproc_probe(struct platform_device *pdev) > int enabled; > int ret, i; > > - match = of_match_device(st_rproc_match, dev); > - if (!match || !match->data) { > - dev_err(dev, "No device match found\n"); > - return -ENODEV; > - } > - > rproc = rproc_alloc(dev, np->name, &st_rproc_ops, NULL, sizeof(*ddata)); > if (!rproc) > return -ENOMEM; > > rproc->has_iommu = false; > ddata = rproc->priv; > - ddata->config = (struct st_rproc_config *)match->data; > + ddata->config = (struct st_rproc_config *)device_get_match_data(dev); > + if (!ddata->config) > + goto free_rproc; > > platform_set_drvdata(pdev, rproc); > Reviewed-by: Patrice Chotard Thanks Patrice
Re: linux-next: build warning after merge of the spi tree
Hi Mark I will send a patch to fix this warning, sorry for that. Patrice. On 4/20/21 5:48 AM, Stephen Rothwell wrote: > Hi all, > > After merging the spi tree, today's linux-next build (x86_64 allmodconfig) > produced this warning: > > In file included from include/linux/printk.h:409, > from include/linux/kernel.h:16, > from include/linux/clk.h:13, > from drivers/spi/spi-stm32-qspi.c:7: > drivers/spi/spi-stm32-qspi.c: In function 'stm32_qspi_dirmap_read': > drivers/spi/spi-stm32-qspi.c:481:21: warning: format '%x' expects argument of > type 'unsigned int', but argument 5 has type 'size_t' {aka 'long unsigned > int'} [-Wformat=] > 481 | dev_dbg(qspi->dev, "%s len = 0x%x offs = 0x%llx buf = 0x%p\n", > __func__, len, offs, buf); > | ^~ > include/linux/dynamic_debug.h:129:15: note: in definition of macro > '__dynamic_func_call' > 129 | func(&id, ##__VA_ARGS__); \ > | ^~~ > include/linux/dynamic_debug.h:161:2: note: in expansion of macro > '_dynamic_func_call' > 161 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \ > | ^~ > include/linux/dev_printk.h:123:2: note: in expansion of macro > 'dynamic_dev_dbg' > 123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__) > | ^~~ > include/linux/dev_printk.h:123:23: note: in expansion of macro 'dev_fmt' > 123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__) > | ^~~ > drivers/spi/spi-stm32-qspi.c:481:2: note: in expansion of macro 'dev_dbg' > 481 | dev_dbg(qspi->dev, "%s len = 0x%x offs = 0x%llx buf = 0x%p\n", > __func__, len, offs, buf); > | ^~~ > drivers/spi/spi-stm32-qspi.c:481:34: note: format string is defined here > 481 | dev_dbg(qspi->dev, "%s len = 0x%x offs = 0x%llx buf = 0x%p\n", > __func__, len, offs, buf); > | ~^ > | | > | unsigned int > | %lx > > Introduced by commit > > 18674dee3cd6 ("spi: stm32-qspi: Add dirmap support") >
Re: [Linux-stm32] [RESEND PATCH 0/3] MAINTAINERS: update STMicroelectronics email
On 4/12/21 3:48 PM, Arnd Bergmann wrote: > On Mon, Apr 12, 2021 at 12:19 PM Patrice CHOTARD > wrote: >> >> Hi >> >> I think this series has been forgotten, any chance to see it merged into >> v5.13 ? > > It's in -rc7, but it appears that my email reply went missing when I merged > it. > > Arnd > Perfect, thanks for confirmation ;-) Patrice
Re: [Linux-stm32] [RESEND PATCH 0/3] MAINTAINERS: update STMicroelectronics email
Hi I think this series has been forgotten, any chance to see it merged into v5.13 ? Thanks Patrice On 3/11/21 4:24 PM, Patrice CHOTARD wrote: > Hi > > It's just a gentle reminder to not forgot this series. > > Thanks > > Patrice > > On 2/16/21 8:49 AM, patrice.chot...@foss.st.com wrote: >> From: Patrice Chotard >> >> This series: >> _ Update st.com to foss.st.com email for some maintainers. >> _ Remove Vincent Abriou as STI/STM DRM driver >> _ Add Alain Volmat as STM32 I2C/SMBUS driver maintainer >> >> Patrice Chotard (3): >> MAINTAINERS: Update some st.com email addresses to foss.st.com >> MAINTAINERS: Remove Vincent Abriou for STM/STI DRM drivers. >> MAINTAINERS: Add Alain Volmat as STM32 I2C/SMBUS maintainer >> >> MAINTAINERS | 31 +++ >> 1 file changed, 15 insertions(+), 16 deletions(-) >> > ___ > Linux-stm32 mailing list > linux-st...@st-md-mailman.stormreply.com > https://st-md-mailman.stormreply.com/mailman/listinfo/linux-stm32 >
Re: [PATCH -next] mmc: sdhci-st: Remove unnecessary error log
Hi Laibin On 4/9/21 4:38 AM, Laibin Qiu wrote: > devm_ioremap_resource() has recorded error log, so it's > unnecessary to record log again. > > Reported-by: Hulk Robot > Signed-off-by: Laibin Qiu > --- > drivers/mmc/host/sdhci-st.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c > index 78941ac3a1d6..d41582c21aa3 100644 > --- a/drivers/mmc/host/sdhci-st.c > +++ b/drivers/mmc/host/sdhci-st.c > @@ -400,10 +400,8 @@ static int sdhci_st_probe(struct platform_device *pdev) > res = platform_get_resource_byname(pdev, IORESOURCE_MEM, > "top-mmc-delay"); > pdata->top_ioaddr = devm_ioremap_resource(&pdev->dev, res); > - if (IS_ERR(pdata->top_ioaddr)) { > - dev_warn(&pdev->dev, "FlashSS Top Dly registers not available"); > + if (IS_ERR(pdata->top_ioaddr)) > pdata->top_ioaddr = NULL; > - } > > pltfm_host->clk = clk; > pdata->icnclk = icnclk; > Reviewed-by: Patrice Chotard Thanks Patrice
Re: [PATCH v3 4/7] clk: st: clkgen-pll: embed soc clock outputs within compatible data
> * DOC: Clock Generated by PLL, rate set and enabled by bootloader > * > @@ -684,7 +748,7 @@ static struct clk * __init clkgen_odf_register(const char > *parent_name, > > > static void __init clkgen_c32_pll_setup(struct device_node *np, > - struct clkgen_pll_data *data) > + struct clkgen_pll_data_clks *datac) > { > struct clk *clk; > const char *parent_name, *pll_name; > @@ -704,14 +768,14 @@ static void __init clkgen_c32_pll_setup(struct > device_node *np, > > of_clk_detect_critical(np, 0, &pll_flags); > > - clk = clkgen_pll_register(parent_name, data, pll_base, pll_flags, > - np->name, data->lock); > + clk = clkgen_pll_register(parent_name, datac->data, pll_base, pll_flags, > + np->name, datac->data->lock); > if (IS_ERR(clk)) > return; > > pll_name = __clk_get_name(clk); > > - num_odfs = data->num_odfs; > + num_odfs = datac->data->num_odfs; > > clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); > if (!clk_data) > @@ -729,14 +793,21 @@ static void __init clkgen_c32_pll_setup(struct > device_node *np, > const char *clk_name; > unsigned long odf_flags = 0; > > - if (of_property_read_string_index(np, "clock-output-names", > - odf, &clk_name)) > - return; > + if (datac->outputs) { > + clk_name = datac->outputs[odf].name; > + odf_flags = datac->outputs[odf].flags; > + } else { > + if (of_property_read_string_index(np, > + "clock-output-names", > + odf, &clk_name)) > + return; > > - of_clk_detect_critical(np, odf, &odf_flags); > + of_clk_detect_critical(np, odf, &odf_flags); > + } > > - clk = clkgen_odf_register(pll_name, pll_base, data, odf_flags, > - odf, &clkgena_c32_odf_lock, clk_name); > + clk = clkgen_odf_register(pll_name, pll_base, datac->data, > + odf_flags, odf, &clkgena_c32_odf_lock, > + clk_name); > if (IS_ERR(clk)) > goto err; > > @@ -754,27 +825,48 @@ static void __init clkgen_c32_pll_setup(struct > device_node *np, > static void __init clkgen_c32_pll0_setup(struct device_node *np) > { > clkgen_c32_pll_setup(np, > - (struct clkgen_pll_data *) &st_pll3200c32_cx_0); > + (struct clkgen_pll_data_clks *) > &st_pll3200c32_cx_0_legacy_data); > } > CLK_OF_DECLARE(c32_pll0, "st,clkgen-pll0", clkgen_c32_pll0_setup); > > +static void __init clkgen_c32_pll0_a0_setup(struct device_node *np) > +{ > + clkgen_c32_pll_setup(np, > + (struct clkgen_pll_data_clks *) &st_pll3200c32_a0_data); > +} > +CLK_OF_DECLARE(c32_pll0_a0, "st,clkgen-pll0-a0", clkgen_c32_pll0_a0_setup); > + > +static void __init clkgen_c32_pll0_c0_setup(struct device_node *np) > +{ > + clkgen_c32_pll_setup(np, > + (struct clkgen_pll_data_clks *) &st_pll3200c32_c0_data); > +} > +CLK_OF_DECLARE(c32_pll0_c0, "st,clkgen-pll0-c0", clkgen_c32_pll0_c0_setup); > + > static void __init clkgen_c32_pll1_setup(struct device_node *np) > { > clkgen_c32_pll_setup(np, > - (struct clkgen_pll_data *) &st_pll3200c32_cx_1); > + (struct clkgen_pll_data_clks *) > &st_pll3200c32_cx_1_legacy_data); > } > CLK_OF_DECLARE(c32_pll1, "st,clkgen-pll1", clkgen_c32_pll1_setup); > > +static void __init clkgen_c32_pll1_c0_setup(struct device_node *np) > +{ > + clkgen_c32_pll_setup(np, > + (struct clkgen_pll_data_clks *) &st_pll3200c32_c1_data); > +} > +CLK_OF_DECLARE(c32_pll1_c0, "st,clkgen-pll1-c0", clkgen_c32_pll1_c0_setup); > + > static void __init clkgen_c32_plla9_setup(struct device_node *np) > { > clkgen_c32_pll_setup(np, > - (struct clkgen_pll_data *) &st_pll3200c32_407_a9); > + (struct clkgen_pll_data_clks *) &st_pll3200c32_407_a9_data); > } > CLK_OF_DECLARE(c32_plla9, "st,stih407-clkgen-plla9", clkgen_c32_plla9_setup); > > static void __init clkgen_c28_plla9_setup(struct device_node *np) > { > clkgen_c32_pll_setup(np, > - (struct clkgen_pll_data *) &st_pll4600c28_418_a9); > + (struct clkgen_pll_data_clks *) &st_pll4600c28_418_a9_data); > } > CLK_OF_DECLARE(c28_plla9, "st,stih418-clkgen-plla9", clkgen_c28_plla9_setup); > Reviewed-by: Patrice Chotard Thanks
Re: [PATCH v3 6/7] clk: st: clkgen-fsyn: embed soc clock outputs within compatible data
ring_index(np, "clock-output-names", > - fschan, &clk_name)) { > - break; > + if (quadfs->outputs) { > + clk_name = quadfs->outputs[fschan].name; > + flags = quadfs->outputs[fschan].flags; > + } else { > + if (of_property_read_string_index(np, > + "clock-output-names", > + fschan, &clk_name)) > + break; > + of_clk_detect_critical(np, fschan, &flags); > } > > /* > @@ -892,10 +960,8 @@ static void __init st_of_create_quadfs_fsynths( > if (*clk_name == '\0') > continue; > > - of_clk_detect_critical(np, fschan, &flags); > - > clk = st_clk_register_quadfs_fsynth(clk_name, pll_name, > - quadfs, reg, fschan, > + quadfs->data, reg, fschan, > flags, lock); > > /* > @@ -915,7 +981,7 @@ static void __init st_of_create_quadfs_fsynths( > } > > static void __init st_of_quadfs_setup(struct device_node *np, > - struct clkgen_quadfs_data *data) > + struct clkgen_quadfs_data_clks *datac) > { > struct clk *clk; > const char *pll_name, *clk_parent_name; > @@ -940,7 +1006,7 @@ static void __init st_of_quadfs_setup(struct device_node > *np, > > spin_lock_init(lock); > > - clk = st_clk_register_quadfs_pll(pll_name, clk_parent_name, data, > + clk = st_clk_register_quadfs_pll(pll_name, clk_parent_name, datac->data, > reg, lock); > if (IS_ERR(clk)) > goto err_exit; > @@ -950,7 +1016,7 @@ static void __init st_of_quadfs_setup(struct device_node > *np, > __clk_get_name(clk_get_parent(clk)), > (unsigned int)clk_get_rate(clk)); > > - st_of_create_quadfs_fsynths(np, pll_name, data, reg, lock); > + st_of_create_quadfs_fsynths(np, pll_name, datac, reg, lock); > > err_exit: > kfree(pll_name); /* No longer need local copy of the PLL name */ > @@ -958,12 +1024,35 @@ static void __init st_of_quadfs_setup(struct > device_node *np, > > static void __init st_of_quadfs660C_setup(struct device_node *np) > { > - st_of_quadfs_setup(np, (struct clkgen_quadfs_data *) &st_fs660c32_C); > + st_of_quadfs_setup(np, > + (struct clkgen_quadfs_data_clks *) &st_fs660c32_C_data); > } > CLK_OF_DECLARE(quadfs660C, "st,quadfs-pll", st_of_quadfs660C_setup); > > static void __init st_of_quadfs660D_setup(struct device_node *np) > { > - st_of_quadfs_setup(np, (struct clkgen_quadfs_data *) &st_fs660c32_D); > + st_of_quadfs_setup(np, > + (struct clkgen_quadfs_data_clks *) &st_fs660c32_D_data); > } > CLK_OF_DECLARE(quadfs660D, "st,quadfs", st_of_quadfs660D_setup); > + > +static void __init st_of_quadfs660D0_setup(struct device_node *np) > +{ > + st_of_quadfs_setup(np, > + (struct clkgen_quadfs_data_clks *) &st_fs660c32_D0_data); > +} > +CLK_OF_DECLARE(quadfs660D0, "st,quadfs-d0", st_of_quadfs660D0_setup); > + > +static void __init st_of_quadfs660D2_setup(struct device_node *np) > +{ > + st_of_quadfs_setup(np, > + (struct clkgen_quadfs_data_clks *) &st_fs660c32_D2_data); > +} > +CLK_OF_DECLARE(quadfs660D2, "st,quadfs-d2", st_of_quadfs660D2_setup); > + > +static void __init st_of_quadfs660D3_setup(struct device_node *np) > +{ > + st_of_quadfs_setup(np, > + (struct clkgen_quadfs_data_clks *) &st_fs660c32_D3_data); > +} > +CLK_OF_DECLARE(quadfs660D3, "st,quadfs-d3", st_of_quadfs660D3_setup); > Reviewed-by: Patrice Chotard Thanks
Re: [PATCH v3 1/7] clk: st: clkgen-pll: remove unused variable of struct clkgen_pll
Hi Alain On 3/30/21 10:51 PM, Alain Volmat wrote: > ODF field within the struct clkgen_pll is never used by the driver > and can thus be removed. > > Signed-off-by: Alain Volmat > --- > v3: s/used/unused within the subject > > drivers/clk/st/clkgen-pll.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c > index 119c5b33080c..f6c56ca90c7d 100644 > --- a/drivers/clk/st/clkgen-pll.c > +++ b/drivers/clk/st/clkgen-pll.c > @@ -146,7 +146,6 @@ struct clkgen_pll { > > u32 ndiv; > u32 idf; > - u32 odf; > u32 cp; > }; > > Reviewed-by: Patrice Chotard Thanks
Re: [PATCH v3 2/7] clk: st: flexgen: embed soc clock outputs within compatible data
truct clkgen_clk_out clkgen_stih410_c0_clk_out[] = { > + { .name = "clk-icn-gpu", }, > + { .name = "clk-fdma", }, > + { .name = "clk-nand", }, > + { .name = "clk-hva", }, > + { .name = "clk-proc-stfe", }, > + { .name = "clk-proc-tp", }, > + { .name = "clk-rx-icn-dmu", }, > + { .name = "clk-rx-icn-hva", }, > + /* This clk needs to be on to keep bus interconnect alive */ > + { .name = "clk-icn-cpu", .flags = CLK_IS_CRITICAL }, > + /* This clk needs to be on to keep bus interconnect alive */ > + { .name = "clk-tx-icn-dmu", .flags = CLK_IS_CRITICAL }, > + { .name = "clk-mmc-0", }, > + { .name = "clk-mmc-1", }, > + { .name = "clk-jpegdec", }, > + /* This clk needs to be on to keep A9 running */ > + { .name = "clk-ext2fa9", .flags = CLK_IS_CRITICAL }, > + { .name = "clk-ic-bdisp-0", }, > + { .name = "clk-ic-bdisp-1", }, > + { .name = "clk-pp-dmu", }, > + { .name = "clk-vid-dmu", }, > + { .name = "clk-dss-lpc", }, > + { .name = "clk-st231-aud-0", }, > + { .name = "clk-st231-gp-1", }, > + { .name = "clk-st231-dmu", }, > + /* This clk needs to be on to keep bus interconnect alive */ > + { .name = "clk-icn-lmi", .flags = CLK_IS_CRITICAL }, > + { .name = "clk-tx-icn-disp-1", }, > + /* This clk needs to be on to keep bus interconnect alive */ > + { .name = "clk-icn-sbc", .flags = CLK_IS_CRITICAL }, > + { .name = "clk-stfe-frc2", }, > + { .name = "clk-eth-phy", }, > + { .name = "clk-eth-ref-phyclk", }, > + { .name = "clk-flash-promip", }, > + { .name = "clk-main-disp", }, > + { .name = "clk-aux-disp", }, > + { .name = "clk-compo-dvp", }, > + { .name = "clk-tx-icn-hades", }, > + { .name = "clk-rx-icn-hades", }, > + { .name = "clk-icn-reg-16", }, Need to add CLK_IS_CRITICAL for clk-icn-reg-16 This was a long time bug which is hidden by usage of clk_ignore_unused in bootargs. With that fix, you can add Reviewed-by: Patrice Chotard Thanks Patrice > + { .name = "clk-pp-hades", }, > + { .name = "clk-clust-hades", }, > + { .name = "clk-hwpe-hades", }, > + { .name = "clk-fc-hades", }, > +}; > + > +static const struct clkgen_data clkgen_stih410_c0 = { > + .outputs = clkgen_stih410_c0_clk_out, > + .outputs_nb = ARRAY_SIZE(clkgen_stih410_c0_clk_out), > +}; > + > +static const struct clkgen_clk_out clkgen_stih418_c0_clk_out[] = { > + { .name = "clk-icn-gpu", }, > + { .name = "clk-fdma", }, > + { .name = "clk-nand", }, > + { .name = "clk-hva", }, > + { .name = "clk-proc-stfe", }, > + { .name = "clk-tp", }, > + /* This clk needs to be on to keep bus interconnect alive */ > + { .name = "clk-rx-icn-dmu", .flags = CLK_IS_CRITICAL }, > + /* This clk needs to be on to keep bus interconnect alive */ > + { .name = "clk-rx-icn-hva", .flags = CLK_IS_CRITICAL }, > + { .name = "clk-icn-cpu", .flags = CLK_IS_CRITICAL }, > + /* This clk needs to be on to keep bus interconnect alive */ > + { .name = "clk-tx-icn-dmu", .flags = CLK_IS_CRITICAL }, > + { .name = "clk-mmc-0", }, > + { .name = "clk-mmc-1", }, > + { .name = "clk-jpegdec", }, > + /* This clk needs to be on to keep bus interconnect alive */ > + { .name = "clk-icn-reg", .flags = CLK_IS_CRITICAL }, > + { .name = "clk-proc-bdisp-0", }, > + { .name = "clk-proc-bdisp-1", }, > + { .name = "clk-pp-dmu", }, > + { .name = "clk-vid-dmu", }, > + { .name = "clk-dss-lpc", }, > + { .name = "clk-st231-aud-0", }, > + { .name = "clk-st231-gp-1", }, > + { .name = "clk-st231-dmu", }, > + /* This clk needs to be on to keep bus interconnect alive */ > + { .name = "clk-icn-lmi", .flags = CLK_IS_CRITICAL }, > + /* This clk needs to be on to keep bus interconnect alive */ > + { .name = "clk-tx-icn-1", .flags = CLK_IS_CRITICAL }, > + /* This clk needs to be on to keep bus interconnect alive */ > + { .name = "clk-icn-sbc", .flags = CLK_IS_CRITICAL }, > + { .name = "clk-stfe-frc2", }, > + { .name = &
Re: [RESEND PATCH 0/3] MAINTAINERS: update STMicroelectronics email
Hi It's just a gentle reminder to not forgot this series. Thanks Patrice On 2/16/21 8:49 AM, patrice.chot...@foss.st.com wrote: > From: Patrice Chotard > > This series: > _ Update st.com to foss.st.com email for some maintainers. > _ Remove Vincent Abriou as STI/STM DRM driver > _ Add Alain Volmat as STM32 I2C/SMBUS driver maintainer > > Patrice Chotard (3): > MAINTAINERS: Update some st.com email addresses to foss.st.com > MAINTAINERS: Remove Vincent Abriou for STM/STI DRM drivers. > MAINTAINERS: Add Alain Volmat as STM32 I2C/SMBUS maintainer > > MAINTAINERS | 31 +++ > 1 file changed, 15 insertions(+), 16 deletions(-) >
Re: [RESEND PATCH 0/3] MAINTAINERS: update STMicroelectronics email
Hi It's just a gentle reminder to not forgot this series. Thanks Patrice On 2/16/21 8:49 AM, patrice.chot...@foss.st.com wrote: > From: Patrice Chotard > > This series: > _ Update st.com to foss.st.com email for some maintainers. > _ Remove Vincent Abriou as STI/STM DRM driver > _ Add Alain Volmat as STM32 I2C/SMBUS driver maintainer > > Patrice Chotard (3): > MAINTAINERS: Update some st.com email addresses to foss.st.com > MAINTAINERS: Remove Vincent Abriou for STM/STI DRM drivers. > MAINTAINERS: Add Alain Volmat as STM32 I2C/SMBUS maintainer > > MAINTAINERS | 31 +++ > 1 file changed, 15 insertions(+), 16 deletions(-) >
Re: [PATCH 0/3] MAINTAINERS: update STMicroelectronics email
Hi Arnd On 2/15/21 3:19 PM, Arnd Bergmann wrote: > On Mon, Feb 15, 2021 at 2:17 PM Patrice CHOTARD > wrote: >> >> Hi Arnd, Olof, Kevin >> >> What is the best way to get this series merged ? >> Do you pick it and apply it directly, or do we integrate it in the next >> STM32 pull request ? > > I usually pick up updates to the MAINTAINERS file as bugfixes, so > either send them as part of the fixes pull request, or forward them > to s...@kernel.org to apply directly. > > If you cc me on patches for a particular platform, I usually just ignore them, > unless they get sent to s...@kernel.org, and in that case I will either apply > them or ask back if they were meant for us. > > Arnd > Ok, i will resend this series to s...@kernel.org. Thanks Patrice
Re: [PATCH 0/3] MAINTAINERS: update STMicroelectronics email
Hi Arnd, Olof, Kevin What is the best way to get this series merged ? Do you pick it and apply it directly, or do we integrate it in the next STM32 pull request ? Thanks Patrice On 2/1/21 11:00 AM, patrice.chot...@foss.st.com wrote: > From: Patrice Chotard > > This series: > _ Update st.com to foss.st.com email for some maintainers. > _ Remove Vincent Abriou as STI/STM DRM driver > _ Add Alain Volmat as I2C/SMBUS driver maintainer > > Patrice Chotard (3): > MAINTAINERS: Update some st.com email addresses to foss.st.com > MAINTAINERS: Remove Vincent Abriou for STM/STI DRM drivers. > MAINTAINERS: Add Alain Volmat as STM32 I2C/SMBUS maintainer > > MAINTAINERS | 31 +++ > 1 file changed, 15 insertions(+), 16 deletions(-) >
Re: [PATCH] ARM: sti: Fix spelling mistake in Kconfig "targetted" -> "targeted"
Hi Colin On 12/17/20 6:13 PM, Colin King wrote: > From: Colin Ian King > > There is a spelling mistake in the Kconfig help text. Fix it. > > Signed-off-by: Colin Ian King > --- > arch/arm/mach-sti/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig > index b2d45cf10a3c..74640bbaeba6 100644 > --- a/arch/arm/mach-sti/Kconfig > +++ b/arch/arm/mach-sti/Kconfig > @@ -50,7 +50,7 @@ config SOC_STIH407 > select STIH407_RESET > help > This enables support for STMicroelectronics Digital Consumer > - Electronics family StiH407 parts, targetted at set-top-box > + Electronics family StiH407 parts, targeted at set-top-box > and other digital audio/video applications using Flattened Device > Trees. > Reviewed-by: Patrice Chotard Thanks Patrice
Re: [PATCH v3 07/10] arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name
Hi Serge On 12/5/20 4:56 PM, Serge Semin wrote: > In accordance with the DWC USB3 bindings the corresponding node > name is suppose to comply with the Generic USB HCD DT schema, which > requires the USB nodes to have the name acceptable by the regexp: > "^usb(@.*)?" . Make sure the "snps,dwc3"-compatible nodes are correctly > named. > > Signed-off-by: Serge Semin > Acked-by: Krzysztof Kozlowski > --- > arch/arm/boot/dts/stih407-family.dtsi | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/boot/dts/stih407-family.dtsi > b/arch/arm/boot/dts/stih407-family.dtsi > index 23a1746f3baa..2352f76b5a69 100644 > --- a/arch/arm/boot/dts/stih407-family.dtsi > +++ b/arch/arm/boot/dts/stih407-family.dtsi > @@ -681,7 +681,7 @@ st_dwc3: dwc3@8f94000 { > > status = "disabled"; > > - dwc3: dwc3@990 { > + dwc3: usb@990 { > compatible = "snps,dwc3"; > reg = <0x0990 0x10>; > interrupts = IRQ_TYPE_LEVEL_HIGH>; Reviewed-by: Patrice Chotard Thanks Patrice
Re: [PATCH v2 0/2] arm: sti: LL_UART updates & STiH418 addition
After discussion with Alain, he will take care to submit them to Russell's patch tracker. Thanks On 11/19/20 10:57 AM, Patrice CHOTARD wrote: > Hi Linus > > On 11/19/20 9:26 AM, Linus Walleij wrote: >> On Thu, Nov 19, 2020 at 9:08 AM Patrice CHOTARD >> wrote: >> >>> Is there any reason for this series not being merged ? >> Did you put them into Russell's patch tracker as I asked? >> I haven't seen them there. >> https://www.armlinux.org.uk/developer/patches/ > No i haven't put them into patch tracker, my bad. > > I will register to it and add this series. > > Thanks for the tip Linus. > > Patrice > > >> Yours, >> Linus Walleij
Re: [PATCH v2 0/2] arm: sti: LL_UART updates & STiH418 addition
Hi Linus On 11/19/20 9:26 AM, Linus Walleij wrote: > On Thu, Nov 19, 2020 at 9:08 AM Patrice CHOTARD > wrote: > >> Is there any reason for this series not being merged ? > Did you put them into Russell's patch tracker as I asked? > I haven't seen them there. > https://www.armlinux.org.uk/developer/patches/ No i haven't put them into patch tracker, my bad. I will register to it and add this series. Thanks for the tip Linus. Patrice > > Yours, > Linus Walleij
Re: [PATCH v2 0/2] arm: sti: LL_UART updates & STiH418 addition
Hi Russell Is there any reason for this series not being merged ? Thanks Patrice On 8/30/20 9:57 PM, Alain Volmat wrote: > This serie update the STi Platform LL_UART code to rely on > DEBUG_UART_PHYS & DEBUG_UART_VIRT and add the STiH418 SoC support. > > Alain Volmat (2): > arm: use DEBUG_UART_PHYS and DEBUG_UART_VIRT for sti LL_UART > arm: sti LL_UART: add STiH418 SBC UART0 support > > arch/arm/Kconfig.debug | 38 +--- > arch/arm/include/debug/sti.S | 26 ++-- > 2 files changed, 29 insertions(+), 35 deletions(-) > > v2: rebased on top of linux 5.9-rc2 > >
Re: [PATCH] reset: sti: reset-syscfg: fix struct description warnings
Hi Alain On 8/31/20 10:38 PM, Alain Volmat wrote: > Fix formating of struct description to avoid warning highlighted > by W=1 compilation. > > Fixes: e5d76075d930 ("drivers: reset: STi SoC system configuration reset > controller support") > Signed-off-by: Alain Volmat > --- > drivers/reset/sti/reset-syscfg.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/reset/sti/reset-syscfg.c > b/drivers/reset/sti/reset-syscfg.c > index 91215bb88f62..99b63035fe72 100644 > --- a/drivers/reset/sti/reset-syscfg.c > +++ b/drivers/reset/sti/reset-syscfg.c > @@ -17,7 +17,7 @@ > #include "reset-syscfg.h" > > /** > - * Reset channel regmap configuration > + * struct syscfg_reset_channel - Reset channel regmap configuration > * > * @reset: regmap field for the channel's reset bit. > * @ack: regmap field for the channel's ack bit (optional). > @@ -28,8 +28,9 @@ struct syscfg_reset_channel { > }; > > /** > - * A reset controller which groups together a set of related reset bits, > which > - * may be located in different system configuration registers. > + * struct syscfg_reset_controller - A reset controller which groups together > + * a set of related reset bits, which may be located in different system > + * configuration registers. > * > * @rst: base reset controller structure. > * @active_low: are the resets in this controller active low, i.e. clearing Reviewed-by: Patrice Chotard Thanks Patrice
Re: [PATCH v1 0/4] PM: Add dev_wakeup_path() helper
Hi Rafael On 11/18/20 2:08 PM, Rafael J. Wysocki wrote: > On Fri, Nov 6, 2020 at 8:34 AM wrote: >> From: Patrice Chotard >> >> Add dev_wakeup_path() helper to avoid to spread >> dev->power.wakeup_path test in drivers. > OK > >> Cc: amelie.delau...@st.com, >> erwan_le...@st.com, >> fabrice.gasn...@st.com, >> alexandre.tor...@st.com, >> alain.vol...@st.com, >> pierre-yves.mord...@st.com >> >> *** BLURB HERE *** > Hmm? > >> Patrice Chotard (4): >> PM / wakeup: Add dev_wakeup_path() helper >> PM: domains: Make usage of device_wakeup_path() helper >> PM: core: Make usage of device_wakeup_path() helper >> i2c: stm32f7: Make usage of dev_wakeup_path() helper > Please fold the patches into one and add the R-by from Ulf to it. OK, the v2 is on the way. Thanks Patrice > > Thanks!
Re: [PATCH 2/3] watchdog: st_lpc_wdt: remove unnecessary CONFIG_PM_SLEEP
Hi Coiby As already pointed by Fabrice Gasnier for similar patch "[PATCH 10/15] iio: adc: stm32: remove unnecessary CONFIG_PM_SLEEP" When compiling with W=1 and CONFIG_PM_SLEEP disabled, we got the following warnings: drivers/watchdog/st_lpc_wdt.c:265:12: warning: ‘st_wdog_resume’ defined but not used [-Wunused-function] 265 | static int st_wdog_resume(struct device *dev) | ^~ drivers/watchdog/st_lpc_wdt.c:251:12: warning: ‘st_wdog_suspend’ defined but not used [-Wunused-function] 251 | static int st_wdog_suspend(struct device *dev) | ^~~ Can you add missing "__maybe unused" attribute ? Thanks Patrice On 10/29/20 8:58 AM, Patrice CHOTARD wrote: > Hi Coiby > > On 10/29/20 8:53 AM, Coiby Xu wrote: >> SIMPLE_DEV_PM_OPS has already took good care of CONFIG_PM_CONFIG. >> >> Signed-off-by: Coiby Xu >> --- >> drivers/watchdog/st_lpc_wdt.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/drivers/watchdog/st_lpc_wdt.c b/drivers/watchdog/st_lpc_wdt.c >> index 14ab6559c748..c1428d63dc9e 100644 >> --- a/drivers/watchdog/st_lpc_wdt.c >> +++ b/drivers/watchdog/st_lpc_wdt.c >> @@ -248,7 +248,6 @@ static int st_wdog_remove(struct platform_device *pdev) >> return 0; >> } >> >> -#ifdef CONFIG_PM_SLEEP >> static int st_wdog_suspend(struct device *dev) >> { >> struct st_wdog *st_wdog = watchdog_get_drvdata(&st_wdog_dev); >> @@ -285,7 +284,6 @@ static int st_wdog_resume(struct device *dev) >> >> return 0; >> } >> -#endif >> >> static SIMPLE_DEV_PM_OPS(st_wdog_pm_ops, >> st_wdog_suspend, > Reviewed-by: Patrice Chotard > > Thanks > > Patrice >
Re: [PATCH 2/3] watchdog: st_lpc_wdt: remove unnecessary CONFIG_PM_SLEEP
Hi Coiby On 10/29/20 8:53 AM, Coiby Xu wrote: > SIMPLE_DEV_PM_OPS has already took good care of CONFIG_PM_CONFIG. > > Signed-off-by: Coiby Xu > --- > drivers/watchdog/st_lpc_wdt.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/watchdog/st_lpc_wdt.c b/drivers/watchdog/st_lpc_wdt.c > index 14ab6559c748..c1428d63dc9e 100644 > --- a/drivers/watchdog/st_lpc_wdt.c > +++ b/drivers/watchdog/st_lpc_wdt.c > @@ -248,7 +248,6 @@ static int st_wdog_remove(struct platform_device *pdev) > return 0; > } > > -#ifdef CONFIG_PM_SLEEP > static int st_wdog_suspend(struct device *dev) > { > struct st_wdog *st_wdog = watchdog_get_drvdata(&st_wdog_dev); > @@ -285,7 +284,6 @@ static int st_wdog_resume(struct device *dev) > > return 0; > } > -#endif > > static SIMPLE_DEV_PM_OPS(st_wdog_pm_ops, >st_wdog_suspend, Reviewed-by: Patrice Chotard Thanks Patrice
Re: [PATCH v2 2/2] arm: sti LL_UART: add STiH418 SBC UART0 support
Hi Alain On 8/30/20 9:57 PM, Alain Volmat wrote: > Add the entry for the STiH418 SBC UART0 low level uart. > > Signed-off-by: Alain Volmat > --- > arch/arm/Kconfig.debug | 19 +-- > 1 file changed, 17 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug > index e97d6e5c8898..447d177fcf8d 100644 > --- a/arch/arm/Kconfig.debug > +++ b/arch/arm/Kconfig.debug > @@ -1204,6 +1204,16 @@ choice > > If unsure, say N. > > + config DEBUG_STIH418_SBC_ASC0 > + bool "Use StiH418 SBC ASC0 UART for low-level debug" > + depends on ARCH_STI > + help > + Say Y here if you want kernel low-level debugging support > + on STiH418 based platforms which has default UART wired > + up to SBC ASC0. > + > + If unsure, say N. > + > config STM32F4_DEBUG_UART > bool "Use STM32F4 UART for low-level debug" > depends on MACH_STM32F429 || MACH_STM32F469 > @@ -1587,6 +1597,7 @@ config DEBUG_LL_INCLUDE > default "debug/sirf.S" if DEBUG_SIRFSOC_UART > default "debug/sti.S" if DEBUG_STIH41X_ASC2 > default "debug/sti.S" if DEBUG_STIH41X_SBC_ASC1 > + default "debug/sti.S" if DEBUG_STIH418_SBC_ASC0 > default "debug/stm32.S" if DEBUG_STM32_UART > default "debug/tegra.S" if DEBUG_TEGRA_UART > default "debug/ux500.S" if DEBUG_UX500_UART > @@ -1620,6 +1631,7 @@ config DEBUG_UART_PHYS > default 0x03010fe0 if ARCH_RPC > default 0x0700 if DEBUG_SUN9I_UART0 > default 0x09405000 if DEBUG_ZTE_ZX > + default 0x0953 if DEBUG_STIH418_SBC_ASC0 > default 0x10009000 if DEBUG_REALVIEW_STD_PORT || \ > DEBUG_VEXPRESS_UART0_CA9 > default 0x1010c000 if DEBUG_REALVIEW_PB1176_PORT > @@ -1750,7 +1762,8 @@ config DEBUG_UART_PHYS > DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ > DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \ > DEBUG_AT91_UART || DEBUG_STM32_UART || \ > - DEBUG_STIH41X_ASC2 || DEBUG_STIH41X_SBC_ASC1 > + DEBUG_STIH41X_ASC2 || DEBUG_STIH41X_SBC_ASC1 || \ > + DEBUG_STIH418_SBC_ASC0 > > config DEBUG_UART_VIRT > hex "Virtual base address of debug UART" > @@ -1796,6 +1809,7 @@ config DEBUG_UART_VIRT > default 0xf809 if DEBUG_VEXPRESS_UART0_RS1 > default 0xf8ffee00 if DEBUG_AT91_SAM9263_DBGU > default 0xf8fff200 if DEBUG_AT91_RM9200_DBGU > + default 0xf953 if DEBUG_STIH418_SBC_ASC0 > default 0xf9e09000 if DEBUG_AM33XXUART1 > default 0xfa02 if DEBUG_OMAP4UART3 || DEBUG_TI81XXUART1 > default 0xfa022000 if DEBUG_TI81XXUART2 > @@ -1864,7 +1878,8 @@ config DEBUG_UART_VIRT > DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ > DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \ > DEBUG_AT91_UART || DEBUG_STM32_UART || \ > - DEBUG_STIH41X_ASC2 || DEBUG_STIH41X_SBC_ASC1 > + DEBUG_STIH41X_ASC2 || DEBUG_STIH41X_SBC_ASC1 || \ > + DEBUG_STIH418_SBC_ASC0 > > config DEBUG_UART_8250_SHIFT > int "Register offset shift for the 8250 debug UART" Reviewed-by: Patrice Chotard Thanks Patrice
Re: [PATCH v2 1/2] arm: use DEBUG_UART_PHYS and DEBUG_UART_VIRT for sti LL_UART
) Limited. > */ > > -#define STIH41X_COMMS_BASE 0xfed0 > -#define STIH41X_ASC2_BASE (STIH41X_COMMS_BASE+0x32000) > - > -#define STIH41X_SBC_LPM_BASE0xfe40 > -#define STIH41X_SBC_COMMS_BASE (STIH41X_SBC_LPM_BASE + 0x10) > -#define STIH41X_SBC_ASC1_BASE (STIH41X_SBC_COMMS_BASE + 0x31000) > - > - > -#define VIRT_ADDRESS(x) (x - 0x100) > - > -#if IS_ENABLED(CONFIG_STIH41X_DEBUG_ASC2) > -#define DEBUG_LL_UART_BASE STIH41X_ASC2_BASE > -#endif > - > -#if IS_ENABLED(CONFIG_STIH41X_DEBUG_SBC_ASC1) > -#define DEBUG_LL_UART_BASE STIH41X_SBC_ASC1_BASE > -#endif > - > -#ifndef DEBUG_LL_UART_BASE > -#error "DEBUG UART is not Configured" > -#endif > - > #define ASC_TX_BUF_OFF 0x04 > #define ASC_CTRL_OFF0x0c > #define ASC_STA_OFF 0x14 > @@ -37,8 +15,8 @@ > > > .macro addruart, rp, rv, tmp > - ldr \rp, =DEBUG_LL_UART_BASE @ physical base > - ldr \rv, =VIRT_ADDRESS(DEBUG_LL_UART_BASE) @ virt base > + ldr \rp, =CONFIG_DEBUG_UART_PHYS @ physical base > + ldr \rv, =CONFIG_DEBUG_UART_VIRT @ virt base > .endm > > .macro senduart,rd,rx Reviewed-by: Patrice Chotard Thanks Patrice
Re: [PATCH 4/7] usb: dwc3: convert to devm_platform_ioremap_resource_byname
Hi Chunfeng On 7/22/20 9:51 AM, Chunfeng Yun wrote: > Use devm_platform_ioremap_resource_byname() to simplify code > > Cc: Patrice Chotard > Signed-off-by: Chunfeng Yun > --- > drivers/usb/dwc3/dwc3-st.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c > index c682420..e733be8 100644 > --- a/drivers/usb/dwc3/dwc3-st.c > +++ b/drivers/usb/dwc3/dwc3-st.c > @@ -206,8 +206,8 @@ static int st_dwc3_probe(struct platform_device *pdev) > if (!dwc3_data) > return -ENOMEM; > > - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg-glue"); > - dwc3_data->glue_base = devm_ioremap_resource(dev, res); > + dwc3_data->glue_base = > + devm_platform_ioremap_resource_byname(pdev, "reg-glue"); > if (IS_ERR(dwc3_data->glue_base)) > return PTR_ERR(dwc3_data->glue_base); > Reviewed-by: Patrice Chotard Thanks Patrice
Re: [PATCH -next 11/13] hwrng: st - use devm_platform_ioremap_resource() to simplify code
Hi On 10/16/19 12:46 PM, YueHaibing wrote: > Use devm_platform_ioremap_resource() to simplify the code a bit. > This is detected by coccinelle. > > Signed-off-by: YueHaibing > --- > drivers/char/hw_random/st-rng.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/char/hw_random/st-rng.c b/drivers/char/hw_random/st-rng.c > index 8634483..783c24e 100644 > --- a/drivers/char/hw_random/st-rng.c > +++ b/drivers/char/hw_random/st-rng.c > @@ -72,7 +72,6 @@ static int st_rng_read(struct hwrng *rng, void *data, > size_t max, bool wait) > static int st_rng_probe(struct platform_device *pdev) > { > struct st_rng_data *ddata; > - struct resource *res; > struct clk *clk; > void __iomem *base; > int ret; > @@ -81,8 +80,7 @@ static int st_rng_probe(struct platform_device *pdev) > if (!ddata) > return -ENOMEM; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - base = devm_ioremap_resource(&pdev->dev, res); > + base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(base)) > return PTR_ERR(base); > Reviewed-by: Patrice Chotard Thanks
Re: ARM: multi_v7_defconfig: Enable SPI_STM32_QSPI support
Hi OLof On 7/30/19 7:36 PM, Olof Johansson wrote: > Hi Patrice, > > If you cc s...@kernel.org on patches you want us to apply, you'll get > them automatically tracked by patchwork. Thanks for the information, i will resubmit it. Patrice > > > -Olof > > On Mon, Jul 29, 2019 at 3:55 PM wrote: >> From: Patrice Chotard >> >> Enable support for QSPI block on STM32 SoCs. >> >> Signed-off-by: Patrice Chotard >> --- >> arch/arm/configs/multi_v7_defconfig | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/arch/arm/configs/multi_v7_defconfig >> b/arch/arm/configs/multi_v7_defconfig >> index 6a40bc2ef271..78d1d93298af 100644 >> --- a/arch/arm/configs/multi_v7_defconfig >> +++ b/arch/arm/configs/multi_v7_defconfig >> @@ -403,6 +403,7 @@ CONFIG_SPI_SH_MSIOF=m >> CONFIG_SPI_SH_HSPI=y >> CONFIG_SPI_SIRF=y >> CONFIG_SPI_STM32=m >> +CONFIG_SPI_STM32_QSPI=m >> CONFIG_SPI_SUN4I=y >> CONFIG_SPI_SUN6I=y >> CONFIG_SPI_TEGRA114=y >> -- >> 2.17.1 >>
Re: [PATCH 1/6] ARM: dts: STi: Switch to SPDX header
Hi Lubomir On 6/11/19 9:29 AM, Lubomir Rintel wrote: > The original license text had a typo ("publishhed") which would be > likely to confuse automated licensing auditing tools. Let's just switch > to SPDX instead of fixing the wording. > > Signed-off-by: Lubomir Rintel > --- > arch/arm/boot/dts/stih407-family.dtsi | 5 + > arch/arm/boot/dts/stih407-pinctrl.dtsi | 5 + > arch/arm/boot/dts/stih407.dtsi | 5 + > arch/arm/boot/dts/stih410-pinctrl.dtsi | 5 + > arch/arm/boot/dts/stih410.dtsi | 5 + > arch/arm/boot/dts/stih418.dtsi | 5 + > 6 files changed, 6 insertions(+), 24 deletions(-) > > diff --git a/arch/arm/boot/dts/stih407-family.dtsi > b/arch/arm/boot/dts/stih407-family.dtsi > index 9e29a4499938..2ff2542bf335 100644 > --- a/arch/arm/boot/dts/stih407-family.dtsi > +++ b/arch/arm/boot/dts/stih407-family.dtsi > @@ -1,10 +1,7 @@ > +// SPDX-License-Identifier: GPL-2.0 > /* > * Copyright (C) 2014 STMicroelectronics Limited. > * Author: Giuseppe Cavallaro > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License version 2 as > - * publishhed by the Free Software Foundation. > */ > #include "stih407-pinctrl.dtsi" > #include > diff --git a/arch/arm/boot/dts/stih407-pinctrl.dtsi > b/arch/arm/boot/dts/stih407-pinctrl.dtsi > index e393519fb84c..db174019626f 100644 > --- a/arch/arm/boot/dts/stih407-pinctrl.dtsi > +++ b/arch/arm/boot/dts/stih407-pinctrl.dtsi > @@ -1,10 +1,7 @@ > +// SPDX-License-Identifier: GPL-2.0 > /* > * Copyright (C) 2014 STMicroelectronics Limited. > * Author: Giuseppe Cavallaro > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License version 2 as > - * publishhed by the Free Software Foundation. > */ > #include "st-pincfg.h" > #include > diff --git a/arch/arm/boot/dts/stih407.dtsi b/arch/arm/boot/dts/stih407.dtsi > index 5b7951ffc350..242ac72e4d4a 100644 > --- a/arch/arm/boot/dts/stih407.dtsi > +++ b/arch/arm/boot/dts/stih407.dtsi > @@ -1,10 +1,7 @@ > +// SPDX-License-Identifier: GPL-2.0 > /* > * Copyright (C) 2015 STMicroelectronics Limited. > * Author: Gabriel Fernandez > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License version 2 as > - * publishhed by the Free Software Foundation. > */ > #include "stih407-clock.dtsi" > #include "stih407-family.dtsi" > diff --git a/arch/arm/boot/dts/stih410-pinctrl.dtsi > b/arch/arm/boot/dts/stih410-pinctrl.dtsi > index 5ae1fd66c0b8..8532ae3f61e8 100644 > --- a/arch/arm/boot/dts/stih410-pinctrl.dtsi > +++ b/arch/arm/boot/dts/stih410-pinctrl.dtsi > @@ -1,10 +1,7 @@ > +// SPDX-License-Identifier: GPL-2.0 > /* > * Copyright (C) 2014 STMicroelectronics Limited. > * Author: Peter Griffin > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License version 2 as > - * publishhed by the Free Software Foundation. > */ > #include "st-pincfg.h" > / { > diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi > index 888548ea9b5c..23b494a13c47 100644 > --- a/arch/arm/boot/dts/stih410.dtsi > +++ b/arch/arm/boot/dts/stih410.dtsi > @@ -1,10 +1,7 @@ > +// SPDX-License-Identifier: GPL-2.0 > /* > * Copyright (C) 2014 STMicroelectronics Limited. > * Author: Peter Griffin > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License version 2 as > - * publishhed by the Free Software Foundation. > */ > #include "stih410-clock.dtsi" > #include "stih407-family.dtsi" > diff --git a/arch/arm/boot/dts/stih418.dtsi b/arch/arm/boot/dts/stih418.dtsi > index 0efb3cd6a86e..f3f0a0e0f23c 100644 > --- a/arch/arm/boot/dts/stih418.dtsi > +++ b/arch/arm/boot/dts/stih418.dtsi > @@ -1,10 +1,7 @@ > +// SPDX-License-Identifier: GPL-2.0 > /* > * Copyright (C) 2014 STMicroelectronics Limited. > * Author: Peter Griffin > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License version 2 as > - * publishhed by the Free Software Foundation. > */ > #include "stih418-clock.dtsi" > #include "stih407-family.dtsi" Acked-by: Patrice Chotard Thanks
Re: [PATCH -next] usb: host: ehci-st: Remove set but not used variable 'ehci'
Hi On 5/28/19 3:45 PM, YueHaibing wrote: > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/usb/host/ehci-st.c: In function st_ehci_platform_probe: > drivers/usb/host/ehci-st.c:155:19: warning: variable ehci set but not used > [-Wunused-but-set-variable] > > It is never used, so can be removed. > > Signed-off-by: YueHaibing > --- > drivers/usb/host/ehci-st.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/usb/host/ehci-st.c b/drivers/usb/host/ehci-st.c > index dc42981047c9..ccb4e611001d 100644 > --- a/drivers/usb/host/ehci-st.c > +++ b/drivers/usb/host/ehci-st.c > @@ -152,7 +152,6 @@ static int st_ehci_platform_probe(struct platform_device > *dev) > struct resource *res_mem; > struct usb_ehci_pdata *pdata = &ehci_platform_defaults; > struct st_ehci_platform_priv *priv; > - struct ehci_hcd *ehci; > int err, irq, clk = 0; > > if (usb_disabled()) > @@ -177,7 +176,6 @@ static int st_ehci_platform_probe(struct platform_device > *dev) > platform_set_drvdata(dev, hcd); > dev->dev.platform_data = pdata; > priv = hcd_to_ehci_priv(hcd); > - ehci = hcd_to_ehci(hcd); > > priv->phy = devm_phy_get(&dev->dev, "usb"); > if (IS_ERR(priv->phy)) { > Acked-by: Patrice Chotard Thanks Patrice
Re: [PATCH -next] usb: host: ohci-st: Remove set but not used variable 'ohci'
Hi On 5/28/19 3:38 PM, YueHaibing wrote: > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/usb/host/ohci-st.c: In function st_ohci_platform_probe: > drivers/usb/host/ohci-st.c:135:19: warning: variable ohci set but not used > [-Wunused-but-set-variable] > > It's never used, so can be removed. > > Signed-off-by: YueHaibing > --- > drivers/usb/host/ohci-st.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/usb/host/ohci-st.c b/drivers/usb/host/ohci-st.c > index 992807c9850a..638a92bd2cdc 100644 > --- a/drivers/usb/host/ohci-st.c > +++ b/drivers/usb/host/ohci-st.c > @@ -132,7 +132,6 @@ static int st_ohci_platform_probe(struct platform_device > *dev) > struct resource *res_mem; > struct usb_ohci_pdata *pdata = &ohci_platform_defaults; > struct st_ohci_platform_priv *priv; > - struct ohci_hcd *ohci; > int err, irq, clk = 0; > > if (usb_disabled()) > @@ -158,7 +157,6 @@ static int st_ohci_platform_probe(struct platform_device > *dev) > platform_set_drvdata(dev, hcd); > dev->dev.platform_data = pdata; > priv = hcd_to_ohci_priv(hcd); > - ohci = hcd_to_ohci(hcd); > > priv->phy = devm_phy_get(&dev->dev, "usb"); > if (IS_ERR(priv->phy)) { > Acked-by: Patrice Chotard Thanks
Re: [PATCH 3/5] pinctrl: st: fix leaked of_node references
Hi Wen On 4/12/19 8:02 AM, Wen Yang wrote: > The call to of_get_child_by_name returns a node pointer with refcount > incremented thus it must be explicitly decremented after the last > usage. > > Detected by coccinelle with the following warnings: > ./drivers/pinctrl/pinctrl-st.c:1188:3-9: ERROR: missing of_node_put; acquired > a node pointer with refcount incremented on line 1175, but without a > corresponding object release within this function. > ./drivers/pinctrl/pinctrl-st.c:1188:3-9: ERROR: missing of_node_put; acquired > a node pointer with refcount incremented on line 1175, but without a > corresponding object release within this function. > ./drivers/pinctrl/pinctrl-st.c:1199:2-8: ERROR: missing of_node_put; acquired > a node pointer with refcount incremented on line 1175, but without a > corresponding object release within this function. > ./drivers/pinctrl/pinctrl-st.c:1199:2-8: ERROR: missing of_node_put; acquired > a node pointer with refcount incremented on line 1175, but without a > corresponding object release within this function. > > Signed-off-by: Wen Yang > Cc: Patrice Chotard > Cc: Linus Walleij > Cc: linux-g...@vger.kernel.org > Cc: linux-kernel@vger.kernel.org (open list) > --- > drivers/pinctrl/pinctrl-st.c | 15 ++- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c > index e66af93..195b442 100644 > --- a/drivers/pinctrl/pinctrl-st.c > +++ b/drivers/pinctrl/pinctrl-st.c > @@ -1170,7 +1170,7 @@ static int st_pctl_dt_parse_groups(struct device_node > *np, > struct property *pp; > struct st_pinconf *conf; > struct device_node *pins; > - int i = 0, npins = 0, nr_props; > + int i = 0, npins = 0, nr_props, ret = 0; > > pins = of_get_child_by_name(np, "st,pins"); > if (!pins) > @@ -1185,7 +1185,8 @@ static int st_pctl_dt_parse_groups(struct device_node > *np, > npins++; > } else { > pr_warn("Invalid st,pins in %pOFn node\n", np); > - return -EINVAL; > + ret = -EINVAL; > + goto out_put_node; > } > } > > @@ -1195,8 +1196,10 @@ static int st_pctl_dt_parse_groups(struct device_node > *np, > grp->pin_conf = devm_kcalloc(info->dev, > npins, sizeof(*conf), GFP_KERNEL); > > - if (!grp->pins || !grp->pin_conf) > - return -ENOMEM; > + if (!grp->pins || !grp->pin_conf) { > + ret = -ENOMEM; > + goto out_put_node; > + } > > /* */ > for_each_property_of_node(pins, pp) { > @@ -1229,9 +1232,11 @@ static int st_pctl_dt_parse_groups(struct device_node > *np, > } > i++; > } > + > +out_put_node: > of_node_put(pins); > > - return 0; > + return ret; > } > > static int st_pctl_parse_functions(struct device_node *np, > Reviewed-by: Patrice Chotard Thanks
Re: [PATCH 19/23] watchdog: st_lpc_wdt: Convert to use device managed functions
Hi Guenter On 4/9/19 7:23 PM, Guenter Roeck wrote: > Use device managed functions to simplify error handling, reduce > source code size, improve readability, and reduce the likelyhood of bugs. > > The conversion was done automatically with coccinelle using the > following semantic patches. The semantic patches and the scripts > used to generate this commit log are available at > https://github.com/groeck/coccinelle-patches > > - Use devm_add_action_or_reset() for calls to clk_disable_unprepare > - Introduce local variable 'struct device *dev' and use it instead of > dereferencing it repeatedly > - Use devm_watchdog_register_driver() to register watchdog device > > Cc: Patrice Chotard > Signed-off-by: Guenter Roeck > --- > drivers/watchdog/st_lpc_wdt.c | 47 > --- > 1 file changed, 26 insertions(+), 21 deletions(-) > > diff --git a/drivers/watchdog/st_lpc_wdt.c b/drivers/watchdog/st_lpc_wdt.c > index 196fb4b72c5d..9a5ed95c3403 100644 > --- a/drivers/watchdog/st_lpc_wdt.c > +++ b/drivers/watchdog/st_lpc_wdt.c > @@ -142,10 +142,16 @@ static struct watchdog_device st_wdog_dev = { > .ops= &st_wdog_ops, > }; > > +static void st_clk_disable_unprepare(void *data) > +{ > + clk_disable_unprepare(data); > +} > + > static int st_wdog_probe(struct platform_device *pdev) > { > + struct device *dev = &pdev->dev; > const struct of_device_id *match; > - struct device_node *np = pdev->dev.of_node; > + struct device_node *np = dev->of_node; > struct st_wdog *st_wdog; > struct regmap *regmap; > struct clk *clk; > @@ -155,7 +161,7 @@ static int st_wdog_probe(struct platform_device *pdev) > > ret = of_property_read_u32(np, "st,lpc-mode", &mode); > if (ret) { > - dev_err(&pdev->dev, "An LPC mode must be provided\n"); > + dev_err(dev, "An LPC mode must be provided\n"); > return -EINVAL; > } > > @@ -163,13 +169,13 @@ static int st_wdog_probe(struct platform_device *pdev) > if (mode != ST_LPC_MODE_WDT) > return -ENODEV; > > - st_wdog = devm_kzalloc(&pdev->dev, sizeof(*st_wdog), GFP_KERNEL); > + st_wdog = devm_kzalloc(dev, sizeof(*st_wdog), GFP_KERNEL); > if (!st_wdog) > return -ENOMEM; > > - match = of_match_device(st_wdog_match, &pdev->dev); > + match = of_match_device(st_wdog_match, dev); > if (!match) { > - dev_err(&pdev->dev, "Couldn't match device\n"); > + dev_err(dev, "Couldn't match device\n"); > return -ENODEV; > } > st_wdog->syscfg = (struct st_wdog_syscfg *)match->data; > @@ -180,17 +186,17 @@ static int st_wdog_probe(struct platform_device *pdev) > > regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); > if (IS_ERR(regmap)) { > - dev_err(&pdev->dev, "No syscfg phandle specified\n"); > + dev_err(dev, "No syscfg phandle specified\n"); > return PTR_ERR(regmap); > } > > - clk = devm_clk_get(&pdev->dev, NULL); > + clk = devm_clk_get(dev, NULL); > if (IS_ERR(clk)) { > - dev_err(&pdev->dev, "Unable to request clock\n"); > + dev_err(dev, "Unable to request clock\n"); > return PTR_ERR(clk); > } > > - st_wdog->dev= &pdev->dev; > + st_wdog->dev= dev; > st_wdog->base = base; > st_wdog->clk= clk; > st_wdog->regmap = regmap; > @@ -198,39 +204,40 @@ static int st_wdog_probe(struct platform_device *pdev) > st_wdog->clkrate= clk_get_rate(st_wdog->clk); > > if (!st_wdog->clkrate) { > - dev_err(&pdev->dev, "Unable to fetch clock rate\n"); > + dev_err(dev, "Unable to fetch clock rate\n"); > return -EINVAL; > } > st_wdog_dev.max_timeout = 0x / st_wdog->clkrate; > - st_wdog_dev.parent = &pdev->dev; > + st_wdog_dev.parent = dev; > > ret = clk_prepare_enable(clk); > if (ret) { > - dev_err(&pdev->dev, "Unable to enable clock\n"); > + dev_err(dev, "Unable to enable clock\n"); > return ret; > } > + ret = devm_add_action_or_reset(dev, st_clk_disable_unprepare, clk); > + if (ret) > +
Re: [PATCH] watchdog: Convert to use devm_platform_ioremap_resource
Hi On 4/2/19 9:01 PM, Guenter Roeck wrote: > Use devm_platform_ioremap_resource to reduce source code size, > improve readability, and reduce the likelyhood of bugs. > > The conversion was done automatically with coccinelle using the > following semantic patch. > > @r@ > identifier res, pdev; > expression a; > expression index; > expression e; > @@ > > <+... > - res = platform_get_resource(pdev, IORESOURCE_MEM, index); > - a = devm_ioremap_resource(e, res); > + a = devm_platform_ioremap_resource(pdev, index); > ...+> > > @depends on r@ > identifier r.res; > @@ > - struct resource *res; > ... when != res > > @@ > identifier res, pdev; > expression index; > expression a; > @@ > - struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, index); > - a = devm_ioremap_resource(&pdev->dev, res); > + a = devm_platform_ioremap_resource(pdev, index); > > Cc: Joel Stanley > Cc: Nicolas Ferre > Cc: Alexandre Belloni > Cc: Florian Fainelli > Cc: Linus Walleij > Cc: Baruch Siach > Cc: Keguang Zhang > Cc: Vladimir Zapolskiy > Cc: Kevin Hilman > Cc: Matthias Brugger > Cc: Avi Fishman > Cc: Nancy Yuen > Cc: Brendan Higgins > Cc: Wan ZongShun > Cc: Michal Simek > Cc: Sylvain Lemieux > Cc: Kukjin Kim > Cc: Barry Song > Cc: Orson Zhai > Cc: Patrice Chotard > Cc: Maxime Coquelin > Cc: Maxime Ripard > Cc: Chen-Yu Tsai > Cc: Marc Gonzalez > Cc: Thierry Reding > Cc: Shawn Guo > Signed-off-by: Guenter Roeck > --- > drivers/watchdog/st_lpc_wdt.c | 4 +--- For st_lpc_wdt Acked-by: Patrice Chotard Thanks
Re: [PATCH] USB: dwc3: add missing of_node_put()
Hi Wen On 2/3/19 4:52 AM, wen yang wrote: > The call to of_find_node_by_name returns a node pointer with refcount > incremented thus it must be explicitly decremented here after the last > usage. > The of_find_device_by_node() takes a reference to the underlying device > structure, we also should release that reference. > This patch fixes those 2 issues. > > Signed-off-by: Wen Yang > Cc: Patrice Chotard > Cc: Felipe Balbi > Cc: Greg Kroah-Hartman > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-...@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > --- > drivers/usb/dwc3/dwc3-st.c | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c > index 1608138..fdd90d2 100644 > --- a/drivers/usb/dwc3/dwc3-st.c > +++ b/drivers/usb/dwc3/dwc3-st.c > @@ -262,17 +262,18 @@ static int st_dwc3_probe(struct platform_device *pdev) > ret = of_platform_populate(node, NULL, NULL, dev); > if (ret) { > dev_err(dev, "failed to add dwc3 core\n"); > - goto undo_softreset; > + goto put_node; > } > > child_pdev = of_find_device_by_node(child); > if (!child_pdev) { > dev_err(dev, "failed to find dwc3 core device\n"); > ret = -ENODEV; > - goto undo_softreset; > + goto put_node; > } > > dwc3_data->dr_mode = usb_get_dr_mode(&child_pdev->dev); > + put_device(&child_pdev->dev); > > /* >* Configure the USB port as device or host according to the static > @@ -283,15 +284,18 @@ static int st_dwc3_probe(struct platform_device *pdev) > ret = st_dwc3_drd_init(dwc3_data); > if (ret) { > dev_err(dev, "drd initialisation failed\n"); > - goto undo_softreset; > + goto put_node; > } > > /* ST glue logic init */ > st_dwc3_init(dwc3_data); > > platform_set_drvdata(pdev, dwc3_data); > + of_node_put(child); > return 0; > > +put_node: > + of_node_put(child); > undo_softreset: > reset_control_assert(dwc3_data->rstc_rst); > undo_powerdown: > Reviewed-by: Patrice Chotard Thanks
Re: [PATCH] phy: Variable "val" in function miphy_osc_is_ready() could be uninitialized
Hi Yizhuo On 2/6/19 4:30 AM, Yizhuo wrote: > In function miphy_osc_is_ready(), local variable "val" > could be uninitalized. if function regmap_read() returns > -EINVAL. However, this value is used in if statement. > This is potentially unsafe. > > Signed-off-by: Yizhuo > --- > drivers/phy/st/phy-miphy28lp.c | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/phy/st/phy-miphy28lp.c b/drivers/phy/st/phy-miphy28lp.c > index 213e2e15339c..40c7c0a611a0 100644 > --- a/drivers/phy/st/phy-miphy28lp.c > +++ b/drivers/phy/st/phy-miphy28lp.c > @@ -835,7 +835,8 @@ static int miphy_osc_is_ready(struct miphy28lp_phy > *miphy_phy) > { > struct miphy28lp_dev *miphy_dev = miphy_phy->phydev; > unsigned long finish = jiffies + 5 * HZ; > - u32 val; > + u32 val = 0; > + int ret; > > if (!miphy_phy->osc_rdy) > return 0; > @@ -844,8 +845,10 @@ static int miphy_osc_is_ready(struct miphy28lp_phy > *miphy_phy) > return -EINVAL; > > do { > - regmap_read(miphy_dev->regmap, > + ret = regmap_read(miphy_dev->regmap, > miphy_phy->syscfg_reg[SYSCFG_STATUS], &val); > + if (ret) > + return ret; > > if ((val & MIPHY_OSC_RDY) != MIPHY_OSC_RDY) > cpu_relax(); > Reviewed-by: Patrice Chotard Thanks
Re: [PATCH] dmaengine: st_fdma: use struct_size() in kzalloc()
Hi Gustavo On 1/4/19 7:43 PM, Gustavo A. R. Silva wrote: > One of the more common cases of allocation size calculations is finding the > size of a structure that has a zero-sized array at the end, along with memory > for some number of elements for that array. For example: > > struct foo { > int stuff; > void *entry[]; > }; > > instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL); > > Instead of leaving these open-coded and prone to type mistakes, we can now > use the new struct_size() helper: > > instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL); > > This code was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva > --- > drivers/dma/st_fdma.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c > index 07c20aa2e955..df6b73028ecb 100644 > --- a/drivers/dma/st_fdma.c > +++ b/drivers/dma/st_fdma.c > @@ -243,8 +243,7 @@ static struct st_fdma_desc *st_fdma_alloc_desc(struct > st_fdma_chan *fchan, > struct st_fdma_desc *fdesc; > int i; > > - fdesc = kzalloc(sizeof(*fdesc) + > - sizeof(struct st_fdma_sw_node) * sg_len, GFP_NOWAIT); > + fdesc = kzalloc(struct_size(fdesc, node, sg_len), GFP_NOWAIT); > if (!fdesc) > return NULL; > > Acked-by: Patrice Chotard Thanks
[GIT PULL] STi SoC update for v4.21 round 1
Hi Arnd, Olof, Kevin Please find STi SoC update for v4.21 round 1: The following changes since commit 651022382c7f8da46cb4872a545ee1da6d097d2a: Linux 4.20-rc1 (2018-11-04 15:37:52 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti.git tags/sti-soc-for-v4.21-round1 for you to fetch changes up to 704cfd7f5f71c6bc6cdfaa63a16ed0f72882b1a1: ARM: sti: remove pen_release and boot_lock (2018-12-20 14:32:15 +0100) Highlights: --- - Following pen_release and boot_lock cleanup initiated by Russell King, .smp_prepare_cpus and .smp_boot_secondary STi callbacks must be reworked to keep secondary CPU's bringup. Patrice Chotard (1): ARM: sti: remove pen_release and boot_lock arch/arm/mach-sti/Makefile | 2 +- arch/arm/mach-sti/headsmp.S | 43 -- arch/arm/mach-sti/platsmp.c | 88 - 3 files changed, 15 insertions(+), 118 deletions(-) delete mode 100644 arch/arm/mach-sti/headsmp.S
Re: [PATCH 1/1] ARM: STi: Restore secondary CPU's bringup
On 12/19/18 12:28 PM, Russell King - ARM Linux wrote: > On Wed, Dec 19, 2018 at 10:31:35AM +0000, Patrice CHOTARD wrote: >> Hi Russell >> >> On 12/18/18 6:27 PM, Russell King - ARM Linux wrote: >>> On Tue, Dec 18, 2018 at 05:05:18PM +, Patrice CHOTARD wrote: >>>> Hi Russell >>>> >>>> On 12/18/18 4:52 PM, Russell King - ARM Linux wrote: >>>>> On Tue, Dec 18, 2018 at 03:48:13PM +0100, patrice.chot...@st.com wrote: >>>>>> From: Patrice Chotard >>>>>> >>>>>> Due to pen_release and boot_lock removal, secondary CPU's bringup >>>>>> was broken. Restore CPU's bringup by reworking properly >>>>>> .smp_prepare_cpus and .smp_boot_secondary STi callbacks. >>>>> >>>>> Sorry, maybe I don't understand your commit message, but you seem to be >>>>> saying that removal of the pen_release and boot_lock broke STi's secondary >>>>> CPU bring up? Please clarify, and explain how that happened. >>>> >>>> Correct, CPU1 failed to come online. >>>> >>>> It seems that writing secondary_startup address at cpu-release-addr in >>>> .smp_prepare_cpus callback was too early. >>>> >>>> Doing it in .smp_boot_secondary callback, insures that secondary_data >>>> struct is populated in __cpu_up() (stack, pgdir and swapper_pg_dir fields). >>> >>> Ah, you're saying that it causes the CPU to jump to secondary_startup >>> while the boot CPU is in smp_prepare_cpus()? What triggers the CPU >> >> Yes >> >>> to jump to the address written to cpu_strt_ptr? What you're saying >>> seems to suggest that it's the write to that address, rather than the >>> IPI that's sent in sti_boot_secondary(). >> >> At platform startup, an U-Bootrom firmware initialize secondary CPU and >> make it spinning waiting for a jump address to be written at cpu_strt_ptr. >> >> I didn't pay attention to the IPI, you are right IPI is useless, i will >> remove it. > > Okay, in that case may I suggest an alternative to taking my patch > which will break this, and then fixing it in a subsequent patch - > please merge the two patches together so it becomes one "clean up" > patch which doesn't cause any breakage. > > Thanks. > Ok, agree with your proposal. I will squash our 2 patches. Thanks Patrice
Re: [PATCH 1/1] ARM: STi: Restore secondary CPU's bringup
Hi Russell On 12/18/18 6:27 PM, Russell King - ARM Linux wrote: > On Tue, Dec 18, 2018 at 05:05:18PM +0000, Patrice CHOTARD wrote: >> Hi Russell >> >> On 12/18/18 4:52 PM, Russell King - ARM Linux wrote: >>> On Tue, Dec 18, 2018 at 03:48:13PM +0100, patrice.chot...@st.com wrote: >>>> From: Patrice Chotard >>>> >>>> Due to pen_release and boot_lock removal, secondary CPU's bringup >>>> was broken. Restore CPU's bringup by reworking properly >>>> .smp_prepare_cpus and .smp_boot_secondary STi callbacks. >>> >>> Sorry, maybe I don't understand your commit message, but you seem to be >>> saying that removal of the pen_release and boot_lock broke STi's secondary >>> CPU bring up? Please clarify, and explain how that happened. >> >> Correct, CPU1 failed to come online. >> >> It seems that writing secondary_startup address at cpu-release-addr in >> .smp_prepare_cpus callback was too early. >> >> Doing it in .smp_boot_secondary callback, insures that secondary_data >> struct is populated in __cpu_up() (stack, pgdir and swapper_pg_dir fields). > > Ah, you're saying that it causes the CPU to jump to secondary_startup > while the boot CPU is in smp_prepare_cpus()? What triggers the CPU Yes > to jump to the address written to cpu_strt_ptr? What you're saying > seems to suggest that it's the write to that address, rather than the > IPI that's sent in sti_boot_secondary(). At platform startup, an U-Bootrom firmware initialize secondary CPU and make it spinning waiting for a jump address to be written at cpu_strt_ptr. I didn't pay attention to the IPI, you are right IPI is useless, i will remove it. > > If the IPI in sti_boot_secondary() isn't doing anything, it ought to > be removed. It'd also be a good idea to document what's going on as > comments in the code for future maintanence. Agree, i will add a comment. Thanks Patrice > >> If you are ok, i will pick up your patch [1] and this one to prepare a >> STi pull-request. > > Yes, although I'll have to delay patch 9 as a result. >
Re: [PATCH 1/1] ARM: STi: Restore secondary CPU's bringup
Hi Russell On 12/18/18 4:52 PM, Russell King - ARM Linux wrote: > On Tue, Dec 18, 2018 at 03:48:13PM +0100, patrice.chot...@st.com wrote: >> From: Patrice Chotard >> >> Due to pen_release and boot_lock removal, secondary CPU's bringup >> was broken. Restore CPU's bringup by reworking properly >> .smp_prepare_cpus and .smp_boot_secondary STi callbacks. > > Sorry, maybe I don't understand your commit message, but you seem to be > saying that removal of the pen_release and boot_lock broke STi's secondary > CPU bring up? Please clarify, and explain how that happened. Correct, CPU1 failed to come online. It seems that writing secondary_startup address at cpu-release-addr in .smp_prepare_cpus callback was too early. Doing it in .smp_boot_secondary callback, insures that secondary_data struct is populated in __cpu_up() (stack, pgdir and swapper_pg_dir fields). If you are ok, i will pick up your patch [1] and this one to prepare a STi pull-request. Thanks Patrice [1] https://patchwork.kernel.org/patch/10729479/ > > Thanks. > >> >> Signed-off-by: Patrice Chotard >> --- >> arch/arm/mach-sti/platsmp.c | 31 --- >> 1 file changed, 16 insertions(+), 15 deletions(-) >> >> diff --git a/arch/arm/mach-sti/platsmp.c b/arch/arm/mach-sti/platsmp.c >> index 2166850..9bfc93a 100644 >> --- a/arch/arm/mach-sti/platsmp.c >> +++ b/arch/arm/mach-sti/platsmp.c >> @@ -28,8 +28,21 @@ >> >> #include "smp.h" >> >> +static u32 __iomem *cpu_strt_ptr; >> + >> static int sti_boot_secondary(unsigned int cpu, struct task_struct *idle) >> { >> +unsigned long entry_pa = __pa_symbol(secondary_startup); >> + >> +__raw_writel(entry_pa, cpu_strt_ptr); >> + >> +/* >> + * wmb so that data is actually written >> + * before cache flush is done >> + */ >> +smp_wmb(); >> +sync_cache_w(cpu_strt_ptr); >> + >> /* >> * Send the secondary CPU a soft interrupt, thereby causing >> * it to jump to the secondary entrypoint. >> @@ -43,10 +56,8 @@ static void __init sti_smp_prepare_cpus(unsigned int >> max_cpus) >> { >> struct device_node *np; >> void __iomem *scu_base; >> -u32 __iomem *cpu_strt_ptr; >> u32 release_phys; >> int cpu; >> -unsigned long entry_pa = __pa_symbol(secondary_startup); >> >> np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); >> >> @@ -74,8 +85,8 @@ static void __init sti_smp_prepare_cpus(unsigned int >> max_cpus) >> } >> >> /* >> - * holding pen is usually configured in SBC DMEM but can also be >> - * in RAM. >> + * cpu-release-addr is usually configured in SBC DMEM but can >> + * also be in RAM. >> */ >> >> if (!memblock_is_memory(release_phys)) >> @@ -85,17 +96,7 @@ static void __init sti_smp_prepare_cpus(unsigned int >> max_cpus) >> cpu_strt_ptr = >> (u32 __iomem *)phys_to_virt(release_phys); >> >> -__raw_writel(entry_pa, cpu_strt_ptr); >> - >> -/* >> - * wmb so that data is actually written >> - * before cache flush is done >> - */ >> -smp_wmb(); >> -sync_cache_w(cpu_strt_ptr); >> - >> -if (!memblock_is_memory(release_phys)) >> -iounmap(cpu_strt_ptr); >> +set_cpu_possible(cpu, true); >> } >> } >> >> -- >> 1.9.1 >> >
[GIT PULL] STi DT update for v4.20 round 1
Hi Arnd, Kevin, Olof PLease consider this first round of STi dts update for v4.20 The following changes since commit 5b394b2ddf0347bef56e50c69a58773c94343ff3: Linux 4.19-rc1 (2018-08-26 14:11:59 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti.git tags/sti-dt-for-v4.20-round1 for you to fetch changes up to b5b4c8dd5c44edc112a362f87a8d8953336571bd: ARM: dts: stih410: change syntax of multiple DAI (2018-09-25 17:41:51 +0200) STi DT update: _ Change syntax of multiple DAI links Christophe Priouzeau (1): ARM: dts: stih410: change syntax of multiple DAI arch/arm/boot/dts/stih410-b2260.dts | 5 - arch/arm/boot/dts/stihxxx-b2120.dtsi | 11 --- 2 files changed, 12 insertions(+), 4 deletions(-)
Re: [PATCH] pinctrl: Convert to using %pOFn instead of device_node.name
Hi Rob On 08/28/2018 03:52 AM, Rob Herring wrote: > In preparation to remove the node name pointer from struct device_node, > convert printf users to use the %pOFn format specifier. > > Cc: Linus Walleij > Cc: Dong Aisheng > Cc: Fabio Estevam > Cc: Shawn Guo > Cc: Stefan Agner > Cc: Pengutronix Kernel Team > Cc: Sean Wang > Cc: Matthias Brugger > Cc: Carlo Caione > Cc: Kevin Hilman > Cc: Jason Cooper > Cc: Andrew Lunn > Cc: Gregory Clement > Cc: Sebastian Hesselbarth > Cc: Jean-Christophe Plagniol-Villard > Cc: Nicolas Ferre > Cc: Alexandre Belloni > Cc: Heiko Stuebner > Cc: Tony Lindgren > Cc: Haojian Zhuang > Cc: Patrice Chotard > Cc: Barry Song > Cc: Maxime Coquelin > Cc: Alexandre Torgue > Cc: Maxime Ripard > Cc: Chen-Yu Tsai > Cc: linux-g...@vger.kernel.org > Cc: linux-media...@lists.infradead.org > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-amlo...@lists.infradead.org > Cc: linux-rockc...@lists.infradead.org > Cc: linux-o...@vger.kernel.org > Signed-off-by: Rob Herring > --- > drivers/pinctrl/berlin/berlin.c | 6 ++-- > drivers/pinctrl/freescale/pinctrl-imx.c | 7 ++-- > drivers/pinctrl/freescale/pinctrl-imx1-core.c | 12 +++ > drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 +-- > drivers/pinctrl/meson/pinctrl-meson.c | 2 +- > drivers/pinctrl/mvebu/pinctrl-mvebu.c | 4 +-- > drivers/pinctrl/nomadik/pinctrl-nomadik.c | 6 ++-- > drivers/pinctrl/pinctrl-at91.c| 8 ++--- > drivers/pinctrl/pinctrl-lantiq.c | 8 ++--- > drivers/pinctrl/pinctrl-rockchip.c| 8 ++--- > drivers/pinctrl/pinctrl-rza1.c| 8 ++--- > drivers/pinctrl/pinctrl-single.c | 32 +-- > drivers/pinctrl/pinctrl-st.c | 6 ++-- > drivers/pinctrl/sirf/pinctrl-atlas7.c | 4 +-- > drivers/pinctrl/stm32/pinctrl-stm32.c | 4 +-- > drivers/pinctrl/sunxi/pinctrl-sunxi.c | 8 ++--- > drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 8 ++--- > 17 files changed, 66 insertions(+), 69 deletions(-) > > diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c > index 0966bb0bf71f..e66af93f2cbf 100644 > --- a/drivers/pinctrl/pinctrl-st.c > +++ b/drivers/pinctrl/pinctrl-st.c > @@ -817,8 +817,8 @@ static int st_pctl_dt_node_to_map(struct pinctrl_dev > *pctldev, > > grp = st_pctl_find_group_by_name(info, np->name); > if (!grp) { > - dev_err(info->dev, "unable to find group for node %s\n", > - np->name); > + dev_err(info->dev, "unable to find group for node %pOFn\n", > + np); > return -EINVAL; > } > > @@ -1184,7 +1184,7 @@ static int st_pctl_dt_parse_groups(struct device_node > *np, > if (pp->length / sizeof(__be32) >= OF_GPIO_ARGS_MIN) { > npins++; > } else { > - pr_warn("Invalid st,pins in %s node\n", np->name); > + pr_warn("Invalid st,pins in %pOFn node\n", np); > return -EINVAL; > } > } For pinctrl-st: Acked-by: Patrice Chotard Thanks Patrice
Re: [PATCH v2 3/3] ARM: dts: stm32: Fix DT dtc warnings for stm32f4
Hi Rob On 08/07/2018 04:08 PM, Rob Herring wrote: > On Tue, Aug 7, 2018 at 6:55 AM wrote: >> >> From: Patrice Chotard >> >> Fix the following DT dtc warnings for stm32f429 and >> stm32f469 boards: >> >> Warning (node_name_chars_strict): /soc/pin-controller/usbotg_fs@0: Character >> '_' not recommended in node name >> Warning (node_name_chars_strict): /soc/pin-controller/usbotg_fs@1: Character >> '_' not recommended in node name >> Warning (node_name_chars_strict): /soc/pin-controller/usbotg_hs@0: Character >> '_' not recommended in node name >> Warning (node_name_chars_strict): /soc/pin-controller/sdio_pins@0: Character >> '_' not recommended in node name >> Warning (node_name_chars_strict): /soc/pin-controller/sdio_pins_od@0: >> Character '_' not recommended in node name >> Warning (node_name_chars_strict): /gpio_keys: Character '_' not recommended >> in node name >> Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, >> but no unit name >> Warning (unit_address_vs_reg): /soc/pin-controller: node has a reg or ranges >> property, but no unit name >> Warning (unit_address_vs_reg): /soc/pin-controller/usart1@0: node has a unit >> name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/usart3@0: node has a unit >> name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/usbotg_fs@0: node has a >> unit name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/usbotg_fs@1: node has a >> unit name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/usbotg_hs@0: node has a >> unit name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/mii@0: node has a unit >> name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/adc@200: node has a unit >> name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/pwm@1: node has a unit >> name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/pwm@3: node has a unit >> name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/i2c1@0: node has a unit >> name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/ltdc@0: node has a unit >> name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/dcmi@0: node has a unit >> name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/sdio_pins@0: node has a >> unit name, but no reg property >> Warning (unit_address_vs_reg): /soc/pin-controller/sdio_pins_od@0: node has >> a unit name, but no reg property >> Warning (unit_address_vs_reg): /gpio_keys/button@0: node has a unit name, >> but no reg property >> Warning (avoid_unnecessary_addr_size): /gpio_keys: unnecessary >> #address-cells/#size-cells without "ranges" or child "reg" property >> >> Signed-off-by: Patrice Chotard >> --- >> Change since v1: >> - update nodes name as following: @0 to -0 >> >> >> arch/arm/boot/dts/stm32429i-eval.dts | 11 +++-- >> arch/arm/boot/dts/stm32f4-pinctrl.dtsi | 30 ++--- >> arch/arm/boot/dts/stm32f429-disco.dts| 7 ++- >> arch/arm/boot/dts/stm32f429-pinctrl.dtsi | 74 >> +++ >> arch/arm/boot/dts/stm32f429.dtsi | 8 ++-- >> arch/arm/boot/dts/stm32f469-disco.dts| 11 +++-- >> arch/arm/boot/dts/stm32f469-pinctrl.dtsi | 76 >> +++- >> 7 files changed, 102 insertions(+), 115 deletions(-) >> >> diff --git a/arch/arm/boot/dts/stm32429i-eval.dts >> b/arch/arm/boot/dts/stm32429i-eval.dts >> index 7eb786a2d624..116232b589e4 100644 >> --- a/arch/arm/boot/dts/stm32429i-eval.dts >> +++ b/arch/arm/boot/dts/stm32429i-eval.dts >> @@ -60,7 +60,7 @@ >> stdout-path = "serial0:115200n8"; >> }; >> >> - memory { >> + memory@0 { >> reg = <0x 0x200>; >> }; >> >> @@ -111,17 +111,16 @@ >> }; >> }; >> >> - gpio_keys { >> + gpio-keys { >> compatible = "gpio-keys"; >> - #address-cells = <1>; >> #size-cells = <0>; > > Think you forgot this line. You are right, i will remove it > >>
Re: [PATCH 1/3] ARM: dts: stm32: Fix DT dtc warnings for stm32h7
I will send a v2 Thanks for reviewing ;-) Patrice On 08/07/2018 01:56 PM, Alexandre Torgue wrote: > Hi Patrice > > On 08/07/2018 01:38 PM, Alexandre Torgue wrote: >>> + #address-cells = <1>; >>> + #size-cells = <1>; >>> + >>> clocks { >>> clk_hse: clk-hse { >>> #clock-cells = <0>; >>> @@ -60,7 +62,7 @@ >>> clock-frequency = <32768>; >>> }; >>> - clk_i2s: i2s_ckin { >>> + clk_i2s: i2s-ckin { >> >> clock driver deals with "i2s_ckin" for clock source selection. I need >> to check deeper if this change could cause an issue. > > Sorry I didn't check in the well driver. As far I can see it's ok for > this part of patch. > > cheers > Alex > >> >> thx >> Alex
Re: [U-BOOT internal] ARM: dts: stm32: Add clk-lse node's label on stm32f429
Sorry, don't take care about this patch, it was send using the wrong script Patrice On 07/19/2018 03:10 PM, patrice.chot...@st.com wrote: > From: Patrice Chotard > > Add missing clk_lse label for node clk-lse. > > Signed-off-by: Patrice Chotard > --- > arch/arm/boot/dts/stm32f429.dtsi | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/boot/dts/stm32f429.dtsi > b/arch/arm/boot/dts/stm32f429.dtsi > index ede77e0f1c41..64278e81bc08 100644 > --- a/arch/arm/boot/dts/stm32f429.dtsi > +++ b/arch/arm/boot/dts/stm32f429.dtsi > @@ -58,7 +58,7 @@ > clock-frequency = <0>; > }; > > - clk-lse { > + clk_lse: clk-lse { > #clock-cells = <0>; > compatible = "fixed-clock"; > clock-frequency = <32768>; >
Re: [PATCH V2] ARM: STi: warn if scu mapping fails
Hi Nicholas On 07/16/2018 03:46 PM, Nicholas Mc Guire wrote: > If the device node is not found or the of_iomap() failed, calling > scu_enable would not be safe and could lead to an undefined system > state. So warn in both failure paths before returning. > > Signed-off-by: Nicholas Mc Guire > Link: http://lkml.org/lkml/2018/7/16/219 > Fixes: commit 65ebcc115889 ("ARM: sti: Add STiH415 SOC support") > --- > > V2: replacement of WARN_ON() by a meaningful pr_err as suggested by > Patrice CHOTARD . > > Problem was found by an experimental coccinelle script > > Patch was compile tested with: multi_v7_defconfig (implies > CONFIG_ARCH_STI=y, CONFIG_SMP=y) > (with one sparse warning unrelated to the proposed change) > > Patch is against 4.18-rc4 (localversion-next is next-20180716) > > arch/arm/mach-sti/platsmp.c | 18 ++ > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/mach-sti/platsmp.c b/arch/arm/mach-sti/platsmp.c > index 231f19e..530e9a5 100644 > --- a/arch/arm/mach-sti/platsmp.c > +++ b/arch/arm/mach-sti/platsmp.c > @@ -107,12 +107,22 @@ static void __init sti_smp_prepare_cpus(unsigned int > max_cpus) > > np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); > > - if (np) { > - scu_base = of_iomap(np, 0); > - scu_enable(scu_base); > - of_node_put(np); > + if (!np) { > + pr_err("SCU not found at %s:%s():%d\n", > +__FILE__, __func__, __LINE__); > + return; > } > > + scu_base = of_iomap(np, 0); > + of_node_put(np); > + if (!scu_base) { > + pr_err("SCU remap failed at %s:%s():%d\n", > + __FILE__, __func__, __LINE__); > + return; > + } > + > + scu_enable(scu_base); > + > if (max_cpus <= 1) > return; > > Acked-by: Patrice Chotard Patrice
Re: [PATCH] ARM: STi: at least warn if of_iomap fails
Hi Nicholas On 07/12/2018 05:48 PM, Nicholas Mc Guire wrote: > The call to of_iomap() is unchecked but scu_enable(), which the returned > address is passed on to, assumes a valid mapping. If the mapping is > invalid this could probably lead to undefined system state so at least > a warning should be issued. > > Signed-off-by: Nicholas Mc Guire > Fixes: commit 65ebcc115889 ("ARM: sti: Add STiH415 SOC support") > --- > Problem was found by an experimental coccinelle script > > Patch was compile tested with: multi_v7_defconfig (implies > CONFIG_ARCH_STI=y, CONFIG_SMP=y) > > Patch is against 4.18-rc3 (localversion-next is next-20180712) > > arch/arm/mach-sti/platsmp.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/mach-sti/platsmp.c b/arch/arm/mach-sti/platsmp.c > index 231f19e..89ae76f 100644 > --- a/arch/arm/mach-sti/platsmp.c > +++ b/arch/arm/mach-sti/platsmp.c > @@ -109,6 +109,7 @@ static void __init sti_smp_prepare_cpus(unsigned int > max_cpus) > > if (np) { > scu_base = of_iomap(np, 0); > + WARN_ON(!scu_base); > scu_enable(scu_base); > of_node_put(np); > } > I should prefer to exit with an error to avoid unpredictable behavior, something like this is better : scu_base = of_iomap(np, 0); of_node_put(np); if (!scu_base) { pr_err("No SCU remap\n"); return; } scu_enable(scu_base); Thanks
Re: [PATCH] mmc: sdhci-*: Don't emit error msg if sdhci_add_host() fails
gt; goto disable_clk; > - } > > platform_set_drvdata(pdev, host); > > diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c > index c32daed0d418..8f95647195d9 100644 > --- a/drivers/mmc/host/sdhci-st.c > +++ b/drivers/mmc/host/sdhci-st.c > @@ -422,10 +422,8 @@ static int sdhci_st_probe(struct platform_device *pdev) > st_mmcss_cconfig(np, host); > > ret = sdhci_add_host(host); > - if (ret) { > - dev_err(&pdev->dev, "Failed sdhci_add_host\n"); > + if (ret) > goto err_out; > - } > > host_version = readw_relaxed((host->ioaddr + SDHCI_HOST_VERSION)); > > For drivers/mmc/host/sdhci-st.c: Acked-by: Patrice Chotard Thanks
Re: [PATCH v2] rtc: st-lpc: add range
Hi Alexandre On 05/21/2018 10:49 PM, Alexandre Belloni wrote: > The RTC has a 64 bit counter. > > Signed-off-by: Alexandre Belloni > --- > drivers/rtc/rtc-st-lpc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c > index 2f1ef2c28740..bee75ca7ff79 100644 > --- a/drivers/rtc/rtc-st-lpc.c > +++ b/drivers/rtc/rtc-st-lpc.c > @@ -258,6 +258,8 @@ static int st_rtc_probe(struct platform_device *pdev) > platform_set_drvdata(pdev, rtc); > > rtc->rtc_dev->ops = &st_rtc_ops; > + rtc->rtc_dev->range_max = U64_MAX; > + do_div(rtc->rtc_dev->range_max, rtc->clkrate); > > ret = rtc_register_device(rtc->rtc_dev); > if (ret) { > Acked-by: Patrice Chotard Patrice
Re: [PATCH 1/2] rtc: st-lpc: fix possible race condition
Hi Alexandre On 05/20/2018 02:33 PM, Alexandre Belloni wrote: > The IRQ is requested before the struct rtc is allocated and registered, but > this struct is used in the IRQ handler. This may lead to a NULL pointer > dereference. > > Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc > before requesting the IRQ. > > Signed-off-by: Alexandre Belloni > --- > drivers/rtc/rtc-st-lpc.c | 24 +--- > 1 file changed, 9 insertions(+), 15 deletions(-) > > diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c > index d5222667f892..2f1ef2c28740 100644 > --- a/drivers/rtc/rtc-st-lpc.c > +++ b/drivers/rtc/rtc-st-lpc.c > @@ -212,6 +212,10 @@ static int st_rtc_probe(struct platform_device *pdev) > if (!rtc) > return -ENOMEM; > > + rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev); > + if (IS_ERR(rtc->rtc_dev)) > + return PTR_ERR(rtc->rtc_dev); > + > spin_lock_init(&rtc->lock); > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > @@ -253,26 +257,17 @@ static int st_rtc_probe(struct platform_device *pdev) > > platform_set_drvdata(pdev, rtc); > > - rtc->rtc_dev = rtc_device_register("st-lpc-rtc", &pdev->dev, > -&st_rtc_ops, THIS_MODULE); > - if (IS_ERR(rtc->rtc_dev)) { > + rtc->rtc_dev->ops = &st_rtc_ops; > + > + ret = rtc_register_device(rtc->rtc_dev); > + if (ret) { > clk_disable_unprepare(rtc->clk); > - return PTR_ERR(rtc->rtc_dev); > + return ret; > } > > return 0; > } > > -static int st_rtc_remove(struct platform_device *pdev) > -{ > - struct st_rtc *rtc = platform_get_drvdata(pdev); > - > - if (likely(rtc->rtc_dev)) > - rtc_device_unregister(rtc->rtc_dev); > - > - return 0; > -} > - > #ifdef CONFIG_PM_SLEEP > static int st_rtc_suspend(struct device *dev) > { > @@ -325,7 +320,6 @@ static struct platform_driver st_rtc_platform_driver = { > .of_match_table = st_rtc_match, > }, > .probe = st_rtc_probe, > - .remove = st_rtc_remove, > }; > > module_platform_driver(st_rtc_platform_driver); > Acked-by: Patrice Chotard Thanks Patrice
[GIT PULL] STi DT update for v4.18 round 1
Hi Arnd, Kevin, Olof PLease consider this first round of STi dts update for v4.18 The following changes since commit 60cc43fc888428bb2f18f08997432d426a243338: Linux 4.17-rc1 (2018-04-15 18:24:20 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti.git tags/sti-dt-for-v4.18-round1 for you to fetch changes up to c5bf208a0dc4aee18e03c6ed97eada70ffa9a4d8: ARM: dts: stihxxx-b2120: Fix complain about IRQ_TYPE_NONE usage (2018-05-14 17:40:26 +0200) STi DT update for 4.18: - Fix complain about IRQ_TYPE_NONE_usage Patrice Chotard (5): ARM: dts: stih407-family: Fix complain about IRQ_TYPE_NONE usage ARM: dts: stih407-pinctrl: Fix complain about IRQ_TYPE_NONE usage ARM: dts: stih407: Fix complain about IRQ_TYPE_NONE usage ARM: dts: stih410: Fix complain about IRQ_TYPE_NONE usage ARM: dts: stihxxx-b2120: Fix complain about IRQ_TYPE_NONE usage arch/arm/boot/dts/stih407-family.dtsi | 52 +- arch/arm/boot/dts/stih407-pinctrl.dtsi | 10 +++ arch/arm/boot/dts/stih407.dtsi | 2 +- arch/arm/boot/dts/stih410.dtsi | 18 ++-- arch/arm/boot/dts/stihxxx-b2120.dtsi | 4 +-- 5 files changed, 43 insertions(+), 43 deletions(-)
Re: [PATCH 53/61] tty: serial: simplify getting .drvdata
_serial_remove(struct platform_device > *pdev) > #ifdef CONFIG_PM_SLEEP > static int asc_serial_suspend(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct uart_port *port = platform_get_drvdata(pdev); > + struct uart_port *port = dev_get_drvdata(dev); > > return uart_suspend_port(&asc_uart_driver, port); > } > > static int asc_serial_resume(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct uart_port *port = platform_get_drvdata(pdev); > + struct uart_port *port = dev_get_drvdata(dev); > > return uart_resume_port(&asc_uart_driver, port); > } > diff --git a/drivers/tty/serial/xilinx_uartps.c > b/drivers/tty/serial/xilinx_uartps.c > index abcb4d09a2d8..3ec4efbf25a9 100644 > --- a/drivers/tty/serial/xilinx_uartps.c > +++ b/drivers/tty/serial/xilinx_uartps.c > @@ -1430,8 +1430,7 @@ static int cdns_uart_resume(struct device *device) > #endif /* ! CONFIG_PM_SLEEP */ > static int __maybe_unused cdns_runtime_suspend(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct uart_port *port = platform_get_drvdata(pdev); > + struct uart_port *port = dev_get_drvdata(dev); > struct cdns_uart *cdns_uart = port->private_data; > > clk_disable(cdns_uart->uartclk); > @@ -1441,8 +1440,7 @@ static int __maybe_unused cdns_runtime_suspend(struct > device *dev) > > static int __maybe_unused cdns_runtime_resume(struct device *dev) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct uart_port *port = platform_get_drvdata(pdev); > + struct uart_port *port = dev_get_drvdata(dev); > struct cdns_uart *cdns_uart = port->private_data; > > clk_enable(cdns_uart->pclk); > For st-asc: Acked-by: Patrice Chotard Thanks
Re: [PATCH] ata: ahci-platform: add reset control support
Hi Hans On 04/05/2018 03:27 PM, Hans de Goede wrote: > Hi, > > On 05-04-18 15:17, Patrice CHOTARD wrote: >> Hi Thierry >> >> On 04/05/2018 11:54 AM, Thierry Reding wrote: >>> On Fri, Mar 23, 2018 at 10:30:53AM +0900, Kunihiko Hayashi wrote: >>>> Add support to get and control a list of resets for the device >>>> as optional and shared. These resets must be kept de-asserted until >>>> the device is enabled. >>>> >>>> This is specified as shared because some SoCs like UniPhier series >>>> have common reset controls with all ahci controller instances. >>>> >>>> Signed-off-by: Kunihiko Hayashi >>>> --- >>>> .../devicetree/bindings/ata/ahci-platform.txt | 1 + >>>> drivers/ata/ahci.h | 1 + >>>> drivers/ata/libahci_platform.c | 24 >>>> +++--- >>>> 3 files changed, 23 insertions(+), 3 deletions(-) >>> >>> This causes a regression on Tegra because we explicitly request the >>> resets after the call to ahci_platform_get_resources(). >> >> I confirm, we got exactly the same behavior on STi platform. >> >>> >>> From a quick look, ahci_mtk and ahci_st are in the same boat, >>> adding the >>> corresponding maintainers to Cc. >>> >>> Patrice, Matthias: does SATA still work for you after this patch? This >>> has been in linux-next since next-20180327. >> >> SATA is still working after this patch, but a kernel warning is >> triggered due to the fact that resets are both requested by >> libahci_platform and by ahci_st driver. > > So in your case you might be able to remove the reset handling > from the ahci_st driver and rely on the new libahci_platform > handling instead? If that works that seems like a win to me. Yes, I did a quick test, the reset handling can be removed from our driver. Patrice > > As said elsewhere in this thread I think it makes sense to keep (or re-add > after a revert) the libahci_platform reset code, but make it conditional > on a flag passed to ahci_platform_get_resources(). This way we get > the shared code for most cases and platforms which need special handling > can opt-out. > > Regards, > > Hans > > >> >> Patrice >> >>> >>> Given how this is one of the more hardware-specific bits, perhaps a >>> better way to do this is to move reset handling into a Uniphier driver >>> much like Tegra, Mediatek and ST? >>> >>> That said, I don't see SATA support for any of the Socionext hardware >>> either in the DT bindings or drivers/ata, so perhaps it'd be best to >>> back this out again until we have something that's more well tested? >>> >>> Thierry
Re: [PATCH] ata: ahci-platform: add reset control support
Hi Thierry On 04/05/2018 11:54 AM, Thierry Reding wrote: > On Fri, Mar 23, 2018 at 10:30:53AM +0900, Kunihiko Hayashi wrote: >> Add support to get and control a list of resets for the device >> as optional and shared. These resets must be kept de-asserted until >> the device is enabled. >> >> This is specified as shared because some SoCs like UniPhier series >> have common reset controls with all ahci controller instances. >> >> Signed-off-by: Kunihiko Hayashi >> --- >> .../devicetree/bindings/ata/ahci-platform.txt | 1 + >> drivers/ata/ahci.h | 1 + >> drivers/ata/libahci_platform.c | 24 >> +++--- >> 3 files changed, 23 insertions(+), 3 deletions(-) > > This causes a regression on Tegra because we explicitly request the > resets after the call to ahci_platform_get_resources(). I confirm, we got exactly the same behavior on STi platform. > > From a quick look, ahci_mtk and ahci_st are in the same boat, adding the > corresponding maintainers to Cc. > > Patrice, Matthias: does SATA still work for you after this patch? This > has been in linux-next since next-20180327. SATA is still working after this patch, but a kernel warning is triggered due to the fact that resets are both requested by libahci_platform and by ahci_st driver. Patrice > > Given how this is one of the more hardware-specific bits, perhaps a > better way to do this is to move reset handling into a Uniphier driver > much like Tegra, Mediatek and ST? > > That said, I don't see SATA support for any of the Socionext hardware > either in the DT bindings or drivers/ata, so perhaps it'd be best to > back this out again until we have something that's more well tested? > > Thierry >
Re: linux-next: Signed-off-by missing for commit in the arm-soc tree
On 03/22/2018 10:01 PM, Alexandre Belloni wrote: > On 16/03/2018 at 07:34:06 +0000, Patrice CHOTARD wrote: >> Hi Arnd, Stephen >> >> On 03/15/2018 10:06 PM, Arnd Bergmann wrote: >>> On Thu, Mar 15, 2018 at 9:56 PM, Stephen Rothwell >>> wrote: >>>> Hi all, >>>> >>>> Commit >>>> >>>> 9a5f4879cd8d ("ARM: dts: stih4xx: Add missing #sound-dai-cells") >>>> >>>> is missing a Signed-off-by from its committer. >>> >>> Thanks for the report. >>> >>> What script do you use to find those? I guess I should check for >>> missing signoffs as well when pulling a branch. >>> >>> Patrice, I've dropped the merge now, and picked up the one >>> patch in it directly, with my signoff. This should fix the issue this >>> time, but please make sure you always sign off patches when >>> you apply them from the list. >>> >>> Arnd >>> >> >> Ok i will update my script on my side with Stephen's script to avoid >> this in the future. >> > > FWIW, last time this happened in the at91 tree, I've switched to use > Stephen's script as a pre-push hook: > https://raw.githubusercontent.com/alexandrebelloni/tools/master/pre-push_signed-off > > Thanks Alexandre Patrice
Re: linux-next: Signed-off-by missing for commit in the arm-soc tree
Hi Arnd, Stephen On 03/15/2018 10:06 PM, Arnd Bergmann wrote: > On Thu, Mar 15, 2018 at 9:56 PM, Stephen Rothwell > wrote: >> Hi all, >> >> Commit >> >>9a5f4879cd8d ("ARM: dts: stih4xx: Add missing #sound-dai-cells") >> >> is missing a Signed-off-by from its committer. > > Thanks for the report. > > What script do you use to find those? I guess I should check for > missing signoffs as well when pulling a branch. > > Patrice, I've dropped the merge now, and picked up the one > patch in it directly, with my signoff. This should fix the issue this > time, but please make sure you always sign off patches when > you apply them from the list. > > Arnd > Ok i will update my script on my side with Stephen's script to avoid this in the future. Thanks Patrice
Re: [GIT PULL] STi DT update for v4.17 round 2
Hi Arnd On 03/15/2018 03:59 PM, Arnd Bergmann wrote: > On Thu, Mar 15, 2018 at 10:06 AM, Patrice CHOTARD > wrote: >> Hi Arnd, Kevin, Olof >> >> PLease consider this second round of STi dts update for v4.17 >> >> The following changes since commit 0e04ce02e6a2ac30d21294d8bb2aeceb8489e52b: >> >> ARM: dts: STi: Remove unused clk_ext2f_a9 clock (2018-02-13 13:31:38 >> +0100) >> >> are available in the git repository at: >> >> git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti.git >> >> for you to fetch changes up to 9a5f4879cd8de167e82f335317c63f2ffdc80129: >> >> ARM: dts: stih4xx: Add missing #sound-dai-cells (2018-03-15 09:52:25 >> +0100) >> >> >> >> STi DT update: >> >> Add missing #sound-dai-cells which fix DT dtc warnings when building >> with W=1 > > You missed a tag name for this one, but I found tags/sti-dt-for-v4.17-round2 > to be the one that matches the commit ID above and pulled that. > >Arnd > Sorry for that. I will check that point, i noticed that i got the same issue with the previous pull request for STi DT. Thanks Patrice
[GIT PULL] STi DT update for v4.17 round 2
Hi Arnd, Kevin, Olof PLease consider this second round of STi dts update for v4.17 The following changes since commit 0e04ce02e6a2ac30d21294d8bb2aeceb8489e52b: ARM: dts: STi: Remove unused clk_ext2f_a9 clock (2018-02-13 13:31:38 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti.git for you to fetch changes up to 9a5f4879cd8de167e82f335317c63f2ffdc80129: ARM: dts: stih4xx: Add missing #sound-dai-cells (2018-03-15 09:52:25 +0100) STi DT update: Add missing #sound-dai-cells which fix DT dtc warnings when building with W=1 Rob Herring (1): ARM: dts: stih4xx: Add missing #sound-dai-cells arch/arm/boot/dts/stih407.dtsi | 1 + arch/arm/boot/dts/stih410.dtsi | 1 + 2 files changed, 2 insertions(+)
Re: [RESEND PATCH v4 3/3] ARM: dts: STi: Remove console=ttyASN from bootargs for STi boards] ARM: dts: STi: Remove "console=ttyASN" from bootargs for STi boards
Sorry I just noticed that the commit header is corrupted I will resend this patch Patrice On 03/14/2018 03:52 PM, patrice.chot...@st.com wrote: > From: Patrice Chotard > > As serial interface is already specified into stdout-path property, > "console=ttyASN,115200" from bootargs can be removed. > > Signed-off-by: Patrice Chotard > --- > > v4: _ none > v3: _ remove "console=serialN,115200" from bootargs and use prefered >stdout-path property > v2: _ none > > arch/arm/boot/dts/stih407-b2120.dts | 2 +- > arch/arm/boot/dts/stih410-b2120.dts | 2 +- > arch/arm/boot/dts/stih410-b2260.dts | 2 +- > arch/arm/boot/dts/stih418-b2199.dts | 2 +- > 4 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/boot/dts/stih407-b2120.dts > b/arch/arm/boot/dts/stih407-b2120.dts > index 37f2ddbfa099..a7a0f76e9cbc 100644 > --- a/arch/arm/boot/dts/stih407-b2120.dts > +++ b/arch/arm/boot/dts/stih407-b2120.dts > @@ -14,7 +14,7 @@ > compatible = "st,stih407-b2120", "st,stih407"; > > chosen { > - bootargs = "console=ttyAS0,115200 clk_ignore_unused"; > + bootargs = "clk_ignore_unused"; > linux,stdout-path = &sbc_serial0; > }; > > diff --git a/arch/arm/boot/dts/stih410-b2120.dts > b/arch/arm/boot/dts/stih410-b2120.dts > index a6f00a6687a9..6c6b4cc37e97 100644 > --- a/arch/arm/boot/dts/stih410-b2120.dts > +++ b/arch/arm/boot/dts/stih410-b2120.dts > @@ -14,7 +14,7 @@ > compatible = "st,stih410-b2120", "st,stih410"; > > chosen { > - bootargs = "console=ttyAS0,115200 clk_ignore_unused"; > + bootargs = "clk_ignore_unused"; > linux,stdout-path = &sbc_serial0; > }; > > diff --git a/arch/arm/boot/dts/stih410-b2260.dts > b/arch/arm/boot/dts/stih410-b2260.dts > index 62770496e328..50d36758391c 100644 > --- a/arch/arm/boot/dts/stih410-b2260.dts > +++ b/arch/arm/boot/dts/stih410-b2260.dts > @@ -15,7 +15,7 @@ > compatible = "st,stih410-b2260", "st,stih410"; > > chosen { > - bootargs = "console=ttyAS1,115200 clk_ignore_unused"; > + bootargs = "clk_ignore_unused"; > linux,stdout-path = &uart1; > }; > > diff --git a/arch/arm/boot/dts/stih418-b2199.dts > b/arch/arm/boot/dts/stih418-b2199.dts > index 36f40f58155d..7f5f3252bfc7 100644 > --- a/arch/arm/boot/dts/stih418-b2199.dts > +++ b/arch/arm/boot/dts/stih418-b2199.dts > @@ -14,7 +14,7 @@ > compatible = "st,stih418-b2199", "st,stih418"; > > chosen { > - bootargs = "console=ttyAS0,115200 clk_ignore_unused"; > + bootargs = "clk_ignore_unused"; > linux,stdout-path = &sbc_serial0; > }; > >
Re: [PATCH v4 3/3] ARM: dts: STi: Remove "console=ttyASN" from bootargs for STi boards
Hi Greg On 03/14/2018 02:57 PM, Greg KH wrote: > On Wed, Mar 07, 2018 at 06:35:34PM +0100, patrice.chot...@st.com wrote: >> From: Patrice Chotard >> >> As serial interface is already specified into stdout-path property, >> "console=ttyASN,115200" from bootargs can be removed. >> >> Signed-off-by: Patrice Chotard >> --- >> v4: _ none >> v3: _ remove "console=serialN,115200" from bootargs and use prefered >>stdout-path property >> v2: _ none >> > > This patch does not apply at all, are you sure you made it correctly? > > Can you please fix it up and resend? No problem, the patch has just been sent. Thanks Patrice > > thanks, > > greg k-h >
Re: [PATCH v3 04/10] otm
Hi Yannick There is a problem with patch 4. I received two patches 04/10, this one and [PATCH v3 04/10] video: add support of panel OTM8009A. Patrice On 03/13/2018 02:50 PM, yannick fertre wrote: > --- > drivers/video/orisetech_otm8009a.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/video/orisetech_otm8009a.c > b/drivers/video/orisetech_otm8009a.c > index 81b11d7..aa8139a 100644 > --- a/drivers/video/orisetech_otm8009a.c > +++ b/drivers/video/orisetech_otm8009a.c > @@ -289,9 +289,11 @@ static int otm8009a_panel_probe(struct udevice *dev) > struct otm8009a_panel_priv *priv = dev_get_priv(dev); > int ret; > > - /* reset panel must be done before probe */ > + /* reset panel */ > dm_gpio_set_value(&priv->reset, true); > > + mdelay(1); > + > if (IS_ENABLED(CONFIG_DM_REGULATOR) && priv->reg) { > dev_err(dev, "enable regulator '%s'\n", priv->reg->name); > ret = regulator_set_enable(priv->reg, true); >
Re: [PATCH v3 10/10] board: Add STM32F769 SoC, discovery board support
Hi Yannick You have forgotten the commit message Patrice On 03/13/2018 02:50 PM, yannick fertre wrote: > Signed-off-by: yannick fertre > --- > configs/stm32f769-disco_defconfig | 65 > +++ > 1 file changed, 65 insertions(+) > create mode 100644 configs/stm32f769-disco_defconfig > > diff --git a/configs/stm32f769-disco_defconfig > b/configs/stm32f769-disco_defconfig > new file mode 100644 > index 000..01b3b51 > --- /dev/null > +++ b/configs/stm32f769-disco_defconfig > @@ -0,0 +1,65 @@ > +CONFIG_ARM=y > +CONFIG_STM32=y > +CONFIG_SYS_TEXT_BASE=0x08008000 > +CONFIG_SYS_MALLOC_F_LEN=0xC00 > +CONFIG_STM32F7=y > +CONFIG_TARGET_STM32F746_DISCO=y > +CONFIG_DEFAULT_DEVICE_TREE="stm32f769-disco" > +CONFIG_ENV_VARS_UBOOT_CONFIG=y > +CONFIG_BOOTDELAY=3 > +CONFIG_USE_BOOTARGS=y > +CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk consoleblank=0 > ignore_loglevel" > +# CONFIG_DISPLAY_CPUINFO is not set > +# CONFIG_DISPLAY_BOARDINFO is not set > +CONFIG_BOARD_EARLY_INIT_F=y > +CONFIG_HUSH_PARSER=y > +CONFIG_SYS_PROMPT="U-Boot > " > +CONFIG_AUTOBOOT_KEYED=y > +CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n" > +CONFIG_AUTOBOOT_STOP_STR=" " > +CONFIG_CMD_BOOTZ=y > +CONFIG_CMD_GPT=y > +# CONFIG_RANDOM_UUID is not set > +CONFIG_CMD_MMC=y > +CONFIG_CMD_SF=y > +# CONFIG_CMD_SETEXPR is not set > +CONFIG_CMD_DHCP=y > +CONFIG_CMD_MII=y > +CONFIG_CMD_PING=y > +CONFIG_CMD_SNTP=y > +CONFIG_CMD_DNS=y > +CONFIG_CMD_LINK_LOCAL=y > +CONFIG_CMD_BMP=y > +CONFIG_CMD_TIMER=y > +CONFIG_CMD_EXT2=y > +CONFIG_CMD_EXT4=y > +CONFIG_CMD_FAT=y > +CONFIG_CMD_FS_GENERIC=y > +# CONFIG_DOS_PARTITION is not set > +# CONFIG_SPL_EFI_PARTITION is not set > +CONFIG_OF_CONTROL=y > +CONFIG_NET_RANDOM_ETHADDR=y > +CONFIG_NETCONSOLE=y > +# CONFIG_BLK is not set > +CONFIG_DM_MMC=y > +# CONFIG_SPL_DM_MMC is not set > +CONFIG_ARM_PL180_MMCI=y > +CONFIG_MTD=y > +CONFIG_MTD_NOR_FLASH=y > +CONFIG_DM_SPI_FLASH=y > +CONFIG_SPI_FLASH=y > +CONFIG_SPI_FLASH_STMICRO=y > +CONFIG_DM_ETH=y > +CONFIG_ETH_DESIGNWARE=y > +# CONFIG_PINCTRL_FULL is not set > +CONFIG_DM_SPI=y > +CONFIG_STM32_QSPI=y > +CONFIG_DM_VIDEO=y > +CONFIG_BACKLIGHT_GPIO=y > +CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y > +CONFIG_VIDEO_STM32=y > +CONFIG_VIDEO_STM32_DSI=y > +CONFIG_VIDEO_STM32_MAX_XRES=480 > +CONFIG_VIDEO_STM32_MAX_YRES=800 > +CONFIG_OF_LIBFDT_OVERLAY=y > +# CONFIG_EFI_LOADER is not set >
Re: [PATCH v2 07/10] video: add support of panel rm68200
Hi yannick On 03/02/2018 04:44 PM, yannick fertre wrote: > Support for Raydium rm68200 720p dsi 2dl video mode panel. > > Signed-off-by: yannick fertre > --- > drivers/video/Kconfig | 8 + > drivers/video/Makefile | 1 + > drivers/video/raydium-rm68200.c | 329 > > 3 files changed, 338 insertions(+) > create mode 100644 drivers/video/raydium-rm68200.c > > diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig > index 0f641d7..2561c59 100644 > --- a/drivers/video/Kconfig > +++ b/drivers/video/Kconfig > @@ -328,6 +328,14 @@ config VIDEO_LCD_ORISETECH_OTM8009A > ---help--- > Support for Orise Tech otm8009a 480p dsi 2dl video mode panel. > > +config VIDEO_LCD_RAYDIUM_RM68200 > + bool "RM68200 DSI LCD panel support" > + depends on DM_VIDEO > + select VIDEO_MIPI_DSI > + default n > + ---help--- > + Support for Raydium rm68200 720x1280 dsi 2dl video mode panel. > + > config VIDEO_LCD_SSD2828 > bool "SSD2828 bridge chip" > default n > diff --git a/drivers/video/Makefile b/drivers/video/Makefile > index 50be569..1a6c8d3 100644 > --- a/drivers/video/Makefile > +++ b/drivers/video/Makefile > @@ -38,6 +38,7 @@ obj-$(CONFIG_VIDEO_DA8XX) += da8xx-fb.o videomodes.o > obj-$(CONFIG_VIDEO_LCD_ANX9804) += anx9804.o > obj-$(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM) += hitachi_tx18d42vm_lcd.o > obj-$(CONFIG_VIDEO_LCD_ORISETECH_OTM8009A) += orisetech_otm8009a.o > +obj-$(CONFIG_VIDEO_LCD_RAYDIUM_RM68200) += raydium-rm68200.o > obj-$(CONFIG_VIDEO_LCD_SSD2828) += ssd2828.o > obj-$(CONFIG_VIDEO_MB862xx) += mb862xx.o videomodes.o > obj-$(CONFIG_VIDEO_MX3) += mx3fb.o videomodes.o > diff --git a/drivers/video/raydium-rm68200.c b/drivers/video/raydium-rm68200.c > new file mode 100644 > index 000..46afb58 > --- /dev/null > +++ b/drivers/video/raydium-rm68200.c > @@ -0,0 +1,329 @@ > +/* > + * Copyright (C) 2018 STMicroelectronics - All Rights Reserved > + * Author(s): Yannick Fertre for STMicroelectronics. > + * Philippe Cornu for STMicroelectronics. > + * > + * This rm68200 panel driver is based on the panel driver from > + * drivers/gpu/drm/panel/panel-raydium-rm68200.c (kernel linux) > + * > + * SPDX-License-Identifier: GPL-2.0 > + */ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +DECLARE_GLOBAL_DATA_PTR; > + > +#define DRV_NAME "raydium_rm68200" > + > +/*** Manufacturer Command Set ***/ > +#define MCS_CMD_MODE_SW 0xFE /* CMD Mode Switch */ > +#define MCS_CMD1_UCS 0x00 /* User Command Set (UCS = CMD1) */ > +#define MCS_CMD2_P0 0x01 /* Manufacture Command Set Page0 (CMD2 P0) */ > +#define MCS_CMD2_P1 0x02 /* Manufacture Command Set Page1 (CMD2 P1) */ > +#define MCS_CMD2_P2 0x03 /* Manufacture Command Set Page2 (CMD2 P2) */ > +#define MCS_CMD2_P3 0x04 /* Manufacture Command Set Page3 (CMD2 P3) */ > + > +/* CMD2 P0 commands (Display Options and Power) */ > +#define MCS_STBCTR 0x12 /* TE1 Output Setting Zig-Zag Connection */ > +#define MCS_SGOPCTR 0x16 /* Source Bias Current */ > +#define MCS_SDCTR0x1A /* Source Output Delay Time */ > +#define MCS_INVCTR 0x1B /* Inversion Type */ > +#define MCS_EXT_PWR_IC 0x24 /* External PWR IC Control */ > +#define MCS_SETAVDD 0x27 /* PFM Control for AVDD Output */ > +#define MCS_SETAVEE 0x29 /* PFM Control for AVEE Output */ > +#define MCS_BT2CTR 0x2B /* DDVDL Charge Pump Control */ > +#define MCS_BT3CTR 0x2F /* VGH Charge Pump Control */ > +#define MCS_BT4CTR 0x34 /* VGL Charge Pump Control */ > +#define MCS_VCMCTR 0x46 /* VCOM Output Level Control */ > +#define MCS_SETVGN 0x52 /* VG M/S N Control */ > +#define MCS_SETVGP 0x54 /* VG M/S P Control */ > +#define MCS_SW_CTRL 0x5F /* Interface Control for PFM and MIPI */ > + > +/* CMD2 P2 commands (GOA Timing Control) - no description in datasheet */ > +#define GOA_VSTV10x00 > +#define GOA_VSTV20x07 > +#define GOA_VCLK10x0E > +#define GOA_VCLK20x17 > +#define GOA_VCLK_OPT10x20 > +#define GOA_BICLK1 0x2A > +#define GOA_BICLK2 0x37 > +#define GOA_BICLK3 0x44 > +#define GOA_BICLK4 0x4F > +#define GOA_BICLK_OPT1 0x5B > +#define GOA_BICLK_OPT2 0x60 > +#define MCS_GOA_GPO1 0x6D > +#define MCS_GOA_GPO2 0x71 > +#define MCS_GOA_EQ 0x74 > +#define MCS_GOA_CLK_GALLON 0x7C > +#define MCS_GOA_FS_SEL0 0x7E > +#define MCS_GOA_FS_SEL1 0x87 > +#define MCS_GOA_FS_SEL2 0x91 > +#define MCS_GOA_FS_SEL3 0x9B > +#define MCS_GOA_BS_SEL0 0xAC > +#define MCS_GOA_BS_SEL1 0xB5 > +#define MCS_GOA_BS_SEL2 0xBF > +#define MCS_GOA_BS_SEL3 0xC9 > +#define MCS_GOA_BS_SEL4 0xD3 > + > +/* CMD2 P3 commands (Gamma) */ > +#define MCS_GAMMA_VP 0x60 /* Gamma VP1~VP16 */ > +#define MCS_GAMMA_VN 0x70 /* Gamma VN1~VN16 */ > + > +struct rm68200_panel_priv { > + struct udevice *reg; > + struct udevice *backlight; > + struct gpio_desc reset; > +}; > + > +static
Re: [PATCH v2 06/10] video: add support of STM32 MIPI DSI controller driver
Hi yannick On 03/02/2018 04:44 PM, yannick fertre wrote: > Add the STM32 DSI controller driver that uses the Synopsys DesignWare > MIPI DSI host controller bridge. > > Signed-off-by: yannick fertre > --- > drivers/video/stm32/Kconfig | 10 + > drivers/video/stm32/Makefile| 1 + > drivers/video/stm32/stm32_dsi.c | 427 > > 3 files changed, 438 insertions(+) > create mode 100644 drivers/video/stm32/stm32_dsi.c > > diff --git a/drivers/video/stm32/Kconfig b/drivers/video/stm32/Kconfig > index 113a2bb..2ea6f18 100644 > --- a/drivers/video/stm32/Kconfig > +++ b/drivers/video/stm32/Kconfig > @@ -15,6 +15,16 @@ menuconfig VIDEO_STM32 > DSI. This option enables these supports which can be used on > devices which have RGB TFT or DSI display connected. > > +config VIDEO_STM32_DSI > + bool "Enable STM32 DSI video support" > + depends on VIDEO_STM32 > + select VIDEO_MIPI_DSI > + select VIDEO_BRIDGE > + select VIDEO_DW_MIPI_DSI > + help > + This option enables support DSI internal bridge which can be used on > + devices which have DSI display connected. > + > config VIDEO_STM32_MAX_XRES > int "Maximum horizontal resolution (for memory allocation purposes)" > depends on VIDEO_STM32 > diff --git a/drivers/video/stm32/Makefile b/drivers/video/stm32/Makefile > index 372a2e1..f8c3ff7 100644 > --- a/drivers/video/stm32/Makefile > +++ b/drivers/video/stm32/Makefile > @@ -8,3 +8,4 @@ > # > > obj-${CONFIG_VIDEO_STM32} = stm32_ltdc.o > +obj-${CONFIG_VIDEO_STM32_DSI} += stm32_dsi.o > diff --git a/drivers/video/stm32/stm32_dsi.c b/drivers/video/stm32/stm32_dsi.c > new file mode 100644 > index 000..3e26433 > --- /dev/null > +++ b/drivers/video/stm32/stm32_dsi.c > @@ -0,0 +1,427 @@ > +/* > + * Copyright (C) 2018 STMicroelectronics - All Rights Reserved > + * Author(s): Philippe Cornu for STMicroelectronics. > + * Yannick Fertre for STMicroelectronics. > + * > + * This driver is based on the mipi dsi driver from > + * drivers/gpu/drm/stm/dw_mipi_dsi-stm.c (kernel linux). > + * > + * SPDX-License-Identifier: GPL-2.0 > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +DECLARE_GLOBAL_DATA_PTR; > + > +#define HWVER_1300x31333000 /* IP version 1.30 */ > +#define HWVER_1310x31333100 /* IP version 1.31 */ > + > +/* DSI digital registers & bit definitions */ > +#define DSI_VERSION 0x00 > +#define VERSION GENMASK(31, 8) > + > +/* > + * DSI wrapper registers & bit definitions > + * Note: registers are named as in the Reference Manual > + */ > +#define DSI_WCFGR0x0400 /* Wrapper ConFiGuration Reg */ > +#define WCFGR_DSIM BIT(0) /* DSI Mode */ > +#define WCFGR_COLMUX GENMASK(3, 1) /* COLor MUltipleXing */ > + > +#define DSI_WCR 0x0404 /* Wrapper Control Reg */ > +#define WCR_DSIENBIT(3) /* DSI ENable */ > + > +#define DSI_WISR 0x040C /* Wrapper Interrupt and Status Reg */ > +#define WISR_PLLLS BIT(8) /* PLL Lock Status */ > +#define WISR_RRS BIT(12) /* Regulator Ready Status */ > + > +#define DSI_WPCR00x0418 /* Wrapper Phy Conf Reg 0 */ > +#define WPCR0_UIX4 GENMASK(5, 0) /* Unit Interval X 4 */ > +#define WPCR0_TDDL BIT(16) /* Turn Disable Data Lanes */ > + > +#define DSI_WRPCR0x0430 /* Wrapper Regulator & Pll Ctrl Reg */ > +#define WRPCR_PLLEN BIT(0) /* PLL ENable */ > +#define WRPCR_NDIV GENMASK(8, 2) /* pll loop DIVision Factor */ > +#define WRPCR_IDFGENMASK(14, 11) /* pll Input Division Factor */ > +#define WRPCR_ODFGENMASK(17, 16) /* pll Output Division Factor */ > +#define WRPCR_REGEN BIT(24) /* REGulator ENable */ > +#define WRPCR_BGREN BIT(28) /* BandGap Reference ENable */ > +#define IDF_MIN 1 > +#define IDF_MAX 7 > +#define NDIV_MIN 10 > +#define NDIV_MAX 125 > +#define ODF_MIN 1 > +#define ODF_MAX 8 > + > +/* dsi color format coding according to the datasheet */ > +enum dsi_color { > + DSI_RGB565_CONF1, > + DSI_RGB565_CONF2, > + DSI_RGB565_CONF3, > + DSI_RGB666_CONF1, > + DSI_RGB666_CONF2, > + DSI_RGB888, > +}; > + > +#define LANE_MIN_KBPS31250 > +#define LANE_MAX_KBPS50 > + > +/* Timeout for regulator on/off, pll lock/unlock & fifo empty */ > +#define TIMEOUT_US 20 > + > +struct stm32_dsi_priv { > + struct mipi_dsi_device device; > + void __iomem *base; > + struct udevice *panel; > + u32 pllref_clk; > + u32 hw_version; > + int lane_min_kbps; > + int lane_max_kbps; > +}; > + > +static inline void dsi_write(struct stm32_dsi_priv *dsi, u32 reg, u32
Re: [PATCH v2 04/10] video: add support of panel OTM8009A
Hi Yannick On 03/02/2018 04:44 PM, yannick fertre wrote: > Support for Orise Tech otm8009a 480p dsi 2dl video mode panel. > > Signed-off-by: yannick fertre > --- > drivers/video/Kconfig | 8 + > drivers/video/Makefile | 1 + > drivers/video/orisetech_otm8009a.c | 329 > + > 3 files changed, 338 insertions(+) > create mode 100644 drivers/video/orisetech_otm8009a.c > > diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig > index 1981298..b5fc535 100644 > --- a/drivers/video/Kconfig > +++ b/drivers/video/Kconfig > @@ -320,6 +320,14 @@ config VIDEO_LCD_ANX9804 > from a parallel LCD interface and translate it on the fy into a DP > interface for driving eDP TFT displays. It uses I2C for configuration. > > +config VIDEO_LCD_ORISETECH_OTM8009A > + bool "OTM8009A DSI LCD panel support" > + depends on DM_VIDEO > + select VIDEO_MIPI_DSI > + default n > + ---help--- > + Support for Orise Tech otm8009a 480p dsi 2dl video mode panel. > + > config VIDEO_LCD_SSD2828 > bool "SSD2828 bridge chip" > default n > diff --git a/drivers/video/Makefile b/drivers/video/Makefile > index 6f42cca..65002af 100644 > --- a/drivers/video/Makefile > +++ b/drivers/video/Makefile > @@ -37,6 +37,7 @@ obj-$(CONFIG_VIDEO_COREBOOT) += coreboot.o > obj-$(CONFIG_VIDEO_DA8XX) += da8xx-fb.o videomodes.o > obj-$(CONFIG_VIDEO_LCD_ANX9804) += anx9804.o > obj-$(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM) += hitachi_tx18d42vm_lcd.o > +obj-$(CONFIG_VIDEO_LCD_ORISETECH_OTM8009A) += orisetech_otm8009a.o > obj-$(CONFIG_VIDEO_LCD_SSD2828) += ssd2828.o > obj-$(CONFIG_VIDEO_MB862xx) += mb862xx.o videomodes.o > obj-$(CONFIG_VIDEO_MX3) += mx3fb.o videomodes.o > diff --git a/drivers/video/orisetech_otm8009a.c > b/drivers/video/orisetech_otm8009a.c > new file mode 100644 > index 000..79f2da8 > --- /dev/null > +++ b/drivers/video/orisetech_otm8009a.c > @@ -0,0 +1,329 @@ > +/* > + * Copyright (C) 2018 STMicroelectronics - All Rights Reserved > + * Author(s): Yannick Fertre for STMicroelectronics. > + * Philippe Cornu for STMicroelectronics. > + * > + * This otm8009a panel driver is based on the panel driver from > + * drivers/gpu/drm/panel/panel-orisetech-otm8009a.c (kernel linux) > + * > + * SPDX-License-Identifier: GPL-2.0 > + */ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +DECLARE_GLOBAL_DATA_PTR; > + > +#define DRV_NAME "orisetech_otm8009a" > + > +#define OTM8009A_BACKLIGHT_DEFAULT 240 > +#define OTM8009A_BACKLIGHT_MAX 255 > + > +/* Manufacturer Command Set */ > +#define MCS_ADRSFT 0x /* Address Shift Function */ > +#define MCS_PANSET 0xB3A6 /* Panel Type Setting */ > +#define MCS_SD_CTRL 0xC0A2 /* Source Driver Timing Setting */ > +#define MCS_P_DRV_M 0xC0B4 /* Panel Driving Mode */ > +#define MCS_OSC_ADJ 0xC181 /* Oscillator Adjustment for Idle/Normal mode */ > +#define MCS_RGB_VID_SET 0xC1A1 /* RGB Video Mode Setting */ > +#define MCS_SD_PCH_CTRL 0xC480 /* Source Driver Precharge Control */ > +#define MCS_NO_DOC1 0xC48A /* Command not documented */ > +#define MCS_PWR_CTRL10xC580 /* Power Control Setting 1 */ > +#define MCS_PWR_CTRL20xC590 /* Power Control Setting 2 for Normal > Mode */ > +#define MCS_PWR_CTRL40xC5B0 /* Power Control Setting 4 for DC > Voltage */ > +#define MCS_PANCTRLSET1 0xCB80 /* Panel Control Setting 1 */ > +#define MCS_PANCTRLSET2 0xCB90 /* Panel Control Setting 2 */ > +#define MCS_PANCTRLSET3 0xCBA0 /* Panel Control Setting 3 */ > +#define MCS_PANCTRLSET4 0xCBB0 /* Panel Control Setting 4 */ > +#define MCS_PANCTRLSET5 0xCBC0 /* Panel Control Setting 5 */ > +#define MCS_PANCTRLSET6 0xCBD0 /* Panel Control Setting 6 */ > +#define MCS_PANCTRLSET7 0xCBE0 /* Panel Control Setting 7 */ > +#define MCS_PANCTRLSET8 0xCBF0 /* Panel Control Setting 8 */ > +#define MCS_PANU2D1 0xCC80 /* Panel U2D Setting 1 */ > +#define MCS_PANU2D2 0xCC90 /* Panel U2D Setting 2 */ > +#define MCS_PANU2D3 0xCCA0 /* Panel U2D Setting 3 */ > +#define MCS_PAND2U1 0xCCB0 /* Panel D2U Setting 1 */ > +#define MCS_PAND2U2 0xCCC0 /* Panel D2U Setting 2 */ > +#define MCS_PAND2U3 0xCCD0 /* Panel D2U Setting 3 */ > +#define MCS_GOAVST 0xCE80 /* GOA VST Setting */ > +#define MCS_GOACLKA1 0xCEA0 /* GOA CLKA1 Setting */ > +#define MCS_GOACLKA3 0xCEB0 /* GOA CLKA3 Setting */ > +#define MCS_GOAECLK 0xCFC0 /* GOA ECLK Setting */ > +#define MCS_NO_DOC2 0xCFD0 /* Command not documented */ > +#define MCS_GVDDSET 0xD800 /* GVDD/NGVDD */ > +#define MCS_VCOMDC 0xD900 /* VCOM Voltage Setting */ > +#define MCS_GMCT2_2P 0xE100 /* Gamma Correction 2.2+ Setting */ > +#define MCS_GMCT2_2N 0xE200 /* Gamma Correction 2.2- Setting */ > +#define MCS_NO_DOC3 0xF5B6 /* Command not documented */ > +#define MCS_CMD2_ENA10xFF00 /* Enable Acces
Re: [PATCH v2 02/10] video: stm32: stm32_ltdc: update debug log
Hi Yannick On 03/02/2018 04:44 PM, yannick fertre wrote: > Replace macro debug by pr_error, pr_warn or pr_info. > > Signed-off-by: yannick fertre > --- > drivers/video/stm32/stm32_ltdc.c | 62 > > 1 file changed, 31 insertions(+), 31 deletions(-) > > diff --git a/drivers/video/stm32/stm32_ltdc.c > b/drivers/video/stm32/stm32_ltdc.c > index bd9c0de..e95f35c 100644 > --- a/drivers/video/stm32/stm32_ltdc.c > +++ b/drivers/video/stm32/stm32_ltdc.c > @@ -176,13 +176,13 @@ static u32 stm32_ltdc_get_pixel_format(enum > video_log2_bpp l2bpp) > case VIDEO_BPP2: > case VIDEO_BPP4: > default: > - debug("%s: warning %dbpp not supported yet, %dbpp instead\n", > - __func__, VNBITS(l2bpp), VNBITS(VIDEO_BPP16)); > + pr_warn("%s: warning %dbpp not supported yet, %dbpp instead\n", > + __func__, VNBITS(l2bpp), VNBITS(VIDEO_BPP16)); > pf = PF_RGB565; > break; > } > > - debug("%s: %d bpp -> ltdc pf %d\n", __func__, VNBITS(l2bpp), pf); > + pr_info("%s: %d bpp -> ltdc pf %d\n", __func__, VNBITS(l2bpp), pf); > > return (u32)pf; > } > @@ -249,7 +249,7 @@ static void stm32_ltdc_set_mode(struct stm32_ltdc_priv > *priv, > > /* Signal polarities */ > val = 0; > - debug("%s: timing->flags 0x%08x\n", __func__, timings->flags); > + pr_info("%s: timing->flags 0x%08x\n", __func__, timings->flags); > if (timings->flags & DISPLAY_FLAGS_HSYNC_HIGH) > val |= GCR_HSPOL; > if (timings->flags & DISPLAY_FLAGS_VSYNC_HIGH) > @@ -343,26 +343,26 @@ static int stm32_ltdc_probe(struct udevice *dev) > > priv->regs = (void *)dev_read_addr(dev); > if ((fdt_addr_t)priv->regs == FDT_ADDR_T_NONE) { > - debug("%s: ltdc dt register address error\n", __func__); > + pr_err("%s: ltdc dt register address error\n", __func__); As you get access to the struct udevice, prefer dev_err() here. > return -EINVAL; > } > > ret = clk_get_by_index(dev, 0, &pclk); > if (ret) { > - debug("%s: peripheral clock get error %d\n", __func__, ret); > + pr_err("%s: peripheral clock get error %d\n", __func__, ret); ditto > return ret; > } > > ret = clk_enable(&pclk); > if (ret) { > - debug("%s: peripheral clock enable error %d\n", > - __func__, ret); > + pr_err("%s: peripheral clock enable error %d\n", > +__func__, ret); ditto > return ret; > } > > ret = reset_get_by_index(dev, 0, &rst); > if (ret) { > - debug("%s: missing ltdc hardware reset\n", __func__); > + pr_err("%s: missing ltdc hardware reset\n", __func__); ditto > return -ENODEV; > } > > @@ -372,41 +372,40 @@ static int stm32_ltdc_probe(struct udevice *dev) > #ifdef CONFIG_VIDEO_BRIDGE > ret = uclass_get_device(UCLASS_VIDEO_BRIDGE, 0, &bridge); > if (ret) { > - debug("%s: No video bridge, or no backlight on bridge\n", > - __func__); > + pr_info("%s: No video bridge, or no backlight on bridge\n", > + __func__); dev_info() > } > > if (bridge) { > ret = video_bridge_attach(bridge); > if (ret) { > - debug("%s: fail to attach bridge\n", __func__); > + pr_err("%s: fail to attach bridge\n", __func__); dev_err() > return ret; > } > } > #endif > ret = uclass_first_device(UCLASS_PANEL, &panel); > if (ret) { > - debug("%s: panel device error %d\n", __func__, ret); > + pr_err("%s: panel device error %d\n", __func__, ret); ditto > return ret; > } > > ret = fdtdec_decode_display_timing(gd->fdt_blob, dev_of_offset(panel), > 0, &timings); > if (ret) { > - debug("%s: decode display timing error %d\n", > - __func__, ret); > + pr_err("%s: decode display timing error %d\n", __func__, ret); ditto > return ret; > } > > rate = clk_set_rate(&pclk, timings.pixelclock.typ); > if (rate < 0) { > - debug("%s: fail to set pixel clock %d hz %d hz\n", > - __func__, timings.pixelclock.typ, rate); > + pr_err("%s: fail to set pixel clock %d hz %d hz\n", > +__func__, timings.pixelclock.typ, rate); ditto > return rate; > } > > - debug("%s: Set pixel clock req %d hz get %d hz\n", __func__, > - timings.pixelclock.typ, rate); > + pr_info("%s: Set pixel clock req %d hz get %d hz\n", __func__, > + timings.pixelclock.typ, rate); > > /* TODO Below
Re: [PATCH v2 01/10] video: stm32: stm32_ltdc: add bridge to display controller
Hi Yannick On 03/02/2018 04:44 PM, yannick fertre wrote: > Manage a bridge insert between the display controller & a panel. > > Signed-off-by: yannick fertre > --- > drivers/video/stm32/stm32_ltdc.c | 107 > ++- > 1 file changed, 71 insertions(+), 36 deletions(-) > > diff --git a/drivers/video/stm32/stm32_ltdc.c > b/drivers/video/stm32/stm32_ltdc.c > index e160c77..bd9c0de 100644 > --- a/drivers/video/stm32/stm32_ltdc.c > +++ b/drivers/video/stm32/stm32_ltdc.c > @@ -8,6 +8,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -15,12 +16,12 @@ > #include > #include > #include > +#include > > DECLARE_GLOBAL_DATA_PTR; > > struct stm32_ltdc_priv { > void __iomem *regs; > - struct display_timing timing; > enum video_log2_bpp l2bpp; > u32 bg_col_argb; > u32 crop_x, crop_y, crop_w, crop_h; > @@ -210,23 +211,23 @@ static void stm32_ltdc_enable(struct stm32_ltdc_priv > *priv) > setbits_le32(priv->regs + LTDC_GCR, GCR_LTDCEN); > } > > -static void stm32_ltdc_set_mode(struct stm32_ltdc_priv *priv) > +static void stm32_ltdc_set_mode(struct stm32_ltdc_priv *priv, > + struct display_timing *timings) > { > void __iomem *regs = priv->regs; > - struct display_timing *timing = &priv->timing; > u32 hsync, vsync, acc_hbp, acc_vbp, acc_act_w, acc_act_h; > u32 total_w, total_h; > u32 val; > > /* Convert video timings to ltdc timings */ > - hsync = timing->hsync_len.typ - 1; > - vsync = timing->vsync_len.typ - 1; > - acc_hbp = hsync + timing->hback_porch.typ; > - acc_vbp = vsync + timing->vback_porch.typ; > - acc_act_w = acc_hbp + timing->hactive.typ; > - acc_act_h = acc_vbp + timing->vactive.typ; > - total_w = acc_act_w + timing->hfront_porch.typ; > - total_h = acc_act_h + timing->vfront_porch.typ; > + hsync = timings->hsync_len.typ - 1; > + vsync = timings->vsync_len.typ - 1; > + acc_hbp = hsync + timings->hback_porch.typ; > + acc_vbp = vsync + timings->vback_porch.typ; > + acc_act_w = acc_hbp + timings->hactive.typ; > + acc_act_h = acc_vbp + timings->vactive.typ; > + total_w = acc_act_w + timings->hfront_porch.typ; > + total_h = acc_act_h + timings->vfront_porch.typ; > > /* Synchronization sizes */ > val = (hsync << 16) | vsync; > @@ -248,14 +249,14 @@ static void stm32_ltdc_set_mode(struct stm32_ltdc_priv > *priv) > > /* Signal polarities */ > val = 0; > - debug("%s: timing->flags 0x%08x\n", __func__, timing->flags); > - if (timing->flags & DISPLAY_FLAGS_HSYNC_HIGH) > + debug("%s: timing->flags 0x%08x\n", __func__, timings->flags); > + if (timings->flags & DISPLAY_FLAGS_HSYNC_HIGH) > val |= GCR_HSPOL; > - if (timing->flags & DISPLAY_FLAGS_VSYNC_HIGH) > + if (timings->flags & DISPLAY_FLAGS_VSYNC_HIGH) > val |= GCR_VSPOL; > - if (timing->flags & DISPLAY_FLAGS_DE_HIGH) > + if (timings->flags & DISPLAY_FLAGS_DE_HIGH) > val |= GCR_DEPOL; > - if (timing->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE) > + if (timings->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE) > val |= GCR_PCPOL; > clrsetbits_le32(regs + LTDC_GCR, > GCR_HSPOL | GCR_VSPOL | GCR_DEPOL | GCR_PCPOL, val); > @@ -331,7 +332,11 @@ static int stm32_ltdc_probe(struct udevice *dev) > struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev); > struct video_priv *uc_priv = dev_get_uclass_priv(dev); > struct stm32_ltdc_priv *priv = dev_get_priv(dev); > - struct udevice *panel; > +#ifdef CONFIG_VIDEO_BRIDGE > + struct udevice *bridge = NULL; > +#endif > + struct udevice *panel = NULL; > + struct display_timing timings; > struct clk pclk; > struct reset_ctl rst; > int rate, ret; > @@ -364,63 +369,93 @@ static int stm32_ltdc_probe(struct udevice *dev) > /* Reset */ > reset_deassert(&rst); > > - ret = uclass_first_device(UCLASS_PANEL, &panel); > +#ifdef CONFIG_VIDEO_BRIDGE > + ret = uclass_get_device(UCLASS_VIDEO_BRIDGE, 0, &bridge); > if (ret) { > - debug("%s: panel device error %d\n", __func__, ret); > - return ret; > + debug("%s: No video bridge, or no backlight on bridge\n", > + __func__); > } > > - ret = panel_enable_backlight(panel); > + if (bridge) { > + ret = video_bridge_attach(bridge); > + if (ret) { > + debug("%s: fail to attach bridge\n", __func__); I would replace debug by dev_err() here. > + return ret; > + } > + } > +#endif > + ret = uclass_first_device(UCLASS_PANEL, &panel); > if (ret) { > - debug("%s: panel %s enable backlight error %d\n", > - __func__, panel->name, ret); >
Re: [PATCH v2 10/10] board: Add STM32F769 SoC, discovery board support
Hi Yannick On 03/02/2018 04:44 PM, yannick fertre wrote: > Signed-off-by: yannick fertre Can you add a commit message explaining why you add a specific defconfig for this board. FYI, previously, the same defconfig was used for all STM32F7 boards (ie /stm32f746-disco_defconfig). You will also need to resync with the last master branch regarding defconfig content. Thanks Patrice > --- > configs/stm32f769-disco_defconfig | 63 > +++ > 1 file changed, 63 insertions(+) > create mode 100644 configs/stm32f769-disco_defconfig > > diff --git a/configs/stm32f769-disco_defconfig > b/configs/stm32f769-disco_defconfig > new file mode 100644 > index 000..ac34076 > --- /dev/null > +++ b/configs/stm32f769-disco_defconfig > @@ -0,0 +1,63 @@ > +CONFIG_ARM=y > +CONFIG_STM32=y > +CONFIG_SYS_MALLOC_F_LEN=0xC00 > +CONFIG_STM32F7=y > +CONFIG_TARGET_STM32F746_DISCO=y > +CONFIG_DEFAULT_DEVICE_TREE="stm32f769-disco" > +CONFIG_BOOTDELAY=3 > +CONFIG_USE_BOOTARGS=y > +CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk consoleblank=0 > ignore_loglevel" > +# CONFIG_DISPLAY_CPUINFO is not set > +# CONFIG_DISPLAY_BOARDINFO is not set > +CONFIG_BOARD_EARLY_INIT_F=y > +CONFIG_HUSH_PARSER=y > +CONFIG_SYS_PROMPT="U-Boot > " > +CONFIG_AUTOBOOT_KEYED=y > +CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n" > +CONFIG_AUTOBOOT_STOP_STR=" " > +CONFIG_CMD_BOOTZ=y > +# CONFIG_CMD_FPGA is not set > +CONFIG_CMD_GPT=y > +# CONFIG_RANDOM_UUID is not set > +CONFIG_CMD_MMC=y > +CONFIG_CMD_SF=y > +# CONFIG_CMD_SETEXPR is not set > +CONFIG_CMD_DHCP=y > +CONFIG_CMD_MII=y > +CONFIG_CMD_PING=y > +CONFIG_CMD_SNTP=y > +CONFIG_CMD_DNS=y > +CONFIG_CMD_LINK_LOCAL=y > +CONFIG_CMD_BMP=y > +CONFIG_CMD_TIMER=y > +CONFIG_CMD_EXT2=y > +CONFIG_CMD_EXT4=y > +CONFIG_CMD_FAT=y > +CONFIG_CMD_FS_GENERIC=y > +# CONFIG_DOS_PARTITION is not set > +CONFIG_OF_CONTROL=y > +CONFIG_NET_RANDOM_ETHADDR=y > +CONFIG_NETCONSOLE=y > +# CONFIG_BLK is not set > +CONFIG_DM_MMC=y > +# CONFIG_SPL_DM_MMC is not set > +CONFIG_ARM_PL180_MMCI=y > +CONFIG_MTD=y > +CONFIG_MTD_NOR_FLASH=y > +CONFIG_DM_SPI_FLASH=y > +CONFIG_SPI_FLASH=y > +CONFIG_SPI_FLASH_STMICRO=y > +CONFIG_DM_ETH=y > +CONFIG_ETH_DESIGNWARE=y > +# CONFIG_PINCTRL_FULL is not set > +CONFIG_DM_SPI=y > +CONFIG_STM32_QSPI=y > +CONFIG_DM_VIDEO=y > +CONFIG_BACKLIGHT_GPIO=y > +CONFIG_VIDEO_LCD_ORISETECH_OTM8009A=y > +CONFIG_VIDEO_STM32=y > +CONFIG_VIDEO_STM32_DSI=y > +CONFIG_VIDEO_STM32_MAX_XRES=480 > +CONFIG_VIDEO_STM32_MAX_YRES=800 > +CONFIG_OF_LIBFDT_OVERLAY=y > +# CONFIG_EFI_LOADER is not set >
Re: [PATCH v3 1/3] ARM: dts: STi: Fix aliases property name for STi boards
Hi Rob On 03/07/2018 05:15 PM, Rob Herring wrote: > On Wed, Mar 7, 2018 at 2:49 AM, wrote: >> From: Patrice Chotard >> >> Update serial aliases from "ttyASN" to more common "serialN". >> >> Since dtc v1.4.6-9-gaadd0b65c987, aliases property name must >> be lowercase only. This allows to fix following dtc warnings: >> >> arch/arm/boot/dts/stih418-b2199.dtb: Warning (alias_paths): /aliases: >> aliases property name must include only lowercase and '-' >> arch/arm/boot/dts/stih407-b2120.dtb: Warning (alias_paths): /aliases: >> aliases property name must include only lowercase and '-' >> arch/arm/boot/dts/stih410-b2260.dtb: Warning (alias_paths): /aliases: >> aliases property name must include only lowercase and '-' >> arch/arm/boot/dts/stih410-b2120.dtb: Warning (alias_paths): /aliases: >> aliases property name must include only lowercase and '-' >> >> Signed-off-by: Patrice Chotard >> --- >> >> v3: _ none >> v2: _ use serialN instead of ttyasN aliases to not break ABI >> >> arch/arm/boot/dts/stih407-b2120.dts | 4 ++-- >> arch/arm/boot/dts/stih410-b2120.dts | 4 ++-- >> arch/arm/boot/dts/stih410-b2260.dts | 4 ++-- >> arch/arm/boot/dts/stih418-b2199.dts | 4 ++-- >> 4 files changed, 8 insertions(+), 8 deletions(-) >> >> diff --git a/arch/arm/boot/dts/stih407-b2120.dts >> b/arch/arm/boot/dts/stih407-b2120.dts >> index de3c8bf129b5..2c4d6033b448 100644 >> --- a/arch/arm/boot/dts/stih407-b2120.dts >> +++ b/arch/arm/boot/dts/stih407-b2120.dts >> @@ -14,7 +14,7 @@ >> compatible = "st,stih407-b2120", "st,stih407"; >> >> chosen { >> - bootargs = "console=ttyAS0,115200 clk_ignore_unused"; >> + bootargs = "console=serial0,115200 clk_ignore_unused"; > > These hunks for bootargs are still wrong. You wouldn't boot with a > console if you only apply patch 1. These hunks should be squashed with > patch 2. Thanks for pointing this, i even noticed that patches must be reordered, first st-asc driver update and then DTS patches. Thanks Patrice > >> stdout-path = &sbc_serial0; >> }; >> >> @@ -24,7 +24,7 @@ >> }; >> >> aliases { >> - ttyAS0 = &sbc_serial0; >> + serial0 = &sbc_serial0; >> ethernet0 = ðernet0; >> }; >> >> diff --git a/arch/arm/boot/dts/stih410-b2120.dts >> b/arch/arm/boot/dts/stih410-b2120.dts >> index 0a59b7b0f4b2..5422850641e8 100644 >> --- a/arch/arm/boot/dts/stih410-b2120.dts >> +++ b/arch/arm/boot/dts/stih410-b2120.dts >> @@ -14,7 +14,7 @@ >> compatible = "st,stih410-b2120", "st,stih410"; >> >> chosen { >> - bootargs = "console=ttyAS0,115200 clk_ignore_unused"; >> + bootargs = "console=serial0,115200 clk_ignore_unused"; >> stdout-path = &sbc_serial0; >> }; >> >> @@ -24,7 +24,7 @@ >> }; >> >> aliases { >> - ttyAS0 = &sbc_serial0; >> + serial0 = &sbc_serial0; >> ethernet0 = ðernet0; >> }; >> >> diff --git a/arch/arm/boot/dts/stih410-b2260.dts >> b/arch/arm/boot/dts/stih410-b2260.dts >> index feb8834478fa..ca347160e35d 100644 >> --- a/arch/arm/boot/dts/stih410-b2260.dts >> +++ b/arch/arm/boot/dts/stih410-b2260.dts >> @@ -15,7 +15,7 @@ >> compatible = "st,stih410-b2260", "st,stih410"; >> >> chosen { >> - bootargs = "console=ttyAS1,115200 clk_ignore_unused"; >> + bootargs = "console=serial1,115200 clk_ignore_unused"; >> stdout-path = &uart1; >> }; >> >> @@ -25,7 +25,7 @@ >> }; >> >> aliases { >> - ttyAS1 = &uart1; >> + serial1 = &uart1; >> ethernet0 = ðernet0; >> }; >> >> diff --git a/arch/arm/boot/dts/stih418-b2199.dts >> b/arch/arm/boot/dts/stih418-b2199.dts >> index 39b4db2e3507..dbf7bb704a1a 100644 >> --- a/arch/arm/boot/dts/stih418-b2199.dts >> +++ b/arch/arm/boot/dts/stih418-b2199.dts >> @@ -14,7 +14,7 @@ >> compatible = "st,stih418-b2199", "st,stih418"; >> >> chosen { >> - bootargs = "console=ttyAS0,115200 clk_ignore_unused"; >> + bootargs = "console=serial0,115200 clk_ignore_unused"; >> stdout-path = &sbc_serial0; >> }; >> >> @@ -24,7 +24,7 @@ >> }; >> >> aliases { >> - ttyAS0 = &sbc_serial0; >> + serial0 = &sbc_serial0; >> ethernet0 = ðernet0; >> }; >> >> -- >> 1.9.1 >>
Re: [PATCH v2 0/6] Add mmc support for STM32F7 boards
Hi Lee On 03/07/2018 09:35 AM, Lee Jones wrote: > On Mon, 05 Mar 2018, Alexandre Torgue wrote: > >> Hi Patrice, >> >> On 03/01/2018 11:53 AM, patrice.chot...@st.com wrote: >>> From: Patrice Chotard >>> >>> This series adds : >>>_ SDIO pins definition for STM32F7 SoCs family >>>_ add sdio1 DT entry for STM32F746 Discovery board >>>_ add sdio1 DT entry for STM32F746 Evaluation board >>>_ add sdio1 DT entry for STM32F769 Discovery board >>>_ add SDMMC2 entry in stm32f7-rcc.h >>>_ replace sdio2 hard coded value in stm32f746.dtsi >>> >>> v2: _ rename sdio_pins / sdio_od_pins to sdio_pins_a / sdio_od_pins_a >>> and update board dts files accordingly. >>> >>> >>> Patrice Chotard (6): >>> ARM: dts: stm32: Add sdio pins definition for stm32f7 >>> ARM: dts: stm32: Enable sdio1 for stm32f746-disco >>> ARM: dts: stm32: Enable sdio1 for stm32f746-eval >>> ARM: dts: stm32: Enable sdio1 for stm32f769-disco >>> dt-bindings: mfd: Add STM32F7 SDMMC2 rcc entry >>> ARM: dts: stm32: Fix sdio2 rcc hard coded value >>> >>>arch/arm/boot/dts/stm32746g-eval.dts | 17 ++ >>>arch/arm/boot/dts/stm32f7-pinctrl.dtsi | 62 >>> ++ >>>arch/arm/boot/dts/stm32f746-disco.dts | 19 +++ >>>arch/arm/boot/dts/stm32f746.dtsi | 2 +- >>>arch/arm/boot/dts/stm32f769-disco.dts | 19 +++ >>>include/dt-bindings/mfd/stm32f7-rcc.h | 1 + >>>6 files changed, 119 insertions(+), 1 deletion(-) >>> >> Series applied on stm32-next. > > Even the MFD patch? > Yes, the MFD part has been taken by Alex. Patrice
Re: [PATCH v2 3/3] tty: st-asc: Update tty alias
Hi Rob On 03/06/2018 02:29 PM, Rob Herring wrote: > On Tue, Mar 6, 2018 at 2:07 AM, wrote: >> From: Patrice Chotard >> >> Since dtc v1.4.6-9-gaadd0b65c987, aliases property name >> must include only lowercase and '-'. >> >> After having updated all STi boards serial aliases from "ttyASN" >> to "serialN", st-asc driver need to be updated accordingly as tty >> aliases id is retrieved using of_alias_get_id(np, ASC_SERIAL_NAME); > > Again, changing the tty name breaks userspace. You can't do that. > > You need to do something like this: > > diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c > index c763253514e9..5f9f01fac6dd 100644 > --- a/drivers/tty/serial/st-asc.c > +++ b/drivers/tty/serial/st-asc.c > @@ -782,7 +782,9 @@ static struct asc_port *asc_of_get_asc_port(struct > platform_device *pdev) > if (!np) > return NULL; > > - id = of_alias_get_id(np, ASC_SERIAL_NAME); > + id = of_alias_get_id(np, "serial"); > + if (id < 0) > + id = of_alias_get_id(np, ASC_SERIAL_NAME); > > if (id < 0) > id = 0; > I will fix this too Patrice
Re: [PATCH v2 2/3] ARM: dts: STi: Remove useless stdout-path for STi boards
Hi Rob On 03/06/2018 02:26 PM, Rob Herring wrote: > On Tue, Mar 6, 2018 at 2:07 AM, wrote: >> From: Patrice Chotard >> >> As serial interface is already specified into bootargs, >> stdout-path can be removed. > > Wrong way around. stdout-path is preferred over using console in bootargs. Ah sorry, i misunderstood what you previously suggested. I will fix it. Thanks Patrice > >> >> Signed-off-by: Patrice Chotard >> --- >> >> v2: _ none >> >> arch/arm/boot/dts/stih407-b2120.dts | 1 - >> arch/arm/boot/dts/stih410-b2120.dts | 1 - >> arch/arm/boot/dts/stih410-b2260.dts | 1 - >> arch/arm/boot/dts/stih418-b2199.dts | 1 - >> 4 files changed, 4 deletions(-) >> >> diff --git a/arch/arm/boot/dts/stih407-b2120.dts >> b/arch/arm/boot/dts/stih407-b2120.dts >> index 2c4d6033b448..074b4cd0ca89 100644 >> --- a/arch/arm/boot/dts/stih407-b2120.dts >> +++ b/arch/arm/boot/dts/stih407-b2120.dts >> @@ -15,7 +15,6 @@ >> >> chosen { >> bootargs = "console=serial0,115200 clk_ignore_unused"; >> - stdout-path = &sbc_serial0; >> }; >> >> memory@4000 { >> diff --git a/arch/arm/boot/dts/stih410-b2120.dts >> b/arch/arm/boot/dts/stih410-b2120.dts >> index 5422850641e8..eae3050984d0 100644 >> --- a/arch/arm/boot/dts/stih410-b2120.dts >> +++ b/arch/arm/boot/dts/stih410-b2120.dts >> @@ -15,7 +15,6 @@ >> >> chosen { >> bootargs = "console=serial0,115200 clk_ignore_unused"; >> - stdout-path = &sbc_serial0; >> }; >> >> memory@4000 { >> diff --git a/arch/arm/boot/dts/stih410-b2260.dts >> b/arch/arm/boot/dts/stih410-b2260.dts >> index ca347160e35d..c26e388bd1a4 100644 >> --- a/arch/arm/boot/dts/stih410-b2260.dts >> +++ b/arch/arm/boot/dts/stih410-b2260.dts >> @@ -16,7 +16,6 @@ >> >> chosen { >> bootargs = "console=serial1,115200 clk_ignore_unused"; >> - stdout-path = &uart1; >> }; >> >> memory@4000 { >> diff --git a/arch/arm/boot/dts/stih418-b2199.dts >> b/arch/arm/boot/dts/stih418-b2199.dts >> index dbf7bb704a1a..d948f774fee7 100644 >> --- a/arch/arm/boot/dts/stih418-b2199.dts >> +++ b/arch/arm/boot/dts/stih418-b2199.dts >> @@ -15,7 +15,6 @@ >> >> chosen { >> bootargs = "console=serial0,115200 clk_ignore_unused"; >> - stdout-path = &sbc_serial0; >> }; >> >> memory@4000 { >> -- >> 1.9.1 >>
Re: [PATCH 1/2] ARM: dts: STi: Fix aliases property name for STi boards
Hi Rob On 03/05/2018 04:28 PM, Rob Herring wrote: > On Mon, Mar 5, 2018 at 9:00 AM, wrote: >> From: Patrice Chotard >> >> Since dtc v1.4.6-9-gaadd0b65c987, aliases property name must >> be lowercase only. >> This allows to fix following warnings when compiling dtb >> with W=1 option : > > I'm so glad to see fixes before the dtc update landed in the kernel tree! ;-) > >> arch/arm/boot/dts/stih418-b2199.dtb: Warning (alias_paths): /aliases: >> aliases property name must include only lowercase and '-' >> arch/arm/boot/dts/stih407-b2120.dtb: Warning (alias_paths): /aliases: >> aliases property name must include only lowercase and '-' >> arch/arm/boot/dts/stih410-b2260.dtb: Warning (alias_paths): /aliases: >> aliases property name must include only lowercase and '-' >> arch/arm/boot/dts/stih410-b2120.dtb: Warning (alias_paths): /aliases: >> aliases property name must include only lowercase and '-' >> >> Signed-off-by: Patrice Chotard >> --- >> arch/arm/boot/dts/stih407-b2120.dts | 4 ++-- >> arch/arm/boot/dts/stih410-b2120.dts | 4 ++-- >> arch/arm/boot/dts/stih410-b2260.dts | 4 ++-- >> arch/arm/boot/dts/stih418-b2199.dts | 4 ++-- >> 4 files changed, 8 insertions(+), 8 deletions(-) >> >> diff --git a/arch/arm/boot/dts/stih407-b2120.dts >> b/arch/arm/boot/dts/stih407-b2120.dts >> index c8ad905d0309..fa1186af6574 100644 >> --- a/arch/arm/boot/dts/stih407-b2120.dts >> +++ b/arch/arm/boot/dts/stih407-b2120.dts >> @@ -14,7 +14,7 @@ >> compatible = "st,stih407-b2120", "st,stih407"; >> >> chosen { >> - bootargs = "console=ttyAS0,115200 clk_ignore_unused"; >> + bootargs = "console=ttyas0,115200 clk_ignore_unused"; > > The kernel change for this is an ABI breakage both DT <-> kernel and > kernel <-> userspace. > > Really, if you are okay with doing this, you should change it to ttySx IMO. OK i will use serialN instead > >> linux,stdout-path = &sbc_serial0; > > And since you have this, you don't even need the console praram. Ok, i will remove stdout-path in an additional patch > >> }; >> >> @@ -24,7 +24,7 @@ >> }; >> >> aliases { >> - ttyAS0 = &sbc_serial0; >> + ttyas0 = &sbc_serial0; > > The correct fix is use "serialN" for aliases. Ok > > I have a check for only known alias names which would give a better > warning, but David thought it was too restrictive. > >> ethernet0 = ðernet0; >> }; >> Thanks Patrice
Re: [PATCH 1/6] ARM: dts: stm32: Add sdio pins definition for stm32f7
Hi Alex On 03/01/2018 10:51 AM, Alexandre Torgue wrote: > Hi Patrice > > On 03/01/2018 10:43 AM, patrice.chot...@st.com wrote: >> From: Patrice Chotard >> >> Add sdio pins definition for the 2 sdio instances embeds in stm32f746. >> >> Signed-off-by: Patrice Chotard >> --- >> arch/arm/boot/dts/stm32f7-pinctrl.dtsi | 62 >> ++ >> 1 file changed, 62 insertions(+) >> >> diff --git a/arch/arm/boot/dts/stm32f7-pinctrl.dtsi >> b/arch/arm/boot/dts/stm32f7-pinctrl.dtsi >> index f518de184e52..fb40f0835dd4 100644 >> --- a/arch/arm/boot/dts/stm32f7-pinctrl.dtsi >> +++ b/arch/arm/boot/dts/stm32f7-pinctrl.dtsi >> @@ -222,6 +222,68 @@ >> slew-rate = <2>; >> }; >> }; >> + >> + sdio_pins: sdio_pins@0 { >> + pins { >> + pinmux = , /* SDMMC1 >> D0 */ >> + , /* SDMMC1 D1 */ >> + , /* SDMMC1 D2 */ >> + , /* SDMMC1 D3 */ >> + , /* SDMMC1 CLK */ >> + ; /* SDMMC1 CMD */ >> + drive-push-pull; >> + slew-rate = <2>; >> + }; >> + }; > > if you have 2 pins groups, please use '_a' for the first one. You could > have something like: > > sdio_pins_a > sdio_od_pins_a > > and > > sdio_pins_b > sdio_od_pins_b Ok, i prepare a v2 Thanks Patrice > >> + sdio_pins_od: sdio_pins_od@0 { >> + pins1 { >> + pinmux = , /* SDMMC1 >> D0 */ >> + , /* SDMMC1 D1 */ >> + , /* SDMMC1 D2 */ >> + , /* SDMMC1 D3 */ >> + ; /* SDMMC1 CLK */ >> + drive-push-pull; >> + slew-rate = <2>; >> + }; >> + >> + pins2 { >> + pinmux = ; /* SDMMC1 >> CMD */ >> + drive-open-drain; >> + slew-rate = <2>; >> + }; >> + }; >> + >> + sdio_pins_b: sdio_pins_b@0 { >> + pins { >> + pinmux = , /* SDMMC2 >> D0 */ >> + , /* SDMMC2 D1 */ >> + , /* SDMMC2 D2 */ >> + , /* SDMMC2 D3 */ >> + , /* SDMMC2 CLK */ >> + ; /* SDMMC2 CMD */ >> + drive-push-pull; >> + slew-rate = <2>; >> + }; >> + }; >> + >> + sdio_pins_od_b: sdio_pins_od_b@0 { >> + pins1 { >> + pinmux = , /* SDMMC2 >> D0 */ >> + , /* SDMMC2 D1 */ >> + , /* SDMMC2 D2 */ >> + , /* SDMMC2 D3 */ >> + ; /* SDMMC2 CLK */ >> + drive-push-pull; >> + slew-rate = <2>; >> + }; >> + >> + pins2 { >> + pinmux = ; /* SDMMC2 >> CMD */ >> + drive-open-drain; >> + slew-rate = <2>; >> + }; >> + }; >> }; >> }; >> }; >>
Re: [PATCH v2 14/15] clk: stm32: Add clk entry for SDMMC2 on stm32F769
Hi Linus On 03/01/2018 10:12 AM, Linus Walleij wrote: > On Mon, Feb 26, 2018 at 9:41 AM, Patrice CHOTARD > wrote: > >> Hi Stephen, Michael >> >> It's a gentle reminder as this patch is present on mailing list and >> acked-by since 01/12/2018 > > You need Stephen's new kernel.org mail address to reach him. > (Added on TO:) Thanks ! Patrice > > Yours, > Linus Walleij >
Re: [PATCH v2 14/15] clk: stm32: Add clk entry for SDMMC2 on stm32F769
Hi Stephen, Michael It's a gentle reminder as this patch is present on mailing list and acked-by since 01/12/2018 Thanks Patrice On 01/16/2018 01:30 PM, patrice.chot...@st.com wrote: > From: Patrice Chotard > > STM32F769 has 2 SDMMC port, add clock entry for the second one. > > Signed-off-by: Alexandre TORGUE > Signed-off-by: Patrice Chotard > Acked-by: Stephen Boyd > --- > > v2 _ Add Acked-by > > drivers/clk/clk-stm32f4.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c > index 96c6b6b..8f8a178 100644 > --- a/drivers/clk/clk-stm32f4.c > +++ b/drivers/clk/clk-stm32f4.c > @@ -282,6 +282,7 @@ struct stm32f4_gate_data { > > { STM32F4_RCC_APB2ENR, 0, "tim1", "apb2_mul" }, > { STM32F4_RCC_APB2ENR, 1, "tim8", "apb2_mul" }, > + { STM32F4_RCC_APB2ENR, 7, "sdmmc2", "sdmux"}, > { STM32F4_RCC_APB2ENR, 8, "adc1", "apb2_div" }, > { STM32F4_RCC_APB2ENR, 9, "adc2", "apb2_div" }, > { STM32F4_RCC_APB2ENR, 10, "adc3", "apb2_div" }, > @@ -315,7 +316,7 @@ struct stm32f4_gate_data { > > static const u64 stm32f746_gate_map[MAX_GATE_MAP] = { 0x00f17ef417ffull, > 0x0003ull, > - 0x04f77f033e01c9ffull }; > + 0x04f77f833e01c9ffull }; > > static const u64 *stm32f4_gate_map; > >
[GIT PULL] STi DT update for v4.17 round 1
Hi Arnd, Kevin, Olof PLease consider this first round of STi dts update for v4.17 : The following changes since commit 7928b2cbe55b2a410a0f5c1f154610059c57b1b2: Linux 4.16-rc1 (2018-02-11 15:04:29 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti.git for you to fetch changes up to 0e04ce02e6a2ac30d21294d8bb2aeceb8489e52b: ARM: dts: STi: Remove unused clk_ext2f_a9 clock (2018-02-13 13:31:38 +0100) warn: You locally have sti-dt-for-v4.17-round1 but it does not (yet) warn: appear to be at git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti.git warn: Do you want to push it there, perhaps? warning: refname 'sti-dt-for-v4.17-round1' is ambiguous. STi dts update: Fix all DT dtc warnings when building with W=1 For most of implicated node, the addition of a fake reg property fixes these warnings. For others nodes, their location in device tree have been updated. -------- Patrice Chotard (11): ARM: dts: STi: Fix bindings notation ARM: dts: STi: Move leds node outside soc node ARM: dts: STi: Add fake reg property for sti-display-subsystem ARM: dts: STi: Add fake reg property for miphy28lp_phy ARM: dts: STi: Add fake reg property for irq-syscfg ARM: dts: STi: Add fake reg property for remote processors ARM: dts: STi: Add fake reg for restart, powerdown and picophy/softreset ARM: dts: STi: Add fake reg property for usb2_picophyX nodes ARM: dts: STi: Update sound related nodes location ARM: dts: STi: Update clocks node location ARM: dts: STi: Remove unused clk_ext2f_a9 clock arch/arm/boot/dts/stih407-b2120.dts| 2 +- arch/arm/boot/dts/stih407-clock.dtsi | 92 +++- arch/arm/boot/dts/stih407-family.dtsi | 42 ++- arch/arm/boot/dts/stih407-pinctrl.dtsi | 10 +-- arch/arm/boot/dts/stih407.dtsi | 4 +- arch/arm/boot/dts/stih410-b2120.dts| 8 +-- arch/arm/boot/dts/stih410-b2260.dts| 89 --- arch/arm/boot/dts/stih410-clock.dtsi | 96 +++-- arch/arm/boot/dts/stih410-pinctrl.dtsi | 2 +- arch/arm/boot/dts/stih410.dtsi | 13 ++-- arch/arm/boot/dts/stih418-b2199.dts| 30 arch/arm/boot/dts/stih418-clock.dtsi | 95 +++-- arch/arm/boot/dts/stih418.dtsi | 6 +- arch/arm/boot/dts/stihxxx-b2120.dtsi | 126 + 14 files changed, 300 insertions(+), 315 deletions(-)
Re: [PATCH v2 10/12] ARM: dts: STi: Add fake reg property for clocks
Hi Rob On 02/12/2018 04:22 PM, Rob Herring wrote: > On Mon, Feb 12, 2018 at 8:43 AM, wrote: >> From: Patrice Chotard >> >> For all clock's element inside SoC, add a fake reg property, >> this allows to fix the following warnings when compiling >> dtb with W=1 option : >> >> arch/arm/boot/dts/stih410-b2120.dtb: Warning (simple_bus_reg): >> Node /clocks/clk-m-a9-periphs missing or empty reg/ranges property >> arch/arm/boot/dts/stih410-b2120.dtb: Warning (simple_bus_reg): >> Node /clocks/clk-m-a9-ext2f-div2s missing or empty reg/ranges property >> arch/arm/boot/dts/stih410-b2120.dtb: Warning (simple_bus_reg): >> Node /clocks/clk-tmdsout-hdmi missing or empty reg/ranges property >> >> arch/arm/boot/dts/stih410-b2260.dtb: Warning (simple_bus_reg): >> Node /clocks/clk-m-a9-periphs missing or empty reg/ranges property >> arch/arm/boot/dts/stih410-b2260.dtb: Warning (simple_bus_reg): >> Node /clocks/clk-m-a9-ext2f-div2s missing or empty reg/ranges property >> arch/arm/boot/dts/stih410-b2260.dtb: Warning (simple_bus_reg): >> Node /clocks/clk-tmdsout-hdmi missing or empty reg/ranges property >> >> arch/arm/boot/dts/stih418-b2199.dtb: Warning (simple_bus_reg): >> Node /clocks/clk-m-a9-periphs missing or empty reg/ranges property >> arch/arm/boot/dts/stih418-b2199.dtb: Warning (simple_bus_reg): >> Node /clocks/clk-m-a9-ext2f-div2s missing or empty reg/ranges property >> arch/arm/boot/dts/stih418-b2199.dtb: Warning (simple_bus_reg): >> Node /clocks/clk-tmdsout-hdmi missing or empty reg/ranges property >> >> Signed-off-by: Patrice Chotard >> --- >> >> v2: _ add a fake reg property to node without reg property. >> >> arch/arm/boot/dts/stih407-clock.dtsi | 9 ++--- >> arch/arm/boot/dts/stih410-clock.dtsi | 9 ++--- >> arch/arm/boot/dts/stih418-clock.dtsi | 9 ++--- >> 3 files changed, 18 insertions(+), 9 deletions(-) >> >> diff --git a/arch/arm/boot/dts/stih407-clock.dtsi >> b/arch/arm/boot/dts/stih407-clock.dtsi >> index b882dcf3a649..1bba47e06ebe 100644 >> --- a/arch/arm/boot/dts/stih407-clock.dtsi >> +++ b/arch/arm/boot/dts/stih407-clock.dtsi >> @@ -24,9 +24,10 @@ >> /* >> * ARM Peripheral clock for timers >> */ >> - arm_periph_clk: clk-m-a9-periphs { >> + arm_periph_clk: clk-m-a9-periphs@0 { >> #clock-cells = <0>; >> compatible = "fixed-factor-clock"; >> + reg = <0 0>; > > Don't do this. The correct fix is change the location of these nodes > to be under whatever controls them. > Ok i will put this node as a child of clockgen-a9@92b Thanks Patrice > Rob >
Re: [PATCH v2 09/12] ARM: dts: STi: Add fake reg property for sound related nodes
Hi Rob On 02/12/2018 04:40 PM, Rob Herring wrote: > On Mon, Feb 12, 2018 at 8:43 AM, wrote: >> From: Patrice Chotard >> >> Add fake reg property to sound, simple-audio-card, dai-link and >> sti_sasg_codec nodes, this allows to fix the following warning >> when compiling dtb with W=1 option: >> >> arch/arm/boot/dts/stih407-b2120.dtb: Warning (unit_address_vs_reg): >> Node /soc/sound/simple-audio-card,dai-link@0 has a unit name, but no reg >> property >> arch/arm/boot/dts/stih407-b2120.dtb: Warning (unit_address_vs_reg): >> Node /soc/sound/simple-audio-card,dai-link@1 has a unit name, but no reg >> property >> arch/arm/boot/dts/stih407-b2120.dtb: Warning (unit_address_vs_reg): >> Node /soc/sound/simple-audio-card,dai-link@2 has a unit name, but no reg >> property >> arch/arm/boot/dts/stih410-b2120.dtb: Warning (simple_bus_reg): >> Node /soc/sti-sasg-codec missing or empty reg/ranges property >> >> arch/arm/boot/dts/stih410-b2120.dtb: Warning (unit_address_vs_reg): >> Node /soc/sound/simple-audio-card,dai-link@0 has a unit name, but no reg >> property >> arch/arm/boot/dts/stih410-b2120.dtb: Warning (unit_address_vs_reg): >> Node /soc/sound/simple-audio-card,dai-link@1 has a unit name, but no reg >> property >> arch/arm/boot/dts/stih410-b2120.dtb: Warning (unit_address_vs_reg): >> Node /soc/sound/simple-audio-card,dai-link@2 has a unit name, but no reg >> property >> arch/arm/boot/dts/stih407-b2120.dtb: Warning (simple_bus_reg): >> Node /soc/sound missing or empty reg/ranges property >> arch/arm/boot/dts/stih410-b2120.dtb: Warning (simple_bus_reg): >> Node /soc/sti-sasg-codec missing or empty reg/ranges property >> >> arch/arm/boot/dts/stih410-b2260.dtb: Warning (unit_address_vs_reg): >> Node /soc/sound/simple-audio-card,dai-link@0 has a unit name, but no reg >> property >> arch/arm/boot/dts/stih410-b2260.dtb: Warning (simple_bus_reg): >> Node /soc/sti-sasg-codec missing or empty reg/ranges property >> arch/arm/boot/dts/stih410-b2260.dtb: Warning (simple_bus_reg): >> Node /soc/sound missing or empty reg/ranges property >> >> arch/arm/boot/dts/stih418-b2199.dtb: Warning (simple_bus_reg): >> Node /soc/sti-sasg-codec missing or empty reg/ranges property >> >> Signed-off-by: Patrice Chotard >> --- >> >> v2: _ add a fake reg property to node without reg property. >> >> arch/arm/boot/dts/stih407-family.dtsi | 3 ++- >> arch/arm/boot/dts/stih410-b2260.dts | 5 +++-- >> arch/arm/boot/dts/stihxxx-b2120.dtsi | 11 ++- >> 3 files changed, 11 insertions(+), 8 deletions(-) >> >> diff --git a/arch/arm/boot/dts/stih407-family.dtsi >> b/arch/arm/boot/dts/stih407-family.dtsi >> index 5df827b00eb6..df1a3f1dc5a7 100644 >> --- a/arch/arm/boot/dts/stih407-family.dtsi >> +++ b/arch/arm/boot/dts/stih407-family.dtsi >> @@ -894,8 +894,9 @@ >> status = "disabled"; >> }; >> >> - sti_sasg_codec: sti-sasg-codec { >> + sti_sasg_codec: sti-sasg-codec@0 { >> compatible = "st,stih407-sas-codec"; >> + reg = <0 0>; >> #sound-dai-cells = <1>; >> status = "disabled"; >> st,syscfg = <&syscfg_core>; > > This should probably be a child of syscfg to fix this. And if this > block has a dedicated set of registers, then use reg to define those > (even though regmap/syscon doesn't need it). Ok, i will mode this node > >> diff --git a/arch/arm/boot/dts/stih410-b2260.dts >> b/arch/arm/boot/dts/stih410-b2260.dts >> index 8bcd58118dba..03d05a98b7fc 100644 >> --- a/arch/arm/boot/dts/stih410-b2260.dts >> +++ b/arch/arm/boot/dts/stih410-b2260.dts >> @@ -181,12 +181,13 @@ >> status = "okay"; >> }; >> >> - sound { >> + sound: sound@0 { > > I'd move this up to top level. Ok Thanks Patrice > > Rob >
Re: [PATCH 2/5] pinctrl: stm32: add STM32F769 MCU support
Hi Linus It's a gentle reminder because this patch seems not yet merged in any of your pinctrl branch. Thanks Patrice On 12/11/2017 09:54 AM, Alexandre Torgue wrote: > This patch which adds STM32F769 pinctrl and GPIO support, relies on the > generic STM32 pinctrl driver. > > Signed-off-by: Alexandre Torgue > > diff --git a/drivers/pinctrl/stm32/Kconfig b/drivers/pinctrl/stm32/Kconfig > index 7e1fe39..397f8c1 100644 > --- a/drivers/pinctrl/stm32/Kconfig > +++ b/drivers/pinctrl/stm32/Kconfig > @@ -27,6 +27,12 @@ config PINCTRL_STM32F746 > default MACH_STM32F746 > select PINCTRL_STM32 > > +config PINCTRL_STM32F769 > + bool "STMicroelectronics STM32F769 pin control" if COMPILE_TEST && > !MACH_STM32F769 > + depends on OF > + default MACH_STM32F769 > + select PINCTRL_STM32 > + > config PINCTRL_STM32H743 > bool "STMicroelectronics STM32H743 pin control" if COMPILE_TEST && > !MACH_STM32H743 > depends on OF > diff --git a/drivers/pinctrl/stm32/Makefile b/drivers/pinctrl/stm32/Makefile > index d13ca35..7d63e4a 100644 > --- a/drivers/pinctrl/stm32/Makefile > +++ b/drivers/pinctrl/stm32/Makefile > @@ -6,4 +6,5 @@ obj-$(CONFIG_PINCTRL_STM32) += pinctrl-stm32.o > obj-$(CONFIG_PINCTRL_STM32F429) += pinctrl-stm32f429.o > obj-$(CONFIG_PINCTRL_STM32F469) += pinctrl-stm32f469.o > obj-$(CONFIG_PINCTRL_STM32F746) += pinctrl-stm32f746.o > +obj-$(CONFIG_PINCTRL_STM32F769) += pinctrl-stm32f769.o > obj-$(CONFIG_PINCTRL_STM32H743) += pinctrl-stm32h743.o > diff --git a/drivers/pinctrl/stm32/pinctrl-stm32f769.c > b/drivers/pinctrl/stm32/pinctrl-stm32f769.c > new file mode 100644 > index 000..f81c51c > --- /dev/null > +++ b/drivers/pinctrl/stm32/pinctrl-stm32f769.c > @@ -0,0 +1,1827 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (C) STMicroelectronics 2017 > + * Author: Alexandre Torgue for > STMicroelectronics. > + */ > +#include > +#include > +#include > + > +#include "pinctrl-stm32.h" > + > +static const struct stm32_desc_pin stm32f769_pins[] = { > + STM32_PIN( > + PINCTRL_PIN(0, "PA0"), > + STM32_FUNCTION(0, "GPIOA0"), > + STM32_FUNCTION(2, "TIM2_CH1 TIM2_ETR"), > + STM32_FUNCTION(3, "TIM5_CH1"), > + STM32_FUNCTION(4, "TIM8_ETR"), > + STM32_FUNCTION(8, "USART2_CTS"), > + STM32_FUNCTION(9, "UART4_TX"), > + STM32_FUNCTION(11, "SAI2_SD_B"), > + STM32_FUNCTION(12, "ETH_MII_CRS"), > + STM32_FUNCTION(16, "EVENTOUT"), > + STM32_FUNCTION(17, "ANALOG") > + ), > + STM32_PIN( > + PINCTRL_PIN(1, "PA1"), > + STM32_FUNCTION(0, "GPIOA1"), > + STM32_FUNCTION(2, "TIM2_CH2"), > + STM32_FUNCTION(3, "TIM5_CH2"), > + STM32_FUNCTION(8, "USART2_RTS"), > + STM32_FUNCTION(9, "UART4_RX"), > + STM32_FUNCTION(10, "QUADSPI_BK1_IO3"), > + STM32_FUNCTION(11, "SAI2_MCLK_B"), > + STM32_FUNCTION(12, "ETH_MII_RX_CLK ETH_RMII_REF_CLK"), > + STM32_FUNCTION(15, "LCD_R2"), > + STM32_FUNCTION(16, "EVENTOUT"), > + STM32_FUNCTION(17, "ANALOG") > + ), > + STM32_PIN( > + PINCTRL_PIN(2, "PA2"), > + STM32_FUNCTION(0, "GPIOA2"), > + STM32_FUNCTION(2, "TIM2_CH3"), > + STM32_FUNCTION(3, "TIM5_CH3"), > + STM32_FUNCTION(4, "TIM9_CH1"), > + STM32_FUNCTION(8, "USART2_TX"), > + STM32_FUNCTION(9, "SAI2_SCK_B"), > + STM32_FUNCTION(12, "ETH_MDIO"), > + STM32_FUNCTION(13, "MDIOS_MDIO"), > + STM32_FUNCTION(15, "LCD_R1"), > + STM32_FUNCTION(16, "EVENTOUT"), > + STM32_FUNCTION(17, "ANALOG") > + ), > + STM32_PIN( > + PINCTRL_PIN(3, "PA3"), > + STM32_FUNCTION(0, "GPIOA3"), > + STM32_FUNCTION(2, "TIM2_CH4"), > + STM32_FUNCTION(3, "TIM5_CH4"), > + STM32_FUNCTION(4, "TIM9_CH2"), > + STM32_FUNCTION(8, "USART2_RX"), > + STM32_FUNCTION(10, "LCD_B2"), > + STM32_FUNCTION(11, "OTG_HS_ULPI_D0"), > + STM32_FUNCTION(12, "ETH_MII_COL"), > + STM32_FUNCTION(15, "LCD_B5"), > + STM32_FUNCTION(16, "EVENTOUT"), > + STM32_FUNCTION(17, "ANALOG") > + ), > + STM32_PIN( > + PINCTRL_PIN(4, "PA4"), > + STM32_FUNCTION(0, "GPIOA4"), > + STM32_FUNCTION(6, "SPI1_NSS I2S1_WS"), > + STM32_FUNCTION(7, "SPI3_NSS I2S3_WS"), > + STM32_FUNCTION(8, "USART2_CK"), > + STM32_FUNCTION(9, "SPI6_NSS"), > + STM32_FUNCTION(13, "OTG_HS_SOF"), > + STM32_FUNCTION(14, "DCMI_HSYNC"), > + STM32_FUNCTION(15, "LCD_VSYNC"), > + STM32_FUNCTION(16, "EVENTOUT"), > + STM32_FUNCTION(17, "ANALOG") > + ), > + STM32_PI
Re: [PATCH v2 04/15] mmc: mmci: Add support for setting pad type via pinctrl
Hi Ulf On 01/17/2018 10:34 AM, Ulf Hansson wrote: > [...] > >> /* >> @@ -1616,6 +1625,32 @@ static int mmci_probe(struct amba_device *dev, >> host = mmc_priv(mmc); >> host->mmc = mmc; >> >> + /* >> +* Some variant (STM32) doesn't have opendrain bit, nevertheless >> +* pins can be set accordingly using pinctrl >> +*/ >> + if (!variant->opendrain) { >> + host->pinctrl = devm_pinctrl_get(&dev->dev); >> + if (IS_ERR(host->pinctrl)) { >> + dev_err(&dev->dev, "failed to get pinctrl"); >> + goto host_free; >> + } >> + >> + host->pins_default = pinctrl_lookup_state(host->pinctrl, >> + >> PINCTRL_STATE_DEFAULT); >> + if (IS_ERR(host->pins_default)) { >> + dev_warn(mmc_dev(mmc), "Can't select default >> pins\n"); >> + host->pins_default = NULL; > > This is wrong, I think you should bail out and return the error code instead. Ok > > Moreover, calling pinctrl_select_state() from ->set_ios by using a > NULL state, will likely trigger a NULL pointer deference bug in the > pinctrl layer. Regarding pinctrl_select_state() call with a NULL state, this case is managed inside pinctrl_state(), but ok, it will be more elegant to exit directly in case of no DT pins definition found. > >> + } >> + >> + host->pins_opendrain = pinctrl_lookup_state(host->pinctrl, >> + >> MMCI_PINCTRL_STATE_OPENDRAIN); >> + if (IS_ERR(host->pins_opendrain)) { >> + dev_warn(mmc_dev(mmc), "Can't select opendrain >> pins\n"); >> + host->pins_opendrain = NULL; > > Ditto. ok Thanks Patrice > >> + } >> + } >> + > > [...] > > Kind regards > Uffe >
Re: [PATCH v2 03/15] mmc: mmci: Don't pretend all variants to have OPENDRAIN bit
Hi Ulf On 01/17/2018 10:33 AM, Ulf Hansson wrote: > [...] > >> /* Busy detection for the ST Micro variant */ >> @@ -1455,16 +1465,13 @@ static void mmci_set_ios(struct mmc_host *mmc, >> struct mmc_ios *ios) >> ~MCI_ST_DATA2DIREN); >> } >> >> - if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) { >> - if (host->hw_designer != AMBA_VENDOR_ST) >> - pwr |= MCI_ROD; >> - else { >> - /* >> -* The ST Micro variant use the ROD bit for something >> -* else and only has OD (Open Drain). >> -*/ >> - pwr |= MCI_OD; >> - } >> + if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN && >> + host->variant->opendrain) { > > A few nitpicks (because I anyway had some comment on patch4): > > The above can be written on one line and the brackets isn't needed. > > Replace host->variant->opendrain with variant->opendrain. The same > applies to the below change. Ah yes, i will fix it > >> + /* >> +* The ST Micro variant use the ROD bit for >> +* something else and only has OD (Open Drain). >> +*/ > > I think we can remove this comment, as this information becomes > implicit when we start using the variant data. Ok Thanks Patrice > >> + pwr |= host->variant->opendrain; >> } >> >> /* >> -- >> 1.9.1 >> > > Kind regards > Uffe >
Re: [PATCH 2/7] ARM: dts: STi: Add gpio polarity for "hdmi,hpd-gpio" property
Hi Arnd On 01/15/2018 03:59 PM, Arnd Bergmann wrote: > On Wed, Jan 10, 2018 at 9:21 AM, wrote: >> From: Patrice Chotard >> >> The GPIO polarity is missing in the hdmi,hpd-gpio property, this >> fixes the following DT warnings: >> >> arch/arm/boot/dts/stih410-b2120.dtb: Warning (gpios_property): hdmi,hpd-gpio >> property >> size (8) too small for cell size 2 in >> /soc/sti-display-subsystem/sti-hdmi@8d04000 >> >> arch/arm/boot/dts/stih407-b2120.dtb: Warning (gpios_property): hdmi,hpd-gpio >> property >> size (8) too small for cell size 2 in >> /soc/sti-display-subsystem/sti-hdmi@8d04000 >> >> arch/arm/boot/dts/stih410-b2260.dtb: Warning (gpios_property): hdmi,hpd-gpio >> property >> size (8) too small for cell size 2 in >> /soc/sti-display-subsystem/sti-hdmi@8d04000 >> >> Signed-off-by: Patrice Chotard > > Olof has picked up a number of other dtc warning fixes into next/dt, > so I ended up > adding this to the same place rather than our fixes branch, but added > a Cc:stable > tag. We now have just one warning left in arm-soc, and I think Linus > Walleij will > send a patch for that soon. > > Please send a pull request for the remaining commits from the STi > series, thanks! Ok thanks Patrice > >Arnd >
Re: [PATCH 03/14] mmc: mmci: Add support for setting pad type via pinctrl
Hi Ulf On 01/15/2018 01:43 PM, Ulf Hansson wrote: > On 12 January 2018 at 13:15, wrote: >> From: Patrice Chotard >> >> The STM32 variant hasn't the control bit to switch pads in opendrain mode. >> In this case we can achieve the same result by asking to the pinmux driver >> to configure pins for us. >> >> This patch make the mmci driver able to do this whenever needed. >> >> Signed-off-by: Andrea Merello >> Signed-off-by: Patrice Chotard >> --- >> drivers/mmc/host/mmci.c | 54 >> - >> drivers/mmc/host/mmci.h | 5 + >> 2 files changed, 50 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c >> index 7e56f85..38e8c20 100644 >> --- a/drivers/mmc/host/mmci.c >> +++ b/drivers/mmc/host/mmci.c >> @@ -85,6 +85,8 @@ >>* @mmcimask1: true if variant have a MMCIMASK1 register. >>* @start_err: true is the variant has STARTBITERR bit inside MMCISTATUS >>*register. >> + * @opendrain: true if variant have dedicated bit for opendrain pins >> + *configuration. >>*/ >> struct variant_data { >> unsigned intclkreg; >> @@ -116,6 +118,7 @@ struct variant_data { >> boolreversed_irq_handling; >> boolmmcimask1; >> boolstart_err; >> + boolopendrain; > > Similar comment as for patch2. > > To be consistent with how we implement support for similar variant > variations, I would prefer to have this being a u32. Something along > the lines of how the "busy_detect_flag" is being used. ok > > [...] > >> @@ -1394,9 +1405,11 @@ static void mmci_set_ios(struct mmc_host *mmc, struct >> mmc_ios *ios) >> { >> struct mmci_host *host = mmc_priv(mmc); >> struct variant_data *variant = host->variant; >> + struct pinctrl_state *pins; >> u32 pwr = 0; >> unsigned long flags; >> int ret; >> + bool is_opendrain; >> >> if (host->plat->ios_handler && >> host->plat->ios_handler(mmc_dev(mmc), ios)) >> @@ -1455,16 +1468,31 @@ static void mmci_set_ios(struct mmc_host *mmc, >> struct mmc_ios *ios) >> ~MCI_ST_DATA2DIREN); >> } >> >> - if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) { >> - if (host->hw_designer != AMBA_VENDOR_ST) >> - pwr |= MCI_ROD; >> - else { >> - /* >> -* The ST Micro variant use the ROD bit for something >> -* else and only has OD (Open Drain). >> -*/ >> - pwr |= MCI_OD; > > Seems like you should actually split this change into two parts. > > One that adds the variant flag for the open drain bit, when then can > clean up this code. Then a patch on top that starts using pinctrl in > case there is no open drain bit set. > > Does that sounds reasonable? Of course > >> + if (host->variant->opendrain) { >> + if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) { >> + if (host->hw_designer != AMBA_VENDOR_ST) { >> + pwr |= MCI_ROD; >> + } else { >> + /* >> +* The ST Micro variant use the ROD bit for >> +* something else and only has OD (Open >> Drain). >> +*/ >> + pwr |= MCI_OD; >> + } >> } >> + } else { >> + /* >> +* If the variant cannot configure the pads by its own, then >> we >> +* expect the pinctrl to be able to do that for us >> +*/ >> + is_opendrain = (ios->bus_mode == MMC_BUSMODE_OPENDRAIN); >> + pins = pinctrl_lookup_state(host->pinctrl, is_opendrain ? > > How about doing the lookup in ->probe() instead? Then just select the > state here, if supported? ok > >> + MMCI_PINCTRL_STATE_OPENDRAIN : >> + MMCI_PINCTRL_STATE_PUSHPULL); >> + if
Re: [PATCH 02/14] mmc: mmci: Don't pretend all variants to have MCI_STARBITERR flag
Hi Ulf On 01/15/2018 01:32 PM, Ulf Hansson wrote: > On 12 January 2018 at 13:15, wrote: >> From: Patrice Chotard >> >> This patch prepares for supporting the STM32 variant that >> has no such bit in the status register. >> >> Signed-off-by: Andrea Merello >> Signed-off-by: Patrice Chotard >> --- >> drivers/mmc/host/mmci.c | 16 ++-- >> 1 file changed, 14 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c >> index 3125dc0..7e56f85 100644 >> --- a/drivers/mmc/host/mmci.c >> +++ b/drivers/mmc/host/mmci.c >> @@ -83,6 +83,8 @@ >>* @qcom_dml: enables qcom specific dma glue for dma transfers. >>* @reversed_irq_handling: handle data irq before cmd irq. >>* @mmcimask1: true if variant have a MMCIMASK1 register. >> + * @start_err: true is the variant has STARTBITERR bit inside MMCISTATUS >> + *register. >>*/ >> struct variant_data { >> unsigned intclkreg; >> @@ -113,6 +115,7 @@ struct variant_data { >> boolqcom_dml; >> boolreversed_irq_handling; >> boolmmcimask1; >> + boolstart_err; > > To be consistent with how we implement support for similar variant > variations, I would prefer to have this being a u32. Something along > the lines of how the "busy_detect_flag" is being used. OK i will update this in v2 Thanks Patrice > > Otherwise this looks good to me. > > [...] > > Kind regards > Uffe >
Re: [PATCH 04/14] mmc: mmci: Add STM32 variant
Hi Linus On 01/15/2018 02:13 AM, Linus Walleij wrote: > On Fri, Jan 12, 2018 at 1:15 PM, wrote: > >> From: Patrice Chotard >> >> STM32F4 and STM32F7 MCUs has a SDIO controller that looks like >> an ARM pl810. > > PL180 you mean. Ulf can fix while applying. I need to send a v2, i will fix it. > >> This patch adds the STM32 variant so that mmci driver supports it. >> >> Signed-off-by: Andrea Merello >> Signed-off-by: Patrice Chotard > > (...) >> +static struct variant_data variant_stm32 = { >> + .fifosize = 32 * 4, >> + .fifohalfsize = 8 * 4, >> + .clkreg = MCI_CLK_ENABLE, >> + .clkreg_enable = MCI_ST_UX500_HWFCEN, > > If the asic designed derived this from ux500 I guess it is proper. > >> + .clkreg_8bit_bus_enable = MCI_ST_8BIT_BUS, >> + .clkreg_neg_edge_enable = MCI_ST_UX500_NEG_EDGE, >> + .datalength_bits= 24, >> + .datactrl_mask_sdio = MCI_DPSM_ST_SDIOEN, >> + .st_sdio= true, > > Did you test SDIO? I think we lack features for that. no, the board accept only micro SD card, so only MMC mode can be tested. > >> + { >> + .id = 0x00880180, >> + .mask = 0x00ff, >> + .data = &variant_stm32, >> + }, > > Since ux500 was 480180 I wonder what variants 5,6,7 are... What is the rule to define the id ? for ST Micro variants we got the list below : .id = 0x00180180, u300 .id = 0x10180180, nomadik .id = 0x00280180, nomadik .id = 0x00480180, ux500 .id = 0x10480180, ux500v2 .id = 0x00880180, variant_stm32 I simply update the sixth digit for stm32 variant. Patrice > > Reviewed-by: Linus Walleij > > Yours, > Linus Walleij >
Re: [PATCH 0/7] ARM: dts: STi: Fix DT dtc warnings
HI Arnd On 01/10/2018 09:52 PM, Arnd Bergmann wrote: > On Wed, Jan 10, 2018 at 6:17 PM, Patrice CHOTARD > wrote: >> Hi Arnd >> >> On 01/10/2018 04:52 PM, Arnd Bergmann wrote: >>> On Wed, Jan 10, 2018 at 9:21 AM, wrote: >>>> From: Patrice Chotard >>>> >>>> This series fixes all dtc warnings related to STi platforms dt files. >>>> It has been triggered by Rob Herring [1] >>>> >>>> [1] https://www.spinics.net/lists/devicetree/msg206209.html >>>> >>>> For most of implicated node, a simple move outside the soc node >>>> solves the warnings. >>>> >>>> Patrice Chotard (7): >>>> ARM: dts: STi: fix bindings notation >>>> ARM: dts: STi: Add gpio polarity for "hdmi,hpd-gpio" property >>>> ARM: dts: STi: Move clocks without reg outside soc >>>> ARM: dts: STi: Move leds node outside soc node >>>> ARM: dts: STi: Move usb2_picophyX nodes without reg out of soc >>>> ARM: dts: STi: Move sound related nodes without reg out of soc >>>> ARM: dts: STi: Add fake reg property for sti-display-subsystem >>> >>> Thanks a lot for addressing these! >>> >>> As far as I can tell, there is one patch in particular that addresses a >>> warning >>> we get at the default warning level: "ARM: dts: STi: Add gpio polarity for >>> "hdmi,hpd-gpio" property". Should we merge that one for 4.15 to get closer >>> to a clean build again? I'm not sure whether we can address the other >> >> How do you want to proceed with this particular patch ? >> Do you want me to send a pull-request with this patch ? >> >> Patrice > > I'd just pick it up directly into the arm-soc fixes branch if that > works for you. Perfect ;-) Thanks Patrice > > Arnd >
Re: [PATCH 0/7] ARM: dts: STi: Fix DT dtc warnings
Hi Arnd On 01/10/2018 04:52 PM, Arnd Bergmann wrote: > On Wed, Jan 10, 2018 at 9:21 AM, wrote: >> From: Patrice Chotard >> >> This series fixes all dtc warnings related to STi platforms dt files. >> It has been triggered by Rob Herring [1] >> >> [1] https://www.spinics.net/lists/devicetree/msg206209.html >> >> For most of implicated node, a simple move outside the soc node >> solves the warnings. >> >> Patrice Chotard (7): >>ARM: dts: STi: fix bindings notation >>ARM: dts: STi: Add gpio polarity for "hdmi,hpd-gpio" property >>ARM: dts: STi: Move clocks without reg outside soc >>ARM: dts: STi: Move leds node outside soc node >>ARM: dts: STi: Move usb2_picophyX nodes without reg out of soc >>ARM: dts: STi: Move sound related nodes without reg out of soc >>ARM: dts: STi: Add fake reg property for sti-display-subsystem > > Thanks a lot for addressing these! > > As far as I can tell, there is one patch in particular that addresses a > warning > we get at the default warning level: "ARM: dts: STi: Add gpio polarity for > "hdmi,hpd-gpio" property". Should we merge that one for 4.15 to get closer > to a clean build again? I'm not sure whether we can address the other How do you want to proceed with this particular patch ? Do you want me to send a pull-request with this patch ? Patrice > dtc warnings, but we're getting fairly close now. > > Arnd >
Re: [PATCH] [media] c8sectpfe: Use resource_size function on memory resource
Hi Vasyl On 11/20/2017 11:46 PM, Vasyl Gomonovych wrote: > To adapt fei->sram_size calculation via resource_size for memory size > calculation before, in fei->sram = devm_ioremap_resource(dev, res). > And make memory initialization range in > memset_io for fei->sram appropriate > > Signed-off-by: Vasyl Gomonovych > --- > drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c > b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c > index 59280ac31937..283f7289aaa1 100644 > --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c > +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c > @@ -691,7 +691,7 @@ static int c8sectpfe_probe(struct platform_device *pdev) > if (IS_ERR(fei->sram)) > return PTR_ERR(fei->sram); > > - fei->sram_size = res->end - res->start; > + fei->sram_size = resource_size(res); > > fei->idle_irq = platform_get_irq_byname(pdev, "c8sectpfe-idle-irq"); > if (fei->idle_irq < 0) { > Acked-by: Patrice Chotard Thanks
Re: [PATCH] c8sectpfe: fix potential NULL pointer dereference in c8sectpfe_timer_interrupt
Hi Gustavo On 11/20/2017 03:00 PM, Gustavo A. R. Silva wrote: > _channel_ is being dereferenced before it is null checked, hence there is a > potential null pointer dereference. Fix this by moving the pointer dereference > after _channel_ has been null checked. > > This issue was detected with the help of Coccinelle. > > Fixes: c5f5d0f99794 ("[media] c8sectpfe: STiH407/10 Linux DVB demux support") > Signed-off-by: Gustavo A. R. Silva > --- > drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c > b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c > index 59280ac..23d0ced 100644 > --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c > +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c > @@ -83,7 +83,7 @@ static void c8sectpfe_timer_interrupt(unsigned long > ac8sectpfei) > static void channel_swdemux_tsklet(unsigned long data) > { > struct channel_info *channel = (struct channel_info *)data; > - struct c8sectpfei *fei = channel->fei; > + struct c8sectpfei *fei; > unsigned long wp, rp; > int pos, num_packets, n, size; > u8 *buf; > @@ -91,6 +91,8 @@ static void channel_swdemux_tsklet(unsigned long data) > if (unlikely(!channel || !channel->irec)) > return; > > + fei = channel->fei; > + > wp = readl(channel->irec + DMA_PRDS_BUSWP_TP(0)); > rp = readl(channel->irec + DMA_PRDS_BUSRP_TP(0)); > > Acked-by: Patrice Chotard Thanks
Re: [PATCH 04/17] pinctrl: st: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures
Hi Julia On 08/10/2017 12:06 PM, Julia Lawall wrote: > These structures are only stored in fields of a pinctrl_desc > structure (confops, pctlops, and pmxops) that are const. Make the > structures const as well. > > Done with the help of Coccinelle. > > Signed-off-by: Julia Lawall > > --- > drivers/pinctrl/pinctrl-st.c |6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c > index 7ac8b1e..aed8006 100644 > --- a/drivers/pinctrl/pinctrl-st.c > +++ b/drivers/pinctrl/pinctrl-st.c > @@ -861,7 +861,7 @@ static void st_pctl_dt_free_map(struct pinctrl_dev > *pctldev, > { > } > > -static struct pinctrl_ops st_pctlops = { > +static const struct pinctrl_ops st_pctlops = { > .get_groups_count = st_pctl_get_groups_count, > .get_group_pins = st_pctl_get_group_pins, > .get_group_name = st_pctl_get_group_name, > @@ -928,7 +928,7 @@ static int st_pmx_set_gpio_direction(struct pinctrl_dev > *pctldev, > return 0; > } > > -static struct pinmux_ops st_pmxops = { > +static const struct pinmux_ops st_pmxops = { > .get_functions_count= st_pmx_get_funcs_count, > .get_function_name = st_pmx_get_fname, > .get_function_groups= st_pmx_get_groups, > @@ -1025,7 +1025,7 @@ static void st_pinconf_dbg_show(struct pinctrl_dev > *pctldev, > ST_PINCONF_UNPACK_RT_DELAY(config)); > } > > -static struct pinconf_ops st_confops = { > +static const struct pinconf_ops st_confops = { > .pin_config_get = st_pinconf_get, > .pin_config_set = st_pinconf_set, > .pin_config_dbg_show= st_pinconf_dbg_show, > Acked-by: Patrice Chotard Thanks
Re: [RFC PATCH v2] ARM: dts: stm32: change pinctrl bindings definition
Hi Alex On 07/21/2017 02:34 PM, Alexandre Torgue wrote: > Initially each pin was declared in "include/dt-bindings/stm32f429-pinfunc.h" > and each definition contained SOC names (ex: STM32F429_PA9_FUNC_USART1_TX). > Since this approach was approved, the number of supported MCU has > increased (STM32F429/STM32F469/STM32f746/STM32H743). To avoid to add a new > file in "include/dt-bindings" each time a new STM32 SOC arrives I propose > a new approach which consist to use a macro to define pin muxing in device > tree. All STM32 will use the common macro to define pinmux. Furthermore, it > will make maintenance and integration of new SOC easier . > > Signed-off-by: Alexandre TORGUE Agree with this proposal, thanks Patrice > > diff --git a/arch/arm/boot/dts/stm32f429.dtsi > b/arch/arm/boot/dts/stm32f429.dtsi > index a8113dc..e9e46ee 100644 > --- a/arch/arm/boot/dts/stm32f429.dtsi > +++ b/arch/arm/boot/dts/stm32f429.dtsi > @@ -47,7 +47,7 @@ > > #include "skeleton.dtsi" > #include "armv7-m.dtsi" > -#include > +#include > #include > #include > > @@ -687,35 +687,35 @@ > > usart1_pins_a: usart1@0 { > pins1 { > - pinmux = ; > + pinmux = AF7)>; /* USART1_TX */ > bias-disable; > drive-push-pull; > slew-rate = <0>; > }; > pins2 { > - pinmux = > ; > + pinmux = AF7)>; /* USART1_RX */ > bias-disable; > }; > }; > > usart3_pins_a: usart3@0 { > pins1 { > - pinmux = > ; > + pinmux = AF7)>; /* USART3_TX */ > bias-disable; > drive-push-pull; > slew-rate = <0>; > }; > pins2 { > - pinmux = > ; > + pinmux = AF7)>; /* USART3_RX */ > bias-disable; > }; > }; > > usbotg_fs_pins_a: usbotg_fs@0 { > pins { > - pinmux = > , > - > , > - > ; > + pinmux = AF10)>, /* OTG_FS_ID */ > + AF10)>, /* OTG_FS_DM */ > + AF10)>; /* OTG_FS_DP */ > bias-disable; > drive-push-pull; > slew-rate = <2>; > @@ -724,9 +724,9 @@ > > usbotg_fs_pins_b: usbotg_fs@1 { > pins { > - pinmux = > , > - > , > - > ; > + pinmux = AF12)>, /* OTG_HS_ID */ > + AF12)>, /* OTG_HS_DM */ > + AF12)>; /* OTG_HS_DP */ > bias-disable; > drive-push-pull; > slew-rate = <2>; > @@ -735,18 +735,18 @@ > > usbotg_hs_pins_a: usbotg_hs@0 { > pins { > - pinmux = > , > - > , > - > , > - > , > - > , > - > , > - > , > - > , > - > , > - > , > - > , > - > ; > + pinmux = AF10)>, /* OTG_HS_ULPI_NXT*/ > + AF10)>, /* OTG_HS_ULPI_DIR */ > + AF10)>, /* OTG_HS_ULPI_STP */ > + AF10)>, /* OTG_HS_ULPI_CK */ > + AF10)>, /* OTG_HS_UL
Re: [PATCH] cpufreq: Convert to using %pOF instead of full_name
On 07/18/2017 11:42 PM, Rob Herring wrote: > Now that we have a custom printf format specifier, convert users of > full_name to use %pOF instead. This is preparation to remove storing > of the full path string for each node. > > Signed-off-by: Rob Herring > Cc: "Rafael J. Wysocki" > Cc: Viresh Kumar > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: Patrice Chotard > Cc: linux...@vger.kernel.org > Cc: linuxppc-...@lists.ozlabs.org > Cc: linux-arm-ker...@lists.infradead.org > Cc: ker...@stlinux.com > --- > drivers/cpufreq/pmac64-cpufreq.c | 2 +- > drivers/cpufreq/sti-cpufreq.c| 8 > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/cpufreq/pmac64-cpufreq.c > b/drivers/cpufreq/pmac64-cpufreq.c > index 267e0894c62d..be623dd7b9f2 100644 > --- a/drivers/cpufreq/pmac64-cpufreq.c > +++ b/drivers/cpufreq/pmac64-cpufreq.c > @@ -516,7 +516,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node > *cpunode) > goto bail; > } > > - DBG("cpufreq: i2c clock chip found: %s\n", hwclock->full_name); > + DBG("cpufreq: i2c clock chip found: %pOF\n", hwclock); > > /* Now get all the platform functions */ > pfunc_cpu_getfreq = > diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c > index d2d0430d09d4..47105735df12 100644 > --- a/drivers/cpufreq/sti-cpufreq.c > +++ b/drivers/cpufreq/sti-cpufreq.c > @@ -65,8 +65,8 @@ static int sti_cpufreq_fetch_major(void) { > ret = of_property_read_u32_index(np, "st,syscfg", >MAJOR_ID_INDEX, &major_offset); > if (ret) { > - dev_err(dev, "No major number offset provided in %s [%d]\n", > - np->full_name, ret); > + dev_err(dev, "No major number offset provided in %pOF [%d]\n", > + np, ret); > return ret; > } > > @@ -92,8 +92,8 @@ static int sti_cpufreq_fetch_minor(void) >MINOR_ID_INDEX, &minor_offset); > if (ret) { > dev_err(dev, > - "No minor number offset provided %s [%d]\n", > - np->full_name, ret); > + "No minor number offset provided %pOF [%d]\n", > + np, ret); > return ret; > } > > -- > 2.11.0 > For ST cpufreq: Acked-by: Patrice Chotard Thanks
Re: [PATCH] pinctrl: Convert to using %pOF instead of full_name
On 07/18/2017 11:43 PM, Rob Herring wrote: > Now that we have a custom printf format specifier, convert users of > full_name to use %pOF instead. This is preparation to remove storing > of the full path string for each node. > > Signed-off-by: Rob Herring > Cc: Linus Walleij > Cc: Lee Jones > Cc: Eric Anholt > Cc: Stefan Wahren > Cc: Florian Fainelli > Cc: Ray Jui > Cc: Scott Branden > Cc: bcm-kernel-feedback-l...@broadcom.com > Cc: Ludovic Desroches > Cc: Patrice Chotard > Cc: Tomasz Figa > Cc: Krzysztof Kozlowski > Cc: Sylwester Nawrocki > Cc: Laurent Pinchart > Cc: Geert Uytterhoeven > Cc: Barry Song > Cc: linux-g...@vger.kernel.org > Cc: linux-rpi-ker...@lists.infradead.org > Cc: linux-arm-ker...@lists.infradead.org > Cc: ker...@stlinux.com > Cc: linux-samsung-...@vger.kernel.org > Cc: linux-renesas-...@vger.kernel.org > --- > drivers/pinctrl/bcm/pinctrl-bcm2835.c | 25 +++-- > drivers/pinctrl/devicetree.c | 4 ++-- > drivers/pinctrl/freescale/pinctrl-imx.c | 8 +++- > drivers/pinctrl/pinconf-generic.c | 7 +++ > drivers/pinctrl/pinctrl-at91-pio4.c | 11 +-- > drivers/pinctrl/pinctrl-st.c | 2 +- > drivers/pinctrl/pinctrl-tb10x.c | 4 ++-- > drivers/pinctrl/samsung/pinctrl-samsung.c | 6 +++--- > drivers/pinctrl/sh-pfc/pinctrl.c | 2 +- > drivers/pinctrl/sirf/pinctrl-sirf.c | 6 +++--- > 10 files changed, 34 insertions(+), 41 deletions(-) > > diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c > b/drivers/pinctrl/bcm/pinctrl-bcm2835.c > index 230883168e99..3e71e5d782ee 100644 > --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c > +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c > @@ -692,8 +692,7 @@ static int bcm2835_pctl_dt_node_to_map_func(struct > bcm2835_pinctrl *pc, > struct pinctrl_map *map = *maps; > > if (fnum >= ARRAY_SIZE(bcm2835_functions)) { > - dev_err(pc->dev, "%s: invalid brcm,function %d\n", > - of_node_full_name(np), fnum); > + dev_err(pc->dev, "%pOF: invalid brcm,function %d\n", np, fnum); > return -EINVAL; > } > > @@ -713,8 +712,7 @@ static int bcm2835_pctl_dt_node_to_map_pull(struct > bcm2835_pinctrl *pc, > unsigned long *configs; > > if (pull > 2) { > - dev_err(pc->dev, "%s: invalid brcm,pull %d\n", > - of_node_full_name(np), pull); > + dev_err(pc->dev, "%pOF: invalid brcm,pull %d\n", np, pull); > return -EINVAL; > } > > @@ -745,8 +743,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev > *pctldev, > > pins = of_find_property(np, "brcm,pins", NULL); > if (!pins) { > - dev_err(pc->dev, "%s: missing brcm,pins property\n", > - of_node_full_name(np)); > + dev_err(pc->dev, "%pOF: missing brcm,pins property\n", np); > return -EINVAL; > } > > @@ -755,8 +752,8 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev > *pctldev, > > if (!funcs && !pulls) { > dev_err(pc->dev, > - "%s: neither brcm,function nor brcm,pull specified\n", > - of_node_full_name(np)); > + "%pOF: neither brcm,function nor brcm,pull specified\n", > + np); > return -EINVAL; > } > > @@ -766,15 +763,15 @@ static int bcm2835_pctl_dt_node_to_map(struct > pinctrl_dev *pctldev, > > if (num_funcs > 1 && num_funcs != num_pins) { > dev_err(pc->dev, > - "%s: brcm,function must have 1 or %d entries\n", > - of_node_full_name(np), num_pins); > + "%pOF: brcm,function must have 1 or %d entries\n", > + np, num_pins); > return -EINVAL; > } > > if (num_pulls > 1 && num_pulls != num_pins) { > dev_err(pc->dev, > - "%s: brcm,pull must have 1 or %d entries\n", > - of_node_full_name(np), num_pins); > + "%pOF: brcm,pull must have 1 or %d entries\n", > + np, num_pins); > return -EINVAL; > } > > @@ -793,8 +790,8 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev > *pctldev, > if (err) > goto out; >
Re: [PATCH] pinctrl: st: constify gpio_chip structure
Hi Gustavo On 07/11/2017 08:15 PM, Gustavo A. R. Silva wrote: > This structure is only used to copy into other structure, so declare > it as const. > > This issue was detected using Coccinelle and the following semantic patch: > > @r disable optional_qualifier@ > identifier i; > position p; > @@ > static struct gpio_chip i@p = { ... }; > > @ok@ > identifier r.i; > expression e; > position p; > @@ > e = i@p; > > @bad@ > position p != {r.p,ok.p}; > identifier r.i; > struct gpio_chip e; > @@ > e@i@p > > @depends on !bad disable optional_qualifier@ > identifier r.i; > @@ > static > +const > struct gpio_chip i = { ... }; > > In the following log you can see a significant difference in the code size > and data segment, hence in the dec segment. This log is the output > of the size command, before and after the code change: > > before: > textdata bss dec hex filename >216713632 128 254316357 drivers/pinctrl/pinctrl-st.o > > after: > textdata bss dec hex filename >213663576 128 2507061ee drivers/pinctrl/pinctrl-st.o > > Signed-off-by: Gustavo A. R. Silva > --- > drivers/pinctrl/pinctrl-st.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c > index 3ae8066..5d4789d 100644 > --- a/drivers/pinctrl/pinctrl-st.c > +++ b/drivers/pinctrl/pinctrl-st.c > @@ -1442,7 +1442,7 @@ static void st_gpio_irqmux_handler(struct irq_desc > *desc) > chained_irq_exit(chip, desc); > } > > -static struct gpio_chip st_gpio_template = { > +static const struct gpio_chip st_gpio_template = { > .request= gpiochip_generic_request, > .free = gpiochip_generic_free, > .get= st_gpio_get, > Acked-by: Patrice Chotard Thanks
Re: [PATCH 3/3] rtc: st-lpc: make it robust against y2038/2106 bug
Hi Benjamin On 06/16/2017 04:03 PM, Benjamin Gaignard wrote: > Make driver use u64 variables and functions to be sure that > it will support dates after year 2038. > > Signed-off-by: Benjamin Gaignard > --- > drivers/rtc/rtc-st-lpc.c | 19 --- > 1 file changed, 8 insertions(+), 11 deletions(-) > > diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c > index 74c0a33..82b0af1 100644 > --- a/drivers/rtc/rtc-st-lpc.c > +++ b/drivers/rtc/rtc-st-lpc.c > @@ -99,7 +99,7 @@ static int st_rtc_read_time(struct device *dev, struct > rtc_time *tm) > > lpt = ((unsigned long long)lpt_msb << 32) | lpt_lsb; > do_div(lpt, rtc->clkrate); > - rtc_time_to_tm(lpt, tm); > + rtc_time64_to_tm(lpt, tm); > > return 0; > } > @@ -107,13 +107,10 @@ static int st_rtc_read_time(struct device *dev, struct > rtc_time *tm) > static int st_rtc_set_time(struct device *dev, struct rtc_time *tm) > { > struct st_rtc *rtc = dev_get_drvdata(dev); > - unsigned long long lpt; > - unsigned long secs, flags; > - int ret; > + unsigned long long lpt, secs; > + unsigned long flags; > > - ret = rtc_tm_to_time(tm, &secs); > - if (ret) > - return ret; > + secs = rtc_tm_to_time64(tm); > > lpt = (unsigned long long)secs * rtc->clkrate; > > @@ -161,13 +158,13 @@ static int st_rtc_set_alarm(struct device *dev, struct > rtc_wkalrm *t) > { > struct st_rtc *rtc = dev_get_drvdata(dev); > struct rtc_time now; > - unsigned long now_secs; > - unsigned long alarm_secs; > + unsigned long long now_secs; > + unsigned long long alarm_secs; > unsigned long long lpa; > > st_rtc_read_time(dev, &now); > - rtc_tm_to_time(&now, &now_secs); > - rtc_tm_to_time(&t->time, &alarm_secs); > + now_secs = rtc_tm_to_time64(&now); > + alarm_secs = rtc_tm_to_time64(&t->time); > > /* Invalid alarm time */ > if (now_secs > alarm_secs) > Acked-by: Patrice Chotard Thanks
Re: [PATCH 0/3] Add stm32h743i-disco board
Hi Alex On 06/07/2017 09:04 AM, Alexandre Torgue wrote: > Hi Patrice > > On 06/06/2017 06:13 PM, patrice.chot...@st.com wrote: >> From: Patrice Chotard >> >> This series adds basic support for the stm32h743i discovery board >> based on stm32h7 MCU. >> >> Patrice Chotard (3): >> ARM: dts: stm32h743: Add usart2_pins >> ARM: dts: stm32h743: Add usart2 support >> ARM: dts: stm32h743: Add stm32h743i-disco board >> >> arch/arm/boot/dts/Makefile | 3 +- >> arch/arm/boot/dts/stm32h743-pinctrl.dtsi | 13 ++ >> arch/arm/boot/dts/stm32h743.dtsi | 8 >> arch/arm/boot/dts/stm32h743i-disco.dts | 74 >> >> 4 files changed, 97 insertions(+), 1 deletion(-) >> create mode 100644 arch/arm/boot/dts/stm32h743i-disco.dts >> > > Series looks fine for me, but can you change commit header please. For > example: ARM: dts: stm32: Add usart2_pins on stm32h743. > > Soon it will be done, I will apply it for next pull request. Sure, the v2 is on the way Patrice > > Regards > Alex
Re: [PATCH 1/1] ARM: compressed/head.S: fix __nop macro rept number for ARMv7M
Hi Ard On 05/18/2017 01:16 PM, Ard Biesheuvel wrote: > On 12 May 2017 at 08:22, Patrice CHOTARD wrote: >> Hi all >> >> It's a gentle reminder to not forgot this patch. >> >> Thanks >> >> Patrice >> >> On 04/25/2017 11:01 AM, patrice.chot...@st.com wrote: >>> From: Patrice Chotard >>> >>> In zImage, _magic_sig is located at offset 0x24. >>> But for ARMv7M architecture which enable CPU_THUMBONLY >>> and !EFI_STUB kernel flag, _magic_sig is located at offset 0x14 >>> >>> 00 46 00 46 00 46 00 46 00 46 00 46 00 46 0f f2 >>> |.F.F.F.F.F.F.F.ò| >>> 0010 15 0c 60 47 18 28 6f 01 00 00 00 00 28 5c 0e 00 >>> |..`G.(o.(\..| >>> 0020 01 02 03 04 0f 46 90 46 00 00 00 00 00 00 00 00 >>> |.F.F| >>> >>> Reproduced with stm32_defconfig with XIP_KERNEL flag disabled. >>> >>> To restore correct _magic_sig offset at 0x24, we add 8 additional >>> "mov r0, r0" instruction. >>> >>> Signed-off-by: Patrice Chotard >>> --- >>> arch/arm/boot/compressed/head.S | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/arch/arm/boot/compressed/head.S >>> b/arch/arm/boot/compressed/head.S >>> index 9150f97..5d9cda3 100644 >>> --- a/arch/arm/boot/compressed/head.S >>> +++ b/arch/arm/boot/compressed/head.S >>> @@ -127,7 +127,8 @@ >>>AR_CLASS( .arm) >>> start: >>>.type start,#function >>> - .rept 7 >>> + ARM( .rept 7) >>> + THUMB( .rept 15) >>> > > Could you try using W(mov) instead of mov in the definition of __nop ? If i use W(mov) instead of mov in __nop macro, i need to add one additional "mov r0,r0" in THUMB case as following : start: .type start,#function .rept 7 __nop .endr ARM( mov r0, r0 ) ARM( b 1f ) + THUMB(mov r0, r0 ) THUMB( badrr12, 1f ) THUMB( bx r12 ) .word _magic_sig @ Magic numbers to help the loader .word _magic_start@ absolute load/run zImage address .word _magic_end @ zImage end address .word 0x04030201 @ endianness flag Which implementation do you prefer ? Thanks Patrice
Re: [PATCH 1/1] ARM: compressed/head.S: fix __nop macro rept number for ARMv7M
Hi all It's a gentle reminder to not forgot this patch. Thanks Patrice On 04/25/2017 11:01 AM, patrice.chot...@st.com wrote: > From: Patrice Chotard > > In zImage, _magic_sig is located at offset 0x24. > But for ARMv7M architecture which enable CPU_THUMBONLY > and !EFI_STUB kernel flag, _magic_sig is located at offset 0x14 > > 00 46 00 46 00 46 00 46 00 46 00 46 00 46 0f f2 |.F.F.F.F.F.F.F.ò| > 0010 15 0c 60 47 18 28 6f 01 00 00 00 00 28 5c 0e 00 |..`G.(o.(\..| > 0020 01 02 03 04 0f 46 90 46 00 00 00 00 00 00 00 00 |.F.F| > > Reproduced with stm32_defconfig with XIP_KERNEL flag disabled. > > To restore correct _magic_sig offset at 0x24, we add 8 additional > "mov r0, r0" instruction. > > Signed-off-by: Patrice Chotard > --- > arch/arm/boot/compressed/head.S | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S > index 9150f97..5d9cda3 100644 > --- a/arch/arm/boot/compressed/head.S > +++ b/arch/arm/boot/compressed/head.S > @@ -127,7 +127,8 @@ > AR_CLASS( .arm) > start: > .type start,#function > - .rept 7 > + ARM( .rept 7) > + THUMB( .rept 15) > __nop > .endr > ARM( mov r0, r0 ) >
Re: [PATCH] mfd: stmpe: Fix bit clearing on STMPE1600
Hi Hugues On 03/31/2017 10:12 AM, Hugues Fruchet wrote: > GPIO bits clearing on pins assigned to STMPE1600 > had no effects due to missing "clear registers" > settings within stmpe1600_regs[]. > STMPE1600 does not have dedicated "clear registers", > but single "set/clear registers", hence stmpe1600_regs[] > "clear registers" (STMPE_IDX_GPCR_XXX) must be set to > same value as "set registers" (STMPE_IDX_GPSR_XXX), ie > STMPE1600_REG_GPSR_XXX. > > Signed-off-by: Hugues Fruchet > --- > drivers/mfd/stmpe.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c > index b0c7bcd..566caca 100644 > --- a/drivers/mfd/stmpe.c > +++ b/drivers/mfd/stmpe.c > @@ -568,6 +568,8 @@ static int stmpe811_get_altfunc(struct stmpe *stmpe, enum > stmpe_block block) > [STMPE_IDX_GPMR_CSB]= STMPE1600_REG_GPMR_MSB, > [STMPE_IDX_GPSR_LSB]= STMPE1600_REG_GPSR_LSB, > [STMPE_IDX_GPSR_CSB]= STMPE1600_REG_GPSR_MSB, > + [STMPE_IDX_GPCR_LSB]= STMPE1600_REG_GPSR_LSB, > + [STMPE_IDX_GPCR_CSB]= STMPE1600_REG_GPSR_MSB, > [STMPE_IDX_GPDR_LSB]= STMPE1600_REG_GPDR_LSB, > [STMPE_IDX_GPDR_CSB]= STMPE1600_REG_GPDR_MSB, > [STMPE_IDX_IEGPIOR_LSB] = STMPE1600_REG_IEGPIOR_LSB, > Reviewed-by: Patrice Chotard Thanks