Kinetis Bootloader  2.0.0
Common bootloader for Kinetis devices
fpga_clock_registers.h
1 /*
2  * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without modification,
6  * are permitted provided that the following conditions are met:
7  *
8  * o Redistributions of source code must retain the above copyright notice, this list
9  * of conditions and the following disclaimer.
10  *
11  * o Redistributions in binary form must reproduce the above copyright notice, this
12  * list of conditions and the following disclaimer in the documentation and/or
13  * other materials provided with the distribution.
14  *
15  * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
16  * contributors may be used to endorse or promote products derived from this
17  * software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #if !defined(__FPGA_CLOCK_REGISTERS_H__)
32 #define __FPGA_CLOCK_REGISTERS_H__
33 
34 #define CY22393_ADDR 0x69
35 
36 // REG
37 #define CY22393_REG_CLKA_DIVIDE (0x08) // divsel:0
38 #define CY22393_REG_CLKB_DIVIDE (0x0A) // divsel:0
39 #define CY22393_REG_CLKC_DIVIDE (0x0C) // CLKC
40 #define CY22393_REG_CLKD_DIVIDE (0x0D) // CLKD
41 
42 #define CY22393_REG_SOURCE 0x0E
43 
44 #define CY22393_REG_AC 0x0F
45 #define CY22393_REG_DC 0x10
46 
47 #define CY22393_REG_CLKA_DIV 0x08
48 #define CY22393_REG_PLL3Q 0x14
49 #define CY22393_REG_PLL3P 0x15
50 #define CY22393_REG_PLL3E 0x16
51 
52 // This is the low register value of the lower bank
53 #define CY22393_REG_LOW 0x08
54 // This is the high register value of the high bank
55 #define CY22393_REG_HIGH 0x17
56 
57 #define CY22393_AC 0x55
58 #define CY22393_DC 0x55
59 
60 #define CY22393_DIVIDE_OFF 0 // close clk ouput
61 
62 // Maximum post div value when using VCO frequency above 333 MHZ
63 #define CY22393_POSTDIV_MAX_VAL 31
64 
65 // Reference clock to cypress chip
66 #define CY22393_REF_CLK 24000000
67 
68 // This is the minimum value that Reference divided by Q can be equal to
69 #define CY22393_MIN_REF_DIV_Q 250000
70 
71 // Max clock frequency the chip supports, for CY22393 it is 200Mhz
72 #define CY22393_MAX_OUTPUT_CLK 200000000
73 
74 // Max VCO clock frequency the chip supports, for CY22393 it is 375Mhz
75 #define CY22393_MAX_VCO_CLK 375000000
76 
77 #endif // __FPGA_CLOCK_REGISTERS_H__