aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchenhui zhao <chenhui.zhao@freescale.com>2012-03-06 04:06:42 -0500
committerKumar Gala <galak@kernel.crashing.org>2012-03-16 16:58:21 -0400
commit992608ff56b9c2e987f706da94ceca991b7886a4 (patch)
treebba9a79a788a8945a9920f888fcbb724885454be
parent96939e79b0d8571f557bf4d7f0f933282401342b (diff)
powerpc/85xx: mpc8548cds - Add FPGA node to dts
Remove FPGA(CADMUS) macros in code. Move it to dts. Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com> Signed-off-by: Li Yang <leoli@freescale.com> Acked-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r--arch/powerpc/boot/dts/mpc8548cds.dts8
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c50
2 files changed, 41 insertions, 17 deletions
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index 8d4df8e7b696..0683983f1d3b 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -35,7 +35,8 @@
35 lbc: localbus@e0005000 { 35 lbc: localbus@e0005000 {
36 reg = <0 0xe0005000 0 0x1000>; 36 reg = <0 0xe0005000 0 0x1000>;
37 37
38 ranges = <0x0 0x0 0x0 0xff000000 0x01000000>; 38 ranges = <0x0 0x0 0x0 0xff000000 0x01000000
39 0x1 0x0 0x0 0xf8004000 0x00001000>;
39 40
40 nor@0,0 { 41 nor@0,0 {
41 #address-cells = <1>; 42 #address-cells = <1>;
@@ -72,6 +73,11 @@
72 read-only; 73 read-only;
73 }; 74 };
74 }; 75 };
76
77 board-control@1,0 {
78 compatible = "fsl,mpc8548cds-fpga";
79 reg = <0x1 0x0 0x1000>;
80 };
75 }; 81 };
76 82
77 soc: soc8548@e0000000 { 83 soc: soc8548@e0000000 {
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 766b2150e480..ab5f0bf19454 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -48,17 +48,24 @@
48 48
49#include "mpc85xx.h" 49#include "mpc85xx.h"
50 50
51/* CADMUS info */ 51/*
52/* xxx - galak, move into device tree */ 52 * The CDS board contains an FPGA/CPLD called "Cadmus", which collects
53#define CADMUS_BASE (0xf8004000) 53 * various logic and performs system control functions.
54#define CADMUS_SIZE (256) 54 * Here is the FPGA/CPLD register map.
55#define CM_VER (0) 55 */
56#define CM_CSR (1) 56struct cadmus_reg {
57#define CM_RST (2) 57 u8 cm_ver; /* Board version */
58 58 u8 cm_csr; /* General control/status */
59 u8 cm_rst; /* Reset control */
60 u8 cm_hsclk; /* High speed clock */
61 u8 cm_hsxclk; /* High speed clock extended */
62 u8 cm_led; /* LED data */
63 u8 cm_pci; /* PCI control/status */
64 u8 cm_dma; /* DMA control */
65 u8 res[248]; /* Total 256 bytes */
66};
59 67
60static int cds_pci_slot = 2; 68static struct cadmus_reg *cadmus;
61static volatile u8 *cadmus;
62 69
63#ifdef CONFIG_PCI 70#ifdef CONFIG_PCI
64 71
@@ -275,20 +282,30 @@ machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);
275 */ 282 */
276static void __init mpc85xx_cds_setup_arch(void) 283static void __init mpc85xx_cds_setup_arch(void)
277{ 284{
278#ifdef CONFIG_PCI
279 struct device_node *np; 285 struct device_node *np;
280#endif 286 int cds_pci_slot;
281 287
282 if (ppc_md.progress) 288 if (ppc_md.progress)
283 ppc_md.progress("mpc85xx_cds_setup_arch()", 0); 289 ppc_md.progress("mpc85xx_cds_setup_arch()", 0);
284 290
285 cadmus = ioremap(CADMUS_BASE, CADMUS_SIZE); 291 np = of_find_compatible_node(NULL, NULL, "fsl,mpc8548cds-fpga");
286 cds_pci_slot = ((cadmus[CM_CSR] >> 6) & 0x3) + 1; 292 if (!np) {
293 pr_err("Could not find FPGA node.\n");
294 return;
295 }
296
297 cadmus = of_iomap(np, 0);
298 of_node_put(np);
299 if (!cadmus) {
300 pr_err("Fail to map FPGA area.\n");
301 return;
302 }
287 303
288 if (ppc_md.progress) { 304 if (ppc_md.progress) {
289 char buf[40]; 305 char buf[40];
306 cds_pci_slot = ((in_8(&cadmus->cm_csr) >> 6) & 0x3) + 1;
290 snprintf(buf, 40, "CDS Version = 0x%x in slot %d\n", 307 snprintf(buf, 40, "CDS Version = 0x%x in slot %d\n",
291 cadmus[CM_VER], cds_pci_slot); 308 in_8(&cadmus->cm_ver), cds_pci_slot);
292 ppc_md.progress(buf, 0); 309 ppc_md.progress(buf, 0);
293 } 310 }
294 311
@@ -318,7 +335,8 @@ static void mpc85xx_cds_show_cpuinfo(struct seq_file *m)
318 svid = mfspr(SPRN_SVR); 335 svid = mfspr(SPRN_SVR);
319 336
320 seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n"); 337 seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
321 seq_printf(m, "Machine\t\t: MPC85xx CDS (0x%x)\n", cadmus[CM_VER]); 338 seq_printf(m, "Machine\t\t: MPC85xx CDS (0x%x)\n",
339 in_8(&cadmus->cm_ver));
322 seq_printf(m, "PVR\t\t: 0x%x\n", pvid); 340 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
323 seq_printf(m, "SVR\t\t: 0x%x\n", svid); 341 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
324 342