Skip to contentSkip to conversation

kirkwood: combine support for openrd base/client support

PATCH Superseded Alexander Clouter 3 participants 6 messages Oct 22, 2009 – Oct 23, 2009

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 kirkwood: combine support for openrd base/client support

Inspired by the mach-ep93xx flattening work, there is really not much difference between the OpenRD base and client board support so they should be merged together.

v0 - initial release
v1 - added I2C/PCIe support
v2 - removed un-necessary ifdef's as recommended by Nico
and marked u-boot MTD_WRITEABLE
v3 - fixup GbE1 to work (PHY address incorrect, hex 18 *not* dec 18)

---

arch/arm/mach-kirkwood/Kconfig +11 -0
index 0aca451..8e9ac7d 100644
@@ -38,12 +38,23 @@ config MACH_TS219
 	  Say 'Y' here if you want your kernel to support the
 	  QNAP TS-119 and TS-219 Turbo NAS devices.
 
+config MACH_OPENRD
+        bool
+
 config MACH_OPENRD_BASE
 	bool "Marvell OpenRD Base Board"
+	select MACH_OPENRD
 	help
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell OpenRD Base Board.
 
+config MACH_OPENRD_CLIENT
+	bool "Marvell OpenRD Client Board"
+	select MACH_OPENRD
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell OpenRD Client Board.
+
 endmenu
 
 endif
arch/arm/mach-kirkwood/Makefile +1 -1
index 80ab0ec..5ad19dd 100644
@@ -6,6 +6,6 @@ obj-$(CONFIG_MACH_RD88F6281)		+= rd88f6281-setup.o
 obj-$(CONFIG_MACH_MV88F6281GTW_GE)	+= mv88f6281gtw_ge-setup.o
 obj-$(CONFIG_MACH_SHEEVAPLUG)		+= sheevaplug-setup.o
 obj-$(CONFIG_MACH_TS219)		+= ts219-setup.o
-obj-$(CONFIG_MACH_OPENRD_BASE)		+= openrd_base-setup.o
+obj-$(CONFIG_MACH_OPENRD)		+= openrd-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
arch/arm/mach-kirkwood/openrd-setup.c new file +117 -0

117 lines not on this page · raw message

arch/arm/mach-kirkwood/openrd_base-setup.c deleted +0 -84

84 lines not on this page · raw message

#1 lore raw

PATCH v3 1/1 kirkwood: combine support for openrd base/client support

arch/arm/mach-kirkwood/openrd-setup.c line 87

Quoted 3 lines · On Thu, 22 Oct 2009 09:22:49 +0100 Alexander Clouter <[email protected]> wrote:
arch/arm/mach-kirkwood/openrd-setup.c new file +3 -0
+static int __init openrd_pci_init(void)
+{
+	kirkwood_pcie_init();

I think you should do

	if (machine_is_openrd_base() || machine_is_openrd_client())
		kirkwood_pcie_init();

here instead since there might be other boards configured as well where this shouldn't be done (e.g., a build with both sheevaplug and the OpenRDs).

arch/arm/mach-kirkwood/openrd_base-setup.c

Quoted 1 line
arch/arm/mach-kirkwood/openrd_base-setup.c +0 -0

Perhaps it's a good idea to rebase this one against Nicolas orion.git tree at

http://git.marvell.com/?p=orion.git;a=summary

?

// Simon

#2 lore raw

PATCH v3 1/1 kirkwood: combine support for openrd base/client support

Hi,

Quoted 9 lines · Simon Kagstrom

arch/arm/mach-kirkwood/openrd-setup.c line 87

Quoted 3 lines · On Thu, 22 Oct 2009 09:22:49 +0100 Alexander Clouter <[email protected]> wrote:
arch/arm/mach-kirkwood/openrd-setup.c new file +3 -0
+static int __init openrd_pci_init(void)
+{
+	kirkwood_pcie_init();

I think you should do

Quoted 7 lines
	if (machine_is_openrd_base() || machine_is_openrd_client())
		kirkwood_pcie_init();

here instead since there might be other boards configured as well where this shouldn't be done (e.g., a build with both sheevaplug and the OpenRDs).

It's called 'openrd-setup.c' not 'sheevaplug-setup.c' :) The SheevaPlug's do not use this at all ('MACHINE_START(SHEEVAPLUG, ...)' is not to be seen in there), they already have their own file. If someone wants to merge the SheevaPlug's into here too they can cross that bridge themselves.

If people want *me* to flatten sheevaplug-setup.c and my openrd-setup.c into a single file I am happy to do so, but someone needs to give me a suitable combo name as sheeva/openrd would no longer be right I would guess :)

Quoted 6 lines

arch/arm/mach-kirkwood/openrd_base-setup.c

Quoted 1 line
arch/arm/mach-kirkwood/openrd_base-setup.c +0 -0

Perhaps it's a good idea to rebase this one against Nicolas orion.git tree at

http://git.marvell.com/?p=orion.git;a=summary

...erm..I have not rebased but it should apply cleanly though as I just run from a clone'd vanilla 2.6 (Linus's tree) and pull in orion.git anyway.

I did not think the rebasing was really an issue unless you get hunk fails?

Cheers

Signature · 2 lines
Alexander Clouter
.sigmonster says: Phone call for chucky-pooh.
#3 lore raw

PATCH v3 1/1 kirkwood: combine support for openrd base/client support

Quoted 12 lines · Alexander Clouter

Hi,

Quoted 9 lines · Simon Kagstrom

arch/arm/mach-kirkwood/openrd-setup.c line 87

Quoted 3 lines · On Thu, 22 Oct 2009 09:22:49 +0100 Alexander Clouter <[email protected]> wrote:
arch/arm/mach-kirkwood/openrd-setup.c new file +3 -0
+static int __init openrd_pci_init(void)
+{
+	kirkwood_pcie_init();

I think you should do

Quoted 8 lines
Quoted 7 lines
	if (machine_is_openrd_base() || machine_is_openrd_client())
		kirkwood_pcie_init();

here instead since there might be other boards configured as well where this shouldn't be done (e.g., a build with both sheevaplug and the OpenRDs).

It's called 'openrd-setup.c' not 'sheevaplug-setup.c' :)

So?

Quoted 2 lines

The SheevaPlug's do not use this at all ('MACHINE_START(SHEEVAPLUG, ...)' is not to be seen in there), they already have their own file.

The openrd_pci_init() is still called with a subsys_initcall() registration. That would be invoked on a SheevaPlug as well if you have a kernel that supports them both.

Quoted 3 lines

If someone
wants to merge the SheevaPlug's into here too they can cross that bridge themselves.

No way. I'll bomb the bridge beforehand. There should be a balance between consolidation and abstraction.

Nicolas

#4 lore raw

PATCH v3 1/1 kirkwood: combine support for openrd base/client support

Hi,

Quoted 10 lines · Nicolas Pitre
Quoted 2 lines · Alexander Clouter

The SheevaPlug's do not use this at all ('MACHINE_START(SHEEVAPLUG, ...)' is not to be seen in there), they already have their own file.

The openrd_pci_init() is still called with a subsys_initcall() registration. That would be invoked on a SheevaPlug as well if you have a kernel that supports them both.

Right, now I understand, that makes perfect sense. I'll amend things to behave for version 4.

Quoted 6 lines
Quoted 2 lines

If someone wants to merge the SheevaPlug's into here too they can cross that bridge themselves.

No way. I'll bomb the bridge beforehand. There should be a balance between consolidation and abstraction.

I did not say it was a Good Idea(tm) :)

Cheers

Signature · 2 lines
Alexander Clouter
.sigmonster says: It was Penguin lust... at its ugliest.
#5 lore raw

PATCH v3 1/1 kirkwood: combine support for openrd base/client support

In reply to Alexander Clouter

Sorry for being unclear in my comments! (And thanks to Nicolas for explaining the PCI init issue I raised).

Quoted 9 lines · On Thu, 22 Oct 2009 12:04:36 +0100 Alexander Clouter <[email protected]> wrote:
Quoted 6 lines

arch/arm/mach-kirkwood/openrd_base-setup.c

Quoted 1 line
arch/arm/mach-kirkwood/openrd_base-setup.c +0 -0

Perhaps it's a good idea to rebase this one against Nicolas orion.git tree at

http://git.marvell.com/?p=orion.git;a=summary

...erm..I have not rebased but it should apply cleanly though as I just run from a clone'd vanilla 2.6 (Linus's tree) and pull in orion.git anyway.

Well, your patch will/should go through Nicolas tree, and I just noticed that it didn't contain the last patches on orion.git (namely the PCI init you also added to the combined file).

I haven't tested, but would guess that git won't accept removing a file which has changes in it - the openrd-base.c you _remove_ don't have the PCI init.

Anyway, I believe it makes very much sense to merge the two OpenRDs, so other than these things I'm happy with the patch.

// Simon