2017-08-18 15:33:56

by Rocco Folino

[permalink] [raw]
Subject: [PATCH] MIPS: ath79: support devicetree selection

Allow to choose devicetrees from Kconfig.

Signed-off-by: Rocco Folino <[email protected]>
---
arch/mips/ath79/Kconfig | 44 +++++++++++++++++++++++++++++++++++++++++
arch/mips/boot/dts/qca/Makefile | 10 +++++-----
2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig
index dfc60209dc63..b43d116187af 100644
--- a/arch/mips/ath79/Kconfig
+++ b/arch/mips/ath79/Kconfig
@@ -1,5 +1,49 @@
if ATH79

+menu "Atheros AR71XX/AR724X/AR913X devicetree selection"
+
+config DTB_ATH_DPT_MODULE
+ bool "DPTechnics DPT-Module"
+ select SOC_933X
+ select BUILTIN_DTB
+ help
+ Say 'Y' if you want your kernel to support the
+ DPTechnics DPT-Module board.
+
+config DTB_ATH_DRAGINO_MS14
+ bool "Dragino MS14 (Dragino 2)"
+ select SOC_AR933X
+ select BUILTIN_DTB
+ help
+ Say 'Y' if you want your kernel to support the
+ Dragino MS14 board.
+
+config DTB_ATH_OMEGA
+ bool "Onion Omega"
+ select SOC_AR933X
+ select BUILTIN_DTB
+ help
+ Say 'Y' if you want your kernel to support the
+ Onion Omega board.
+
+config DTB_ATH_TL_MR3020
+ bool "TP-Link TL-MR3020"
+ select SOC_AR933X
+ select BUILTIN_DTB
+ help
+ Say 'Y' if you want your kernel to support the
+ TP-Link TL-MR3020 board.
+
+config DTB_ATH_TL_WR1043ND_V1
+ bool "TP-Link TL-WR1043ND v1"
+ select SOC_AR913X
+ select BUILTIN_DTB
+ help
+ Say 'Y' if you want your kernel to support the
+ TP-Link TL-WR1043ND v1 board.
+
+endmenu
+
menu "Atheros AR71XX/AR724X/AR913X machine selection"

config ATH79_MACH_AP121
diff --git a/arch/mips/boot/dts/qca/Makefile b/arch/mips/boot/dts/qca/Makefile
index 63a9ddf048c9..acaf448e4516 100644
--- a/arch/mips/boot/dts/qca/Makefile
+++ b/arch/mips/boot/dts/qca/Makefile
@@ -1,9 +1,9 @@
# All DTBs
-dtb-$(CONFIG_ATH79) += ar9132_tl_wr1043nd_v1.dtb
-dtb-$(CONFIG_ATH79) += ar9331_dpt_module.dtb
-dtb-$(CONFIG_ATH79) += ar9331_dragino_ms14.dtb
-dtb-$(CONFIG_ATH79) += ar9331_omega.dtb
-dtb-$(CONFIG_ATH79) += ar9331_tl_mr3020.dtb
+dtb-$(CONFIG_DTB_ATH_TL_WR1043ND_V1) += ar9132_tl_wr1043nd_v1.dtb
+dtb-$(CONFIG_DTB_ATH_DPT_MODULE) += ar9331_dpt_module.dtb
+dtb-$(CONFIG_DTB_ATH_DRAGINO_MS14) += ar9331_dragino_ms14.dtb
+dtb-$(CONFIG_DTB_ATH_OMEGA) += ar9331_omega.dtb
+dtb-$(CONFIG_DTB_ATH_TL_MR3020) += ar9331_tl_mr3020.dtb

# Force kbuild to make empty built-in.o if necessary
obj- += dummy.o
--
2.13.5


2017-09-06 11:14:43

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH] MIPS: ath79: support devicetree selection

On Fri, Aug 18, 2017 at 05:32:42PM +0200, Rocco Folino wrote:

> Allow to choose devicetrees from Kconfig.
>
> Signed-off-by: Rocco Folino <[email protected]>
> ---
> arch/mips/ath79/Kconfig | 44 +++++++++++++++++++++++++++++++++++++++++
> arch/mips/boot/dts/qca/Makefile | 10 +++++-----
> 2 files changed, 49 insertions(+), 5 deletions(-)
>
> diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig
> index dfc60209dc63..b43d116187af 100644
> --- a/arch/mips/ath79/Kconfig
> +++ b/arch/mips/ath79/Kconfig
> @@ -1,5 +1,49 @@
> if ATH79
>
> +menu "Atheros AR71XX/AR724X/AR913X devicetree selection"
> +
> +config DTB_ATH_DPT_MODULE
> + bool "DPTechnics DPT-Module"
> + select SOC_933X

There is no symbol SOC_933X. Did you mean SOC_AR933X?

Anyway, your patch does more than the changelog ("Allow to choose
devicetrees from Kconfig") says, so please either fix the changelog
or split that into multiple patches with proper changelogs.

Ralf

2017-09-06 12:01:52

by Rocco Folino

[permalink] [raw]
Subject: Re: [PATCH] MIPS: ath79: support devicetree selection

On Wed, Sep 06, 2017 at 01:14:35PM +0200, Ralf Baechle wrote:
> On Fri, Aug 18, 2017 at 05:32:42PM +0200, Rocco Folino wrote:
>
> > Allow to choose devicetrees from Kconfig.
> >
> > Signed-off-by: Rocco Folino <[email protected]>
> > ---
> > arch/mips/ath79/Kconfig | 44 +++++++++++++++++++++++++++++++++++++++++
> > arch/mips/boot/dts/qca/Makefile | 10 +++++-----
> > 2 files changed, 49 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig
> > index dfc60209dc63..b43d116187af 100644
> > --- a/arch/mips/ath79/Kconfig
> > +++ b/arch/mips/ath79/Kconfig
> > @@ -1,5 +1,49 @@
> > if ATH79
> >
> > +menu "Atheros AR71XX/AR724X/AR913X devicetree selection"
> > +
> > +config DTB_ATH_DPT_MODULE
> > + bool "DPTechnics DPT-Module"
> > + select SOC_933X
>
> There is no symbol SOC_933X. Did you mean SOC_AR933X?

Yes, right

>
> Anyway, your patch does more than the changelog ("Allow to choose
> devicetrees from Kconfig") says, so please either fix the changelog
> or split that into multiple patches with proper changelogs.

Ok, I'll fix everything in the v2

thanks for the comments.

Rocco

2017-09-06 12:20:38

by Alban

[permalink] [raw]
Subject: Re: [PATCH] MIPS: ath79: support devicetree selection

On Wed, 6 Sep 2017 13:14:35 +0200
Ralf Baechle <[email protected]> wrote:

> On Fri, Aug 18, 2017 at 05:32:42PM +0200, Rocco Folino wrote:
>
> > Allow to choose devicetrees from Kconfig.
> >
> > Signed-off-by: Rocco Folino <[email protected]>

I don't really see the point of this patch. Building the dtb doesn't
take any significant time, so why add this extra complexity?

Alban


Attachments:
(No filename) (819.00 B)
OpenPGP digital signature

2017-09-06 12:32:06

by Rocco Folino

[permalink] [raw]
Subject: Re: [PATCH] MIPS: ath79: support devicetree selection

On Wed, Sep 06, 2017 at 02:20:05PM +0200, Alban wrote:
> On Wed, 6 Sep 2017 13:14:35 +0200
> Ralf Baechle <[email protected]> wrote:
>
> > On Fri, Aug 18, 2017 at 05:32:42PM +0200, Rocco Folino wrote:
> >
> > > Allow to choose devicetrees from Kconfig.
> > >
> > > Signed-off-by: Rocco Folino <[email protected]>
>
> I don't really see the point of this patch. Building the dtb doesn't
> take any significant time, so why add this extra complexity?

Because you need to select the SoC type in order to enable some drivers, for
example on the AR9331 to use the serial you need the CONFIG_SERIAL_AR933X
which depends on the CONFIG_SOC_AR933X.

Rocco

2017-09-06 13:36:26

by Alban

[permalink] [raw]
Subject: Re: [PATCH] MIPS: ath79: support devicetree selection

On Wed, 6 Sep 2017 14:32:00 +0200
Rocco Folino <[email protected]> wrote:

> On Wed, Sep 06, 2017 at 02:20:05PM +0200, Alban wrote:
> > On Wed, 6 Sep 2017 13:14:35 +0200
> > Ralf Baechle <[email protected]> wrote:
> >
> > > On Fri, Aug 18, 2017 at 05:32:42PM +0200, Rocco Folino wrote:
> > >
> > > > Allow to choose devicetrees from Kconfig.
> > > >
> > > > Signed-off-by: Rocco Folino <[email protected]>
> >
> > I don't really see the point of this patch. Building the dtb doesn't
> > take any significant time, so why add this extra complexity?
>
> Because you need to select the SoC type in order to enable some
> drivers, for example on the AR9331 to use the serial you need the
> CONFIG_SERIAL_AR933X which depends on the CONFIG_SOC_AR933X.

Seeing as this driver is the only one that make use of CONFIG_SOC_AR933X
I would prefer removing this dependency. It would also open the way to have
the driver built in COMPILE_TEST. A few more fixes might be needed but that
would be better than such a workaround.

Alban


Attachments:
(No filename) (819.00 B)
OpenPGP digital signature

2017-09-06 14:00:06

by Rocco Folino

[permalink] [raw]
Subject: Re: [PATCH] MIPS: ath79: support devicetree selection

On Wed, Sep 06, 2017 at 03:35:43PM +0200, Alban wrote:
> On Wed, 6 Sep 2017 14:32:00 +0200
> Rocco Folino <[email protected]> wrote:
>
> > On Wed, Sep 06, 2017 at 02:20:05PM +0200, Alban wrote:
> > > On Wed, 6 Sep 2017 13:14:35 +0200
> > > Ralf Baechle <[email protected]> wrote:
> > >
> > > > On Fri, Aug 18, 2017 at 05:32:42PM +0200, Rocco Folino wrote:
> > > >
> > > > > Allow to choose devicetrees from Kconfig.
> > > > >
> > > > > Signed-off-by: Rocco Folino <[email protected]>
> > >
> > > I don't really see the point of this patch. Building the dtb doesn't
> > > take any significant time, so why add this extra complexity?
> >
> > Because you need to select the SoC type in order to enable some
> > drivers, for example on the AR9331 to use the serial you need the
> > CONFIG_SERIAL_AR933X which depends on the CONFIG_SOC_AR933X.
>
> Seeing as this driver is the only one that make use of CONFIG_SOC_AR933X
> I would prefer removing this dependency. It would also open the way to have
> the driver built in COMPILE_TEST. A few more fixes might be needed but that
> would be better than such a workaround.

Yes, I agree!

Thanks,

Rocco