diff options
Diffstat (limited to 'meta-ti-bsp')
30 files changed, 530 insertions, 77 deletions
diff --git a/meta-ti-bsp/conf/layer.conf b/meta-ti-bsp/conf/layer.conf index 86744b2f..c8e4cd39 100644 --- a/meta-ti-bsp/conf/layer.conf +++ b/meta-ti-bsp/conf/layer.conf | |||
| @@ -20,10 +20,13 @@ LAYERDEPENDS_meta-ti-bsp = " \ | |||
| 20 | 20 | ||
| 21 | LAYERRECOMMENDS_meta-ti-bsp = " \ | 21 | LAYERRECOMMENDS_meta-ti-bsp = " \ |
| 22 | openembedded-layer \ | 22 | openembedded-layer \ |
| 23 | tpm-layer \ | ||
| 23 | " | 24 | " |
| 24 | 25 | ||
| 25 | BBFILES_DYNAMIC += " \ | 26 | BBFILES_DYNAMIC += " \ |
| 26 | openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes*/*/*.bbappend \ | 27 | openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes*/*/*.bbappend \ |
| 28 | tpm-layer:${LAYERDIR}/dynamic-layers/tpm-layer/recipes*/*/*.bb \ | ||
| 29 | tpm-layer:${LAYERDIR}/dynamic-layers/tpm-layer/recipes*/*/*.bbappend \ | ||
| 27 | " | 30 | " |
| 28 | 31 | ||
| 29 | SIGGEN_EXCLUDERECIPES_ABISAFE += " \ | 32 | SIGGEN_EXCLUDERECIPES_ABISAFE += " \ |
diff --git a/meta-ti-bsp/conf/machine/am62lxx-evm.conf b/meta-ti-bsp/conf/machine/am62lxx-evm.conf index 9aa4b853..677d6955 100644 --- a/meta-ti-bsp/conf/machine/am62lxx-evm.conf +++ b/meta-ti-bsp/conf/machine/am62lxx-evm.conf | |||
| @@ -17,3 +17,10 @@ KERNEL_DEVICETREE_PREFIX = " \ | |||
| 17 | KERNEL_DEVICETREE = "" | 17 | KERNEL_DEVICETREE = "" |
| 18 | 18 | ||
| 19 | UBOOT_MACHINE = "am62lx_evm_defconfig" | 19 | UBOOT_MACHINE = "am62lx_evm_defconfig" |
| 20 | FIT_CONF_DEFAULT_DTB = "k3-am62l3-evm.dtb" | ||
| 21 | UBOOT_LOADADDRESS = "0x82400000" | ||
| 22 | UBOOT_ENTRYPOINT = "0x82400000" | ||
| 23 | UBOOT_RD_LOADADDRESS = "0x84000000" | ||
| 24 | UBOOT_RD_ENTRYPOINT = "0x84000000" | ||
| 25 | UBOOT_DTB_LOADADDRESS = "0x84f00000" | ||
| 26 | UBOOT_DTBO_LOADADDRESS = "0x84f80000" | ||
diff --git a/meta-ti-bsp/conf/machine/am65xx-evm-k3r5.conf b/meta-ti-bsp/conf/machine/am65xx-evm-k3r5.conf index 4450ef57..c3b028ea 100644 --- a/meta-ti-bsp/conf/machine/am65xx-evm-k3r5.conf +++ b/meta-ti-bsp/conf/machine/am65xx-evm-k3r5.conf | |||
| @@ -8,6 +8,6 @@ UBOOT_MACHINE = "am65x_evm_r5_defconfig" | |||
| 8 | UBOOT_MACHINE:tie-test-builds = "" | 8 | UBOOT_MACHINE:tie-test-builds = "" |
| 9 | 9 | ||
| 10 | UBOOT_CONFIG = "" | 10 | UBOOT_CONFIG = "" |
| 11 | UBOOT_CONFIG:prepend:tie-test-builds = "usbdfu main" | 11 | UBOOT_CONFIG:tie-test-builds = "usbdfu main" |
| 12 | UBOOT_CONFIG[main] = "am62x_evm_r5_defconfig" | 12 | UBOOT_CONFIG[main] = "am65x_evm_r5_defconfig" |
| 13 | UBOOT_CONFIG[usbdfu] = "am65x_evm_r5_usbdfu_defconfig" | 13 | UBOOT_CONFIG[usbdfu] = "am65x_evm_r5_usbdfu_defconfig" |
diff --git a/meta-ti-bsp/conf/machine/include/j784s4.inc b/meta-ti-bsp/conf/machine/include/j784s4.inc index 4dc3a71b..e0ce81b5 100644 --- a/meta-ti-bsp/conf/machine/include/j784s4.inc +++ b/meta-ti-bsp/conf/machine/include/j784s4.inc | |||
| @@ -12,7 +12,7 @@ TFA_BOARD = "j784s4" | |||
| 12 | 12 | ||
| 13 | OPTEEMACHINE = "k3-j784s4" | 13 | OPTEEMACHINE = "k3-j784s4" |
| 14 | 14 | ||
| 15 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "cadence-mhdp-fw cnm-wave-fw ti-eth-fw-j784s4" | 15 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "cadence-mhdp-fw cnm-wave-fw" |
| 16 | 16 | ||
| 17 | TI_CORE_INITRAMFS_KERNEL_MODULES = "kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs" | 17 | TI_CORE_INITRAMFS_KERNEL_MODULES = "kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs" |
| 18 | TI_CORE_INITRAMFS_KERNEL_MODULES:bsp-ti-6_6 = "" | 18 | TI_CORE_INITRAMFS_KERNEL_MODULES:bsp-ti-6_6 = "" |
diff --git a/meta-ti-bsp/conf/machine/include/k3.inc b/meta-ti-bsp/conf/machine/include/k3.inc index 3138cf08..6833789c 100644 --- a/meta-ti-bsp/conf/machine/include/k3.inc +++ b/meta-ti-bsp/conf/machine/include/k3.inc | |||
| @@ -55,7 +55,7 @@ TI_WKS_BOOTLOADER_APPEND ?= "console=${KERNEL_CONSOLE}" | |||
| 55 | 55 | ||
| 56 | do_image_wic[depends] += "virtual/bootloader:do_deploy" | 56 | do_image_wic[depends] += "virtual/bootloader:do_deploy" |
| 57 | 57 | ||
| 58 | SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS2" | 58 | SERIAL_CONSOLES = "115200;ttyS2 115200;ttyS0" |
| 59 | 59 | ||
| 60 | FALCON_INCLUDE = "" | 60 | FALCON_INCLUDE = "" |
| 61 | FALCON_INCLUDE:ti-falcon = "conf/machine/include/ti-falcon.inc" | 61 | FALCON_INCLUDE:ti-falcon = "conf/machine/include/ti-falcon.inc" |
diff --git a/meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc b/meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc index 9d3cc612..15c05e04 100644 --- a/meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc +++ b/meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | # TI_CORE_INITRAMFS_ENABLED = "0" | 5 | # TI_CORE_INITRAMFS_ENABLED = "0" |
| 6 | # | 6 | # |
| 7 | #------------------------------------------------------------------------------ | 7 | #------------------------------------------------------------------------------ |
| 8 | TI_CORE_INITRAMFS_ENABLED ?= "${@ '1' if d.getVar('TI_CORE_INITRAMFS_KERNEL_MODULES') or d.getVar('TI_CORE_INITRAMFS_EXTRA_INSTALL') else '0'}" | 8 | TI_CORE_INITRAMFS_ENABLED ?= "${@ '1' if d.getVar('TI_CORE_INITRAMFS_KERNEL_MODULES') or d.getVar('TI_CORE_INITRAMFS_EXTRA_INSTALL') or bb.utils.contains('DISTRO_FEATURES', 'luks', True, False, d) else '0'}" |
| 9 | 9 | ||
| 10 | TI_CORE_INITRAMFS_KERNEL_MODULES ?= "" | 10 | TI_CORE_INITRAMFS_KERNEL_MODULES ?= "" |
| 11 | TI_CORE_INITRAMFS_EXTRA_INSTALL ?= "" | 11 | TI_CORE_INITRAMFS_EXTRA_INSTALL ?= "" |
diff --git a/meta-ti-bsp/conf/machine/j722s-evm-k3r5.conf b/meta-ti-bsp/conf/machine/j722s-evm-k3r5.conf index 5df4edfe..3cb95142 100644 --- a/meta-ti-bsp/conf/machine/j722s-evm-k3r5.conf +++ b/meta-ti-bsp/conf/machine/j722s-evm-k3r5.conf | |||
| @@ -7,8 +7,8 @@ require conf/machine/include/k3r5.inc | |||
| 7 | UBOOT_MACHINE = "j722s_evm_r5_defconfig" | 7 | UBOOT_MACHINE = "j722s_evm_r5_defconfig" |
| 8 | UBOOT_MACHINE:tie-test-builds = "" | 8 | UBOOT_MACHINE:tie-test-builds = "" |
| 9 | 9 | ||
| 10 | UBOOT_CONFIG = "main" | 10 | UBOOT_CONFIG = "" |
| 11 | UBOOT_CONFIG:prepend:tie-test-builds = "usbdfu " | 11 | UBOOT_CONFIG:tie-test-builds = "usbdfu main" |
| 12 | UBOOT_CONFIG[main] = "j722s_evm_r5_defconfig" | 12 | UBOOT_CONFIG[main] = "j722s_evm_r5_defconfig" |
| 13 | UBOOT_CONFIG[usbdfu] = "j722s_evm_r5_defconfig" | 13 | UBOOT_CONFIG[usbdfu] = "j722s_evm_r5_defconfig" |
| 14 | 14 | ||
diff --git a/meta-ti-bsp/conf/machine/j784s4-evm.conf b/meta-ti-bsp/conf/machine/j784s4-evm.conf index bf53b07c..a88f6f69 100644 --- a/meta-ti-bsp/conf/machine/j784s4-evm.conf +++ b/meta-ti-bsp/conf/machine/j784s4-evm.conf | |||
| @@ -27,3 +27,5 @@ KERNEL_DEVICETREE = " \ | |||
| 27 | " | 27 | " |
| 28 | 28 | ||
| 29 | UBOOT_MACHINE = "j784s4_evm_a72_defconfig" | 29 | UBOOT_MACHINE = "j784s4_evm_a72_defconfig" |
| 30 | |||
| 31 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "ti-eth-fw-j784s4" | ||
diff --git a/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/initramfs-module-luks-ftpm/luksftpm b/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/initramfs-module-luks-ftpm/luksftpm new file mode 100644 index 00000000..5e3aedc4 --- /dev/null +++ b/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/initramfs-module-luks-ftpm/luksftpm | |||
| @@ -0,0 +1,341 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # initramfs-framework module for LUKS encryption with fTPM support | ||
| 3 | |||
| 4 | # Configuration | ||
| 5 | BOOT_DEV="/dev/mmcblk1p1" # Boot partition (FAT, unencrypted) | ||
| 6 | ROOT_DEV="/dev/mmcblk1p2" # Root partition (will be encrypted) | ||
| 7 | CRYPT_NAME="root_crypt" | ||
| 8 | CRYPT_DEV="/dev/mapper/${CRYPT_NAME}" | ||
| 9 | BOOT_MNT="/boot_part" | ||
| 10 | TPM_PRIMARY_CTX="/tmp/tpm_primary.ctx" | ||
| 11 | TPM_KEY_PRIV="/tmp/tpm_key.priv" | ||
| 12 | TPM_KEY_PUB="/tmp/tpm_key.pub" | ||
| 13 | TPM_KEY_CTX="/tmp/tpm_key.ctx" | ||
| 14 | TPM2_HANDLE="0x81080001" # TPM persistent handle for LUKS key | ||
| 15 | ENCRYPTION_MARKER="${BOOT_MNT}/.encryption_in_progress" | ||
| 16 | |||
| 17 | # Wait for MMC device to appear | ||
| 18 | wait_for_device() { | ||
| 19 | local device="$1" | ||
| 20 | local timeout="${2:-10}" | ||
| 21 | |||
| 22 | msg "Waiting for storage device ${device}..." | ||
| 23 | for i in $(seq 1 ${timeout}); do | ||
| 24 | if [ -b "${device}" ]; then | ||
| 25 | return 0 | ||
| 26 | fi | ||
| 27 | sleep 1 | ||
| 28 | done | ||
| 29 | return 1 | ||
| 30 | } | ||
| 31 | |||
| 32 | # Initialize fTPM and check availability | ||
| 33 | init_ftpm() { | ||
| 34 | msg "Initializing secure hardware (fTPM)..." | ||
| 35 | |||
| 36 | # Start TEE supplicant (required for fTPM TA to work) | ||
| 37 | if [ -x /usr/sbin/tee-supplicant ]; then | ||
| 38 | /usr/sbin/tee-supplicant -d & | ||
| 39 | TEE_SUPPLICANT_PID=$! | ||
| 40 | sleep 5 | ||
| 41 | else | ||
| 42 | info "Warning: Trusted execution environment not available" | ||
| 43 | return 1 | ||
| 44 | fi | ||
| 45 | |||
| 46 | # Load fTPM kernel module | ||
| 47 | if ! /sbin/modprobe tpm_ftpm_tee; then | ||
| 48 | info "Warning: TPM module failed to load" | ||
| 49 | return 1 | ||
| 50 | fi | ||
| 51 | |||
| 52 | # Wait for TPM device | ||
| 53 | for i in $(seq 1 10); do | ||
| 54 | if [ -c /dev/tpmrm0 ]; then | ||
| 55 | export TPM2TOOLS_TCTI="device:/dev/tpmrm0" | ||
| 56 | return 0 | ||
| 57 | fi | ||
| 58 | sleep 1 | ||
| 59 | done | ||
| 60 | |||
| 61 | info "Warning: fTPM not available - encryption will be skipped" | ||
| 62 | return 1 | ||
| 63 | } | ||
| 64 | |||
| 65 | # Generate 32-byte random key using TPM RNG | ||
| 66 | generate_random_key() { | ||
| 67 | /usr/bin/tpm2_getrandom --hex 32 | ||
| 68 | } | ||
| 69 | |||
| 70 | # Seal data with TPM and store in persistent handle | ||
| 71 | tpm_seal_key() { | ||
| 72 | local KEY_DATA="$1" | ||
| 73 | |||
| 74 | # Create primary key in owner hierarchy | ||
| 75 | /usr/bin/tpm2_createprimary -C o -c "${TPM_PRIMARY_CTX}" -Q || return 1 | ||
| 76 | |||
| 77 | # Create sealed object | ||
| 78 | echo -n "${KEY_DATA}" | \ | ||
| 79 | /usr/bin/tpm2_create -C "${TPM_PRIMARY_CTX}" \ | ||
| 80 | -u "${TPM_KEY_PUB}" -r "${TPM_KEY_PRIV}" \ | ||
| 81 | -i- -Q || return 1 | ||
| 82 | |||
| 83 | # Load sealed object into TPM | ||
| 84 | /usr/bin/tpm2_load -C "${TPM_PRIMARY_CTX}" \ | ||
| 85 | -u "${TPM_KEY_PUB}" -r "${TPM_KEY_PRIV}" \ | ||
| 86 | -c "${TPM_KEY_CTX}" -Q || return 1 | ||
| 87 | |||
| 88 | # Make key persistent at handle (stored in TPM NV RAM - RPMB) | ||
| 89 | /usr/bin/tpm2_evictcontrol -C o -c "${TPM_KEY_CTX}" "${TPM2_HANDLE}" || return 1 | ||
| 90 | |||
| 91 | return 0 | ||
| 92 | } | ||
| 93 | |||
| 94 | # Unseal data from TPM persistent handle | ||
| 95 | tpm_unseal_key() { | ||
| 96 | # Check if persistent handle exists | ||
| 97 | if ! /usr/bin/tpm2_getcap handles-persistent | grep -q "${TPM2_HANDLE}"; then | ||
| 98 | debug "ERROR: TPM persistent handle not found" | ||
| 99 | return 1 | ||
| 100 | fi | ||
| 101 | |||
| 102 | # Unseal key directly from persistent handle | ||
| 103 | /usr/bin/tpm2_unseal -c "${TPM2_HANDLE}" || return 1 | ||
| 104 | |||
| 105 | return 0 | ||
| 106 | } | ||
| 107 | |||
| 108 | # Perform in-place LUKS encryption (first boot) | ||
| 109 | encrypt_root_filesystem() { | ||
| 110 | msg "==========================================" | ||
| 111 | msg "First boot: Encrypting root filesystem" | ||
| 112 | msg "==========================================" | ||
| 113 | |||
| 114 | # Set marker to track encryption progress | ||
| 115 | touch "${ENCRYPTION_MARKER}" | ||
| 116 | sync | ||
| 117 | |||
| 118 | # Generate random encryption key using TPM RNG | ||
| 119 | msg "Generating encryption key..." | ||
| 120 | LUKS_KEY=$(generate_random_key) | ||
| 121 | |||
| 122 | if [ -z "${LUKS_KEY}" ]; then | ||
| 123 | msg "ERROR: Failed to generate encryption key" | ||
| 124 | rm -f "${ENCRYPTION_MARKER}" | ||
| 125 | return 1 | ||
| 126 | fi | ||
| 127 | |||
| 128 | # Seal key with TPM before encryption starts | ||
| 129 | msg "Securing key with TPM..." | ||
| 130 | if ! tpm_seal_key "${LUKS_KEY}"; then | ||
| 131 | msg "ERROR: Failed to secure key" | ||
| 132 | rm -f "${ENCRYPTION_MARKER}" | ||
| 133 | return 1 | ||
| 134 | fi | ||
| 135 | |||
| 136 | # Filesystem check before encryption | ||
| 137 | msg "Checking filesystem integrity..." | ||
| 138 | /usr/sbin/e2fsck -f -y "${ROOT_DEV}" | ||
| 139 | E2FSCK_RET=$? | ||
| 140 | if [ ${E2FSCK_RET} -ge 4 ]; then | ||
| 141 | msg "ERROR: Filesystem check failed" | ||
| 142 | rm -f "${ENCRYPTION_MARKER}" | ||
| 143 | return 1 | ||
| 144 | fi | ||
| 145 | |||
| 146 | # Shrink filesystem before encryption to leave room for LUKS header | ||
| 147 | msg "Preparing filesystem for encryption..." | ||
| 148 | /usr/sbin/resize2fs -M "${ROOT_DEV}" || { | ||
| 149 | msg "ERROR: Failed to prepare filesystem" | ||
| 150 | rm -f "${ENCRYPTION_MARKER}" | ||
| 151 | return 1 | ||
| 152 | } | ||
| 153 | |||
| 154 | # Verify partition has sufficient space for LUKS header | ||
| 155 | msg "Verifying space for encryption..." | ||
| 156 | MIN_BLOCKS=$(/usr/sbin/resize2fs -P "${ROOT_DEV}" 2>&1 | awk '/[Mm]inimum.*:/ {print $NF}') | ||
| 157 | |||
| 158 | # Get filesystem block size and device size | ||
| 159 | BLOCK_SIZE=$(/usr/sbin/tune2fs -l "${ROOT_DEV}" 2>/dev/null | awk '/^Block size:/ {print $NF}') | ||
| 160 | DEV_NAME=$(basename "${ROOT_DEV}") | ||
| 161 | PART_SECTORS=$(cat /sys/class/block/"${DEV_NAME}"/size 2>/dev/null) | ||
| 162 | |||
| 163 | if [ -z "${MIN_BLOCKS}" ] || [ -z "${BLOCK_SIZE}" ] || [ -z "${PART_SECTORS}" ]; then | ||
| 164 | msg "ERROR: Unable to determine partition geometry" | ||
| 165 | rm -f "${ENCRYPTION_MARKER}" | ||
| 166 | return 1 | ||
| 167 | fi | ||
| 168 | |||
| 169 | # Convert filesystem blocks to 512-byte sectors | ||
| 170 | MIN_SECTORS=$((MIN_BLOCKS * BLOCK_SIZE / 512)) | ||
| 171 | LUKS_SECTORS=65536 # 32MB in 512-byte sectors | ||
| 172 | |||
| 173 | if [ $((PART_SECTORS - MIN_SECTORS)) -lt ${LUKS_SECTORS} ]; then | ||
| 174 | msg "ERROR: Insufficient space for LUKS header (need 32MB free)" | ||
| 175 | rm -f "${ENCRYPTION_MARKER}" | ||
| 176 | return 1 | ||
| 177 | fi | ||
| 178 | |||
| 179 | # Perform in-place encryption | ||
| 180 | msg "==========================================" | ||
| 181 | msg "Encrypting filesystem..." | ||
| 182 | msg "This will take several minutes." | ||
| 183 | msg "DO NOT POWER OFF THE DEVICE!" | ||
| 184 | msg "==========================================" | ||
| 185 | |||
| 186 | echo -n "${LUKS_KEY}" | \ | ||
| 187 | /usr/sbin/cryptsetup reencrypt --encrypt \ | ||
| 188 | --type luks2 \ | ||
| 189 | --cipher aes-xts-plain64 \ | ||
| 190 | --key-size 256 \ | ||
| 191 | --hash sha256 \ | ||
| 192 | --reduce-device-size 32M \ | ||
| 193 | --key-file - \ | ||
| 194 | "${ROOT_DEV}" || { | ||
| 195 | msg "ERROR: Encryption failed" | ||
| 196 | rm -f "${ENCRYPTION_MARKER}" | ||
| 197 | return 1 | ||
| 198 | } | ||
| 199 | |||
| 200 | msg "==========================================" | ||
| 201 | msg "Encryption completed successfully!" | ||
| 202 | msg "==========================================" | ||
| 203 | |||
| 204 | # Remove encryption marker | ||
| 205 | rm -f "${ENCRYPTION_MARKER}" | ||
| 206 | sync | ||
| 207 | |||
| 208 | # Unlock the newly encrypted device | ||
| 209 | msg "Activating encrypted filesystem..." | ||
| 210 | echo -n "${LUKS_KEY}" | \ | ||
| 211 | /usr/sbin/cryptsetup luksOpen "${ROOT_DEV}" "${CRYPT_NAME}" --key-file - || { | ||
| 212 | msg "ERROR: Failed to activate encrypted filesystem" | ||
| 213 | return 1 | ||
| 214 | } | ||
| 215 | |||
| 216 | # Resize filesystem to fit the encrypted device | ||
| 217 | msg "Optimizing filesystem..." | ||
| 218 | /usr/sbin/resize2fs -f "${CRYPT_DEV}" || { | ||
| 219 | msg "ERROR: Failed to optimize filesystem" | ||
| 220 | return 1 | ||
| 221 | } | ||
| 222 | |||
| 223 | # Verify filesystem after resize | ||
| 224 | /usr/sbin/e2fsck -f -y "${CRYPT_DEV}" || { | ||
| 225 | info "WARNING: Filesystem verification had issues, but continuing" | ||
| 226 | } | ||
| 227 | |||
| 228 | return 0 | ||
| 229 | } | ||
| 230 | |||
| 231 | # Unlock encrypted root filesystem (subsequent boots) | ||
| 232 | unlock_encrypted_root() { | ||
| 233 | msg "Unlocking encrypted filesystem..." | ||
| 234 | |||
| 235 | # Unseal key from TPM persistent handle | ||
| 236 | LUKS_KEY=$(tpm_unseal_key) | ||
| 237 | |||
| 238 | if [ -z "${LUKS_KEY}" ]; then | ||
| 239 | msg "ERROR: Failed to retrieve encryption key from TPM" | ||
| 240 | msg "Attempting passphrase fallback..." | ||
| 241 | |||
| 242 | # Try to unlock with passphrase (interactive) | ||
| 243 | /usr/sbin/cryptsetup luksOpen "${ROOT_DEV}" "${CRYPT_NAME}" || { | ||
| 244 | fatal "ERROR: Failed to unlock encrypted filesystem" | ||
| 245 | } | ||
| 246 | else | ||
| 247 | # Unlock with unsealed key | ||
| 248 | echo -n "${LUKS_KEY}" | \ | ||
| 249 | /usr/sbin/cryptsetup luksOpen "${ROOT_DEV}" "${CRYPT_NAME}" --key-file - || { | ||
| 250 | fatal "ERROR: Failed to unlock with TPM key" | ||
| 251 | } | ||
| 252 | fi | ||
| 253 | |||
| 254 | msg "Encrypted filesystem unlocked" | ||
| 255 | } | ||
| 256 | |||
| 257 | # Module enabled check | ||
| 258 | luksftpm_enabled() { | ||
| 259 | # Always run this module - it handles both encrypted and unencrypted cases | ||
| 260 | return 0 | ||
| 261 | } | ||
| 262 | |||
| 263 | # Module main function | ||
| 264 | luksftpm_run() { | ||
| 265 | # Wait for storage device | ||
| 266 | if ! wait_for_device "${ROOT_DEV}" 10; then | ||
| 267 | info "Storage device not found, skipping encryption module" | ||
| 268 | return 0 | ||
| 269 | fi | ||
| 270 | |||
| 271 | # Mount boot partition | ||
| 272 | msg "Mounting boot partition..." | ||
| 273 | mkdir -p "${BOOT_MNT}" | ||
| 274 | if ! mount "${BOOT_DEV}" "${BOOT_MNT}"; then | ||
| 275 | info "ERROR: Failed to mount boot partition, attempting standard boot..." | ||
| 276 | mkdir -p ${ROOTFS_DIR} | ||
| 277 | mount "${ROOT_DEV}" ${ROOTFS_DIR} | ||
| 278 | return 0 | ||
| 279 | fi | ||
| 280 | |||
| 281 | # Initialize fTPM | ||
| 282 | TPM_AVAILABLE=0 | ||
| 283 | if init_ftpm; then | ||
| 284 | TPM_AVAILABLE=1 | ||
| 285 | fi | ||
| 286 | |||
| 287 | # Check filesystem encryption status | ||
| 288 | msg "Checking filesystem encryption status..." | ||
| 289 | |||
| 290 | MOUNT_DEV="${ROOT_DEV}" | ||
| 291 | |||
| 292 | if /usr/sbin/cryptsetup isLuks "${ROOT_DEV}"; then | ||
| 293 | msg "Filesystem is encrypted" | ||
| 294 | unlock_encrypted_root | ||
| 295 | MOUNT_DEV="${CRYPT_DEV}" | ||
| 296 | else | ||
| 297 | msg "Filesystem is not encrypted" | ||
| 298 | |||
| 299 | # Check if encryption is enabled and TPM is available | ||
| 300 | if [ $TPM_AVAILABLE -eq 1 ]; then | ||
| 301 | # Check for encryption marker (resume interrupted encryption) | ||
| 302 | if [ -f "${ENCRYPTION_MARKER}" ]; then | ||
| 303 | msg "Resuming interrupted encryption..." | ||
| 304 | if ! encrypt_root_filesystem; then | ||
| 305 | msg "ERROR: Failed to resume encryption" | ||
| 306 | msg "Booting without encryption..." | ||
| 307 | MOUNT_DEV="${ROOT_DEV}" | ||
| 308 | else | ||
| 309 | MOUNT_DEV="${CRYPT_DEV}" | ||
| 310 | fi | ||
| 311 | else | ||
| 312 | # First boot - perform encryption | ||
| 313 | if encrypt_root_filesystem; then | ||
| 314 | MOUNT_DEV="${CRYPT_DEV}" | ||
| 315 | else | ||
| 316 | msg "ERROR: Encryption failed - booting without encryption" | ||
| 317 | MOUNT_DEV="${ROOT_DEV}" | ||
| 318 | fi | ||
| 319 | fi | ||
| 320 | else | ||
| 321 | msg "TPM not available - skipping encryption" | ||
| 322 | MOUNT_DEV="${ROOT_DEV}" | ||
| 323 | fi | ||
| 324 | fi | ||
| 325 | |||
| 326 | # Unmount boot partition before switching root | ||
| 327 | umount "${BOOT_MNT}" | ||
| 328 | |||
| 329 | # Mount root filesystem to $ROOTFS_DIR (framework expects this) | ||
| 330 | msg "Mounting root filesystem..." | ||
| 331 | mkdir -p ${ROOTFS_DIR} | ||
| 332 | mount "${MOUNT_DEV}" ${ROOTFS_DIR} || { | ||
| 333 | fatal "ERROR: Failed to mount root filesystem!" | ||
| 334 | } | ||
| 335 | |||
| 336 | # Clean up tmpfs and sensitive variables | ||
| 337 | rm -f "${TPM_PRIMARY_CTX}" "${TPM_KEY_PUB}" "${TPM_KEY_PRIV}" "${TPM_KEY_CTX}" | ||
| 338 | unset LUKS_KEY TPM_AVAILABLE MOUNT_DEV TEE_SUPPLICANT_PID | ||
| 339 | |||
| 340 | msg "Boot complete" | ||
| 341 | } | ||
diff --git a/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/initramfs-module-luks-ftpm_1.0.bb b/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/initramfs-module-luks-ftpm_1.0.bb new file mode 100644 index 00000000..b2a41d08 --- /dev/null +++ b/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/initramfs-module-luks-ftpm_1.0.bb | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | SUMMARY = "initramfs support for LUKS encryption with fTPM" | ||
| 2 | DESCRIPTION = "Provides LUKS2 full disk encryption using firmware TPM (fTPM) for key management on TI K3 platforms" | ||
| 3 | |||
| 4 | LICENSE = "MIT" | ||
| 5 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
| 6 | |||
| 7 | # Only build for platforms with optee-ftpm support | ||
| 8 | COMPATIBLE_MACHINE = "null" | ||
| 9 | COMPATIBLE_MACHINE:k3 = "${@bb.utils.contains('MACHINE_FEATURES', 'optee-ftpm', '.*', 'null', d)}" | ||
| 10 | |||
| 11 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | ||
| 12 | |||
| 13 | SRC_URI = "file://luksftpm" | ||
| 14 | |||
| 15 | S = "${UNPACKDIR}" | ||
| 16 | |||
| 17 | do_install() { | ||
| 18 | install -d ${D}/init.d | ||
| 19 | # Install as 85-luksftpm (runs after udev at 01, before rootfs at 90) | ||
| 20 | install -m 0755 ${UNPACKDIR}/luksftpm ${D}/init.d/85-luksftpm | ||
| 21 | } | ||
| 22 | |||
| 23 | FILES:${PN} = "/init.d/85-luksftpm" | ||
| 24 | |||
| 25 | # Runtime dependencies | ||
| 26 | RDEPENDS:${PN} = "\ | ||
| 27 | initramfs-framework-base \ | ||
| 28 | busybox \ | ||
| 29 | kmod \ | ||
| 30 | cryptsetup \ | ||
| 31 | tpm2-tools \ | ||
| 32 | tpm2-tss \ | ||
| 33 | libtss2-tcti-device \ | ||
| 34 | optee-client \ | ||
| 35 | optee-ftpm \ | ||
| 36 | e2fsprogs-e2fsck \ | ||
| 37 | e2fsprogs-resize2fs \ | ||
| 38 | e2fsprogs-tune2fs \ | ||
| 39 | util-linux-blkid \ | ||
| 40 | kernel-module-tpm-ftpm-tee \ | ||
| 41 | " | ||
| 42 | |||
| 43 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
diff --git a/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bbappend b/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bbappend new file mode 100644 index 00000000..52c82389 --- /dev/null +++ b/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bbappend | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | LUKS_ENCRYPTION ?= "${@bb.utils.contains('MACHINE_FEATURES', 'optee-ftpm', 'initramfs-module-luks-ftpm', '', d)}" | ||
| 2 | |||
| 3 | RDEPENDS:${PN}:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'luks', '${LUKS_ENCRYPTION}', '', d)}" | ||
diff --git a/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/ti-core-initramfs.bbappend b/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/ti-core-initramfs.bbappend new file mode 100644 index 00000000..8901d0bf --- /dev/null +++ b/meta-ti-bsp/dynamic-layers/tpm-layer/recipes-ti/initramfs/ti-core-initramfs.bbappend | |||
| @@ -0,0 +1 @@ | |||
| INITRAMFS_MAXSIZE = "200000" | |||
diff --git a/meta-ti-bsp/wic/sdimage-2part-efi.wks.in b/meta-ti-bsp/files/wic/sdimage-2part-efi.wks.in index 2582692f..2582692f 100644 --- a/meta-ti-bsp/wic/sdimage-2part-efi.wks.in +++ b/meta-ti-bsp/files/wic/sdimage-2part-efi.wks.in | |||
diff --git a/meta-ti-bsp/wic/sdimage-2part.wks b/meta-ti-bsp/files/wic/sdimage-2part.wks index 5073176e..5073176e 100644 --- a/meta-ti-bsp/wic/sdimage-2part.wks +++ b/meta-ti-bsp/files/wic/sdimage-2part.wks | |||
diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc index 9ed421a4..85b73854 100644 --- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc +++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc | |||
| @@ -21,7 +21,7 @@ TI_PKA_FW_VERSION = "2.1.0" | |||
| 21 | TI_IPC_EXAMPLES_FW_VERSION = "3.52.00.01" | 21 | TI_IPC_EXAMPLES_FW_VERSION = "3.52.00.01" |
| 22 | PCM6240_FW_VERSION = "1.0.0.0" | 22 | PCM6240_FW_VERSION = "1.0.0.0" |
| 23 | 23 | ||
| 24 | TI_LINUX_FW_SRCREV ?= "aaa3d54aaa9e837834fa6b6dd99e9fefdfcf7949" | 24 | TI_LINUX_FW_SRCREV ?= "9e9d50ff563f83db86d36b72cd7fb4f487d6b414" |
| 25 | SRCREV = "${TI_LINUX_FW_SRCREV}" | 25 | SRCREV = "${TI_LINUX_FW_SRCREV}" |
| 26 | 26 | ||
| 27 | BRANCH ?= "ti-linux-firmware" | 27 | BRANCH ?= "ti-linux-firmware" |
diff --git a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc b/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc index ec670a14..695b8b90 100644 --- a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc +++ b/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc | |||
| @@ -10,7 +10,7 @@ SRC_URI_TRUSTED_FIRMWARE_A = "git://git.trustedfirmware.org/TF-A/trusted-firmwar | |||
| 10 | SRCBRANCH = "master" | 10 | SRCBRANCH = "master" |
| 11 | 11 | ||
| 12 | LIC_FILES_CHKSUM:am62lxx = "file://docs/license.rst;md5=6ed7bace7b0bc63021c6eba7b524039e" | 12 | LIC_FILES_CHKSUM:am62lxx = "file://docs/license.rst;md5=6ed7bace7b0bc63021c6eba7b524039e" |
| 13 | SRCREV_tfa:am62lxx = "d203b8453905178252094416448de009931087e0" | 13 | SRCREV_tfa:am62lxx = "17d2997c0e7d4549720a5d176916f5ea0f63b009" |
| 14 | SRC_URI_TRUSTED_FIRMWARE_A:am62lxx = "git://github.com/TexasInstruments/arm-trusted-firmware.git;protocol=https" | 14 | SRC_URI_TRUSTED_FIRMWARE_A:am62lxx = "git://github.com/TexasInstruments/arm-trusted-firmware.git;protocol=https" |
| 15 | SRCBRANCH:am62lxx = "ti-tfa-2.14.y" | 15 | SRCBRANCH:am62lxx = "ti-tfa-2.14.y" |
| 16 | 16 | ||
diff --git a/meta-ti-bsp/recipes-bsp/u-boot/ti-extras.inc b/meta-ti-bsp/recipes-bsp/u-boot/ti-extras.inc index 2160e1ec..7d784ac8 100644 --- a/meta-ti-bsp/recipes-bsp/u-boot/ti-extras.inc +++ b/meta-ti-bsp/recipes-bsp/u-boot/ti-extras.inc | |||
| @@ -7,6 +7,6 @@ BRANCH:tie-jailhouse:bsp-ti-6_12 = "ti-u-boot-2025.01-jailhouse" | |||
| 7 | BRANCH:tie-jailhouse:bsp-ti-6_18 = "ti-u-boot-2026.01-jailhouse" | 7 | BRANCH:tie-jailhouse:bsp-ti-6_18 = "ti-u-boot-2026.01-jailhouse" |
| 8 | 8 | ||
| 9 | SRCREV_uboot:tie-jailhouse:bsp-ti-6_12 = "e718bbcec3ebf663c021839753034a224be4cc53" | 9 | SRCREV_uboot:tie-jailhouse:bsp-ti-6_12 = "e718bbcec3ebf663c021839753034a224be4cc53" |
| 10 | SRCREV_uboot:tie-jailhouse:bsp-ti-6_18 = "cfac87057b6fed15c4be4f1d35bf0c4001807484" | 10 | SRCREV_uboot:tie-jailhouse:bsp-ti-6_18 = "53a287d24610f0747ae4e35cff2afa3af23a48e3" |
| 11 | 11 | ||
| 12 | UBOOT_GIT_URI:tie-jailhouse = "git://git.ti.com/git/processor-sdk/u-boot.git" | 12 | UBOOT_GIT_URI:tie-jailhouse = "git://git.ti.com/git/processor-sdk/u-boot.git" |
diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-mainline_git.bb b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-mainline_git.bb index be53ce7b..03fd6193 100644 --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-mainline_git.bb +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-mainline_git.bb | |||
| @@ -2,8 +2,8 @@ require u-boot-ti.inc | |||
| 2 | 2 | ||
| 3 | SUMMARY = "Mainline U-Boot for TI devices" | 3 | SUMMARY = "Mainline U-Boot for TI devices" |
| 4 | 4 | ||
| 5 | PV = "2026.01" | 5 | PV = "2026.04" |
| 6 | 6 | ||
| 7 | UBOOT_GIT_URI = "git://source.denx.de/u-boot/u-boot.git" | 7 | UBOOT_GIT_URI = "git://source.denx.de/u-boot/u-boot.git" |
| 8 | 8 | ||
| 9 | SRCREV_uboot = "127a42c7257a6ffbbd1575ed1cbaa8f5408a44b3" | 9 | SRCREV_uboot = "88dc2788777babfd6322fa655df549a019aa1e69" |
diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging_2025.01.bb b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging_2025.01.bb index 6fef7e91..d03cae2b 100644 --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging_2025.01.bb +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging_2025.01.bb | |||
| @@ -4,6 +4,6 @@ PR = "r0" | |||
| 4 | 4 | ||
| 5 | BRANCH = "ti-u-boot-2025.01" | 5 | BRANCH = "ti-u-boot-2025.01" |
| 6 | 6 | ||
| 7 | SRCREV_uboot = "ef2eb76b650415637bd93b0eddfb1e31489117f9" | 7 | SRCREV_uboot = "19795f63be7ee27e38b6e800ff6c88a2feaae13f" |
| 8 | 8 | ||
| 9 | SRC_URI += "file://0001-binman-migrate-form-pkg_resources-to-importlib.patch" | 9 | SRC_URI += "file://0001-binman-migrate-form-pkg_resources-to-importlib.patch" |
diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging_2026.01.bb b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging_2026.01.bb index 7ad50c78..a7225293 100644 --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging_2026.01.bb +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti-staging_2026.01.bb | |||
| @@ -4,4 +4,4 @@ PR = "r0" | |||
| 4 | 4 | ||
| 5 | BRANCH = "ti-u-boot-2026.01" | 5 | BRANCH = "ti-u-boot-2026.01" |
| 6 | 6 | ||
| 7 | SRCREV_uboot = "a46241db71e383bb6dda103ecad12b13e7af3c38" | 7 | SRCREV_uboot = "ee3048ee0822c35312379b6e24b5c80e9a845110" |
diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-gallivm-Fix-armhf-build-against-LLVM-22.patch b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-gallivm-Fix-armhf-build-against-LLVM-22.patch new file mode 100644 index 00000000..935d76d1 --- /dev/null +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-gallivm-Fix-armhf-build-against-LLVM-22.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | From 973dc32026c164d0c13f7f5bef36c8d1c2375973 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alessandro Astone <ales.astone@gmail.com> | ||
| 3 | Date: Sun, 1 Mar 2026 18:14:09 +0100 | ||
| 4 | Subject: [PATCH] gallivm: Fix armhf build against LLVM 22 | ||
| 5 | |||
| 6 | StringMapIterator<bool> became StringMapIterBase<bool, false /* IsConst */>; | ||
| 7 | Use `auto` to handle either case. | ||
| 8 | |||
| 9 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40161] | ||
| 10 | Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com> | ||
| 11 | --- | ||
| 12 | src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 2 +- | ||
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | ||
| 16 | index d3ad342..c95d86e 100644 | ||
| 17 | --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | ||
| 18 | +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | ||
| 19 | @@ -331,7 +331,7 @@ lp_build_fill_mattrs(std::vector<std::string> &MAttrs) | ||
| 20 | llvm::sys::getHostCPUFeatures(features); | ||
| 21 | #endif | ||
| 22 | |||
| 23 | - for (llvm::StringMapIterator<bool> f = features.begin(); | ||
| 24 | + for (auto f = features.begin(); | ||
| 25 | f != features.end(); | ||
| 26 | ++f) { | ||
| 27 | MAttrs.push_back(((*f).second ? "+" : "-") + (*f).first().str()); | ||
| 28 | -- | ||
| 29 | 2.53.0 | ||
diff --git a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_24.0.1.bb b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_24.0.1.bb index 0b48bc15..8ec06800 100644 --- a/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_24.0.1.bb +++ b/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_24.0.1.bb | |||
| @@ -19,6 +19,7 @@ SRC_URI = " \ | |||
| 19 | file://0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch \ | 19 | file://0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch \ |
| 20 | file://0001-gallivm-Call-StringMapIterator-from-llvm-scope.patch \ | 20 | file://0001-gallivm-Call-StringMapIterator-from-llvm-scope.patch \ |
| 21 | file://0001-Update-lp_bld_misc.cpp-to-support-llvm-19.patch \ | 21 | file://0001-Update-lp_bld_misc.cpp-to-support-llvm-19.patch \ |
| 22 | file://0001-gallivm-Fix-armhf-build-against-LLVM-22.patch \ | ||
| 22 | " | 23 | " |
| 23 | 24 | ||
| 24 | SRCREV = "7c82c1eebc67f5a62a347a84d42fe795cf7f523b" | 25 | SRCREV = "7c82c1eebc67f5a62a347a84d42fe795cf7f523b" |
diff --git a/meta-ti-bsp/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch b/meta-ti-bsp/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch index fbe8f2bb..4b3b4a1f 100644 --- a/meta-ti-bsp/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch +++ b/meta-ti-bsp/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | From 5a05e5b66dd3831a9c9c2b3f64bd42419d9ade2d Mon Sep 17 00:00:00 2001 | 1 | From 3cddacaa9ea3cfd75732ea9a84312fa68e0bfda7 Mon Sep 17 00:00:00 2001 |
| 2 | From: Denys Dmytriyenko <denys@konsulko.com> | 2 | From: Ryan Eatmon <reatmon@ti.com> |
| 3 | Date: Thu, 6 Jul 2023 01:48:41 +0000 | 3 | Date: Tue, 24 Mar 2026 10:52:59 -0500 |
| 4 | Subject: [PATCH] Revert require GL_EXT_unpack_subimage commit | 4 | Subject: [PATCH] Revert require GL_EXT_unpack_subimage commit |
| 5 | 5 | ||
| 6 | This reverts commit 593d5af43a8e2c2a3371088fa7ae430d0517c82d. | 6 | This reverts commit 593d5af43a8e2c2a3371088fa7ae430d0517c82d. |
| @@ -13,83 +13,76 @@ Upstream-Status: Inappropriate [specific to TI SGX] | |||
| 13 | 13 | ||
| 14 | Signed-off-by: Andrew Davis <afd@ti.com> | 14 | Signed-off-by: Andrew Davis <afd@ti.com> |
| 15 | Signed-off-by: Denys Dmytriyenko <denys@konsulko.com> | 15 | Signed-off-by: Denys Dmytriyenko <denys@konsulko.com> |
| 16 | 16 | Signed-off-by: Ryan Eatmon <reatmon@ti.com> | |
| 17 | --- | 17 | --- |
| 18 | libweston/renderer-gl/gl-renderer-internal.h | 2 ++ | 18 | libweston/renderer-gl/gl-renderer-internal.h | 2 ++ |
| 19 | libweston/renderer-gl/gl-renderer.c | 29 ++++++++++++++++---- | 19 | libweston/renderer-gl/gl-renderer.c | 26 ++++++++++++++++---- |
| 20 | 2 files changed, 26 insertions(+), 5 deletions(-) | 20 | 2 files changed, 23 insertions(+), 5 deletions(-) |
| 21 | 21 | ||
| 22 | diff --git a/libweston/renderer-gl/gl-renderer-internal.h b/libweston/renderer-gl/gl-renderer-internal.h | 22 | diff --git a/libweston/renderer-gl/gl-renderer-internal.h b/libweston/renderer-gl/gl-renderer-internal.h |
| 23 | index 5032035..85616c9 100644 | 23 | index 1afffbda..dbf7b1c3 100644 |
| 24 | --- a/libweston/renderer-gl/gl-renderer-internal.h | 24 | --- a/libweston/renderer-gl/gl-renderer-internal.h |
| 25 | +++ b/libweston/renderer-gl/gl-renderer-internal.h | 25 | +++ b/libweston/renderer-gl/gl-renderer-internal.h |
| 26 | @@ -229,6 +229,8 @@ struct gl_renderer { | 26 | @@ -526,6 +526,8 @@ struct gl_renderer { |
| 27 | PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC create_platform_window; | 27 | struct weston_log_scope *shader_scope; |
| 28 | bool has_platform_base; | 28 | |
| 29 | 29 | struct dmabuf_allocator *allocator; | |
| 30 | + bool has_unpack_subimage; | ||
| 31 | + | 30 | + |
| 32 | PFNEGLBINDWAYLANDDISPLAYWL bind_display; | 31 | + bool has_unpack_subimage; |
| 33 | PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display; | 32 | }; |
| 34 | PFNEGLQUERYWAYLANDBUFFERWL query_buffer; | 33 | |
| 34 | static inline uint32_t | ||
| 35 | diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c | 35 | diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c |
| 36 | index e694418b..2be6d621 100644 | 36 | index 45a2a148..8b238208 100644 |
| 37 | --- a/libweston/renderer-gl/gl-renderer.c | 37 | --- a/libweston/renderer-gl/gl-renderer.c |
| 38 | +++ b/libweston/renderer-gl/gl-renderer.c | 38 | +++ b/libweston/renderer-gl/gl-renderer.c |
| 39 | @@ -2523,6 +2523,7 @@ gl_renderer_flush_damage(struct weston_paint_node *pnode) | 39 | @@ -3021,6 +3021,22 @@ gl_renderer_flush_damage(struct weston_paint_node *pnode) |
| 40 | struct weston_surface *surface = pnode->surface; | 40 | |
| 41 | const struct weston_testsuite_quirks *quirks = | 41 | data = wl_shm_buffer_get_data(buffer->shm_buffer); |
| 42 | &surface->compositor->test_data.test_quirks; | 42 | |
| 43 | + struct gl_renderer *gr = get_renderer(surface->compositor); | ||
| 44 | struct weston_buffer *buffer = surface->buffer_ref.buffer; | ||
| 45 | struct gl_surface_state *gs = get_surface_state(surface); | ||
| 46 | struct gl_buffer_state *gb = gs->buffer; | ||
| 47 | @@ -2550,6 +2551,24 @@ gl_renderer_flush_damage(struct weston_paint_node *pnode) | ||
| 48 | |||
| 49 | data = wl_shm_buffer_get_data(buffer->shm_buffer); | ||
| 50 | |||
| 51 | + if (!gr->has_unpack_subimage) { | 43 | + if (!gr->has_unpack_subimage) { |
| 52 | + wl_shm_buffer_begin_access(buffer->shm_buffer); | 44 | + wl_shm_buffer_begin_access(buffer->shm_buffer); |
| 53 | + for (j = 0; j < gs->buffer->num_textures; j++) { | 45 | + for (j = 0; j < gb->num_textures; j++) { |
| 54 | + glBindTexture(GL_TEXTURE_2D, gs->buffer->textures[j]); | 46 | + glBindTexture(GL_TEXTURE_2D, gb->textures[j]); |
| 55 | + glTexImage2D(GL_TEXTURE_2D, 0, | 47 | + gl_texture_2d_store(gr, 0, 0, 0, |
| 56 | + gs->buffer->gl_format[j], | 48 | + gb->pitch / pixel_format_hsub(buffer->pixel_format, j), |
| 57 | + gs->buffer->pitch / pixel_format_hsub(buffer->pixel_format, j), | 49 | + buffer->height / pixel_format_vsub(buffer->pixel_format, j), |
| 58 | + buffer->height / pixel_format_vsub(buffer->pixel_format, j), | 50 | + gb->texture_format[j].external, |
| 59 | + 0, | 51 | + gb->texture_format[j].type, |
| 60 | + gl_format_from_internal(gs->buffer->gl_format[j]), | 52 | + data + gb->offset[j]); |
| 61 | + gs->buffer->gl_pixel_type, | ||
| 62 | + data + gs->buffer->offset[j]); | ||
| 63 | + } | 53 | + } |
| 64 | + wl_shm_buffer_end_access(buffer->shm_buffer); | 54 | + wl_shm_buffer_end_access(buffer->shm_buffer); |
| 65 | + | 55 | + |
| 66 | + goto done; | 56 | + goto done; |
| 67 | + } | 57 | + } |
| 68 | + | 58 | + |
| 69 | if (gb->needs_full_upload || quirks->gl_force_full_upload) { | 59 | if (gb->needs_full_upload || quirks->force_full_upload) { |
| 70 | wl_shm_buffer_begin_access(buffer->shm_buffer); | 60 | wl_shm_buffer_begin_access(buffer->shm_buffer); |
| 71 | 61 | ||
| 72 | @@ -4754,11 +4773,9 @@ gl_renderer_setup(struct weston_compositor *ec) | 62 | @@ -5171,11 +5187,9 @@ gl_renderer_setup(struct weston_compositor *ec) |
| 73 | else | 63 | else |
| 74 | ec->read_format = pixel_format_get_info(DRM_FORMAT_ABGR8888); | 64 | ec->read_format = pixel_format_get_info(DRM_FORMAT_ABGR8888); |
| 75 | 65 | ||
| 76 | - if (gr->gl_version < gr_gl_version(3, 0) && | 66 | - if (gr->gl_version < gl_version(3, 0) && |
| 77 | - !weston_check_egl_extension(extensions, "GL_EXT_unpack_subimage")) { | 67 | - !gl_extensions_has(gr, EXTENSION_EXT_UNPACK_SUBIMAGE)) { |
| 78 | - weston_log("GL_EXT_unpack_subimage not available.\n"); | 68 | - weston_log("GL_EXT_unpack_subimage not available.\n"); |
| 79 | - return -1; | 69 | - return -1; |
| 80 | - } | 70 | - } |
| 81 | + if (gr->gl_version >= gr_gl_version(3, 0) || | 71 | + if (gr->gl_version >= gl_version(3, 0) || |
| 82 | + weston_check_egl_extension(extensions, "GL_EXT_unpack_subimage")) | 72 | + weston_check_egl_extension(extensions, "GL_EXT_unpack_subimage")) |
| 83 | + gr->has_unpack_subimage = true; | 73 | + gr->has_unpack_subimage = true; |
| 84 | 74 | ||
| 85 | if (gr->gl_version >= gr_gl_version(3, 0) || | 75 | if (gl_extensions_has(gr, EXTENSION_OES_MAPBUFFER)) |
| 86 | weston_check_egl_extension(extensions, "GL_EXT_texture_type_2_10_10_10_REV")) | 76 | GET_PROC_ADDRESS(gr->unmap_buffer, "glUnmapBufferOES"); |
| 87 | @@ -4880,6 +4897,8 @@ gl_renderer_setup(struct weston_compositor *ec) | 77 | @@ -5303,6 +5317,8 @@ gl_renderer_setup(struct weston_compositor *ec) |
| 88 | gr_gl_version_minor(gr->gl_version)); | 78 | gl_version_minor(gr->gl_version)); |
| 89 | weston_log_continue(STAMP_SPACE "read-back format: %s\n", | 79 | weston_log_continue(STAMP_SPACE "read-back format: %s\n", |
| 90 | ec->read_format->drm_format_name); | 80 | ec->read_format->drm_format_name); |
| 91 | + weston_log_continue(STAMP_SPACE "wl_shm sub-image to texture: %s\n", | 81 | + weston_log_continue(STAMP_SPACE "wl_shm sub-image to texture: %s\n", |
| 92 | + gr->has_unpack_subimage ? "yes" : "no"); | 82 | + gr->has_unpack_subimage ? "yes" : "no"); |
| 93 | weston_log_continue(STAMP_SPACE "glReadPixels supports y-flip: %s\n", | 83 | weston_log_continue(STAMP_SPACE "glReadPixels supports y-flip: %s\n", |
| 94 | yesno(gr->has_pack_reverse)); | 84 | yesno(gl_extensions_has(gr, EXTENSION_ANGLE_PACK_REVERSE_ROW_ORDER))); |
| 95 | weston_log_continue(STAMP_SPACE "glReadPixels supports PBO: %s\n", | 85 | weston_log_continue(STAMP_SPACE "glReadPixels supports PBO: %s\n", |
| 86 | -- | ||
| 87 | 2.43.0 | ||
| 88 | |||
diff --git a/meta-ti-bsp/recipes-graphics/wayland/weston_14.0.%.bbappend b/meta-ti-bsp/recipes-graphics/wayland/weston_%.bbappend index cf4f530a..cf4f530a 100644 --- a/meta-ti-bsp/recipes-graphics/wayland/weston_14.0.%.bbappend +++ b/meta-ti-bsp/recipes-graphics/wayland/weston_%.bbappend | |||
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-6.18/luks-ftpm.cfg b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-6.18/luks-ftpm.cfg new file mode 100644 index 00000000..291e5ee6 --- /dev/null +++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-6.18/luks-ftpm.cfg | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | # Device Mapper support | ||
| 2 | CONFIG_MD=y | ||
| 3 | CONFIG_BLK_DEV_DM=y | ||
| 4 | CONFIG_DM_CRYPT=y | ||
| 5 | |||
| 6 | # Core crypto algorithms for LUKS encryption | ||
| 7 | CONFIG_CRYPTO_AES=y | ||
| 8 | CONFIG_CRYPTO_XTS=y | ||
| 9 | CONFIG_CRYPTO_SHA256=y | ||
| 10 | CONFIG_CRYPTO_SHA512=y | ||
| 11 | |||
| 12 | # ARM64 optimized crypto for better performance | ||
| 13 | CONFIG_CRYPTO_AES_ARM64=y | ||
| 14 | CONFIG_CRYPTO_AES_ARM64_CE=y | ||
| 15 | CONFIG_CRYPTO_AES_ARM64_CE_BLK=y | ||
| 16 | |||
| 17 | # Userspace crypto API for cryptsetup | ||
| 18 | CONFIG_CRYPTO_USER_API_HASH=y | ||
| 19 | CONFIG_CRYPTO_USER_API_SKCIPHER=y | ||
| 20 | |||
| 21 | # Firmware TPM support via OP-TEE | ||
| 22 | CONFIG_TCG_FTPM_TEE=m | ||
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-rt_6.12.bb b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-rt_6.12.bb index 5957194c..0d974c0b 100644 --- a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-rt_6.12.bb +++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-rt_6.12.bb | |||
| @@ -10,7 +10,7 @@ BRANCH_ARM64 = "ti-linux-6.12.y" | |||
| 10 | BRANCH = "${BRANCH_ARM64}" | 10 | BRANCH = "${BRANCH_ARM64}" |
| 11 | 11 | ||
| 12 | BRANCH_ARM32 = "ti-rt-linux-6.12.y-arm32" | 12 | BRANCH_ARM32 = "ti-rt-linux-6.12.y-arm32" |
| 13 | SRCREV_ARM32 = "a3bc6dc973a99822f0707b1c9ba06b56bf142076" | 13 | SRCREV_ARM32 = "62fdc7890cde3197051743120ff44162b7356cc5" |
| 14 | PV_ARM32 = "6.12.57+git" | 14 | PV_ARM32 = "6.12.57+git" |
| 15 | 15 | ||
| 16 | BRANCH:ti33x = "${BRANCH_ARM32}" | 16 | BRANCH:ti33x = "${BRANCH_ARM32}" |
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb index c63d7532..8a86e1d8 100644 --- a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb +++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb | |||
| @@ -21,7 +21,7 @@ S = "${UNPACKDIR}/${BB_GIT_DEFAULT_DESTSUFFIX}" | |||
| 21 | 21 | ||
| 22 | BRANCH ?= "ti-linux-6.12.y" | 22 | BRANCH ?= "ti-linux-6.12.y" |
| 23 | 23 | ||
| 24 | SRCREV ?= "da3c0f0a33ac00f7138c695a16d90301cf7ec02b" | 24 | SRCREV ?= "c52c5589aab8c376f975b1feb7b8746b7b6624bd" |
| 25 | PV = "6.12.57+git" | 25 | PV = "6.12.57+git" |
| 26 | 26 | ||
| 27 | SRC_URI += "file://0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch" | 27 | SRC_URI += "file://0001-libbpf-Fix-Wdiscarded-qualifiers-under-C23.patch" |
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.18.bb b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.18.bb index 3d278daf..1b7ec01a 100644 --- a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.18.bb +++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.18.bb | |||
| @@ -22,7 +22,7 @@ S = "${UNPACKDIR}/${BB_GIT_DEFAULT_DESTSUFFIX}" | |||
| 22 | 22 | ||
| 23 | BRANCH ?= "ti-linux-6.18.y" | 23 | BRANCH ?= "ti-linux-6.18.y" |
| 24 | 24 | ||
| 25 | SRCREV ?= "fa0fe817f5ee1b0542f757abaded245c6e5a1321" | 25 | SRCREV ?= "fa14abf25646c5814b997836539dbb859d6a669f" |
| 26 | PV = "6.18.13+git" | 26 | PV = "6.18.13+git" |
| 27 | 27 | ||
| 28 | KERNEL_REPRODUCIBILITY_PATCHES = " \ | 28 | KERNEL_REPRODUCIBILITY_PATCHES = " \ |
| @@ -35,3 +35,11 @@ module_conf_rpmsg_client_sample = "blacklist rpmsg_client_sample" | |||
| 35 | module_conf_ti_k3_r5_remoteproc = "softdep ti_k3_r5_remoteproc pre: virtio_rpmsg_bus" | 35 | module_conf_ti_k3_r5_remoteproc = "softdep ti_k3_r5_remoteproc pre: virtio_rpmsg_bus" |
| 36 | module_conf_ti_k3_dsp_remoteproc = "softdep ti_k3_dsp_remoteproc pre: virtio_rpmsg_bus" | 36 | module_conf_ti_k3_dsp_remoteproc = "softdep ti_k3_dsp_remoteproc pre: virtio_rpmsg_bus" |
| 37 | KERNEL_MODULE_PROBECONF += "rpmsg_client_sample ti_k3_r5_remoteproc ti_k3_dsp_remoteproc" | 37 | KERNEL_MODULE_PROBECONF += "rpmsg_client_sample ti_k3_r5_remoteproc ti_k3_dsp_remoteproc" |
| 38 | |||
| 39 | # LUKS encryption with fTPM kernel configuration | ||
| 40 | SRC_URI:append:k3 = " \ | ||
| 41 | ${@bb.utils.contains('DISTRO_FEATURES', 'luks', 'file://luks-ftpm.cfg', '', d)} \ | ||
| 42 | " | ||
| 43 | KERNEL_CONFIG_FRAGMENTS:append:k3 = " \ | ||
| 44 | ${@bb.utils.contains('DISTRO_FEATURES', 'luks', '${UNPACKDIR}/luks-ftpm.cfg', '', d)} \ | ||
| 45 | " | ||
diff --git a/meta-ti-bsp/recipes-kernel/linux/ti-extras-rt.inc b/meta-ti-bsp/recipes-kernel/linux/ti-extras-rt.inc index 10e5988c..63de122e 100644 --- a/meta-ti-bsp/recipes-kernel/linux/ti-extras-rt.inc +++ b/meta-ti-bsp/recipes-kernel/linux/ti-extras-rt.inc | |||
| @@ -5,4 +5,4 @@ BRANCH:tie-jailhouse:bsp-ti-6_12 = "ti-linux-6.12.y-jailhouse" | |||
| 5 | BRANCH:tie-jailhouse:bsp-ti-6_18 = "ti-linux-6.18.y-jailhouse" | 5 | BRANCH:tie-jailhouse:bsp-ti-6_18 = "ti-linux-6.18.y-jailhouse" |
| 6 | 6 | ||
| 7 | SRCREV:tie-jailhouse:bsp-ti-6_12 = "229a48602ad1557612a4ffabec6a3cbcdd745f87" | 7 | SRCREV:tie-jailhouse:bsp-ti-6_12 = "229a48602ad1557612a4ffabec6a3cbcdd745f87" |
| 8 | SRCREV:tie-jailhouse:bsp-ti-6_18 = "e80c3501e727c8c01454594ca5b10555377dfd60" | 8 | SRCREV:tie-jailhouse:bsp-ti-6_18 = "b27ed9ea7bdad936265fe38c6e112d86743fd379" |
diff --git a/meta-ti-bsp/recipes-kernel/linux/ti-extras.inc b/meta-ti-bsp/recipes-kernel/linux/ti-extras.inc index 515db47d..ff8b6f6b 100644 --- a/meta-ti-bsp/recipes-kernel/linux/ti-extras.inc +++ b/meta-ti-bsp/recipes-kernel/linux/ti-extras.inc | |||
| @@ -9,6 +9,6 @@ BRANCH:tie-jailhouse:bsp-ti-6_12 = "ti-linux-6.12.y-jailhouse" | |||
| 9 | BRANCH:tie-jailhouse:bsp-ti-6_18 = "ti-linux-6.18.y-jailhouse" | 9 | BRANCH:tie-jailhouse:bsp-ti-6_18 = "ti-linux-6.18.y-jailhouse" |
| 10 | 10 | ||
| 11 | SRCREV:tie-jailhouse:bsp-ti-6_12 = "229a48602ad1557612a4ffabec6a3cbcdd745f87" | 11 | SRCREV:tie-jailhouse:bsp-ti-6_12 = "229a48602ad1557612a4ffabec6a3cbcdd745f87" |
| 12 | SRCREV:tie-jailhouse:bsp-ti-6_18 = "e80c3501e727c8c01454594ca5b10555377dfd60" | 12 | SRCREV:tie-jailhouse:bsp-ti-6_18 = "b27ed9ea7bdad936265fe38c6e112d86743fd379" |
| 13 | 13 | ||
| 14 | KERNEL_GIT_URI:tie-jailhouse = "git://git.ti.com/git/processor-sdk/linux.git" | 14 | KERNEL_GIT_URI:tie-jailhouse = "git://git.ti.com/git/processor-sdk/linux.git" |
