diff mbox

[1/3] arm64: mediatek: Add config option for mt8173.

Message ID 1422342836-27689-2-git-send-email-hongzhou.yang@mediatek.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hongzhou Yang Jan. 27, 2015, 7:13 a.m. UTC
From: Hongzhou Yang <hongzhou.yang@mediatek.com>

The upcoming MTK pinctrl driver have a big pin table for each SoC,
and we don't want to bloat the kernel binary if we don't need it.
Add config options so we can build for one SoC only.

Signed-off-by: Hongzhou Yang <hongzhou.yang@mediatek.com>
---
 arch/arm64/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Linus Walleij Feb. 10, 2015, 8:21 a.m. UTC | #1
On Tue, Jan 27, 2015 at 3:13 PM, Hongzhou Yang
<hongzhou.yang@mediatek.com> wrote:

> From: Hongzhou Yang <hongzhou.yang@mediatek.com>
>
> The upcoming MTK pinctrl driver have a big pin table for each SoC,
> and we don't want to bloat the kernel binary if we don't need it.
> Add config options so we can build for one SoC only.
>
> Signed-off-by: Hongzhou Yang <hongzhou.yang@mediatek.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Take this through the ARM SoC tree with the rest of the mediatek
SoC stuff.

Yours,
Linus Walleij
Yingjoe Chen Feb. 25, 2015, 9:07 a.m. UTC | #2
On Tue, 2015-01-27 at 15:13 +0800, Hongzhou Yang wrote:
> From: Hongzhou Yang <hongzhou.yang@mediatek.com>
> 
> The upcoming MTK pinctrl driver have a big pin table for each SoC,
> and we don't want to bloat the kernel binary if we don't need it.
> Add config options so we can build for one SoC only.
> 
> Signed-off-by: Hongzhou Yang <hongzhou.yang@mediatek.com>
> ---
>  arch/arm64/Kconfig | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index e627ead..6213dac 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -151,9 +151,15 @@ menu "Platform selection"
>  config ARCH_MEDIATEK
>  	bool "Mediatek MT65xx & MT81xx ARMv8 SoC"
>  	select ARM_GIC
> +	select PINCTRL
>  	help
>  	  Support for Mediatek MT65xx & MT81xx ARMv8 SoCs
>  
> +config MACH_MT8173
> +	bool "Mediatek 8173 Soc Supprt"
> +	depends on ARCH_MEDIATEK
> +	default y
> +
>  config ARCH_SEATTLE
>  	bool "AMD Seattle SoC Family"
>  	help

Hi Arnd/Matthias,

Any comments on this patch?

Joe.C
Arnd Bergmann Feb. 25, 2015, 10:51 a.m. UTC | #3
On Wednesday 25 February 2015 17:07:22 Yingjoe Chen wrote:
> On Tue, 2015-01-27 at 15:13 +0800, Hongzhou Yang wrote:
> > From: Hongzhou Yang <hongzhou.yang@mediatek.com>
> > 
> > The upcoming MTK pinctrl driver have a big pin table for each SoC,
> > and we don't want to bloat the kernel binary if we don't need it.
> > Add config options so we can build for one SoC only.
> > 
> > Signed-off-by: Hongzhou Yang <hongzhou.yang@mediatek.com>
> > ---
> >  arch/arm64/Kconfig | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index e627ead..6213dac 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -151,9 +151,15 @@ menu "Platform selection"
> >  config ARCH_MEDIATEK
> >       bool "Mediatek MT65xx & MT81xx ARMv8 SoC"
> >       select ARM_GIC
> > +     select PINCTRL
> >       help
> >         Support for Mediatek MT65xx & MT81xx ARMv8 SoCs
> >  
> > +config MACH_MT8173
> > +     bool "Mediatek 8173 Soc Supprt"
> > +     depends on ARCH_MEDIATEK
> > +     default y
> > +
> >  config ARCH_SEATTLE
> >       bool "AMD Seattle SoC Family"
> >       help
> 
> Hi Arnd/Matthias,
> 
> Any comments on this patch?

Hi Joe,

Actually I just commented on a similar patch from Samsung the other
day, and I think we should make a more general decision about these:

I would rather see only one Kconfig option per SoC family and use
ARCH_MEDIATEK without any MACH_* options. We can have other options
for e.g. networking chips from Mediatek that are not closely related
but I would group all the phone and tablet chips under one option
here. Same for the other vendors of course.

Any other opinions?

	Arnd
Catalin Marinas Feb. 25, 2015, 11:11 a.m. UTC | #4
On Wed, Feb 25, 2015 at 11:51:57AM +0100, Arnd Bergmann wrote:
> On Wednesday 25 February 2015 17:07:22 Yingjoe Chen wrote:
> > On Tue, 2015-01-27 at 15:13 +0800, Hongzhou Yang wrote:
> > > From: Hongzhou Yang <hongzhou.yang@mediatek.com>
> > > 
> > > The upcoming MTK pinctrl driver have a big pin table for each SoC,
> > > and we don't want to bloat the kernel binary if we don't need it.
> > > Add config options so we can build for one SoC only.
> > > 
> > > Signed-off-by: Hongzhou Yang <hongzhou.yang@mediatek.com>
> > > ---
> > >  arch/arm64/Kconfig | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > > 
> > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > > index e627ead..6213dac 100644
> > > --- a/arch/arm64/Kconfig
> > > +++ b/arch/arm64/Kconfig
> > > @@ -151,9 +151,15 @@ menu "Platform selection"
> > >  config ARCH_MEDIATEK
> > >       bool "Mediatek MT65xx & MT81xx ARMv8 SoC"
> > >       select ARM_GIC
> > > +     select PINCTRL
> > >       help
> > >         Support for Mediatek MT65xx & MT81xx ARMv8 SoCs
> > >  
> > > +config MACH_MT8173
> > > +     bool "Mediatek 8173 Soc Supprt"
> > > +     depends on ARCH_MEDIATEK
> > > +     default y
> > > +
> > >  config ARCH_SEATTLE
> > >       bool "AMD Seattle SoC Family"
> > >       help
> > 
> > Hi Arnd/Matthias,
> > 
> > Any comments on this patch?
> 
> Hi Joe,
> 
> Actually I just commented on a similar patch from Samsung the other
> day, and I think we should make a more general decision about these:
> 
> I would rather see only one Kconfig option per SoC family and use
> ARCH_MEDIATEK without any MACH_* options. We can have other options
> for e.g. networking chips from Mediatek that are not closely related
> but I would group all the phone and tablet chips under one option
> here. Same for the other vendors of course.

I agree.
Yingjoe Chen March 4, 2015, 2:31 a.m. UTC | #5
On Wed, 2015-02-25 at 11:11 +0000, Catalin Marinas wrote:
> On Wed, Feb 25, 2015 at 11:51:57AM +0100, Arnd Bergmann wrote:
> > On Wednesday 25 February 2015 17:07:22 Yingjoe Chen wrote:
> > > On Tue, 2015-01-27 at 15:13 +0800, Hongzhou Yang wrote:
> > > > From: Hongzhou Yang <hongzhou.yang@mediatek.com>
> > > > 
> > > > The upcoming MTK pinctrl driver have a big pin table for each SoC,
> > > > and we don't want to bloat the kernel binary if we don't need it.
> > > > Add config options so we can build for one SoC only.
> > > > 
> > > > Signed-off-by: Hongzhou Yang <hongzhou.yang@mediatek.com>
> > > > ---
> > > >  arch/arm64/Kconfig | 6 ++++++
> > > >  1 file changed, 6 insertions(+)
> > > > 
> > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > > > index e627ead..6213dac 100644
> > > > --- a/arch/arm64/Kconfig
> > > > +++ b/arch/arm64/Kconfig
> > > > @@ -151,9 +151,15 @@ menu "Platform selection"
> > > >  config ARCH_MEDIATEK
> > > >       bool "Mediatek MT65xx & MT81xx ARMv8 SoC"
> > > >       select ARM_GIC
> > > > +     select PINCTRL
> > > >       help
> > > >         Support for Mediatek MT65xx & MT81xx ARMv8 SoCs
> > > >  
> > > > +config MACH_MT8173
> > > > +     bool "Mediatek 8173 Soc Supprt"
> > > > +     depends on ARCH_MEDIATEK
> > > > +     default y
> > > > +
> > > >  config ARCH_SEATTLE
> > > >       bool "AMD Seattle SoC Family"
> > > >       help
> > > 
> > > Hi Arnd/Matthias,
> > > 
> > > Any comments on this patch?
> > 
> > Hi Joe,
> > 
> > Actually I just commented on a similar patch from Samsung the other
> > day, and I think we should make a more general decision about these:
> > 
> > I would rather see only one Kconfig option per SoC family and use
> > ARCH_MEDIATEK without any MACH_* options. We can have other options
> > for e.g. networking chips from Mediatek that are not closely related
> > but I would group all the phone and tablet chips under one option
> > here. Same for the other vendors of course.
> 
> I agree.
> 

Hi,

Since we support devicetree, we don't need MACH_* to build a working
kernel. This is true even for our v7 soc. We intend to use it to reduce
numbers of drivers in product kernel binary.
Most drivers are shared among the same SoCs family, but some are not.
Currently for pinctrl driver, we are doing this so user don't need to
select them one by one:

config PINCTRL_MT8173
        def_bool MACH_MT8173
        select PINCTRL_MTK_COMMON

Alternatively, we could add these MACH_* to some other places, eg,
drivers/soc/mediatek. Or we don't add MACH_* at all, and have all
drivers export their own Kconfig option. User will need to select each
of them one-by-one.

What do you think?

Joe.C
Arnd Bergmann March 4, 2015, 9:53 a.m. UTC | #6
On Wednesday 04 March 2015 10:31:07 Yingjoe Chen wrote:
> Hi,
> 
> Since we support devicetree, we don't need MACH_* to build a working
> kernel. This is true even for our v7 soc. We intend to use it to reduce
> numbers of drivers in product kernel binary.
> Most drivers are shared among the same SoCs family, but some are not.
> Currently for pinctrl driver, we are doing this so user don't need to
> select them one by one:
> 
> config PINCTRL_MT8173
>         def_bool MACH_MT8173
>         select PINCTRL_MTK_COMMON
> 
> Alternatively, we could add these MACH_* to some other places, eg,
> drivers/soc/mediatek. Or we don't add MACH_* at all, and have all
> drivers export their own Kconfig option. User will need to select each
> of them one-by-one.
> 
> What do you think?

I would rather see these as user-selectable options, which has the
other benefit of giving compile-time coverage. For your example,
I'd suggest doing

config PINCTRL_MT8173
        bool "Mediatek MT8173 pin control"
	depends on ARCH_MEDIATEK || COMPILE_TEST
        select PINCTRL_MTK_COMMON
	help
	   ... a useful description ...


	Arnd
Yingjoe Chen March 4, 2015, 10:01 a.m. UTC | #7
On Wed, 2015-03-04 at 10:53 +0100, Arnd Bergmann wrote:
> On Wednesday 04 March 2015 10:31:07 Yingjoe Chen wrote:
> > Hi,
> > 
> > Since we support devicetree, we don't need MACH_* to build a working
> > kernel. This is true even for our v7 soc. We intend to use it to reduce
> > numbers of drivers in product kernel binary.
> > Most drivers are shared among the same SoCs family, but some are not.
> > Currently for pinctrl driver, we are doing this so user don't need to
> > select them one by one:
> > 
> > config PINCTRL_MT8173
> >         def_bool MACH_MT8173
> >         select PINCTRL_MTK_COMMON
> > 
> > Alternatively, we could add these MACH_* to some other places, eg,
> > drivers/soc/mediatek. Or we don't add MACH_* at all, and have all
> > drivers export their own Kconfig option. User will need to select each
> > of them one-by-one.
> > 
> > What do you think?
> 
> I would rather see these as user-selectable options, which has the
> other benefit of giving compile-time coverage. For your example,
> I'd suggest doing
> 
> config PINCTRL_MT8173
>         bool "Mediatek MT8173 pin control"
> 	depends on ARCH_MEDIATEK || COMPILE_TEST
>         select PINCTRL_MTK_COMMON
> 	help
> 	   ... a useful description ...
> 

OK, I'll send a new patch to do this.
Thanks.

Joe.C
diff mbox

Patch

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index e627ead..6213dac 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -151,9 +151,15 @@  menu "Platform selection"
 config ARCH_MEDIATEK
 	bool "Mediatek MT65xx & MT81xx ARMv8 SoC"
 	select ARM_GIC
+	select PINCTRL
 	help
 	  Support for Mediatek MT65xx & MT81xx ARMv8 SoCs
 
+config MACH_MT8173
+	bool "Mediatek 8173 Soc Supprt"
+	depends on ARCH_MEDIATEK
+	default y
+
 config ARCH_SEATTLE
 	bool "AMD Seattle SoC Family"
 	help