Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
0004  *
0005  *  Support functions for calculating clocks/divisors for the ICST
0006  *  clock generators.  See https://www.idt.com/ for more information
0007  *  on these devices.
0008  */
0009 #ifndef ICST_H
0010 #define ICST_H
0011 
0012 struct icst_params {
0013     unsigned long   ref;
0014     unsigned long   vco_max;    /* inclusive */
0015     unsigned long   vco_min;    /* exclusive */
0016     unsigned short  vd_min;     /* inclusive */
0017     unsigned short  vd_max;     /* inclusive */
0018     unsigned char   rd_min;     /* inclusive */
0019     unsigned char   rd_max;     /* inclusive */
0020     const unsigned char *s2div; /* chip specific s2div array */
0021     const unsigned char *idx2s; /* chip specific idx2s array */
0022 };
0023 
0024 struct icst_vco {
0025     unsigned short  v;
0026     unsigned char   r;
0027     unsigned char   s;
0028 };
0029 
0030 unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco);
0031 struct icst_vco icst_hz_to_vco(const struct icst_params *p, unsigned long freq);
0032 
0033 /*
0034  * ICST307 VCO frequency must be between 6MHz and 200MHz (3.3 or 5V).
0035  * This frequency is pre-output divider.
0036  */
0037 #define ICST307_VCO_MIN 6000000
0038 #define ICST307_VCO_MAX 200000000
0039 
0040 extern const unsigned char icst307_s2div[];
0041 extern const unsigned char icst307_idx2s[];
0042 
0043 /*
0044  * ICST525 VCO frequency must be between 10MHz and 200MHz (3V) or 320MHz (5V).
0045  * This frequency is pre-output divider.
0046  */
0047 #define ICST525_VCO_MIN     10000000
0048 #define ICST525_VCO_MAX_3V  200000000
0049 #define ICST525_VCO_MAX_5V  320000000
0050 
0051 extern const unsigned char icst525_s2div[];
0052 extern const unsigned char icst525_idx2s[];
0053 
0054 #endif