diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 22:04:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 22:04:58 -0400 |
commit | 45158894d4d6704afbb4cefe55e5f6ca279fe12a (patch) | |
tree | d57e745e2d0848d75cd4a46ca04178b16f186b50 /arch/powerpc/platforms/85xx/mpc8536_ds.c | |
parent | 89a93f2f4834f8c126e8d9dd6b368d0b9e21ec3d (diff) | |
parent | 84c3d4aaec3338201b449034beac41635866bddf (diff) |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (249 commits)
powerpc: Fix pte_update for CONFIG_PTE_64BIT and !PTE_ATOMIC_UPDATES
powerpc: Fix a build problem on ppc32 with new DMA_ATTRs
ibm_newemac: Add MII mode support to the EMAC RGMII bridge.
powerpc: Don't spin on sync instruction at boot time
powerpc: Add VSX load/store alignment exception handler
powerpc: fix giveup_vsx to save registers correctly
powerpc: support for latencytop
powerpc: Remove unnecessary condition when sanity-checking WIMG bits
powerpc: Add PPC_FEATURE_PSERIES_PERFMON_COMPAT
powerpc: Add driver for Barrier Synchronization Register
powerpc: mman.h export fixups
powerpc/fsl: update crypto node definition and device tree instances
powerpc/fsl: Refactor device bindings
powerpc/85xx: Minor fixes for 85xxds and 8536ds board.
powerpc: Add 82xx/83xx/86xx to 6xx Multiplatform
powerpc/85xx: publish of device for cds platforms
powerpc/booke: don't reinitialize time base
powerpc/86xx: Refactor pic init
powerpc/CPM: Add i2c pins to dts and board setup
cpm_uart: Support uart_wait_until_sent()
...
Diffstat (limited to 'arch/powerpc/platforms/85xx/mpc8536_ds.c')
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc8536_ds.c | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c new file mode 100644 index 000000000000..6b846aa1ced9 --- /dev/null +++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c | |||
@@ -0,0 +1,125 @@ | |||
1 | /* | ||
2 | * MPC8536 DS Board Setup | ||
3 | * | ||
4 | * Copyright 2008 Freescale Semiconductor, Inc. | ||
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; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/stddef.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/pci.h> | ||
15 | #include <linux/kdev_t.h> | ||
16 | #include <linux/delay.h> | ||
17 | #include <linux/seq_file.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/of_platform.h> | ||
20 | |||
21 | #include <asm/system.h> | ||
22 | #include <asm/time.h> | ||
23 | #include <asm/machdep.h> | ||
24 | #include <asm/pci-bridge.h> | ||
25 | #include <mm/mmu_decl.h> | ||
26 | #include <asm/prom.h> | ||
27 | #include <asm/udbg.h> | ||
28 | #include <asm/mpic.h> | ||
29 | |||
30 | #include <sysdev/fsl_soc.h> | ||
31 | #include <sysdev/fsl_pci.h> | ||
32 | |||
33 | void __init mpc8536_ds_pic_init(void) | ||
34 | { | ||
35 | struct mpic *mpic; | ||
36 | struct resource r; | ||
37 | struct device_node *np; | ||
38 | |||
39 | np = of_find_node_by_type(NULL, "open-pic"); | ||
40 | if (np == NULL) { | ||
41 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
42 | return; | ||
43 | } | ||
44 | |||
45 | if (of_address_to_resource(np, 0, &r)) { | ||
46 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
47 | of_node_put(np); | ||
48 | return; | ||
49 | } | ||
50 | |||
51 | mpic = mpic_alloc(np, r.start, | ||
52 | MPIC_PRIMARY | MPIC_WANTS_RESET | | ||
53 | MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS, | ||
54 | 0, 256, " OpenPIC "); | ||
55 | BUG_ON(mpic == NULL); | ||
56 | of_node_put(np); | ||
57 | |||
58 | mpic_init(mpic); | ||
59 | } | ||
60 | |||
61 | /* | ||
62 | * Setup the architecture | ||
63 | */ | ||
64 | static void __init mpc8536_ds_setup_arch(void) | ||
65 | { | ||
66 | #ifdef CONFIG_PCI | ||
67 | struct device_node *np; | ||
68 | #endif | ||
69 | |||
70 | if (ppc_md.progress) | ||
71 | ppc_md.progress("mpc8536_ds_setup_arch()", 0); | ||
72 | |||
73 | #ifdef CONFIG_PCI | ||
74 | for_each_node_by_type(np, "pci") { | ||
75 | if (of_device_is_compatible(np, "fsl,mpc8540-pci") || | ||
76 | of_device_is_compatible(np, "fsl,mpc8548-pcie")) { | ||
77 | struct resource rsrc; | ||
78 | of_address_to_resource(np, 0, &rsrc); | ||
79 | if ((rsrc.start & 0xfffff) == 0x8000) | ||
80 | fsl_add_bridge(np, 1); | ||
81 | else | ||
82 | fsl_add_bridge(np, 0); | ||
83 | } | ||
84 | } | ||
85 | |||
86 | #endif | ||
87 | |||
88 | printk("MPC8536 DS board from Freescale Semiconductor\n"); | ||
89 | } | ||
90 | |||
91 | static struct of_device_id __initdata mpc8536_ds_ids[] = { | ||
92 | { .type = "soc", }, | ||
93 | { .compatible = "soc", }, | ||
94 | {}, | ||
95 | }; | ||
96 | |||
97 | static int __init mpc8536_ds_publish_devices(void) | ||
98 | { | ||
99 | return of_platform_bus_probe(NULL, mpc8536_ds_ids, NULL); | ||
100 | } | ||
101 | machine_device_initcall(mpc8536_ds, mpc8536_ds_publish_devices); | ||
102 | |||
103 | /* | ||
104 | * Called very early, device-tree isn't unflattened | ||
105 | */ | ||
106 | static int __init mpc8536_ds_probe(void) | ||
107 | { | ||
108 | unsigned long root = of_get_flat_dt_root(); | ||
109 | |||
110 | return of_flat_dt_is_compatible(root, "fsl,mpc8536ds"); | ||
111 | } | ||
112 | |||
113 | define_machine(mpc8536_ds) { | ||
114 | .name = "MPC8536 DS", | ||
115 | .probe = mpc8536_ds_probe, | ||
116 | .setup_arch = mpc8536_ds_setup_arch, | ||
117 | .init_IRQ = mpc8536_ds_pic_init, | ||
118 | #ifdef CONFIG_PCI | ||
119 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | ||
120 | #endif | ||
121 | .get_irq = mpic_get_irq, | ||
122 | .restart = fsl_rstcr_restart, | ||
123 | .calibrate_decr = generic_calibrate_decr, | ||
124 | .progress = udbg_progress, | ||
125 | }; | ||