162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#define TS7800_FPGA_MAGIC 0x00b480
362306a36Sopenharmony_ci#define FPGAID(_magic, _rev) ((_magic << 8) + _rev)
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci/*
662306a36Sopenharmony_ci * get yer id's from http://ts78xx.digriz.org.uk/
762306a36Sopenharmony_ci * do *not* make up your own or 'borrow' any!
862306a36Sopenharmony_ci */
962306a36Sopenharmony_cienum fpga_ids {
1062306a36Sopenharmony_ci	/* Technologic Systems */
1162306a36Sopenharmony_ci	TS7800_REV_1	= FPGAID(TS7800_FPGA_MAGIC, 0x01),
1262306a36Sopenharmony_ci	TS7800_REV_2	= FPGAID(TS7800_FPGA_MAGIC, 0x02),
1362306a36Sopenharmony_ci	TS7800_REV_3	= FPGAID(TS7800_FPGA_MAGIC, 0x03),
1462306a36Sopenharmony_ci	TS7800_REV_4	= FPGAID(TS7800_FPGA_MAGIC, 0x04),
1562306a36Sopenharmony_ci	TS7800_REV_5	= FPGAID(TS7800_FPGA_MAGIC, 0x05),
1662306a36Sopenharmony_ci	TS7800_REV_6	= FPGAID(TS7800_FPGA_MAGIC, 0x06),
1762306a36Sopenharmony_ci	TS7800_REV_7	= FPGAID(TS7800_FPGA_MAGIC, 0x07),
1862306a36Sopenharmony_ci	TS7800_REV_8	= FPGAID(TS7800_FPGA_MAGIC, 0x08),
1962306a36Sopenharmony_ci	TS7800_REV_9	= FPGAID(TS7800_FPGA_MAGIC, 0x09),
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci	/* Unaffordable & Expensive */
2262306a36Sopenharmony_ci	UAE_DUMMY	= FPGAID(0xffffff, 0x01),
2362306a36Sopenharmony_ci};
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_cistruct fpga_device {
2662306a36Sopenharmony_ci	unsigned		present:1;
2762306a36Sopenharmony_ci	unsigned		init:1;
2862306a36Sopenharmony_ci};
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_cistruct fpga_devices {
3162306a36Sopenharmony_ci	/* Technologic Systems */
3262306a36Sopenharmony_ci	struct fpga_device	ts_rtc;
3362306a36Sopenharmony_ci	struct fpga_device	ts_nand;
3462306a36Sopenharmony_ci	struct fpga_device	ts_rng;
3562306a36Sopenharmony_ci};
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_cistruct ts78xx_fpga_data {
3862306a36Sopenharmony_ci	unsigned int		id;
3962306a36Sopenharmony_ci	int			state;
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci	struct fpga_devices	supports;
4262306a36Sopenharmony_ci};
43