diff options
author | Kim Phillips <kim.phillips@freescale.com> | 2008-01-24 21:47:11 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-01-28 09:33:05 -0500 |
commit | 38f66f90b2f89b3280ab505bd410e199fc461ed6 (patch) | |
tree | 417d9aaf2c2fbd00af3ca71581325e2969e82e7f | |
parent | 71d6fc1d57ce60ecdbee2ad9a5d535959af7a3ce (diff) |
[POWERPC] 83xx: add MPC837x RDB platform support
primarily based on mpc837x mds code.
Signed-off-by: Joe D'Abbraccio <ljd015@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/83xx/Kconfig | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc837x_rdb.c | 99 |
3 files changed, 107 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/83xx/Kconfig b/arch/powerpc/platforms/83xx/Kconfig index 924408cc5a81..ba28882a3914 100644 --- a/arch/powerpc/platforms/83xx/Kconfig +++ b/arch/powerpc/platforms/83xx/Kconfig | |||
@@ -56,6 +56,12 @@ config MPC837x_MDS | |||
56 | help | 56 | help |
57 | This option enables support for the MPC837x MDS Processor Board. | 57 | This option enables support for the MPC837x MDS Processor Board. |
58 | 58 | ||
59 | config MPC837x_RDB | ||
60 | bool "Freescale MPC837x RDB" | ||
61 | select DEFAULT_UIMAGE | ||
62 | help | ||
63 | This option enables support for the MPC837x RDB Board. | ||
64 | |||
59 | config SBC834x | 65 | config SBC834x |
60 | bool "Wind River SBC834x" | 66 | bool "Wind River SBC834x" |
61 | select DEFAULT_UIMAGE | 67 | select DEFAULT_UIMAGE |
@@ -92,4 +98,4 @@ config PPC_MPC837x | |||
92 | bool | 98 | bool |
93 | select PPC_UDBG_16550 | 99 | select PPC_UDBG_16550 |
94 | select PPC_INDIRECT_PCI | 100 | select PPC_INDIRECT_PCI |
95 | default y if MPC837x_MDS | 101 | default y if MPC837x_MDS || MPC837x_RDB |
diff --git a/arch/powerpc/platforms/83xx/Makefile b/arch/powerpc/platforms/83xx/Makefile index 2d3cbab5c50b..7e6dd3e259d8 100644 --- a/arch/powerpc/platforms/83xx/Makefile +++ b/arch/powerpc/platforms/83xx/Makefile | |||
@@ -11,3 +11,4 @@ obj-$(CONFIG_MPC836x_MDS) += mpc836x_mds.o | |||
11 | obj-$(CONFIG_MPC832x_MDS) += mpc832x_mds.o | 11 | obj-$(CONFIG_MPC832x_MDS) += mpc832x_mds.o |
12 | obj-$(CONFIG_MPC837x_MDS) += mpc837x_mds.o | 12 | obj-$(CONFIG_MPC837x_MDS) += mpc837x_mds.o |
13 | obj-$(CONFIG_SBC834x) += sbc834x.o | 13 | obj-$(CONFIG_SBC834x) += sbc834x.o |
14 | obj-$(CONFIG_MPC837x_RDB) += mpc837x_rdb.o | ||
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c new file mode 100644 index 000000000000..2293ae51383d --- /dev/null +++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c | |||
@@ -0,0 +1,99 @@ | |||
1 | /* | ||
2 | * arch/powerpc/platforms/83xx/mpc837x_rdb.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Freescale Semicondutor, Inc. All rights reserved. | ||
5 | * | ||
6 | * MPC837x RDB board specific routines | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | */ | ||
13 | |||
14 | #include <linux/pci.h> | ||
15 | #include <linux/of_platform.h> | ||
16 | |||
17 | #include <asm/time.h> | ||
18 | #include <asm/ipic.h> | ||
19 | #include <asm/udbg.h> | ||
20 | |||
21 | #include "mpc83xx.h" | ||
22 | |||
23 | extern int mpc837x_usb_cfg(void); | ||
24 | |||
25 | /* ************************************************************************ | ||
26 | * | ||
27 | * Setup the architecture | ||
28 | * | ||
29 | */ | ||
30 | static void __init mpc837x_rdb_setup_arch(void) | ||
31 | { | ||
32 | #ifdef CONFIG_PCI | ||
33 | struct device_node *np; | ||
34 | #endif | ||
35 | |||
36 | if (ppc_md.progress) | ||
37 | ppc_md.progress("mpc837x_rdb_setup_arch()", 0); | ||
38 | |||
39 | #ifdef CONFIG_PCI | ||
40 | for_each_compatible_node(np, "pci", "fsl,mpc8349-pci") | ||
41 | mpc83xx_add_bridge(np); | ||
42 | #endif | ||
43 | mpc837x_usb_cfg(); | ||
44 | } | ||
45 | |||
46 | static struct of_device_id mpc837x_ids[] = { | ||
47 | { .type = "soc", }, | ||
48 | { .compatible = "soc", }, | ||
49 | {}, | ||
50 | }; | ||
51 | |||
52 | static int __init mpc837x_declare_of_platform_devices(void) | ||
53 | { | ||
54 | /* Publish of_device */ | ||
55 | of_platform_bus_probe(NULL, mpc837x_ids, NULL); | ||
56 | |||
57 | return 0; | ||
58 | } | ||
59 | machine_device_initcall(mpc837x_rdb, mpc837x_declare_of_platform_devices); | ||
60 | |||
61 | static void __init mpc837x_rdb_init_IRQ(void) | ||
62 | { | ||
63 | struct device_node *np; | ||
64 | |||
65 | np = of_find_compatible_node(NULL, NULL, "fsl,ipic"); | ||
66 | if (!np) | ||
67 | return; | ||
68 | |||
69 | ipic_init(np, 0); | ||
70 | |||
71 | /* Initialize the default interrupt mapping priorities, | ||
72 | * in case the boot rom changed something on us. | ||
73 | */ | ||
74 | ipic_set_default_priority(); | ||
75 | } | ||
76 | |||
77 | /* | ||
78 | * Called very early, MMU is off, device-tree isn't unflattened | ||
79 | */ | ||
80 | static int __init mpc837x_rdb_probe(void) | ||
81 | { | ||
82 | unsigned long root = of_get_flat_dt_root(); | ||
83 | |||
84 | return of_flat_dt_is_compatible(root, "fsl,mpc8377rdb") || | ||
85 | of_flat_dt_is_compatible(root, "fsl,mpc8378rdb") || | ||
86 | of_flat_dt_is_compatible(root, "fsl,mpc8379rdb"); | ||
87 | } | ||
88 | |||
89 | define_machine(mpc837x_rdb) { | ||
90 | .name = "MPC837x RDB", | ||
91 | .probe = mpc837x_rdb_probe, | ||
92 | .setup_arch = mpc837x_rdb_setup_arch, | ||
93 | .init_IRQ = mpc837x_rdb_init_IRQ, | ||
94 | .get_irq = ipic_get_irq, | ||
95 | .restart = mpc83xx_restart, | ||
96 | .time_init = mpc83xx_time_init, | ||
97 | .calibrate_decr = generic_calibrate_decr, | ||
98 | .progress = udbg_progress, | ||
99 | }; | ||