Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions conf/machine/beaglev-ahead.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,43 @@ MACHINE_FEATURES += "usb wifi bluetooth"

#============================================
# SBI Configuration
#RISCV_SBI_FDT ?= "th1520-beaglev-ahead.dtb"
unset RISCV_SBI_PAYLOAD
#============================================

#============================================
# Kernel Configuration
KERNEL_DEVICETREE ?= "thead/th1520-beaglev-ahead.dtb"
KERNEL_IMAGETYPE = "Image"
# Install kernel modules by default
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS:append = " kernel-modules"

#============================================

#============================================
# Uboot Configuration
UBOOT_MACHINE = "light_beagle_defconfig"
UBOOT_DTB_BINARY = "th1520-beaglev-ahead.dtb"
UBOOT_MACHINE = "th1520_beaglev_ahead_defconfig"
UBOOT_ENV = ""
#============================================

#============================================
# Firmware Configuration
TH1520_TRAINING_FW_SRC = "lpddr4x-3733-singlerank.lua"
#============================================

#============================================
# Image Configuration
# Note: currently just a fastboot deployment is supported
# for which a separate boot.ext4 is generated
IMAGE_BOOT_FILES:remove = "boot.scr.uimg"
IMAGE_BOOT_FILES:append = "fw_payload.bin th1520-beaglev-ahead.dtb extlinux_sd.conf;extlinux/extlinux.conf"
IMAGE_BOOT_FILES = " \
${KERNEL_IMAGETYPE} \
th1520-beaglev-ahead.dtb \
extlinux.conf;extlinux/extlinux.conf \
"
WKS_FILE ?= "beaglev-ahead.wks"
#============================================

#============================================
# Common Preferred Providers
PREFERRED_PROVIDER_virtual/kernel ?= "linux-beaglev-dev"
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-beaglev-ahead"
PREFERRED_PROVIDER_opensbi ?= "opensbi-revyos"
EXTRA_IMAGEDEPENDS += "u-boot-beaglev-ahead firmware-th1520"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-mainline"
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
EXTRA_IMAGEDEPENDS += "u-boot firmware-th1520"
#============================================
WKS_FILE_DEPENDS:append = " gptfdisk-native"
50 changes: 31 additions & 19 deletions docs/BeagleV-Ahead.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BeagleV-Ahead

BeagleV-Ahead is a RISC-V platform with an Alibaba T-Head TH1520 SoC (2GHz quad-core 64-bit Xuantee C910).

The board supports booting from both eMMC and SD card. eMMC can be flashed using fastboot, while the generated WIC image can be flashed directly to an SD card.
The board supports booting from both eMMC and SD card. eMMC can be flashed using fastboot, while the generated WIC image can be flashed directly to an SD card. U-Boot looks for a bootable SD card first and falls back to eMMC, so the same image boots from the medium it is written to.

How to Build
============
Expand Down Expand Up @@ -52,24 +52,6 @@ After building, you will obtain the following artifacts:
Flashing Linux
==============

Flashing to eMMC
----------------

0. Install `fastboot` via distro packages.
1. Enter flash mode (see Quickstart guide for details): press USB-button and while pressing, click `RESET`-button; then release `USB`-button only after device started
2. Enter deploy folder `tmp/deploy/images/beaglev-ahead/` and flash artifacts with sudo rights:

```shell
fastboot flash ram ./u-boot-with-spl.bin
fastboot reboot
sleep 10
fastboot oem format
fastboot flash uboot ./u-boot-with-spl.bin
fastboot flash boot ./boot.ext4
fastboot flash root ./core-image-minimal-beaglev-ahead.rootfs.ext4
fastboot reboot
```

Flashing to SD card
-------------------

Expand All @@ -89,6 +71,36 @@ Replace `/dev/sdX` with the block device corresponding to the SD card.

Insert the SD card into the BeagleV-Ahead and power on the board.

Flashing to eMMC
----------------

The easiest way to flash eMMC is by first flashing an SD card and booting it (see above).

Then, copy the `core-image-minimal-beaglev-ahead.rootfs.wic.gz` and
`core-image-minimal-beaglev-ahead.rootfs.wic.bmap` files from the deploy folder
to an ext4 formatted USB flash drive.

Power your board with a 5V power supply (using the 5.5 mm barrel connector),
and use the USB type-B to USB-A F cable provided with your board to connect
the USB flash drive to the board.

Once booted, mount the USB drive on the command line shell
(see the "Check Functionality" section below to access the serial console):

```shell
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1
```

You can then flash eMMC:

```shell
cd /mnt/sda1
bmaptool copy core-image-minimal-beaglev-ahead.rootfs.wic.gz /dev/mmcblk0
```

You can then remove the SD card and reboot.

Check Functionality
===================
Follow the Quickstart-Guide and connect an RS232-to-USB device, then connect to the UART console and login
Expand Down
4 changes: 2 additions & 2 deletions files/wic/beaglev-ahead.wks
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# short-description: Create SD card image for BeagleV-ahead
bootloader --ptable gpt --source beaglev_boot
part --label empty --part-name empty --align 4096 --size=2M
part /boot --source bootimg-partition --fstype=ext4 --label boot --part-name boot --align 4096 --size=100M
part --label empty --part-name empty --align 8192 --size=2M
part /boot --source bootimg-partition --fstype=ext4 --label boot --part-name boot --align 4096 --size=100M --active
part / --source rootfs --fstype=ext4 --label root --part-name root --align 4096 --size 1G
5 changes: 5 additions & 0 deletions kas/beaglev-ahead.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ header:

machine: beaglev-ahead
target: core-image-minimal

local_conf_header:
beaglev-ahead: |
# Add "bmaptool" for flashing eMMC from board booted for SD
IMAGE_INSTALL:append = " bmaptool"
25 changes: 25 additions & 0 deletions recipes-bsp/firmware/firmware-ddr-training-th1520.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# DDR training firmware for TH1520
SUMMARY = "th1520 ddr training firmware binary"
HOMEPAGE = "https://github.com/ziyao233/th1520-firmware/"

LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
DEPENDS = "lua-native"

inherit deploy

SRC_URI = "git://github.com/ziyao233/th1520-firmware.git;branch=main;protocol=https"
SRCREV = "672c4441a8487bd1fcc8a8ae36824586c007625a"

do_compile() {
lua ddr-generate.lua src/${TH1520_TRAINING_FW_SRC} th1520-ddr-firmware.bin
}

do_deploy() {
install -Dm 644 ${B}/th1520-ddr-firmware.bin ${DEPLOYDIR}/th1520-ddr-firmware.bin
}

addtask deploy before do_build after do_compile

COMPATIBLE_MACHINE = "(beaglev-ahead)"

This file was deleted.

50 changes: 0 additions & 50 deletions recipes-bsp/opensbi/opensbi-revyos/0001-c23-compatibility.patch

This file was deleted.

57 changes: 0 additions & 57 deletions recipes-bsp/opensbi/opensbi-revyos_git.bb

This file was deleted.

Loading
Loading