Skip to contentSkip to conversation

ARM: davinci: register the usb20_phy clock on the DT file

PATCH In review [email protected] 3 participants 6 messages Oct 26, 2016 – Oct 27, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: davinci: register the usb20_phy clock on the DT file

From: Axel Haslam <[email protected]>

The usb20_phy clock needs to be registered for the driver to be able to get and enable a clock. Currently the usb phy clocks are registered form board files, which will not be called during a device tree based boot.

To be able to probe correctly usb form a device tree boot, register the usb phy clocks form the DT specific init.

Unfourtunatly, davinci does not have proper clock support on device tree yet, so by registering the clock form de DT specific file we are forced to hardcode the parent clock, and cannot select refclkin as parent for any of the phy clocks of the da850 family.

As none of the current da850 based boards currently in mainline use refclkin as source. I guess we can live with this limitation until clocks are correctly represented through CCF/device tree.

---

This patch depends on David's series for usb clocks:

currently:
[PATCH v6 0/5] da8xx USB PHY platform devices and clocks
https://lkml.org/lkml/2016/10/25/867

 arch/arm/mach-davinci/da8xx-dt.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-davinci/da8xx-dt.c +2 -0
index c9f7e92..7947267 100644
@@ -45,6 +45,8 @@
 
 static void __init da850_init_machine(void)
 {
+	da8xx_register_usb20_phy_clk(false);
+	da8xx_register_usb11_phy_clk(false);
 	of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
 }
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 37 lines · ahaslam at baylibre.com

From: Axel Haslam <[email protected]>

The usb20_phy clock needs to be registered for the driver to be able to get and enable a clock. Currently the usb phy clocks are registered form board files, which will not be called during a device tree based boot.

To be able to probe correctly usb form a device tree boot, register the usb phy clocks form the DT specific init.

Unfourtunatly, davinci does not have proper clock support on device tree yet, so by registering the clock form de DT specific file we are forced to hardcode the parent clock, and cannot select refclkin as parent for any of the phy clocks of the da850 family.

As none of the current da850 based boards currently in mainline use refclkin as source. I guess we can live with this limitation until clocks are correctly represented through CCF/device tree.

---

This patch depends on David's series for usb clocks:

currently:
[PATCH v6 0/5] da8xx USB PHY platform devices and clocks
https://lkml.org/lkml/2016/10/25/867

 arch/arm/mach-davinci/da8xx-dt.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-davinci/da8xx-dt.c +0 -0
index c9f7e92..7947267 100644

arch/arm/mach-davinci/da8xx-dt.c line 52

Quoted 8 lines
arch/arm/mach-davinci/da8xx-dt.c +2 -0
@@ -45,6 +45,8 @@
 
 static void __init da850_init_machine(void)
 {
+	da8xx_register_usb20_phy_clk(false);
+	da8xx_register_usb11_phy_clk(false);
 	of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
 }
 

You should check for error on return and print a warning if there is an error. Like this: https://patchwork.kernel.org/patch/9395635/

(I actually just had to make this change a few minutes ago to troubleshoot a problem that I am working on. da8xx_register_usb11_phy_clk() is failing for some reason that I have not figured out yet.)

#2 lore raw
Quoted 52 lines · David Lechner
Quoted 38 lines · ahaslam at baylibre.com

From: Axel Haslam <[email protected]>

The usb20_phy clock needs to be registered for the driver to be able to get and enable a clock. Currently the usb phy clocks are registered form board files, which will not be called during a device tree based boot.

To be able to probe correctly usb form a device tree boot, register the usb phy clocks form the DT specific init.

Unfourtunatly, davinci does not have proper clock support on device tree yet, so by registering the clock form de DT specific file we are forced to hardcode the parent clock, and cannot select refclkin as parent for any of the phy clocks of the da850 family.

As none of the current da850 based boards currently in mainline use refclkin as source. I guess we can live with this limitation until clocks are correctly represented through CCF/device tree.

---

This patch depends on David's series for usb clocks:

currently:
[PATCH v6 0/5] da8xx USB PHY platform devices and clocks
https://lkml.org/lkml/2016/10/25/867

 arch/arm/mach-davinci/da8xx-dt.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-davinci/da8xx-dt.c +0 -0
index c9f7e92..7947267 100644

arch/arm/mach-davinci/da8xx-dt.c line 52

Quoted 8 lines
arch/arm/mach-davinci/da8xx-dt.c +2 -0
@@ -45,6 +45,8 @@
 
 static void __init da850_init_machine(void)
 {
+    da8xx_register_usb20_phy_clk(false);
+    da8xx_register_usb11_phy_clk(false);
     of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
 }
 

You should check for error on return and print a warning if there is an error. Like this: https://patchwork.kernel.org/patch/9395635/

Quoted 4 lines

(I actually just had to make this change a few minutes ago to troubleshoot a problem that I am working on. da8xx_register_usb11_phy_clk() is failing for some reason that I have not figured out yet.)

And actually, since my patch that provides these functions has not been accepted yet, why don't I just add this change to that series?

#3 lore raw
Quoted 62 lines · David Lechner
Quoted 54 lines · David Lechner
Quoted 39 lines · ahaslam at baylibre.com

From: Axel Haslam <[email protected]>

The usb20_phy clock needs to be registered for the driver to be able to get and enable a clock. Currently the usb phy clocks are registered form board files, which will not be called during a device tree based boot.

To be able to probe correctly usb form a device tree boot, register the usb phy clocks form the DT specific init.

Unfourtunatly, davinci does not have proper clock support on device tree yet, so by registering the clock form de DT specific file we are forced to hardcode the parent clock, and cannot select refclkin as parent for any of the phy clocks of the da850 family.

As none of the current da850 based boards currently in mainline use refclkin as source. I guess we can live with this limitation until clocks are correctly represented through CCF/device tree.

---

This patch depends on David's series for usb clocks:

currently:
[PATCH v6 0/5] da8xx USB PHY platform devices and clocks
https://lkml.org/lkml/2016/10/25/867

 arch/arm/mach-davinci/da8xx-dt.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-davinci/da8xx-dt.c +0 -0
index c9f7e92..7947267 100644

arch/arm/mach-davinci/da8xx-dt.c line 52

Quoted 8 lines
arch/arm/mach-davinci/da8xx-dt.c +2 -0
@@ -45,6 +45,8 @@
 
 static void __init da850_init_machine(void)
 {
+    da8xx_register_usb20_phy_clk(false);
+    da8xx_register_usb11_phy_clk(false);
     of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
 }
 

You should check for error on return and print a warning if there is an error. Like this: https://patchwork.kernel.org/patch/9395635/

Quoted 4 lines

(I actually just had to make this change a few minutes ago to troubleshoot a problem that I am working on. da8xx_register_usb11_phy_clk() is failing for some reason that I have not figured out yet.)

Quoted 2 lines

And actually, since my patch that provides these functions has not been accepted yet, why don't I just add this change to that series?

Ok, sure, if you are planing on sending another version.

Regards
Axel

#4 lore raw
Quoted 63 lines · Axel Haslam
Quoted 62 lines · David Lechner
Quoted 58 lines · David Lechner
Quoted 39 lines · ahaslam at baylibre.com

From: Axel Haslam <[email protected]>

The usb20_phy clock needs to be registered for the driver to be able to get and enable a clock. Currently the usb phy clocks are registered form board files, which will not be called during a device tree based boot.

To be able to probe correctly usb form a device tree boot, register the usb phy clocks form the DT specific init.

Unfourtunatly, davinci does not have proper clock support on device tree yet, so by registering the clock form de DT specific file we are forced to hardcode the parent clock, and cannot select refclkin as parent for any of the phy clocks of the da850 family.

As none of the current da850 based boards currently in mainline use refclkin as source. I guess we can live with this limitation until clocks are correctly represented through CCF/device tree.

---

This patch depends on David's series for usb clocks:

currently:
[PATCH v6 0/5] da8xx USB PHY platform devices and clocks
https://lkml.org/lkml/2016/10/25/867

 arch/arm/mach-davinci/da8xx-dt.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-davinci/da8xx-dt.c +0 -0
index c9f7e92..7947267 100644

arch/arm/mach-davinci/da8xx-dt.c line 52

Quoted 8 lines
arch/arm/mach-davinci/da8xx-dt.c +2 -0
@@ -45,6 +45,8 @@
 
 static void __init da850_init_machine(void)
 {
+    da8xx_register_usb20_phy_clk(false);
+    da8xx_register_usb11_phy_clk(false);
     of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
 }
 

You should check for error on return and print a warning if there is an error. Like this: https://patchwork.kernel.org/patch/9395635/

(I actually just had to make this change a few minutes ago to troubleshoot a problem that I am working on. da8xx_register_usb11_phy_clk() is failing for some reason that I have not figured out yet.)

Quoted 8 lines
Quoted 2 lines

And actually, since my patch that provides these functions has not been accepted yet, why don't I just add this change to that series?

Ok, sure, if you are planing on sending another version.

Regards
Axel

Yes, I have some more changes to make and resubmit, so I will include this too.

#5 lore raw
In reply to [email protected]
reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree…

Hi Axel,

[auto build test ERROR on arm-soc/for-next]
[also build test ERROR on v4.9-rc2 next-20161027]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on] [Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/ahaslam-baylibre-com/ARM-davinci-register-the-usb20_phy-clock-on-the-DT-file/20161027-040551
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git for-next
config: arm-davinci_all_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705

reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm

All errors (new ones prefixed by >>):

arch/arm/mach-davinci/da8xx-dt.c: In function 'da850_init_machine':

>> arch/arm/mach-davinci/da8xx-dt.c:48:2: error: implicit declaration of function 'da8xx_register_usb20_phy_clk' [-Werror=implicit-function-declaration]
     da8xx_register_usb20_phy_clk(false);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> arch/arm/mach-davinci/da8xx-dt.c:49:2: error: implicit declaration of function 'da8xx_register_usb11_phy_clk' [-Werror=implicit-function-declaration]
     da8xx_register_usb11_phy_clk(false);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: some warnings being treated as errors

vim +/da8xx_register_usb20_phy_clk +48 arch/arm/mach-davinci/da8xx-dt.c

    42	};
    43	
    44	#ifdef CONFIG_ARCH_DAVINCI_DA850
    45	
    46	static void __init da850_init_machine(void)
    47	{
  > 48		da8xx_register_usb20_phy_clk(false);
  > 49		da8xx_register_usb11_phy_clk(false);
    50		of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
    51	}
    52	

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 21064 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161027/615d600d/attachment-0001.gz>