SimpleVOut  1.0.0 Initial
A Simple FPGA Core for Creating VGA/DVI/HDMI/OpenLDI Signals
ps7_init_gpl.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Copyright (C) 2010-2020 <Xilinx Inc.>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, see <http://www.gnu.org/licenses/>
17 *
18 *
19 ******************************************************************************/
20 /****************************************************************************/
21 /**
22 *
23 * @file ps7_init_gpl.h
24 *
25 * This file can be included in FSBL code
26 * to get prototype of ps7_init() function
27 * and error codes
28 *
29 *****************************************************************************/
30 
31 
32 
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 
39 //typedef unsigned int u32;
40 
41 
42 /** do we need to make this name more unique ? **/
43 //extern u32 ps7_init_data[];
44 extern unsigned long * ps7_ddr_init_data;
45 extern unsigned long * ps7_mio_init_data;
46 extern unsigned long * ps7_pll_init_data;
47 extern unsigned long * ps7_clock_init_data;
48 extern unsigned long * ps7_peripherals_init_data;
49 
50 
51 
52 #define OPCODE_EXIT 0U
53 #define OPCODE_CLEAR 1U
54 #define OPCODE_WRITE 2U
55 #define OPCODE_MASKWRITE 3U
56 #define OPCODE_MASKPOLL 4U
57 #define OPCODE_MASKDELAY 5U
58 #define NEW_PS7_ERR_CODE 1
59 
60 /* Encode number of arguments in last nibble */
61 #define EMIT_EXIT() ( (OPCODE_EXIT << 4 ) | 0 )
62 #define EMIT_CLEAR(addr) ( (OPCODE_CLEAR << 4 ) | 1 ) , addr
63 #define EMIT_WRITE(addr,val) ( (OPCODE_WRITE << 4 ) | 2 ) , addr, val
64 #define EMIT_MASKWRITE(addr,mask,val) ( (OPCODE_MASKWRITE << 4 ) | 3 ) , addr, mask, val
65 #define EMIT_MASKPOLL(addr,mask) ( (OPCODE_MASKPOLL << 4 ) | 2 ) , addr, mask
66 #define EMIT_MASKDELAY(addr,mask) ( (OPCODE_MASKDELAY << 4 ) | 2 ) , addr, mask
67 
68 /* Returns codes of PS7_Init */
69 #define PS7_INIT_SUCCESS (0) // 0 is success in good old C
70 #define PS7_INIT_CORRUPT (1) // 1 the data is corrupted, and slcr reg are in corrupted state now
71 #define PS7_INIT_TIMEOUT (2) // 2 when a poll operation timed out
72 #define PS7_POLL_FAILED_DDR_INIT (3) // 3 when a poll operation timed out for ddr init
73 #define PS7_POLL_FAILED_DMA (4) // 4 when a poll operation timed out for dma done bit
74 #define PS7_POLL_FAILED_PLL (5) // 5 when a poll operation timed out for pll sequence init
75 
76 
77 /* Silicon Versions */
78 #define PCW_SILICON_VERSION_1 0
79 #define PCW_SILICON_VERSION_2 1
80 #define PCW_SILICON_VERSION_3 2
81 
82 /* This flag to be used by FSBL to check whether ps7_post_config() proc exixts */
83 #define PS7_POST_CONFIG
84 
85 /* Freq of all peripherals */
86 
87 #define APU_FREQ 666666687
88 #define DDR_FREQ 533333374
89 #define DCI_FREQ 10158730
90 #define QSPI_FREQ 10000000
91 #define SMC_FREQ 100000000
92 #define ENET0_FREQ 25000000
93 #define ENET1_FREQ 10000000
94 #define USB0_FREQ 60000000
95 #define USB1_FREQ 60000000
96 #define SDIO_FREQ 100000000
97 #define UART_FREQ 100000000
98 #define SPI_FREQ 10000000
99 #define I2C_FREQ 111111115
100 #define WDT_FREQ 111111115
101 #define TTC_FREQ 50000000
102 #define CAN_FREQ 10000000
103 #define PCAP_FREQ 200000000
104 #define TPIU_FREQ 200000000
105 #define FPGA0_FREQ 125000000
106 #define FPGA1_FREQ 25000000
107 #define FPGA2_FREQ 33333336
108 #define FPGA3_FREQ 100000000
109 
110 
111 /* For delay calculation using global registers*/
112 #define SCU_GLOBAL_TIMER_COUNT_L32 0xF8F00200
113 #define SCU_GLOBAL_TIMER_COUNT_U32 0xF8F00204
114 #define SCU_GLOBAL_TIMER_CONTROL 0xF8F00208
115 #define SCU_GLOBAL_TIMER_AUTO_INC 0xF8F00218
116 
117 int ps7_config( unsigned long*);
118 int ps7_init();
119 int ps7_post_config();
120 int ps7_debug();
121 char* getPS7MessageInfo(unsigned key);
122 
123 void perf_start_clock(void);
124 void perf_disable_clock(void);
125 void perf_reset_clock(void);
127 int get_number_of_cycles_for_delay(unsigned int delay);
128 #ifdef __cplusplus
129 }
130 #endif
131 
get_number_of_cycles_for_delay
int get_number_of_cycles_for_delay(unsigned int delay)
Definition: ps7_init.c:12325
perf_reset_and_start_timer
void perf_reset_and_start_timer()
Definition: ps7_init.c:12338
getPS7MessageInfo
char * getPS7MessageInfo(unsigned key)
Definition: ps7_init.c:12066
perf_reset_clock
void perf_reset_clock(void)
Definition: ps7_init.c:12317
ps7_debug
int ps7_debug()
Definition: ps7_init.c:12225
ps7_peripherals_init_data
unsigned long * ps7_peripherals_init_data
Definition: ps7_init.c:12203
ps7_clock_init_data
unsigned long * ps7_clock_init_data
Definition: ps7_init.c:12201
ps7_mio_init_data
unsigned long * ps7_mio_init_data
Definition: ps7_init.c:12199
ps7_ddr_init_data
unsigned long * ps7_ddr_init_data
do we need to make this name more unique ?
Definition: ps7_init.c:12202
ps7_config
int ps7_config(unsigned long *)
Definition: ps7_init.c:12121
ps7_post_config
int ps7_post_config()
Definition: ps7_init.c:12206
perf_start_clock
void perf_start_clock(void)
Definition: ps7_init.c:12308
ps7_pll_init_data
unsigned long * ps7_pll_init_data
Definition: ps7_init.c:12200
ps7_init
int ps7_init()
Definition: ps7_init.c:12245
perf_disable_clock
void perf_disable_clock(void)
Definition: ps7_init.c:12333