#!/bin/regdecode UIO Driver for Ciena Geco CPLD

[GECO_VERSION]
name:	0x00	CN3960 Board ID, GECO cpld Load ID
width: 16
field:	15	Unused1
field:	14:12	Mezz_board_ID	from pullup resistors on Mezzanine board
field:	11:8	Main_board_ID	from pullup resistors on Main board
field:	7	Unused2
field:	6:4	Major_version	Initial release = 0
field:	3:0	Minor_version	Initial release = 1

[GECO_CPLD_RESET]
name:	0x02	Software-controlled GECO Internal Reset. writing 0xA5A5 to this register will generate an internal reset on the GECO.
width: 16
value:	0xA5A5	cpld_reset

[GECO_STATUS_THERMAL]
name:	0x04	Status Temperature
width: 16
field:	15:10	Unused
field:	9	Temp_crit_sirion1	Temperature critical alarm threshold exceeded on Sirion
field:	8	Temp_crit_sirion0	Temperature critical alarm threshold exceeded on Sirion
field:	7	Temp_alert_sirion1	Temperature alert alarm threshold exceeded on Sirion
field:	6	Temp_alert_sirion0	Temperature alert alarm threshold exceeded on Sirion
field:	5	temp_crit_cpu	Temperature critical alarm threshold exceeded on CPU
field:	4	temp_alert_cpu	Temperature alert alarm threshold exceeded on CPU
field:	3	temp_crit_ambient	Ambient temperature critical alarm threshold exceeded
field:	2	temp_alert_ambient	Ambient temperature alert alarm threshold exceeded
field:	1	temp_crit_triumph	Temperature critical alarm threshold exceeded on Triumph
field:	0	temp_alert_triumph	Temperature alert alarm threshold exceeded on Triumph

[GECO_STATUS_PWR_SFP]
name:	0x06	Status POWER and SFP_LOS
width: 16
field:	15	Unused
field:	14	led_pwr_ok	Active high status bit indicates all pwr voltages are OK
field:	13	pwr_present_n[1]	Active low status bit indicates power supply A is present
field:	12	pwr_present_n[0]	Active low status bit indicates power supply B is present
field:	11	pwr_fault[1]	Active high status bit indicates a power supply A fault
field:	10	pwr_fault[0]	Active high status bit indicates a power supply B fault
field:	9	pwr_fan_fail_irq_n[1]	Active low status bit indicates power supply A fan has failed
field:	8	pwr_fan_fail_irq_n[0]	Active low status bit indicates power supply B fan has failed
field:	7:0	sfp_los[7:0]	SFP loss of signal

[GECO_STATUS_SFP_1]
name:	0x08	Status SFP 1
width: 16
field:	15:8	sfp_tx_fault[7:0]	SFP transmitter fault indication
field:	7:0	sfp_mod_def0[7:0]	SFP module present

[GECO_STATUS_XFP_1]
name:	0x0a	Status XFP 1
width: 16
field:	15:12	xfp_mod_abs[3:0]	Active high - XFP module is absent
field:	11:8	xfp_pcmulk[3:0]	Active high - PMD CMU Lock Detect
field:	7:4	xfp_plos_n[3:0]	Active low - PMD Loss Of Signal
field:	3:0	xfp_pcdrlk[3:0]	Active high - PMD CDR Lock Detect

[GECO_INTR_STATUS_THERMAL]
name:	0x0c	Interrupt Status Thermal
width: 16
field:	15:10	Unused
field:	9	Temp_crit_sirion1	Temperature critical alarm threshold exceeded on Sirion
field:	8	Temp_crit_sirion0	Temperature critical alarm threshold exceeded on Sirion
field:	7	Temp_alert_sirion1	Temperature alert alarm threshold exceeded on Sirion
field:	6	Temp_alert_sirion0	Temperature alert alarm threshold exceeded on Sirion
field:	5	temp_crit_cpu	Temperature critical alarm threshold exceeded on CPU
field:	4	temp_alert_cpu	Temperature alert alarm threshold exceeded on CPU
field:	3	temp_crit_ambient	Ambient temperature critical alarm threshold exceeded
field:	2	temp_alert_ambient	Ambient temperature alert alarm threshold exceeded
field:	1	temp_crit_triumph	Temperature critical alarm threshold exceeded on Triumph
field:	0	temp_alert_triumph	Temperature alert alarm threshold exceeded on Triumph

[GECO_INTR_STATUS_PWR_SFP]
name:	0x0e	Interrupt Status POWER and SFP_LOS
width: 16
field:	15	Unused
field:	14:0	intr_status[14:0]	Set high when corresponding bit in STATUS_PWR_SFP changes from 0->1, or 1->0

[GECO_INTR_STATUS_SFP_1]
name:	0x10	Interrupt Status SFP 1
width: 16
field:	15:0	intr_status[15:0]	Set high when corresponding bit in STATUS_SFP_1 changes from 0->1, or 1->0

[GECO_INTR_STATUS_XFP_1]
name:	0x12	Interrupt Status XFP 1
width: 16
field:	15:0	intr_status[15:0]	Set high when corresponding bit in STATUS_XFP_1 changes from 0->1, or 1->0

[GECO_INTR_STATUS_XFP_2]
name:	0x14	Interrupt Status XFP 2 This register groups together the interrupt outputs from the XFPs, but does not latch them. A low level on any bit here will assert the cpld_int_n signal to the Cavium , unless a mask bit is set in INTR_MASK_XFP_2. To clear an interrupt indicated in this register, the source in the XFP must be cleared.
width: 16
field:	15:8	Unused
field:	7:4	xfp_irq_n[3:0]	Active low XFP interrupt indicating the presence of an important condition
field:	3:0	xfp_lasi_n[3:0]	Active low XFP interrupt indicating Link Alarm Status Interrupt

[GECO_INTR_STATUS_FPGA]
name:	0x16	Interrupt Status from Sirion FPGAs This register groups together the interrupt outputs from the Sirion fpga's, but does not latch them. A low level on any bit here will assert the cpld_int_n signal to the Cavium , unless a mask bit is set in INTR_MASK_FPGA. To clear an interrupt indicated in this register, the source in the Sirion must be cleared.
width: 16
field:	15:6	Unused
field:	5	fpga2_crc_error	Set high when FPGA 2 Configuration SRAM is corrupted. Need to reconfigure.
field:	4	fpga1_crc_error	Set high when FPGA 1 Configuration SRAM is corrupted. Need to reconfigure.
field:	3:2	fpga_1588_irq_n[1:0]	Active low Interrupt from Sirion FPGAs (IEEE 1588) RTC.
field:	1:0	fpga_irq_n[1:0]	Active low Interrupt from Sirion FPGAs.

[GECO_INTR_MASK_THERMAL]
name:	0x18	Interrupt Mask Register 0
width: 16
field:	15:10	Unused
field:	9	Temp_crit_sirion1	Temperature critical alarm threshold exceeded on Sirion
field:	8	Temp_crit_sirion0	Temperature critical alarm threshold exceeded on Sirion
field:	7	Temp_alert_sirion1	Temperature alert alarm threshold exceeded on Sirion
field:	6	Temp_alert_sirion0	Temperature alert alarm threshold exceeded on Sirion
field:	5	temp_crit_cpu	Temperature critical alarm threshold exceeded on CPU
field:	4	temp_alert_cpu	Temperature alert alarm threshold exceeded on CPU
field:	3	temp_crit_ambient	Ambient temperature critical alarm threshold exceeded
field:	2	temp_alert_ambient	Ambient temperature alert alarm threshold exceeded
field:	1	temp_crit_triumph	Temperature critical alarm threshold exceeded on Triumph
field:	0	temp_alert_triumph	Temperature alert alarm threshold exceeded on Triumph

[GECO_INTR_MASK_PWR_SFP]
name:	0x1a	Interrupt Mask Register 1
width: 16
field:	15	Unused
field:	14:0	mask_1[14:0] Setting a mask bit prevents the corresponding bit in INTR_STATUS_PWR_SFP register from causing an interrupt to the CPU. Interrupt bits are still set in the INTR_STATUS_PWR_SFP

[GECO_INTR_MASK_SFP_1]
name:	0x1c	Interrupt Mask Register 2
width: 16
field:	15:0	mask_2[15:0] Setting a mask bit prevents the corresponding bit in INTR_STATUS_SFP_1 register from causing an interrupt to the CPU. Interrupt bits are still set in the INTR_STATUS_SFP_1

[GECO_INTR_MASK_FPGA]
name:	0x1e	Interrupt Mask Register 3
width: 16
field:	15:6	Unused
field:	5:0	mask_3[5:0] Setting a mask bit prevents the corresponding bit in INTR_STATUS_FPGA register from causing an interrupt to the CPU.

[GECO_INTR_MASK_XFP_1]
name:	0x20	Interrupt Mask Register 4
width: 16
field:	15:0	mask_4[15:0] Setting a mask bit prevents the corresponding bit in INTR_STATUS_XFP_1 register from causing an interrupt to the CPU. Interrupt bits are still set in the INTR_STATUS

[GECO_INTR_MASK_XFP_2]
name:	0x22	Interrupt Mask Register 5
width: 16
field:	15:8	Unused
field:	7:0	mask_5[7:0] Setting a mask bit prevents the corresponding bit in INTR_STATUS_XFP_2 register from causing an interrupt to the CPU.

[GECO_RESET]
name:	0x24	Reset Register
width: 16
field:	15:9	Unused
field:	8:7	rst_fpga[1:0]	Active high Reset to Sirion FPGAs
field:	6	rst_phy_mgmt	Active high Reset to Management PHY
field:	5:4	rst_phy10g[1:0]	Active high Reset to 10G PHYs
field:	3:0	rst_phy1g[3:0]	Active high Reset to 1G PHYs

[GECO_LED_1G_LINK_SPEED]
name:	0x26	1G Link Speed LED
width: 16
field:	15:8	Unused
field:	7:0	led_spd_1G[7:0]	LED output 1G link Speed (1 = 1 Gbs, 0 = 100Mbs)

[GECO_LED_10G_LINK_ACT]
name:	0x28	10G Link Status LED
width: 16
field:	15:12	Unused1
field:	11:8	led_link_active_10G_old[3:0]	LED output 10G link Active Rev 1 board
field:	7:4	Unused2
field:	3:0	led_link_active_10G[3:0]	LED output 10G link Active Rev 1 board

[GECO_LED_SYS_STATUS]
name:	0x2a	System Status LEDs
width: 16
field:	15:8	Unused
field:	7	led_sys_alarm_blink_en	Assertion will set 1 second blink on System Alarm LED in colour selected by [6:5].
field:	6	led_sys_alarm_grn	Assertion will illuminate System Alarm LED green
field:	5	led_sys_alarm_yel	Assertion will illuminate System Alarm LED yellow
field:	4	led_sys_status_blink_en	Assertion will set 1 second blink on System Status LED in colour selected by [3:2].
field:	3	led_sys_status_grn	Assertion will illuminate System Status LED green
field:	2	led_sys_status_yel	Assertion will illuminate System Status LED yellow
field:	1	led_temp_grn	Assertion will illuminate Temperature LED green
field:	0	led_temp_yellow	Assertion will illuminate Temperature LED yellow

[GECO_XFP_CTRL]
name:	0x2c	Control register for XFP
width: 16
field:	15:8	Unused
field:	7:4	xfp_mod_desel[3:0]	XFP module deselect
field:	3:0	xfp_txon[3:0]	10G PHY Transmitter enable (1 = enabled, 0 = disabled)

[GECO_SFP_CTRL]
name:	0x2e	Control register for SFP
width: 16
field:	15:8	Unused
field:	7:0	sfp_tx_dis[7:0]	SFP transmitter disable (0 = enabled, 1 = disabled)

[GECO_FAN_EN]
name:	0x30	Control register for GASP, FAN_EN
width: 16
field:	15:4	Unused
field:	3	gasp	Logic sets this bit when input pin dying_gasp_irq_n is asserted (low). It can also be written by software.
field:	2:0	fan_enable[2:0]	Active high enable for fans 3-1 respectively. They are cleared when a dying gasp interrupt occurs.

[GECO_FAN_PWM_0]
name:	0x32	Control register for FAN_PWM 0
width: 16
field:	15:6	Unused
field:	5:0	fan_pwm_0[4:0]	Pulse Width Modulator Fan speed control. (0x000 = Min Speed. 0x00FF = Max Speed.)

[GECO_RESERVED1]
name:	0x34	RESERVED
width: 16
field:	15:6	Unused
field:	5:0	reserved_1[4:0]

[GECO_RESERVED2]
name:	0x36	RESERVED
width: 16
field:	15:6	Unused
field:	5:0	reserved_2[4:0]

[GECO_FAN_TACH_0]
name:	0x38	Status register for FAN_TACH 0
width: 16
field:	15:6	Unused
field:	5:0	fan_tach_0[5:0]	Fan speed Indication. (0x000 = Min Speed. 0x00FF = Max Speed.)

[GECO_FAN_TACH_1]
name:	0x3a	Status register for FAN_TACH 1
width: 16
field:	15:6	Unused
field:	5:0	fan_tach_1[5:0]	Fan speed Indication. (0x000 = Min Speed. 0x00FF = Max Speed.)

[GECO_FAN_TACH_2]
name:	0x3c	Status register for FAN_TACH 2
width: 16
field:	15:6	Unused
field:	5:0	fan_tach_2[5:0]	Fan speed Indication. (0x000 = Min Speed. 0x00FF = Max Speed.)

[GECO_FPP_CTRL]
name:	0x3e	Control register for FPP_CTRL
width: 16
field:	15:2	Unused
field:	1:0	fpp_config[1:0]	FPP Configure

[GECO_FPP_STATUS]
name:	0x40	Control register for FPP_CTRL
width: 16
field:	15:4	Unused
field:	3:2	fpp_conf_done[1:0]	FPP Configure Done indication
field:	1:0	fpp_status[1:0]	FPP Configure Status indication (1 = FPGA selected by fpp_config is not ready, or error during configuration , 0 = FPGA selected by fpp_nconfig is ready to be configured)

[GECO_FPP_DATA]
name:	0x42	Control register for FPP_DATA
width: 16
field:	15:8	Unused
field:	7:0	fpp_data[7:0]	Next Configuration data byte to be written to FPGA selected by fpp_nconfig

[GECO_I2C_MUX_SEL]
name:	0x44	Select lines for I2C bus expansion
width: 16
field:	15:5	Unused
field:	4:0	i2c_mux_sel[4:0] I2C bus mapping
value:	0	local_bus	devices: eeprom, so-dimm
value:	1	power_0_bus	devices: pwr sup 0, pwr sup
value:	2	xfp0_bus	devices: xfp0
value:	3	xfp1_bus	devices: xfp1
value:	4	xfp2_bus	devices: xfp2
value:	5	xfp3_bus	devices: xfp3
value:	6	sfp0_bus	devices: sfp0
value:	7	sfp1_bus	devices: sfp1
value:	8	sfp2_bus	devices: sfp2
value:	9	sfp3_bus	devices: sfp3
value:	10	sfp4_bus	devices: sfp4
value:	11	sfp5_bus	devices: sfp5
value:	12	sfp6_bus	devices: sfp6
value:	13	sfp7_bus	devices: sfp7
value:	14	temp0_bus	devices: temp sensor 0
value:	15	temp1_bus	devices: temp sensor 1
value:	16	temp2_bus	devices: temp sensor 2
value:	17	temp3_bus	devices: temp sensor 3
value:	18	temp4_bus	devices: temp sensor 4
value:	19	power_1_bus	devices: (empty)

[GECO_PWR_SHUTDOWN]
name:	0x46	Control register Power Supply Shutdown
width: 16
field:	15:2	Unused
field:	1	pwr2_shutdown	Active high Shutdown to Power Supply 2. Writing '1' drives pin pwr2_shutdown_n = 0.
field:	0	pwr1_shutdown	Active high Shutdown to Power Supply 1. Writing '1' drives pin pwr1_shutdown_n = 0.

[GECO_TEST_0]
name:	0x48	Test register
width: 16
field:	15:0	test_reg[15:0]

[GECO_SW_RESET]
name:	0x4a	Software-controlled Board Reset
width: 16
value:	0xA5A5	board_reset

[GECO_DEBUG]
name:	0x4c	DEBUG Register
width: 16
field:	15:1	Unused
field:	0	fpp_tri_state	Active high tri-state of all fpp pins.

[GECO_RESET_BUTTON]
name:	0x4e	Reset Button monitor
width: 16
field:	15:1	Unused
field:	0	reset_button	Active high indication of reset button pressed

[GECO_LED_10G_BLINK]
name:	0x50	10G Link Activity LED Blinking control
width: 16
field:	15:12	Unused
field:	11:10	led_10G_blink_rate_3[1:0]	LED 10G link Blink rate port 11
value:	0	blink_1_sec
value:	1	blink_3_quarter_sec
value:	2	blink_half_sec
value:	3	blink_1_quarter_sec
field:	9:8	led_10G_blink_rate_2[1:0]	LED 10G link Blink rate port 10
value:	0	blink_1_sec
value:	1	blink_3_quarter_sec
value:	2	blink_half_sec
value:	3	blink_1_quarter_sec
field:	7:6	led_10G_blink_rate_1[1:0]	LED 10G link Blink rate port 9
value:	0	blink_1_sec
value:	1	blink_3_quarter_sec
value:	2	blink_half_sec
value:	3	blink_1_quarter_sec
field:	5:4	led_10G_blink_rate_0[1:0]	LED 10G link Blink rate port 8
value:	0	blink_1_sec
value:	1	blink_3_quarter_sec
value:	2	blink_half_sec
value:	3	blink_1_quarter_sec
field:	3:0	led_10G_blink_en[3:0]	LED 10G link Blink enable
value:	0	blink
value:	1	steady

[GECO_TRIUMPH_PCI_RESET_MASK]
name:	0x52	TRIUMPH PCI RESET MASK
width: 16
field:	15:1	Unused
field:	0	triumph_pci_reset_mask	1= disable PCI reset from cpu to triumph
value:	1	disable
value:	0	enable

