XenevaOS
Loading...
Searching...
No Matches
Macros | Functions | Variables
littleboot.c File Reference
#include "littleboot.h"
#include "dtb.h"
#include "physm.h"
#include "vmmngr.h"
#include "ramdisk.h"
#include "aurora.h"
#include "gpio.h"
Include dependency graph for littleboot.c:

Macros

#define MBOX_REQUEST   0
 
#define MBOX_CH_POWER   0
 
#define MBOX_CH_FB   1
 
#define MBOX_CH_VUART   2
 
#define MBOX_CH_VCHIQ   3
 
#define MBOX_CH_LEDS   4
 
#define MBOX_CH_BTNS   5
 
#define MBOX_CH_TOUCH   6
 
#define MBOX_CH_COUNT   7
 
#define MBOX_CH_PROP   8
 
#define MBOX_TAG_GETSERIAL   0x1004
 
#define MBOX_TAG_SETCLKRATE   0x38002
 
#define MBOX_TAG_LAST   0
 
#define VIDEOCORE_MBOX   (MMIO_BASE+0x0000B880)
 
#define MBOX_READ   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x0))
 
#define MBOX_POLL   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x10))
 
#define MBOX_SENDER   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x14))
 
#define MBOX_STATUS   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x18))
 
#define MBOX_CONFIG   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x1C))
 
#define MBOX_WRITE   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x20))
 
#define MBOX_RESPONSE   0x80000000
 
#define MBOX_FULL   0x80000000
 
#define MBOX_EMPTY   0x40000000
 

Functions

volatile unsigned int __attribute__ ((aligned(16)))
 
void LBUartInit ()
 
void LBUartPutc (char c)
 
void LBUartPutString (const char *s)
 
void LBUartPrintHex (uint64_t val)
 
void LBUartPrintInt (uint64_t value)
 
void subtract_resv (uint64_t start, uint64_t end, uint64_t resvstart, uint64_t resvend)
 
void LBSubtractRegion (uint64_t mem_base, uint64_t mem_end, uint64_t regionStart, uint64_t regionEnd)
 
void LBInitializeMemoryMap (uint64_t dtb)
 
void LBExitEL2 ()
 
void LittleBootMain (uint64_t dtb)
 

Variables

memory_region_t usable_regions [MAX_MEMORY_REGN]
 
int usable_region_count = 0
 
uint64_t nextStart
 
char phys []
 
char end []
 
uint64_t nextIterationStart
 
uint64_t pmmngrdata [1024 *1024]
 
uint64_t mem_base
 
uint64_t mem_end
 
uint64_t mem_size
 

Macro Definition Documentation

◆ MBOX_CH_BTNS

#define MBOX_CH_BTNS   5

◆ MBOX_CH_COUNT

#define MBOX_CH_COUNT   7

◆ MBOX_CH_FB

#define MBOX_CH_FB   1

◆ MBOX_CH_LEDS

#define MBOX_CH_LEDS   4

◆ MBOX_CH_POWER

#define MBOX_CH_POWER   0

◆ MBOX_CH_PROP

#define MBOX_CH_PROP   8

◆ MBOX_CH_TOUCH

#define MBOX_CH_TOUCH   6

◆ MBOX_CH_VCHIQ

#define MBOX_CH_VCHIQ   3

◆ MBOX_CH_VUART

#define MBOX_CH_VUART   2

◆ MBOX_CONFIG

#define MBOX_CONFIG   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x1C))

◆ MBOX_EMPTY

#define MBOX_EMPTY   0x40000000

◆ MBOX_FULL

#define MBOX_FULL   0x80000000

◆ MBOX_POLL

#define MBOX_POLL   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x10))

◆ MBOX_READ

#define MBOX_READ   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x0))

◆ MBOX_REQUEST

#define MBOX_REQUEST   0

BSD 2-Clause License

Copyright (c) 2022-2025, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ MBOX_RESPONSE

#define MBOX_RESPONSE   0x80000000

◆ MBOX_SENDER

#define MBOX_SENDER   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x14))

◆ MBOX_STATUS

#define MBOX_STATUS   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x18))

◆ MBOX_TAG_GETSERIAL

#define MBOX_TAG_GETSERIAL   0x1004

◆ MBOX_TAG_LAST

#define MBOX_TAG_LAST   0

◆ MBOX_TAG_SETCLKRATE

#define MBOX_TAG_SETCLKRATE   0x38002

◆ MBOX_WRITE

#define MBOX_WRITE   ((volatile unsigned int*)(VIDEOCORE_MBOX+0x20))

◆ VIDEOCORE_MBOX

#define VIDEOCORE_MBOX   (MMIO_BASE+0x0000B880)

Function Documentation

◆ __attribute__()

volatile unsigned int __attribute__ ( (aligned(16))  )

Make a mailbox call. Returns 0 on failure, non-zero on success

◆ LBExitEL2()

void LBExitEL2 ( )

◆ LBInitializeMemoryMap()

void LBInitializeMemoryMap ( uint64_t  dtb)

◆ LBSubtractRegion()

void LBSubtractRegion ( uint64_t  mem_base,
uint64_t  mem_end,
uint64_t  regionStart,
uint64_t  regionEnd 
)

◆ LBUartInit()

void LBUartInit ( )

◆ LBUartPrintHex()

void LBUartPrintHex ( uint64_t  val)

◆ LBUartPrintInt()

void LBUartPrintInt ( uint64_t  value)

◆ LBUartPutc()

void LBUartPutc ( char  c)

◆ LBUartPutString()

void LBUartPutString ( const char *  s)

◆ LittleBootMain()

void LittleBootMain ( uint64_t  dtb)

◆ subtract_resv()

void subtract_resv ( uint64_t  start,
uint64_t  end,
uint64_t  resvstart,
uint64_t  resvend 
)

Variable Documentation

◆ end

char end[]
extern

◆ mem_base

uint64_t mem_base

◆ mem_end

uint64_t mem_end

◆ mem_size

uint64_t mem_size

◆ nextIterationStart

uint64_t nextIterationStart

◆ nextStart

uint64_t nextStart

◆ phys

char phys[]
extern

◆ pmmngrdata

uint64_t pmmngrdata[1024 *1024]

◆ usable_region_count

int usable_region_count = 0

◆ usable_regions