Zelalem Aweke | 8e2e24b | 2021-07-13 14:05:20 -0500 | [diff] [blame] | 1 | # |
AlexeiFedorov | 46881f7 | 2025-01-24 15:53:50 +0000 | [diff] [blame] | 2 | # Copyright (c) 2021-2025, Arm Limited. All rights reserved. |
Zelalem Aweke | 8e2e24b | 2021-07-13 14:05:20 -0500 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
AlexeiFedorov | 46881f7 | 2025-01-24 15:53:50 +0000 | [diff] [blame] | 7 | # RME_GPT_BITLOCK_BLOCK is the number of 512MB blocks |
| 8 | # per bit and the value must be power of 2. |
| 9 | BITLOCK_BLOCK_POWER_2=$(shell echo $$(( ${RME_GPT_BITLOCK_BLOCK} & (${RME_GPT_BITLOCK_BLOCK} - 1) ))) |
| 10 | |
AlexeiFedorov | c0ca2d7 | 2024-05-13 15:35:54 +0100 | [diff] [blame] | 11 | # Process RME_GPT_BITLOCK_BLOCK value |
AlexeiFedorov | 46881f7 | 2025-01-24 15:53:50 +0000 | [diff] [blame] | 12 | ifneq (${BITLOCK_BLOCK_POWER_2}, 0) |
| 13 | $(error "RME_GPT_BITLOCK_BLOCK must be power of 2. Invalid value ${RME_GPT_BITLOCK_BLOCK}.") |
AlexeiFedorov | c0ca2d7 | 2024-05-13 15:35:54 +0100 | [diff] [blame] | 14 | endif |
| 15 | |
| 16 | ifeq (${RME_GPT_BITLOCK_BLOCK},0) |
AlexeiFedorov | 46881f7 | 2025-01-24 15:53:50 +0000 | [diff] [blame] | 17 | $(info "GPT library uses global spinlock") |
AlexeiFedorov | c0ca2d7 | 2024-05-13 15:35:54 +0100 | [diff] [blame] | 18 | endif |
| 19 | |
AlexeiFedorov | 46881f7 | 2025-01-24 15:53:50 +0000 | [diff] [blame] | 20 | # Process the maximum size of supported contiguous blocks |
| 21 | # RME_GPT_MAX_BLOCK |
AlexeiFedorov | bd8b1bb | 2024-03-13 17:07:03 +0000 | [diff] [blame] | 22 | ifeq ($(filter 0 2 32 512, ${RME_GPT_MAX_BLOCK}),) |
| 23 | $(error "Invalid value for RME_GPT_MAX_BLOCK: ${RME_GPT_MAX_BLOCK}") |
| 24 | endif |
| 25 | |
johpow01 | 9d13402 | 2021-06-16 17:57:28 -0500 | [diff] [blame] | 26 | GPT_LIB_SRCS := $(addprefix lib/gpt_rme/, \ |
| 27 | gpt_rme.c) |