mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] clk-conf.h: Add missing re-inclusion protection
@ 2020-02-13 10:58 Sascha Hauer
  2020-02-13 10:58 ` [PATCH 2/3] clk-conf.h: Add static inline wrapper for of_clk_set_defaults() Sascha Hauer
  2020-02-13 10:58 ` [PATCH 3/3] driver: Call of_clk_set_defaults for each probed device Sascha Hauer
  0 siblings, 2 replies; 6+ messages in thread
From: Sascha Hauer @ 2020-02-13 10:58 UTC (permalink / raw)
  To: Barebox List

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/linux/clk/clk-conf.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/linux/clk/clk-conf.h b/include/linux/clk/clk-conf.h
index 8f4382e6c6..ac6cfdf711 100644
--- a/include/linux/clk/clk-conf.h
+++ b/include/linux/clk/clk-conf.h
@@ -6,12 +6,15 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
-#if defined(CONFIG_OFTREE) && defined(CONFIG_COMMON_CLK_OF_PROVIDER)
+#ifndef __CLK_CONF_H
+#define __CLK_CONF_H
 
 #include <linux/types.h>
 
+#if defined(CONFIG_OFTREE) && defined(CONFIG_COMMON_CLK_OF_PROVIDER)
+
 struct device_node;
 int of_clk_set_defaults(struct device_node *node, bool clk_supplier);
 
 #endif
+#endif /* __CLK_CONF_H */
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/3] clk-conf.h: Add static inline wrapper for of_clk_set_defaults()
  2020-02-13 10:58 [PATCH 1/3] clk-conf.h: Add missing re-inclusion protection Sascha Hauer
@ 2020-02-13 10:58 ` Sascha Hauer
  2020-02-13 10:58 ` [PATCH 3/3] driver: Call of_clk_set_defaults for each probed device Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2020-02-13 10:58 UTC (permalink / raw)
  To: Barebox List

Will be needed once we call of_clk_set_defaults() from the driver core.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/linux/clk/clk-conf.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/linux/clk/clk-conf.h b/include/linux/clk/clk-conf.h
index ac6cfdf711..8da0f99d66 100644
--- a/include/linux/clk/clk-conf.h
+++ b/include/linux/clk/clk-conf.h
@@ -16,5 +16,13 @@
 struct device_node;
 int of_clk_set_defaults(struct device_node *node, bool clk_supplier);
 
+#else
+
+static inline int of_clk_set_defaults(struct device_node *node,
+				      bool clk_supplier)
+{
+	return 0;
+}
+
 #endif
 #endif /* __CLK_CONF_H */
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/3] driver: Call of_clk_set_defaults for each probed device
  2020-02-13 10:58 [PATCH 1/3] clk-conf.h: Add missing re-inclusion protection Sascha Hauer
  2020-02-13 10:58 ` [PATCH 2/3] clk-conf.h: Add static inline wrapper for of_clk_set_defaults() Sascha Hauer
@ 2020-02-13 10:58 ` Sascha Hauer
  2020-04-06  6:01   ` Ahmad Fatoum
  1 sibling, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2020-02-13 10:58 UTC (permalink / raw)
  To: Barebox List

So far we only honour the assigned-clocks and assigned-clock-rates
device tree properties for the clock controller nodes. With this patch
we also honour the properties for each device which is done by Linux
as well.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/base/driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index eec2a2d8a2..247456a2c6 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -36,6 +36,7 @@
 #include <linux/err.h>
 #include <complete.h>
 #include <pinctrl.h>
+#include <linux/clk/clk-conf.h>
 
 LIST_HEAD(device_list);
 EXPORT_SYMBOL(device_list);
@@ -86,6 +87,7 @@ int device_probe(struct device_d *dev)
 	int ret;
 
 	pinctrl_select_state_default(dev);
+	of_clk_set_defaults(dev->device_node, false);
 
 	list_add(&dev->active, &active);
 
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] driver: Call of_clk_set_defaults for each probed device
  2020-02-13 10:58 ` [PATCH 3/3] driver: Call of_clk_set_defaults for each probed device Sascha Hauer
@ 2020-04-06  6:01   ` Ahmad Fatoum
  2020-04-14 10:02     ` Sascha Hauer
  0 siblings, 1 reply; 6+ messages in thread
From: Ahmad Fatoum @ 2020-04-06  6:01 UTC (permalink / raw)
  To: Sascha Hauer, Barebox List, Steffen Trumtrar

Hello Sascha,

On 2/13/20 11:58 AM, Sascha Hauer wrote:
> So far we only honour the assigned-clocks and assigned-clock-rates
> device tree properties for the clock controller nodes. With this patch
> we also honour the properties for each device which is done by Linux
> as well.

This breaks the default barebox console on the i.MX7 sabresd.
The default UART, uart1, specifies assigned-clock-parents, which is now applied
and causes garbage to be output on the serial port.

&uart1 {
       /delete-property/ assigned-clocks;
       /delete-property/ assigned-clock-parents;
};

Fixes it, but I didn't dig deeper than that.

> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/base/driver.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/base/driver.c b/drivers/base/driver.c
> index eec2a2d8a2..247456a2c6 100644
> --- a/drivers/base/driver.c
> +++ b/drivers/base/driver.c
> @@ -36,6 +36,7 @@
>  #include <linux/err.h>
>  #include <complete.h>
>  #include <pinctrl.h>
> +#include <linux/clk/clk-conf.h>
>  
>  LIST_HEAD(device_list);
>  EXPORT_SYMBOL(device_list);
> @@ -86,6 +87,7 @@ int device_probe(struct device_d *dev)
>  	int ret;
>  
>  	pinctrl_select_state_default(dev);
> +	of_clk_set_defaults(dev->device_node, false);
>  
>  	list_add(&dev->active, &active);
>  
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] driver: Call of_clk_set_defaults for each probed device
  2020-04-06  6:01   ` Ahmad Fatoum
@ 2020-04-14 10:02     ` Sascha Hauer
  2020-04-15  9:57       ` Ahmad Fatoum
  0 siblings, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2020-04-14 10:02 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: Barebox List

On Mon, Apr 06, 2020 at 08:01:19AM +0200, Ahmad Fatoum wrote:
> Hello Sascha,
> 
> On 2/13/20 11:58 AM, Sascha Hauer wrote:
> > So far we only honour the assigned-clocks and assigned-clock-rates
> > device tree properties for the clock controller nodes. With this patch
> > we also honour the properties for each device which is done by Linux
> > as well.
> 
> This breaks the default barebox console on the i.MX7 sabresd.
> The default UART, uart1, specifies assigned-clock-parents, which is now applied
> and causes garbage to be output on the serial port.
> 
> &uart1 {
>        /delete-property/ assigned-clocks;
>        /delete-property/ assigned-clock-parents;
> };
> 
> Fixes it, but I didn't dig deeper than that.

Care to send this as a patch so that we at least have a stop gap
solution?

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] driver: Call of_clk_set_defaults for each probed device
  2020-04-14 10:02     ` Sascha Hauer
@ 2020-04-15  9:57       ` Ahmad Fatoum
  0 siblings, 0 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2020-04-15  9:57 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

Hello Sascha,

On 4/14/20 12:02 PM, Sascha Hauer wrote:
> On Mon, Apr 06, 2020 at 08:01:19AM +0200, Ahmad Fatoum wrote:
>> Hello Sascha,
>>
>> On 2/13/20 11:58 AM, Sascha Hauer wrote:
>>> So far we only honour the assigned-clocks and assigned-clock-rates
>>> device tree properties for the clock controller nodes. With this patch
>>> we also honour the properties for each device which is done by Linux
>>> as well.
>>
>> This breaks the default barebox console on the i.MX7 sabresd.
>> The default UART, uart1, specifies assigned-clock-parents, which is now applied
>> and causes garbage to be output on the serial port.
>>
>> &uart1 {
>>        /delete-property/ assigned-clocks;
>>        /delete-property/ assigned-clock-parents;
>> };
>>
>> Fixes it, but I didn't dig deeper than that.
> 
> Care to send this as a patch so that we at least have a stop gap
> solution?

Sure. Working on it now. Don't tag the new release just yet :D

> 
> Sascha
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-15  9:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13 10:58 [PATCH 1/3] clk-conf.h: Add missing re-inclusion protection Sascha Hauer
2020-02-13 10:58 ` [PATCH 2/3] clk-conf.h: Add static inline wrapper for of_clk_set_defaults() Sascha Hauer
2020-02-13 10:58 ` [PATCH 3/3] driver: Call of_clk_set_defaults for each probed device Sascha Hauer
2020-04-06  6:01   ` Ahmad Fatoum
2020-04-14 10:02     ` Sascha Hauer
2020-04-15  9:57       ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox