From 9b71dbd3c44c29665f1af5b9bb2ba8bc056a83a7 Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Tue, 31 Mar 2009 08:05:50 -0400 Subject: powerpc: Make LOWMEM_CAM_NUM depend on FSL_BOOKE The recent addition of CONFIG_LOWMEM_CAM_BOOL and CONFIG_LOWMEM_CAM_NUM cause the latter to show up in configs that do not need it during 'make oldconfig'. Make LOWMEM_CAM_NUM depend on FSL_BOOKE. Signed-off-by: Josh Boyer Signed-off-by: Kumar Gala --- arch/powerpc/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index ad6b1c084fe..7d1a535f9fe 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -772,6 +772,7 @@ config LOWMEM_CAM_NUM_BOOL Say N here unless you know what you are doing. config LOWMEM_CAM_NUM + depends on FSL_BOOKE int "Number of CAMs to use to map low memory" if LOWMEM_CAM_NUM_BOOL default 3 -- cgit v1.2.3 From 9310933c832719b095f82dab30c6bf4e75e937ee Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Sat, 28 Mar 2009 15:07:16 -0600 Subject: powerpc: Remove unused symbols from fsl_devices.h Remove old artifacts leftover from the platform driver gianfar and fsl_i2c drivers. These symbols became unused when the drivers were migrated over to use the of_platform bus. Signed-off-by: Grant Likely Signed-off-by: Kumar Gala --- include/linux/fsl_devices.h | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index d9051d717d2..4953709f687 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h @@ -18,7 +18,6 @@ #define _FSL_DEVICE_H_ #include -#include /* * Some conventions on how we handle peripherals on Freescale chips @@ -44,27 +43,6 @@ * */ -struct gianfar_platform_data { - /* device specific information */ - u32 device_flags; - char bus_id[BUS_ID_SIZE]; - phy_interface_t interface; -}; - -struct gianfar_mdio_data { - /* board specific information */ - int irq[32]; -}; - -/* Flags in gianfar_platform_data */ -#define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* set or use a timer */ -#define FSL_GIANFAR_BRD_IS_REDUCED 0x00000002 /* Set if RGMII, RMII */ - -struct fsl_i2c_platform_data { - /* device specific information */ - u32 device_flags; -}; - /* Flags related to I2C device features */ #define FSL_I2C_DEV_SEPARATE_DFSRR 0x00000001 #define FSL_I2C_DEV_CLOCK_5200 0x00000002 -- cgit v1.2.3 From fe671772ab1bf5624f2c4dbe2295e6ebeb8055fc Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 31 Mar 2009 08:46:25 -0500 Subject: powerpc/85xx: Use fsl,mpc85.. as prefix for memory ctrl & l2-cache nodes Older devices tree's used "fsl,85.." instead of the preferred "fsl,mpc85.." for the memory controller & l2 cache controller nodes. The EDAC code is the only use of these and has been updated for some time to support both "fsl,85.." and "fsl,mpc85.." Signed-off-by: Kumar Gala --- arch/powerpc/boot/dts/ksi8560.dts | 4 ++-- arch/powerpc/boot/dts/sbc8548.dts | 4 ++-- arch/powerpc/boot/dts/sbc8560.dts | 4 ++-- arch/powerpc/boot/dts/stx_gp3_8560.dts | 4 ++-- arch/powerpc/boot/dts/tqm8540.dts | 4 ++-- arch/powerpc/boot/dts/tqm8541.dts | 4 ++-- arch/powerpc/boot/dts/tqm8555.dts | 4 ++-- arch/powerpc/boot/dts/tqm8560.dts | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/boot/dts/ksi8560.dts b/arch/powerpc/boot/dts/ksi8560.dts index 308fe7c29de..c9cfd374bff 100644 --- a/arch/powerpc/boot/dts/ksi8560.dts +++ b/arch/powerpc/boot/dts/ksi8560.dts @@ -57,14 +57,14 @@ bus-frequency = <0>; /* Fixed by bootwrapper */ memory-controller@2000 { - compatible = "fsl,8540-memory-controller"; + compatible = "fsl,mpc8540-memory-controller"; reg = <0x2000 0x1000>; interrupt-parent = <&mpic>; interrupts = <0x12 0x2>; }; L2: l2-cache-controller@20000 { - compatible = "fsl,8540-l2-cache-controller"; + compatible = "fsl,mpc8540-l2-cache-controller"; reg = <0x20000 0x1000>; cache-line-size = <0x20>; /* 32 bytes */ cache-size = <0x40000>; /* L2, 256K */ diff --git a/arch/powerpc/boot/dts/sbc8548.dts b/arch/powerpc/boot/dts/sbc8548.dts index 9c5079fec4f..b1f1416ac99 100644 --- a/arch/powerpc/boot/dts/sbc8548.dts +++ b/arch/powerpc/boot/dts/sbc8548.dts @@ -156,14 +156,14 @@ compatible = "simple-bus"; memory-controller@2000 { - compatible = "fsl,8548-memory-controller"; + compatible = "fsl,mpc8548-memory-controller"; reg = <0x2000 0x1000>; interrupt-parent = <&mpic>; interrupts = <0x12 0x2>; }; L2: l2-cache-controller@20000 { - compatible = "fsl,8548-l2-cache-controller"; + compatible = "fsl,mpc8548-l2-cache-controller"; reg = <0x20000 0x1000>; cache-line-size = <0x20>; // 32 bytes cache-size = <0x80000>; // L2, 512K diff --git a/arch/powerpc/boot/dts/sbc8560.dts b/arch/powerpc/boot/dts/sbc8560.dts index b772405a9a0..c4564b81e47 100644 --- a/arch/powerpc/boot/dts/sbc8560.dts +++ b/arch/powerpc/boot/dts/sbc8560.dts @@ -61,14 +61,14 @@ clock-frequency = <0>; memory-controller@2000 { - compatible = "fsl,8560-memory-controller"; + compatible = "fsl,mpc8560-memory-controller"; reg = <0x2000 0x1000>; interrupt-parent = <&mpic>; interrupts = <0x12 0x2>; }; L2: l2-cache-controller@20000 { - compatible = "fsl,8560-l2-cache-controller"; + compatible = "fsl,mpc8560-l2-cache-controller"; reg = <0x20000 0x1000>; cache-line-size = <0x20>; // 32 bytes cache-size = <0x40000>; // L2, 256K diff --git a/arch/powerpc/boot/dts/stx_gp3_8560.dts b/arch/powerpc/boot/dts/stx_gp3_8560.dts index 8b173957fb5..ea6b15152de 100644 --- a/arch/powerpc/boot/dts/stx_gp3_8560.dts +++ b/arch/powerpc/boot/dts/stx_gp3_8560.dts @@ -57,14 +57,14 @@ compatible = "fsl,mpc8560-immr", "simple-bus"; memory-controller@2000 { - compatible = "fsl,8540-memory-controller"; + compatible = "fsl,mpc8540-memory-controller"; reg = <0x2000 0x1000>; interrupt-parent = <&mpic>; interrupts = <18 2>; }; L2: l2-cache-controller@20000 { - compatible = "fsl,8540-l2-cache-controller"; + compatible = "fsl,mpc8540-l2-cache-controller"; reg = <0x20000 0x1000>; cache-line-size = <32>; cache-size = <0x40000>; // L2, 256K diff --git a/arch/powerpc/boot/dts/tqm8540.dts b/arch/powerpc/boot/dts/tqm8540.dts index ac9413a29f9..231bae75663 100644 --- a/arch/powerpc/boot/dts/tqm8540.dts +++ b/arch/powerpc/boot/dts/tqm8540.dts @@ -59,14 +59,14 @@ compatible = "fsl,mpc8540-immr", "simple-bus"; memory-controller@2000 { - compatible = "fsl,8540-memory-controller"; + compatible = "fsl,mpc8540-memory-controller"; reg = <0x2000 0x1000>; interrupt-parent = <&mpic>; interrupts = <18 2>; }; L2: l2-cache-controller@20000 { - compatible = "fsl,8540-l2-cache-controller"; + compatible = "fsl,mpc8540-l2-cache-controller"; reg = <0x20000 0x1000>; cache-line-size = <32>; cache-size = <0x40000>; // L2, 256K diff --git a/arch/powerpc/boot/dts/tqm8541.dts b/arch/powerpc/boot/dts/tqm8541.dts index c71bb5dd5e5..4356a1f0829 100644 --- a/arch/powerpc/boot/dts/tqm8541.dts +++ b/arch/powerpc/boot/dts/tqm8541.dts @@ -58,14 +58,14 @@ compatible = "fsl,mpc8541-immr", "simple-bus"; memory-controller@2000 { - compatible = "fsl,8540-memory-controller"; + compatible = "fsl,mpc8540-memory-controller"; reg = <0x2000 0x1000>; interrupt-parent = <&mpic>; interrupts = <18 2>; }; L2: l2-cache-controller@20000 { - compatible = "fsl,8540-l2-cache-controller"; + compatible = "fsl,mpc8540-l2-cache-controller"; reg = <0x20000 0x1000>; cache-line-size = <32>; cache-size = <0x40000>; // L2, 256K diff --git a/arch/powerpc/boot/dts/tqm8555.dts b/arch/powerpc/boot/dts/tqm8555.dts index a133ded6ddd..06d366ebbda 100644 --- a/arch/powerpc/boot/dts/tqm8555.dts +++ b/arch/powerpc/boot/dts/tqm8555.dts @@ -58,14 +58,14 @@ compatible = "fsl,mpc8555-immr", "simple-bus"; memory-controller@2000 { - compatible = "fsl,8540-memory-controller"; + compatible = "fsl,mpc8540-memory-controller"; reg = <0x2000 0x1000>; interrupt-parent = <&mpic>; interrupts = <18 2>; }; L2: l2-cache-controller@20000 { - compatible = "fsl,8540-l2-cache-controller"; + compatible = "fsl,mpc8540-l2-cache-controller"; reg = <0x20000 0x1000>; cache-line-size = <32>; cache-size = <0x40000>; // L2, 256K diff --git a/arch/powerpc/boot/dts/tqm8560.dts b/arch/powerpc/boot/dts/tqm8560.dts index 649e2e57626..feff915e049 100644 --- a/arch/powerpc/boot/dts/tqm8560.dts +++ b/arch/powerpc/boot/dts/tqm8560.dts @@ -60,14 +60,14 @@ compatible = "fsl,mpc8560-immr", "simple-bus"; memory-controller@2000 { - compatible = "fsl,8540-memory-controller"; + compatible = "fsl,mpc8540-memory-controller"; reg = <0x2000 0x1000>; interrupt-parent = <&mpic>; interrupts = <18 2>; }; L2: l2-cache-controller@20000 { - compatible = "fsl,8540-l2-cache-controller"; + compatible = "fsl,mpc8540-l2-cache-controller"; reg = <0x20000 0x1000>; cache-line-size = <32>; cache-size = <0x40000>; // L2, 256K -- cgit v1.2.3 From 39fd09320b2d952c360b430c70846f8fa0244a51 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 1 Apr 2009 16:25:33 -0500 Subject: powerpc: Move SPEFSCR defines to common header SPEFSCR is a user space register and doesn't conflict with anything. Moving the defines of the various bit fields makes some emulation code have fewer ifdefs Signed-off-by: Kumar Gala --- arch/powerpc/include/asm/reg.h | 30 ++++++++++++++++++++++++++++++ arch/powerpc/include/asm/reg_booke.h | 30 ------------------------------ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index c9ff1ec9747..e8018d540e8 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -143,6 +143,36 @@ #define FPSCR_NI 0x00000004 /* FPU non IEEE-Mode */ #define FPSCR_RN 0x00000003 /* FPU rounding control */ +/* Bit definitions for SPEFSCR. */ +#define SPEFSCR_SOVH 0x80000000 /* Summary integer overflow high */ +#define SPEFSCR_OVH 0x40000000 /* Integer overflow high */ +#define SPEFSCR_FGH 0x20000000 /* Embedded FP guard bit high */ +#define SPEFSCR_FXH 0x10000000 /* Embedded FP sticky bit high */ +#define SPEFSCR_FINVH 0x08000000 /* Embedded FP invalid operation high */ +#define SPEFSCR_FDBZH 0x04000000 /* Embedded FP div by zero high */ +#define SPEFSCR_FUNFH 0x02000000 /* Embedded FP underflow high */ +#define SPEFSCR_FOVFH 0x01000000 /* Embedded FP overflow high */ +#define SPEFSCR_FINXS 0x00200000 /* Embedded FP inexact sticky */ +#define SPEFSCR_FINVS 0x00100000 /* Embedded FP invalid op. sticky */ +#define SPEFSCR_FDBZS 0x00080000 /* Embedded FP div by zero sticky */ +#define SPEFSCR_FUNFS 0x00040000 /* Embedded FP underflow sticky */ +#define SPEFSCR_FOVFS 0x00020000 /* Embedded FP overflow sticky */ +#define SPEFSCR_MODE 0x00010000 /* Embedded FP mode */ +#define SPEFSCR_SOV 0x00008000 /* Integer summary overflow */ +#define SPEFSCR_OV 0x00004000 /* Integer overflow */ +#define SPEFSCR_FG 0x00002000 /* Embedded FP guard bit */ +#define SPEFSCR_FX 0x00001000 /* Embedded FP sticky bit */ +#define SPEFSCR_FINV 0x00000800 /* Embedded FP invalid operation */ +#define SPEFSCR_FDBZ 0x00000400 /* Embedded FP div by zero */ +#define SPEFSCR_FUNF 0x00000200 /* Embedded FP underflow */ +#define SPEFSCR_FOVF 0x00000100 /* Embedded FP overflow */ +#define SPEFSCR_FINXE 0x00000040 /* Embedded FP inexact enable */ +#define SPEFSCR_FINVE 0x00000020 /* Embedded FP invalid op. enable */ +#define SPEFSCR_FDBZE 0x00000010 /* Embedded FP div by zero enable */ +#define SPEFSCR_FUNFE 0x00000008 /* Embedded FP underflow enable */ +#define SPEFSCR_FOVFE 0x00000004 /* Embedded FP overflow enable */ +#define SPEFSCR_FRMC 0x00000003 /* Embedded FP rounding mode control */ + /* Special Purpose Registers (SPRNs)*/ #define SPRN_CTR 0x009 /* Count Register */ #define SPRN_DSCR 0x11 diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h index a56f4d61aa7..601ddbc4600 100644 --- a/arch/powerpc/include/asm/reg_booke.h +++ b/arch/powerpc/include/asm/reg_booke.h @@ -423,36 +423,6 @@ #define SGR_NORMAL 0 /* Speculative fetching allowed. */ #define SGR_GUARDED 1 /* Speculative fetching disallowed. */ -/* Bit definitions for SPEFSCR. */ -#define SPEFSCR_SOVH 0x80000000 /* Summary integer overflow high */ -#define SPEFSCR_OVH 0x40000000 /* Integer overflow high */ -#define SPEFSCR_FGH 0x20000000 /* Embedded FP guard bit high */ -#define SPEFSCR_FXH 0x10000000 /* Embedded FP sticky bit high */ -#define SPEFSCR_FINVH 0x08000000 /* Embedded FP invalid operation high */ -#define SPEFSCR_FDBZH 0x04000000 /* Embedded FP div by zero high */ -#define SPEFSCR_FUNFH 0x02000000 /* Embedded FP underflow high */ -#define SPEFSCR_FOVFH 0x01000000 /* Embedded FP overflow high */ -#define SPEFSCR_FINXS 0x00200000 /* Embedded FP inexact sticky */ -#define SPEFSCR_FINVS 0x00100000 /* Embedded FP invalid op. sticky */ -#define SPEFSCR_FDBZS 0x00080000 /* Embedded FP div by zero sticky */ -#define SPEFSCR_FUNFS 0x00040000 /* Embedded FP underflow sticky */ -#define SPEFSCR_FOVFS 0x00020000 /* Embedded FP overflow sticky */ -#define SPEFSCR_MODE 0x00010000 /* Embedded FP mode */ -#define SPEFSCR_SOV 0x00008000 /* Integer summary overflow */ -#define SPEFSCR_OV 0x00004000 /* Integer overflow */ -#define SPEFSCR_FG 0x00002000 /* Embedded FP guard bit */ -#define SPEFSCR_FX 0x00001000 /* Embedded FP sticky bit */ -#define SPEFSCR_FINV 0x00000800 /* Embedded FP invalid operation */ -#define SPEFSCR_FDBZ 0x00000400 /* Embedded FP div by zero */ -#define SPEFSCR_FUNF 0x00000200 /* Embedded FP underflow */ -#define SPEFSCR_FOVF 0x00000100 /* Embedded FP overflow */ -#define SPEFSCR_FINXE 0x00000040 /* Embedded FP inexact enable */ -#define SPEFSCR_FINVE 0x00000020 /* Embedded FP invalid op. enable */ -#define SPEFSCR_FDBZE 0x00000010 /* Embedded FP div by zero enable */ -#define SPEFSCR_FUNFE 0x00000008 /* Embedded FP underflow enable */ -#define SPEFSCR_FOVFE 0x00000004 /* Embedded FP overflow enable */ -#define SPEFSCR_FRMC 0x00000003 /* Embedded FP rounding mode control */ - /* * The IBM-403 is an even more odd special case, as it is much * older than the IBM-405 series. We put these down here incase someone -- cgit v1.2.3 From 212f8c6d67634b133b2bc816e4aa6ca82fbd334c Mon Sep 17 00:00:00 2001 From: Wolfgang Grandegger Date: Thu, 2 Apr 2009 20:50:56 +0200 Subject: powerpc/85xx: Re-add the device_type soc to socrates.dts The device_type "soc" is still required for MPC85xx boards. Signed-off-by: Wolfgang Grandegger Signed-off-by: Kumar Gala --- arch/powerpc/boot/dts/socrates.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/boot/dts/socrates.dts b/arch/powerpc/boot/dts/socrates.dts index b8d0fc6f004..04c398862e0 100644 --- a/arch/powerpc/boot/dts/socrates.dts +++ b/arch/powerpc/boot/dts/socrates.dts @@ -52,6 +52,7 @@ soc8544@e0000000 { #address-cells = <1>; #size-cells = <1>; + device_type = "soc"; ranges = <0x00000000 0xe0000000 0x00100000>; reg = <0xe0000000 0x00001000>; // CCSRBAR 1M -- cgit v1.2.3 From e60f57f50f861f29052e0e3563ac453da53f2181 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Thu, 2 Apr 2009 16:17:36 -0500 Subject: powerpc/math-emu: Change types to work on ppc64 While normally we don't use the math emulation code on ppc64 it can be useful for doing things like emulating the embedded FP instructions. Since performance isn't critical in this scenario its easier to keep the sizes of the various math-emu the same as on ppc32. Signed-off-by: Kumar Gala --- arch/powerpc/include/asm/sfp-machine.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/sfp-machine.h b/arch/powerpc/include/asm/sfp-machine.h index 3d9f831c3c5..3a7a67a0d00 100644 --- a/arch/powerpc/include/asm/sfp-machine.h +++ b/arch/powerpc/include/asm/sfp-machine.h @@ -29,9 +29,9 @@ /* basic word size definitions */ #define _FP_W_TYPE_SIZE 32 -#define _FP_W_TYPE unsigned long -#define _FP_WS_TYPE signed long -#define _FP_I_TYPE long +#define _FP_W_TYPE unsigned int +#define _FP_WS_TYPE signed int +#define _FP_I_TYPE int #define __ll_B ((UWtype) 1 << (W_TYPE_SIZE / 2)) #define __ll_lowpart(t) ((UWtype) (t) & (__ll_B - 1)) -- cgit v1.2.3 From d91e4ea7047d96733d763f1626f1f21ff4298cef Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 7 Jan 2009 15:53:29 -0600 Subject: powerpc: Add support for CoreInt delivery of interrupts on MPIC CoreInt provides a mechansim to deliver the IRQ vector directly into the core on an interrupt (via the SPR EPR) rather than having to go IACK on the PIC. This is suppose to provide an improvment in interrupt latency by reducing the time to get the IRQ vector. Signed-off-by: Kumar Gala --- arch/powerpc/include/asm/mpic.h | 12 ++++++++++++ arch/powerpc/sysdev/mpic.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h index c2ccca53b99..a002682f3a6 100644 --- a/arch/powerpc/include/asm/mpic.h +++ b/arch/powerpc/include/asm/mpic.h @@ -22,6 +22,14 @@ #define MPIC_GREG_FEATURE_1 0x00010 #define MPIC_GREG_GLOBAL_CONF_0 0x00020 #define MPIC_GREG_GCONF_RESET 0x80000000 +/* On the FSL mpic implementations the Mode field is expand to be + * 2 bits wide: + * 0b00 = pass through (interrupts routed to IRQ0) + * 0b01 = Mixed mode + * 0b10 = reserved + * 0b11 = External proxy / coreint + */ +#define MPIC_GREG_GCONF_COREINT 0x60000000 #define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000 #define MPIC_GREG_GCONF_NO_BIAS 0x10000000 #define MPIC_GREG_GCONF_BASE_MASK 0x000fffff @@ -357,6 +365,8 @@ struct mpic #define MPIC_BROKEN_FRR_NIRQS 0x00000800 /* Destination only supports a single CPU at a time */ #define MPIC_SINGLE_DEST_CPU 0x00001000 +/* Enable CoreInt delivery of interrupts */ +#define MPIC_ENABLE_COREINT 0x00002000 /* MPIC HW modification ID */ #define MPIC_REGSET_MASK 0xf0000000 @@ -470,6 +480,8 @@ extern void mpic_end_irq(unsigned int irq); extern unsigned int mpic_get_one_irq(struct mpic *mpic); /* This one gets from the primary mpic */ extern unsigned int mpic_get_irq(void); +/* This one gets from the primary mpic via CoreInt*/ +extern unsigned int mpic_get_coreint_irq(void); /* Fetch Machine Check interrupt from primary mpic */ extern unsigned int mpic_get_mcirq(void); diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 532e205303a..21b95670159 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -1170,6 +1170,12 @@ struct mpic * __init mpic_alloc(struct device_node *node, mb(); } + /* CoreInt */ + if (flags & MPIC_ENABLE_COREINT) + mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0), + mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) + | MPIC_GREG_GCONF_COREINT); + if (flags & MPIC_ENABLE_MCK) mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0), mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) @@ -1525,6 +1531,34 @@ unsigned int mpic_get_irq(void) return mpic_get_one_irq(mpic); } +unsigned int mpic_get_coreint_irq(void) +{ +#ifdef CONFIG_BOOKE + struct mpic *mpic = mpic_primary; + u32 src; + + BUG_ON(mpic == NULL); + + src = mfspr(SPRN_EPR); + + if (unlikely(src == mpic->spurious_vec)) { + if (mpic->flags & MPIC_SPV_EOI) + mpic_eoi(mpic); + return NO_IRQ; + } + if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { + if (printk_ratelimit()) + printk(KERN_WARNING "%s: Got protected source %d !\n", + mpic->name, (int)src); + return NO_IRQ; + } + + return irq_linear_revmap(mpic->irqhost, src); +#else + return NO_IRQ; +#endif +} + unsigned int mpic_get_mcirq(void) { struct mpic *mpic = mpic_primary; -- cgit v1.2.3 From bd86ef378412fc30282daf722a833f734e4e2236 Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Fri, 3 Apr 2009 15:48:44 -0500 Subject: cpm_uart: Initialize port.dev before it's used. Previously, this caused NULL to sometimes be passed as a device to the DMA code. With recent DMA changes, that now causes a BUG(). Signed-off-by: Scott Wood Signed-off-by: Kumar Gala --- drivers/serial/cpm_uart/cpm_uart_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 5c6ef51da27..4dd00bea191 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c @@ -1339,13 +1339,13 @@ static int __devinit cpm_uart_probe(struct of_device *ofdev, dev_set_drvdata(&ofdev->dev, pinfo); + /* initialize the device pointer for the port */ + pinfo->port.dev = &ofdev->dev; + ret = cpm_uart_init_port(ofdev->node, pinfo); if (ret) return ret; - /* initialize the device pointer for the port */ - pinfo->port.dev = &ofdev->dev; - return uart_add_one_port(&cpm_reg, &pinfo->port); } -- cgit v1.2.3 From 4d8107f474029167ae69862bf6b2c7273be757c7 Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Fri, 3 Apr 2009 16:15:49 -0500 Subject: cpm_uart: Disable CPM udbg when re-initing CPM uart, even if not the console. Previously, if udbg was using the CPM uart, and the normal CPM uart driver was enabled, but the console was directed elsewhere, udbg would not be stopped prior to initialization. This resulted in udbg hanging forever waiting for the CPM to process a descriptor. Signed-off-by: Scott Wood Signed-off-by: Kumar Gala --- drivers/serial/cpm_uart/cpm_uart_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 4dd00bea191..f8df0681e16 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c @@ -1106,6 +1106,10 @@ static int cpm_uart_init_port(struct device_node *np, for (i = 0; i < NUM_GPIOS; i++) pinfo->gpios[i] = of_get_gpio(np, i); +#ifdef CONFIG_PPC_EARLY_DEBUG_CPM + udbg_putc = NULL; +#endif + return cpm_uart_request_port(&pinfo->port); out_pram: @@ -1255,10 +1259,6 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) baud = 9600; } -#ifdef CONFIG_PPC_EARLY_DEBUG_CPM - udbg_putc = NULL; -#endif - if (IS_SMC(pinfo)) { out_be16(&pinfo->smcup->smc_brkcr, 0); cpm_line_cr_cmd(pinfo, CPM_CR_STOP_TX); -- cgit v1.2.3 From 65cc0fa3bde00e81f83348ef162a83ab9fff2079 Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Fri, 3 Apr 2009 15:58:46 -0500 Subject: powerpc/pq2fads: Update device tree for use with device-tree-aware u-boot. Add aliases, and correct CS0 offset to match how u-boot programs it (this was not a problem with cuImage because the wrapper would reprogram the localbus to match the device tree). Signed-off-by: Scott Wood Signed-off-by: Kumar Gala --- arch/powerpc/boot/dts/pq2fads.dts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/boot/dts/pq2fads.dts b/arch/powerpc/boot/dts/pq2fads.dts index b2d61091b36..0bb66937674 100644 --- a/arch/powerpc/boot/dts/pq2fads.dts +++ b/arch/powerpc/boot/dts/pq2fads.dts @@ -17,6 +17,14 @@ #address-cells = <1>; #size-cells = <1>; + aliases { + ethernet0 = &enet0; + ethernet1 = &enet1; + serial0 = &serial0; + serial1 = &serial1; + pci0 = &pci0; + }; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -45,7 +53,7 @@ #size-cells = <1>; reg = <0xf0010100 0x60>; - ranges = <0x0 0x0 0xfe000000 0x800000 + ranges = <0x0 0x0 0xff800000 0x800000 0x1 0x0 0xf4500000 0x8000 0x8 0x0 0xf8200000 0x8000>; @@ -71,7 +79,7 @@ }; }; - pci@f0010800 { + pci0: pci@f0010800 { device_type = "pci"; reg = <0xf0010800 0x10c 0xf00101ac 0x8 0xf00101c4 0x8>; compatible = "fsl,mpc8280-pci", "fsl,pq2-pci"; @@ -142,7 +150,7 @@ reg = <0x119f0 0x10 0x115f0 0x10>; }; - serial@11a00 { + serial0: serial@11a00 { device_type = "serial"; compatible = "fsl,mpc8280-scc-uart", "fsl,cpm2-scc-uart"; @@ -153,7 +161,7 @@ fsl,cpm-command = <0x800000>; }; - serial@11a20 { + serial1: serial@11a20 { device_type = "serial"; compatible = "fsl,mpc8280-scc-uart", "fsl,cpm2-scc-uart"; @@ -164,7 +172,7 @@ fsl,cpm-command = <0x4a00000>; }; - ethernet@11320 { + enet0: ethernet@11320 { device_type = "network"; compatible = "fsl,mpc8280-fcc-enet", "fsl,cpm2-fcc-enet"; @@ -176,7 +184,7 @@ fsl,cpm-command = <0x16200300>; }; - ethernet@11340 { + enet1: ethernet@11340 { device_type = "network"; compatible = "fsl,mpc8280-fcc-enet", "fsl,cpm2-fcc-enet"; -- cgit v1.2.3 From f379188958ae8af30105eb1f27d0e0abf6a51558 Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Sat, 4 Apr 2009 22:31:20 +0400 Subject: fsl-diu-fb: Pass the proper device for dma mapping routines The driver should pass a device that specifies internal DMA ops, but currently NULL pointers are passed, and thus following bug pops up: Freescale DIU driver ------------[ cut here ]------------ kernel BUG at arch/powerpc/include/asm/dma-mapping.h:237! Oops: Exception in kernel mode, sig: 5 [#1] ... NIP [c01658b4] allocate_buf+0x0/0x8 LR [c0306554] fsl_diu_probe+0x2b4/0x518 Call Trace: [df02be10] [c030638c] fsl_diu_probe+0xec/0x518 (unreliable) [df02be60] [c020cdec] of_platform_device_probe+0x5c/0x84 [df02be80] [c018f5d0] really_probe+0x78/0x1a0 [df02bea0] [c018f7c0] __driver_attach+0xa4/0xa8 [df02bec0] [c018ea00] bus_for_each_dev+0x60/0x9c [df02bef0] [c018f414] driver_attach+0x24/0x34 [df02bf00] [c018f168] bus_add_driver+0x12c/0x1cc [df02bf20] [c018fbdc] driver_register+0x6c/0x110 [df02bf30] [c020ccb4] of_register_driver+0x54/0x70 [df02bf40] [c03d0a50] fsl_diu_init+0x70/0xa4 ... This patch fixes the issue. Signed-off-by: Anton Vorontsov Signed-off-by: Kumar Gala --- drivers/video/fsl-diu-fb.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index fb51197d1c9..f153c581cbd 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c @@ -1352,14 +1352,15 @@ static int fsl_diu_resume(struct of_device *ofdev) #endif /* CONFIG_PM */ /* Align to 64-bit(8-byte), 32-byte, etc. */ -static int allocate_buf(struct diu_addr *buf, u32 size, u32 bytes_align) +static int allocate_buf(struct device *dev, struct diu_addr *buf, u32 size, + u32 bytes_align) { u32 offset, ssize; u32 mask; dma_addr_t paddr = 0; ssize = size + bytes_align; - buf->vaddr = dma_alloc_coherent(NULL, ssize, &paddr, GFP_DMA | + buf->vaddr = dma_alloc_coherent(dev, ssize, &paddr, GFP_DMA | __GFP_ZERO); if (!buf->vaddr) return -ENOMEM; @@ -1376,9 +1377,10 @@ static int allocate_buf(struct diu_addr *buf, u32 size, u32 bytes_align) return 0; } -static void free_buf(struct diu_addr *buf, u32 size, u32 bytes_align) +static void free_buf(struct device *dev, struct diu_addr *buf, u32 size, + u32 bytes_align) { - dma_free_coherent(NULL, size + bytes_align, + dma_free_coherent(dev, size + bytes_align, buf->vaddr, (buf->paddr - buf->offset)); return; } @@ -1476,17 +1478,19 @@ static int __devinit fsl_diu_probe(struct of_device *ofdev, machine_data->monitor_port = monitor_port; /* Area descriptor memory pool aligns to 64-bit boundary */ - if (allocate_buf(&pool.ad, sizeof(struct diu_ad) * FSL_AOI_NUM, 8)) + if (allocate_buf(&ofdev->dev, &pool.ad, + sizeof(struct diu_ad) * FSL_AOI_NUM, 8)) return -ENOMEM; /* Get memory for Gamma Table - 32-byte aligned memory */ - if (allocate_buf(&pool.gamma, 768, 32)) { + if (allocate_buf(&ofdev->dev, &pool.gamma, 768, 32)) { ret = -ENOMEM; goto error; } /* For performance, cursor bitmap buffer aligns to 32-byte boundary */ - if (allocate_buf(&pool.cursor, MAX_CURS * MAX_CURS * 2, 32)) { + if (allocate_buf(&ofdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2, + 32)) { ret = -ENOMEM; goto error; } @@ -1554,11 +1558,13 @@ error: i > 0; i--) uninstall_fb(machine_data->fsl_diu_info[i - 1]); if (pool.ad.vaddr) - free_buf(&pool.ad, sizeof(struct diu_ad) * FSL_AOI_NUM, 8); + free_buf(&ofdev->dev, &pool.ad, + sizeof(struct diu_ad) * FSL_AOI_NUM, 8); if (pool.gamma.vaddr) - free_buf(&pool.gamma, 768, 32); + free_buf(&ofdev->dev, &pool.gamma, 768, 32); if (pool.cursor.vaddr) - free_buf(&pool.cursor, MAX_CURS * MAX_CURS * 2, 32); + free_buf(&ofdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2, + 32); if (machine_data->dummy_aoi_virt) fsl_diu_free(machine_data->dummy_aoi_virt, 64); iounmap(dr.diu_reg); @@ -1584,11 +1590,13 @@ static int fsl_diu_remove(struct of_device *ofdev) for (i = ARRAY_SIZE(machine_data->fsl_diu_info); i > 0; i--) uninstall_fb(machine_data->fsl_diu_info[i - 1]); if (pool.ad.vaddr) - free_buf(&pool.ad, sizeof(struct diu_ad) * FSL_AOI_NUM, 8); + free_buf(&ofdev->dev, &pool.ad, + sizeof(struct diu_ad) * FSL_AOI_NUM, 8); if (pool.gamma.vaddr) - free_buf(&pool.gamma, 768, 32); + free_buf(&ofdev->dev, &pool.gamma, 768, 32); if (pool.cursor.vaddr) - free_buf(&pool.cursor, MAX_CURS * MAX_CURS * 2, 32); + free_buf(&ofdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2, + 32); if (machine_data->dummy_aoi_virt) fsl_diu_free(machine_data->dummy_aoi_virt, 64); iounmap(dr.diu_reg); -- cgit v1.2.3