blob: 0a8268cbb581ec060a6ab7f5af578488d4129429 [file] [log] [blame]
Dirk Eibach81b37932011-01-21 09:31:21 +01001/*
2 * (C) Copyright 2010
3 * Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Dirk Eibach81b37932011-01-21 09:31:21 +01006 */
7
8#ifndef __GDSYS_FPGA_H
9#define __GDSYS_FPGA_H
10
Dirk Eibach6fabe552011-10-20 11:12:55 +020011int init_func_fpga(void);
12
Dirk Eibach81b37932011-01-21 09:31:21 +010013enum {
14 FPGA_STATE_DONE_FAILED = 1 << 0,
15 FPGA_STATE_REFLECTION_FAILED = 1 << 1,
Dirk Eibach6fabe552011-10-20 11:12:55 +020016 FPGA_STATE_PLATFORM = 1 << 2,
Dirk Eibach81b37932011-01-21 09:31:21 +010017};
18
19int get_fpga_state(unsigned dev);
20void print_fpga_state(unsigned dev);
21
Dirk Eibach6176f4c2012-04-27 10:33:46 +020022struct ihs_gpio {
Dirk Eibach81b37932011-01-21 09:31:21 +010023 u16 read;
24 u16 clear;
25 u16 set;
Dirk Eibach6176f4c2012-04-27 10:33:46 +020026};
Dirk Eibach81b37932011-01-21 09:31:21 +010027
Dirk Eibach6176f4c2012-04-27 10:33:46 +020028struct ihs_i2c {
Dirk Eibach81b37932011-01-21 09:31:21 +010029 u16 write_mailbox;
30 u16 write_mailbox_ext;
31 u16 read_mailbox;
32 u16 read_mailbox_ext;
Dirk Eibach6176f4c2012-04-27 10:33:46 +020033};
Dirk Eibach81b37932011-01-21 09:31:21 +010034
Dirk Eibach6176f4c2012-04-27 10:33:46 +020035struct ihs_osd {
Dirk Eibach81b37932011-01-21 09:31:21 +010036 u16 version;
37 u16 features;
38 u16 control;
39 u16 xy_size;
Dirk Eibachd3b17002011-04-06 13:53:47 +020040 u16 xy_scale;
41 u16 x_pos;
42 u16 y_pos;
Dirk Eibach6176f4c2012-04-27 10:33:46 +020043};
Dirk Eibach81b37932011-01-21 09:31:21 +010044
Dirk Eibach9a659572012-04-26 03:54:22 +000045#ifdef CONFIG_NEO
Dirk Eibach6176f4c2012-04-27 10:33:46 +020046struct ihs_fpga {
Dirk Eibach9a659572012-04-26 03:54:22 +000047 u16 reflection_low; /* 0x0000 */
48 u16 versions; /* 0x0002 */
49 u16 fpga_features; /* 0x0004 */
50 u16 fpga_version; /* 0x0006 */
51 u16 reserved_0[8187]; /* 0x0008 */
52 u16 reflection_high; /* 0x3ffe */
Dirk Eibach6176f4c2012-04-27 10:33:46 +020053};
Dirk Eibach9a659572012-04-26 03:54:22 +000054#endif
55
Dirk Eibach81b37932011-01-21 09:31:21 +010056#ifdef CONFIG_IO
Dirk Eibach6176f4c2012-04-27 10:33:46 +020057struct ihs_fpga {
Dirk Eibach81b37932011-01-21 09:31:21 +010058 u16 reflection_low; /* 0x0000 */
59 u16 versions; /* 0x0002 */
60 u16 fpga_features; /* 0x0004 */
61 u16 fpga_version; /* 0x0006 */
62 u16 reserved_0[5]; /* 0x0008 */
63 u16 quad_serdes_reset; /* 0x0012 */
64 u16 reserved_1[8181]; /* 0x0014 */
65 u16 reflection_high; /* 0x3ffe */
Dirk Eibach6176f4c2012-04-27 10:33:46 +020066};
Dirk Eibach81b37932011-01-21 09:31:21 +010067#endif
68
Dirk Eibach6fabe552011-10-20 11:12:55 +020069#ifdef CONFIG_IO64
Dirk Eibach6176f4c2012-04-27 10:33:46 +020070struct ihs_fpga {
Dirk Eibach6fabe552011-10-20 11:12:55 +020071 u16 reflection_low; /* 0x0000 */
72 u16 versions; /* 0x0002 */
73 u16 fpga_features; /* 0x0004 */
74 u16 fpga_version; /* 0x0006 */
75 u16 reserved_0[5]; /* 0x0008 */
76 u16 quad_serdes_reset; /* 0x0012 */
77 u16 reserved_1[502]; /* 0x0014 */
78 u16 ch0_status_int; /* 0x0400 */
79 u16 ch0_config_int; /* 0x0402 */
Dirk Eibach6e2350f2012-01-02 11:02:46 +010080 u16 reserved_2[126]; /* 0x0404 */
81 u16 ch0_hicb_status_int;/* 0x0500 */
82 u16 ch0_hicb_config_int;/* 0x0502 */
83 u16 reserved_3[7549]; /* 0x0504 */
Dirk Eibach6fabe552011-10-20 11:12:55 +020084 u16 reflection_high; /* 0x3ffe */
Dirk Eibach6176f4c2012-04-27 10:33:46 +020085};
Dirk Eibach6fabe552011-10-20 11:12:55 +020086#endif
87
Dirk Eibach81b37932011-01-21 09:31:21 +010088#ifdef CONFIG_IOCON
Dirk Eibach6176f4c2012-04-27 10:33:46 +020089struct ihs_fpga {
Dirk Eibach81b37932011-01-21 09:31:21 +010090 u16 reflection_low; /* 0x0000 */
91 u16 versions; /* 0x0002 */
92 u16 fpga_version; /* 0x0004 */
93 u16 fpga_features; /* 0x0006 */
94 u16 reserved_0[6]; /* 0x0008 */
Dirk Eibach6176f4c2012-04-27 10:33:46 +020095 struct ihs_gpio gpio; /* 0x0014 */
Dirk Eibach81b37932011-01-21 09:31:21 +010096 u16 mpc3w_control; /* 0x001a */
97 u16 reserved_1[19]; /* 0x001c */
98 u16 videocontrol; /* 0x0042 */
99 u16 reserved_2[93]; /* 0x0044 */
100 u16 reflection_high; /* 0x00fe */
Dirk Eibach6176f4c2012-04-27 10:33:46 +0200101 struct ihs_osd osd; /* 0x0100 */
Dirk Eibach09e046f2012-04-26 03:54:26 +0000102 u16 reserved_3[889]; /* 0x010e */
Dirk Eibach81b37932011-01-21 09:31:21 +0100103 u16 videomem; /* 0x0800 */
Dirk Eibach6176f4c2012-04-27 10:33:46 +0200104};
Dirk Eibach81b37932011-01-21 09:31:21 +0100105#endif
106
107#ifdef CONFIG_DLVISION_10G
Dirk Eibach6176f4c2012-04-27 10:33:46 +0200108struct ihs_fpga {
Dirk Eibach81b37932011-01-21 09:31:21 +0100109 u16 reflection_low; /* 0x0000 */
110 u16 versions; /* 0x0002 */
111 u16 fpga_version; /* 0x0004 */
112 u16 fpga_features; /* 0x0006 */
113 u16 reserved_0[10]; /* 0x0008 */
114 u16 extended_interrupt; /* 0x001c */
115 u16 reserved_1[9]; /* 0x001e */
Dirk Eibach6176f4c2012-04-27 10:33:46 +0200116 struct ihs_i2c i2c; /* 0x0030 */
Dirk Eibachc0413ee2011-04-06 13:53:48 +0200117 u16 reserved_2[16]; /* 0x0038 */
118 u16 mpc3w_control; /* 0x0058 */
119 u16 reserved_3[34]; /* 0x005a */
Dirk Eibach81b37932011-01-21 09:31:21 +0100120 u16 videocontrol; /* 0x009e */
Dirk Eibachc0413ee2011-04-06 13:53:48 +0200121 u16 reserved_4[176]; /* 0x00a0 */
Dirk Eibach6176f4c2012-04-27 10:33:46 +0200122 struct ihs_osd osd; /* 0x0200 */
Dirk Eibachc0413ee2011-04-06 13:53:48 +0200123 u16 reserved_5[761]; /* 0x020e */
Dirk Eibach81b37932011-01-21 09:31:21 +0100124 u16 videomem; /* 0x0800 */
Dirk Eibach6176f4c2012-04-27 10:33:46 +0200125};
Dirk Eibach81b37932011-01-21 09:31:21 +0100126#endif
127
128#endif