xref: /aosp_15_r20/trusty/kernel/lib/arm_trng/rules.mk (revision 344aa361028b423587d4ef3fa52a23d194628137)
1*344aa361SAndroid Build Coastguard Worker#
2*344aa361SAndroid Build Coastguard Worker# Copyright (c) 2022, Google, Inc. All rights reserved
3*344aa361SAndroid Build Coastguard Worker#
4*344aa361SAndroid Build Coastguard Worker# Permission is hereby granted, free of charge, to any person obtaining
5*344aa361SAndroid Build Coastguard Worker# a copy of this software and associated documentation files
6*344aa361SAndroid Build Coastguard Worker# (the "Software"), to deal in the Software without restriction,
7*344aa361SAndroid Build Coastguard Worker# including without limitation the rights to use, copy, modify, merge,
8*344aa361SAndroid Build Coastguard Worker# publish, distribute, sublicense, and/or sell copies of the Software,
9*344aa361SAndroid Build Coastguard Worker# and to permit persons to whom the Software is furnished to do so,
10*344aa361SAndroid Build Coastguard Worker# subject to the following conditions:
11*344aa361SAndroid Build Coastguard Worker#
12*344aa361SAndroid Build Coastguard Worker# The above copyright notice and this permission notice shall be
13*344aa361SAndroid Build Coastguard Worker# included in all copies or substantial portions of the Software.
14*344aa361SAndroid Build Coastguard Worker#
15*344aa361SAndroid Build Coastguard Worker# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16*344aa361SAndroid Build Coastguard Worker# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17*344aa361SAndroid Build Coastguard Worker# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18*344aa361SAndroid Build Coastguard Worker# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19*344aa361SAndroid Build Coastguard Worker# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20*344aa361SAndroid Build Coastguard Worker# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21*344aa361SAndroid Build Coastguard Worker# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*344aa361SAndroid Build Coastguard Worker#
23*344aa361SAndroid Build Coastguard Worker
24*344aa361SAndroid Build Coastguard WorkerLOCAL_DIR := $(GET_LOCAL_DIR)
25*344aa361SAndroid Build Coastguard Worker
26*344aa361SAndroid Build Coastguard WorkerMODULE := $(LOCAL_DIR)
27*344aa361SAndroid Build Coastguard Worker
28*344aa361SAndroid Build Coastguard WorkerMODULE_SRCS += \
29*344aa361SAndroid Build Coastguard Worker	$(LOCAL_DIR)/arm_trng.c \
30*344aa361SAndroid Build Coastguard Worker
31*344aa361SAndroid Build Coastguard WorkerMODULE_DEPS += \
32*344aa361SAndroid Build Coastguard Worker	trusty/kernel/lib/smc \
33*344aa361SAndroid Build Coastguard Worker
34*344aa361SAndroid Build Coastguard Worker# Timeouts in milliseconds for the long wait warning and the printing
35*344aa361SAndroid Build Coastguard WorkerARM_TRNG_LONG_WAIT_MS ?= 1000
36*344aa361SAndroid Build Coastguard WorkerARM_TRNG_PRINT_MS ?= 100
37*344aa361SAndroid Build Coastguard Worker
38*344aa361SAndroid Build Coastguard Worker# How long to sleep when out of entropy
39*344aa361SAndroid Build Coastguard WorkerARM_TRNG_ENTROPY_SLEEP_NS ?= 1000000
40*344aa361SAndroid Build Coastguard Worker
41*344aa361SAndroid Build Coastguard WorkerMODULE_DEFINES += \
42*344aa361SAndroid Build Coastguard Worker	ARM_TRNG_LONG_WAIT_MS=$(ARM_TRNG_LONG_WAIT_MS) \
43*344aa361SAndroid Build Coastguard Worker	ARM_TRNG_PRINT_MS=$(ARM_TRNG_PRINT_MS) \
44*344aa361SAndroid Build Coastguard Worker	ARM_TRNG_ENTROPY_SLEEP_NS=$(ARM_TRNG_ENTROPY_SLEEP_NS) \
45*344aa361SAndroid Build Coastguard Worker
46*344aa361SAndroid Build Coastguard Workerinclude make/module.mk
47