Code Monkey home page Code Monkey logo

syterkit's Introduction

SyterKit

SyterKit LOGO_Thin

SyterKit is a bare-metal framework designed for Allwinner platform. SyterKit utilizes CMake as its build system and supports various applications and peripheral drivers. Additionally, SyterKit also has bootloader functionality

Support list

Board Manufacturer Platform Spec Details Config
Yuzukilizard YuzukiHD V851s Cortex A7 board/yuzukilizard yuzukilizard.cmake
TinyVision YuzukiHD V851se Cortex A7 board/tinyvision tinyvision.cmake
100ask-t113s3 100ask T113-S3 Dual-Core Cortex A7 board/100ask-t113s3 100ask-t113s3.cmake
100ask-t113i 100ask T113-I Dual-Core Cortex A7 + C906 RISC-V board/100ask-t113i 100ask-t113i.cmake
100ask-d1-h 100ask D1-H C906 RISC-V board/100ask-d1-h 100ask-d1-h.cmake
dongshanpi-aict 100ask V853 Cortex A7 board/dongshanpi-aict dongshanpi-aict.cmake
project-yosemite YuzukiHD V853 Cortex A7 board/project-yosemite project-yosemite.cmake
100ask ROS 100ask R818 Quad-Core Cortex A53 board/100ask-ros 100ask-ros.cmake
longanpi-3h sipeed H618 Quad-Core Cortex A53 board/longanpi-3h longanpi-3h.cmake
longanpi-4b sipeed T527 Octa-Core Cortex A55 board/longanpi-4b longanpi-4b.cmake
LT527X myir-tech T527 Octa-Core Cortex A55 board/lt527x lt527x.cmake
Avaota A1 YuzukiHD T527 Octa-Core Cortex A55 board/avaota-a1 avaota-a1.cmake
Yuzukihomekit YuzukiHD T113-M4020DC0 Dual-Core Cortex A7 + C906 RISC-V + HIFI4 DSP board/yuzukihomekit yuzukihomekit.cmake
OrangePi 4A OrangePi A527 Octa-Core Cortex A55 (可以嫖个板子吗) -

Getting Started

SyterKit Architecture

SyterKit_Arch

Building SyterKit From Scratch

Building SyterKit is a straightforward process that only requires setting up the environment for compilation on a Linux operating system. The software packages required by SyterKit include:

  • gcc-arm-none-eabi
  • CMake

For commonly used Ubuntu systems, they can be installed using the following command:

sudo apt-get update
sudo apt-get install gcc-arm-none-eabi cmake build-essential -y

Then create a folder to store the compiled output files and navigate to it:

mkdir build
cd build

Finally, run the following commands to compile SyterKit:

cmake -DCMAKE_BOARD_FILE={Board_config_file.cmake} ..
make

For example, if you want to compile SyterKit for the TinyVision platform, you need the following command:

cmake -DCMAKE_BOARD_FILE=tinyvision.cmake ..
make

The compiled executable files will be located in build/board/{board_name}/{app_name}.

The SyterKit project will compile two versions: firmware ending with .elf is for USB booting and requires bootloading by PC-side software, while firmware ending with .bin is for flashing and can be written into storage devices such as TF cards and SPI NAND.

  • For SD Card, You need to flash the xxx_card.bin
  • For SPI NAND/SPI NOR, You need to flash the xxx_spi.bin

Creating TF Card Boot Firmware

After build the firmware, you can flash it into the TF card. For the V851s platform, you can write it to either an 8K offset or a 128K offset. Generally, if the TF card uses MBR format, write it with an 8K offset. If it uses GPT format, write it with a 128K offset. Assuming /dev/sdb is the target TF card, you can use the following command to write it with an 8K offset:

sudo dd if=syter_boot_bin_card.bin of=/dev/sdb bs=1024 seek=8

If it is a GPT partition table, you need to write it with a 128K offset:

sudo dd if=syter_boot_bin_card.bin of=/dev/sdb bs=1024 seek=128

Creating the Firmware for SPI NAND

For SPI NAND, we need to create the firmware for SPI NAND by writing SyterKit to the corresponding positions:

dd if=syter_boot_bin_spi.bin of=spi.img bs=2k
dd if=syter_boot_bin_spi.bin of=spi.img bs=2k seek=32
dd if=syter_boot_bin_spi.bin of=spi.img bs=2k seek=64

You can also include the Linux kernel and device tree in the firmware:

dd if=sunxi.dtb of=spi.img bs=2k seek=128     # DTB on page 128
dd if=zImage of=spi.img bs=2k seek=256        # Kernel on page 256

Use the xfel tool to flash the created firmware into SPI NAND:

xfel spinand write 0x0 spi.img

Creating the Firmware for SPI NOR

For SPI NOR, we need to create the firmware for SPI NOR by writing SyterKit to the corresponding positions:

dd if=syter_boot_bin_spi.bin of=spi.img bs=2k
dd if=syter_boot_bin_spi.bin of=spi.img bs=2k seek=32
dd if=syter_boot_bin_spi.bin of=spi.img bs=2k seek=64

You can also include the Linux kernel and device tree in the firmware:

dd if=sunxi.dtb of=spi.img bs=2k seek=128     # DTB on page 128
dd if=zImage of=spi.img bs=2k seek=256        # Kernel on page 256

Use the xfel tool to flash the created firmware into SPI NOR:

xfel spinor write 0x0 spi.img

syterkit's People

Contributors

916bgai avatar bigfootaca avatar chainsx avatar cx-dandelion avatar luojia65 avatar samulkyull avatar yuzukitsuru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

syterkit's Issues

[board]: how burn the T113i image to TF-card

  1. build the t113i image
    cmake -DCMAKE_BOARD_FILE=100ask-t113i.cmake -Bbuild -H.
  2. create the sd card MBR partition
Welcome to fdisk (util-linux 2.38.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdb: 14.84 GiB, 15931539456 bytes, 31116288 sectors
Disk model: STORAGE DEVICE  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x536d07fa

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
  1. burn the image to sd card
    sudo dd if=build/board/100ask-t113i/hello_world/helloworld_bin_card.bin of=/dev/sdb bs=1024 seek=8 conv=notrunc,fdatasync status=progress

But can't get boot message on the terminal. Please help me!

关于D1S time CSR寄存器的访问

大佬好!
本人在开发D1S裸机程序的时候,参考您提供的框架代码进行部分功能的移植。在需要获取系统时钟的部分,即使用get_arch_time()函数时,板卡会崩溃重启,貌似是对time寄存器访问的时候出现了问题,请问在访问该寄存器之前需要有需要特殊操作的吗?
谢谢

d1h中的SPI_CCR寄存器从何而来?

SPI_CCR在代码中定义的地址为

enum {
    SPI_GCR = 0x04,
    SPI_TCR = 0x08,
    SPI_IER = 0x10,
    SPI_ISR = 0x14,
    SPI_FCR = 0x18,
    SPI_FSR = 0x1c,
    SPI_WCR = 0x20,
    SPI_CCR = 0x24, // 这个寄存器
    SPI_DLY = 0x28,
    SPI_MBC = 0x30,
    SPI_MTC = 0x34,
    SPI_BCC = 0x38,
    SPI_TXD = 0x200,
    SPI_RXD = 0x300,
};

但是我在D1h的手册中找不到SPI_CCR这个寄存器
图片
不过在使用SPI的过程中,我发现这个寄存器似乎确实能实现分频的功能(注释掉了某行向这个地址写数据的代码后write32(spi->base + SPI_CCR, reg);,时钟频率似乎确实发生了变化),想问一下是如何得知这个地址上存在寄存器的呢?

sdhci2 not initialized

I'm trying to make the TinyVision board boot from the onboard SD-NAND (I soldered a chip).
Added the sdhci2 structure to the board.c file

sdhci_t sdhci2 = {
        .name = "sdhci2",
        .reg = (sdhci_reg_t *) 0x04022000,
        .voltage = MMC_VDD_27_36,
        .width = MMC_BUS_WIDTH_4,
        .clock = MMC_CLK_50M,
        .removable = 0,
        .isspi = FALSE,
        .gpio_clk = {GPIO_PIN(GPIO_PORTC, 0), GPIO_PERIPH_MUX3},
        .gpio_cmd = {GPIO_PIN(GPIO_PORTC, 1), GPIO_PERIPH_MUX3},
        .gpio_d0 = {GPIO_PIN(GPIO_PORTC, 4), GPIO_PERIPH_MUX3},
        .gpio_d1 = {GPIO_PIN(GPIO_PORTC, 3), GPIO_PERIPH_MUX3},
        .gpio_d2 = {GPIO_PIN(GPIO_PORTC, 2), GPIO_PERIPH_MUX3},
        .gpio_d3 = {GPIO_PIN(GPIO_PORTC, 5), GPIO_PERIPH_MUX3},
};

added the initialization in the syter_boot/main.c file

    if (sunxi_sdhci_init(&sdhci2) != 0) {
        printk(LOG_LEVEL_ERROR, "SMHC2: %s controller init failed\n", sdhci2.name);
        goto _shell;
    } else {
        printk(LOG_LEVEL_INFO, "SMHC2: %s controller v%x initialized\n", sdhci2.name, sdhci2.reg->vers);
    }

    if (sdmmc_init(&card0, &sdhci2) != 0) {
        printk(LOG_LEVEL_WARNING, "SMHC2: init failed\n");
        goto _shell;
    }
  

compiled and flashed to the SD-NAND, this is the output when booting from it

[    0.000124][I]  _____     _           _____ _ _
[    0.005125][I] |   __|_ _| |_ ___ ___|  |  |_| |_
[    0.010160][I] |__   | | |  _| -_|  _|    -| | _|
[    0.015161][I] |_____|_  |_| |___|_| |__|__|_|_|
[    0.020170][I]       |___|
[    0.025171][I] ***********************************
[    0.030180][I]  SyterKit v0.2.4 Commit:
[    0.034262][I]  github.com/YuzukiHD/SyterKit
[    0.039263][I] ***********************************
[    0.044281][I]  Built by: arm-none-eabi-gcc 8.3.1
[    0.049204][I]
[    0.052332][I] DRAM: size = 64MB
[    0.058609][I] DRAM: simple test OK
[    0.068207][I] SMHC2: sdhci2 controller v0 initialized
[    0.173584][W] SMHC: wait timeout 0 status 0 flag 4
[    0.178431][W] SMHC: cmd timeout
[    0.181698][E] SMHC: set idle state failed
[    0.185824][W] SMHC2: init failed
SyterKit>

There is not hardware issues as I am able to enable the SD2 on the .dts and use it under OpenWRT (booting from SD Card).

This the output when bootng from SD Card

[    0.000125][I]  _____     _           _____ _ _
[    0.005143][I] |   __|_ _| |_ ___ ___|  |  |_| |_
[    0.010187][I] |__   | | |  _| -_|  _|    -| | _|
[    0.015240][I] |_____|_  |_| |___|_| |__|__|_|_|
[    0.020302][I]       |___|
[    0.025319][I] ***********************************
[    0.030346][I]  SyterKit v0.2.4 Commit:
[    0.034523][I]  github.com/YuzukiHD/SyterKit
[    0.039550][I] ***********************************
[    0.044585][I]  Built by: arm-none-eabi-gcc 8.3.1
[    0.049525][I]
[    0.052607][I] DRAM: size = 64MB
[    0.058479][I] DRAM: simple test OK
[    0.062458][I] SMHC0: sdhci0 controller v50400 initialized
[    0.083915][I] SMHC: capacity 31.9GB
[    0.088109][I] SHMC: SD card detected
[    0.165755][I] FATFS: read sunxi.dtb addr=41008000
[    0.183112][I] FATFS: read in 13ms at 2.32MB/S
[    0.187526][I] FATFS: read zImage addr=41800000
[    1.871819][I] FATFS: read in 1680ms at 3.02MB/S
[    1.876363][I] FATFS: read config.ini addr=40008000
[    1.881970][I] FATFS: read in 1ms at 0.19MB/S
[    1.886280][I] FATFS: done in 1722ms
[    1.902492][I] Hit any key to stop autoboot:  0
[    6.910329][I] disable mmu ok...
[    6.913726][I] disable dcache ok...
[    6.917401][I] disable icache ok...
[    6.921075][I] free interrupt ok...
[    6.924750][I] enable kernel smp ok...
[    6.928659][I] jump to kernel address: 0x41800000

Am I missing something to initialize the sdhci2 and boot from it?
Thanks.

SyterKit 会支持V3S吗?

作为这个系列的入门级的V3S,手工处理方便,在低端产品上使用不少。SyterKit有支持V3S的计划吗?

SyterKit是否适合用来给其他SoC做启动加速,例如君正X2000

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.