Re: [PATCH] remoteproc: st: Use device_get_match_data()

2023-10-10 Thread Patrice CHOTARD



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 = >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, _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

2021-04-20 Thread Patrice CHOTARD
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(, ##__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

2021-04-12 Thread Patrice CHOTARD



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

2021-04-12 Thread Patrice CHOTARD
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

2021-04-09 Thread Patrice CHOTARD
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(>dev, res);
> - if (IS_ERR(pdata->top_ioaddr)) {
> - dev_warn(>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

2021-03-31 Thread Patrice CHOTARD
   *
> @@ -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, _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, _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, _name))
> + return;
>  
> - of_clk_detect_critical(np, odf, _flags);
> + of_clk_detect_critical(np, odf, _flags);
> + }
>  
> - clk = clkgen_odf_register(pll_name, pll_base, data, odf_flags,
> - odf, _c32_odf_lock, clk_name);
> + clk = clkgen_odf_register(pll_name, pll_base, datac->data,
> + odf_flags, odf, _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 *) _pll3200c32_cx_0);
> + (struct clkgen_pll_data_clks *) 
> _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 *) _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 *) _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 *) _pll3200c32_cx_1);
> + (struct clkgen_pll_data_clks *) 
> _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 *) _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 *) _pll3200c32_407_a9);
> + (struct clkgen_pll_data_clks *) _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 *) _pll4600c28_418_a9);
> + (struct clkgen_pll_data_clks *) _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

2021-03-31 Thread Patrice CHOTARD
ock-output-names",
> -   fschan, _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, _name))
> + break;
> + of_clk_detect_critical(np, fschan, );
>   }
>  
>   /*
> @@ -892,10 +960,8 @@ static void __init st_of_create_quadfs_fsynths(
>   if (*clk_name == '\0')
>   continue;
>  
> - of_clk_detect_critical(np, fschan, );
> -
>   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 *) _fs660c32_C);
> + st_of_quadfs_setup(np,
> + (struct clkgen_quadfs_data_clks *) _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 *) _fs660c32_D);
> + st_of_quadfs_setup(np,
> + (struct clkgen_quadfs_data_clks *) _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 *) _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 *) _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 *) _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

2021-03-31 Thread Patrice CHOTARD
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

2021-03-31 Thread Patrice CHOTARD
 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

2021-03-11 Thread Patrice CHOTARD
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

2021-03-11 Thread Patrice CHOTARD
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

2021-02-15 Thread Patrice CHOTARD
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

2021-02-15 Thread Patrice CHOTARD
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"

2020-12-17 Thread Patrice CHOTARD
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

2020-12-09 Thread Patrice CHOTARD
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

2020-11-19 Thread Patrice CHOTARD
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

2020-11-19 Thread Patrice CHOTARD
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

2020-11-19 Thread Patrice CHOTARD
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

2020-11-18 Thread Patrice CHOTARD
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

2020-11-18 Thread Patrice CHOTARD
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

2020-10-29 Thread Patrice CHOTARD
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(_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

2020-10-29 Thread Patrice CHOTARD
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(_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

2020-10-06 Thread Patrice CHOTARD
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

2020-10-06 Thread Patrice CHOTARD
mited.
>   */
>  
> -#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

2020-07-27 Thread Patrice CHOTARD
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

2019-10-16 Thread Patrice CHOTARD
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(>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

2019-07-31 Thread Patrice CHOTARD
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

2019-06-14 Thread Patrice CHOTARD
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'

2019-06-03 Thread Patrice CHOTARD
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 = _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, "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'

2019-06-03 Thread Patrice CHOTARD
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 = _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, "usb");
>   if (IS_ERR(priv->phy)) {
> 

Acked-by: Patrice Chotard 

Thanks

Re: [PATCH 3/5] pinctrl: st: fix leaked of_node references

2019-04-12 Thread Patrice CHOTARD
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

2019-04-10 Thread Patrice CHOTARD
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= _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 = >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", );
>   if (ret) {
> - dev_err(>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(>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, >dev);
> + match = of_match_device(st_wdog_match, dev);
>   if (!match) {
> - dev_err(>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(>dev, "No syscfg phandle specified\n");
> + dev_err(dev, "No syscfg phandle specified\n");
>   return PTR_ERR(regmap);
>   }
>  
> - clk = devm_clk_get(>dev, NULL);
> + clk = devm_clk_get(dev, NULL);
>   if (IS_ERR(clk)) {
> - dev_err(>dev, "Unable to request clock\n");
> + dev_err(dev, "Unable to request clock\n");
>   return PTR_ERR(clk);
>   }
>  
> - st_wdog->dev= >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(>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 = >dev;
> + st_wdog_dev.parent = dev;
>  
>   ret = clk_prepare_enable(clk);
>   if (ret) {
> - dev_err(>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)
> + return ret;
>  
>   watchdog_set_drvdata(_wdog_dev, st_wdog);
>   watchdog_set_nowayout(_wdog_dev, WATCHDOG_NOWAYOUT);
>  
>   /

Re: [PATCH] watchdog: Convert to use devm_platform_ioremap_resource

2019-04-04 Thread Patrice CHOTARD
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(>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()

2019-02-06 Thread Patrice CHOTARD
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(_pdev->dev);
> + put_device(_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

2019-02-06 Thread Patrice CHOTARD
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], );
> + 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()

2019-01-07 Thread Patrice CHOTARD
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

2018-12-20 Thread Patrice CHOTARD
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

2018-12-19 Thread Patrice CHOTARD
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

2018-12-19 Thread Patrice CHOTARD
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

2018-12-18 Thread Patrice CHOTARD
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

2018-09-25 Thread Patrice CHOTARD
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(-)

[GIT PULL] STi DT update for v4.20 round 1

2018-09-25 Thread Patrice CHOTARD
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

2018-09-03 Thread Patrice CHOTARD
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] pinctrl: Convert to using %pOFn instead of device_node.name

2018-09-03 Thread Patrice CHOTARD
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

2018-08-07 Thread Patrice CHOTARD
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

> 
>>  autorepeat;
>> -   button@0 {
>&g

Re: [PATCH v2 3/3] ARM: dts: stm32: Fix DT dtc warnings for stm32f4

2018-08-07 Thread Patrice CHOTARD
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

> 
>>  autorepeat;
>> -   button@0 {
>&g

Re: [PATCH 1/3] ARM: dts: stm32: Fix DT dtc warnings for stm32h7

2018-08-07 Thread Patrice CHOTARD
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: [PATCH 1/3] ARM: dts: stm32: Fix DT dtc warnings for stm32h7

2018-08-07 Thread Patrice CHOTARD
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

2018-07-19 Thread Patrice CHOTARD
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: [U-BOOT internal] ARM: dts: stm32: Add clk-lse node's label on stm32f429

2018-07-19 Thread Patrice CHOTARD
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

2018-07-18 Thread Patrice CHOTARD
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 V2] ARM: STi: warn if scu mapping fails

2018-07-18 Thread Patrice CHOTARD
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

2018-07-16 Thread Patrice CHOTARD
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] ARM: STi: at least warn if of_iomap fails

2018-07-16 Thread Patrice CHOTARD
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

2018-05-25 Thread Patrice CHOTARD
m_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(>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 <patrice.chot...@st.com>

Thanks

Re: [PATCH] mmc: sdhci-*: Don't emit error msg if sdhci_add_host() fails

2018-05-25 Thread Patrice CHOTARD
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(>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

2018-05-23 Thread Patrice CHOTARD
Hi Alexandre

On 05/21/2018 10:49 PM, Alexandre Belloni wrote:
> The RTC has a 64 bit counter.
> 
> Signed-off-by: Alexandre Belloni <alexandre.bell...@bootlin.com>
> ---
>   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 = _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.chot...@st.com>

Patrice

Re: [PATCH v2] rtc: st-lpc: add range

2018-05-23 Thread Patrice CHOTARD
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 = _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

2018-05-23 Thread Patrice CHOTARD
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 <alexandre.bell...@bootlin.com>
> ---
>   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(>dev);
> + if (IS_ERR(rtc->rtc_dev))
> + return PTR_ERR(rtc->rtc_dev);
> +
>   spin_lock_init(>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", >dev,
> -_rtc_ops, THIS_MODULE);
> - if (IS_ERR(rtc->rtc_dev)) {
> + rtc->rtc_dev->ops = _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 <patrice.chot...@st.com>

Thanks

Patrice

Re: [PATCH 1/2] rtc: st-lpc: fix possible race condition

2018-05-23 Thread Patrice CHOTARD
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(>dev);
> + if (IS_ERR(rtc->rtc_dev))
> + return PTR_ERR(rtc->rtc_dev);
> +
>   spin_lock_init(>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", >dev,
> -_rtc_ops, THIS_MODULE);
> - if (IS_ERR(rtc->rtc_dev)) {
> + rtc->rtc_dev->ops = _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

2018-05-14 Thread Patrice CHOTARD
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(-)

[GIT PULL] STi DT update for v4.18 round 1

2018-05-14 Thread Patrice CHOTARD
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

2018-04-20 Thread Patrice CHOTARD
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(_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(_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 <patrice.chot...@st.com>

Thanks

Re: [PATCH 53/61] tty: serial: simplify getting .drvdata

2018-04-20 Thread Patrice CHOTARD
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(_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(_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

2018-04-05 Thread Patrice CHOTARD
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 <hayashi.kunih...@socionext.com>
>>>> ---
>>>>    .../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

2018-04-05 Thread Patrice CHOTARD
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

2018-04-05 Thread Patrice CHOTARD
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: [PATCH] ata: ahci-platform: add reset control support

2018-04-05 Thread Patrice CHOTARD
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

2018-03-23 Thread Patrice CHOTARD
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 <s...@canb.auug.org.au> 
>>> 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

2018-03-23 Thread Patrice CHOTARD
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

2018-03-16 Thread Patrice CHOTARD
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: linux-next: Signed-off-by missing for commit in the arm-soc tree

2018-03-16 Thread Patrice CHOTARD
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

2018-03-15 Thread Patrice CHOTARD
Hi Arnd

On 03/15/2018 03:59 PM, Arnd Bergmann wrote:
> On Thu, Mar 15, 2018 at 10:06 AM, Patrice CHOTARD
> <patrice.chot...@st.com> 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

Re: [GIT PULL] STi DT update for v4.17 round 2

2018-03-15 Thread Patrice CHOTARD
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

2018-03-15 Thread Patrice CHOTARD
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(+)

[GIT PULL] STi DT update for v4.17 round 2

2018-03-15 Thread Patrice CHOTARD
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

2018-03-14 Thread Patrice CHOTARD
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 <patrice.chot...@st.com>
> 
> As serial interface is already specified into stdout-path property,
> "console=ttyASN,115200" from bootargs can be removed.
> 
> Signed-off-by: Patrice Chotard <patrice.chot...@st.com>
> ---
> 
> 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 = _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 = _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 = 
>   };
>   
> 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 = _serial0;
>   };
>   
> 

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

2018-03-14 Thread Patrice CHOTARD
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 = _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 = _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 = 
>   };
>   
> 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 = _serial0;
>   };
>   
> 

Re: [PATCH v4 3/3] ARM: dts: STi: Remove "console=ttyASN" from bootargs for STi boards

2018-03-14 Thread Patrice CHOTARD
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 <patrice.chot...@st.com>
>>
>> As serial interface is already specified into stdout-path property,
>> "console=ttyASN,115200" from bootargs can be removed.
>>
>> Signed-off-by: Patrice Chotard <patrice.chot...@st.com>
>> ---
>> 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 v4 3/3] ARM: dts: STi: Remove "console=ttyASN" from bootargs for STi boards

2018-03-14 Thread Patrice CHOTARD
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

2018-03-13 Thread Patrice CHOTARD
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(>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 04/10] otm

2018-03-13 Thread Patrice CHOTARD
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(>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

2018-03-13 Thread Patrice CHOTARD
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 v3 10/10] board: Add STM32F769 SoC, discovery board support

2018-03-13 Thread Patrice CHOTARD
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

2018-03-13 Thread Patrice CHOTARD
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 

Re: [PATCH v2 07/10] video: add support of panel rm68200

2018-03-13 Thread Patrice CHOTARD
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

2018-03-13 Thread Patrice CHOTARD
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;
> +};
> +
> 

Re: [PATCH v2 06/10] video: add support of STM32 MIPI DSI controller driver

2018-03-13 Thread Patrice CHOTARD
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

2018-03-13 Thread Patrice CHOTARD
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 

Re: [PATCH v2 04/10] video: add support of panel OTM8009A

2018-03-13 Thread Patrice CHOTARD
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 

Re: [PATCH v2 02/10] video: stm32: stm32_ltdc: update debug log

2018-03-13 Thread Patrice CHOTARD
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, );
>   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();
>   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, );
>   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, );
>   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, );
>   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, );
>   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(, 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 parameters are 

Re: [PATCH v2 02/10] video: stm32: stm32_ltdc: update debug log

2018-03-13 Thread Patrice CHOTARD
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, );
>   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();
>   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, );
>   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, );
>   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, );
>   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, );
>   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(, 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 parameters are hard-coded for the 

Re: [PATCH v2 01/10] video: stm32: stm32_ltdc: add bridge to display controller

2018-03-13 Thread Patrice CHOTARD
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 = >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();
>   
> - ret = uclass_first_device(UCLASS_PANEL, );
> +#ifdef CONFIG_VIDEO_BRIDGE
> + ret = uclass_get_device(UCLASS_VIDEO_BRIDGE, 0, );
>   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, );
>   if (ret) {
> - debug("%s: panel %s enable backlight error %d\n",
> -   __func__, panel->name, ret);
> +

Re: [PATCH v2 01/10] video: stm32: stm32_ltdc: add bridge to display controller

2018-03-13 Thread Patrice CHOTARD
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 = >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();
>   
> - ret = uclass_first_device(UCLASS_PANEL, );
> +#ifdef CONFIG_VIDEO_BRIDGE
> + ret = uclass_get_device(UCLASS_VIDEO_BRIDGE, 0, );
>   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, );
>   if (ret) {
> - debug("%s: panel %s enable backlight error %d\n",
> -   __func__, panel->name, ret);
> + debug("%s: 

Re: [PATCH v2 10/10] board: Add STM32F769 SoC, discovery board support

2018-03-13 Thread Patrice CHOTARD
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 v2 10/10] board: Add STM32F769 SoC, discovery board support

2018-03-13 Thread Patrice CHOTARD
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

2018-03-07 Thread Patrice CHOTARD
Hi Rob

On 03/07/2018 05:15 PM, Rob Herring wrote:
> On Wed, Mar 7, 2018 at 2:49 AM,  <patrice.chot...@st.com> wrote:
>> From: Patrice Chotard <patrice.chot...@st.com>
>>
>> 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 <patrice.chot...@st.com>
>> ---
>>
>> 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 = _serial0;
>>  };
>>
>> @@ -24,7 +24,7 @@
>>  };
>>
>>  aliases {
>> -   ttyAS0 = _serial0;
>> +   serial0 = _serial0;
>>  ethernet0 = 
>>  };
>>
>> 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 = _serial0;
>>  };
>>
>> @@ -24,7 +24,7 @@
>>  };
>>
>>  aliases {
>> -   ttyAS0 = _serial0;
>> +   serial0 = _serial0;
>>  ethernet0 = 
>>  };
>>
>> 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 = 
>>  };
>>
>> @@ -25,7 +25,7 @@
>>  };
>>
>>  aliases {
>> -   ttyAS1 = 
>> +   serial1 = 
>>  ethernet0 = 
>>  };
>>
>> 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 = _serial0;
>>  };
>>
>> @@ -24,7 +24,7 @@
>>  };
>>
>>  aliases {
>> -   ttyAS0 = _serial0;
>> +   serial0 = _serial0;
>>  ethernet0 = 
>>  };
>>
>> --
>> 1.9.1
>>

Re: [PATCH v3 1/3] ARM: dts: STi: Fix aliases property name for STi boards

2018-03-07 Thread Patrice CHOTARD
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 = _serial0;
>>  };
>>
>> @@ -24,7 +24,7 @@
>>  };
>>
>>  aliases {
>> -   ttyAS0 = _serial0;
>> +   serial0 = _serial0;
>>  ethernet0 = 
>>  };
>>
>> 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 = _serial0;
>>  };
>>
>> @@ -24,7 +24,7 @@
>>  };
>>
>>  aliases {
>> -   ttyAS0 = _serial0;
>> +   serial0 = _serial0;
>>  ethernet0 = 
>>  };
>>
>> 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 = 
>>  };
>>
>> @@ -25,7 +25,7 @@
>>  };
>>
>>  aliases {
>> -   ttyAS1 = 
>> +   serial1 = 
>>  ethernet0 = 
>>  };
>>
>> 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 = _serial0;
>>  };
>>
>> @@ -24,7 +24,7 @@
>>  };
>>
>>  aliases {
>> -   ttyAS0 = _serial0;
>> +   serial0 = _serial0;
>>  ethernet0 = 
>>  };
>>
>> --
>> 1.9.1
>>

Re: [PATCH v2 0/6] Add mmc support for STM32F7 boards

2018-03-07 Thread Patrice CHOTARD
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 <patrice.chot...@st.com>
>>>
>>> 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 0/6] Add mmc support for STM32F7 boards

2018-03-07 Thread Patrice CHOTARD
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

  1   2   3   4   5   >