MPC52xx updates : sparse clean-ups
PATCH 1/2 MPC52xx updates : sparse clean-ups
Hi Tom & all
Here's some updates related to the Freescale MPC52xx. First some clean-ups for sparse warnings and then PCI support. I'd like to get theses approved & merged before I submit conversion to platform bus model.
As usual, the patches can also be pulled of a bk repository :
bk://tnt.bkbits.net/linux-2.5-mpc52xx-pending
(note it's _NOT_ the same url as before even if it's close ;)
Sylvain
---
arch/ppc/syslib/mpc52xx_pic.c 2005-03-11 20:41:36 +01:00 +0 -0
@@ -33,8 +33,8 @@
#include <asm/mpc52xx.h>
-static struct mpc52xx_intr *intr;
-static struct mpc52xx_sdma *sdma;
+static struct mpc52xx_intr __iomem *intr;
+static struct mpc52xx_sdma __iomem *sdma;
static voidmpc52xx_ic_disable(unsigned int irq)
@@ -173,7 +173,7 @@
mpc52xx_ic_disable, /* disable(irq) */
mpc52xx_ic_disable_and_ack, /* disable_and_ack(irq) */
mpc52xx_ic_end, /* end(irq) */
- 0 /* set_affinity(irq, cpumask) SMP. */
+ NULL /* set_affinity(irq, cpumask) SMP. */};
void __init
@@ -183,10 +183,8 @@
u32 intr_ctrl;
/* Remap the necessary zones */- intr = (struct mpc52xx_intr *)
- ioremap(MPC52xx_INTR, sizeof(struct mpc52xx_intr));
- sdma = (struct mpc52xx_sdma *)
- ioremap(MPC52xx_SDMA, sizeof(struct mpc52xx_sdma));
+ intr = ioremap(MPC52xx_INTR, sizeof(struct mpc52xx_intr));
+ sdma = ioremap(MPC52xx_SDMA, sizeof(struct mpc52xx_sdma));
if ((intr==NULL) || (sdma==NULL))
panic("Can't ioremap PIC/SDMA register for init_irq !");arch/ppc/syslib/mpc52xx_setup.c 2005-03-11 20:41:36 +01:00 +0 -0
@@ -39,7 +39,8 @@
voidmpc52xx_restart(char *cmd)
{
- struct mpc52xx_gpt* gpt0 = (struct mpc52xx_gpt*) MPC52xx_GPTx(0);
+ struct mpc52xx_gpt __iomem *gpt0 =
+ (struct mpc52xx_gpt __iomem *) MPC52xx_GPTx(0);
local_irq_disable();
@@ -102,7 +103,7 @@
#endif
static void
-mpc52xx_psc_putc(struct mpc52xx_psc * psc, unsigned char c) +mpc52xx_psc_putc(struct mpc52xx_psc __iomem *psc, unsigned char c)
{
while (!(in_be16(&psc->mpc52xx_psc_status) &
MPC52xx_PSC_SR_TXRDY));@@ -112,8 +113,9 @@
voidmpc52xx_progress(char *s, unsigned short hex)
{
- struct mpc52xx_psc *psc = (struct mpc52xx_psc *)MPC52xx_CONSOLE;
char c;+ struct mpc52xx_psc __iomem *psc =
+ (struct mpc52xx_psc __iomem *)MPC52xx_CONSOLE;
while ((c = *s++) != 0) {
if (c == '\n')
@@ -138,11 +140,11 @@
* else get size from sdram config registers
*/
if (ramsize == 0) {
- struct mpc52xx_mmap_ctl *mmap_ctl;
+ struct mpc52xx_mmap_ctl __iomem *mmap_ctl;
u32 sdram_config_0, sdram_config_1;
/* Temp BAT2 mapping active when this is called ! */- mmap_ctl = (struct mpc52xx_mmap_ctl*) MPC52xx_MMAP_CTL;
+ mmap_ctl = (struct mpc52xx_mmap_ctl __iomem *) MPC52xx_MMAP_CTL;
sdram_config_0 = in_be32(&mmap_ctl->sdram0);
sdram_config_1 = in_be32(&mmap_ctl->sdram1);
@@ -169,13 +171,11 @@
/* if bootloader didn't pass bus frequencies, calculate them */
if (xlbfreq == 0) {
/* Get RTC & Clock manager modules */
- struct mpc52xx_rtc *rtc;
- struct mpc52xx_cdm *cdm;
+ struct mpc52xx_rtc __iomem *rtc;
+ struct mpc52xx_cdm __iomem *cdm;- rtc = (struct mpc52xx_rtc*)
- ioremap(MPC52xx_RTC, sizeof(struct mpc52xx_rtc));
- cdm = (struct mpc52xx_cdm*)
- ioremap(MPC52xx_CDM, sizeof(struct mpc52xx_cdm));
+ rtc = ioremap(MPC52xx_RTC, sizeof(struct mpc52xx_rtc));
+ cdm = ioremap(MPC52xx_CDM, sizeof(struct mpc52xx_cdm));
if ((rtc==NULL) || (cdm==NULL))
panic("Can't ioremap RTC/CDM while computing bus
freq");
@@ -212,8 +212,8 @@
__res.bi_pcifreq = pcifreq;
/* Release mapping */
- iounmap((void*)rtc);
- iounmap((void*)cdm);
+ iounmap(rtc);
+ iounmap(cdm);
}
divisor = 4;drivers/serial/mpc52xx_uart.c 2005-03-11 20:41:36 +01:00 +1 -1
@@ -86,7 +86,7 @@ * the console_init */ -#define PSC(port) ((struct mpc52xx_psc *)((port)->membase)) +#define PSC(port) ((struct mpc52xx_psc __iomem *)((port)->membase))
/* Forward declaration of the interruption handling routine */ @@ -190,7 +190,7 @@
static intmpc52xx_uart_startup(struct uart_port *port)
{
- struct mpc52xx_psc *psc = PSC(port);
+ struct mpc52xx_psc __iomem *psc = PSC(port);
/* Reset/activate the port, clear and enable interrupts */
out_8(&psc->command,MPC52xx_PSC_RST_RX);@@ -217,7 +217,7 @@
static voidmpc52xx_uart_shutdown(struct uart_port *port)
{
- struct mpc52xx_psc *psc = PSC(port);
+ struct mpc52xx_psc __iomem *psc = PSC(port);
/* Shut down the port, interrupt and all */
out_8(&psc->command,MPC52xx_PSC_RST_RX);@@ -231,7 +231,7 @@
mpc52xx_uart_set_termios(struct uart_port *port, struct termios *new,
struct termios *old)
{
- struct mpc52xx_psc *psc = PSC(port);
+ struct mpc52xx_psc __iomem *psc = PSC(port);
unsigned long flags;
unsigned char mr1, mr2;
unsigned short ctr;@@ -562,7 +562,7 @@
mpc52xx_console_get_options(struct uart_port *port,
int *baud, int *parity, int *bits, int *flow)
{
- struct mpc52xx_psc *psc = PSC(port);
+ struct mpc52xx_psc __iomem *psc = PSC(port);
unsigned char mr1;
/* Read the mode registers */
@@ -592,7 +592,7 @@
mpc52xx_console_write(struct console *co, const char *s, unsigned int count)
{
struct uart_port *port = &mpc52xx_uart_ports[co->index];
- struct mpc52xx_psc *psc = PSC(port);
+ struct mpc52xx_psc __iomem *psc = PSC(port);
unsigned int i, j;
/* Disable interrupts */Re: [PATCH 2/2] MPC52xx updates : PCI Support
And here's the second patch :
# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2005/03/11 19:58:21+01:00 [email protected]
# ppc32: Add PCI bus support for Freescale MPC52xx
# # Note that this support has "known" problem but theses
# are believed to be due to hardware issues.
# # Signed-off-by: Sylvain Munaut <[email protected]>
#
# arch/ppc/syslib/mpc52xx_pci.h # 2005/03/11 19:57:56+01:00 [email protected] +139 -0 # ppc32: Add PCI bus support for Freescale MPC52xx # # include/linux/pci_ids.h # 2005/03/11 19:57:56+01:00 [email protected] +1 -0 # ppc32: Add PCI bus support for Freescale MPC52xx # # include/asm-ppc/mpc52xx.h # 2005/03/11 19:57:56+01:00 [email protected] +2 -0 # ppc32: Add PCI bus support for Freescale MPC52xx # # arch/ppc/syslib/mpc52xx_pci.h # 2005/03/11 19:57:56+01:00 [email protected] +0 -0 # BitKeeper file /home/tnt/musicbox/kernel/linux-2.5-mpc52xx-pending/arch/ppc/syslib/mpc52xx_pci.h # # arch/ppc/syslib/mpc52xx_pci.c # 2005/03/11 19:57:56+01:00 [email protected] +235 -0 # ppc32: Add PCI bus support for Freescale MPC52xx # # arch/ppc/syslib/Makefile # 2005/03/11 19:57:56+01:00 [email protected] +3 -0 # ppc32: Add PCI bus support for Freescale MPC52xx # # arch/ppc/platforms/lite5200.c # 2005/03/11 19:57:56+01:00 [email protected] +33 -3 # ppc32: Add PCI bus support for Freescale MPC52xx # # arch/ppc/Kconfig # 2005/03/11 19:57:56+01:00 [email protected] +1 -1 # ppc32: Add PCI bus support for Freescale MPC52xx # # arch/ppc/syslib/mpc52xx_pci.c # 2005/03/11 19:57:56+01:00 [email protected] +0 -0 # BitKeeper file /home/tnt/musicbox/kernel/linux-2.5-mpc52xx-pending/arch/ppc/syslib/mpc52xx_pci.c # diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig --- a/arch/ppc/Kconfig 2005-03-11 20:41:56 +01:00 +++ b/arch/ppc/Kconfig 2005-03-11 20:41:56 +01:00 @@ -1097,7 +1097,7 @@ bool
config PCI
- bool "PCI support" if 40x || CPM2 || 83xx || 85xx
+ bool "PCI support" if 40x || CPM2 || 83xx || 85xx || PPC_MPC52xx
default y if !40x && !CPM2 && !8xx && !APUS && !83xx && !85xx
default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
default PCI_QSPAN if !4xx && !CPM2 && 8xxarch/ppc/platforms/lite5200.c 2005-03-11 20:41:56 +01:00 +0 -0
@@ -35,6 +35,8 @@
#include <asm/ocp.h>
#include <asm/mpc52xx.h>
+#include <syslib/mpc52xx_pci.h>
+
extern int powersave_nap;
fdef CONFIG_PCI
+static int
+lite5200_map_irq(struct pci_dev *dev, unsigned char idsel,
+ unsigned char pin) {
+ return (pin == 1) && (idsel==24) ? MPC52xx_IRQ0 : -1;
+}
+#endif
+
static void __initlite5200_setup_cpu(void)
{
+ struct mpc52xx_xlb __iomem *xlb;
struct mpc52xx_intr __iomem *intr;
u32 intr_ctrl;
/* Map zones */
+ xlb = ioremap(MPC52xx_XLB,sizeof(struct mpc52xx_xlb));
intr = ioremap(MPC52xx_INTR,sizeof(struct mpc52xx_intr));- if (!intr) {
- printk("lite5200.c: Error while mapping INTR during lite5200_setup_cpu\n");
+ if (!xlb || !intr) {
+ printk("lite5200.c: Error while mapping XLB/INTR during lite5200_setup_cpu\n");
goto unmap_regs;
}+ /* Configure the XLB Arbiter */
+ out_be32(&xlb->master_pri_enable, 0xff);
+ out_be32(&xlb->master_priority, 0x11111111);
+
+ /* Enable ram snooping for 1GB window */
+ out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_SNOOP);
+ out_be32(&xlb->snoop_window, MPC52xx_PCI_TARGET_MEM | 0x1d);
+
/* IRQ[0-3] setup : IRQ0 - Level Active Low */
/* IRQ[1-3] - Level Active High */
intr_ctrl = in_be32(&intr->ctrl);@@ -103,6 +123,7 @@
/* Unmap reg zone */
unmap_regs:
+ if (xlb) iounmap(xlb);
if (intr) iounmap(intr);
}@@ -114,6 +135,11 @@
/* CPU & Port mux setup */
lite5200_setup_cpu();+
+#ifdef CONFIG_PCI
+ /* PCI Bridge setup */
+ mpc52xx_find_bridges();
+#endif
}
void __init
@@ -152,7 +178,7 @@
/* BAT setup */
mpc52xx_set_bat();- /* No ISA bus AFAIK */
+ /* No ISA bus by default */
isa_io_base = 0;
isa_mem_base = 0;@@ -165,6 +191,10 @@
ppc_md.show_percpuinfo = NULL;
ppc_md.init_IRQ = mpc52xx_init_irq;
ppc_md.get_irq = mpc52xx_get_irq;+
+#ifdef CONFIG_PCI
+ ppc_md.pci_map_irq = lite5200_map_irq;
+#endif
ppc_md.find_end_of_memory = mpc52xx_find_end_of_memory;
ppc_md.setup_io_mappings = mpc52xx_map_io;arch/ppc/syslib/Makefile 2005-03-11 20:41:56 +01:00 +0 -0
@@ -106,3 +106,6 @@
endif
obj-$(CONFIG_MPC8555_CDS) += todc_time.o
obj-$(CONFIG_PPC_MPC52xx) += mpc52xx_setup.o mpc52xx_pic.o
+ifeq ($(CONFIG_PPC_MPC52xx),y)
+obj-$(CONFIG_PCI) += mpc52xx_pci.o
+endif
arch/ppc/syslib/mpc52xx_pci.c 2005-03-11 20:41:56 +01:00 renamed from dev/null Wed Dec 31 16:00:00 196900 +235 -0
235 lines not on this page · raw message
arch/ppc/syslib/mpc52xx_pci.h 2005-03-11 20:41:56 +01:00 renamed from dev/null Wed Dec 31 16:00:00 196900 +138 -0
138 lines not on this page · raw message
include/asm-ppc/mpc52xx.h 2005-03-11 20:41:56 +01:00 +0 -0
@@ -393,6 +393,8 @@
extern void mpc52xx_calibrate_decr(void);
extern void mpc52xx_add_board_devices(struct ocp_def board_ocp[]);
+extern void mpc52xx_find_bridges(void);
+
#endif /* __ASSEMBLY__ */
include/linux/pci_ids.h 2005-03-11 20:41:56 +01:00 +0 -0
@@ -807,6 +807,7 @@
#define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803
#define PCI_DEVICE_ID_MOTOROLA_CPX8216 0x4806
#define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b
+#define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803
#define PCI_VENDOR_ID_PROMISE 0x105a
#define PCI_DEVICE_ID_PROMISE_20265 0x0d30
Re: [PATCH 2/2] MPC52xx updates : PCI Support
The first hunk of arch/ppc/platforms/lite5200.c looks corrupted. See the line beginning "fdef CONFIG_PCI".
-Dale
Quoted 1 line · Sylvain Munaut
And here's the second patch :
[ deleted lines ]
Quoted 13 lines
diff -Nru
a/arch/ppc/platforms/lite5200.cb/arch/ppc/platforms/lite5200.carch/ppc/platforms/lite5200.c 2005-03-11 20:41:56 +01:00 +2
-0@@ -35,6 +35,8 @@ #include <asm/ocp.h> #include <asm/mpc52xx.h> +#include <syslib/mpc52xx_pci.h> + extern int powersave_nap;fdef
CONFIG_PCI
arch/ppc/platforms/lite5200.c 2005-03-11 20:41:56 +01:00
Quoted 6 lines
arch/ppc/platforms/lite5200.c 2005-03-11 20:41:56 +01:00 +6
-0+static int +lite5200_map_irq(struct pci_dev *dev, unsigned char idsel, + unsigned char pin) { + return (pin == 1) && (idsel==24) ? MPC52xx_IRQ0 : -1; +} +#endif
[ more deleted lines ]
Re: [PATCH 2/2] MPC52xx updates : PCI Support
Quoted 7 lines · Dale Farnsworth
The first hunk of
arch/ppc/platforms/lite5200.clooks corrupted. See the line beginning "fdefCONFIG_PCI".-Dale
Damn, you're right and even the first patch is screwed, half of it is missing.
Discard theses, I'll put them on-line somewhere and post the urls.
Sylvain
Quoted 41 lines · Sylvain Munaut
Quoted 5 lines
And here's the second patch :
[ deleted lines ]
Quoted 15 lines
diff -Nru
a/arch/ppc/platforms/lite5200.cb/arch/ppc/platforms/lite5200.carch/ppc/platforms/lite5200.c 2005-03-11 20:41:56 +01:00 +2
-0@@ -35,6 +35,8 @@ #include <asm/ocp.h> #include <asm/mpc52xx.h> +#include <syslib/mpc52xx_pci.h> + extern int powersave_nap;fdef
CONFIG_PCIarch/ppc/platforms/lite5200.c 2005-03-11 20:41:56 +01:00
Quoted 6 lines
arch/ppc/platforms/lite5200.c 2005-03-11 20:41:56 +01:00 +6
-0+static int +lite5200_map_irq(struct pci_dev *dev, unsigned char idsel, + unsigned char pin) { + return (pin == 1) && (idsel==24) ? MPC52xx_IRQ0 : -1; +} +#endif[ more deleted lines ]
_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Quoted 15 lines · Sylvain Munaut
Hi Tom & all
Here's some updates related to the Freescale MPC52xx. First some
clean-ups for sparse warnings and then PCI support. I'd like to get theses approved & merged before I submit conversion to platform bus model.As usual, the patches can also be pulled of a bk repository :
bk://tnt.bkbits.net/linux-2.5-mpc52xx-pending(note it's _NOT_ the same url as before even if it's close ;)
Quoted 7 lines
=A0=A0=A0 Sylvain
---
diff -Nru a/arch/ppc/syslib/mpc52xx_pic.c=20
b/arch/ppc/syslib/mpc52xx_pic.c
--- a/arch/ppc/syslib/mpc52xx_pic.c=A0=A0=A0=A0 2005-03-11 20:41:36 =
+01:00
Quoted 1 line
+++ b/arch/ppc/syslib/mpc52xx_pic.c=A0=A0=A0=A0 2005-03-11 20:41:36 =
+01:00
Quoted 10 lines
@@ -33,8 +33,8 @@
=A0#include <asm/mpc52xx.h>-static struct
mpc52xx_intr*intr;
-static structmpc52xx_sdma*sdma;
+static structmpc52xx_intr__iomem*intr;
+static structmpc52xx_sdma__iomem*sdma;
Quoted 4 lines
=A0static void
=A0mpc52xx_ic_disable(unsigned int irq)
@@ -173,7 +173,7 @@
=A0=A0=A0=A0=A0=A0=A0 mpc52xx_ic_disable,=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0 /* disable(irq) */
Quoted 1 line
=A0=A0=A0=A0=A0=A0=A0 mpc52xx_ic_disable_and_ack,=A0=A0=A0=A0 /* =
disable_and_ack(irq) */
Quoted 1 line
=A0=A0=A0=A0=A0=A0=A0 mpc52xx_ic_end,=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0 /* end(irq) */
Quoted 1 line
-=A0=A0=A0=A0=A0=A0 0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* set_affinity(irq, cpumask)
Quoted 2 lines
SMP. */
+=A0=A0=A0=A0=A0=A0 NULL=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* set_affinity(irq, cpumask)
Quoted 2 lines
SMP. */
=A0};
It looks like others have moved to a C99 initialization style for=20 hw_interrupt_type, see syslib/ipic.c for an example.
Quoted 7 lines
=A0void
__init
@@ -183,10 +183,8 @@
=A0=A0=A0=A0=A0=A0=A0 u32intr_ctrl;=A0=A0=A0=A0=A0=A0=A0 /* Remap the necessary zones */
-=A0=A0=A0=A0=A0=A0 intr =3D (structmpc52xx_intr*) -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ioremap(MPC52xx_INTR, =
sizeof(struct mpc52xx_intr));
Quoted 2 lines
-=A0=A0=A0=A0=A0=A0 sdma =3D (struct
mpc52xx_sdma*)
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ioremap(MPC52xx_SDMA, =
sizeof(struct mpc52xx_sdma));
Quoted 1 line
+=A0=A0=A0=A0=A0=A0 intr =3D ioremap(MPC52xx_INTR, sizeof(struct =
mpc52xx_intr));
Quoted 1 line
+=A0=A0=A0=A0=A0=A0 sdma =3D ioremap(MPC52xx_SDMA, sizeof(struct =
mpc52xx_sdma));
Quoted 3 lines
=A0=A0=A0=A0=A0=A0=A0 if ((intr=3D=3DNULL) || (sdma=3D=3DNULL)) =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 panic("Can't ioremap =
PIC/SDMA register for init_irq=20
Quoted 5 lines
!");
diff -Nrua/arch/ppc/syslib/mpc52xx_setup.cb/arch/ppc/syslib/mpc52xx_setup.c
--- a/arch/ppc/syslib/mpc52xx_setup.c=A0=A0 2005-03-11 20:41:36 +01:00
+++ b/arch/ppc/syslib/mpc52xx_setup.c=A0=A0 2005-03-11 20:41:36 =
+01:00
Quoted 5 lines
@@ -39,7 +39,8 @@
=A0void
=A0mpc52xx_restart(char *cmd)
=A0{
-=A0=A0=A0=A0=A0=A0 struct mpc52xx_gpt* gpt0 =3D (struct =
mpc52xx_gpt*)=20
Quoted 3 lines
MPC52xx_GPTx(0);+=A0=A0=A0=A0=A0=A0 struct mpc52xx_gpt __iomem *gpt0 =3D +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (struct mpc52xx_gpt =
__iomem *) MPC52xx_GPTx(0);
Quoted 6 lines
=A0=A0=A0=A0=A0=A0=A0
local_irq_disable();(quoted diff) +0
-0@@ -102,7 +103,7 @@ =A0#endif
Quoted 6 lines
=A0static void
-mpc52xx_psc_putc(structmpc52xx_psc* psc, unsigned char c) +mpc52xx_psc_putc(structmpc52xx_psc__iomem*psc, unsigned char c) =A0{
=A0=A0=A0=A0=A0=A0=A0 while (!(in_be16(&psc->mpc52xx_psc_status) & =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
MPC52xx_PSC_SR_TXRDY));
Review
Quoted 10 lines
(quoted diff) +0
-0@@ -112,8 +113,9 @@ =A0void =A0mpc52xx_progress(char *s, unsigned short hex) =A0{ -=A0=A0=A0=A0=A0=A0 struct mpc52xx_psc *psc =3D (struct mpc52xx_psc=20= *)MPC52xx_CONSOLE; =A0=A0=A0=A0=A0=A0=A0 char c; +=A0=A0=A0=A0=A0=A0 struct mpc52xx_psc __iomem *psc =3D +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (struct mpc52xx_psc =
__iomem *)MPC52xx_CONSOLE;
Quoted 8 lines
=A0=A0=A0=A0=A0=A0=A0 while ((c =3D *s++) !=3D 0) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (c =3D=3D '\n') @@ -138,11 +140,11 @@
=A0=A0=A0=A0=A0=A0=A0=A0 * else get size from sdram config registers =A0=A0=A0=A0=A0=A0=A0=A0 */
=A0=A0=A0=A0=A0=A0=A0 if (ramsize =3D=3D 0) { -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 structmpc52xx_mmap_ctl=
*mmap_ctl;
Quoted 1 line
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct
mpc52xx_mmap_ctl=
__iomem *mmap_ctl;
Quoted 1 line
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 u32
sdram_config_0, =
sdram_config_1;
Quoted 2 lines
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Temp BAT2 mapping =
active when this is called ! */
Quoted 1 line
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
mmap_ctl=3D (struct =
mpc52xx_mmap_ctl*)=20
Quoted 2 lines
MPC52xx_MMAP_CTL; +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0mmap_ctl=3D (struct =
mpc52xx_mmap_ctl __iomem *)
Quoted 3 lines
MPC52xx_MMAP_CTL;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
sdram_config_0=3D =
in_be32(&mmap_ctl->sdram0);
Quoted 1 line
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
sdram_config_1=3D =
in_be32(&mmap_ctl->sdram1);
Quoted 2 lines
@@ -169,13 +171,11 @@
=A0=A0=A0=A0=A0=A0=A0 /* if bootloader didn't pass bus frequencies, =
calculate them=20
Quoted 3 lines
*/
=A0=A0=A0=A0=A0=A0=A0 if (xlbfreq =3D=3D 0) { =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Get RTC & Clock =
manager modules */
Quoted 3 lines
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct
mpc52xx_rtc*rtc; -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 structmpc52xx_cdm*cdm; +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 structmpc52xx_rtc=
__iomem *rtc;
Quoted 1 line
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct
mpc52xx_cdm=
__iomem *cdm;
Quoted 2 lines
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rtc =3D (struct =
mpc52xx_rtc*)
Quoted 1 line
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
ioremap(MPC52xx_RTC, sizeof(struct=20
Quoted 2 lines
mpc52xx_rtc)); -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cdm =3D (struct =
mpc52xx_cdm*)
Quoted 1 line
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
ioremap(MPC52xx_CDM, sizeof(struct=20
Quoted 2 lines
mpc52xx_cdm)); +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rtc =3D =
ioremap(MPC52xx_RTC, sizeof(struct mpc52xx_rtc));
Quoted 1 line
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cdm =3D =
ioremap(MPC52xx_CDM, sizeof(struct mpc52xx_cdm));
Quoted 2 lines
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if ((rtc=3D=3DNULL) || =
(cdm=3D=3DNULL))
Quoted 1 line
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
panic("Can't ioremap RTC/CDM while computing=20
Quoted 4 lines
bus
freq");
@@ -212,8 +212,8 @@ =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 __res.bi_pcifreq =3D =
pcifreq;
Quoted 4 lines
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Release mapping */
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 iounmap((void*)rtc);
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 iounmap((void*)cdm);
Quoted 8 lines
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 iounmap(rtc); +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 iounmap(cdm);=A0=A0=A0=A0=A0=A0=A0 }
=A0=A0=A0=A0=A0=A0=A0 divisor =3D 4;
diff -Nru a/drivers/serial/mpc52xx_uart.c=20b/drivers/serial/mpc52xx_uart.c
--- a/drivers/serial/mpc52xx_uart.c=A0=A0=A0=A0 2005-03-11 20:41:36 =
+01:00
Quoted 1 line
+++ b/drivers/serial/mpc52xx_uart.c=A0=A0=A0=A0 2005-03-11 20:41:36 =
+01:00
Quoted 17 lines
@@ -86,7 +86,7 @@
=A0=A0=A0=A0=A0=A0=A0=A0 *=A0=A0=A0=A0=A0=A0=A0 theconsole_init=A0=A0=A0=A0=A0=A0=A0=A0 */-#define PSC(port) ((struct
mpc52xx_psc*)((port)->membase))
+#define PSC(port) ((structmpc52xx_psc__iomem*)((port)->membase))=A0/* Forward declaration of the interruption handling routine */
@@ -190,7 +190,7 @@
=A0static int
=A0mpc52xx_uart_startup(structuart_port*port)
=A0{
-=A0=A0=A0=A0=A0=A0 structmpc52xx_psc*psc =3D PSC(port); +=A0=A0=A0=A0=A0=A0 structmpc52xx_psc__iomem*psc =3D PSC(port);
Quoted 1 line
=A0=A0=A0=A0=A0=A0=A0 /* Reset/activate the port, clear and enable =
interrupts */
Review line 231
Quoted 12 lines
=A0=A0=A0=A0=A0=A0=A0
out_8(&psc->command,MPC52xx_PSC_RST_RX);(quoted diff) +0
-0@@ -217,7 +217,7 @@ =A0static void =A0mpc52xx_uart_shutdown(struct uart_port *port) =A0{ -=A0=A0=A0=A0=A0=A0 struct mpc52xx_psc *psc =3D PSC(port); +=A0=A0=A0=A0=A0=A0 struct mpc52xx_psc __iomem *psc =3D PSC(port);=A0=A0=A0=A0=A0=A0=A0 /* Shut down the port, interrupt and all */
=A0=A0=A0=A0=A0=A0=A0out_8(&psc->command,MPC52xx_PSC_RST_RX);(quoted diff) +0
-0@@ -231,7 +231,7 @@ =A0mpc52xx_uart_set_termios(struct uart_port *port, struct termios =
*new,
Review line 232
Quoted 1 line
(quoted diff) +0
-0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0 struct termios *old)
Quoted 9 lines
(quoted diff) +0
-0=A0{ -=A0=A0=A0=A0=A0=A0 struct mpc52xx_psc *psc =3D PSC(port); +=A0=A0=A0=A0=A0=A0 struct mpc52xx_psc __iomem *psc =3D PSC(port); =A0=A0=A0=A0=A0=A0=A0 unsigned long flags; =A0=A0=A0=A0=A0=A0=A0 unsigned char mr1, mr2;=A0=A0=A0=A0=A0=A0=A0 unsigned short ctr;
@@ -562,7 +562,7 @@
=A0mpc52xx_console_get_options(structuart_port*port,
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0 int *baud, int *parity, int *bits, int=20
Quoted 9 lines
*flow)
=A0{
-=A0=A0=A0=A0=A0=A0 structmpc52xx_psc*psc =3D PSC(port); +=A0=A0=A0=A0=A0=A0 structmpc52xx_psc__iomem*psc =3D PSC(port); =A0=A0=A0=A0=A0=A0=A0 unsigned char mr1;=A0=A0=A0=A0=A0=A0=A0 /* Read the mode registers */
@@ -592,7 +592,7 @@
=A0mpc52xx_console_write(struct console *co, const char *s, unsigned =
int
Quoted 3 lines
count)
=A0{
=A0=A0=A0=A0=A0=A0=A0 structuart_port*port =3D =
&mpc52xx_uart_ports[co->index];
Quoted 10 lines
-=A0=A0=A0=A0=A0=A0 struct
mpc52xx_psc*psc =3D PSC(port); +=A0=A0=A0=A0=A0=A0 structmpc52xx_psc__iomem*psc =3D PSC(port); =A0=A0=A0=A0=A0=A0=A0 unsigned int i, j;=A0=A0=A0=A0=A0=A0=A0 /* Disable interrupts */
_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Quoted 15 lines · Kumar Gala
Quoted 15 lines
diff -Nru
a/arch/ppc/syslib/mpc52xx_pic.cb/arch/ppc/syslib/mpc52xx_pic.c
---a/arch/ppc/syslib/mpc52xx_pic.c2005-03-11 20:41:36 +01:00
+++b/arch/ppc/syslib/mpc52xx_pic.c2005-03-11 20:41:36 +01:00
@@ -33,8 +33,8 @@
#include <asm/mpc52xx.h>-static struct
mpc52xx_intr*intr;
-static structmpc52xx_sdma*sdma;
+static structmpc52xx_intr__iomem*intr;
+static structmpc52xx_sdma__iomem*sdma;
Quoted 15 lines
Quoted 11 lines
static void
mpc52xx_ic_disable(unsigned int irq)
@@ -173,7 +173,7 @@
mpc52xx_ic_disable, /* disable(irq) */
mpc52xx_ic_disable_and_ack, /*disable_and_ack(irq)*/
mpc52xx_ic_end, /* end(irq) */
- 0 /*set_affinity(irq, cpumask)
SMP. */
+ NULL /*set_affinity(irq, cpumask)
SMP. */
};It looks like others have moved to a C99 initialization style for
hw_interrupt_type, seesyslib/ipic.cfor an example.
Indeed. Here's a third patch ;)
It has been added to the bk tree as well.
# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2005/03/11 21:37:08+01:00 [email protected]
# ppc32: Change to a C99 initialization style for hw_interrupt_type
# in MPC52xx interrupt controller
#
# arch/ppc/syslib/mpc52xx_pic.c # 2005/03/11 21:36:54+01:00 [email protected] +5 -8 # ppc32: Change to a C99 initialization style for hw_interrupt_type # in MPC52xx interrupt controller # diff -Nru a/arch/ppc/syslib/mpc52xx_pic.c b/arch/ppc/syslib/mpc52xx_pic.c --- a/arch/ppc/syslib/mpc52xx_pic.c 2005-03-11 21:45:50 +01:00 +++ b/arch/ppc/syslib/mpc52xx_pic.c 2005-03-11 21:45:50 +01:00 @@ -166,14 +166,11 @@ }
static struct hw_interrupt_type mpc52xx_ic = {
- "MPC52xx", - NULL, /* startup(irq) */ - NULL, /* shutdown(irq) */ - mpc52xx_ic_enable, /* enable(irq) */ - mpc52xx_ic_disable, /* disable(irq) */ - mpc52xx_ic_disable_and_ack, /* disable_and_ack(irq) */ - mpc52xx_ic_end, /* end(irq) */ - NULL /* set_affinity(irq, cpumask) SMP. */ + .typename = "MPC52xx", + .enable = mpc52xx_ic_enable, + .disable = mpc52xx_ic_disable, + .ack = mpc52xx_ic_disable_and_ack, + .end = mpc52xx_ic_end,
};
void __init
On Fri, Mar 11, 2005 at 09:47:40PM +0100, Sylvain Munaut wrote:
[snip]
Quoted 2 lines
static struct
hw_interrupt_typempc52xx_ic= {
- "MPC52xx",
[snip]
Quoted 1 line
+ .typename = "MPC52xx",
Shouldn't that be " MPC52xx ", or is that another field I'm thinking of?
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/