diff options
author | Josh Boyer <jwboyer@linux.vnet.ibm.com> | 2008-08-19 11:25:15 -0400 |
---|---|---|
committer | Josh Boyer <jwboyer@linux.vnet.ibm.com> | 2008-08-28 09:07:19 -0400 |
commit | 775d5a110b8a0bc9a0ccf3b831a8991b6c1d84dd (patch) | |
tree | 76c7f91cc767bc7da68455f5939e9856ac5348dc | |
parent | e30c98758453d743fab00e45da0eac6fc581958a (diff) |
powerpc/44x: Add PowerPC 44x simple platform support
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>
-rw-r--r-- | arch/powerpc/platforms/44x/Kconfig | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/44x/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/44x/ppc44x_simple.c | 85 |
3 files changed, 93 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig index 249ba01c6674..97c634c8f9da 100644 --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig | |||
@@ -127,6 +127,13 @@ config XILINX_VIRTEX440_GENERIC_BOARD | |||
127 | Most Virtex 5 designs should use this unless it needs to do some | 127 | Most Virtex 5 designs should use this unless it needs to do some |
128 | special configuration at board probe time. | 128 | special configuration at board probe time. |
129 | 129 | ||
130 | config PPC44x_SIMPLE | ||
131 | bool "Simple PowerPC 44x board support" | ||
132 | depends on 44x | ||
133 | default n | ||
134 | help | ||
135 | This option enables the simple PowerPC 44x platform support. | ||
136 | |||
130 | # 44x specific CPU modules, selected based on the board above. | 137 | # 44x specific CPU modules, selected based on the board above. |
131 | config 440EP | 138 | config 440EP |
132 | bool | 139 | bool |
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile index 8d0b1a192d62..73c1df5bc051 100644 --- a/arch/powerpc/platforms/44x/Makefile +++ b/arch/powerpc/platforms/44x/Makefile | |||
@@ -1,4 +1,5 @@ | |||
1 | obj-$(CONFIG_44x) := misc_44x.o idle.o | 1 | obj-$(CONFIG_44x) := misc_44x.o idle.o |
2 | obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o | ||
2 | obj-$(CONFIG_EBONY) += ebony.o | 3 | obj-$(CONFIG_EBONY) += ebony.o |
3 | obj-$(CONFIG_TAISHAN) += taishan.o | 4 | obj-$(CONFIG_TAISHAN) += taishan.o |
4 | obj-$(CONFIG_BAMBOO) += bamboo.o | 5 | 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 000000000000..32b0535f29fe --- /dev/null +++ b/arch/powerpc/platforms/44x/ppc44x_simple.c | |||
@@ -0,0 +1,85 @@ | |||
1 | /* | ||
2 | * Generic PowerPC 44x platform support | ||
3 | * | ||
4 | * Copyright 2008 IBM Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; version 2 of the License. | ||
9 | * | ||
10 | * This implements simple platform support for PowerPC 44x chips. This is | ||
11 | * mostly used for eval boards or other simple and "generic" 44x boards. If | ||
12 | * your board has custom functions or hardware, then you will likely want to | ||
13 | * implement your own board.c file to accommodate it. | ||
14 | */ | ||
15 | |||
16 | #include <asm/machdep.h> | ||
17 | #include <asm/pci-bridge.h> | ||
18 | #include <asm/ppc4xx.h> | ||
19 | #include <asm/prom.h> | ||
20 | #include <asm/time.h> | ||
21 | #include <asm/udbg.h> | ||
22 | #include <asm/uic.h> | ||
23 | |||
24 | #include <linux/init.h> | ||
25 | #include <linux/of_platform.h> | ||
26 | |||
27 | static __initdata struct of_device_id ppc44x_of_bus[] = { | ||
28 | { .compatible = "ibm,plb4", }, | ||
29 | { .compatible = "ibm,opb", }, | ||
30 | { .compatible = "ibm,ebc", }, | ||
31 | { .compatible = "simple-bus", }, | ||
32 | {}, | ||
33 | }; | ||
34 | |||
35 | static int __init ppc44x_device_probe(void) | ||
36 | { | ||
37 | of_platform_bus_probe(NULL, ppc44x_of_bus, NULL); | ||
38 | |||
39 | return 0; | ||
40 | } | ||
41 | machine_device_initcall(ppc44x_simple, ppc44x_device_probe); | ||
42 | |||
43 | /* This is the list of boards that can be supported by this simple | ||
44 | * platform code. This does _not_ mean the boards are compatible, | ||
45 | * as they most certainly are not from a device tree perspective. | ||
46 | * However, their differences are handled by the device tree and the | ||
47 | * drivers and therefore they don't need custom board support files. | ||
48 | * | ||
49 | * Again, if your board needs to do things differently then create a | ||
50 | * board.c file for it rather than adding it to this list. | ||
51 | */ | ||
52 | static char *board[] __initdata = { | ||
53 | "amcc,bamboo", | ||
54 | "amcc,cayonlands", | ||
55 | "ibm,ebony", | ||
56 | "amcc,katmai", | ||
57 | "amcc,rainier", | ||
58 | "amcc,sequoia", | ||
59 | "amcc,taishan" | ||
60 | }; | ||
61 | |||
62 | static int __init ppc44x_probe(void) | ||
63 | { | ||
64 | unsigned long root = of_get_flat_dt_root(); | ||
65 | int i = 0; | ||
66 | |||
67 | for (i = 0; i < ARRAY_SIZE(board); i++) { | ||
68 | if (of_flat_dt_is_compatible(root, board[i])) { | ||
69 | ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC; | ||
70 | return 1; | ||
71 | } | ||
72 | } | ||
73 | |||
74 | return 0; | ||
75 | } | ||
76 | |||
77 | define_machine(ppc44x_simple) { | ||
78 | .name = "PowerPC 44x Platform", | ||
79 | .probe = ppc44x_probe, | ||
80 | .progress = udbg_progress, | ||
81 | .init_IRQ = uic_init_tree, | ||
82 | .get_irq = uic_get_irq, | ||
83 | .restart = ppc4xx_reset_system, | ||
84 | .calibrate_decr = generic_calibrate_decr, | ||
85 | }; | ||