spinnaker_tools (BMP) latest
SpiNNaker BMP firmware
Loading...
Searching...
No Matches
Macros | Functions
bmp_ssp.c File Reference

Synchronous Serial Port (SSP) peripheral handling for BC&MP. More...

#include "lpc17xx.h"
#include "lpc17xx_clkpwr.h"
#include "lpc17xx_ssp.h"
#include "bmp.h"

Macros

#define SSP0_CLK   25000000
 SSP0 clock: 25 MHz.
 
#define SSP1_CLK_H   25000000
 SSP1 clock: 25 MHz (fast)
 
#define SSP1_CLK_L   5000000
 SSP1 clock: 5 MHz (slow)
 

Functions

static void delay (uint32_t n)
 Simple delay (~30ns per loop?)
 
void ssp1_copy (uint32_t count, const uint8_t *buf)
 Copy buffer to FPGAs.
 
void fpga_word (uint32_t addr, uint32_t fpga, uint32_t *buf, uint32_t dir)
 Read or write an FPGA.
 
static void ssp0_send (uint32_t d)
 Send word to Serial Flash.
 
void ssp0_write (uint32_t cmd, uint32_t addr, uint32_t len, const uint8_t *buf)
 Write buffer to Serial Flash.
 
void ssp0_read (uint32_t cmd, uint32_t addr, uint32_t len, uint8_t *buf)
 Read buffer from Serial Flash.
 
void ssp0_copy (uint32_t addr, uint32_t len)
 Copy from Serial Flash on SSP0 to FPGA(s) on SSP1.
 
void sf_write (uint32_t addr, uint32_t len, const uint8_t *buf)
 Write to flash.
 
void sf_read (uint32_t addr, uint32_t len, uint8_t *buf)
 Read from flash.
 
uint32_t sf_crc32 (uint32_t addr, uint32_t len)
 Compute CRC of data on flash.
 
void ssp1_slow (void)
 Configure SSP1 to be slow.
 
void ssp1_fast (void)
 Configure SSP1 to be fast.
 
void configure_ssp (void)
 Configure SSP (serial flash, FPGAs)
 

Detailed Description

Synchronous Serial Port (SSP) peripheral handling for BC&MP.

Author
Steve Temple, APT Group, School of Computer Science

SSP1 is connected to the FPGAs and is used to load their bitmaps. It can also be used to communicate with the FPGAs when the FPGA code supports this function.

SSP0 is connected to a serial Flash device which currently holds two areas of data. The area at 0 is the SpiNNaker IP address block which is read by the root chip when it is reset. A buffer and software multiplexer dual-port the serial Flash. It can currently only be written by the BMP. The second area holds the FPGA bitmap and starts at 0x10000. This is loaded whenever power is applied to the FPGAs

Function Documentation

◆ delay()

static void delay ( uint32_t  n)
static

Simple delay (~30ns per loop?)

Parameters
[in]nNumber of times to loop

◆ ssp1_copy()

void ssp1_copy ( uint32_t  count,
const uint8_t *  buf 
)

Copy buffer to FPGAs.

Parameters
[in]countNumber of bytes in buf to copy
[in]bufBuffer containing data to copy

◆ fpga_word()

void fpga_word ( uint32_t  addr,
uint32_t  fpga,
uint32_t *  buf,
uint32_t  dir 
)

Read or write an FPGA.

Parameters
[in]addrWhere on the FPGA to access
[in]fpgaWhich FPGA to access
[in,out]bufBuffer; contains word to write to FPGA, or is location to put word read from FPGA
[in]dirReading (FPGA_READ) or writing (FPGA_WRITE)

◆ ssp0_send()

static void ssp0_send ( uint32_t  d)
static

Send word to Serial Flash.

Parameters
[in]dWord to send

◆ ssp0_write()

void ssp0_write ( uint32_t  cmd,
uint32_t  addr,
uint32_t  len,
const uint8_t *  buf 
)

Write buffer to Serial Flash.

Parameters
[in]cmdCommand for SSP0
[in]addrWhere to write to
[in]lenHow many bytes to write
[in]bufBuffer of bytes to write

◆ ssp0_read()

void ssp0_read ( uint32_t  cmd,
uint32_t  addr,
uint32_t  len,
uint8_t *  buf 
)

Read buffer from Serial Flash.

Parameters
[in]cmdCommand for SSP0
[in]addrWhere to read from
[in]lenHow many bytes to read
[out]bufBuffer to receive read bytes

◆ ssp0_copy()

void ssp0_copy ( uint32_t  addr,
uint32_t  len 
)

Copy from Serial Flash on SSP0 to FPGA(s) on SSP1.

Parameters
[in]addrAddress of data to move (same address used for all)
[in]lenLength of data to move

◆ sf_write()

void sf_write ( uint32_t  addr,
uint32_t  len,
const uint8_t *  buf 
)

Write to flash.

Parameters
[in]addrWhere to write to
[in]lenHow many bytes to write
[in]bufThe data to write

◆ sf_read()

void sf_read ( uint32_t  addr,
uint32_t  len,
uint8_t *  buf 
)

Read from flash.

Parameters
[in]addrWhere to read from
[in]lenHow many bytes to read
[out]bufThe buffer receiving the data

◆ sf_crc32()

uint32_t sf_crc32 ( uint32_t  addr,
uint32_t  len 
)

Compute CRC of data on flash.

Parameters
[in]addrWhere the data is
[in]lenThe length of the data
Returns
CRC of the data