public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] ppc4xx [Resubmit] [PATCH] CPU PPC440x5 on Virtex5 FX (new version)
@ 2008-07-14 19:47 Ricardo Ribalda Delgado
  2008-07-14 19:47 ` [U-Boot-Users] ppc4xx: [PATCH] [Resubmit] ML507 Board Support Ricardo Ribalda Delgado
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-14 19:47 UTC (permalink / raw)
  To: u-boot


Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
---
-This patchs gives support for the embbedded ppc440
on the Virtex5 FPGAs
-interrupts.c divided in uic.c and interrupts.c
-xilinx_irq.c for xilinx interrupt controller

 cpu/ppc4xx/Makefile         |   15 +++-
 cpu/ppc4xx/cpu.c            |    4 +
 cpu/ppc4xx/interrupts.c     |  178 ++++++---------------------------
 cpu/ppc4xx/speed.c          |    6 +-
 cpu/ppc4xx/uic.c            |  238 +++++++++++++++++++++++++++++++++++++++++++
 cpu/ppc4xx/xilinx_irq.c     |  113 ++++++++++++++++++++
 include/asm-ppc/interrupt.h |   50 +++++++++
 include/asm-ppc/processor.h |    2 +
 8 files changed, 456 insertions(+), 150 deletions(-)
 create mode 100644 cpu/ppc4xx/uic.c
 create mode 100644 cpu/ppc4xx/xilinx_irq.c
 create mode 100644 include/asm-ppc/interrupt.h

diff --git a/cpu/ppc4xx/Makefile b/cpu/ppc4xx/Makefile
index 800bb41..b006127 100644
--- a/cpu/ppc4xx/Makefile
+++ b/cpu/ppc4xx/Makefile
@@ -35,10 +35,14 @@ SOBJS	+= kgdb.o
 COBJS	:= 40x_spd_sdram.o
 COBJS	+= 44x_spd_ddr.o
 COBJS	+= 44x_spd_ddr2.o
-COBJS	+= 4xx_enet.o
+ifndef CONFIG_XILINX_440
+COBJS   += 4xx_enet.o
+endif
 COBJS	+= 4xx_pci.o
 COBJS	+= 4xx_pcie.o
+ifndef CONFIG_XILINX_440
 COBJS	+= 4xx_uart.o
+endif
 COBJS	+= bedbug_405.o
 COBJS	+= commproc.o
 COBJS	+= cpu.o
@@ -47,11 +51,20 @@ COBJS	+= denali_data_eye.o
 COBJS	+= denali_spd_ddr2.o
 COBJS	+= ecc.o
 COBJS	+= fdt.o
+ifndef CONFIG_XILINX_440
 COBJS	+= gpio.o
+endif
 COBJS	+= i2c.o
 COBJS	+= interrupts.o
+ifndef CONFIG_XILINX_440
+COBJS	+= uic.o
+else
+COBJS	+= xilinx_irq.o
+endif
 COBJS	+= iop480_uart.o
+ifndef CONFIG_XILINX_440
 COBJS	+= miiphy.o
+endif
 COBJS	+= ndfc.o
 COBJS	+= sdram.o
 COBJS	+= speed.o
diff --git a/cpu/ppc4xx/cpu.c b/cpu/ppc4xx/cpu.c
index ef32bc6..2b9b364 100644
--- a/cpu/ppc4xx/cpu.c
+++ b/cpu/ppc4xx/cpu.c
@@ -541,6 +541,10 @@ int checkcpu (void)
 		puts("GX Rev. A");
 		strcpy(addstr, "No Security support");
 		break;
+	
+	case PVR_VIRTEX5:
+		puts(" VIRTEX5");
+		break;
 
 	default:
 		printf (" UNKNOWN (PVR=%08x)", pvr);
diff --git a/cpu/ppc4xx/interrupts.c b/cpu/ppc4xx/interrupts.c
index 8215dc6..58d1d81 100644
--- a/cpu/ppc4xx/interrupts.c
+++ b/cpu/ppc4xx/interrupts.c
@@ -8,6 +8,10 @@
  * (C) Copyright 2003 (440GX port)
  * Travis B. Sawyer, Sandburst Corporation, tsawyer at sandburst.com
  *
+ * (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
+ * Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * Work supported by Qtechnology (htpp://qtec.com)
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -31,23 +35,11 @@
 #include <watchdog.h>
 #include <command.h>
 #include <asm/processor.h>
+#include <asm/interrupt.h>
 #include <ppc4xx.h>
 #include <ppc_asm.tmpl>
 #include <commproc.h>
 
-#if (UIC_MAX > 3)
-#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
-			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI) | \
-			 UIC_MASK(VECNUM_UIC3CI) | UIC_MASK(VECNUM_UIC3NCI))
-#elif (UIC_MAX > 2)
-#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
-			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI))
-#elif (UIC_MAX > 1)
-#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI))
-#else
-#define UICB0_ALL	0
-#endif
-
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -58,11 +50,7 @@ struct	irq_action {
 	void *arg;
 	int count;
 };
-
-static struct irq_action irq_vecs[UIC_MAX * 32];
-
-u32 get_dcr(u16);
-void set_dcr(u16, u32);
+static struct irq_action irq_vecs[IRQ_MAX];
 
 #if defined(CONFIG_440)
 
@@ -103,7 +91,7 @@ int interrupt_init_cpu (unsigned *decrementer_count)
 	/*
 	 * Mark all irqs as free
 	 */
-	for (vec = 0; vec < (UIC_MAX * 32); vec++) {
+	for (vec = 0; vec < IRQ_MAX; vec++) {
 		irq_vecs[vec].handler = NULL;
 		irq_vecs[vec].arg = NULL;
 		irq_vecs[vec].count = 0;
@@ -147,110 +135,36 @@ int interrupt_init_cpu (unsigned *decrementer_count)
 	 */
 	set_evpr(0x00000000);
 
-#if (UIC_MAX > 1)
-	/* Install the UIC1 handlers */
-	irq_install_handler(VECNUM_UIC1NCI, (void *)(void *)external_interrupt, 0);
-	irq_install_handler(VECNUM_UIC1CI, (void *)(void *)external_interrupt, 0);
-#endif
-#if (UIC_MAX > 2)
-	irq_install_handler(VECNUM_UIC2NCI, (void *)(void *)external_interrupt, 0);
-	irq_install_handler(VECNUM_UIC2CI, (void *)(void *)external_interrupt, 0);
-#endif
-#if (UIC_MAX > 3)
-	irq_install_handler(VECNUM_UIC3NCI, (void *)(void *)external_interrupt, 0);
-	irq_install_handler(VECNUM_UIC3CI, (void *)(void *)external_interrupt, 0);
-#endif
+	/*
+	 *Call uic or xilinx_irq pic_enable
+	 */
+	pic_enable();
 
 	return (0);
 }
 
-/* Handler for UIC interrupt */
-static void uic_interrupt(u32 uic_base, int vec_base)
+void timer_interrupt_cpu(struct pt_regs *regs)
 {
-	u32 uic_msr;
-	u32 msr_shift;
-	int vec;
-
-	/*
-	 * Read masked interrupt status register to determine interrupt source
-	 */
-	uic_msr = get_dcr(uic_base + UIC_MSR);
-	msr_shift = uic_msr;
-	vec = vec_base;
-
-	while (msr_shift != 0) {
-		if (msr_shift & 0x80000000) {
-			/*
-			 * Increment irq counter (for debug purpose only)
-			 */
-			irq_vecs[vec].count++;
-
-			if (irq_vecs[vec].handler != NULL) {
-				/* call isr */
-				(*irq_vecs[vec].handler)(irq_vecs[vec].arg);
-			} else {
-				set_dcr(uic_base + UIC_ER,
-					get_dcr(uic_base + UIC_ER) & ~UIC_MASK(vec));
-				printf("Masking bogus interrupt vector %d"
-				       " (UIC_BASE=0x%x)\n", vec, uic_base);
-			}
-
-			/*
-			 * After servicing the interrupt, we have to remove the
-			 * status indicator
-			 */
-			set_dcr(uic_base + UIC_SR, UIC_MASK(vec));
-		}
-
-		/*
-		 * Shift msr to next position and increment vector
-		 */
-		msr_shift <<= 1;
-		vec++;
-	}
+	/* nothing to do here */
+	return;
 }
 
-/*
- * Handle external interrupts
- */
-void external_interrupt(struct pt_regs *regs)
+void interrupt_run_handler(int vec)
 {
-	u32 uic_msr;
-
-	/*
-	 * Read masked interrupt status register to determine interrupt source
-	 */
-	uic_msr = mfdcr(uic0msr);
-
-#if (UIC_MAX > 1)
-	if ((UIC_MASK(VECNUM_UIC1CI) & uic_msr) ||
-	    (UIC_MASK(VECNUM_UIC1NCI) & uic_msr))
-		uic_interrupt(UIC1_DCR_BASE, 32);
-#endif
-
-#if (UIC_MAX > 2)
-	if ((UIC_MASK(VECNUM_UIC2CI) & uic_msr) ||
-	    (UIC_MASK(VECNUM_UIC2NCI) & uic_msr))
-		uic_interrupt(UIC2_DCR_BASE, 64);
-#endif
-
-#if (UIC_MAX > 3)
-	if ((UIC_MASK(VECNUM_UIC3CI) & uic_msr) ||
-	    (UIC_MASK(VECNUM_UIC3NCI) & uic_msr))
-		uic_interrupt(UIC3_DCR_BASE, 96);
-#endif
-
-	if (uic_msr & ~(UICB0_ALL))
-		uic_interrupt(UIC0_DCR_BASE, 0);
-
-	mtdcr(uic0sr, uic_msr);
+	irq_vecs[vec].count++;
+
+	if (irq_vecs[vec].handler != NULL) {
+		/* call isr */
+		(*irq_vecs[vec].handler) (irq_vecs[vec].arg);
+	} else {
+		pic_irq_disable(vec);
+		printf("Masking bogus interrupt vector %d\n", vec);
+	}
 
+	pic_irq_ack(vec);
 	return;
 }
 
-/*
- * Install and free a interrupt handler.
- */
 void irq_install_handler(int vec, interrupt_handler_t * handler, void *arg)
 {
 	/*
@@ -263,51 +177,19 @@ void irq_install_handler(int vec, interrupt_handler_t * handler, void *arg)
 	irq_vecs[vec].handler = handler;
 	irq_vecs[vec].arg = arg;
 
-	if ((vec >= 0) && (vec < 32))
-		mtdcr(uicer, mfdcr(uicer) | UIC_MASK(vec));
-#if (UIC_MAX > 1)
-	else if ((vec >= 32) && (vec < 64))
-		mtdcr(uic1er, mfdcr(uic1er) | UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 2)
-	else if ((vec >= 64) && (vec < 96))
-		mtdcr(uic2er, mfdcr(uic2er) | UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 3)
-	else if (vec >= 96)
-		mtdcr(uic3er, mfdcr(uic3er) | UIC_MASK(vec));
-#endif
-
-	debug("Install interrupt for vector %d ==> %p\n", vec, handler);
+	pic_irq_enable(vec);
+	return;
 }
 
-void irq_free_handler (int vec)
+void irq_free_handler(int vec)
 {
 	debug("Free interrupt for vector %d ==> %p\n",
 	      vec, irq_vecs[vec].handler);
 
-	if ((vec >= 0) && (vec < 32))
-		mtdcr(uicer, mfdcr(uicer) & ~UIC_MASK(vec));
-#if (UIC_MAX > 1)
-	else if ((vec >= 32) && (vec < 64))
-		mtdcr(uic1er, mfdcr(uic1er) & ~UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 2)
-	else if ((vec >= 64) && (vec < 96))
-		mtdcr(uic2er, mfdcr(uic2er) & ~UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 3)
-	else if (vec >= 96)
-		mtdcr(uic3er, mfdcr(uic3er) & ~UIC_MASK(vec));
-#endif
+	pic_irq_disable(vec);
 
 	irq_vecs[vec].handler = NULL;
 	irq_vecs[vec].arg = NULL;
-}
-
-void timer_interrupt_cpu (struct pt_regs *regs)
-{
-	/* nothing to do here */
 	return;
 }
 
@@ -319,7 +201,7 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	printf ("Interrupt-Information:\n");
 	printf ("Nr  Routine   Arg       Count\n");
 
-	for (vec = 0; vec < (UIC_MAX * 32); vec++) {
+	for (vec = 0; vec < IRQ_MAX; vec++) {
 		if (irq_vecs[vec].handler != NULL) {
 			printf ("%02d  %08lx  %08lx  %d\n",
 				vec,
diff --git a/cpu/ppc4xx/speed.c b/cpu/ppc4xx/speed.c
index b86b6de..d21bd82 100644
--- a/cpu/ppc4xx/speed.c
+++ b/cpu/ppc4xx/speed.c
@@ -416,7 +416,8 @@ ulong get_PCI_freq (void)
 	return sys_info.freqPCI;
 }
 
-#elif !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && !defined(CONFIG_440SPE)
+#elif !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && !defined(CONFIG_440SPE) \
+	&& !defined(CONFIG_XILINX_440)
 void get_sys_info (sys_info_t * sysInfo)
 {
 	unsigned long strp0;
@@ -449,6 +450,8 @@ void get_sys_info (sys_info_t * sysInfo)
 	sysInfo->freqUART = sysInfo->freqPLB;
 }
 #else
+
+#if !defined(CONFIG_XILINX_440)
 void get_sys_info (sys_info_t * sysInfo)
 {
 	unsigned long strp0;
@@ -535,6 +538,7 @@ void get_sys_info (sys_info_t * sysInfo)
 }
 
 #endif
+#endif /* CONFIG_XILINX_440 */
 
 #if defined(CONFIG_YUCCA)
 unsigned long determine_sysper(void)
diff --git a/cpu/ppc4xx/uic.c b/cpu/ppc4xx/uic.c
new file mode 100644
index 0000000..92350dc
--- /dev/null
+++ b/cpu/ppc4xx/uic.c
@@ -0,0 +1,238 @@
+/*
+ * (C) Copyright 2000-2002
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ *
+ * (C) Copyright 2002 (440 port)
+ * Scott McNutt, Artesyn Communication Producs, smcnutt at artsyncp.com
+ *
+ * (C) Copyright 2003 (440GX port)
+ * Travis B. Sawyer, Sandburst Corporation, tsawyer at sandburst.com
+ *
+ * (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
+ * Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * Work supported by Qtechnology (htpp://qtec.com)
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <watchdog.h>
+#include <command.h>
+#include <asm/processor.h>
+#include <asm/interrupt.h>
+#include <ppc4xx.h>
+#include <ppc_asm.tmpl>
+#include <commproc.h>
+
+#if (UIC_MAX > 3)
+#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
+			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI) | \
+			 UIC_MASK(VECNUM_UIC3CI) | UIC_MASK(VECNUM_UIC3NCI))
+#elif (UIC_MAX > 2)
+#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
+			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI))
+#elif (UIC_MAX > 1)
+#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI))
+#else
+#define UICB0_ALL	0
+#endif
+
+#if (UIC_MAX > 1) && !defined(CONFIG_440GX)
+static void uic_cascade_interrupt(void *para);
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void pic_enable()
+{
+	int vec;
+
+#if !defined (CONFIG_440_VIRTEX5)
+
+#if (UIC_MAX > 1)
+	/* Install the UIC1 handlers */
+	irq_install_handler(VECNUM_UIC1NCI, (void *)(void *)external_interrupt,
+			    0);
+	irq_install_handler(VECNUM_UIC1CI, (void *)(void *)external_interrupt,
+			    0);
+#endif
+#if (UIC_MAX > 2)
+	irq_install_handler(VECNUM_UIC2NCI, (void *)(void *)external_interrupt,
+			    0);
+	irq_install_handler(VECNUM_UIC2CI, (void *)(void *)external_interrupt,
+			    0);
+#endif
+#if (UIC_MAX > 3)
+	irq_install_handler(VECNUM_UIC3NCI, (void *)(void *)external_interrupt,
+			    0);
+	irq_install_handler(VECNUM_UIC3CI, (void *)(void *)external_interrupt,
+			    0);
+#endif
+#else				/* !defined(CONFIG_440GX) */
+	/* Take the GX out of compatibility mode
+	 * Travis Sawyer, 9 Mar 2004
+	 * NOTE: 440gx user manual inconsistency here
+	 *       Compatibility mode and Ethernet Clock select are not
+	 *       correct in the manual
+	 */
+	mfsdr(sdr_mfr, val);
+	val &= ~0x10000000;
+	mtsdr(sdr_mfr, val);
+
+	/* Enable UIC interrupts via UIC Base Enable Register */
+	mtdcr(uicb0sr, UICB0_ALL);
+	mtdcr(uicb0er, 0x54000000);
+	/* None are critical */
+	mtdcr(uicb0cr, 0);
+#endif				/* !defined(CONFIG_440GX) */
+
+}
+
+#if (UIC_MAX > 1) && !defined(CONFIG_440GX)
+static void uic_cascade_interrupt(void *para)
+{
+	external_interrupt(para);
+}
+#endif
+
+/* Handler for UIC interrupt */
+static void uic_interrupt(u32 uic_base, int vec_base)
+{
+	u32 uic_msr;
+	u32 msr_shift;
+	int vec;
+
+	/*
+	 * Read masked interrupt status register to determine interrupt source
+	 */
+	uic_msr = get_dcr(uic_base + UIC_MSR);
+	msr_shift = uic_msr;
+	vec = vec_base;
+
+	while (msr_shift != 0) {
+		if (msr_shift & 0x80000000)
+			interrupt_run_handler(vec);
+		/*
+		 * Shift msr to next position and increment vector
+		 */
+		msr_shift <<= 1;
+		vec++;
+	}
+}
+
+/*
+ * Handle external interrupts
+ */
+void external_interrupt(struct pt_regs *regs)
+{
+	u32 uic_msr;
+
+	/*
+	 * Read masked interrupt status register to determine interrupt source
+	 */
+	uic_msr = mfdcr(uic0msr);
+
+#if (UIC_MAX > 1)
+	if ((UIC_MASK(VECNUM_UIC1CI) & uic_msr) ||
+	    (UIC_MASK(VECNUM_UIC1NCI) & uic_msr))
+		uic_interrupt(UIC1_DCR_BASE, 32);
+#endif
+
+#if (UIC_MAX > 2)
+	if ((UIC_MASK(VECNUM_UIC2CI) & uic_msr) ||
+	    (UIC_MASK(VECNUM_UIC2NCI) & uic_msr))
+		uic_interrupt(UIC2_DCR_BASE, 64);
+#endif
+
+#if (UIC_MAX > 3)
+	if ((UIC_MASK(VECNUM_UIC3CI) & uic_msr) ||
+	    (UIC_MASK(VECNUM_UIC3NCI) & uic_msr))
+		uic_interrupt(UIC3_DCR_BASE, 96);
+#endif
+
+	if (uic_msr & ~(UICB0_ALL))
+		uic_interrupt(UIC0_DCR_BASE, 0);
+
+	mtdcr(uic0sr, uic_msr);
+
+	return;
+}
+
+void pic_irq_ack(int vec)
+{
+
+	if ((vec >= 0) && (vec < 32))
+		mtdcr(uicsr, UIC_MASK(vec));
+#if (UIC_MAX > 1)
+	else if ((vec >= 32) && (vec < 64))
+		mtdcr(uic1sr, UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 2)
+	else if ((vec >= 64) && (vec < 96))
+		mtdcr(uic2sr, UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 3)
+	else if (vec >= 96)
+		mtdcr(uic3sr, UIC_MASK(vec));
+#endif
+}
+
+/*
+ * Install and free a interrupt handler.
+ */
+void pic_irq_enable(int vec, interrupt_handler_t * handler, void *arg)
+{
+
+	if ((vec >= 0) && (vec < 32))
+		mtdcr(uicer, mfdcr(uicer) | UIC_MASK(vec));
+#if (UIC_MAX > 1)
+	else if ((vec >= 32) && (vec < 64))
+		mtdcr(uic1er, mfdcr(uic1er) | UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 2)
+	else if ((vec >= 64) && (vec < 96))
+		mtdcr(uic2er, mfdcr(uic2er) | UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 3)
+	else if (vec >= 96)
+		mtdcr(uic3er, mfdcr(uic3er) | UIC_MASK(vec));
+#endif
+
+	debug("Install interrupt for vector %d ==> %p\n", vec, handler);
+}
+
+void pic_irq_disable(int vec)
+{
+
+	if ((vec >= 0) && (vec < 32))
+		mtdcr(uicer, mfdcr(uicer) & ~UIC_MASK(vec));
+#if (UIC_MAX > 1)
+	else if ((vec >= 32) && (vec < 64))
+		mtdcr(uic1er, mfdcr(uic1er) & ~UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 2)
+	else if ((vec >= 64) && (vec < 96))
+		mtdcr(uic2er, mfdcr(uic2er) & ~UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 3)
+	else if (vec >= 96)
+		mtdcr(uic3er, mfdcr(uic3er) & ~UIC_MASK(vec));
+#endif
+
+}
diff --git a/cpu/ppc4xx/xilinx_irq.c b/cpu/ppc4xx/xilinx_irq.c
new file mode 100644
index 0000000..ff10a08
--- /dev/null
+++ b/cpu/ppc4xx/xilinx_irq.c
@@ -0,0 +1,113 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es 
+ * This work has been supported by: Q-Technology  http://qtec.com/
+ * Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd at denx.de
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+#include <common.h>
+#include <watchdog.h>
+#include <command.h>
+#include <asm/processor.h>
+#include <asm/interrupt.h>
+#include <ppc4xx.h>
+#include <ppc_asm.tmpl>
+#include <commproc.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define intc XPAR_INTC_0_BASEADDR
+#define ISR (u32*)(intc+(0*4))	/* Interrupt Status Register */
+#define IPR (u32*)(intc+(1*4))	/* Interrupt Pending Register */
+#define IER (u32*)(intc+(2*4))	/* Interrupt Enable Register */
+#define IAR (u32*)(intc+(3*4))	/* Interrupt Acknowledge Register */
+#define SIE (u32*)(intc+(4*4))	/* Set Interrupt Enable bits */
+#define CIE (u32*)(intc+(5*4))	/* Clear Interrupt Enable bits */
+#define IVR (u32*)(intc+(6*4))	/* Interrupt Vector Register */
+#define MER (u32*)(intc+(7*4))	/* Master Enable Register */
+
+#define IRQ_MASK(irq) (1<<(irq&0x1f))
+
+void pic_enable(void)
+{
+
+	printf("Xilinx PIC@0x%8x\n", intc);
+
+	/*
+	 * Disable all external interrupts until they are
+	 * explicitly requested.
+	 */
+	out_be32(IER, 0);
+
+	/* Acknowledge any pending interrupts just in case. */
+	out_be32(IAR, ~(u32) 0);
+
+	/* Turn on the Master Enable. */
+	out_be32(MER, 0x3UL);
+
+	return;
+
+}
+
+int xilinx_pic_irq_get(void)
+{
+	u32 irq;
+	irq = in_be32(IVR);
+
+	/* If no interrupt is pending then all bits of the IVR are set to 1. As
+	 * the IVR is as many bits wide as numbers of inputs are available.
+	 * Therefore, if all bits of the IVR are set to one, its content will
+	 * be bigger than XPAR_INTC_MAX_NUM_INTR_INPUTS.
+	 */
+	if (irq >= XPAR_INTC_MAX_NUM_INTR_INPUTS)
+		irq = -1;	/* report no pending interrupt. */
+
+	debug("get_irq: %d\n", irq);
+	return (irq);
+}
+
+void pic_irq_enable(unsigned int irq)
+{
+	unsigned long mask = IRQ_MASK(irq);
+	debug("enable: %d\n", irq);
+	out_be32(SIE, mask);
+}
+
+void pic_irq_disable(unsigned int irq)
+{
+	unsigned long mask = IRQ_MASK(irq);
+	debug("disable: %d\n", irq);
+	out_be32(CIE, mask);
+}
+
+void pic_irq_ack(unsigned int irq)
+{
+	unsigned long mask = IRQ_MASK(irq);
+	debug("ack: %d\n", irq);
+	out_be32(IAR, mask);
+}
+
+void external_interrupt(struct pt_regs *regs)
+{
+	int irq;
+
+	irq = xilinx_pic_irq_get();
+	if (irq < 0)
+		return;
+
+	interrupt_run_handler(irq);
+
+	return;
+}
diff --git a/include/asm-ppc/interrupt.h b/include/asm-ppc/interrupt.h
new file mode 100644
index 0000000..5217e66
--- /dev/null
+++ b/include/asm-ppc/interrupt.h
@@ -0,0 +1,50 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es 
+ * This work has been supported by: Q-Technology  http://qtec.com/
+ * Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd@denx.de
+ * 
+ * This program is free software: you can redistribute it and/or modify    
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+#ifndef INTERRUPT_H
+#define INTERRUPT_H
+
+#if defined(CONFIG_440SPE) || \
+    defined(CONFIG_460EX) || defined(CONFIG_460GT)
+#define UIC_MAX		4
+#elif defined(CONFIG_440GX) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_405EX)
+#define UIC_MAX		3
+#elif defined(CONFIG_440GP) || defined(CONFIG_440SP) || \
+    defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#define UIC_MAX		2
+#else
+#define UIC_MAX		1
+#endif
+
+#if defined(CONFIG_440_VIRTEX5)
+#define IRQ_MAX XPAR_INTC_MAX_NUM_INTR_INPUTS
+#else
+#define IRQ_MAX UIC_MAX * 32
+#endif
+
+void pic_enable(void);
+void pic_irq_enable(unsigned int irq);
+void pic_irq_disable(unsigned int irq);
+void pic_irq_ack(unsigned int irq);
+void external_interrupt(struct pt_regs *regs);
+void interrupt_run_handler(int vec);
+
+#endif
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index 6e134c3..5501244 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -839,6 +839,8 @@
 #define PVR_86xx	0x80040000
 #define PVR_86xx_REV1	(PVR_86xx | 0x0010)
 
+#define PVR_VIRTEX5     0x7ff21912
+
 /*
  * For the 8xx processors, all of them report the same PVR family for
  * the PowerPC core. The various versions of these processors must be
-- 
1.5.6.2

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] [Resubmit] ML507 Board Support
  2008-07-14 19:47 [U-Boot-Users] ppc4xx [Resubmit] [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Ricardo Ribalda Delgado
@ 2008-07-14 19:47 ` Ricardo Ribalda Delgado
  2008-07-16  1:17   ` [U-Boot-Users] ppc4xx: [PATCH] " Ricardo Ribalda Delgado
  2008-07-15 20:47 ` [U-Boot-Users] ppc4xx [Resubmit] [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Ricardo Ribalda Delgado
  2008-07-16  1:14 ` [U-Boot-Users] ppc4xx: " Ricardo Ribalda Delgado
  2 siblings, 1 reply; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-14 19:47 UTC (permalink / raw)
  To: u-boot


Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
---
Support for the ML507 Board by Xilinx

 CREDITS                          |    5 ++
 MAINTAINERS                      |    4 +
 MAKEALL                          |    1 +
 Makefile                         |    3 +
 board/xilinx/ml507/Makefile      |   58 +++++++++++++++++
 board/xilinx/ml507/config.mk     |   24 +++++++
 board/xilinx/ml507/init.S        |   44 +++++++++++++
 board/xilinx/ml507/ml507.c       |   46 +++++++++++++
 board/xilinx/ml507/u-boot.lds    |  130 ++++++++++++++++++++++++++++++++++++++
 board/xilinx/ml507/xparameters.h |   34 ++++++++++
 include/configs/ml507.h          |  107 +++++++++++++++++++++++++++++++
 11 files changed, 456 insertions(+), 0 deletions(-)
 create mode 100644 board/xilinx/ml507/Makefile
 create mode 100644 board/xilinx/ml507/config.mk
 create mode 100644 board/xilinx/ml507/init.S
 create mode 100644 board/xilinx/ml507/ml507.c
 create mode 100644 board/xilinx/ml507/u-boot.lds
 create mode 100644 board/xilinx/ml507/xparameters.h
 create mode 100644 include/configs/ml507.h

diff --git a/CREDITS b/CREDITS
index 3b6e57d..260a84b 100644
--- a/CREDITS
+++ b/CREDITS
@@ -399,6 +399,11 @@ N: Stelian Pop
 E: stelian.pop at leadtechdesign.com
 D: Atmel AT91CAP9ADK support
 
+N: Ricardo Ribalda Delgado
+E: ricardo.ribalda at uam.es
+D: PPC440x5 (Virtex5), ML507 Board
+W: http://www.ii.uam.es/~rribalda
+
 N: Stefan Roese
 E: sr at denx.de
 D: AMCC PPC4xx Support
diff --git a/MAINTAINERS b/MAINTAINERS
index b667c8e..75b5b02 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -311,6 +311,10 @@ Daniel Poirot <dan.poirot@windriver.com>
 	sbc8240		MPC8240
 	sbc405		PPC405GP
 
+Ricardo Ribalda <ricardo.ribalda@uam.es>
+
+	ml507 		PPC440x5
+
 Stefan Roese <sr@denx.de>
 
 	P3M7448		MPC7448
diff --git a/MAKEALL b/MAKEALL
index a256e9a..5463a58 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -239,6 +239,7 @@ LIST_4xx="		\
 	yosemite	\
 	yucca		\
 	zeus		\
+	ml507		\
 "
 
 #########################################################################
diff --git a/Makefile b/Makefile
index 10a3e06..40029e6 100644
--- a/Makefile
+++ b/Makefile
@@ -1336,6 +1336,9 @@ ML2_config:	unconfig
 ml300_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ml300 xilinx
 
+ml507_config:	unconfig
+	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ml507 xilinx
+
 ocotea_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ocotea amcc
 
diff --git a/board/xilinx/ml507/Makefile b/board/xilinx/ml507/Makefile
new file mode 100644
index 0000000..3b144de
--- /dev/null
+++ b/board/xilinx/ml507/Makefile
@@ -0,0 +1,58 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+endif
+
+INCS		:= 
+CFLAGS		+= $(INCS)
+HOST_CFLAGS	+= $(INCS)
+
+LIB	= $(obj)lib$(BOARD).a
+
+COBJS	= $(BOARD).o \
+
+SOBJS	= init.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(OBJS) $(SOBJS)
+	$(AR) $(ARFLAGS) $@ $^
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/xilinx/ml507/config.mk b/board/xilinx/ml507/config.mk
new file mode 100644
index 0000000..35c52ad
--- /dev/null
+++ b/board/xilinx/ml507/config.mk
@@ -0,0 +1,24 @@
+#
+# (C) Copyright 2000
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+TEXT_BASE = 0x04000000
diff --git a/board/xilinx/ml507/init.S b/board/xilinx/ml507/init.S
new file mode 100644
index 0000000..692c6f7
--- /dev/null
+++ b/board/xilinx/ml507/init.S
@@ -0,0 +1,44 @@
+/*
+ *  (C) Copyright 2008
+ *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ *  This work has been supported by: Q-Technology  http://qtec.com/
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <ppc_asm.tmpl>
+#include <config.h>
+#include <asm-ppc/mmu.h>
+
+.section .bootpg,"ax"
+.globl tlbtab
+
+tlbtab:
+tlbtab_start
+    	/* SDRAM */
+tlbentry(XPAR_DDR2_SDRAM_MEM_BASEADDR, SZ_256M, CFG_SDRAM_BASE, 0,
+	 AC_R | AC_W | AC_X | SA_G | SA_I)
+	/* UART */
+tlbentry(XPAR_UARTLITE_0_BASEADDR, SZ_64K, XPAR_UARTLITE_0_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+	/* PIC */
+tlbentry(XPAR_INTC_0_BASEADDR, SZ_64K, XPAR_INTC_0_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+	/* I2C */
+tlbentry(XPAR_IIC_EEPROM_BASEADDR, SZ_64K, XPAR_IIC_EEPROM_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+	/* Net */
+tlbentry(XPAR_LLTEMAC_0_BASEADDR, SZ_64K, XPAR_LLTEMAC_0_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+tlbtab_end
diff --git a/board/xilinx/ml507/ml507.c b/board/xilinx/ml507/ml507.c
new file mode 100644
index 0000000..cae541b
--- /dev/null
+++ b/board/xilinx/ml507/ml507.c
@@ -0,0 +1,46 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * This work has been supported by: QTechnology  http://qtec.com/
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <config.h>
+#include <common.h>
+#include <asm/processor.h>
+
+int board_pre_init(void)
+{
+	return 0;
+}
+
+int checkboard(void)
+{
+	puts ("ML507 Board\n");
+	return 0;
+}
+
+phys_size_t initdram(int board_type)
+{
+	return 256 * 1024 * 1024;
+}
+
+void get_sys_info(sys_info_t * sysInfo)
+{
+	sysInfo->freqProcessor = XPAR_CORE_CLOCK_FREQ_HZ;
+	sysInfo->freqPLB = XPAR_PLB_CLOCK_FREQ_HZ;
+	sysInfo->freqPCI = 0;
+
+	return;
+}
diff --git a/board/xilinx/ml507/u-boot.lds b/board/xilinx/ml507/u-boot.lds
new file mode 100644
index 0000000..ef2bdc3
--- /dev/null
+++ b/board/xilinx/ml507/u-boot.lds
@@ -0,0 +1,130 @@
+/*
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ * 2008:
+ * Modified by: Ricardo Ribalda Delgado ricardo.ribalda at uam.es
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+ENTRY(_start_440)
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)		}
+  .dynsym        : { *(.dynsym)		}
+  .dynstr        : { *(.dynstr)		}
+  .rel.text      : { *(.rel.text)		}
+  .rela.text     : { *(.rela.text)	}
+  .rel.data      : { *(.rel.data)		}
+  .rela.data     : { *(.rela.data)	}
+  .rel.rodata    : { *(.rel.rodata)	}
+  .rela.rodata   : { *(.rela.rodata)	}
+  .rel.got       : { *(.rel.got)		}
+  .rela.got      : { *(.rela.got)		}
+  .rel.ctors     : { *(.rel.ctors)	}
+  .rela.ctors    : { *(.rela.ctors)	}
+  .rel.dtors     : { *(.rel.dtors)	}
+  .rela.dtors    : { *(.rela.dtors)	}
+  .rel.bss       : { *(.rel.bss)		}
+  .rela.bss      : { *(.rela.bss)		}
+  .rel.plt       : { *(.rel.plt)		}
+  .rela.plt      : { *(.rela.plt)		}
+  .init          : { *(.init)	}
+  .plt : { *(.plt) }
+  .text      :
+  {
+    *(.text)
+    *(.fixup)
+    *(.got1)
+  }
+  _etext = .;
+  PROVIDE (etext = .);
+  .rodata    :
+  {
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x00FF) & 0xFFFFFF00;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(256);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(256);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss (NOLOAD)       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
diff --git a/board/xilinx/ml507/xparameters.h b/board/xilinx/ml507/xparameters.h
new file mode 100644
index 0000000..1c41eb5
--- /dev/null
+++ b/board/xilinx/ml507/xparameters.h
@@ -0,0 +1,34 @@
+/*   
+    (C) Copyright 2008
+    Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+    This work has been supported by: QTechnology  http://qtec.com/
+    based on xparameters-ml507.h by Xilinx
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef XPARAMETER_H
+#define XPARAMETER_H
+
+#define XPAR_DDR2_SDRAM_MEM_BASEADDR 	0x00000000
+#define XPAR_INTC_0_BASEADDR 		0x81800000
+#define XPAR_UARTLITE_0_BASEADDR 	0x84000000
+#define XPAR_RS232_UART_1_BASEADDR 	0x84000000
+#define XPAR_IIC_EEPROM_BASEADDR 	0x81600000
+#define XPAR_LLTEMAC_0_BASEADDR 	0x81c00000
+#define XPAR_PLB_CLOCK_FREQ_HZ 		100000000
+#define XPAR_CORE_CLOCK_FREQ_HZ 	400000000
+#define XPAR_INTC_MAX_NUM_INTR_INPUTS 	13
+
+#endif
diff --git a/include/configs/ml507.h b/include/configs/ml507.h
new file mode 100644
index 0000000..cb44d08
--- /dev/null
+++ b/include/configs/ml507.h
@@ -0,0 +1,107 @@
+/*
+ * (C) Copyright 2008
+ *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es 
+ *  This work has been supported by: Q-Technology  http://qtec.com/
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+#define DEBUG
+#define ET_DEBUG
+*/
+ /*CPU*/
+#define CONFIG_XILINX_ML507	1
+#define CONFIG_XILINX_440	1
+#define CONFIG_440		1
+#define CONFIG_4xx		1
+#include "../board/xilinx/ml507/xparameters.h"
+
+/*Mem Map*/
+#define CFG_SDRAM_BASE		0x0
+#define CFG_MONITOR_BASE	0x04000000
+#define CFG_MONITOR_LEN		(192*1024)
+#define CFG_MALLOC_LEN		(128*1024)
+#define CFG_ISRAM_BASE		XPAR_XPS_BRAM_IF_CNTLR_1_BASEADDR
+
+/*Uart*/
+#define CONFIG_XILINX_UARTLITE
+#define CONFIG_BAUDRATE		9600
+#define CFG_BAUDRATE_TABLE	{9600}
+#define CONFIG_SERIAL_BASE	XPAR_UARTLITE_0_BASEADDR
+
+/*Cmd*/
+#include <config_cmd_default.h>
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_REGINFO
+#undef CONFIG_CMD_I2C
+#undef CONFIG_CMD_DTT
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_PING
+#undef CONFIG_CMD_DHCP
+#undef CONFIG_CMD_EEPROM
+#undef CONFIG_CMD_IMLS
+
+/*Env*/
+#define	CFG_ENV_IS_NOWHERE
+#define	CFG_ENV_SIZE		0x200
+#define CFG_ENV_OFFSET 		0x100
+#define CFG_NO_FLASH
+
+/*Misc*/
+#define CONFIG_BOOTDELAY	5		/* autoboot after 5 seconds     */
+#define CFG_LONGHELP				/* undef to save memory         */
+#define CFG_PROMPT		"board:/# "	/* Monitor Command Prompt       */
+#if defined(CONFIG_CMD_KGDB)
+#define CFG_CBSIZE		1024		/* Console I/O Buffer Size      */
+#else
+#define CFG_CBSIZE		256		/* Console I/O Buffer Size      */
+#endif
+#define CFG_PBSIZE		(CFG_CBSIZE+sizeof(CFG_PROMPT)+16)
+#define CFG_MAXARGS		16		/* max number of command args   */
+#define CFG_BARGSIZE		CFG_CBSIZE	/* Boot Argument Buffer Size */
+#define CFG_MEMTEST_START	0x0400000	/* memtest works on           */
+#define CFG_MEMTEST_END		0x0C00000	/* 4 ... 12 MB in DRAM        */
+#define CFG_LOAD_ADDR		0x400000	/* default load address       */
+#define CFG_EXTBDINFO		1		/* To use extended board_into (bd_t) */
+#define CFG_HZ			1000		/* decrementer freq: 1 ms ticks */
+#define CONFIG_CMDLINE_EDITING			/* add command line history     */
+#define CONFIG_AUTO_COMPLETE			/* add autocompletion support   */
+#define CONFIG_LOOPW				/* enable loopw command         */
+#define CONFIG_MX_CYCLIC			/* enable mdc/mwc commands      */
+#define CONFIG_ZERO_BOOTDELAY_CHECK		/* check for keypress on bootdelay==0 */
+#define CONFIG_VERSION_VARIABLE			/* include version env variable */
+#define CFG_CONSOLE_INFO_QUIET			/* don't print console @ startup */
+#define CFG_HUSH_PARSER				/* Use the HUSH parser          */
+#define	CFG_PROMPT_HUSH_PS2	"> "
+#define CONFIG_LOADS_ECHO			/* echo on for serial download  */
+#define CFG_LOADS_BAUD_CHANGE			/* allow baudrate change        */
+#define CFG_BOOTMAPSZ		(8 << 20)	/* Initial Memory map for Linux */
+#define CONFIG_PREBOOT		"echo U-Boot is up and runnining;"
+
+/*Stack*/
+#define CFG_INIT_RAM_ADDR	0x800000	/* Initial RAM address    */
+#define CFG_INIT_RAM_END	0x2000		/* End of used area in RAM  */
+#define CFG_GBL_DATA_SIZE	128		/* num bytes initial data   */
+#define CFG_GBL_DATA_OFFSET	(CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_INIT_SP_OFFSET	CFG_GBL_DATA_OFFSET
+/*Speed*/
+#define CONFIG_SYS_CLK_FREQ	400000000
+
+#endif						/* __CONFIG_H */
-- 
1.5.6.2

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx [Resubmit] [PATCH] CPU PPC440x5 on Virtex5 FX (new version)
  2008-07-14 19:47 [U-Boot-Users] ppc4xx [Resubmit] [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Ricardo Ribalda Delgado
  2008-07-14 19:47 ` [U-Boot-Users] ppc4xx: [PATCH] [Resubmit] ML507 Board Support Ricardo Ribalda Delgado
@ 2008-07-15 20:47 ` Ricardo Ribalda Delgado
  2008-07-16  1:14 ` [U-Boot-Users] ppc4xx: " Ricardo Ribalda Delgado
  2 siblings, 0 replies; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-15 20:47 UTC (permalink / raw)
  To: u-boot

Please do not use this yet. I have found problems running MAKEALL.

  I try to fix then and resubmit

On Mon, Jul 14, 2008 at 9:47 PM, Ricardo Ribalda Delgado
<ricardo.ribalda@uam.es> wrote:
>
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
> ---
> -This patchs gives support for the embbedded ppc440
> on the Virtex5 FPGAs
> -interrupts.c divided in uic.c and interrupts.c
> -xilinx_irq.c for xilinx interrupt controller
>
>  cpu/ppc4xx/Makefile         |   15 +++-
>  cpu/ppc4xx/cpu.c            |    4 +
>  cpu/ppc4xx/interrupts.c     |  178 ++++++---------------------------
>  cpu/ppc4xx/speed.c          |    6 +-
>  cpu/ppc4xx/uic.c            |  238 +++++++++++++++++++++++++++++++++++++++++++
>  cpu/ppc4xx/xilinx_irq.c     |  113 ++++++++++++++++++++
>  include/asm-ppc/interrupt.h |   50 +++++++++
>  include/asm-ppc/processor.h |    2 +
>  8 files changed, 456 insertions(+), 150 deletions(-)
>  create mode 100644 cpu/ppc4xx/uic.c
>  create mode 100644 cpu/ppc4xx/xilinx_irq.c
>  create mode 100644 include/asm-ppc/interrupt.h
>
> diff --git a/cpu/ppc4xx/Makefile b/cpu/ppc4xx/Makefile
> index 800bb41..b006127 100644
> --- a/cpu/ppc4xx/Makefile
> +++ b/cpu/ppc4xx/Makefile
> @@ -35,10 +35,14 @@ SOBJS       += kgdb.o
>  COBJS  := 40x_spd_sdram.o
>  COBJS  += 44x_spd_ddr.o
>  COBJS  += 44x_spd_ddr2.o
> -COBJS  += 4xx_enet.o
> +ifndef CONFIG_XILINX_440
> +COBJS   += 4xx_enet.o
> +endif
>  COBJS  += 4xx_pci.o
>  COBJS  += 4xx_pcie.o
> +ifndef CONFIG_XILINX_440
>  COBJS  += 4xx_uart.o
> +endif
>  COBJS  += bedbug_405.o
>  COBJS  += commproc.o
>  COBJS  += cpu.o
> @@ -47,11 +51,20 @@ COBJS       += denali_data_eye.o
>  COBJS  += denali_spd_ddr2.o
>  COBJS  += ecc.o
>  COBJS  += fdt.o
> +ifndef CONFIG_XILINX_440
>  COBJS  += gpio.o
> +endif
>  COBJS  += i2c.o
>  COBJS  += interrupts.o
> +ifndef CONFIG_XILINX_440
> +COBJS  += uic.o
> +else
> +COBJS  += xilinx_irq.o
> +endif
>  COBJS  += iop480_uart.o
> +ifndef CONFIG_XILINX_440
>  COBJS  += miiphy.o
> +endif
>  COBJS  += ndfc.o
>  COBJS  += sdram.o
>  COBJS  += speed.o
> diff --git a/cpu/ppc4xx/cpu.c b/cpu/ppc4xx/cpu.c
> index ef32bc6..2b9b364 100644
> --- a/cpu/ppc4xx/cpu.c
> +++ b/cpu/ppc4xx/cpu.c
> @@ -541,6 +541,10 @@ int checkcpu (void)
>                puts("GX Rev. A");
>                strcpy(addstr, "No Security support");
>                break;
> +
> +       case PVR_VIRTEX5:
> +               puts(" VIRTEX5");
> +               break;
>
>        default:
>                printf (" UNKNOWN (PVR=%08x)", pvr);
> diff --git a/cpu/ppc4xx/interrupts.c b/cpu/ppc4xx/interrupts.c
> index 8215dc6..58d1d81 100644
> --- a/cpu/ppc4xx/interrupts.c
> +++ b/cpu/ppc4xx/interrupts.c
> @@ -8,6 +8,10 @@
>  * (C) Copyright 2003 (440GX port)
>  * Travis B. Sawyer, Sandburst Corporation, tsawyer at sandburst.com
>  *
> + * (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
> + * Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * Work supported by Qtechnology (htpp://qtec.com)
> + *
>  * See file CREDITS for list of people who contributed to this
>  * project.
>  *
> @@ -31,23 +35,11 @@
>  #include <watchdog.h>
>  #include <command.h>
>  #include <asm/processor.h>
> +#include <asm/interrupt.h>
>  #include <ppc4xx.h>
>  #include <ppc_asm.tmpl>
>  #include <commproc.h>
>
> -#if (UIC_MAX > 3)
> -#define UICB0_ALL      (UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
> -                        UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI) | \
> -                        UIC_MASK(VECNUM_UIC3CI) | UIC_MASK(VECNUM_UIC3NCI))
> -#elif (UIC_MAX > 2)
> -#define UICB0_ALL      (UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
> -                        UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI))
> -#elif (UIC_MAX > 1)
> -#define UICB0_ALL      (UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI))
> -#else
> -#define UICB0_ALL      0
> -#endif
> -
>  DECLARE_GLOBAL_DATA_PTR;
>
>  /*
> @@ -58,11 +50,7 @@ struct       irq_action {
>        void *arg;
>        int count;
>  };
> -
> -static struct irq_action irq_vecs[UIC_MAX * 32];
> -
> -u32 get_dcr(u16);
> -void set_dcr(u16, u32);
> +static struct irq_action irq_vecs[IRQ_MAX];
>
>  #if defined(CONFIG_440)
>
> @@ -103,7 +91,7 @@ int interrupt_init_cpu (unsigned *decrementer_count)
>        /*
>         * Mark all irqs as free
>         */
> -       for (vec = 0; vec < (UIC_MAX * 32); vec++) {
> +       for (vec = 0; vec < IRQ_MAX; vec++) {
>                irq_vecs[vec].handler = NULL;
>                irq_vecs[vec].arg = NULL;
>                irq_vecs[vec].count = 0;
> @@ -147,110 +135,36 @@ int interrupt_init_cpu (unsigned *decrementer_count)
>         */
>        set_evpr(0x00000000);
>
> -#if (UIC_MAX > 1)
> -       /* Install the UIC1 handlers */
> -       irq_install_handler(VECNUM_UIC1NCI, (void *)(void *)external_interrupt, 0);
> -       irq_install_handler(VECNUM_UIC1CI, (void *)(void *)external_interrupt, 0);
> -#endif
> -#if (UIC_MAX > 2)
> -       irq_install_handler(VECNUM_UIC2NCI, (void *)(void *)external_interrupt, 0);
> -       irq_install_handler(VECNUM_UIC2CI, (void *)(void *)external_interrupt, 0);
> -#endif
> -#if (UIC_MAX > 3)
> -       irq_install_handler(VECNUM_UIC3NCI, (void *)(void *)external_interrupt, 0);
> -       irq_install_handler(VECNUM_UIC3CI, (void *)(void *)external_interrupt, 0);
> -#endif
> +       /*
> +        *Call uic or xilinx_irq pic_enable
> +        */
> +       pic_enable();
>
>        return (0);
>  }
>
> -/* Handler for UIC interrupt */
> -static void uic_interrupt(u32 uic_base, int vec_base)
> +void timer_interrupt_cpu(struct pt_regs *regs)
>  {
> -       u32 uic_msr;
> -       u32 msr_shift;
> -       int vec;
> -
> -       /*
> -        * Read masked interrupt status register to determine interrupt source
> -        */
> -       uic_msr = get_dcr(uic_base + UIC_MSR);
> -       msr_shift = uic_msr;
> -       vec = vec_base;
> -
> -       while (msr_shift != 0) {
> -               if (msr_shift & 0x80000000) {
> -                       /*
> -                        * Increment irq counter (for debug purpose only)
> -                        */
> -                       irq_vecs[vec].count++;
> -
> -                       if (irq_vecs[vec].handler != NULL) {
> -                               /* call isr */
> -                               (*irq_vecs[vec].handler)(irq_vecs[vec].arg);
> -                       } else {
> -                               set_dcr(uic_base + UIC_ER,
> -                                       get_dcr(uic_base + UIC_ER) & ~UIC_MASK(vec));
> -                               printf("Masking bogus interrupt vector %d"
> -                                      " (UIC_BASE=0x%x)\n", vec, uic_base);
> -                       }
> -
> -                       /*
> -                        * After servicing the interrupt, we have to remove the
> -                        * status indicator
> -                        */
> -                       set_dcr(uic_base + UIC_SR, UIC_MASK(vec));
> -               }
> -
> -               /*
> -                * Shift msr to next position and increment vector
> -                */
> -               msr_shift <<= 1;
> -               vec++;
> -       }
> +       /* nothing to do here */
> +       return;
>  }
>
> -/*
> - * Handle external interrupts
> - */
> -void external_interrupt(struct pt_regs *regs)
> +void interrupt_run_handler(int vec)
>  {
> -       u32 uic_msr;
> -
> -       /*
> -        * Read masked interrupt status register to determine interrupt source
> -        */
> -       uic_msr = mfdcr(uic0msr);
> -
> -#if (UIC_MAX > 1)
> -       if ((UIC_MASK(VECNUM_UIC1CI) & uic_msr) ||
> -           (UIC_MASK(VECNUM_UIC1NCI) & uic_msr))
> -               uic_interrupt(UIC1_DCR_BASE, 32);
> -#endif
> -
> -#if (UIC_MAX > 2)
> -       if ((UIC_MASK(VECNUM_UIC2CI) & uic_msr) ||
> -           (UIC_MASK(VECNUM_UIC2NCI) & uic_msr))
> -               uic_interrupt(UIC2_DCR_BASE, 64);
> -#endif
> -
> -#if (UIC_MAX > 3)
> -       if ((UIC_MASK(VECNUM_UIC3CI) & uic_msr) ||
> -           (UIC_MASK(VECNUM_UIC3NCI) & uic_msr))
> -               uic_interrupt(UIC3_DCR_BASE, 96);
> -#endif
> -
> -       if (uic_msr & ~(UICB0_ALL))
> -               uic_interrupt(UIC0_DCR_BASE, 0);
> -
> -       mtdcr(uic0sr, uic_msr);
> +       irq_vecs[vec].count++;
> +
> +       if (irq_vecs[vec].handler != NULL) {
> +               /* call isr */
> +               (*irq_vecs[vec].handler) (irq_vecs[vec].arg);
> +       } else {
> +               pic_irq_disable(vec);
> +               printf("Masking bogus interrupt vector %d\n", vec);
> +       }
>
> +       pic_irq_ack(vec);
>        return;
>  }
>
> -/*
> - * Install and free a interrupt handler.
> - */
>  void irq_install_handler(int vec, interrupt_handler_t * handler, void *arg)
>  {
>        /*
> @@ -263,51 +177,19 @@ void irq_install_handler(int vec, interrupt_handler_t * handler, void *arg)
>        irq_vecs[vec].handler = handler;
>        irq_vecs[vec].arg = arg;
>
> -       if ((vec >= 0) && (vec < 32))
> -               mtdcr(uicer, mfdcr(uicer) | UIC_MASK(vec));
> -#if (UIC_MAX > 1)
> -       else if ((vec >= 32) && (vec < 64))
> -               mtdcr(uic1er, mfdcr(uic1er) | UIC_MASK(vec));
> -#endif
> -#if (UIC_MAX > 2)
> -       else if ((vec >= 64) && (vec < 96))
> -               mtdcr(uic2er, mfdcr(uic2er) | UIC_MASK(vec));
> -#endif
> -#if (UIC_MAX > 3)
> -       else if (vec >= 96)
> -               mtdcr(uic3er, mfdcr(uic3er) | UIC_MASK(vec));
> -#endif
> -
> -       debug("Install interrupt for vector %d ==> %p\n", vec, handler);
> +       pic_irq_enable(vec);
> +       return;
>  }
>
> -void irq_free_handler (int vec)
> +void irq_free_handler(int vec)
>  {
>        debug("Free interrupt for vector %d ==> %p\n",
>              vec, irq_vecs[vec].handler);
>
> -       if ((vec >= 0) && (vec < 32))
> -               mtdcr(uicer, mfdcr(uicer) & ~UIC_MASK(vec));
> -#if (UIC_MAX > 1)
> -       else if ((vec >= 32) && (vec < 64))
> -               mtdcr(uic1er, mfdcr(uic1er) & ~UIC_MASK(vec));
> -#endif
> -#if (UIC_MAX > 2)
> -       else if ((vec >= 64) && (vec < 96))
> -               mtdcr(uic2er, mfdcr(uic2er) & ~UIC_MASK(vec));
> -#endif
> -#if (UIC_MAX > 3)
> -       else if (vec >= 96)
> -               mtdcr(uic3er, mfdcr(uic3er) & ~UIC_MASK(vec));
> -#endif
> +       pic_irq_disable(vec);
>
>        irq_vecs[vec].handler = NULL;
>        irq_vecs[vec].arg = NULL;
> -}
> -
> -void timer_interrupt_cpu (struct pt_regs *regs)
> -{
> -       /* nothing to do here */
>        return;
>  }
>
> @@ -319,7 +201,7 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
>        printf ("Interrupt-Information:\n");
>        printf ("Nr  Routine   Arg       Count\n");
>
> -       for (vec = 0; vec < (UIC_MAX * 32); vec++) {
> +       for (vec = 0; vec < IRQ_MAX; vec++) {
>                if (irq_vecs[vec].handler != NULL) {
>                        printf ("%02d  %08lx  %08lx  %d\n",
>                                vec,
> diff --git a/cpu/ppc4xx/speed.c b/cpu/ppc4xx/speed.c
> index b86b6de..d21bd82 100644
> --- a/cpu/ppc4xx/speed.c
> +++ b/cpu/ppc4xx/speed.c
> @@ -416,7 +416,8 @@ ulong get_PCI_freq (void)
>        return sys_info.freqPCI;
>  }
>
> -#elif !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && !defined(CONFIG_440SPE)
> +#elif !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && !defined(CONFIG_440SPE) \
> +       && !defined(CONFIG_XILINX_440)
>  void get_sys_info (sys_info_t * sysInfo)
>  {
>        unsigned long strp0;
> @@ -449,6 +450,8 @@ void get_sys_info (sys_info_t * sysInfo)
>        sysInfo->freqUART = sysInfo->freqPLB;
>  }
>  #else
> +
> +#if !defined(CONFIG_XILINX_440)
>  void get_sys_info (sys_info_t * sysInfo)
>  {
>        unsigned long strp0;
> @@ -535,6 +538,7 @@ void get_sys_info (sys_info_t * sysInfo)
>  }
>
>  #endif
> +#endif /* CONFIG_XILINX_440 */
>
>  #if defined(CONFIG_YUCCA)
>  unsigned long determine_sysper(void)
> diff --git a/cpu/ppc4xx/uic.c b/cpu/ppc4xx/uic.c
> new file mode 100644
> index 0000000..92350dc
> --- /dev/null
> +++ b/cpu/ppc4xx/uic.c
> @@ -0,0 +1,238 @@
> +/*
> + * (C) Copyright 2000-2002
> + * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> + *
> + * (C) Copyright 2002 (440 port)
> + * Scott McNutt, Artesyn Communication Producs, smcnutt at artsyncp.com
> + *
> + * (C) Copyright 2003 (440GX port)
> + * Travis B. Sawyer, Sandburst Corporation, tsawyer at sandburst.com
> + *
> + * (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
> + * Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * Work supported by Qtechnology (htpp://qtec.com)
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include <common.h>
> +#include <watchdog.h>
> +#include <command.h>
> +#include <asm/processor.h>
> +#include <asm/interrupt.h>
> +#include <ppc4xx.h>
> +#include <ppc_asm.tmpl>
> +#include <commproc.h>
> +
> +#if (UIC_MAX > 3)
> +#define UICB0_ALL      (UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
> +                        UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI) | \
> +                        UIC_MASK(VECNUM_UIC3CI) | UIC_MASK(VECNUM_UIC3NCI))
> +#elif (UIC_MAX > 2)
> +#define UICB0_ALL      (UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
> +                        UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI))
> +#elif (UIC_MAX > 1)
> +#define UICB0_ALL      (UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI))
> +#else
> +#define UICB0_ALL      0
> +#endif
> +
> +#if (UIC_MAX > 1) && !defined(CONFIG_440GX)
> +static void uic_cascade_interrupt(void *para);
> +#endif
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +static void pic_enable()
> +{
> +       int vec;
> +
> +#if !defined (CONFIG_440_VIRTEX5)
> +
> +#if (UIC_MAX > 1)
> +       /* Install the UIC1 handlers */
> +       irq_install_handler(VECNUM_UIC1NCI, (void *)(void *)external_interrupt,
> +                           0);
> +       irq_install_handler(VECNUM_UIC1CI, (void *)(void *)external_interrupt,
> +                           0);
> +#endif
> +#if (UIC_MAX > 2)
> +       irq_install_handler(VECNUM_UIC2NCI, (void *)(void *)external_interrupt,
> +                           0);
> +       irq_install_handler(VECNUM_UIC2CI, (void *)(void *)external_interrupt,
> +                           0);
> +#endif
> +#if (UIC_MAX > 3)
> +       irq_install_handler(VECNUM_UIC3NCI, (void *)(void *)external_interrupt,
> +                           0);
> +       irq_install_handler(VECNUM_UIC3CI, (void *)(void *)external_interrupt,
> +                           0);
> +#endif
> +#else                          /* !defined(CONFIG_440GX) */
> +       /* Take the GX out of compatibility mode
> +        * Travis Sawyer, 9 Mar 2004
> +        * NOTE: 440gx user manual inconsistency here
> +        *       Compatibility mode and Ethernet Clock select are not
> +        *       correct in the manual
> +        */
> +       mfsdr(sdr_mfr, val);
> +       val &= ~0x10000000;
> +       mtsdr(sdr_mfr, val);
> +
> +       /* Enable UIC interrupts via UIC Base Enable Register */
> +       mtdcr(uicb0sr, UICB0_ALL);
> +       mtdcr(uicb0er, 0x54000000);
> +       /* None are critical */
> +       mtdcr(uicb0cr, 0);
> +#endif                         /* !defined(CONFIG_440GX) */
> +
> +}
> +
> +#if (UIC_MAX > 1) && !defined(CONFIG_440GX)
> +static void uic_cascade_interrupt(void *para)
> +{
> +       external_interrupt(para);
> +}
> +#endif
> +
> +/* Handler for UIC interrupt */
> +static void uic_interrupt(u32 uic_base, int vec_base)
> +{
> +       u32 uic_msr;
> +       u32 msr_shift;
> +       int vec;
> +
> +       /*
> +        * Read masked interrupt status register to determine interrupt source
> +        */
> +       uic_msr = get_dcr(uic_base + UIC_MSR);
> +       msr_shift = uic_msr;
> +       vec = vec_base;
> +
> +       while (msr_shift != 0) {
> +               if (msr_shift & 0x80000000)
> +                       interrupt_run_handler(vec);
> +               /*
> +                * Shift msr to next position and increment vector
> +                */
> +               msr_shift <<= 1;
> +               vec++;
> +       }
> +}
> +
> +/*
> + * Handle external interrupts
> + */
> +void external_interrupt(struct pt_regs *regs)
> +{
> +       u32 uic_msr;
> +
> +       /*
> +        * Read masked interrupt status register to determine interrupt source
> +        */
> +       uic_msr = mfdcr(uic0msr);
> +
> +#if (UIC_MAX > 1)
> +       if ((UIC_MASK(VECNUM_UIC1CI) & uic_msr) ||
> +           (UIC_MASK(VECNUM_UIC1NCI) & uic_msr))
> +               uic_interrupt(UIC1_DCR_BASE, 32);
> +#endif
> +
> +#if (UIC_MAX > 2)
> +       if ((UIC_MASK(VECNUM_UIC2CI) & uic_msr) ||
> +           (UIC_MASK(VECNUM_UIC2NCI) & uic_msr))
> +               uic_interrupt(UIC2_DCR_BASE, 64);
> +#endif
> +
> +#if (UIC_MAX > 3)
> +       if ((UIC_MASK(VECNUM_UIC3CI) & uic_msr) ||
> +           (UIC_MASK(VECNUM_UIC3NCI) & uic_msr))
> +               uic_interrupt(UIC3_DCR_BASE, 96);
> +#endif
> +
> +       if (uic_msr & ~(UICB0_ALL))
> +               uic_interrupt(UIC0_DCR_BASE, 0);
> +
> +       mtdcr(uic0sr, uic_msr);
> +
> +       return;
> +}
> +
> +void pic_irq_ack(int vec)
> +{
> +
> +       if ((vec >= 0) && (vec < 32))
> +               mtdcr(uicsr, UIC_MASK(vec));
> +#if (UIC_MAX > 1)
> +       else if ((vec >= 32) && (vec < 64))
> +               mtdcr(uic1sr, UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 2)
> +       else if ((vec >= 64) && (vec < 96))
> +               mtdcr(uic2sr, UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 3)
> +       else if (vec >= 96)
> +               mtdcr(uic3sr, UIC_MASK(vec));
> +#endif
> +}
> +
> +/*
> + * Install and free a interrupt handler.
> + */
> +void pic_irq_enable(int vec, interrupt_handler_t * handler, void *arg)
> +{
> +
> +       if ((vec >= 0) && (vec < 32))
> +               mtdcr(uicer, mfdcr(uicer) | UIC_MASK(vec));
> +#if (UIC_MAX > 1)
> +       else if ((vec >= 32) && (vec < 64))
> +               mtdcr(uic1er, mfdcr(uic1er) | UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 2)
> +       else if ((vec >= 64) && (vec < 96))
> +               mtdcr(uic2er, mfdcr(uic2er) | UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 3)
> +       else if (vec >= 96)
> +               mtdcr(uic3er, mfdcr(uic3er) | UIC_MASK(vec));
> +#endif
> +
> +       debug("Install interrupt for vector %d ==> %p\n", vec, handler);
> +}
> +
> +void pic_irq_disable(int vec)
> +{
> +
> +       if ((vec >= 0) && (vec < 32))
> +               mtdcr(uicer, mfdcr(uicer) & ~UIC_MASK(vec));
> +#if (UIC_MAX > 1)
> +       else if ((vec >= 32) && (vec < 64))
> +               mtdcr(uic1er, mfdcr(uic1er) & ~UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 2)
> +       else if ((vec >= 64) && (vec < 96))
> +               mtdcr(uic2er, mfdcr(uic2er) & ~UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 3)
> +       else if (vec >= 96)
> +               mtdcr(uic3er, mfdcr(uic3er) & ~UIC_MASK(vec));
> +#endif
> +
> +}
> diff --git a/cpu/ppc4xx/xilinx_irq.c b/cpu/ppc4xx/xilinx_irq.c
> new file mode 100644
> index 0000000..ff10a08
> --- /dev/null
> +++ b/cpu/ppc4xx/xilinx_irq.c
> @@ -0,0 +1,113 @@
> +/*
> + * (C) Copyright 2008
> + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * This work has been supported by: Q-Technology  http://qtec.com/
> + * Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd at denx.de
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/
> +#include <common.h>
> +#include <watchdog.h>
> +#include <command.h>
> +#include <asm/processor.h>
> +#include <asm/interrupt.h>
> +#include <ppc4xx.h>
> +#include <ppc_asm.tmpl>
> +#include <commproc.h>
> +#include <asm/io.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#define intc XPAR_INTC_0_BASEADDR
> +#define ISR (u32*)(intc+(0*4)) /* Interrupt Status Register */
> +#define IPR (u32*)(intc+(1*4)) /* Interrupt Pending Register */
> +#define IER (u32*)(intc+(2*4)) /* Interrupt Enable Register */
> +#define IAR (u32*)(intc+(3*4)) /* Interrupt Acknowledge Register */
> +#define SIE (u32*)(intc+(4*4)) /* Set Interrupt Enable bits */
> +#define CIE (u32*)(intc+(5*4)) /* Clear Interrupt Enable bits */
> +#define IVR (u32*)(intc+(6*4)) /* Interrupt Vector Register */
> +#define MER (u32*)(intc+(7*4)) /* Master Enable Register */
> +
> +#define IRQ_MASK(irq) (1<<(irq&0x1f))
> +
> +void pic_enable(void)
> +{
> +
> +       printf("Xilinx PIC at 0x%8x\n", intc);
> +
> +       /*
> +        * Disable all external interrupts until they are
> +        * explicitly requested.
> +        */
> +       out_be32(IER, 0);
> +
> +       /* Acknowledge any pending interrupts just in case. */
> +       out_be32(IAR, ~(u32) 0);
> +
> +       /* Turn on the Master Enable. */
> +       out_be32(MER, 0x3UL);
> +
> +       return;
> +
> +}
> +
> +int xilinx_pic_irq_get(void)
> +{
> +       u32 irq;
> +       irq = in_be32(IVR);
> +
> +       /* If no interrupt is pending then all bits of the IVR are set to 1. As
> +        * the IVR is as many bits wide as numbers of inputs are available.
> +        * Therefore, if all bits of the IVR are set to one, its content will
> +        * be bigger than XPAR_INTC_MAX_NUM_INTR_INPUTS.
> +        */
> +       if (irq >= XPAR_INTC_MAX_NUM_INTR_INPUTS)
> +               irq = -1;       /* report no pending interrupt. */
> +
> +       debug("get_irq: %d\n", irq);
> +       return (irq);
> +}
> +
> +void pic_irq_enable(unsigned int irq)
> +{
> +       unsigned long mask = IRQ_MASK(irq);
> +       debug("enable: %d\n", irq);
> +       out_be32(SIE, mask);
> +}
> +
> +void pic_irq_disable(unsigned int irq)
> +{
> +       unsigned long mask = IRQ_MASK(irq);
> +       debug("disable: %d\n", irq);
> +       out_be32(CIE, mask);
> +}
> +
> +void pic_irq_ack(unsigned int irq)
> +{
> +       unsigned long mask = IRQ_MASK(irq);
> +       debug("ack: %d\n", irq);
> +       out_be32(IAR, mask);
> +}
> +
> +void external_interrupt(struct pt_regs *regs)
> +{
> +       int irq;
> +
> +       irq = xilinx_pic_irq_get();
> +       if (irq < 0)
> +               return;
> +
> +       interrupt_run_handler(irq);
> +
> +       return;
> +}
> diff --git a/include/asm-ppc/interrupt.h b/include/asm-ppc/interrupt.h
> new file mode 100644
> index 0000000..5217e66
> --- /dev/null
> +++ b/include/asm-ppc/interrupt.h
> @@ -0,0 +1,50 @@
> +/*
> + * (C) Copyright 2008
> + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * This work has been supported by: Q-Technology  http://qtec.com/
> + * Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd at denx.de
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/
> +#ifndef INTERRUPT_H
> +#define INTERRUPT_H
> +
> +#if defined(CONFIG_440SPE) || \
> +    defined(CONFIG_460EX) || defined(CONFIG_460GT)
> +#define UIC_MAX                4
> +#elif defined(CONFIG_440GX) || \
> +    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
> +    defined(CONFIG_405EX)
> +#define UIC_MAX                3
> +#elif defined(CONFIG_440GP) || defined(CONFIG_440SP) || \
> +    defined(CONFIG_440EP) || defined(CONFIG_440GR)
> +#define UIC_MAX                2
> +#else
> +#define UIC_MAX                1
> +#endif
> +
> +#if defined(CONFIG_440_VIRTEX5)
> +#define IRQ_MAX XPAR_INTC_MAX_NUM_INTR_INPUTS
> +#else
> +#define IRQ_MAX UIC_MAX * 32
> +#endif
> +
> +void pic_enable(void);
> +void pic_irq_enable(unsigned int irq);
> +void pic_irq_disable(unsigned int irq);
> +void pic_irq_ack(unsigned int irq);
> +void external_interrupt(struct pt_regs *regs);
> +void interrupt_run_handler(int vec);
> +
> +#endif
> diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
> index 6e134c3..5501244 100644
> --- a/include/asm-ppc/processor.h
> +++ b/include/asm-ppc/processor.h
> @@ -839,6 +839,8 @@
>  #define PVR_86xx       0x80040000
>  #define PVR_86xx_REV1  (PVR_86xx | 0x0010)
>
> +#define PVR_VIRTEX5     0x7ff21912
> +
>  /*
>  * For the 8xx processors, all of them report the same PVR family for
>  * the PowerPC core. The various versions of these processors must be
> --
> 1.5.6.2
>
>



-- 
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (new version)
  2008-07-14 19:47 [U-Boot-Users] ppc4xx [Resubmit] [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Ricardo Ribalda Delgado
  2008-07-14 19:47 ` [U-Boot-Users] ppc4xx: [PATCH] [Resubmit] ML507 Board Support Ricardo Ribalda Delgado
  2008-07-15 20:47 ` [U-Boot-Users] ppc4xx [Resubmit] [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Ricardo Ribalda Delgado
@ 2008-07-16  1:14 ` Ricardo Ribalda Delgado
  2008-07-16 15:14   ` Jon Loeliger
  2008-07-17  6:24   ` [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Stefan Roese
  2 siblings, 2 replies; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-16  1:14 UTC (permalink / raw)
  To: u-boot

Previous patch did not compile on some boards


Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
---
-This patchs gives support for the embbedded ppc440
on the Virtex5 FPGAs

-interrupts.c divided in uic.c and interrupts.c

-xilinx_irq.c for xilinx interrupt controller

 cpu/ppc4xx/Makefile         |   13 +++
 cpu/ppc4xx/cpu.c            |    8 ++
 cpu/ppc4xx/interrupts.c     |  178 ++++++------------------------------
 cpu/ppc4xx/speed.c          |    6 +-
 cpu/ppc4xx/uic.c            |  210 +++++++++++++++++++++++++++++++++++++++++++
 cpu/ppc4xx/xilinx_irq.c     |  111 +++++++++++++++++++++++
 include/asm-ppc/interrupt.h |   37 ++++++++
 include/asm-ppc/processor.h |    2 +
 8 files changed, 416 insertions(+), 149 deletions(-)
 create mode 100644 cpu/ppc4xx/uic.c
 create mode 100644 cpu/ppc4xx/xilinx_irq.c
 create mode 100644 include/asm-ppc/interrupt.h

diff --git a/cpu/ppc4xx/Makefile b/cpu/ppc4xx/Makefile
index 800bb41..9d918c9 100644
--- a/cpu/ppc4xx/Makefile
+++ b/cpu/ppc4xx/Makefile
@@ -35,10 +35,14 @@ SOBJS	+= kgdb.o
 COBJS	:= 40x_spd_sdram.o
 COBJS	+= 44x_spd_ddr.o
 COBJS	+= 44x_spd_ddr2.o
+ifndef CONFIG_XILINX_440
 COBJS	+= 4xx_enet.o
+endif
 COBJS	+= 4xx_pci.o
 COBJS	+= 4xx_pcie.o
+ifndef CONFIG_XILINX_440
 COBJS	+= 4xx_uart.o
+endif
 COBJS	+= bedbug_405.o
 COBJS	+= commproc.o
 COBJS	+= cpu.o
@@ -47,11 +51,20 @@ COBJS	+= denali_data_eye.o
 COBJS	+= denali_spd_ddr2.o
 COBJS	+= ecc.o
 COBJS	+= fdt.o
+ifndef CONFIG_XILINX_440
 COBJS	+= gpio.o
+endif
 COBJS	+= i2c.o
 COBJS	+= interrupts.o
+ifndef CONFIG_XILINX_440
+COBJS	+= uic.o
+else
+COBJS	+= xilinx_irq.o
+endif
 COBJS	+= iop480_uart.o
+ifndef CONFIG_XILINX_440
 COBJS	+= miiphy.o
+endif
 COBJS	+= ndfc.o
 COBJS	+= sdram.o
 COBJS	+= speed.o
diff --git a/cpu/ppc4xx/cpu.c b/cpu/ppc4xx/cpu.c
index ef32bc6..775ed01 100644
--- a/cpu/ppc4xx/cpu.c
+++ b/cpu/ppc4xx/cpu.c
@@ -279,7 +279,11 @@ int checkcpu (void)
 
 	get_sys_info(&sys_info);
 
+#if defined(CONFIG_XILINX_440)
+	puts("IBM PowerPC 4");
+#else
 	puts("AMCC PowerPC 4");
+#endif
 
 #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \
     defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \
@@ -541,6 +545,10 @@ int checkcpu (void)
 		puts("GX Rev. A");
 		strcpy(addstr, "No Security support");
 		break;
+	
+	case PVR_VIRTEX5:
+		puts(" VIRTEX5");
+		break;
 
 	default:
 		printf (" UNKNOWN (PVR=%08x)", pvr);
diff --git a/cpu/ppc4xx/interrupts.c b/cpu/ppc4xx/interrupts.c
index 8215dc6..58d1d81 100644
--- a/cpu/ppc4xx/interrupts.c
+++ b/cpu/ppc4xx/interrupts.c
@@ -8,6 +8,10 @@
  * (C) Copyright 2003 (440GX port)
  * Travis B. Sawyer, Sandburst Corporation, tsawyer at sandburst.com
  *
+ * (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
+ * Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * Work supported by Qtechnology (htpp://qtec.com)
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -31,23 +35,11 @@
 #include <watchdog.h>
 #include <command.h>
 #include <asm/processor.h>
+#include <asm/interrupt.h>
 #include <ppc4xx.h>
 #include <ppc_asm.tmpl>
 #include <commproc.h>
 
-#if (UIC_MAX > 3)
-#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
-			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI) | \
-			 UIC_MASK(VECNUM_UIC3CI) | UIC_MASK(VECNUM_UIC3NCI))
-#elif (UIC_MAX > 2)
-#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
-			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI))
-#elif (UIC_MAX > 1)
-#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI))
-#else
-#define UICB0_ALL	0
-#endif
-
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -58,11 +50,7 @@ struct	irq_action {
 	void *arg;
 	int count;
 };
-
-static struct irq_action irq_vecs[UIC_MAX * 32];
-
-u32 get_dcr(u16);
-void set_dcr(u16, u32);
+static struct irq_action irq_vecs[IRQ_MAX];
 
 #if defined(CONFIG_440)
 
@@ -103,7 +91,7 @@ int interrupt_init_cpu (unsigned *decrementer_count)
 	/*
 	 * Mark all irqs as free
 	 */
-	for (vec = 0; vec < (UIC_MAX * 32); vec++) {
+	for (vec = 0; vec < IRQ_MAX; vec++) {
 		irq_vecs[vec].handler = NULL;
 		irq_vecs[vec].arg = NULL;
 		irq_vecs[vec].count = 0;
@@ -147,110 +135,36 @@ int interrupt_init_cpu (unsigned *decrementer_count)
 	 */
 	set_evpr(0x00000000);
 
-#if (UIC_MAX > 1)
-	/* Install the UIC1 handlers */
-	irq_install_handler(VECNUM_UIC1NCI, (void *)(void *)external_interrupt, 0);
-	irq_install_handler(VECNUM_UIC1CI, (void *)(void *)external_interrupt, 0);
-#endif
-#if (UIC_MAX > 2)
-	irq_install_handler(VECNUM_UIC2NCI, (void *)(void *)external_interrupt, 0);
-	irq_install_handler(VECNUM_UIC2CI, (void *)(void *)external_interrupt, 0);
-#endif
-#if (UIC_MAX > 3)
-	irq_install_handler(VECNUM_UIC3NCI, (void *)(void *)external_interrupt, 0);
-	irq_install_handler(VECNUM_UIC3CI, (void *)(void *)external_interrupt, 0);
-#endif
+	/*
+	 *Call uic or xilinx_irq pic_enable
+	 */
+	pic_enable();
 
 	return (0);
 }
 
-/* Handler for UIC interrupt */
-static void uic_interrupt(u32 uic_base, int vec_base)
+void timer_interrupt_cpu(struct pt_regs *regs)
 {
-	u32 uic_msr;
-	u32 msr_shift;
-	int vec;
-
-	/*
-	 * Read masked interrupt status register to determine interrupt source
-	 */
-	uic_msr = get_dcr(uic_base + UIC_MSR);
-	msr_shift = uic_msr;
-	vec = vec_base;
-
-	while (msr_shift != 0) {
-		if (msr_shift & 0x80000000) {
-			/*
-			 * Increment irq counter (for debug purpose only)
-			 */
-			irq_vecs[vec].count++;
-
-			if (irq_vecs[vec].handler != NULL) {
-				/* call isr */
-				(*irq_vecs[vec].handler)(irq_vecs[vec].arg);
-			} else {
-				set_dcr(uic_base + UIC_ER,
-					get_dcr(uic_base + UIC_ER) & ~UIC_MASK(vec));
-				printf("Masking bogus interrupt vector %d"
-				       " (UIC_BASE=0x%x)\n", vec, uic_base);
-			}
-
-			/*
-			 * After servicing the interrupt, we have to remove the
-			 * status indicator
-			 */
-			set_dcr(uic_base + UIC_SR, UIC_MASK(vec));
-		}
-
-		/*
-		 * Shift msr to next position and increment vector
-		 */
-		msr_shift <<= 1;
-		vec++;
-	}
+	/* nothing to do here */
+	return;
 }
 
-/*
- * Handle external interrupts
- */
-void external_interrupt(struct pt_regs *regs)
+void interrupt_run_handler(int vec)
 {
-	u32 uic_msr;
-
-	/*
-	 * Read masked interrupt status register to determine interrupt source
-	 */
-	uic_msr = mfdcr(uic0msr);
-
-#if (UIC_MAX > 1)
-	if ((UIC_MASK(VECNUM_UIC1CI) & uic_msr) ||
-	    (UIC_MASK(VECNUM_UIC1NCI) & uic_msr))
-		uic_interrupt(UIC1_DCR_BASE, 32);
-#endif
-
-#if (UIC_MAX > 2)
-	if ((UIC_MASK(VECNUM_UIC2CI) & uic_msr) ||
-	    (UIC_MASK(VECNUM_UIC2NCI) & uic_msr))
-		uic_interrupt(UIC2_DCR_BASE, 64);
-#endif
-
-#if (UIC_MAX > 3)
-	if ((UIC_MASK(VECNUM_UIC3CI) & uic_msr) ||
-	    (UIC_MASK(VECNUM_UIC3NCI) & uic_msr))
-		uic_interrupt(UIC3_DCR_BASE, 96);
-#endif
-
-	if (uic_msr & ~(UICB0_ALL))
-		uic_interrupt(UIC0_DCR_BASE, 0);
-
-	mtdcr(uic0sr, uic_msr);
+	irq_vecs[vec].count++;
+
+	if (irq_vecs[vec].handler != NULL) {
+		/* call isr */
+		(*irq_vecs[vec].handler) (irq_vecs[vec].arg);
+	} else {
+		pic_irq_disable(vec);
+		printf("Masking bogus interrupt vector %d\n", vec);
+	}
 
+	pic_irq_ack(vec);
 	return;
 }
 
-/*
- * Install and free a interrupt handler.
- */
 void irq_install_handler(int vec, interrupt_handler_t * handler, void *arg)
 {
 	/*
@@ -263,51 +177,19 @@ void irq_install_handler(int vec, interrupt_handler_t * handler, void *arg)
 	irq_vecs[vec].handler = handler;
 	irq_vecs[vec].arg = arg;
 
-	if ((vec >= 0) && (vec < 32))
-		mtdcr(uicer, mfdcr(uicer) | UIC_MASK(vec));
-#if (UIC_MAX > 1)
-	else if ((vec >= 32) && (vec < 64))
-		mtdcr(uic1er, mfdcr(uic1er) | UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 2)
-	else if ((vec >= 64) && (vec < 96))
-		mtdcr(uic2er, mfdcr(uic2er) | UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 3)
-	else if (vec >= 96)
-		mtdcr(uic3er, mfdcr(uic3er) | UIC_MASK(vec));
-#endif
-
-	debug("Install interrupt for vector %d ==> %p\n", vec, handler);
+	pic_irq_enable(vec);
+	return;
 }
 
-void irq_free_handler (int vec)
+void irq_free_handler(int vec)
 {
 	debug("Free interrupt for vector %d ==> %p\n",
 	      vec, irq_vecs[vec].handler);
 
-	if ((vec >= 0) && (vec < 32))
-		mtdcr(uicer, mfdcr(uicer) & ~UIC_MASK(vec));
-#if (UIC_MAX > 1)
-	else if ((vec >= 32) && (vec < 64))
-		mtdcr(uic1er, mfdcr(uic1er) & ~UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 2)
-	else if ((vec >= 64) && (vec < 96))
-		mtdcr(uic2er, mfdcr(uic2er) & ~UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 3)
-	else if (vec >= 96)
-		mtdcr(uic3er, mfdcr(uic3er) & ~UIC_MASK(vec));
-#endif
+	pic_irq_disable(vec);
 
 	irq_vecs[vec].handler = NULL;
 	irq_vecs[vec].arg = NULL;
-}
-
-void timer_interrupt_cpu (struct pt_regs *regs)
-{
-	/* nothing to do here */
 	return;
 }
 
@@ -319,7 +201,7 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	printf ("Interrupt-Information:\n");
 	printf ("Nr  Routine   Arg       Count\n");
 
-	for (vec = 0; vec < (UIC_MAX * 32); vec++) {
+	for (vec = 0; vec < IRQ_MAX; vec++) {
 		if (irq_vecs[vec].handler != NULL) {
 			printf ("%02d  %08lx  %08lx  %d\n",
 				vec,
diff --git a/cpu/ppc4xx/speed.c b/cpu/ppc4xx/speed.c
index b86b6de..d21bd82 100644
--- a/cpu/ppc4xx/speed.c
+++ b/cpu/ppc4xx/speed.c
@@ -416,7 +416,8 @@ ulong get_PCI_freq (void)
 	return sys_info.freqPCI;
 }
 
-#elif !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && !defined(CONFIG_440SPE)
+#elif !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && !defined(CONFIG_440SPE) \
+	&& !defined(CONFIG_XILINX_440)
 void get_sys_info (sys_info_t * sysInfo)
 {
 	unsigned long strp0;
@@ -449,6 +450,8 @@ void get_sys_info (sys_info_t * sysInfo)
 	sysInfo->freqUART = sysInfo->freqPLB;
 }
 #else
+
+#if !defined(CONFIG_XILINX_440)
 void get_sys_info (sys_info_t * sysInfo)
 {
 	unsigned long strp0;
@@ -535,6 +538,7 @@ void get_sys_info (sys_info_t * sysInfo)
 }
 
 #endif
+#endif /* CONFIG_XILINX_440 */
 
 #if defined(CONFIG_YUCCA)
 unsigned long determine_sysper(void)
diff --git a/cpu/ppc4xx/uic.c b/cpu/ppc4xx/uic.c
new file mode 100644
index 0000000..102b67a
--- /dev/null
+++ b/cpu/ppc4xx/uic.c
@@ -0,0 +1,210 @@
+/*
+ * (C) Copyright 2000-2002
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ *
+ * (C) Copyright 2002 (440 port)
+ * Scott McNutt, Artesyn Communication Producs, smcnutt at artsyncp.com
+ *
+ * (C) Copyright 2003 (440GX port)
+ * Travis B. Sawyer, Sandburst Corporation, tsawyer at sandburst.com
+ *
+ * (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
+ * Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * Work supported by Qtechnology (htpp://qtec.com)
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <watchdog.h>
+#include <command.h>
+#include <asm/processor.h>
+#include <asm/interrupt.h>
+#include <ppc4xx.h>
+#include <ppc_asm.tmpl>
+#include <commproc.h>
+
+#if (UIC_MAX > 3)
+#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
+			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI) | \
+			 UIC_MASK(VECNUM_UIC3CI) | UIC_MASK(VECNUM_UIC3NCI))
+#elif (UIC_MAX > 2)
+#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
+			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI))
+#elif (UIC_MAX > 1)
+#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI))
+#else
+#define UICB0_ALL	0
+#endif
+
+u32 get_dcr(u16);
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void pic_enable(void)
+{
+
+#if (UIC_MAX > 1)
+	/* Install the UIC1 handlers */
+	irq_install_handler(VECNUM_UIC1NCI, (void *)(void *)external_interrupt,
+			    0);
+	irq_install_handler(VECNUM_UIC1CI, (void *)(void *)external_interrupt,
+			    0);
+#endif
+#if (UIC_MAX > 2)
+	irq_install_handler(VECNUM_UIC2NCI, (void *)(void *)external_interrupt,
+			    0);
+	irq_install_handler(VECNUM_UIC2CI, (void *)(void *)external_interrupt,
+			    0);
+#endif
+#if (UIC_MAX > 3)
+	irq_install_handler(VECNUM_UIC3NCI, (void *)(void *)external_interrupt,
+			    0);
+	irq_install_handler(VECNUM_UIC3CI, (void *)(void *)external_interrupt,
+			    0);
+#endif
+
+}
+
+
+/* Handler for UIC interrupt */
+static void uic_interrupt(u32 uic_base, int vec_base)
+{
+	u32 uic_msr;
+	u32 msr_shift;
+	int vec;
+
+	/*
+	 * Read masked interrupt status register to determine interrupt source
+	 */
+	uic_msr = get_dcr(uic_base + UIC_MSR);
+	msr_shift = uic_msr;
+	vec = vec_base;
+
+	while (msr_shift != 0) {
+		if (msr_shift & 0x80000000)
+			interrupt_run_handler(vec);
+		/*
+		 * Shift msr to next position and increment vector
+		 */
+		msr_shift <<= 1;
+		vec++;
+	}
+}
+
+/*
+ * Handle external interrupts
+ */
+void external_interrupt(struct pt_regs *regs)
+{
+	u32 uic_msr;
+
+	/*
+	 * Read masked interrupt status register to determine interrupt source
+	 */
+	uic_msr = mfdcr(uic0msr);
+
+#if (UIC_MAX > 1)
+	if ((UIC_MASK(VECNUM_UIC1CI) & uic_msr) ||
+	    (UIC_MASK(VECNUM_UIC1NCI) & uic_msr))
+		uic_interrupt(UIC1_DCR_BASE, 32);
+#endif
+
+#if (UIC_MAX > 2)
+	if ((UIC_MASK(VECNUM_UIC2CI) & uic_msr) ||
+	    (UIC_MASK(VECNUM_UIC2NCI) & uic_msr))
+		uic_interrupt(UIC2_DCR_BASE, 64);
+#endif
+
+#if (UIC_MAX > 3)
+	if ((UIC_MASK(VECNUM_UIC3CI) & uic_msr) ||
+	    (UIC_MASK(VECNUM_UIC3NCI) & uic_msr))
+		uic_interrupt(UIC3_DCR_BASE, 96);
+#endif
+
+	if (uic_msr & ~(UICB0_ALL))
+		uic_interrupt(UIC0_DCR_BASE, 0);
+
+	mtdcr(uic0sr, uic_msr);
+
+	return;
+}
+
+void pic_irq_ack(unsigned int vec)
+{
+
+	if ((vec >= 0) && (vec < 32))
+		mtdcr(uicsr, UIC_MASK(vec));
+#if (UIC_MAX > 1)
+	else if ((vec >= 32) && (vec < 64))
+		mtdcr(uic1sr, UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 2)
+	else if ((vec >= 64) && (vec < 96))
+		mtdcr(uic2sr, UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 3)
+	else if (vec >= 96)
+		mtdcr(uic3sr, UIC_MASK(vec));
+#endif
+}
+
+/*
+ * Install and free a interrupt handler.
+ */
+void pic_irq_enable(unsigned int vec)
+{
+
+	if ((vec >= 0) && (vec < 32))
+		mtdcr(uicer, mfdcr(uicer) | UIC_MASK(vec));
+#if (UIC_MAX > 1)
+	else if ((vec >= 32) && (vec < 64))
+		mtdcr(uic1er, mfdcr(uic1er) | UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 2)
+	else if ((vec >= 64) && (vec < 96))
+		mtdcr(uic2er, mfdcr(uic2er) | UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 3)
+	else if (vec >= 96)
+		mtdcr(uic3er, mfdcr(uic3er) | UIC_MASK(vec));
+#endif
+
+	debug("Install interrupt for vector %d ==> %p\n", vec, handler);
+}
+
+void pic_irq_disable(unsigned int vec)
+{
+
+	if ((vec >= 0) && (vec < 32))
+		mtdcr(uicer, mfdcr(uicer) & ~UIC_MASK(vec));
+#if (UIC_MAX > 1)
+	else if ((vec >= 32) && (vec < 64))
+		mtdcr(uic1er, mfdcr(uic1er) & ~UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 2)
+	else if ((vec >= 64) && (vec < 96))
+		mtdcr(uic2er, mfdcr(uic2er) & ~UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 3)
+	else if (vec >= 96)
+		mtdcr(uic3er, mfdcr(uic3er) & ~UIC_MASK(vec));
+#endif
+
+}
diff --git a/cpu/ppc4xx/xilinx_irq.c b/cpu/ppc4xx/xilinx_irq.c
new file mode 100644
index 0000000..f2dbcc8
--- /dev/null
+++ b/cpu/ppc4xx/xilinx_irq.c
@@ -0,0 +1,111 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * This work has been supported by: QTechnology  http://qtec.com/
+ * Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd at denx.de
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+#include <common.h>
+#include <watchdog.h>
+#include <command.h>
+#include <asm/processor.h>
+#include <asm/interrupt.h>
+#include <ppc4xx.h>
+#include <ppc_asm.tmpl>
+#include <commproc.h>
+#include <asm/io.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define intc XPAR_INTC_0_BASEADDR
+#define ISR (u32*)(intc+(0*4))	/* Interrupt Status Register */
+#define IPR (u32*)(intc+(1*4))	/* Interrupt Pending Register */
+#define IER (u32*)(intc+(2*4))	/* Interrupt Enable Register */
+#define IAR (u32*)(intc+(3*4))	/* Interrupt Acknowledge Register */
+#define SIE (u32*)(intc+(4*4))	/* Set Interrupt Enable bits */
+#define CIE (u32*)(intc+(5*4))	/* Clear Interrupt Enable bits */
+#define IVR (u32*)(intc+(6*4))	/* Interrupt Vector Register */
+#define MER (u32*)(intc+(7*4))	/* Master Enable Register */
+
+#define IRQ_MASK(irq) (1<<(irq&0x1f))
+
+void pic_enable(void)
+{
+	printf("Xilinx PIC@0x%8x\n", intc);
+
+	/*
+	 * Disable all external interrupts until they are
+	 * explicitly requested.
+	 */
+	out_be32(IER, 0);
+
+	/* Acknowledge any pending interrupts just in case. */
+	out_be32(IAR, ~(u32) 0);
+
+	/* Turn on the Master Enable. */
+	out_be32(MER, 0x3UL);
+
+	return;
+}
+
+int xilinx_pic_irq_get(void)
+{
+	u32 irq;
+	irq = in_be32(IVR);
+
+	/* If no interrupt is pending then all bits of the IVR are set to 1. As
+	 * the IVR is as many bits wide as numbers of inputs are available.
+	 * Therefore, if all bits of the IVR are set to one, its content will
+	 * be bigger than XPAR_INTC_MAX_NUM_INTR_INPUTS.
+	 */
+	if (irq >= XPAR_INTC_MAX_NUM_INTR_INPUTS)
+		irq = -1;	/* report no pending interrupt. */
+
+	debug("get_irq: %d\n", irq);
+	return (irq);
+}
+
+void pic_irq_enable(unsigned int irq)
+{
+	unsigned long mask = IRQ_MASK(irq);
+	debug("enable: %d\n", irq);
+	out_be32(SIE, mask);
+}
+
+void pic_irq_disable(unsigned int irq)
+{
+	unsigned long mask = IRQ_MASK(irq);
+	debug("disable: %d\n", irq);
+	out_be32(CIE, mask);
+}
+
+void pic_irq_ack(unsigned int irq)
+{
+	unsigned long mask = IRQ_MASK(irq);
+	debug("ack: %d\n", irq);
+	out_be32(IAR, mask);
+}
+
+void external_interrupt(struct pt_regs *regs)
+{
+	int irq;
+
+	irq = xilinx_pic_irq_get();
+	if (irq < 0)
+		return;
+
+	interrupt_run_handler(irq);
+
+	return;
+}
diff --git a/include/asm-ppc/interrupt.h b/include/asm-ppc/interrupt.h
new file mode 100644
index 0000000..6c84a84
--- /dev/null
+++ b/include/asm-ppc/interrupt.h
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * This work has been supported by: QTechnology  http://qtec.com/
+ * Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd@denx.de
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+#ifndef INTERRUPT_H
+#define INTERRUPT_H
+
+
+#if defined(CONFIG_440_VIRTEX5)
+#define IRQ_MAX XPAR_INTC_MAX_NUM_INTR_INPUTS
+#else
+#define IRQ_MAX UIC_MAX * 32
+#endif
+
+void pic_enable(void);
+void pic_irq_enable(unsigned int irq);
+void pic_irq_disable(unsigned int irq);
+void pic_irq_ack(unsigned int irq);
+void external_interrupt(struct pt_regs *regs);
+void interrupt_run_handler(int vec);
+
+#endif
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index 6e134c3..5501244 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -839,6 +839,8 @@
 #define PVR_86xx	0x80040000
 #define PVR_86xx_REV1	(PVR_86xx | 0x0010)
 
+#define PVR_VIRTEX5     0x7ff21912
+
 /*
  * For the 8xx processors, all of them report the same PVR family for
  * the PowerPC core. The various versions of these processors must be
-- 
1.5.6.2

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support
  2008-07-14 19:47 ` [U-Boot-Users] ppc4xx: [PATCH] [Resubmit] ML507 Board Support Ricardo Ribalda Delgado
@ 2008-07-16  1:17   ` Ricardo Ribalda Delgado
  2008-07-17  6:31     ` Stefan Roese
  2008-07-17  7:21     ` Michal Simek
  0 siblings, 2 replies; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-16  1:17 UTC (permalink / raw)
  To: u-boot

Added Flash Support

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
---
 CREDITS                          |    5 ++
 MAINTAINERS                      |    4 +
 MAKEALL                          |    1 +
 Makefile                         |    3 +
 board/xilinx/ml507/Makefile      |   58 +++++++++++++++++
 board/xilinx/ml507/config.mk     |   24 +++++++
 board/xilinx/ml507/init.S        |   47 ++++++++++++++
 board/xilinx/ml507/ml507.c       |   46 +++++++++++++
 board/xilinx/ml507/u-boot.lds    |  130 ++++++++++++++++++++++++++++++++++++++
 board/xilinx/ml507/xparameters.h |   35 ++++++++++
 include/configs/ml507.h          |  116 +++++++++++++++++++++++++++++++++
 11 files changed, 469 insertions(+), 0 deletions(-)
 create mode 100644 board/xilinx/ml507/Makefile
 create mode 100644 board/xilinx/ml507/config.mk
 create mode 100644 board/xilinx/ml507/init.S
 create mode 100644 board/xilinx/ml507/ml507.c
 create mode 100644 board/xilinx/ml507/u-boot.lds
 create mode 100644 board/xilinx/ml507/xparameters.h
 create mode 100644 include/configs/ml507.h

diff --git a/CREDITS b/CREDITS
index 3b6e57d..06e78bf 100644
--- a/CREDITS
+++ b/CREDITS
@@ -399,6 +399,11 @@ N: Stelian Pop
 E: stelian.pop at leadtechdesign.com
 D: Atmel AT91CAP9ADK support
 
+N: Ricardo Ribalda Delgado
+E: ricardo.ribalda at uam.es
+D: PPC440x5 (Virtex5), ML507 Board, eeprom_simul, adt7460
+W: http://www.ii.uam.es/~rribalda
+
 N: Stefan Roese
 E: sr at denx.de
 D: AMCC PPC4xx Support
diff --git a/MAINTAINERS b/MAINTAINERS
index b667c8e..75b5b02 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -311,6 +311,10 @@ Daniel Poirot <dan.poirot@windriver.com>
 	sbc8240		MPC8240
 	sbc405		PPC405GP
 
+Ricardo Ribalda <ricardo.ribalda@uam.es>
+
+	ml507 		PPC440x5
+
 Stefan Roese <sr@denx.de>
 
 	P3M7448		MPC7448
diff --git a/MAKEALL b/MAKEALL
index a256e9a..5463a58 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -239,6 +239,7 @@ LIST_4xx="		\
 	yosemite	\
 	yucca		\
 	zeus		\
+	ml507		\
 "
 
 #########################################################################
diff --git a/Makefile b/Makefile
index 10a3e06..40029e6 100644
--- a/Makefile
+++ b/Makefile
@@ -1336,6 +1336,9 @@ ML2_config:	unconfig
 ml300_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ml300 xilinx
 
+ml507_config:	unconfig
+	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ml507 xilinx
+
 ocotea_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ocotea amcc
 
diff --git a/board/xilinx/ml507/Makefile b/board/xilinx/ml507/Makefile
new file mode 100644
index 0000000..b9bd737
--- /dev/null
+++ b/board/xilinx/ml507/Makefile
@@ -0,0 +1,58 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+endif
+
+INCS		:=
+CFLAGS		+= $(INCS)
+HOST_CFLAGS	+= $(INCS)
+
+LIB	= $(obj)lib$(BOARD).a
+
+COBJS	= $(BOARD).o \
+
+SOBJS	= init.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(OBJS) $(SOBJS)
+	$(AR) $(ARFLAGS) $@ $^
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/xilinx/ml507/config.mk b/board/xilinx/ml507/config.mk
new file mode 100644
index 0000000..35c52ad
--- /dev/null
+++ b/board/xilinx/ml507/config.mk
@@ -0,0 +1,24 @@
+#
+# (C) Copyright 2000
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+TEXT_BASE = 0x04000000
diff --git a/board/xilinx/ml507/init.S b/board/xilinx/ml507/init.S
new file mode 100644
index 0000000..6510646
--- /dev/null
+++ b/board/xilinx/ml507/init.S
@@ -0,0 +1,47 @@
+/*
+ *  (C) Copyright 2008
+ *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ *  This work has been supported by: QTechnology  http://qtec.com/
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <ppc_asm.tmpl>
+#include <config.h>
+#include <asm-ppc/mmu.h>
+
+.section .bootpg,"ax"
+.globl tlbtab
+
+tlbtab:
+tlbtab_start
+	/* SDRAM */
+tlbentry(XPAR_DDR2_SDRAM_MEM_BASEADDR, SZ_256M, CFG_SDRAM_BASE, 0,
+	 AC_R | AC_W | AC_X | SA_G | SA_I)
+	/* UART */
+tlbentry(XPAR_UARTLITE_0_BASEADDR, SZ_64K, XPAR_UARTLITE_0_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+	/* PIC */
+tlbentry(XPAR_INTC_0_BASEADDR, SZ_64K, XPAR_INTC_0_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+	/* I2C */
+tlbentry(XPAR_IIC_EEPROM_BASEADDR, SZ_64K, XPAR_IIC_EEPROM_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+	/* Net */
+tlbentry(XPAR_LLTEMAC_0_BASEADDR, SZ_64K, XPAR_LLTEMAC_0_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+	/*Flash*/
+tlbentry(XPAR_FLASH_MEM0_BASEADDR, SZ_256M, XPAR_FLASH_MEM0_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+tlbtab_end
diff --git a/board/xilinx/ml507/ml507.c b/board/xilinx/ml507/ml507.c
new file mode 100644
index 0000000..6d78dd6
--- /dev/null
+++ b/board/xilinx/ml507/ml507.c
@@ -0,0 +1,46 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * This work has been supported by: QTechnology  http://qtec.com/
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <config.h>
+#include <common.h>
+#include <asm/processor.h>
+
+int board_pre_init(void)
+{
+	return 0;
+}
+
+int checkboard(void)
+{
+	puts ("ML507 Board\n");
+	return 0;
+}
+
+phys_size_t initdram(int board_type)
+{
+	return 256 * 1024 * 1024;
+}
+
+void get_sys_info(sys_info_t * sysInfo)
+{
+	sysInfo->freqProcessor = XPAR_CORE_CLOCK_FREQ_HZ;
+	sysInfo->freqPLB = XPAR_PLB_CLOCK_FREQ_HZ;
+	sysInfo->freqPCI = 0;
+
+	return;
+}
diff --git a/board/xilinx/ml507/u-boot.lds b/board/xilinx/ml507/u-boot.lds
new file mode 100644
index 0000000..ef2bdc3
--- /dev/null
+++ b/board/xilinx/ml507/u-boot.lds
@@ -0,0 +1,130 @@
+/*
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ * 2008:
+ * Modified by: Ricardo Ribalda Delgado ricardo.ribalda at uam.es
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+ENTRY(_start_440)
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)		}
+  .dynsym        : { *(.dynsym)		}
+  .dynstr        : { *(.dynstr)		}
+  .rel.text      : { *(.rel.text)		}
+  .rela.text     : { *(.rela.text)	}
+  .rel.data      : { *(.rel.data)		}
+  .rela.data     : { *(.rela.data)	}
+  .rel.rodata    : { *(.rel.rodata)	}
+  .rela.rodata   : { *(.rela.rodata)	}
+  .rel.got       : { *(.rel.got)		}
+  .rela.got      : { *(.rela.got)		}
+  .rel.ctors     : { *(.rel.ctors)	}
+  .rela.ctors    : { *(.rela.ctors)	}
+  .rel.dtors     : { *(.rel.dtors)	}
+  .rela.dtors    : { *(.rela.dtors)	}
+  .rel.bss       : { *(.rel.bss)		}
+  .rela.bss      : { *(.rela.bss)		}
+  .rel.plt       : { *(.rel.plt)		}
+  .rela.plt      : { *(.rela.plt)		}
+  .init          : { *(.init)	}
+  .plt : { *(.plt) }
+  .text      :
+  {
+    *(.text)
+    *(.fixup)
+    *(.got1)
+  }
+  _etext = .;
+  PROVIDE (etext = .);
+  .rodata    :
+  {
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x00FF) & 0xFFFFFF00;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(256);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(256);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss (NOLOAD)       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
diff --git a/board/xilinx/ml507/xparameters.h b/board/xilinx/ml507/xparameters.h
new file mode 100644
index 0000000..8d938f9
--- /dev/null
+++ b/board/xilinx/ml507/xparameters.h
@@ -0,0 +1,35 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * This work has been supported by: QTechnology  http://qtec.com/
+ * based on xparameters-ml507.h by Xilinx
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef XPARAMETER_H
+#define XPARAMETER_H
+
+#define XPAR_DDR2_SDRAM_MEM_BASEADDR 	0x00000000
+#define XPAR_INTC_0_BASEADDR 		0x81800000
+#define XPAR_UARTLITE_0_BASEADDR 	0x84000000
+#define XPAR_RS232_UART_1_BASEADDR 	0x84000000
+#define XPAR_IIC_EEPROM_BASEADDR 	0x81600000
+#define XPAR_LLTEMAC_0_BASEADDR 	0x81c00000
+#define XPAR_FLASH_MEM0_BASEADDR 	0xFC000000
+#define XPAR_PLB_CLOCK_FREQ_HZ 		100000000
+#define XPAR_CORE_CLOCK_FREQ_HZ 	400000000
+#define XPAR_INTC_MAX_NUM_INTR_INPUTS 	13
+
+#endif
diff --git a/include/configs/ml507.h b/include/configs/ml507.h
new file mode 100644
index 0000000..293ae65
--- /dev/null
+++ b/include/configs/ml507.h
@@ -0,0 +1,116 @@
+/*
+ * (C) Copyright 2008
+ *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ *  This work has been supported by: QTechnology  http://qtec.com/
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+#define DEBUG
+#define ET_DEBUG
+*/
+ /*CPU*/
+#define CONFIG_XILINX_ML507	1
+#define CONFIG_XILINX_440	1
+#define CONFIG_440		1
+#define CONFIG_4xx		1
+#include "../board/xilinx/ml507/xparameters.h"
+
+/*Mem Map*/
+#define CFG_SDRAM_BASE		0x0
+#define CFG_MONITOR_BASE	0x04000000
+#define CFG_MONITOR_LEN		(192*1024)
+#define CFG_MALLOC_LEN		(128*1024)
+#define CFG_ISRAM_BASE		XPAR_XPS_BRAM_IF_CNTLR_1_BASEADDR
+
+/*Uart*/
+#define CONFIG_XILINX_UARTLITE
+#define CONFIG_BAUDRATE		9600
+#define CFG_BAUDRATE_TABLE	{9600}
+#define CONFIG_SERIAL_BASE	XPAR_UARTLITE_0_BASEADDR
+
+/*Cmd*/
+#include <config_cmd_default.h>
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_REGINFO
+#undef CONFIG_CMD_I2C
+#undef CONFIG_CMD_DTT
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_PING
+#undef CONFIG_CMD_DHCP
+#undef CONFIG_CMD_EEPROM
+#undef CONFIG_CMD_IMLS
+
+/*Env*/
+#define	CFG_ENV_IS_NOWHERE
+#define	CFG_ENV_SIZE		0x200
+#define CFG_ENV_OFFSET 		0x100
+
+/*Misc*/
+#define CONFIG_BOOTDELAY	5		/* autoboot after 5 seconds     */
+#define CFG_LONGHELP				/* undef to save memory         */
+#define CFG_PROMPT		"board:/# "	/* Monitor Command Prompt       */
+#if defined(CONFIG_CMD_KGDB)
+#define CFG_CBSIZE		1024		/* Console I/O Buffer Size      */
+#else
+#define CFG_CBSIZE		256		/* Console I/O Buffer Size      */
+#endif
+#define CFG_PBSIZE		(CFG_CBSIZE+sizeof(CFG_PROMPT)+16)
+#define CFG_MAXARGS		16		/* max number of command args   */
+#define CFG_BARGSIZE		CFG_CBSIZE	/* Boot Argument Buffer Size */
+#define CFG_MEMTEST_START	0x0400000	/* memtest works on           */
+#define CFG_MEMTEST_END		0x0C00000	/* 4 ... 12 MB in DRAM        */
+#define CFG_LOAD_ADDR		0x400000	/* default load address       */
+#define CFG_EXTBDINFO		1		/* To use extended board_into (bd_t) */
+#define CFG_HZ			1000		/* decrementer freq: 1 ms ticks */
+#define CONFIG_CMDLINE_EDITING			/* add command line history     */
+#define CONFIG_AUTO_COMPLETE			/* add autocompletion support   */
+#define CONFIG_LOOPW				/* enable loopw command         */
+#define CONFIG_MX_CYCLIC			/* enable mdc/mwc commands      */
+#define CONFIG_ZERO_BOOTDELAY_CHECK		/* check for keypress on bootdelay==0 */
+#define CONFIG_VERSION_VARIABLE			/* include version env variable */
+#define CFG_CONSOLE_INFO_QUIET			/* don't print console @ startup */
+#define CFG_HUSH_PARSER				/* Use the HUSH parser          */
+#define	CFG_PROMPT_HUSH_PS2	"> "
+#define CONFIG_LOADS_ECHO			/* echo on for serial download  */
+#define CFG_LOADS_BAUD_CHANGE			/* allow baudrate change        */
+#define CFG_BOOTMAPSZ		(8 << 20)	/* Initial Memory map for Linux */
+#define CONFIG_PREBOOT		"echo U-Boot is up and runnining;"
+
+/*Stack*/
+#define CFG_INIT_RAM_ADDR	0x800000	/* Initial RAM address    */
+#define CFG_INIT_RAM_END	0x2000		/* End of used area in RAM  */
+#define CFG_GBL_DATA_SIZE	128		/* num bytes initial data   */
+#define CFG_GBL_DATA_OFFSET	(CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_INIT_SP_OFFSET	CFG_GBL_DATA_OFFSET
+/*Speed*/
+#define CONFIG_SYS_CLK_FREQ	400000000
+
+/*Flash*/
+#define	CFG_FLASH_BASE		XPAR_FLASH_MEM0_BASEADDR
+#define	CFG_FLASH_SIZE		(32*1024*1024)
+#define	CFG_FLASH_CFI		1
+#define	CFG_FLASH_CFI_DRIVER	1
+#define	CFG_FLASH_EMPTY_INFO	1
+#define	CFG_MAX_FLASH_BANKS	1
+#define	CFG_MAX_FLASH_SECT	128
+#define	CFG_FLASH_PROTECTION
+
+#endif						/* __CONFIG_H */
-- 
1.5.6.2

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (new version)
  2008-07-16  1:14 ` [U-Boot-Users] ppc4xx: " Ricardo Ribalda Delgado
@ 2008-07-16 15:14   ` Jon Loeliger
  2008-07-16 15:28     ` [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (newversion) Ricardo Ribalda Delgado
  2008-07-17  6:24   ` [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Stefan Roese
  1 sibling, 1 reply; 25+ messages in thread
From: Jon Loeliger @ 2008-07-16 15:14 UTC (permalink / raw)
  To: u-boot

Ricardo Ribalda Delgado wrote:
> Previous patch did not compile on some boards
> 
> 
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
> ---
> -This patchs gives support for the embbedded ppc440
> on the Virtex5 FPGAs
> 
> -interrupts.c divided in uic.c and interrupts.c
> 
> -xilinx_irq.c for xilinx interrupt controller

Hmmm.....  My feeling here is that you have the stuff
above the triple-dash and the stuff below the triple-dash
swapped.

Stuff above is official Log Message.
Stuff below is commentary.

jdl

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (newversion)
  2008-07-16 15:14   ` Jon Loeliger
@ 2008-07-16 15:28     ` Ricardo Ribalda Delgado
  0 siblings, 0 replies; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-16 15:28 UTC (permalink / raw)
  To: u-boot

HI Jon

Jou are completely right. Lets wait for more comments, and if there is
no other I will resubmit.

     Best regards

On Wed, Jul 16, 2008 at 5:14 PM, Jon Loeliger <jdl@freescale.com> wrote:
> Ricardo Ribalda Delgado wrote:
>>
>> Previous patch did not compile on some boards
>>
>>
>> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
>> ---
>> -This patchs gives support for the embbedded ppc440
>> on the Virtex5 FPGAs
>>
>> -interrupts.c divided in uic.c and interrupts.c
>>
>> -xilinx_irq.c for xilinx interrupt controller
>
> Hmmm.....  My feeling here is that you have the stuff
> above the triple-dash and the stuff below the triple-dash
> swapped.
>
> Stuff above is official Log Message.
> Stuff below is commentary.
>
> jdl
>
>



-- 
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (new version)
  2008-07-16  1:14 ` [U-Boot-Users] ppc4xx: " Ricardo Ribalda Delgado
  2008-07-16 15:14   ` Jon Loeliger
@ 2008-07-17  6:24   ` Stefan Roese
  2008-07-17  9:22     ` Ricardo Ribalda Delgado
  2008-07-17  9:44     ` [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (resubmit) Ricardo Ribalda Delgado
  1 sibling, 2 replies; 25+ messages in thread
From: Stefan Roese @ 2008-07-17  6:24 UTC (permalink / raw)
  To: u-boot

On Wednesday 16 July 2008, Ricardo Ribalda Delgado wrote:
> Previous patch did not compile on some boards
>
>
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
> ---
> -This patchs gives support for the embbedded ppc440
> on the Virtex5 FPGAs
>
> -interrupts.c divided in uic.c and interrupts.c
>
> -xilinx_irq.c for xilinx interrupt controller

Jon already commented about the swapped commit text/comments issue. Apart from 
that please find some more comments below:

>  cpu/ppc4xx/Makefile         |   13 +++
>  cpu/ppc4xx/cpu.c            |    8 ++
>  cpu/ppc4xx/interrupts.c     |  178 ++++++------------------------------
>  cpu/ppc4xx/speed.c          |    6 +-
>  cpu/ppc4xx/uic.c            |  210
> +++++++++++++++++++++++++++++++++++++++++++ cpu/ppc4xx/xilinx_irq.c     | 
> 111 +++++++++++++++++++++++
>  include/asm-ppc/interrupt.h |   37 ++++++++
>  include/asm-ppc/processor.h |    2 +
>  8 files changed, 416 insertions(+), 149 deletions(-)
>  create mode 100644 cpu/ppc4xx/uic.c
>  create mode 100644 cpu/ppc4xx/xilinx_irq.c
>  create mode 100644 include/asm-ppc/interrupt.h
>
> diff --git a/cpu/ppc4xx/Makefile b/cpu/ppc4xx/Makefile
> index 800bb41..9d918c9 100644
> --- a/cpu/ppc4xx/Makefile
> +++ b/cpu/ppc4xx/Makefile
> @@ -35,10 +35,14 @@ SOBJS	+= kgdb.o
>  COBJS	:= 40x_spd_sdram.o
>  COBJS	+= 44x_spd_ddr.o
>  COBJS	+= 44x_spd_ddr2.o
> +ifndef CONFIG_XILINX_440
>  COBJS	+= 4xx_enet.o
> +endif
>  COBJS	+= 4xx_pci.o
>  COBJS	+= 4xx_pcie.o
> +ifndef CONFIG_XILINX_440
>  COBJS	+= 4xx_uart.o
> +endif
>  COBJS	+= bedbug_405.o
>  COBJS	+= commproc.o
>  COBJS	+= cpu.o
> @@ -47,11 +51,20 @@ COBJS	+= denali_data_eye.o
>  COBJS	+= denali_spd_ddr2.o
>  COBJS	+= ecc.o
>  COBJS	+= fdt.o
> +ifndef CONFIG_XILINX_440
>  COBJS	+= gpio.o
> +endif
>  COBJS	+= i2c.o
>  COBJS	+= interrupts.o
> +ifndef CONFIG_XILINX_440
> +COBJS	+= uic.o
> +else
> +COBJS	+= xilinx_irq.o
> +endif
>  COBJS	+= iop480_uart.o
> +ifndef CONFIG_XILINX_440
>  COBJS	+= miiphy.o
> +endif

Even though we usually sort the files alphabetically, these 
multiple "ifndef's" look very ugly. Perhaps we should change this here to a 
single "ifndef" with all the non-Xilinx files in it.

>  COBJS	+= ndfc.o
>  COBJS	+= sdram.o
>  COBJS	+= speed.o
> diff --git a/cpu/ppc4xx/cpu.c b/cpu/ppc4xx/cpu.c
> index ef32bc6..775ed01 100644
> --- a/cpu/ppc4xx/cpu.c
> +++ b/cpu/ppc4xx/cpu.c
> @@ -279,7 +279,11 @@ int checkcpu (void)
>
>  	get_sys_info(&sys_info);
>
> +#if defined(CONFIG_XILINX_440)
> +	puts("IBM PowerPC 4");
> +#else
>  	puts("AMCC PowerPC 4");
> +#endif
>
>  #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \
>      defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \
> @@ -541,6 +545,10 @@ int checkcpu (void)
>  		puts("GX Rev. A");
>  		strcpy(addstr, "No Security support");
>  		break;
> +
> +	case PVR_VIRTEX5:
> +		puts(" VIRTEX5");
> +		break;

Is the CPU really a VIRTEX5 or a PPC440 variant? I think the latter. Perhaps 
something like "PPC440x5"?

>  	default:
>  		printf (" UNKNOWN (PVR=%08x)", pvr);
> diff --git a/cpu/ppc4xx/interrupts.c b/cpu/ppc4xx/interrupts.c
> index 8215dc6..58d1d81 100644
> --- a/cpu/ppc4xx/interrupts.c
> +++ b/cpu/ppc4xx/interrupts.c
> @@ -8,6 +8,10 @@
>   * (C) Copyright 2003 (440GX port)
>   * Travis B. Sawyer, Sandburst Corporation, tsawyer at sandburst.com
>   *
> + * (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
> + * Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * Work supported by Qtechnology (htpp://qtec.com)
> + *
>   * See file CREDITS for list of people who contributed to this
>   * project.
>   *
> @@ -31,23 +35,11 @@
>  #include <watchdog.h>
>  #include <command.h>
>  #include <asm/processor.h>
> +#include <asm/interrupt.h>
>  #include <ppc4xx.h>
>  #include <ppc_asm.tmpl>
>  #include <commproc.h>
>
> -#if (UIC_MAX > 3)
> -#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
> -			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI) | \
> -			 UIC_MASK(VECNUM_UIC3CI) | UIC_MASK(VECNUM_UIC3NCI))
> -#elif (UIC_MAX > 2)
> -#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
> -			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI))
> -#elif (UIC_MAX > 1)
> -#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI))
> -#else
> -#define UICB0_ALL	0
> -#endif
> -
>  DECLARE_GLOBAL_DATA_PTR;
>
>  /*
> @@ -58,11 +50,7 @@ struct	irq_action {
>  	void *arg;
>  	int count;
>  };
> -
> -static struct irq_action irq_vecs[UIC_MAX * 32];
> -
> -u32 get_dcr(u16);
> -void set_dcr(u16, u32);
> +static struct irq_action irq_vecs[IRQ_MAX];
>
>  #if defined(CONFIG_440)
>
> @@ -103,7 +91,7 @@ int interrupt_init_cpu (unsigned *decrementer_count)
>  	/*
>  	 * Mark all irqs as free
>  	 */
> -	for (vec = 0; vec < (UIC_MAX * 32); vec++) {
> +	for (vec = 0; vec < IRQ_MAX; vec++) {
>  		irq_vecs[vec].handler = NULL;
>  		irq_vecs[vec].arg = NULL;
>  		irq_vecs[vec].count = 0;
> @@ -147,110 +135,36 @@ int interrupt_init_cpu (unsigned *decrementer_count)
>  	 */
>  	set_evpr(0x00000000);
>
> -#if (UIC_MAX > 1)
> -	/* Install the UIC1 handlers */
> -	irq_install_handler(VECNUM_UIC1NCI, (void *)(void *)external_interrupt,
> 0); -	irq_install_handler(VECNUM_UIC1CI, (void *)(void
> *)external_interrupt, 0); -#endif
> -#if (UIC_MAX > 2)
> -	irq_install_handler(VECNUM_UIC2NCI, (void *)(void *)external_interrupt,
> 0); -	irq_install_handler(VECNUM_UIC2CI, (void *)(void
> *)external_interrupt, 0); -#endif
> -#if (UIC_MAX > 3)
> -	irq_install_handler(VECNUM_UIC3NCI, (void *)(void *)external_interrupt,
> 0); -	irq_install_handler(VECNUM_UIC3CI, (void *)(void
> *)external_interrupt, 0); -#endif
> +	/*
> +	 *Call uic or xilinx_irq pic_enable
> +	 */
> +	pic_enable();
>
>  	return (0);
>  }
>
> -/* Handler for UIC interrupt */
> -static void uic_interrupt(u32 uic_base, int vec_base)
> +void timer_interrupt_cpu(struct pt_regs *regs)
>  {
> -	u32 uic_msr;
> -	u32 msr_shift;
> -	int vec;
> -
> -	/*
> -	 * Read masked interrupt status register to determine interrupt source
> -	 */
> -	uic_msr = get_dcr(uic_base + UIC_MSR);
> -	msr_shift = uic_msr;
> -	vec = vec_base;
> -
> -	while (msr_shift != 0) {
> -		if (msr_shift & 0x80000000) {
> -			/*
> -			 * Increment irq counter (for debug purpose only)
> -			 */
> -			irq_vecs[vec].count++;
> -
> -			if (irq_vecs[vec].handler != NULL) {
> -				/* call isr */
> -				(*irq_vecs[vec].handler)(irq_vecs[vec].arg);
> -			} else {
> -				set_dcr(uic_base + UIC_ER,
> -					get_dcr(uic_base + UIC_ER) & ~UIC_MASK(vec));
> -				printf("Masking bogus interrupt vector %d"
> -				       " (UIC_BASE=0x%x)\n", vec, uic_base);
> -			}
> -
> -			/*
> -			 * After servicing the interrupt, we have to remove the
> -			 * status indicator
> -			 */
> -			set_dcr(uic_base + UIC_SR, UIC_MASK(vec));
> -		}
> -
> -		/*
> -		 * Shift msr to next position and increment vector
> -		 */
> -		msr_shift <<= 1;
> -		vec++;
> -	}
> +	/* nothing to do here */
> +	return;
>  }
>
> -/*
> - * Handle external interrupts
> - */
> -void external_interrupt(struct pt_regs *regs)
> +void interrupt_run_handler(int vec)
>  {
> -	u32 uic_msr;
> -
> -	/*
> -	 * Read masked interrupt status register to determine interrupt source
> -	 */
> -	uic_msr = mfdcr(uic0msr);
> -
> -#if (UIC_MAX > 1)
> -	if ((UIC_MASK(VECNUM_UIC1CI) & uic_msr) ||
> -	    (UIC_MASK(VECNUM_UIC1NCI) & uic_msr))
> -		uic_interrupt(UIC1_DCR_BASE, 32);
> -#endif
> -
> -#if (UIC_MAX > 2)
> -	if ((UIC_MASK(VECNUM_UIC2CI) & uic_msr) ||
> -	    (UIC_MASK(VECNUM_UIC2NCI) & uic_msr))
> -		uic_interrupt(UIC2_DCR_BASE, 64);
> -#endif
> -
> -#if (UIC_MAX > 3)
> -	if ((UIC_MASK(VECNUM_UIC3CI) & uic_msr) ||
> -	    (UIC_MASK(VECNUM_UIC3NCI) & uic_msr))
> -		uic_interrupt(UIC3_DCR_BASE, 96);
> -#endif
> -
> -	if (uic_msr & ~(UICB0_ALL))
> -		uic_interrupt(UIC0_DCR_BASE, 0);
> -
> -	mtdcr(uic0sr, uic_msr);
> +	irq_vecs[vec].count++;
> +
> +	if (irq_vecs[vec].handler != NULL) {
> +		/* call isr */
> +		(*irq_vecs[vec].handler) (irq_vecs[vec].arg);
> +	} else {
> +		pic_irq_disable(vec);
> +		printf("Masking bogus interrupt vector %d\n", vec);
> +	}
>
> +	pic_irq_ack(vec);
>  	return;
>  }
>
> -/*
> - * Install and free a interrupt handler.
> - */
>  void irq_install_handler(int vec, interrupt_handler_t * handler, void
> *arg) {
>  	/*
> @@ -263,51 +177,19 @@ void irq_install_handler(int vec, interrupt_handler_t
> * handler, void *arg) irq_vecs[vec].handler = handler;
>  	irq_vecs[vec].arg = arg;
>
> -	if ((vec >= 0) && (vec < 32))
> -		mtdcr(uicer, mfdcr(uicer) | UIC_MASK(vec));
> -#if (UIC_MAX > 1)
> -	else if ((vec >= 32) && (vec < 64))
> -		mtdcr(uic1er, mfdcr(uic1er) | UIC_MASK(vec));
> -#endif
> -#if (UIC_MAX > 2)
> -	else if ((vec >= 64) && (vec < 96))
> -		mtdcr(uic2er, mfdcr(uic2er) | UIC_MASK(vec));
> -#endif
> -#if (UIC_MAX > 3)
> -	else if (vec >= 96)
> -		mtdcr(uic3er, mfdcr(uic3er) | UIC_MASK(vec));
> -#endif
> -
> -	debug("Install interrupt for vector %d ==> %p\n", vec, handler);
> +	pic_irq_enable(vec);
> +	return;
>  }
>
> -void irq_free_handler (int vec)
> +void irq_free_handler(int vec)
>  {
>  	debug("Free interrupt for vector %d ==> %p\n",
>  	      vec, irq_vecs[vec].handler);
>
> -	if ((vec >= 0) && (vec < 32))
> -		mtdcr(uicer, mfdcr(uicer) & ~UIC_MASK(vec));
> -#if (UIC_MAX > 1)
> -	else if ((vec >= 32) && (vec < 64))
> -		mtdcr(uic1er, mfdcr(uic1er) & ~UIC_MASK(vec));
> -#endif
> -#if (UIC_MAX > 2)
> -	else if ((vec >= 64) && (vec < 96))
> -		mtdcr(uic2er, mfdcr(uic2er) & ~UIC_MASK(vec));
> -#endif
> -#if (UIC_MAX > 3)
> -	else if (vec >= 96)
> -		mtdcr(uic3er, mfdcr(uic3er) & ~UIC_MASK(vec));
> -#endif
> +	pic_irq_disable(vec);
>
>  	irq_vecs[vec].handler = NULL;
>  	irq_vecs[vec].arg = NULL;
> -}
> -
> -void timer_interrupt_cpu (struct pt_regs *regs)
> -{
> -	/* nothing to do here */
>  	return;
>  }
>
> @@ -319,7 +201,7 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc,
> char *argv[]) printf ("Interrupt-Information:\n");
>  	printf ("Nr  Routine   Arg       Count\n");
>
> -	for (vec = 0; vec < (UIC_MAX * 32); vec++) {
> +	for (vec = 0; vec < IRQ_MAX; vec++) {
>  		if (irq_vecs[vec].handler != NULL) {
>  			printf ("%02d  %08lx  %08lx  %d\n",
>  				vec,
> diff --git a/cpu/ppc4xx/speed.c b/cpu/ppc4xx/speed.c
> index b86b6de..d21bd82 100644
> --- a/cpu/ppc4xx/speed.c
> +++ b/cpu/ppc4xx/speed.c
> @@ -416,7 +416,8 @@ ulong get_PCI_freq (void)
>  	return sys_info.freqPCI;
>  }
>
> -#elif !defined(CONFIG_440GX) && !defined(CONFIG_440SP) &&
> !defined(CONFIG_440SPE) +#elif !defined(CONFIG_440GX) &&
> !defined(CONFIG_440SP) && !defined(CONFIG_440SPE) \ +	&&
> !defined(CONFIG_XILINX_440)
>  void get_sys_info (sys_info_t * sysInfo)
>  {
>  	unsigned long strp0;
> @@ -449,6 +450,8 @@ void get_sys_info (sys_info_t * sysInfo)
>  	sysInfo->freqUART = sysInfo->freqPLB;
>  }
>  #else
> +
> +#if !defined(CONFIG_XILINX_440)
>  void get_sys_info (sys_info_t * sysInfo)
>  {
>  	unsigned long strp0;
> @@ -535,6 +538,7 @@ void get_sys_info (sys_info_t * sysInfo)
>  }
>
>  #endif
> +#endif /* CONFIG_XILINX_440 */
>
>  #if defined(CONFIG_YUCCA)
>  unsigned long determine_sysper(void)
> diff --git a/cpu/ppc4xx/uic.c b/cpu/ppc4xx/uic.c
> new file mode 100644
> index 0000000..102b67a
> --- /dev/null
> +++ b/cpu/ppc4xx/uic.c
> @@ -0,0 +1,210 @@
> +/*
> + * (C) Copyright 2000-2002
> + * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> + *
> + * (C) Copyright 2002 (440 port)
> + * Scott McNutt, Artesyn Communication Producs, smcnutt at artsyncp.com
> + *
> + * (C) Copyright 2003 (440GX port)
> + * Travis B. Sawyer, Sandburst Corporation, tsawyer at sandburst.com
> + *
> + * (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
> + * Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * Work supported by Qtechnology (htpp://qtec.com)
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include <common.h>
> +#include <watchdog.h>
> +#include <command.h>
> +#include <asm/processor.h>
> +#include <asm/interrupt.h>
> +#include <ppc4xx.h>
> +#include <ppc_asm.tmpl>
> +#include <commproc.h>
> +
> +#if (UIC_MAX > 3)
> +#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
> +			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI) | \
> +			 UIC_MASK(VECNUM_UIC3CI) | UIC_MASK(VECNUM_UIC3NCI))
> +#elif (UIC_MAX > 2)
> +#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
> +			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI))
> +#elif (UIC_MAX > 1)
> +#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI))
> +#else
> +#define UICB0_ALL	0
> +#endif
> +
> +u32 get_dcr(u16);
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +void pic_enable(void)
> +{
> +
> +#if (UIC_MAX > 1)
> +	/* Install the UIC1 handlers */
> +	irq_install_handler(VECNUM_UIC1NCI, (void *)(void *)external_interrupt,
> +			    0);
> +	irq_install_handler(VECNUM_UIC1CI, (void *)(void *)external_interrupt,
> +			    0);
> +#endif
> +#if (UIC_MAX > 2)
> +	irq_install_handler(VECNUM_UIC2NCI, (void *)(void *)external_interrupt,
> +			    0);
> +	irq_install_handler(VECNUM_UIC2CI, (void *)(void *)external_interrupt,
> +			    0);
> +#endif
> +#if (UIC_MAX > 3)
> +	irq_install_handler(VECNUM_UIC3NCI, (void *)(void *)external_interrupt,
> +			    0);
> +	irq_install_handler(VECNUM_UIC3CI, (void *)(void *)external_interrupt,
> +			    0);
> +#endif
> +
> +}
> +
> +

Nitpick: Only one empty line please.

> +/* Handler for UIC interrupt */
> +static void uic_interrupt(u32 uic_base, int vec_base)
> +{
> +	u32 uic_msr;
> +	u32 msr_shift;
> +	int vec;
> +
> +	/*
> +	 * Read masked interrupt status register to determine interrupt source
> +	 */
> +	uic_msr = get_dcr(uic_base + UIC_MSR);
> +	msr_shift = uic_msr;
> +	vec = vec_base;
> +
> +	while (msr_shift != 0) {
> +		if (msr_shift & 0x80000000)
> +			interrupt_run_handler(vec);
> +		/*
> +		 * Shift msr to next position and increment vector
> +		 */
> +		msr_shift <<= 1;
> +		vec++;
> +	}
> +}
> +
> +/*
> + * Handle external interrupts
> + */
> +void external_interrupt(struct pt_regs *regs)
> +{
> +	u32 uic_msr;
> +
> +	/*
> +	 * Read masked interrupt status register to determine interrupt source
> +	 */
> +	uic_msr = mfdcr(uic0msr);
> +
> +#if (UIC_MAX > 1)
> +	if ((UIC_MASK(VECNUM_UIC1CI) & uic_msr) ||
> +	    (UIC_MASK(VECNUM_UIC1NCI) & uic_msr))
> +		uic_interrupt(UIC1_DCR_BASE, 32);
> +#endif
> +
> +#if (UIC_MAX > 2)
> +	if ((UIC_MASK(VECNUM_UIC2CI) & uic_msr) ||
> +	    (UIC_MASK(VECNUM_UIC2NCI) & uic_msr))
> +		uic_interrupt(UIC2_DCR_BASE, 64);
> +#endif
> +
> +#if (UIC_MAX > 3)
> +	if ((UIC_MASK(VECNUM_UIC3CI) & uic_msr) ||
> +	    (UIC_MASK(VECNUM_UIC3NCI) & uic_msr))
> +		uic_interrupt(UIC3_DCR_BASE, 96);
> +#endif
> +
> +	if (uic_msr & ~(UICB0_ALL))
> +		uic_interrupt(UIC0_DCR_BASE, 0);
> +
> +	mtdcr(uic0sr, uic_msr);
> +
> +	return;
> +}
> +
> +void pic_irq_ack(unsigned int vec)
> +{
> +
> +	if ((vec >= 0) && (vec < 32))
> +		mtdcr(uicsr, UIC_MASK(vec));
> +#if (UIC_MAX > 1)
> +	else if ((vec >= 32) && (vec < 64))
> +		mtdcr(uic1sr, UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 2)
> +	else if ((vec >= 64) && (vec < 96))
> +		mtdcr(uic2sr, UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 3)
> +	else if (vec >= 96)
> +		mtdcr(uic3sr, UIC_MASK(vec));
> +#endif
> +}
> +
> +/*
> + * Install and free a interrupt handler.
> + */
> +void pic_irq_enable(unsigned int vec)
> +{
> +
> +	if ((vec >= 0) && (vec < 32))
> +		mtdcr(uicer, mfdcr(uicer) | UIC_MASK(vec));
> +#if (UIC_MAX > 1)
> +	else if ((vec >= 32) && (vec < 64))
> +		mtdcr(uic1er, mfdcr(uic1er) | UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 2)
> +	else if ((vec >= 64) && (vec < 96))
> +		mtdcr(uic2er, mfdcr(uic2er) | UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 3)
> +	else if (vec >= 96)
> +		mtdcr(uic3er, mfdcr(uic3er) | UIC_MASK(vec));
> +#endif
> +
> +	debug("Install interrupt for vector %d ==> %p\n", vec, handler);
> +}
> +
> +void pic_irq_disable(unsigned int vec)
> +{
> +
> +	if ((vec >= 0) && (vec < 32))
> +		mtdcr(uicer, mfdcr(uicer) & ~UIC_MASK(vec));
> +#if (UIC_MAX > 1)
> +	else if ((vec >= 32) && (vec < 64))
> +		mtdcr(uic1er, mfdcr(uic1er) & ~UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 2)
> +	else if ((vec >= 64) && (vec < 96))
> +		mtdcr(uic2er, mfdcr(uic2er) & ~UIC_MASK(vec));
> +#endif
> +#if (UIC_MAX > 3)
> +	else if (vec >= 96)
> +		mtdcr(uic3er, mfdcr(uic3er) & ~UIC_MASK(vec));
> +#endif
> +
> +}
> diff --git a/cpu/ppc4xx/xilinx_irq.c b/cpu/ppc4xx/xilinx_irq.c
> new file mode 100644
> index 0000000..f2dbcc8
> --- /dev/null
> +++ b/cpu/ppc4xx/xilinx_irq.c
> @@ -0,0 +1,111 @@
> +/*
> + * (C) Copyright 2008
> + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * This work has been supported by: QTechnology  http://qtec.com/
> + * Based on interrupts.c Wolfgang Denk-DENX Software
> Engineering-wd at denx.de + * This program is free software: you can
> redistribute it and/or modify + * it under the terms of the GNU General
> Public License as published by + * the Free Software Foundation, either
> version 2 of the License, or + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/
> +#include <common.h>
> +#include <watchdog.h>
> +#include <command.h>
> +#include <asm/processor.h>
> +#include <asm/interrupt.h>
> +#include <ppc4xx.h>
> +#include <ppc_asm.tmpl>
> +#include <commproc.h>
> +#include <asm/io.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;

Do you really need this in this file?

> +
> +#define intc XPAR_INTC_0_BASEADDR
> +#define ISR (u32*)(intc+(0*4))	/* Interrupt Status Register */
> +#define IPR (u32*)(intc+(1*4))	/* Interrupt Pending Register */
> +#define IER (u32*)(intc+(2*4))	/* Interrupt Enable Register */
> +#define IAR (u32*)(intc+(3*4))	/* Interrupt Acknowledge Register */
> +#define SIE (u32*)(intc+(4*4))	/* Set Interrupt Enable bits */
> +#define CIE (u32*)(intc+(5*4))	/* Clear Interrupt Enable bits */
> +#define IVR (u32*)(intc+(6*4))	/* Interrupt Vector Register */
> +#define MER (u32*)(intc+(7*4))	/* Master Enable Register */

Don't put the casts into the defines. They belong in the code.

> +#define IRQ_MASK(irq) (1<<(irq&0x1f))

Conding-style: Missing spaces.

> +void pic_enable(void)
> +{
> +	printf("Xilinx PIC at 0x%8x\n", intc);

You probably what a debug() here.

> +
> +	/*
> +	 * Disable all external interrupts until they are
> +	 * explicitly requested.
> +	 */
> +	out_be32(IER, 0);
> +
> +	/* Acknowledge any pending interrupts just in case. */
> +	out_be32(IAR, ~(u32) 0);

I personally prefer to use 0xffffffff here.

> +	/* Turn on the Master Enable. */
> +	out_be32(MER, 0x3UL);
> +
> +	return;
> +}
> +
> +int xilinx_pic_irq_get(void)
> +{
> +	u32 irq;
> +	irq = in_be32(IVR);
> +
> +	/* If no interrupt is pending then all bits of the IVR are set to 1. As
> +	 * the IVR is as many bits wide as numbers of inputs are available.
> +	 * Therefore, if all bits of the IVR are set to one, its content will
> +	 * be bigger than XPAR_INTC_MAX_NUM_INTR_INPUTS.
> +	 */
> +	if (irq >= XPAR_INTC_MAX_NUM_INTR_INPUTS)
> +		irq = -1;	/* report no pending interrupt. */
> +
> +	debug("get_irq: %d\n", irq);
> +	return (irq);
> +}
> +
> +void pic_irq_enable(unsigned int irq)
> +{
> +	unsigned long mask = IRQ_MASK(irq);
> +	debug("enable: %d\n", irq);
> +	out_be32(SIE, mask);
> +}

I suggest you decide for one type here and not use "unsigned int" 
and "unsigned long". I use u32 now if possible. This is for the whole file.

> +
> +void pic_irq_disable(unsigned int irq)
> +{
> +	unsigned long mask = IRQ_MASK(irq);
> +	debug("disable: %d\n", irq);
> +	out_be32(CIE, mask);
> +}
> +
> +void pic_irq_ack(unsigned int irq)
> +{
> +	unsigned long mask = IRQ_MASK(irq);
> +	debug("ack: %d\n", irq);
> +	out_be32(IAR, mask);
> +}
> +
> +void external_interrupt(struct pt_regs *regs)
> +{
> +	int irq;
> +
> +	irq = xilinx_pic_irq_get();
> +	if (irq < 0)
> +		return;
> +
> +	interrupt_run_handler(irq);
> +
> +	return;
> +}
> diff --git a/include/asm-ppc/interrupt.h b/include/asm-ppc/interrupt.h
> new file mode 100644
> index 0000000..6c84a84
> --- /dev/null
> +++ b/include/asm-ppc/interrupt.h
> @@ -0,0 +1,37 @@
> +/*
> + * (C) Copyright 2008
> + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * This work has been supported by: QTechnology  http://qtec.com/
> + * Based on interrupts.c Wolfgang Denk-DENX Software
> Engineering-wd at denx.de + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/
> +#ifndef INTERRUPT_H
> +#define INTERRUPT_H
> +
> +
> +#if defined(CONFIG_440_VIRTEX5)
> +#define IRQ_MAX XPAR_INTC_MAX_NUM_INTR_INPUTS
> +#else
> +#define IRQ_MAX UIC_MAX * 32
> +#endif

Please move those defines into some interrupt controller specific headers. For 
uic version this is include/asm-ppc/ppc4xx-uic.h.

> +
> +void pic_enable(void);
> +void pic_irq_enable(unsigned int irq);
> +void pic_irq_disable(unsigned int irq);
> +void pic_irq_ack(unsigned int irq);
> +void external_interrupt(struct pt_regs *regs);
> +void interrupt_run_handler(int vec);
> +
> +#endif
> diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
> index 6e134c3..5501244 100644
> --- a/include/asm-ppc/processor.h
> +++ b/include/asm-ppc/processor.h
> @@ -839,6 +839,8 @@
>  #define PVR_86xx	0x80040000
>  #define PVR_86xx_REV1	(PVR_86xx | 0x0010)
>
> +#define PVR_VIRTEX5     0x7ff21912
> +
>  /*
>   * For the 8xx processors, all of them report the same PVR family for
>   * the PowerPC core. The various versions of these processors must be

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support
  2008-07-16  1:17   ` [U-Boot-Users] ppc4xx: [PATCH] " Ricardo Ribalda Delgado
@ 2008-07-17  6:31     ` Stefan Roese
  2008-07-17  8:25       ` Wolfgang Denk
  2008-07-17  7:21     ` Michal Simek
  1 sibling, 1 reply; 25+ messages in thread
From: Stefan Roese @ 2008-07-17  6:31 UTC (permalink / raw)
  To: u-boot

On Wednesday 16 July 2008, Ricardo Ribalda Delgado wrote:
> Added Flash Support
>
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>

Please add a small board description in the commit text.

> ---
>  CREDITS                          |    5 ++
>  MAINTAINERS                      |    4 +
>  MAKEALL                          |    1 +
>  Makefile                         |    3 +
>  board/xilinx/ml507/Makefile      |   58 +++++++++++++++++
>  board/xilinx/ml507/config.mk     |   24 +++++++
>  board/xilinx/ml507/init.S        |   47 ++++++++++++++
>  board/xilinx/ml507/ml507.c       |   46 +++++++++++++
>  board/xilinx/ml507/u-boot.lds    |  130
> ++++++++++++++++++++++++++++++++++++++ board/xilinx/ml507/xparameters.h |  
> 35 ++++++++++
>  include/configs/ml507.h          |  116 +++++++++++++++++++++++++++++++++
>  11 files changed, 469 insertions(+), 0 deletions(-)
>  create mode 100644 board/xilinx/ml507/Makefile
>  create mode 100644 board/xilinx/ml507/config.mk
>  create mode 100644 board/xilinx/ml507/init.S
>  create mode 100644 board/xilinx/ml507/ml507.c
>  create mode 100644 board/xilinx/ml507/u-boot.lds
>  create mode 100644 board/xilinx/ml507/xparameters.h
>  create mode 100644 include/configs/ml507.h
>
> diff --git a/CREDITS b/CREDITS
> index 3b6e57d..06e78bf 100644
> --- a/CREDITS
> +++ b/CREDITS
> @@ -399,6 +399,11 @@ N: Stelian Pop
>  E: stelian.pop at leadtechdesign.com
>  D: Atmel AT91CAP9ADK support
>
> +N: Ricardo Ribalda Delgado
> +E: ricardo.ribalda at uam.es
> +D: PPC440x5 (Virtex5), ML507 Board, eeprom_simul, adt7460
> +W: http://www.ii.uam.es/~rribalda
> +
>  N: Stefan Roese
>  E: sr at denx.de
>  D: AMCC PPC4xx Support
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b667c8e..75b5b02 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -311,6 +311,10 @@ Daniel Poirot <dan.poirot@windriver.com>
>  	sbc8240		MPC8240
>  	sbc405		PPC405GP
>
> +Ricardo Ribalda <ricardo.ribalda@uam.es>
> +
> +	ml507 		PPC440x5
> +
>  Stefan Roese <sr@denx.de>
>
>  	P3M7448		MPC7448
> diff --git a/MAKEALL b/MAKEALL
> index a256e9a..5463a58 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -239,6 +239,7 @@ LIST_4xx="		\
>  	yosemite	\
>  	yucca		\
>  	zeus		\
> +	ml507		\
>  "
>
>  #########################################################################
> diff --git a/Makefile b/Makefile
> index 10a3e06..40029e6 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1336,6 +1336,9 @@ ML2_config:	unconfig
>  ml300_config:	unconfig
>  	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ml300 xilinx
>
> +ml507_config:	unconfig
> +	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ml507 xilinx
> +
>  ocotea_config:	unconfig
>  	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ocotea amcc
>
> diff --git a/board/xilinx/ml507/Makefile b/board/xilinx/ml507/Makefile
> new file mode 100644
> index 0000000..b9bd737
> --- /dev/null
> +++ b/board/xilinx/ml507/Makefile
> @@ -0,0 +1,58 @@
> +#
> +# (C) Copyright 2000-2006
> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +include $(TOPDIR)/config.mk
> +ifneq ($(OBJTREE),$(SRCTREE))
> +endif
> +
> +INCS		:=
> +CFLAGS		+= $(INCS)
> +HOST_CFLAGS	+= $(INCS)
> +
> +LIB	= $(obj)lib$(BOARD).a
> +
> +COBJS	= $(BOARD).o \
> +
> +SOBJS	= init.o
> +
> +SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS	:= $(addprefix $(obj),$(COBJS))
> +SOBJS	:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):	$(OBJS) $(SOBJS)
> +	$(AR) $(ARFLAGS) $@ $^
> +
> +clean:
> +	rm -f $(SOBJS) $(OBJS)
> +
> +distclean:	clean
> +	rm -f $(LIB) core *.bak .depend
> +
> +#########################################################################
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#########################################################################
> diff --git a/board/xilinx/ml507/config.mk b/board/xilinx/ml507/config.mk
> new file mode 100644
> index 0000000..35c52ad
> --- /dev/null
> +++ b/board/xilinx/ml507/config.mk
> @@ -0,0 +1,24 @@
> +#
> +# (C) Copyright 2000
> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +TEXT_BASE = 0x04000000
> diff --git a/board/xilinx/ml507/init.S b/board/xilinx/ml507/init.S
> new file mode 100644
> index 0000000..6510646
> --- /dev/null
> +++ b/board/xilinx/ml507/init.S
> @@ -0,0 +1,47 @@
> +/*
> + *  (C) Copyright 2008
> + *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + *  This work has been supported by: QTechnology  http://qtec.com/
> + *
> + *  This program is free software: you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation, either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/
> +
> +#include <ppc_asm.tmpl>
> +#include <config.h>
> +#include <asm-ppc/mmu.h>
> +
> +.section .bootpg,"ax"
> +.globl tlbtab
> +
> +tlbtab:
> +tlbtab_start
> +	/* SDRAM */
> +tlbentry(XPAR_DDR2_SDRAM_MEM_BASEADDR, SZ_256M, CFG_SDRAM_BASE, 0,
> +	 AC_R | AC_W | AC_X | SA_G | SA_I)
> +	/* UART */
> +tlbentry(XPAR_UARTLITE_0_BASEADDR, SZ_64K, XPAR_UARTLITE_0_BASEADDR, 0,
> +	 AC_R | AC_W | SA_G | SA_I)
> +	/* PIC */
> +tlbentry(XPAR_INTC_0_BASEADDR, SZ_64K, XPAR_INTC_0_BASEADDR, 0,
> +	 AC_R | AC_W | SA_G | SA_I)
> +	/* I2C */
> +tlbentry(XPAR_IIC_EEPROM_BASEADDR, SZ_64K, XPAR_IIC_EEPROM_BASEADDR, 0,
> +	 AC_R | AC_W | SA_G | SA_I)
> +	/* Net */
> +tlbentry(XPAR_LLTEMAC_0_BASEADDR, SZ_64K, XPAR_LLTEMAC_0_BASEADDR, 0,
> +	 AC_R | AC_W | SA_G | SA_I)
> +	/*Flash*/
> +tlbentry(XPAR_FLASH_MEM0_BASEADDR, SZ_256M, XPAR_FLASH_MEM0_BASEADDR, 0,
> +	 AC_R | AC_W | SA_G | SA_I)
> +tlbtab_end
> diff --git a/board/xilinx/ml507/ml507.c b/board/xilinx/ml507/ml507.c
> new file mode 100644
> index 0000000..6d78dd6
> --- /dev/null
> +++ b/board/xilinx/ml507/ml507.c
> @@ -0,0 +1,46 @@
> +/*
> + * (C) Copyright 2008
> + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * This work has been supported by: QTechnology  http://qtec.com/
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/
> +
> +#include <config.h>
> +#include <common.h>
> +#include <asm/processor.h>
> +
> +int board_pre_init(void)
> +{
> +	return 0;
> +}
> +
> +int checkboard(void)
> +{
> +	puts ("ML507 Board\n");
> +	return 0;
> +}
> +
> +phys_size_t initdram(int board_type)
> +{
> +	return 256 * 1024 * 1024;
> +}

How about at least defining this SDRAM size in the board header and using it 
here:

board_foo.h:
#define CFG_MBYTES_SDRAM        256

board_foo.c
	return CFG_MBYTES_SDRAM << 20;

> +
> +void get_sys_info(sys_info_t * sysInfo)
> +{
> +	sysInfo->freqProcessor = XPAR_CORE_CLOCK_FREQ_HZ;
> +	sysInfo->freqPLB = XPAR_PLB_CLOCK_FREQ_HZ;
> +	sysInfo->freqPCI = 0;
> +
> +	return;
> +}
> diff --git a/board/xilinx/ml507/u-boot.lds b/board/xilinx/ml507/u-boot.lds
> new file mode 100644
> index 0000000..ef2bdc3
> --- /dev/null
> +++ b/board/xilinx/ml507/u-boot.lds
> @@ -0,0 +1,130 @@
> +/*
> + * (C) Copyright 2000
> + * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> + * 2008:
> + * Modified by: Ricardo Ribalda Delgado ricardo.ribalda at uam.es
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +OUTPUT_ARCH(powerpc)
> +ENTRY(_start_440)
> +/* Do we need any of these for elf?
> +   __DYNAMIC = 0;    */
> +SECTIONS
> +{
> +  /* Read-only sections, merged into text segment: */
> +  . = + SIZEOF_HEADERS;
> +  .interp : { *(.interp) }
> +  .hash          : { *(.hash)		}
> +  .dynsym        : { *(.dynsym)		}
> +  .dynstr        : { *(.dynstr)		}
> +  .rel.text      : { *(.rel.text)		}
> +  .rela.text     : { *(.rela.text)	}
> +  .rel.data      : { *(.rel.data)		}
> +  .rela.data     : { *(.rela.data)	}
> +  .rel.rodata    : { *(.rel.rodata)	}
> +  .rela.rodata   : { *(.rela.rodata)	}
> +  .rel.got       : { *(.rel.got)		}
> +  .rela.got      : { *(.rela.got)		}
> +  .rel.ctors     : { *(.rel.ctors)	}
> +  .rela.ctors    : { *(.rela.ctors)	}
> +  .rel.dtors     : { *(.rel.dtors)	}
> +  .rela.dtors    : { *(.rela.dtors)	}
> +  .rel.bss       : { *(.rel.bss)		}
> +  .rela.bss      : { *(.rela.bss)		}
> +  .rel.plt       : { *(.rel.plt)		}
> +  .rela.plt      : { *(.rela.plt)		}
> +  .init          : { *(.init)	}
> +  .plt : { *(.plt) }
> +  .text      :
> +  {
> +    *(.text)
> +    *(.fixup)
> +    *(.got1)
> +  }
> +  _etext = .;
> +  PROVIDE (etext = .);
> +  .rodata    :
> +  {
> +    *(.rodata)
> +    *(.rodata1)
> +    *(.rodata.str1.4)
> +    *(.eh_frame)
> +  }
> +  .fini      : { *(.fini)    } =0
> +  .ctors     : { *(.ctors)   }
> +  .dtors     : { *(.dtors)   }
> +
> +  /* Read-write section, merged into data segment: */
> +  . = (. + 0x00FF) & 0xFFFFFF00;
> +  _erotext = .;
> +  PROVIDE (erotext = .);
> +  .reloc   :
> +  {
> +    *(.got)
> +    _GOT2_TABLE_ = .;
> +    *(.got2)
> +    _FIXUP_TABLE_ = .;
> +    *(.fixup)
> +  }
> +  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
> +  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
> +
> +  .data    :
> +  {
> +    *(.data)
> +    *(.data1)
> +    *(.sdata)
> +    *(.sdata2)
> +    *(.dynamic)
> +    CONSTRUCTORS
> +  }
> +  _edata  =  .;
> +  PROVIDE (edata = .);
> +
> +  . = .;
> +  __u_boot_cmd_start = .;
> +  .u_boot_cmd : { *(.u_boot_cmd) }
> +  __u_boot_cmd_end = .;
> +
> +
> +  . = .;
> +  __start___ex_table = .;
> +  __ex_table : { *(__ex_table) }
> +  __stop___ex_table = .;
> +
> +  . = ALIGN(256);
> +  __init_begin = .;
> +  .text.init : { *(.text.init) }
> +  .data.init : { *(.data.init) }
> +  . = ALIGN(256);
> +  __init_end = .;
> +
> +  __bss_start = .;
> +  .bss (NOLOAD)       :
> +  {
> +   *(.sbss) *(.scommon)
> +   *(.dynbss)
> +   *(.bss)
> +   *(COMMON)
> +  }
> +  _end = . ;
> +  PROVIDE (end = .);
> +}
> diff --git a/board/xilinx/ml507/xparameters.h
> b/board/xilinx/ml507/xparameters.h new file mode 100644
> index 0000000..8d938f9
> --- /dev/null
> +++ b/board/xilinx/ml507/xparameters.h
> @@ -0,0 +1,35 @@
> +/*
> + * (C) Copyright 2008
> + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * This work has been supported by: QTechnology  http://qtec.com/
> + * based on xparameters-ml507.h by Xilinx
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/
> +
> +#ifndef XPARAMETER_H
> +#define XPARAMETER_H
> +
> +#define XPAR_DDR2_SDRAM_MEM_BASEADDR 	0x00000000
> +#define XPAR_INTC_0_BASEADDR 		0x81800000
> +#define XPAR_UARTLITE_0_BASEADDR 	0x84000000
> +#define XPAR_RS232_UART_1_BASEADDR 	0x84000000
> +#define XPAR_IIC_EEPROM_BASEADDR 	0x81600000
> +#define XPAR_LLTEMAC_0_BASEADDR 	0x81c00000
> +#define XPAR_FLASH_MEM0_BASEADDR 	0xFC000000
> +#define XPAR_PLB_CLOCK_FREQ_HZ 		100000000
> +#define XPAR_CORE_CLOCK_FREQ_HZ 	400000000
> +#define XPAR_INTC_MAX_NUM_INTR_INPUTS 	13
> +
> +#endif
> diff --git a/include/configs/ml507.h b/include/configs/ml507.h
> new file mode 100644
> index 0000000..293ae65
> --- /dev/null
> +++ b/include/configs/ml507.h
> @@ -0,0 +1,116 @@
> +/*
> + * (C) Copyright 2008
> + *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + *  This work has been supported by: QTechnology  http://qtec.com/
> + *  This program is free software: you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation, either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/
> +
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +/*
> +#define DEBUG
> +#define ET_DEBUG
> +*/
> + /*CPU*/
> +#define CONFIG_XILINX_ML507	1
> +#define CONFIG_XILINX_440	1
> +#define CONFIG_440		1
> +#define CONFIG_4xx		1
> +#include "../board/xilinx/ml507/xparameters.h"
> +
> +/*Mem Map*/
> +#define CFG_SDRAM_BASE		0x0
> +#define CFG_MONITOR_BASE	0x04000000
> +#define CFG_MONITOR_LEN		(192*1024)
> +#define CFG_MALLOC_LEN		(128*1024)
> +#define CFG_ISRAM_BASE		XPAR_XPS_BRAM_IF_CNTLR_1_BASEADDR
> +
> +/*Uart*/
> +#define CONFIG_XILINX_UARTLITE
> +#define CONFIG_BAUDRATE		9600
> +#define CFG_BAUDRATE_TABLE	{9600}
> +#define CONFIG_SERIAL_BASE	XPAR_UARTLITE_0_BASEADDR
> +
> +/*Cmd*/
> +#include <config_cmd_default.h>
> +#define CONFIG_CMD_ASKENV
> +#define CONFIG_CMD_CACHE
> +#define CONFIG_CMD_DIAG
> +#define CONFIG_CMD_ELF
> +#define CONFIG_CMD_IRQ
> +#define CONFIG_CMD_REGINFO
> +#undef CONFIG_CMD_I2C
> +#undef CONFIG_CMD_DTT
> +#undef CONFIG_CMD_NET
> +#undef CONFIG_CMD_PING
> +#undef CONFIG_CMD_DHCP
> +#undef CONFIG_CMD_EEPROM
> +#undef CONFIG_CMD_IMLS
> +
> +/*Env*/
> +#define	CFG_ENV_IS_NOWHERE
> +#define	CFG_ENV_SIZE		0x200
> +#define CFG_ENV_OFFSET 		0x100
> +
> +/*Misc*/
> +#define CONFIG_BOOTDELAY	5		/* autoboot after 5 seconds     */
> +#define CFG_LONGHELP				/* undef to save memory         */
> +#define CFG_PROMPT		"board:/# "	/* Monitor Command Prompt       */
> +#if defined(CONFIG_CMD_KGDB)
> +#define CFG_CBSIZE		1024		/* Console I/O Buffer Size      */
> +#else
> +#define CFG_CBSIZE		256		/* Console I/O Buffer Size      */
> +#endif
> +#define CFG_PBSIZE		(CFG_CBSIZE+sizeof(CFG_PROMPT)+16)
> +#define CFG_MAXARGS		16		/* max number of command args   */
> +#define CFG_BARGSIZE		CFG_CBSIZE	/* Boot Argument Buffer Size */
> +#define CFG_MEMTEST_START	0x0400000	/* memtest works on           */
> +#define CFG_MEMTEST_END		0x0C00000	/* 4 ... 12 MB in DRAM        */
> +#define CFG_LOAD_ADDR		0x400000	/* default load address       */
> +#define CFG_EXTBDINFO		1		/* To use extended board_into (bd_t) */
> +#define CFG_HZ			1000		/* decrementer freq: 1 ms ticks */
> +#define CONFIG_CMDLINE_EDITING			/* add command line history     */
> +#define CONFIG_AUTO_COMPLETE			/* add autocompletion support   */
> +#define CONFIG_LOOPW				/* enable loopw command         */
> +#define CONFIG_MX_CYCLIC			/* enable mdc/mwc commands      */
> +#define CONFIG_ZERO_BOOTDELAY_CHECK		/* check for keypress on bootdelay==0
> */ +#define CONFIG_VERSION_VARIABLE			/* include version env variable */
> +#define CFG_CONSOLE_INFO_QUIET			/* don't print console @ startup */
> +#define CFG_HUSH_PARSER				/* Use the HUSH parser          */
> +#define	CFG_PROMPT_HUSH_PS2	"> "
> +#define CONFIG_LOADS_ECHO			/* echo on for serial download  */
> +#define CFG_LOADS_BAUD_CHANGE			/* allow baudrate change        */
> +#define CFG_BOOTMAPSZ		(8 << 20)	/* Initial Memory map for Linux */
> +#define CONFIG_PREBOOT		"echo U-Boot is up and runnining;"
> +
> +/*Stack*/
> +#define CFG_INIT_RAM_ADDR	0x800000	/* Initial RAM address    */
> +#define CFG_INIT_RAM_END	0x2000		/* End of used area in RAM  */
> +#define CFG_GBL_DATA_SIZE	128		/* num bytes initial data   */
> +#define CFG_GBL_DATA_OFFSET	(CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
> +#define CFG_INIT_SP_OFFSET	CFG_GBL_DATA_OFFSET
> +/*Speed*/
> +#define CONFIG_SYS_CLK_FREQ	400000000
> +
> +/*Flash*/
> +#define	CFG_FLASH_BASE		XPAR_FLASH_MEM0_BASEADDR
> +#define	CFG_FLASH_SIZE		(32*1024*1024)

Why do you need this define? Is it really used?

> +#define	CFG_FLASH_CFI		1
> +#define	CFG_FLASH_CFI_DRIVER	1
> +#define	CFG_FLASH_EMPTY_INFO	1
> +#define	CFG_MAX_FLASH_BANKS	1
> +#define	CFG_MAX_FLASH_SECT	128
> +#define	CFG_FLASH_PROTECTION
> +
> +#endif						/* __CONFIG_H */

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support
  2008-07-16  1:17   ` [U-Boot-Users] ppc4xx: [PATCH] " Ricardo Ribalda Delgado
  2008-07-17  6:31     ` Stefan Roese
@ 2008-07-17  7:21     ` Michal Simek
  2008-07-17 10:30       ` Ricardo Ribalda Delgado
  2008-07-17 10:47       ` [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support (Resubmit) Ricardo Ribalda Delgado
  1 sibling, 2 replies; 25+ messages in thread
From: Michal Simek @ 2008-07-17  7:21 UTC (permalink / raw)
  To: u-boot

> Added Flash Support
> 
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
> ---
>  CREDITS                          |    5 ++
>  MAINTAINERS                      |    4 +
>  MAKEALL                          |    1 +
>  Makefile                         |    3 +
>  board/xilinx/ml507/Makefile      |   58 +++++++++++++++++
>  board/xilinx/ml507/config.mk     |   24 +++++++
>  board/xilinx/ml507/init.S        |   47 ++++++++++++++
>  board/xilinx/ml507/ml507.c       |   46 +++++++++++++
>  board/xilinx/ml507/u-boot.lds    |  130 ++++++++++++++++++++++++++++++++++++++
>  board/xilinx/ml507/xparameters.h |   35 ++++++++++
>  include/configs/ml507.h          |  116 +++++++++++++++++++++++++++++++++
>  11 files changed, 469 insertions(+), 0 deletions(-)
>  create mode 100644 board/xilinx/ml507/Makefile
>  create mode 100644 board/xilinx/ml507/config.mk
>  create mode 100644 board/xilinx/ml507/init.S
>  create mode 100644 board/xilinx/ml507/ml507.c
>  create mode 100644 board/xilinx/ml507/u-boot.lds
>  create mode 100644 board/xilinx/ml507/xparameters.h
>  create mode 100644 include/configs/ml507.h
> 
> diff --git a/CREDITS b/CREDITS
> index 3b6e57d..06e78bf 100644
> --- a/CREDITS
> +++ b/CREDITS
> @@ -399,6 +399,11 @@ N: Stelian Pop
>  E: stelian.pop at leadtechdesign.com
>  D: Atmel AT91CAP9ADK support
>  
> +N: Ricardo Ribalda Delgado
> +E: ricardo.ribalda at uam.es
> +D: PPC440x5 (Virtex5), ML507 Board, eeprom_simul, adt7460
> +W: http://www.ii.uam.es/~rribalda
> +
>  N: Stefan Roese
>  E: sr at denx.de
>  D: AMCC PPC4xx Support
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b667c8e..75b5b02 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -311,6 +311,10 @@ Daniel Poirot <dan.poirot@windriver.com>
>  	sbc8240		MPC8240
>  	sbc405		PPC405GP
>  
> +Ricardo Ribalda <ricardo.ribalda@uam.es>
> +
> +	ml507 		PPC440x5
> +
>  Stefan Roese <sr@denx.de>
>  
>  	P3M7448		MPC7448
> diff --git a/MAKEALL b/MAKEALL
> index a256e9a..5463a58 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -239,6 +239,7 @@ LIST_4xx="		\
>  	yosemite	\
>  	yucca		\
>  	zeus		\
> +	ml507		\
>  "

keep list sorted

>  #########################################################################
> diff --git a/Makefile b/Makefile
> index 10a3e06..40029e6 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1336,6 +1336,9 @@ ML2_config:	unconfig
>  ml300_config:	unconfig
>  	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ml300 xilinx
>  
> +ml507_config:	unconfig
> +	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ml507 xilinx
> +
>  ocotea_config:	unconfig
>  	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ocotea amcc
>  
> diff --git a/board/xilinx/ml507/Makefile b/board/xilinx/ml507/Makefile
> new file mode 100644
> index 0000000..b9bd737
> --- /dev/null
> +++ b/board/xilinx/ml507/Makefile
> @@ -0,0 +1,58 @@
> +#
> +# (C) Copyright 2000-2006
> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +include $(TOPDIR)/config.mk
> +ifneq ($(OBJTREE),$(SRCTREE))
> +endif
> +
> +INCS		:=
> +CFLAGS		+= $(INCS)
> +HOST_CFLAGS	+= $(INCS)
> +
> +LIB	= $(obj)lib$(BOARD).a
> +
> +COBJS	= $(BOARD).o \

why is back-slash here?

> +SOBJS	= init.o
> +
> +SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS	:= $(addprefix $(obj),$(COBJS))
> +SOBJS	:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):	$(OBJS) $(SOBJS)
> +	$(AR) $(ARFLAGS) $@ $^
> +
> +clean:
> +	rm -f $(SOBJS) $(OBJS)
> +
> +distclean:	clean
> +	rm -f $(LIB) core *.bak .depend
> +
> +#########################################################################
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#########################################################################
> diff --git a/board/xilinx/ml507/config.mk b/board/xilinx/ml507/config.mk
> new file mode 100644
> index 0000000..35c52ad
> --- /dev/null
> +++ b/board/xilinx/ml507/config.mk
> @@ -0,0 +1,24 @@
> +#
> +# (C) Copyright 2000
> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +TEXT_BASE = 0x04000000
> diff --git a/board/xilinx/ml507/init.S b/board/xilinx/ml507/init.S
> new file mode 100644
> index 0000000..6510646
> --- /dev/null
> +++ b/board/xilinx/ml507/init.S
> @@ -0,0 +1,47 @@
> +/*
> + *  (C) Copyright 2008
> + *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + *  This work has been supported by: QTechnology  http://qtec.com/
> + *
> + *  This program is free software: you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation, either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/
> +
> +#include <ppc_asm.tmpl>
> +#include <config.h>
> +#include <asm-ppc/mmu.h>
> +
> +.section .bootpg,"ax"
> +.globl tlbtab
> +
> +tlbtab:
> +tlbtab_start
> +	/* SDRAM */
> +tlbentry(XPAR_DDR2_SDRAM_MEM_BASEADDR, SZ_256M, CFG_SDRAM_BASE, 0,
> +	 AC_R | AC_W | AC_X | SA_G | SA_I)

you have "\t\ " here

> +	/* UART */
> +tlbentry(XPAR_UARTLITE_0_BASEADDR, SZ_64K, XPAR_UARTLITE_0_BASEADDR, 0,
> +	 AC_R | AC_W | SA_G | SA_I)
> +	/* PIC */
> +tlbentry(XPAR_INTC_0_BASEADDR, SZ_64K, XPAR_INTC_0_BASEADDR, 0,
> +	 AC_R | AC_W | SA_G | SA_I)
> +	/* I2C */
> +tlbentry(XPAR_IIC_EEPROM_BASEADDR, SZ_64K, XPAR_IIC_EEPROM_BASEADDR, 0,
> +	 AC_R | AC_W | SA_G | SA_I)
> +	/* Net */
> +tlbentry(XPAR_LLTEMAC_0_BASEADDR, SZ_64K, XPAR_LLTEMAC_0_BASEADDR, 0,
> +	 AC_R | AC_W | SA_G | SA_I)
> +	/*Flash*/
> +tlbentry(XPAR_FLASH_MEM0_BASEADDR, SZ_256M, XPAR_FLASH_MEM0_BASEADDR, 0,
> +	 AC_R | AC_W | SA_G | SA_I)
> +tlbtab_end
> diff --git a/board/xilinx/ml507/ml507.c b/board/xilinx/ml507/ml507.c
> new file mode 100644
> index 0000000..6d78dd6
> --- /dev/null
> +++ b/board/xilinx/ml507/ml507.c
> @@ -0,0 +1,46 @@
> +/*
> + * (C) Copyright 2008
> + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * This work has been supported by: QTechnology  http://qtec.com/
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/
> +
> +#include <config.h>
> +#include <common.h>
> +#include <asm/processor.h>
> +
> +int board_pre_init(void)
> +{
> +	return 0;
> +}
> +
> +int checkboard(void)
> +{
> +	puts ("ML507 Board\n");
> +	return 0;
> +}
> +
> +phys_size_t initdram(int board_type)
> +{
> +	return 256 * 1024 * 1024;
> +}

the same as SR.

> +void get_sys_info(sys_info_t * sysInfo)
> +{
> +	sysInfo->freqProcessor = XPAR_CORE_CLOCK_FREQ_HZ;
> +	sysInfo->freqPLB = XPAR_PLB_CLOCK_FREQ_HZ;
> +	sysInfo->freqPCI = 0;
> +
> +	return;
> +}
> diff --git a/board/xilinx/ml507/u-boot.lds b/board/xilinx/ml507/u-boot.lds
> new file mode 100644
> index 0000000..ef2bdc3
> --- /dev/null
> +++ b/board/xilinx/ml507/u-boot.lds
> @@ -0,0 +1,130 @@
> +/*
> + * (C) Copyright 2000
> + * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> + * 2008:
> + * Modified by: Ricardo Ribalda Delgado ricardo.ribalda at uam.es
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +OUTPUT_ARCH(powerpc)
> +ENTRY(_start_440)
> +/* Do we need any of these for elf?
> +   __DYNAMIC = 0;    */
> +SECTIONS
> +{
> +  /* Read-only sections, merged into text segment: */
> +  . = + SIZEOF_HEADERS;
> +  .interp : { *(.interp) }
> +  .hash          : { *(.hash)		}
> +  .dynsym        : { *(.dynsym)		}
> +  .dynstr        : { *(.dynstr)		}
> +  .rel.text      : { *(.rel.text)		}
> +  .rela.text     : { *(.rela.text)	}
> +  .rel.data      : { *(.rel.data)		}
> +  .rela.data     : { *(.rela.data)	}
> +  .rel.rodata    : { *(.rel.rodata)	}
> +  .rela.rodata   : { *(.rela.rodata)	}
> +  .rel.got       : { *(.rel.got)		}
> +  .rela.got      : { *(.rela.got)		}
> +  .rel.ctors     : { *(.rel.ctors)	}
> +  .rela.ctors    : { *(.rela.ctors)	}
> +  .rel.dtors     : { *(.rel.dtors)	}
> +  .rela.dtors    : { *(.rela.dtors)	}
> +  .rel.bss       : { *(.rel.bss)		}
> +  .rela.bss      : { *(.rela.bss)		}
> +  .rel.plt       : { *(.rel.plt)		}
> +  .rela.plt      : { *(.rela.plt)		}
> +  .init          : { *(.init)	}
> +  .plt : { *(.plt) }
> +  .text      :
> +  {
> +    *(.text)
> +    *(.fixup)
> +    *(.got1)
> +  }
> +  _etext = .;
> +  PROVIDE (etext = .);
> +  .rodata    :
> +  {
> +    *(.rodata)
> +    *(.rodata1)
> +    *(.rodata.str1.4)
> +    *(.eh_frame)
> +  }
> +  .fini      : { *(.fini)    } =0
> +  .ctors     : { *(.ctors)   }
> +  .dtors     : { *(.dtors)   }
> +
> +  /* Read-write section, merged into data segment: */
> +  . = (. + 0x00FF) & 0xFFFFFF00;
> +  _erotext = .;
> +  PROVIDE (erotext = .);
> +  .reloc   :
> +  {
> +    *(.got)
> +    _GOT2_TABLE_ = .;
> +    *(.got2)
> +    _FIXUP_TABLE_ = .;
> +    *(.fixup)
> +  }
> +  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
> +  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
> +
> +  .data    :
> +  {
> +    *(.data)
> +    *(.data1)
> +    *(.sdata)
> +    *(.sdata2)
> +    *(.dynamic)
> +    CONSTRUCTORS
> +  }
> +  _edata  =  .;
> +  PROVIDE (edata = .);
> +
> +  . = .;
> +  __u_boot_cmd_start = .;
> +  .u_boot_cmd : { *(.u_boot_cmd) }
> +  __u_boot_cmd_end = .;
> +
> +
> +  . = .;
> +  __start___ex_table = .;
> +  __ex_table : { *(__ex_table) }
> +  __stop___ex_table = .;
> +
> +  . = ALIGN(256);
> +  __init_begin = .;
> +  .text.init : { *(.text.init) }
> +  .data.init : { *(.data.init) }
> +  . = ALIGN(256);
> +  __init_end = .;
> +
> +  __bss_start = .;
> +  .bss (NOLOAD)       :
> +  {
> +   *(.sbss) *(.scommon)
> +   *(.dynbss)
> +   *(.bss)
> +   *(COMMON)
> +  }
> +  _end = . ;
> +  PROVIDE (end = .);
> +}
> diff --git a/board/xilinx/ml507/xparameters.h b/board/xilinx/ml507/xparameters.h
> new file mode 100644
> index 0000000..8d938f9
> --- /dev/null
> +++ b/board/xilinx/ml507/xparameters.h
> @@ -0,0 +1,35 @@
> +/*
> + * (C) Copyright 2008
> + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + * This work has been supported by: QTechnology  http://qtec.com/
> + * based on xparameters-ml507.h by Xilinx
> + *
> + * This program is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/

I am not lawyer but IMHO you can't change license from generated file. You can
add your copyright.

> +#ifndef XPARAMETER_H
> +#define XPARAMETER_H
> +
> +#define XPAR_DDR2_SDRAM_MEM_BASEADDR 	0x00000000
> +#define XPAR_INTC_0_BASEADDR 		0x81800000
> +#define XPAR_UARTLITE_0_BASEADDR 	0x84000000
> +#define XPAR_RS232_UART_1_BASEADDR 	0x84000000
> +#define XPAR_IIC_EEPROM_BASEADDR 	0x81600000
> +#define XPAR_LLTEMAC_0_BASEADDR 	0x81c00000
> +#define XPAR_FLASH_MEM0_BASEADDR 	0xFC000000
> +#define XPAR_PLB_CLOCK_FREQ_HZ 		100000000
> +#define XPAR_CORE_CLOCK_FREQ_HZ 	400000000
> +#define XPAR_INTC_MAX_NUM_INTR_INPUTS 	13
> +
> +#endif
> diff --git a/include/configs/ml507.h b/include/configs/ml507.h
> new file mode 100644
> index 0000000..293ae65
> --- /dev/null
> +++ b/include/configs/ml507.h
> @@ -0,0 +1,116 @@
> +/*
> + * (C) Copyright 2008
> + *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
> + *  This work has been supported by: QTechnology  http://qtec.com/
> + *  This program is free software: you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation, either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +*/
> +
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +/*
> +#define DEBUG
> +#define ET_DEBUG
> +*/
> + /*CPU*/
> +#define CONFIG_XILINX_ML507	1
> +#define CONFIG_XILINX_440	1
> +#define CONFIG_440		1
> +#define CONFIG_4xx		1
> +#include "../board/xilinx/ml507/xparameters.h"
> +
> +/*Mem Map*/
> +#define CFG_SDRAM_BASE		0x0
> +#define CFG_MONITOR_BASE	0x04000000
> +#define CFG_MONITOR_LEN		(192*1024)

better (192 * 1024) and for other defines too.


> +#define CFG_MALLOC_LEN		(128*1024)
> +#define CFG_ISRAM_BASE		XPAR_XPS_BRAM_IF_CNTLR_1_BASEADDR
> +
> +/*Uart*/
> +#define CONFIG_XILINX_UARTLITE
> +#define CONFIG_BAUDRATE		9600
> +#define CFG_BAUDRATE_TABLE	{9600}
> +#define CONFIG_SERIAL_BASE	XPAR_UARTLITE_0_BASEADDR
> +
> +/*Cmd*/
> +#include <config_cmd_default.h>
> +#define CONFIG_CMD_ASKENV
> +#define CONFIG_CMD_CACHE
> +#define CONFIG_CMD_DIAG
> +#define CONFIG_CMD_ELF
> +#define CONFIG_CMD_IRQ
> +#define CONFIG_CMD_REGINFO
> +#undef CONFIG_CMD_I2C
> +#undef CONFIG_CMD_DTT
> +#undef CONFIG_CMD_NET
> +#undef CONFIG_CMD_PING
> +#undef CONFIG_CMD_DHCP
> +#undef CONFIG_CMD_EEPROM
> +#undef CONFIG_CMD_IMLS
> +
> +/*Env*/
> +#define	CFG_ENV_IS_NOWHERE
> +#define	CFG_ENV_SIZE		0x200
> +#define CFG_ENV_OFFSET 		0x100
> +
> +/*Misc*/
> +#define CONFIG_BOOTDELAY	5		/* autoboot after 5 seconds     */
> +#define CFG_LONGHELP				/* undef to save memory         */
> +#define CFG_PROMPT		"board:/# "	/* Monitor Command Prompt       */
> +#if defined(CONFIG_CMD_KGDB)
> +#define CFG_CBSIZE		1024		/* Console I/O Buffer Size      */
> +#else
> +#define CFG_CBSIZE		256		/* Console I/O Buffer Size      */
> +#endif
> +#define CFG_PBSIZE		(CFG_CBSIZE+sizeof(CFG_PROMPT)+16)
> +#define CFG_MAXARGS		16		/* max number of command args   */
> +#define CFG_BARGSIZE		CFG_CBSIZE	/* Boot Argument Buffer Size */
> +#define CFG_MEMTEST_START	0x0400000	/* memtest works on           */
> +#define CFG_MEMTEST_END		0x0C00000	/* 4 ... 12 MB in DRAM        */
> +#define CFG_LOAD_ADDR		0x400000	/* default load address       */
> +#define CFG_EXTBDINFO		1		/* To use extended board_into (bd_t) */

please check 80 char on line.

> +#define CFG_HZ			1000		/* decrementer freq: 1 ms ticks */
> +#define CONFIG_CMDLINE_EDITING			/* add command line history     */
> +#define CONFIG_AUTO_COMPLETE			/* add autocompletion support   */
> +#define CONFIG_LOOPW				/* enable loopw command         */
> +#define CONFIG_MX_CYCLIC			/* enable mdc/mwc commands      */
> +#define CONFIG_ZERO_BOOTDELAY_CHECK		/* check for keypress on bootdelay==0 */
> +#define CONFIG_VERSION_VARIABLE			/* include version env variable */
> +#define CFG_CONSOLE_INFO_QUIET			/* don't print console @ startup */
> +#define CFG_HUSH_PARSER				/* Use the HUSH parser          */
> +#define	CFG_PROMPT_HUSH_PS2	"> "
> +#define CONFIG_LOADS_ECHO			/* echo on for serial download  */
> +#define CFG_LOADS_BAUD_CHANGE			/* allow baudrate change        */
> +#define CFG_BOOTMAPSZ		(8 << 20)	/* Initial Memory map for Linux */
> +#define CONFIG_PREBOOT		"echo U-Boot is up and runnining;"
> +
> +/*Stack*/
> +#define CFG_INIT_RAM_ADDR	0x800000	/* Initial RAM address    */
> +#define CFG_INIT_RAM_END	0x2000		/* End of used area in RAM  */
> +#define CFG_GBL_DATA_SIZE	128		/* num bytes initial data   */
> +#define CFG_GBL_DATA_OFFSET	(CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
> +#define CFG_INIT_SP_OFFSET	CFG_GBL_DATA_OFFSET
> +/*Speed*/
> +#define CONFIG_SYS_CLK_FREQ	400000000
> +
> +/*Flash*/
> +#define	CFG_FLASH_BASE		XPAR_FLASH_MEM0_BASEADDR
> +#define	CFG_FLASH_SIZE		(32*1024*1024)
> +#define	CFG_FLASH_CFI		1
> +#define	CFG_FLASH_CFI_DRIVER	1
> +#define	CFG_FLASH_EMPTY_INFO	1
> +#define	CFG_MAX_FLASH_BANKS	1
> +#define	CFG_MAX_FLASH_SECT	128
> +#define	CFG_FLASH_PROTECTION
> +
> +#endif						/* __CONFIG_H */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support
  2008-07-17  6:31     ` Stefan Roese
@ 2008-07-17  8:25       ` Wolfgang Denk
  2008-07-17  8:39         ` Stefan Roese
  0 siblings, 1 reply; 25+ messages in thread
From: Wolfgang Denk @ 2008-07-17  8:25 UTC (permalink / raw)
  To: u-boot

In message <200807170831.57309.sr@denx.de> you wrote:
>
> > +phys_size_t initdram(int board_type)
> > +{
> > +	return 256 * 1024 * 1024;
> > +}
> 
> How about at least defining this SDRAM size in the board header and using it 
> here:
> 
> board_foo.h:
> #define CFG_MBYTES_SDRAM        256

No. All boards, especially all PowerPC boards, should use dynamic
memory size detection.

There is no reason to hard-wire the size.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
All these theories, diverse as they are, have two things  in  common:
they explain the observed facts, and they are completeley and utterly
wrong.                       - Terry Pratchett, _The Light Fantastic_

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support
  2008-07-17  8:25       ` Wolfgang Denk
@ 2008-07-17  8:39         ` Stefan Roese
  2008-07-29 14:29           ` Wolfgang Denk
  0 siblings, 1 reply; 25+ messages in thread
From: Stefan Roese @ 2008-07-17  8:39 UTC (permalink / raw)
  To: u-boot

On Thursday 17 July 2008, Wolfgang Denk wrote:
> In message <200807170831.57309.sr@denx.de> you wrote:
> > > +phys_size_t initdram(int board_type)
> > > +{
> > > +	return 256 * 1024 * 1024;
> > > +}
> >
> > How about at least defining this SDRAM size in the board header and using
> > it here:
> >
> > board_foo.h:
> > #define CFG_MBYTES_SDRAM        256
>
> No. All boards, especially all PowerPC boards, should use dynamic
> memory size detection.

You are probably referring to calling get_ram_size() instead of just returning 
the configured fixed value. But what do we gain here. get_ram_size() also 
needs the ram-size as parameter. Not sure if this is an improvement on such 
fixed systems.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (new version)
  2008-07-17  6:24   ` [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Stefan Roese
@ 2008-07-17  9:22     ` Ricardo Ribalda Delgado
  2008-07-17  9:44     ` [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (resubmit) Ricardo Ribalda Delgado
  1 sibling, 0 replies; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-17  9:22 UTC (permalink / raw)
  To: u-boot

Hello Stefan

   Thanks for your comments.



On Thu, Jul 17, 2008 at 8:24 AM, Stefan Roese <sr@denx.de> wrote:

> Even though we usually sort the files alphabetically, these
> multiple "ifndef's" look very ugly. Perhaps we should change this here to a
> single "ifndef" with all the non-Xilinx files in it.

OK, done

>
> Is the CPU really a VIRTEX5 or a PPC440 variant? I think the latter. Perhaps
> something like "PPC440x5"?

The CPU is a PPC440x5 by IBM designed for the Virtex5, I think that is
more descriptive Virtex5 than just x5. What do you thing about:
      puts ("x5 VIRTEX5");

>
> Nitpick: Only one empty line please.
:) Sorry, done

>
> Do you really need this in this file?

Yes, is the external interrupt handler of the CPU, it is needed for
other elemments like the ethernet and the i2c.

> Don't put the casts into the defines. They belong in the code.

Done


> Conding-style: Missing spaces.

Done

>
> You probably what a debug() here.

I liked the printf :) but I have changed it to a debug

>
> I personally prefer to use 0xffffffff here.
OK


> I suggest you decide for one type here and not use "unsigned int"
> and "unsigned long". I use u32 now if possible. This is for the whole file.

Done


> Please move those defines into some interrupt controller specific headers. For
> uic version this is include/asm-ppc/ppc4xx-uic.h.
>

Done

> Best regards,
> Stefan
>
> =====================================================================
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
> =====================================================================
>



-- 
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (resubmit)
  2008-07-17  6:24   ` [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Stefan Roese
  2008-07-17  9:22     ` Ricardo Ribalda Delgado
@ 2008-07-17  9:44     ` Ricardo Ribalda Delgado
  2008-07-18 10:33       ` Stefan Roese
  1 sibling, 1 reply; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-17  9:44 UTC (permalink / raw)
  To: u-boot

-This patchs gives support for the embbedded ppc440
on the Virtex5 FPGAs

-interrupts.c divided in uic.c and interrupts.c

-xilinx_irq.c for xilinx interrupt controller

-Include modifications propossed by  Stefan Roese

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
---
 cpu/ppc4xx/Makefile          |   13 ++-
 cpu/ppc4xx/cpu.c             |    8 ++
 cpu/ppc4xx/interrupts.c      |  178 ++++++-----------------------------
 cpu/ppc4xx/speed.c           |    6 +-
 cpu/ppc4xx/uic.c             |  209 ++++++++++++++++++++++++++++++++++++++++++
 cpu/ppc4xx/xilinx_irq.c      |  100 ++++++++++++++++++++
 include/asm-ppc/interrupt.h  |   36 +++++++
 include/asm-ppc/ppc4xx-uic.h |    2 +
 include/asm-ppc/processor.h  |    2 +
 include/asm-ppc/xilinx_irq.h |   36 +++++++
 include/ppc4xx.h             |    2 +
 11 files changed, 439 insertions(+), 153 deletions(-)
 create mode 100644 cpu/ppc4xx/uic.c
 create mode 100644 cpu/ppc4xx/xilinx_irq.c
 create mode 100644 include/asm-ppc/interrupt.h
 create mode 100644 include/asm-ppc/xilinx_irq.h

diff --git a/cpu/ppc4xx/Makefile b/cpu/ppc4xx/Makefile
index 800bb41..c773400 100644
--- a/cpu/ppc4xx/Makefile
+++ b/cpu/ppc4xx/Makefile
@@ -35,10 +35,8 @@ SOBJS	+= kgdb.o
 COBJS	:= 40x_spd_sdram.o
 COBJS	+= 44x_spd_ddr.o
 COBJS	+= 44x_spd_ddr2.o
-COBJS	+= 4xx_enet.o
 COBJS	+= 4xx_pci.o
 COBJS	+= 4xx_pcie.o
-COBJS	+= 4xx_uart.o
 COBJS	+= bedbug_405.o
 COBJS	+= commproc.o
 COBJS	+= cpu.o
@@ -47,11 +45,9 @@ COBJS	+= denali_data_eye.o
 COBJS	+= denali_spd_ddr2.o
 COBJS	+= ecc.o
 COBJS	+= fdt.o
-COBJS	+= gpio.o
 COBJS	+= i2c.o
 COBJS	+= interrupts.o
 COBJS	+= iop480_uart.o
-COBJS	+= miiphy.o
 COBJS	+= ndfc.o
 COBJS	+= sdram.o
 COBJS	+= speed.o
@@ -60,6 +56,15 @@ COBJS	+= traps.o
 COBJS	+= usb.o
 COBJS	+= usb_ohci.o
 COBJS	+= usbdev.o
+ifndef CONFIG_XILINX_440
+COBJS	+= 4xx_enet.o
+COBJS	+= 4xx_uart.o
+COBJS	+= gpio.o
+COBJS	+= miiphy.o
+COBJS	+= uic.o
+else
+COBJS	+= xilinx_irq.o
+endif
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/ppc4xx/cpu.c b/cpu/ppc4xx/cpu.c
index ef32bc6..eb1d4f0 100644
--- a/cpu/ppc4xx/cpu.c
+++ b/cpu/ppc4xx/cpu.c
@@ -279,7 +279,11 @@ int checkcpu (void)
 
 	get_sys_info(&sys_info);
 
+#if defined(CONFIG_XILINX_440)
+	puts("IBM PowerPC 4");
+#else
 	puts("AMCC PowerPC 4");
+#endif
 
 #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \
     defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \
@@ -541,6 +545,10 @@ int checkcpu (void)
 		puts("GX Rev. A");
 		strcpy(addstr, "No Security support");
 		break;
+	
+	case PVR_VIRTEX5:
+		puts("x5 VIRTEX5");
+		break;
 
 	default:
 		printf (" UNKNOWN (PVR=%08x)", pvr);
diff --git a/cpu/ppc4xx/interrupts.c b/cpu/ppc4xx/interrupts.c
index 8215dc6..58d1d81 100644
--- a/cpu/ppc4xx/interrupts.c
+++ b/cpu/ppc4xx/interrupts.c
@@ -8,6 +8,10 @@
  * (C) Copyright 2003 (440GX port)
  * Travis B. Sawyer, Sandburst Corporation, tsawyer at sandburst.com
  *
+ * (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
+ * Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * Work supported by Qtechnology (htpp://qtec.com)
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -31,23 +35,11 @@
 #include <watchdog.h>
 #include <command.h>
 #include <asm/processor.h>
+#include <asm/interrupt.h>
 #include <ppc4xx.h>
 #include <ppc_asm.tmpl>
 #include <commproc.h>
 
-#if (UIC_MAX > 3)
-#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
-			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI) | \
-			 UIC_MASK(VECNUM_UIC3CI) | UIC_MASK(VECNUM_UIC3NCI))
-#elif (UIC_MAX > 2)
-#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
-			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI))
-#elif (UIC_MAX > 1)
-#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI))
-#else
-#define UICB0_ALL	0
-#endif
-
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -58,11 +50,7 @@ struct	irq_action {
 	void *arg;
 	int count;
 };
-
-static struct irq_action irq_vecs[UIC_MAX * 32];
-
-u32 get_dcr(u16);
-void set_dcr(u16, u32);
+static struct irq_action irq_vecs[IRQ_MAX];
 
 #if defined(CONFIG_440)
 
@@ -103,7 +91,7 @@ int interrupt_init_cpu (unsigned *decrementer_count)
 	/*
 	 * Mark all irqs as free
 	 */
-	for (vec = 0; vec < (UIC_MAX * 32); vec++) {
+	for (vec = 0; vec < IRQ_MAX; vec++) {
 		irq_vecs[vec].handler = NULL;
 		irq_vecs[vec].arg = NULL;
 		irq_vecs[vec].count = 0;
@@ -147,110 +135,36 @@ int interrupt_init_cpu (unsigned *decrementer_count)
 	 */
 	set_evpr(0x00000000);
 
-#if (UIC_MAX > 1)
-	/* Install the UIC1 handlers */
-	irq_install_handler(VECNUM_UIC1NCI, (void *)(void *)external_interrupt, 0);
-	irq_install_handler(VECNUM_UIC1CI, (void *)(void *)external_interrupt, 0);
-#endif
-#if (UIC_MAX > 2)
-	irq_install_handler(VECNUM_UIC2NCI, (void *)(void *)external_interrupt, 0);
-	irq_install_handler(VECNUM_UIC2CI, (void *)(void *)external_interrupt, 0);
-#endif
-#if (UIC_MAX > 3)
-	irq_install_handler(VECNUM_UIC3NCI, (void *)(void *)external_interrupt, 0);
-	irq_install_handler(VECNUM_UIC3CI, (void *)(void *)external_interrupt, 0);
-#endif
+	/*
+	 *Call uic or xilinx_irq pic_enable
+	 */
+	pic_enable();
 
 	return (0);
 }
 
-/* Handler for UIC interrupt */
-static void uic_interrupt(u32 uic_base, int vec_base)
+void timer_interrupt_cpu(struct pt_regs *regs)
 {
-	u32 uic_msr;
-	u32 msr_shift;
-	int vec;
-
-	/*
-	 * Read masked interrupt status register to determine interrupt source
-	 */
-	uic_msr = get_dcr(uic_base + UIC_MSR);
-	msr_shift = uic_msr;
-	vec = vec_base;
-
-	while (msr_shift != 0) {
-		if (msr_shift & 0x80000000) {
-			/*
-			 * Increment irq counter (for debug purpose only)
-			 */
-			irq_vecs[vec].count++;
-
-			if (irq_vecs[vec].handler != NULL) {
-				/* call isr */
-				(*irq_vecs[vec].handler)(irq_vecs[vec].arg);
-			} else {
-				set_dcr(uic_base + UIC_ER,
-					get_dcr(uic_base + UIC_ER) & ~UIC_MASK(vec));
-				printf("Masking bogus interrupt vector %d"
-				       " (UIC_BASE=0x%x)\n", vec, uic_base);
-			}
-
-			/*
-			 * After servicing the interrupt, we have to remove the
-			 * status indicator
-			 */
-			set_dcr(uic_base + UIC_SR, UIC_MASK(vec));
-		}
-
-		/*
-		 * Shift msr to next position and increment vector
-		 */
-		msr_shift <<= 1;
-		vec++;
-	}
+	/* nothing to do here */
+	return;
 }
 
-/*
- * Handle external interrupts
- */
-void external_interrupt(struct pt_regs *regs)
+void interrupt_run_handler(int vec)
 {
-	u32 uic_msr;
-
-	/*
-	 * Read masked interrupt status register to determine interrupt source
-	 */
-	uic_msr = mfdcr(uic0msr);
-
-#if (UIC_MAX > 1)
-	if ((UIC_MASK(VECNUM_UIC1CI) & uic_msr) ||
-	    (UIC_MASK(VECNUM_UIC1NCI) & uic_msr))
-		uic_interrupt(UIC1_DCR_BASE, 32);
-#endif
-
-#if (UIC_MAX > 2)
-	if ((UIC_MASK(VECNUM_UIC2CI) & uic_msr) ||
-	    (UIC_MASK(VECNUM_UIC2NCI) & uic_msr))
-		uic_interrupt(UIC2_DCR_BASE, 64);
-#endif
-
-#if (UIC_MAX > 3)
-	if ((UIC_MASK(VECNUM_UIC3CI) & uic_msr) ||
-	    (UIC_MASK(VECNUM_UIC3NCI) & uic_msr))
-		uic_interrupt(UIC3_DCR_BASE, 96);
-#endif
-
-	if (uic_msr & ~(UICB0_ALL))
-		uic_interrupt(UIC0_DCR_BASE, 0);
-
-	mtdcr(uic0sr, uic_msr);
+	irq_vecs[vec].count++;
+
+	if (irq_vecs[vec].handler != NULL) {
+		/* call isr */
+		(*irq_vecs[vec].handler) (irq_vecs[vec].arg);
+	} else {
+		pic_irq_disable(vec);
+		printf("Masking bogus interrupt vector %d\n", vec);
+	}
 
+	pic_irq_ack(vec);
 	return;
 }
 
-/*
- * Install and free a interrupt handler.
- */
 void irq_install_handler(int vec, interrupt_handler_t * handler, void *arg)
 {
 	/*
@@ -263,51 +177,19 @@ void irq_install_handler(int vec, interrupt_handler_t * handler, void *arg)
 	irq_vecs[vec].handler = handler;
 	irq_vecs[vec].arg = arg;
 
-	if ((vec >= 0) && (vec < 32))
-		mtdcr(uicer, mfdcr(uicer) | UIC_MASK(vec));
-#if (UIC_MAX > 1)
-	else if ((vec >= 32) && (vec < 64))
-		mtdcr(uic1er, mfdcr(uic1er) | UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 2)
-	else if ((vec >= 64) && (vec < 96))
-		mtdcr(uic2er, mfdcr(uic2er) | UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 3)
-	else if (vec >= 96)
-		mtdcr(uic3er, mfdcr(uic3er) | UIC_MASK(vec));
-#endif
-
-	debug("Install interrupt for vector %d ==> %p\n", vec, handler);
+	pic_irq_enable(vec);
+	return;
 }
 
-void irq_free_handler (int vec)
+void irq_free_handler(int vec)
 {
 	debug("Free interrupt for vector %d ==> %p\n",
 	      vec, irq_vecs[vec].handler);
 
-	if ((vec >= 0) && (vec < 32))
-		mtdcr(uicer, mfdcr(uicer) & ~UIC_MASK(vec));
-#if (UIC_MAX > 1)
-	else if ((vec >= 32) && (vec < 64))
-		mtdcr(uic1er, mfdcr(uic1er) & ~UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 2)
-	else if ((vec >= 64) && (vec < 96))
-		mtdcr(uic2er, mfdcr(uic2er) & ~UIC_MASK(vec));
-#endif
-#if (UIC_MAX > 3)
-	else if (vec >= 96)
-		mtdcr(uic3er, mfdcr(uic3er) & ~UIC_MASK(vec));
-#endif
+	pic_irq_disable(vec);
 
 	irq_vecs[vec].handler = NULL;
 	irq_vecs[vec].arg = NULL;
-}
-
-void timer_interrupt_cpu (struct pt_regs *regs)
-{
-	/* nothing to do here */
 	return;
 }
 
@@ -319,7 +201,7 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	printf ("Interrupt-Information:\n");
 	printf ("Nr  Routine   Arg       Count\n");
 
-	for (vec = 0; vec < (UIC_MAX * 32); vec++) {
+	for (vec = 0; vec < IRQ_MAX; vec++) {
 		if (irq_vecs[vec].handler != NULL) {
 			printf ("%02d  %08lx  %08lx  %d\n",
 				vec,
diff --git a/cpu/ppc4xx/speed.c b/cpu/ppc4xx/speed.c
index b86b6de..d21bd82 100644
--- a/cpu/ppc4xx/speed.c
+++ b/cpu/ppc4xx/speed.c
@@ -416,7 +416,8 @@ ulong get_PCI_freq (void)
 	return sys_info.freqPCI;
 }
 
-#elif !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && !defined(CONFIG_440SPE)
+#elif !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && !defined(CONFIG_440SPE) \
+	&& !defined(CONFIG_XILINX_440)
 void get_sys_info (sys_info_t * sysInfo)
 {
 	unsigned long strp0;
@@ -449,6 +450,8 @@ void get_sys_info (sys_info_t * sysInfo)
 	sysInfo->freqUART = sysInfo->freqPLB;
 }
 #else
+
+#if !defined(CONFIG_XILINX_440)
 void get_sys_info (sys_info_t * sysInfo)
 {
 	unsigned long strp0;
@@ -535,6 +538,7 @@ void get_sys_info (sys_info_t * sysInfo)
 }
 
 #endif
+#endif /* CONFIG_XILINX_440 */
 
 #if defined(CONFIG_YUCCA)
 unsigned long determine_sysper(void)
diff --git a/cpu/ppc4xx/uic.c b/cpu/ppc4xx/uic.c
new file mode 100644
index 0000000..fbf0c2b
--- /dev/null
+++ b/cpu/ppc4xx/uic.c
@@ -0,0 +1,209 @@
+/*
+ * (C) Copyright 2000-2002
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ *
+ * (C) Copyright 2002 (440 port)
+ * Scott McNutt, Artesyn Communication Producs, smcnutt at artsyncp.com
+ *
+ * (C) Copyright 2003 (440GX port)
+ * Travis B. Sawyer, Sandburst Corporation, tsawyer at sandburst.com
+ *
+ * (C) Copyright 2008 (PPC440X05 port for Virtex 5 FX)
+ * Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * Work supported by Qtechnology (htpp://qtec.com)
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <watchdog.h>
+#include <command.h>
+#include <asm/processor.h>
+#include <asm/interrupt.h>
+#include <ppc4xx.h>
+#include <ppc_asm.tmpl>
+#include <commproc.h>
+
+#if (UIC_MAX > 3)
+#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
+			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI) | \
+			 UIC_MASK(VECNUM_UIC3CI) | UIC_MASK(VECNUM_UIC3NCI))
+#elif (UIC_MAX > 2)
+#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI) | \
+			 UIC_MASK(VECNUM_UIC2CI) | UIC_MASK(VECNUM_UIC2NCI))
+#elif (UIC_MAX > 1)
+#define UICB0_ALL	(UIC_MASK(VECNUM_UIC1CI) | UIC_MASK(VECNUM_UIC1NCI))
+#else
+#define UICB0_ALL	0
+#endif
+
+u32 get_dcr(u16);
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void pic_enable(void)
+{
+
+#if (UIC_MAX > 1)
+	/* Install the UIC1 handlers */
+	irq_install_handler(VECNUM_UIC1NCI, (void *)(void *)external_interrupt,
+			    0);
+	irq_install_handler(VECNUM_UIC1CI, (void *)(void *)external_interrupt,
+			    0);
+#endif
+#if (UIC_MAX > 2)
+	irq_install_handler(VECNUM_UIC2NCI, (void *)(void *)external_interrupt,
+			    0);
+	irq_install_handler(VECNUM_UIC2CI, (void *)(void *)external_interrupt,
+			    0);
+#endif
+#if (UIC_MAX > 3)
+	irq_install_handler(VECNUM_UIC3NCI, (void *)(void *)external_interrupt,
+			    0);
+	irq_install_handler(VECNUM_UIC3CI, (void *)(void *)external_interrupt,
+			    0);
+#endif
+
+}
+
+/* Handler for UIC interrupt */
+static void uic_interrupt(u32 uic_base, int vec_base)
+{
+	u32 uic_msr;
+	u32 msr_shift;
+	int vec;
+
+	/*
+	 * Read masked interrupt status register to determine interrupt source
+	 */
+	uic_msr = get_dcr(uic_base + UIC_MSR);
+	msr_shift = uic_msr;
+	vec = vec_base;
+
+	while (msr_shift != 0) {
+		if (msr_shift & 0x80000000)
+			interrupt_run_handler(vec);
+		/*
+		 * Shift msr to next position and increment vector
+		 */
+		msr_shift <<= 1;
+		vec++;
+	}
+}
+
+/*
+ * Handle external interrupts
+ */
+void external_interrupt(struct pt_regs *regs)
+{
+	u32 uic_msr;
+
+	/*
+	 * Read masked interrupt status register to determine interrupt source
+	 */
+	uic_msr = mfdcr(uic0msr);
+
+#if (UIC_MAX > 1)
+	if ((UIC_MASK(VECNUM_UIC1CI) & uic_msr) ||
+	    (UIC_MASK(VECNUM_UIC1NCI) & uic_msr))
+		uic_interrupt(UIC1_DCR_BASE, 32);
+#endif
+
+#if (UIC_MAX > 2)
+	if ((UIC_MASK(VECNUM_UIC2CI) & uic_msr) ||
+	    (UIC_MASK(VECNUM_UIC2NCI) & uic_msr))
+		uic_interrupt(UIC2_DCR_BASE, 64);
+#endif
+
+#if (UIC_MAX > 3)
+	if ((UIC_MASK(VECNUM_UIC3CI) & uic_msr) ||
+	    (UIC_MASK(VECNUM_UIC3NCI) & uic_msr))
+		uic_interrupt(UIC3_DCR_BASE, 96);
+#endif
+
+	if (uic_msr & ~(UICB0_ALL))
+		uic_interrupt(UIC0_DCR_BASE, 0);
+
+	mtdcr(uic0sr, uic_msr);
+
+	return;
+}
+
+void pic_irq_ack(unsigned int vec)
+{
+
+	if ((vec >= 0) && (vec < 32))
+		mtdcr(uicsr, UIC_MASK(vec));
+#if (UIC_MAX > 1)
+	else if ((vec >= 32) && (vec < 64))
+		mtdcr(uic1sr, UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 2)
+	else if ((vec >= 64) && (vec < 96))
+		mtdcr(uic2sr, UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 3)
+	else if (vec >= 96)
+		mtdcr(uic3sr, UIC_MASK(vec));
+#endif
+}
+
+/*
+ * Install and free a interrupt handler.
+ */
+void pic_irq_enable(unsigned int vec)
+{
+
+	if ((vec >= 0) && (vec < 32))
+		mtdcr(uicer, mfdcr(uicer) | UIC_MASK(vec));
+#if (UIC_MAX > 1)
+	else if ((vec >= 32) && (vec < 64))
+		mtdcr(uic1er, mfdcr(uic1er) | UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 2)
+	else if ((vec >= 64) && (vec < 96))
+		mtdcr(uic2er, mfdcr(uic2er) | UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 3)
+	else if (vec >= 96)
+		mtdcr(uic3er, mfdcr(uic3er) | UIC_MASK(vec));
+#endif
+
+	debug("Install interrupt for vector %d ==> %p\n", vec, handler);
+}
+
+void pic_irq_disable(unsigned int vec)
+{
+
+	if ((vec >= 0) && (vec < 32))
+		mtdcr(uicer, mfdcr(uicer) & ~UIC_MASK(vec));
+#if (UIC_MAX > 1)
+	else if ((vec >= 32) && (vec < 64))
+		mtdcr(uic1er, mfdcr(uic1er) & ~UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 2)
+	else if ((vec >= 64) && (vec < 96))
+		mtdcr(uic2er, mfdcr(uic2er) & ~UIC_MASK(vec));
+#endif
+#if (UIC_MAX > 3)
+	else if (vec >= 96)
+		mtdcr(uic3er, mfdcr(uic3er) & ~UIC_MASK(vec));
+#endif
+
+}
diff --git a/cpu/ppc4xx/xilinx_irq.c b/cpu/ppc4xx/xilinx_irq.c
new file mode 100644
index 0000000..7108777
--- /dev/null
+++ b/cpu/ppc4xx/xilinx_irq.c
@@ -0,0 +1,100 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * This work has been supported by: QTechnology  http://qtec.com/
+ * Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd at denx.de
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+#include <common.h>
+#include <watchdog.h>
+#include <command.h>
+#include <asm/processor.h>
+#include <asm/interrupt.h>
+#include <ppc4xx.h>
+#include <ppc_asm.tmpl>
+#include <commproc.h>
+#include <asm/io.h>
+#include <asm/xilinx_irq.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void pic_enable(void)
+{
+	debug("Xilinx PIC at 0x%8x\n", intc);
+
+	/*
+	 * Disable all external interrupts until they are
+	 * explicitly requested.
+	 */
+	out_be32((u32 *) IER, 0);
+
+	/* Acknowledge any pending interrupts just in case. */
+	out_be32((u32 *) IAR, 0xffffffff);
+
+	/* Turn on the Master Enable. */
+	out_be32((u32 *) MER, 0x3UL);
+
+	return;
+}
+
+int xilinx_pic_irq_get(void)
+{
+	u32 irq;
+	irq = in_be32((u32 *) IVR);
+
+	/* If no interrupt is pending then all bits of the IVR are set to 1. As
+	 * the IVR is as many bits wide as numbers of inputs are available.
+	 * Therefore, if all bits of the IVR are set to one, its content will
+	 * be bigger than XPAR_INTC_MAX_NUM_INTR_INPUTS.
+	 */
+	if (irq >= XPAR_INTC_MAX_NUM_INTR_INPUTS)
+		irq = -1;	/* report no pending interrupt. */
+
+	debug("get_irq: %d\n", irq);
+	return (irq);
+}
+
+void pic_irq_enable(unsigned int irq)
+{
+	u32 mask = IRQ_MASK(irq);
+	debug("enable: %d\n", irq);
+	out_be32((u32 *) SIE, mask);
+}
+
+void pic_irq_disable(unsigned int irq)
+{
+	u32 mask = IRQ_MASK(irq);
+	debug("disable: %d\n", irq);
+	out_be32((u32 *) CIE, mask);
+}
+
+void pic_irq_ack(unsigned int irq)
+{
+	u32 mask = IRQ_MASK(irq);
+	debug("ack: %d\n", irq);
+	out_be32((u32 *) IAR, mask);
+}
+
+void external_interrupt(struct pt_regs *regs)
+{
+	int irq;
+
+	irq = xilinx_pic_irq_get();
+	if (irq < 0)
+		return;
+
+	interrupt_run_handler(irq);
+
+	return;
+}
diff --git a/include/asm-ppc/interrupt.h b/include/asm-ppc/interrupt.h
new file mode 100644
index 0000000..792836b
--- /dev/null
+++ b/include/asm-ppc/interrupt.h
@@ -0,0 +1,36 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * This work has been supported by: QTechnology  http://qtec.com/
+ * Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd@denx.de
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+#ifndef INTERRUPT_H
+#define INTERRUPT_H
+
+#if defined(CONFIG_XILINX_440)
+#include <asm/xilinx_irq.h>
+#else
+#include <asm/ppc4xx-uic.h>
+#endif
+
+void pic_enable(void);
+void pic_irq_enable(unsigned int irq);
+void pic_irq_disable(unsigned int irq);
+void pic_irq_ack(unsigned int irq);
+void external_interrupt(struct pt_regs *regs);
+void interrupt_run_handler(int vec);
+
+#endif
diff --git a/include/asm-ppc/ppc4xx-uic.h b/include/asm-ppc/ppc4xx-uic.h
index d50c363..c908d42 100644
--- a/include/asm-ppc/ppc4xx-uic.h
+++ b/include/asm-ppc/ppc4xx-uic.h
@@ -43,6 +43,8 @@
 #define UIC_MAX		1
 #endif
 
+#define IRQ_MAX UIC_MAX * 32
+
 /*
  * UIC register
  */
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index 6e134c3..5501244 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -839,6 +839,8 @@
 #define PVR_86xx	0x80040000
 #define PVR_86xx_REV1	(PVR_86xx | 0x0010)
 
+#define PVR_VIRTEX5     0x7ff21912
+
 /*
  * For the 8xx processors, all of them report the same PVR family for
  * the PowerPC core. The various versions of these processors must be
diff --git a/include/asm-ppc/xilinx_irq.h b/include/asm-ppc/xilinx_irq.h
new file mode 100644
index 0000000..ddccc75
--- /dev/null
+++ b/include/asm-ppc/xilinx_irq.h
@@ -0,0 +1,36 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * This work has been supported by: QTechnology  http://qtec.com/
+ * Based on interrupts.c Wolfgang Denk-DENX Software Engineering-wd at denx.de
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+#ifndef XILINX_IRQ_H
+#define XILINX_IRQ_H
+
+#define intc XPAR_INTC_0_BASEADDR
+#define ISR (intc+(0*4))	/* Interrupt Status Register */
+#define IPR (intc+(1*4))	/* Interrupt Pending Register */
+#define IER (intc+(2*4))	/* Interrupt Enable Register */
+#define IAR (intc+(3*4))	/* Interrupt Acknowledge Register */
+#define SIE (intc+(4*4))	/* Set Interrupt Enable bits */
+#define CIE (intc+(5*4))	/* Clear Interrupt Enable bits */
+#define IVR (intc+(6*4))	/* Interrupt Vector Register */
+#define MER (intc+(7*4))	/* Master Enable Register */
+
+#define IRQ_MASK(irq) (1<<(irq&0x1f))
+
+#define IRQ_MAX XPAR_INTC_MAX_NUM_INTR_INPUTS
+
+#endif
diff --git a/include/ppc4xx.h b/include/ppc4xx.h
index d593b07..5a6b855 100644
--- a/include/ppc4xx.h
+++ b/include/ppc4xx.h
@@ -54,7 +54,9 @@
 
 #include <asm/ppc4xx-sdram.h>
 #include <asm/ppc4xx-ebc.h>
+#if !defined(CONFIG_XILINX_440)
 #include <asm/ppc4xx-uic.h>
+#endif
 
 /*
  * Macro for generating register field mnemonics
-- 
1.5.6.2

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support
  2008-07-17  7:21     ` Michal Simek
@ 2008-07-17 10:30       ` Ricardo Ribalda Delgado
  2008-07-17 10:47       ` [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support (Resubmit) Ricardo Ribalda Delgado
  1 sibling, 0 replies; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-17 10:30 UTC (permalink / raw)
  To: u-boot

Hi Michal

   Thanks for your comments.
   I am with you in all off them, expect for the xparameters.h. It is
completely different to the generated file by edk. I am just using
their naming and they don't have the copyright of that names.  Why I
have use their names? It is very convenient for the final user. He
will just have to replace the xparameters.h file with the generated
file by edk.


   Best regards

On Thu, Jul 17, 2008 at 9:21 AM, Michal Simek <monstr@seznam.cz> wrote:
>> Added Flash Support
>>
>> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
>> ---
>>  CREDITS                          |    5 ++
>>  MAINTAINERS                      |    4 +
>>  MAKEALL                          |    1 +
>>  Makefile                         |    3 +
>>  board/xilinx/ml507/Makefile      |   58 +++++++++++++++++
>>  board/xilinx/ml507/config.mk     |   24 +++++++
>>  board/xilinx/ml507/init.S        |   47 ++++++++++++++
>>  board/xilinx/ml507/ml507.c       |   46 +++++++++++++
>>  board/xilinx/ml507/u-boot.lds    |  130 ++++++++++++++++++++++++++++++++++++++
>>  board/xilinx/ml507/xparameters.h |   35 ++++++++++
>>  include/configs/ml507.h          |  116 +++++++++++++++++++++++++++++++++
>>  11 files changed, 469 insertions(+), 0 deletions(-)
>>  create mode 100644 board/xilinx/ml507/Makefile
>>  create mode 100644 board/xilinx/ml507/config.mk
>>  create mode 100644 board/xilinx/ml507/init.S
>>  create mode 100644 board/xilinx/ml507/ml507.c
>>  create mode 100644 board/xilinx/ml507/u-boot.lds
>>  create mode 100644 board/xilinx/ml507/xparameters.h
>>  create mode 100644 include/configs/ml507.h
>>
>> diff --git a/CREDITS b/CREDITS
>> index 3b6e57d..06e78bf 100644
>> --- a/CREDITS
>> +++ b/CREDITS
>> @@ -399,6 +399,11 @@ N: Stelian Pop
>>  E: stelian.pop at leadtechdesign.com
>>  D: Atmel AT91CAP9ADK support
>>
>> +N: Ricardo Ribalda Delgado
>> +E: ricardo.ribalda at uam.es
>> +D: PPC440x5 (Virtex5), ML507 Board, eeprom_simul, adt7460
>> +W: http://www.ii.uam.es/~rribalda
>> +
>>  N: Stefan Roese
>>  E: sr at denx.de
>>  D: AMCC PPC4xx Support
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index b667c8e..75b5b02 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -311,6 +311,10 @@ Daniel Poirot <dan.poirot@windriver.com>
>>       sbc8240         MPC8240
>>       sbc405          PPC405GP
>>
>> +Ricardo Ribalda <ricardo.ribalda@uam.es>
>> +
>> +     ml507           PPC440x5
>> +
>>  Stefan Roese <sr@denx.de>
>>
>>       P3M7448         MPC7448
>> diff --git a/MAKEALL b/MAKEALL
>> index a256e9a..5463a58 100755
>> --- a/MAKEALL
>> +++ b/MAKEALL
>> @@ -239,6 +239,7 @@ LIST_4xx="                \
>>       yosemite        \
>>       yucca           \
>>       zeus            \
>> +     ml507           \
>>  "
>
> keep list sorted
>
>>  #########################################################################
>> diff --git a/Makefile b/Makefile
>> index 10a3e06..40029e6 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1336,6 +1336,9 @@ ML2_config:     unconfig
>>  ml300_config:        unconfig
>>       @$(MKCONFIG) $(@:_config=) ppc ppc4xx ml300 xilinx
>>
>> +ml507_config:        unconfig
>> +     @$(MKCONFIG) $(@:_config=) ppc ppc4xx ml507 xilinx
>> +
>>  ocotea_config:       unconfig
>>       @$(MKCONFIG) $(@:_config=) ppc ppc4xx ocotea amcc
>>
>> diff --git a/board/xilinx/ml507/Makefile b/board/xilinx/ml507/Makefile
>> new file mode 100644
>> index 0000000..b9bd737
>> --- /dev/null
>> +++ b/board/xilinx/ml507/Makefile
>> @@ -0,0 +1,58 @@
>> +#
>> +# (C) Copyright 2000-2006
>> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
>> +#
>> +# See file CREDITS for list of people who contributed to this
>> +# project.
>> +#
>> +# This program is free software; you can redistribute it and/or
>> +# modify it under the terms of the GNU General Public License as
>> +# published by the Free Software Foundation; either version 2 of
>> +# the License, or (at your option) any later version.
>> +#
>> +# This program is distributed in the hope that it will be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> +# GNU General Public License for more details.
>> +#
>> +# You should have received a copy of the GNU General Public License
>> +# along with this program; if not, write to the Free Software
>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
>> +# MA 02111-1307 USA
>> +#
>> +
>> +include $(TOPDIR)/config.mk
>> +ifneq ($(OBJTREE),$(SRCTREE))
>> +endif
>> +
>> +INCS         :=
>> +CFLAGS               += $(INCS)
>> +HOST_CFLAGS  += $(INCS)
>> +
>> +LIB  = $(obj)lib$(BOARD).a
>> +
>> +COBJS        = $(BOARD).o \
>
> why is back-slash here?
>
>> +SOBJS        = init.o
>> +
>> +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
>> +OBJS := $(addprefix $(obj),$(COBJS))
>> +SOBJS        := $(addprefix $(obj),$(SOBJS))
>> +
>> +$(LIB):      $(OBJS) $(SOBJS)
>> +     $(AR) $(ARFLAGS) $@ $^
>> +
>> +clean:
>> +     rm -f $(SOBJS) $(OBJS)
>> +
>> +distclean:   clean
>> +     rm -f $(LIB) core *.bak .depend
>> +
>> +#########################################################################
>> +
>> +# defines $(obj).depend target
>> +include $(SRCTREE)/rules.mk
>> +
>> +sinclude $(obj).depend
>> +
>> +#########################################################################
>> diff --git a/board/xilinx/ml507/config.mk b/board/xilinx/ml507/config.mk
>> new file mode 100644
>> index 0000000..35c52ad
>> --- /dev/null
>> +++ b/board/xilinx/ml507/config.mk
>> @@ -0,0 +1,24 @@
>> +#
>> +# (C) Copyright 2000
>> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
>> +#
>> +# See file CREDITS for list of people who contributed to this
>> +# project.
>> +#
>> +# This program is free software; you can redistribute it and/or
>> +# modify it under the terms of the GNU General Public License as
>> +# published by the Free Software Foundation; either version 2 of
>> +# the License, or (at your option) any later version.
>> +#
>> +# This program is distributed in the hope that it will be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> +# GNU General Public License for more details.
>> +#
>> +# You should have received a copy of the GNU General Public License
>> +# along with this program; if not, write to the Free Software
>> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
>> +# MA 02111-1307 USA
>> +#
>> +
>> +TEXT_BASE = 0x04000000
>> diff --git a/board/xilinx/ml507/init.S b/board/xilinx/ml507/init.S
>> new file mode 100644
>> index 0000000..6510646
>> --- /dev/null
>> +++ b/board/xilinx/ml507/init.S
>> @@ -0,0 +1,47 @@
>> +/*
>> + *  (C) Copyright 2008
>> + *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
>> + *  This work has been supported by: QTechnology  http://qtec.com/
>> + *
>> + *  This program is free software: you can redistribute it and/or modify
>> + *  it under the terms of the GNU General Public License as published by
>> + *  the Free Software Foundation, either version 2 of the License, or
>> + *  (at your option) any later version.
>> + *
>> + *  This program is distributed in the hope that it will be useful,
>> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + *  GNU General Public License for more details.
>> + *
>> + *  You should have received a copy of the GNU General Public License
>> + *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
>> +*/
>> +
>> +#include <ppc_asm.tmpl>
>> +#include <config.h>
>> +#include <asm-ppc/mmu.h>
>> +
>> +.section .bootpg,"ax"
>> +.globl tlbtab
>> +
>> +tlbtab:
>> +tlbtab_start
>> +     /* SDRAM */
>> +tlbentry(XPAR_DDR2_SDRAM_MEM_BASEADDR, SZ_256M, CFG_SDRAM_BASE, 0,
>> +      AC_R | AC_W | AC_X | SA_G | SA_I)
>
> you have "\t\ " here
>
>> +     /* UART */
>> +tlbentry(XPAR_UARTLITE_0_BASEADDR, SZ_64K, XPAR_UARTLITE_0_BASEADDR, 0,
>> +      AC_R | AC_W | SA_G | SA_I)
>> +     /* PIC */
>> +tlbentry(XPAR_INTC_0_BASEADDR, SZ_64K, XPAR_INTC_0_BASEADDR, 0,
>> +      AC_R | AC_W | SA_G | SA_I)
>> +     /* I2C */
>> +tlbentry(XPAR_IIC_EEPROM_BASEADDR, SZ_64K, XPAR_IIC_EEPROM_BASEADDR, 0,
>> +      AC_R | AC_W | SA_G | SA_I)
>> +     /* Net */
>> +tlbentry(XPAR_LLTEMAC_0_BASEADDR, SZ_64K, XPAR_LLTEMAC_0_BASEADDR, 0,
>> +      AC_R | AC_W | SA_G | SA_I)
>> +     /*Flash*/
>> +tlbentry(XPAR_FLASH_MEM0_BASEADDR, SZ_256M, XPAR_FLASH_MEM0_BASEADDR, 0,
>> +      AC_R | AC_W | SA_G | SA_I)
>> +tlbtab_end
>> diff --git a/board/xilinx/ml507/ml507.c b/board/xilinx/ml507/ml507.c
>> new file mode 100644
>> index 0000000..6d78dd6
>> --- /dev/null
>> +++ b/board/xilinx/ml507/ml507.c
>> @@ -0,0 +1,46 @@
>> +/*
>> + * (C) Copyright 2008
>> + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
>> + * This work has been supported by: QTechnology  http://qtec.com/
>> + * This program is free software: you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation, either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>> +*/
>> +
>> +#include <config.h>
>> +#include <common.h>
>> +#include <asm/processor.h>
>> +
>> +int board_pre_init(void)
>> +{
>> +     return 0;
>> +}
>> +
>> +int checkboard(void)
>> +{
>> +     puts ("ML507 Board\n");
>> +     return 0;
>> +}
>> +
>> +phys_size_t initdram(int board_type)
>> +{
>> +     return 256 * 1024 * 1024;
>> +}
>
> the same as SR.
>
>> +void get_sys_info(sys_info_t * sysInfo)
>> +{
>> +     sysInfo->freqProcessor = XPAR_CORE_CLOCK_FREQ_HZ;
>> +     sysInfo->freqPLB = XPAR_PLB_CLOCK_FREQ_HZ;
>> +     sysInfo->freqPCI = 0;
>> +
>> +     return;
>> +}
>> diff --git a/board/xilinx/ml507/u-boot.lds b/board/xilinx/ml507/u-boot.lds
>> new file mode 100644
>> index 0000000..ef2bdc3
>> --- /dev/null
>> +++ b/board/xilinx/ml507/u-boot.lds
>> @@ -0,0 +1,130 @@
>> +/*
>> + * (C) Copyright 2000
>> + * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
>> + * 2008:
>> + * Modified by: Ricardo Ribalda Delgado ricardo.ribalda at uam.es
>> + *
>> + * See file CREDITS for list of people who contributed to this
>> + * project.
>> + *
>> + * This program is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU General Public License as
>> + * published by the Free Software Foundation; either version 2 of
>> + * the License, or (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program; if not, write to the Free Software
>> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
>> + * MA 02111-1307 USA
>> + */
>> +
>> +OUTPUT_ARCH(powerpc)
>> +ENTRY(_start_440)
>> +/* Do we need any of these for elf?
>> +   __DYNAMIC = 0;    */
>> +SECTIONS
>> +{
>> +  /* Read-only sections, merged into text segment: */
>> +  . = + SIZEOF_HEADERS;
>> +  .interp : { *(.interp) }
>> +  .hash          : { *(.hash)                }
>> +  .dynsym        : { *(.dynsym)              }
>> +  .dynstr        : { *(.dynstr)              }
>> +  .rel.text      : { *(.rel.text)            }
>> +  .rela.text     : { *(.rela.text)   }
>> +  .rel.data      : { *(.rel.data)            }
>> +  .rela.data     : { *(.rela.data)   }
>> +  .rel.rodata    : { *(.rel.rodata)  }
>> +  .rela.rodata   : { *(.rela.rodata) }
>> +  .rel.got       : { *(.rel.got)             }
>> +  .rela.got      : { *(.rela.got)            }
>> +  .rel.ctors     : { *(.rel.ctors)   }
>> +  .rela.ctors    : { *(.rela.ctors)  }
>> +  .rel.dtors     : { *(.rel.dtors)   }
>> +  .rela.dtors    : { *(.rela.dtors)  }
>> +  .rel.bss       : { *(.rel.bss)             }
>> +  .rela.bss      : { *(.rela.bss)            }
>> +  .rel.plt       : { *(.rel.plt)             }
>> +  .rela.plt      : { *(.rela.plt)            }
>> +  .init          : { *(.init)        }
>> +  .plt : { *(.plt) }
>> +  .text      :
>> +  {
>> +    *(.text)
>> +    *(.fixup)
>> +    *(.got1)
>> +  }
>> +  _etext = .;
>> +  PROVIDE (etext = .);
>> +  .rodata    :
>> +  {
>> +    *(.rodata)
>> +    *(.rodata1)
>> +    *(.rodata.str1.4)
>> +    *(.eh_frame)
>> +  }
>> +  .fini      : { *(.fini)    } =0
>> +  .ctors     : { *(.ctors)   }
>> +  .dtors     : { *(.dtors)   }
>> +
>> +  /* Read-write section, merged into data segment: */
>> +  . = (. + 0x00FF) & 0xFFFFFF00;
>> +  _erotext = .;
>> +  PROVIDE (erotext = .);
>> +  .reloc   :
>> +  {
>> +    *(.got)
>> +    _GOT2_TABLE_ = .;
>> +    *(.got2)
>> +    _FIXUP_TABLE_ = .;
>> +    *(.fixup)
>> +  }
>> +  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
>> +  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
>> +
>> +  .data    :
>> +  {
>> +    *(.data)
>> +    *(.data1)
>> +    *(.sdata)
>> +    *(.sdata2)
>> +    *(.dynamic)
>> +    CONSTRUCTORS
>> +  }
>> +  _edata  =  .;
>> +  PROVIDE (edata = .);
>> +
>> +  . = .;
>> +  __u_boot_cmd_start = .;
>> +  .u_boot_cmd : { *(.u_boot_cmd) }
>> +  __u_boot_cmd_end = .;
>> +
>> +
>> +  . = .;
>> +  __start___ex_table = .;
>> +  __ex_table : { *(__ex_table) }
>> +  __stop___ex_table = .;
>> +
>> +  . = ALIGN(256);
>> +  __init_begin = .;
>> +  .text.init : { *(.text.init) }
>> +  .data.init : { *(.data.init) }
>> +  . = ALIGN(256);
>> +  __init_end = .;
>> +
>> +  __bss_start = .;
>> +  .bss (NOLOAD)       :
>> +  {
>> +   *(.sbss) *(.scommon)
>> +   *(.dynbss)
>> +   *(.bss)
>> +   *(COMMON)
>> +  }
>> +  _end = . ;
>> +  PROVIDE (end = .);
>> +}
>> diff --git a/board/xilinx/ml507/xparameters.h b/board/xilinx/ml507/xparameters.h
>> new file mode 100644
>> index 0000000..8d938f9
>> --- /dev/null
>> +++ b/board/xilinx/ml507/xparameters.h
>> @@ -0,0 +1,35 @@
>> +/*
>> + * (C) Copyright 2008
>> + * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
>> + * This work has been supported by: QTechnology  http://qtec.com/
>> + * based on xparameters-ml507.h by Xilinx
>> + *
>> + * This program is free software: you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation, either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>> +*/
>
> I am not lawyer but IMHO you can't change license from generated file. You can
> add your copyright.
>
>> +#ifndef XPARAMETER_H
>> +#define XPARAMETER_H
>> +
>> +#define XPAR_DDR2_SDRAM_MEM_BASEADDR         0x00000000
>> +#define XPAR_INTC_0_BASEADDR                 0x81800000
>> +#define XPAR_UARTLITE_0_BASEADDR     0x84000000
>> +#define XPAR_RS232_UART_1_BASEADDR   0x84000000
>> +#define XPAR_IIC_EEPROM_BASEADDR     0x81600000
>> +#define XPAR_LLTEMAC_0_BASEADDR      0x81c00000
>> +#define XPAR_FLASH_MEM0_BASEADDR     0xFC000000
>> +#define XPAR_PLB_CLOCK_FREQ_HZ               100000000
>> +#define XPAR_CORE_CLOCK_FREQ_HZ      400000000
>> +#define XPAR_INTC_MAX_NUM_INTR_INPUTS        13
>> +
>> +#endif
>> diff --git a/include/configs/ml507.h b/include/configs/ml507.h
>> new file mode 100644
>> index 0000000..293ae65
>> --- /dev/null
>> +++ b/include/configs/ml507.h
>> @@ -0,0 +1,116 @@
>> +/*
>> + * (C) Copyright 2008
>> + *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
>> + *  This work has been supported by: QTechnology  http://qtec.com/
>> + *  This program is free software: you can redistribute it and/or modify
>> + *  it under the terms of the GNU General Public License as published by
>> + *  the Free Software Foundation, either version 2 of the License, or
>> + *  (at your option) any later version.
>> + *
>> + *  This program is distributed in the hope that it will be useful,
>> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + *  GNU General Public License for more details.
>> + *  You should have received a copy of the GNU General Public License
>> + *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
>> +*/
>> +
>> +#ifndef __CONFIG_H
>> +#define __CONFIG_H
>> +
>> +/*
>> +#define DEBUG
>> +#define ET_DEBUG
>> +*/
>> + /*CPU*/
>> +#define CONFIG_XILINX_ML507  1
>> +#define CONFIG_XILINX_440    1
>> +#define CONFIG_440           1
>> +#define CONFIG_4xx           1
>> +#include "../board/xilinx/ml507/xparameters.h"
>> +
>> +/*Mem Map*/
>> +#define CFG_SDRAM_BASE               0x0
>> +#define CFG_MONITOR_BASE     0x04000000
>> +#define CFG_MONITOR_LEN              (192*1024)
>
> better (192 * 1024) and for other defines too.
>
>
>> +#define CFG_MALLOC_LEN               (128*1024)
>> +#define CFG_ISRAM_BASE               XPAR_XPS_BRAM_IF_CNTLR_1_BASEADDR
>> +
>> +/*Uart*/
>> +#define CONFIG_XILINX_UARTLITE
>> +#define CONFIG_BAUDRATE              9600
>> +#define CFG_BAUDRATE_TABLE   {9600}
>> +#define CONFIG_SERIAL_BASE   XPAR_UARTLITE_0_BASEADDR
>> +
>> +/*Cmd*/
>> +#include <config_cmd_default.h>
>> +#define CONFIG_CMD_ASKENV
>> +#define CONFIG_CMD_CACHE
>> +#define CONFIG_CMD_DIAG
>> +#define CONFIG_CMD_ELF
>> +#define CONFIG_CMD_IRQ
>> +#define CONFIG_CMD_REGINFO
>> +#undef CONFIG_CMD_I2C
>> +#undef CONFIG_CMD_DTT
>> +#undef CONFIG_CMD_NET
>> +#undef CONFIG_CMD_PING
>> +#undef CONFIG_CMD_DHCP
>> +#undef CONFIG_CMD_EEPROM
>> +#undef CONFIG_CMD_IMLS
>> +
>> +/*Env*/
>> +#define      CFG_ENV_IS_NOWHERE
>> +#define      CFG_ENV_SIZE            0x200
>> +#define CFG_ENV_OFFSET               0x100
>> +
>> +/*Misc*/
>> +#define CONFIG_BOOTDELAY     5               /* autoboot after 5 seconds     */
>> +#define CFG_LONGHELP                         /* undef to save memory         */
>> +#define CFG_PROMPT           "board:/# "     /* Monitor Command Prompt       */
>> +#if defined(CONFIG_CMD_KGDB)
>> +#define CFG_CBSIZE           1024            /* Console I/O Buffer Size      */
>> +#else
>> +#define CFG_CBSIZE           256             /* Console I/O Buffer Size      */
>> +#endif
>> +#define CFG_PBSIZE           (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)
>> +#define CFG_MAXARGS          16              /* max number of command args   */
>> +#define CFG_BARGSIZE         CFG_CBSIZE      /* Boot Argument Buffer Size */
>> +#define CFG_MEMTEST_START    0x0400000       /* memtest works on           */
>> +#define CFG_MEMTEST_END              0x0C00000       /* 4 ... 12 MB in DRAM        */
>> +#define CFG_LOAD_ADDR                0x400000        /* default load address       */
>> +#define CFG_EXTBDINFO                1               /* To use extended board_into (bd_t) */
>
> please check 80 char on line.
>
>> +#define CFG_HZ                       1000            /* decrementer freq: 1 ms ticks */
>> +#define CONFIG_CMDLINE_EDITING                       /* add command line history     */
>> +#define CONFIG_AUTO_COMPLETE                 /* add autocompletion support   */
>> +#define CONFIG_LOOPW                         /* enable loopw command         */
>> +#define CONFIG_MX_CYCLIC                     /* enable mdc/mwc commands      */
>> +#define CONFIG_ZERO_BOOTDELAY_CHECK          /* check for keypress on bootdelay==0 */
>> +#define CONFIG_VERSION_VARIABLE                      /* include version env variable */
>> +#define CFG_CONSOLE_INFO_QUIET                       /* don't print console @ startup */
>> +#define CFG_HUSH_PARSER                              /* Use the HUSH parser          */
>> +#define      CFG_PROMPT_HUSH_PS2     "> "
>> +#define CONFIG_LOADS_ECHO                    /* echo on for serial download  */
>> +#define CFG_LOADS_BAUD_CHANGE                        /* allow baudrate change        */
>> +#define CFG_BOOTMAPSZ                (8 << 20)       /* Initial Memory map for Linux */
>> +#define CONFIG_PREBOOT               "echo U-Boot is up and runnining;"
>> +
>> +/*Stack*/
>> +#define CFG_INIT_RAM_ADDR    0x800000        /* Initial RAM address    */
>> +#define CFG_INIT_RAM_END     0x2000          /* End of used area in RAM  */
>> +#define CFG_GBL_DATA_SIZE    128             /* num bytes initial data   */
>> +#define CFG_GBL_DATA_OFFSET  (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
>> +#define CFG_INIT_SP_OFFSET   CFG_GBL_DATA_OFFSET
>> +/*Speed*/
>> +#define CONFIG_SYS_CLK_FREQ  400000000
>> +
>> +/*Flash*/
>> +#define      CFG_FLASH_BASE          XPAR_FLASH_MEM0_BASEADDR
>> +#define      CFG_FLASH_SIZE          (32*1024*1024)
>> +#define      CFG_FLASH_CFI           1
>> +#define      CFG_FLASH_CFI_DRIVER    1
>> +#define      CFG_FLASH_EMPTY_INFO    1
>> +#define      CFG_MAX_FLASH_BANKS     1
>> +#define      CFG_MAX_FLASH_SECT      128
>> +#define      CFG_FLASH_PROTECTION
>> +
>> +#endif                                               /* __CONFIG_H */
>



-- 
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support (Resubmit)
  2008-07-17  7:21     ` Michal Simek
  2008-07-17 10:30       ` Ricardo Ribalda Delgado
@ 2008-07-17 10:47       ` Ricardo Ribalda Delgado
  2008-07-18 10:34         ` Stefan Roese
  1 sibling, 1 reply; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-17 10:47 UTC (permalink / raw)
  To: u-boot

The Xilinx ML507 Board is a Virtex 5 prototyping board that includes,
	among others:
	-Virtex 5 FX FPGA (With a ppc440x5 in it)
	-256MB of SDRAM2
	-32MB of Flash
	-I2C Eeprom
	-System ACE chip
	-Serial ATA connectors
	-RS232 Level Conversors
	-Ethernet Transceiver

This patch gives support to a standard design produced by EDK for this
board: ppc440, uartlite, xilinx_int and flash

- Includes Changes propossed by Stefan Roese and Michal Simek

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
---
 CREDITS                          |    5 ++
 MAINTAINERS                      |    4 +
 MAKEALL                          |    1 +
 Makefile                         |    3 +
 board/xilinx/ml507/Makefile      |   58 +++++++++++++++++
 board/xilinx/ml507/config.mk     |   24 +++++++
 board/xilinx/ml507/init.S        |   47 ++++++++++++++
 board/xilinx/ml507/ml507.c       |   46 +++++++++++++
 board/xilinx/ml507/u-boot.lds    |  130 ++++++++++++++++++++++++++++++++++++++
 board/xilinx/ml507/xparameters.h |   34 ++++++++++
 include/configs/ml507.h          |  116 +++++++++++++++++++++++++++++++++
 11 files changed, 468 insertions(+), 0 deletions(-)
 create mode 100644 board/xilinx/ml507/Makefile
 create mode 100644 board/xilinx/ml507/config.mk
 create mode 100644 board/xilinx/ml507/init.S
 create mode 100644 board/xilinx/ml507/ml507.c
 create mode 100644 board/xilinx/ml507/u-boot.lds
 create mode 100644 board/xilinx/ml507/xparameters.h
 create mode 100644 include/configs/ml507.h

diff --git a/CREDITS b/CREDITS
index 3b6e57d..06e78bf 100644
--- a/CREDITS
+++ b/CREDITS
@@ -399,6 +399,11 @@ N: Stelian Pop
 E: stelian.pop at leadtechdesign.com
 D: Atmel AT91CAP9ADK support
 
+N: Ricardo Ribalda Delgado
+E: ricardo.ribalda at uam.es
+D: PPC440x5 (Virtex5), ML507 Board, eeprom_simul, adt7460
+W: http://www.ii.uam.es/~rribalda
+
 N: Stefan Roese
 E: sr at denx.de
 D: AMCC PPC4xx Support
diff --git a/MAINTAINERS b/MAINTAINERS
index b667c8e..75b5b02 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -311,6 +311,10 @@ Daniel Poirot <dan.poirot@windriver.com>
 	sbc8240		MPC8240
 	sbc405		PPC405GP
 
+Ricardo Ribalda <ricardo.ribalda@uam.es>
+
+	ml507 		PPC440x5
+
 Stefan Roese <sr@denx.de>
 
 	P3M7448		MPC7448
diff --git a/MAKEALL b/MAKEALL
index a256e9a..098578d 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -208,6 +208,7 @@ LIST_4xx="		\
 	MIP405T		\
 	ML2		\
 	ml300		\
+	ml507		\
 	ocotea		\
 	OCRTC		\
 	ORSG		\
diff --git a/Makefile b/Makefile
index 10a3e06..40029e6 100644
--- a/Makefile
+++ b/Makefile
@@ -1336,6 +1336,9 @@ ML2_config:	unconfig
 ml300_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ml300 xilinx
 
+ml507_config:	unconfig
+	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ml507 xilinx
+
 ocotea_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc ppc4xx ocotea amcc
 
diff --git a/board/xilinx/ml507/Makefile b/board/xilinx/ml507/Makefile
new file mode 100644
index 0000000..7283704
--- /dev/null
+++ b/board/xilinx/ml507/Makefile
@@ -0,0 +1,58 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+endif
+
+INCS		:=
+CFLAGS		+= $(INCS)
+HOST_CFLAGS	+= $(INCS)
+
+LIB	= $(obj)lib$(BOARD).a
+
+COBJS	= $(BOARD).o
+
+SOBJS	= init.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(OBJS) $(SOBJS)
+	$(AR) $(ARFLAGS) $@ $^
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/xilinx/ml507/config.mk b/board/xilinx/ml507/config.mk
new file mode 100644
index 0000000..35c52ad
--- /dev/null
+++ b/board/xilinx/ml507/config.mk
@@ -0,0 +1,24 @@
+#
+# (C) Copyright 2000
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+TEXT_BASE = 0x04000000
diff --git a/board/xilinx/ml507/init.S b/board/xilinx/ml507/init.S
new file mode 100644
index 0000000..f54d929
--- /dev/null
+++ b/board/xilinx/ml507/init.S
@@ -0,0 +1,47 @@
+/*
+ *  (C) Copyright 2008
+ *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ *  This work has been supported by: QTechnology  http://qtec.com/
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <ppc_asm.tmpl>
+#include <config.h>
+#include <asm-ppc/mmu.h>
+
+.section .bootpg,"ax"
+.globl tlbtab
+
+tlbtab:
+tlbtab_start
+	/* SDRAM */
+tlbentry(XPAR_DDR2_SDRAM_MEM_BASEADDR, SZ_256M, CFG_SDRAM_BASE, 0,
+	 AC_R | AC_W | AC_X | SA_G | SA_I)
+	/* UART */
+tlbentry(XPAR_UARTLITE_0_BASEADDR, SZ_64K, XPAR_UARTLITE_0_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+	/* PIC */
+tlbentry(XPAR_INTC_0_BASEADDR, SZ_64K, XPAR_INTC_0_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+	/* I2C */
+tlbentry(XPAR_IIC_EEPROM_BASEADDR, SZ_64K, XPAR_IIC_EEPROM_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+	/* Net */
+tlbentry(XPAR_LLTEMAC_0_BASEADDR, SZ_64K, XPAR_LLTEMAC_0_BASEADDR, 0,
+	 AC_R | AC_W | SA_G | SA_I)
+	/*Flash*/
+tlbentry(XPAR_FLASH_MEM0_BASEADDR, SZ_256M, XPAR_FLASH_MEM0_BASEADDR, 0,
+	AC_R | AC_W | SA_G | SA_I)
+tlbtab_end
diff --git a/board/xilinx/ml507/ml507.c b/board/xilinx/ml507/ml507.c
new file mode 100644
index 0000000..e95d2af
--- /dev/null
+++ b/board/xilinx/ml507/ml507.c
@@ -0,0 +1,46 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * This work has been supported by: QTechnology  http://qtec.com/
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <config.h>
+#include <common.h>
+#include <asm/processor.h>
+
+int board_pre_init(void)
+{
+	return 0;
+}
+
+int checkboard(void)
+{
+	puts ("ML507 Board\n");
+	return 0;
+}
+
+phys_size_t initdram(int board_type)
+{
+	return CFG_SDRAM_SIZE_MB * 1024 * 1024;
+}
+
+void get_sys_info(sys_info_t * sysInfo)
+{
+	sysInfo->freqProcessor = XPAR_CORE_CLOCK_FREQ_HZ;
+	sysInfo->freqPLB = XPAR_PLB_CLOCK_FREQ_HZ;
+	sysInfo->freqPCI = 0;
+
+	return;
+}
diff --git a/board/xilinx/ml507/u-boot.lds b/board/xilinx/ml507/u-boot.lds
new file mode 100644
index 0000000..ef2bdc3
--- /dev/null
+++ b/board/xilinx/ml507/u-boot.lds
@@ -0,0 +1,130 @@
+/*
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ * 2008:
+ * Modified by: Ricardo Ribalda Delgado ricardo.ribalda at uam.es
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_ARCH(powerpc)
+ENTRY(_start_440)
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)		}
+  .dynsym        : { *(.dynsym)		}
+  .dynstr        : { *(.dynstr)		}
+  .rel.text      : { *(.rel.text)		}
+  .rela.text     : { *(.rela.text)	}
+  .rel.data      : { *(.rel.data)		}
+  .rela.data     : { *(.rela.data)	}
+  .rel.rodata    : { *(.rel.rodata)	}
+  .rela.rodata   : { *(.rela.rodata)	}
+  .rel.got       : { *(.rel.got)		}
+  .rela.got      : { *(.rela.got)		}
+  .rel.ctors     : { *(.rel.ctors)	}
+  .rela.ctors    : { *(.rela.ctors)	}
+  .rel.dtors     : { *(.rel.dtors)	}
+  .rela.dtors    : { *(.rela.dtors)	}
+  .rel.bss       : { *(.rel.bss)		}
+  .rela.bss      : { *(.rela.bss)		}
+  .rel.plt       : { *(.rel.plt)		}
+  .rela.plt      : { *(.rela.plt)		}
+  .init          : { *(.init)	}
+  .plt : { *(.plt) }
+  .text      :
+  {
+    *(.text)
+    *(.fixup)
+    *(.got1)
+  }
+  _etext = .;
+  PROVIDE (etext = .);
+  .rodata    :
+  {
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+    *(.eh_frame)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x00FF) & 0xFFFFFF00;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(256);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(256);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss (NOLOAD)       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
diff --git a/board/xilinx/ml507/xparameters.h b/board/xilinx/ml507/xparameters.h
new file mode 100644
index 0000000..1542e84
--- /dev/null
+++ b/board/xilinx/ml507/xparameters.h
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2008
+ * Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ * This work has been supported by: QTechnology  http://qtec.com/
+ * based on xparameters-ml507.h by Xilinx
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef XPARAMETER_H
+#define XPARAMETER_H
+
+#define XPAR_DDR2_SDRAM_MEM_BASEADDR 	0x00000000
+#define XPAR_INTC_0_BASEADDR 		0x81800000
+#define XPAR_UARTLITE_0_BASEADDR 	0x84000000
+#define XPAR_IIC_EEPROM_BASEADDR 	0x81600000
+#define XPAR_LLTEMAC_0_BASEADDR 	0x81c00000
+#define XPAR_FLASH_MEM0_BASEADDR 	0xFC000000
+#define XPAR_PLB_CLOCK_FREQ_HZ 		100000000
+#define XPAR_CORE_CLOCK_FREQ_HZ 	400000000
+#define XPAR_INTC_MAX_NUM_INTR_INPUTS 	13
+
+#endif
diff --git a/include/configs/ml507.h b/include/configs/ml507.h
new file mode 100644
index 0000000..94518a4
--- /dev/null
+++ b/include/configs/ml507.h
@@ -0,0 +1,116 @@
+/*
+ * (C) Copyright 2008
+ *  Ricado Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda at uam.es
+ *  This work has been supported by: QTechnology  http://qtec.com/
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+/*
+#define DEBUG
+#define ET_DEBUG
+*/
+ /*CPU*/
+#define CONFIG_XILINX_ML507	1
+#define CONFIG_XILINX_440	1
+#define CONFIG_440		1
+#define CONFIG_4xx		1
+#include "../board/xilinx/ml507/xparameters.h"
+
+/*Mem Map*/
+#define CFG_SDRAM_BASE		0x0
+#define CFG_SDRAM_SIZE_MB	256
+#define CFG_MONITOR_BASE	0x04000000
+#define CFG_MONITOR_LEN		( 192 * 1024 )
+#define CFG_MALLOC_LEN		( 128 * 1024 )
+#define CFG_ISRAM_BASE		XPAR_XPS_BRAM_IF_CNTLR_1_BASEADDR
+
+/*Uart*/
+#define CONFIG_XILINX_UARTLITE
+#define CONFIG_BAUDRATE		9600
+#define CFG_BAUDRATE_TABLE	{9600}
+#define CONFIG_SERIAL_BASE	XPAR_UARTLITE_0_BASEADDR
+
+/*Cmd*/
+#include <config_cmd_default.h>
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_REGINFO
+#undef CONFIG_CMD_I2C
+#undef CONFIG_CMD_DTT
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_PING
+#undef CONFIG_CMD_DHCP
+#undef CONFIG_CMD_EEPROM
+#undef CONFIG_CMD_IMLS
+
+/*Env*/
+#define	CFG_ENV_IS_NOWHERE
+#define	CFG_ENV_SIZE		0x200
+#define CFG_ENV_OFFSET 		0x100
+
+/*Misc*/
+#define CONFIG_BOOTDELAY	5		/* autoboot after 5 seconds     */
+#define CFG_LONGHELP				/* undef to save memory         */
+#define CFG_PROMPT		"board:/# "	/* Monitor Command Prompt       */
+#if defined(CONFIG_CMD_KGDB)
+#define CFG_CBSIZE		1024		/* Console I/O Buffer Size      */
+#else
+#define CFG_CBSIZE		256		/* Console I/O Buffer Size      */
+#endif
+#define CFG_PBSIZE		( CFG_CBSIZE + sizeof( CFG_PROMPT ) + 16 )
+#define CFG_MAXARGS		16		/* max number of command args   */
+#define CFG_BARGSIZE		CFG_CBSIZE	/* Boot Argument Buffer Size */
+#define CFG_MEMTEST_START	0x0400000	/* memtest works on           */
+#define CFG_MEMTEST_END		0x0C00000	/* 4 ... 12 MB in DRAM        */
+#define CFG_LOAD_ADDR		0x400000	/* default load address       */
+#define CFG_EXTBDINFO		1		/* Extended board_into (bd_t) */
+#define CFG_HZ			1000		/* decrementer freq: 1 ms ticks */
+#define CONFIG_CMDLINE_EDITING			/* add command line history     */
+#define CONFIG_AUTO_COMPLETE			/* add autocompletion support   */
+#define CONFIG_LOOPW				/* enable loopw command         */
+#define CONFIG_MX_CYCLIC			/* enable mdc/mwc commands      */
+#define CONFIG_ZERO_BOOTDELAY_CHECK		/* check for keypress on bootdelay==0 */
+#define CONFIG_VERSION_VARIABLE			/* include version env variable */
+#define CFG_CONSOLE_INFO_QUIET			/* don't print console @ startup */
+#define CFG_HUSH_PARSER				/* Use the HUSH parser          */
+#define	CFG_PROMPT_HUSH_PS2	"> "
+#define CONFIG_LOADS_ECHO			/* echo on for serial download  */
+#define CFG_LOADS_BAUD_CHANGE			/* allow baudrate change        */
+#define CFG_BOOTMAPSZ		( 8 << 20 )	/* Initial Memory map for Linux */
+#define CONFIG_PREBOOT		"echo U-Boot is up and runnining;"
+
+/*Stack*/
+#define CFG_INIT_RAM_ADDR	0x800000	/* Initial RAM address    */
+#define CFG_INIT_RAM_END	0x2000		/* End of used area in RAM  */
+#define CFG_GBL_DATA_SIZE	128		/* num bytes initial data   */
+#define CFG_GBL_DATA_OFFSET	( CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE )
+#define CFG_INIT_SP_OFFSET	CFG_GBL_DATA_OFFSET
+/*Speed*/
+#define CONFIG_SYS_CLK_FREQ	400000000
+
+/*Flash*/
+#define	CFG_FLASH_BASE		XPAR_FLASH_MEM0_BASEADDR
+#define	CFG_FLASH_SIZE		(32*1024*1024)
+#define	CFG_FLASH_CFI		1
+#define	CFG_FLASH_CFI_DRIVER	1
+#define	CFG_FLASH_EMPTY_INFO	1
+#define	CFG_MAX_FLASH_BANKS	1
+#define	CFG_MAX_FLASH_SECT	( CFG_FLASH_SIZE / ( 64 * 1024 ) )
+#define	CFG_FLASH_PROTECTION
+
+#endif						/* __CONFIG_H */
-- 
1.5.6.2

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (resubmit)
  2008-07-17  9:44     ` [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (resubmit) Ricardo Ribalda Delgado
@ 2008-07-18 10:33       ` Stefan Roese
  0 siblings, 0 replies; 25+ messages in thread
From: Stefan Roese @ 2008-07-18 10:33 UTC (permalink / raw)
  To: u-boot

On Thursday 17 July 2008, Ricardo Ribalda Delgado wrote:
> -This patchs gives support for the embbedded ppc440
> on the Virtex5 FPGAs
>
> -interrupts.c divided in uic.c and interrupts.c
>
> -xilinx_irq.c for xilinx interrupt controller
>
> -Include modifications propossed by  Stefan Roese

Applied to next branch of u-boot-ppc4xx after some minor cleanups.

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support (Resubmit)
  2008-07-17 10:47       ` [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support (Resubmit) Ricardo Ribalda Delgado
@ 2008-07-18 10:34         ` Stefan Roese
  2008-07-29 14:30           ` Wolfgang Denk
  0 siblings, 1 reply; 25+ messages in thread
From: Stefan Roese @ 2008-07-18 10:34 UTC (permalink / raw)
  To: u-boot

On Thursday 17 July 2008, Ricardo Ribalda Delgado wrote:
> The Xilinx ML507 Board is a Virtex 5 prototyping board that includes,
> 	among others:
> 	-Virtex 5 FX FPGA (With a ppc440x5 in it)
> 	-256MB of SDRAM2
> 	-32MB of Flash
> 	-I2C Eeprom
> 	-System ACE chip
> 	-Serial ATA connectors
> 	-RS232 Level Conversors
> 	-Ethernet Transceiver
>
> This patch gives support to a standard design produced by EDK for this
> board: ppc440, uartlite, xilinx_int and flash
>
> - Includes Changes propossed by Stefan Roese and Michal Simek

Applied to next branch of u-boot-ppc4xx after some minor cleanups.

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support
  2008-07-17  8:39         ` Stefan Roese
@ 2008-07-29 14:29           ` Wolfgang Denk
  2008-07-29 14:59             ` Stefan Roese
  0 siblings, 1 reply; 25+ messages in thread
From: Wolfgang Denk @ 2008-07-29 14:29 UTC (permalink / raw)
  To: u-boot

In message <200807171039.38227.sr@denx.de> you wrote:
>
> > > #define CFG_MBYTES_SDRAM        256
> >
> > No. All boards, especially all PowerPC boards, should use dynamic
> > memory size detection.
> 
> You are probably referring to calling get_ram_size() instead of just returning 
> the configured fixed value. But what do we gain here. get_ram_size() also 
> needs the ram-size as parameter. Not sure if this is an improvement on such 
> fixed systems.

It just needs a maximum possible size.

One major advantage is for example that get_ram_size() verifies  that
RAM is actually working, and of expected size. It is a very efficient
test to make sure your hardware is actually working.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I can call spirits from the vasty deep."
"Why so can I, or so can any man; but will they come when you do call
for them?"          - Shakespeare, 1 King Henry IV, Act III, Scene I.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support (Resubmit)
  2008-07-18 10:34         ` Stefan Roese
@ 2008-07-29 14:30           ` Wolfgang Denk
  0 siblings, 0 replies; 25+ messages in thread
From: Wolfgang Denk @ 2008-07-29 14:30 UTC (permalink / raw)
  To: u-boot

In message <200807181234.10282.sr@denx.de> you wrote:
>
> > This patch gives support to a standard design produced by EDK for this
> > board: ppc440, uartlite, xilinx_int and flash
> >
> > - Includes Changes propossed by Stefan Roese and Michal Simek
> 
> Applied to next branch of u-boot-ppc4xx after some minor cleanups.

I still object against using a fixed memory configuration without
testing. This should be avoided.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It seems intuitively obvious to me, which  means  that  it  might  be
wrong.                                                 -- Chris Torek

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support
  2008-07-29 14:29           ` Wolfgang Denk
@ 2008-07-29 14:59             ` Stefan Roese
  2008-07-29 15:16               ` [U-Boot-Users] [PATCH] ppc4xx: ml507: Use of get_ram_size in board ml507 Ricardo Ribalda Delgado
  2008-07-29 15:16               ` [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support Ricardo Ribalda Delgado
  0 siblings, 2 replies; 25+ messages in thread
From: Stefan Roese @ 2008-07-29 14:59 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On Tuesday 29 July 2008, Wolfgang Denk wrote:
> In message <200807171039.38227.sr@denx.de> you wrote:
> > > > #define CFG_MBYTES_SDRAM        256
> > >
> > > No. All boards, especially all PowerPC boards, should use dynamic
> > > memory size detection.
> >
> > You are probably referring to calling get_ram_size() instead of just
> > returning the configured fixed value. But what do we gain here.
> > get_ram_size() also needs the ram-size as parameter. Not sure if this is
> > an improvement on such fixed systems.
>
> It just needs a maximum possible size.

OK, this would be the 256 MB from above again.

> One major advantage is for example that get_ram_size() verifies  that
> RAM is actually working, and of expected size. It is a very efficient
> test to make sure your hardware is actually working.

But what exactly should happen if such a board with only one possible memory 
size configuration detects ram_size != configured ram_size?

OK, this small check is an improvement over no check at all. Is it acceptable 
that I add this get_ram_size() with an additional patch? This would safe me 
from resetting my "next" branch or reverting patches.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] [PATCH] ppc4xx: ml507: Use of get_ram_size in board ml507
  2008-07-29 14:59             ` Stefan Roese
@ 2008-07-29 15:16               ` Ricardo Ribalda Delgado
  2008-07-29 21:40                 ` [U-Boot-Users] unassigned-patches/16: " u-boot at bugs.denx.de
  2008-07-30  9:37                 ` [U-Boot-Users] " Stefan Roese
  2008-07-29 15:16               ` [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support Ricardo Ribalda Delgado
  1 sibling, 2 replies; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-29 15:16 UTC (permalink / raw)
  To: u-boot

-Change suggested by WD

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
---
 board/xilinx/ml507/ml507.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/board/xilinx/ml507/ml507.c b/board/xilinx/ml507/ml507.c
index e95d2af..d499303 100644
--- a/board/xilinx/ml507/ml507.c
+++ b/board/xilinx/ml507/ml507.c
@@ -27,13 +27,14 @@ int board_pre_init(void)
 
 int checkboard(void)
 {
-	puts ("ML507 Board\n");
+	puts("ML507 Board\n");
 	return 0;
 }
 
 phys_size_t initdram(int board_type)
 {
-	return CFG_SDRAM_SIZE_MB * 1024 * 1024;
+	return get_ram_size(XPAR_DDR2_SDRAM_MEM_BASEADDR,
+			    CFG_SDRAM_SIZE_MB * 1024 * 1024);
 }
 
 void get_sys_info(sys_info_t * sysInfo)
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support
  2008-07-29 14:59             ` Stefan Roese
  2008-07-29 15:16               ` [U-Boot-Users] [PATCH] ppc4xx: ml507: Use of get_ram_size in board ml507 Ricardo Ribalda Delgado
@ 2008-07-29 15:16               ` Ricardo Ribalda Delgado
  1 sibling, 0 replies; 25+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-29 15:16 UTC (permalink / raw)
  To: u-boot

Hi all

I have just prepared, tested and sent a patch.

   Best regards

On Tue, Jul 29, 2008 at 4:59 PM, Stefan Roese <sr@denx.de> wrote:
> Hi Wolfgang,
>
> On Tuesday 29 July 2008, Wolfgang Denk wrote:
>> In message <200807171039.38227.sr@denx.de> you wrote:
>> > > > #define CFG_MBYTES_SDRAM        256
>> > >
>> > > No. All boards, especially all PowerPC boards, should use dynamic
>> > > memory size detection.
>> >
>> > You are probably referring to calling get_ram_size() instead of just
>> > returning the configured fixed value. But what do we gain here.
>> > get_ram_size() also needs the ram-size as parameter. Not sure if this is
>> > an improvement on such fixed systems.
>>
>> It just needs a maximum possible size.
>
> OK, this would be the 256 MB from above again.
>
>> One major advantage is for example that get_ram_size() verifies  that
>> RAM is actually working, and of expected size. It is a very efficient
>> test to make sure your hardware is actually working.
>
> But what exactly should happen if such a board with only one possible memory
> size configuration detects ram_size != configured ram_size?
>
> OK, this small check is an improvement over no check at all. Is it acceptable
> that I add this get_ram_size() with an additional patch? This would safe me
> from resetting my "next" branch or reverting patches.
>
> Best regards,
> Stefan
>
> =====================================================================
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
> =====================================================================
>



-- 
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [U-Boot-Users] unassigned-patches/16: [PATCH] ppc4xx: ml507: Use of get_ram_size in board ml507
  2008-07-29 15:16               ` [U-Boot-Users] [PATCH] ppc4xx: ml507: Use of get_ram_size in board ml507 Ricardo Ribalda Delgado
@ 2008-07-29 21:40                 ` u-boot at bugs.denx.de
  2008-07-30  9:37                 ` [U-Boot-Users] " Stefan Roese
  1 sibling, 0 replies; 25+ messages in thread
From: u-boot at bugs.denx.de @ 2008-07-29 21:40 UTC (permalink / raw)
  To: u-boot

-Change suggested by WD

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>

---
Added to GNATS database as unassigned-patches/16
>Responsible:    patch-coord
>Message-Id:     <1217344570-14937-1-git-send-email-ricardo.ribalda@uam.es>
>In-Reply-To:    <200807291659.44619.sr@denx.de>
>References:     <200807291659.44619.sr@denx.de>
>Patch-Date:     Tue Jul 29 17:16:10 +0200 2008
---
 board/xilinx/ml507/ml507.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/board/xilinx/ml507/ml507.c b/board/xilinx/ml507/ml507.c
index e95d2af..d499303 100644
--- a/board/xilinx/ml507/ml507.c
+++ b/board/xilinx/ml507/ml507.c
@@ -27,13 +27,14 @@ int board_pre_init(void)
 
 int checkboard(void)
 {
-	puts ("ML507 Board\n");
+	puts("ML507 Board\n");
 	return 0;
 }
 
 phys_size_t initdram(int board_type)
 {
-	return CFG_SDRAM_SIZE_MB * 1024 * 1024;
+	return get_ram_size(XPAR_DDR2_SDRAM_MEM_BASEADDR,
+			    CFG_SDRAM_SIZE_MB * 1024 * 1024);
 }
 
 void get_sys_info(sys_info_t * sysInfo)
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [U-Boot-Users] [PATCH] ppc4xx: ml507: Use of get_ram_size in board ml507
  2008-07-29 15:16               ` [U-Boot-Users] [PATCH] ppc4xx: ml507: Use of get_ram_size in board ml507 Ricardo Ribalda Delgado
  2008-07-29 21:40                 ` [U-Boot-Users] unassigned-patches/16: " u-boot at bugs.denx.de
@ 2008-07-30  9:37                 ` Stefan Roese
  1 sibling, 0 replies; 25+ messages in thread
From: Stefan Roese @ 2008-07-30  9:37 UTC (permalink / raw)
  To: u-boot

On Tuesday 29 July 2008, Ricardo Ribalda Delgado wrote:
> -Change suggested by WD
>
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>

Applied to next branch of u-boot-ppc4xx repository.

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2008-07-30  9:37 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-14 19:47 [U-Boot-Users] ppc4xx [Resubmit] [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Ricardo Ribalda Delgado
2008-07-14 19:47 ` [U-Boot-Users] ppc4xx: [PATCH] [Resubmit] ML507 Board Support Ricardo Ribalda Delgado
2008-07-16  1:17   ` [U-Boot-Users] ppc4xx: [PATCH] " Ricardo Ribalda Delgado
2008-07-17  6:31     ` Stefan Roese
2008-07-17  8:25       ` Wolfgang Denk
2008-07-17  8:39         ` Stefan Roese
2008-07-29 14:29           ` Wolfgang Denk
2008-07-29 14:59             ` Stefan Roese
2008-07-29 15:16               ` [U-Boot-Users] [PATCH] ppc4xx: ml507: Use of get_ram_size in board ml507 Ricardo Ribalda Delgado
2008-07-29 21:40                 ` [U-Boot-Users] unassigned-patches/16: " u-boot at bugs.denx.de
2008-07-30  9:37                 ` [U-Boot-Users] " Stefan Roese
2008-07-29 15:16               ` [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support Ricardo Ribalda Delgado
2008-07-17  7:21     ` Michal Simek
2008-07-17 10:30       ` Ricardo Ribalda Delgado
2008-07-17 10:47       ` [U-Boot-Users] ppc4xx: [PATCH] ML507 Board Support (Resubmit) Ricardo Ribalda Delgado
2008-07-18 10:34         ` Stefan Roese
2008-07-29 14:30           ` Wolfgang Denk
2008-07-15 20:47 ` [U-Boot-Users] ppc4xx [Resubmit] [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Ricardo Ribalda Delgado
2008-07-16  1:14 ` [U-Boot-Users] ppc4xx: " Ricardo Ribalda Delgado
2008-07-16 15:14   ` Jon Loeliger
2008-07-16 15:28     ` [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (newversion) Ricardo Ribalda Delgado
2008-07-17  6:24   ` [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (new version) Stefan Roese
2008-07-17  9:22     ` Ricardo Ribalda Delgado
2008-07-17  9:44     ` [U-Boot-Users] ppc4xx: [PATCH] CPU PPC440x5 on Virtex5 FX (resubmit) Ricardo Ribalda Delgado
2008-07-18 10:33       ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox