/*
 * Register definitions for the AR660S CPLD.
 *
 * Copyright 2010 Allied Telesis Labs
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */
#ifndef CPLD_H_
#define CPLD_H_

#define CPLD_CR3		0x3
#define CPLD_CR3_PCIE_RST	(1 << 6)		/* PCI-Express Slot */
#define CPLD_CR3_USB_RST	(1 << 5)		/* USB Devices */
#define CPLD_CR3_PIC1_RST	(1 << 4)		/* AT-PIC slot 0 */
#define CPLD_CR3_PIC0_RST	(1 << 3)		/* AT-PIC slot 0 */
#define CPLD_CR3_PHY_WAN2_RST	(1 << 2)		/* WAN2 PHY */
#define CPLD_CR3_PHY_WAN1_RST	(1 << 1)		/* WAN1 PHY */
#define CPLD_CR3_LAN_RST	(1 << 0)		/* LAN Switch chip */

#define CPLD_CR5		0x5
#define CPLD_CR5_I2C_2_ENABLE	(1 << 6)
#define CPLD_CR5_I2C_2_SELECT	(3 << 4)
#define CPLD_CR5_I2C_2_CH0	(0 << 4)
#define CPLD_CR5_I2C_2_CH1	(1 << 4)
#define CPLD_CR5_I2C_2_CH2	(2 << 4)
#define CPLD_CR5_I2C_2_CH3	(3 << 4)
#define CPLD_CR5_I2C_1_ENABLE	(1 << 2)
#define CPLD_CR5_I2C_1_SELECT	(3 << 0)
#define CPLD_CR5_I2C_1_CH0	(0 << 0)
#define CPLD_CR5_I2C_1_CH1	(1 << 0)
#define CPLD_CR5_I2C_1_CH2	(2 << 0)
#define CPLD_CR5_I2C_1_CH3	(3 << 0)

#endif /* CPLD_H_ */

