Embedded Xinu Operating System
An ongoing research project and educational operating system.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Functions

The SoC of the Raspberry Pi 3 Model B+ is the Broadcom BCM2837B0. More...

Functions

void add_mailbox_tag (volatile uint32_t *buffer, uint32_t tag, uint32_t buflen, uint32_t len, uint32_t *data)
 
void build_mailbox_request (volatile uint32_t *mailbuffer)
 
void get_mac_mailbox (volatile uint32_t *mailbuffer)
 
void bcm2837_mailbox_write (uint channel, uint value)
 
uint bcm2837_mailbox_read (uint channel)
 
int bcm2837_setpower (enum board_power_feature feature, bool on)
 
void bcm2837_power_init (void)
 
unsigned int mmu_section (unsigned int vadd, unsigned int padd, unsigned int flags)
 
void mmu_init ()
 
void led_init (void)
 
void led_on (void)
 
void led_off (void)
 
int platforminit (void)
 
void * setupStack (void *stackaddr, void *procaddr, void *retaddr, uint nargs, va_list ap)
 
void CoreSetup (void)
 
void createnullthread (void)
 

Detailed Description

The SoC of the Raspberry Pi 3 Model B+ is the Broadcom BCM2837B0.

While much of Embedded Xinu's port has been redesigned for the BCM2837B0 (bootloader, multicore capability, L1 cache, to name a few), there are remnants of the last port (BCM2835 Raspberry Pi 1) in this operating system as the entire wheel need not be reinvented.

Function Documentation

void add_mailbox_tag ( volatile uint32_t *  buffer,
uint32_t  tag,
uint32_t  buflen,
uint32_t  len,
uint32_t *  data 
)

Add a tag to the mailbox buffer. This step must be done before a mailbox request is built.

Parameters
bufferMailbox buffer
tagTag to pass
buflenBuffer length
lenLength of data to be sent
dataData to be sent
uint bcm2837_mailbox_read ( uint  channel)

Read from the specified channel of the mailbox.

Parameters
channelMailbox channel to read from
Returns
Value read from the mailbox
void bcm2837_mailbox_write ( uint  channel,
uint  value 
)

Write to the specified channel of the mailbox.

Parameters
channelMailbox channel to write to
valueValue to write to the mailbox
void bcm2837_power_init ( void  )

Resets BCM2837 power to default state (all devices powered off).

int bcm2837_setpower ( enum board_power_feature  feature,
bool  on 
)

Powers on or powers off BCM2837 hardware.

Parameters
featureDevice or hardware to power on or off.
on::TRUE to power on; ::FALSE to power off.
Returns
::OK if successful; ::SYSERR otherwise.
void build_mailbox_request ( volatile uint32_t *  mailbuffer)

Ready the buffer by initializing proper lengths, slots.

Parameters
mailbufferMailbox buffer
void createnullthread ( void  )

Create a null thread (for testing purposes -> should be taken out)

void get_mac_mailbox ( volatile uint32_t *  mailbuffer)

Function for getting the MAC address using the corresponding MAC mailbox tag.

Parameters
mailbufferMailbox buffer written with MAC address upon conclusion.
void led_init ( void  )

This code is irrelevant to Embedded Xinu and is only used as a means of testing on the RPI 3 boards

Initialize GPIO pin 16 as an output

void led_off ( void  )

Set GPIO pin 16 to OFF

void led_on ( void  )

Set GPIO pin 16 to ON

void mmu_init ( void  )

mmu_init() configures virtual address == physical address also configures memory to be cacheable, except for peripheral portion

unsigned int mmu_section ( unsigned int  vadd,
unsigned int  padd,
unsigned int  flags 
)

Mark a section of memory as cacheable, given flags

Parameters
vaddVirtual address
paddPhysical address
flagsFlag to mark the section
Returns
Zero
int platforminit ( void  )

Initializes platform specific information for the Raspberry Pi hardware.

Returns
OK
void* setupStack ( void *  stackaddr,
void *  procaddr,
void *  retaddr,
uint  nargs,
va_list  ap 
)

Set up the context record and arguments on the stack for a new thread (ARM version)

Parameters
stackaddrStack address
procaddrProcess address
Returns
Top of the stack