Skip to contentSkip to conversation

SPARC: Added generic support for SPARC architecture.

PATCH New Daniel Hellstrom 2 participants 16 messages Mar 28, 2008 – Mar 31, 2008 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/13 SPARC: Added generic support for SPARC architecture.

Not much to say, tested on LEON2 simulator and LEON3.

ABOUT SPARC-ELF COMPILER
------------------------
Compiling u-boot for LEON3 and LEON2 has only been has been tested with GCC 3.4.4 compiler with added LEON2 and LEON3 support available from www.gaisler.com or ftp://ftp.gaisler.com/gaisler.com/bcc/bin/linux/sparc-elf-3.4.4-1.0.30.tar.bz2, installation instructions can be found in bcc/doc/bcc.pdf. (extract to /opt/ and add /opt/sparc-elf-3.4.4/bin to PATH).

U-BOOT support tested
---------------------
- LEON3 (and LEON3FT Fault tolerant version)
- LEON3 Simulator (GRSIM and TSIM)
- LEON2 Simulator (GRSIM and TSIM)
- Network (GRETH and SMC91111)
- USB 1.1 (UHCI)
- Linux and RTEMS booting
- booting UBOOT from RAM and FLASH by changing board/gaisler/xxx/config.mk
- DDR, DDR2, SRAM, FT-SRAM
- UART, IRQ, Timer

This patch is available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches/1_sparc.patch.

Best Regards,
Daniel Hellstrom

---
 MAKEALL                         |    7 +
 Makefile                        |    9 +-
 README                          |    1 +
 examples/Makefile               |    3 +
 examples/sparc.lds              |   61 +++++
 examples/stubs.c                |   16 ++
 include/asm-sparc/asi.h         |   32 +++
 include/asm-sparc/asmmacro.h    |   45 ++++
 include/asm-sparc/atomic.h      |   29 +++
 include/asm-sparc/bitops.h      |   29 +++
 include/asm-sparc/byteorder.h   |   37 +++
 include/asm-sparc/cache.h       |   31 +++
 include/asm-sparc/errno.h       |  162 ++++++++++++
 include/asm-sparc/global_data.h |   85 +++++++
 include/asm-sparc/io.h          |   94 +++++++
 include/asm-sparc/irq.h         |   49 ++++
 include/asm-sparc/machines.h    |   92 +++++++
 include/asm-sparc/page.h        |   43 ++++
 include/asm-sparc/posix_types.h |  139 +++++++++++
 include/asm-sparc/processor.h   |  109 ++++++++
 include/asm-sparc/prom.h        |  297 ++++++++++++++++++++++
 include/asm-sparc/psr.h         |   97 ++++++++
 include/asm-sparc/ptrace.h      |  181 ++++++++++++++
 include/asm-sparc/srmmu.h       |  301 ++++++++++++++++++++++
 include/asm-sparc/stack.h       |  162 ++++++++++++
 include/asm-sparc/string.h      |   55 ++++
 include/asm-sparc/types.h       |   71 ++++++
 include/asm-sparc/u-boot.h      |   74 ++++++
 include/asm-sparc/winmacro.h    |  151 +++++++++++
 lib_sparc/Makefile              |   45 ++++
 lib_sparc/board.c               |  521 +++++++++++++++++++++++++++++++++++++++
 lib_sparc/bootm.c               |  226 +++++++++++++++++
 lib_sparc/cache.c               |   33 +++
 lib_sparc/interrupts.c          |  122 +++++++++
 lib_sparc/time.c                |   78 ++++++
 sparc_config.mk                 |   24 ++
 36 files changed, 3510 insertions(+), 1 deletions(-)
 create mode 100644 examples/sparc.lds
 create mode 100644 include/asm-sparc/asi.h
 create mode 100644 include/asm-sparc/asmmacro.h
 create mode 100644 include/asm-sparc/atomic.h
 create mode 100644 include/asm-sparc/bitops.h
 create mode 100644 include/asm-sparc/byteorder.h
 create mode 100644 include/asm-sparc/cache.h
 create mode 100644 include/asm-sparc/errno.h
 create mode 100644 include/asm-sparc/global_data.h
 create mode 100644 include/asm-sparc/io.h
 create mode 100644 include/asm-sparc/irq.h
 create mode 100644 include/asm-sparc/machines.h
 create mode 100644 include/asm-sparc/page.h
 create mode 100644 include/asm-sparc/posix_types.h
 create mode 100644 include/asm-sparc/processor.h
 create mode 100644 include/asm-sparc/prom.h
 create mode 100644 include/asm-sparc/psr.h
 create mode 100644 include/asm-sparc/ptrace.h
 create mode 100644 include/asm-sparc/srmmu.h
 create mode 100644 include/asm-sparc/stack.h
 create mode 100644 include/asm-sparc/string.h
 create mode 100644 include/asm-sparc/types.h
 create mode 100644 include/asm-sparc/u-boot.h
 create mode 100644 include/asm-sparc/winmacro.h
 create mode 100644 lib_sparc/Makefile
 create mode 100644 lib_sparc/board.c
 create mode 100644 lib_sparc/bootm.c
 create mode 100644 lib_sparc/cache.c
 create mode 100644 lib_sparc/interrupts.c
 create mode 100644 lib_sparc/time.c
 create mode 100644 sparc_config.mk
Signature · 1 line
1.5.4
#1 lore raw

PATCH 2/13 SPARC: added SPARC board information to the command bdinfo.

Hello Wolfgang,

This patch adds support for the U-Boot command 'bdinfo' for SPARC boards, the output is as shown below.

######################
U-Boot 1.3.2-00273-gf85e20a (Mar 28 2008 - 13:13:48)GAISLER LEON3 GR-XC3S-1500

CPU: LEON3
Board: GRSIM/TSIM
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   GRETH 10/100

Type "run flash_nfs" to mount root filesystem over NFS

Hit any key to stop autoboot: 0
=> bdinfo

memstart               = 0x40000000
memsize                = 0x04000000
flashstart             = 0x00000000
CFG_MONITOR_BASE       = 0x00000000
CFG_ENV_ADDR           = 0x007F8000
CFG_RELOC_MONITOR_BASE = 0x43f8e000 (262144)
CFG_MALLOC_BASE        = 0x43fce000 (131072)
CFG_INIT_SP_OFFSET     = 0x43ffdfe0 (65504)
CFG_PROM_OFFSET        = 0x43ffe000 (8064)
CFG_GBL_DATA_OFFSET    = 0x43ffff80 (128)
ethaddr                = 00:00:7A:CC:00:12
IP addr                = 192.168.0.80
baudrate               =  38400 bps

=>
######################

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 common/cmd_bdinfo.c |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
common/cmd_bdinfo.c +39 -0
index bbb0192..731c1d2 100644
@@ -208,6 +208,45 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	return 0;
 }
 
+#elif defined(CONFIG_SPARC)	/* SPARC */
+int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+	bd_t *bd = gd->bd;
+#if defined(CONFIG_CMD_NET)
+	int i;
+#endif
+
+#ifdef DEBUG
+	print_num("bd address             ", (ulong) bd);
+#endif
+	print_num("memstart               ", bd->bi_memstart);
+	print_num("memsize                ", bd->bi_memsize);
+	print_num("flashstart             ", bd->bi_flashstart);
+	print_num("CFG_MONITOR_BASE       ", CFG_MONITOR_BASE);
+	print_num("CFG_ENV_ADDR           ", CFG_ENV_ADDR);
+	printf("CFG_RELOC_MONITOR_BASE = 0x%lx (%d)\n", CFG_RELOC_MONITOR_BASE,
+	       CFG_MONITOR_LEN);
+	printf("CFG_MALLOC_BASE        = 0x%lx (%d)\n", CFG_MALLOC_BASE,
+	       CFG_MALLOC_LEN);
+	printf("CFG_INIT_SP_OFFSET     = 0x%lx (%d)\n", CFG_INIT_SP_OFFSET,
+	       CFG_STACK_SIZE);
+	printf("CFG_PROM_OFFSET        = 0x%lx (%d)\n", CFG_PROM_OFFSET,
+	       CFG_PROM_SIZE);
+	printf("CFG_GBL_DATA_OFFSET    = 0x%lx (%d)\n", CFG_GBL_DATA_OFFSET,
+	       CFG_GBL_DATA_SIZE);
+
+#if defined(CONFIG_CMD_NET)
+	puts("ethaddr                =");
+	for (i = 0; i < 6; ++i) {
+		printf("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
+	}
+	puts("\nIP addr                = ");
+	print_IPaddr(bd->bi_ip_addr);
+#endif
+	printf("\nbaudrate               = %6ld bps\n", bd->bi_baudrate);
+	return 0;
+}
+
 #elif defined(CONFIG_M68K) /* M68K */
 static void print_str(const char *, const char *);
 
Signature · 1 line
1.5.4
#2 lore raw

PATCH 3/13 SPARC: added SPARC support for new uimage in common code.

In reply to Daniel Hellstrom

Hello Wolfgang,

This patch adds support for SPARC u-boot images to bootm. The IH_ARCH_SPARC indentifier in the image header is recognized. The IH_ARCH_SPARC indentifier has already been implemented in mkimage.

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 common/image.c  |    2 +-
 include/image.h |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)
common/image.c +1 -1
index f04826a..ce49bb2 100644
@@ -1014,7 +1014,7 @@ int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
 	return 0;
 }
 
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
 /**
  * boot_ramdisk_high - relocate init ramdisk
  * @lmb: pointer to lmb handle, will be used for memory mgmt
include/image.h +4 -0
index 36143e2..c1a6cbb 100644
@@ -419,6 +419,8 @@ static inline int image_check_target_arch (image_header_t *hdr)
 	if (!image_check_arch (hdr, IH_ARCH_PPC))
 #elif defined(__sh__)
 	if (!image_check_arch (hdr, IH_ARCH_SH))
+#elif defined(__sparc__)
+	if (!image_check_arch (hdr, IH_ARCH_SPARC))
 #else
 # error Unknown CPU type
 #endif
@@ -571,6 +573,8 @@ static inline int fit_image_check_target_arch (const void *fdt, int node)
 	if (!fit_image_check_arch (fdt, node, IH_ARCH_PPC))
 #elif defined(__sh__)
 	if (!fit_image_check_arch (fdt, node, IH_ARCH_SH))
+#elif defined(__sparc__)
+	if (!fit_image_check_arch (fdt, node, IH_ARCH_SPARC))
 #else
 # error Unknown CPU type
 #endif
Signature · 1 line
1.5.4
#3 lore raw

PATCH 4/13 SPARC: Added support for SPARC LEON3 SOC processor.

In reply to Daniel Hellstrom

Hello Wolfgang,

This patch adds support for SPARC/LEON3 to U-Boot. LEON3 boards are added in separate patches.

This patch does not support LEON3 SMP system.

Linux for SPARC assumes that there is a Sun Boot prom available. The boot prom is used as monitor to support basic features such as rebooting, printing to the system console (serial terminal in the LEON case) and getting information about the hardware (baudrate, main memory etc.). So, in order to boot SPARC Linux on LEON a standard boot prom is emulated. This is done in cpu/leon?/prom.c.
The boot prom must be placed at a higher address that the stack to avoid that it gets overwritten.

Some chip designs has UHCI and EHI USB. UHCI has been implemented for U-Boot on LEON3 systems.

LEON3 processors is on an extended AMBA bus (with Plug&Play support), whereas LEON2 uses hardcoded addresses since it is on an AMBA bus without Plug&Play.

ABOUT LEON3 and GRLIB
---------------------
LEON3 is an open source (GPL) SPARC V7 and/or V8 processor part of GRLIB. GRLIB is a free comprehensive open source (GPL) Portable IP library (written in VHDL) featuring cores such as Ethernet 10/100/1000, SpaceWire, PCI, CAN, 1553, I2C, USB 1.1 and 2.0, SPI, DMA ATA, SVGA, PS/2, UART, Timer, SDRAM, SRAM, SSRAM, DDR, DDR2, FLASH/PROM, CPU Debug Unit, FPU, GPIO and many more. More info available at www.gaisler.com.

ABOUT SPARC-ELF COMPILER
------------------------
Compiling u-boot for LEON3 and LEON2 has only been has only been tested with GCC
3.4.4 compiler with added LEON2 and LEON3 support available from www.gaisler.com or ftp://ftp.gaisler.com/gaisler.com/bcc/bin/linux/sparc-elf-3.4.4-1.0.30.tar.bz2,

installation instructions can be found in bcc/doc/bcc.pdf. (extract to /opt/ and
add /opt/sparc-elf-3.4.4/bin to PATH).

U-BOOT support tested
---------------------
- LEON3 (and LEON3FT Fault tolerant version)
- LEON3 Simmulator (GRSIM and TSIM)
- Network (GRETH and SMC91111)
- USB 1.1 (UHCI)
- Linux and RTEMS booting
- booting UBOOT from RAM and FLASH by changing board/gaisler/xxx/config.mk
- DDR, DDR2, SRAM, FT-SRAM
- UART, IRQ, Timer

This patch is available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches/4_leon3.patch.

Best Regards,
Daniel Hellstrom

---
 Makefile                           |    3 +
 README                             |    1 +
 cpu/leon3/Makefile                 |   54 ++
 cpu/leon3/ambapp.c                 |  339 ++++++++++
 cpu/leon3/config.mk                |   26 +
 cpu/leon3/cpu.c                    |   67 ++
 cpu/leon3/cpu_init.c               |  254 +++++++
 cpu/leon3/interrupts.c             |  219 ++++++
 cpu/leon3/prom.c                   | 1078 +++++++++++++++++++++++++++++
 cpu/leon3/serial.c                 |  139 ++++
 cpu/leon3/start.S                  |  616 +++++++++++++++++
 cpu/leon3/usb_uhci.c               | 1313 ++++++++++++++++++++++++++++++++++++
 cpu/leon3/usb_uhci.h               |  184 +++++
 include/ambapp.h                   |  380 +++++++++++
 include/asm-sparc/arch-leon3/asi.h |   36 +
 include/asm-sparc/leon.h           |   38 +
 include/asm-sparc/leon3.h          |   37 +
 include/asm-sparc/processor.h      |    9 +-
 18 files changed, 4792 insertions(+), 1 deletions(-)
 create mode 100644 cpu/leon3/Makefile
 create mode 100644 cpu/leon3/ambapp.c
 create mode 100644 cpu/leon3/config.mk
 create mode 100644 cpu/leon3/cpu.c
 create mode 100644 cpu/leon3/cpu_init.c
 create mode 100644 cpu/leon3/interrupts.c
 create mode 100644 cpu/leon3/prom.c
 create mode 100644 cpu/leon3/serial.c
 create mode 100644 cpu/leon3/start.S
 create mode 100644 cpu/leon3/usb_uhci.c
 create mode 100644 cpu/leon3/usb_uhci.h
 create mode 100644 include/ambapp.h
 create mode 100644 include/asm-sparc/arch-leon3/asi.h
 create mode 100644 include/asm-sparc/leon.h
 create mode 100644 include/asm-sparc/leon3.h
Signature · 1 line
1.5.4
#4 lore raw

PATCH 5/13 SPARC/LEON3: Added AMBA Bus Plug&Play information print command (ambapp).

In reply to Daniel Hellstrom

Hello Wolfgang,

This patch adds an U-Boot command, ambapp, which prints a summary of AMBA Bus Plug & Play information.

AMBA is a bus specified by ARM. AMBA with Plug and Play information is a Gaisler extension to that bus. See www.gaisler.com.

######################
U-Boot 1.3.2-g6bc2ec61-dirty (Mar 12 2008 - 21:24:14)Gaisler GRSIM

CPU: LEON3
Board: GRSIM/TSIM
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   PHY info not available

GRETH 10/100

Type "run flash_nfs" to mount root filesystem over NFS

Hit any key to stop autoboot: 0
=> ambapp
--------- AHB Masters ---------
0x00:0x01:0x03: VENDOR_GAISLER GAISLER_LEON3
irq: 0 (ver: 0)
--------- AHB Slaves ---------
0x00:0x04:0x0f: VENDOR_ESA ESA_MCTRL
mem: 0x00000000 - 0x10000000
mem: 0x20000000 - 0x30000000
mem: 0x40000000 - 0x70000000
irq: 1 (ver: 0)
0x01:0x01:0x06: VENDOR_GAISLER GAISLER_APBMST
mem: 0xc0000000 - 0xc0100000
irq: 3 (ver: 0)
--------- APB Slaves ---------
0x00:0x04:0x0f: VENDOR_ESA ESA_MCTRL
apb: 0xc0000000 - 0xc0000100
irq: 1 (ver: 0 )
0x01:0x01:0x0c: VENDOR_GAISLER GAISLER_APBUART
apb: 0xc0000100 - 0xc0000200
irq: 3 (ver: 0 )
0x02:0x01:0x0d: VENDOR_GAISLER GAISLER_IRQMP
apb: 0xc0000200 - 0xc0000300
irq: 7 (ver: 0 )
0x03:0x01:0x11: VENDOR_GAISLER GAISLER_GPTIMER
apb: 0xc0000300 - 0xc0000400
irq: 8 (ver: 0 )
0x04:0x01:0x1d: VENDOR_GAISLER GAISLER_ETHMAC
apb: 0xc0000800 - 0xc0001000
irq: 12 (ver: 0 )

=>
######################

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 common/Makefile          |    1 +
 common/cmd_ambapp.c      |  278 ++++++++++++++++++++++++++++++++++++++++++++++
 cpu/leon3/ambapp.c       |   20 ++++
 include/ambapp.h         |   14 +++
 include/config_cmd_all.h |    1 +
 5 files changed, 314 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_ambapp.c
common/Makefile +1 -0
index 0d67337..c71b228 100644
@@ -32,6 +32,7 @@ COBJS-y += ACEX1K.o
 COBJS-y += altera.o
 COBJS-y += bedbug.o
 COBJS-y += circbuf.o
+COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
 COBJS-y += cmd_autoscript.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
common/cmd_ambapp.c new file +278 -0

278 lines not on this page · raw message

cpu/leon3/ambapp.c +20 -0
index 60ff1a2..efd41ae 100644
@@ -28,6 +28,14 @@
 #include <command.h>
 #include <ambapp.h>
 
+#if defined(CONFIG_CMD_AMBAPP)
+extern void ambapp_print_apb(apbctrl_pp_dev * apb,
+			     ambapp_ahbdev * apbmst, int index);
+extern void ambapp_print_ahb(ahbctrl_pp_dev * ahb, int index);
+extern int ambapp_apb_print;
+extern int ambapp_ahb_print;
+#endif
+
 static int ambapp_apb_scan(unsigned int vendor,	/* Plug&Play Vendor ID */
 			   unsigned int driver,	/* Plug&Play Device ID */
 			   ambapp_apbdev * dev,	/* Result(s) is placed here */
@@ -58,6 +66,12 @@ static int ambapp_apb_scan(unsigned int vendor,	/* Plug&Play Vendor ID */
 	apb = (apbctrl_pp_dev *) (apbmst_base | LEON3_CONF_AREA);
 
 	for (i = 0; i < LEON3_APB_SLAVES; i++) {
+#if defined(CONFIG_CMD_AMBAPP)
+		if (ambapp_apb_print && amba_vendor(apb->conf)
+		    && amba_device(apb->conf)) {
+			ambapp_print_apb(apb, &apbmst, i);
+		}
+#endif
 		if ((amba_vendor(apb->conf) == vendor) &&
 		    (amba_device(apb->conf) == driver) && ((index < 0)
 							   || (index-- == 0))) {
@@ -192,6 +206,12 @@ static int ambapp_ahb_scan(unsigned int vendor,	/* Plug&Play Vendor ID */
 	}
 
 	for (i = 0; i < max_pp_devs; i++) {
+#if defined(CONFIG_CMD_AMBAPP)
+		if (ambapp_ahb_print && amba_vendor(ahb->conf) &&
+		    amba_device(ahb->conf)) {
+			ambapp_print_ahb(ahb, i);
+		}
+#endif
 		if ((amba_vendor(ahb->conf) == vendor) &&
 		    (amba_device(ahb->conf) == driver) &&
 		    ((index < 0) || (index-- == 0))) {
include/ambapp.h +14 -0
index 1e49d89..7494e59 100644
@@ -140,6 +140,20 @@
 
 #ifndef __ASSEMBLER__
 
+#ifdef CONFIG_CMD_AMBAPP
+
+/* AMBA Plug&Play relocation & initialization */
+int ambapp_init_reloc(void);
+
+/* AMBA Plug&Play Name of Vendors and devices */
+
+/* Return name of device */
+char *ambapp_device_id2str(int vendor, int id);
+
+/* Return name of vendor */
+char *ambapp_vendor_id2str(int vendor);
+#endif
+
 /*
  *  Types and structure used for AMBA Plug & Play bus scanning
  */
include/config_cmd_all.h +1 -0
index 69276a3..d1b5ffb 100644
@@ -13,6 +13,7 @@
  * Alphabetical list of all possible commands.
  */
 
+#define CONFIG_CMD_AMBAPP	/* AMBA Plug & Play Bus print utility */
 #define CONFIG_CMD_ASKENV	/* ask for env variable		*/
 #define CONFIG_CMD_AUTOSCRIPT	/* Autoscript Support		*/
 #define CONFIG_CMD_BDI	       	/* bdinfo			*/
Signature · 1 line
1.5.4
#5 lore raw

PATCH 6/13 SPARC: Added support for SPARC LEON2 SOC Processor.

In reply to Daniel Hellstrom

Hello Wolfgang,

This patch adds support for SPARC/LEON2 to U-Boot. Currently only the LEON2 TSIM and GRSIM simulators are supported, they are added in a separate patch.

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 Makefile                           |    4 +
 README                             |    1 +
 cpu/leon2/Makefile                 |   54 ++
 cpu/leon2/config.mk                |   26 +
 cpu/leon2/cpu.c                    |   58 ++
 cpu/leon2/cpu_init.c               |  142 +++++
 cpu/leon2/interrupts.c             |  217 ++++++++
 cpu/leon2/prom.c                   | 1047 ++++++++++++++++++++++++++++++++++++
 cpu/leon2/serial.c                 |  165 ++++++
 cpu/leon2/start.S                  |  661 +++++++++++++++++++++++
 include/asm-sparc/arch-leon2/asi.h |   36 ++
 include/asm-sparc/leon.h           |    4 +
 include/asm-sparc/leon2.h          |  236 ++++++++
 13 files changed, 2651 insertions(+), 0 deletions(-)
 create mode 100644 cpu/leon2/Makefile
 create mode 100644 cpu/leon2/config.mk
 create mode 100644 cpu/leon2/cpu.c
 create mode 100644 cpu/leon2/cpu_init.c
 create mode 100644 cpu/leon2/interrupts.c
 create mode 100644 cpu/leon2/prom.c
 create mode 100644 cpu/leon2/serial.c
 create mode 100644 cpu/leon2/start.S
 create mode 100644 include/asm-sparc/arch-leon2/asi.h
 create mode 100644 include/asm-sparc/leon2.h
Signature · 1 line
1.5.4
#6 lore raw

PATCH 7/13 SPARC/LEON3: Added GRETH Ethernet 10/100/1000 driver.

In reply to Daniel Hellstrom

Hello Wolfgang,

GRETH is an Ethernet 10/100 or 10/100/1000 MAC with out without a debug link (EDCL). The GRETH core is documented in GRIP.pdf available at www.gaisler.com.

If the GRETH has GigaBit support (GBIT, Scatter gather, checksum offloading etc.) can be determined by a bit in the control register. The GBIT MAC is supported by operating in GRTEH 10/100 legacy mode.

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 drivers/net/Makefile |    1 +
 drivers/net/greth.c  |  661 ++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/greth.h  |   97 ++++++++
 net/eth.c            |    4 +
 4 files changed, 763 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/greth.c
 create mode 100644 drivers/net/greth.h
drivers/net/Makefile +1 -0
index 320dc3e..eafd267 100644
@@ -35,6 +35,7 @@ COBJS-y += e1000.o
 COBJS-y += eepro100.o
 COBJS-y += enc28j60.o
 COBJS-y += fsl_mcdmafec.o
+COBJS-$(CONFIG_GRETH) += greth.o
 COBJS-y += inca-ip_sw.o
 COBJS-y += ks8695eth.o
 COBJS-y += lan91c96.o
drivers/net/greth.c new file +661 -0

661 lines not on this page · raw message

drivers/net/greth.h new file +97 -0

97 lines not on this page · raw message

net/eth.c +4 -0
index 16a6dcb..3b86f87 100644
@@ -60,6 +60,7 @@ extern int npe_initialize(bd_t *);
 extern int uec_initialize(int);
 extern int bfin_EMAC_initialize(bd_t *);
 extern int atstk1000_eth_initialize(bd_t *);
+extern int greth_initialize(bd_t *);
 extern int atngw100_eth_initialize(bd_t *);
 extern int mcffec_initialize(bd_t*);
 extern int mcdmafec_initialize(bd_t*);
@@ -275,6 +276,9 @@ int eth_initialize(bd_t *bis)
 #if defined(CONFIG_ATSTK1000)
 	atstk1000_eth_initialize(bis);
 #endif
+#if defined(CONFIG_GRETH)
+	greth_initialize(bis);
+#endif
 #if defined(CONFIG_ATNGW100)
 	atngw100_eth_initialize(bis);
 #endif
Signature · 1 line
1.5.4
#7 lore raw

PATCH 7/13 SPARC/LEON3: Added GRETH Ethernet 10/100/1000 driver.

Quoted 16 lines · Daniel Hellstrom

Hello Wolfgang,

GRETH is an Ethernet 10/100 or 10/100/1000 MAC with out without a debug link (EDCL). The GRETH core is documented in GRIP.pdf available at www.gaisler.com.

If the GRETH has GigaBit support (GBIT, Scatter gather, checksum offloading etc.) can be determined by a bit in the control register. The GBIT MAC is supported by operating in GRTEH 10/100 legacy mode.

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

Quoted 10 lines
---
 drivers/net/Makefile |    1 +
 drivers/net/greth.c  |  661 ++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/greth.h  |   97 ++++++++
 net/eth.c            |    4 +
 4 files changed, 763 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/greth.c
 create mode 100644 drivers/net/greth.h

<snip>
Applied to net tree. Please be careful where you put your message relative to the "---" line.

regards,
Ben

#8 lore raw

PATCH 8/13 SPARC: added SMC91111 driver in and out macros for LEON processors.

In reply to Daniel Hellstrom

Hello Wolfgang,

This patch makes SPARC/LEON processors able to read and write to the SMC91111 chip using the chip external I/O bus of the memory controller. This patchs defines the standard in and out macros expected by the SMC9111 driver.

To access that I/O bus one must set up the memory controller (MCTRL or FTMCTRL) correctly. It is assumed that the user sets up this correctly when the other MCTRL parameters are set up. It can be set up from the board configuration header file.

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 drivers/net/smc91111.h |   74 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 73 insertions(+), 1 deletions(-)
drivers/net/smc91111.h +73 -1
index 8dcbb3e..6c4af64 100644
@@ -176,7 +176,79 @@ typedef unsigned long int 		dword;
 					};  \
 				})
 
-#else /* if not CONFIG_PXA250 */
+#elif defined(CONFIG_LEON)	/* if not CONFIG_PXA250 */
+
+#define SMC_LEON_SWAP16(_x_)                                        \
+    ({ word _x = (_x_); ((_x << 8) | (_x >> 8)); })
+
+#define SMC_LEON_SWAP32(_x_)                        \
+    ({ dword _x = (_x_);                   \
+       ((_x << 24) |                            \
+       ((0x0000FF00UL & _x) <<  8) |            \
+       ((0x00FF0000UL & _x) >>  8) |            \
+       (_x  >> 24)); })
+
+#define	SMC_inl(r) 	(SMC_LEON_SWAP32((*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0)))))
+#define	SMC_inl_nosw(r) 	((*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0))))
+#define	SMC_inw(r) 	(SMC_LEON_SWAP16((*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0)))))
+#define	SMC_inw_nosw(r) 	((*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0))))
+#define SMC_inb(p)	({ \
+	word ___v = SMC_inw((p) & ~1); \
+	if (p & 1) ___v >>= 8; \
+	else ___v &= 0xff; \
+	___v; })
+#define	SMC_outl(d,r)	(*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0))=SMC_LEON_SWAP32(d))
+#define	SMC_outl_nosw(d,r)	(*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0))=(d))
+#define	SMC_outw(d,r)	(*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0))=SMC_LEON_SWAP16(d))
+#define	SMC_outw_nosw(d,r)	(*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0))=(d))
+#define	SMC_outb(d,r)	({	word __d = (byte)(d);  \
+				word __w = SMC_inw((r)&~1);  \
+				__w &= ((r)&1) ? 0x00FF : 0xFF00;  \
+				__w |= ((r)&1) ? __d<<8 : __d;  \
+				SMC_outw(__w,(r)&~1);  \
+			})
+#define SMC_outsl(r,b,l)	({	int __i; \
+					dword *__b2; \
+					__b2 = (dword *) b; \
+					for (__i = 0; __i < l; __i++) { \
+					    SMC_outl_nosw( *(__b2 + __i), r); \
+					} \
+				})
+#define SMC_outsw(r,b,l)	({	int __i; \
+					word *__b2; \
+					__b2 = (word *) b; \
+					for (__i = 0; __i < l; __i++) { \
+					    SMC_outw_nosw( *(__b2 + __i), r); \
+					} \
+				})
+#define SMC_insl(r,b,l) 	({	int __i ;  \
+					dword *__b2;  \
+			    		__b2 = (dword *) b;  \
+			    		for (__i = 0; __i < l; __i++) {  \
+					  *(__b2 + __i) = SMC_inl_nosw(r);  \
+					  SMC_inl(0);  \
+					};  \
+				})
+
+#define SMC_insw(r,b,l) 	({	int __i ;  \
+					word *__b2;  \
+			    		__b2 = (word *) b;  \
+			    		for (__i = 0; __i < l; __i++) {  \
+					  *(__b2 + __i) = SMC_inw_nosw(r);  \
+					  SMC_inw(0);  \
+					};  \
+				})
+
+#define SMC_insb(r,b,l) 	({	int __i ;  \
+					byte *__b2;  \
+			    		__b2 = (byte *) b;  \
+			    		for (__i = 0; __i < l; __i++) {  \
+					  *(__b2 + __i) = SMC_inb(r);  \
+					  SMC_inb(0);  \
+					};  \
+				})
+
+#else				/* if not CONFIG_PXA250 and not CONFIG_LEON */
 
 #ifndef CONFIG_SMC_USE_IOFUNCS /* these macros don't work on some boards */
 /*
Signature · 1 line
1.5.4
#9 lore raw

PATCH 8/13 SPARC: added SMC91111 driver in and out macros for LEON processors.

Quoted 98 lines · Daniel Hellstrom

Hello Wolfgang,

This patch makes SPARC/LEON processors able to read and write to the SMC91111 chip using the chip external I/O bus of the memory controller. This patchs defines the standard in and out macros expected by the SMC9111 driver.

To access that I/O bus one must set up the memory controller (MCTRL or FTMCTRL) correctly. It is assumed that the user sets up this correctly when the other MCTRL parameters are set up. It can be set up from the board configuration header file.

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 drivers/net/smc91111.h |   74 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 73 insertions(+), 1 deletions(-)
drivers/net/smc91111.h +66 -1
index 8dcbb3e..6c4af64 100644
@@ -176,7 +176,79 @@ typedef unsigned long int 		dword;
 					};  \
 				})
 
-#else /* if not CONFIG_PXA250 */
+#elif defined(CONFIG_LEON)	/* if not CONFIG_PXA250 */
+
+#define SMC_LEON_SWAP16(_x_)                                        \
+    ({ word _x = (_x_); ((_x << 8) | (_x >> 8)); })
+
+#define SMC_LEON_SWAP32(_x_)                        \
+    ({ dword _x = (_x_);                   \
+       ((_x << 24) |                            \
+       ((0x0000FF00UL & _x) <<  8) |            \
+       ((0x00FF0000UL & _x) >>  8) |            \
+       (_x  >> 24)); })
+
+#define	SMC_inl(r) 	(SMC_LEON_SWAP32((*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0)))))
+#define	SMC_inl_nosw(r) 	((*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0))))
+#define	SMC_inw(r) 	(SMC_LEON_SWAP16((*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0)))))
+#define	SMC_inw_nosw(r) 	((*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0))))
+#define SMC_inb(p)	({ \
+	word ___v = SMC_inw((p) & ~1); \
+	if (p & 1) ___v >>= 8; \
+	else ___v &= 0xff; \
+	___v; })
+#define	SMC_outl(d,r)	(*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0))=SMC_LEON_SWAP32(d))
+#define	SMC_outl_nosw(d,r)	(*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0))=(d))
+#define	SMC_outw(d,r)	(*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0))=SMC_LEON_SWAP16(d))
+#define	SMC_outw_nosw(d,r)	(*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0))=(d))
+#define	SMC_outb(d,r)	({	word __d = (byte)(d);  \
+				word __w = SMC_inw((r)&~1);  \
+				__w &= ((r)&1) ? 0x00FF : 0xFF00;  \
+				__w |= ((r)&1) ? __d<<8 : __d;  \
+				SMC_outw(__w,(r)&~1);  \
+			})
+#define SMC_outsl(r,b,l)	({	int __i; \
+					dword *__b2; \
+					__b2 = (dword *) b; \
+					for (__i = 0; __i < l; __i++) { \
+					    SMC_outl_nosw( *(__b2 + __i), r); \
+					} \
+				})
+#define SMC_outsw(r,b,l)	({	int __i; \
+					word *__b2; \
+					__b2 = (word *) b; \
+					for (__i = 0; __i < l; __i++) { \
+					    SMC_outw_nosw( *(__b2 + __i), r); \
+					} \
+				})
+#define SMC_insl(r,b,l) 	({	int __i ;  \
+					dword *__b2;  \
+			    		__b2 = (dword *) b;  \
+			    		for (__i = 0; __i < l; __i++) {  \
+					  *(__b2 + __i) = SMC_inl_nosw(r);  \
+					  SMC_inl(0);  \
+					};  \
+				})
+
+#define SMC_insw(r,b,l) 	({	int __i ;  \
+					word *__b2;  \
+			    		__b2 = (word *) b;  \
+			    		for (__i = 0; __i < l; __i++) {  \
+					  *(__b2 + __i) = SMC_inw_nosw(r);  \
+					  SMC_inw(0);  \
+					};  \
+				})
+
+#define SMC_insb(r,b,l) 	({	int __i ;  \
+					byte *__b2;  \
+			    		__b2 = (byte *) b;  \

drivers/net/smc91111.h typedef unsigned long int dword; · line 254

Quoted 10 lines
drivers/net/smc91111.h +7 -0
+			    		for (__i = 0; __i < l; __i++) {  \
+					  *(__b2 + __i) = SMC_inb(r);  \
+					  SMC_inb(0);  \
+					};  \
+				})
+
+#else				/* if not CONFIG_PXA250 and not CONFIG_LEON */
 
 #ifndef CONFIG_SMC_USE_IOFUNCS /* these macros don't work on some boards */
 /*

I haven't looked at how all the funky macros in this patch are called, but it's generally considered good form to wrap multi-line macros with do {...} while(0) in order to avoid compiler issues. I'll NAK the patch for now based on this.

regards,
Ben

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw

PATCH 8/13 SPARC: added SMC91111 driver in and out macros for LEON processors.

Quoted 15 lines · Alessandro Rubini
Quoted 5 lines
Quoted 5 lines
drivers/net/smc91111.h +5 -0
+#define SMC_insb(r,b,l) 	({	int __i ;  \
+					byte *__b2;  \
+			    		__b2 = (byte *) b;  \
+			    		for (__i = 0; __i < l; __i++) {  \
+					  *(__b2 + __i) = SMC_inb(r);  \
Quoted 9 lines

drivers/net/smc91111.h typedef unsigned long int dword; · line 249

Quoted 4 lines
drivers/net/smc91111.h +3 -0
+					  SMC_inb(0);  \
+					};  \
+				})

[...] it's generally considered good form to wrap multi-line macros with do {...} while(0) in order to avoid compiler issues.

Quoted 6 lines

But this is the "expression statement" gcc slang. the do/while0 thing avoids if/else problems but isn't an expression, it is a statement. This has no issue with if/else (no trailing semicolon or brace) and moreover it is an expression.

Oh, I see. Thanks for taking the time Alessandro. I'm putting this back on list so others can be educated too.

regards,
Ben

#12 lore raw

PATCH 9/13 SPARC/LEON3: added support for GR-XC3S-1500 board with GRLIB template design.

In reply to Daniel Hellstrom

Hello Wolfgang,

This patch adds support for the LEON3 board:
* GR-XC3S-1500 (Low cost Xilinx Spartan FPGA board)

Note that by board support I mean support for the pre synthezied template design for the board. Supporting any configuration is not possible but almost, due to the Plug & Play system...
The FPGA can be programmed with the template design by:

 $ cd grlib/designs/BOARD
 $ make ise-prog-prom-ref

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 MAKEALL                                   |    2 +-
 Makefile                                  |    4 +
 board/gaisler/gr_xc3s_1500/Makefile       |   52 +++++
 board/gaisler/gr_xc3s_1500/config.mk      |   34 +++
 board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c |   39 ++++
 board/gaisler/gr_xc3s_1500/u-boot.lds     |  162 +++++++++++++++
 include/configs/gr_xc3s_1500.h            |  321 +++++++++++++++++++++++++++++
 7 files changed, 613 insertions(+), 1 deletions(-)
 create mode 100644 board/gaisler/gr_xc3s_1500/Makefile
 create mode 100644 board/gaisler/gr_xc3s_1500/config.mk
 create mode 100644 board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c
 create mode 100644 board/gaisler/gr_xc3s_1500/u-boot.lds
 create mode 100644 include/configs/gr_xc3s_1500.h
MAKEALL +1 -1
index d63a228..dc11ed8 100755
@@ -714,7 +714,7 @@ LIST_sh="		\
 ## SPARC Systems
 #########################################################################
 
-LIST_sparc=""
+LIST_sparc="gr_xc3s_1500"
 
 #-----------------------------------------------------------------------
 
Makefile +4 -0
index 8d4c10d..99811aa 100644
@@ -2862,6 +2862,10 @@ ms7722se_config :	unconfig
 ## LEON3
 #########################################################################
 
+# Gaisler GR-XC3S-1500 board
+gr_xc3s_1500_config : unconfig
+	@$(MKCONFIG) $(@:_config=) sparc leon3 gr_xc3s_1500 gaisler
+
 #########################################################################
 ## LEON2
 #########################################################################
board/gaisler/gr_xc3s_1500/Makefile new file +52 -0

52 lines not on this page · raw message

board/gaisler/gr_xc3s_1500/config.mk new file +34 -0
new file mode 100644
index 0000000..35cbc1b
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2007
+# Daniel Hellstrom, Gaisler Research, daniel at gaisler.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
+#
+
+#
+# GR-XC3S-1500 board
+#
+
+# U-BOOT IN FLASH
+TEXT_BASE = 0x00000000
+
+# U-BOOT IN RAM
+#TEXT_BASE = 0x40000000
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c new file +39 -0
new file mode 100644
index 0000000..1ee7024
@@ -0,0 +1,39 @@
+/*
+ * (C) Copyright 2007
+ * Daniel Hellstrom, daniel at gaisler.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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <config.h>
+#include <asm/leon.h>
+
+long int initdram(int board_type)
+{
+	return 1;
+}
+
+int checkboard(void)
+{
+	puts("Board: GR-XC3S-1500\n");
+	return 0;
+}
+
+int misc_init_r(void)
+{
+	return 0;
+}
board/gaisler/gr_xc3s_1500/u-boot.lds new file +162 -0

162 lines not on this page · raw message

include/configs/gr_xc3s_1500.h new file +321 -0

321 lines not on this page · raw message

Signature · 1 line
1.5.4
#13 lore raw

PATCH 10/13 SPARC/LEON3: added support for Gaisler GRSIM/TSIM2 SPARC/LEON3 simulatorn.

In reply to Daniel Hellstrom

Hello Wolfgang,

This patch adds support for the LEON3 simulators TSIM and GRSIM.

The simulators GRSIM and TSIM for LEON3 has been added as a board. A separate board is needed due to that the FLASH CFI interface has not been implemented in the simulators. Configuring the GR-XC3S-1500 board without FLASH support should run in the simulator.

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 MAKEALL                        |    2 +-
 Makefile                       |    4 +
 board/gaisler/grsim/Makefile   |   50 ++++++
 board/gaisler/grsim/config.mk  |   34 ++++
 board/gaisler/grsim/grsim.c    |   43 +++++
 board/gaisler/grsim/u-boot.lds |  161 +++++++++++++++++++
 include/configs/grsim.h        |  340 ++++++++++++++++++++++++++++++++++++++++
 7 files changed, 633 insertions(+), 1 deletions(-)
 create mode 100644 board/gaisler/grsim/Makefile
 create mode 100644 board/gaisler/grsim/config.mk
 create mode 100644 board/gaisler/grsim/grsim.c
 create mode 100644 board/gaisler/grsim/u-boot.lds
 create mode 100644 include/configs/grsim.h
MAKEALL +1 -1
index dc11ed8..d31addf 100755
@@ -714,7 +714,7 @@ LIST_sh="		\
 ## SPARC Systems
 #########################################################################
 
-LIST_sparc="gr_xc3s_1500"
+LIST_sparc="gr_xc3s_1500	grsim"
 
 #-----------------------------------------------------------------------
 
Makefile +4 -0
index 99811aa..27e480f 100644
@@ -2866,6 +2866,10 @@ ms7722se_config :	unconfig
 gr_xc3s_1500_config : unconfig
 	@$(MKCONFIG) $(@:_config=) sparc leon3 gr_xc3s_1500 gaisler
 
+# Gaisler LEON3 GRSIM simulator
+grsim_config : unconfig
+	@$(MKCONFIG) $(@:_config=) sparc leon3 grsim gaisler
+
 #########################################################################
 ## LEON2
 #########################################################################
board/gaisler/grsim/Makefile new file +50 -0

50 lines not on this page · raw message

board/gaisler/grsim/config.mk new file +34 -0
new file mode 100644
index 0000000..81cd415
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2007
+# Daniel Hellstrom, Gaisler Research, daniel at gaisler.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
+#
+
+#
+# GRSIM simulating a LEON3 GR-XC3S-1500 board
+#
+
+# U-BOOT IN FLASH
+TEXT_BASE = 0x00000000
+
+# U-BOOT IN RAM
+#TEXT_BASE = 0x40000000
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
board/gaisler/grsim/grsim.c new file +43 -0

43 lines not on this page · raw message

board/gaisler/grsim/u-boot.lds new file +161 -0

161 lines not on this page · raw message

include/configs/grsim.h new file +340 -0

340 lines not on this page · raw message

Signature · 1 line
1.5.4
#14 lore raw

PATCH 11/13 SPARC/LEON3: added support for Altera NIOS Development kit (STRATIX II Edition) with GRLIB template design.

In reply to Daniel Hellstrom

Hello Wolfgang,

This patch adds support for the LEON3 board:
* ALTERA NIOS Development board, Stratix II edition

Note that by board support I mean support for the pre synthezied template design for the board. Supporting any configuration is not possible but almost, due to the Plug & Play system...
The FPGA can be programmed with the template design by:

 $ cd grlib/designs/BOARD
 $ make ise-prog-prom-ref

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 MAKEALL                             |    2 +-
 Makefile                            |    5 +
 board/gaisler/gr_ep2s60/Makefile    |   52 +++++
 board/gaisler/gr_ep2s60/config.mk   |   35 ++++
 board/gaisler/gr_ep2s60/gr_ep2s60.c |   39 ++++
 board/gaisler/gr_ep2s60/u-boot.lds  |  160 ++++++++++++++++
 include/configs/gr_ep2s60.h         |  356 +++++++++++++++++++++++++++++++++++
 7 files changed, 648 insertions(+), 1 deletions(-)
 create mode 100644 board/gaisler/gr_ep2s60/Makefile
 create mode 100644 board/gaisler/gr_ep2s60/config.mk
 create mode 100644 board/gaisler/gr_ep2s60/gr_ep2s60.c
 create mode 100644 board/gaisler/gr_ep2s60/u-boot.lds
 create mode 100644 include/configs/gr_ep2s60.h
MAKEALL +1 -1
index d31addf..14961f7 100755
@@ -714,7 +714,7 @@ LIST_sh="		\
 ## SPARC Systems
 #########################################################################
 
-LIST_sparc="gr_xc3s_1500	grsim"
+LIST_sparc="gr_xc3s_1500	gr_ep2s60	grsim"
 
 #-----------------------------------------------------------------------
 
Makefile +5 -0
index 27e480f..96a7910 100644
@@ -2866,6 +2866,11 @@ ms7722se_config :	unconfig
 gr_xc3s_1500_config : unconfig
 	@$(MKCONFIG) $(@:_config=) sparc leon3 gr_xc3s_1500 gaisler
 
+# Gaisler GRLIB template design (GPL SPARC/LEON3) for Altera NIOS
+# Development board Stratix II edition, FPGA Device EP2S60.
+gr_ep2s60_config: unconfig
+	@$(MKCONFIG) $(@:_config=) sparc leon3 gr_ep2s60 gaisler
+
 # Gaisler LEON3 GRSIM simulator
 grsim_config : unconfig
 	@$(MKCONFIG) $(@:_config=) sparc leon3 grsim gaisler
board/gaisler/gr_ep2s60/Makefile new file +52 -0

52 lines not on this page · raw message

board/gaisler/gr_ep2s60/config.mk new file +35 -0
new file mode 100644
index 0000000..2ee0957
@@ -0,0 +1,35 @@
+#
+# (C) Copyright 2008
+# Daniel Hellstrom, Gaisler Research, daniel at gaisler.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
+#
+
+#
+# Altera NIOS delopment board Stratix II edition, FPGA device EP2S60,
+# with GRLIB Template design (GPL Open Source SPARC/LEON3)
+#
+
+# U-BOOT IN FLASH
+TEXT_BASE = 0x00000000
+
+# U-BOOT IN SDRAM
+#TEXT_BASE = 0x40000000
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
board/gaisler/gr_ep2s60/gr_ep2s60.c new file +39 -0
new file mode 100644
index 0000000..e8617f0
@@ -0,0 +1,39 @@
+/*
+ * (C) Copyright 2008
+ * Daniel Hellstrom, daniel at gaisler.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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <config.h>
+#include <asm/leon.h>
+
+long int initdram(int board_type)
+{
+	return 1;
+}
+
+int checkboard(void)
+{
+	puts("Board: EP2S60 GRLIB\n");
+	return 0;
+}
+
+int misc_init_r(void)
+{
+	return 0;
+}
board/gaisler/gr_ep2s60/u-boot.lds new file +160 -0

160 lines not on this page · raw message

include/configs/gr_ep2s60.h new file +356 -0

356 lines not on this page · raw message

Signature · 1 line
1.5.4
#15 lore raw

PATCH 12/13 SPARC/LEON3: added support for GR-CPCI-AX2000 FPGA AX board.

In reply to Daniel Hellstrom

Hello Wolfgang,

This patch adds support for the LEON3 board:
* GR-CPCI-AX2000 (AX system with switchable AX FPGA)

Note that by board support I mean support for the pre synthezied template design for the board. Supporting any configuration is not possible but almost, due to the Plug & Play system...
The FPGA can be programmed with the template design by:

 $ cd grlib/designs/BOARD
 $ make ise-prog-prom-ref

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 MAKEALL                                       |    2 +-
 Makefile                                      |    4 +
 board/gaisler/gr_cpci_ax2000/Makefile         |   52 ++++
 board/gaisler/gr_cpci_ax2000/config.mk        |   37 +++
 board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c |   39 +++
 board/gaisler/gr_cpci_ax2000/u-boot.lds       |  160 +++++++++++
 include/configs/gr_cpci_ax2000.h              |  380 +++++++++++++++++++++++++
 7 files changed, 673 insertions(+), 1 deletions(-)
 create mode 100644 board/gaisler/gr_cpci_ax2000/Makefile
 create mode 100644 board/gaisler/gr_cpci_ax2000/config.mk
 create mode 100644 board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c
 create mode 100644 board/gaisler/gr_cpci_ax2000/u-boot.lds
 create mode 100644 include/configs/gr_cpci_ax2000.h
MAKEALL +1 -1
index 14961f7..5019f8a 100755
@@ -714,7 +714,7 @@ LIST_sh="		\
 ## SPARC Systems
 #########################################################################
 
-LIST_sparc="gr_xc3s_1500	gr_ep2s60	grsim"
+LIST_sparc="gr_xc3s_1500	gr_cpci_ax2000	gr_ep2s60	grsim"
 
 #-----------------------------------------------------------------------
 
Makefile +4 -0
index 96a7910..a094606 100644
@@ -2866,6 +2866,10 @@ ms7722se_config :	unconfig
 gr_xc3s_1500_config : unconfig
 	@$(MKCONFIG) $(@:_config=) sparc leon3 gr_xc3s_1500 gaisler
 
+# Gaisler GR-CPCI-AX2000 board, a General purpose FPGA-AX system
+gr_cpci_ax2000_config : unconfig
+	@$(MKCONFIG) $(@:_config=) sparc leon3 gr_cpci_ax2000 gaisler
+
 # Gaisler GRLIB template design (GPL SPARC/LEON3) for Altera NIOS
 # Development board Stratix II edition, FPGA Device EP2S60.
 gr_ep2s60_config: unconfig
board/gaisler/gr_cpci_ax2000/Makefile new file +52 -0

52 lines not on this page · raw message

board/gaisler/gr_cpci_ax2000/config.mk new file +37 -0
new file mode 100644
index 0000000..6c4d56b
@@ -0,0 +1,37 @@
+#
+# (C) Copyright 2008
+# Daniel Hellstrom, Gaisler Research, daniel at gaisler.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
+#
+
+#
+# GR-CPCI-AX2000 board
+#
+
+# U-BOOT IN FLASH
+TEXT_BASE = 0x00000000
+
+# U-BOOT IN RAM or SDRAM with -nosram flag set when starting GRMON
+#TEXT_BASE = 0x40000000
+
+# U-BOOT IN SDRAM
+#TEXT_BASE = 0x60000000
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c new file +39 -0
new file mode 100644
index 0000000..d99b455
@@ -0,0 +1,39 @@
+/*
+ * (C) Copyright 2008
+ * Daniel Hellstrom, daniel at gaisler.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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <config.h>
+#include <asm/leon.h>
+
+long int initdram(int board_type)
+{
+	return 1;
+}
+
+int checkboard(void)
+{
+	puts("Board: GR-CPCI-AX2000\n");
+	return 0;
+}
+
+int misc_init_r(void)
+{
+	return 0;
+}
board/gaisler/gr_cpci_ax2000/u-boot.lds new file +160 -0

160 lines not on this page · raw message

include/configs/gr_cpci_ax2000.h new file +380 -0

380 lines not on this page · raw message

Signature · 1 line
1.5.4
#16 lore raw

PATCH 13/13 SPARC/LEON2: added support for Gaisler simulator GRSIM/TSIM for SPARC/LEON2 targets.

In reply to Daniel Hellstrom

Hello Wolfgang,

This patch adds support for the LEON2 simulators TSIM and GRSIM.

The simulators GRSIM and TSIM for LEON3 has been added as a board. A separate board is needed due to that the FLASH CFI interface has not been implemented in the simulators.

This patch is also available at ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom

---
 MAKEALL                                 |    2 +-
 Makefile                                |    4 +
 board/gaisler/grsim_leon2/Makefile      |   50 +++++
 board/gaisler/grsim_leon2/config.mk     |   34 +++
 board/gaisler/grsim_leon2/grsim_leon2.c |   43 ++++
 board/gaisler/grsim_leon2/u-boot.lds    |  159 ++++++++++++++
 include/configs/grsim_leon2.h           |  349 +++++++++++++++++++++++++++++++
 7 files changed, 640 insertions(+), 1 deletions(-)
 create mode 100644 board/gaisler/grsim_leon2/Makefile
 create mode 100644 board/gaisler/grsim_leon2/config.mk
 create mode 100644 board/gaisler/grsim_leon2/grsim_leon2.c
 create mode 100644 board/gaisler/grsim_leon2/u-boot.lds
 create mode 100644 include/configs/grsim_leon2.h
MAKEALL +1 -1
index 5019f8a..c3be0c2 100755
@@ -714,7 +714,7 @@ LIST_sh="		\
 ## SPARC Systems
 #########################################################################
 
-LIST_sparc="gr_xc3s_1500	gr_cpci_ax2000	gr_ep2s60	grsim"
+LIST_sparc="gr_xc3s_1500	gr_cpci_ax2000	gr_ep2s60	grsim	grsim_leon2"
 
 #-----------------------------------------------------------------------
 
Makefile +4 -0
index a094606..13a1147 100644
@@ -2883,6 +2883,10 @@ grsim_config : unconfig
 ## LEON2
 #########################################################################
 
+# Gaisler LEON2 GRSIM simulator
+grsim_leon2_config : unconfig
+	@$(MKCONFIG) $(@:_config=) sparc leon2 grsim_leon2 gaisler
+
 #########################################################################
 #########################################################################
 #########################################################################
board/gaisler/grsim_leon2/Makefile new file +50 -0

50 lines not on this page · raw message

board/gaisler/grsim_leon2/config.mk new file +34 -0
new file mode 100644
index 0000000..65eba1b
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2007
+# Daniel Hellstrom, Gaisler Research, daniel at gaisler.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
+#
+
+#
+# GRSIM simulating a LEON2 board
+#
+
+# RUN U-BOOT FROM PROM
+TEXT_BASE = 0x00000000
+
+# RUN U-BOOT FROM RAM
+#TEXT_BASE = 0x40000000
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
board/gaisler/grsim_leon2/grsim_leon2.c new file +43 -0

43 lines not on this page · raw message

board/gaisler/grsim_leon2/u-boot.lds new file +159 -0

159 lines not on this page · raw message

include/configs/grsim_leon2.h new file +349 -0

349 lines not on this page · raw message

Signature · 1 line
1.5.4