Skip to contentSkip to conversation

mips: jz4780: Kconfig cleanup

PATCH In review Krzysztof Kozlowski 4 participants 20 messages Jul 24, 2020 – Aug 3, 2020

Subsystems (5)
lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

v3 cover mips: jz4780: Kconfig cleanup

Hi,

This is a subset of my bigger work for memory controller drivers [1].

Patch #1 (memory): I can take it through my tree because of dependant work around compile testing.

Patch #2: Independent, please pick it up if it looks good.

[1] https://lore.kernel.org/lkml/20200724140345.GB13472@kozik-lap/T/#t

Best regards,
Krzysztof

Krzysztof Kozlowski (2):
memory: jz4780-nemc: Limit dependency and compile testing to Ingenic
architecture only
mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

 drivers/memory/Kconfig               | 4 ++--
 drivers/mtd/nand/raw/ingenic/Kconfig | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH v3 1/2 memory: jz4780-nemc: Limit dependency and compile testing to Ingenic architecture only

Enabling the JZ4780_NEMC driver makes sense only for specific hardware - the Ingenic SoC architecture. Set it's dependency to MACH_INGENIC so it will not appear on unrelated architectures (easier job for downstream/distro kernel engineers).

When compile testing, do not enable the driver on other architectures.

---

Changes since v2:
1. MIPS -> MACH_INGENIC, as suggested by Arnd

---
 drivers/memory/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/memory/Kconfig +2 -2
index a1493549fec3..cd4fc93b50df 100644
@@ -152,8 +152,8 @@ config FSL_IFC
 
 config JZ4780_NEMC
 	bool "Ingenic JZ4780 SoC NEMC driver"
-	default y
-	depends on MIPS || COMPILE_TEST
+	default y if MACH_INGENIC
+	depends on MACH_INGENIC || COMPILE_TEST
 	depends on HAS_IOMEM && OF
 	help
 	  This driver is for the NAND/External Memory Controller (NEMC) in
Signature · 1 line
2.17.1
author maintainer
#2 lore raw

PATCH v3 2/2 mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

In reply to Krzysztof Kozlowski

Enabling the MTD_NAND_JZ4780 driver makes sense only for specific hardware - the Ingenic SoC architecture. Set it's dependency to MACH_INGENIC so it will not appear on unrelated architectures (easier job for downstream/distro kernel engineers).

---

Changes since v2:
1. New patch

---
 drivers/mtd/nand/raw/ingenic/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/ingenic/Kconfig +1 -1
index 96c5ae8b1bbc..2e3936543ba6 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config MTD_NAND_JZ4780
 	tristate "JZ4780 NAND controller"
-	depends on MIPS || COMPILE_TEST
+	depends on MACH_INGENIC || COMPILE_TEST
 	depends on JZ4780_NEMC
 	help
 	  Enables support for NAND Flash connected to the NEMC on JZ4780 SoC
Signature · 1 line
2.17.1
maintainer
#3 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Hi Krzysztof,

Quoted 4 lines · Krzysztof Kozlowski

Enabling the MTD_NAND_JZ4780 driver makes sense only for specific hardware - the Ingenic SoC architecture. Set it's dependency to MACH_INGENIC so it will not appear on unrelated architectures (easier job for downstream/distro kernel engineers).

Disagreed. It was done this way so that distro kernels can support multiple SoCs.

-Paul

Quoted 26 lines

---

Changes since v2:
1. New patch

---
 drivers/mtd/nand/raw/ingenic/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/ingenic/Kconfig +1 -2
index 96c5ae8b1bbc..2e3936543ba6 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config MTD_NAND_JZ4780
 	tristate "JZ4780 NAND controller"
-	depends on MIPS || COMPILE_TEST
+	depends on MACH_INGENIC || COMPILE_TEST
 	depends on JZ4780_NEMC
 	help
 	  Enables support for NAND Flash connected to the NEMC on JZ4780 SoC
--

2.17.1

author maintainer
#4 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 6 lines · Paul Cercueil

Hi Krzysztof,

Le ven. 24 juil. 2020 à 16:54, Krzysztof Kozlowski <[email protected]> a écrit :

Quoted 7 lines
Quoted 4 lines

Enabling the MTD_NAND_JZ4780 driver makes sense only for specific hardware - the Ingenic SoC architecture. Set it's dependency to MACH_INGENIC so it will not appear on unrelated architectures (easier job for downstream/distro kernel engineers).

Disagreed. It was done this way so that distro kernels can support multiple SoCs.

They will still be able to support multiple SoCs. Nothing changed here. The same we do for all ARM drivers (SoCs are multiplatform)... Unless you want to say that it is possible to support Ingenic SoC without MACH_INGENIC?

Best regards,
Krzysztof

maintainer
#5 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 14 lines · Krzysztof Kozlowski
Quoted 13 lines · Paul Cercueil

Hi Krzysztof,

Le ven. 24 juil. 2020 à 16:54, Krzysztof Kozlowski
<[email protected]> a
écrit :

Quoted 3 lines

Enabling the MTD_NAND_JZ4780 driver makes sense only for specific hardware - the Ingenic SoC architecture. Set it's dependency to MACH_INGENIC so it will not appear on unrelated architectures

(easier

Quoted 1 line

job for downstream/distro kernel engineers).

Quoted 7 lines
Quoted 2 lines

Disagreed. It was done this way so that distro kernels can support multiple SoCs.

They will still be able to support multiple SoCs. Nothing changed here. The same we do for all ARM drivers (SoCs are multiplatform)... Unless you want to say that it is possible to support Ingenic SoC without MACH_INGENIC?

On MIPS, the SoC selection is a Kconfig "choice", so you can only support one SoC family, unfortunately. I'm the one to blame for using "depends on MIPS || COMPILE_TEST" on ingenic drivers, maybe it should depend on MACH_INGENIC indeed, but then it should be made possible to support more than one SoC family.

That's something that should be pointed out to the MIPS mailing list, I believe.

Btw: Does that mean you are the new maintainer for drivers/memory/?

Cheers,
-Paul

Quoted 2 lines

Best regards,
Krzysztof

author maintainer
#6 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 22 lines · Paul Cercueil

Le ven. 24 juil. 2020 à 17:33, Krzysztof Kozlowski <[email protected]> a écrit :

Quoted 18 lines
Quoted 15 lines · Paul Cercueil

Hi Krzysztof,

Le ven. 24 juil. 2020 à 16:54, Krzysztof Kozlowski
<[email protected]> a
écrit :

Quoted 3 lines

Enabling the MTD_NAND_JZ4780 driver makes sense only for specific hardware - the Ingenic SoC architecture. Set it's dependency to MACH_INGENIC so it will not appear on unrelated architectures

(easier

Quoted 1 line

job for downstream/distro kernel engineers).

Disagreed. It was done this way so that distro kernels can support multiple SoCs.

Quoted 7 lines
Quoted 4 lines

They will still be able to support multiple SoCs. Nothing changed here. The same we do for all ARM drivers (SoCs are multiplatform)... Unless you want to say that it is possible to support Ingenic SoC without MACH_INGENIC?

On MIPS, the SoC selection is a Kconfig "choice", so you can only support one SoC family, unfortunately.

Let's say someone selected then some other architecture (MIPS_ALCHEMY). They could select this MTD driver.

Does it mean they would be able to run it on Ingenic hardware?

Quoted 7 lines

I'm the one to blame for using "depends on
MIPS || COMPILE_TEST" on ingenic drivers, maybe it should depend on MACH_INGENIC indeed, but then it should be made possible to support more than one SoC family.

That's something that should be pointed out to the MIPS mailing list, I believe.

Somehow JZ4780 entries in Maintainers do not mention MIPS list...

Quoted 2 lines

Btw: Does that mean you are the new maintainer for drivers/memory/?

Yes, that's the coming change.

https://lore.kernel.org/lkml/20200724140345.GB13472@kozik-lap/T/#m91ca20920a7ec5f228a595f1816c15b6c85b6a09

Best regards,
Krzysztof

maintainer
#7 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 33 lines · Krzysztof Kozlowski
Quoted 32 lines · Paul Cercueil

Le ven. 24 juil. 2020 à 17:33, Krzysztof Kozlowski
<[email protected]> a écrit
:

Quoted 10 lines
Quoted 8 lines · Paul Cercueil

Hi Krzysztof,

Le ven. 24 juil. 2020 à 16:54, Krzysztof Kozlowski
<[email protected]> a
écrit :

Quoted 1 line

Enabling the MTD_NAND_JZ4780 driver makes sense only for

specific

Quoted 1 line
Quoted 1 line
Quoted 1 line

hardware - the Ingenic SoC architecture. Set it's

dependency to

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

MACH_INGENIC so it will not appear on unrelated architectures

(easier

Quoted 1 line

job for downstream/distro kernel engineers).

Disagreed. It was done this way so that distro kernels can

support

Quoted 4 lines
Quoted 1 line

multiple SoCs.

They will still be able to support multiple SoCs. Nothing changed here. The same we do for all ARM drivers (SoCs are

multiplatform)...

Quoted 2 lines

Unless you want to say that it is possible to support Ingenic SoC without MACH_INGENIC?

Quoted 8 lines
Quoted 3 lines

On MIPS, the SoC selection is a Kconfig "choice", so you can only
support
one SoC family, unfortunately.

Let's say someone selected then some other architecture (MIPS_ALCHEMY). They could select this MTD driver.

Does it mean they would be able to run it on Ingenic hardware?

In *theory* yes, as long as the Kconfig options that MACH_INGENIC selects are enabled, the kernel should boot and work on Ingenic SoCs.

-Paul

Quoted 22 lines
Quoted 9 lines

I'm the one to blame for using "depends on
MIPS || COMPILE_TEST" on ingenic drivers, maybe it should depend on MACH_INGENIC indeed, but then it should be made possible to support
more
than one SoC family.

That's something that should be pointed out to the MIPS mailing
list, I
believe.

Somehow JZ4780 entries in Maintainers do not mention MIPS list...

Quoted 2 lines

Btw: Does that mean you are the new maintainer for drivers/memory/?

Yes, that's the coming change.

https://lore.kernel.org/lkml/20200724140345.GB13472@kozik-lap/T/#m91ca20920a7ec5f228a595f1816c15b6c85b6a09

Best regards,
Krzysztof

#8 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 12 lines · Paul Cercueil

Le ven. 24 juil. 2020 à 17:54, Krzysztof Kozlowski <[email protected]> a écrit :

Quoted 10 lines · Paul Cercueil
Quoted 8 lines
Quoted 2 lines · Krzysztof Kozlowski

On Fri, 24 Jul 2020 at 17:19, Paul Cercueil <[email protected]> wrote:

On MIPS, the SoC selection is a Kconfig "choice", so you can only
support
one SoC family, unfortunately.

Quoted 8 lines
Quoted 5 lines

Let's say someone selected then some other architecture (MIPS_ALCHEMY).
They could select this MTD driver.

Does it mean they would be able to run it on Ingenic hardware?

In *theory* yes, as long as the Kconfig options that MACH_INGENIC selects are enabled, the kernel should boot and work on Ingenic SoCs.

Right now, this won't work yet, because there are platform specific functions that are implemented by each of the platforms in arch/mips, e.g. arch/mips/generic/init.c and arch/mips/jz4740/setup.c.

A lot of the newer platforms are part of arch/mips/generic (CONFIG_MIPS_GENERIC), which roughly corresponds to CONFIG_ARCH_MULTIPLATFORM on in arch/arm/.
Similarly, there are header files in arch/mips/include/asm/mach-*/ that conflict and you need to have the right one.

To have more than one platform enabled, each one needs to have all of that platform code converted to fit into the MIPS_GENERIC framework. This can be a lot of work, but I suppose the ingenic platform would be a candidate for which this makes sense, as long as new SoCs of that family still come out.

Arnd

author maintainer
#9 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 17 lines · Arnd Bergmann
Quoted 16 lines · Paul Cercueil

Le ven. 24 juil. 2020 à 17:54, Krzysztof Kozlowski <[email protected]> a écrit :

Quoted 14 lines · Paul Cercueil
Quoted 8 lines
Quoted 2 lines · Krzysztof Kozlowski

On Fri, 24 Jul 2020 at 17:19, Paul Cercueil <[email protected]> wrote:

On MIPS, the SoC selection is a Kconfig "choice", so you can only
support
one SoC family, unfortunately.

Let's say someone selected then some other architecture (MIPS_ALCHEMY).
They could select this MTD driver.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Does it mean they would be able to run it on Ingenic hardware?

In *theory* yes, as long as the Kconfig options that MACH_INGENIC selects are enabled, the kernel should boot and work on Ingenic SoCs.

Right now, this won't work yet, because there are platform specific functions that are implemented by each of the platforms in arch/mips, e.g. arch/mips/generic/init.c and arch/mips/jz4740/setup.c.

I would say even more - no DTS would be provided for such configuration. All Ingenic DTSes are included only with MACH_INGENIC. You cannot build a kernel working on Ingenic without MACH_INGENIC. Even in theory.

Quoted 7 lines

A lot of the newer platforms are part of arch/mips/generic (CONFIG_MIPS_GENERIC), which roughly corresponds to CONFIG_ARCH_MULTIPLATFORM on in arch/arm/.
Similarly, there are header files in arch/mips/include/asm/mach-*/ that conflict and you need to have the right one.

Quoted 6 lines

To have more than one platform enabled, each one needs to have all of that platform code converted to fit into the MIPS_GENERIC framework. This can be a lot of work, but I suppose the ingenic platform would be a candidate for which this makes sense, as long as new SoCs of that family still come out.

I can therefore change the patch to:
depends on MACH_INGENIC || MIPS_GENERIC || COMPILE_TEST

Other solution is to leave MTD driver as is and for the memory driver go with my v2 approach:
https://lore.kernel.org/lkml/[email protected]/

Best regards,
Krzysztof

maintainer Acked-by
#19 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

In reply to Arnd Bergmann
Quoted 36 lines · Arnd Bergmann
Quoted 19 lines · Paul Cercueil

Le ven. 24 juil. 2020 à 17:54, Krzysztof Kozlowski
<[email protected]> a
écrit :

Quoted 4 lines · Paul Cercueil
Quoted 3 lines
Quoted 1 line · Krzysztof Kozlowski

On Fri, 24 Jul 2020 at 17:19, Paul Cercueil

<[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

wrote:

On MIPS, the SoC selection is a Kconfig "choice", so you can

only

Quoted 7 lines
Quoted 2 lines

support
one SoC family, unfortunately.

Let's say someone selected then some other architecture (MIPS_ALCHEMY).
They could select this MTD driver.

Quoted 5 lines
Quoted 1 line

Does it mean they would be able to run it on Ingenic hardware?

In *theory* yes, as long as the Kconfig options that MACH_INGENIC selects are enabled, the kernel should boot and work on Ingenic
SoCs.

Right now, this won't work yet, because there are platform specific functions that are implemented by each of the platforms in arch/mips, e.g. arch/mips/generic/init.c and arch/mips/jz4740/setup.c.

A lot of the newer platforms are part of arch/mips/generic (CONFIG_MIPS_GENERIC), which roughly corresponds to CONFIG_ARCH_MULTIPLATFORM on in arch/arm/.
Similarly, there are header files in arch/mips/include/asm/mach-*/ that conflict and you need to have the right one.

Quoted 6 lines

To have more than one platform enabled, each one needs to have all of that platform code converted to fit into the MIPS_GENERIC framework. This can be a lot of work, but I suppose the ingenic platform would be a candidate for which this makes sense, as long as new SoCs of that family still come out.

It should be much less work now that the vast majority of arch/mips/jz4740 is gone. The code left is pretty much generic. I can have a look to convert it to the MIPS_GENERIC framework.

Although the code there is scary. Have a look at arch/mips/include/asm/{machine,mips_machine}.h, you'll see what I mean.

Anyway, I think we're way past the scope of this patch, so for this one:

Cheers,
-Paul

maintainer
#10 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

In reply to Krzysztof Kozlowski
Quoted 28 lines · Krzysztof Kozlowski
Quoted 27 lines · Arnd Bergmann
Quoted 1 line · Paul Cercueil

Le ven. 24 juil. 2020 à 17:54, Krzysztof Kozlowski

<[email protected]> a

Quoted 5 lines

écrit :

Quoted 4 lines · Paul Cercueil
Quoted 3 lines
Quoted 1 line · Krzysztof Kozlowski

On Fri, 24 Jul 2020 at 17:19, Paul Cercueil

<[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

wrote:

On MIPS, the SoC selection is a Kconfig "choice", so you can

only

Quoted 11 lines
Quoted 8 lines
Quoted 2 lines

support
one SoC family, unfortunately.

Let's say someone selected then some other architecture (MIPS_ALCHEMY).
They could select this MTD driver.

Does it mean they would be able to run it on Ingenic hardware?

In *theory* yes, as long as the Kconfig options that MACH_INGENIC selects are enabled, the kernel should boot and work on Ingenic

SoCs.

Quoted 8 lines
Quoted 4 lines

Right now, this won't work yet, because there are platform specific functions that are implemented by each of the platforms in
arch/mips,
e.g. arch/mips/generic/init.c and arch/mips/jz4740/setup.c.

I would say even more - no DTS would be provided for such configuration. All Ingenic DTSes are included only with MACH_INGENIC. You cannot build a kernel working on Ingenic without MACH_INGENIC. Even in theory.

But the devicetree doesn't have to be built-in.

-Paul

Quoted 24 lines
Quoted 7 lines

A lot of the newer platforms are part of arch/mips/generic (CONFIG_MIPS_GENERIC), which roughly corresponds to CONFIG_ARCH_MULTIPLATFORM on in arch/arm/.
Similarly, there are header files in arch/mips/include/asm/mach-*/ that conflict and you need to have the right one.

Quoted 6 lines

To have more than one platform enabled, each one needs to have all of that platform code converted to fit into the MIPS_GENERIC framework. This can be a lot of work, but I suppose the ingenic platform would be a candidate for which this makes sense, as long as new SoCs of that family still come out.

I can therefore change the patch to:
depends on MACH_INGENIC || MIPS_GENERIC || COMPILE_TEST

Other solution is to leave MTD driver as is and for the memory driver go with my v2 approach:
https://lore.kernel.org/lkml/[email protected]/

Best regards,
Krzysztof

author maintainer
#11 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 37 lines · Paul Cercueil

Le dim. 26 juil. 2020 à 18:06, Krzysztof Kozlowski <[email protected]> a écrit :

Quoted 33 lines · Arnd Bergmann
Quoted 31 lines
Quoted 1 line · Paul Cercueil

Le ven. 24 juil. 2020 à 17:54, Krzysztof Kozlowski

<[email protected]> a

Quoted 5 lines

écrit :

Quoted 4 lines · Paul Cercueil
Quoted 3 lines
Quoted 1 line · Krzysztof Kozlowski

On Fri, 24 Jul 2020 at 17:19, Paul Cercueil

<[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

wrote:

On MIPS, the SoC selection is a Kconfig "choice", so you can

only

Quoted 11 lines
Quoted 8 lines
Quoted 2 lines

support
one SoC family, unfortunately.

Let's say someone selected then some other architecture (MIPS_ALCHEMY).
They could select this MTD driver.

Does it mean they would be able to run it on Ingenic hardware?

In *theory* yes, as long as the Kconfig options that MACH_INGENIC selects are enabled, the kernel should boot and work on Ingenic

SoCs.

Right now, this won't work yet, because there are platform specific functions that are implemented by each of the platforms in
arch/mips,
e.g. arch/mips/generic/init.c and arch/mips/jz4740/setup.c.

Quoted 6 lines
Quoted 3 lines

I would say even more - no DTS would be provided for such configuration. All Ingenic DTSes are included only with MACH_INGENIC. You cannot build a kernel working on Ingenic without MACH_INGENIC. Even in theory.

But the devicetree doesn't have to be built-in.

OK, that's true. Anyway, I don't have strong opinion on any of this. I just followed Arnd's hint.

For the memory driver (and MTD NAND as well) which one you prefer:
1. https://lore.kernel.org/lkml/[email protected]/
2. depends on MACH_INGENIC || MIPS_GENERIC || COMPILE_TEST

?

Best regards,
Krzysztof

maintainer
#12 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 54 lines · Krzysztof Kozlowski
Quoted 44 lines · Paul Cercueil

Le dim. 26 juil. 2020 à 18:06, Krzysztof Kozlowski
<[email protected]> a écrit
:

Quoted 7 lines · Arnd Bergmann
Quoted 6 lines
Quoted 1 line · Paul Cercueil

Le ven. 24 juil. 2020 à 17:54, Krzysztof Kozlowski

<[email protected]> a

Quoted 2 lines

écrit :

Quoted 1 line

On Fri, Jul 24, 2020 at 05:50:06PM +0200, Paul Cercueil

Quoted 7 lines · wrote:
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line · Krzysztof Kozlowski

On Fri, 24 Jul 2020 at 17:19, Paul Cercueil

<[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

wrote:

On MIPS, the SoC selection is a Kconfig "choice", so you

can

Quoted 9 lines
Quoted 9 lines

only

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

support
one SoC family, unfortunately.

Let's say someone selected then some other architecture (MIPS_ALCHEMY).
They could select this MTD driver.

Does it mean they would be able to run it on Ingenic

hardware?

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

In *theory* yes, as long as the Kconfig options that

MACH_INGENIC

Quoted 1 line
Quoted 1 line
Quoted 1 line

selects are enabled, the kernel should boot and work on

Ingenic

Quoted 3 lines
Quoted 3 lines

SoCs.

Right now, this won't work yet, because there are platform

specific

Quoted 4 lines
Quoted 3 lines

functions that are implemented by each of the platforms in
arch/mips,
e.g. arch/mips/generic/init.c and arch/mips/jz4740/setup.c.

Quoted 8 lines
Quoted 1 line

I would say even more - no DTS would be provided for such

configuration.

Quoted 1 line

All Ingenic DTSes are included only with MACH_INGENIC. You

cannot build

Quoted 1 line

a kernel working on Ingenic without MACH_INGENIC. Even in theory.

But the devicetree doesn't have to be built-in.

Quoted 8 lines

OK, that's true. Anyway, I don't have strong opinion on any of this. I just followed Arnd's hint.

For the memory driver (and MTD NAND as well) which one you prefer:
1. https://lore.kernel.org/lkml/[email protected]/
2. depends on MACH_INGENIC || MIPS_GENERIC || COMPILE_TEST

?

I'd say a slightly modified #1. The driver shouldn't be "default y" in the first place, so the patch could be to disable it by default. And when the Ingenic code is merged into the MIPS generic framework, I'll send a set of patches to change all driver dependencies on MIPS to MIPS_GENERIC.

-Paul

#13 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 7 lines · Paul Cercueil
Quoted 6 lines · Krzysztof Kozlowski
Quoted 1 line · Paul Cercueil

Le dim. 26 juil. 2020 à 18:06, Krzysztof Kozlowski <[email protected]> a écrit

OK, that's true. Anyway, I don't have strong opinion on any of this. I just followed Arnd's hint.

Quoted 8 lines
Quoted 5 lines

For the memory driver (and MTD NAND as well) which one you prefer:
1. https://lore.kernel.org/lkml/[email protected]/
2. depends on MACH_INGENIC || MIPS_GENERIC || COMPILE_TEST

?

I'd say a slightly modified #1. The driver shouldn't be "default y" in the first place, so the patch could be to disable it by default.

If it defaults to 'n' even for MACH_INGENIC, you may have to enable it in the four defconfig files for these machines to avoid surprises.

Quoted 3 lines

And when the Ingenic code is merged into the MIPS generic framework, I'll send a set of patches to change all driver dependencies on MIPS to MIPS_GENERIC.

The way we do it on Arm, the machine Kconfig identifiers stay around even for multiplatform targets (which now make up basically actively maintained machines).

I don't think it makes any sense for a driver to depend on MIPS_GENERIC:
either it is a generic driver that should always be visible or it is specific to a set of SoCs and should depend on some corresponding vendor specific identifiers.

Arnd

author maintainer
#14 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 12 lines · Arnd Bergmann
Quoted 11 lines · Paul Cercueil
Quoted 10 lines · Krzysztof Kozlowski
Quoted 1 line · Paul Cercueil

Le dim. 26 juil. 2020 à 18:06, Krzysztof Kozlowski <[email protected]> a écrit

OK, that's true. Anyway, I don't have strong opinion on any of this. I just followed Arnd's hint.

For the memory driver (and MTD NAND as well) which one you prefer:
1. https://lore.kernel.org/lkml/[email protected]/
2. depends on MACH_INGENIC || MIPS_GENERIC || COMPILE_TEST

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

?

I'd say a slightly modified #1. The driver shouldn't be "default y" in the first place, so the patch could be to disable it by default.

If it defaults to 'n' even for MACH_INGENIC, you may have to enable it in the four defconfig files for these machines to avoid surprises.

Exactly. Nothing else selects JZ4780_NEMC, so either we keep default y ("if MACH_INGENIC || MIPS_GENERIC"), or you select it directly from MACH_INGENIC/MIPS_GENERIC.

A related question is how essential are these drivers? At least for ARM platforms, all essential SoC blocks/IPs are selected by default, if support for chosen SoC is enabled. Only non-essential stuff is left, e.g. DRM, cpufreq, devfreq, ADC, crypto, video, USB, eMMC (although one could argue that it is essential), IOMMU.

Quoted 4 lines
Quoted 3 lines

And when the Ingenic code is merged into the MIPS generic framework, I'll send a set of patches to change all driver dependencies on MIPS to MIPS_GENERIC.

Quoted 8 lines

The way we do it on Arm, the machine Kconfig identifiers stay around even for multiplatform targets (which now make up basically actively maintained machines).

I don't think it makes any sense for a driver to depend on MIPS_GENERIC:
either it is a generic driver that should always be visible or it is specific to a set of SoCs and should depend on some corresponding vendor specific identifiers.

If support for Ingenic is provided also by MIPS_GENERIC (without selecting MACH_INGENIC), then it makes sense. This would be just a different way than ARM of building multi-platform kernel.

Best regards,
Krzysztof

maintainer
#15 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 33 lines · Krzysztof Kozlowski
Quoted 20 lines · Arnd Bergmann
Quoted 1 line · Paul Cercueil

Le dim. 26 juil. 2020 à 18:15, Krzysztof Kozlowski

Quoted 2 lines · <[email protected]> a écrit :
Quoted 2 lines · Paul Cercueil
Quoted 1 line

Le dim. 26 juil. 2020 à 18:06, Krzysztof Kozlowski

<[email protected]> a écrit

Quoted 2 lines
Quoted 2 lines

OK, that's true. Anyway, I don't have strong opinion on any of

this. I

Quoted 3 lines
Quoted 3 lines

just followed Arnd's hint.

For the memory driver (and MTD NAND as well) which one you

prefer:

Quoted 1 line
Quoted 1 line

1.

https://lore.kernel.org/lkml/[email protected]/

Quoted 4 lines
Quoted 3 lines

2. depends on MACH_INGENIC || MIPS_GENERIC || COMPILE_TEST

?

Quoted 7 lines
Quoted 1 line

I'd say a slightly modified #1. The driver shouldn't be "default

y" in

Quoted 1 line

the first place, so the patch could be to disable it by default.

If it defaults to 'n' even for MACH_INGENIC, you may have to enable it in the four defconfig files for these machines to avoid
surprises.

Exactly. Nothing else selects JZ4780_NEMC, so either we keep default y ("if MACH_INGENIC || MIPS_GENERIC"), or you select it directly from MACH_INGENIC/MIPS_GENERIC.

Quoted 5 lines

A related question is how essential are these drivers? At least for ARM platforms, all essential SoC blocks/IPs are selected by default, if support for chosen SoC is enabled. Only non-essential stuff is left, e.g. DRM, cpufreq, devfreq, ADC, crypto, video, USB, eMMC (although one could argue that it is essential), IOMMU.

They are only used for NAND access, which is not really essential (some boards only use MMC storage), that's why I said they shouldn't have been enabled by default in the first place.

-Paul

Quoted 23 lines
Quoted 10 lines
Quoted 2 lines

And when the Ingenic code is merged into the MIPS generic

framework, I'll

Quoted 2 lines

send a set of patches to change all driver dependencies on MIPS to MIPS_GENERIC.

The way we do it on Arm, the machine Kconfig identifiers stay around even for multiplatform targets (which now make up basically actively maintained machines).

Quoted 6 lines

I don't think it makes any sense for a driver to depend on
MIPS_GENERIC:
either it is a generic driver that should always be visible or it
is specific
to a set of SoCs and should depend on some corresponding vendor specific identifiers.

If support for Ingenic is provided also by MIPS_GENERIC (without selecting MACH_INGENIC), then it makes sense. This would be just a different way than ARM of building multi-platform kernel.

Best regards,
Krzysztof

#16 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

In reply to Krzysztof Kozlowski
Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Arnd Bergmann

The way we do it on Arm, the machine Kconfig identifiers stay around even for multiplatform targets (which now make up basically actively maintained machines).

Quoted 8 lines
Quoted 4 lines

I don't think it makes any sense for a driver to depend on MIPS_GENERIC:
either it is a generic driver that should always be visible or it is specific to a set of SoCs and should depend on some corresponding vendor specific identifiers.

If support for Ingenic is provided also by MIPS_GENERIC (without selecting MACH_INGENIC), then it makes sense. This would be just a different way than ARM of building multi-platform kernel.

Yes, it would work just as well, my point was just that it is somewhat confusing to have every architecture do it differently, and that I prefer the way Arm (and also ppc, x86 etc) handles it today.

On MIPS, most platforms are not yet part of MIPS_GENERIC, so they are fairly free to pick whatever method works best and is consistent with the rest of the kernel.

Arnd

maintainer
#17 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Hello,

Arnd Bergmann <[email protected]> wrote on Mon, 27 Jul 2020 19:28:48 +0200:

Quoted 16 lines · Krzysztof Kozlowski
Quoted 6 lines · Arnd Bergmann
Quoted 5 lines

The way we do it on Arm, the machine Kconfig identifiers stay around even for multiplatform targets (which now make up basically actively maintained machines).

Quoted 8 lines
Quoted 4 lines

I don't think it makes any sense for a driver to depend on MIPS_GENERIC:
either it is a generic driver that should always be visible or it is specific to a set of SoCs and should depend on some corresponding vendor specific identifiers.

If support for Ingenic is provided also by MIPS_GENERIC (without selecting MACH_INGENIC), then it makes sense. This would be just a different way than ARM of building multi-platform kernel.

Quoted 7 lines

Yes, it would work just as well, my point was just that it is somewhat confusing to have every architecture do it differently, and that I prefer the way Arm (and also ppc, x86 etc) handles it today.

On MIPS, most platforms are not yet part of MIPS_GENERIC, so they are fairly free to pick whatever method works best and is consistent with the rest of the kernel.

In the end, shall I apply Krzysztof patch or shall I wait for an update (eg. without 'default y')?

Thanks,
Miquèl

author maintainer
#18 lore raw

Re: [PATCH v3 2/2] mtd: rawnand: ingenic: Limit MTD_NAND_JZ4780 to architecture only

Quoted 25 lines · Miquel Raynal

Hello,

Arnd Bergmann <[email protected]> wrote on Mon, 27 Jul 2020 19:28:48 +0200:

Quoted 20 lines · Krzysztof Kozlowski
Quoted 6 lines · Arnd Bergmann
Quoted 5 lines

The way we do it on Arm, the machine Kconfig identifiers stay around even for multiplatform targets (which now make up basically actively maintained machines).

Quoted 8 lines
Quoted 4 lines

I don't think it makes any sense for a driver to depend on MIPS_GENERIC:
either it is a generic driver that should always be visible or it is specific to a set of SoCs and should depend on some corresponding vendor specific identifiers.

If support for Ingenic is provided also by MIPS_GENERIC (without selecting MACH_INGENIC), then it makes sense. This would be just a different way than ARM of building multi-platform kernel.

Yes, it would work just as well, my point was just that it is somewhat confusing to have every architecture do it differently, and that I prefer the way Arm (and also ppc, x86 etc) handles it today.

Quoted 6 lines
Quoted 3 lines

On MIPS, most platforms are not yet part of MIPS_GENERIC, so they are fairly free to pick whatever method works best and is consistent with the rest of the kernel.

In the end, shall I apply Krzysztof patch or shall I wait for an update (eg. without 'default y')?

No, this patch should be dropped as we decided to leave it as is. At least that was my understanding. The other similar changes - relating to memory driver - were already applied:
https://lore.kernel.org/lkml/[email protected]/

Best regards,
Krzysztof