3 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef __KEYMILE_COMMON_H
9 #define __KEYMILE_COMMON_H
11 #define WRG_RESET 0x80
12 #define H_OPORTS_14 0x40
16 #define OPRTL_XBUFENA 0x20
18 #define H_OPORTS_SCC4_ENA 0x10
19 #define H_OPORTS_SCC4_FD_ENA 0x04
20 #define H_OPORTS_FCC1_PW_DWN 0x01
22 #define PIGGY_PRESENT 0x80
29 unsigned char res1[3];
36 unsigned char res2[2];
38 unsigned char res3[0xfff0];
40 unsigned char pgy_rev;
41 unsigned char pgy_outputs;
42 unsigned char pgy_eth;
45 #define BFTICU_DIPSWITCH_MASK 0x0f
49 * BFTICU is used on mgcoge and mgocge3ne
52 u8 xi_ena; /* General defect enable */
112 u8 led_on; /* Leds */
114 u8 sfp_control; /* SFP modules */
116 u8 alarm_control; /* Alarm output */
118 u8 icps; /* ICN clock pulse shaping */
119 u8 mswitch; /* Read mode switch */
124 #if !defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET)
125 #define CONFIG_PIGGY_MAC_ADRESS_OFFSET 0
128 int ethernet_present(void);
129 int ivm_read_eeprom(unsigned char *buf, int len);
130 int ivm_analyze_eeprom(unsigned char *buf, int len);
132 int trigger_fpga_config(void);
133 int wait_for_fpga_config(void);
134 int fpga_reset(void);
135 int toggle_eeprom_spi_bus(void);
137 int get_testpin(void);
139 int set_km_env(void);
140 int fdt_set_node_and_value(void *blob,
145 int fdt_get_node_and_value(void *blob,
150 #define DELAY_ABORT_SEQ 62 /* @200kHz 9 clocks = 44us, 62us is ok */
151 #define DELAY_HALF_PERIOD (500 / (CONFIG_SYS_I2C_SPEED / 1000))
153 int i2c_soft_read_pin(void);
154 int i2c_make_abort(void);
155 #endif /* __KEYMILE_COMMON_H */