aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/boot/dts/p1022rdk.dts188
-rw-r--r--arch/powerpc/configs/mpc85xx_defconfig1
-rw-r--r--arch/powerpc/configs/mpc85xx_smp_defconfig1
-rw-r--r--arch/powerpc/platforms/85xx/Kconfig7
-rw-r--r--arch/powerpc/platforms/85xx/Makefile1
-rw-r--r--arch/powerpc/platforms/85xx/p1022_rdk.c195
6 files changed, 393 insertions, 0 deletions
diff --git a/arch/powerpc/boot/dts/p1022rdk.dts b/arch/powerpc/boot/dts/p1022rdk.dts
new file mode 100644
index 00000000000..51d82de223f
--- /dev/null
+++ b/arch/powerpc/boot/dts/p1022rdk.dts
@@ -0,0 +1,188 @@
1/*
2 * P1022 RDK 32-bit Physical Address Map Device Tree Source
3 *
4 * Copyright 2012 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/include/ "fsl/p1022si-pre.dtsi"
36/ {
37 model = "fsl,P1022RDK";
38 compatible = "fsl,P1022RDK";
39
40 memory {
41 device_type = "memory";
42 };
43
44 board_lbc: lbc: localbus@ffe05000 {
45 /* The P1022 RDK does not have any localbus devices */
46 status = "disabled";
47 };
48
49 board_soc: soc: soc@ffe00000 {
50 ranges = <0x0 0x0 0xffe00000 0x100000>;
51
52 i2c@3100 {
53 wm8960:codec@1a {
54 compatible = "wlf,wm8960";
55 reg = <0x1a>;
56 /* MCLK source is a stand-alone oscillator */
57 clock-frequency = <12288000>;
58 };
59 rtc@68 {
60 compatible = "stm,m41t62";
61 reg = <0x68>;
62 };
63 adt7461@4c{
64 compatible = "adi,adt7461";
65 reg = <0x4c>;
66 };
67 zl6100@21{
68 compatible = "isil,zl6100";
69 reg = <0x21>;
70 };
71 zl6100@24{
72 compatible = "isil,zl6100";
73 reg = <0x24>;
74 };
75 zl6100@26{
76 compatible = "isil,zl6100";
77 reg = <0x26>;
78 };
79 zl6100@29{
80 compatible = "isil,zl6100";
81 reg = <0x29>;
82 };
83 };
84
85 spi@7000 {
86 flash@0 {
87 #address-cells = <1>;
88 #size-cells = <1>;
89 compatible = "spansion,m25p80";
90 reg = <0>;
91 spi-max-frequency = <1000000>;
92 partition@0 {
93 label = "full-spi-flash";
94 reg = <0x00000000 0x00100000>;
95 };
96 };
97 };
98
99 ssi@15000 {
100 fsl,mode = "i2s-slave";
101 codec-handle = <&wm8960>;
102 };
103
104 usb@22000 {
105 phy_type = "ulpi";
106 };
107
108 usb@23000 {
109 phy_type = "ulpi";
110 };
111
112 mdio@24000 {
113 phy0: ethernet-phy@0 {
114 interrupts = <3 1 0 0>;
115 reg = <0x1>;
116 };
117 phy1: ethernet-phy@1 {
118 interrupts = <9 1 0 0>;
119 reg = <0x2>;
120 };
121 };
122
123 mdio@25000 {
124 tbi0: tbi-phy@11 {
125 reg = <0x11>;
126 device_type = "tbi-phy";
127 };
128 };
129
130 ethernet@b0000 {
131 phy-handle = <&phy0>;
132 phy-connection-type = "rgmii-id";
133 };
134
135 ethernet@b1000 {
136 phy-handle = <&phy1>;
137 tbi-handle = <&tbi0>;
138 phy-connection-type = "sgmii";
139 };
140 };
141
142 pci0: pcie@ffe09000 {
143 ranges = <0x2000000 0x0 0xe0000000 0 0xa0000000 0x0 0x20000000
144 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
145 reg = <0x0 0xffe09000 0 0x1000>;
146 pcie@0 {
147 ranges = <0x2000000 0x0 0xe0000000
148 0x2000000 0x0 0xe0000000
149 0x0 0x20000000
150
151 0x1000000 0x0 0x0
152 0x1000000 0x0 0x0
153 0x0 0x100000>;
154 };
155 };
156
157 pci1: pcie@ffe0a000 {
158 ranges = <0x2000000 0x0 0xe0000000 0 0xc0000000 0x0 0x20000000
159 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
160 reg = <0 0xffe0a000 0 0x1000>;
161 pcie@0 {
162 ranges = <0x2000000 0x0 0xe0000000
163 0x2000000 0x0 0xe0000000
164 0x0 0x20000000
165
166 0x1000000 0x0 0x0
167 0x1000000 0x0 0x0
168 0x0 0x100000>;
169 };
170 };
171
172 pci2: pcie@ffe0b000 {
173 ranges = <0x2000000 0x0 0xe0000000 0 0x80000000 0x0 0x20000000
174 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
175 reg = <0 0xffe0b000 0 0x1000>;
176 pcie@0 {
177 ranges = <0x2000000 0x0 0xe0000000
178 0x2000000 0x0 0xe0000000
179 0x0 0x20000000
180
181 0x1000000 0x0 0x0
182 0x1000000 0x0 0x0
183 0x0 0x100000>;
184 };
185 };
186};
187
188/include/ "fsl/p1022si-post.dtsi"
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig
index 8b5bda27d24..cf815e847cd 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -30,6 +30,7 @@ CONFIG_MPC85xx_DS=y
30CONFIG_MPC85xx_RDB=y 30CONFIG_MPC85xx_RDB=y
31CONFIG_P1010_RDB=y 31CONFIG_P1010_RDB=y
32CONFIG_P1022_DS=y 32CONFIG_P1022_DS=y
33CONFIG_P1022_RDK=y
33CONFIG_P1023_RDS=y 34CONFIG_P1023_RDS=y
34CONFIG_SOCRATES=y 35CONFIG_SOCRATES=y
35CONFIG_KSI8560=y 36CONFIG_KSI8560=y
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig
index b0974e7e98a..502cd9e027e 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
@@ -32,6 +32,7 @@ CONFIG_MPC85xx_DS=y
32CONFIG_MPC85xx_RDB=y 32CONFIG_MPC85xx_RDB=y
33CONFIG_P1010_RDB=y 33CONFIG_P1010_RDB=y
34CONFIG_P1022_DS=y 34CONFIG_P1022_DS=y
35CONFIG_P1022_RDK=y
35CONFIG_P1023_RDS=y 36CONFIG_P1023_RDS=y
36CONFIG_SOCRATES=y 37CONFIG_SOCRATES=y
37CONFIG_KSI8560=y 38CONFIG_KSI8560=y
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 31f0618ec67..02d02a09942 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -104,6 +104,13 @@ config P1022_DS
104 help 104 help
105 This option enables support for the Freescale P1022DS reference board. 105 This option enables support for the Freescale P1022DS reference board.
106 106
107config P1022_RDK
108 bool "Freescale / iVeia P1022 RDK"
109 select DEFAULT_UIMAGE
110 help
111 This option enables support for the Freescale / iVeia P1022RDK
112 reference board.
113
107config P1023_RDS 114config P1023_RDS
108 bool "Freescale P1023 RDS" 115 bool "Freescale P1023 RDS"
109 select DEFAULT_UIMAGE 116 select DEFAULT_UIMAGE
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index d99268aef55..76f679cb04a 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
15obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o 15obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o
16obj-$(CONFIG_P1010_RDB) += p1010rdb.o 16obj-$(CONFIG_P1010_RDB) += p1010rdb.o
17obj-$(CONFIG_P1022_DS) += p1022_ds.o 17obj-$(CONFIG_P1022_DS) += p1022_ds.o
18obj-$(CONFIG_P1022_RDK) += p1022_rdk.o
18obj-$(CONFIG_P1023_RDS) += p1023_rds.o 19obj-$(CONFIG_P1023_RDS) += p1023_rds.o
19obj-$(CONFIG_P2041_RDB) += p2041_rdb.o corenet_ds.o 20obj-$(CONFIG_P2041_RDB) += p2041_rdb.o corenet_ds.o
20obj-$(CONFIG_P3041_DS) += p3041_ds.o corenet_ds.o 21obj-$(CONFIG_P3041_DS) += p3041_ds.o corenet_ds.o
diff --git a/arch/powerpc/platforms/85xx/p1022_rdk.c b/arch/powerpc/platforms/85xx/p1022_rdk.c
new file mode 100644
index 00000000000..b3cf11b92e7
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/p1022_rdk.c
@@ -0,0 +1,195 @@
1/*
2 * P1022 RDK board specific routines
3 *
4 * Copyright 2012 Freescale Semiconductor, Inc.
5 *
6 * Author: Timur Tabi <timur@freescale.com>
7 *
8 * Based on p1022_ds.c
9 *
10 * This file is licensed under the terms of the GNU General Public License
11 * version 2. This program is licensed "as is" without any warranty of any
12 * kind, whether express or implied.
13 */
14
15#include <linux/pci.h>
16#include <linux/of_platform.h>
17#include <linux/memblock.h>
18#include <asm/div64.h>
19#include <asm/mpic.h>
20#include <asm/swiotlb.h>
21
22#include <sysdev/fsl_soc.h>
23#include <sysdev/fsl_pci.h>
24#include <asm/udbg.h>
25#include <asm/fsl_guts.h>
26#include "smp.h"
27
28#include "mpc85xx.h"
29
30#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
31
32/* DIU Pixel Clock bits of the CLKDVDR Global Utilities register */
33#define CLKDVDR_PXCKEN 0x80000000
34#define CLKDVDR_PXCKINV 0x10000000
35#define CLKDVDR_PXCKDLY 0x06000000
36#define CLKDVDR_PXCLK_MASK 0x00FF0000
37
38/**
39 * p1022rdk_set_monitor_port: switch the output to a different monitor port
40 */
41static void p1022rdk_set_monitor_port(enum fsl_diu_monitor_port port)
42{
43 if (port != FSL_DIU_PORT_DVI) {
44 pr_err("p1022rdk: unsupported monitor port %i\n", port);
45 return;
46 }
47}
48
49/**
50 * p1022rdk_set_pixel_clock: program the DIU's clock
51 *
52 * @pixclock: the wavelength, in picoseconds, of the clock
53 */
54void p1022rdk_set_pixel_clock(unsigned int pixclock)
55{
56 struct device_node *guts_np = NULL;
57 struct ccsr_guts __iomem *guts;
58 unsigned long freq;
59 u64 temp;
60 u32 pxclk;
61
62 /* Map the global utilities registers. */
63 guts_np = of_find_compatible_node(NULL, NULL, "fsl,p1022-guts");
64 if (!guts_np) {
65 pr_err("p1022rdk: missing global utilties device node\n");
66 return;
67 }
68
69 guts = of_iomap(guts_np, 0);
70 of_node_put(guts_np);
71 if (!guts) {
72 pr_err("p1022rdk: could not map global utilties device\n");
73 return;
74 }
75
76 /* Convert pixclock from a wavelength to a frequency */
77 temp = 1000000000000ULL;
78 do_div(temp, pixclock);
79 freq = temp;
80
81 /*
82 * 'pxclk' is the ratio of the platform clock to the pixel clock.
83 * This number is programmed into the CLKDVDR register, and the valid
84 * range of values is 2-255.
85 */
86 pxclk = DIV_ROUND_CLOSEST(fsl_get_sys_freq(), freq);
87 pxclk = clamp_t(u32, pxclk, 2, 255);
88
89 /* Disable the pixel clock, and set it to non-inverted and no delay */
90 clrbits32(&guts->clkdvdr,
91 CLKDVDR_PXCKEN | CLKDVDR_PXCKDLY | CLKDVDR_PXCLK_MASK);
92
93 /* Enable the clock and set the pxclk */
94 setbits32(&guts->clkdvdr, CLKDVDR_PXCKEN | (pxclk << 16));
95
96 iounmap(guts);
97}
98
99/**
100 * p1022rdk_valid_monitor_port: set the monitor port for sysfs
101 */
102enum fsl_diu_monitor_port
103p1022rdk_valid_monitor_port(enum fsl_diu_monitor_port port)
104{
105 return FSL_DIU_PORT_DVI;
106}
107
108#endif
109
110void __init p1022_rdk_pic_init(void)
111{
112 struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
113 MPIC_SINGLE_DEST_CPU,
114 0, 256, " OpenPIC ");
115 BUG_ON(mpic == NULL);
116 mpic_init(mpic);
117}
118
119/*
120 * Setup the architecture
121 */
122static void __init p1022_rdk_setup_arch(void)
123{
124#ifdef CONFIG_PCI
125 struct device_node *np;
126#endif
127 dma_addr_t max = 0xffffffff;
128
129 if (ppc_md.progress)
130 ppc_md.progress("p1022_rdk_setup_arch()", 0);
131
132#ifdef CONFIG_PCI
133 for_each_compatible_node(np, "pci", "fsl,p1022-pcie") {
134 struct resource rsrc;
135 struct pci_controller *hose;
136
137 of_address_to_resource(np, 0, &rsrc);
138
139 if ((rsrc.start & 0xfffff) == 0x8000)
140 fsl_add_bridge(np, 1);
141 else
142 fsl_add_bridge(np, 0);
143
144 hose = pci_find_hose_for_OF_device(np);
145 max = min(max, hose->dma_window_base_cur +
146 hose->dma_window_size);
147 }
148#endif
149
150#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
151 diu_ops.set_monitor_port = p1022rdk_set_monitor_port;
152 diu_ops.set_pixel_clock = p1022rdk_set_pixel_clock;
153 diu_ops.valid_monitor_port = p1022rdk_valid_monitor_port;
154#endif
155
156 mpc85xx_smp_init();
157
158#ifdef CONFIG_SWIOTLB
159 if ((memblock_end_of_DRAM() - 1) > max) {
160 ppc_swiotlb_enable = 1;
161 set_pci_dma_ops(&swiotlb_dma_ops);
162 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
163 }
164#endif
165
166 pr_info("Freescale / iVeia P1022 RDK reference board\n");
167}
168
169machine_device_initcall(p1022_rdk, mpc85xx_common_publish_devices);
170
171machine_arch_initcall(p1022_rdk, swiotlb_setup_bus_notifier);
172
173/*
174 * Called very early, device-tree isn't unflattened
175 */
176static int __init p1022_rdk_probe(void)
177{
178 unsigned long root = of_get_flat_dt_root();
179
180 return of_flat_dt_is_compatible(root, "fsl,p1022rdk");
181}
182
183define_machine(p1022_rdk) {
184 .name = "P1022 RDK",
185 .probe = p1022_rdk_probe,
186 .setup_arch = p1022_rdk_setup_arch,
187 .init_IRQ = p1022_rdk_pic_init,
188#ifdef CONFIG_PCI
189 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
190#endif
191 .get_irq = mpic_get_irq,
192 .restart = fsl_rstcr_restart,
193 .calibrate_decr = generic_calibrate_decr,
194 .progress = udbg_progress,
195};