hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/crypto/ccree/cc_sram_mgr.h
....@@ -1,5 +1,5 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
2
-/* Copyright (C) 2012-2018 ARM Limited or its affiliates. */
2
+/* Copyright (C) 2012-2019 ARM Limited (or its affiliates). */
33
44 #ifndef __CC_SRAM_MGR_H__
55 #define __CC_SRAM_MGR_H__
....@@ -10,42 +10,30 @@
1010
1111 struct cc_drvdata;
1212
13
+#define NULL_SRAM_ADDR ((u32)-1)
14
+
1315 /**
14
- * Address (offset) within CC internal SRAM
15
- */
16
-
17
-typedef u64 cc_sram_addr_t;
18
-
19
-#define NULL_SRAM_ADDR ((cc_sram_addr_t)-1)
20
-
21
-/*!
22
- * Initializes SRAM pool.
16
+ * cc_sram_mgr_init() - Initializes SRAM pool.
2317 * The first X bytes of SRAM are reserved for ROM usage, hence, pool
2418 * starts right after X bytes.
2519 *
26
- * \param drvdata
20
+ * @drvdata: Associated device driver context
2721 *
28
- * \return int Zero for success, negative value otherwise.
22
+ * Return:
23
+ * Zero for success, negative value otherwise.
2924 */
3025 int cc_sram_mgr_init(struct cc_drvdata *drvdata);
3126
32
-/*!
33
- * Uninits SRAM pool.
27
+/**
28
+ * cc_sram_alloc() - Allocate buffer from SRAM pool.
3429 *
35
- * \param drvdata
36
- */
37
-void cc_sram_mgr_fini(struct cc_drvdata *drvdata);
38
-
39
-/*!
40
- * Allocated buffer from SRAM pool.
41
- * Note: Caller is responsible to free the LAST allocated buffer.
42
- * This function does not taking care of any fragmentation may occur
43
- * by the order of calls to alloc/free.
30
+ * @drvdata: Associated device driver context
31
+ * @size: The requested bytes to allocate
4432 *
45
- * \param drvdata
46
- * \param size The requested bytes to allocate
33
+ * Return:
34
+ * Address offset in SRAM or NULL_SRAM_ADDR for failure.
4735 */
48
-cc_sram_addr_t cc_sram_alloc(struct cc_drvdata *drvdata, u32 size);
36
+u32 cc_sram_alloc(struct cc_drvdata *drvdata, u32 size);
4937
5038 /**
5139 * cc_set_sram_desc() - Create const descriptors sequence to
....@@ -54,12 +42,11 @@
5442 *
5543 * @src: A pointer to array of words to set as consts.
5644 * @dst: The target SRAM buffer to set into
57
- * @nelements: The number of words in "src" array
45
+ * @nelement: The number of words in "src" array
5846 * @seq: A pointer to the given IN/OUT descriptor sequence
5947 * @seq_len: A pointer to the given IN/OUT sequence length
6048 */
61
-void cc_set_sram_desc(const u32 *src, cc_sram_addr_t dst,
62
- unsigned int nelement, struct cc_hw_desc *seq,
63
- unsigned int *seq_len);
49
+void cc_set_sram_desc(const u32 *src, u32 dst, unsigned int nelement,
50
+ struct cc_hw_desc *seq, unsigned int *seq_len);
6451
6552 #endif /*__CC_SRAM_MGR_H__*/