Examples of SpWBoot generation

This software provides a simple way to demonstrate one LEON processor development board booting another over SpaceWire RMAP. 
For situations where a second LEON system is not available or desired, dummy files may be used instead of executing the flow.
This folder contains generated include files for different LEON platforms:

 GR712RC-target/
   Master: GR-CPCI-UT699 board (SPW-2)
   Target: GR712RC-BOARD (SPW-0)

 UT699-target/
   Master: GR712RC-BOARD (SPW-0)
   Target: GR-CPCI-UT699 board (SPW-2)

GR740-target/
   Target: GR-CPCI-GR740 board (SPW-1)

For the following Makefile targets the corresponding files are generated:

 master:
  spwboot_master.h

 target:
  spwboot_rmap.h
  spwboot_target.h
  spwboot.mk

 spwboot:
  bdinit.o
  spw_bootprom
  spwboot
  spwboot_rmap_img.h


Below is an execution log of the Makefile targets master (GR712RC), target (UT699) and spwboot.
Thereafter comes an execution log of the Makefile target spwboot for the GR740 target.

================================================

~$ make master
gcc -g -O2 obj2array.c -o obj2array -lbfd
GRSPW=grspw0 grmon -ftdi -c master_gen.tcl

  GRMON2 LEON debug monitor v2.0.83 32-bit 
  
  Copyright (C) 2017 Cobham Gaisler - All rights reserved.
  For latest updates, go to http://www.gaisler.com/
  Comments or bug-reports to support@gaisler.com
  
 JTAG chain (1): GR712RC 
  Device ID:           0x712
  GRLIB build version: 3696
  Detected system:     GR712RC
  Detected frequency:  48 MHz
  
  Component                            Vendor
  LEON3-FT SPARC V8 Processor          Cobham Gaisler
  LEON3-FT SPARC V8 Processor          Cobham Gaisler
  JTAG Debug Link                      Cobham Gaisler
  GR Ethernet MAC                      Cobham Gaisler
  SatCAN controller                    Cobham Gaisler
  GRSPW2 SpaceWire Serial Link         Cobham Gaisler
  GRSPW2 SpaceWire Serial Link         Cobham Gaisler
  GRSPW2 SpaceWire Serial Link         Cobham Gaisler
  GRSPW2 SpaceWire Serial Link         Cobham Gaisler
  GRSPW2 SpaceWire Serial Link         Cobham Gaisler
  GRSPW2 SpaceWire Serial Link         Cobham Gaisler
  AMBA Wrapper for Core1553BRM         Cobham Gaisler
  CCSDS Telecommand Decoder            Cobham Gaisler
  CCSDS Telemetry Encoder              Cobham Gaisler
  SLINK Master                         Cobham Gaisler
  Memory controller with EDAC          Cobham Gaisler
  AHB/APB Bridge                       Cobham Gaisler
  LEON3 Debug Support Unit             Cobham Gaisler
  AHB/APB Bridge                       Cobham Gaisler
  OC CAN AHB interface                 Cobham Gaisler
  Generic FT AHB SRAM module           Cobham Gaisler
  Generic UART                         Cobham Gaisler
  Multi-processor Interrupt Ctrl.      Cobham Gaisler
  Modular Timer Unit                   Cobham Gaisler
  SPI Controller                       Cobham Gaisler
  CAN Bus multiplexer                  Cobham Gaisler
  General Purpose Register             Cobham Gaisler
  ASCS Master                          Cobham Gaisler
  General Purpose I/O port             Cobham Gaisler
  General Purpose I/O port             Cobham Gaisler
  AMBA Wrapper for OC I2C-master       Cobham Gaisler
  Clock gating unit                    Cobham Gaisler
  AHB Status Register                  Cobham Gaisler
  Generic UART                         Cobham Gaisler
  Generic UART                         Cobham Gaisler
  Generic UART                         Cobham Gaisler
  Generic UART                         Cobham Gaisler
  Generic UART                         Cobham Gaisler
  Timer Unit with Latches              Cobham Gaisler
  
  Use command 'info sys' to print a detailed report of attached cores

  
Exiting GRMON
~$ make target
GRSPW=grspw2 IS_GR740=0 grmon -digilent -edac -c target_gen.tcl

  GRMON2 LEON debug monitor v2.0.83 32-bit 
  
  Copyright (C) 2017 Cobham Gaisler - All rights reserved.
  For latest updates, go to http://www.gaisler.com/
  Comments or bug-reports to support@gaisler.com
  
 JTAG chain (1): UT699A 
  Device ID:           0x699
  GRLIB build version: 2564
  Detected system:     UT699
  Detected frequency:  66 MHz
  
  Component                            Vendor
  LEON3-FT SPARC V8 Processor          Cobham Gaisler
  AHB Debug UART                       Cobham Gaisler
  JTAG Debug Link                      Cobham Gaisler
  Fast 32-bit PCI Bridge               Cobham Gaisler
  PCI/AHB DMA controller               Cobham Gaisler
  GR Ethernet MAC                      Cobham Gaisler
  SpaceWire Serial Link                Cobham Gaisler
  SpaceWire Serial Link                Cobham Gaisler
  SpaceWire Serial Link                Cobham Gaisler
  SpaceWire Serial Link                Cobham Gaisler
  Memory controller with EDAC          Cobham Gaisler
  AHB/APB Bridge                       Cobham Gaisler
  LEON3 Debug Support Unit             Cobham Gaisler
  OC CAN AHB interface                 Cobham Gaisler
  Generic UART                         Cobham Gaisler
  Multi-processor Interrupt Ctrl.      Cobham Gaisler
  Modular Timer Unit                   Cobham Gaisler
  Clock gating unit                    Cobham Gaisler
  PCI Arbiter                          European Space Agency
  General Purpose I/O port             Cobham Gaisler
  AHB Status Register                  Cobham Gaisler
  
  Use command 'info sys' to print a detailed report of attached cores

  
Exiting GRMON
~$ make spwboot
sparc-elf-gcc -msoft-float -O2  hello.c -o hello
Error opening file 'spw_bootprom': 2
Error opening file 'spw_bootprom': 2
Error opening file 'spw_bootprom': 2
sparc-elf-gcc -msoft-float -O2 -g -mtune=ut699 -DSPWBOOT_WASHWORD=0 -DGR740=0 -c bdinit.c -o bdinit.o
mkprom2 -leon3 -freq 66 -ramsize 8192 -baud 38400  -nopnp -bdinit -uart 0x80000100 -irqmp 0x80000200 -gpt 0x80000300  hello -o spw_bootprom -rstaddr 0x40008000 -memc 0x40000000 -edac -edac-clean 0x40000000 0x00008000 0 0

LEON2/3/ERC32 MKPROM prom builder for BCC, ECOS, RTEMS and ThreadX v2.0.60
Copyright Gaisler Research 2004-2007, all rights reserved.


creating LEON3 boot prom: spw_bootprom
Searching for compiler to use (sparc-elf, sparc-rtems or sparc-linux):
sparc-elf-gcc (BCC 4.4.2 release 1.0.45) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

sparc-elf-gcc -msoft-float -O2 -g -mtune=ut699 -DSPWBOOT_WASHWORD=0x4000D0E0 -DGR740=0 -c bdinit.c -o bdinit.o
mkprom2 -leon3 -freq 66 -ramsize 8192 -baud 38400  -nopnp -bdinit -uart 0x80000100 -irqmp 0x80000200 -gpt 0x80000300  hello -o spw_bootprom -rstaddr 0x40008000 -memc 0x40000000 -edac -edac-clean 0x40000000 0x00008000 0x4000D0E0 0x007F2F20

LEON2/3/ERC32 MKPROM prom builder for BCC, ECOS, RTEMS and ThreadX v2.0.60
Copyright Gaisler Research 2004-2007, all rights reserved.


creating LEON3 boot prom: spw_bootprom
Searching for compiler to use (sparc-elf, sparc-rtems or sparc-linux):
sparc-elf-gcc (BCC 4.4.2 release 1.0.45) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

./obj2array spw_bootprom > spwboot_rmap_img.h
.text: addr=0x40008000 size=20704, flags=113
SKIPPING .debug_line: addr=(nil) size=1842, flags=2108
SKIPPING .debug_info: addr=(nil) size=1962, flags=2108
SKIPPING .debug_abbrev: addr=(nil) size=751, flags=2108
SKIPPING .debug_aranges: addr=(nil) size=288, flags=2108
SKIPPING .debug_frame: addr=(nil) size=184, flags=2108
SKIPPING .debug_pubnames: addr=(nil) size=149, flags=2108
SKIPPING .debug_ranges: addr=(nil) size=72, flags=2108
SKIPPING .debug_str: addr=(nil) size=487, flags=1802108
SKIPPING .comment: addr=(nil) size=75, flags=108
sparc-elf-gcc -msoft-float -O2 -g -mtune=ut699 -DREMOTE_ENTRYPOINT=0x40008000 -DGR740=0 -DGR740_SPWPORT=1 -o spwboot spwboot.c spwapi.c
~$ 

================================================

~$ make spwboot
sparc-elf-gcc -msoft-float -O2 -Wl,-msparcleon0 hello.c -o hello
sparc-elf-gcc -msoft-float -O2 -g -mtune=ut699 -DSPWBOOT_WASHWORD=0x0000D100 -DGR740=1 -c bdinit.c -o bdinit.o
mkprom2 -leon3 -freq 250 -ramsize 131072 -baud 38400 -sparcleon0 -nopnp -bdinit -uart 0xFF900000 -irqmp 0xFF904000 -gpt 0xFF908000  hello -o spw_bootprom -rstaddr 0x00008000 -memc 0x00000000 -edac -edac-clean 0x00000000 0x00008000 0x0000D100 0x07FF2F00

LEON2/3/ERC32 MKPROM prom builder for BCC, ECOS, RTEMS and ThreadX v2.0.60
Copyright Gaisler Research 2004-2007, all rights reserved.


creating LEON3 boot prom: spw_bootprom
Searching for compiler to use (sparc-elf, sparc-rtems or sparc-linux):
sparc-elf-gcc (BCC 4.4.2 release 1.0.45) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

sparc-elf-gcc -msoft-float -O2 -g -mtune=ut699 -DSPWBOOT_WASHWORD=0x0000D100 -DGR740=1 -c bdinit.c -o bdinit.o
mkprom2 -leon3 -freq 250 -ramsize 131072 -baud 38400 -sparcleon0 -nopnp -bdinit -uart 0xFF900000 -irqmp 0xFF904000 -gpt 0xFF908000  hello -o spw_bootprom -rstaddr 0x00008000 -memc 0x00000000 -edac -edac-clean 0x00000000 0x00008000 0x0000D100 0x07FF2F00

LEON2/3/ERC32 MKPROM prom builder for BCC, ECOS, RTEMS and ThreadX v2.0.60
Copyright Gaisler Research 2004-2007, all rights reserved.


creating LEON3 boot prom: spw_bootprom
Searching for compiler to use (sparc-elf, sparc-rtems or sparc-linux):
sparc-elf-gcc (BCC 4.4.2 release 1.0.45) 4.4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

./obj2array spw_bootprom > spwboot_rmap_img.h
.text: addr=0x8000 size=20736, flags=113
SKIPPING .debug_line: addr=(nil) size=1845, flags=2108
SKIPPING .debug_info: addr=(nil) size=1976, flags=2108
SKIPPING .debug_abbrev: addr=(nil) size=787, flags=2108
SKIPPING .debug_aranges: addr=(nil) size=288, flags=2108
SKIPPING .debug_frame: addr=(nil) size=184, flags=2108
SKIPPING .debug_pubnames: addr=(nil) size=149, flags=2108
SKIPPING .debug_ranges: addr=(nil) size=72, flags=2108
SKIPPING .debug_str: addr=(nil) size=487, flags=1802108
SKIPPING .comment: addr=(nil) size=75, flags=108
sparc-elf-gcc -msoft-float -O2 -g -mtune=ut699 -DREMOTE_ENTRYPOINT=0x00008000 -DGR740=1 -DGR740_SPWPORT=1 -o spwboot spwboot.c spwapi.c
~$ 