xref: /openbmc/linux/arch/arm/mach-orion5x/ts78xx-fpga.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2b3882330SAlexander Clouter #define TS7800_FPGA_MAGIC 0x00b480
339008f95SAlexander Clouter #define FPGAID(_magic, _rev) ((_magic << 8) + _rev)
439008f95SAlexander Clouter 
539008f95SAlexander Clouter /*
639008f95SAlexander Clouter  * get yer id's from http://ts78xx.digriz.org.uk/
739008f95SAlexander Clouter  * do *not* make up your own or 'borrow' any!
839008f95SAlexander Clouter  */
939008f95SAlexander Clouter enum fpga_ids {
1039008f95SAlexander Clouter 	/* Technologic Systems */
11b3882330SAlexander Clouter 	TS7800_REV_1	= FPGAID(TS7800_FPGA_MAGIC, 0x01),
12b3882330SAlexander Clouter 	TS7800_REV_2	= FPGAID(TS7800_FPGA_MAGIC, 0x02),
13b3882330SAlexander Clouter 	TS7800_REV_3	= FPGAID(TS7800_FPGA_MAGIC, 0x03),
14b3882330SAlexander Clouter 	TS7800_REV_4	= FPGAID(TS7800_FPGA_MAGIC, 0x04),
15b3882330SAlexander Clouter 	TS7800_REV_5	= FPGAID(TS7800_FPGA_MAGIC, 0x05),
16b3882330SAlexander Clouter 	TS7800_REV_6	= FPGAID(TS7800_FPGA_MAGIC, 0x06),
17b3882330SAlexander Clouter 	TS7800_REV_7	= FPGAID(TS7800_FPGA_MAGIC, 0x07),
18b3882330SAlexander Clouter 	TS7800_REV_8	= FPGAID(TS7800_FPGA_MAGIC, 0x08),
19b3882330SAlexander Clouter 	TS7800_REV_9	= FPGAID(TS7800_FPGA_MAGIC, 0x09),
200c1355e3SAlexander Clouter 
210c1355e3SAlexander Clouter 	/* Unaffordable & Expensive */
220c1355e3SAlexander Clouter 	UAE_DUMMY	= FPGAID(0xffffff, 0x01),
2339008f95SAlexander Clouter };
2439008f95SAlexander Clouter 
2539008f95SAlexander Clouter struct fpga_device {
2639008f95SAlexander Clouter 	unsigned		present:1;
2739008f95SAlexander Clouter 	unsigned		init:1;
2839008f95SAlexander Clouter };
2939008f95SAlexander Clouter 
3039008f95SAlexander Clouter struct fpga_devices {
3139008f95SAlexander Clouter 	/* Technologic Systems */
3239008f95SAlexander Clouter 	struct fpga_device	ts_rtc;
3375bb6b9aSAlexander Clouter 	struct fpga_device	ts_nand;
34a914d430SAlexander Clouter 	struct fpga_device	ts_rng;
3539008f95SAlexander Clouter };
3639008f95SAlexander Clouter 
3739008f95SAlexander Clouter struct ts78xx_fpga_data {
3839008f95SAlexander Clouter 	unsigned int		id;
3939008f95SAlexander Clouter 	int			state;
4039008f95SAlexander Clouter 
4139008f95SAlexander Clouter 	struct fpga_devices	supports;
4239008f95SAlexander Clouter };
43