blob: 6878489e36a2425bfa28c8a6899ac1c7d1887da4 [file] [log] [blame]
Zelalem Aweke8e2e24b2021-07-13 14:05:20 -05001#
AlexeiFedorov46881f72025-01-24 15:53:50 +00002# Copyright (c) 2021-2025, Arm Limited. All rights reserved.
Zelalem Aweke8e2e24b2021-07-13 14:05:20 -05003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
AlexeiFedorov46881f72025-01-24 15:53:50 +00007# RME_GPT_BITLOCK_BLOCK is the number of 512MB blocks
8# per bit and the value must be power of 2.
9BITLOCK_BLOCK_POWER_2=$(shell echo $$(( ${RME_GPT_BITLOCK_BLOCK} & (${RME_GPT_BITLOCK_BLOCK} - 1) )))
10
AlexeiFedorovc0ca2d72024-05-13 15:35:54 +010011# Process RME_GPT_BITLOCK_BLOCK value
AlexeiFedorov46881f72025-01-24 15:53:50 +000012ifneq (${BITLOCK_BLOCK_POWER_2}, 0)
13 $(error "RME_GPT_BITLOCK_BLOCK must be power of 2. Invalid value ${RME_GPT_BITLOCK_BLOCK}.")
AlexeiFedorovc0ca2d72024-05-13 15:35:54 +010014endif
15
16ifeq (${RME_GPT_BITLOCK_BLOCK},0)
AlexeiFedorov46881f72025-01-24 15:53:50 +000017 $(info "GPT library uses global spinlock")
AlexeiFedorovc0ca2d72024-05-13 15:35:54 +010018endif
19
AlexeiFedorov46881f72025-01-24 15:53:50 +000020# Process the maximum size of supported contiguous blocks
21# RME_GPT_MAX_BLOCK
AlexeiFedorovbd8b1bb2024-03-13 17:07:03 +000022ifeq ($(filter 0 2 32 512, ${RME_GPT_MAX_BLOCK}),)
23 $(error "Invalid value for RME_GPT_MAX_BLOCK: ${RME_GPT_MAX_BLOCK}")
24endif
25
johpow019d134022021-06-16 17:57:28 -050026GPT_LIB_SRCS := $(addprefix lib/gpt_rme/, \
27 gpt_rme.c)