mirror of
https://gitee.com/bianbu-linux/buildroot-ext
synced 2025-04-18 20:34:47 -04:00
Update for v1.0alpha2
This commit is contained in:
commit
9a5ccb4cd4
54 changed files with 1697 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
fs/bootfs/fakeroot
|
16
Config.in
Normal file
16
Config.in
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
menu "Bianbu config"
|
||||
|
||||
source "$BR2_EXTERNAL_Bianbu_PATH/package/mpp/Config.in"
|
||||
source "$BR2_EXTERNAL_Bianbu_PATH/package/img-gpu-powervr/Config.in"
|
||||
source "$BR2_EXTERNAL_Bianbu_PATH/package/drm-test/Config.in"
|
||||
source "$BR2_EXTERNAL_Bianbu_PATH/package/v2d-test/Config.in"
|
||||
source "$BR2_EXTERNAL_Bianbu_PATH/package/k1x-vpu-test/Config.in"
|
||||
source "$BR2_EXTERNAL_Bianbu_PATH/package/k1x-vpu-firmware/Config.in"
|
||||
source "$BR2_EXTERNAL_Bianbu_PATH/package/k1x-jpu/Config.in"
|
||||
source "$BR2_EXTERNAL_Bianbu_PATH/package/k1x-cam/Config.in"
|
||||
source "$BR2_EXTERNAL_Bianbu_PATH/package/vk-gl-cts/Config.in"
|
||||
source "$BR2_EXTERNAL_Bianbu_PATH/package/onnx-runtime/Config.in"
|
||||
source "$BR2_EXTERNAL_Bianbu_PATH/package/ai-support/Config.in"
|
||||
|
||||
endmenu
|
93
board/spacemit/k1/dracut.conf
Executable file
93
board/spacemit/k1/dracut.conf
Executable file
|
@ -0,0 +1,93 @@
|
|||
#Simple dracut config for a system without systemd
|
||||
|
||||
#Dracut configuration
|
||||
|
||||
show_modules=yes
|
||||
i18n_install_all=no
|
||||
lvmconf=no
|
||||
mdadmconf=no
|
||||
early_microcode=no
|
||||
hostonly=no
|
||||
hostonly_cmdline=no
|
||||
use_fstab=no
|
||||
kernel_cmdline="rd.break=initqueue"
|
||||
do_strip=no
|
||||
|
||||
# Dracut modules needed
|
||||
add_dracutmodules+=" \
|
||||
busybox-init \
|
||||
busybox \
|
||||
rescue \
|
||||
"
|
||||
|
||||
# Modules to ignore
|
||||
omit_dracutmodules+=" \
|
||||
bash \
|
||||
biosdevname \
|
||||
btrfs \
|
||||
bluetooth \
|
||||
caps \
|
||||
cifs \
|
||||
crypt \
|
||||
crypt-gpg \
|
||||
dash \
|
||||
dbus-broker \
|
||||
dbus-daemon \
|
||||
dm \
|
||||
dmraid \
|
||||
dmsquash-live-ntfs \
|
||||
dracut-systemd \
|
||||
fcoe \
|
||||
fcoe-uefi \
|
||||
fs-lib \
|
||||
iscsi \
|
||||
i18n \
|
||||
lvmmerge \
|
||||
lvm \
|
||||
lunmask \
|
||||
mdraid \
|
||||
memstrack \
|
||||
mksh \
|
||||
modsign \
|
||||
mount-root \
|
||||
multipath \
|
||||
nbd \
|
||||
network-legacy \
|
||||
network-wicked \
|
||||
nfs \
|
||||
nvdimm \
|
||||
nvmf \
|
||||
parse-lunmask \
|
||||
qemu \
|
||||
qemu-net \
|
||||
resume \
|
||||
rootfs-block \
|
||||
rngd \
|
||||
systemd \
|
||||
systemd-udevd \
|
||||
systemd-coredump \
|
||||
systemd-ask-password \
|
||||
systemd-timedated \
|
||||
systemd-rfkill \
|
||||
systemd-resolved \
|
||||
systemd-hostnamed \
|
||||
systemd-initrd \
|
||||
systemd-journald \
|
||||
systemd-ldconfig \
|
||||
systemd-networkd \
|
||||
systemd-timesyncd \
|
||||
systemd-veritysetup \
|
||||
systemd-modules-load \
|
||||
systemd-sysctl \
|
||||
systemd-repart \
|
||||
systemd-sysext \
|
||||
systemd-sysusers \
|
||||
systemd-tmpfiles \
|
||||
squash \
|
||||
ssh-client \
|
||||
stratis \
|
||||
tpm2-tss \
|
||||
udev-rules \
|
||||
url-lib \
|
||||
usrmount \
|
||||
"
|
153
board/spacemit/k1/env_k1-x.txt
Normal file
153
board/spacemit/k1/env_k1-x.txt
Normal file
|
@ -0,0 +1,153 @@
|
|||
# Common parameter
|
||||
earlycon=sbi
|
||||
console=ttyS0,115200
|
||||
init=/init
|
||||
bootdelay=0
|
||||
baudrate=115200
|
||||
loglevel=loglevel=8
|
||||
|
||||
#partitions/mtdparts/mtdids would set while flashing env.bin
|
||||
partitions=
|
||||
mtdids=nor0=spi-dev
|
||||
mtdparts=spi-dev:64K@0K(bootinfo),256K@64K(fsbl),128K@512K(env),384K@640K(opensbi),1M@2M(uboot)
|
||||
|
||||
# Nand flash rootfs device
|
||||
nand_root=ubi0:rootfs
|
||||
nand_rootfstype=ubifs
|
||||
|
||||
# Nor flash rootfs device
|
||||
nor_root=/dev/mtdblock6
|
||||
nor_rootfstype=squashfs
|
||||
|
||||
# eMMC/SDCard rootfs device
|
||||
mmc_rootfstype=ext4
|
||||
|
||||
## Get "rootfs" partition number in decimal, and set var "mmc_root"
|
||||
## Variable "boot_devnum" is set during board_lat_init()
|
||||
set_mmc_root=part number mmc ${boot_devnum} rootfs rootfs_part; \
|
||||
setexpr rootfs_part ${rootfs_part} + 0; \
|
||||
setenv mmc_root "/dev/mmcblk${boot_devnum}p${rootfs_part}";
|
||||
|
||||
set_nvme_root=part number nvme ${boot_devnum} rootfs rootfs_part; \
|
||||
setexpr rootfs_part ${rootfs_part} + 0; \
|
||||
setenv nvme_root "/dev/nvme${boot_devnum}n1p${rootfs_part}";
|
||||
|
||||
# NFS device
|
||||
#override here, otherwise gen random addr and save to eeprom by uboot
|
||||
#ethaddr=fe:fe:fe:22:22:01
|
||||
#eth1addr=fe:fe:fe:22:22:02
|
||||
|
||||
ipaddr=192.168.1.15
|
||||
netmask=255.255.255.0
|
||||
serverip=192.168.1.2
|
||||
gatewayip=192.168.1.1
|
||||
|
||||
preboot=
|
||||
knl_addr=0x40000000
|
||||
ramdisk_addr=0x50000000
|
||||
knl_name=uImage.itb
|
||||
ramdisk_name=initramfs-generic.img
|
||||
dtb_name=k1-x_evb.dtb
|
||||
dtb_addr=0x28000000
|
||||
mdio_intf=
|
||||
phyaddr0=1
|
||||
phy_link_time=10000
|
||||
netdev=eth0
|
||||
nfsopts=
|
||||
nfs_root=
|
||||
nfs_bootfile=
|
||||
|
||||
# Common boot args
|
||||
commonargs=setenv bootargs earlycon=${earlycon} earlyprintk console=tty1 console=${console} ${loglevel} clk_ignore_unused rdinit=${init}
|
||||
|
||||
#detect product_name from env and select dtb file to load
|
||||
dtb_env=if test -n "${product_name}"; then \
|
||||
if test "${product_name}" = k1_evb; then \
|
||||
setenv dtb_name k1-x_evb.dtb; \
|
||||
elif test "${product_name}" = k1_deb1; then \
|
||||
setenv dtb_name k1-x_deb1.dtb; \
|
||||
elif test "${product_name}" = k1_deb2; then \
|
||||
setenv dtb_name k1-x_deb2.dtb; \
|
||||
else \
|
||||
echo "Unknow product_name: ${product_name}, loads default dtb: ${dtb_name}"; \
|
||||
fi; \
|
||||
fi;
|
||||
|
||||
detect_dtb=echo "product_name: ${product_name}"; run dtb_env; echo "detect dtb_name: ${dtb_name}";
|
||||
|
||||
# spinand_ubifs boot
|
||||
ubifs_list= mtd list; \
|
||||
ubifsls;
|
||||
ubifs_loadimg= echo " ubifsload uImage.itb..."; \
|
||||
ubifsload ${knl_addr} ${knl_name};
|
||||
|
||||
ubifs_boot=echo "Trying to boot from UBIFS..."; \
|
||||
run ubifs_loadimg; \
|
||||
bootm ${knl_addr};
|
||||
|
||||
# Nand boot
|
||||
nand_boot=echo "Try to boot from nand flash..."; \
|
||||
run ubifs_list; \
|
||||
run ubifs_loadimg; \
|
||||
bootm ${knl_addr};
|
||||
|
||||
# Nor boot
|
||||
set_nor_args=setenv bootargs ${bootargs} mtdparts=${mtdparts} root=${nvme_root} rootfstype=ext4
|
||||
|
||||
nor_loadknl=echo "Loading kernel..."; \
|
||||
fatload ${bootfs_devname} ${boot_devnum}:${bootfs_part} ${knl_addr} ${knl_name}; \
|
||||
fatload ${bootfs_devname} ${boot_devnum}:${bootfs_part} ${ramdisk_addr} ${ramdisk_name}; \
|
||||
fatload ${bootfs_devname} ${boot_devnum}:${bootfs_part} ${dtb_addr} ${dtb_name};
|
||||
|
||||
nor_boot=echo "Try to boot from NVMe ..."; \
|
||||
run commonargs; \
|
||||
run set_nvme_root; \
|
||||
run set_nor_args; \
|
||||
run detect_dtb; \
|
||||
run nor_loadknl; \
|
||||
bootm ${knl_addr} ${ramdisk_addr} ${dtb_addr}; \
|
||||
echo "########### boot kernel failed by default config, check your boot config #############"
|
||||
|
||||
###############################################################################
|
||||
# eMMC/SDCard boot
|
||||
###############################################################################
|
||||
set_mmc_args=setenv bootargs "${bootargs}" root=${mmc_root} rootwait rootfstype=${mmc_rootfstype};
|
||||
|
||||
mmc_loadknl=echo "Loading kernel ..."; \
|
||||
fatload mmc ${boot_devnum}:${bootfs_part} ${knl_addr} ${knl_name}; \
|
||||
fatload mmc ${boot_devnum}:${bootfs_part} ${ramdisk_addr} ${ramdisk_name}; \
|
||||
fatload mmc ${boot_devnum}:${bootfs_part} ${dtb_addr} ${dtb_name};
|
||||
|
||||
|
||||
mmc_boot=echo "Try to boot from MMC${boot_devnum} ..."; \
|
||||
run commonargs; \
|
||||
run set_mmc_root; \
|
||||
run set_mmc_args; \
|
||||
run detect_dtb; \
|
||||
run mmc_loadknl; \
|
||||
bootm ${knl_addr} ${ramdisk_addr} ${dtb_addr}; \
|
||||
echo "########### boot kernel failed by default config, check your boot config #############"
|
||||
|
||||
# NFS boot args
|
||||
nfs_args=run commonargs; setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${nfs_root},${nfsopts}
|
||||
addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off
|
||||
nfs_boot=echo Booting from NFS..; run nfs_args; run addip; tftp ${knl_addr} ${nfs_bootfile} && bootm ${knl_addr}
|
||||
|
||||
# U-boot autoboot script: try to boot from device, if failed then try nfs boot
|
||||
# Variable "boot_device" is set during board_late_init()
|
||||
autoboot=if test ${boot_device} = nand; then \
|
||||
run nand_boot; \
|
||||
elif test ${boot_device} = nor; then \
|
||||
run nor_boot; \
|
||||
elif test ${boot_device} = mmc; then \
|
||||
run mmc_boot; \
|
||||
fi; \
|
||||
run nfs_boot;
|
||||
bootcmd=run autoboot; echo "run autoboot"
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
BIN
board/spacemit/k1/factory/bootinfo_emmc.bin
Normal file
BIN
board/spacemit/k1/factory/bootinfo_emmc.bin
Normal file
Binary file not shown.
BIN
board/spacemit/k1/factory/bootinfo_sd.bin
Normal file
BIN
board/spacemit/k1/factory/bootinfo_sd.bin
Normal file
Binary file not shown.
BIN
board/spacemit/k1/factory/bootinfo_spinand.bin
Normal file
BIN
board/spacemit/k1/factory/bootinfo_spinand.bin
Normal file
Binary file not shown.
BIN
board/spacemit/k1/factory/bootinfo_spinor.bin
Normal file
BIN
board/spacemit/k1/factory/bootinfo_spinor.bin
Normal file
Binary file not shown.
52
board/spacemit/k1/fastboot.yaml
Executable file
52
board/spacemit/k1/fastboot.yaml
Executable file
|
@ -0,0 +1,52 @@
|
|||
version: 1.0 # 配置文件版本
|
||||
support: # 支持的项目代号
|
||||
- 'k1x'
|
||||
- 'k1pro'
|
||||
actions: # 刷机操作的定义
|
||||
|
||||
- getvar:
|
||||
args: 'version-brom'
|
||||
set: 'version'
|
||||
skip_fail: true
|
||||
timeout:
|
||||
seconds: 1
|
||||
|
||||
- stage:
|
||||
file: 'factory/FSBL.bin'
|
||||
skip_when: "not temp.version"
|
||||
timeout:
|
||||
minutes: 2
|
||||
|
||||
- continue:
|
||||
skip_when: "not temp.version"
|
||||
timeout:
|
||||
seconds: 1
|
||||
|
||||
- stage:
|
||||
file: 'u-boot.itb'
|
||||
skip_when: "not temp.version"
|
||||
timeout:
|
||||
minutes: 2
|
||||
retry: 3
|
||||
|
||||
- continue:
|
||||
skip_when: "not temp.version"
|
||||
timeout:
|
||||
seconds: 1
|
||||
|
||||
- getvar:
|
||||
args: 'mtd-size'
|
||||
set_var: 'size0'
|
||||
timeout:
|
||||
seconds: 1
|
||||
|
||||
- getvar:
|
||||
args: 'blk-size'
|
||||
set_var: 'size1'
|
||||
timeout:
|
||||
seconds: 1
|
||||
|
||||
- multi_flash:
|
||||
timeout:
|
||||
minutes: 10
|
||||
relate_partition: ['partition_{size0}.json', 'partition_{size1}.json']
|
118
board/spacemit/k1/fsbl.yml
Executable file
118
board/spacemit/k1/fsbl.yml
Executable file
|
@ -0,0 +1,118 @@
|
|||
# fspl build configuration script
|
||||
# key word
|
||||
# image -- image definition
|
||||
# module -- image module define
|
||||
# data -- image item data config
|
||||
info:
|
||||
arch: RISCV64
|
||||
description: spacemit k1x fsbl image
|
||||
image:
|
||||
- module: ROTPK
|
||||
data:
|
||||
- pubkey:
|
||||
name: rsakeypair0
|
||||
algorithm: RSA2048
|
||||
source: key/rsakeypair0_prv.key
|
||||
align: 256
|
||||
- module: image_header
|
||||
data:
|
||||
- structure:
|
||||
# only structure support nest data type
|
||||
# item name, item value or method, item size
|
||||
- name, header0, 0
|
||||
- magic, AIHD, 4
|
||||
- version, 1, 1
|
||||
- secure, 0, 1
|
||||
- reserved, 0, 2
|
||||
- imgsize, 0x1000, 8
|
||||
- load_addr, 0, 8
|
||||
- pad, 0xA5, 8
|
||||
- module: image_config
|
||||
data:
|
||||
- structure:
|
||||
- name, keydata, 0
|
||||
- key_default, 0, 4
|
||||
- table_num, 4, 4
|
||||
- structure:
|
||||
- name, keytable0, 0
|
||||
- key_name, spl, 16
|
||||
- key_id, 0, 4
|
||||
- structure:
|
||||
- name, keytable1, 0
|
||||
- key_name, uboot, 16
|
||||
- key_id, 1, 4
|
||||
- structure:
|
||||
- name, keytable2, 0
|
||||
- key_name, kernel, 16
|
||||
- key_id, 2, 4
|
||||
- structure:
|
||||
- name, keytable3, 0
|
||||
- key_name, rootfs, 16
|
||||
- key_id, 3, 4
|
||||
- reserved, 0, 320
|
||||
- hash:
|
||||
name: rotpk_hash
|
||||
algorithm: SHA256
|
||||
source: rsakeypair0
|
||||
align: 32
|
||||
- pad, 0, 40
|
||||
- module: oem_pubkey
|
||||
data:
|
||||
- structure:
|
||||
- name, oem_key, 0
|
||||
- pubkey:
|
||||
name: spl_pubkey
|
||||
algorithm: RSA2048
|
||||
source: key/spl_pubkey_prv.key
|
||||
align: 256
|
||||
- pubkey:
|
||||
name: uboot_pubkey
|
||||
algorithm: RSA2048
|
||||
source: key/uboot_pubkey_pub.key
|
||||
align: 256
|
||||
- pubkey:
|
||||
name: kernel_pubkey
|
||||
algorithm: RSA2048
|
||||
source: key/kernel_pubkey_pub.key
|
||||
align: 256
|
||||
- pubkey:
|
||||
name: rootfs_pubkey
|
||||
algorithm: RSA2048
|
||||
source: key/rootfs_pubkey_pub.key
|
||||
align: 256
|
||||
- reserved, 0, 1024
|
||||
- module: cert0
|
||||
data:
|
||||
- signature:
|
||||
name: signature0
|
||||
algorithm: SHA256+RSA2048
|
||||
key: rsakeypair0
|
||||
# signature source MUST has the same order within file
|
||||
source: header0 + keydata + oem_key
|
||||
align: 256
|
||||
- module: padding
|
||||
data:
|
||||
- structure:
|
||||
- pad, 0, 992
|
||||
- module: spl
|
||||
data:
|
||||
- structure:
|
||||
- name, header1, 0
|
||||
- magic, AIHD, 4
|
||||
- version, 1, 1
|
||||
- secure, 0, 1
|
||||
- reserved, 0, 2
|
||||
- imgsize, sizeof(fsbl), 8
|
||||
- load_addr, 0, 8
|
||||
- pad, 0xA5, 8
|
||||
- file:
|
||||
name: fsbl
|
||||
source: u-boot-spl.bin
|
||||
align: 32
|
||||
- signature:
|
||||
name: signature1
|
||||
algorithm: SHA256+RSA2048
|
||||
key: spl_pubkey
|
||||
# signature source MUST has the same order within file
|
||||
source: header1 + fsbl
|
||||
align: 256
|
BIN
board/spacemit/k1/k1-x.bmp
Normal file
BIN
board/spacemit/k1/k1-x.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 256 KiB |
31
board/spacemit/k1/kernel_fdt.its
Normal file
31
board/spacemit/k1/kernel_fdt.its
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* U-Boot uImage source file containing a single kernel
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
description = "Image with single Linux kernel";
|
||||
#address-cells = <2>;
|
||||
|
||||
images {
|
||||
kernel {
|
||||
description = "Spacemit Linux kernel";
|
||||
data = /incbin/("./Image");
|
||||
type = "kernel";
|
||||
arch = "riscv";
|
||||
os = "linux";
|
||||
compression = "none";
|
||||
load = <0x0 0x1400000>;
|
||||
entry = <0x0 0x1400000>;
|
||||
};
|
||||
};
|
||||
|
||||
configurations {
|
||||
default = "conf-1";
|
||||
conf-1 {
|
||||
description = "Boot Linux kernel with external initramfs";
|
||||
kernel = "kernel";
|
||||
};
|
||||
};
|
||||
};
|
41
board/spacemit/k1/partition_256M.json
Executable file
41
board/spacemit/k1/partition_256M.json
Executable file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"version": "1.0",
|
||||
"format": "mtd",
|
||||
"partitions": [
|
||||
{
|
||||
"name": "bootinfo",
|
||||
"offset": "0",
|
||||
"size": "128K",
|
||||
"image": "factory/bootinfo_spinand.bin"
|
||||
},
|
||||
{
|
||||
"name": "fsbl",
|
||||
"offset": "256K",
|
||||
"size": "256K",
|
||||
"image": "factory/FSBL.bin"
|
||||
},
|
||||
{
|
||||
"name": "env",
|
||||
"offset": "512K",
|
||||
"size": "128K"
|
||||
},
|
||||
{
|
||||
"name": "opensbi",
|
||||
"offset": "640K",
|
||||
"size": "384K",
|
||||
"image": "opensbi.itb"
|
||||
},
|
||||
{
|
||||
"name": "uboot",
|
||||
"offset": "1M",
|
||||
"size": "1M",
|
||||
"image": "u-boot.itb"
|
||||
},
|
||||
{
|
||||
"name": "user",
|
||||
"offset": "2M",
|
||||
"size": "-",
|
||||
"volume_images": {"bootfs": "bootfs.img", "rootfs": "rootfs.img"}
|
||||
}
|
||||
]
|
||||
}
|
35
board/spacemit/k1/partition_2M.json
Normal file
35
board/spacemit/k1/partition_2M.json
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"version": "1.0",
|
||||
"format": "mtd",
|
||||
"partitions": [
|
||||
{
|
||||
"name": "bootinfo",
|
||||
"offset": "0",
|
||||
"size": "64K",
|
||||
"image": "factory/bootinfo_spinor.bin"
|
||||
},
|
||||
{
|
||||
"name": "fsbl",
|
||||
"offset": "64K",
|
||||
"size": "256K",
|
||||
"image": "factory/FSBL.bin"
|
||||
},
|
||||
{
|
||||
"name": "env",
|
||||
"offset": "512K",
|
||||
"size": "128K"
|
||||
},
|
||||
{
|
||||
"name": "opensbi",
|
||||
"offset": "640K",
|
||||
"size": "384K",
|
||||
"image": "opensbi.itb"
|
||||
},
|
||||
{
|
||||
"name": "uboot",
|
||||
"offset": "1M",
|
||||
"size": "1M",
|
||||
"image": "u-boot.itb"
|
||||
}
|
||||
]
|
||||
}
|
35
board/spacemit/k1/partition_4M.json
Normal file
35
board/spacemit/k1/partition_4M.json
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"version": "1.0",
|
||||
"format": "mtd",
|
||||
"partitions": [
|
||||
{
|
||||
"name": "bootinfo",
|
||||
"offset": "0",
|
||||
"size": "64K",
|
||||
"image": "factory/bootinfo_spinor.bin"
|
||||
},
|
||||
{
|
||||
"name": "fsbl",
|
||||
"offset": "64K",
|
||||
"size": "256K",
|
||||
"image": "factory/FSBL.bin"
|
||||
},
|
||||
{
|
||||
"name": "env",
|
||||
"offset": "512K",
|
||||
"size": "128K"
|
||||
},
|
||||
{
|
||||
"name": "opensbi",
|
||||
"offset": "640K",
|
||||
"size": "384K",
|
||||
"image": "opensbi.itb"
|
||||
},
|
||||
{
|
||||
"name": "uboot",
|
||||
"offset": "1M",
|
||||
"size": "2M",
|
||||
"image": "u-boot.itb"
|
||||
}
|
||||
]
|
||||
}
|
40
board/spacemit/k1/partition_64M.json
Normal file
40
board/spacemit/k1/partition_64M.json
Normal file
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"version": "1.0",
|
||||
"format": "mtd",
|
||||
"partitions": [
|
||||
{
|
||||
"name": "bootinfo",
|
||||
"offset": "0",
|
||||
"size": "128K",
|
||||
"image": "factory/bootinfo_spinand.bin"
|
||||
},
|
||||
{
|
||||
"name": "fsbl",
|
||||
"offset": "256K",
|
||||
"size": "256K",
|
||||
"image": "factory/FSBL.bin"
|
||||
},
|
||||
{
|
||||
"name": "env",
|
||||
"offset": "512K",
|
||||
"size": "128K"
|
||||
},
|
||||
{
|
||||
"name": "opensbi",
|
||||
"offset": "640K",
|
||||
"size": "384K",
|
||||
"image": "opensbi.itb"
|
||||
},
|
||||
{
|
||||
"name": "uboot",
|
||||
"offset": "1M",
|
||||
"size": "2M",
|
||||
"image": "u-boot.itb"
|
||||
},
|
||||
{
|
||||
"name": "bootfs",
|
||||
"offset": "3M",
|
||||
"size": "61M"
|
||||
}
|
||||
]
|
||||
}
|
35
board/spacemit/k1/partition_8M.json
Normal file
35
board/spacemit/k1/partition_8M.json
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"version": "1.0",
|
||||
"format": "mtd",
|
||||
"partitions": [
|
||||
{
|
||||
"name": "bootinfo",
|
||||
"offset": "0",
|
||||
"size": "64K",
|
||||
"image": "factory/bootinfo_spinor.bin"
|
||||
},
|
||||
{
|
||||
"name": "fsbl",
|
||||
"offset": "64K",
|
||||
"size": "256K",
|
||||
"image": "factory/FSBL.bin"
|
||||
},
|
||||
{
|
||||
"name": "env",
|
||||
"offset": "512K",
|
||||
"size": "128K"
|
||||
},
|
||||
{
|
||||
"name": "opensbi",
|
||||
"offset": "640K",
|
||||
"size": "384K",
|
||||
"image": "opensbi.itb"
|
||||
},
|
||||
{
|
||||
"name": "uboot",
|
||||
"offset": "1M",
|
||||
"size": "2M",
|
||||
"image": "u-boot.itb"
|
||||
}
|
||||
]
|
||||
}
|
49
board/spacemit/k1/partition_universal.json
Normal file
49
board/spacemit/k1/partition_universal.json
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"version": "1.0",
|
||||
"format": "gpt",
|
||||
"partitions": [
|
||||
{
|
||||
"name": "bootinfo",
|
||||
"hidden": true,
|
||||
"offset": "0K",
|
||||
"size": "512",
|
||||
"image": "factory/bootinfo_sd.bin",
|
||||
"holes": "{\"(80;512)\"}"
|
||||
},
|
||||
{
|
||||
"name": "fsbl",
|
||||
"hidden": false,
|
||||
"offset": "256K",
|
||||
"size": "256K",
|
||||
"image": "factory/FSBL.bin"
|
||||
},
|
||||
{
|
||||
"name": "env",
|
||||
"offset":"512K",
|
||||
"size": "128K",
|
||||
"image": "env.bin"
|
||||
},
|
||||
{
|
||||
"name": "opensbi",
|
||||
"size": "384K",
|
||||
"image": "opensbi.itb"
|
||||
},
|
||||
{
|
||||
"name": "uboot",
|
||||
"size": "2M",
|
||||
"image": "u-boot.itb"
|
||||
},
|
||||
{
|
||||
"name": "bootfs",
|
||||
"offset": "4M",
|
||||
"size": "256M",
|
||||
"image": "bootfs.img"
|
||||
},
|
||||
{
|
||||
"name": "rootfs",
|
||||
"offset": "260M",
|
||||
"size": "-",
|
||||
"image": "rootfs.ext4"
|
||||
}
|
||||
]
|
||||
}
|
170
board/spacemit/k1/prepare_img.sh
Executable file
170
board/spacemit/k1/prepare_img.sh
Executable file
|
@ -0,0 +1,170 @@
|
|||
#!/bin/bash
|
||||
|
||||
######################## Prepare sub-iamges and pack ####################
|
||||
#$0 is this file path
|
||||
#$1 is buildroot output images dir
|
||||
|
||||
IMGS_DIR=$1
|
||||
DEVICE_DIR=$(dirname $0)
|
||||
|
||||
SRC_ROOTFS_FILE="$DEVICE_DIR/rootfs.ext4"
|
||||
FSBL_YML_FILE="$DEVICE_DIR/fsbl.yml"
|
||||
KERNEL_FIT_FILE="$DEVICE_DIR/kernel_fdt.its"
|
||||
PARTITIONS_FILE="$DEVICE_DIR/partition_universal.json"
|
||||
UENV_TXT_FILE="$DEVICE_DIR/env_k1-x.txt"
|
||||
UBOOT_LOGO_FILE="$DEVICE_DIR/k1-x.bmp"
|
||||
|
||||
#Give a chance to CI
|
||||
if [ -z "$BIANBU_LINUX_ARCHIVE" ]; then
|
||||
TARGET_IMAGE_ZIP="$IMGS_DIR/spacemit_bianbu_linux_k1_emmc_pack_image.zip"
|
||||
else
|
||||
TARGET_IMAGE_ZIP="$BIANBU_LINUX_ARCHIVE.zip"
|
||||
fi
|
||||
|
||||
TARGET_ROOTFS_FILE="$IMGS_DIR/rootfs.ext2"
|
||||
TARGET_BOOTFS_FILE="$IMGS_DIR/bootfs.img"
|
||||
#TARGET_INITRAMFS_FILE=("$IMGS_DIR/rootfs.cpio.gz")
|
||||
TARGET_INITRAMFS_FILE=("$IMGS_DIR/rootfs.cpio.uboot")
|
||||
|
||||
BOOTFS_SIZE=$($IMGS_DIR/../host/bin/jq '.partitions[] | select(.name == "bootfs") | .size' "$PARTITIONS_FILE")
|
||||
BOOTFS_DIR="$IMGS_DIR/bootfs"
|
||||
BOOTFS_IMG_FILE="$IMGS_DIR/bootfs.img"
|
||||
|
||||
KERNEL_DTB_NAME="k1-x*.dtb"
|
||||
KERNEL_DTB_FILE="$IMGS_DIR/$KERNEL_DTB_NAME"
|
||||
KERNEL_IMAGE_FILE="$IMGS_DIR/uImage.itb"
|
||||
|
||||
FAKE_ROOT_FILE=/tmp/$(whoami)-fakeroot
|
||||
|
||||
#Pack kernel image and initramfs
|
||||
gen_bootfs_vfat() {
|
||||
echo -e "\n"
|
||||
echo "Starting to build bootfs ..............................."
|
||||
|
||||
echo "#!/bin/sh" > "$FAKE_ROOT_FILE"
|
||||
echo "set -e" >> "$FAKE_ROOT_FILE"
|
||||
echo "rm -rf $BOOTFS_DIR" >> "$FAKE_ROOT_FILE"
|
||||
echo "mkdir -p $BOOTFS_DIR" >> "$FAKE_ROOT_FILE"
|
||||
|
||||
echo "rm -f $BOOTFS_IMG_FILE" >> "$FAKE_ROOT_FILE"
|
||||
echo "dd if=/dev/zero of=$BOOTFS_IMG_FILE count=1 bs=$BOOTFS_SIZE" >> "$FAKE_ROOT_FILE"
|
||||
echo "mkfs.vfat $BOOTFS_IMG_FILE" >> "$FAKE_ROOT_FILE"
|
||||
|
||||
echo "cp -f $UENV_TXT_FILE $BOOTFS_DIR/" >> "$FAKE_ROOT_FILE"
|
||||
echo "cp -f $UBOOT_LOGO_FILE $BOOTFS_DIR/" >> "$FAKE_ROOT_FILE"
|
||||
echo "cp -f $KERNEL_IMAGE_FILE $BOOTFS_DIR/" >> "$FAKE_ROOT_FILE"
|
||||
echo "cp -f $KERNEL_DTB_FILE $BOOTFS_DIR/" >> "$FAKE_ROOT_FILE"
|
||||
echo "cp -f $TARGET_INITRAMFS_FILE $BOOTFS_DIR/initramfs-generic.img" >> "$FAKE_ROOT_FILE"
|
||||
echo "mcopy -i $BOOTFS_IMG_FILE $BOOTFS_DIR/* ::" >> "$FAKE_ROOT_FILE"
|
||||
|
||||
chmod 777 "$FAKE_ROOT_FILE"
|
||||
FAKEROOTDONTTRYCHOWN=1 "$IMGS_DIR/../host/bin/fakeroot" -- "$FAKE_ROOT_FILE"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Building bootfs failed. Please check for errors..............."
|
||||
exit 1
|
||||
fi
|
||||
echo "Bootfs build successful................................."
|
||||
echo -e "\n"
|
||||
}
|
||||
|
||||
override_rootfs_img() {
|
||||
#override rootfs.ext4 if needed
|
||||
if [ -f "$SRC_ROOTFS_FILE" ]; then
|
||||
cp -rf ${SRC_ROOTFS_FILE} ${TARGET_ROOTFS_FILE}
|
||||
echo "Successfully overridden ${TARGET_ROOTFS_FILE} with ${SRC_ROOTFS_FILE}"
|
||||
fi
|
||||
}
|
||||
|
||||
gen_sub_images() {
|
||||
|
||||
#env.bin
|
||||
rm -f ${IMGS_DIR}/env_k1-x.txt
|
||||
cp -f ${UENV_TXT_FILE} ${IMGS_DIR}/
|
||||
$IMGS_DIR/../host/bin/mkenvimage -s 0x4000 -o ${IMGS_DIR}/env.bin ${IMGS_DIR}/env_k1-x.txt
|
||||
rm ${IMGS_DIR}/env_k1-x.txt
|
||||
|
||||
#Rename to opensbi.itb for the partition file
|
||||
cp -f ${IMGS_DIR}/fw_dynamic.itb ${IMGS_DIR}/opensbi.itb
|
||||
|
||||
#Gen kernel Image dtb here
|
||||
rm -f ${IMGS_DIR}/uImage.itb
|
||||
cp -f ${KERNEL_FIT_FILE} ${IMGS_DIR}/kernel_fdt.its
|
||||
$IMGS_DIR/../host/bin/mkimage -f ${IMGS_DIR}/kernel_fdt.its -r ${IMGS_DIR}/uImage.itb
|
||||
rm ${IMGS_DIR}/kernel_fdt.its
|
||||
|
||||
}
|
||||
|
||||
update_genimage_cfg() {
|
||||
#Update sd-geimage.cfg
|
||||
$PWD/../scripts/gen_imgcfg.py ${PARTITIONS_FILE}
|
||||
mv $PWD/./genimage.cfg ${IMGS_DIR}/genimage.cfg
|
||||
}
|
||||
|
||||
gen_sdcard_img() {
|
||||
echo "Generating sdcard.img..................................."
|
||||
$PWD/support/scripts/genimage.sh -c ${IMGS_DIR}/genimage.cfg
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Generating bootfs failed. Please check for errors..............."
|
||||
exit 1
|
||||
fi
|
||||
echo "sdcard.img successfully generated at ${IMGS_DIR}/sdcard.img"
|
||||
}
|
||||
|
||||
pack_image_zip() {
|
||||
echo "Starting to pack images................................."
|
||||
rm -f ${TARGET_IMAGE_ZIP}
|
||||
rm -rf ${IMGS_DIR}/factory
|
||||
|
||||
mkdir -p ${IMGS_DIR}/factory
|
||||
cp -f ${IMGS_DIR}/FSBL.bin ${IMGS_DIR}/factory/
|
||||
cp -f ${IMGS_DIR}/bootinfo_*.bin ${IMGS_DIR}/factory/
|
||||
|
||||
cp -f ${DEVICE_DIR}/fastboot.yaml ${IMGS_DIR}/
|
||||
cp -f ${DEVICE_DIR}/partition_*.json ${IMGS_DIR}/
|
||||
#cp -f ${DEVICE_DIR}/partition_universal.json ${IMGS_DIR}/
|
||||
cd ${IMGS_DIR}
|
||||
zip ${TARGET_IMAGE_ZIP} \
|
||||
opensbi.itb \
|
||||
u-boot.itb \
|
||||
env.bin \
|
||||
bootfs.img \
|
||||
rootfs.ext4 \
|
||||
partition_*.json \
|
||||
fastboot.yaml \
|
||||
genimage.cfg \
|
||||
-r factory
|
||||
|
||||
#Give a chance to CI
|
||||
if [ -n "$BIANBU_LINUX_ARCHIVE_LATEST" ]; then
|
||||
ln -sf ${TARGET_IMAGE_ZIP} $BIANBU_LINUX_ARCHIVE_LATEST
|
||||
fi
|
||||
|
||||
#rm -f fastboot.yaml \
|
||||
# partition_2M.json
|
||||
# partition_universal.json \
|
||||
cd - >/dev/null
|
||||
|
||||
echo "Images successfully packed into ${TARGET_IMAGE_ZIP}"
|
||||
echo -e "\n"
|
||||
}
|
||||
|
||||
|
||||
#FSBL opensbi uboot uImage
|
||||
gen_sub_images
|
||||
|
||||
#Gen bootfs
|
||||
gen_bootfs_vfat
|
||||
|
||||
#For Debian or Ubuntu rootfs override
|
||||
override_rootfs_img
|
||||
|
||||
#Update genimage cfg because pack_image_zip dependis on it
|
||||
update_genimage_cfg
|
||||
|
||||
#Pack images in zip
|
||||
pack_image_zip
|
||||
|
||||
#Gen sdcard.img if need
|
||||
gen_sdcard_img
|
||||
|
30
board/spacemit/k1/target_overlay/etc/init.d/S30weston-setup.sh
Executable file
30
board/spacemit/k1/target_overlay/etc/init.d/S30weston-setup.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/sh
|
||||
setup()
|
||||
{
|
||||
/root/run_weston.sh &
|
||||
}
|
||||
|
||||
clean()
|
||||
{
|
||||
kill `pidof weston`
|
||||
kill `pidof weston-keyboard`
|
||||
kill `pidof weston-desktop-shell`
|
||||
}
|
||||
|
||||
OPT=$1
|
||||
case "$1" in
|
||||
start)
|
||||
setup
|
||||
;;
|
||||
stop)
|
||||
clean
|
||||
;;
|
||||
restart|reload)
|
||||
clean
|
||||
setup
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|reload}"
|
||||
exit 1
|
||||
esac
|
||||
exit $?
|
95
board/spacemit/k1/target_overlay/etc/init.d/S50adb-setup
Executable file
95
board/spacemit/k1/target_overlay/etc/init.d/S50adb-setup
Executable file
|
@ -0,0 +1,95 @@
|
|||
#!/bin/sh
|
||||
VENDOR_ID="0x361c"
|
||||
PRODUC_ID="0x0008"
|
||||
SERNUM_STR="20211102"
|
||||
MANUAF_STR="Spacemit"
|
||||
PRODUC_STR="K1 ADB"
|
||||
USBDEVICE_SERNUM=`sed 's/://g' /sys/class/net/eth0/address`
|
||||
[ $USBDEVICE_SERNUM ] && SERNUM_STR=$USBDEVICE_SERNUM
|
||||
|
||||
config_gadget()
|
||||
{
|
||||
echo "$0: config $VENDOR_ID/$PRODUC_ID/$SERNUM_STR/$MANUAF_STR/$PRODUC_STR."
|
||||
# mount /dev/mmcblk0 /mnt/SDCARD
|
||||
mount -t configfs none /sys/kernel/config
|
||||
mkdir /sys/kernel/config/usb_gadget/g1
|
||||
echo $VENDOR_ID > /sys/kernel/config/usb_gadget/g1/idVendor
|
||||
echo $PRODUC_ID > /sys/kernel/config/usb_gadget/g1/idProduct
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/strings/0x409
|
||||
echo $SERNUM_STR > /sys/kernel/config/usb_gadget/g1/strings/0x409/serialnumber
|
||||
echo $MANUAF_STR > /sys/kernel/config/usb_gadget/g1/strings/0x409/manufacturer
|
||||
echo $PRODUC_STR > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/configs/c.1
|
||||
echo 0xc0 > /sys/kernel/config/usb_gadget/g1/configs/c.1/bmAttributes
|
||||
echo 500 > /sys/kernel/config/usb_gadget/g1/configs/c.1/MaxPower
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/configs/c.1/strings/0x409
|
||||
}
|
||||
clean_gadget()
|
||||
{
|
||||
# Remove strings:
|
||||
echo "gadget-setup: remove strings of c.1."
|
||||
rmdir /sys/kernel/config/usb_gadget/g1/configs/c.1/strings/0x409
|
||||
# Remove config:
|
||||
echo "gadget-setup: remove configs c.1."
|
||||
rmdir /sys/kernel/config/usb_gadget/g1/configs/c.1
|
||||
# Remove string in gadget
|
||||
echo "gadget-setup: remove strings of g1."
|
||||
rmdir /sys/kernel/config/usb_gadget/g1/strings/0x409
|
||||
# Remove gadget
|
||||
echo "gadget-setup: remove g1."
|
||||
rmdir /sys/kernel/config/usb_gadget/g1
|
||||
}
|
||||
setup()
|
||||
{
|
||||
mkdir /sys/kernel/config/usb_gadget/g1/functions/ffs.adb
|
||||
ln -s /sys/kernel/config/usb_gadget/g1/functions/ffs.adb/ /sys/kernel/config/usb_gadget/g1/configs/c.1/ffs.adb
|
||||
mkdir /dev/usb-ffs
|
||||
mkdir /dev/usb-ffs/adb
|
||||
mount -o uid=2000,gid=2000 -t functionfs adb /dev/usb-ffs/adb/
|
||||
adbd &
|
||||
}
|
||||
udc()
|
||||
{
|
||||
echo `ls /sys/class/udc` > /sys/kernel/config/usb_gadget/g1/UDC
|
||||
}
|
||||
noudc()
|
||||
{
|
||||
echo > /sys/kernel/config/usb_gadget/g1/UDC
|
||||
}
|
||||
clean()
|
||||
{
|
||||
kill `pidof adbd`
|
||||
rm -f /sys/kernel/config/usb_gadget/g1/configs/c.1/ffs.adb
|
||||
rmdir /sys/kernel/config/usb_gadget/g1/functions/ffs.adb
|
||||
umount /dev/usb-ffs/adb/
|
||||
umount /dev/pts
|
||||
rmdir /dev/pts
|
||||
rmdir /dev/usb-ffs/adb
|
||||
rmdir /dev/usb-ffs
|
||||
}
|
||||
OPT=$1
|
||||
case "$1" in
|
||||
start)
|
||||
config_gadget
|
||||
setup
|
||||
sleep 1
|
||||
udc
|
||||
;;
|
||||
stop)
|
||||
noudc
|
||||
clean
|
||||
clean_gadget
|
||||
;;
|
||||
restart|reload)
|
||||
noudc
|
||||
clean
|
||||
clean_gadget
|
||||
config_gadget
|
||||
setup
|
||||
udc
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|reload}"
|
||||
exit 1
|
||||
esac
|
||||
exit $?
|
|
@ -0,0 +1,2 @@
|
|||
KERNEL=="sd*", SUBSYSTEM=="block", ACTION=="add", RUN+="/bin/mkdir -p /mnt/udisk/%k", RUN+="/bin/mount /dev/%k /mnt/udisk/%k"
|
||||
KERNEL=="sd*", SUBSYSTEM=="block", ACTION=="remove", RUN+="/bin/umount /mnt/udisk/%k", RUN+="/bin/rmdir /mnt/udisk/%k"
|
12
board/spacemit/k1/target_overlay/etc/xdg/weston/weston.ini
Normal file
12
board/spacemit/k1/target_overlay/etc/xdg/weston/weston.ini
Normal file
|
@ -0,0 +1,12 @@
|
|||
[core]
|
||||
shell=desktop-shell.so
|
||||
xwayland=false
|
||||
backend=drm-backend.so
|
||||
require-input=false
|
||||
[shell]
|
||||
startup-animation=none
|
||||
background-image=/usr/share/backgrounds/default_wallpaper.jpg
|
||||
background-type=scale-crop
|
||||
[keyboard]
|
||||
[output]
|
||||
mode=1920x1080
|
75
board/spacemit/k1/target_overlay/init
Executable file
75
board/spacemit/k1/target_overlay/init
Executable file
|
@ -0,0 +1,75 @@
|
|||
#!/bin/sh
|
||||
|
||||
mount -t proc proc /proc
|
||||
ROOT=
|
||||
NFSROOT=
|
||||
export init=/sbin/init
|
||||
for x in $(cat /proc/cmdline); do
|
||||
case $x in
|
||||
init=*)
|
||||
init=${x#init=}
|
||||
;;
|
||||
root=*)
|
||||
ROOT=${x#root=}
|
||||
;;
|
||||
nfsroot=*)
|
||||
NFSROOT=${x#nfsroot=}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
mount -t sysfs sysfs /sys
|
||||
|
||||
mount -t devtmpfs -o nosuid,mode=0755 devtmpfs /dev
|
||||
|
||||
mkdir -p /dev/pts
|
||||
mkdir -p /dev/shm
|
||||
mount -t devpts -o defaults,mode=644,ptmxmode=666 devpts /dev/pts
|
||||
mount -t tmpfs tmpfs /dev/shm
|
||||
mount -t tmpfs tmpfs /tmp
|
||||
mount -t tmpfs tmpfs /run
|
||||
|
||||
if [ "x${ROOT}" = "x" ]; then
|
||||
exec /sbin/init
|
||||
fi
|
||||
|
||||
export ROOT
|
||||
|
||||
mkdir /rootfs
|
||||
if [ $ROOT == "/dev/nfs" ] && [ "x${NFSROOT}" != "x" ];then
|
||||
/sbin/ifup -a
|
||||
mount -t nfs -o nolock $NFSROOT /rootfs
|
||||
else
|
||||
cnt=0
|
||||
while [ $cnt -lt 100 ]
|
||||
do
|
||||
if [ ! -e $ROOT ];then
|
||||
sleep 0.1
|
||||
else
|
||||
echo "find $ROOT: $cnt"
|
||||
break
|
||||
fi
|
||||
let cnt++
|
||||
done
|
||||
e2fsck -y $ROOT
|
||||
resize2fs $ROOT
|
||||
mount $ROOT /rootfs/
|
||||
if [ ! -e /rootfs/dev/console ]; then
|
||||
/bin/mknod /rootfs/dev/console c 5 1
|
||||
fi
|
||||
if [ ! -e /rootfs/dev/null ]; then
|
||||
/bin/mknod /rootfs/dev/null c 1 3
|
||||
fi
|
||||
fi
|
||||
|
||||
mount -n -o move /proc /rootfs/proc
|
||||
mount -n -o move /sys /rootfs/sys
|
||||
mount -n -o move /run /rootfs/run
|
||||
mount -n -o move /tmp /rootfs/tmp
|
||||
mount -n -o move /dev /rootfs/dev
|
||||
mount -n -o move /dev/shm /rootfs/dev/shm
|
||||
mount -n -o move /dev/pts /rootfs/dev/pts
|
||||
mount -t debugfs debugfs /rootfs/sys/kernel/debug
|
||||
|
||||
exec run-init /rootfs "${init}" "$@" <"/rootfs/dev/console" >"/rootfs/dev/console" 2>&1
|
||||
echo "Something went badly wrong in the initramfs."
|
BIN
board/spacemit/k1/target_overlay/lib/firmware/esos.elf
Executable file
BIN
board/spacemit/k1/target_overlay/lib/firmware/esos.elf
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 2.7 MiB |
178
configs/spacemit_k1_defconfig
Normal file
178
configs/spacemit_k1_defconfig
Normal file
|
@ -0,0 +1,178 @@
|
|||
BR2_riscv=y
|
||||
BR2_riscv_custom=y
|
||||
BR2_RISCV_ISA_CUSTOM_RVM=y
|
||||
BR2_RISCV_ISA_CUSTOM_RVF=y
|
||||
BR2_RISCV_ISA_CUSTOM_RVD=y
|
||||
BR2_RISCV_ISA_CUSTOM_RVC=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_URL="http://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v0.3.3.tar.xz"
|
||||
BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH="spacemit-toolchain-linux-glibc-x86_64-v0.3.3/bin"
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="$(ARCH)-unknown-linux-gnu"
|
||||
BR2_TOOLCHAIN_EXTERNAL_HEADERS_6_1=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
|
||||
# BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set
|
||||
BR2_TOOLCHAIN_EXTERNAL_CXX=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_FORTRAN=y
|
||||
BR2_TOOLCHAIN_EXTERNAL_OPENMP=y
|
||||
BR2_CCACHE=y
|
||||
BR2_PACKAGE_OVERRIDE_FILE="$(TOPDIR)/../buildroot-ext/local.mk"
|
||||
BR2_GLOBAL_PATCH_DIR="$(TOPDIR)/../buildroot-ext/patches/"
|
||||
BR2_TARGET_GENERIC_HOSTNAME="Bianbu"
|
||||
BR2_TARGET_GENERIC_ISSUE="Welcome to Bianbu Linux"
|
||||
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
|
||||
BR2_TARGET_GENERIC_ROOT_PASSWD="spacemit"
|
||||
BR2_SYSTEM_DHCP="eth0"
|
||||
# BR2_ENABLE_LOCALE_PURGE is not set
|
||||
BR2_GENERATE_LOCALE="C en_US.UTF-8 zh_CN.UTF-8"
|
||||
BR2_TARGET_TZ_INFO=y
|
||||
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_Bianbu_PATH)/board/spacemit/k1/target_overlay"
|
||||
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_Bianbu_PATH)/board/spacemit/k1/prepare_img.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(LINUX_OVERRIDE_SRCDIR)/arch/riscv/configs/k1_defconfig"
|
||||
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
||||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="spacemit/k1-x_deb1 spacemit/k1-x_deb2 spacemit/k1-x_evb"
|
||||
BR2_PACKAGE_LINUX_TOOLS_GPIO=y
|
||||
BR2_PACKAGE_LINUX_TOOLS_PERF=y
|
||||
BR2_PACKAGE_LINUX_TOOLS_PERF_SCRIPTS=y
|
||||
BR2_PACKAGE_LINUX_TOOLS_PERF_TUI=y
|
||||
BR2_PACKAGE_LINUX_TOOLS_PERF_NEEDS_HOST_PYTHON3=y
|
||||
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
|
||||
BR2_PACKAGE_FFMPEG_GPL=y
|
||||
BR2_PACKAGE_FFMPEG_SPACEMIT_CODEC=y
|
||||
BR2_PACKAGE_FFMPEG_NONFREE=y
|
||||
BR2_PACKAGE_FFMPEG_FFPLAY=y
|
||||
BR2_PACKAGE_FFMPEG_FFPROBE=y
|
||||
BR2_PACKAGE_FFMPEG_POSTPROC=y
|
||||
BR2_PACKAGE_GZIP=y
|
||||
BR2_PACKAGE_P7ZIP=y
|
||||
BR2_PACKAGE_UNRAR=y
|
||||
BR2_PACKAGE_UNZIP=y
|
||||
BR2_PACKAGE_ZIP=y
|
||||
BR2_PACKAGE_DHRYSTONE=y
|
||||
BR2_PACKAGE_FIO=y
|
||||
BR2_PACKAGE_IOZONE=y
|
||||
BR2_PACKAGE_LSOF=y
|
||||
BR2_PACKAGE_MBW=y
|
||||
BR2_PACKAGE_STRESS_NG=y
|
||||
BR2_PACKAGE_GETTEXT=y
|
||||
BR2_PACKAGE_GREP=y
|
||||
BR2_PACKAGE_JQ=y
|
||||
BR2_PACKAGE_SED=y
|
||||
BR2_PACKAGE_TREE=y
|
||||
BR2_PACKAGE_E2FSPROGS=y
|
||||
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y
|
||||
BR2_PACKAGE_EXFAT_UTILS=y
|
||||
BR2_PACKAGE_EXFATPROGS=y
|
||||
BR2_PACKAGE_MTD=y
|
||||
BR2_PACKAGE_NTFS_3G=y
|
||||
BR2_PACKAGE_NTFS_3G_NTFSPROGS=y
|
||||
BR2_PACKAGE_XFSPROGS=y
|
||||
BR2_PACKAGE_LIBERATION=y
|
||||
BR2_PACKAGE_WQY_ZENHEI=y
|
||||
BR2_PACKAGE_GLMARK2=y
|
||||
BR2_PACKAGE_SDL2_KMSDRM=y
|
||||
BR2_PACKAGE_SDL2_OPENGLES=y
|
||||
BR2_PACKAGE_QT5=y
|
||||
BR2_PACKAGE_QT5BASE_EXAMPLES=y
|
||||
BR2_PACKAGE_QT5BASE_SQLITE_QT=y
|
||||
BR2_PACKAGE_QT5BASE_OPENGL=y
|
||||
BR2_PACKAGE_QT5BASE_FONTCONFIG=y
|
||||
BR2_PACKAGE_QT5BASE_SYSLOG=y
|
||||
BR2_PACKAGE_QT5CHARTS=y
|
||||
BR2_PACKAGE_QT5MULTIMEDIA=y
|
||||
BR2_PACKAGE_QT5WAYLAND=y
|
||||
BR2_PACKAGE_WESTON=y
|
||||
BR2_PACKAGE_CRYPTSETUP=y
|
||||
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
|
||||
BR2_PACKAGE_GPTFDISK=y
|
||||
BR2_PACKAGE_MDADM=y
|
||||
BR2_PACKAGE_MEMTESTER=y
|
||||
BR2_PACKAGE_SMARTMONTOOLS=y
|
||||
BR2_PACKAGE_SYSSTAT=y
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON3_XZ=y
|
||||
BR2_PACKAGE_PYTHON_PIP=y
|
||||
BR2_PACKAGE_PYTHON_PYQT5=y
|
||||
BR2_PACKAGE_PYTHON_PYYAML=y
|
||||
BR2_PACKAGE_TINYALSA=y
|
||||
BR2_PACKAGE_LZ4=y
|
||||
BR2_PACKAGE_LIBNSS=y
|
||||
BR2_PACKAGE_LIBOPENSSL_BIN=y
|
||||
BR2_PACKAGE_LIBOPENSSL_ENGINES=y
|
||||
BR2_PACKAGE_JASPER=y
|
||||
BR2_PACKAGE_LCMS2=y
|
||||
BR2_PACKAGE_OPENCV4_LIB_CALIB3D=y
|
||||
BR2_PACKAGE_OPENCV4_WITH_QT5=y
|
||||
BR2_PACKAGE_OPENCV4_WITH_FFMPEG=y
|
||||
BR2_PACKAGE_OPENCV4_WITH_GSTREAMER1=y
|
||||
BR2_PACKAGE_OPENCV4_WITH_JPEG=y
|
||||
BR2_PACKAGE_OPENCV4_WITH_PNG=y
|
||||
BR2_PACKAGE_OPENCV4_WITH_V4L=y
|
||||
BR2_PACKAGE_OPENMPI=y
|
||||
BR2_PACKAGE_UTF8PROC=y
|
||||
BR2_PACKAGE_CAN_UTILS=y
|
||||
BR2_PACKAGE_DHCPCD=y
|
||||
BR2_PACKAGE_DROPBEAR=y
|
||||
BR2_PACKAGE_ETHTOOL=y
|
||||
BR2_PACKAGE_IPERF3=y
|
||||
BR2_PACKAGE_IPROUTE2=y
|
||||
BR2_PACKAGE_IPSET=y
|
||||
BR2_PACKAGE_IPUTILS=y
|
||||
BR2_PACKAGE_NTP=y
|
||||
BR2_PACKAGE_RSYNC=y
|
||||
BR2_PACKAGE_WHOIS=y
|
||||
BR2_PACKAGE_BASH=y
|
||||
BR2_PACKAGE_FILE=y
|
||||
BR2_PACKAGE_ANDROID_TOOLS=y
|
||||
BR2_PACKAGE_ANDROID_TOOLS_ADB=y
|
||||
BR2_PACKAGE_ANDROID_TOOLS_ADBD=y
|
||||
BR2_PACKAGE_FTOP=y
|
||||
BR2_PACKAGE_GETENT=y
|
||||
BR2_PACKAGE_HTOP=y
|
||||
BR2_PACKAGE_IOTOP=y
|
||||
BR2_PACKAGE_KEYUTILS=y
|
||||
BR2_PACKAGE_TAR=y
|
||||
BR2_PACKAGE_UTIL_LINUX_IRQTOP=y
|
||||
BR2_PACKAGE_UTIL_LINUX_KILL=y
|
||||
BR2_PACKAGE_UTIL_LINUX_MORE=y
|
||||
BR2_PACKAGE_UTIL_LINUX_MOUNT=y
|
||||
BR2_PACKAGE_NANO=y
|
||||
BR2_PACKAGE_VIM=y
|
||||
BR2_TARGET_ROOTFS_CPIO=y
|
||||
BR2_TARGET_ROOTFS_CPIO_DRACUT=y
|
||||
BR2_TARGET_ROOTFS_CPIO_GZIP=y
|
||||
BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
|
||||
BR2_TARGET_ROOTFS_EXT2=y
|
||||
BR2_TARGET_ROOTFS_EXT2_4=y
|
||||
BR2_TARGET_ROOTFS_EXT2_SIZE="500M"
|
||||
# BR2_TARGET_ROOTFS_TAR is not set
|
||||
BR2_TARGET_OPENSBI=y
|
||||
BR2_TARGET_OPENSBI_PLAT="generic"
|
||||
# BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
|
||||
BR2_TARGET_OPENSBI_ADDITIONAL_VARIABLES="PLATFORM_DEFCONFIG=k1_defconfig"
|
||||
BR2_TARGET_UBOOT=y
|
||||
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
|
||||
BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(UBOOT_OVERRIDE_SRCDIR)/configs/k1_defconfig"
|
||||
# BR2_TARGET_UBOOT_FORMAT_BIN is not set
|
||||
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
|
||||
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb"
|
||||
BR2_TARGET_UBOOT_SPL=y
|
||||
BR2_TARGET_UBOOT_SPL_NAME="FSBL.bin bootinfo_*.bin"
|
||||
BR2_PACKAGE_HOST_CMAKE=y
|
||||
BR2_PACKAGE_HOST_GENIMAGE=y
|
||||
BR2_PACKAGE_HOST_JQ=y
|
||||
BR2_PACKAGE_HOST_PYTHON_PYYAML=y
|
||||
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
|
||||
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
|
||||
BR2_PACKAGE_IMG_GPU_POWERVR=y
|
||||
BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT_WL=y
|
||||
BR2_PACKAGE_DRM_TEST=y
|
||||
BR2_PACKAGE_V2D_TEST=y
|
||||
BR2_PACKAGE_K1X_VPU_TEST=y
|
||||
BR2_PACKAGE_K1X_VPU_FIRMWARE=y
|
||||
BR2_PACKAGE_K1X_JPU=y
|
||||
BR2_PACKAGE_K1X_CAM=y
|
||||
BR2_PACKAGE_AI_SUPPORT=y
|
3
external.desc
Normal file
3
external.desc
Normal file
|
@ -0,0 +1,3 @@
|
|||
name: Bianbu
|
||||
desc: bianbu solutions tree
|
||||
|
13
external.mk
Normal file
13
external.mk
Normal file
|
@ -0,0 +1,13 @@
|
|||
include $(sort $(wildcard $(BR2_EXTERNAL_Bianbu_PATH)/package/*/*.mk))
|
||||
include $(sort $(wildcard $(BR2_EXTERNAL_Bianbu_PATH)/board/*/*.mk))
|
||||
include $(sort $(wildcard $(BR2_EXTERNAL_Bianbu_PATH)/board/*/*/*.mk))
|
||||
|
||||
|
||||
burn-image:
|
||||
@echo "Starting to burn image......."
|
||||
@(cd $(BINARIES_DIR);$(BINARIES_DIR)/fastboot_flash_emmc.sh)
|
||||
@if [ $$? -ne 0 ]; then \
|
||||
@echo "burning fails..."; \
|
||||
exit 1; \
|
||||
fi
|
||||
@echo "burning successful..."
|
14
local.mk
Normal file
14
local.mk
Normal file
|
@ -0,0 +1,14 @@
|
|||
#for dev purpose , lists pkg-source dir here and buildroot use it priority
|
||||
#为了方便源码开发,这里提供各模块源码路径覆写,buildroot优先使用
|
||||
|
||||
#e.g example
|
||||
#XXX is package name defined in buildroot
|
||||
#XXX_OVERRIDE_SRCDIR = /path/to/xxx/dir
|
||||
#XXX_OVERRIDE_SRCDIR_RSYNC_EXCLUSIONS = --exclude unittests --exclude test.txt --include .git
|
||||
|
||||
|
||||
LINUX_OVERRIDE_SRCDIR = $(TOPDIR)/../bsp-src/linux-6.1
|
||||
UBOOT_OVERRIDE_SRCDIR = $(TOPDIR)/../bsp-src/uboot-2022.10
|
||||
OPENSBI_OVERRIDE_SRCDIR = $(TOPDIR)/../bsp-src/opensbi
|
||||
MESA3D_OVERRIDE_SRCDIR = $(TOPDIR)/../package-src/mesa3d
|
||||
IMG_GPU_POWERVR_OVERRIDE_SRCDIR = $(TOPDIR)/../package-src/img-gpu-powervr
|
21
package/ai-support/Config.in
Normal file
21
package/ai-support/Config.in
Normal file
|
@ -0,0 +1,21 @@
|
|||
config BR2_PACKAGE_AI_SUPPORT
|
||||
bool "k1 ai support"
|
||||
default n
|
||||
select BR2_PACKAGE_ONNX_RUNTIME
|
||||
select BR2_PACKAGE_OPENCV4
|
||||
select BR2_PACKAGE_OPENCV4_LIB_IMGPROC
|
||||
help
|
||||
Spacemit k1 AI support lib.
|
||||
|
||||
if BR2_PACKAGE_AI_SUPPORT
|
||||
|
||||
config BR2_PACKAGE_AI_SUPPORT_DEMO
|
||||
bool "k1 ai support demo"
|
||||
default y
|
||||
select BR2_PACKAGE_OPENCV4_LIB_HIGHGUI
|
||||
select BR2_PACKAGE_OPENCV4_LIB_IMGCODECS
|
||||
select BR2_PACKAGE_OPENCV4_LIB_VIDEOIO
|
||||
help
|
||||
Spacemit k1 AI support demo.
|
||||
|
||||
endif
|
14
package/ai-support/ai-support.mk
Normal file
14
package/ai-support/ai-support.mk
Normal file
|
@ -0,0 +1,14 @@
|
|||
AI_SUPPORT_VERSION:=1.0.8
|
||||
AI_SUPPORT_SITE = $(BR2_EXTERNAL_Bianbu_PATH)/../package-src/ai-support
|
||||
AI_SUPPORT_SITE_METHOD = local
|
||||
AI_SUPPORT_DEPENDENCIES += onnx-runtime opencv4
|
||||
|
||||
# CMAKE_BUILD_TYPE is driven by BR2_ENABLE_RUNTIME_DEBUG
|
||||
AI_SUPPORT_CONF_OPTS = -DTEST=OFF \
|
||||
-DORT_HOME=$(STAGING_DIR)/usr
|
||||
|
||||
ifeq ($(BR2_PACKAGE_AI_SUPPORT_DEMO),y)
|
||||
AI_SUPPORT_CONF_OPTS += -DDEMO=ON
|
||||
endif # BR2_PACKAGE_AI_SUPPORT_DEMO
|
||||
|
||||
$(eval $(cmake-package))
|
9
package/drm-test/Config.in
Normal file
9
package/drm-test/Config.in
Normal file
|
@ -0,0 +1,9 @@
|
|||
comment "drm test package"
|
||||
|
||||
config BR2_PACKAGE_DRM_TEST
|
||||
bool "drm-test"
|
||||
depends on BR2_PACKAGE_LIBDRM
|
||||
help
|
||||
Utility for testing drm working on variable modes.
|
||||
|
||||
https://github.com/dvdhrm/docs.git
|
19
package/drm-test/drm-test.mk
Normal file
19
package/drm-test/drm-test.mk
Normal file
|
@ -0,0 +1,19 @@
|
|||
DRM_TEST_VERSION:=1.0.0
|
||||
DRM_TEST_SITE = $(BR2_EXTERNAL_Bianbu_PATH)/../package-src/drm-test
|
||||
DRM_TEST_SITE_METHOD = local
|
||||
DRM_TEST_INSTALL_TARGET = YES
|
||||
|
||||
define DRM_TEST_BUILD_CMDS
|
||||
($(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS)" -C $(@D) all;)
|
||||
endef
|
||||
|
||||
define DRM_TEST_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -D -m 0755 $(@D)/modeset-single-buffer $(TARGET_DIR)/usr/bin/
|
||||
$(INSTALL) -D -m 0755 $(@D)/modeset-double-buffer $(TARGET_DIR)/usr/bin/
|
||||
$(INSTALL) -D -m 0755 $(@D)/modeset-vsync $(TARGET_DIR)/usr/bin/
|
||||
$(INSTALL) -D -m 0755 $(@D)/modeset-atomic $(TARGET_DIR)/usr/bin/
|
||||
|
||||
endef
|
||||
|
||||
DRM_TEST_DEPENDENCIES = libdrm
|
||||
$(eval $(generic-package))
|
97
package/img-gpu-powervr/Config.in
Normal file
97
package/img-gpu-powervr/Config.in
Normal file
|
@ -0,0 +1,97 @@
|
|||
comment "img-gpu-powervr needs a glibc toolchain"
|
||||
depends on BR2_riscv
|
||||
depends on !BR2_TOOLCHAIN_USES_GLIBC
|
||||
|
||||
config BR2_PACKAGE_IMG_GPU_POWERVR
|
||||
bool "img-gpu-powervr"
|
||||
# Pre-built binaries only available for RISCV
|
||||
depends on BR2_riscv
|
||||
# Library binaries are linked against libc.so.6
|
||||
depends on BR2_TOOLCHAIN_USES_GLIBC
|
||||
# Library binaries are linked against libdrm.so.2, except framebuffer
|
||||
# output on RISCV
|
||||
select BR2_PACKAGE_LIBDRM if !(BR2_riscv && BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT_FB)
|
||||
select BR2_PACKAGE_HAS_LIBEGL
|
||||
select BR2_PACKAGE_HAS_LIBGLES
|
||||
select BR2_PACKAGE_HAS_LIBOPENCL
|
||||
select BR2_PACKAGE_HAS_LIBVULKAN
|
||||
select BR2_PACKAGE_MESA3D
|
||||
select BR2_PACKAGE_MESA3D_OPENGL_EGL
|
||||
select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_PVR
|
||||
help
|
||||
Userspace libraries for Imagination PowerGPU GPU on StarFive platforms
|
||||
|
||||
It contains libraries and headers for GLES, OpenCL, and
|
||||
Vulkan. It also contains a DRI plugin for X11. It also
|
||||
contains a plugin for DirectFB-1.4.0.
|
||||
|
||||
This library is provided by StarFive as-is and doesn't have
|
||||
an upstream.
|
||||
|
||||
if BR2_PACKAGE_IMG_GPU_POWERVR
|
||||
|
||||
choice
|
||||
prompt "Output option"
|
||||
help
|
||||
There are two versions of this library: one for
|
||||
direct framebuffer access, one for X11 rendering.
|
||||
Choose here which version to install.
|
||||
|
||||
config BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT_X11
|
||||
bool "X11"
|
||||
depends on BR2_PACKAGE_XORG7
|
||||
# The i.MX8 blob doesn't support X11 output
|
||||
depends on !BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
|
||||
select BR2_PACKAGE_XLIB_LIBXDAMAGE
|
||||
select BR2_PACKAGE_XLIB_LIBXEXT
|
||||
select BR2_PACKAGE_XLIB_LIBXFIXES
|
||||
|
||||
comment "X11 backend needs Xorg package"
|
||||
depends on !BR2_PACKAGE_XORG7
|
||||
|
||||
config BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT_FB
|
||||
bool "Framebuffer"
|
||||
|
||||
config BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT_WL
|
||||
bool "Wayland"
|
||||
select BR2_PACKAGE_WAYLAND
|
||||
select BR2_PACKAGE_HAS_LIBEGL_WAYLAND
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT
|
||||
string
|
||||
default "x11" if BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT_X11
|
||||
default "fb" if BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT_FB
|
||||
default "wayland" if BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT_WL
|
||||
|
||||
config BR2_PACKAGE_PROVIDES_LIBEGL
|
||||
default "img-gpu-powervr"
|
||||
|
||||
config BR2_PACKAGE_PROVIDES_LIBGLES
|
||||
default "img-gpu-powervr"
|
||||
|
||||
config BR2_PACKAGE_PROVIDES_LIBOPENCL
|
||||
default "img-gpu-powervr"
|
||||
|
||||
config BR2_PACKAGE_PROVIDES_LIBVULKAN
|
||||
default "img-gpu-powervr"
|
||||
|
||||
config BR2_PACKAGE_IMG_GPU_POWERVR_EXAMPLES
|
||||
bool "install examples"
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
help
|
||||
Copy the PowerVR examples to the target.
|
||||
|
||||
Warning: examples take approximately 150 MB of disk space.
|
||||
|
||||
comment "img-gpu-powervr-examples need a toolchain w/ C++ support"
|
||||
depends on !BR2_INSTALL_LIBSTDCPP
|
||||
|
||||
config BR2_PACKAGE_IMG_GPU_POWERVR_GMEM_INFO
|
||||
bool "install gmem_info tool"
|
||||
help
|
||||
Copy the gmem_info tool to the target which provides
|
||||
information about GPU memory consumption.
|
||||
|
||||
endif
|
39
package/img-gpu-powervr/img-gpu-powervr.mk
Normal file
39
package/img-gpu-powervr/img-gpu-powervr.mk
Normal file
|
@ -0,0 +1,39 @@
|
|||
IMG_GPU_POWERVR_VERSION:=23.2.6460340
|
||||
IMG_GPU_POWERVR_SITE=$(TOPDIR)/../buildroot-ext/patches/img-gpu-powervr
|
||||
IMG_GPU_POWERVR_SITE_METHOD=file
|
||||
IMG_GPU_POWERVR_SOURCE=img-gpu-powervr-bin-$(IMG_GPU_POWERVR_VERSION).tar.xz
|
||||
|
||||
IMG_GPU_POWERVR_INSTALL_STAGING = YES
|
||||
|
||||
IMG_GPU_POWERVR_LICENSE = Strictly Confidential
|
||||
IMG_GPU_POWERVR_REDISTRIBUTE = NO
|
||||
|
||||
IMG_GPU_POWERVR_PROVIDES = libgles libopencl
|
||||
IMG_GPU_POWERVR_LIB_TARGET = $(call qstrip,$(BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT))
|
||||
|
||||
ifeq ($(IMG_GPU_POWERVR_LIB_TARGET),x11)
|
||||
IMG_GPU_POWERVR_DEPENDENCIES += xlib_libXdamage xlib_libXext xlib_libXfixes
|
||||
endif
|
||||
|
||||
ifneq ($(IMG_GPU_POWERVR_LIB_TARGET)$(BR2_riscv),fby)
|
||||
IMG_GPU_POWERVR_DEPENDENCIES += libdrm
|
||||
endif
|
||||
|
||||
ifeq ($(IMG_GPU_POWERVR_LIB_TARGET),wayland)
|
||||
IMG_GPU_POWERVR_DEPENDENCIES += wayland
|
||||
endif
|
||||
|
||||
define IMG_GPU_POWERVR_INSTALL_STAGING_CMDS
|
||||
cp -rdpf $(@D)/staging/usr/lib/glesv2.pc $(STAGING_DIR)/usr/lib/pkgconfig/
|
||||
cp -rdpf $(@D)/staging/include/* $(STAGING_DIR)/usr/include/
|
||||
cp -rdpf $(@D)/staging/usr/lib/* $(STAGING_DIR)/usr/lib/
|
||||
endef
|
||||
|
||||
define IMG_GPU_POWERVR_INSTALL_TARGET_CMDS
|
||||
mkdir -p $(TARGET_DIR)/usr/local/share/pvr/shaders/
|
||||
cp -rdpf $(@D)/target/usr/local/share/pvr/shaders/* $(TARGET_DIR)/usr/local/share/pvr/shaders/
|
||||
cp -rdpf $(@D)/target/lib/* $(TARGET_DIR)/lib/
|
||||
cp -rdpf $(@D)/target/usr/* $(TARGET_DIR)/usr/
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
4
package/k1x-cam/Config.in
Normal file
4
package/k1x-cam/Config.in
Normal file
|
@ -0,0 +1,4 @@
|
|||
config BR2_PACKAGE_K1X_CAM
|
||||
bool "k1x-cam"
|
||||
help
|
||||
Spacemit k1x cam demo and test.
|
30
package/k1x-cam/k1x-cam.mk
Normal file
30
package/k1x-cam/k1x-cam.mk
Normal file
|
@ -0,0 +1,30 @@
|
|||
K1X_CAM_VERSION:=1.0.0
|
||||
K1X_CAM_SITE = $(BR2_EXTERNAL_Bianbu_PATH)/../package-src/k1x-cam
|
||||
K1X_CAM_SITE_METHOD = local
|
||||
|
||||
K1X_CAM_CONF_OPTS = -DRUN_PLATFORM="RISCV" \
|
||||
-DCI_LOG_LEVEL=4 \
|
||||
-DARCH_RISCV="Y" \
|
||||
-DCMAKE_INSTALL_PREFIX="/usr" \
|
||||
|
||||
define K1X_CAM_POST_RSYNC
|
||||
$(INSTALL) -D -m 0644 $(@D)/libs/lib64/libcpp.so $(STAGING_DIR)/lib64/libcpp.so
|
||||
$(INSTALL) -D -m 0644 $(@D)/libs/lib64/libcppfw-2.0.so $(STAGING_DIR)/lib64/libcppfw-2.0.so
|
||||
$(INSTALL) -D -m 0644 $(@D)/libs/lib64/libisp.so $(STAGING_DIR)/lib64/libisp.so
|
||||
$(INSTALL) -D -m 0644 $(@D)/libs/lib64/libispeagle.so $(STAGING_DIR)/lib64/libispeagle.so
|
||||
$(INSTALL) -D -m 0644 $(@D)/libs/lib64/libtuningtools.so $(STAGING_DIR)/lib64/libtuningtools.so
|
||||
$(INSTALL) -D -m 0644 $(@D)/libs/lib64/libvi.so $(STAGING_DIR)/lib64/libvi.so
|
||||
endef
|
||||
K1X_CAM_POST_RSYNC_HOOKS += K1X_CAM_POST_RSYNC
|
||||
|
||||
define K1X_CAM_POST_BUILD
|
||||
$(INSTALL) -D -m 0755 $(@D)/libs/lib64/libcpp.so $(TARGET_DIR)/lib64/libcpp.so
|
||||
$(INSTALL) -D -m 0755 $(@D)/libs/lib64/libcppfw-2.0.so $(TARGET_DIR)/lib64/libcppfw-2.0.so
|
||||
$(INSTALL) -D -m 0755 $(@D)/libs/lib64/libisp.so $(TARGET_DIR)/lib64/libisp.so
|
||||
$(INSTALL) -D -m 0755 $(@D)/libs/lib64/libispeagle.so $(TARGET_DIR)/lib64/libispeagle.so
|
||||
$(INSTALL) -D -m 0755 $(@D)/libs/lib64/libtuningtools.so $(TARGET_DIR)/lib64/libtuningtools.so
|
||||
$(INSTALL) -D -m 0755 $(@D)/libs/lib64/libvi.so $(TARGET_DIR)/lib64/libvi.so
|
||||
endef
|
||||
K1X_CAM_POST_BUILD_HOOKS += K1X_CAM_POST_BUILD
|
||||
|
||||
$(eval $(cmake-package))
|
4
package/k1x-jpu/Config.in
Normal file
4
package/k1x-jpu/Config.in
Normal file
|
@ -0,0 +1,4 @@
|
|||
config BR2_PACKAGE_K1X_JPU
|
||||
bool "k1x-jpu"
|
||||
help
|
||||
Spacemit k1x jpu library and test.
|
10
package/k1x-jpu/k1x-jpu.mk
Normal file
10
package/k1x-jpu/k1x-jpu.mk
Normal file
|
@ -0,0 +1,10 @@
|
|||
K1X_JPU_VERSION:=1.0.0
|
||||
K1X_JPU_SITE = $(BR2_EXTERNAL_Bianbu_PATH)/../package-src/k1x-jpu
|
||||
K1X_JPU_SITE_METHOD = local
|
||||
|
||||
K1X_JPU_CONF_OPTS = -DRUN_PLATFORM="RISCV" \
|
||||
-DCI_LOG_LEVEL=4 \
|
||||
-DARCH_RISCV="Y" \
|
||||
-DCMAKE_INSTALL_PREFIX="/usr" \
|
||||
|
||||
$(eval $(cmake-package))
|
4
package/k1x-vpu-firmware/Config.in
Normal file
4
package/k1x-vpu-firmware/Config.in
Normal file
|
@ -0,0 +1,4 @@
|
|||
config BR2_PACKAGE_K1X_VPU_FIRMWARE
|
||||
bool "k1x-vpu-firmware"
|
||||
help
|
||||
Spacemit k1x vpu driver firmware.
|
10
package/k1x-vpu-firmware/k1x-vpu-firmware.mk
Normal file
10
package/k1x-vpu-firmware/k1x-vpu-firmware.mk
Normal file
|
@ -0,0 +1,10 @@
|
|||
K1X_VPU_FIRMWARE_VERSION:=1.0.0
|
||||
K1X_VPU_FIRMWARE_SITE = $(BR2_EXTERNAL_Bianbu_PATH)/../package-src/k1x-vpu-firmware
|
||||
K1X_VPU_FIRMWARE_SITE_METHOD = local
|
||||
|
||||
define K1X_VPU_FIRMWARE_INSTALL_TARGET_CMDS
|
||||
cp -rdpf $(@D)/lib/* $(TARGET_DIR)/lib/
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
|
4
package/k1x-vpu-test/Config.in
Normal file
4
package/k1x-vpu-test/Config.in
Normal file
|
@ -0,0 +1,4 @@
|
|||
config BR2_PACKAGE_K1X_VPU_TEST
|
||||
bool "k1x-vpu-test"
|
||||
help
|
||||
Spacemit k1x vpu driver test.
|
10
package/k1x-vpu-test/k1x-vpu-test.mk
Normal file
10
package/k1x-vpu-test/k1x-vpu-test.mk
Normal file
|
@ -0,0 +1,10 @@
|
|||
K1X_VPU_TEST_VERSION:=1.0.0
|
||||
K1X_VPU_TEST_SITE = $(BR2_EXTERNAL_Bianbu_PATH)/../package-src/k1x-vpu-test
|
||||
K1X_VPU_TEST_SITE_METHOD = local
|
||||
|
||||
MPP_CONF_OPTS = -DRUN_PLATFORM="RISCV" \
|
||||
-DCI_LOG_LEVEL=4 \
|
||||
-DARCH_RISCV="Y" \
|
||||
-DCMAKE_INSTALL_PREFIX="/usr" \
|
||||
|
||||
$(eval $(cmake-package))
|
6
package/mpp/Config.in
Normal file
6
package/mpp/Config.in
Normal file
|
@ -0,0 +1,6 @@
|
|||
comment "spacemit mpp package"
|
||||
|
||||
config BR2_PACKAGE_MPP
|
||||
bool "spacemit mpp"
|
||||
help
|
||||
spacemit mpp package
|
23
package/mpp/mpp.mk
Normal file
23
package/mpp/mpp.mk
Normal file
|
@ -0,0 +1,23 @@
|
|||
MPP_VERSION := 0.1.0
|
||||
MPP_SITE = $(TOPDIR)/../package-src/mpp
|
||||
MPP_SITE_METHOD = local
|
||||
MPP_SUPPORTS_IN_SOURCE_BUILD = NO
|
||||
MPP_INSTALL_STAGING = YES
|
||||
#MPP_DEPENDENCIES = jpeg libv4l libdrm
|
||||
|
||||
# default CMAKE_INSTALL_PREFIX is $(TARGET_DIR)/usr, change to below
|
||||
# note: not have -DCROSS_COMPILE
|
||||
MPP_CONF_OPTS = -DRUN_PLATFORM="RISCV" \
|
||||
-DCI_LOG_LEVEL=4 \
|
||||
-DARCH_RISCV="Y" \
|
||||
-DCMAKE_INSTALL_PREFIX="/usr" \
|
||||
|
||||
define MPP_INSTALL_STAGING_CMDS
|
||||
cp -rdpf $(@D)/include/* $(STAGING_DIR)/usr/include/
|
||||
cp -rdpf $(@D)/mpi/include/* $(STAGING_DIR)/usr/include/
|
||||
cp -rdpf $(@D)/utils/include/* $(STAGING_DIR)/usr/include/
|
||||
cp -rdpf $(@D)/al/include/* $(STAGING_DIR)/usr/include/
|
||||
cp -rdpf $(@D)/buildroot-build/mpi/libspacemit_mpp.so* $(STAGING_DIR)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(cmake-package))
|
7
package/onnx-runtime/Config.in
Normal file
7
package/onnx-runtime/Config.in
Normal file
|
@ -0,0 +1,7 @@
|
|||
|
||||
config BR2_PACKAGE_ONNX_RUNTIME
|
||||
bool "ONNX Runtime"
|
||||
|
||||
help
|
||||
Customized Version of ONNX Runtime
|
||||
|
19
package/onnx-runtime/onnx-runtime.mk
Normal file
19
package/onnx-runtime/onnx-runtime.mk
Normal file
|
@ -0,0 +1,19 @@
|
|||
ONNX_RUNTIME_VERSION:=v1.0.3
|
||||
ONNX_RUNTIME_SITE=http://archive.spacemit.com/spacemit-ai/onnxruntime
|
||||
ONNX_RUNTIME_SITE_METHOD=wget
|
||||
ONNX_RUNTIME_SOURCE=spacemit-ort.rv64.$(ONNX_RUNTIME_VERSION).tar.gz
|
||||
|
||||
ONNX_RUNTIME_INSTALL_STAGING = YES
|
||||
|
||||
|
||||
define ONNX_RUNTIME_INSTALL_STAGING_CMDS
|
||||
cp -rdpf $(@D)/include/* $(STAGING_DIR)/usr/include/
|
||||
cp -rdpf $(@D)/lib/* $(STAGING_DIR)/usr/lib/
|
||||
endef
|
||||
|
||||
define ONNX_RUNTIME_INSTALL_TARGET_CMDS
|
||||
cp -rdpf $(@D)/lib/* $(TARGET_DIR)/usr/lib/
|
||||
cp -rdpf $(@D)/bin/* $(TARGET_DIR)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
4
package/v2d-test/Config.in
Normal file
4
package/v2d-test/Config.in
Normal file
|
@ -0,0 +1,4 @@
|
|||
config BR2_PACKAGE_V2D_TEST
|
||||
bool "v2d-test"
|
||||
help
|
||||
Spacemit V2D driver test.
|
12
package/v2d-test/v2d-test.mk
Normal file
12
package/v2d-test/v2d-test.mk
Normal file
|
@ -0,0 +1,12 @@
|
|||
V2D_TEST_VERSION:=1.0.0
|
||||
V2D_TEST_SITE = $(BR2_EXTERNAL_Bianbu_PATH)/../package-src/v2d-test
|
||||
V2D_TEST_SITE_METHOD = local
|
||||
V2D_TEST_INSTALL_TARGET = YES
|
||||
|
||||
define V2D_TEST_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -D -m 0755 $(@D)/v2d_test $(TARGET_DIR)/usr/bin/v2d_test
|
||||
$(INSTALL) -D -m 0755 $(@D)/libv2d.so $(TARGET_DIR)/usr/lib/libv2d.so
|
||||
$(INSTALL) -D -m 0755 $(@D)/libdmabufheap.so $(TARGET_DIR)/usr/lib/libdmabufheap.so
|
||||
endef
|
||||
|
||||
$(eval $(cmake-package))
|
6
package/vk-gl-cts/Config.in
Normal file
6
package/vk-gl-cts/Config.in
Normal file
|
@ -0,0 +1,6 @@
|
|||
comment "vk-gl-cts package"
|
||||
|
||||
config BR2_PACKAGE_VK_GL_CTS
|
||||
bool "vk-gl-cts"
|
||||
help
|
||||
vk-gl-cts package
|
30
package/vk-gl-cts/vk-gl-cts.mk
Normal file
30
package/vk-gl-cts/vk-gl-cts.mk
Normal file
|
@ -0,0 +1,30 @@
|
|||
VK_GL_CTS_VERSION := 0.1.0
|
||||
VK_GL_CTS_SITE = $(TOPDIR)/../package-src/vk-gl-cts
|
||||
VK_GL_CTS_SITE_METHOD = local
|
||||
VK_GL_CTS_SUPPORTS_IN_SOURCE_BUILD = NO
|
||||
VK_GL_CTS_DEPENDENCIES = wayland libegl libgles
|
||||
VK_GL_CTS_BUILDDIR = $(@D)/../vk-gl-cts_build
|
||||
|
||||
define VK_GL_CTS_BUILD_CMDS
|
||||
$(warning here is $(@D)/build)
|
||||
rm -rf $(VK_GL_CTS_BUILDDIR)
|
||||
cd $(@D)
|
||||
mkdir -p $(VK_GL_CTS_BUILDDIR)
|
||||
rm -rf $(@D)/CMakeCache.txt $(@D)/CMakeFiles
|
||||
(cd $(VK_GL_CTS_BUILDDIR); $(TARGET_MAKE_ENV) cmake $(@D) -DCMAKE_TOOLCHAIN_FILE="$(HOST_DIR)/share/buildroot/toolchainfile.cmake" -DDEQP_TARGET=wayland -DGLCTS_GTF_TARGET=gles32 -DWAYLAND_SCANNER=$(HOST_DIR)/bin/wayland-scanner -DSELECTED_BUILD_TARGETS="deqp-egl deqp-gles2" -DCMAKE_INSTALL_PREFIX=$(TARGET_DIR)/usr; $(TARGET_MAKE_ENV) cmake --build external/openglcts; $(MAKE) install)
|
||||
endef
|
||||
|
||||
define VK_GL_CTS_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -D -m 0755 $(VK_GL_CTS_BUILDDIR)/external/openglcts/modules/cts-runner $(TARGET_DIR)/usr/bin/
|
||||
$(INSTALL) -D -m 0755 $(VK_GL_CTS_BUILDDIR)/external/openglcts/modules/glcts $(TARGET_DIR)/usr/bin/
|
||||
$(INSTALL) -D -m 0755 $(VK_GL_CTS_BUILDDIR)/modules/egl/deqp-egl $(TARGET_DIR)/usr/bin/
|
||||
$(INSTALL) -D -m 0755 $(VK_GL_CTS_BUILDDIR)/modules/gles2/deqp-gles2 $(TARGET_DIR)/usr/bin/
|
||||
cp -rf $(VK_GL_CTS_BUILDDIR)/modules/gles2/gles2/ $(TARGET_DIR)/usr/bin/
|
||||
$(INSTALL) -D -m 0755 $(VK_GL_CTS_BUILDDIR)/modules/gles3/deqp-gles3 $(TARGET_DIR)/usr/bin/
|
||||
cp -rf $(VK_GL_CTS_BUILDDIR)/modules/gles3/gles3/ $(TARGET_DIR)/usr/bin/
|
||||
$(INSTALL) -D -m 0755 $(VK_GL_CTS_BUILDDIR)/modules/gles31/deqp-gles31 $(TARGET_DIR)/usr/bin/
|
||||
cp -rf $(VK_GL_CTS_BUILDDIR)/modules/gles31/gles31/ $(TARGET_DIR)/usr/bin/
|
||||
$(INSTALL) -D -m 0755 $(VK_GL_CTS_BUILDDIR)/external/spirv-tools/spirv-tools/source/libSPIRV-Tools-shared.so $(TARGET_DIR)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
24
patches/libdrm/0004-Add-spacemit-drm-module.patch
Normal file
24
patches/libdrm/0004-Add-spacemit-drm-module.patch
Normal file
|
@ -0,0 +1,24 @@
|
|||
From 76e5d5e6ca2cd1970d763a1ef37856a1a4af4f87 Mon Sep 17 00:00:00 2001
|
||||
From: lilijun <lijun.li@spacemit.com>
|
||||
Date: Tue, 5 Dec 2023 13:54:38 +0800
|
||||
Subject: [PATCH] Add spacemit drm module
|
||||
|
||||
---
|
||||
tests/util/kms.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/tests/util/kms.c b/tests/util/kms.c
|
||||
index 39a9386..9debd40 100644
|
||||
--- a/tests/util/kms.c
|
||||
+++ b/tests/util/kms.c
|
||||
@@ -124,6 +124,7 @@ const char *util_lookup_connector_type_name(unsigned int type)
|
||||
}
|
||||
|
||||
static const char * const modules[] = {
|
||||
+ "spacemit",
|
||||
"i915",
|
||||
"amdgpu",
|
||||
"radeon",
|
||||
--
|
||||
2.25.1
|
||||
|
Loading…
Add table
Reference in a new issue