Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 1 | /* |
| 2 | * AMD Cryptographic Coprocessor (CCP) driver |
| 3 | * |
Gary R Hook | 553d237 | 2016-03-01 13:49:04 -0600 | [diff] [blame] | 4 | * Copyright (C) 2013,2016 Advanced Micro Devices, Inc. |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 5 | * |
| 6 | * Author: Tom Lendacky <thomas.lendacky@amd.com> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | */ |
| 12 | |
| 13 | #ifndef __CCP_DEV_H__ |
| 14 | #define __CCP_DEV_H__ |
| 15 | |
| 16 | #include <linux/device.h> |
| 17 | #include <linux/pci.h> |
| 18 | #include <linux/spinlock.h> |
| 19 | #include <linux/mutex.h> |
| 20 | #include <linux/list.h> |
| 21 | #include <linux/wait.h> |
| 22 | #include <linux/dmapool.h> |
| 23 | #include <linux/hw_random.h> |
Tom Lendacky | 8db8846 | 2015-02-03 13:07:05 -0600 | [diff] [blame] | 24 | #include <linux/bitops.h> |
Gary R Hook | 58ea8ab | 2016-04-18 09:21:44 -0500 | [diff] [blame] | 25 | #include <linux/interrupt.h> |
| 26 | #include <linux/irqreturn.h> |
| 27 | #include <linux/dmaengine.h> |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 28 | |
Gary R Hook | 553d237 | 2016-03-01 13:49:04 -0600 | [diff] [blame] | 29 | #define MAX_CCP_NAME_LEN 16 |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 30 | #define MAX_DMAPOOL_NAME_LEN 32 |
| 31 | |
| 32 | #define MAX_HW_QUEUES 5 |
| 33 | #define MAX_CMD_QLEN 100 |
| 34 | |
| 35 | #define TRNG_RETRIES 10 |
| 36 | |
Tom Lendacky | 126ae9a | 2014-07-10 10:58:35 -0500 | [diff] [blame] | 37 | #define CACHE_NONE 0x00 |
Tom Lendacky | c4f4b32 | 2014-06-05 10:17:57 -0500 | [diff] [blame] | 38 | #define CACHE_WB_NO_ALLOC 0xb7 |
| 39 | |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 40 | /****** Register Mappings ******/ |
| 41 | #define Q_MASK_REG 0x000 |
| 42 | #define TRNG_OUT_REG 0x00c |
| 43 | #define IRQ_MASK_REG 0x040 |
| 44 | #define IRQ_STATUS_REG 0x200 |
| 45 | |
| 46 | #define DEL_CMD_Q_JOB 0x124 |
| 47 | #define DEL_Q_ACTIVE 0x00000200 |
| 48 | #define DEL_Q_ID_SHIFT 6 |
| 49 | |
| 50 | #define CMD_REQ0 0x180 |
| 51 | #define CMD_REQ_INCR 0x04 |
| 52 | |
| 53 | #define CMD_Q_STATUS_BASE 0x210 |
| 54 | #define CMD_Q_INT_STATUS_BASE 0x214 |
| 55 | #define CMD_Q_STATUS_INCR 0x20 |
| 56 | |
Tom Lendacky | c4f4b32 | 2014-06-05 10:17:57 -0500 | [diff] [blame] | 57 | #define CMD_Q_CACHE_BASE 0x228 |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 58 | #define CMD_Q_CACHE_INC 0x20 |
| 59 | |
Tom Lendacky | 8db8846 | 2015-02-03 13:07:05 -0600 | [diff] [blame] | 60 | #define CMD_Q_ERROR(__qs) ((__qs) & 0x0000003f) |
| 61 | #define CMD_Q_DEPTH(__qs) (((__qs) >> 12) & 0x0000000f) |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 62 | |
| 63 | /****** REQ0 Related Values ******/ |
| 64 | #define REQ0_WAIT_FOR_WRITE 0x00000004 |
| 65 | #define REQ0_INT_ON_COMPLETE 0x00000002 |
| 66 | #define REQ0_STOP_ON_COMPLETE 0x00000001 |
| 67 | |
| 68 | #define REQ0_CMD_Q_SHIFT 9 |
| 69 | #define REQ0_JOBID_SHIFT 3 |
| 70 | |
| 71 | /****** REQ1 Related Values ******/ |
| 72 | #define REQ1_PROTECT_SHIFT 27 |
| 73 | #define REQ1_ENGINE_SHIFT 23 |
| 74 | #define REQ1_KEY_KSB_SHIFT 2 |
| 75 | |
| 76 | #define REQ1_EOM 0x00000002 |
| 77 | #define REQ1_INIT 0x00000001 |
| 78 | |
| 79 | /* AES Related Values */ |
| 80 | #define REQ1_AES_TYPE_SHIFT 21 |
| 81 | #define REQ1_AES_MODE_SHIFT 18 |
| 82 | #define REQ1_AES_ACTION_SHIFT 17 |
| 83 | #define REQ1_AES_CFB_SIZE_SHIFT 10 |
| 84 | |
| 85 | /* XTS-AES Related Values */ |
| 86 | #define REQ1_XTS_AES_SIZE_SHIFT 10 |
| 87 | |
| 88 | /* SHA Related Values */ |
| 89 | #define REQ1_SHA_TYPE_SHIFT 21 |
| 90 | |
| 91 | /* RSA Related Values */ |
| 92 | #define REQ1_RSA_MOD_SIZE_SHIFT 10 |
| 93 | |
| 94 | /* Pass-Through Related Values */ |
| 95 | #define REQ1_PT_BW_SHIFT 12 |
| 96 | #define REQ1_PT_BS_SHIFT 10 |
| 97 | |
| 98 | /* ECC Related Values */ |
| 99 | #define REQ1_ECC_AFFINE_CONVERT 0x00200000 |
| 100 | #define REQ1_ECC_FUNCTION_SHIFT 18 |
| 101 | |
| 102 | /****** REQ4 Related Values ******/ |
| 103 | #define REQ4_KSB_SHIFT 18 |
| 104 | #define REQ4_MEMTYPE_SHIFT 16 |
| 105 | |
| 106 | /****** REQ6 Related Values ******/ |
| 107 | #define REQ6_MEMTYPE_SHIFT 16 |
| 108 | |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 109 | /****** Key Storage Block ******/ |
| 110 | #define KSB_START 77 |
| 111 | #define KSB_END 127 |
| 112 | #define KSB_COUNT (KSB_END - KSB_START + 1) |
| 113 | #define CCP_KSB_BITS 256 |
| 114 | #define CCP_KSB_BYTES 32 |
| 115 | |
| 116 | #define CCP_JOBID_MASK 0x0000003f |
| 117 | |
| 118 | #define CCP_DMAPOOL_MAX_SIZE 64 |
Tom Lendacky | 8db8846 | 2015-02-03 13:07:05 -0600 | [diff] [blame] | 119 | #define CCP_DMAPOOL_ALIGN BIT(5) |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 120 | |
| 121 | #define CCP_REVERSE_BUF_SIZE 64 |
| 122 | |
| 123 | #define CCP_AES_KEY_KSB_COUNT 1 |
| 124 | #define CCP_AES_CTX_KSB_COUNT 1 |
| 125 | |
| 126 | #define CCP_XTS_AES_KEY_KSB_COUNT 1 |
| 127 | #define CCP_XTS_AES_CTX_KSB_COUNT 1 |
| 128 | |
| 129 | #define CCP_SHA_KSB_COUNT 1 |
| 130 | |
| 131 | #define CCP_RSA_MAX_WIDTH 4096 |
| 132 | |
| 133 | #define CCP_PASSTHRU_BLOCKSIZE 256 |
| 134 | #define CCP_PASSTHRU_MASKSIZE 32 |
| 135 | #define CCP_PASSTHRU_KSB_COUNT 1 |
| 136 | |
| 137 | #define CCP_ECC_MODULUS_BYTES 48 /* 384-bits */ |
| 138 | #define CCP_ECC_MAX_OPERANDS 6 |
| 139 | #define CCP_ECC_MAX_OUTPUTS 3 |
| 140 | #define CCP_ECC_SRC_BUF_SIZE 448 |
| 141 | #define CCP_ECC_DST_BUF_SIZE 192 |
| 142 | #define CCP_ECC_OPERAND_SIZE 64 |
| 143 | #define CCP_ECC_OUTPUT_SIZE 64 |
| 144 | #define CCP_ECC_RESULT_OFFSET 60 |
| 145 | #define CCP_ECC_RESULT_SUCCESS 0x0001 |
| 146 | |
Gary R Hook | ea0375a | 2016-03-01 13:49:25 -0600 | [diff] [blame] | 147 | struct ccp_op; |
| 148 | |
| 149 | /* Structure for computation functions that are device-specific */ |
| 150 | struct ccp_actions { |
| 151 | int (*perform_aes)(struct ccp_op *); |
| 152 | int (*perform_xts_aes)(struct ccp_op *); |
| 153 | int (*perform_sha)(struct ccp_op *); |
| 154 | int (*perform_rsa)(struct ccp_op *); |
| 155 | int (*perform_passthru)(struct ccp_op *); |
| 156 | int (*perform_ecc)(struct ccp_op *); |
| 157 | int (*init)(struct ccp_device *); |
| 158 | void (*destroy)(struct ccp_device *); |
| 159 | irqreturn_t (*irqhandler)(int, void *); |
| 160 | }; |
| 161 | |
Gary R Hook | c7019c4 | 2016-03-01 13:49:15 -0600 | [diff] [blame] | 162 | /* Structure to hold CCP version-specific values */ |
| 163 | struct ccp_vdata { |
| 164 | unsigned int version; |
Julia Lawall | bc197b2a | 2016-05-01 13:52:55 +0200 | [diff] [blame] | 165 | const struct ccp_actions *perform; |
Gary R Hook | c7019c4 | 2016-03-01 13:49:15 -0600 | [diff] [blame] | 166 | }; |
| 167 | |
| 168 | extern struct ccp_vdata ccpv3; |
| 169 | |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 170 | struct ccp_device; |
| 171 | struct ccp_cmd; |
| 172 | |
Gary R Hook | 58ea8ab | 2016-04-18 09:21:44 -0500 | [diff] [blame] | 173 | struct ccp_dma_cmd { |
| 174 | struct list_head entry; |
| 175 | |
| 176 | struct ccp_cmd ccp_cmd; |
| 177 | }; |
| 178 | |
| 179 | struct ccp_dma_desc { |
| 180 | struct list_head entry; |
| 181 | |
| 182 | struct ccp_device *ccp; |
| 183 | |
| 184 | struct list_head pending; |
| 185 | struct list_head active; |
| 186 | |
| 187 | enum dma_status status; |
| 188 | struct dma_async_tx_descriptor tx_desc; |
| 189 | size_t len; |
| 190 | }; |
| 191 | |
| 192 | struct ccp_dma_chan { |
| 193 | struct ccp_device *ccp; |
| 194 | |
| 195 | spinlock_t lock; |
| 196 | struct list_head pending; |
| 197 | struct list_head active; |
| 198 | struct list_head complete; |
| 199 | |
| 200 | struct tasklet_struct cleanup_tasklet; |
| 201 | |
| 202 | enum dma_status status; |
| 203 | struct dma_chan dma_chan; |
| 204 | }; |
| 205 | |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 206 | struct ccp_cmd_queue { |
| 207 | struct ccp_device *ccp; |
| 208 | |
| 209 | /* Queue identifier */ |
| 210 | u32 id; |
| 211 | |
| 212 | /* Queue dma pool */ |
| 213 | struct dma_pool *dma_pool; |
| 214 | |
| 215 | /* Queue reserved KSB regions */ |
| 216 | u32 ksb_key; |
| 217 | u32 ksb_ctx; |
| 218 | |
| 219 | /* Queue processing thread */ |
| 220 | struct task_struct *kthread; |
| 221 | unsigned int active; |
| 222 | unsigned int suspended; |
| 223 | |
| 224 | /* Number of free command slots available */ |
| 225 | unsigned int free_slots; |
| 226 | |
| 227 | /* Interrupt masks */ |
| 228 | u32 int_ok; |
| 229 | u32 int_err; |
| 230 | |
| 231 | /* Register addresses for queue */ |
| 232 | void __iomem *reg_status; |
| 233 | void __iomem *reg_int_status; |
| 234 | |
| 235 | /* Status values from job */ |
| 236 | u32 int_status; |
| 237 | u32 q_status; |
| 238 | u32 q_int_status; |
| 239 | u32 cmd_error; |
| 240 | |
| 241 | /* Interrupt wait queue */ |
| 242 | wait_queue_head_t int_queue; |
| 243 | unsigned int int_rcvd; |
| 244 | } ____cacheline_aligned; |
| 245 | |
| 246 | struct ccp_device { |
Gary R Hook | 553d237 | 2016-03-01 13:49:04 -0600 | [diff] [blame] | 247 | struct list_head entry; |
| 248 | |
Gary R Hook | c7019c4 | 2016-03-01 13:49:15 -0600 | [diff] [blame] | 249 | struct ccp_vdata *vdata; |
Gary R Hook | 553d237 | 2016-03-01 13:49:04 -0600 | [diff] [blame] | 250 | unsigned int ord; |
| 251 | char name[MAX_CCP_NAME_LEN]; |
| 252 | char rngname[MAX_CCP_NAME_LEN]; |
| 253 | |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 254 | struct device *dev; |
| 255 | |
Gary R Hook | fa242e8 | 2016-07-26 18:09:46 -0500 | [diff] [blame^] | 256 | /* Bus specific device information |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 257 | */ |
| 258 | void *dev_specific; |
| 259 | int (*get_irq)(struct ccp_device *ccp); |
| 260 | void (*free_irq)(struct ccp_device *ccp); |
Tom Lendacky | 3d77565 | 2014-06-05 10:17:45 -0500 | [diff] [blame] | 261 | unsigned int irq; |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 262 | |
Gary R Hook | fa242e8 | 2016-07-26 18:09:46 -0500 | [diff] [blame^] | 263 | /* I/O area used for device communication. The register mapping |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 264 | * starts at an offset into the mapped bar. |
| 265 | * The CMD_REQx registers and the Delete_Cmd_Queue_Job register |
| 266 | * need to be protected while a command queue thread is accessing |
| 267 | * them. |
| 268 | */ |
| 269 | struct mutex req_mutex ____cacheline_aligned; |
| 270 | void __iomem *io_map; |
| 271 | void __iomem *io_regs; |
| 272 | |
Gary R Hook | fa242e8 | 2016-07-26 18:09:46 -0500 | [diff] [blame^] | 273 | /* Master lists that all cmds are queued on. Because there can be |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 274 | * more than one CCP command queue that can process a cmd a separate |
| 275 | * backlog list is neeeded so that the backlog completion call |
| 276 | * completes before the cmd is available for execution. |
| 277 | */ |
| 278 | spinlock_t cmd_lock ____cacheline_aligned; |
| 279 | unsigned int cmd_count; |
| 280 | struct list_head cmd; |
| 281 | struct list_head backlog; |
| 282 | |
Gary R Hook | fa242e8 | 2016-07-26 18:09:46 -0500 | [diff] [blame^] | 283 | /* The command queues. These represent the queues available on the |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 284 | * CCP that are available for processing cmds |
| 285 | */ |
| 286 | struct ccp_cmd_queue cmd_q[MAX_HW_QUEUES]; |
| 287 | unsigned int cmd_q_count; |
| 288 | |
Gary R Hook | fa242e8 | 2016-07-26 18:09:46 -0500 | [diff] [blame^] | 289 | /* Support for the CCP True RNG |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 290 | */ |
| 291 | struct hwrng hwrng; |
| 292 | unsigned int hwrng_retries; |
| 293 | |
Gary R Hook | fa242e8 | 2016-07-26 18:09:46 -0500 | [diff] [blame^] | 294 | /* Support for the CCP DMA capabilities |
Gary R Hook | 58ea8ab | 2016-04-18 09:21:44 -0500 | [diff] [blame] | 295 | */ |
| 296 | struct dma_device dma_dev; |
| 297 | struct ccp_dma_chan *ccp_dma_chan; |
| 298 | struct kmem_cache *dma_cmd_cache; |
| 299 | struct kmem_cache *dma_desc_cache; |
| 300 | |
Gary R Hook | fa242e8 | 2016-07-26 18:09:46 -0500 | [diff] [blame^] | 301 | /* A counter used to generate job-ids for cmds submitted to the CCP |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 302 | */ |
| 303 | atomic_t current_id ____cacheline_aligned; |
| 304 | |
Gary R Hook | fa242e8 | 2016-07-26 18:09:46 -0500 | [diff] [blame^] | 305 | /* The CCP uses key storage blocks (KSB) to maintain context for certain |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 306 | * operations. To prevent multiple cmds from using the same KSB range |
| 307 | * a command queue reserves a KSB range for the duration of the cmd. |
| 308 | * Each queue, will however, reserve 2 KSB blocks for operations that |
| 309 | * only require single KSB entries (eg. AES context/iv and key) in order |
| 310 | * to avoid allocation contention. This will reserve at most 10 KSB |
| 311 | * entries, leaving 40 KSB entries available for dynamic allocation. |
| 312 | */ |
| 313 | struct mutex ksb_mutex ____cacheline_aligned; |
| 314 | DECLARE_BITMAP(ksb, KSB_COUNT); |
| 315 | wait_queue_head_t ksb_queue; |
| 316 | unsigned int ksb_avail; |
| 317 | unsigned int ksb_count; |
| 318 | u32 ksb_start; |
| 319 | |
| 320 | /* Suspend support */ |
| 321 | unsigned int suspending; |
| 322 | wait_queue_head_t suspend_queue; |
Tom Lendacky | 126ae9a | 2014-07-10 10:58:35 -0500 | [diff] [blame] | 323 | |
| 324 | /* DMA caching attribute support */ |
| 325 | unsigned int axcache; |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 326 | }; |
| 327 | |
Gary R Hook | ea0375a | 2016-03-01 13:49:25 -0600 | [diff] [blame] | 328 | enum ccp_memtype { |
| 329 | CCP_MEMTYPE_SYSTEM = 0, |
| 330 | CCP_MEMTYPE_KSB, |
| 331 | CCP_MEMTYPE_LOCAL, |
| 332 | CCP_MEMTYPE__LAST, |
| 333 | }; |
| 334 | |
| 335 | struct ccp_dma_info { |
| 336 | dma_addr_t address; |
| 337 | unsigned int offset; |
| 338 | unsigned int length; |
| 339 | enum dma_data_direction dir; |
| 340 | }; |
| 341 | |
| 342 | struct ccp_dm_workarea { |
| 343 | struct device *dev; |
| 344 | struct dma_pool *dma_pool; |
| 345 | unsigned int length; |
| 346 | |
| 347 | u8 *address; |
| 348 | struct ccp_dma_info dma; |
| 349 | }; |
| 350 | |
| 351 | struct ccp_sg_workarea { |
| 352 | struct scatterlist *sg; |
| 353 | int nents; |
| 354 | |
| 355 | struct scatterlist *dma_sg; |
| 356 | struct device *dma_dev; |
| 357 | unsigned int dma_count; |
| 358 | enum dma_data_direction dma_dir; |
| 359 | |
| 360 | unsigned int sg_used; |
| 361 | |
| 362 | u64 bytes_left; |
| 363 | }; |
| 364 | |
| 365 | struct ccp_data { |
| 366 | struct ccp_sg_workarea sg_wa; |
| 367 | struct ccp_dm_workarea dm_wa; |
| 368 | }; |
| 369 | |
| 370 | struct ccp_mem { |
| 371 | enum ccp_memtype type; |
| 372 | union { |
| 373 | struct ccp_dma_info dma; |
| 374 | u32 ksb; |
| 375 | } u; |
| 376 | }; |
| 377 | |
| 378 | struct ccp_aes_op { |
| 379 | enum ccp_aes_type type; |
| 380 | enum ccp_aes_mode mode; |
| 381 | enum ccp_aes_action action; |
| 382 | }; |
| 383 | |
| 384 | struct ccp_xts_aes_op { |
| 385 | enum ccp_aes_action action; |
| 386 | enum ccp_xts_aes_unit_size unit_size; |
| 387 | }; |
| 388 | |
| 389 | struct ccp_sha_op { |
| 390 | enum ccp_sha_type type; |
| 391 | u64 msg_bits; |
| 392 | }; |
| 393 | |
| 394 | struct ccp_rsa_op { |
| 395 | u32 mod_size; |
| 396 | u32 input_len; |
| 397 | }; |
| 398 | |
| 399 | struct ccp_passthru_op { |
| 400 | enum ccp_passthru_bitwise bit_mod; |
| 401 | enum ccp_passthru_byteswap byte_swap; |
| 402 | }; |
| 403 | |
| 404 | struct ccp_ecc_op { |
| 405 | enum ccp_ecc_function function; |
| 406 | }; |
| 407 | |
| 408 | struct ccp_op { |
| 409 | struct ccp_cmd_queue *cmd_q; |
| 410 | |
| 411 | u32 jobid; |
| 412 | u32 ioc; |
| 413 | u32 soc; |
| 414 | u32 ksb_key; |
| 415 | u32 ksb_ctx; |
| 416 | u32 init; |
| 417 | u32 eom; |
| 418 | |
| 419 | struct ccp_mem src; |
| 420 | struct ccp_mem dst; |
| 421 | |
| 422 | union { |
| 423 | struct ccp_aes_op aes; |
| 424 | struct ccp_xts_aes_op xts; |
| 425 | struct ccp_sha_op sha; |
| 426 | struct ccp_rsa_op rsa; |
| 427 | struct ccp_passthru_op passthru; |
| 428 | struct ccp_ecc_op ecc; |
| 429 | } u; |
| 430 | }; |
| 431 | |
| 432 | static inline u32 ccp_addr_lo(struct ccp_dma_info *info) |
| 433 | { |
| 434 | return lower_32_bits(info->address + info->offset); |
| 435 | } |
| 436 | |
| 437 | static inline u32 ccp_addr_hi(struct ccp_dma_info *info) |
| 438 | { |
| 439 | return upper_32_bits(info->address + info->offset) & 0x0000ffff; |
| 440 | } |
| 441 | |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 442 | int ccp_pci_init(void); |
| 443 | void ccp_pci_exit(void); |
| 444 | |
Tom Lendacky | c4f4b32 | 2014-06-05 10:17:57 -0500 | [diff] [blame] | 445 | int ccp_platform_init(void); |
| 446 | void ccp_platform_exit(void); |
| 447 | |
Gary R Hook | ea0375a | 2016-03-01 13:49:25 -0600 | [diff] [blame] | 448 | void ccp_add_device(struct ccp_device *ccp); |
| 449 | void ccp_del_device(struct ccp_device *ccp); |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 450 | |
Gary R Hook | ea0375a | 2016-03-01 13:49:25 -0600 | [diff] [blame] | 451 | struct ccp_device *ccp_alloc_struct(struct device *dev); |
| 452 | bool ccp_queues_suspended(struct ccp_device *ccp); |
| 453 | int ccp_cmd_queue_thread(void *data); |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 454 | |
| 455 | int ccp_run_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd); |
| 456 | |
Gary R Hook | 58ea8ab | 2016-04-18 09:21:44 -0500 | [diff] [blame] | 457 | int ccp_dmaengine_register(struct ccp_device *ccp); |
| 458 | void ccp_dmaengine_unregister(struct ccp_device *ccp); |
| 459 | |
Tom Lendacky | 63b9450 | 2013-11-12 11:46:16 -0600 | [diff] [blame] | 460 | #endif |