xref: /rk3399_rockchip-uboot/board/freescale/c29xpcie/cpld.h (revision b98d934128bcd98106e764d2f492ac79c38ae53d)
1a8d9758dSMingkai Hu /**
2a8d9758dSMingkai Hu  * Copyright 2013 Freescale Semiconductor
3a8d9758dSMingkai Hu  * Author: Mingkai Hu <Mingkai.Hu@freescale.com>
4a8d9758dSMingkai Hu  *         Po Liu <Po.Liu@freescale.com>
5a8d9758dSMingkai Hu  *
6*3aab0cd8SYork Sun  * SPDX-License-Identifier:	GPL-2.0+
7a8d9758dSMingkai Hu  *
8a8d9758dSMingkai Hu  * This file provides support for the ngPIXIS, a board-specific FPGA used on
9a8d9758dSMingkai Hu  * some Freescale reference boards.
10a8d9758dSMingkai Hu  */
11a8d9758dSMingkai Hu 
12a8d9758dSMingkai Hu /*
13a8d9758dSMingkai Hu  * CPLD register set. Feel free to add board-specific #ifdefs where necessary.
14a8d9758dSMingkai Hu  */
15a8d9758dSMingkai Hu struct cpld_data {
16a8d9758dSMingkai Hu 	u8 chipid1;	/* 0x0 - CPLD Chip ID1 Register */
17a8d9758dSMingkai Hu 	u8 chipid2;	/* 0x1 - CPLD Chip ID2 Register */
18a8d9758dSMingkai Hu 	u8 hwver;	/* 0x2 - Hardware Version Register */
19a8d9758dSMingkai Hu 	u8 cpldver;	/* 0x3 - Software Version Register */
20a8d9758dSMingkai Hu 	u8 res[12];
21a8d9758dSMingkai Hu 	u8 rstcon;	/* 0x10 - Reset control register */
22a8d9758dSMingkai Hu 	u8 flhcsr;	/* 0x11 - Flash control and status Register */
23a8d9758dSMingkai Hu 	u8 wdcsr;	/* 0x12 - Watchdog control and status Register */
24a8d9758dSMingkai Hu 	u8 wdkick;	/* 0x13 - Watchdog kick Register */
25a8d9758dSMingkai Hu 	u8 fancsr;	/* 0x14 - Fan control and status Register */
26a8d9758dSMingkai Hu 	u8 ledcsr;	/* 0x15 - LED control and status Register */
27a8d9758dSMingkai Hu 	u8 misccsr;	/* 0x16 - Misc control and status Register */
28a8d9758dSMingkai Hu 	u8 bootor;	/* 0x17 - Boot configure override Register */
29a8d9758dSMingkai Hu 	u8 bootcfg1;	/* 0x18 - Boot configure 1 Register */
30a8d9758dSMingkai Hu 	u8 bootcfg2;	/* 0x19 - Boot configure 2 Register */
31a8d9758dSMingkai Hu 	u8 bootcfg3;	/* 0x1a - Boot configure 3 Register */
32a8d9758dSMingkai Hu 	u8 bootcfg4;	/* 0x1b - Boot configure 4 Register */
33a8d9758dSMingkai Hu };
34a8d9758dSMingkai Hu 
35a8d9758dSMingkai Hu #define CPLD_BANKSEL_EN		0x02
36a8d9758dSMingkai Hu #define CPLD_BANKSEL_MASK	0x3f
37a8d9758dSMingkai Hu #define CPLD_SELECT_BANK1	0xc0
38a8d9758dSMingkai Hu #define CPLD_SELECT_BANK2	0x80
39a8d9758dSMingkai Hu #define CPLD_SELECT_BANK3	0x40
40a8d9758dSMingkai Hu #define CPLD_SELECT_BANK4	0x00
41