Skip to content

Commit

Permalink
Aspeed SDK release v09.00
Browse files Browse the repository at this point in the history
Update kernel-5.4 v00.04.16
Update kernel-5.15 v00.05.08
Update u-boot-2019.04 v00.04.17
Update aspeed_app v00.01.11
Update openssl v00.01.02
Support kernel-6.6 v00.06.00
Support u-boot-2023.10	v00.05.00

Merge branch 'aspeed-dev' into aspeed-master

Signed-off-by: VinceChang6637 <[email protected]>
Change-Id: I6d10d57d20283cb907c248d3896267e4397d7950
  • Loading branch information
VinceChang6637 committed Dec 22, 2023
2 parents 49899a5 + 6a6b5ea commit 5d2cab7
Show file tree
Hide file tree
Showing 179 changed files with 5,346 additions and 542 deletions.
2 changes: 2 additions & 0 deletions meta-aspeed-sdk/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ owners:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
22 changes: 19 additions & 3 deletions meta-aspeed-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,46 @@ Reference:
. setup <machine> [build_dir]
Target machine must be specified. Use one of:
ast2500-default
ast2500-default-515
ast2500-default-54
ast2600-dcscm
ast2600-dcscm-amd
ast2600-dcscm-avenue-city
ast2600-default
ast2600-default-515
ast2600-default-54
ast2600-default-ecc
ast2600-default-ncsi
ast2600-default-raw
ast2600-default-secure
ast2600-default-secure-515
ast2600-default-secure-tee
ast2600-default-secure-tee-515
ast2600-default-tee
ast2600-default-tee-515
ast2600-emmc
ast2600-emmc-515
ast2600-emmc-secure
ast2600-emmc-secure-515
ast2600-emmc-secure-tee
ast2600-emmc-secure-tee-515
ast2600-emmc-tee
ast2600-emmc-tee-515
ast2700-default
ast2700-default-ltpi
ast2700-default-ltpi-dual
ast2700-emmc
```

- Linux kernel version is `5.15` by default. machine with `54` postfix for kernel v5.4.
- Linux kernel version is `6.6` by default. machine with `515` postfix for kernel v5.15, machine with `54` postfix for kernel v5.4.
- AST2600 revision is `A3` by default.
- OPTEE-OS
- AST2600
- OPTEE-OS is disabled by default. machine with `tee` postfix for OPTEE-OS enable.
- AST2700
- OPTEE-OS is enabled by default.

1. AST2700 (**Not support yet**)
1. AST2700

```
. setup ast2700-default [build_dir]
Expand Down Expand Up @@ -104,7 +120,7 @@ After you successfully built the image, the image file can be found in: `[build_
- `otp_image`: OTP image

### Recovery Image via UART
- `recovery_u-boot-spl` : u-boot-spl.bin processed with gen_uart_booting_image.sh for recovery image via UART
- `recovery_u-boot-spl` : u-boot-spl.bin processed with gen_uart_booting_image.py for recovery image via UART

# Free Open Source Software (FOSS)
The Yocto/OpenBMC build system supports to provide the following things to meet the FOSS requirement.
Expand Down
88 changes: 24 additions & 64 deletions meta-aspeed-sdk/classes/image_types_phosphor_aspeed.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ FLASH_UBOOT_SPL_IMAGE ?= "u-boot-spl"
# image_types_phosphor uses FLASH_UBOOT_OFFSET(384kb) as start offset of uboot-spl and
# FLASH_UBOOT_SPL_SIZE(128kb) as the end offset of uboot-spl
# The start offset is larger than the end offset which causes the "image too large" error.
# According to the design of AST2700, bootmuc(riscv-32) execute SPL and CPU(coretax-a35) execute u-boot.
# To successfully build ast2700, SPL should no be built in u-boot recipe for CPU(coretax-a35),
# so the value of SPL_BINARY should be empty.
# However, it only checks SPL_BINARY to update SPL in image files.
# Therefore,creates do_generate_static task to overwrite the default setting which is from
# image_types_phosphor.bbclass
python do_generate_static() {
Expand Down Expand Up @@ -77,77 +81,33 @@ python do_generate_static() {
bb.build.exec_func("do_mk_static_symlinks", d)
}

do_generate_ext4_tar() {
# Generate the U-Boot image
mk_empty_image_zeros image-u-boot ${MMC_UBOOT_SIZE}
do_generate_image_uboot_file image-u-boot
do_generate_image_uboot_file() {
image_dst="$1"
uboot_offset="0"

if [[ ${BOOTMCU_FW_BINARY} ]]; then
mk_empty_image_zeros image-bmcu-ram 384
do_generate_image_bmcu_ram_file image-bmcu-ram
if [ -n "${SPL_BINARY}" -a -n "${BOOTMCU_FW_BINARY}" ]; then
bbfatal "SPL_BINARY and BOOTMCU_FW_BINARY should not be set at the same time."
fi

# Generate a compressed ext4 filesystem with the fitImage file in it to be
# flashed to the boot partition of the eMMC
install -d boot-image
install -m 644 ${DEPLOY_DIR_IMAGE}/${FLASH_KERNEL_IMAGE} boot-image/fitImage
mk_empty_image_zeros boot-image.${FLASH_EXT4_BASETYPE} ${MMC_BOOT_PARTITION_SIZE}
mkfs.ext4 -F -i 4096 -d boot-image boot-image.${FLASH_EXT4_BASETYPE}
# Error codes 0-3 indicate successfull operation of fsck
fsck.ext4 -pvfD boot-image.${FLASH_EXT4_BASETYPE} || [ $? -le 3 ]
zstd -f -k -T0 -c ${ZSTD_COMPRESSION_LEVEL} boot-image.${FLASH_EXT4_BASETYPE} > boot-image.${FLASH_EXT4_BASETYPE}.zst

# Generate the compressed ext4 rootfs
zstd -f -k -T0 -c ${ZSTD_COMPRESSION_LEVEL} ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${FLASH_EXT4_BASETYPE} > ${IMAGE_LINK_NAME}.${FLASH_EXT4_BASETYPE}.zst

ln -sf boot-image.${FLASH_EXT4_BASETYPE}.zst image-kernel
ln -sf ${IMAGE_LINK_NAME}.${FLASH_EXT4_BASETYPE}.zst image-rofs
ln -sf ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.rwfs.${FLASH_EXT4_OVERLAY_BASETYPE} image-rwfs
ln -sf ${S}/MANIFEST MANIFEST
ln -sf ${S}/publickey publickey

hostfw_update_file="${DEPLOY_DIR_IMAGE}/hostfw/update/image-hostfw"
if [ -e "${hostfw_update_file}" ]; then
ln -sf "${hostfw_update_file}" image-hostfw
if [[ ${BOOTMCU_FW_BINARY} ]]; then
make_signatures image-bmcu-ram image-u-boot image-kernel image-rofs image-rwfs MANIFEST publickey image-hostfw
else
make_signatures image-u-boot image-kernel image-rofs image-rwfs MANIFEST publickey image-hostfw
fi
make_tar_of_images ext4.mmc MANIFEST publickey ${signature_files} image-hostfw
else
if [[ ${BOOTMCU_FW_BINARY} ]]; then
make_signatures image-bmcu-ram image-u-boot image-kernel image-rofs image-rwfs MANIFEST publickey
else
make_signatures image-u-boot image-kernel image-rofs image-rwfs MANIFEST publickey
fi

make_tar_of_images ext4.mmc MANIFEST publickey ${signature_files}
if [ ! -z ${BOOTMCU_FW_BINARY} ]; then
dd bs=1k conv=notrunc seek=0 \
if=${DEPLOY_DIR_IMAGE}/${BOOTMCU_FW_BINARY} \
of=${image_dst}
uboot_offset=${FLASH_BMCU_SIZE}
fi
}

do_generate_image_uboot_file() {
image_dst="$1"
uboot_offset="0"

if [ ! -z ${SPL_BINARY} ]; then
dd bs=1k conv=notrunc seek=0 \
if=${DEPLOY_DIR_IMAGE}/${FLASH_UBOOT_SPL_IMAGE}.${UBOOT_SUFFIX} \
of=${image_dst}
uboot_offset=${FLASH_UBOOT_SPL_SIZE}
fi

dd bs=1k conv=notrunc seek=${uboot_offset} \
if=${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX} \
of=${image_dst}
}
if [ ! -z ${SPL_BINARY} ]; then
dd bs=1k conv=notrunc seek=0 \
if=${DEPLOY_DIR_IMAGE}/${FLASH_UBOOT_SPL_IMAGE}.${UBOOT_SUFFIX} \
of=${image_dst}
uboot_offset=${FLASH_UBOOT_SPL_SIZE}
fi

do_generate_image_bmcu_ram_file() {
image_dst="$1"
dd bs=1K conv=notrunc seek=0 \
if=${DEPLOY_DIR_IMAGE}/${BOOTMCU_FW_BINARY} \
of=${image_dst}
dd bs=1k conv=notrunc seek=${uboot_offset} \
if=${DEPLOY_DIR_IMAGE}/u-boot.${UBOOT_SUFFIX} \
of=${image_dst}
}

do_generate_static[depends] += "${@bb.utils.contains('MACHINE_FEATURES', 'ast-bootmcu', 'bootmcu-fw:do_deploy', '', d)}"
do_generate_static_tar[depends] += "${@bb.utils.contains('MACHINE_FEATURES', 'ast-bootmcu', 'bootmcu-fw:do_deploy', '', d)}"
do_generate_ext4_tar[depends] += "${@bb.utils.contains('MACHINE_FEATURES', 'ast-bootmcu', 'bootmcu-fw:do_deploy', '', d)}"
3 changes: 3 additions & 0 deletions meta-aspeed-sdk/classes/socsec-sign.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ sign_spl_helper() {
$signing_helper_args \
${SOCSEC_SIGN_EXTRA_OPTS} \
--output ${SPL_BINARY}.staged

# install unsigned image
install -m 0644 ${B}/$CONFIG_B_PATH/${SPL_BINARY} ${DEPLOYDIR}/"$(basename ${SPL_BINARY})".unsigned
cp -f ${SPL_BINARY}.staged ${B}/$CONFIG_B_PATH/${SPL_BINARY}
mv -f ${SPL_BINARY}.staged ${DEPLOYDIR}/${SPL_IMAGE}
fi
Expand Down
11 changes: 8 additions & 3 deletions meta-aspeed-sdk/classes/uboot-sign-aspeed.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ UBOOT_FIT_ARM_TRUSTED_FIRMWARE_A_IMAGE ?= "bl31.bin"
UBOOT_FIT_OPTEE_OS ?= "0"
UBOOT_FIT_OPTEE_OS_IMAGE ?= "tee-raw.bin"

UBOOT_FIT_UBOOT_LOADADDRESS ?= "${UBOOT_LOADADDRESS}"
UBOOT_FIT_UBOOT_ENTRYPOINT ?= "${UBOOT_ENTRYPOINT}"

python() {
# We need u-boot-tools-native if we're creating a U-Boot fitImage
sign = d.getVar('UBOOT_SIGN_ENABLE') == '1'
Expand Down Expand Up @@ -272,8 +275,8 @@ uboot_fitimage_assemble() {
os = "u-boot";
arch = "${UBOOT_ARCH}";
compression = "none";
load = <${UBOOT_LOADADDRESS}>;
entry = <${UBOOT_ENTRYPOINT}>;
load = <${UBOOT_FIT_UBOOT_LOADADDRESS}>;
entry = <${UBOOT_FIT_UBOOT_ENTRYPOINT}>;
EOF

if [ "${SPL_SIGN_ENABLE}" = "1" ] ; then
Expand Down Expand Up @@ -402,7 +405,9 @@ EOF
${SPL_MKIMAGE_SIGN_ARGS}
fi

cp ${SPL_DIR}/${SPL_DTB_BINARY} ${SPL_DIR}/${SPL_DTB_SIGNED}
if [ -f "${SPL_DIR}/${SPL_NODTB_BINARY}" ]; then
cp ${SPL_DIR}/${SPL_DTB_BINARY} ${SPL_DIR}/${SPL_DTB_SIGNED}
fi
}

uboot_assemble_fitimage_helper() {
Expand Down
4 changes: 4 additions & 0 deletions meta-aspeed-sdk/conf/machine/include/aspeed-sdk.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ PREFERRED_VERSION_iperf3 ?= "3.1.4"

# It should be removed if kernel 5.4 is no longer supported.
require oldest-kernel-54.inc

# Installs static development packages, which are static libraries (i.e. *.a files), for all packages installed in a given SDK
SDKIMAGE_FEATURES += "staticdev-pkgs"

4 changes: 0 additions & 4 deletions meta-aspeed-sdk/conf/machine/include/ast-abr.inc

This file was deleted.

15 changes: 15 additions & 0 deletions meta-aspeed-sdk/conf/machine/include/ast-mmc.inc
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
MACHINE_FEATURES:append = " ast-mmc"
MACHINEOVERRIDES .= ":ast-mmc"

# This IMAGE_OVERHEAD_FACTOR allows for a percentage overage of the actual
# image size rather than a fixed extra space, this is space needed for
# initial startup and basic operations.
# IMAGE_OVERHEAD_FACTOR is 1.3 by default in bitbake.conf.
# And the IMAGE_ROOTFS_SIZE is IMAGE_ROOTFS * 1.3 by default.
# The rootfs is a readonly filesystem in openbmc for emmc boot.
# Set IMAGE_OVERHEAD_FACTOR 1 to reduce the code size.
IMAGE_OVERHEAD_FACTOR = "1.0"

# If generating an empty image the size of the sparse block should be large
# enough to allocate an ext4 filesystem using 4096 bytes per inode, this is
# about 60K, so add extra rootfs space 4MB
# Defines additional free disk space created in the image in Kbytes
IMAGE_ROOTFS_EXTRA_SPACE = "4096"
3 changes: 3 additions & 0 deletions meta-aspeed-sdk/conf/machine/include/ast2500-sdk.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ UBOOT_LOADADDRESS ?= "0x80000000"

require conf/machine/include/arm/armv6/tune-arm1176jz-s.inc

PREFERRED_VERSION_u-boot-aspeed-sdk = "v2019.04+%"
PREFERRED_VERSION_u-boot-fw-utils-aspeed-sdk = "v2019.04+%"

2 changes: 2 additions & 0 deletions meta-aspeed-sdk/conf/machine/include/ast2600-sdk.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ OPTEEMACHINE = "aspeed-ast2600"

UBOOT_FIT_OPTEE_OS_IMAGE ?= "${DEPLOY_DIR_IMAGE}/optee/tee-raw.bin"

PREFERRED_VERSION_u-boot-aspeed-sdk = "v2019.04+%"
PREFERRED_VERSION_u-boot-fw-utils-aspeed-sdk = "v2019.04+%"
22 changes: 12 additions & 10 deletions meta-aspeed-sdk/conf/machine/include/ast2700-sdk.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ DEFAULTTUNE = "cortexa35"

require conf/machine/include/arm/armv8a/tune-cortexa35.inc
require conf/machine/include/ast-arm-trusted-firmware-a.inc
require conf/machine/include/ast-bootmcu.inc

SERIAL_CONSOLES ?= "115200;ttyS12"

UBOOT_FIT_ADDRESS_CELLS ?= "2"
FIT_ADDRESS_CELLS ?= "2"

# kernel and bootloader fitimage
UBOOT_ENTRYPOINT ?= "0x4 0x00040000"
UBOOT_LOADADDRESS ?= "0x4 0x00040000"
# bootloader fitimage
UBOOT_FIT_UBOOT_ENTRYPOINT ?= "0x80000000"
UBOOT_FIT_UBOOT_LOADADDRESS ?= "0x80000000"
UBOOT_FIT_ARM_TRUSTED_FIRMWARE_A_LOADADDRESS ?= "0xb0000000"
UBOOT_FIT_ARM_TRUSTED_FIRMWARE_A_ENTRYPOINT ?= "0xb0000000"
UBOOT_FIT_OPTEE_OS_LOADADDRESS ?= "0xb0080000"
UBOOT_FIT_OPTEE_OS_ENTRYPOINT ?= "0xb0080000"

UBOOT_FIT_ARM_TRUSTED_FIRMWARE_A_LOADADDRESS ?= "0x4 0x30000000"
UBOOT_FIT_ARM_TRUSTED_FIRMWARE_A_ENTRYPOINT ?= "0x4 0x30000000"
UBOOT_FIT_OPTEE_OS_LOADADDRESS ?= "0x4 0x30080000"
UBOOT_FIT_OPTEE_OS_ENTRYPOINT ?= "0x4 0x30080000"
# kernel fitimage
FIT_ADDRESS_CELLS ?= "2"
UBOOT_ENTRYPOINT ?= "0x4 0x00000000"
UBOOT_LOADADDRESS ?= "0x4 0x00000000"

COMPATIBLE_MACHINE:aspeed-g7 = "aspeed-g7"
TFA_PLATFORM = "ast2700"
Expand Down
Loading

0 comments on commit 5d2cab7

Please sign in to comment.