cc_driver.c (aca24d48cee232a88839c8895ac6fcd2fcad6588) | cc_driver.c (e6e6600c001c3aa3760aeb83dbd4630063e926ee) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* Copyright (C) 2012-2019 ARM Limited or its affiliates. */ 3 4#include <linux/kernel.h> 5#include <linux/module.h> 6 7#include <linux/crypto.h> 8#include <linux/moduleparam.h> --- 8 unchanged lines hidden (view full) --- 17 18#include "cc_driver.h" 19#include "cc_request_mgr.h" 20#include "cc_buffer_mgr.h" 21#include "cc_debugfs.h" 22#include "cc_cipher.h" 23#include "cc_aead.h" 24#include "cc_hash.h" | 1// SPDX-License-Identifier: GPL-2.0 2/* Copyright (C) 2012-2019 ARM Limited or its affiliates. */ 3 4#include <linux/kernel.h> 5#include <linux/module.h> 6 7#include <linux/crypto.h> 8#include <linux/moduleparam.h> --- 8 unchanged lines hidden (view full) --- 17 18#include "cc_driver.h" 19#include "cc_request_mgr.h" 20#include "cc_buffer_mgr.h" 21#include "cc_debugfs.h" 22#include "cc_cipher.h" 23#include "cc_aead.h" 24#include "cc_hash.h" |
25#include "cc_ivgen.h" | |
26#include "cc_sram_mgr.h" 27#include "cc_pm.h" 28#include "cc_fips.h" 29 30bool cc_dump_desc; 31module_param_named(dump_desc, cc_dump_desc, bool, 0600); 32MODULE_PARM_DESC(cc_dump_desc, "Dump descriptors to kernel log as debugging aid"); 33bool cc_dump_bytes; --- 464 unchanged lines hidden (view full) --- 498 } 499 500 rc = cc_pm_init(new_drvdata); 501 if (rc) { 502 dev_err(dev, "ssi_power_mgr_init failed\n"); 503 goto post_buf_mgr_err; 504 } 505 | 25#include "cc_sram_mgr.h" 26#include "cc_pm.h" 27#include "cc_fips.h" 28 29bool cc_dump_desc; 30module_param_named(dump_desc, cc_dump_desc, bool, 0600); 31MODULE_PARM_DESC(cc_dump_desc, "Dump descriptors to kernel log as debugging aid"); 32bool cc_dump_bytes; --- 464 unchanged lines hidden (view full) --- 497 } 498 499 rc = cc_pm_init(new_drvdata); 500 if (rc) { 501 dev_err(dev, "ssi_power_mgr_init failed\n"); 502 goto post_buf_mgr_err; 503 } 504 |
506 rc = cc_ivgen_init(new_drvdata); 507 if (rc) { 508 dev_err(dev, "cc_ivgen_init failed\n"); 509 goto post_buf_mgr_err; 510 } 511 | |
512 /* Allocate crypto algs */ 513 rc = cc_cipher_alloc(new_drvdata); 514 if (rc) { 515 dev_err(dev, "cc_cipher_alloc failed\n"); | 505 /* Allocate crypto algs */ 506 rc = cc_cipher_alloc(new_drvdata); 507 if (rc) { 508 dev_err(dev, "cc_cipher_alloc failed\n"); |
516 goto post_ivgen_err; | 509 goto post_buf_mgr_err; |
517 } 518 519 /* hash must be allocated before aead since hash exports APIs */ 520 rc = cc_hash_alloc(new_drvdata); 521 if (rc) { 522 dev_err(dev, "cc_hash_alloc failed\n"); 523 goto post_cipher_err; 524 } --- 14 unchanged lines hidden (view full) --- 539 cc_set_ree_fips_status(new_drvdata, true); 540 541 return 0; 542 543post_hash_err: 544 cc_hash_free(new_drvdata); 545post_cipher_err: 546 cc_cipher_free(new_drvdata); | 510 } 511 512 /* hash must be allocated before aead since hash exports APIs */ 513 rc = cc_hash_alloc(new_drvdata); 514 if (rc) { 515 dev_err(dev, "cc_hash_alloc failed\n"); 516 goto post_cipher_err; 517 } --- 14 unchanged lines hidden (view full) --- 532 cc_set_ree_fips_status(new_drvdata, true); 533 534 return 0; 535 536post_hash_err: 537 cc_hash_free(new_drvdata); 538post_cipher_err: 539 cc_cipher_free(new_drvdata); |
547post_ivgen_err: 548 cc_ivgen_fini(new_drvdata); | |
549post_buf_mgr_err: 550 cc_buffer_mgr_fini(new_drvdata); 551post_req_mgr_err: 552 cc_req_mgr_fini(new_drvdata); 553post_sram_mgr_err: 554 cc_sram_mgr_fini(new_drvdata); 555post_fips_init_err: 556 cc_fips_fini(new_drvdata); --- 15 unchanged lines hidden (view full) --- 572static void cleanup_cc_resources(struct platform_device *plat_dev) 573{ 574 struct cc_drvdata *drvdata = 575 (struct cc_drvdata *)platform_get_drvdata(plat_dev); 576 577 cc_aead_free(drvdata); 578 cc_hash_free(drvdata); 579 cc_cipher_free(drvdata); | 540post_buf_mgr_err: 541 cc_buffer_mgr_fini(new_drvdata); 542post_req_mgr_err: 543 cc_req_mgr_fini(new_drvdata); 544post_sram_mgr_err: 545 cc_sram_mgr_fini(new_drvdata); 546post_fips_init_err: 547 cc_fips_fini(new_drvdata); --- 15 unchanged lines hidden (view full) --- 563static void cleanup_cc_resources(struct platform_device *plat_dev) 564{ 565 struct cc_drvdata *drvdata = 566 (struct cc_drvdata *)platform_get_drvdata(plat_dev); 567 568 cc_aead_free(drvdata); 569 cc_hash_free(drvdata); 570 cc_cipher_free(drvdata); |
580 cc_ivgen_fini(drvdata); | |
581 cc_pm_fini(drvdata); 582 cc_buffer_mgr_fini(drvdata); 583 cc_req_mgr_fini(drvdata); 584 cc_sram_mgr_fini(drvdata); 585 cc_fips_fini(drvdata); 586 cc_debugfs_fini(drvdata); 587 fini_cc_regs(drvdata); 588 cc_clk_off(drvdata); --- 98 unchanged lines hidden --- | 571 cc_pm_fini(drvdata); 572 cc_buffer_mgr_fini(drvdata); 573 cc_req_mgr_fini(drvdata); 574 cc_sram_mgr_fini(drvdata); 575 cc_fips_fini(drvdata); 576 cc_debugfs_fini(drvdata); 577 fini_cc_regs(drvdata); 578 cc_clk_off(drvdata); --- 98 unchanged lines hidden --- |