KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mboot.h File Reference

Multiboot Driver, exposes one function, mbootLoad. More...

#include <stdint.h>
#include <stdbool.h>
#include "lm32soc/dev_soc.h"
#include "cfg_soc.h"

Go to the source code of this file.

Macros

#define MBOOT_GOLDEN   0
 The golden image index position. More...
 
#define MBOOT_RUNTIME   1
 Runtime image.
 
#define MBOOT_RUNTIME_2   2
 Runtime image 2.
 
#define MBOOT_DIAGNOSTIC   3
 Diagnostic image.
 
#define MBOOT_STS_VALID   BIT(0)
 
#define MBOOT_STS_FALLBACK   BIT(1)
 
#define MBOOT_STS_IPROG   BIT(2)
 
#define MBOOT_STS_WTO_ERROR   BIT(3)
 
#define MBOOT_STS_ID_ERROR   BIT(4)
 
#define MBOOT_STS_CRC_ERROR   BIT(5)
 
#define MBOOT_STS_WRAP_ERROR   BIT(6)
 

Functions

static uint32_t mbootIDCode ()
 Returns the ID-code. More...
 
static int mbootBootStatus (bool previous)
 Returns the boot status. More...
 
void mbootLoad (int imgNo)
 Boots a specific image. More...
 
void mbootWDogStart (uint32_t timer, bool config)
 Configures and starts the ICAPE2 watchdog. More...
 
static void mbootWDogFeed ()
 Feed the watchdog.
 
static void mbootWDogStop ()
 Stop the watchdog.
 

Detailed Description

Multiboot Driver, exposes one function, mbootLoad.

Definition in file mboot.h.

Macro Definition Documentation

#define MBOOT_GOLDEN   0

The golden image index position.

Definition at line 31 of file mboot.h.

Function Documentation

static int mbootBootStatus ( bool  previous)
inlinestatic

Returns the boot status.

Parameters
previousStatus of previous boot (instead of current)
Returns
A bitmask of a combination of MBOOT_STS_* bits.

Definition at line 62 of file mboot.h.

static uint32_t mbootIDCode ( )
inlinestatic

Returns the ID-code.

Returns
The 32 bits Xilinx device ID code.

Definition at line 50 of file mboot.h.

void mbootLoad ( int  imgNo)

Boots a specific image.

Parameters
imgNoThe image to boot

Definition at line 38 of file mboot.c.

void mbootWDogStart ( uint32_t  timer,
bool  config 
)

Configures and starts the ICAPE2 watchdog.

The watchdog can run in two modes: user - in which the user application must feed the watchdog. Otherwise a reconfigure will be triggered config - in this case the watchdog will be used to detect faulty reconfigurations.

Parameters
timerTimer value, runs approx. at MBOOT_WATCHDOG_FREQ.
configUse as configuration timer instead of user timer.