xref: /openbmc/linux/drivers/usb/serial/iuu_phoenix.h (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
1*788a4ee6SNishad Kamdar /* SPDX-License-Identifier: GPL-2.0+ */
260a8fc01SAlain Degreffe /*
360a8fc01SAlain Degreffe  * Infinity Unlimited USB Phoenix driver
460a8fc01SAlain Degreffe  *
560a8fc01SAlain Degreffe  * Copyright (C) 2007 Alain Degreffe (eczema@ecze.com)
660a8fc01SAlain Degreffe  *
760a8fc01SAlain Degreffe  *
860a8fc01SAlain Degreffe  * Original code taken from iuutool ( Copyright (C) 2006 Juan Carlos Borrás )
960a8fc01SAlain Degreffe  *
1060a8fc01SAlain Degreffe  *  And tested with help of WB Electronics
1160a8fc01SAlain Degreffe  */
1260a8fc01SAlain Degreffe 
1360a8fc01SAlain Degreffe #define   IUU_USB_VENDOR_ID  0x104f
1460a8fc01SAlain Degreffe #define   IUU_USB_PRODUCT_ID  0x0004
1560a8fc01SAlain Degreffe #define   IUU_USB_OP_TIMEOUT  0x0200
1660a8fc01SAlain Degreffe 
1760a8fc01SAlain Degreffe /* Programmer commands */
1860a8fc01SAlain Degreffe 
1960a8fc01SAlain Degreffe #define IUU_NO_OPERATION   0x00
2060a8fc01SAlain Degreffe #define IUU_GET_FIRMWARE_VERSION   0x01
2160a8fc01SAlain Degreffe #define IUU_GET_PRODUCT_NAME   0x02
2260a8fc01SAlain Degreffe #define IUU_GET_STATE_REGISTER   0x03
2360a8fc01SAlain Degreffe #define IUU_SET_LED   0x04
2460a8fc01SAlain Degreffe #define IUU_WAIT_MUS   0x05
2560a8fc01SAlain Degreffe #define IUU_WAIT_MS   0x06
2660a8fc01SAlain Degreffe #define IUU_GET_LOADER_VERSION   0x50
2760a8fc01SAlain Degreffe #define IUU_RST_SET   0x52
2860a8fc01SAlain Degreffe #define IUU_RST_CLEAR   0x53
2960a8fc01SAlain Degreffe #define IUU_SET_VCC   0x59
3060a8fc01SAlain Degreffe #define IUU_UART_ENABLE   0x49
3160a8fc01SAlain Degreffe #define IUU_UART_DISABLE   0x4A
3260a8fc01SAlain Degreffe #define IUU_UART_WRITE_I2C   0x4C
3360a8fc01SAlain Degreffe #define IUU_UART_ESC   0x5E
3460a8fc01SAlain Degreffe #define IUU_UART_TRAP   0x54
3560a8fc01SAlain Degreffe #define IUU_UART_TRAP_BREAK   0x5B
3660a8fc01SAlain Degreffe #define IUU_UART_RX   0x56
3760a8fc01SAlain Degreffe #define IUU_AVR_ON   0x21
3860a8fc01SAlain Degreffe #define IUU_AVR_OFF   0x22
3960a8fc01SAlain Degreffe #define IUU_AVR_1CLK   0x23
4060a8fc01SAlain Degreffe #define IUU_AVR_RESET   0x24
4160a8fc01SAlain Degreffe #define IUU_AVR_RESET_PC   0x25
4260a8fc01SAlain Degreffe #define IUU_AVR_INC_PC   0x26
4360a8fc01SAlain Degreffe #define IUU_AVR_INCN_PC   0x27
4460a8fc01SAlain Degreffe #define IUU_AVR_PREAD   0x29
4560a8fc01SAlain Degreffe #define IUU_AVR_PREADN   0x2A
4660a8fc01SAlain Degreffe #define IUU_AVR_PWRITE   0x28
4760a8fc01SAlain Degreffe #define IUU_AVR_DREAD   0x2C
4860a8fc01SAlain Degreffe #define IUU_AVR_DREADN   0x2D
4960a8fc01SAlain Degreffe #define IUU_AVR_DWRITE   0x2B
5060a8fc01SAlain Degreffe #define IUU_AVR_PWRITEN   0x2E
5160a8fc01SAlain Degreffe #define IUU_EEPROM_ON   0x37
5260a8fc01SAlain Degreffe #define IUU_EEPROM_OFF   0x38
5360a8fc01SAlain Degreffe #define IUU_EEPROM_WRITE   0x39
5460a8fc01SAlain Degreffe #define IUU_EEPROM_WRITEX   0x3A
5560a8fc01SAlain Degreffe #define IUU_EEPROM_WRITE8   0x3B
5660a8fc01SAlain Degreffe #define IUU_EEPROM_WRITE16   0x3C
5760a8fc01SAlain Degreffe #define IUU_EEPROM_WRITEX32   0x3D
5860a8fc01SAlain Degreffe #define IUU_EEPROM_WRITEX64   0x3E
5960a8fc01SAlain Degreffe #define IUU_EEPROM_READ   0x3F
6060a8fc01SAlain Degreffe #define IUU_EEPROM_READX   0x40
6160a8fc01SAlain Degreffe #define IUU_EEPROM_BREAD   0x41
6260a8fc01SAlain Degreffe #define IUU_EEPROM_BREADX   0x42
6360a8fc01SAlain Degreffe #define IUU_PIC_CMD   0x0A
6460a8fc01SAlain Degreffe #define IUU_PIC_CMD_LOAD   0x0B
6560a8fc01SAlain Degreffe #define IUU_PIC_CMD_READ   0x0C
6660a8fc01SAlain Degreffe #define IUU_PIC_ON   0x0D
6760a8fc01SAlain Degreffe #define IUU_PIC_OFF   0x0E
6860a8fc01SAlain Degreffe #define IUU_PIC_RESET   0x16
6960a8fc01SAlain Degreffe #define IUU_PIC_INC_PC   0x0F
7060a8fc01SAlain Degreffe #define IUU_PIC_INCN_PC   0x10
7160a8fc01SAlain Degreffe #define IUU_PIC_PWRITE   0x11
7260a8fc01SAlain Degreffe #define IUU_PIC_PREAD   0x12
7360a8fc01SAlain Degreffe #define IUU_PIC_PREADN   0x13
7460a8fc01SAlain Degreffe #define IUU_PIC_DWRITE   0x14
7560a8fc01SAlain Degreffe #define IUU_PIC_DREAD   0x15
7660a8fc01SAlain Degreffe #define IUU_UART_NOP   0x00
7760a8fc01SAlain Degreffe #define IUU_UART_CHANGE   0x02
7860a8fc01SAlain Degreffe #define IUU_UART_TX   0x04
7960a8fc01SAlain Degreffe #define IUU_DELAY_MS   0x06
8060a8fc01SAlain Degreffe 
8160a8fc01SAlain Degreffe #define IUU_OPERATION_OK   0x00
8260a8fc01SAlain Degreffe #define IUU_DEVICE_NOT_FOUND   0x01
8360a8fc01SAlain Degreffe #define IUU_INVALID_HANDLE   0x02
8460a8fc01SAlain Degreffe #define IUU_INVALID_PARAMETER   0x03
8560a8fc01SAlain Degreffe #define IUU_INVALID_voidERFACE   0x04
8660a8fc01SAlain Degreffe #define IUU_INVALID_REQUEST_LENGTH   0x05
8760a8fc01SAlain Degreffe #define IUU_UART_NOT_ENABLED   0x06
8860a8fc01SAlain Degreffe #define IUU_WRITE_ERROR   0x07
8960a8fc01SAlain Degreffe #define IUU_READ_ERROR   0x08
9060a8fc01SAlain Degreffe #define IUU_TX_ERROR   0x09
9160a8fc01SAlain Degreffe #define IUU_RX_ERROR   0x0A
9260a8fc01SAlain Degreffe 
9360a8fc01SAlain Degreffe #define IUU_PARITY_NONE   0x00
9460a8fc01SAlain Degreffe #define IUU_PARITY_EVEN   0x01
9560a8fc01SAlain Degreffe #define IUU_PARITY_ODD   0x02
9660a8fc01SAlain Degreffe #define IUU_PARITY_MARK   0x03
9760a8fc01SAlain Degreffe #define IUU_PARITY_SPACE   0x04
9860a8fc01SAlain Degreffe #define IUU_SC_INSERTED   0x01
9960a8fc01SAlain Degreffe #define IUU_VERIFY_ERROR   0x02
10060a8fc01SAlain Degreffe #define IUU_SIM_INSERTED   0x04
10160a8fc01SAlain Degreffe #define IUU_TWO_STOP_BITS   0x00
10260a8fc01SAlain Degreffe #define IUU_ONE_STOP_BIT   0x20
10360a8fc01SAlain Degreffe #define IUU_BAUD_2400   0x0398
10460a8fc01SAlain Degreffe #define IUU_BAUD_9600   0x0298
10560a8fc01SAlain Degreffe #define IUU_BAUD_19200   0x0164
10660a8fc01SAlain Degreffe #define IUU_BAUD_28800   0x0198
10760a8fc01SAlain Degreffe #define IUU_BAUD_38400   0x01B2
10860a8fc01SAlain Degreffe #define IUU_BAUD_57600   0x0030
10960a8fc01SAlain Degreffe #define IUU_BAUD_115200   0x0098
11060a8fc01SAlain Degreffe #define IUU_CLK_3579000   3579000
11160a8fc01SAlain Degreffe #define IUU_CLK_3680000   3680000
11260a8fc01SAlain Degreffe #define IUU_CLK_6000000   6000000
11360a8fc01SAlain Degreffe #define IUU_FULLCARD_IN   0x01
11460a8fc01SAlain Degreffe #define IUU_DEV_ERROR   0x02
11560a8fc01SAlain Degreffe #define IUU_MINICARD_IN   0x04
11660a8fc01SAlain Degreffe #define IUU_VCC_5V   0x00
11760a8fc01SAlain Degreffe #define IUU_VCC_3V   0x01
118