SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
main.c File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include <config.h>
#include <log.h>
#include <timer.h>
#include <common.h>
#include <jmp.h>
#include <mmu.h>
#include <smalloc.h>
#include <sstdlib.h>
#include <string.h>
#include <sys-clk.h>
#include <sys-dram.h>
#include <sys-i2c.h>
#include <sys-rtc.h>
#include <sys-sdcard.h>
#include <sys-sid.h>
#include <sys-spi.h>
#include <pmu/axp.h>
#include <fdt_wrapper.h>
#include <ff.h>
#include <libfdt.h>
#include <sys-sdhci.h>
#include <uart.h>
Include dependency graph for main.c:

Classes

struct  atf_head
 
struct  ext_linux_data
 
struct  image_info_t
 
struct  image_header
 

Macros

#define CONFIG_BL31_FILENAME   "bl31.bin"
 
#define CONFIG_BL31_LOAD_ADDR   (0x48000000)
 
#define CONFIG_DTB_LOAD_ADDR   (0x40400000)
 
#define CONFIG_INITRD_LOAD_ADDR   (0x43000000)
 
#define CONFIG_KERNEL_LOAD_ADDR   (0x40800000)
 
#define CONFIG_EXTLINUX_FILENAME   "extlinux/extlinux.conf"
 
#define CONFIG_EXTLINUX_LOAD_ADDR   (0x40020000)
 
#define CONFIG_PLATFORM_MAGIC   "\0RAW\xbe\xe9\0\0"
 
#define CONFIG_SDMMC_SPEED_TEST_SIZE   1024
 
#define CONFIG_HEAP_BASE   (0x50800000)
 
#define CONFIG_HEAP_SIZE   (16 * 1024 * 1024)
 
#define FILENAME_MAX_LEN   25
 
#define IH_COMP_NONE   0 /* No Compression Used */
 
#define IH_COMP_GZIP   1 /* gzip Compression Used */
 
#define IH_COMP_BZIP2   2 /* bzip2 Compression Used */
 
#define IH_MAGIC   0x56190527 /* mkimage magic for uinitrd */
 
#define IH_NMLEN   32 /* Image Name Length */
 
#define CHUNK_SIZE   0x20000
 

Typedefs

typedef struct atf_head atf_head_t
 
typedef struct ext_linux_data ext_linux_data_t
 
typedef struct image_header image_header_t
 

Functions

int ar100s_gpu_fix (void)
 
static int fatfs_loadimage_size (char *filename, BYTE *dest, uint32_t *file_size)
 
static int fatfs_loadimage (char *filename, BYTE *dest)
 
static int load_sdcard (image_info_t *image)
 
void jmp_to_arm64 (uint32_t addr)
 
static char * skip_spaces (char *str)
 
static char * find_substring (char *source, const char *target)
 
static char * copy_until_newline_or_end (char *source)
 
static void parse_extlinux_data (char *config, ext_linux_data_t *data)
 
static int fdt_pack_reg (const void *fdt, void *buf, uint64_t address, uint64_t size)
 
static char to_hex_char (uint8_t value)
 
static void chip_sid_to_mac (uint32_t chip_sid[4], uint8_t mac_address[6])
 
static char * get_mac_address_from_sid (uint32_t chip_sid[4], char mac_address_str[18])
 
static int load_extlinux (image_info_t *image, uint32_t dram_size)
 
static int abortboot_single_key (int bootdelay)
 
int main (void)
 

Variables

sunxi_serial_t uart_dbg
 
sunxi_i2c_t i2c_pmu
 
sunxi_sdhci_t sdhci0
 
uint32_t dram_para [32]
 
image_info_t image
 

Macro Definition Documentation

◆ CHUNK_SIZE

#define CHUNK_SIZE   0x20000

◆ CONFIG_BL31_FILENAME

#define CONFIG_BL31_FILENAME   "bl31.bin"

◆ CONFIG_BL31_LOAD_ADDR

#define CONFIG_BL31_LOAD_ADDR   (0x48000000)

◆ CONFIG_DTB_LOAD_ADDR

#define CONFIG_DTB_LOAD_ADDR   (0x40400000)

◆ CONFIG_EXTLINUX_FILENAME

#define CONFIG_EXTLINUX_FILENAME   "extlinux/extlinux.conf"

◆ CONFIG_EXTLINUX_LOAD_ADDR

#define CONFIG_EXTLINUX_LOAD_ADDR   (0x40020000)

◆ CONFIG_HEAP_BASE

#define CONFIG_HEAP_BASE   (0x50800000)

◆ CONFIG_HEAP_SIZE

#define CONFIG_HEAP_SIZE   (16 * 1024 * 1024)

◆ CONFIG_INITRD_LOAD_ADDR

#define CONFIG_INITRD_LOAD_ADDR   (0x43000000)

◆ CONFIG_KERNEL_LOAD_ADDR

#define CONFIG_KERNEL_LOAD_ADDR   (0x40800000)

◆ CONFIG_PLATFORM_MAGIC

#define CONFIG_PLATFORM_MAGIC   "\0RAW\xbe\xe9\0\0"

◆ CONFIG_SDMMC_SPEED_TEST_SIZE

#define CONFIG_SDMMC_SPEED_TEST_SIZE   1024

◆ FILENAME_MAX_LEN

#define FILENAME_MAX_LEN   25

◆ IH_COMP_BZIP2

#define IH_COMP_BZIP2   2 /* bzip2 Compression Used */

◆ IH_COMP_GZIP

#define IH_COMP_GZIP   1 /* gzip Compression Used */

◆ IH_COMP_NONE

#define IH_COMP_NONE   0 /* No Compression Used */

◆ IH_MAGIC

#define IH_MAGIC   0x56190527 /* mkimage magic for uinitrd */

◆ IH_NMLEN

#define IH_NMLEN   32 /* Image Name Length */

Typedef Documentation

◆ atf_head_t

typedef struct atf_head atf_head_t

◆ ext_linux_data_t

◆ image_header_t

typedef struct image_header image_header_t

Function Documentation

◆ abortboot_single_key()

static int abortboot_single_key ( int  bootdelay)
static

◆ ar100s_gpu_fix()

int ar100s_gpu_fix ( void  )
extern

◆ chip_sid_to_mac()

static void chip_sid_to_mac ( uint32_t  chip_sid[4],
uint8_t  mac_address[6] 
)
static

◆ copy_until_newline_or_end()

static char * copy_until_newline_or_end ( char *  source)
static

◆ fatfs_loadimage()

static int fatfs_loadimage ( char *  filename,
BYTE dest 
)
static

◆ fatfs_loadimage_size()

static int fatfs_loadimage_size ( char *  filename,
BYTE dest,
uint32_t file_size 
)
static

◆ fdt_pack_reg()

static int fdt_pack_reg ( const void *  fdt,
void *  buf,
uint64_t  address,
uint64_t  size 
)
static

◆ find_substring()

static char * find_substring ( char *  source,
const char *  target 
)
static

◆ get_mac_address_from_sid()

static char * get_mac_address_from_sid ( uint32_t  chip_sid[4],
char  mac_address_str[18] 
)
static

◆ jmp_to_arm64()

void jmp_to_arm64 ( uint32_t  addr)

◆ load_extlinux()

static int load_extlinux ( image_info_t image,
uint32_t  dram_size 
)
static

◆ load_sdcard()

static int load_sdcard ( image_info_t image)
static

◆ main()

int main ( void  )

◆ parse_extlinux_data()

static void parse_extlinux_data ( char *  config,
ext_linux_data_t data 
)
static

◆ skip_spaces()

static char * skip_spaces ( char *  str)
static

◆ to_hex_char()

static char to_hex_char ( uint8_t  value)
static

Variable Documentation

◆ dram_para

uint32_t dram_para[32]
extern

◆ i2c_pmu

sunxi_i2c_t i2c_pmu
extern

◆ image

image_info_t image

◆ sdhci0

sunxi_sdhci_t sdhci0
extern

◆ uart_dbg

sunxi_serial_t uart_dbg
extern