···5454 - compatible5555 Usage: required5656 Value type: <string>5757- Definition: Must include "fsl,sec-v4.0". Also includes SEC5858- ERA versions (optional) with which the device is compatible.5757+ Definition: Must include "fsl,sec-v4.0"5858+5959+ - fsl,sec-era6060+ Usage: optional6161+ Value type: <u32>6262+ Definition: A standard property. Define the 'ERA' of the SEC6363+ device.59646065 - #address-cells6166 Usage: required···112107113108EXAMPLE114109 crypto@300000 {115115- compatible = "fsl,sec-v4.0", "fsl,sec-era-v2.0";110110+ compatible = "fsl,sec-v4.0";111111+ fsl,sec-era = <0x2>;116112 #address-cells = <1>;117113 #size-cells = <1>;118114 reg = <0x300000 0x10000>;
···1717 contains a functioning "reset control register" (i.e. the board1818 is wired to reset upon setting the HRESET_REQ bit in this register).19192020-Example:2020+ - fsl,liodn-bits : Indicates the number of defined bits in the LIODN2121+ registers, for those SOCs that have a PAMU device.2222+2323+Examples:2124 global-utilities@e0000 { /* global utilities block */2225 compatible = "fsl,mpc8548-guts";2326 reg = <e0000 1000>;2427 fsl,has-rstcr;2828+ };2929+3030+ guts: global-utilities@e0000 {3131+ compatible = "fsl,qoriq-device-config-1.0";3232+ reg = <0xe0000 0xe00>;3333+ fsl,has-rstcr;3434+ #sleep-cells = <1>;3535+ fsl,liodn-bits = <12>;2536 };
···11+Freescale Peripheral Management Access Unit (PAMU) Device Tree Binding22+33+DESCRIPTION44+55+The PAMU is an I/O MMU that provides device-to-memory access control and66+address translation capabilities.77+88+Required properties:99+1010+- compatible : <string>1111+ First entry is a version-specific string, such as1212+ "fsl,pamu-v1.0". The second is "fsl,pamu".1313+- ranges : <prop-encoded-array>1414+ A standard property. Utilized to describe the memory mapped1515+ I/O space utilized by the controller. The size should1616+ be set to the total size of the register space of all1717+ physically present PAMU controllers. For example, for1818+ PAMU v1.0, on an SOC that has five PAMU devices, the size1919+ is 0x5000.2020+- interrupts : <prop-encoded-array>2121+ Interrupt mappings. The first tuple is the normal PAMU2222+ interrupt, used for reporting access violations. The second2323+ is for PAMU hardware errors, such as PAMU operation errors2424+ and ECC errors.2525+- #address-cells: <u32>2626+ A standard property.2727+- #size-cells : <u32>2828+ A standard property.2929+3030+Optional properties:3131+- reg : <prop-encoded-array>3232+ A standard property. It represents the CCSR registers of3333+ all child PAMUs combined. Include it to provide support3434+ for legacy drivers.3535+- interrupt-parent : <phandle>3636+ Phandle to interrupt controller3737+3838+Child nodes:3939+4040+Each child node represents one PAMU controller. Each SOC device that is4141+connected to a specific PAMU device should have a "fsl,pamu-phandle" property4242+that links to the corresponding specific child PAMU controller.4343+4444+- reg : <prop-encoded-array>4545+ A standard property. Specifies the physical address and4646+ length (relative to the parent 'ranges' property) of this4747+ PAMU controller's configuration registers. The size should4848+ be set to the size of this PAMU controllers's register space.4949+ For PAMU v1.0, this size is 0x1000.5050+- fsl,primary-cache-geometry5151+ : <prop-encoded-array>5252+ Two cells that specify the geometry of the primary PAMU5353+ cache. The first is the number of cache lines, and the5454+ second is the number of "ways". For direct-mapped caches,5555+ specify a value of 1.5656+- fsl,secondary-cache-geometry5757+ : <prop-encoded-array>5858+ Two cells that specify the geometry of the secondary PAMU5959+ cache. The first is the number of cache lines, and the6060+ second is the number of "ways". For direct-mapped caches,6161+ specify a value of 1.6262+6363+Device nodes:6464+6565+Devices that have LIODNs need to specify links to the parent PAMU controller6666+(the actual PAMU controller that this device is connected to) and a pointer to6767+the LIODN register, if applicable.6868+6969+- fsl,iommu-parent7070+ : <phandle>7171+ Phandle to the single, specific PAMU controller node to which7272+ this device is connect. The PAMU topology is represented in7373+ the device tree to assist code that dynamically determines the7474+ best LIODN values to minimize PAMU cache thrashing.7575+7676+- fsl,liodn-reg : <prop-encoded-array>7777+ Two cells that specify the location of the LIODN register7878+ for this device. Required for devices that have a single7979+ LIODN. The first cell is a phandle to a node that contains8080+ the registers where the LIODN is to be set. The second is8181+ the offset from the first "reg" resource of the node where8282+ the specific LIODN register is located.8383+8484+8585+Example:8686+8787+ iommu@20000 {8888+ compatible = "fsl,pamu-v1.0", "fsl,pamu";8989+ reg = <0x20000 0x5000>;9090+ ranges = <0 0x20000 0x5000>;9191+ #address-cells = <1>;9292+ #size-cells = <1>;9393+ interrupts = <9494+ 24 2 0 09595+ 16 2 1 30>;9696+9797+ pamu0: pamu@0 {9898+ reg = <0 0x1000>;9999+ fsl,primary-cache-geometry = <32 1>;100100+ fsl,secondary-cache-geometry = <128 2>;101101+ };102102+103103+ pamu1: pamu@1000 {104104+ reg = <0x1000 0x1000>;105105+ fsl,primary-cache-geometry = <32 1>;106106+ fsl,secondary-cache-geometry = <128 2>;107107+ };108108+109109+ pamu2: pamu@2000 {110110+ reg = <0x2000 0x1000>;111111+ fsl,primary-cache-geometry = <32 1>;112112+ fsl,secondary-cache-geometry = <128 2>;113113+ };114114+115115+ pamu3: pamu@3000 {116116+ reg = <0x3000 0x1000>;117117+ fsl,primary-cache-geometry = <32 1>;118118+ fsl,secondary-cache-geometry = <128 2>;119119+ };120120+121121+ pamu4: pamu@4000 {122122+ reg = <0x4000 0x1000>;123123+ fsl,primary-cache-geometry = <32 1>;124124+ fsl,secondary-cache-geometry = <128 2>;125125+ };126126+ };127127+128128+ guts: global-utilities@e0000 {129129+ compatible = "fsl,qoriq-device-config-1.0";130130+ reg = <0xe0000 0xe00>;131131+ fsl,has-rstcr;132132+ #sleep-cells = <1>;133133+ fsl,liodn-bits = <12>;134134+ };135135+136136+/include/ "qoriq-dma-0.dtsi"137137+ dma@100300 {138138+ fsl,iommu-parent = <&pamu0>;139139+ fsl,liodn-reg = <&guts 0x584>; /* DMA2LIODNR */140140+ };
···22# CONFIG_SWAP is not set33CONFIG_SYSVIPC=y44CONFIG_POSIX_MQUEUE=y55+CONFIG_NO_HZ=y66+CONFIG_HIGH_RES_TIMERS=y57CONFIG_LOG_BUF_SHIFT=1468CONFIG_EXPERT=y79CONFIG_SLAB=y···1816# CONFIG_PPC_PMAC is not set1917CONFIG_PPC_83xx=y2018CONFIG_KMETER1=y2121-CONFIG_NO_HZ=y2222-CONFIG_HIGH_RES_TIMERS=y2319CONFIG_PREEMPT=y2420# CONFIG_SECCOMP is not set2521CONFIG_NET=y···4545CONFIG_MTD_PHRAM=y4646CONFIG_MTD_UBI=y4747CONFIG_MTD_UBI_GLUEBI=y4848-CONFIG_MTD_UBI_DEBUG=y4948CONFIG_PROC_DEVICETREE=y5049CONFIG_NETDEVICES=y5150CONFIG_DUMMY=y···7576CONFIG_JFFS2_FS=y7677CONFIG_UBIFS_FS=y7778CONFIG_NFS_FS=y7878-CONFIG_NFS_V3=y7979CONFIG_ROOT_NFS=y
+65
arch/powerpc/configs/85xx/ppa8548_defconfig
···11+CONFIG_PPC_85xx=y22+CONFIG_PPA8548=y33+CONFIG_DTC=y44+CONFIG_DEFAULT_UIMAGE=y55+CONFIG_IKCONFIG=y66+CONFIG_IKCONFIG_PROC=y77+# CONFIG_PCI is not set88+# CONFIG_USB_SUPPORT is not set99+CONFIG_ADVANCED_OPTIONS=y1010+CONFIG_LOWMEM_SIZE_BOOL=y1111+CONFIG_LOWMEM_SIZE=0x400000001212+CONFIG_LOWMEM_CAM_NUM_BOOL=y1313+CONFIG_LOWMEM_CAM_NUM=41414+CONFIG_PAGE_OFFSET_BOOL=y1515+CONFIG_PAGE_OFFSET=0xb00000001616+CONFIG_KERNEL_START_BOOL=y1717+CONFIG_KERNEL_START=0xb00000001818+# CONFIG_PHYSICAL_START_BOOL is not set1919+CONFIG_PHYSICAL_START=0x000000002020+CONFIG_PHYSICAL_ALIGN=0x040000002121+CONFIG_TASK_SIZE_BOOL=y2222+CONFIG_TASK_SIZE=0xb00000002323+2424+CONFIG_FSL_LBC=y2525+CONFIG_FSL_DMA=y2626+CONFIG_FSL_RIO=y2727+2828+CONFIG_RAPIDIO=y2929+CONFIG_RAPIDIO_DMA_ENGINE=y3030+CONFIG_RAPIDIO_TSI57X=y3131+CONFIG_RAPIDIO_TSI568=y3232+CONFIG_RAPIDIO_CPS_XX=y3333+CONFIG_RAPIDIO_CPS_GEN2=y3434+CONFIG_SERIAL_8250=y3535+CONFIG_SERIAL_8250_CONSOLE=y3636+CONFIG_PROC_DEVICETREE=y3737+3838+CONFIG_MTD=y3939+CONFIG_MTD_BLKDEVS=y4040+CONFIG_MTD_BLOCK=y4141+CONFIG_MTD_CFI=y4242+CONFIG_MTD_CFI_AMDSTD=y4343+CONFIG_MTD_CFI_INTELEXT=y4444+CONFIG_MTD_CHAR=y4545+CONFIG_MTD_CMDLINE_PARTS=y4646+CONFIG_MTD_CONCAT=y4747+CONFIG_MTD_PARTITIONS=y4848+CONFIG_MTD_PHYSMAP_OF=y4949+5050+CONFIG_I2C=y5151+CONFIG_I2C_MPC=y5252+CONFIG_I2C_CHARDEV5353+CONFIG_RTC_CLASS=y5454+CONFIG_RTC_HCTOSYS=y5555+CONFIG_RTC_DRV_ISL1208=y5656+5757+CONFIG_NET=y5858+CONFIG_INET=y5959+CONFIG_IP_PNP=y6060+CONFIG_NETDEVICES=y6161+CONFIG_MII=y6262+CONFIG_GIANFAR=y6363+CONFIG_MARVELL_PHY=y6464+CONFIG_NFS_FS=y6565+CONFIG_ROOT_NFS=y
+19
arch/powerpc/configs/85xx/sbc8548_defconfig
···5555# CONFIG_RCU_CPU_STALL_DETECTOR is not set5656CONFIG_SYSCTL_SYSCALL_CHECK=y5757# CONFIG_CRYPTO_ANSI_CPRNG is not set5858+CONFIG_MTD=y5959+CONFIG_MTD_OF_PARTS=y6060+CONFIG_MTD_CHAR=y6161+CONFIG_MTD_BLKDEVS=y6262+CONFIG_MTD_BLOCK=y6363+CONFIG_MTD_CFI=y6464+CONFIG_MTD_GEN_PROBE=y6565+CONFIG_MTD_CFI_ADV_OPTIONS=y6666+CONFIG_MTD_CFI_NOSWAP=y6767+CONFIG_MTD_CFI_GEOMETRY=y6868+CONFIG_MTD_MAP_BANK_WIDTH_1=y6969+CONFIG_MTD_MAP_BANK_WIDTH_2=y7070+CONFIG_MTD_MAP_BANK_WIDTH_4=y7171+CONFIG_MTD_CFI_I1=y7272+CONFIG_MTD_CFI_I2=y7373+CONFIG_MTD_CFI_I4=y7474+CONFIG_MTD_CFI_INTELEXT=y7575+CONFIG_MTD_CFI_UTIL=y7676+CONFIG_MTD_PHYSMAP_OF=y
···1818#include <linux/fsl_devices.h>1919#include <linux/of_platform.h>20202121-#include <asm/io.h>2121+#include <linux/io.h>2222#include <asm/cpm2.h>2323#include <asm/udbg.h>2424#include <asm/machdep.h>2525-#include <asm/time.h>2525+#include <linux/time.h>2626#include <asm/mpc8260.h>2727#include <asm/prom.h>2828···3636 struct device_node *np = of_find_compatible_node(NULL, NULL,3737 "fsl,pq2-pic");3838 if (!np) {3939- printk(KERN_ERR "PIC init: can not find cpm-pic node\n");3939+ pr_err("PIC init: can not find cpm-pic node\n");4040 return;4141 }4242
+83-78
arch/powerpc/platforms/83xx/km83xx.c
···2828#include <linux/of_device.h>29293030#include <linux/atomic.h>3131-#include <asm/time.h>3232-#include <asm/io.h>3131+#include <linux/time.h>3232+#include <linux/io.h>3333#include <asm/machdep.h>3434#include <asm/ipic.h>3535#include <asm/irq.h>···4343#include "mpc83xx.h"44444545#define SVR_REV(svr) (((svr) >> 0) & 0xFFFF) /* Revision field */4646+4747+static void quirk_mpc8360e_qe_enet10(void)4848+{4949+ /*5050+ * handle mpc8360E Erratum QE_ENET10:5151+ * RGMII AC values do not meet the specification5252+ */5353+ uint svid = mfspr(SPRN_SVR);5454+ struct device_node *np_par;5555+ struct resource res;5656+ void __iomem *base;5757+ int ret;5858+5959+ np_par = of_find_node_by_name(NULL, "par_io");6060+ if (np_par == NULL) {6161+ pr_warn("%s couldn;t find par_io node\n", __func__);6262+ return;6363+ }6464+ /* Map Parallel I/O ports registers */6565+ ret = of_address_to_resource(np_par, 0, &res);6666+ if (ret) {6767+ pr_warn("%s couldn;t map par_io registers\n", __func__);6868+ return;6969+ }7070+7171+ base = ioremap(res.start, res.end - res.start + 1);7272+7373+ /*7474+ * set output delay adjustments to default values according7575+ * table 5 in Errata Rev. 5, 9/2011:7676+ *7777+ * write 0b01 to UCC1 bits 18:197878+ * write 0b01 to UCC2 option 1 bits 4:57979+ * write 0b01 to UCC2 option 2 bits 16:178080+ */8181+ clrsetbits_be32((base + 0xa8), 0x0c00f000, 0x04005000);8282+8383+ /*8484+ * set output delay adjustments to default values according8585+ * table 3-13 in Reference Manual Rev.3 05/2010:8686+ *8787+ * write 0b01 to UCC2 option 2 bits 16:178888+ * write 0b0101 to UCC1 bits 20:238989+ * write 0b0101 to UCC2 option 1 bits 24:279090+ */9191+ clrsetbits_be32((base + 0xac), 0x0000cff0, 0x00004550);9292+9393+ if (SVR_REV(svid) == 0x0021) {9494+ /*9595+ * UCC2 option 1: write 0b1010 to bits 24:279696+ * at address IMMRBAR+0x14AC9797+ */9898+ clrsetbits_be32((base + 0xac), 0x000000f0, 0x000000a0);9999+ } else if (SVR_REV(svid) == 0x0020) {100100+ /*101101+ * UCC1: write 0b11 to bits 18:19102102+ * at address IMMRBAR+0x14A8103103+ */104104+ setbits32((base + 0xa8), 0x00003000);105105+106106+ /*107107+ * UCC2 option 1: write 0b11 to bits 4:5108108+ * at address IMMRBAR+0x14A8109109+ */110110+ setbits32((base + 0xa8), 0x0c000000);111111+112112+ /*113113+ * UCC2 option 2: write 0b11 to bits 16:17114114+ * at address IMMRBAR+0x14AC115115+ */116116+ setbits32((base + 0xac), 0x0000c000);117117+ }118118+ iounmap(base);119119+ of_node_put(np_par);120120+}121121+46122/* ************************************************************************47123 *48124 * Setup the architecture···1487214973 for_each_node_by_name(np, "ucc")15074 par_io_of_config(np);151151- }15275153153- np = of_find_compatible_node(NULL, "network", "ucc_geth");154154- if (np != NULL) {155155- /*156156- * handle mpc8360E Erratum QE_ENET10:157157- * RGMII AC values do not meet the specification158158- */159159- uint svid = mfspr(SPRN_SVR);160160- struct device_node *np_par;161161- struct resource res;162162- void __iomem *base;163163- int ret;164164-165165- np_par = of_find_node_by_name(NULL, "par_io");166166- if (np_par == NULL) {167167- printk(KERN_WARNING "%s couldn;t find par_io node\n",168168- __func__);169169- return;7676+ /* Only apply this quirk when par_io is available */7777+ np = of_find_compatible_node(NULL, "network", "ucc_geth");7878+ if (np != NULL) {7979+ quirk_mpc8360e_qe_enet10();8080+ of_node_put(np);17081 }171171- /* Map Parallel I/O ports registers */172172- ret = of_address_to_resource(np_par, 0, &res);173173- if (ret) {174174- printk(KERN_WARNING "%s couldn;t map par_io registers\n",175175- __func__);176176- return;177177- }178178-179179- base = ioremap(res.start, res.end - res.start + 1);180180-181181- /*182182- * set output delay adjustments to default values according183183- * table 5 in Errata Rev. 5, 9/2011:184184- *185185- * write 0b01 to UCC1 bits 18:19186186- * write 0b01 to UCC2 option 1 bits 4:5187187- * write 0b01 to UCC2 option 2 bits 16:17188188- */189189- clrsetbits_be32((base + 0xa8), 0x0c00f000, 0x04005000);190190-191191- /*192192- * set output delay adjustments to default values according193193- * table 3-13 in Reference Manual Rev.3 05/2010:194194- *195195- * write 0b01 to UCC2 option 2 bits 16:17196196- * write 0b0101 to UCC1 bits 20:23197197- * write 0b0101 to UCC2 option 1 bits 24:27198198- */199199- clrsetbits_be32((base + 0xac), 0x0000cff0, 0x00004550);200200-201201- if (SVR_REV(svid) == 0x0021) {202202- /*203203- * UCC2 option 1: write 0b1010 to bits 24:27204204- * at address IMMRBAR+0x14AC205205- */206206- clrsetbits_be32((base + 0xac), 0x000000f0, 0x000000a0);207207- } else if (SVR_REV(svid) == 0x0020) {208208- /*209209- * UCC1: write 0b11 to bits 18:19210210- * at address IMMRBAR+0x14A8211211- */212212- setbits32((base + 0xa8), 0x00003000);213213-214214- /*215215- * UCC2 option 1: write 0b11 to bits 4:5216216- * at address IMMRBAR+0x14A8217217- */218218- setbits32((base + 0xa8), 0x0c000000);219219-220220- /*221221- * UCC2 option 2: write 0b11 to bits 16:17222222- * at address IMMRBAR+0x14AC223223- */224224- setbits32((base + 0xac), 0x0000c000);225225- }226226- iounmap(base);227227- of_node_put(np_par);228228- of_node_put(np);22982 }23083#endif /* CONFIG_QUICC_ENGINE */23184}
+7
arch/powerpc/platforms/85xx/Kconfig
···191191 help192192 This option enables support for the Wind River SBC8548 board193193194194+config PPA8548195195+ bool "Prodrive PPA8548"196196+ help197197+ This option enables support for the Prodrive PPA8548 board.198198+ select DEFAULT_UIMAGE199199+ select HAS_RAPIDIO200200+194201config GE_IMP3A195202 bool "GE Intelligent Platforms IMP3A"196203 select DEFAULT_UIMAGE
···206206 setbits8(&bcsr_regs[7], BCSR7_UCC12_GETHnRST);207207 clrbits8(&bcsr_regs[8], BCSR8_UEM_MARVELL_RST);208208209209- for (np = NULL; (np = of_find_compatible_node(np,210210- "network",211211- "ucc_geth")) != NULL;) {209209+ for_each_compatible_node(np, "network", "ucc_geth") {212210 const unsigned int *prop;213211 int ucc_num;214212
+1-39
arch/powerpc/platforms/85xx/p1022_ds.c
···106106 (c2 << AD_COMP_2_SHIFT) | (c1 << AD_COMP_1_SHIFT) | \107107 (c0 << AD_COMP_0_SHIFT) | (size << AD_PIXEL_S_SHIFT))108108109109-/**110110- * p1022ds_get_pixel_format: return the Area Descriptor for a given pixel depth111111- *112112- * The Area Descriptor is a 32-bit value that determine which bits in each113113- * pixel are to be used for each color.114114- */115115-static u32 p1022ds_get_pixel_format(enum fsl_diu_monitor_port port,116116- unsigned int bits_per_pixel)117117-{118118- switch (bits_per_pixel) {119119- case 32:120120- /* 0x88883316 */121121- return MAKE_AD(3, 2, 0, 1, 3, 8, 8, 8, 8);122122- case 24:123123- /* 0x88082219 */124124- return MAKE_AD(4, 0, 1, 2, 2, 0, 8, 8, 8);125125- case 16:126126- /* 0x65053118 */127127- return MAKE_AD(4, 2, 1, 0, 1, 5, 6, 5, 0);128128- default:129129- pr_err("fsl-diu: unsupported pixel depth %u\n", bits_per_pixel);130130- return 0;131131- }132132-}133133-134134-/**135135- * p1022ds_set_gamma_table: update the gamma table, if necessary136136- *137137- * On some boards, the gamma table for some ports may need to be modified.138138- * This is not the case on the P1022DS, so we do nothing.139139-*/140140-static void p1022ds_set_gamma_table(enum fsl_diu_monitor_port port,141141- char *gamma_table_base)142142-{143143-}144144-145109struct fsl_law {146110 u32 lawbar;147111 u32 reserved1;···266302 goto exit;267303 }268304 cs1_addr = lbc_br_to_phys(ecm, num_laws, br1);269269- if (!cs0_addr) {305305+ if (!cs1_addr) {270306 pr_err("p1022ds: could not determine physical address for CS1"271307 " (BR1=%08x)\n", br1);272308 goto exit;···474510 ppc_md.progress("p1022_ds_setup_arch()", 0);475511476512#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)477477- diu_ops.get_pixel_format = p1022ds_get_pixel_format;478478- diu_ops.set_gamma_table = p1022ds_set_gamma_table;479513 diu_ops.set_monitor_port = p1022ds_set_monitor_port;480514 diu_ops.set_pixel_clock = p1022ds_set_pixel_clock;481515 diu_ops.valid_monitor_port = p1022ds_valid_monitor_port;
-12
arch/powerpc/platforms/85xx/p1022_rdk.c
···3535#define CLKDVDR_PXCLK_MASK 0x00FF000036363737/**3838- * p1022rdk_set_monitor_port: switch the output to a different monitor port3939- */4040-static void p1022rdk_set_monitor_port(enum fsl_diu_monitor_port port)4141-{4242- if (port != FSL_DIU_PORT_DVI) {4343- pr_err("p1022rdk: unsupported monitor port %i\n", port);4444- return;4545- }4646-}4747-4848-/**4938 * p1022rdk_set_pixel_clock: program the DIU's clock5039 *5140 * @pixclock: the wavelength, in picoseconds, of the clock···113124 ppc_md.progress("p1022_rdk_setup_arch()", 0);114125115126#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)116116- diu_ops.set_monitor_port = p1022rdk_set_monitor_port;117127 diu_ops.set_pixel_clock = p1022rdk_set_pixel_clock;118128 diu_ops.valid_monitor_port = p1022rdk_valid_monitor_port;119129#endif
+98
arch/powerpc/platforms/85xx/ppa8548.c
···11+/*22+ * ppa8548 setup and early boot code.33+ *44+ * Copyright 2009 Prodrive B.V..55+ *66+ * By Stef van Os (see MAINTAINERS for contact information)77+ *88+ * Based on the SBC8548 support - Copyright 2007 Wind River Systems Inc.99+ * Based on the MPC8548CDS support - Copyright 2005 Freescale Inc.1010+ *1111+ * This program is free software; you can redistribute it and/or modify it1212+ * under the terms of the GNU General Public License as published by the1313+ * Free Software Foundation; either version 2 of the License, or (at your1414+ * option) any later version.1515+ */1616+1717+#include <linux/stddef.h>1818+#include <linux/kernel.h>1919+#include <linux/init.h>2020+#include <linux/reboot.h>2121+#include <linux/seq_file.h>2222+#include <linux/of_platform.h>2323+2424+#include <asm/machdep.h>2525+#include <asm/udbg.h>2626+#include <asm/mpic.h>2727+2828+#include <sysdev/fsl_soc.h>2929+3030+static void __init ppa8548_pic_init(void)3131+{3232+ struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN,3333+ 0, 256, " OpenPIC ");3434+ BUG_ON(mpic == NULL);3535+ mpic_init(mpic);3636+}3737+3838+/*3939+ * Setup the architecture4040+ */4141+static void __init ppa8548_setup_arch(void)4242+{4343+ if (ppc_md.progress)4444+ ppc_md.progress("ppa8548_setup_arch()", 0);4545+}4646+4747+static void ppa8548_show_cpuinfo(struct seq_file *m)4848+{4949+ uint32_t svid, phid1;5050+5151+ svid = mfspr(SPRN_SVR);5252+5353+ seq_printf(m, "Vendor\t\t: Prodrive B.V.\n");5454+ seq_printf(m, "SVR\t\t: 0x%x\n", svid);5555+5656+ /* Display cpu Pll setting */5757+ phid1 = mfspr(SPRN_HID1);5858+ seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));5959+}6060+6161+static struct of_device_id __initdata of_bus_ids[] = {6262+ { .name = "soc", },6363+ { .type = "soc", },6464+ { .compatible = "simple-bus", },6565+ { .compatible = "gianfar", },6666+ { .compatible = "fsl,srio", },6767+ {},6868+};6969+7070+static int __init declare_of_platform_devices(void)7171+{7272+ of_platform_bus_probe(NULL, of_bus_ids, NULL);7373+7474+ return 0;7575+}7676+machine_device_initcall(ppa8548, declare_of_platform_devices);7777+7878+/*7979+ * Called very early, device-tree isn't unflattened8080+ */8181+static int __init ppa8548_probe(void)8282+{8383+ unsigned long root = of_get_flat_dt_root();8484+8585+ return of_flat_dt_is_compatible(root, "ppa8548");8686+}8787+8888+define_machine(ppa8548) {8989+ .name = "ppa8548",9090+ .probe = ppa8548_probe,9191+ .setup_arch = ppa8548_setup_arch,9292+ .init_IRQ = ppa8548_pic_init,9393+ .show_cpuinfo = ppa8548_show_cpuinfo,9494+ .get_irq = mpic_get_irq,9595+ .restart = fsl_rstcr_restart,9696+ .calibrate_decr = generic_calibrate_decr,9797+ .progress = udbg_progress,9898+};
···11821182 const char *vers;11831183 const u32 *psrc;11841184 u32 last_irq;11851185+ u32 fsl_version = 0;1185118611861187 /* Default MPIC search parameters */11871188 static const struct of_device_id __initconst mpic_device_id[] = {···13151314 mpic_map(mpic, mpic->paddr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000);1316131513171316 if (mpic->flags & MPIC_FSL) {13181318- u32 brr1, version;13171317+ u32 brr1;13191318 int ret;1320131913211320 /*···1328132713291328 brr1 = _mpic_read(mpic->reg_type, &mpic->thiscpuregs,13301329 MPIC_FSL_BRR1);13311331- version = brr1 & MPIC_FSL_BRR1_VER;13301330+ fsl_version = brr1 & MPIC_FSL_BRR1_VER;1332133113331332 /* Error interrupt mask register (EIMR) is required for13341333 * handling individual device error interrupts. EIMR···13431342 * is the number of vectors which have been consumed by13441343 * ipis and timer interrupts.13451344 */13461346- if (version >= 0x401) {13451345+ if (fsl_version >= 0x401) {13471346 ret = mpic_setup_error_int(mpic, intvec_top - 12);13481347 if (ret)13491348 return NULL;13501349 }13501350+13511351+ }13521352+13531353+ /*13541354+ * EPR is only available starting with v4.0. To support13551355+ * platforms that don't know the MPIC version at compile-time,13561356+ * such as qemu-e500, turn off coreint if this MPIC doesn't13571357+ * support it. Note that we never enable it if it wasn't13581358+ * requested in the first place.13591359+ *13601360+ * This is done outside the MPIC_FSL check, so that we13611361+ * also disable coreint if the MPIC node doesn't have13621362+ * an "fsl,mpic" compatible at all. This will be the case13631363+ * with device trees generated by older versions of QEMU.13641364+ * fsl_version will be zero if MPIC_FSL is not set.13651365+ */13661366+ if (fsl_version < 0x400 && (flags & MPIC_ENABLE_COREINT)) {13671367+ WARN_ON(ppc_md.get_irq != mpic_get_coreint_irq);13681368+ ppc_md.get_irq = mpic_get_irq;13511369 }1352137013531371 /* Reset */