Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

chenhui zhao and committed by
Kumar Gala
992608ff 96939e79

+41 -17
+7 -1
arch/powerpc/boot/dts/mpc8548cds.dts
··· 35 35 lbc: localbus@e0005000 { 36 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 41 nor@0,0 { 41 42 #address-cells = <1>; ··· 72 71 label = "u-boot-nor"; 73 72 read-only; 74 73 }; 74 + }; 75 + 76 + board-control@1,0 { 77 + compatible = "fsl,mpc8548cds-fpga"; 78 + reg = <0x1 0x0 0x1000>; 75 79 }; 76 80 }; 77 81
+34 -16
arch/powerpc/platforms/85xx/mpc85xx_cds.c
··· 48 48 49 49 #include "mpc85xx.h" 50 50 51 - /* CADMUS info */ 52 - /* xxx - galak, move into device tree */ 53 - #define CADMUS_BASE (0xf8004000) 54 - #define CADMUS_SIZE (256) 55 - #define CM_VER (0) 56 - #define CM_CSR (1) 57 - #define CM_RST (2) 51 + /* 52 + * The CDS board contains an FPGA/CPLD called "Cadmus", which collects 53 + * various logic and performs system control functions. 54 + * Here is the FPGA/CPLD register map. 55 + */ 56 + struct cadmus_reg { 57 + u8 cm_ver; /* Board version */ 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 + }; 58 67 59 - 60 - static int cds_pci_slot = 2; 61 - static volatile u8 *cadmus; 68 + static struct cadmus_reg *cadmus; 62 69 63 70 #ifdef CONFIG_PCI 64 71 ··· 282 275 */ 283 276 static void __init mpc85xx_cds_setup_arch(void) 284 277 { 285 - #ifdef CONFIG_PCI 286 278 struct device_node *np; 287 - #endif 279 + int cds_pci_slot; 288 280 289 281 if (ppc_md.progress) 290 282 ppc_md.progress("mpc85xx_cds_setup_arch()", 0); 291 283 292 - cadmus = ioremap(CADMUS_BASE, CADMUS_SIZE); 293 - cds_pci_slot = ((cadmus[CM_CSR] >> 6) & 0x3) + 1; 284 + np = of_find_compatible_node(NULL, NULL, "fsl,mpc8548cds-fpga"); 285 + if (!np) { 286 + pr_err("Could not find FPGA node.\n"); 287 + return; 288 + } 289 + 290 + cadmus = of_iomap(np, 0); 291 + of_node_put(np); 292 + if (!cadmus) { 293 + pr_err("Fail to map FPGA area.\n"); 294 + return; 295 + } 294 296 295 297 if (ppc_md.progress) { 296 298 char buf[40]; 299 + cds_pci_slot = ((in_8(&cadmus->cm_csr) >> 6) & 0x3) + 1; 297 300 snprintf(buf, 40, "CDS Version = 0x%x in slot %d\n", 298 - cadmus[CM_VER], cds_pci_slot); 301 + in_8(&cadmus->cm_ver), cds_pci_slot); 299 302 ppc_md.progress(buf, 0); 300 303 } 301 304 ··· 335 318 svid = mfspr(SPRN_SVR); 336 319 337 320 seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n"); 338 - seq_printf(m, "Machine\t\t: MPC85xx CDS (0x%x)\n", cadmus[CM_VER]); 321 + seq_printf(m, "Machine\t\t: MPC85xx CDS (0x%x)\n", 322 + in_8(&cadmus->cm_ver)); 339 323 seq_printf(m, "PVR\t\t: 0x%x\n", pvid); 340 324 seq_printf(m, "SVR\t\t: 0x%x\n", svid); 341 325