SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Functions | Variables
board.c File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include <log.h>
#include <common.h>
#include <reg-ncat.h>
#include <sys-clk.h>
#include <mmu.h>
#include <mmc/sys-sdhci.h>
#include <mmc/sys-sdcard.h>
#include <sys-dram.h>
#include <sys-gpio.h>
#include <sys-i2c.h>
#include <sys-sid.h>
#include <sys-spi.h>
#include <sys-uart.h>
Include dependency graph for board.c:

Functions

void neon_enable (void)
 
void clean_syterkit_data (void)
 
void show_chip ()
 

Variables

sunxi_serial_t uart_dbg
 
sunxi_sdhci_t sdhci0
 
sunxi_dma_t sunxi_dma
 
sunxi_spi_t sunxi_spi0
 
uint32_t dram_para [96]
 
uint32_t dram_para_trained [96]
 

Function Documentation

◆ clean_syterkit_data()

void clean_syterkit_data ( void  )

◆ neon_enable()

void neon_enable ( void  )

◆ show_chip()

void show_chip ( )

Variable Documentation

◆ dram_para

uint32_t dram_para[96]

◆ dram_para_trained

uint32_t dram_para_trained[96]

◆ sdhci0

sunxi_sdhci_t sdhci0

◆ sunxi_dma

sunxi_dma_t sunxi_dma
Initial value:
= {
.dma_reg_base = SUNXI_DMA_BASE,
.bus_clk =
{
.gate_reg_offset = DMA_DEFAULT_CLK_GATE_OFFSET,
},
.dma_clk =
{
.rst_reg_base = SUNXI_CCM_BASE + DMA0_GAR_REG,
.rst_reg_offset = DMA_DEFAULT_CLK_RST_OFFSET,
.gate_reg_base = SUNXI_CCM_BASE + DMA0_GAR_REG,
.gate_reg_offset = DMA_DEFAULT_CLK_GATE_OFFSET,
},
}
#define SUNXI_CCM_BASE
Definition reg-ncat.h:11
#define SUNXI_DMA_BASE
Definition reg-ncat.h:15
#define MBUS_CLK_GATE_EN_REG
Definition reg-ccu.h:952
#define DMA0_GAR_REG
Definition reg-ccu.h:978
#define DMA_DEFAULT_CLK_GATE_OFFSET
Definition sys-dma.h:107
#define DMA_DEFAULT_CLK_RST_OFFSET
Definition sys-dma.h:106

◆ sunxi_spi0

sunxi_spi_t sunxi_spi0
Initial value:
= {
.base = SUNXI_SPI0_BASE,
.id = 0,
.clk_rate = 100 * 1000 * 1000,
.gpio =
{
.gpio_sck = {GPIO_PIN(GPIO_PORTC, 0), GPIO_PERIPH_MUX3},
.gpio_mosi = {GPIO_PIN(GPIO_PORTC, 2), GPIO_PERIPH_MUX3},
.gpio_miso = {GPIO_PIN(GPIO_PORTC, 3), GPIO_PERIPH_MUX3},
.gpio_hold = {GPIO_PIN(GPIO_PORTC, 5), GPIO_PERIPH_MUX3},
},
.spi_clk =
{
.spi_clock_cfg_base = SUNXI_CCM_BASE + SPI0_CLK_REG,
.spi_clock_factor_n_offset = SPI_CLK_SEL_FACTOR_N_OFF,
},
.parent_clk_reg =
{
.rst_reg_base = SUNXI_CCM_BASE + SPI0_GAR_REG,
.rst_reg_offset = SPI_DEFAULT_CLK_RST_OFFSET(0),
.gate_reg_base = SUNXI_CCM_BASE + SPI0_GAR_REG,
.gate_reg_offset = SPI_DEFAULT_CLK_GATE_OFFSET(0),
.parent_clk = 300000000,
},
.dma_handle = &sunxi_dma,
}
sunxi_dma_t sunxi_dma
Definition board.c:45
#define SUNXI_SPI0_BASE
Definition reg-ncat.h:40
#define SPI0_CLK_REG
Definition reg-ccu.h:1257
#define SPI0_CLK_REG_CLK_SRC_SEL_PERI0_300M
Definition reg-ccu.h:1952
#define SPI0_GAR_REG
Definition reg-ccu.h:1547
@ GPIO_PORTC
Definition sys-gpio.h:41
@ GPIO_PERIPH_MUX3
Definition sys-gpio.h:23
#define GPIO_PIN(x, y)
Definition sys-gpio.h:66
#define SPI_CLK_SEL_FACTOR_N_OFF
Offset for the SPI clock select factor is 8.
Definition sys-spi.h:105
#define SPI_DEFAULT_CLK_GATE_OFFSET(x)
Returns the default clock gate offset, based on the SPI module number (x).
Definition sys-spi.h:107
#define SPI_DEFAULT_CLK_RST_OFFSET(x)
Returns the default clock reset offset, based on the SPI module number (x).
Definition sys-spi.h:106

◆ uart_dbg

sunxi_serial_t uart_dbg
Initial value:
= {
.id = 0,
.baud_rate = UART_BAUDRATE_115200,
.dlen = UART_DLEN_8,
.stop = UART_STOP_BIT_0,
.parity = UART_PARITY_NO,
.gpio_pin =
{
.gpio_rx = {GPIO_PIN(GPIO_PORTB, 10), GPIO_PERIPH_MUX2},
},
.uart_clk =
{
.gate_reg_base = SUNXI_CCM_BASE + UART0_GAR_REG,
.gate_reg_offset = SERIAL_DEFAULT_CLK_GATE_OFFSET(0),
.rst_reg_base = SUNXI_CCM_BASE + UART0_GAR_REG,
.rst_reg_offset = SERIAL_DEFAULT_CLK_RST_OFFSET(0),
},
}
#define SUNXI_UART0_BASE
Definition reg-ncat.h:32
#define UART0_GAR_REG
Definition reg-ccu.h:1388
@ UART_STOP_BIT_0
Definition sys-uart.h:41
@ UART_BAUDRATE_115200
Definition sys-uart.h:24
#define SERIAL_DEFAULT_PARENT_CLK
Definition sys-uart.h:99
#define SERIAL_DEFAULT_CLK_RST_OFFSET(x)
Definition sys-uart.h:96
@ UART_PARITY_NO
Definition sys-uart.h:34
@ UART_DLEN_8
Definition sys-uart.h:50
#define SERIAL_DEFAULT_CLK_GATE_OFFSET(x)
Definition sys-uart.h:97
@ GPIO_PORTB
Definition sys-gpio.h:40
@ GPIO_PERIPH_MUX2
Definition sys-gpio.h:22