/*
 * Register definitions for the x610 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_SR1		0x10
#define CPLD_SR1_REVISION	(1 << 0)

#define CPLD_SR2		0x11
#define CPLD_SR2_SD_DET	(1 << 3)
#define CPLD_SR2_SD_PROT	(1 << 2)

#define CPLD_SR3		0x12

#define CPLD_CR1		0x0
#define CPLD_CR1_FLASH_MAP	(1 << 7)
#define CPLD_CR1_FLASH_WP	(1 << 1)
#define CPLD_CR1_FLASH_PRGM	(1 << 0)

#define CPLD_CR2		0x1
#define CPLD_CR2_TSEC_PHY_RES	(1 << 2)
#define CPLD_CR2_DBG_LED1	(1 << 1)
#define CPLD_CR2_RTS		(1 << 0)

#define CPLD_CR3		0x2
#define CPLD_CR3_SOFT_RST	(1 << 7)
#define CPLD_CR3_LM81_RST	(1 << 6)

#define CPLD_CR4		0x3
#define CPLD_CR4_SD_LED_MASK	(3 << 6)
#define CPLD_CR4_SD_LED_GREEN	(1 << 6)
#define CPLD_CR4_SD_LED_YELLOW	(2 << 6)
#define CPLD_CR4_SD_LED_OFF	(3 << 6)
#define CPLD_CR4_SD_CS		(1 << 5)
#define CPLD_CR4_SD_INT_EN	(1 << 4)
#define CPLD_CR4_RSTPHY_GE1	(1 << 3)
#define CPLD_CR4_RSTPHY_GE2	(1 << 2)
#define CPLD_CR4_RSTPHY_SFPP	(1 << 1)
#define CPLD_CR4_SW_RST	(1 << 0)

#endif /* CPLD_H_ */

