/* Set up params for h/w CRYPTO_ENGINE. */ void target_crypto_init_params() { struct crypto_init_params ce_params; /* Set up base addresses and instance. */ ce_params.crypto_instance = CRYPTO_ENGINE_INSTANCE; ce_params.crypto_base = MSM_CE1_BASE; ce_params.bam_base = MSM_CE1_BAM_BASE; /* Set up BAM config. */ ce_params.bam_ee = CRYPTO_ENGINE_EE; ce_params.pipes.read_pipe = CRYPTO_ENGINE_READ_PIPE; ce_params.pipes.write_pipe = CRYPTO_ENGINE_WRITE_PIPE; ce_params.pipes.read_pipe_grp = CRYPTO_READ_PIPE_LOCK_GRP; ce_params.pipes.write_pipe_grp = CRYPTO_WRITE_PIPE_LOCK_GRP; /* Assign buffer sizes. */ ce_params.num_ce = CRYPTO_ENGINE_CMD_ARRAY_SIZE; ce_params.read_fifo_size = CRYPTO_ENGINE_FIFO_SIZE; ce_params.write_fifo_size = CRYPTO_ENGINE_FIFO_SIZE; ce_params.do_bam_init = 0; crypto_init_params(&ce_params); }
/* Set up params for h/w CE. */ void target_crypto_init_params() { struct crypto_init_params ce_params; /* Set up base addresses and instance. */ ce_params.crypto_instance = CE_INSTANCE; ce_params.crypto_base = MSM_CE2_BASE; ce_params.bam_base = MSM_CE2_BAM_BASE; /* Set up BAM config. */ ce_params.bam_ee = CE_EE; ce_params.pipes.read_pipe = CE_READ_PIPE; ce_params.pipes.write_pipe = CE_WRITE_PIPE; ce_params.pipes.read_pipe_grp = CE_READ_PIPE_LOCK_GRP; ce_params.pipes.write_pipe_grp = CE_WRITE_PIPE_LOCK_GRP; /* Assign buffer sizes. */ ce_params.num_ce = CE_ARRAY_SIZE; ce_params.read_fifo_size = CE_FIFO_SIZE; ce_params.write_fifo_size = CE_FIFO_SIZE; /* BAM is initialized by TZ for this platform. * Do not do it again as the initialization address space * is locked. */ ce_params.do_bam_init = 0; crypto_init_params(&ce_params); }