Message ID | cover.1582096982.git.rahul.tanwar@linux.intel.com |
---|---|
Headers | show |
Series | intel: Add a new driver for a new clock controller IP | expand |
On 2/18/20 11:40 PM, Rahul Tanwar wrote: > From: rtanwar <rahul.tanwar@intel.com> > > Clock Generation Unit(CGU) is a new clock controller IP of a forthcoming > Intel network processor SoC named Lightning Mountain(LGM). It provides > programming interfaces to control & configure all CPU & peripheral clocks. > Add common clock framework based clock controller driver for CGU. > > Signed-off-by: Rahul Tanwar <rahul.tanwar@linux.intel.com> > --- > drivers/clk/Kconfig | 1 + > drivers/clk/x86/Kconfig | 8 + > drivers/clk/x86/Makefile | 1 + > drivers/clk/x86/clk-cgu-pll.c | 156 +++++++++++ > drivers/clk/x86/clk-cgu.c | 636 ++++++++++++++++++++++++++++++++++++++++++ > drivers/clk/x86/clk-cgu.h | 335 ++++++++++++++++++++++ > drivers/clk/x86/clk-lgm.c | 492 ++++++++++++++++++++++++++++++++ > 7 files changed, 1629 insertions(+) > create mode 100644 drivers/clk/x86/Kconfig > create mode 100644 drivers/clk/x86/clk-cgu-pll.c > create mode 100644 drivers/clk/x86/clk-cgu.c > create mode 100644 drivers/clk/x86/clk-cgu.h > create mode 100644 drivers/clk/x86/clk-lgm.c > > diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig > index bcb257baed06..43dab257e7aa 100644 > --- a/drivers/clk/Kconfig > +++ b/drivers/clk/Kconfig > @@ -360,6 +360,7 @@ source "drivers/clk/sunxi-ng/Kconfig" > source "drivers/clk/tegra/Kconfig" > source "drivers/clk/ti/Kconfig" > source "drivers/clk/uniphier/Kconfig" > +source "drivers/clk/x86/Kconfig" > source "drivers/clk/zynqmp/Kconfig" > > endmenu Hi, > diff --git a/drivers/clk/x86/Kconfig b/drivers/clk/x86/Kconfig > new file mode 100644 > index 000000000000..2e2b9730541f > --- /dev/null > +++ b/drivers/clk/x86/Kconfig > @@ -0,0 +1,8 @@ > +# SPDX-License-Identifier: GPL-2.0-only > +config CLK_LGM_CGU > + depends on (OF && HAS_IOMEM) || COMPILE_TEST This "depends on" looks problematic to me. I guess we shall see when all the build bots get to it. > + select OF_EARLY_FLATTREE If OF is not set and HAS_IOMEM is not set, but COMPILE_TEST is set, I expect that this should not be attempting to select OF_EARLY_FLATTREE. Have you tried such a config combination? > + bool "Clock driver for Lightning Mountain(LGM) platform" > + help > + Clock Generation Unit(CGU) driver for Intel Lightning Mountain(LGM) > + network processor SoC. thanks.
Hi Randy, On 19/2/2020 3:59 PM, Randy Dunlap wrote: > On 2/18/20 11:40 PM, Rahul Tanwar wrote: >> From: rtanwar <rahul.tanwar@intel.com> >> >> Clock Generation Unit(CGU) is a new clock controller IP of a forthcoming >> Intel network processor SoC named Lightning Mountain(LGM). It provides >> programming interfaces to control & configure all CPU & peripheral clocks. >> Add common clock framework based clock controller driver for CGU. >> >> Signed-off-by: Rahul Tanwar <rahul.tanwar@linux.intel.com> >> --- >> drivers/clk/Kconfig | 1 + >> drivers/clk/x86/Kconfig | 8 + >> drivers/clk/x86/Makefile | 1 + >> drivers/clk/x86/clk-cgu-pll.c | 156 +++++++++++ >> drivers/clk/x86/clk-cgu.c | 636 ++++++++++++++++++++++++++++++++++++++++++ >> drivers/clk/x86/clk-cgu.h | 335 ++++++++++++++++++++++ >> drivers/clk/x86/clk-lgm.c | 492 ++++++++++++++++++++++++++++++++ >> 7 files changed, 1629 insertions(+) >> create mode 100644 drivers/clk/x86/Kconfig >> create mode 100644 drivers/clk/x86/clk-cgu-pll.c >> create mode 100644 drivers/clk/x86/clk-cgu.c >> create mode 100644 drivers/clk/x86/clk-cgu.h >> create mode 100644 drivers/clk/x86/clk-lgm.c >> >> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig >> index bcb257baed06..43dab257e7aa 100644 >> --- a/drivers/clk/Kconfig >> +++ b/drivers/clk/Kconfig >> @@ -360,6 +360,7 @@ source "drivers/clk/sunxi-ng/Kconfig" >> source "drivers/clk/tegra/Kconfig" >> source "drivers/clk/ti/Kconfig" >> source "drivers/clk/uniphier/Kconfig" >> +source "drivers/clk/x86/Kconfig" >> source "drivers/clk/zynqmp/Kconfig" >> >> endmenu > Hi, > >> diff --git a/drivers/clk/x86/Kconfig b/drivers/clk/x86/Kconfig >> new file mode 100644 >> index 000000000000..2e2b9730541f >> --- /dev/null >> +++ b/drivers/clk/x86/Kconfig >> @@ -0,0 +1,8 @@ >> +# SPDX-License-Identifier: GPL-2.0-only >> +config CLK_LGM_CGU >> + depends on (OF && HAS_IOMEM) || COMPILE_TEST > This "depends on" looks problematic to me. I guess we shall see when > all the build bots get to it. At the moment, i am not able to figure out possible problems in this.. >> + select OF_EARLY_FLATTREE > If OF is not set and HAS_IOMEM is not set, but COMPILE_TEST is set, > I expect that this should not be attempting to select OF_EARLY_FLATTREE. > > Have you tried such a config combination? Agree, that would be a problem. I will change it to select OF_EARLY_FLATTREE if OF Thanks. Regards, Rahul
On Thu, Feb 27, 2020 at 03:19:26PM +0800, Tanwar, Rahul wrote: > On 19/2/2020 3:59 PM, Randy Dunlap wrote: > > On 2/18/20 11:40 PM, Rahul Tanwar wrote: > >> +config CLK_LGM_CGU > >> + depends on (OF && HAS_IOMEM) || COMPILE_TEST > > This "depends on" looks problematic to me. I guess we shall see when > > all the build bots get to it. > > At the moment, i am not able to figure out possible problems in this.. COMPILE_TEST should be accompanied by non-generic dependency. There is none. So, I quite agree with Randy. > >> + select OF_EARLY_FLATTREE > > If OF is not set and HAS_IOMEM is not set, but COMPILE_TEST is set, > > I expect that this should not be attempting to select OF_EARLY_FLATTREE. > > > > Have you tried such a config combination? > > Agree, that would be a problem. I will change it to > > select OF_EARLY_FLATTREE if OF Nope, I think this is wrong work around. See above.
On 27/2/2020 6:02 PM, Andy Shevchenko wrote: > On Thu, Feb 27, 2020 at 03:19:26PM +0800, Tanwar, Rahul wrote: >> On 19/2/2020 3:59 PM, Randy Dunlap wrote: >>> On 2/18/20 11:40 PM, Rahul Tanwar wrote: >>> >>>> +config CLK_LGM_CGU >>>> + depends on (OF && HAS_IOMEM) || COMPILE_TEST >>> This "depends on" looks problematic to me. I guess we shall see when >>> all the build bots get to it. >> At the moment, i am not able to figure out possible problems in this.. > COMPILE_TEST should be accompanied by non-generic dependency. > There is none. > > So, I quite agree with Randy. I see COMPILE_TEST is mostly ORed with ARCH_xx. How about below? depends on OF && HAS_IOMEM && (CONFIG_X86 || COMPILE_TEST) >>>> + select OF_EARLY_FLATTREE >>> If OF is not set and HAS_IOMEM is not set, but COMPILE_TEST is set, >>> I expect that this should not be attempting to select OF_EARLY_FLATTREE. >>> >>> Have you tried such a config combination? >> Agree, that would be a problem. I will change it to >> >> select OF_EARLY_FLATTREE if OF > Nope, I think this is wrong work around. > See above. With above proposed change, i can simply switch to select OF_EARLY_FLATTREE since all dependencies are already in place.. Thanks. Regards, Rahul
On Tue, Mar 03, 2020 at 11:37:23AM +0800, Tanwar, Rahul wrote: > On 27/2/2020 6:02 PM, Andy Shevchenko wrote: > > On Thu, Feb 27, 2020 at 03:19:26PM +0800, Tanwar, Rahul wrote: > >> On 19/2/2020 3:59 PM, Randy Dunlap wrote: > >>> On 2/18/20 11:40 PM, Rahul Tanwar wrote: > >>> > >>>> +config CLK_LGM_CGU > >>>> + depends on (OF && HAS_IOMEM) || COMPILE_TEST > >>> This "depends on" looks problematic to me. I guess we shall see when > >>> all the build bots get to it. > >> At the moment, i am not able to figure out possible problems in this.. > > COMPILE_TEST should be accompanied by non-generic dependency. > > There is none. > > > > So, I quite agree with Randy. > > I see COMPILE_TEST is mostly ORed with ARCH_xx. How about below? > > depends on OF && HAS_IOMEM && (CONFIG_X86 || COMPILE_TEST) How about to leave logical parts separately? How is OF related to architecture? On top of that, is this code only for x86 for sure? > >>>> + select OF_EARLY_FLATTREE > >>> If OF is not set and HAS_IOMEM is not set, but COMPILE_TEST is set, > >>> I expect that this should not be attempting to select OF_EARLY_FLATTREE. > >>> > >>> Have you tried such a config combination? > >> Agree, that would be a problem. I will change it to > >> > >> select OF_EARLY_FLATTREE if OF > > Nope, I think this is wrong work around. > > See above. > > With above proposed change, i can simply switch to > select OF_EARLY_FLATTREE since all dependencies are already > in place.. Right.
On 3/3/2020 6:09 PM, Andy Shevchenko wrote: > On Tue, Mar 03, 2020 at 11:37:23AM +0800, Tanwar, Rahul wrote: >> On 27/2/2020 6:02 PM, Andy Shevchenko wrote: >>> On Thu, Feb 27, 2020 at 03:19:26PM +0800, Tanwar, Rahul wrote: >>>> On 19/2/2020 3:59 PM, Randy Dunlap wrote: >>>>> On 2/18/20 11:40 PM, Rahul Tanwar wrote: >>>>> >>>>>> +config CLK_LGM_CGU >>>>>> + depends on (OF && HAS_IOMEM) || COMPILE_TEST >>>>> This "depends on" looks problematic to me. I guess we shall see when >>>>> all the build bots get to it. >>>> At the moment, i am not able to figure out possible problems in this.. >>> COMPILE_TEST should be accompanied by non-generic dependency. >>> There is none. >>> >>> So, I quite agree with Randy. >> I see COMPILE_TEST is mostly ORed with ARCH_xx. How about below? >> >> depends on OF && HAS_IOMEM && (CONFIG_X86 || COMPILE_TEST) > How about to leave logical parts separately? > How is OF related to architecture? OF is not related to architecture. Driver depends on OF. In the past, many build/linker issues were reported due to OF & HAS_IOMEM dependencies in the code. Please see [1] & [2]. So to be safe this time, i am adding these dependencies here. > On top of that, is this code only for x86 for sure? > Yes, this is a totally new IP for x86 based SoC. No plans of using same IP/driver for any other arch based SoCs. [1] https://lkml.org/lkml/2019/12/3/613 [2] https://lkml.org/lkml/2019/12/11/1733