]> CyberLeo.Net >> Repos - FreeBSD/releng/8.2.git/blob - sys/contrib/octeon-sdk/cvmx-compactflash.h
Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.
[FreeBSD/releng/8.2.git] / sys / contrib / octeon-sdk / cvmx-compactflash.h
1 /***********************license start***************
2  *  Copyright (c) 2008 Cavium Networks (support@cavium.com). All rights
3  *  reserved.
4  *
5  *
6  *  Redistribution and use in source and binary forms, with or without
7  *  modification, are permitted provided that the following conditions are
8  *  met:
9  *
10  *      * Redistributions of source code must retain the above copyright
11  *        notice, this list of conditions and the following disclaimer.
12  *
13  *      * Redistributions in binary form must reproduce the above
14  *        copyright notice, this list of conditions and the following
15  *        disclaimer in the documentation and/or other materials provided
16  *        with the distribution.
17  *
18  *      * Neither the name of Cavium Networks nor the names of
19  *        its contributors may be used to endorse or promote products
20  *        derived from this software without specific prior written
21  *        permission.
22  *
23  *  TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
24  *  AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS
25  *  OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
26  *  RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY
27  *  REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT
28  *  DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES
29  *  OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR
30  *  PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET
31  *  POSSESSION OR CORRESPONDENCE TO DESCRIPTION.  THE ENTIRE RISK ARISING OUT
32  *  OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
33  *
34  *
35  *  For any questions regarding licensing please contact marketing@caviumnetworks.com
36  *
37  ***********************license end**************************************/
38
39
40
41 #ifndef __CVMX_COMPACTFLASH_H__
42 #define __CVMX_COMPACTFLASH_H__
43 #ifdef  __cplusplus
44 extern "C" {
45 #endif
46
47
48 /**
49  * This function takes values from the compact flash device
50  * identify response, and returns the appropriate value to write
51  * into the boot bus DMA timing register.
52  *
53  * @param tim_mult   Eclock timing multiple to use
54  * @param ident_data Data returned by the 'identify' command.  This is used to
55  *                   determine the DMA modes supported by the card, if any.
56  * @param mwdma_mode_ptr
57  *                   Optional pointer to return MWDMA mode in
58  *
59  * @return 64 bit value to write to DMA timing register
60  */
61 extern uint64_t cvmx_compactflash_generate_dma_tim(int tim_mult, uint16_t *ident_data, int *mwdma_mode_ptr);
62
63 /**
64  * Setup timing and region config to support a specific IDE PIO
65  * mode over the bootbus.
66  *
67  * @param cs0      Bootbus region number connected to CS0 on the IDE device
68  * @param cs1      Bootbus region number connected to CS1 on the IDE device
69  * @param pio_mode PIO mode to set (0-6)
70  */
71 extern void cvmx_compactflash_set_piomode(int cs0, int cs1, int pio_mode);
72
73 #ifdef  __cplusplus
74 }
75 #endif
76 #endif   /* __CVMX_COMPACTFLASH_H__ */