SimpleVOut  1.0.0 Initial
A Simple FPGA Core for Creating VGA/DVI/HDMI/OpenLDI Signals
ps7_init.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Copyright (C) 2010-2020 Xilinx, Inc. All rights reserved.
4 * SPDX-License-Identifier: MIT
5 ******************************************************************************/
6 /****************************************************************************/
7 /**
8 *
9 * @file ps7_init.h
10 *
11 * This file can be included in FSBL code
12 * to get prototype of ps7_init() function
13 * and error codes
14 *
15 *****************************************************************************/
16 
17 
18 
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 
25 //typedef unsigned int u32;
26 
27 
28 /** do we need to make this name more unique ? **/
29 //extern u32 ps7_init_data[];
30 extern unsigned long * ps7_ddr_init_data;
31 extern unsigned long * ps7_mio_init_data;
32 extern unsigned long * ps7_pll_init_data;
33 extern unsigned long * ps7_clock_init_data;
34 extern unsigned long * ps7_peripherals_init_data;
35 
36 
37 
38 #define OPCODE_EXIT 0U
39 #define OPCODE_CLEAR 1U
40 #define OPCODE_WRITE 2U
41 #define OPCODE_MASKWRITE 3U
42 #define OPCODE_MASKPOLL 4U
43 #define OPCODE_MASKDELAY 5U
44 #define NEW_PS7_ERR_CODE 1
45 
46 /* Encode number of arguments in last nibble */
47 #define EMIT_EXIT() ( (OPCODE_EXIT << 4 ) | 0 )
48 #define EMIT_CLEAR(addr) ( (OPCODE_CLEAR << 4 ) | 1 ) , addr
49 #define EMIT_WRITE(addr,val) ( (OPCODE_WRITE << 4 ) | 2 ) , addr, val
50 #define EMIT_MASKWRITE(addr,mask,val) ( (OPCODE_MASKWRITE << 4 ) | 3 ) , addr, mask, val
51 #define EMIT_MASKPOLL(addr,mask) ( (OPCODE_MASKPOLL << 4 ) | 2 ) , addr, mask
52 #define EMIT_MASKDELAY(addr,mask) ( (OPCODE_MASKDELAY << 4 ) | 2 ) , addr, mask
53 
54 /* Returns codes of PS7_Init */
55 #define PS7_INIT_SUCCESS (0) // 0 is success in good old C
56 #define PS7_INIT_CORRUPT (1) // 1 the data is corrupted, and slcr reg are in corrupted state now
57 #define PS7_INIT_TIMEOUT (2) // 2 when a poll operation timed out
58 #define PS7_POLL_FAILED_DDR_INIT (3) // 3 when a poll operation timed out for ddr init
59 #define PS7_POLL_FAILED_DMA (4) // 4 when a poll operation timed out for dma done bit
60 #define PS7_POLL_FAILED_PLL (5) // 5 when a poll operation timed out for pll sequence init
61 
62 
63 /* Silicon Versions */
64 #define PCW_SILICON_VERSION_1 0
65 #define PCW_SILICON_VERSION_2 1
66 #define PCW_SILICON_VERSION_3 2
67 
68 /* This flag to be used by FSBL to check whether ps7_post_config() proc exixts */
69 #define PS7_POST_CONFIG
70 
71 /* Freq of all peripherals */
72 
73 #define APU_FREQ 666666687
74 #define DDR_FREQ 533333374
75 #define DCI_FREQ 10158730
76 #define QSPI_FREQ 10000000
77 #define SMC_FREQ 100000000
78 #define ENET0_FREQ 25000000
79 #define ENET1_FREQ 10000000
80 #define USB0_FREQ 60000000
81 #define USB1_FREQ 60000000
82 #define SDIO_FREQ 100000000
83 #define UART_FREQ 100000000
84 #define SPI_FREQ 10000000
85 #define I2C_FREQ 111111115
86 #define WDT_FREQ 111111115
87 #define TTC_FREQ 50000000
88 #define CAN_FREQ 10000000
89 #define PCAP_FREQ 200000000
90 #define TPIU_FREQ 200000000
91 #define FPGA0_FREQ 125000000
92 #define FPGA1_FREQ 25000000
93 #define FPGA2_FREQ 33333336
94 #define FPGA3_FREQ 100000000
95 
96 
97 /* For delay calculation using global registers*/
98 #define SCU_GLOBAL_TIMER_COUNT_L32 0xF8F00200
99 #define SCU_GLOBAL_TIMER_COUNT_U32 0xF8F00204
100 #define SCU_GLOBAL_TIMER_CONTROL 0xF8F00208
101 #define SCU_GLOBAL_TIMER_AUTO_INC 0xF8F00218
102 
103 int ps7_config( unsigned long*);
104 int ps7_init();
105 int ps7_post_config();
106 int ps7_debug();
107 char* getPS7MessageInfo(unsigned key);
108 
109 void perf_start_clock(void);
110 void perf_disable_clock(void);
111 void perf_reset_clock(void);
113 int get_number_of_cycles_for_delay(unsigned int delay);
114 #ifdef __cplusplus
115 }
116 #endif
117 
ps7_config
int ps7_config(unsigned long *)
Definition: ps7_init.c:12121
ps7_post_config
int ps7_post_config()
Definition: ps7_init.c:12206
ps7_mio_init_data
unsigned long * ps7_mio_init_data
Definition: ps7_init.c:12199
perf_reset_clock
void perf_reset_clock(void)
Definition: ps7_init.c:12317
get_number_of_cycles_for_delay
int get_number_of_cycles_for_delay(unsigned int delay)
Definition: ps7_init.c:12325
perf_start_clock
void perf_start_clock(void)
Definition: ps7_init.c:12308
ps7_ddr_init_data
unsigned long * ps7_ddr_init_data
do we need to make this name more unique ?
Definition: ps7_init.c:12202
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
ps7_peripherals_init_data
unsigned long * ps7_peripherals_init_data
Definition: ps7_init.c:12203
ps7_init
int ps7_init()
Definition: ps7_init.c:12245
ps7_pll_init_data
unsigned long * ps7_pll_init_data
Definition: ps7_init.c:12200
perf_disable_clock
void perf_disable_clock(void)
Definition: ps7_init.c:12333
ps7_debug
int ps7_debug()
Definition: ps7_init.c:12225
ps7_clock_init_data
unsigned long * ps7_clock_init_data
Definition: ps7_init.c:12201