linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support
  2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
@ 2008-08-19 15:25 ` Josh Boyer
  2008-08-20 13:33   ` Arnd Bergmann
  2008-08-19 15:26 ` [PATCH 2/9] powerpc/44x: Migrate Bamboo support to ppc44x_simple Josh Boyer
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 26+ messages in thread
From: Josh Boyer @ 2008-08-19 15:25 UTC (permalink / raw)
  To: linuxppc-dev

This adds a common board file for almost all of the "simple" PowerPC 44x
boards that exist today.  This is intended to be a single place to add
support for boards that do not differ in platform support from most of the
evaluation boards that are used as reference platforms.  Boards that have
specific requirements or custom hardware setup should still have their own
board.c file.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/44x/Kconfig         |    7 +++
 arch/powerpc/platforms/44x/Makefile        |    1 +
 arch/powerpc/platforms/44x/ppc44x_simple.c |   81 ++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/platforms/44x/ppc44x_simple.c

diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 249ba01..97c634c 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -127,6 +127,13 @@ config XILINX_VIRTEX440_GENERIC_BOARD
 	  Most Virtex 5 designs should use this unless it needs to do some
 	  special configuration at board probe time.
 
+config PPC44x_SIMPLE
+	bool "Simple PowerPC 44x board support"
+	depends on 44x
+	default n
+	help
+	  This option enables the simple PowerPC 44x platform support.
+
 # 44x specific CPU modules, selected based on the board above.
 config 440EP
 	bool
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 8d0b1a1..73c1df5 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -1,4 +1,5 @@
 obj-$(CONFIG_44x)	:= misc_44x.o idle.o
+obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o
 obj-$(CONFIG_EBONY)	+= ebony.o
 obj-$(CONFIG_TAISHAN)	+= taishan.o
 obj-$(CONFIG_BAMBOO)	+= bamboo.o
diff --git a/arch/powerpc/platforms/44x/ppc44x_simple.c b/arch/powerpc/platforms/44x/ppc44x_simple.c
new file mode 100644
index 0000000..067cddb
--- /dev/null
+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
@@ -0,0 +1,81 @@
+/*
+ * Generic PowerPC 44x platform support
+ *
+ * Copyright 2008 IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; version 2 of the License.
+ *
+ * This implements simple platform support for PowerPC 44x chips.  This is
+ * mostly used for eval boards or other simple and "generic" 44x boards.  If
+ * your board has custom functions or hardware, then you will likely want to
+ * implement your own board.c file to accommodate it.
+ */
+
+#include <linux/init.h>
+#include <linux/of_platform.h>
+
+#include <asm/machdep.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <asm/time.h>
+#include <asm/uic.h>
+#include <asm/pci-bridge.h>
+#include <asm/ppc4xx.h>
+
+static __initdata struct of_device_id ppc44x_of_bus[] = {
+	{ .compatible = "ibm,plb4", },
+	{ .compatible = "ibm,opb", },
+	{ .compatible = "ibm,ebc", },
+	{ .compatible = "simple-bus", },
+	{},
+};
+
+static int __init ppc44x_device_probe(void)
+{
+	of_platform_bus_probe(NULL, ppc44x_of_bus, NULL);
+
+	return 0;
+}
+machine_device_initcall(ppc44x_simple, ppc44x_device_probe);
+
+static char *board[] __initdata = {
+	"amcc,bamboo",
+	"amcc,cayonlands",
+	"ibm,ebony",
+	"amcc,katmai",
+	"amcc,rainier",
+	"amcc,sequoia",
+	"amcc,taishan",
+	NULL
+};
+
+static int __init ppc44x_probe(void)
+{
+	unsigned long root = of_get_flat_dt_root();
+	int i = 0;
+
+	while (board[i]) {
+		if (of_flat_dt_is_compatible(root, board[i]))
+			break;
+		i++;
+	}
+
+	if (board[i] != NULL) {
+		ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+		return 1;
+	}
+
+	return 0;
+}
+
+define_machine(ppc44x_simple) {
+	.name = "PowerPC 44x Platform",
+	.probe = ppc44x_probe,
+	.progress = udbg_progress,
+	.init_IRQ = uic_init_tree,
+	.get_irq = uic_get_irq,
+	.restart = ppc4xx_reset_system,
+	.calibrate_decr = generic_calibrate_decr,
+};
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/9] powerpc/44x: Migrate Bamboo support to ppc44x_simple
  2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
  2008-08-19 15:25 ` [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support Josh Boyer
@ 2008-08-19 15:26 ` Josh Boyer
  2008-08-19 15:26 ` [PATCH 3/9] powerpc/44x: Migrate Canyonlands " Josh Boyer
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-19 15:26 UTC (permalink / raw)
  To: linuxppc-dev

Migrate the AMCC Bamboo board to use the ppc44x_simple platform file.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/44x/Kconfig  |    2 +
 arch/powerpc/platforms/44x/Makefile |    2 -
 arch/powerpc/platforms/44x/bamboo.c |   62 -----------------------------------
 3 files changed, 2 insertions(+), 64 deletions(-)
 delete mode 100644 arch/powerpc/platforms/44x/bamboo.c

diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 97c634c..0958285 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -2,6 +2,7 @@ config BAMBOO
 	bool "Bamboo"
 	depends on 44x
 	default n
+	select PPC44x_SIMPLE
 	select 440EP
 	select PCI
 	help
@@ -90,6 +91,7 @@ config YOSEMITE
 	bool "Yosemite"
 	depends on 44x
 	default n
+	select PPC44x_SIMPLE
 	select 440EP
 	select PCI
 	help
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 73c1df5..ca18a32 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -2,8 +2,6 @@ obj-$(CONFIG_44x)	:= misc_44x.o idle.o
 obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o
 obj-$(CONFIG_EBONY)	+= ebony.o
 obj-$(CONFIG_TAISHAN)	+= taishan.o
-obj-$(CONFIG_BAMBOO)	+= bamboo.o
-obj-$(CONFIG_YOSEMITE)	+= bamboo.o
 obj-$(CONFIG_SAM440EP) 	+= sam440ep.o
 obj-$(CONFIG_SEQUOIA)	+= sequoia.o
 obj-$(CONFIG_KATMAI)	+= katmai.o
diff --git a/arch/powerpc/platforms/44x/bamboo.c b/arch/powerpc/platforms/44x/bamboo.c
deleted file mode 100644
index cef169e..0000000
--- a/arch/powerpc/platforms/44x/bamboo.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Bamboo board specific routines
- *
- * Wade Farnsworth <wfarnsworth@mvista.com>
- * Copyright 2004 MontaVista Software Inc.
- *
- * Rewritten and ported to the merged powerpc tree:
- * Josh Boyer <jwboyer@linux.vnet.ibm.com>
- * Copyright 2007 IBM Corporation
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- */
-#include <linux/init.h>
-#include <linux/of_platform.h>
-
-#include <asm/machdep.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <asm/time.h>
-#include <asm/uic.h>
-#include <asm/pci-bridge.h>
-#include <asm/ppc4xx.h>
-
-static __initdata struct of_device_id bamboo_of_bus[] = {
-	{ .compatible = "ibm,plb4", },
-	{ .compatible = "ibm,opb", },
-	{ .compatible = "ibm,ebc", },
-	{},
-};
-
-static int __init bamboo_device_probe(void)
-{
-	of_platform_bus_probe(NULL, bamboo_of_bus, NULL);
-
-	return 0;
-}
-machine_device_initcall(bamboo, bamboo_device_probe);
-
-static int __init bamboo_probe(void)
-{
-	unsigned long root = of_get_flat_dt_root();
-
-	if (!of_flat_dt_is_compatible(root, "amcc,bamboo"))
-		return 0;
-
-	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
-
-	return 1;
-}
-
-define_machine(bamboo) {
-	.name 			= "Bamboo",
-	.probe 			= bamboo_probe,
-	.progress 		= udbg_progress,
-	.init_IRQ 		= uic_init_tree,
-	.get_irq 		= uic_get_irq,
-	.restart		= ppc4xx_reset_system,
-	.calibrate_decr 	= generic_calibrate_decr,
-};
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/9] powerpc/44x: Migrate Canyonlands support to ppc44x_simple
  2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
  2008-08-19 15:25 ` [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support Josh Boyer
  2008-08-19 15:26 ` [PATCH 2/9] powerpc/44x: Migrate Bamboo support to ppc44x_simple Josh Boyer
@ 2008-08-19 15:26 ` Josh Boyer
  2008-08-19 15:26 ` [PATCH 4/9] powerpc/44x: Migrate Katmai " Josh Boyer
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-19 15:26 UTC (permalink / raw)
  To: linuxppc-dev

Migrate the AMCC Canyonlands board to use the ppc44x_simple platform file.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/44x/Kconfig       |    1 +
 arch/powerpc/platforms/44x/Makefile      |    1 -
 arch/powerpc/platforms/44x/canyonlands.c |   63 ------------------------------
 3 files changed, 1 insertions(+), 64 deletions(-)
 delete mode 100644 arch/powerpc/platforms/44x/canyonlands.c

diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 0958285..92ba2d8 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -81,6 +81,7 @@ config CANYONLANDS
 	bool "Canyonlands"
 	depends on 44x
 	default n
+	select PPC44x_SIMPLE
 	select 460EX
 	select PCI
 	select PPC4xx_PCI_EXPRESS
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index ca18a32..0ab626d 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -8,5 +8,4 @@ obj-$(CONFIG_KATMAI)	+= katmai.o
 obj-$(CONFIG_RAINIER)	+= rainier.o
 obj-$(CONFIG_WARP)	+= warp.o
 obj-$(CONFIG_WARP)	+= warp-nand.o
-obj-$(CONFIG_CANYONLANDS) += canyonlands.o
 obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
diff --git a/arch/powerpc/platforms/44x/canyonlands.c b/arch/powerpc/platforms/44x/canyonlands.c
deleted file mode 100644
index 3949289..0000000
--- a/arch/powerpc/platforms/44x/canyonlands.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Canyonlands board specific routines
- *
- * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
- *
- * Based on the Katmai code by
- * Benjamin Herrenschmidt <benh@kernel.crashing.org>
- * Copyright 2007 IBM Corp.
- * Josh Boyer <jwboyer@linux.vnet.ibm.com>
- * Copyright 2007 IBM Corporation
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- */
-#include <linux/init.h>
-#include <linux/of_platform.h>
-
-#include <asm/machdep.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <asm/time.h>
-#include <asm/uic.h>
-#include <asm/pci-bridge.h>
-#include <asm/ppc4xx.h>
-
-static __initdata struct of_device_id canyonlands_of_bus[] = {
-	{ .compatible = "ibm,plb4", },
-	{ .compatible = "ibm,opb", },
-	{ .compatible = "ibm,ebc", },
-	{},
-};
-
-static int __init canyonlands_device_probe(void)
-{
-	of_platform_bus_probe(NULL, canyonlands_of_bus, NULL);
-
-	return 0;
-}
-machine_device_initcall(canyonlands, canyonlands_device_probe);
-
-static int __init canyonlands_probe(void)
-{
-	unsigned long root = of_get_flat_dt_root();
-
-	if (!of_flat_dt_is_compatible(root, "amcc,canyonlands"))
-		return 0;
-
-	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
-
-	return 1;
-}
-
-define_machine(canyonlands) {
-	.name 				= "Canyonlands",
-	.probe 				= canyonlands_probe,
-	.progress 			= udbg_progress,
-	.init_IRQ 			= uic_init_tree,
-	.get_irq 			= uic_get_irq,
-	.restart			= ppc4xx_reset_system,
-	.calibrate_decr			= generic_calibrate_decr,
-};
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 4/9] powerpc/44x: Migrate Katmai support to ppc44x_simple
  2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
                   ` (2 preceding siblings ...)
  2008-08-19 15:26 ` [PATCH 3/9] powerpc/44x: Migrate Canyonlands " Josh Boyer
@ 2008-08-19 15:26 ` Josh Boyer
  2008-08-19 15:26 ` [PATCH 5/9] powerpc/44x: Migrate Rainier " Josh Boyer
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-19 15:26 UTC (permalink / raw)
  To: linuxppc-dev

Migrate the AMCC Katmai board to use the ppc44x_simple platform file.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/44x/Kconfig  |    1 +
 arch/powerpc/platforms/44x/Makefile |    1 -
 arch/powerpc/platforms/44x/katmai.c |   62 -----------------------------------
 3 files changed, 1 insertions(+), 63 deletions(-)
 delete mode 100644 arch/powerpc/platforms/44x/katmai.c

diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 92ba2d8..66d4499 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -49,6 +49,7 @@ config KATMAI
 	bool "Katmai"
 	depends on 44x
 	default n
+	select PPC44x_SIMPLE
 	select 440SPe
 	select PCI
 	select PPC4xx_PCI_EXPRESS
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 0ab626d..2eb1cbe 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -4,7 +4,6 @@ obj-$(CONFIG_EBONY)	+= ebony.o
 obj-$(CONFIG_TAISHAN)	+= taishan.o
 obj-$(CONFIG_SAM440EP) 	+= sam440ep.o
 obj-$(CONFIG_SEQUOIA)	+= sequoia.o
-obj-$(CONFIG_KATMAI)	+= katmai.o
 obj-$(CONFIG_RAINIER)	+= rainier.o
 obj-$(CONFIG_WARP)	+= warp.o
 obj-$(CONFIG_WARP)	+= warp-nand.o
diff --git a/arch/powerpc/platforms/44x/katmai.c b/arch/powerpc/platforms/44x/katmai.c
deleted file mode 100644
index 44f4b3a..0000000
--- a/arch/powerpc/platforms/44x/katmai.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Katmai board specific routines
- *
- * Benjamin Herrenschmidt <benh@kernel.crashing.org>
- * Copyright 2007 IBM Corp.
- *
- * Based on the Bamboo code by
- * Josh Boyer <jwboyer@linux.vnet.ibm.com>
- * Copyright 2007 IBM Corporation
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- */
-#include <linux/init.h>
-#include <linux/of_platform.h>
-
-#include <asm/machdep.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <asm/time.h>
-#include <asm/uic.h>
-#include <asm/pci-bridge.h>
-#include <asm/ppc4xx.h>
-
-static __initdata struct of_device_id katmai_of_bus[] = {
-	{ .compatible = "ibm,plb4", },
-	{ .compatible = "ibm,opb", },
-	{ .compatible = "ibm,ebc", },
-	{},
-};
-
-static int __init katmai_device_probe(void)
-{
-	of_platform_bus_probe(NULL, katmai_of_bus, NULL);
-
-	return 0;
-}
-machine_device_initcall(katmai, katmai_device_probe);
-
-static int __init katmai_probe(void)
-{
-	unsigned long root = of_get_flat_dt_root();
-
-	if (!of_flat_dt_is_compatible(root, "amcc,katmai"))
-		return 0;
-
-	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
-
-	return 1;
-}
-
-define_machine(katmai) {
-	.name 				= "Katmai",
-	.probe 				= katmai_probe,
-	.progress 			= udbg_progress,
-	.init_IRQ 			= uic_init_tree,
-	.get_irq 			= uic_get_irq,
-	.restart			= ppc4xx_reset_system,
-	.calibrate_decr			= generic_calibrate_decr,
-};
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 5/9] powerpc/44x: Migrate Rainier support to ppc44x_simple
  2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
                   ` (3 preceding siblings ...)
  2008-08-19 15:26 ` [PATCH 4/9] powerpc/44x: Migrate Katmai " Josh Boyer
@ 2008-08-19 15:26 ` Josh Boyer
  2008-08-19 15:26 ` [PATCH 6/9] powerpc/44x: Migrate Sequoia " Josh Boyer
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-19 15:26 UTC (permalink / raw)
  To: linuxppc-dev

Migrate the AMCC Rainier board to use the ppc44x_simple platform file.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/44x/Kconfig   |    1 +
 arch/powerpc/platforms/44x/Makefile  |    1 -
 arch/powerpc/platforms/44x/rainier.c |   62 ----------------------------------
 3 files changed, 1 insertions(+), 63 deletions(-)
 delete mode 100644 arch/powerpc/platforms/44x/rainier.c

diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 66d4499..89e7f1f 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -60,6 +60,7 @@ config RAINIER
 	bool "Rainier"
 	depends on 44x
 	default n
+	select PPC44x_SIMPLE
 	select 440GRX
 	select PCI
 	help
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 2eb1cbe..c201af6 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -4,7 +4,6 @@ obj-$(CONFIG_EBONY)	+= ebony.o
 obj-$(CONFIG_TAISHAN)	+= taishan.o
 obj-$(CONFIG_SAM440EP) 	+= sam440ep.o
 obj-$(CONFIG_SEQUOIA)	+= sequoia.o
-obj-$(CONFIG_RAINIER)	+= rainier.o
 obj-$(CONFIG_WARP)	+= warp.o
 obj-$(CONFIG_WARP)	+= warp-nand.o
 obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
diff --git a/arch/powerpc/platforms/44x/rainier.c b/arch/powerpc/platforms/44x/rainier.c
deleted file mode 100644
index 4f1ff84..0000000
--- a/arch/powerpc/platforms/44x/rainier.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Rainier board specific routines
- *
- * Valentine Barshak <vbarshak@ru.mvista.com>
- * Copyright 2007 MontaVista Software Inc.
- *
- * Based on the Bamboo code by
- * Josh Boyer <jwboyer@linux.vnet.ibm.com>
- * Copyright 2007 IBM Corporation
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- */
-#include <linux/init.h>
-#include <linux/of_platform.h>
-
-#include <asm/machdep.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <asm/time.h>
-#include <asm/uic.h>
-#include <asm/pci-bridge.h>
-#include <asm/ppc4xx.h>
-
-static __initdata struct of_device_id rainier_of_bus[] = {
-	{ .compatible = "ibm,plb4", },
-	{ .compatible = "ibm,opb", },
-	{ .compatible = "ibm,ebc", },
-	{},
-};
-
-static int __init rainier_device_probe(void)
-{
-	of_platform_bus_probe(NULL, rainier_of_bus, NULL);
-
-	return 0;
-}
-machine_device_initcall(rainier, rainier_device_probe);
-
-static int __init rainier_probe(void)
-{
-	unsigned long root = of_get_flat_dt_root();
-
-	if (!of_flat_dt_is_compatible(root, "amcc,rainier"))
-		return 0;
-
-	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
-
-	return 1;
-}
-
-define_machine(rainier) {
-	.name 				= "Rainier",
-	.probe 				= rainier_probe,
-	.progress 			= udbg_progress,
-	.init_IRQ 			= uic_init_tree,
-	.get_irq 			= uic_get_irq,
-	.restart			= ppc4xx_reset_system,
-	.calibrate_decr			= generic_calibrate_decr,
-};
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 6/9] powerpc/44x: Migrate Sequoia support to ppc44x_simple
  2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
                   ` (4 preceding siblings ...)
  2008-08-19 15:26 ` [PATCH 5/9] powerpc/44x: Migrate Rainier " Josh Boyer
@ 2008-08-19 15:26 ` Josh Boyer
  2008-08-19 15:26 ` [PATCH 7/9] powerpc/44x: Migrate Taishan " Josh Boyer
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-19 15:26 UTC (permalink / raw)
  To: linuxppc-dev

Migrate the AMCC Sequoia board to use the ppc44x_simple platform file.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/44x/Kconfig   |    1 +
 arch/powerpc/platforms/44x/Makefile  |    1 -
 arch/powerpc/platforms/44x/sequoia.c |   63 ----------------------------------
 3 files changed, 1 insertions(+), 64 deletions(-)
 delete mode 100644 arch/powerpc/platforms/44x/sequoia.c

diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 89e7f1f..84e2a70 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -31,6 +31,7 @@ config SEQUOIA
 	bool "Sequoia"
 	depends on 44x
 	default n
+	select PPC44x_SIMPLE
 	select 440EPX
 	help
 	  This option enables support for the AMCC PPC440EPX evaluation board.
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index c201af6..a8a92c1 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -3,7 +3,6 @@ obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o
 obj-$(CONFIG_EBONY)	+= ebony.o
 obj-$(CONFIG_TAISHAN)	+= taishan.o
 obj-$(CONFIG_SAM440EP) 	+= sam440ep.o
-obj-$(CONFIG_SEQUOIA)	+= sequoia.o
 obj-$(CONFIG_WARP)	+= warp.o
 obj-$(CONFIG_WARP)	+= warp-nand.o
 obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
diff --git a/arch/powerpc/platforms/44x/sequoia.c b/arch/powerpc/platforms/44x/sequoia.c
deleted file mode 100644
index 49eb73d..0000000
--- a/arch/powerpc/platforms/44x/sequoia.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Sequoia board specific routines
- *
- * Valentine Barshak <vbarshak@ru.mvista.com>
- * Copyright 2007 MontaVista Software Inc.
- *
- * Based on the Bamboo code by
- * Josh Boyer <jwboyer@linux.vnet.ibm.com>
- * Copyright 2007 IBM Corporation
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- */
-#include <linux/init.h>
-#include <linux/of_platform.h>
-
-#include <asm/machdep.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <asm/time.h>
-#include <asm/uic.h>
-#include <asm/pci-bridge.h>
-
-#include <asm/ppc4xx.h>
-
-static __initdata struct of_device_id sequoia_of_bus[] = {
-	{ .compatible = "ibm,plb4", },
-	{ .compatible = "ibm,opb", },
-	{ .compatible = "ibm,ebc", },
-	{},
-};
-
-static int __init sequoia_device_probe(void)
-{
-	of_platform_bus_probe(NULL, sequoia_of_bus, NULL);
-
-	return 0;
-}
-machine_device_initcall(sequoia, sequoia_device_probe);
-
-static int __init sequoia_probe(void)
-{
-	unsigned long root = of_get_flat_dt_root();
-
-	if (!of_flat_dt_is_compatible(root, "amcc,sequoia"))
-		return 0;
-
-	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
-
-	return 1;
-}
-
-define_machine(sequoia) {
-	.name 				= "Sequoia",
-	.probe 				= sequoia_probe,
-	.progress 			= udbg_progress,
-	.init_IRQ 			= uic_init_tree,
-	.get_irq 			= uic_get_irq,
-	.restart			= ppc4xx_reset_system,
-	.calibrate_decr			= generic_calibrate_decr,
-};
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 7/9] powerpc/44x: Migrate Taishan support to ppc44x_simple
  2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
                   ` (5 preceding siblings ...)
  2008-08-19 15:26 ` [PATCH 6/9] powerpc/44x: Migrate Sequoia " Josh Boyer
@ 2008-08-19 15:26 ` Josh Boyer
  2008-08-19 15:27 ` [PATCH 8/9] powerpc/44x: Add explicit support for AMCC Glacier Josh Boyer
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-19 15:26 UTC (permalink / raw)
  To: linuxppc-dev

Migrate the AMCC Taishan board to use the ppc44x_simple platform file.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/44x/Kconfig   |    1 +
 arch/powerpc/platforms/44x/Makefile  |    1 -
 arch/powerpc/platforms/44x/taishan.c |   72 ----------------------------------
 3 files changed, 1 insertions(+), 73 deletions(-)
 delete mode 100644 arch/powerpc/platforms/44x/taishan.c

diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 84e2a70..e0bea83 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -40,6 +40,7 @@ config TAISHAN
 	bool "Taishan"
 	depends on 44x
 	default n
+	select PPC44x_SIMPLE
 	select 440GX
 	select PCI
 	help
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index a8a92c1..6981331 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -1,7 +1,6 @@
 obj-$(CONFIG_44x)	:= misc_44x.o idle.o
 obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o
 obj-$(CONFIG_EBONY)	+= ebony.o
-obj-$(CONFIG_TAISHAN)	+= taishan.o
 obj-$(CONFIG_SAM440EP) 	+= sam440ep.o
 obj-$(CONFIG_WARP)	+= warp.o
 obj-$(CONFIG_WARP)	+= warp-nand.o
diff --git a/arch/powerpc/platforms/44x/taishan.c b/arch/powerpc/platforms/44x/taishan.c
deleted file mode 100644
index 49c78b2..0000000
--- a/arch/powerpc/platforms/44x/taishan.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Taishan board specific routines based off ebony.c code
- * original copyrights below
- *
- * Matt Porter <mporter@kernel.crashing.org>
- * Copyright 2002-2005 MontaVista Software Inc.
- *
- * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
- * Copyright (c) 2003-2005 Zultys Technologies
- *
- * Rewritten and ported to the merged powerpc tree:
- * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
- *
- * Modified from ebony.c for taishan:
- * Copyright 2007 Hugh Blemings <hugh@au.ibm.com>, IBM Corporation.
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- */
-
-#include <linux/init.h>
-#include <linux/of_platform.h>
-
-#include <asm/machdep.h>
-#include <asm/prom.h>
-#include <asm/udbg.h>
-#include <asm/time.h>
-#include <asm/uic.h>
-#include <asm/pci-bridge.h>
-#include <asm/ppc4xx.h>
-
-static __initdata struct of_device_id taishan_of_bus[] = {
-	{ .compatible = "ibm,plb4", },
-	{ .compatible = "ibm,opb", },
-	{ .compatible = "ibm,ebc", },
-	{},
-};
-
-static int __init taishan_device_probe(void)
-{
-	of_platform_bus_probe(NULL, taishan_of_bus, NULL);
-
-	return 0;
-}
-machine_device_initcall(taishan, taishan_device_probe);
-
-/*
- * Called very early, MMU is off, device-tree isn't unflattened
- */
-static int __init taishan_probe(void)
-{
-	unsigned long root = of_get_flat_dt_root();
-
-	if (!of_flat_dt_is_compatible(root, "amcc,taishan"))
-		return 0;
-
-	ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
-
-	return 1;
-}
-
-define_machine(taishan) {
-	.name			= "Taishan",
-	.probe			= taishan_probe,
-	.progress		= udbg_progress,
-	.init_IRQ		= uic_init_tree,
-	.get_irq		= uic_get_irq,
-	.restart		= ppc4xx_reset_system,
-	.calibrate_decr		= generic_calibrate_decr,
-};
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 8/9] powerpc/44x: Add explicit support for AMCC Glacier
  2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
                   ` (6 preceding siblings ...)
  2008-08-19 15:26 ` [PATCH 7/9] powerpc/44x: Migrate Taishan " Josh Boyer
@ 2008-08-19 15:27 ` Josh Boyer
  2008-08-19 15:27 ` [PATCH 9/9] powerpc/44x: Add explicit Yosemite support Josh Boyer
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-19 15:27 UTC (permalink / raw)
  To: linuxppc-dev

Add explicit support for the AMCC Glacier eval board to Kconfig and the
ppc44x_simple file.  Also removes the cayonlands compatible entry from the
DTS file.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/boot/dts/glacier.dts          |    2 +-
 arch/powerpc/platforms/44x/Kconfig         |   11 +++++++++++
 arch/powerpc/platforms/44x/ppc44x_simple.c |    1 +
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/boot/dts/glacier.dts b/arch/powerpc/boot/dts/glacier.dts
index 24cf0db..f3787a2 100644
--- a/arch/powerpc/boot/dts/glacier.dts
+++ b/arch/powerpc/boot/dts/glacier.dts
@@ -14,7 +14,7 @@
 	#address-cells = <2>;
 	#size-cells = <1>;
 	model = "amcc,glacier";
-	compatible = "amcc,glacier", "amcc,canyonlands";
+	compatible = "amcc,glacier";
 	dcr-parent = <&{/cpus/cpu@0}>;
 
 	aliases {
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index e0bea83..f8ef279 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -92,6 +92,17 @@ config CANYONLANDS
 	help
 	  This option enables support for the AMCC PPC460EX evaluation board.
 
+config GLACIER
+	bool "Glacier"
+	depends on 44x
+	default n
+	select PPC44x_SIMPLE
+	select 460EX # Odd since it uses 460GT but the effects are the same
+	select PCI
+	select PPC4xx_PCI_EXPRESS
+	help
+	  This option enables support for the AMCC PPC460GT evaluation board.
+
 config YOSEMITE
 	bool "Yosemite"
 	depends on 44x
diff --git a/arch/powerpc/platforms/44x/ppc44x_simple.c b/arch/powerpc/platforms/44x/ppc44x_simple.c
index 067cddb..4e78e04 100644
--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
@@ -43,6 +43,7 @@ machine_device_initcall(ppc44x_simple, ppc44x_device_probe);
 static char *board[] __initdata = {
 	"amcc,bamboo",
 	"amcc,cayonlands",
+	"amcc,glacier",
 	"ibm,ebony",
 	"amcc,katmai",
 	"amcc,rainier",
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 9/9] powerpc/44x: Add explicit Yosemite support
  2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
                   ` (7 preceding siblings ...)
  2008-08-19 15:27 ` [PATCH 8/9] powerpc/44x: Add explicit support for AMCC Glacier Josh Boyer
@ 2008-08-19 15:27 ` Josh Boyer
  2008-08-19 18:26 ` [PATCH 0/9] Rework PowerPC 44x board support Stefan Roese
  2008-08-20 16:51 ` Valentine Barshak
  10 siblings, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-19 15:27 UTC (permalink / raw)
  To: linuxppc-dev

Add the Yosemite board to the explicitly supported list for ppc44x_simple
boards and remove the compatible entry for bamboo from the DTS file.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 arch/powerpc/boot/dts/yosemite.dts         |    2 +-
 arch/powerpc/platforms/44x/ppc44x_simple.c |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/boot/dts/yosemite.dts b/arch/powerpc/boot/dts/yosemite.dts
index e39422a..1fa3cb4 100644
--- a/arch/powerpc/boot/dts/yosemite.dts
+++ b/arch/powerpc/boot/dts/yosemite.dts
@@ -15,7 +15,7 @@
 	#address-cells = <2>;
 	#size-cells = <1>;
 	model = "amcc,yosemite";
-	compatible = "amcc,yosemite","amcc,bamboo";
+	compatible = "amcc,yosemite";
 	dcr-parent = <&{/cpus/cpu@0}>;
 
 	aliases {
diff --git a/arch/powerpc/platforms/44x/ppc44x_simple.c b/arch/powerpc/platforms/44x/ppc44x_simple.c
index 4e78e04..43b8db9 100644
--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
@@ -49,6 +49,7 @@ static char *board[] __initdata = {
 	"amcc,rainier",
 	"amcc,sequoia",
 	"amcc,taishan",
+	"amcc,yosemite",
 	NULL
 };
 
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 0/9] Rework PowerPC 44x board support
@ 2008-08-19 15:36 Josh Boyer
  2008-08-19 15:25 ` [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support Josh Boyer
                   ` (10 more replies)
  0 siblings, 11 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-19 15:36 UTC (permalink / raw)
  To: linuxppc-dev

The following patch series reworks the board support code for PowerPC 44x
platforms.  It eliminates a number of redundant <board>.c files and add a
ppc44x_simple.c file that has an explicit list of boards that are supported
by it.  This is the same mechanism that Grant Likely has used for MPC 5200
boards.

It also adds some more explicit support for Glacier and Yosemite boards, as
those boards were using a board level compatible property in their DTS files
that was a bit confusing.

Review would be appreciated.  Tested on Sequoia, and I plan on testing on as
many boards as I can before committing to my tree.

josh

Josh Boyer (9):
  powerpc/44x: Add PowerPC 44x simple platform support
  powerpc/44x: Migrate Bamboo support to ppc44x_simple
  powerpc/44x: Migrate Canyonlands support to ppc44x_simple
  powerpc/44x: Migrate Katmai support to ppc44x_simple
  powerpc/44x: Migrate Rainier support to ppc44x_simple
  powerpc/44x: Migrate Sequoia support to ppc44x_simple
  powerpc/44x: Migrate Taishan support to ppc44x_simple
  powerpc/44x: Add explicit support for AMCC Glacier
  powerpc/44x: Add explicit Yosemite support

 arch/powerpc/boot/dts/glacier.dts          |    2 +-
 arch/powerpc/boot/dts/yosemite.dts         |    2 +-
 arch/powerpc/platforms/44x/Kconfig         |   25 ++++++++
 arch/powerpc/platforms/44x/Makefile        |    8 +--
 arch/powerpc/platforms/44x/bamboo.c        |   62 ---------------------
 arch/powerpc/platforms/44x/canyonlands.c   |   63 ---------------------
 arch/powerpc/platforms/44x/katmai.c        |   62 ---------------------
 arch/powerpc/platforms/44x/ppc44x_simple.c |   83 ++++++++++++++++++++++++++++
 arch/powerpc/platforms/44x/rainier.c       |   62 ---------------------
 arch/powerpc/platforms/44x/sequoia.c       |   63 ---------------------
 arch/powerpc/platforms/44x/taishan.c       |   72 ------------------------
 11 files changed, 111 insertions(+), 393 deletions(-)
 delete mode 100644 arch/powerpc/platforms/44x/bamboo.c
 delete mode 100644 arch/powerpc/platforms/44x/canyonlands.c
 delete mode 100644 arch/powerpc/platforms/44x/katmai.c
 create mode 100644 arch/powerpc/platforms/44x/ppc44x_simple.c
 delete mode 100644 arch/powerpc/platforms/44x/rainier.c
 delete mode 100644 arch/powerpc/platforms/44x/sequoia.c
 delete mode 100644 arch/powerpc/platforms/44x/taishan.c

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/9] Rework PowerPC 44x board support
  2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
                   ` (8 preceding siblings ...)
  2008-08-19 15:27 ` [PATCH 9/9] powerpc/44x: Add explicit Yosemite support Josh Boyer
@ 2008-08-19 18:26 ` Stefan Roese
  2008-08-19 18:45   ` Josh Boyer
  2008-08-20 16:51 ` Valentine Barshak
  10 siblings, 1 reply; 26+ messages in thread
From: Stefan Roese @ 2008-08-19 18:26 UTC (permalink / raw)
  To: linuxppc-dev

On Tuesday 19 August 2008, Josh Boyer wrote:
> The following patch series reworks the board support code for PowerPC 44x
> platforms.  It eliminates a number of redundant <board>.c files and add a
> ppc44x_simple.c file that has an explicit list of boards that are supported
> by it.  This is the same mechanism that Grant Likely has used for MPC 5200
> boards.
>
> It also adds some more explicit support for Glacier and Yosemite boards, as
> those boards were using a board level compatible property in their DTS
> files that was a bit confusing.
>
> Review would be appreciated.  Tested on Sequoia, and I plan on testing on
> as many boards as I can before committing to my tree.

Looks great at first glance. I'll try to do some testing here too in the next 
few days.

Thanks.

Best regards,
Stefan

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/9] Rework PowerPC 44x board support
  2008-08-19 18:26 ` [PATCH 0/9] Rework PowerPC 44x board support Stefan Roese
@ 2008-08-19 18:45   ` Josh Boyer
  2008-08-20 16:54     ` prodyut hazarika
  0 siblings, 1 reply; 26+ messages in thread
From: Josh Boyer @ 2008-08-19 18:45 UTC (permalink / raw)
  To: Stefan Roese; +Cc: linuxppc-dev

On Tue, 19 Aug 2008 20:26:12 +0200
Stefan Roese <sr@denx.de> wrote:

> On Tuesday 19 August 2008, Josh Boyer wrote:
> > The following patch series reworks the board support code for PowerPC 44x
> > platforms.  It eliminates a number of redundant <board>.c files and add a
> > ppc44x_simple.c file that has an explicit list of boards that are supported
> > by it.  This is the same mechanism that Grant Likely has used for MPC 5200
> > boards.
> >
> > It also adds some more explicit support for Glacier and Yosemite boards, as
> > those boards were using a board level compatible property in their DTS
> > files that was a bit confusing.
> >
> > Review would be appreciated.  Tested on Sequoia, and I plan on testing on
> > as many boards as I can before committing to my tree.
> 
> Looks great at first glance. I'll try to do some testing here too in the next 
> few days.

That would be much appreciated.  I have a number of the effected
boards, but I don't have them all so any testing you can do would be
awesome.

josh

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support
  2008-08-19 15:25 ` [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support Josh Boyer
@ 2008-08-20 13:33   ` Arnd Bergmann
  2008-08-20 14:03     ` Josh Boyer
  2008-08-20 14:15     ` Grant Likely
  0 siblings, 2 replies; 26+ messages in thread
From: Arnd Bergmann @ 2008-08-20 13:33 UTC (permalink / raw)
  To: linuxppc-dev

On Tuesday 19 August 2008, Josh Boyer wrote:
> This adds a common board file for almost all of the "simple" PowerPC 44x
> boards that exist today.  This is intended to be a single place to add
> support for boards that do not differ in platform support from most of the
> evaluation boards that are used as reference platforms.  Boards that have
> specific requirements or custom hardware setup should still have their own
> board.c file.

The code looks correct, but since this is going to be example code
that may get copied into other platforms, I would take extra care
for coding style:

> +#include <linux/init.h>
> +#include <linux/of_platform.h>
> +
> +#include <asm/machdep.h>
> +#include <asm/prom.h>
> +#include <asm/udbg.h>
> +#include <asm/time.h>
> +#include <asm/uic.h>
> +#include <asm/pci-bridge.h>
> +#include <asm/ppc4xx.h>

#include lines should be ordered alphabetically in an ideal world.

> +static char *board[] __initdata = {
> +	"amcc,bamboo",
> +	"amcc,cayonlands",
> +	"ibm,ebony",
> +	"amcc,katmai",
> +	"amcc,rainier",
> +	"amcc,sequoia",
> +	"amcc,taishan",
> +	NULL
> +};

You don't need the NULL termination here, since the array is only
used statically and you can use ARRAY_SIZE().

> +static int __init ppc44x_probe(void)
> +{
> +	unsigned long root = of_get_flat_dt_root();
> +	int i = 0;
> +
> +	while (board[i]) {
> +		if (of_flat_dt_is_compatible(root, board[i]))
> +			break;
> +		i++;
> +	}

This looks like a for() loop in disguise, so you can better write
it as

	int i;
	for (i = 0; i < ARRAY_SIZE(board); i++) {
		if (of_flat_dt_is_compatible(root, board[i])) {
			ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
			return 1;
		}
	}
	return 0;


	Arnd <><

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support
  2008-08-20 13:33   ` Arnd Bergmann
@ 2008-08-20 14:03     ` Josh Boyer
  2008-08-20 14:15     ` Grant Likely
  1 sibling, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-20 14:03 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev

On Wed, 20 Aug 2008 15:33:21 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> On Tuesday 19 August 2008, Josh Boyer wrote:
> > This adds a common board file for almost all of the "simple" PowerPC 44x
> > boards that exist today.  This is intended to be a single place to add
> > support for boards that do not differ in platform support from most of the
> > evaluation boards that are used as reference platforms.  Boards that have
> > specific requirements or custom hardware setup should still have their own
> > board.c file.
> 
> The code looks correct, but since this is going to be example code
> that may get copied into other platforms, I would take extra care
> for coding style:

Fair enough.  Your comments all make sense to me.  I'll fixup things
and resend this one.

josh

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support
  2008-08-20 13:33   ` Arnd Bergmann
  2008-08-20 14:03     ` Josh Boyer
@ 2008-08-20 14:15     ` Grant Likely
  2008-08-20 14:45       ` Josh Boyer
  1 sibling, 1 reply; 26+ messages in thread
From: Grant Likely @ 2008-08-20 14:15 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev

On Wed, Aug 20, 2008 at 7:33 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 19 August 2008, Josh Boyer wrote:
>> This adds a common board file for almost all of the "simple" PowerPC 44x
>> boards that exist today.  This is intended to be a single place to add
>> support for boards that do not differ in platform support from most of the
>> evaluation boards that are used as reference platforms.  Boards that have
>> specific requirements or custom hardware setup should still have their own
>> board.c file.
>
> The code looks correct, but since this is going to be example code
> that may get copied into other platforms, I would take extra care
> for coding style:

I second Arnd's comments.  Otherwise, this looks pretty good to me.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support
  2008-08-20 14:15     ` Grant Likely
@ 2008-08-20 14:45       ` Josh Boyer
  2008-08-20 15:19         ` Josh Boyer
  2008-08-20 16:33         ` Roland Dreier
  0 siblings, 2 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-20 14:45 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Arnd Bergmann

On Wed, 2008-08-20 at 08:15 -0600, Grant Likely wrote:
> On Wed, Aug 20, 2008 at 7:33 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Tuesday 19 August 2008, Josh Boyer wrote:
> >> This adds a common board file for almost all of the "simple" PowerPC 44x
> >> boards that exist today.  This is intended to be a single place to add
> >> support for boards that do not differ in platform support from most of the
> >> evaluation boards that are used as reference platforms.  Boards that have
> >> specific requirements or custom hardware setup should still have their own
> >> board.c file.
> >
> > The code looks correct, but since this is going to be example code
> > that may get copied into other platforms, I would take extra care
> > for coding style:
> 
> I second Arnd's comments.  Otherwise, this looks pretty good to me.

You should fix 52xx with the same for loop change then, since I
blatantly most of this file from you ;)

josh

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support
  2008-08-20 14:45       ` Josh Boyer
@ 2008-08-20 15:19         ` Josh Boyer
  2008-08-20 16:33         ` Roland Dreier
  1 sibling, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-20 15:19 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Arnd Bergmann

On Wed, 20 Aug 2008 10:45:47 -0400
Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:

> On Wed, 2008-08-20 at 08:15 -0600, Grant Likely wrote:
> > On Wed, Aug 20, 2008 at 7:33 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > > On Tuesday 19 August 2008, Josh Boyer wrote:
> > >> This adds a common board file for almost all of the "simple" PowerPC 44x
> > >> boards that exist today.  This is intended to be a single place to add
> > >> support for boards that do not differ in platform support from most of the
> > >> evaluation boards that are used as reference platforms.  Boards that have
> > >> specific requirements or custom hardware setup should still have their own
> > >> board.c file.
> > >
> > > The code looks correct, but since this is going to be example code
> > > that may get copied into other platforms, I would take extra care
> > > for coding style:
> > 
> > I second Arnd's comments.  Otherwise, this looks pretty good to me.
> 
> You should fix 52xx with the same for loop change then, since I
> blatantly most of this file from you ;)
           ^ stole

/me sighs.

josh

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support
  2008-08-20 14:45       ` Josh Boyer
  2008-08-20 15:19         ` Josh Boyer
@ 2008-08-20 16:33         ` Roland Dreier
  2008-08-20 17:11           ` Josh Boyer
  1 sibling, 1 reply; 26+ messages in thread
From: Roland Dreier @ 2008-08-20 16:33 UTC (permalink / raw)
  To: jwboyer; +Cc: linuxppc-dev, Arnd Bergmann

 > You should fix 52xx with the same for loop change then, since I
 > blatantly most of this file from you ;)

Heh, then factor out mpc5200_simple_probe() into a helper and use it
instead of copying it as ppc44x_probe?  ;)

If you stick to the NULL-terminated array version, then it becomes easy
to convert some other platform probing code to use your new code too, eg
tqm85xx_probe() could use an array too.

 - R.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/9] Rework PowerPC 44x board support
  2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
                   ` (9 preceding siblings ...)
  2008-08-19 18:26 ` [PATCH 0/9] Rework PowerPC 44x board support Stefan Roese
@ 2008-08-20 16:51 ` Valentine Barshak
  2008-08-20 17:08   ` Josh Boyer
  10 siblings, 1 reply; 26+ messages in thread
From: Valentine Barshak @ 2008-08-20 16:51 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

Josh Boyer wrote:
> The following patch series reworks the board support code for PowerPC 44x
> platforms.  It eliminates a number of redundant <board>.c files and add a
> ppc44x_simple.c file that has an explicit list of boards that are supported
> by it.  This is the same mechanism that Grant Likely has used for MPC 5200
> boards.
> 
> It also adds some more explicit support for Glacier and Yosemite boards, as
> those boards were using a board level compatible property in their DTS files
> that was a bit confusing.
> 
> Review would be appreciated.  Tested on Sequoia, and I plan on testing on as
> many boards as I can before committing to my tree.
> 
> josh

Sorry if I miss anything, but
what happens if I build an uImage just for Rainier (not enabling other 
platforms in the kernel config) and then start it on Canyonlands for 
example?
They both use PowerPC_44x_simple stuff and looks like now we claim that 
all these "simple" boards are compatible. So, board check always passes, 
although Canyonlands support is actually disabled (CONFIG_460EX = n; 
CONFIG_PPC4xx_PCI_EXPRESS = n). It's not critical, but I just thought we 
might also remove the platform-specific options from 
arch/powerpc/platforms/44x/Kconfig for these boards at all. Just enable 
all board-specific stuff under "config PPC44x_SIMPLE".
Otherwise we probably should have a configurable char *board[] array.

Thanks,
Valentine.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/9] Rework PowerPC 44x board support
  2008-08-19 18:45   ` Josh Boyer
@ 2008-08-20 16:54     ` prodyut hazarika
  2008-08-20 17:09       ` Josh Boyer
  0 siblings, 1 reply; 26+ messages in thread
From: prodyut hazarika @ 2008-08-20 16:54 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, Stefan Roese

Hi Josh,

>> >
>> > Review would be appreciated.  Tested on Sequoia, and I plan on testing on
>> > as many boards as I can before committing to my tree.
>>

The changes looks great.
>
> That would be much appreciated.  I have a number of the effected
> boards, but I don't have them all so any testing you can do would be
> awesome.

I tried pulling up the latest code from your git tree. Seems it is not
yet put in there.
Do I have to manually apply all the patches to my git tree. I was
planning to test the changes on Canyonlands, glacier and Kilauea
boards here.

Thanks,
Prodyut Hazarika

===============
Staff S/W Engineer
AMCC
===============

> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/9] Rework PowerPC 44x board support
  2008-08-20 16:51 ` Valentine Barshak
@ 2008-08-20 17:08   ` Josh Boyer
  0 siblings, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-20 17:08 UTC (permalink / raw)
  To: Valentine Barshak; +Cc: linuxppc-dev

On Wed, 20 Aug 2008 20:51:18 +0400
Valentine Barshak <vbarshak@ru.mvista.com> wrote:

> Josh Boyer wrote:
> > The following patch series reworks the board support code for PowerPC 44x
> > platforms.  It eliminates a number of redundant <board>.c files and add a
> > ppc44x_simple.c file that has an explicit list of boards that are supported
> > by it.  This is the same mechanism that Grant Likely has used for MPC 5200
> > boards.
> > 
> > It also adds some more explicit support for Glacier and Yosemite boards, as
> > those boards were using a board level compatible property in their DTS files
> > that was a bit confusing.
> > 
> > Review would be appreciated.  Tested on Sequoia, and I plan on testing on as
> > many boards as I can before committing to my tree.
> > 
> > josh
> 
> Sorry if I miss anything, but
> what happens if I build an uImage just for Rainier (not enabling other 
> platforms in the kernel config) and then start it on Canyonlands for 
> example?

Why would you do that?  If you want that, use ppc44x_defconfig as it
has all the boards enabled.  Also, if you're talking about the default
make targets in the kernel, that would build a cuImage for Rainier, and
I'd expect that to blow up spectacularly on a Canoynlands because the
device tree would be in no way correct.

> They both use PowerPC_44x_simple stuff and looks like now we claim that 
> all these "simple" boards are compatible. So, board check always passes, 

No, we don't claim they are compatible at all.  We simply claim that
they can all be supported by the ppc44x_simple.c platform file.  The
compatible stuff is done through the device tree, and if you look at
the patch series you'll see that I actually removed all the cross-board
compatible statements from the boards that had more than one in the DTS
file.

> although Canyonlands support is actually disabled (CONFIG_460EX = n; 
> CONFIG_PPC4xx_PCI_EXPRESS = n). It's not critical, but I just thought we 
> might also remove the platform-specific options from 
> arch/powerpc/platforms/44x/Kconfig for these boards at all. Just enable 

I left them in there on purpose.  People want to be able to say "I have
a Rainier board.  I only want a kernel for that."  They're also used
for the wrapper stuff to build the right images.

> all board-specific stuff under "config PPC44x_SIMPLE".
> Otherwise we probably should have a configurable char *board[] array.

We could do that if it's _really_ necessary, but I'm not sure it is.

josh

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/9] Rework PowerPC 44x board support
  2008-08-20 16:54     ` prodyut hazarika
@ 2008-08-20 17:09       ` Josh Boyer
  0 siblings, 0 replies; 26+ messages in thread
From: Josh Boyer @ 2008-08-20 17:09 UTC (permalink / raw)
  To: prodyut hazarika; +Cc: linuxppc-dev, Stefan Roese

On Wed, 20 Aug 2008 09:54:40 -0700
"prodyut hazarika" <prodyuth@gmail.com> wrote:

> Hi Josh,
> 
> >> >
> >> > Review would be appreciated.  Tested on Sequoia, and I plan on testing on
> >> > as many boards as I can before committing to my tree.
> >>
> 
> The changes looks great.
> >
> > That would be much appreciated.  I have a number of the effected
> > boards, but I don't have them all so any testing you can do would be
> > awesome.
> 
> I tried pulling up the latest code from your git tree. Seems it is not
> yet put in there.

Right.  I tend to not commit patches that even I send out until they've
at least had some review.

> Do I have to manually apply all the patches to my git tree. I was
> planning to test the changes on Canyonlands, glacier and Kilauea
> boards here.

For now, yes.  In a day or so I'll probably fix the small comments I've
gotten and then commit the series to my next branch.

josh

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support
  2008-08-20 16:33         ` Roland Dreier
@ 2008-08-20 17:11           ` Josh Boyer
  2008-08-20 17:19             ` Roland Dreier
  0 siblings, 1 reply; 26+ messages in thread
From: Josh Boyer @ 2008-08-20 17:11 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linuxppc-dev, Bergmann, Arnd

On Wed, 20 Aug 2008 09:33:06 -0700
Roland Dreier <rdreier@cisco.com> wrote:

>  > You should fix 52xx with the same for loop change then, since I
>  > blatantly most of this file from you ;)
> 
> Heh, then factor out mpc5200_simple_probe() into a helper and use it
> instead of copying it as ppc44x_probe?  ;)
> 
> If you stick to the NULL-terminated array version, then it becomes easy
> to convert some other platform probing code to use your new code too, eg
> tqm85xx_probe() could use an array too.

Except that logically doesn't make much sense.  Why would you have a
list of mpc52xx and 44x boards together?  They require completely
different kernels because the MMU and drive set is entirely different.

Or am I totally missing what you are saying?

josh

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support
  2008-08-20 17:11           ` Josh Boyer
@ 2008-08-20 17:19             ` Roland Dreier
  2008-08-20 17:35               ` Josh Boyer
  0 siblings, 1 reply; 26+ messages in thread
From: Roland Dreier @ 2008-08-20 17:19 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, Arnd, Bergmann

 > Except that logically doesn't make much sense.  Why would you have a
 > list of mpc52xx and 44x boards together?  They require completely
 > different kernels because the MMU and drive set is entirely different.
 > 
 > Or am I totally missing what you are saying?

Yeah, I wasn't clear -- I meant to add a new helper like
of_flat_dt_is_compatible_list() (not sure of the name) that takes a node
and a NULL-terminated array of strings, and then mpc5200_simple_probe()
can become a one-liner, along with mpc5121_generic_probe(),
tqm85xx_probe(), ppc44x_probe(), etc.

 - R.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support
  2008-08-20 17:19             ` Roland Dreier
@ 2008-08-20 17:35               ` Josh Boyer
  2008-08-20 21:15                 ` Roland Dreier
  0 siblings, 1 reply; 26+ messages in thread
From: Josh Boyer @ 2008-08-20 17:35 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linuxppc-dev, Arnd, Bergmann

On Wed, 20 Aug 2008 10:19:02 -0700
Roland Dreier <rdreier@cisco.com> wrote:

>  > Except that logically doesn't make much sense.  Why would you have a
>  > list of mpc52xx and 44x boards together?  They require completely
>  > different kernels because the MMU and drive set is entirely different.
>  > 
>  > Or am I totally missing what you are saying?
> 
> Yeah, I wasn't clear -- I meant to add a new helper like
> of_flat_dt_is_compatible_list() (not sure of the name) that takes a node
> and a NULL-terminated array of strings, and then mpc5200_simple_probe()
> can become a one-liner, along with mpc5121_generic_probe(),
> tqm85xx_probe(), ppc44x_probe(), etc.

Ah, I see.

I worry about doing that though.  I don't want to give people the
impression that these boards are "of" compatible.  I want it to be more
"this file supports these explicit platforms and makes no claim on
compatibility between them".

josh

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support
  2008-08-20 17:35               ` Josh Boyer
@ 2008-08-20 21:15                 ` Roland Dreier
  0 siblings, 0 replies; 26+ messages in thread
From: Roland Dreier @ 2008-08-20 21:15 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, Arnd, Bergmann

 > > Yeah, I wasn't clear -- I meant to add a new helper like
 > > of_flat_dt_is_compatible_list() (not sure of the name) that takes a node
 > > and a NULL-terminated array of strings, and then mpc5200_simple_probe()
 > > can become a one-liner, along with mpc5121_generic_probe(),
 > > tqm85xx_probe(), ppc44x_probe(), etc.

 > I worry about doing that though.  I don't want to give people the
 > impression that these boards are "of" compatible.  I want it to be more
 > "this file supports these explicit platforms and makes no claim on
 > compatibility between them".

It's no big deal really -- just my knee-jerk reaction to seeing a
comment like "this should also be fixed in some other place because I
copied the code from there."  My reaction to that is always, "why not
use one common copy of the code then?"

You could call it something like of_flat_dt_match_list() if that makes
more sense to you.  Or just copy the for loop around, it's not much code.

 - R.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2008-08-20 21:15 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-19 15:36 [PATCH 0/9] Rework PowerPC 44x board support Josh Boyer
2008-08-19 15:25 ` [PATCH 1/9] powerpc/44x: Add PowerPC 44x simple platform support Josh Boyer
2008-08-20 13:33   ` Arnd Bergmann
2008-08-20 14:03     ` Josh Boyer
2008-08-20 14:15     ` Grant Likely
2008-08-20 14:45       ` Josh Boyer
2008-08-20 15:19         ` Josh Boyer
2008-08-20 16:33         ` Roland Dreier
2008-08-20 17:11           ` Josh Boyer
2008-08-20 17:19             ` Roland Dreier
2008-08-20 17:35               ` Josh Boyer
2008-08-20 21:15                 ` Roland Dreier
2008-08-19 15:26 ` [PATCH 2/9] powerpc/44x: Migrate Bamboo support to ppc44x_simple Josh Boyer
2008-08-19 15:26 ` [PATCH 3/9] powerpc/44x: Migrate Canyonlands " Josh Boyer
2008-08-19 15:26 ` [PATCH 4/9] powerpc/44x: Migrate Katmai " Josh Boyer
2008-08-19 15:26 ` [PATCH 5/9] powerpc/44x: Migrate Rainier " Josh Boyer
2008-08-19 15:26 ` [PATCH 6/9] powerpc/44x: Migrate Sequoia " Josh Boyer
2008-08-19 15:26 ` [PATCH 7/9] powerpc/44x: Migrate Taishan " Josh Boyer
2008-08-19 15:27 ` [PATCH 8/9] powerpc/44x: Add explicit support for AMCC Glacier Josh Boyer
2008-08-19 15:27 ` [PATCH 9/9] powerpc/44x: Add explicit Yosemite support Josh Boyer
2008-08-19 18:26 ` [PATCH 0/9] Rework PowerPC 44x board support Stefan Roese
2008-08-19 18:45   ` Josh Boyer
2008-08-20 16:54     ` prodyut hazarika
2008-08-20 17:09       ` Josh Boyer
2008-08-20 16:51 ` Valentine Barshak
2008-08-20 17:08   ` Josh Boyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).