diff options
author | Jon Loeliger <jdl@freescale.com> | 2007-03-20 12:19:10 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-03-29 20:39:27 -0400 |
commit | d93daf848161043c06b665bbbd4bc22ef0247065 (patch) | |
tree | 4559423a6fba0cac3dcf875239428a4a3320497f | |
parent | 23308c54d559a210019a576c5741cfb762af69d6 (diff) |
[POWERPC] 85xx: Add initial MPC8544 DS platform files.
This patch provides the basic MPC8544 DS platform code and config.
Follow-up patches will add peripherals such as PCI and SATA.
Signed-off-by: Xianghua Xiao <x.xiao@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/boot/dts/mpc8544ds.dts | 136 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/Kconfig | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc8544_ds.c | 144 |
4 files changed, 289 insertions, 1 deletions
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts new file mode 100644 index 000000000000..6b084605bb4b --- /dev/null +++ b/arch/powerpc/boot/dts/mpc8544ds.dts | |||
@@ -0,0 +1,136 @@ | |||
1 | /* | ||
2 | * MPC8544 DS Device Tree Source | ||
3 | * | ||
4 | * Copyright 2007 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 | / { | ||
13 | model = "MPC8544DS"; | ||
14 | compatible = "MPC8544DS", "MPC85xxDS"; | ||
15 | #address-cells = <1>; | ||
16 | #size-cells = <1>; | ||
17 | |||
18 | cpus { | ||
19 | #cpus = <1>; | ||
20 | #address-cells = <1>; | ||
21 | #size-cells = <0>; | ||
22 | |||
23 | PowerPC,8544@0 { | ||
24 | device_type = "cpu"; | ||
25 | reg = <0>; | ||
26 | d-cache-line-size = <20>; // 32 bytes | ||
27 | i-cache-line-size = <20>; // 32 bytes | ||
28 | d-cache-size = <8000>; // L1, 32K | ||
29 | i-cache-size = <8000>; // L1, 32K | ||
30 | timebase-frequency = <0>; | ||
31 | bus-frequency = <0>; | ||
32 | clock-frequency = <0>; | ||
33 | 32-bit; | ||
34 | }; | ||
35 | }; | ||
36 | |||
37 | memory { | ||
38 | device_type = "memory"; | ||
39 | reg = <00000000 00000000>; // Filled by U-Boot | ||
40 | }; | ||
41 | |||
42 | soc8544@e0000000 { | ||
43 | #address-cells = <1>; | ||
44 | #size-cells = <1>; | ||
45 | #interrupt-cells = <2>; | ||
46 | device_type = "soc"; | ||
47 | ranges = <0 e0000000 00100000>; | ||
48 | reg = <e0000000 00100000>; // CCSRBAR 1M | ||
49 | bus-frequency = <0>; // Filled out by uboot. | ||
50 | |||
51 | i2c@3000 { | ||
52 | device_type = "i2c"; | ||
53 | compatible = "fsl-i2c"; | ||
54 | reg = <3000 100>; | ||
55 | interrupts = <1b 2>; | ||
56 | interrupt-parent = <&mpic>; | ||
57 | dfsrr; | ||
58 | }; | ||
59 | |||
60 | mdio@24520 { | ||
61 | #address-cells = <1>; | ||
62 | #size-cells = <0>; | ||
63 | device_type = "mdio"; | ||
64 | compatible = "gianfar"; | ||
65 | reg = <24520 20>; | ||
66 | phy0: ethernet-phy@0 { | ||
67 | interrupt-parent = <&mpic>; | ||
68 | interrupts = <3a 1>; | ||
69 | reg = <0>; | ||
70 | device_type = "ethernet-phy"; | ||
71 | }; | ||
72 | phy1: ethernet-phy@1 { | ||
73 | interrupt-parent = <&mpic>; | ||
74 | interrupts = <3a 1>; | ||
75 | reg = <1>; | ||
76 | device_type = "ethernet-phy"; | ||
77 | }; | ||
78 | }; | ||
79 | |||
80 | ethernet@24000 { | ||
81 | #address-cells = <1>; | ||
82 | #size-cells = <0>; | ||
83 | device_type = "network"; | ||
84 | model = "TSEC"; | ||
85 | compatible = "gianfar"; | ||
86 | reg = <24000 1000>; | ||
87 | local-mac-address = [ 00 00 00 00 00 00 ]; | ||
88 | interrupts = <d 2 e 2 12 2>; | ||
89 | interrupt-parent = <&mpic>; | ||
90 | phy-handle = <&phy0>; | ||
91 | }; | ||
92 | |||
93 | ethernet@26000 { | ||
94 | #address-cells = <1>; | ||
95 | #size-cells = <0>; | ||
96 | device_type = "network"; | ||
97 | model = "TSEC"; | ||
98 | compatible = "gianfar"; | ||
99 | reg = <26000 1000>; | ||
100 | local-mac-address = [ 00 00 00 00 00 00 ]; | ||
101 | interrupts = <f 2 10 2 11 2>; | ||
102 | interrupt-parent = <&mpic>; | ||
103 | phy-handle = <&phy1>; | ||
104 | }; | ||
105 | |||
106 | serial@4500 { | ||
107 | device_type = "serial"; | ||
108 | compatible = "ns16550"; | ||
109 | reg = <4500 100>; | ||
110 | clock-frequency = <0>; | ||
111 | interrupts = <1a 2>; | ||
112 | interrupt-parent = <&mpic>; | ||
113 | }; | ||
114 | |||
115 | serial@4600 { | ||
116 | device_type = "serial"; | ||
117 | compatible = "ns16550"; | ||
118 | reg = <4600 100>; | ||
119 | clock-frequency = <0>; | ||
120 | interrupts = <1a 2>; | ||
121 | interrupt-parent = <&mpic>; | ||
122 | }; | ||
123 | |||
124 | mpic: pic@40000 { | ||
125 | clock-frequency = <0>; | ||
126 | interrupt-controller; | ||
127 | #address-cells = <0>; | ||
128 | #interrupt-cells = <2>; | ||
129 | reg = <40000 40000>; | ||
130 | built-in; | ||
131 | compatible = "chrp,open-pic"; | ||
132 | device_type = "open-pic"; | ||
133 | big-endian; | ||
134 | }; | ||
135 | }; | ||
136 | }; | ||
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig index eb661ccf2dab..124e2c595972 100644 --- a/arch/powerpc/platforms/85xx/Kconfig +++ b/arch/powerpc/platforms/85xx/Kconfig | |||
@@ -30,6 +30,12 @@ config MPC85xx_MDS | |||
30 | help | 30 | help |
31 | This option enables support for the MPC85xx MDS board | 31 | This option enables support for the MPC85xx MDS board |
32 | 32 | ||
33 | config MPC8544_DS | ||
34 | bool "Freescale MPC8544 DS" | ||
35 | select DEFAULT_UIMAGE | ||
36 | help | ||
37 | This option enables support for the MPC8544 DS board | ||
38 | |||
33 | endchoice | 39 | endchoice |
34 | 40 | ||
35 | config MPC8540 | 41 | config MPC8540 |
@@ -47,7 +53,8 @@ config MPC85xx | |||
47 | bool | 53 | bool |
48 | select PPC_UDBG_16550 | 54 | select PPC_UDBG_16550 |
49 | select PPC_INDIRECT_PCI | 55 | select PPC_INDIRECT_PCI |
50 | default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS || MPC85xx_MDS | 56 | default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \ |
57 | || MPC85xx_MDS || MPC8544_DS | ||
51 | 58 | ||
52 | config PPC_INDIRECT_PCI_BE | 59 | config PPC_INDIRECT_PCI_BE |
53 | bool | 60 | bool |
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile index 4e63917ada9d..4e02cbb14cf7 100644 --- a/arch/powerpc/platforms/85xx/Makefile +++ b/arch/powerpc/platforms/85xx/Makefile | |||
@@ -5,4 +5,5 @@ obj-$(CONFIG_PPC_85xx) += misc.o pci.o | |||
5 | obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o | 5 | obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o |
6 | obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o | 6 | obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o |
7 | obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o | 7 | obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o |
8 | obj-$(CONFIG_MPC8544_DS) += mpc8544_ds.o | ||
8 | obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o | 9 | obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o |
diff --git a/arch/powerpc/platforms/85xx/mpc8544_ds.c b/arch/powerpc/platforms/85xx/mpc8544_ds.c new file mode 100644 index 000000000000..2867f85e6325 --- /dev/null +++ b/arch/powerpc/platforms/85xx/mpc8544_ds.c | |||
@@ -0,0 +1,144 @@ | |||
1 | /* | ||
2 | * MPC8544 DS Board Setup | ||
3 | * | ||
4 | * Author Xianghua Xiao (x.xiao@freescale.com) | ||
5 | * Copyright 2007 Freescale Semiconductor Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #include <linux/stddef.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/kdev_t.h> | ||
16 | #include <linux/delay.h> | ||
17 | #include <linux/seq_file.h> | ||
18 | |||
19 | #include <asm/system.h> | ||
20 | #include <asm/time.h> | ||
21 | #include <asm/machdep.h> | ||
22 | #include <asm/mpc85xx.h> | ||
23 | #include <mm/mmu_decl.h> | ||
24 | #include <asm/prom.h> | ||
25 | #include <asm/udbg.h> | ||
26 | #include <asm/mpic.h> | ||
27 | #include <asm/i8259.h> | ||
28 | |||
29 | #include <sysdev/fsl_soc.h> | ||
30 | #include "mpc85xx.h" | ||
31 | |||
32 | #undef DEBUG | ||
33 | |||
34 | #ifdef DEBUG | ||
35 | #define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) | ||
36 | #else | ||
37 | #define DBG(fmt, args...) | ||
38 | #endif | ||
39 | |||
40 | |||
41 | void __init mpc8544_ds_pic_init(void) | ||
42 | { | ||
43 | struct mpic *mpic; | ||
44 | struct resource r; | ||
45 | struct device_node *np = NULL; | ||
46 | #ifdef CONFIG_PPC_I8259 | ||
47 | struct device_node *cascade_node = NULL; | ||
48 | int cascade_irq; | ||
49 | #endif | ||
50 | |||
51 | np = of_find_node_by_type(np, "open-pic"); | ||
52 | |||
53 | if (np == NULL) { | ||
54 | printk(KERN_ERR "Could not find open-pic node\n"); | ||
55 | return; | ||
56 | } | ||
57 | |||
58 | if (of_address_to_resource(np, 0, &r)) { | ||
59 | printk(KERN_ERR "Failed to map mpic register space\n"); | ||
60 | of_node_put(np); | ||
61 | return; | ||
62 | } | ||
63 | |||
64 | /* Alloc mpic structure and per isu has 16 INT entries. */ | ||
65 | mpic = mpic_alloc(np, r.start, | ||
66 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | ||
67 | 16, 64, " OPENPIC "); | ||
68 | BUG_ON(mpic == NULL); | ||
69 | |||
70 | /* | ||
71 | * 48 Internal Interrupts | ||
72 | */ | ||
73 | mpic_assign_isu(mpic, 0, r.start + 0x10200); | ||
74 | mpic_assign_isu(mpic, 1, r.start + 0x10400); | ||
75 | mpic_assign_isu(mpic, 2, r.start + 0x10600); | ||
76 | |||
77 | /* | ||
78 | * 16 External interrupts | ||
79 | */ | ||
80 | mpic_assign_isu(mpic, 3, r.start + 0x10000); | ||
81 | |||
82 | mpic_init(mpic); | ||
83 | |||
84 | #ifdef CONFIG_PPC_I8259 | ||
85 | /* Initialize the i8259 controller */ | ||
86 | for_each_node_by_type(np, "interrupt-controller") | ||
87 | if (device_is_compatible(np, "chrp,iic")) { | ||
88 | cascade_node = np; | ||
89 | break; | ||
90 | } | ||
91 | |||
92 | if (cascade_node == NULL) { | ||
93 | printk(KERN_DEBUG "Could not find i8259 PIC\n"); | ||
94 | return; | ||
95 | } | ||
96 | |||
97 | cascade_irq = irq_of_parse_and_map(cascade_node, 0); | ||
98 | if (cascade_irq == NO_IRQ) { | ||
99 | printk(KERN_ERR "Failed to map cascade interrupt\n"); | ||
100 | return; | ||
101 | } | ||
102 | |||
103 | DBG("mpc8544ds: cascade mapped to irq %d\n", cascade_irq); | ||
104 | |||
105 | i8259_init(cascade_node, 0); | ||
106 | of_node_put(cascade_node); | ||
107 | |||
108 | set_irq_chained_handler(cascade_irq, mpc8544_8259_cascade); | ||
109 | #endif /* CONFIG_PPC_I8259 */ | ||
110 | } | ||
111 | |||
112 | |||
113 | /* | ||
114 | * Setup the architecture | ||
115 | */ | ||
116 | static void __init mpc8544_ds_setup_arch(void) | ||
117 | { | ||
118 | if (ppc_md.progress) | ||
119 | ppc_md.progress("mpc8544_ds_setup_arch()", 0); | ||
120 | |||
121 | printk("MPC8544 DS board from Freescale Semiconductor\n"); | ||
122 | } | ||
123 | |||
124 | |||
125 | /* | ||
126 | * Called very early, device-tree isn't unflattened | ||
127 | */ | ||
128 | static int __init mpc8544_ds_probe(void) | ||
129 | { | ||
130 | unsigned long root = of_get_flat_dt_root(); | ||
131 | |||
132 | return of_flat_dt_is_compatible(root, "MPC8544DS"); | ||
133 | } | ||
134 | |||
135 | define_machine(mpc8544_ds) { | ||
136 | .name = "MPC8544 DS", | ||
137 | .probe = mpc8544_ds_probe, | ||
138 | .setup_arch = mpc8544_ds_setup_arch, | ||
139 | .init_IRQ = mpc8544_ds_pic_init, | ||
140 | .get_irq = mpic_get_irq, | ||
141 | .restart = mpc85xx_restart, | ||
142 | .calibrate_decr = generic_calibrate_decr, | ||
143 | .progress = udbg_progress, | ||
144 | }; | ||