/* * Copyright (C) 2008 Apple Inc. All rights reserved. * * This document is the property of Apple Inc. * It is considered confidential and proprietary. * * This document may not be reproduced or transmitted in any form, * in whole or in part, without the express written permission of * Apple Inc. */ #ifndef _IOKIT_APPLES5L8900XPKE_HARDWARE_H #define _IOKIT_APPLES5L8900XPKE_HARDWARE_H #define IN_KERNEL 0 #if IN_KERNEL #include #endif struct pke_regs { uint32_t pke_key_len; // 0x000 #define S5L8900XPKE_key_len(_precision, _chunk_size) (((_precision) & 0x03) | ((((_chunk_size) / 32) & 0x0f) << 3)) uint32_t pad004; // 0x004 uint32_t pke_start; // 0x008 #define S5L8900XPKE_exec_on (1<<0) #define S5L8900XPKE_pldm_on (1<<3) uint32_t pke_seg_id; // 0x00c #define S5L8900XPKE_seg_ids(_a, _b, _m, _s) (((_a) << 24 ) | ((_b) << 16) | ((_m) << 8) | (_s)) uint32_t pke_seg_sign; // 0x010 uint32_t pke_seg_size; // 0x014 #define S5L8900XPKE_func_id (1<<0) #define S5L8900XPKE_seg_256 (0x00 << 6) #define S5L8900XPKE_seg_128 (0x01 << 6) #define S5L8900XPKE_seg_64 (0x02 << 6) uint32_t pke_intmode; // 0x018 #define S5L8900XPKE_interrupt (1<<0) uint32_t pke_int; // 0x01c #define S5L8900XPKE_end_int (1<<0) uint32_t pke_int_mask; // 0x020 #define S5L8900XPKE_end_mask (1<<0) uint32_t pke_sw_reset; #define S5L8900XPKE_reset (1<<0) }; /* ========================================================================= */ /* D E F I N E S */ /* ========================================================================= */ #define kIOPKEAcceleratorComputeRsquareMask 0x10 #define kIOPKEAcceleratorCacheRsquare 0x01 #define kIOPKEAcceleratorPreProcessingDone 0x100 #define kIOPKEMaxBits 2048 #define kIOPKEUserDataEndianessMask (1<<7) /** \define * definition of data format size */ #define DATA_WORD_TO_BYTE 4 /*4BYTE=1WORD*/ #define DATA_BYTE_TO_BIT 8 /*1BYTE=8BIT*/ #define DATA_SHIFT_FOR_256 8 /*2^8=256*/ #define DATA_SHIFT_FOR_128 7 /*2^7=128*/ #define DATA_SHIFT_FOR_64 6 /*2^6=64*/ #define PKE_REGSHIFT_KEY_LEN_CHNK_SZ 3 /** \define * definition of PKE precision size */ #define PKE_SIZE_PREC_0 0 /*single*/ #define PKE_SIZE_PREC_1 1 #define PKE_SIZE_PREC_2 2 #define PKE_SIZE_PREC_3 3 /** \define * definition of PKE key bit length */ #define PKE_LEN_BIT_128 128 /* min size of bit length*/ #define PKE_LEN_BIT_512 512 #define PKE_LEN_BIT_672 672 #define PKE_LEN_BIT_864 864 #define PKE_LEN_BIT_1024 1024 #define PKE_LEN_BIT_1280 1280 #define PKE_LEN_BIT_1408 1408 #define PKE_LEN_BIT_1536 1536 #define PKE_LEN_BIT_2048 2048 /*max size of bit length*/ /** \define * definition of PKE Segment Size */ #define PKE_SEG_SIZE_256 (1<