-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support StarFive VisionFive2(RISC-V)
- Loading branch information
1 parent
6dbf4d2
commit 52583a3
Showing
10 changed files
with
252 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
type: model | ||
authority-id: V2yG6LAupEYdeTz6jHQLLOMkHGd1ZG44 | ||
series: 16 | ||
brand-id: V2yG6LAupEYdeTz6jHQLLOMkHGd1ZG44 | ||
model: ubuntu-core-22 | ||
architecture: riscv64 | ||
base: core22 | ||
grade: dangerous | ||
snaps: | ||
- | ||
default-channel: latest/stable | ||
id: ThisIsADummyStringForGadgetSnaps | ||
name: gadget-snap | ||
type: gadget | ||
- | ||
default-channel: latest/stable | ||
id: ThisIsADummyStringForKernelSnaps | ||
name: kernel-snap | ||
type: kernel | ||
- | ||
default-channel: latest/stable | ||
id: amcUKQILKXHHTlmSa7NMdnXSx02dNeeT | ||
name: core22 | ||
type: base | ||
- | ||
default-channel: latest/stable | ||
id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4 | ||
name: snapd | ||
type: snapd | ||
timestamp: 2023-03-05T02:00:46Z | ||
sign-key-sha3-384: J-RYIwjKa7kBS5WpVNM036ri24pNeOaAM3nbDzyv8q55iMF6Y3nJqsVYiBtI56vE | ||
|
||
AcLBcwQAAQoAHRYhBBP9k65i7BkdXwGeTA1TXkI+U5x2BQJkj7aJAAoJEA1TXkI+U5x27zsP/3WV | ||
RIoptbJ6FLZvP3bCDzXyXzGhFCt754aWcghfiUI0Ch/25TKROBeUe/yEmFTQeSEx3gwtEXS+mXrO | ||
4uoGj4ORqtDObkgsW2I+0H98d+TMwXs0Z3gdiaZxm2opKtt4T7XiNAjtAhcQsV4Btoi7HLPVnXP7 | ||
TkIFcwIEcOmaKVzIfO9w5f1VNL5MWklPQr02YK2tj58Fj93lrPN2Ogw/ylBvEVnYqpAM2B1X41oo | ||
MVECqlUmEAZkDPo1JsNwkNF/L5taT3dVw/i8H/dfBomnkottCe0tghbCvAxdG5MbOFZ+T7/qHxSi | ||
+/x/ci9kYaTgj5Er9yisnp+haWq7vYA/CnlkAESsm+aID0NhJsAfBdqWPPkwRmqAJk5RO6DXBgQB | ||
Eax3E6OSuuUttyms1svSnMlMGcyAQGh2YIBUbpVx7PVboW6YAbQ6SHizmCwLWDqXmhPKrAakslC2 | ||
jxRqWY1gnca18NIruPOkGfsk0IO/KY8pIzB1utPi62sznGUpGlb2MS1G07ynfO2zFIwJj9KR0qxN | ||
kBRnSJpEgB2XGtMLhPJYqNOoFUzijNFdpQ9cY0gObUuvVeBT0UGqZ4rqMNY1+2TC0LEVFUiFL3XX | ||
Wtkk7Nj2ScbxSJbwvwVd/lfeeEen3Vc5jGHQDPaKwqhRIYh1CO9Dcqxv5xy+B+hLedqTxve1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"type": "model", | ||
"authority-id": "V2yG6LAupEYdeTz6jHQLLOMkHGd1ZG44", | ||
"brand-id": "V2yG6LAupEYdeTz6jHQLLOMkHGd1ZG44", | ||
"series": "16", | ||
"model": "ubuntu-core-22", | ||
"architecture": "riscv64", | ||
"base": "core22", | ||
"grade": "dangerous", | ||
"snaps": [ | ||
{ | ||
"default-channel": "latest/stable", | ||
"id": "ThisIsADummyStringForGadgetSnaps", | ||
"name": "gadget-snap", | ||
"type": "gadget" | ||
}, | ||
{ | ||
"default-channel": "latest/stable", | ||
"id": "ThisIsADummyStringForKernelSnaps", | ||
"name": "kernel-snap", | ||
"type": "kernel" | ||
}, | ||
{ | ||
"default-channel": "latest/stable", | ||
"id": "amcUKQILKXHHTlmSa7NMdnXSx02dNeeT", | ||
"name": "core22", | ||
"type": "base" | ||
}, | ||
{ | ||
"default-channel": "latest/stable", | ||
"id": "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4", | ||
"name": "snapd", | ||
"type": "snapd" | ||
} | ||
], | ||
"timestamp": "2023-03-05T02:00:46Z" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
configs/patch/starfive_visionfive2/gadget_snap/additional/its/firmware.its
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/dts-v1/; | ||
|
||
/ { | ||
description = "Ubuntu Core FIT boot firmware"; | ||
#address-cells = <2>; | ||
|
||
images { | ||
firmware { | ||
description = "Ubuntu-Core-Bootloader"; | ||
data = /incbin/("./fw_payload.bin"); | ||
type = "firmware"; | ||
arch = "riscv"; | ||
os = "u-boot"; | ||
compression = "none"; | ||
load = <0x40000000>; | ||
entry = <0x40000000>; | ||
}; | ||
}; | ||
|
||
configurations { | ||
default = "firmware-1"; | ||
|
||
fimware-1 { | ||
description = "__DEVICE__ firmware"; | ||
firmware = "firmware"; | ||
}; | ||
}; | ||
}; |
15 changes: 15 additions & 0 deletions
15
configs/patch/starfive_visionfive2/gadget_snap/gadget.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
volumes: | ||
ubuntu-core: | ||
structure: | ||
- name: spl | ||
offset: 2097152 | ||
size: 1M | ||
type: 0C,2E54B353-1271-4842-806F-E436D6AF6985 | ||
content: | ||
- image: u-boot-spl.bin.normal.out | ||
- name: bootloader | ||
offset: 4194304 | ||
size: 8M | ||
type: 0C,5B193300-FC78-40CD-8002-E86C45580B47 | ||
content: | ||
- image: visionfive2_fw_payload.img |
71 changes: 71 additions & 0 deletions
71
configs/patch/starfive_visionfive2/gadget_snap/snap/snapcraft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
parts: | ||
u-boot: | ||
override-build: | | ||
cat << EOF >> configs/__BOOTLOADER_DEFCONFIG__ | ||
CONFIG_FIT=y | ||
CONFIG_LOCALVERSION_AUTO=n | ||
EOF | ||
sed -i "s/CONFIG_BOOTCOMMAND=\"\(.*\)\"/\ | ||
CONFIG_BOOTCOMMAND=\"load mmc 1:3 \${scriptaddr} boot.scr; source \${scriptaddr}\"/g" \ | ||
configs/__BOOTLOADER_DEFCONFIG__ | ||
sed -i "s/CONFIG_BOOTARGS=\"\(.*\)\"/\ | ||
CONFIG_BOOTARGS=\"console=tty1 console=ttyS0,115200 earlycon=sbi\"/g" \ | ||
configs/__BOOTLOADER_DEFCONFIG__ | ||
make __BOOTLOADER_DEFCONFIG__ | ||
make -j$(nproc) LOCALVERSION="-uc22" | ||
cp u-boot.bin "${CRAFT_PART_INSTALL}"/ | ||
cp spl/u-boot-spl.bin "${CRAFT_PART_INSTALL}"/ | ||
cp arch/riscv/dts/starfive_visionfive2.dtb "${CRAFT_PART_INSTALL}"/ | ||
# Copy licenses | ||
mkdir -p "${CRAFT_PART_INSTALL}"/usr/share/doc/u-boot | ||
cp -a Licenses/* "${CRAFT_PART_INSTALL}"/usr/share/doc/u-boot | ||
mkenvimage -s 4096 -o "${CRAFT_PART_INSTALL}"/boot.sel - < /dev/null | ||
touch "${CRAFT_PART_INSTALL}"/uboot.conf | ||
prime: | ||
- -u-boot-spl.bin | ||
- -starfive_visionfive2.dtb | ||
|
||
spl: | ||
after: | ||
- u-boot | ||
plugin: nil | ||
source: https://github.com/starfive-tech/soft_3rdpart.git | ||
source-type: git | ||
source-depth: 1 | ||
source-branch: JH7110_VisionFive2_devel | ||
override-build: | | ||
cd spl_tool | ||
make | ||
./spl_tool -c -f "${CRAFT_STAGE}"/u-boot-spl.bin | ||
cp "${CRAFT_STAGE}"/u-boot-spl.bin.normal.out "${CRAFT_PART_INSTALL}"/ | ||
open-sbi: | ||
after: | ||
- u-boot | ||
plugin: nil | ||
source: https://github.com/starfive-tech/opensbi.git | ||
source-type: git | ||
source-depth: 1 | ||
source-branch: master | ||
build-environment: | ||
- on amd64: | ||
- CROSS_COMPILE: riscv64-linux-gnu- | ||
- CFLAGS: "-mabi=lp64d -march=rv64imafdc_zicsr_zifencei_zba_zbb" | ||
override-build: | | ||
mkdir output | ||
make PLATFORM=generic FW_PAYLOAD_PATH="${CRAFT_STAGE}"/u-boot.bin \ | ||
FW_FDT_PATH="${CRAFT_STAGE}"/starfive_visionfive2.dtb \ | ||
FW_TEXT_START=0x40000000 O=output | ||
cp "${CRAFT_PROJECT_DIR}"/its/firmware.its . | ||
cp output/platform/generic/firmware/fw_payload.bin . | ||
mkimage -f firmware.its -A riscv -O u-boot -T firmware \ | ||
"${CRAFT_PART_INSTALL}"/visionfive2_fw_payload.img | ||
boot-script: | ||
override-build: | | ||
sed -i 's/setenv mmc_seed_part 1/setenv mmc_seed_part 3/g' boot.cmd | ||
sed -i 's/setenv mmc_boot_part 2/setenv mmc_boot_part 4/g' boot.cmd | ||
mkimage -C none -A arm -T script -d boot.cmd "${CRAFT_PART_INSTALL}"/boot.scr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# StarFive JH7110 quad core | ||
DEVICE="StarFive_VisionFive2" | ||
ARCH=riscv64 | ||
CROSS_COMPILER=riscv64-linux-gnu- | ||
CROSS_COMPILER_DEB_PACKAGE=gcc-riscv64-linux-gnu | ||
|
||
PARTITION_SCHEMA=gpt | ||
BOOTLOADER_GIT_SOURCE=https://github.com/starfive-tech/u-boot | ||
BOOTLOADER_GIT_BRANCH=JH7110_VisionFive2_devel | ||
BOOTLOADER_DEFCONFIG=starfive_visionfive2_defconfig | ||
BOOTLOADER_BINARY=u-boot.bin | ||
BOOTLOADER_BINARY_RENAME=false | ||
BOOTLOADER_BOOTARGS="" | ||
|
||
CLOUD_INIT_ENABLED=true | ||
|
||
MMC_DEV_NUM=1 | ||
KERNEL_LOAD_ADDR=0x40200000 | ||
RAMDISK_LOAD_ADDR=0x46100000 | ||
FDT_LOAD_ADDR=0x46000000 | ||
FIT_LOAD_ADDR=0xa0000000 | ||
|
||
ITS_KERNEL_COMPRESSION="none" | ||
ITS_FDT_NAME=jh7110-visionfive-v2.dtb | ||
|
||
KERNEL_GIT_SOURCE=https://github.com/starfive-tech/linux.git | ||
KERNEL_GIT_BRANCH=JH7110_VisionFive2_devel | ||
KERNEL_DEFCONFIG=starfive_visionfive2_defconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,5 @@ | |
ramdisk = "ramdisk-uc"; | ||
fdt = "fdt-uc"; | ||
}; | ||
|
||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters