spinnaker_tools 3.4.0
SpiNNaker API, sark, sc&mp, bmp firmware and build tools
Loading...
Searching...
No Matches
Enumerations | Functions
spinn_srom.c File Reference

Serial ROM interface routines for Spinnaker. More...

#include "spinnaker.h"
#include "sark.h"

Enumerations

enum  spinn_srom_commands {
  SROM_READ = (0x03U << 24) , SROM_WRITE = (0x02U << 24) , SROM_WREN = (0x06U << 24) , SROM_WRDI = (0x04U << 24) ,
  SROM_RDSR = (0x05U << 24) , SROM_WRSR = (0x01U << 24) , SROM_PE = (0x42U << 24) , SROM_SE = (0xd8U << 24) ,
  SROM_CE = (0xc7U << 24) , SROM_RDID = (0xabU << 24) , SROM_DPD = (0xb9U << 24)
}
 Serial ROM command codes.
 
enum  spinn_srom_scp_flag_bits { WAIT = 0x40 , WREN = 0x80 , WRITE = 0x100 }
 Flag bits within the SCP message.
 

Functions

static void ncs_low (void)
 Set the NCS line low.
 
static void ncs_high (void)
 Set the NCS line high.
 
static void clock (void)
 Cycle the clock line on the SROM.
 
static void send (uint v, uint n)
 Send data to the SROM.
 
static uint read8 (void)
 Read a byte from the SROM (must have been requested)
 
uint cmd_srom (sdp_msg_t *msg)
 General purpose SROM interface routine.
 

Detailed Description

Serial ROM interface routines for Spinnaker.

Author
Steve Temple, APT Group, School of Computer Science

Function Documentation

◆ send()

static void send ( uint  v,
uint  n 
)
static

Send data to the SROM.

Parameters
[in]vValue to send, in top n bits
[in]nNumber of bits to send

◆ read8()

static uint read8 ( void  )
static

Read a byte from the SROM (must have been requested)

Returns
The byte that was read.

◆ cmd_srom()

uint cmd_srom ( sdp_msg_t msg)

General purpose SROM interface routine.

msg->arg1[31:16] = Data length (or zero)
msg->arg1[8] = Write (1) or Read (0)
msg->arg1[7] = Send WREN command first
msg->arg1[6] = Wait for completion
msg->arg1[5:0] = Number of command bits (8,16,32)
msg->arg2[31:24] = SROM command
msg->arg2[23:0] = extra command bits
Parameters
[in,out]msgSCP message describing what to do. Updated with response payload if relevant.
Returns
the length of the result message