2 /***********************license start***************
3 * Copyright (c) 2003-2010 Cavium Inc. (support@cavium.com). All rights
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer in the documentation and/or other materials provided
17 * with the distribution.
19 * * Neither the name of Cavium Inc. nor the names of
20 * its contributors may be used to endorse or promote products
21 * derived from this software without specific prior written
24 * This Software, including technical data, may be subject to U.S. export control
25 * laws, including the U.S. Export Administration Act and its associated
26 * regulations, and may be subject to export or import regulations in other
29 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
30 * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR
31 * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
32 * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
33 * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
34 * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
35 * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
36 * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
37 * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR
38 * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
39 ***********************license end**************************************/
45 * Helper utilities for enabling crypto.
47 * <hr>$Revision: $<hr>
49 #include "executive-config.h"
50 #include "cvmx-config.h"
53 int cvmx_crypto_dormant_enable(uint64_t key)
55 if (octeon_has_feature(OCTEON_FEATURE_CRYPTO))
58 if (octeon_has_feature(OCTEON_FEATURE_DORM_CRYPTO)) {
61 cvmx_write_csr(CVMX_RNM_EER_KEY, v.u64);
64 return octeon_has_feature(OCTEON_FEATURE_CRYPTO);
67 uint64_t cvmx_crypto_dormant_dbg(void)
69 cvmx_rnm_eer_dbg_t dbg;
71 if (!octeon_has_feature(OCTEON_FEATURE_DORM_CRYPTO))
74 dbg.u64 = cvmx_read_csr(CVMX_RNM_EER_DBG);