spinnaker_tools (BMP) 3.4.0
SpiNNaker BMP firmware
Loading...
Searching...
No Matches
Enumerations | Functions | Variables
bmp_cmd.c File Reference

Command handling for BC&MP. More...

#include "lpc17xx.h"
#include <string.h>
#include "bmp.h"

Enumerations

enum  bmp_info_subcommand {
  BMP_INFO_BASIC = 0 , BMP_INFO_EE_BUF = 1 , BMP_INFO_CAN_STAT = 2 , BMP_INFO_BOARD_STAT = 3 ,
  BMP_INFO_IP_ADDR = 4 , BMP_INFO_UNINIT_VEC = 5
}
 Subcommands supported by cmd_bmp_info()
 

Functions

static void fpga_boot (uint32_t base, uint32_t len, uint32_t mask)
 Boot an FPGA.
 
static void fpga_xreg (uint32_t count, uint8_t *data)
 Write to FPGA registers.
 
static void sf_scan (void)
 Scan serial flash, booting and configuring FPGAs.
 
void flash_buf_init (void)
 Initialise flash_buf.
 
static uint32_t cmd_flash_erase (sdp_msg_t *msg)
 Erase flash.
 
static uint32_t cmd_flash_write (sdp_msg_t *msg)
 Write to flash.
 
static uint32_t cmd_xilinx (sdp_msg_t *msg)
 Control FPGA.
 
uint32_t cmd_fpga_read (sdp_msg_t *msg)
 Read from FPGA.
 
uint32_t cmd_fpga_write (sdp_msg_t *msg)
 Write to FPGA.
 
static uint32_t cmd_sf (sdp_msg_t *msg)
 Access serial flash.
 
static uint32_t cmd_ee (sdp_msg_t *msg)
 Access EEPROM.
 
void proc_led (uint32_t arg, uint32_t mask)
 Control the LEDs on this board; call led_set()
 
static uint32_t cmd_led (sdp_msg_t *msg)
 Control the LEDs.
 
void proc_reset (uint32_t arg, uint32_t mask)
 Board reset handler; calls reset_spin()
 
static uint32_t cmd_reset (sdp_msg_t *msg)
 Reset a board.
 
void proc_power (uint32_t arg, uint32_t mask)
 Control power for this board; calls set_power() (and sf_scan() and reset_spin() if powering on)
 
static uint32_t cmd_power (sdp_msg_t *msg)
 Control power.
 
static uint32_t cmd_ver (sdp_msg_t *msg)
 Get version information.
 
static uint32_t cmd_bmp_info (sdp_msg_t *msg)
 Return various useful bits of information about the BMP.
 
static uint32_t cmd_fill (sdp_msg_t *msg)
 Fill an area of memory.
 
static uint32_t cmd_read (sdp_msg_t *msg)
 Read an area of memory.
 
static uint32_t cmd_write (sdp_msg_t *msg)
 Write an area of memory.
 
static uint32_t cmd_iptag (sdp_msg_t *msg)
 Command to manipulate IPTags.
 
static uint32_t cmd_i2c (sdp_msg_t *msg)
 Access I2C bus.
 
void configure_pwm (uint32_t period, uint32_t width)
 Configure pulse-width modulation hardware.
 
uint32_t debug (sdp_msg_t *msg)
 SDP message dispatcher.
 

Variables

uint32_t tag_tto
 Tag timeout: 2.56s = 10ms * (1 << (9-1))
 

Detailed Description

Command handling for BC&MP.

Author
Steve Temple, APT Group, School of Computer Science

Function Documentation

◆ fpga_boot()

static void fpga_boot ( uint32_t  base,
uint32_t  len,
uint32_t  mask 
)
static

Boot an FPGA.

Parameters
[in]baseAddress of data to boot FPGA from
[in]lenLength of data to boot FPGA from
[in]maskSelects which FPGAs to boot

◆ fpga_xreg()

static void fpga_xreg ( uint32_t  count,
uint8_t *  data 
)
static

Write to FPGA registers.

Parameters
[in]countThe number of blocks of words+config to write
[in]dataPointer to block of data to write. This is really an array of two-word descriptors, addr and datum. addr describes where to write the word (which FPGAs and where therein). datum is the word to write.

◆ cmd_flash_erase()

static uint32_t cmd_flash_erase ( sdp_msg_t msg)
static

Erase flash.

arg1 - start address
arg2 - end address
Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_flash_write()

static uint32_t cmd_flash_write ( sdp_msg_t msg)
static

Write to flash.

arg1 - Flash address
arg2 - Size in bytes
arg3 - Erase before write
Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_xilinx()

static uint32_t cmd_xilinx ( sdp_msg_t msg)
static

Control FPGA.

arg1 - opcode
arg2 - op=0 -> length
op=1 -> mask
op=2 -> reset code
Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_fpga_read()

uint32_t cmd_fpga_read ( sdp_msg_t msg)

Read from FPGA.

arg1 - addr
arg2 - len
arg3 - fpga_num
Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_fpga_write()

uint32_t cmd_fpga_write ( sdp_msg_t msg)

Write to FPGA.

arg1 - addr
arg2 - len
arg3 - link_num
Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_sf()

static uint32_t cmd_sf ( sdp_msg_t msg)
static

Access serial flash.

Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_ee()

static uint32_t cmd_ee ( sdp_msg_t msg)
static

Access EEPROM.

Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ proc_led()

void proc_led ( uint32_t  arg,
uint32_t  mask 
)

Control the LEDs on this board; call led_set()

Parameters
[in]argArgument to pass to led_set()
[in]maskWhich boards are being controlled; this function only acts if this board is selected in the mask

◆ cmd_led()

static uint32_t cmd_led ( sdp_msg_t msg)
static

Control the LEDs.

Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ proc_reset()

void proc_reset ( uint32_t  arg,
uint32_t  mask 
)

Board reset handler; calls reset_spin()

Parameters
[in]argreset code and pre-reset delay factor
[in]maskWhich boards are being controlled; this function only acts if this board is selected in the mask

◆ cmd_reset()

static uint32_t cmd_reset ( sdp_msg_t msg)
static

Reset a board.

Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ proc_power()

void proc_power ( uint32_t  arg,
uint32_t  mask 
)

Control power for this board; calls set_power() (and sf_scan() and reset_spin() if powering on)

Parameters
[in]argtarget power state and pre-switch delay factor
[in]maskWhich boards are being controlled; this function only acts if this board is selected in the mask

◆ cmd_power()

static uint32_t cmd_power ( sdp_msg_t msg)
static

Control power.

Parameters
[in,out]msgSDP message, request and response
Returns
length of response payload

◆ cmd_ver()

static uint32_t cmd_ver ( sdp_msg_t msg)
static

Get version information.

Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_bmp_info()

static uint32_t cmd_bmp_info ( sdp_msg_t msg)
static

Return various useful bits of information about the BMP.

msg->arg1 = 0 returns
0 - hw_ver
1-4 - LPC1768 serial number
5 - flash buffer address
6 - board_stat address (this board)
7 - Cortex boot vector address
msg->arg1 = 1 returns EE data buffer
msg->arg1 = 2 returns CAN status buffer
msg->arg1 = 3 returns Board status buffer
msg->arg1 = 4 returns BMP & Spin IP address data
msg->arg1 = 5 returns Uninitialised vectors
board_stat_t board_stat[CAN_SIZE]
Board status.
Definition bmp_hw.c:248
const uint32_t hw_ver
Hardware version.
Definition bmp_hw.c:270
Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_fill()

static uint32_t cmd_fill ( sdp_msg_t msg)
static

Fill an area of memory.

Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_read()

static uint32_t cmd_read ( sdp_msg_t msg)
static

Read an area of memory.

Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_write()

static uint32_t cmd_write ( sdp_msg_t msg)
static

Write an area of memory.

Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_iptag()

static uint32_t cmd_iptag ( sdp_msg_t msg)
static

Command to manipulate IPTags.

arg1 - 0 : command : 0 : tag
arg2 - timeout : port
arg3 - IP
Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ cmd_i2c()

static uint32_t cmd_i2c ( sdp_msg_t msg)
static

Access I2C bus.

arg1 - I2C ctrl byte
arg2 - addr (not used in receive)
arg3 - length
Parameters
[in,out]msgThe message describing the command. The reply.
Returns
The length of the reply payload

◆ configure_pwm()

void configure_pwm ( uint32_t  period,
uint32_t  width 
)
extern

Configure pulse-width modulation hardware.

Parameters
[in]periodOverall period
[in]widthPulse width. No longer than than period.

◆ debug()

uint32_t debug ( sdp_msg_t msg)

SDP message dispatcher.

Parameters
[in,out]msgThe SDP message. Updated to be the response
Returns
the length of the response payload

Delegates to: