Skip to contentSkip to conversation

Change MPC52xx to platform bus / ppc_sys model

RFC PATCH In review Sylvain Munaut 6 participants 18 messages Mar 21, 2005 – Mar 25, 2005

lore
Share & tools
lore
#0 lore raw

cover Change MPC52xx to platform bus / ppc_sys model

Hi all,

This series of patch changes all the MPC52xx related code to use platform bus and ppc_sys instead of OCP. It's divided in several patches that represents "steps" in the conversion. However the intermediate states might not be functionnal.

This is the first try, comments and suggestions are welcomed.

Sylvain

#1 lore raw

PATCH 1/6 ppc32: Remove unnecessary test in MPC52xx reset code

ppc32: Remove unnecessary test in MPC52xx reset code

That test is part of an old version of the code and erroneously made it to mainstream.

---

arch/ppc/syslib/mpc52xx_setup.c +2 -5
diff -Nru a/arch/ppc/syslib/mpc52xx_setup.c b/arch/ppc/syslib/mpc52xx_setup.c
@@ -46,11 +46,8 @@
 
 	/* Turn on the watchdog and wait for it to expire. It effectively
 	  does a reset */
-	if (gpt0 != NULL) {
-		out_be32(&gpt0->count, 0x000000ff);
-		out_be32(&gpt0->mode, 0x00009004);
-	} else
-		printk(KERN_ERR "mpc52xx_restart: Unable to ioremap GPT0 registers, -> looping ...");
+	out_be32(&gpt0->count, 0x000000ff);
+	out_be32(&gpt0->mode, 0x00009004);
 
 	while (1);
 }
#2 lore raw

PATCH 2/6 ppc32: Remove the OCP system from the Freescale MPC52xx support

In reply to Sylvain Munaut

ppc32: Remove the OCP system from the Freescale MPC52xx support

We remove all usage of the OCP system as preparation to switch to the platform bus model / ppc_sys model.
This is only for 'generic' support, drivers are adapted separatly, afterwards.

---

arch/ppc/Kconfig +1 -1
diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig
@@ -822,7 +822,7 @@
 
 config FSL_OCP
 	bool
-	depends on MPC10X_BRIDGE || PPC_MPC52xx
+	depends on MPC10X_BRIDGE
 	default y
 
 config MPC10X_OPENPIC
arch/ppc/platforms/Makefile +1 -1
diff -Nru a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
@@ -45,7 +45,7 @@
 obj-$(CONFIG_SANDPOINT)		+= sandpoint.o
 obj-$(CONFIG_SBC82xx)		+= sbc82xx.o
 obj-$(CONFIG_SPRUCE)		+= spruce.o
-obj-$(CONFIG_LITE5200)		+= lite5200.o mpc5200.o
+obj-$(CONFIG_LITE5200)		+= lite5200.o
 
 ifeq ($(CONFIG_SMP),y)
 obj-$(CONFIG_PPC_PMAC)		+= pmac_smp.o
arch/ppc/platforms/lite5200.c +2 -30
diff -Nru a/arch/ppc/platforms/lite5200.c b/arch/ppc/platforms/lite5200.c
@@ -13,7 +13,7 @@
  * Dale Farnsworth <[email protected]> and
  * Wolfgang Denk <[email protected]>
  * 
- * Copyright 2004 Sylvain Munaut <[email protected]>
+ * Copyright 2004-2005 Sylvain Munaut <[email protected]>
  * Copyright 2003 Motorola Inc.
  * Copyright 2003 MontaVista Software Inc.
  * Copyright 2003 DENX Software Engineering ([email protected])
@@ -29,10 +29,10 @@
 #include <linux/kdev_t.h>
 #include <linux/root_dev.h>
 #include <linux/console.h>
+#include <linux/module.h>
 
 #include <asm/bootinfo.h>
 #include <asm/io.h>
-#include <asm/ocp.h>
 #include <asm/mpc52xx.h>
 
 #include <syslib/mpc52xx_pci.h>
@@ -46,31 +46,6 @@
 
 
 /* ======================================================================== */
-/* OCP device definition                                                    */
-/* For board/shared resources like PSCs                                     */
-/* ======================================================================== */
-/* Be sure not to load conficting devices : e.g. loading the UART drivers for
- * PSC1 and then also loading a AC97 for this same PSC.
- * For details about how to create an entry, look in the doc of the concerned
- * driver ( eg drivers/serial/mpc52xx_uart.c for the PSC in uart mode )
- */
-
-static struct ocp_def board_ocp[] = {
-	{
-		.vendor		= OCP_VENDOR_FREESCALE,
-		.function	= OCP_FUNC_PSC_UART,
-		.index		= 0,
-		.paddr		= MPC52xx_PSC1,
-		.irq		= MPC52xx_PSC1_IRQ,
-		.pm		= OCP_CPM_NA,
-	},
-	{	/* Terminating entry */
-		.vendor		= OCP_VENDOR_INVALID
-	}
-};
-
-
-/* ======================================================================== */
 /* Platform specific code                                                   */
 /* ======================================================================== */
 
@@ -131,9 +106,6 @@
 static void __init
 lite5200_setup_arch(void)
 {
-	/* Add board OCP definitions */
-	mpc52xx_add_board_devices(board_ocp);
-
 	/* CPU & Port mux setup */
 	lite5200_setup_cpu();
 
arch/ppc/platforms/mpc5200.c deleted +0 -53

53 lines not on this page · raw message

arch/ppc/syslib/mpc52xx_setup.c +0 -10
diff -Nru a/arch/ppc/syslib/mpc52xx_setup.c b/arch/ppc/syslib/mpc52xx_setup.c
@@ -23,7 +23,6 @@
 #include <asm/time.h>
 #include <asm/mpc52xx.h>
 #include <asm/mpc52xx_psc.h>
-#include <asm/ocp.h>
 #include <asm/pgtable.h>
 #include <asm/ppcboot.h>
 
@@ -218,12 +217,3 @@
 	tb_ticks_per_jiffy = xlbfreq / HZ / divisor;
 	tb_to_us = mulhwu_scale_factor(xlbfreq / divisor, 1000000);
 }
-
-
-void __init
-mpc52xx_add_board_devices(struct ocp_def board_ocp[]) {
-	while (board_ocp->vendor != OCP_VENDOR_INVALID)
-		if(ocp_add_one_device(board_ocp++))
-			printk("mpc5200-ocp: Failed to add board device !\n");
-}
-
include/asm-ppc/mpc52xx.h +0 -2
diff -Nru a/include/asm-ppc/mpc52xx.h b/include/asm-ppc/mpc52xx.h
@@ -26,7 +26,6 @@
 #include <asm/types.h>
 
 struct pt_regs;
-struct ocp_def;
 #endif /* __ASSEMBLY__ */
 
 
@@ -391,7 +390,6 @@
 extern void mpc52xx_power_off(void);
 extern void mpc52xx_progress(char *s, unsigned short hex);
 extern void mpc52xx_calibrate_decr(void);
-extern void mpc52xx_add_board_devices(struct ocp_def board_ocp[]);
 
 extern void mpc52xx_find_bridges(void);
#3 lore raw

PATCH 3/6 ppc32: Change constants style in Freescale MPC52xx related code

In reply to Sylvain Munaut

ppc32: Change constants style in Freescale MPC52xx related code

This patch changes the way the constants used for register block address are defined/used. This is a preparation for the use of the platform bus / ppc_sys model.

---

arch/ppc/boot/simple/mpc52xx_tty.c +15 -15
diff -Nru a/arch/ppc/boot/simple/mpc52xx_tty.c b/arch/ppc/boot/simple/mpc52xx_tty.c
@@ -20,32 +20,31 @@
 #include <asm/io.h>
 #include <asm/time.h>
 
-#if MPC52xx_PF_CONSOLE_PORT == 0
-#define MPC52xx_CONSOLE		MPC52xx_PSC1
-#define MPC52xx_PSC_CONFIG_SHIFT	0
-#elif MPC52xx_PF_CONSOLE_PORT == 1
-#define MPC52xx_CONSOLE		MPC52xx_PSC2
-#define MPC52xx_PSC_CONFIG_SHIFT	4
-#elif MPC52xx_PF_CONSOLE_PORT == 2
-#define MPC52xx_CONSOLE		MPC52xx_PSC3
-#define MPC52xx_PSC_CONFIG_SHIFT	8
+
+#ifdef MPC52xx_PF_CONSOLE_PORT
+#define MPC52xx_CONSOLE MPC52xx_PSCx_OFFSET(MPC52xx_PF_CONSOLE_PORT)
+#define MPC52xx_PSC_CONFIG_SHIFT ((MPC52xx_PF_CONSOLE_PORT-1)<<2)
 #else
 #error "MPC52xx_PF_CONSOLE_PORT not defined"
 #endif
 
 static struct mpc52xx_psc __iomem *psc =
-	(struct mpc52xx_psc __iomem *) MPC52xx_CONSOLE;
+	(struct mpc52xx_psc __iomem *) MPC52xx_PA(MPC52xx_CONSOLE);
 
 /* The decrementer counts at the system bus clock frequency
  * divided by four.  The most accurate time base is connected to the
- * rtc.  We read the decrementer change during one rtc tick (one second)
- * and multiply by 4 to get the system bus clock frequency.
+ * rtc.  We read the decrementer change during one rtc tick
+ * and multiply by 4 to get the system bus clock frequency. Since a
+ * rtc tick is one seconds, and that's pretty long, we change the rtc
+ * dividers temporarly to set them 64x faster ;)
  */
 static int
 mpc52xx_ipbfreq(void)
 {
-	struct mpc52xx_rtc __iomem *rtc = (struct mpc52xx_rtc __iomem *)MPC52xx_RTC;
-	struct mpc52xx_cdm __iomem *cdm = (struct mpc52xx_cdm __iomem *)MPC52xx_CDM;
+	struct mpc52xx_rtc __iomem *rtc =
+		(struct mpc52xx_rtc __iomem *) MPC52xx_PA(MPC52xx_RTC_OFFSET);
+	struct mpc52xx_cdm __iomem *cdm =
+		(struct mpc52xx_cdm __iomem *) MPC52xx_PA(MPC52xx_CDM_OFFSET);
 	int current_time, previous_time;
 	int tbl_start, tbl_end;
 	int xlbfreq, ipbfreq;
@@ -68,7 +67,8 @@
 unsigned long
 serial_init(int ignored, void *ignored2)
 {
-	struct mpc52xx_gpio __iomem *gpio = (struct mpc52xx_gpio __iomem *)MPC52xx_GPIO;
+	struct mpc52xx_gpio __iomem *gpio =
+		(struct mpc52xx_gpio __iomem *) MPC52xx_PA(MPC52xx_GPIO_OFFSET);
 	int divisor;
 	int mode1;
 	int mode2;
arch/ppc/platforms/lite5200.c +2 -2
diff -Nru a/arch/ppc/platforms/lite5200.c b/arch/ppc/platforms/lite5200.c
@@ -73,8 +73,8 @@
 	u32 intr_ctrl;
 
 	/* Map zones */
-	xlb  = ioremap(MPC52xx_XLB,sizeof(struct mpc52xx_xlb));
-	intr = ioremap(MPC52xx_INTR,sizeof(struct mpc52xx_intr));
+	xlb  = ioremap(MPC52xx_PA(MPC52xx_XLB_OFFSET), MPC52xx_XLB_SIZE);
+	intr = ioremap(MPC52xx_PA(MPC52xx_INTR_OFFSET), MPC52xx_INTR_SIZE);
 
 	if (!xlb || !intr) {
 		printk("lite5200.c: Error while mapping XLB/INTR during "
arch/ppc/platforms/lite5200.h +1 -1
diff -Nru a/arch/ppc/platforms/lite5200.h b/arch/ppc/platforms/lite5200.h
@@ -17,7 +17,7 @@
 #define __PLATFORMS_LITE5200_H__
 
 /* Serial port used for low-level debug */
-#define MPC52xx_PF_CONSOLE_PORT 0	/* PSC1 */
+#define MPC52xx_PF_CONSOLE_PORT 1	/* PSC1 */
 
 
 #endif /* __PLATFORMS_LITE5200_H__ */
arch/ppc/syslib/mpc52xx_pci.c +1 -1
diff -Nru a/arch/ppc/syslib/mpc52xx_pci.c b/arch/ppc/syslib/mpc52xx_pci.c
@@ -183,7 +183,7 @@
 
 	pci_assign_all_busses = 1;
 
-	pci_regs = ioremap(MPC52xx_PCI, sizeof(struct mpc52xx_pci));
+	pci_regs = ioremap(MPC52xx_PA(MPC52xx_PCI_OFFSET), MPC52xx_PCI_SIZE);
 	if (!pci_regs)
 		return;
 
arch/ppc/syslib/mpc52xx_pic.c +2 -2
diff -Nru a/arch/ppc/syslib/mpc52xx_pic.c b/arch/ppc/syslib/mpc52xx_pic.c
@@ -180,8 +180,8 @@
 	u32 intr_ctrl;
 
 	/* Remap the necessary zones */
-	intr = ioremap(MPC52xx_INTR, sizeof(struct mpc52xx_intr));
-	sdma = ioremap(MPC52xx_SDMA, sizeof(struct mpc52xx_sdma));
+	intr = ioremap(MPC52xx_PA(MPC52xx_INTR_OFFSET), MPC52xx_INTR_SIZE);
+	sdma = ioremap(MPC52xx_PA(MPC52xx_SDMA_OFFSET), MPC52xx_SDMA_SIZE);
 
 	if ((intr==NULL) || (sdma==NULL))
 		panic("Can't ioremap PIC/SDMA register for init_irq !");
arch/ppc/syslib/mpc52xx_setup.c +8 -10
diff -Nru a/arch/ppc/syslib/mpc52xx_setup.c b/arch/ppc/syslib/mpc52xx_setup.c
@@ -38,8 +38,7 @@
 void
 mpc52xx_restart(char *cmd)
 {
-	struct mpc52xx_gpt __iomem *gpt0 =
-		(struct mpc52xx_gpt __iomem *) MPC52xx_GPTx(0);
+	struct mpc52xx_gpt __iomem *gpt0 = MPC52xx_VA(MPC52xx_GPTx_OFFSET(0));
 
 	local_irq_disable();
 
@@ -92,9 +91,7 @@
 
 
 #ifdef CONFIG_SERIAL_TEXT_DEBUG
-#ifdef MPC52xx_PF_CONSOLE_PORT
-#define MPC52xx_CONSOLE MPC52xx_PSCx(MPC52xx_PF_CONSOLE_PORT)
-#else
+#ifndef MPC52xx_PF_CONSOLE_PORT
 #error "mpc52xx PSC for console not selected"
 #endif
 
@@ -110,8 +107,9 @@
 mpc52xx_progress(char *s, unsigned short hex)
 {
 	char c;
-	struct mpc52xx_psc __iomem *psc =
-		(struct mpc52xx_psc __iomem *)MPC52xx_CONSOLE;
+	struct mpc52xx_psc __iomem *psc;
+
+	psc = MPC52xx_VA(MPC52xx_PSCx_OFFSET(MPC52xx_PF_CONSOLE_PORT));
 
 	while ((c = *s++) != 0) {
 		if (c == '\n')
@@ -140,7 +138,7 @@
 		u32 sdram_config_0, sdram_config_1;
 
 		/* Temp BAT2 mapping active when this is called ! */
-		mmap_ctl = (struct mpc52xx_mmap_ctl __iomem *) MPC52xx_MMAP_CTL;
+		mmap_ctl = MPC52xx_VA(MPC52xx_MMAP_CTL_OFFSET);
 
 		sdram_config_0 = in_be32(&mmap_ctl->sdram0);
 		sdram_config_1 = in_be32(&mmap_ctl->sdram1);
@@ -170,8 +168,8 @@
 		struct mpc52xx_rtc __iomem *rtc;
 		struct mpc52xx_cdm __iomem *cdm;
 
-		rtc = ioremap(MPC52xx_RTC, sizeof(struct mpc52xx_rtc));
-		cdm = ioremap(MPC52xx_CDM, sizeof(struct mpc52xx_cdm));
+		rtc = ioremap(MPC52xx_PA(MPC52xx_RTC_OFFSET), MPC52xx_RTC_SIZE);
+		cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
 
 		if ((rtc==NULL) || (cdm==NULL))
 			panic("Can't ioremap RTC/CDM while computing bus freq");
include/asm-ppc/mpc52xx.h +60 -38

131 lines not on this page · raw message

#4 lore raw

PATCH 4/6 ppc32: Add platform bus / ppc_sys model to Freescale MPC52xx

In reply to Sylvain Munaut

ppc32: Add platform bus / ppc_sys model to Freescale MPC52xx

This patch makes all platform based around the Freescale MPC52xx use the platform bus and more precisly the ppc_sys model put in place by Kumar Gala.

---

arch/ppc/platforms/lite5200.c +15 -0
diff -Nru a/arch/ppc/platforms/lite5200.c b/arch/ppc/platforms/lite5200.c
@@ -34,6 +34,7 @@
 #include <asm/bootinfo.h>
 #include <asm/io.h>
 #include <asm/mpc52xx.h>
+#include <asm/ppc_sys.h>
 
 #include <syslib/mpc52xx_pci.h>
 
@@ -49,6 +50,17 @@
 /* Platform specific code                                                   */
 /* ======================================================================== */
 
+/* Supported PSC function in "preference" order */
+struct mpc52xx_psc_func mpc52xx_psc_functions[] = {
+		{       .id     = 0,
+			.func   = "uart",
+		},
+		{       .id     = -1,   /* End entry */
+			.func   = NULL,
+		}
+	};
+
+
 static int
 lite5200_show_cpuinfo(struct seq_file *m)
 {
@@ -147,6 +159,9 @@
 			strcpy(cmd_line, (char *)(r6+KERNELBASE));
 		}
 	}
+
+	/* PPC Sys identification */
+	identify_ppc_sys_by_id(mfspr(SPRN_SVR));
 
 	/* BAT setup */
 	mpc52xx_set_bat();
arch/ppc/syslib/Makefile +2 -1
diff -Nru a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
@@ -106,7 +106,8 @@
 obj-$(CONFIG_PCI)		+= indirect_pci.o pci_auto.o
 endif
 obj-$(CONFIG_MPC8555_CDS)	+= todc_time.o
-obj-$(CONFIG_PPC_MPC52xx)	+= mpc52xx_setup.o mpc52xx_pic.o
+obj-$(CONFIG_PPC_MPC52xx)	+= mpc52xx_setup.o mpc52xx_pic.o \
+					mpc52xx_sys.o mpc52xx_devices.o ppc_sys.o
 ifeq ($(CONFIG_PPC_MPC52xx),y)
 obj-$(CONFIG_PCI)		+= mpc52xx_pci.o
 endif
arch/ppc/syslib/mpc52xx_devices.c new file +333 -0

333 lines not on this page · raw message

arch/ppc/syslib/mpc52xx_setup.c +13 -0
diff -Nru a/arch/ppc/syslib/mpc52xx_setup.c b/arch/ppc/syslib/mpc52xx_setup.c
@@ -215,3 +215,16 @@
 	tb_ticks_per_jiffy = xlbfreq / HZ / divisor;
 	tb_to_us = mulhwu_scale_factor(xlbfreq / divisor, 1000000);
 }
+
+int mpc52xx_match_psc_function(int psc_idx, const char *func)
+{
+	struct mpc52xx_psc_func *cf = mpc52xx_psc_functions;
+
+	while ((cf->id != -1) && (cf->func != NULL)) {
+		if ((cf->id == psc_idx) && !strcmp(cf->func,func))
+			return 1;
+		cf++;
+	}
+
+	return 0;
+}
arch/ppc/syslib/mpc52xx_sys.c new file +38 -0
diff -Nru a/arch/ppc/syslib/mpc52xx_sys.c b/arch/ppc/syslib/mpc52xx_sys.c
@@ -0,0 +1,38 @@
+/*
+ * arch/ppc/syslib/mpc52xx_sys.c
+ *
+ * Freescale MPC52xx system descriptions
+ *
+ *
+ * Maintainer : Sylvain Munaut <[email protected]>
+ *
+ * Copyright (C) 2005 Sylvain Munaut <[email protected]>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include <asm/ppc_sys.h>
+
+struct ppc_sys_spec *cur_ppc_sys_spec;
+struct ppc_sys_spec ppc_sys_specs[] = {
+	{
+		.ppc_sys_name	= "5200",
+		.mask		= 0xffff0000,
+		.value		= 0x80110000,
+		.num_devices	= 15,
+		.device_list	= (enum ppc_sys_devices[])
+		{
+			MPC52xx_MSCAN1, MPC52xx_MSCAN2, MPC52xx_SPI,
+			MPC52xx_USB, MPC52xx_BDLC, MPC52xx_PSC1, MPC52xx_PSC2,
+			MPC52xx_PSC3, MPC52xx_PSC4, MPC52xx_PSC5, MPC52xx_PSC6,
+			MPC52xx_FEC, MPC52xx_ATA, MPC52xx_I2C1, MPC52xx_I2C2,
+		},
+	},
+	{	/* default match */
+		.ppc_sys_name	= "",
+		.mask		= 0x00000000,
+		.value		= 0x00000000,
+	},
+};
include/asm-ppc/mpc52xx.h +34 -0
diff -Nru a/include/asm-ppc/mpc52xx.h b/include/asm-ppc/mpc52xx.h
@@ -30,6 +30,29 @@
 
 
 /* ======================================================================== */
+/* PPC Sys devices definition                                               */
+/* ======================================================================== */
+
+enum ppc_sys_devices {
+	MPC52xx_MSCAN1,
+	MPC52xx_MSCAN2,
+	MPC52xx_SPI,
+	MPC52xx_USB,
+	MPC52xx_BDLC,
+	MPC52xx_PSC1,
+	MPC52xx_PSC2,
+	MPC52xx_PSC3,
+	MPC52xx_PSC4,
+	MPC52xx_PSC5,
+	MPC52xx_PSC6,
+	MPC52xx_FEC,
+	MPC52xx_ATA,
+	MPC52xx_I2C1,
+	MPC52xx_I2C2,
+};
+
+
+/* ======================================================================== */
 /* Main registers/struct addresses                                          */
 /* ======================================================================== */
 
@@ -414,6 +437,17 @@
 extern void mpc52xx_calibrate_decr(void);
 
 extern void mpc52xx_find_bridges(void);
+
+
+	/* Matching of PSC function */
+struct mpc52xx_psc_func {
+	int id;
+	char *func;
+};
+
+extern int mpc52xx_match_psc_function(int psc_idx, const char *func);
+extern struct  mpc52xx_psc_func mpc52xx_psc_functions[];
+	/* This array is to be defined in platform file */
 
 #endif /* __ASSEMBLY__ */
 
include/asm-ppc/ppc_sys.h +2 -0
diff -Nru a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h
@@ -25,6 +25,8 @@
 #include <asm/mpc83xx.h>
 #elif defined(CONFIG_85xx)
 #include <asm/mpc85xx.h>
+#elif defined(CONFIG_PPC_MPC52xx)
+#include <asm/mpc52xx.h>
 #else
 #error "need definition of ppc_sys_devices"
 #endif
#5 lore raw

Re: [PATCH 4/6] ppc32: Add platform bus / ppc_sys model to Freescale MPC52xx

One question, do you really need #defines for the device offsets in=20 mpc52xx_devices.c ? Are these used anywhere else?

- kumar

Quoted 9 lines · Sylvain Munaut

ppc32: Add platform bus / ppc_sys model to Freescale MPC52xx

This patch makes all platform based around the Freescale MPC52xx use
the platform bus and more precisly the ppc_sys model put in place by Kumar Gala.

[ snip ]

Quoted 5 lines

diff -Nru a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile --- a/arch/ppc/syslib/Makefile=A0 2005-03-21 20:10:34 +01:00
+++ b/arch/ppc/syslib/Makefile=A0 2005-03-21 20:10:34 +01:00 @@ -106,7 +106,8 @@ =A0obj-$(CONFIG_PCI)=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 +=3D =

indirect_pci.o pci_auto.o

Quoted 3 lines

=A0endif
=A0obj-$(CONFIG_MPC8555_CDS)=A0=A0=A0=A0=A0 +=3D todc_time.o
-obj-$(CONFIG_PPC_MPC52xx)=A0=A0=A0=A0=A0 +=3D mpc52xx_setup.o =

mpc52xx_pic.o

Quoted 1 line

+obj-$(CONFIG_PPC_MPC52xx)=A0=A0=A0=A0=A0 +=3D mpc52xx_setup.o =

mpc52xx_pic.o \

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=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 mpc52xx_sys.o=20

Quoted 3 lines

mpc52xx_devices.o ppc_sys.o
=A0ifeq ($(CONFIG_PPC_MPC52xx),y)
=A0obj-$(CONFIG_PCI)=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 +=3D =

mpc52xx_pci.o

Quoted 40 lines

=A0endif
diff -Nru a/arch/ppc/syslib/mpc52xx_devices.c=20
b/arch/ppc/syslib/mpc52xx_devices.c
--- /dev/null=A0=A0 Wed Dec 31 16:00:00 196900
+++ b/arch/ppc/syslib/mpc52xx_devices.c 2005-03-21 20:10:34 +01:00 @@ -0,0 +1,333 @@
+/*
+ * arch/ppc/syslib/mpc52xx_devices.c
+ *
+ * Freescale MPC52xx device descriptions
+ *
+ *
+ * Maintainer : Sylvain Munaut <[email protected]>
+ *
+ * Copyright (C) 2005 Sylvain Munaut <[email protected]>
+ *
+ * This file is licensed under the terms of the GNU General Public=20=

License
+ * version 2. This program is licensed "as is" without any warranty=20=

of any
+ * kind, whether express or implied.
+ */
+
+#include <linux/fsl_devices.h>

(quoted diff) +5 -0
+#include <linux/resource.h>
+#include <asm/mpc52xx.h>
+#include <asm/ppc_sys.h>
+
 +
 +static u64 mpc52xx_dma_mask =3D 0xffffffffULL;
 +
 +static struct fsl_i2c_platform_data mpc52xx_fsl_i2c_pdata =3D {
 +=A0=A0=A0=A0=A0=A0 .device_flags =3D FSL_I2C_DEV_CLOCK_5200,
+};
 +
 +
 +/* We use relative offsets for IORESOURCE_MEM to be independent from=20=
Quoted 5 lines

the
+ * MBAR location at compile time
+ */
+
+/* TODO Add the BestComm initiator channel to the device =

definitions,

Quoted 1 line

+=A0=A0 possibly using IORESOURCE_DMA. But that's when BestComm is =

ready=20

Quoted 5 lines

... */
+
+struct platform_device ppc_sys_platform_devices[] =3D {

 +=A0=A0=A0=A0=A0=A0 [MPC52xx_MSCAN1] =3D {
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .name=A0=A0 =A0=A0=A0=A0=A0=A0=

=A0 =3D "mpc52xx-mscan",

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .id=A0=A0=A0=A0 =A0=A0=A0=A0=A0=

=A0=A0 =3D 0,

Quoted 2 lines
+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .num_resources=A0 =3D 2,
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource =3D (struct =

resource[]) {

Quoted 2 lines
 +=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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_MSCAN1_OFFSET,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_MSCAN1_OFFSET +

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=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 = M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 =3D 1,

Quoted 2 lines
+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .num_resources=A0 =3D 2,
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource =3D (struct =

resource[]) {

Quoted 2 lines
 +=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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_MSCAN2_OFFSET,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_MSCAN2_OFFSET +

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=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 = MPC52xx_MSCAN_SIZE -=20

Quoted 2 lines

1,
+=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 .flags=A0 =3D IORESOURCE_MEM,

Quoted 3 lines
+=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=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 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_MSCAN2_IRQ,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_MSCAN2_IRQ,

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=A0=A0=A0=A0 .flags=A0 =3D IORESOURCE_IRQ,

Quoted 5 lines
+=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=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 [MPC52xx_SPI] =3D {
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .name=A0=A0 =A0=A0=A0=A0=A0=A0=

=A0 =3D "mpc52xx-spi",

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .id=A0=A0=A0=A0 =A0=A0=A0=A0=A0=

=A0=A0 =3D -1,

Quoted 2 lines
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .num_resources=A0 =3D 3,
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource=A0=A0=A0=A0=A0=A0 =

=3D (struct resource[]) {

Quoted 2 lines
 +=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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_SPI_OFFSET,

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0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0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .dev.dma_mask=A0=A0 =3D =

&mpc52xx_dma_mask,

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .dev.coherent_dma_mask =3D =

0xffffffffULL,

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource=A0=A0=A0=A0=A0=A0 =

=3D (struct resource[]) {

Quoted 2 lines
 +=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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_USB_OFFSET,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_USB_OFFSET +

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=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 = MPC52xx_USB_SIZE - 1,

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=A0=A0=A0=A0 .flags=A0 =3D IORESOURCE_MEM,

Quoted 3 lines
+=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=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 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_USB_IRQ,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_USB_IRQ,

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=A0=A0=A0=A0 .flags=A0 =3D IORESOURCE_IRQ,

Quoted 5 lines
+=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=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 [MPC52xx_BDLC] =3D {
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .name=A0=A0 =A0=A0=A0=A0=A0=A0=

=A0 =3D "mpc52xx-bdlc",

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .id=A0=A0=A0=A0 =A0=A0=A0=A0=A0=

=A0=A0 =3D -1,

Quoted 2 lines
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .num_resources=A0 =3D 2,
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource=A0=A0=A0=A0=A0=A0 =

=3D (struct resource[]) {

Quoted 2 lines
 +=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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D M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A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 [MPC52xx_PSC1] =3D {
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .name=A0=A0 =A0=A0=A0=A0=A0=A0=

=A0 =3D "mpc52xx-psc",

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .id=A0=A0=A0=A0 =A0=A0=A0=A0=A0=

=A0=A0 =3D 0,

Quoted 2 lines
+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .num_resources=A0 =3D 2,
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource=A0=A0=A0=A0=A0=A0 =

=3D (struct resource[]) {

Quoted 2 lines
 +=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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_PSC1_OFFSET,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_PSC1_OFFSET +

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=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 = MPC52xx_PSC_SIZE - 1,

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=A0=A0=A0=A0 .flags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ted 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=A0=A0=A0=A0 .flags=A0 =3D IORESOURCE_IRQ,

Quoted 5 lines
+=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=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 [MPC52xx_PSC3] =3D {
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .name=A0=A0 =A0=A0=A0=A0=A0=A0=

=A0 =3D "mpc52xx-psc",

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .id=A0=A0=A0=A0 =A0=A0=A0=A0=A0=

=A0=A0 =3D 2,

Quoted 2 lines
+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .num_resources=A0 =3D 2,
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource=A0=A0=A0=A0=A0=A0 =

=3D (struct resource[]) {

Quoted 2 lines
 +=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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_PSC3_OFFSET,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_PSC3_OFFSET +

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A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=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_PSC4_IRQ,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_PSC4_IRQ,

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=A0=A0=A0=A0 .flags=A0 =3D IORESOURCE_IRQ,

Quoted 5 lines
+=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=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 [MPC52xx_PSC5] =3D {
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .name=A0=A0 =A0=A0=A0=A0=A0=A0=

=A0 =3D "mpc52xx-psc",

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .id=A0=A0=A0=A0 =A0=A0=A0=A0=A0=

=A0=A0 =3D 4,

Quoted 2 lines
+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .num_resources=A0 =3D 2,
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource=A0=A0=A0=A0=A0=A0 =

=3D (struct resource[]) {

Quoted 2 lines
 +=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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_PSC5_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A0 =A0=A0=A0=A0=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 [MPC52xx_PSC6] =3D {
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .name=A0=A0 =A0=A0=A0=A0=A0=A0=

=A0 =3D "mpc52xx-psc",

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .id=A0=A0=A0=A0 =A0=A0=A0=A0=A0=

=A0=A0 =3D 5,

Quoted 2 lines
+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .num_resources=A0 =3D 2,
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource=A0=A0=A0=A0=A0=A0 =

=3D (struct resource[]) {

Quoted 2 lines
 +=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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_PSC6_OFFSET,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_PSC6_OFFSET +

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=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 = MPC52xx_PSC_SIZE - 1,

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=A0=A0=A0=A0 .flags=A0 =3D IORESOUR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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .flags=A0 =3D IORESOURCE_IRQ,

Quoted 5 lines
+=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=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 [MPC52xx_ATA] =3D {
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .name=A0=A0 =A0=A0=A0=A0=A0=A0=

=A0 =3D "mpc52xx-ata",

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .id=A0=A0=A0=A0 =A0=A0=A0=A0=A0=

=A0=A0 =3D -1,

Quoted 2 lines
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .num_resources=A0 =3D 2,
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource=A0=A0=A0=A0=A0=A0 =

=3D (struct resource[]) {

Quoted 2 lines
 +=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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_ATA_OFFSET,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_ATA_OFFSET +

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A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A0=A0=A0 .id=A0=A0=A0=A0 =A0=A0=A0=A0=A0=

=A0=A0 =3D 0,

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .dev.platform_data =3D =

&mpc52xx_fsl_i2c_pdata,

Quoted 2 lines
+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .num_resources=A0 =3D 2,
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource=A0=A0=A0=A0=A0=A0 =

=3D (struct resource[]) {

Quoted 2 lines
 +=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=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_I2C1_OFFSET,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_I2C1_OFFSET +

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=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 = MPC52xx_I2C_SIZE - 1,

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=A0=A0=A0=A0 .flags=A0 =3D IORESOURCE_MEM,

Quoted 3 lines
+=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=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 =

=A0=A0=A0=A0=A0=A0=A0 .start=A0 =3D MPC52xx_I2C1_IRQ,

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=A0=A0=A0=A0 .end=A0=A0=A0 =3D MPC52xx_I2C1_IRQ,

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=A0=A0=A0=A0 .flags=A0 =3D IORESOURCE_IRQ,

Quoted 5 lines
+=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=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 [MPC52xx_I2C2] =3D {
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .name=A0=A0 =A0=A0=A0=A0=A0=A0=

=A0 =3D "fsl-i2c",

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .id=A0=A0=A0=A0 =A0=A0=A0=A0=A0=

=A0=A0 =3D 1,

Quoted 1 line

+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .dev.platform_data =3D =

&mpc52xx_fsl_i2c_pdata,

Quoted 2 lines
+=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .num_resources=A0 =3D 2,
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 .resource=A0=A0=A0=A0=A0=A0 =

=3D (struct resource[]) {

Quoted 2 lines
 +=A0=A0=A0=A0=A0=A0 =A0=A0=A0=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=A0 =

=A0=A0=A0=A0=A0=A0=A0 .flags=A0 =3D IORESOURCE_IRQ,

Quoted 19 lines
+=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=A0=A0=A0 },
 +=A0=A0=A0=A0=A0=A0 },
 +};
 +
 +
 +static int __init mach_mpc52xx_fixup(struct platform_device *pdev)
 +{
 +=A0=A0=A0=A0=A0=A0 ppc_sys_fixup_mem_resource(pdev, MPC52xx_MBAR);
+=A0=A0=A0=A0=A0=A0 return 0;

+}
+
+static int __init mach_mpc52xx_init(void)
+{

 +=A0=A0=A0=A0=A0=A0 ppc_sys_device_fixup =3D mach_mpc52xx_fixup;
+=A0=A0=A0=A0=A0=A0 return 0;

+}
+
+postcore_initcall(mach_mpc52xx_init);

#6 lore raw

PATCH 5/6 serial: Update mpc52xx_uart.c to use platform bus

In reply to Sylvain Munaut

serial: Update mpc52xx_uart.c to use platform bus

All Freescale MPC52xx related code now use new constants and the platform bus for it's driver. This patch makes this driver make use of that.

---

drivers/serial/mpc52xx_uart.c +86 -103
diff -Nru a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
@@ -18,7 +18,7 @@
  * Some of the code has been inspired/copied from the 2.4 code written
  * by Dale Farnsworth <[email protected]>.
  * 
- * Copyright (C) 2004 Sylvain Munaut <[email protected]>
+ * Copyright (C) 2004-2005 Sylvain Munaut <[email protected]>
  * Copyright (C) 2003 MontaVista, Software, Inc.
  * 
  * This file is licensed under the terms of the GNU General Public License
@@ -26,33 +26,26 @@
  * kind, whether express or implied.
  */
  
-/* OCP Usage :
+/* Platform device Usage :
  *
- * This drivers uses the OCP model. To load the serial driver for one of the
- * PSCs, just add this to the core_ocp table :
+ * Since PSCs can have multiple function, the correct driver for each one
+ * is selected by calling mpc52xx_match_psc_function(...). The function
+ * handled by this driver is "uart".
  *
- * {
- * 	.vendor         = OCP_VENDOR_FREESCALE,
- * 	.function       = OCP_FUNC_PSC_UART,
- * 	.index          = 0,
- * 	.paddr          = MPC52xx_PSC1,
- * 	.irq            = MPC52xx_PSC1_IRQ,
- * 	.pm             = OCP_CPM_NA,
- * },
- *
- * This is for PSC1, replace the paddr and irq according to the PSC you want to
- * use. The driver all necessary registers to place the PSC in uart mode without
+ * The driver init all necessary registers to place the PSC in uart mode without
  * DCD. However, the pin multiplexing aren't changed and should be set either
  * by the bootloader or in the platform init code.
- * The index field must be equal to the PSC index ( e.g. 0 for PSC1, 1 for PSC2,
+ *
+ * The idx field must be equal to the PSC index ( e.g. 0 for PSC1, 1 for PSC2,
  * and so on). So the PSC1 is mapped to /dev/ttyS0, PSC2 to /dev/ttyS1 and so
  * on. But be warned, it's an ABSOLUTE REQUIREMENT ! This is needed mainly for
  * the console code : without this 1:1 mapping, at early boot time, when we are
  * parsing the kernel args console=ttyS?, we wouldn't know wich PSC it will be
- * mapped to because OCP stuff is not yet initialized.
+ * mapped to.
  */
 
 #include <linux/config.h>
+#include <linux/device.h>
 #include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/serial.h>
@@ -61,7 +54,6 @@
 
 #include <asm/delay.h>
 #include <asm/io.h>
-#include <asm/ocp.h>
 
 #include <asm/mpc52xx.h>
 #include <asm/mpc52xx_psc.h>
@@ -191,6 +183,13 @@
 mpc52xx_uart_startup(struct uart_port *port)
 {
 	struct mpc52xx_psc __iomem *psc = PSC(port);
+	int ret;
+
+	/* Request IRQ */
+	ret = request_irq(port->irq, mpc52xx_uart_int,
+		SA_INTERRUPT | SA_SAMPLE_RANDOM, "mpc52xx_psc_uart", port);
+	if (ret)
+		return ret;
 
 	/* Reset/activate the port, clear and enable interrupts */
 	out_8(&psc->command,MPC52xx_PSC_RST_RX);
@@ -225,6 +224,9 @@
 	
 	port->read_status_mask = 0; 
 	out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
+
+	/* Release interrupt */
+	free_irq(port->irq, port);
 }
 
 static void 
@@ -326,15 +328,21 @@
 		iounmap(port->membase);
 		port->membase = NULL;
 	}
+
+	release_mem_region(port->mapbase, MPC52xx_PSC_SIZE);
 }
 
 static int
 mpc52xx_uart_request_port(struct uart_port *port)
 {
 	if (port->flags & UPF_IOREMAP) /* Need to remap ? */
-		port->membase = ioremap(port->mapbase, sizeof(struct mpc52xx_psc));
-	
-	return port->membase != NULL ? 0 : -EBUSY;
+		port->membase = ioremap(port->mapbase, MPC52xx_PSC_SIZE);
+
+	if (!port->membase)
+		return -EINVAL;
+
+	return request_mem_region(port->mapbase, MPC52xx_PSC_SIZE,
+			"mpc52xx_psc_uart") != NULL ? 0 : -EBUSY;
 }
 
 static void
@@ -354,7 +362,7 @@
 	if ( (ser->irq != port->irq) ||
 	     (ser->io_type != SERIAL_IO_MEM) ||
 	     (ser->baud_base != port->uartclk)  || 
-	     // FIXME Should check addresses/irq as well ?
+	     (ser->iomem_base != (void*)port->mapbase) ||
 	     (ser->hub6 != 0 ) )
 		return -EINVAL;
 
@@ -630,7 +638,7 @@
 {
 	struct uart_port *port = &mpc52xx_uart_ports[co->index];
 
-	int baud = 9600;
+	int baud = CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD;
 	int bits = 8;
 	int parity = 'n';
 	int flow = 'n';
@@ -643,14 +651,12 @@
 	spin_lock_init(&port->lock);
 	port->uartclk	= __res.bi_ipbfreq / 2; /* Look at CTLR doc */
 	port->ops	= &mpc52xx_uart_ops;
-	port->mapbase	= MPC52xx_PSCx(co->index);
+	port->mapbase	= MPC52xx_PA(MPC52xx_PSCx_OFFSET(co->index+1));
 
-		/* We ioremap ourself */
-	port->membase = ioremap(port->mapbase, sizeof(struct mpc52xx_psc));
-	if (port->membase == NULL) {
-		release_mem_region(port->mapbase, sizeof(struct mpc52xx_psc));
-		return -EBUSY;
-	}
+	/* We ioremap ourself */
+	port->membase = ioremap(port->mapbase, MPC52xx_PSC_SIZE);
+	if (port->membase == NULL)
+		return -EINVAL;
 
 	/* Setup the port parameters accoding to options */
 	if (options)
@@ -707,26 +713,32 @@
 
 
 /* ======================================================================== */
-/* OCP Driver                                                               */
+/* Platform Driver                                                          */
 /* ======================================================================== */
 
 static int __devinit
-mpc52xx_uart_probe(struct ocp_device *ocp)
+mpc52xx_uart_probe(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
+	struct resource *res = pdev->resource;
+
 	struct uart_port *port = NULL;
-	int idx, ret;
+	int i, idx, ret;
 
-	/* Get the corresponding port struct */
-	idx = ocp->def->index;
+	/* Check validity & presence */
+	idx = pdev->id;
 	if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM)
 		return -EINVAL;
-	
-	port = &mpc52xx_uart_ports[idx];
+
+	if (!mpc52xx_match_psc_function(idx,"uart"))
+		return -ENODEV;
 
 	/* Init the port structure */
+	port = &mpc52xx_uart_ports[idx];
+
+	memset(port, 0x00, sizeof(struct uart_port));
+
 	spin_lock_init(&port->lock);
-	port->mapbase	= ocp->def->paddr;
-	port->irq	= ocp->def->irq;
 	port->uartclk	= __res.bi_ipbfreq / 2; /* Look at CTLR doc */
 	port->fifosize	= 255; /* Should be 512 ! But it can't be */
 	                       /* stored in a unsigned char       */
@@ -735,95 +747,65 @@
 			  ( uart_console(port) ? 0 : UPF_IOREMAP );
 	port->line	= idx;
 	port->ops	= &mpc52xx_uart_ops;
-	port->read_status_mask = 0;
-	
-	/* Requests the mem & irqs */
-	/* Unlike other serial drivers, we reserve the resources here, so we
-	 * can detect early if multiple drivers uses the same PSC. Special
-	 * care must be taken with the console PSC
-	 */
-	ret = request_irq(
-		port->irq, mpc52xx_uart_int,
-		SA_INTERRUPT | SA_SAMPLE_RANDOM, "mpc52xx_psc_uart", port);
-	if (ret)
-		goto error;
 
-	ret = request_mem_region(port->mapbase, sizeof(struct mpc52xx_psc),
-	                         "mpc52xx_psc_uart") != NULL ? 0 : -EBUSY;
-	if (ret)
-		goto free_irq;
+	/* Search for IRQ and mapbase */
+	for (i=0 ; i<pdev->num_resources ; i++, res++) {
+		if (res->flags & IORESOURCE_MEM)
+			port->mapbase = res->start;
+		else if (res->flags & IORESOURCE_IRQ)
+			port->irq = res->start;
+	}
+	if (!port->irq || !port->mapbase)
+		return -EINVAL;
 
 	/* Add the port to the uart sub-system */
 	ret = uart_add_one_port(&mpc52xx_uart_driver, port);
-	if (ret)
-		goto release_mem;
-
-	ocp_set_drvdata(ocp, (void*)port);
-
-	return 0;
-
-
-free_irq:
-	free_irq(port->irq, mpc52xx_uart_int);
-
-release_mem:
-	release_mem_region(port->mapbase, sizeof(struct mpc52xx_psc));
-
-error:
-	if (uart_console(port))
-		printk(	"mpc52xx_uart.c: Error during resource alloction for "
-			"the console port !!! Check that the console PSC is "
-			"not used by another OCP driver !!!\n" );
+	if (!ret)
+		dev_set_drvdata(dev, (void*)port);
 
 	return ret;
 }
 
-static void
-mpc52xx_uart_remove(struct ocp_device *ocp)
+static int
+mpc52xx_uart_remove(struct device *dev)
 {
-	struct uart_port *port = (struct uart_port *) ocp_get_drvdata(ocp);
+	struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev);
 
-	ocp_set_drvdata(ocp, NULL);
+	dev_set_drvdata(dev, NULL);
 
-	if (port) {
+	if (port)
 		uart_remove_one_port(&mpc52xx_uart_driver, port);
-		release_mem_region(port->mapbase, sizeof(struct mpc52xx_psc));
-		free_irq(port->irq, mpc52xx_uart_int);
-	}
+
+	return 0;
 }
 
 #ifdef CONFIG_PM
 static int
-mpc52xx_uart_suspend(struct ocp_device *ocp, u32 state)
+mpc52xx_uart_suspend(struct device *dev, u32 state, u32 level)
 {
-	struct uart_port *port = (struct uart_port *) ocp_get_drvdata(ocp);
+	struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev);
 
-	uart_suspend_port(&mpc52xx_uart_driver, port);
+	if (sport && level == SUSPEND_DISABLE)
+		uart_suspend_port(&mpc52xx_uart_driver, port);
 
 	return 0;
 }
 
 static int
-mpc52xx_uart_resume(struct ocp_device *ocp)
+mpc52xx_uart_resume(struct device *dev, u32 level)
 {
-	struct uart_port *port = (struct uart_port *) ocp_get_drvdata(ocp);
+	struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev);
 
-	uart_resume_port(&mpc52xx_uart_driver, port);
+	if (port && level == RESUME_ENABLE)
+		uart_resume_port(&mpc52xx_uart_driver, port);
 
 	return 0;
 }
 #endif
 
-static struct ocp_device_id mpc52xx_uart_ids[] __devinitdata = {
-	{ .vendor = OCP_VENDOR_FREESCALE, .function = OCP_FUNC_PSC_UART },
-	{ .vendor = OCP_VENDOR_INVALID /* Terminating entry */ }
-};
-
-MODULE_DEVICE_TABLE(ocp, mpc52xx_uart_ids);
-
-static struct ocp_driver mpc52xx_uart_ocp_driver = {
-	.name		= "mpc52xx_psc_uart",
-	.id_table	= mpc52xx_uart_ids,
+static struct device_driver mpc52xx_uart_platform_driver = {
+	.name		= "mpc52xx-psc",
+	.bus		= &platform_bus_type,
 	.probe		= mpc52xx_uart_probe,
 	.remove		= mpc52xx_uart_remove,
 #ifdef CONFIG_PM
@@ -845,10 +827,11 @@
 	printk(KERN_INFO "Serial: MPC52xx PSC driver\n");
 
 	ret = uart_register_driver(&mpc52xx_uart_driver);
-	if (ret)
-		return ret;
-
-	ret = ocp_register_driver(&mpc52xx_uart_ocp_driver);
+	if (ret == 0) {
+		ret = driver_register(&mpc52xx_uart_platform_driver);
+		if (ret)
+			uart_unregister_driver(&mpc52xx_uart_driver);
+	}
 
 	return ret;
 }
@@ -856,7 +839,7 @@
 static void __exit
 mpc52xx_uart_exit(void)
 {
-	ocp_unregister_driver(&mpc52xx_uart_ocp_driver);
+	driver_unregister(&mpc52xx_uart_platform_driver);
 	uart_unregister_driver(&mpc52xx_uart_driver);
 }
#7 lore raw

PATCH 6/6 ppc32: Adds necessary cpu init to use USB on LITE5200 Platform

In reply to Sylvain Munaut

ppc32: Adds necessary cpu init to use USB on LITE5200 Platform

To use external peripheral on MPC5200, some clocking registers and port-muxing must be done. Since this is platform specific, it's placed the platform support file. This particular patch is for USB support on the LITE5200.

---

arch/ppc/platforms/lite5200.c +35 -3
diff -Nru a/arch/ppc/platforms/lite5200.c b/arch/ppc/platforms/lite5200.c
@@ -79,21 +79,47 @@
 static void __init
 lite5200_setup_cpu(void)
 {
+	struct mpc52xx_cdm  __iomem *cdm;
+	struct mpc52xx_gpio __iomem *gpio;
 	struct mpc52xx_intr __iomem *intr;
 	struct mpc52xx_xlb  __iomem *xlb;
 
+	u32 port_config;
 	u32 intr_ctrl;
 
 	/* Map zones */
+	cdm  = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
+	gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
 	xlb  = ioremap(MPC52xx_PA(MPC52xx_XLB_OFFSET), MPC52xx_XLB_SIZE);
 	intr = ioremap(MPC52xx_PA(MPC52xx_INTR_OFFSET), MPC52xx_INTR_SIZE);
 
-	if (!xlb || !intr) {
-		printk("lite5200.c: Error while mapping XLB/INTR during "
+	if (!cdm || !gpio || !xlb || !intr) {
+		printk("lite5200.c: Error while mapping CDM/GPIO/XLB/INTR during"
 				"lite5200_setup_cpu\n");
 		goto unmap_regs;
 	}
 
+	/* Use internal 48 Mhz */
+	out_8(&cdm->ext_48mhz_en, 0x00);
+	out_8(&cdm->fd_enable, 0x01);
+	if (in_be32(&cdm->rstcfg) & 0x40)	/* Assumes 33Mhz clock */
+		out_be16(&cdm->fd_counters, 0x0001);
+	else
+		out_be16(&cdm->fd_counters, 0x5555);
+
+	/* Get port mux config */
+	port_config = in_be32(&gpio->port_config);
+
+	/* 48Mhz internal, pin is GPIO */
+	port_config &= ~0x00800000;
+
+	/* USB port */
+	port_config &= ~0x00007000;	/* Differential mode - USB1 only */
+	port_config |=  0x00001000;
+
+	/* Commit port config */
+	out_be32(&gpio->port_config, port_config);
+
 	/* Configure the XLB Arbiter */
 	out_be32(&xlb->master_pri_enable, 0xff);
 	out_be32(&xlb->master_priority, 0x11111111);
@@ -111,6 +137,8 @@
 
 	/* Unmap reg zone */
 unmap_regs:
+	if (cdm)  iounmap(cdm);
+	if (gpio) iounmap(gpio);
 	if (xlb)  iounmap(xlb);
 	if (intr) iounmap(intr);
 }
@@ -171,7 +199,11 @@
 	isa_mem_base		= 0;
 
 	/* Powersave */
-	powersave_nap = 1;	/* We allow this platform to NAP */
+	/* This is provided as an example on how to do it. But you
+	   need to be aware that NAP disable bus snoop and that may
+	   be required for some devices to work properly, like USB ... */
+	/* powersave_nap = 1; */
+
 
 	/* Setup the ppc_md struct */
 	ppc_md.setup_arch	= lite5200_setup_arch;
#8 lore raw
In reply to Sylvain Munaut

Sylvain,

Took a quick glance at the patches and they look good. Do you have a=20 bk tree available with all these changes in them?

I think a might have a few minor comments, but might be easier to see=20 the bk tree.

- kumar

Quoted 18 lines · Sylvain Munaut

Hi all,

This series of patch changes all the MPC52xx related code
to use platform bus and ppc_sys instead of OCP. It's divided in several patches that represents "steps" in the conversion. However the intermediate states might not be functionnal.

This is the first try, comments and suggestions are
welcomed.

=A0=A0=A0=A0=A0=A0=A0 Sylvain
_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

#9 lore raw

Hi Kumar,

Quoted 3 lines · Kumar Gala

Took a quick glance at the patches and they look good. Do you have a bk tree available with all these changes in them?

I think a might have a few minor comments, but might be easier to see the bk tree.

Sure, bk://tnt.bkbits.net/linux-2.5-mpc52xx-pending

The only difference between that tree and the patch is a few trailing white space that are in BK but not in the patch.

Note that now, I should also add CONFIG_PPC_MPC52xx to the change of /proc/cpuinfo. What about a CONFIG_PPC_SYS that would include ppc_sys.o in the kernel and activate the /proc/cpuinfo chipset line ?

Sylvain

#10 lore raw

[RFC] MPC5200 PCI problem

Hi Sylvain,

After last synchronization with your bk,
PCI subsys stop calling drv->probe of driver for
my external PCI board (UBoot meanwhile properly displayed and init this board). May be I do something wrong? Or PCI is in disjoint state now?

Signature · 4 lines
Regards
Andrey Volkov

P.S. HOTPLUG disabled in my conf.
#11 lore raw

Re: [RFC] MPC5200 PCI problem

Quoted 6 lines · Andrey Volkov

Hi Sylvain,

After last synchronization with your bk,
PCI subsys stop calling drv->probe of driver for
my external PCI board (UBoot meanwhile properly displayed and init this board). May be I do something wrong? Or PCI is in disjoint state now?

With which tree exactly ?

Try adding some delays in the pci configuration zone access routines in mpc52xx_pci.c I remember someone needed those but still don't know why, the manual don't say anything about that.

What does /proc/pci shows ?

Sylvain

#12 lore raw

Re: [RFC] MPC5200 PCI problem

Quoted 10 lines · Sylvain Munaut
Quoted 6 lines · Andrey Volkov

Hi Sylvain,

After last synchronization with your bk,
PCI subsys stop calling drv->probe of driver for
my external PCI board (UBoot meanwhile properly displayed and init this board). May be I do something wrong? Or PCI is in disjoint state now?

With which tree exactly ?

http://linux.bkbits.net/linux-2.5 +
bk://tnt.bkbits.net/linux-2.5-mpc52xx-pending

Quoted 2 lines

Try adding some delays in the pci configuration zone access routines in mpc52xx_pci.c I remember someone needed those but still don't know why, the manual don't say anything about that.

Board started, after I add udelay(7) in read/write config. Really strange.

Quoted 2 lines

What does /proc/pci shows ?

Couldn't do it now, because fec don't platform :), but OCP.

Signature · 2 lines
Regards
Andrey Volkov
#13 lore raw

[RFC] MPC5200 Kernel/UBoot PCI problem

Hi Sylvain, Wolfgang,

Quoted 5 lines
Quoted 3 lines

Try adding some delays in the pci configuration zone access routines in mpc52xx_pci.c I remember someone needed those but still don't know why, the manual don't say anything about that.

Board started, after I add udelay(7) in read/write config. Really strange.

Sylvain, answer was in PCI2.2 specification, not in manual.

Wolfgang, as I see, you use same trick in u-boot, as Sylvain suggested to me. IMHO this trick is wrong. Below I explain why.

When I insert udelay(1000) after deassertion of RST# (write 0 to PR of PCIGSCR), AND remove ALL delays from read/write config, board started too ;). Hence problem not in the MPC, but in slow board(s) (re)start (I was lucky with my board, because udelay must be 1000000).

Here some quotations from "PCI Local Bus Specification rev. 2.2":

From table 4-6 Timing parameters:

					       |  Min	|Max| Unit
Trhfa| RST# High to First configuration access | 2**25	|   | clocks
Trhff| RST# High to First FRAME# assertion     |   5	|   | clocks

2**25 clocks = 1.016 sec for 33MHz and 0.508 sec for 66MHz PCI.

From Chapter "4.3.2 Reset":

....
Some PCI devices must be prepared to respond as a target Trhff time after RST# deasserts. For example, devices in the path between the CPU and the boot ROM (not expansion ROM) must be prepared to respond as a target Trhff time after RST# deasserts.

All other devices must be prepared to respond as a target not more than Trhfa after the deassertion of RST#. It is recommended that the system wait at least Trhfa following the deassertion of RST# to a device before the first access to that device, unless the device is in the path between the CPU and the boot ROM or the system knows that the device is ready sooner.

Software that accesses devices prior to the expiration of Trhfa must be prepared for the devices either not to respond at all (resulting in Master-Abort) or for the devices to respond with Retry until the expiration of Trhfa. At no time can a device return invalid data. Devices are exempt from the Maximum Retry Time specification and the target initial latency requirement until the expiration of Trhfa.
....

Signature · 2 lines
Regards
Andrey Volkov
#14 lore raw

Re: [RFC] MPC5200 Kernel/UBoot PCI problem

Quoted 11 lines · Andrey Volkov
Quoted 1 line

Board started, after I add udelay(7) in read/write config. Really strange.

Sylvain, answer was in PCI2.2 specification, not in manual.

Wolfgang, as I see, you use same trick in u-boot, as Sylvain suggested to me. IMHO this trick is wrong. Below I explain why.

When I insert udelay(1000) after deassertion of RST# (write 0 to PR of PCIGSCR), AND remove ALL delays from read/write config, board started too ;). Hence problem not in the MPC, but in slow board(s) (re)start (I was lucky with my board, because udelay must be 1000000).

Good catch Andrey!

-Dale

#15 lore raw

Re: [RFC] MPC5200 Kernel/UBoot PCI problem

In reply to Andrey Volkov

Hi Andrey,

Quoted 8 lines · Andrey Volkov
Quoted 4 lines
Quoted 1 line

Try adding some delays in the pci configuration zone access routines in mpc52xx_pci.c I remember someone needed those but still don't know why, the manual don't say anything about that.

Board started, after I add udelay(7) in read/write config. Really strange.

Sylvain, answer was in PCI2.2 specification, not in manual.

Indeed good catch ! Never imagined the delay was so long.

It should be possible to use the sched_clock(void) to know if we're booting since long enough, because just waiting 1 full second is ... long.

Sylvain

#16 lore raw

Future of OCP

In reply to Sylvain Munaut

I apologize up front for my ignorance.

Quoted 10 lines · Sylvain Munaut

Hi all,

This series of patch changes all the MPC52xx related code to use platform bus and ppc_sys instead of OCP. It's divided in several patches that represents "steps" in the conversion. However the intermediate states might not be functionnal.

This is the first try, comments and suggestions are welcomed.

Quoted 11 lines · Kumar Gala

System platform_device description, discovery and management:

On most embedded PPC systems we either have a core CPU and chipset (MPC10x, TSI10x, Marvell, etc.) or a system-on-chip device (4xx, 8xx, 82xx, 85xx, etc.). Some of these sub-archs have been using the On Chip Peripheral (OCP) driver model. The functionality that OCP provide has been replaced by the generic driver model and platform_device. Also, some of these device may exist across a number of architectures (PPC, MIPS, ARM) such that some information that is shared between the architecture and driver needs to exist outside of either.

Quoted 6 lines

The ppc_sys changes add a standard way for PowerPC systems to describe the devices and systems that exist in the sub-arch. Additionally, we are able to discover which system we are and manage which devices are actually registered and any platform specific fixups that may be needed.

Q1: OK, so I gather the OCP system which until recently used to be in a separate OCP tree and was recently integrated into 2.6 is going away?

I had just started to do a 405 EP port of 2.6.11-rc4 based off of the bubinga config.

Q2: Assuming yes, to Q1, any advice on how I should proceed, continue on with an OCP port or wait for this new stuff?

Q3: How does one stay in the loop on this stuff? With only about 3 messages posted in this group and none in linuxppc-dev I am clearly in the wrong place. I feel like I missed the conversation. Where was it?

Best,

leb

#17 lore raw

Re: Future of OCP

Quoted 3 lines · Lawrence E. Bakst

Q1: OK, so I gather the OCP system which until recently used to be in a separate OCP tree and was recently integrated into 2.6 is going away?

There is a trend use platform device instead of OCP. There are no conceptual differences though, just a more convenient way from cross platform POV - OCP is PPC specific, platform device - generic solution.

IMHO there is little gain from converting 4xx from OCP platform device (except being just like other PPC subarchs :). That's the main reason it hasn't been done yet. Matt seems to be busy these days, I don't see a point, frankly, so we just waiting for a patch :).

Quoted 5 lines

I had just started to do a 405 EP port of 2.6.11-rc4 based off of the bubinga config.

Q2: Assuming yes, to Q1, any advice on how I should proceed, continue on with an OCP port or wait for this new stuff?

Well, I wouldn't worry much. These changes will affect mostly device drivers and some platform stuff. Board code (which I assume you are working on) won't be changed significantly if any. As I said, platform device stuff is conceptually similar to OCP, so changes will be mostly cosmetic.

Quoted 4 lines

Q3: How does one stay in the loop on this stuff? With only about 3 messages posted in this group and none in linuxppc-dev I am clearly in the wrong place. I feel like I missed the conversation. Where was it?

Most discussions happen on IRC (for more info see
http://www.penguinppc.org). Some people think it's a kind of "elitist circle" which requires some special invitation :), which is not true, obviously.

--
Eugene