diff options
author | Li Yang <leoli@freescale.com> | 2007-10-19 07:38:45 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-12-11 14:57:18 -0500 |
commit | 833e31e7368335b40be344f73b67fe79c61eb63d (patch) | |
tree | 69078da26dda85e3b0b609b1fa7dab930d45b5d9 | |
parent | f03ca957faa4d51f3a9c52c1ad5ea61a0978c637 (diff) |
[POWERPC] 83xx: Add platform support for MPC837x MDS board
The MPC837x MDS is a new member of Freescale MDS reference system.
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/83xx/Kconfig | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc837x_mds.c | 104 |
3 files changed, 116 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/83xx/Kconfig b/arch/powerpc/platforms/83xx/Kconfig index ec305f18abd8..2430ac840493 100644 --- a/arch/powerpc/platforms/83xx/Kconfig +++ b/arch/powerpc/platforms/83xx/Kconfig | |||
@@ -50,6 +50,11 @@ config MPC836x_MDS | |||
50 | help | 50 | help |
51 | This option enables support for the MPC836x MDS Processor Board. | 51 | This option enables support for the MPC836x MDS Processor Board. |
52 | 52 | ||
53 | config MPC837x_MDS | ||
54 | bool "Freescale MPC837x MDS" | ||
55 | select DEFAULT_UIMAGE | ||
56 | help | ||
57 | This option enables support for the MPC837x MDS Processor Board. | ||
53 | endchoice | 58 | endchoice |
54 | 59 | ||
55 | config PPC_MPC831x | 60 | config PPC_MPC831x |
@@ -75,3 +80,9 @@ config PPC_MPC836x | |||
75 | select PPC_UDBG_16550 | 80 | select PPC_UDBG_16550 |
76 | select PPC_INDIRECT_PCI | 81 | select PPC_INDIRECT_PCI |
77 | default y if MPC836x_MDS | 82 | default y if MPC836x_MDS |
83 | |||
84 | config PPC_MPC837x | ||
85 | bool | ||
86 | select PPC_UDBG_16550 | ||
87 | select PPC_INDIRECT_PCI | ||
88 | default y if MPC837x_MDS | ||
diff --git a/arch/powerpc/platforms/83xx/Makefile b/arch/powerpc/platforms/83xx/Makefile index 5a98f885779f..df4662999a95 100644 --- a/arch/powerpc/platforms/83xx/Makefile +++ b/arch/powerpc/platforms/83xx/Makefile | |||
@@ -9,3 +9,4 @@ obj-$(CONFIG_MPC834x_MDS) += mpc834x_mds.o | |||
9 | obj-$(CONFIG_MPC834x_ITX) += mpc834x_itx.o | 9 | obj-$(CONFIG_MPC834x_ITX) += mpc834x_itx.o |
10 | obj-$(CONFIG_MPC836x_MDS) += mpc836x_mds.o | 10 | 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 | ||
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c new file mode 100644 index 000000000000..166c1116b1ac --- /dev/null +++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * arch/powerpc/platforms/83xx/mpc837x_mds.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved. | ||
5 | * | ||
6 | * MPC837x MDS 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.h> | ||
16 | #include <linux/of_platform.h> | ||
17 | |||
18 | #include <asm/time.h> | ||
19 | #include <asm/ipic.h> | ||
20 | #include <asm/udbg.h> | ||
21 | #include <asm/prom.h> | ||
22 | |||
23 | #include "mpc83xx.h" | ||
24 | |||
25 | #ifndef CONFIG_PCI | ||
26 | unsigned long isa_io_base = 0; | ||
27 | unsigned long isa_mem_base = 0; | ||
28 | #endif | ||
29 | |||
30 | /* ************************************************************************ | ||
31 | * | ||
32 | * Setup the architecture | ||
33 | * | ||
34 | */ | ||
35 | static void __init mpc837x_mds_setup_arch(void) | ||
36 | { | ||
37 | #ifdef CONFIG_PCI | ||
38 | struct device_node *np; | ||
39 | #endif | ||
40 | |||
41 | if (ppc_md.progress) | ||
42 | ppc_md.progress("mpc837x_mds_setup_arch()", 0); | ||
43 | |||
44 | #ifdef CONFIG_PCI | ||
45 | for_each_compatible_node(np, "pci", "fsl,mpc8349-pci") | ||
46 | mpc83xx_add_bridge(np); | ||
47 | #endif | ||
48 | } | ||
49 | |||
50 | static struct of_device_id mpc837x_ids[] = { | ||
51 | { .type = "soc", }, | ||
52 | { .compatible = "soc", }, | ||
53 | {}, | ||
54 | }; | ||
55 | |||
56 | static int __init mpc837x_declare_of_platform_devices(void) | ||
57 | { | ||
58 | if (!machine_is(mpc837x_mds)) | ||
59 | return 0; | ||
60 | |||
61 | /* Publish of_device */ | ||
62 | of_platform_bus_probe(NULL, mpc837x_ids, NULL); | ||
63 | |||
64 | return 0; | ||
65 | } | ||
66 | device_initcall(mpc837x_declare_of_platform_devices); | ||
67 | |||
68 | static void __init mpc837x_mds_init_IRQ(void) | ||
69 | { | ||
70 | struct device_node *np; | ||
71 | |||
72 | np = of_find_compatible_node(NULL, NULL, "fsl,ipic"); | ||
73 | if (!np) | ||
74 | return; | ||
75 | |||
76 | ipic_init(np, 0); | ||
77 | |||
78 | /* Initialize the default interrupt mapping priorities, | ||
79 | * in case the boot rom changed something on us. | ||
80 | */ | ||
81 | ipic_set_default_priority(); | ||
82 | } | ||
83 | |||
84 | /* | ||
85 | * Called very early, MMU is off, device-tree isn't unflattened | ||
86 | */ | ||
87 | static int __init mpc837x_mds_probe(void) | ||
88 | { | ||
89 | unsigned long root = of_get_flat_dt_root(); | ||
90 | |||
91 | return of_flat_dt_is_compatible(root, "fsl,mpc837xmds"); | ||
92 | } | ||
93 | |||
94 | define_machine(mpc837x_mds) { | ||
95 | .name = "MPC837x MDS", | ||
96 | .probe = mpc837x_mds_probe, | ||
97 | .setup_arch = mpc837x_mds_setup_arch, | ||
98 | .init_IRQ = mpc837x_mds_init_IRQ, | ||
99 | .get_irq = ipic_get_irq, | ||
100 | .restart = mpc83xx_restart, | ||
101 | .time_init = mpc83xx_time_init, | ||
102 | .calibrate_decr = generic_calibrate_decr, | ||
103 | .progress = udbg_progress, | ||
104 | }; | ||