OF-related update for FEC and SCC MAC's
Subsystems (4)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/4 cpm2: Updates for CPM2 pic
This contains important fixes for the CPM2 PIC code. Eliminated CPM_IRQ_OFFSET, pulling the respective interrupt numbers from the interrupt mapping. Updated devicetree files to reflect that. Changed direct IC-related IO accesses to the IO accessors.
---
arch/powerpc/boot/dts/mpc8560ads.dts | 8 ++- arch/powerpc/sysdev/cpm2_pic.c | 78 ++++++++++++---------------------- 2 files changed, 31 insertions(+), 55 deletions(-)
arch/powerpc/boot/dts/mpc8560ads.dts +4 -4
@@ -250,7 +250,7 @@ rx-clock = <1>; tx-clock = <1>; current-speed = <1c200>; - interrupts = <64 1>; + interrupts = <28 1>; interrupt-parent = <90c00>; };
@@ -264,7 +264,7 @@ rx-clock = <2>; tx-clock = <2>; current-speed = <1c200>; - interrupts = <65 1>; + interrupts = <29 1>; interrupt-parent = <90c00>; };
@@ -278,7 +278,7 @@ clock-setup = <ff00ffff 250000>; rx-clock = <15>; tx-clock = <16>; - interrupts = <5d 1>; + interrupts = <21 1>; interrupt-parent = <90c00>; phy-handle = <2452002>; };
@@ -293,7 +293,7 @@ clock-setup = <ffff00ff 3700>; rx-clock = <17>; tx-clock = <18>; - interrupts = <5e 1>; + interrupts = <22 1>; interrupt-parent = <90c00>; phy-handle = <2452003>; };
arch/powerpc/sysdev/cpm2_pic.c +27 -51
171 lines not on this page · raw message
Re: [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic
Quoted 5 lines · Vitaly Bordug
This contains important fixes for the CPM2 PIC code. Eliminated
CPM_IRQ_OFFSET, pulling the respective interrupt numbers from the interrupt mapping. Updated devicetree files to reflect that. Changed direct IC-related IO accesses to the IO accessors.
Since your changing the interrupt numbers, do you mind changing the interrupt sense to match ipic? I was hoping to introduce a generic host_xlate function to cover the various embedded pic's.
- kumar
Re: [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic
Quoted 10 lines · On Mon, 11 Dec 2006 20:21:52 -0600 Kumar Gala <[email protected]> wrote:
Quoted 6 lines · Vitaly Bordug
This contains important fixes for the CPM2 PIC code. Eliminated
CPM_IRQ_OFFSET, pulling the respective interrupt numbers from the interrupt
mapping. Updated devicetree files to reflect that. Changed direct IC-related IO accesses to the IO accessors.
Quoted 3 lines
Since your changing the interrupt numbers, do you mind changing the interrupt sense to match ipic? I was hoping to introduce a generic
host_xlatefunction to cover the various embedded pic's.
Umm, can you pls elaborate what do you want to achieve?
I'm inlining updated patch with cpm2_set_irq_type () func which sets up senses for EXT irq's and PortC irq's. ipic seems to have only EXT irq's hence this approach differs from ipic one...
This contains important fixes for the CPM2 PIC code. Eliminated CPM_IRQ_OFFSET, pulling the respective interrupt numbers from the interrupt mapping. Updated devicetree files to reflect that. Changed direct IC-related IO accesses to the IO accessors.
---
arch/powerpc/boot/dts/mpc8560ads.dts | 8 +- arch/powerpc/sysdev/cpm2_pic.c | 127 ++++++++++++++++++++-------------- arch/powerpc/sysdev/cpm2_pic.h | 9 ++ include/asm-powerpc/mpc8260.h | 32 +++++++++ 4 files changed, 120 insertions(+), 56 deletions(-)
arch/powerpc/boot/dts/mpc8560ads.dts +4 -4
@@ -250,7 +250,7 @@ rx-clock = <1>; tx-clock = <1>; current-speed = <1c200>; - interrupts = <64 1>; + interrupts = <28 1>; interrupt-parent = <90c00>; };
@@ -264,7 +264,7 @@ rx-clock = <2>; tx-clock = <2>; current-speed = <1c200>; - interrupts = <65 1>; + interrupts = <29 1>; interrupt-parent = <90c00>; };
@@ -278,7 +278,7 @@ clock-setup = <ff00ffff 250000>; rx-clock = <15>; tx-clock = <16>; - interrupts = <5d 1>; + interrupts = <21 1>; interrupt-parent = <90c00>; phy-handle = <2452002>; };
@@ -293,7 +293,7 @@ clock-setup = <ffff00ff 3700>; rx-clock = <17>; tx-clock = <18>; - interrupts = <5e 1>; + interrupts = <22 1>; interrupt-parent = <90c00>; phy-handle = <2452003>; };
arch/powerpc/sysdev/cpm2_pic.c +75 -52
234 lines not on this page · raw message
arch/powerpc/sysdev/cpm2_pic.h +9 -0
@@ -1,6 +1,15 @@#ifndef _PPC_KERNEL_CPM2_H#define _PPC_KERNEL_CPM2_H + +/* External IRQS */ +#define CPM2_IRQ_EXT1 19 +#define CPM2_IRQ_EXT7 25 + +/* Port C IRQS */ +#define CPM2_IRQ_PORTC15 48 +#define CPM2_IRQ_PORTC0 63 +extern intctl_cpm2_t *cpm2_intctl;extern unsigned int cpm2_get_irq (void );
include/asm-powerpc/mpc8260.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Since there are many different boards and no standard configuration, +* we have a unique include file for each. Rather than change every +* file that has to include MPC8260 configuration, they all include +* this one and the configuration switching is done here. +*/ +#ifdef __KERNEL__ +#ifndef __ASM_PPC_MPC8260_H__ +#define __ASM_PPC_MPC8260_H__ + + +#ifdef CONFIG_8260 + +#if defined(CONFIG_PQ2ADS ) || defined (CONFIG_PQ2FADS ) +#include <platforms/82xx/pq2ads.h> +#endif + +#ifdef CONFIG_PCI_8260 +#include <platforms/82xx/m82xx_pci.h> +#endif + +#ifndef _ISA_MEM_BASE +#define _ISA_MEM_BASE 0 +#endif + +#ifndef PCI_DRAM_OFFSET +#define PCI_DRAM_OFFSET 0 +#endif + +#endif /* CONFIG_8260 */ +#endif /* !__ASM_PPC_MPC8260_H__ */ +#endif /* __KERNEL__ */
Signature · 2 lines
Sincerely, Vitaly
Re: [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic
Quoted 13 lines · Vitaly Bordug
Quoted 10 lines · On Mon, 11 Dec 2006 20:21:52 -0600 Kumar Gala <[email protected]> wrote:
Quoted 6 lines · Vitaly Bordug
This contains important fixes for the CPM2 PIC code. Eliminated
CPM_IRQ_OFFSET, pulling the respective interrupt numbers from the interrupt
mapping. Updated devicetree files to reflect that. Changed direct IC-related IO accesses to the IO accessors.
Quoted 4 lines
Quoted 3 lines
Since your changing the interrupt numbers, do you mind changing the interrupt sense to match ipic? I was hoping to introduce a generic
host_xlatefunction to cover the various embedded pic's.Umm, can you pls elaborate what do you want to achieve?
Its a minor thing, but the values we picked for ipic to encode sense/polarity match the linux definitions. The idea is that if we use the same encoding on multiple pic's we can sure the host_xlate code.
Quoted 374 lines
I'm inlining updated patch with
cpm2_set_irq_type() func which sets up senses for EXT irq's and PortC irq's. ipic seems to have only EXT irq's hence this approach differs from ipic one...This contains important fixes for the CPM2 PIC code. Eliminated
CPM_IRQ_OFFSET, pulling the respective interrupt numbers from the interrupt mapping. Updated devicetree files to reflect that. Changed direct IC-related IO accesses to the IO accessors.Signed-off-by Vitaly Bordug <[email protected]>---
arch/powerpc/boot/dts/mpc8560ads.dts | 8 +- arch/powerpc/sysdev/cpm2_pic.c | 127 +++++++++++++++++++ +-------------- arch/powerpc/sysdev/cpm2_pic.h | 9 ++ include/asm-powerpc/mpc8260.h | 32 +++++++++ 4 files changed, 120 insertions(+), 56 deletions(-)arch/powerpc/boot/dts/mpc8560ads.dts +4
-4@@ -250,7 +250,7 @@ rx-clock = <1>; tx-clock = <1>; current-speed = <1c200>; - interrupts = <64 1>; + interrupts = <28 1>; interrupt-parent = <90c00>; };@@ -264,7 +264,7 @@ rx-clock = <2>; tx-clock = <2>; current-speed = <1c200>; - interrupts = <65 1>; + interrupts = <29 1>; interrupt-parent = <90c00>; };@@ -278,7 +278,7 @@ clock-setup = <ff00ffff 250000>; rx-clock = <15>; tx-clock = <16>; - interrupts = <5d 1>; + interrupts = <21 1>; interrupt-parent = <90c00>; phy-handle = <2452002>; };@@ -293,7 +293,7 @@ clock-setup = <ffff00ff 3700>; rx-clock = <17>; tx-clock = <18>; - interrupts = <5e 1>; + interrupts = <22 1>; interrupt-parent = <90c00>; phy-handle = <2452003>; };arch/powerpc/sysdev/cpm2_pic.c +64
-30@@ -36,6 +36,7 @@ #include <asm/immap_cpm2.h>#include <asm/mpc8260.h> #include <asm/io.h> #include <asm/prom.h> +#include <asm/fs_pd.h> #include "cpm2_pic.h" @@ -68,68 +69,55 @@ static const u_char irq_to_siubit[] = { 24, 25, 26, 27, 28, 29, 30, 31, }; -static void cpm2_mask_irq (unsigned int irq_nr) +static void cpm2_mask_irq (unsigned int irq) {int bit, word; -volatile uint *simr; - - irq_nr -=CPM_IRQ_OFFSET ; +unsigned int irq_nr = (unsigned int )irq_map[irq].hwirq; bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; - simr = &(cpm2_intctl->ic_simrh); ppc_cached_irq_mask[word] &= ~(1 << bit); - simr[word] = ppc_cached_irq_mask[word]; +out_be32 (&cpm2_intctl->ic_simrh + word, ppc_cached_irq_mask[word]); } -static void cpm2_unmask_irq (unsigned int irq_nr) +static void cpm2_unmask_irq (unsigned int irq) {int bit, word; -volatile uint *simr; - - irq_nr -=CPM_IRQ_OFFSET ; +unsigned int irq_nr = (unsigned int )irq_map[irq].hwirq; bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; - simr = &(cpm2_intctl->ic_simrh); ppc_cached_irq_mask[word] |=1 << bit; - simr[word] = ppc_cached_irq_mask[word]; +out_be32 (&cpm2_intctl->ic_simrh + word, ppc_cached_irq_mask[word]); } -static void cpm2_mask_and_ack (unsigned int irq_nr) +static void cpm2_ack (unsigned int irq) {int bit, word; -volatile uint *simr, *sipnr; - - irq_nr -=CPM_IRQ_OFFSET ; +unsigned int irq_nr = (unsigned int )irq_map[irq].hwirq; bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; - simr = &(cpm2_intctl->ic_simrh); - sipnr = &(cpm2_intctl->ic_sipnrh); - ppc_cached_irq_mask[word] &= ~(1 << bit); - simr[word] = ppc_cached_irq_mask[word]; - sipnr[word] =1 << bit; +out_be32 (&cpm2_intctl->ic_sipnrh + word,1 << bit); } -static void cpm2_end_irq (unsigned int irq_nr) +static void cpm2_end_irq (unsigned int irq) {int bit, word; -volatile uint *simr; +unsigned int irq_nr = (unsigned int )irq_map[irq].hwirq;if (!(irq_desc[irq_nr].status & (IRQ_DISABLED |IRQ_INPROGRESS )) && irq_desc[irq_nr].action) { - irq_nr -=CPM_IRQ_OFFSET ; bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; - simr = &(cpm2_intctl->ic_simrh); ppc_cached_irq_mask[word] |=1 << bit; - simr[word] = ppc_cached_irq_mask[word]; +out_be32 (&cpm2_intctl->ic_simrh + word, ppc_cached_irq_mask[word]); +/* * Work around large numbers of spurious IRQs on PowerPC 82xx * systems. @@ -138,13 +126,59 @@ static void cpm2_end_irq(unsigned int ir } } +static int cpm2_set_irq_type (unsigned int virq,unsigned int flow_type) +{ +unsigned int src = (unsigned int )irq_map[virq].hwirq; +struct irq_desc *desc =get_irq_desc (virq); +unsigned int vold, vnew, edibit; + +if (flow_type ==IRQ_TYPE_NONE ) + flow_type =IRQ_TYPE_LEVEL_LOW ; + +if (flow_type &IRQ_TYPE_EDGE_RISING ) { +printk (KERN_ERR "CPM2 PIC: sense type 0x%x not supported\n" , + flow_type); +return -EINVAL ; + } + + desc->status &= ~(IRQ_TYPE_SENSE_MASK |IRQ_LEVEL ); + desc->status |= flow_type &IRQ_TYPE_SENSE_MASK ; +if (flow_type &IRQ_TYPE_LEVEL_LOW ) { + desc->status |=IRQ_LEVEL ; + desc->handle_irq = handle_level_irq; + }else + desc->handle_irq = handle_edge_irq; + +/* internal IRQ senses are LEVEL_LOW +* EXT IRQ and Port C IRQ senses are programmable +*/ +if (src >=CPM2_IRQ_EXT1 && src <=CPM2_IRQ_EXT7 ) + edibit = (14 - (src -CPM2_IRQ_EXT1 )); +else +if (src >=CPM2_IRQ_PORTC15 && src <=CPM2_IRQ_PORTC0 ) + edibit = (31 - (src -CPM2_IRQ_PORTC15 )); +else +return (flow_type &IRQ_TYPE_LEVEL_LOW ) ?0 : -EINVAL ; + + vold =in_be32 (&cpm2_intctl->ic_siexr); + +if ((flow_type &IRQ_TYPE_SENSE_MASK ) ==IRQ_TYPE_EDGE_FALLING ) + vnew = vold | (1 << edibit); +else + vnew = vold & ~(1 << edibit); + +if (vold != vnew) +out_be32 (&cpm2_intctl->ic_siexr, vnew); +return 0 ; +} +static struct irq_chip cpm2_pic = { .typename =" CPM2 SIU " , - .enable = cpm2_unmask_irq, - .disable = cpm2_mask_irq, + .mask = cpm2_mask_irq, .unmask = cpm2_unmask_irq, - .mask_ack = cpm2_mask_and_ack, - .end = cpm2_end_irq, + .ack = cpm2_ack, + .eoi = cpm2_end_irq, + .set_type = cpm2_set_irq_type, };unsigned int
cpm2_get_irq(void)arch/powerpc/sysdev/cpm2_pic.c +3
-3@@ -154,17 +188,17 @@ unsigned int cpm2_get_irq(void)/* For CPM2, read the SIVEC register and shift the bits down * to get the irq number. */ - bits = cpm2_intctl->ic_sivec; + bits =in_be32 (&cpm2_intctl->ic_sivec); irq = bits >>26 ;if (irq ==0 )return (-1 ); -return irq+CPM_IRQ_OFFSET ; +return irq_linear_revmap (cpm2_pic_host, irq); }static int cpm2_pic_host_match (struct irq_host *h,struct device_node *node) { -return cpm2_pic_node ==NULL || cpm2_pic_node == node; +return cpm2_pic_node == node; }static int cpm2_pic_host_map(struct
irq_host*h, unsigned int virq,arch/powerpc/sysdev/cpm2_pic.c +0
-9@@ -177,15 +211,6 @@ static int cpm2_pic_host_map(struct irq_return 0 ; } -static void cpm2_host_unmap (struct irq_host *h,unsigned int virq) -{ -/* Make sure irq is masked in hardware */ -cpm2_mask_irq (virq); - -/* remove chip and handler */ -set_irq_chip_and_handler (virq,NULL ,NULL ); -} - static int cpm2_pic_host_xlate(struct irq_host *h, struct device_node *ct, u32 *intspec, unsigned int intsize,arch/powerpc/sysdev/cpm2_pic.c +8
-10irq_hw_number_t *out_hwirq, unsigned int *out_flags)@@ -202,14 +227,12 @@ static int cpm2_pic_host_xlate(struct ir *out_flags = map_cpm2_senses[intspec[1 ]]; else *out_flags =IRQ_TYPE_NONE ; -return 0 ; }static struct irq_host_ops cpm2_pic_host_ops = { .match = cpm2_pic_host_match, .map = cpm2_pic_host_map, - .unmap = cpm2_host_unmap, .xlate = cpm2_pic_host_xlate, };@@ -223,26 +246,26 @@ void cpm2_pic_init(struct device_node *n/* Mask out everything */ - cpm2_intctl->ic_simrh =0x00000000 ; - cpm2_intctl->ic_simrl =0x00000000 ; +out_be32 (&cpm2_intctl->ic_simrh,0x00000000 ); +out_be32 (&cpm2_intctl->ic_simrl,0x00000000 );wmb ();/* Ack everything */ - cpm2_intctl->ic_sipnrh =0xffffffff ; - cpm2_intctl->ic_sipnrl =0xffffffff ; +out_be32 (&cpm2_intctl->ic_sipnrh,0xffffffff ); +out_be32 (&cpm2_intctl->ic_sipnrl,0xffffffff );wmb ();/* Dummy read of the vector */ - i = cpm2_intctl->ic_sivec; + i =in_be32 (&cpm2_intctl->ic_sivec);rmb ();/* Initialize the default interrupt mapping priorities, * in case the boot rom changed something on us. */ - cpm2_intctl->ic_sicr =0 ; - cpm2_intctl->ic_scprrh =0x05309770 ; - cpm2_intctl->ic_scprrl =0x05309770 ; +out_be16 (&cpm2_intctl->ic_sicr,0 ); +out_be32 (&cpm2_intctl->ic_scprrh,0x05309770 ); +out_be32 (&cpm2_intctl->ic_scprrl,0x05309770 );/* create a legacy host */ if (node)arch/powerpc/sysdev/cpm2_pic.h +9
-0@@ -1,6 +1,15 @@#ifndef _PPC_KERNEL_CPM2_H#define _PPC_KERNEL_CPM2_H + +/* External IRQS */ +#define CPM2_IRQ_EXT1 19 +#define CPM2_IRQ_EXT7 25 + +/* Port C IRQS */ +#define CPM2_IRQ_PORTC15 48 +#define CPM2_IRQ_PORTC0 63 +extern intctl_cpm2_t *cpm2_intctl;extern unsigned int cpm2_get_irq (void );include/asm-powerpc/mpc8260.h new file +2
-0@@ -0,0 +1,32 @@ +/* +* Since there are many different boards and no standard configuration,
+ * we have a unique include file for each. Rather than change every
+ * file that has to include MPC8260 configuration, they all include
+ * this one and the configuration switching is done here.
+ */include/asm-powerpc/mpc8260.h new file +26
-0+#ifdef __KERNEL__ +#ifndef __ASM_PPC_MPC8260_H__ +#define __ASM_PPC_MPC8260_H__ + + +#ifdef CONFIG_8260 + +#if defined(CONFIG_PQ2ADS ) || defined (CONFIG_PQ2FADS ) +#include <platforms/82xx/pq2ads.h> +#endif + +#ifdef CONFIG_PCI_8260 +#include <platforms/82xx/m82xx_pci.h> +#endif + +#ifndef _ISA_MEM_BASE +#define _ISA_MEM_BASE 0 +#endif + +#ifndef PCI_DRAM_OFFSET +#define PCI_DRAM_OFFSET 0 +#endif + +#endif /* CONFIG_8260 */ +#endif /* !__ASM_PPC_MPC8260_H__ */ +#endif /* __KERNEL__ */ Signature · 3 lines
-- Sincerely, Vitaly
Re: [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic
Quoted 16 lines · On Tue, 12 Dec 2006 13:58:44 -0600 Kumar Gala <[email protected]> wrote:
Quoted 13 lines · Vitaly Bordug
Quoted 10 lines · On Mon, 11 Dec 2006 20:21:52 -0600 Kumar Gala <[email protected]> wrote:
Quoted 6 lines · Vitaly Bordug
This contains important fixes for the CPM2 PIC code. Eliminated
CPM_IRQ_OFFSET, pulling the respective interrupt numbers from the interrupt
mapping. Updated devicetree files to reflect that. Changed direct IC-related IO accesses to the IO accessors.
Quoted 9 lines
Quoted 4 lines
Quoted 3 lines
Since your changing the interrupt numbers, do you mind changing the interrupt sense to match ipic? I was hoping to introduce a generic
host_xlatefunction to cover the various embedded pic's.Umm, can you pls elaborate what do you want to achieve?
Its a minor thing, but the values we picked for ipic to encode sense/ polarity match the linux definitions. The idea is that if we use the same encoding on multiple pic's we can sure the
host_xlatecode.
I started it but faced with the problem:
in 8560, there are both mpic and cpm2 pic. To keep consistency (so that cpm irqs encode sence one way, and generic - mpic - in another), we'll have to modify mpic too, and all the 85xx dts's as well.
Yet doable, it's pretty big change, and I think it should be put to the patch, independent of small fixes I have introduced, and that should come separately (or else we'll have hard time git-bisecting for troubles).
If you envision this way as a proper one for mpic too, I'll head for it though.
Signature · 2 lines
Sincerely, Vitaly
Re: [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic
Quoted 24 lines · Vitaly Bordug
Quoted 21 lines · On Tue, 12 Dec 2006 13:58:44 -0600 Kumar Gala <[email protected]> wrote:
Quoted 17 lines · Vitaly Bordug
Quoted 10 lines · On Mon, 11 Dec 2006 20:21:52 -0600 Kumar Gala <[email protected]> wrote:
Quoted 6 lines · Vitaly Bordug
This contains important fixes for the CPM2 PIC code. Eliminated
CPM_IRQ_OFFSET, pulling the respective interrupt numbers from the interrupt
mapping. Updated devicetree files to reflect that. Changed direct IC-related IO accesses to the IO accessors.Quoted 3 lines
Since your changing the interrupt numbers, do you mind changing the interrupt sense to match ipic? I was hoping to introduce a generic
host_xlatefunction to cover the various embedded pic's.Umm, can you pls elaborate what do you want to achieve?
Quoted 7 lines
Quoted 4 lines
Its a minor thing, but the values we picked for ipic to encode sense/ polarity match the linux definitions. The idea is that if we use the same encoding on multiple pic's we can sure the
host_xlatecode.I started it but faced with the problem:
in 8560, there are both mpic and cpm2 pic. To keep consistency (so that cpm irqs encode sence one way, and generic - mpic - in another), we'll have to modify mpic too, and all the 85xx dts's as well.
Don't worry about mpic, just the cpm2. The idea was for pic's that didn't of existing OF specs like mpic/openpic/i8259, etc. to use the same encoding. Consider mpic grandfathered in and don't worry about it.
- k
Quoted 7 lines
Yet doable, it's pretty big change, and I think it should be put to the patch, independent of small fixes I have introduced, and that should come separately (or else we'll have hard time git-bisecting for troubles).
If you envision this way as a proper one for mpic too, I'll head for it though.
Signature · 2 lines
Sincerely, Vitaly
PATCH 2/4 cpm_uart: OF-related updates
In reply to a message not in the archiveThis makes cpm uart able to work using OF-passed parameters in case of CPM1 stuff (found on most mpc8xx reference and custom boards).
---
drivers/serial/cpm_uart/cpm_uart_cpm1.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-)
drivers/serial/cpm_uart/cpm_uart_cpm1.c +11 -6
@@ -40,6 +40,7 @@ #include <linux/dma-mapping.h>#include <asm/io.h> #include <asm/irq.h> +#include <asm/fs_pd.h> #include <linux/serial_core.h> #include <linux/kernel.h>
@@ -145,7 +146,11 @@ int cpm_uart_allocbuf(struct uart_cpm_po/* was hostalloc but changed cause it blows away the */ /* large tlb mapping when pinning the kernel area */ mem_addr = (u8 *)cpm_dpram_addr (cpm_dpalloc (memsz,8 )); +#ifdef CONFIG_PPC_MERGE + dma_addr = (u32 )cpm_dpram_phys (mem_addr); +#else dma_addr = (u32 )mem_addr; +#endif }else mem_addr =dma_alloc_coherent (NULL , memsz, &dma_addr,GFP_KERNEL );
@@ -205,7 +210,7 @@ # endif (unsigned long )&cpmp->cp_smc[0 ]; cpm_uart_ports[UART_SMC1 ].smcp->smc_smcm |= (SMCM_RX |SMCM_TX ); cpm_uart_ports[UART_SMC1 ].smcp->smc_smcmr &= ~(SMCMR_REN |SMCMR_TEN ); - cpm_uart_ports[UART_SMC1 ].port.uartclk = (((bd_t *) __res)->bi_intfreq); + cpm_uart_ports[UART_SMC1 ].port.uartclk =uart_clock (); cpm_uart_port_map[cpm_uart_nr++] =UART_SMC1 ;#endif
@@ -217,7 +222,7 @@ #ifdef CONFIG_SERIAL_CPM_SMC2 (unsigned long )&cpmp->cp_smc[1 ]; cpm_uart_ports[UART_SMC2 ].smcp->smc_smcm |= (SMCM_RX |SMCM_TX ); cpm_uart_ports[UART_SMC2 ].smcp->smc_smcmr &= ~(SMCMR_REN |SMCMR_TEN ); - cpm_uart_ports[UART_SMC2 ].port.uartclk = (((bd_t *) __res)->bi_intfreq); + cpm_uart_ports[UART_SMC2 ].port.uartclk =uart_clock (); cpm_uart_port_map[cpm_uart_nr++] =UART_SMC2 ;#endif
@@ -231,7 +236,7 @@ #ifdef CONFIG_SERIAL_CPM_SCC1 ~(UART_SCCM_TX |UART_SCCM_RX ); cpm_uart_ports[UART_SCC1 ].sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR |SCC_GSMRL_ENT ); - cpm_uart_ports[UART_SCC1 ].port.uartclk = (((bd_t *) __res)->bi_intfreq); + cpm_uart_ports[UART_SCC1 ].port.uartclk =uart_clock (); cpm_uart_port_map[cpm_uart_nr++] =UART_SCC1 ;#endif
@@ -245,7 +250,7 @@ #ifdef CONFIG_SERIAL_CPM_SCC2 ~(UART_SCCM_TX |UART_SCCM_RX ); cpm_uart_ports[UART_SCC2 ].sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR |SCC_GSMRL_ENT ); - cpm_uart_ports[UART_SCC2 ].port.uartclk = (((bd_t *) __res)->bi_intfreq); + cpm_uart_ports[UART_SCC2 ].port.uartclk =uart_clock (); cpm_uart_port_map[cpm_uart_nr++] =UART_SCC2 ;#endif
@@ -259,7 +264,7 @@ #ifdef CONFIG_SERIAL_CPM_SCC3 ~(UART_SCCM_TX |UART_SCCM_RX ); cpm_uart_ports[UART_SCC3 ].sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR |SCC_GSMRL_ENT ); - cpm_uart_ports[UART_SCC3 ].port.uartclk = (((bd_t *) __res)->bi_intfreq); + cpm_uart_ports[UART_SCC3 ].port.uartclk =uart_clock (); cpm_uart_port_map[cpm_uart_nr++] =UART_SCC3 ;#endif
@@ -273,7 +278,7 @@ #ifdef CONFIG_SERIAL_CPM_SCC4 ~(UART_SCCM_TX |UART_SCCM_RX ); cpm_uart_ports[UART_SCC4 ].sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR |SCC_GSMRL_ENT ); - cpm_uart_ports[UART_SCC4 ].port.uartclk = (((bd_t *) __res)->bi_intfreq); + cpm_uart_ports[UART_SCC4 ].port.uartclk =uart_clock (); cpm_uart_port_map[cpm_uart_nr++] =UART_SCC4 ;#endif return 0 ;
PATCH 3/4 OF-related update for FEC and SCC MAC's
In reply to a message not in the archiveUpdated direct resource pass with ioremap call, make it grant proper IRQ mapping, stuff incompatible with the new approach were respectively put under #ifndef CONFIG_PPC_MERGE.
---
drivers/net/fs_enet/mac-fec.c | 13 +++++++++---- drivers/net/fs_enet/mac-scc.c | 6 ++++-- drivers/net/phy/fixed.c | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-)
drivers/net/fs_enet/mac-fec.c +9 -4
@@ -104,9 +104,9 @@ static int do_pd_setup(struct fs_enet_pr fep->interrupt =platform_get_irq_byname (pdev,"interrupt" );if (fep->interrupt <0 )return -EINVAL ; - + r =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"regs" ); - fep->fec.fecp =(void *)r->start; + fep->fec.fecp = (void *)ioremap (r->start, r->end - r->start +1 );if (fep->fec.fecp ==NULL )return -EINVAL ;
@@ -319,11 +319,14 @@ #endif* Clear any outstanding interrupt. */ FW (fecp, ievent,0xffc0 ); +#ifndef CONFIG_PPC_MERGE FW (fecp, ivec, (fep->interrupt /2 ) <<29 ); - +#else +FW (fecp, ivec, (irq_map[fep->interrupt].hwirq /2 ) <<29 ); +#endif /* -* adjust to speed (only for DUET & RMII) +* adjust to speed (only for DUET & RMII) */ #ifdef CONFIG_DUET if (fpi->use_rmii) {
@@ -418,6 +421,7 @@ static void stop(struct net_device *dev)static void pre_request_irq (struct net_device *dev,int irq) { +#ifndef CONFIG_PPC_MERGE immap_t *immap = fs_enet_immap;u32 siel;
@@ -431,6 +435,7 @@ static void pre_request_irq(struct net_d siel &= ~(0x80000000 >> (irq & ~1 )); out_be32(&immap->im_siu_conf.sc_siel, siel); } +#endif }static void post_free_irq (struct net_device *dev,int irq)
drivers/net/fs_enet/mac-scc.c +4 -2
@@ -121,13 +121,13 @@ static int do_pd_setup(struct fs_enet_prreturn -EINVAL ; r =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"regs" ); - fep->scc.sccp = (void *)r->start; + fep->scc.sccp = (void *)ioremap (r->start, r->end - r->start +1 );if (fep->scc.sccp ==NULL )return -EINVAL ; r =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"pram" ); - fep->scc.ep = (void *)r->start; + fep->scc.ep = (void *)ioremap (r->start, r->end - r->start +1 );if (fep->scc.ep ==NULL )return -EINVAL ;
@@ -397,6 +397,7 @@ static void stop(struct net_device *dev)static void pre_request_irq (struct net_device *dev,int irq) { +#ifndef CONFIG_PPC_MERGE immap_t *immap = fs_enet_immap;u32 siel;
@@ -410,6 +411,7 @@ static void pre_request_irq(struct net_d siel &= ~(0x80000000 >> (irq & ~1 )); out_be32(&immap->im_siu_conf.sc_siel, siel); } +#endif }static void post_free_irq (struct net_device *dev,int irq)
drivers/net/phy/fixed.c +1 -1
@@ -349,7 +349,7 @@ #ifdef CONFIG_FIXED_MII_100_FDXfixed_mdio_register_device (0 ,100 ,1 );#endif -#ifdef CONFIX_FIXED_MII_10_FDX +#ifdef CONFIG_FIXED_MII_10_FDX fixed_mdio_register_device (0 ,10 ,1 );#endif return 0 ;
PATCH 4/4 Fix kernel build errors for mpc8272ads and mpc8560ads.
In reply to a message not in the archiveRecent update of asm-powerpc/io.h caused cpm-related stuff to break in the current kernel. Current patch fixes it, and includes other overhaul and improvements (incomplete list is below). Required for proper functioning of the 8xx stuff as well.
- Updated dts with a chosen node with interrupt controller,
- fixed messed device IDs among CPM2 SoC devices,
- corrected odd header name and fixed type in defines,
- Added 82xx subdir to the powerpc/platforms Makefile, new solely-powerpc header for 8260 family (was using one from arch/ppc, this one cleaned up from the extra stuff).
---
arch/powerpc/boot/dts/mpc8272ads.dts | 15 ++++++++++---- arch/powerpc/platforms/82xx/mpc82xx.c | 2 +- arch/powerpc/platforms/82xx/mpc82xx_ads.c | 2 +- arch/powerpc/platforms/82xx/pq2ads.h | 5 +++-- arch/powerpc/platforms/Makefile | 1 + arch/powerpc/sysdev/cpm2_pic.c | 1 + drivers/net/fs_enet/fs_enet.h | 1 + drivers/serial/cpm_uart/cpm_uart_cpm1.h | 3 --- drivers/serial/cpm_uart/cpm_uart_cpm2.h | 3 --- include/asm-powerpc/fs_pd.h | 7 ++++++ include/asm-powerpc/io.h | 6 +++++ include/asm-powerpc/mpc8260.h | 32 +++++++++++++++++++++++++++++ 12 files changed, 64 insertions(+), 14 deletions(-)
arch/powerpc/boot/dts/mpc8272ads.dts +11 -4
@@ -53,6 +53,13 @@ reg = <00000000 4000000 f4500000 00000020>; }; + chosen { + name = "chosen"; + linux,platform = <0>; + interrupt-controller = <10c00>; + linux,phandle = <400>; + }; + soc8272@f0000000 { #address-cells = <1>; #size-cells = <1>;
@@ -90,7 +97,7 @@ #address-cells = <1>; #size-cells = <0>; device_type = "network"; - device-id = <2>; + device-id = <1>; compatible = "fs_enet"; model = "FCC"; reg = <11300 20 8400 100 11380 30>;
@@ -104,7 +111,7 @@ ethernet@25000 { device_type = "network"; - device-id = <3>; + device-id = <2>; compatible = "fs_enet"; model = "FCC"; reg = <11320 20 8500 100 113b0 30>;
@@ -133,7 +140,7 @@ device_type = "serial"; compatible = "cpm_uart"; model = "SCC"; - device-id = <2>; + device-id = <1>; reg = <11a00 20 8000 100>; current-speed = <1c200>; interrupts = <28 2>;
@@ -147,7 +154,7 @@ device_type = "serial"; compatible = "cpm_uart"; model = "SCC"; - device-id = <5>; + device-id = <4>; reg = <11a60 20 8300 100>; current-speed = <1c200>; interrupts = <2b 2>;
arch/powerpc/platforms/82xx/mpc82xx.c +1 -1
@@ -50,7 +50,7 @@ #include <linux/fs_enet_pd.h>#include <sysdev/fsl_soc.h> #include <sysdev/cpm2_pic.h> -#include "pq2ads_pd.h" +#include "pq2ads.h" static int __init get_freq (char *name,unsigned long *val) {
arch/powerpc/platforms/82xx/mpc82xx_ads.c +1 -1
@@ -51,7 +51,7 @@ #include <linux/fs_enet_pd.h>#include <sysdev/fsl_soc.h> #include <../sysdev/cpm2_pic.h> -#include "pq2ads_pd.h" +#include "pq2ads.h" #ifdef CONFIG_PCI static uint pci_clk_frq;
arch/powerpc/platforms/82xx/pq2ads.h +3 -2
@@ -22,6 +22,7 @@ #ifdef __KERNEL__#ifndef __MACH_ADS8260_DEFS#define __MACH_ADS8260_DEFS +#include <linux/seq_file.h> #include <asm/ppcboot.h> /* For our show_cpuinfo hooks. */
@@ -46,12 +47,12 @@ #define BCSR1_FETH_RST ((uint)0x0400000#define BCSR1_RS232_EN1 ((uint)0x02000000)/* 0 ==enable */ #define BCSR1_RS232_EN2 ((uint)0x01000000)/* 0 ==enable */ #define BCSR3_FETHIEN2 ((uint)0x10000000)/* 0 == enable*/ -#define BCSR3_FETH2_RS ((uint)0x80000000)/* 0 == reset */ +#define BCSR3_FETH2_RST ((uint)0x80000000)/* 0 == reset */ /* cpm serial driver works with constants below */ #define SIU_INT_SMC1 ((uint)0x04+CPM_IRQ_OFFSET) -#define SIU_INT_SMC2i ((uint)0x05+CPM_IRQ_OFFSET) +#define SIU_INT_SMC2 ((uint)0x05+CPM_IRQ_OFFSET)#define SIU_INT_SCC1 ((uint)0x28+CPM_IRQ_OFFSET)#define SIU_INT_SCC2 ((uint)0x29+CPM_IRQ_OFFSET)#define SIU_INT_SCC3 ((uint)0x2a+CPM_IRQ_OFFSET)
arch/powerpc/platforms/Makefile +1 -0
@@ -9,6 +9,7 @@ obj-$(CONFIG_PPC_CHRP) += chrp/ obj-$(CONFIG_4xx) += 4xx/ obj-$(CONFIG_PPC_MPC52xx) += 52xx/ obj-$(CONFIG_PPC_8xx) += 8xx/ +obj-$(CONFIG_PPC_82xx) += 82xx/ obj-$(CONFIG_PPC_83xx) += 83xx/ obj-$(CONFIG_PPC_85xx) += 85xx/ obj-$(CONFIG_PPC_86xx) += 86xx/
arch/powerpc/sysdev/cpm2_pic.c +1 -0
@@ -36,6 +36,7 @@ #include <asm/immap_cpm2.h>#include <asm/mpc8260.h> #include <asm/io.h> #include <asm/prom.h> +#include <asm/fs_pd.h> #include "cpm2_pic.h"
drivers/net/fs_enet/fs_enet.h +1 -0
@@ -9,6 +9,7 @@ #include <linux/phy.h>#include <linux/dma-mapping.h> #include <linux/fs_enet_pd.h> +#include <asm/fs_pd.h> #ifdef CONFIG_CPM1 #include <asm/commproc.h>
drivers/serial/cpm_uart/cpm_uart_cpm1.h +0 -3
@@ -20,9 +20,6 @@ #define SCC2_IRQ (CPM_IRQ_OFFSET + CPMVE#define SCC3_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC3)#define SCC4_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC4) -/* the CPM address */ -#define CPM_ADDR IMAP_ADDR -static inline void cpm_set_brg (int brg,int baud) {cpm_setbrg (brg, baud);
drivers/serial/cpm_uart/cpm_uart_cpm2.h +0 -3
@@ -20,9 +20,6 @@ #define SCC2_IRQ SIU_INT_SCC2#define SCC3_IRQ SIU_INT_SCC3#define SCC4_IRQ SIU_INT_SCC4 -/* the CPM address */ -#define CPM_ADDR CPM_MAP_ADDR -static inline void cpm_set_brg (int brg,int baud) {cpm_setbrg (brg, baud);
include/asm-powerpc/fs_pd.h +7 -0
@@ -17,6 +17,12 @@ #include <asm/time.h>#ifdef CONFIG_CPM2 #include <asm/cpm2.h> +#if defined(CONFIG_8260 ) +#include <asm/mpc8260.h> +#elif defined(CONFIG_85xx) +#include <asm/mpc85xx.h> +#endif +#define cpm2_map (member) \ ({ \ u32 offset = offsetof(cpm2_map_t, member); \
@@ -37,6 +43,7 @@ #endif#ifdef CONFIG_8xx#include <asm/8xx_immap.h> +#include <asm/mpc8xx.h> #define immr_map (member) \ ({ \
include/asm-powerpc/io.h +6 -0
@@ -732,6 +732,12 @@ #define page_to_bus(page) (page_to_phys(#endif /* CONFIG_PPC32 */ +/* access ports */ +#define setbits32 (_addr, _v) out_be32((_addr), in_be32(_addr) | (_v)) +#define clrbits32 (_addr, _v) out_be32((_addr), in_be32(_addr) & ~(_v)) + +#define setbits16 (_addr, _v) out_be16((_addr), in_be16(_addr) | (_v)) +#define clrbits16 (_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v))#endif /* __KERNEL__ */
include/asm-powerpc/mpc8260.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Since there are many different boards and no standard configuration, +* we have a unique include file for each. Rather than change every +* file that has to include MPC8260 configuration, they all include +* this one and the configuration switching is done here. +*/ +#ifdef __KERNEL__ +#ifndef __ASM_PPC_MPC8260_H__ +#define __ASM_PPC_MPC8260_H__ + + +#ifdef CONFIG_8260 + +#if defined(CONFIG_PQ2ADS ) || defined (CONFIG_PQ2FADS ) +#include <platforms/82xx/pq2ads.h> +#endif + +#ifdef CONFIG_PCI_8260 +#include <platforms/82xx/m82xx_pci.h> +#endif + +#ifndef _ISA_MEM_BASE +#define _ISA_MEM_BASE 0 +#endif + +#ifndef PCI_DRAM_OFFSET +#define PCI_DRAM_OFFSET 0 +#endif + +#endif /* CONFIG_8260 */ +#endif /* !__ASM_PPC_MPC8260_H__ */ +#endif /* __KERNEL__ */
Re: [PATCH 4/4] [POWERPC] Fix kernel build errors for mpc8272ads and mpc8560ads.
Quoted 16 lines · Vitaly Bordug
Recent update of
asm-powerpc/io.hcaused cpm-related stuff to break in the current kernel. Current patch fixes it, and includes other overhaul and improvements (incomplete list is below). Required for proper functioning of the 8xx stuff as well.- Updated dts with a chosen node with interrupt controller,
- fixed messed device IDs among CPM2 SoC devices,
- corrected odd header name and fixed type in defines,
- Added 82xx subdir to the powerpc/platformsMakefile, new solely-powerpc header for 8260 family (was using one fromarch/
ppc, this
one cleaned up from the extra stuff).Signed-off-by Vitaly Bordug <[email protected]>---
[snip]
Quoted 6 lines
include/asm-powerpc/fs_pd.h +0
-0
include/asm-powerpc/fs_pd.h #include <asm/time.h> · line 25
Quoted 9 lines
include/asm-powerpc/fs_pd.h +6
-0@@ -17,6 +17,12 @@ #include <asm/time.h>#ifdef CONFIG_CPM2 #include <asm/cpm2.h> +#if defined(CONFIG_8260 ) +#include <asm/mpc8260.h> +#elif defined(CONFIG_85xx) +#include <asm/mpc85xx.h> +#endif +
Why does this need to include these files?
include/asm-powerpc/mpc8260.h
Quoted 39 lines
include/asm-powerpc/fs_pd.h +1
-0#define cpm2_map (member) \ ({ \ u32 offset = offsetof(cpm2_map_t, member); \@@ -37,6 +43,7 @@ #endif#ifdef CONFIG_8xx#include <asm/8xx_immap.h> +#include <asm/mpc8xx.h> #define immr_map (member) \ ({ \include/asm-powerpc/io.h +6
-0@@ -732,6 +732,12 @@ #define page_to_bus(page) (page_to_phys(#endif /* CONFIG_PPC32 */ +/* access ports */ +#define setbits32 (_addr, _v) out_be32((_addr), in_be32(_addr) | (_v)) +#define clrbits32 (_addr, _v) out_be32((_addr), in_be32(_addr) & ~ (_v)) + +#define setbits16 (_addr, _v) out_be16((_addr), in_be16(_addr) | (_v)) +#define clrbits16 (_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v))
#endif /*
__KERNEL__*/include/asm-powerpc/mpc8260.h new file +0
-0
Who needs this header? Is this just for the board code under platforms/82xx?
Quoted 38 lines
include/asm-powerpc/mpc8260.h new file +2
-0@@ -0,0 +1,32 @@ +/* +* Since there are many different boards and no standard configuration,
+ * we have a unique include file for each. Rather than change every
+ * file that has to include MPC8260 configuration, they all include
+ * this one and the configuration switching is done here.
+ */include/asm-powerpc/mpc8260.h new file +26
-0+#ifdef __KERNEL__ +#ifndef __ASM_PPC_MPC8260_H__ +#define __ASM_PPC_MPC8260_H__ + + +#ifdef CONFIG_8260 + +#if defined(CONFIG_PQ2ADS ) || defined (CONFIG_PQ2FADS ) +#include <platforms/82xx/pq2ads.h> +#endif + +#ifdef CONFIG_PCI_8260 +#include <platforms/82xx/m82xx_pci.h> +#endif + +#ifndef _ISA_MEM_BASE +#define _ISA_MEM_BASE 0 +#endif + +#ifndef PCI_DRAM_OFFSET +#define PCI_DRAM_OFFSET 0 +#endif + +#endif /* CONFIG_8260 */ +#endif /* !__ASM_PPC_MPC8260_H__ */ +#endif /* __KERNEL__ */ _______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 4/4] [POWERPC] Fix kernel build errors for mpc8272ads and mpc8560ads.
Quoted 32 lines · On Mon, 11 Dec 2006 20:28:38 -0600 Kumar Gala <[email protected]> wrote:
Quoted 19 lines · Vitaly Bordug
Recent update of
asm-powerpc/io.hcaused cpm-related stuff to break in the
current kernel. Current patch fixes it, and includes other overhaul and
improvements (incomplete list is below). Required for proper functioning of
the 8xx stuff as well.- Updated dts with a chosen node with interrupt controller,
- fixed messed device IDs among CPM2 SoC devices,
- corrected odd header name and fixed type in defines,
- Added 82xx subdir to the powerpc/platformsMakefile, new solely-powerpc header for 8260 family (was using one fromarch/
ppc, this
one cleaned up from the extra stuff).Signed-off-by Vitaly Bordug <[email protected]>---
[snip]
Quoted 9 lines
include/asm-powerpc/fs_pd.h +0
-0@@ -17,6 +17,12 @@ #include <asm/time.h>#ifdef CONFIG_CPM2 #include <asm/cpm2.h>
Quoted 8 lines
include/asm-powerpc/fs_pd.h #include <asm/time.h> · line 25
Quoted 6 lines
include/asm-powerpc/fs_pd.h +6
-0+#if defined(CONFIG_8260 ) +#include <asm/mpc8260.h> +#elif defined(CONFIG_85xx) +#include <asm/mpc85xx.h> +#endif +Why does this need to include these files?
To produce exact answer, I have to build kernel which became temporary trouble after git-pull :) I can say this is mainly for CPM_MAP_ADDR (where CPM immap residing) so that to reset cpm early, and a few other BSP defines(like BCSR), that are delivered with #defines for now.
In fact, upper header sequence used to reside in some common ppc/powerpc header until recent cleanup, and CPM-related stuff were not buildable after that. So, "clean-n-proper" solution is under construction now (to get rid of CPM_MAP_ADDR/IMMAP defines usage at all) but we'd better avoid having "build broken" stuff meanwhile.
Quoted 10 lines
Quoted 10 lines
include/asm-powerpc/fs_pd.h +1
-0#define cpm2_map (member) \ ({ \ u32 offset = offsetof(cpm2_map_t, member); \@@ -37,6 +43,7 @@ #endif#ifdef CONFIG_8xx#include <asm/8xx_immap.h> +#include <asm/mpc8xx.h>
[...]
Quoted 6 lines
include/asm-powerpc/mpc8260.h
Quoted 2 lines
include/asm-powerpc/mpc8260.h new file +0
-0Who needs this header? Is this just for the board code under platforms/82xx?
This header it to triage across 82xx boards and include proper BSP .h file. The process is ongoing to minimize such header-residing stuff though. I found it missing from initial 8272 addition, it is required for proper build/operation (so far, but anyway).
Signature · 2 lines
Sincerely, Vitaly