* [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic
[not found] <20061212012641.5ef493f7@localhost.localdomain>
@ 2006-12-11 22:36 ` Vitaly Bordug
2006-12-12 2:21 ` Kumar Gala
2006-12-11 22:37 ` [PATCH 2/4] [POWERPC] cpm_uart: OF-related updates Vitaly Bordug
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Vitaly Bordug @ 2006-12-11 22:36 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
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 <vbordug@ru.mvista.com>
---
arch/powerpc/boot/dts/mpc8560ads.dts | 8 ++-
arch/powerpc/sysdev/cpm2_pic.c | 78 ++++++++++++----------------------
2 files changed, 31 insertions(+), 55 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index 2b16848..3c1e44a 100644
--- a/arch/powerpc/boot/dts/mpc8560ads.dts
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -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>;
};
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c
index 767ee66..46fb0a2 100644
--- a/arch/powerpc/sysdev/cpm2_pic.c
+++ b/arch/powerpc/sysdev/cpm2_pic.c
@@ -68,68 +68,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.
@@ -140,11 +127,10 @@ static void cpm2_end_irq(unsigned int ir
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,
};
unsigned int cpm2_get_irq(void)
@@ -154,17 +140,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,
@@ -177,15 +163,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,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
@@ -209,7 +186,6 @@ static int cpm2_pic_host_xlate(struct ir
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 +199,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)
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/4] [POWERPC] cpm_uart: OF-related updates
[not found] <20061212012641.5ef493f7@localhost.localdomain>
2006-12-11 22:36 ` [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic Vitaly Bordug
@ 2006-12-11 22:37 ` Vitaly Bordug
2006-12-11 22:37 ` [PATCH 3/4] [FS_ENET] OF-related update for FEC and SCC MAC's Vitaly Bordug
2006-12-11 22:37 ` [PATCH 4/4] [POWERPC] Fix kernel build errors for mpc8272ads and mpc8560ads Vitaly Bordug
3 siblings, 0 replies; 11+ messages in thread
From: Vitaly Bordug @ 2006-12-11 22:37 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
This makes cpm uart able to work using OF-passed parameters
in case of CPM1 stuff (found on most mpc8xx reference and custom
boards).
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
---
drivers/serial/cpm_uart/cpm_uart_cpm1.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 08e55fd..3ed4622 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -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;
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/4] [FS_ENET] OF-related update for FEC and SCC MAC's
[not found] <20061212012641.5ef493f7@localhost.localdomain>
2006-12-11 22:36 ` [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic Vitaly Bordug
2006-12-11 22:37 ` [PATCH 2/4] [POWERPC] cpm_uart: OF-related updates Vitaly Bordug
@ 2006-12-11 22:37 ` Vitaly Bordug
2006-12-11 22:37 ` [PATCH 4/4] [POWERPC] Fix kernel build errors for mpc8272ads and mpc8560ads Vitaly Bordug
3 siblings, 0 replies; 11+ messages in thread
From: Vitaly Bordug @ 2006-12-11 22:37 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
Updated 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.
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
---
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(-)
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index c2c5fd4..474d6d7 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -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)
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index 95ec587..62057f4 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -121,13 +121,13 @@ static int do_pd_setup(struct fs_enet_pr
return -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)
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 096d4a1..8613539 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -349,7 +349,7 @@ #ifdef CONFIG_FIXED_MII_100_FDX
fixed_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;
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/4] [POWERPC] Fix kernel build errors for mpc8272ads and mpc8560ads.
[not found] <20061212012641.5ef493f7@localhost.localdomain>
` (2 preceding siblings ...)
2006-12-11 22:37 ` [PATCH 3/4] [FS_ENET] OF-related update for FEC and SCC MAC's Vitaly Bordug
@ 2006-12-11 22:37 ` Vitaly Bordug
2006-12-12 2:28 ` Kumar Gala
3 siblings, 1 reply; 11+ messages in thread
From: Vitaly Bordug @ 2006-12-11 22:37 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
Recent 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).
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
---
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(-)
diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts
index 34efdd0..536c1a5 100644
--- a/arch/powerpc/boot/dts/mpc8272ads.dts
+++ b/arch/powerpc/boot/dts/mpc8272ads.dts
@@ -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>;
diff --git a/arch/powerpc/platforms/82xx/mpc82xx.c b/arch/powerpc/platforms/82xx/mpc82xx.c
index 0f5b30d..74e7892 100644
--- a/arch/powerpc/platforms/82xx/mpc82xx.c
+++ b/arch/powerpc/platforms/82xx/mpc82xx.c
@@ -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)
{
diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
index ea880f1..7334c1a 100644
--- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
@@ -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;
diff --git a/arch/powerpc/platforms/82xx/pq2ads.h b/arch/powerpc/platforms/82xx/pq2ads.h
index fb2f92b..5b5cca6 100644
--- a/arch/powerpc/platforms/82xx/pq2ads.h
+++ b/arch/powerpc/platforms/82xx/pq2ads.h
@@ -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)
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index 961021b..f563212 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -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/
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c
index 46fb0a2..1c50b04 100644
--- a/arch/powerpc/sysdev/cpm2_pic.c
+++ b/arch/powerpc/sysdev/cpm2_pic.c
@@ -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"
diff --git a/drivers/net/fs_enet/fs_enet.h b/drivers/net/fs_enet/fs_enet.h
index 92590d8..569be22 100644
--- a/drivers/net/fs_enet/fs_enet.h
+++ b/drivers/net/fs_enet/fs_enet.h
@@ -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>
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.h b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
index 5eb49ea..a99e45e 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.h
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
@@ -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);
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.h b/drivers/serial/cpm_uart/cpm_uart_cpm2.h
index 4b77911..1b3219f 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.h
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.h
@@ -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);
diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h
index 4c3af35..c624915 100644
--- a/include/asm-powerpc/fs_pd.h
+++ b/include/asm-powerpc/fs_pd.h
@@ -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) \
({ \
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 1cd5323..301c9bb 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -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__ */
diff --git a/include/asm-powerpc/mpc8260.h b/include/asm-powerpc/mpc8260.h
new file mode 100644
index 0000000..c2adcb0
--- /dev/null
+++ b/include/asm-powerpc/mpc8260.h
@@ -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__ */
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic
2006-12-11 22:36 ` [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic Vitaly Bordug
@ 2006-12-12 2:21 ` Kumar Gala
2006-12-12 18:55 ` Vitaly Bordug
0 siblings, 1 reply; 11+ messages in thread
From: Kumar Gala @ 2006-12-12 2:21 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: linuxppc-dev, Paul Mackerras
On Dec 11, 2006, at 4:36 PM, Vitaly Bordug wrote:
>
> 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 4/4] [POWERPC] Fix kernel build errors for mpc8272ads and mpc8560ads.
2006-12-11 22:37 ` [PATCH 4/4] [POWERPC] Fix kernel build errors for mpc8272ads and mpc8560ads Vitaly Bordug
@ 2006-12-12 2:28 ` Kumar Gala
2006-12-12 18:49 ` Vitaly Bordug
0 siblings, 1 reply; 11+ messages in thread
From: Kumar Gala @ 2006-12-12 2:28 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: linuxppc-dev, Paul Mackerras
On Dec 11, 2006, at 4:37 PM, Vitaly Bordug wrote:
>
> Recent 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).
>
> Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
> ---
[snip]
>
> diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h
> index 4c3af35..c624915 100644
> --- a/include/asm-powerpc/fs_pd.h
> +++ b/include/asm-powerpc/fs_pd.h
> @@ -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?
> #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) \
> ({ \
>
> diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
> index 1cd5323..301c9bb 100644
> --- a/include/asm-powerpc/io.h
> +++ b/include/asm-powerpc/io.h
> @@ -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__ */
>
> diff --git a/include/asm-powerpc/mpc8260.h b/include/asm-powerpc/
> mpc8260.h
> new file mode 100644
> index 0000000..c2adcb0
> --- /dev/null
> +++ b/include/asm-powerpc/mpc8260.h
Who needs this header? Is this just for the board code under
platforms/82xx?
> @@ -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__ */
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 4/4] [POWERPC] Fix kernel build errors for mpc8272ads and mpc8560ads.
2006-12-12 2:28 ` Kumar Gala
@ 2006-12-12 18:49 ` Vitaly Bordug
0 siblings, 0 replies; 11+ messages in thread
From: Vitaly Bordug @ 2006-12-12 18:49 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras
On Mon, 11 Dec 2006 20:28:38 -0600
Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Dec 11, 2006, at 4:37 PM, Vitaly Bordug wrote:
>
> >
> > Recent 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).
> >
> > Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
> > ---
> [snip]
> >
> > diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h
> > index 4c3af35..c624915 100644
> > --- a/include/asm-powerpc/fs_pd.h
> > +++ b/include/asm-powerpc/fs_pd.h
> > @@ -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?
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.
>
> > #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>
> >
[...]
> > --- /dev/null
> > +++ b/include/asm-powerpc/mpc8260.h
>
> Who 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).
--
Sincerely,
Vitaly
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic
2006-12-12 2:21 ` Kumar Gala
@ 2006-12-12 18:55 ` Vitaly Bordug
2006-12-12 19:58 ` Kumar Gala
0 siblings, 1 reply; 11+ messages in thread
From: Vitaly Bordug @ 2006-12-12 18:55 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras
On Mon, 11 Dec 2006 20:21:52 -0600
Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Dec 11, 2006, at 4:36 PM, Vitaly Bordug wrote:
>
> >
> > 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.
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.
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
---
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(-)
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index 2b16848..3c1e44a 100644
--- a/arch/powerpc/boot/dts/mpc8560ads.dts
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -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>;
};
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c
index 767ee66..bf5c952 100644
--- a/arch/powerpc/sysdev/cpm2_pic.c
+++ b/arch/powerpc/sysdev/cpm2_pic.c
@@ -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)
@@ -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,
@@ -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,
irq_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)
diff --git a/arch/powerpc/sysdev/cpm2_pic.h b/arch/powerpc/sysdev/cpm2_pic.h
index 2840616..643a857 100644
--- a/arch/powerpc/sysdev/cpm2_pic.h
+++ b/arch/powerpc/sysdev/cpm2_pic.h
@@ -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);
diff --git a/include/asm-powerpc/mpc8260.h b/include/asm-powerpc/mpc8260.h
new file mode 100644
index 0000000..c2adcb0
--- /dev/null
+++ b/include/asm-powerpc/mpc8260.h
@@ -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__ */
--
Sincerely,
Vitaly
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic
2006-12-12 18:55 ` Vitaly Bordug
@ 2006-12-12 19:58 ` Kumar Gala
2006-12-13 8:35 ` Vitaly Bordug
0 siblings, 1 reply; 11+ messages in thread
From: Kumar Gala @ 2006-12-12 19:58 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: linuxppc-dev, Paul Mackerras
On Dec 12, 2006, at 12:55 PM, Vitaly Bordug wrote:
> On Mon, 11 Dec 2006 20:21:52 -0600
> Kumar Gala <galak@kernel.crashing.org> wrote:
>
>>
>> On Dec 11, 2006, at 4:36 PM, Vitaly Bordug wrote:
>>
>>>
>>> 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.
> 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.
> 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 <vbordug@ru.mvista.com>
> ---
>
> 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(-)
>
> diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/
> boot/dts/mpc8560ads.dts
> index 2b16848..3c1e44a 100644
> --- a/arch/powerpc/boot/dts/mpc8560ads.dts
> +++ b/arch/powerpc/boot/dts/mpc8560ads.dts
> @@ -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>;
> };
> diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/
> cpm2_pic.c
> index 767ee66..bf5c952 100644
> --- a/arch/powerpc/sysdev/cpm2_pic.c
> +++ b/arch/powerpc/sysdev/cpm2_pic.c
> @@ -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)
> @@ -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,
> @@ -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,
> irq_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)
> diff --git a/arch/powerpc/sysdev/cpm2_pic.h b/arch/powerpc/sysdev/
> cpm2_pic.h
> index 2840616..643a857 100644
> --- a/arch/powerpc/sysdev/cpm2_pic.h
> +++ b/arch/powerpc/sysdev/cpm2_pic.h
> @@ -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);
> diff --git a/include/asm-powerpc/mpc8260.h b/include/asm-powerpc/
> mpc8260.h
> new file mode 100644
> index 0000000..c2adcb0
> --- /dev/null
> +++ b/include/asm-powerpc/mpc8260.h
> @@ -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__ */
>
>
> --
> Sincerely,
> Vitaly
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic
2006-12-12 19:58 ` Kumar Gala
@ 2006-12-13 8:35 ` Vitaly Bordug
2006-12-13 8:47 ` Kumar Gala
0 siblings, 1 reply; 11+ messages in thread
From: Vitaly Bordug @ 2006-12-13 8:35 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras
On Tue, 12 Dec 2006 13:58:44 -0600
Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Dec 12, 2006, at 12:55 PM, Vitaly Bordug wrote:
>
> > On Mon, 11 Dec 2006 20:21:52 -0600
> > Kumar Gala <galak@kernel.crashing.org> wrote:
> >
> >>
> >> On Dec 11, 2006, at 4:36 PM, Vitaly Bordug wrote:
> >>
> >>>
> >>> 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.
> > 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.
>
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.
--
Sincerely,
Vitaly
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic
2006-12-13 8:35 ` Vitaly Bordug
@ 2006-12-13 8:47 ` Kumar Gala
0 siblings, 0 replies; 11+ messages in thread
From: Kumar Gala @ 2006-12-13 8:47 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: linuxppc-dev, Paul Mackerras
On Dec 13, 2006, at 2:35 AM, Vitaly Bordug wrote:
> On Tue, 12 Dec 2006 13:58:44 -0600
> Kumar Gala <galak@kernel.crashing.org> wrote:
>
>>
>> On Dec 12, 2006, at 12:55 PM, Vitaly Bordug wrote:
>>
>>> On Mon, 11 Dec 2006 20:21:52 -0600
>>> Kumar Gala <galak@kernel.crashing.org> wrote:
>>>
>>>>
>>>> On Dec 11, 2006, at 4:36 PM, Vitaly Bordug wrote:
>>>>
>>>>>
>>>>> 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.
>>> 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.
>>
> 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
> 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.
>
> --
> Sincerely,
> Vitaly
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-12-13 8:47 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20061212012641.5ef493f7@localhost.localdomain>
2006-12-11 22:36 ` [PATCH 1/4] [POWERPC] cpm2: Updates for CPM2 pic Vitaly Bordug
2006-12-12 2:21 ` Kumar Gala
2006-12-12 18:55 ` Vitaly Bordug
2006-12-12 19:58 ` Kumar Gala
2006-12-13 8:35 ` Vitaly Bordug
2006-12-13 8:47 ` Kumar Gala
2006-12-11 22:37 ` [PATCH 2/4] [POWERPC] cpm_uart: OF-related updates Vitaly Bordug
2006-12-11 22:37 ` [PATCH 3/4] [FS_ENET] OF-related update for FEC and SCC MAC's Vitaly Bordug
2006-12-11 22:37 ` [PATCH 4/4] [POWERPC] Fix kernel build errors for mpc8272ads and mpc8560ads Vitaly Bordug
2006-12-12 2:28 ` Kumar Gala
2006-12-12 18:49 ` Vitaly Bordug
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).