atmel-i2c.c (c34a320176a59445d76783e5ee043d6ecd22d011) atmel-i2c.c (da001fb651b00e1deeaf24767dd691ae8152a4f5)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Microchip / Atmel ECC (I2C) driver.
4 *
5 * Copyright (c) 2017, Microchip Technology Inc.
6 * Author: Tudor Ambarus <tudor.ambarus@microchip.com>
7 */
8

--- 44 unchanged lines hidden (view full) ---

53
54 atmel_i2c_checksum(cmd);
55
56 cmd->msecs = MAX_EXEC_TIME_READ;
57 cmd->rxsize = READ_RSP_SIZE;
58}
59EXPORT_SYMBOL(atmel_i2c_init_read_cmd);
60
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Microchip / Atmel ECC (I2C) driver.
4 *
5 * Copyright (c) 2017, Microchip Technology Inc.
6 * Author: Tudor Ambarus <tudor.ambarus@microchip.com>
7 */
8

--- 44 unchanged lines hidden (view full) ---

53
54 atmel_i2c_checksum(cmd);
55
56 cmd->msecs = MAX_EXEC_TIME_READ;
57 cmd->rxsize = READ_RSP_SIZE;
58}
59EXPORT_SYMBOL(atmel_i2c_init_read_cmd);
60
61void atmel_i2c_init_random_cmd(struct atmel_i2c_cmd *cmd)
62{
63 cmd->word_addr = COMMAND;
64 cmd->opcode = OPCODE_RANDOM;
65 cmd->param1 = 0;
66 cmd->param2 = 0;
67 cmd->count = RANDOM_COUNT;
68
69 atmel_i2c_checksum(cmd);
70
71 cmd->msecs = MAX_EXEC_TIME_RANDOM;
72 cmd->rxsize = RANDOM_RSP_SIZE;
73}
74EXPORT_SYMBOL(atmel_i2c_init_random_cmd);
75
61void atmel_i2c_init_genkey_cmd(struct atmel_i2c_cmd *cmd, u16 keyid)
62{
63 cmd->word_addr = COMMAND;
64 cmd->count = GENKEY_COUNT;
65 cmd->opcode = OPCODE_GENKEY;
66 cmd->param1 = GENKEY_MODE_PRIVATE;
67 /* a random private key will be generated and stored in slot keyID */
68 cmd->param2 = cpu_to_le16(keyid);

--- 281 unchanged lines hidden ---
76void atmel_i2c_init_genkey_cmd(struct atmel_i2c_cmd *cmd, u16 keyid)
77{
78 cmd->word_addr = COMMAND;
79 cmd->count = GENKEY_COUNT;
80 cmd->opcode = OPCODE_GENKEY;
81 cmd->param1 = GENKEY_MODE_PRIVATE;
82 /* a random private key will be generated and stored in slot keyID */
83 cmd->param2 = cpu_to_le16(keyid);

--- 281 unchanged lines hidden ---