Skip to contentSkip to conversation

arm64, thunder: Enable Cavium Thunder SoC Family

PATCH Superseded Robert Richter 7 participants 27 messages Sep 5, 2014 – Sep 11, 2014

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover arm64, thunder: Enable Cavium Thunder SoC Family

From: Robert Richter <[email protected]>

This initial patches enable Cavium Thunder SoC Family. The patches add Kconfig and devicetree support and then add Thunder to the defconfig.

The Thunder system needs more enablement patches for subsystems and devices, this includes network, ahci, gicv3/gicv3-its, pci, smmu, kvm. We will send separate patch sets for these. All of them base on this initial patches.

I sent a separate patch set independently that introduces support for dts vendor subdirs. After both patch sets have been applied I will send a patch in addition that moves the dts file into a subdirectory.

Patches are available here:

git://git.kernel.org/pub/scm/linux/kernel/git/rric/linux.git thunder/init

v2 changes:
* rebased to 3.17
* placed commas between 32-bit portions of 64 bit addresses
* removed #address-cells and size-cells in gic node
* get rid of the clocks node
* changed to gpl/x11 dual license
* removed memreserve
* moved gic to bus node

Radha Mohan Chintakuntla (3):
arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family arm64, thunder: Add initial dts for Cavium Thunder SoC arm64, thunder: Document devicetree bindings for Cavium Thunder SoC

Robert Richter (1):
arm64, defconfig: Enable Cavium Thunder SoC in defconfig

 .../devicetree/bindings/arm/cavium-thunder.txt     |  10 +
 Documentation/devicetree/bindings/arm/cpus.txt     |   1 +
 arch/arm64/Kconfig                                 |   6 +
 arch/arm64/boot/dts/Makefile                       |   1 +
 arch/arm64/boot/dts/thunder-88xx.dts               | 414 +++++++++++++++++++++
 arch/arm64/configs/defconfig                       |   1 +
 6 files changed, 433 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/cavium-thunder.txt
 create mode 100644 arch/arm64/boot/dts/thunder-88xx.dts
Signature · 1 line
2.0.1
#1 lore raw

PATCH v2 1/4 arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

From: Radha Mohan Chintakuntla <[email protected]>

Increase maximum numbers of cpus to 32. This relates to current maximal possible cpu number. Increasing this to 64 cpus will be a separate patch not part of this enablement patches.

---
 arch/arm64/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/Kconfig +6 -0
index fd4e81a4e1ce..77fb82b0f684 100644
@@ -134,6 +134,11 @@ source "kernel/Kconfig.freezer"
 
 menu "Platform selection"
 
+config ARCH_THUNDER
+	bool "Cavium Inc. Thunder SoC Family"
+	help
+	  This enables support for Cavium's Thunder Family of SoCs.
+
 config ARCH_VEXPRESS
 	bool "ARMv8 software model (Versatile Express)"
 	select ARCH_REQUIRE_GPIOLIB
@@ -256,6 +261,7 @@ config NR_CPUS
 	range 2 32
 	depends on SMP
 	# These have to remain sorted largest to smallest
+	default "32" if ARCH_THUNDER
 	default "8"
 
 config HOTPLUG_CPU
Signature · 1 line
2.0.1
#2 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 5 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

Increase maximum numbers of cpus to 32. This relates to current maximal possible cpu number. Increasing this to 64 cpus will be a separate patch not part of this enablement patches.

Just out of interest, does raising the current maximum limit actually break any existing code? If not, then doing this as two patches doesn't seem worth it.

Will

#3 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 10 lines · Will Deacon
Quoted 5 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

Increase maximum numbers of cpus to 32. This relates to current maximal possible cpu number. Increasing this to 64 cpus will be a separate patch not part of this enablement patches.

Just out of interest, does raising the current maximum limit actually break any existing code? If not, then doing this as two patches doesn't seem worth it.

Increasing to 64 should be fine from the perspective of cpu mask implementation. Memory foot print should be the same already as this uses long which is 64 bit. So this wouldn't hurt.

However, I felt a bit uncomfortable having a dependency here to enabling 64 cpus and getting this patch set upstream. Support for more than 32 cpus is not well tested yet and there still might be problems with e.g. interrupt delivery or topology.

If increasing to 32 cpus as an intermediate step isn't the best approach here, we can live with the current defaults too. I would then just remove that change from the patch.

For follow on driver patch sets it would be good to have ARCH_THUNDER upstream as this option will be shared between all drivers.

-Robert

#4 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 12 lines · Robert Richter
Quoted 10 lines · Will Deacon
Quoted 5 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

Increase maximum numbers of cpus to 32. This relates to current maximal possible cpu number. Increasing this to 64 cpus will be a separate patch not part of this enablement patches.

Just out of interest, does raising the current maximum limit actually break any existing code? If not, then doing this as two patches doesn't seem worth it.

Quoted 8 lines

Increasing to 64 should be fine from the perspective of cpu mask implementation. Memory foot print should be the same already as this uses long which is 64 bit. So this wouldn't hurt.

However, I felt a bit uncomfortable having a dependency here to enabling 64 cpus and getting this patch set upstream. Support for more than 32 cpus is not well tested yet and there still might be problems with e.g. interrupt delivery or topology.

All I mean is, if the kernel doesn't explode on existing systems by changing the upper limit to 64, then we should do that. If you're not comfortable that the Thunder code can handle that, then leave the thunder default as 32, like you do in the current patch. It just seems odd not to change the maximum number, since it's an arbitrary limit from my perspective.

Will

reviewer
#5 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 22 lines · Will Deacon
Quoted 12 lines · Robert Richter
Quoted 10 lines · Will Deacon
Quoted 5 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

Increase maximum numbers of cpus to 32. This relates to current maximal possible cpu number. Increasing this to 64 cpus will be a separate patch not part of this enablement patches.

Just out of interest, does raising the current maximum limit actually break any existing code? If not, then doing this as two patches doesn't seem worth it.

Quoted 8 lines

Increasing to 64 should be fine from the perspective of cpu mask implementation. Memory foot print should be the same already as this uses long which is 64 bit. So this wouldn't hurt.

However, I felt a bit uncomfortable having a dependency here to enabling 64 cpus and getting this patch set upstream. Support for more than 32 cpus is not well tested yet and there still might be problems with e.g. interrupt delivery or topology.

Quoted 5 lines

All I mean is, if the kernel doesn't explode on existing systems by changing the upper limit to 64, then we should do that. If you're not comfortable that the Thunder code can handle that, then leave the thunder default as 32, like you do in the current patch. It just seems odd not to change the maximum number, since it's an arbitrary limit from my perspective.

FWIW my Juno happily boots with a NR_CPUS=64 kernel.

Mark.

#6 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 8 lines · Mark Rutland
Quoted 5 lines · Will Deacon

All I mean is, if the kernel doesn't explode on existing systems by changing the upper limit to 64, then we should do that. If you're not comfortable that the Thunder code can handle that, then leave the thunder default as 32, like you do in the current patch. It just seems odd not to change the maximum number, since it's an arbitrary limit from my perspective.

FWIW my Juno happily boots with a NR_CPUS=64 kernel.

It looks like if it's fine to set the general default to NR_CPUS=64 even if the kernel might not yet boot more than 32 cpus. Will make this change separately and drop it in this patch.

See also my other reply to Russell in this thread.

-Robert

#7 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

In reply to Robert Richter
Quoted 29 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

Increase maximum numbers of cpus to 32. This relates to current maximal possible cpu number. Increasing this to 64 cpus will be a separate patch not part of this enablement patches.

---
 arch/arm64/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/Kconfig +5 -0
index fd4e81a4e1ce..77fb82b0f684 100644
@@ -134,6 +134,11 @@ source "kernel/Kconfig.freezer"
 
 menu "Platform selection"
 
+config ARCH_THUNDER
+	bool "Cavium Inc. Thunder SoC Family"
+	help
+	  This enables support for Cavium's Thunder Family of SoCs.
+
 config ARCH_VEXPRESS
 	bool "ARMv8 software model (Versatile Express)"
 	select ARCH_REQUIRE_GPIOLIB

arch/arm64/Kconfig config NR_CPUS · line 265

Quoted 5 lines
arch/arm64/Kconfig +1 -0
@@ -256,6 +261,7 @@ config NR_CPUS
 	range 2 32
 	depends on SMP
 	# These have to remain sorted largest to smallest
+	default "32" if ARCH_THUNDER
 	default "8"

Why do you need ARCH_THUNDER? If it's just to change this default, please don't bother - we don't do this kind of thing on x86, so why should it be done here? Just ensure that NR_CPUS is appropriately adjusted. Alternatively, look at how x86 deals with this (with X86_BIGSMP / MAXSMP).

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
#8 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 21 lines · Russell King - ARM Linux
Quoted 20 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

Increase maximum numbers of cpus to 32. This relates to current maximal possible cpu number. Increasing this to 64 cpus will be a separate patch not part of this enablement patches.

---
 arch/arm64/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/Kconfig +0 -0
index fd4e81a4e1ce..77fb82b0f684 100644
@@ -134,6 +134,11 @@ source "kernel/Kconfig.freezer"
 
 menu "Platform selection"
 
Quoted 16 lines
Quoted 9 lines
arch/arm64/Kconfig +5 -0
+config ARCH_THUNDER
+	bool "Cavium Inc. Thunder SoC Family"
+	help
+	  This enables support for Cavium's Thunder Family of SoCs.
+
 config ARCH_VEXPRESS
 	bool "ARMv8 software model (Versatile Express)"
 	select ARCH_REQUIRE_GPIOLIB

arch/arm64/Kconfig config NR_CPUS · line 265

Quoted 5 lines
arch/arm64/Kconfig +1 -0
@@ -256,6 +261,7 @@ config NR_CPUS
 	range 2 32
 	depends on SMP
 	# These have to remain sorted largest to smallest
+	default "32" if ARCH_THUNDER
 	default "8"

Why do you need ARCH_THUNDER? If it's just to change this default,

No, we need it just to enable all our drivers on the SoC. We want to enable the SoC by using defconfig + ARCH_THUNDER. As said in my other mail, I put it here to be able to base all other thunder driver patch sets on this initial base patch set. Otherwise this particular patch and also the dtb patch need to be shipped with all other driver patch sets. This might lead to duplicate submissions of the same patch.

With doing defconfig + ARCH_THUNDER we also want to enable the max number of cpus that is currently supported. I only enable 32 cpus since booting more cpus is untested. There might be problems at the 32 cpu boundary. Just setting it to 64 does not mean a kernel will actually boot more than 32 cpus. But if it will be ack'ed, I would be fine to set NR_CPUS to 32 or 64 in general and independent from ARCH_THUNDER.

For simplicity I better drop setting NR_CPUS in this patch.

-Robert

Quoted 4 lines

please don't bother - we don't do this kind of thing on x86, so why should it be done here? Just ensure that NR_CPUS is appropriately adjusted. Alternatively, look at how x86 deals with this (with X86_BIGSMP / MAXSMP).

#9 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 54 lines · Robert Richter
Quoted 21 lines · Russell King - ARM Linux
Quoted 20 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

Increase maximum numbers of cpus to 32. This relates to current maximal possible cpu number. Increasing this to 64 cpus will be a separate patch not part of this enablement patches.

---
 arch/arm64/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/Kconfig +0 -0
index fd4e81a4e1ce..77fb82b0f684 100644
@@ -134,6 +134,11 @@ source "kernel/Kconfig.freezer"
 
 menu "Platform selection"
 
Quoted 16 lines
Quoted 9 lines
arch/arm64/Kconfig +5 -0
+config ARCH_THUNDER
+	bool "Cavium Inc. Thunder SoC Family"
+	help
+	  This enables support for Cavium's Thunder Family of SoCs.
+
 config ARCH_VEXPRESS
 	bool "ARMv8 software model (Versatile Express)"
 	select ARCH_REQUIRE_GPIOLIB

arch/arm64/Kconfig config NR_CPUS · line 265

Quoted 5 lines
arch/arm64/Kconfig +1 -0
@@ -256,6 +261,7 @@ config NR_CPUS
 	range 2 32
 	depends on SMP
 	# These have to remain sorted largest to smallest
+	default "32" if ARCH_THUNDER
 	default "8"

Why do you need ARCH_THUNDER? If it's just to change this default,

No, we need it just to enable all our drivers on the SoC. We want to enable the SoC by using defconfig + ARCH_THUNDER. As said in my other mail, I put it here to be able to base all other thunder driver patch sets on this initial base patch set. Otherwise this particular patch and also the dtb patch need to be shipped with all other driver patch sets. This might lead to duplicate submissions of the same patch.

With doing defconfig + ARCH_THUNDER we also want to enable the max number of cpus that is currently supported. I only enable 32 cpus since booting more cpus is untested. There might be problems at the 32 cpu boundary. Just setting it to 64 does not mean a kernel will actually boot more than 32 cpus. But if it will be ack'ed, I would be fine to set NR_CPUS to 32 or 64 in general and independent from ARCH_THUNDER.

Quoted 1 line

For simplicity I better drop setting NR_CPUS in this patch.

So, ARM64 will get a big long list of "config ARCH_foo" options just to stuff lots of broken select statements into the configuration. Yes, this may have been the norm with ARM, but it's turned out to be more of a problem than a solution, especially as it keeps causing Kconfig warnings when things change in the rest of the kernel tree.

The same is true with defconfigs - Linus threatened to delete all ARM defconfigs except one at one point.

As I said below, this isn't how stuff is dealt with on x86.

What I'm questioning here is the entire ethos of "have an ARCH_foo configuration which sets stuff up for platform foo".

Quoted 4 lines
Quoted 4 lines

please don't bother - we don't do this kind of thing on x86, so why should it be done here? Just ensure that NR_CPUS is appropriately adjusted. Alternatively, look at how x86 deals with this (with X86_BIGSMP / MAXSMP).

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
reviewer
#10 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 55 lines · Russell King - ARM Linux
Quoted 54 lines · Robert Richter
Quoted 21 lines · Russell King - ARM Linux
Quoted 20 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

Increase maximum numbers of cpus to 32. This relates to current maximal possible cpu number. Increasing this to 64 cpus will be a separate patch not part of this enablement patches.

---
 arch/arm64/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/Kconfig +0 -0
index fd4e81a4e1ce..77fb82b0f684 100644
@@ -134,6 +134,11 @@ source "kernel/Kconfig.freezer"
 
 menu "Platform selection"
 
Quoted 16 lines
Quoted 9 lines
arch/arm64/Kconfig +5 -0
+config ARCH_THUNDER
+	bool "Cavium Inc. Thunder SoC Family"
+	help
+	  This enables support for Cavium's Thunder Family of SoCs.
+
 config ARCH_VEXPRESS
 	bool "ARMv8 software model (Versatile Express)"
 	select ARCH_REQUIRE_GPIOLIB

arch/arm64/Kconfig config NR_CPUS · line 265

Quoted 5 lines
arch/arm64/Kconfig +1 -0
@@ -256,6 +261,7 @@ config NR_CPUS
 	range 2 32
 	depends on SMP
 	# These have to remain sorted largest to smallest
+	default "32" if ARCH_THUNDER
 	default "8"

Why do you need ARCH_THUNDER? If it's just to change this default,

No, we need it just to enable all our drivers on the SoC. We want to enable the SoC by using defconfig + ARCH_THUNDER. As said in my other mail, I put it here to be able to base all other thunder driver patch sets on this initial base patch set. Otherwise this particular patch and also the dtb patch need to be shipped with all other driver patch sets. This might lead to duplicate submissions of the same patch.

With doing defconfig + ARCH_THUNDER we also want to enable the max number of cpus that is currently supported. I only enable 32 cpus since booting more cpus is untested. There might be problems at the 32 cpu boundary. Just setting it to 64 does not mean a kernel will actually boot more than 32 cpus. But if it will be ack'ed, I would be fine to set NR_CPUS to 32 or 64 in general and independent from ARCH_THUNDER.

Quoted 7 lines
Quoted 1 line

For simplicity I better drop setting NR_CPUS in this patch.

So, ARM64 will get a big long list of "config ARCH_foo" options just to stuff lots of broken select statements into the configuration. Yes, this may have been the norm with ARM, but it's turned out to be more of a problem than a solution, especially as it keeps causing Kconfig warnings when things change in the rest of the kernel tree.

Agreed; this seems more pain than it is worth.

Quoted 2 lines

The same is true with defconfigs - Linus threatened to delete all ARM defconfigs except one at one point.

IMO we should continue doing what we've done so far and make the ARM64 defconfig work on everything it can by default, no ARCH_* necessary. That's what most people will build and test and we shouldn't get platform-specific code (well, drivers) breaking the single image.

For the extreme configurations (really tiny or really big) custom configuration being necessary is fine. That doesn't have to involve ARCH_* config options.

If you want to build a custom config then you should have an idea of what you need. ARCH_* options are only necessary if someone wants a kernel tuned for a specific SoC but doesn't know anything about that SoC.

Mark.

maintainer
#11 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 20 lines · On Friday 05 September 2014 13:51:47 Mark Rutland wrote:
Quoted 19 lines · Russell King - ARM Linux
Quoted 17 lines · Robert Richter

On 05.09.14 10:32:40, Russell King - ARM Linux wrote:
No, we need it just to enable all our drivers on the SoC. We want to enable the SoC by using defconfig + ARCH_THUNDER. As said in my other mail, I put it here to be able to base all other thunder driver patch sets on this initial base patch set. Otherwise this particular patch and also the dtb patch need to be shipped with all other driver patch sets. This might lead to duplicate submissions of the same patch.

With doing defconfig + ARCH_THUNDER we also want to enable the max number of cpus that is currently supported. I only enable 32 cpus since booting more cpus is untested. There might be problems at the 32 cpu boundary. Just setting it to 64 does not mean a kernel will actually boot more than 32 cpus. But if it will be ack'ed, I would be fine to set NR_CPUS to 32 or 64 in general and independent from ARCH_THUNDER.

For simplicity I better drop setting NR_CPUS in this patch.

Quoted 7 lines
Quoted 5 lines

So, ARM64 will get a big long list of "config ARCH_foo" options just to stuff lots of broken select statements into the configuration. Yes, this may have been the norm with ARM, but it's turned out to be more of a problem than a solution, especially as it keeps causing Kconfig warnings when things change in the rest of the kernel tree.

Agreed; this seems more pain than it is worth.

Lots of select statements indeed would be a problem, but I don't think that is what Robert was suggesting.

Quoted 7 lines
Quoted 2 lines

The same is true with defconfigs - Linus threatened to delete all ARM defconfigs except one at one point.

IMO we should continue doing what we've done so far and make the ARM64 defconfig work on everything it can by default, no ARCH_* necessary. That's what most people will build and test and we shouldn't get platform-specific code (well, drivers) breaking the single image.

Right.

Quoted 8 lines

For the extreme configurations (really tiny or really big) custom configuration being necessary is fine. That doesn't have to involve ARCH_* config options.

If you want to build a custom config then you should have an idea of what you need. ARCH_* options are only necessary if someone wants a kernel tuned for a specific SoC but doesn't know anything about that SoC.

A common pattern these days is to do dependencies like

arch/*/Kconfig:

	config ARCH_FOO
	bool "Enable support for Foo platform"
	help
	  ...

drivers/*/Kconfig

	config SUBSYS_FOO
	bool "SUBSYS driver for Foo"
	depends on ARCH_FOO || COMPILE_TEST
	depends on OF && REGULATOR && GENERIC_PHY # or whatever

That way we can enable everything in the defconfig, but someone who likes to build a more specialized kernel can disable the other platforms and won't get the drivers that are specific to those.

I personally think this is a bit more verbose than what we need, but I don't strongly object doing it that way.

The code size really should not matter much on ARM64 though: it's unlikely we will see a lot of systems with less than a few gigabytes of memory, and I expect that a generic kernel would be e.g. 6 MB instead of 4 MB for a platform specific kernel.

Arnd

reviewer
#12 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Hi Arnd,

[...]

Quoted 9 lines

A common pattern these days is to do dependencies like

arch/*/Kconfig:

	config ARCH_FOO
	bool "Enable support for Foo platform"
	help
	  ...
Quoted 5 lines

drivers/*/Kconfig

	config SUBSYS_FOO
	bool "SUBSYS driver for Foo"
	depends on ARCH_FOO || COMPILE_TEST
	depends on OF && REGULATOR && GENERIC_PHY # or whatever

Russell's comments w.r.t. Kconfig warnings when config names change still holds regardless of select vs depends on.

Quoted 7 lines

That way we can enable everything in the defconfig, but someone who likes to build a more specialized kernel can disable the other platforms and won't get the drivers that are specific to those.

I personally think this is a bit more verbose than what we need, but I don't strongly object doing it that way.

You'd still be able to do this without ARCH_FOO, though you would need to know which drivers are necessary for a particular SoC. That seems to be the way things are handled on x86; I don't recall having to select support for specific machines there, just the individual drivers.

Quoted 4 lines

The code size really should not matter much on ARM64 though: it's unlikely we will see a lot of systems with less than a few gigabytes of memory, and I expect that a generic kernel would be e.g. 6 MB instead of 4 MB for a platform specific kernel.

Agreed. If there kernel size begins looking unwieldy we either need to be compiling more things as modules or a more drastic kernel weight loss program.

Mark.

maintainer
#13 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 10 lines · On Friday 05 September 2014 15:22:46 Mark Rutland wrote:
Quoted 10 lines

A common pattern these days is to do dependencies like

arch/*/Kconfig:
config ARCH_FOO
bool "Enable support for Foo platform"
help
...

Quoted 8 lines
Quoted 5 lines

drivers/*/Kconfig

      config SUBSYS_FOO
      bool "SUBSYS driver for Foo"
      depends on ARCH_FOO || COMPILE_TEST
      depends on OF && REGULATOR && GENERIC_PHY # or whatever

Russell's comments w.r.t. Kconfig warnings when config names change still holds regardless of select vs depends on.

Yes, that's what I wrote in my reply as well.

Quoted 5 lines
Quoted 5 lines

That way we can enable everything in the defconfig, but someone who likes to build a more specialized kernel can disable the other platforms and won't get the drivers that are specific to those.

Quoted 7 lines
Quoted 2 lines

I personally think this is a bit more verbose than what we need, but I don't strongly object doing it that way.

You'd still be able to do this without ARCH_FOO, though you would need to know which drivers are necessary for a particular SoC. That seems to be the way things are handled on x86; I don't recall having to select support for specific machines there, just the individual drivers.

The main difference is that there are very few drivers on x86 that are specific to one of the two chip makers. Almost everything is a PCI device that can actually be plugged in anywhere.

On ARM64 there is going to be a lot of stuff that really makes sense only for one of the 50 licensees.

Arnd

#14 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 17 lines · Arnd Bergmann
Quoted 16 lines · On Friday 05 September 2014 15:22:46 Mark Rutland wrote:
Quoted 15 lines

A common pattern these days is to do dependencies like

arch/*/Kconfig:
config ARCH_FOO
bool "Enable support for Foo platform"
help
...

drivers/*/Kconfig

      config SUBSYS_FOO
      bool "SUBSYS driver for Foo"
      depends on ARCH_FOO || COMPILE_TEST
      depends on OF && REGULATOR && GENERIC_PHY # or whatever
Quoted 17 lines
Quoted 2 lines

Russell's comments w.r.t. Kconfig warnings when config names change still holds regardless of select vs depends on.

Yes, that's what I wrote in my reply as well.

Quoted 12 lines
Quoted 7 lines

That way we can enable everything in the defconfig, but someone who likes to build a more specialized kernel can disable the other platforms and won't get the drivers that are specific to those.

I personally think this is a bit more verbose than what we need, but I don't strongly object doing it that way.

You'd still be able to do this without ARCH_FOO, though you would need to know which drivers are necessary for a particular SoC. That seems to be the way things are handled on x86; I don't recall having to select support for specific machines there, just the individual drivers.

This is well hidden on x86, but each vendor has a config option. For AMD systems we have had our own option to disable vendor specific code, see CPU_SUP_AMD for example. Disabling this will remove all AMD specific code in the kernel. Of course this is enabled per default.

With ARCH_THUNDER I intended to do the same (you could name this also SOC_SUP_CAVIUM or so but I kept the current naming scheme). In patch 4/4 I have added the option to defconfig. This enables this per default and nobody has to deal with any option manually, just running make defconfig is fine.

Also, at least to disable building the dtb file for foo, you will need ARCH_FOO too. How else would you deal with dtb files then?

Having ARCH_FOO might not be necessary for drivers. One could enable drivers manually, but this option is still a good reference for the drivers needed by foo. At some point you will carry tons of enabled drivers in your defconfig and you don't know which platform actually is using it. For generic drivers this might be fine. But in my point of few, each soc specific driver should have an soc specific option too. Then you easily can remove an soc from the defconfig.

-Robert

Quoted 6 lines

The main difference is that there are very few drivers on x86 that are specific to one of the two chip makers. Almost everything is a PCI device that can actually be plugged in anywhere.

On ARM64 there is going to be a lot of stuff that really makes sense only for one of the 50 licensees.

maintainer
#15 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

Quoted 5 lines · On Monday 08 September 2014 13:01:31 Robert Richter wrote:

This is well hidden on x86, but each vendor has a config option. For AMD systems we have had our own option to disable vendor specific code, see CPU_SUP_AMD for example. Disabling this will remove all AMD specific code in the kernel. Of course this is enabled per default.

Quoted 8 lines

With ARCH_THUNDER I intended to do the same (you could name this also SOC_SUP_CAVIUM or so but I kept the current naming scheme). In patch 4/4 I have added the option to defconfig. This enables this per default and nobody has to deal with any option manually, just running make defconfig is fine.

Also, at least to disable building the dtb file for foo, you will need ARCH_FOO too. How else would you deal with dtb files then?

The only alternative I see is to build them all.

Quoted 7 lines

Having ARCH_FOO might not be necessary for drivers. One could enable drivers manually, but this option is still a good reference for the drivers needed by foo. At some point you will carry tons of enabled drivers in your defconfig and you don't know which platform actually is using it. For generic drivers this might be fine. But in my point of few, each soc specific driver should have an soc specific option too. Then you easily can remove an soc from the defconfig.

Yes, that's what I had in my example.

Arnd

#16 lore raw

Re: [PATCH v2 1/4] arm64, thunder: Add Kconfig option for Cavium Thunder SoC Family

In reply to Robert Richter
Quoted 41 lines · Robert Richter
Quoted 17 lines · Arnd Bergmann
Quoted 16 lines · On Friday 05 September 2014 15:22:46 Mark Rutland wrote:
Quoted 15 lines

A common pattern these days is to do dependencies like

arch/*/Kconfig:
config ARCH_FOO
bool "Enable support for Foo platform"
help
...

drivers/*/Kconfig

      config SUBSYS_FOO
      bool "SUBSYS driver for Foo"
      depends on ARCH_FOO || COMPILE_TEST
      depends on OF && REGULATOR && GENERIC_PHY # or whatever
Quoted 17 lines
Quoted 2 lines

Russell's comments w.r.t. Kconfig warnings when config names change still holds regardless of select vs depends on.

Yes, that's what I wrote in my reply as well.

Quoted 12 lines
Quoted 7 lines

That way we can enable everything in the defconfig, but someone who likes to build a more specialized kernel can disable the other platforms and won't get the drivers that are specific to those.

I personally think this is a bit more verbose than what we need, but I don't strongly object doing it that way.

You'd still be able to do this without ARCH_FOO, though you would need to know which drivers are necessary for a particular SoC. That seems to be the way things are handled on x86; I don't recall having to select support for specific machines there, just the individual drivers.

This is well hidden on x86, but each vendor has a config option. For AMD systems we have had our own option to disable vendor specific code, see CPU_SUP_AMD for example. Disabling this will remove all AMD specific code in the kernel. Of course this is enabled per default.

Quoted 8 lines

With ARCH_THUNDER I intended to do the same (you could name this also SOC_SUP_CAVIUM or so but I kept the current naming scheme). In patch 4/4 I have added the option to defconfig. This enables this per default and nobody has to deal with any option manually, just running make defconfig is fine.

Also, at least to disable building the dtb file for foo, you will need ARCH_FOO too. How else would you deal with dtb files then?

dtb builds are quick and don't affect the image size at all. Personally, I would prefer to see all dtb's get built for the dtbs rule. You can still specify the specific dtb you want in the case of only caring about 1 platform.

Rob

#17 lore raw

PATCH v2 2/4 arm64, thunder: Add initial dts for Cavium Thunder SoC

In reply to Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

Add initial device tree nodes for Cavium Thunder SoCs with support of 48 cores and gicv3. The dts file requires further changes, esp. for pci, gicv3-its and smmu. This changes will be added later together with the device drivers.

---
 arch/arm64/boot/dts/Makefile         |   1 +
 arch/arm64/boot/dts/thunder-88xx.dts | 414 +++++++++++++++++++++++++++++++++++
 2 files changed, 415 insertions(+)
 create mode 100644 arch/arm64/boot/dts/thunder-88xx.dts
arch/arm64/boot/dts/Makefile +1 -0
index c52bdb051f66..f8001a62029c 100644
@@ -1,3 +1,4 @@
+dtb-$(CONFIG_ARCH_THUNDER) += thunder-88xx.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb foundation-v8.dtb
 dtb-$(CONFIG_ARCH_XGENE) += apm-mustang.dtb
 
arch/arm64/boot/dts/thunder-88xx.dts new file +414 -0

414 lines not on this page · raw message

Signature · 1 line
2.0.1
maintainer
#18 lore raw

Re: [PATCH v2 2/4] arm64, thunder: Add initial dts for Cavium Thunder SoC

arch/arm64/boot/dts/thunder-88xx.dts

Quoted 5 lines · On Friday 05 September 2014 09:46:43 Robert Richter wrote:
arch/arm64/boot/dts/thunder-88xx.dts new file +0 -0
new file mode 100644
index 000000000000..4cc1d059d2d9

Most people end up having a soc.dtsi file and a board.dsi file including the former and adding the machine-specific properties.

It is likely that you will end up needing the same, so you might want to start that way.

arch/arm64/boot/dts/thunder-88xx.dts line 54

Quoted 3 lines
arch/arm64/boot/dts/thunder-88xx.dts new file +3 -0
+/ {
+	model = "Cavium ThunderX CN88XX Family";
+	compatible = "cavium,thunder-88xx";

As mentioned by Mark already, you should not include 'xx' in the compatible string, but instead use the real soc ID.

Normally, each SoC has some slight differences anyway, so you would override these in the specialized dtsi file.

The "model" property should go into the board specific file.

arch/arm64/boot/dts/thunder-88xx.dts line 67

Quoted 13 lines
arch/arm64/boot/dts/thunder-88xx.dts new file +13 -0
+	interrupt-parent = <&gic0>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	aliases {
+		serial0 = &uaa0;
+		serial1 = &uaa1;
+	};
+
+	psci {
+		compatible = "arm,psci-0.2";
+		method = "smc";
+	};

The aliases node should go into the board file as well, since it's possible that e.g. the first uart is not connected and you need something like

	aliases {
		serial0 = &uaa1;
	};

The psci node (according to a discussion we just had for the freescale dts files) should ideally get filled out by the boot loader that implements the psci code, to ensure the version matches.

arch/arm64/boot/dts/thunder-88xx.dts line 366

Quoted 5 lines
arch/arm64/boot/dts/thunder-88xx.dts new file +5 -0
+
+	memory at 00000000 {
+		device_type = "memory";
+		reg = <0x0 0x00000000 0x0 0x80000000>;
+	};

memory should also go into the board specific file, or get filled by the boot loader if it is detected at boot time and user serviceable.

I assume that your machines have NUMA properties, in that case it makes sense to split up the memory device nodes by topology. I think there are some standard properties to describe the topology further, but I don't remember how it's done at the moment.

arch/arm64/boot/dts/thunder-88xx.dts line 387

Quoted 12 lines
arch/arm64/boot/dts/thunder-88xx.dts new file +12 -0
+	soc {
+		compatible = "simple-bus";
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		refclk50mhz: refclk50mhz {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <50000000>;
+			clock-output-names = "refclk50mhz";
+		};

If the reference clock is generated outside of the SoC, I would put the device node for it on the top level.

Arnd

#19 lore raw

Re: [PATCH v2 2/4] arm64, thunder: Add initial dts for Cavium Thunder SoC

Arnd,

Quoted 9 lines · Arnd Bergmann

arch/arm64/boot/dts/thunder-88xx.dts

Quoted 5 lines · On Friday 05 September 2014 09:46:43 Robert Richter wrote:
arch/arm64/boot/dts/thunder-88xx.dts new file +0 -0
new file mode 100644
index 000000000000..4cc1d059d2d9

Most people end up having a soc.dtsi file and a board.dsi file including the former and adding the machine-specific properties.

thanks for your feedback on the dts file. I already included your suggestion into the patches and split the files.

-Robert

#20 lore raw

PATCH v2 3/4 arm64, thunder: Document devicetree bindings for Cavium Thunder SoC

In reply to Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

This patch adds documentation for the devicetree bindings used by the DT files of Cavium Thunder SoC platforms.

---
 Documentation/devicetree/bindings/arm/cavium-thunder.txt | 10 ++++++++++
 Documentation/devicetree/bindings/arm/cpus.txt           |  1 +
 2 files changed, 11 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/cavium-thunder.txt
Documentation/devicetree/bindings/arm/cavium-thunder.txt new file +10 -0
new file mode 100644
index 000000000000..6f63a5866902
@@ -0,0 +1,10 @@
+Cavium Thunder platform device tree bindings
+--------------------------------------------
+
+Boards with Cavium's Thunder SoC shall have following properties.
+
+Root Node
+---------
+Required root node properties:
+
+  - compatible = "cavium,thunder-88xx";
Documentation/devicetree/bindings/arm/cpus.txt +1 -0
index 298e2f6b33c6..578796a2cfa9 100644
@@ -166,6 +166,7 @@ nodes to be present and contain the properties described below.
 			    "arm,cortex-r5"
 			    "arm,cortex-r7"
 			    "brcm,brahma-b15"
+			    "cavium,thunder"
 			    "faraday,fa526"
 			    "intel,sa110"
 			    "intel,sa1100"
Signature · 1 line
2.0.1
#21 lore raw

Re: [PATCH v2 3/4] arm64, thunder: Document devicetree bindings for Cavium Thunder SoC

Quoted 19 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

This patch adds documentation for the devicetree bindings used by the DT files of Cavium Thunder SoC platforms.

---
 Documentation/devicetree/bindings/arm/cavium-thunder.txt | 10 ++++++++++
 Documentation/devicetree/bindings/arm/cpus.txt           |  1 +
 2 files changed, 11 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/cavium-thunder.txt
Documentation/devicetree/bindings/arm/cavium-thunder.txt new file +0 -0
new file mode 100644
index 000000000000..6f63a5866902

Documentation/devicetree/bindings/arm/cavium-thunder.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/arm/cavium-thunder.txt new file +10 -0
@@ -0,0 +1,10 @@
+Cavium Thunder platform device tree bindings
+--------------------------------------------
+
+Boards with Cavium's Thunder SoC shall have following properties.
+
+Root Node
+---------
+Required root node properties:
+
+  - compatible = "cavium,thunder-88xx";

Is this file necessary? We don't have one for xgene afaict.

Will

#22 lore raw

Re: [PATCH v2 3/4] arm64, thunder: Document devicetree bindings for Cavium Thunder SoC

Quoted 24 lines · Will Deacon
Quoted 23 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

This patch adds documentation for the devicetree bindings used by the DT files of Cavium Thunder SoC platforms.

---
 Documentation/devicetree/bindings/arm/cavium-thunder.txt | 10 ++++++++++
 Documentation/devicetree/bindings/arm/cpus.txt           |  1 +
 2 files changed, 11 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/cavium-thunder.txt
Documentation/devicetree/bindings/arm/cavium-thunder.txt new file +4 -0
new file mode 100644
index 000000000000..6f63a5866902
@@ -0,0 +1,10 @@
+Cavium Thunder platform device tree bindings
+--------------------------------------------
+
+Boards with Cavium's Thunder SoC shall have following properties.
Quoted 8 lines

Documentation/devicetree/bindings/arm/cavium-thunder.txt line 10

Quoted 6 lines
Documentation/devicetree/bindings/arm/cavium-thunder.txt new file +6 -0
+
+Root Node
+---------
+Required root node properties:
+
+  - compatible = "cavium,thunder-88xx";

Is this file necessary? We don't have one for xgene afaict.

Hmm, looking at Documentation/devicetree/bindings/arm/calxeda.txt there is something similar.

I am fine with both, keeping or removing it.

Would leave this to the DT maintainers.

-Robert

reviewer
#23 lore raw

Re: [PATCH v2 3/4] arm64, thunder: Document devicetree bindings for Cavium Thunder SoC

Quoted 34 lines · Robert Richter
Quoted 24 lines · Will Deacon
Quoted 23 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

This patch adds documentation for the devicetree bindings used by the DT files of Cavium Thunder SoC platforms.

---
 Documentation/devicetree/bindings/arm/cavium-thunder.txt | 10 ++++++++++
 Documentation/devicetree/bindings/arm/cpus.txt           |  1 +
 2 files changed, 11 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/cavium-thunder.txt
Documentation/devicetree/bindings/arm/cavium-thunder.txt new file +4 -0
new file mode 100644
index 000000000000..6f63a5866902
@@ -0,0 +1,10 @@
+Cavium Thunder platform device tree bindings
+--------------------------------------------
+
+Boards with Cavium's Thunder SoC shall have following properties.
Quoted 8 lines

Documentation/devicetree/bindings/arm/cavium-thunder.txt line 10

Quoted 6 lines
Documentation/devicetree/bindings/arm/cavium-thunder.txt new file +6 -0
+
+Root Node
+---------
+Required root node properties:
+
+  - compatible = "cavium,thunder-88xx";

Is this file necessary? We don't have one for xgene afaict.

Quoted 6 lines

Hmm, looking at Documentation/devicetree/bindings/arm/calxeda.txt there is something similar.

I am fine with both, keeping or removing it.

Would leave this to the DT maintainers.

Having a required root node compatible is fine, though I would only expect it to be necessary for errata workarounds if we have no other way of detecting things.

That said, compatible strings shouldn't have wildcards, so "cavium,thunder-88xx" should be replaced with something more specific. Later boards can claim compatibility with that (but should have their own strings too).

Mark.

#24 lore raw

Re: [PATCH v2 3/4] arm64, thunder: Document devicetree bindings for Cavium Thunder SoC

Quoted 38 lines · Mark Rutland
Quoted 37 lines · Robert Richter
Quoted 24 lines · Will Deacon
Quoted 23 lines · Robert Richter

From: Radha Mohan Chintakuntla <[email protected]>

This patch adds documentation for the devicetree bindings used by the DT files of Cavium Thunder SoC platforms.

---
 Documentation/devicetree/bindings/arm/cavium-thunder.txt | 10 ++++++++++
 Documentation/devicetree/bindings/arm/cpus.txt           |  1 +
 2 files changed, 11 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/cavium-thunder.txt
Documentation/devicetree/bindings/arm/cavium-thunder.txt new file +4 -0
new file mode 100644
index 000000000000..6f63a5866902
@@ -0,0 +1,10 @@
+Cavium Thunder platform device tree bindings
+--------------------------------------------
+
+Boards with Cavium's Thunder SoC shall have following properties.
Quoted 8 lines

Documentation/devicetree/bindings/arm/cavium-thunder.txt line 10

Quoted 6 lines
Documentation/devicetree/bindings/arm/cavium-thunder.txt new file +6 -0
+
+Root Node
+---------
+Required root node properties:
+
+  - compatible = "cavium,thunder-88xx";

Is this file necessary? We don't have one for xgene afaict.

Hmm, looking at Documentation/devicetree/bindings/arm/calxeda.txt there is something similar.

Quoted 7 lines
Quoted 3 lines

I am fine with both, keeping or removing it.

Would leave this to the DT maintainers.

Having a required root node compatible is fine, though I would only expect it to be necessary for errata workarounds if we have no other way of detecting things.

Ok, will keep the change.

Quoted 4 lines

That said, compatible strings shouldn't have wildcards, so "cavium,thunder-88xx" should be replaced with something more specific. Later boards can claim compatibility with that (but should have their own strings too).

88xx is not a wildcard for chips, there are no chips named 8800 or whatever, instead we have e.g. 87xx. That said, 88xx is the specific name of the soc and the first reference board. If there will be other boards with the same soc, it should have its own name but should be compatible with cavium,thunder-88xx. Later soc revisions will get a different name than thunder-88xx for differentiation.

-Robert

#25 lore raw

PATCH v2 4/4 arm64, defconfig: Enable Cavium Thunder SoC in defconfig

In reply to Robert Richter

From: Robert Richter <[email protected]>

This patch enables Thunder SoCs in the arm64 defconfig. This is esp. useful to add Thunder platforms to automated builds based on arm64 defconfig.

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index d92ef3c54161..9cd37de9aa8d 100644
@@ -32,6 +32,7 @@ CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_ARCH_THUNDER=y
 CONFIG_ARCH_VEXPRESS=y
 CONFIG_ARCH_XGENE=y
 CONFIG_SMP=y
Signature · 1 line
2.0.1
#26 lore raw
In reply to Robert Richter
Quoted 10 lines · Robert Richter

From: Robert Richter <[email protected]>

This initial patches enable Cavium Thunder SoC Family. The patches add Kconfig and devicetree support and then add Thunder to the defconfig.

The Thunder system needs more enablement patches for subsystems and devices, this includes network, ahci, gicv3/gicv3-its, pci, smmu, kvm. We will send separate patch sets for these. All of them base on this initial patches.

Quoted 5 lines

I sent a separate patch set independently that introduces support for dts vendor subdirs. After both patch sets have been applied I will send a patch in addition that moves the dts file into a subdirectory.

Patches are available here:

If you can get some acks for the DT bits, I'm happy to take this via the arm64 tree for 3.18.

Will