/** 
 * escLibCieloLocal.h
 *
 * Copyright (C) 2010 Fuji Xerox Co.,Ltd. All rights reserved.
 *
 * This 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.
 *
 * The full GNU General Public License is included in this distribution in the
 * file called COPYING.
 */
#ifndef _ESCLIBCIELOLOCAL_H_
#define _ESCLIBCIELOLOCAL_H_ 
#ifdef __cplusplus
extern "C" {
#endif
#define ESC_SWRST 0x01
#define ESC_DISABLE 0x00
#define ESC_ENABLE 0x01
#define ESC_LVDSPD_NORMAL 0x00
#define ESC_LVDSPD_POWERDOWN 0x01
#define ESC_LVL_NORMAL 0x00
#define ESC_LVL_REVERSE 0x01
#define ESC_PLK_PLKISTS_PCIE1 0x40
#define ESC_PLK_PLKISTS_PCIE4 0x20
#define ESC_PLK_PLKISTS_PWM 0x10
#define ESC_PLK_PLKISTS_PRINT 0x08
#define ESC_PLK_PLKISTS_UI 0x04
#define ESC_PLK_PLKISTS_DDR 0x01
#define ESC_PLK_PLKINT_PWM 0x10
#define ESC_PLK_PLKINT_PRINT 0x08
#define ESC_PLK_PLKINT_UI 0x04
#define ESC_PLK_PLKINT_DDR 0x01
#define ESC_PLK_PLKIEN_PWM 0x10
#define ESC_PLK_PLKIEN_PRINT 0x08
#define ESC_PLK_PLKIEN_UI 0x04
#define ESC_PLK_PLKIEN_DDR 0x01
#define ESC_CFGSTS_CPU_NORMAL 0x00
#define ESC_CFGSTS_CPU_ARM_ROM 0x01
#define ESC_CFGSTS_GBUS_FULL 0x00
#define ESC_CFGSTS_GBUS_HOSTIF 0x01
#define ESC_CFGSTS_TPLCLK_NORMAL 0x00
#define ESC_CFGSTS_TPLCLK_MON 0x01
#define ESC_CFGSTS_CCS_ASSP 0x00
#define ESC_CFGSTS_CCS_ASSP_HOSTIF 0x01
#define ESC_MIF0_DDRCLKSEL_DDRCLK 0x00
#define ESC_MIF0_DDRCLKSEL_USBCLK 0x01
#define ESC_UI0_LCDCLKSEL_LVDSCLK 0x00
#define ESC_UI0_LCDCLKSEL_CLK_LCD 0x01
#define ESC_UI0_LCDCLKBP_INTERNAL 0x00
#define ESC_UI0_LCDCLKBP_CLK_LCD 0x01
#define ESC_UI0_LCDCLKDIV_DIV2 0x00
#define ESC_UI0_LCDCLKDIV_DIV4 0x01
#define ESC_UI0_LCDCLKDIV_DIV6 0x02
#define ESC_UI0_LCDCLKDIV_DIV7A 0x03
#define ESC_UI0_LCDCLKDIV_DIV7B 0x04
#define ESC_UI0_LCDCLKDIV_DIV8 0x05
#define ESC_UI0_LCDCLKDIV_DIV10 0x06
#define ESC_UI0_LCDCLKDIV_DIV12 0x07
#define ESC_UI0_LCDCLKDIV_DIV14 0x08
#define ESC_UI0_LCDCLKDIV_DIV16 0x09
#define ESC_UI2_UIPLLEN_ENABLE 0x00000001
#define ESC_UI2_LCDCLKEN_ENABLE 0x00000100
#define ESC_UI2_LVDSCLK_ENABLE 0x00010000
#define ESC_UI2_UIBUFEN_ENABLE 0x01000000
#define ESC_PRT0_CLKSEL_DDRCLK 0x00
#define ESC_PRT0_CLKSEL_USBCLK 0x01
#define ESC_PRT2_PRTPLLEN 0x01
#define ESC_PRT3_PRNCLKEN 0x01
#define ESC_PRT3_IMGCLK_IMG0CLKEN 0x01
#define ESC_PRT3_IMGCLK_IMG1CLKEN 0x02
#define ESC_PRT3_CVCLKEN 0x01
#define ESC_PRT3_SWRST_PRT_SYSCLK 0x01
#define ESC_PRT3_SWRST_PRNCLK 0x02
#define ESC_PRT3_SWRST_IMGCLK 0x04
#define ESC_PRT3_SWRST_CVCLK 0x10
#define ESC_PWM0_SWRST_RV_K 0x01
#define ESC_PWM0_SWRST_RV_Y 0x02
#define ESC_PWM0_SWRST_RV_M 0x04
#define ESC_PWM0_SWRST_RV_C 0x08
#define ESC_PWM1_RVCLKSEL_PWMPLL 0x00
#define ESC_PWM1_RVCLKSEL_RVCLK 0x01
#define ESC_PWM2_PWMPLLEN 0x00000001
#define ESC_PWM2_PWMCLKEN 0x00000100
#define ESC_PWM2_MCULVDSPD_PWDWN 0x01000000
#define ESC_PWM3_PWMCLKKEN 0x00000001
#define ESC_PWM3_PWMCLKYEN 0x00000100
#define ESC_PWM3_PWMCLKMEN 0x00010000
#define ESC_PWM3_PWMCLKCEN 0x01000000
#define ESC_DDIVCLKSEL_P4ECOMPATI 0x00
#define ESC_DDIVCLKSEL_HIGHSPEED 0x01
#define ESC_DDIVCLKSEL_HIGH_HALFDDI 0x02
#define ESC_DDIVCLKSEL_PWM1400 0x03
#define ESC_DDIVCLKSEL_PRATO_TOTO 0x04
#define ESC_DDIVCLKSEL_DDIVCLKBFEN 0x03
#define ESC_IOSEL_GIO_TAGK_SEL 0x01
#define ESC_IOSEL_GIO_TAGC_SEL 0x02
#define ESC_IOSEL_GIO_TAGM_SEL 0x04
#define ESC_IOSEL_GIO_TAGY_SEL 0x08
#define ESC_IOSEL_GIO_VDOY_SEL 0x10
#define ESC_IOSEL_GIO_VDOM_SEL 0x20
#define ESC_IOSEL_GIO_VDOC_SEL 0x40
#define ESC_IOSEL_GIO_GEC_SEL 0x80
#define ESC_IOSEL_INTMODE_INT3 0x00
#define ESC_IOSEL_INTMODE_IPS_INT 0x01
#define ESC_IOSEL_DLDMODE_SEL_CH0 0x01
#define ESC_IOSEL_DLDMODE_SEL_CH1 0x02
#define ESC_IOSEL_DLDMODE_SEL_CH2 0x04
#define ESC_IOSEL_DLDMODE_SEL_CH3 0x08
#define ESC_IOSEL_DLDMODE_SEL_CH4 0x10
#define ESC_IOSEL_DLDMODE_SEL_CH5 0x20
#define ESC_IOSEL_DLDMODE_SEL_CH6 0x40
#define ESC_IOSEL_DLDMODE_SEL_CH7 0x80
#define ESC_IOCONF_CPUMON_NORMAL 0x00
#define ESC_IOCONF_CPUMON_MONITOR 0x01
#define ESC_IOCONF_DLDSLV_MASTER 0x00
#define ESC_IOCONF_DLDSLV_SLAVE 0x01
#define ESC_IOCONF_PCIERSTOUT_INT 0x00
#define ESC_IOCONF_PCIERSTOUT_SWRST 0x01
#define ESC_GIOSEL_GIO4_ENABLE 0x01
#define ESC_PSPDM_DDRIF 0x0002
#define ESC_PSPDM_UI 0x0004
#define ESC_PSPDM_GBUS 0x0008
#define ESC_PSPDM_SATA 0x0010
#define ESC_PSPDM_ARM 0x0020
#define ESC_PSPDM_IITMC 0x0040
#define ESC_PSPDM_GEC 0x0080
#define ESC_PSPDM_FAX0 0x0100
#define ESC_PSPDM_FAX1 0x0200
#define ESC_PSPDM_HOSTIF 0x0400
#define ESC_PSPDM_PRNBLK 0x0800
#define ESC_PSPDM_SCANBLK 0x1000
#define ESC_PSPDM_IPSBLK 0x2000
#define ESC_PSPDM_DEFAULT ( ESC_PSPDM_UI + ESC_PSPDM_GBUS + ESC_PSPDM_SATA + ESC_PSPDM_ARM \
                                    + ESC_PSPDM_IITMC + ESC_PSPDM_PRNBLK + ESC_PSPDM_SCANBLK \
                                    + ESC_PSPDM_IPSBLK )
#define ESC_PSPDHZ0_GBUS 0x00000008
#define ESC_PSPDHZ0_IITMC 0x00000040
#define ESC_PSPDHZ0_GEC 0x00000080
#define ESC_PSPDHZ0_HOSTIF 0x00000400
#define ESC_PSPDHZ0_PRNBLK 0x00000800
#define ESC_PSPDHZ0_IPSBLK 0x00002000
#define ESC_PSPDHZ0_UART0 0x00004000
#define ESC_PSPDHZ0_UART1 0x00008000
#define ESC_PSPDHZ0_UART2 0x00010000
#define ESC_PSPDHZ0_UART3 0x00020000
#define ESC_PSPDHZ0_UART4 0x00040000
#define ESC_PSPDHZ0_UART5 0x00080000
#define ESC_PSPDHZ0_UART6 0x00100000
#define ESC_PSPDHZ0_UART7 0x00200000
#define ESC_PSPDHZ0_UART8 0x00400000
#define ESC_PSPDHZ0_I2C0 0x00800000
#define ESC_PSPDHZ0_I2C1 0x01000000
#define ESC_PSPDHZ0_I2C2 0x02000000
#define ESC_PSPDHZ0_DEFAULT ( ESC_PSPDHZ0_GBUS + ESC_PSPDHZ0_IITMC + ESC_PSPDHZ0_PRNBLK \
                                    + ESC_PSPDHZ0_IPSBLK + ESC_PSPDHZ0_UART0 + ESC_PSPDHZ0_UART2 \
                                    + ESC_PSPDHZ0_UART3 + ESC_PSPDHZ0_UART4 + ESC_PSPDHZ0_UART5 \
                                    + ESC_PSPDHZ0_UART6 + ESC_PSPDHZ0_UART7 + ESC_PSPDHZ0_UART8 )
#define ESC_PSPDHZ1_DLD0 0x0001
#define ESC_PSPDHZ1_DLD1 0x0002
#define ESC_PSPDHZ1_DLD2 0x0004
#define ESC_PSPDHZ1_DLD3 0x0008
#define ESC_PSPDHZ1_DLD4 0x0010
#define ESC_PSPDHZ1_DLD5 0x0020
#define ESC_PSPDHZ1_DLD6 0x0040
#define ESC_PSPDHZ1_DLD7 0x0080
#define ESC_PSPDHZ1_DLDRST 0x0100
#define ESC_PSPDHZ1_DLDTCK 0x0200
#define ESC_PSPDHZ1_DLDMREQ 0x0400
#define ESC_RBTMF_PCIEX 0x0001
#define ESC_RBTMF_DDRIF 0x0002
#define ESC_RBTMF_GBUS 0x0008
#define ESC_RBTMF_SATA 0x0010
#define ESC_RBTMF_ARM 0x0020
#define ESC_RBTHZ0_GBUS 0x00000008
#define ESC_RBTHZ0_ARM 0x00000020
#define ESC_RBTHZ0_GEC 0x00000080
#define ESC_RBTHZ0_UART0 0x00004000
#define ESC_RBTHZ0_UART1 0x00008000
#define ESC_RBTHZ0_UART2 0x00010000
#define ESC_RBTHZ0_UART3 0x00020000
#define ESC_RBTHZ0_UART4 0x00040000
#define ESC_RBTHZ0_UART5 0x00080000
#define ESC_RBTHZ0_UART6 0x00100000
#define ESC_RBTHZ0_UART7 0x00200000
#define ESC_RBTHZ0_UART8 0x00400000
#define ESC_RBTHZ0_I2C0 0x00800000
#define ESC_RBTHZ0_I2C1 0x01000000
#define ESC_RBTHZ0_I2C2 0x02000000
#define ESC_RBTHZ1_DLD0 0x0001
#define ESC_RBTHZ1_DLD1 0x0002
#define ESC_RBTHZ1_DLD2 0x0004
#define ESC_RBTHZ1_DLD3 0x0008
#define ESC_RBTHZ1_DLD4 0x0010
#define ESC_RBTHZ1_DLD5 0x0020
#define ESC_RBTHZ1_DLD6 0x0040
#define ESC_RBTHZ1_DLD7 0x0080
#define ESC_RBTHZ1_DLDRST 0x0100
#define ESC_RBTHZ1_DLDTCK 0x0200
#define ESC_RBTHZ1_DLDMREQ 0x0400
#define ESC_RBTPLL_DDRPLL 0x01
#define ESC_RBTPLL_DDRDLL 0x02
#define ESC_RBTPLL_RBTLVDS_UILVDS 0x01
#define ESC_RBTPLL_RBTLVDS_MCULVDS 0x02
#define ESC_RBTPSEL_STMS_MAINMEM 0x00
#define ESC_RBTPSEL_STMS_PAGEMEM 0x01
#define ESC_RBTUSB_UDSTP_ACTIVE 0x00
#define ESC_RBTUSB_UDSTP_STOP 0x01
#define ESC_RBTUSB_UDRST_RQSTAT_NON 0x00
#define ESC_RBTUSB_UDRST_RQSTAT_UP 0x01
#define ESC_RBTUSB_UDRIEN_DISABLE 0x00
#define ESC_RBTUSB_UDRIEN_ENABLE 0x01
#define ESC_EXTHZ0_GBUS 0x00000008
#define ESC_EXTHZ0_IITMC 0x00000040
#define ESC_EXTHZ0_GEC 0x00000080
#define ESC_EXTHZ0_HOSTIF 0x00000400
#define ESC_EXTHZ0_PRNBLK 0x00000800
#define ESC_EXTHZ0_IPSBLK 0x00002000
#define ESC_EXTHZ0_UART0 0x00004000
#define ESC_EXTHZ0_UART1 0x00008000
#define ESC_EXTHZ0_UART2 0x00010000
#define ESC_EXTHZ0_UART3 0x00020000
#define ESC_EXTHZ0_UART4 0x00040000
#define ESC_EXTHZ0_UART5 0x00080000
#define ESC_EXTHZ0_UART6 0x00100000
#define ESC_EXTHZ0_UART7 0x00200000
#define ESC_EXTHZ0_UART8 0x00400000
#define ESC_EXTHZ0_I2C0 0x00800000
#define ESC_EXTHZ0_I2C1 0x01000000
#define ESC_EXTHZ0_I2C2 0x02000000
#define ESC_EXTHZ0_DEFAULT ( ESC_EXTHZ0_GBUS + ESC_EXTHZ0_IITMC + ESC_EXTHZ0_HOSTIF \
                                    + ESC_EXTHZ0_PRNBLK + ESC_EXTHZ0_IPSBLK + ESC_EXTHZ0_UART0 \
                                    + ESC_EXTHZ0_UART1 + ESC_EXTHZ0_UART2 + ESC_EXTHZ0_UART3 \
                                    + ESC_EXTHZ0_UART4 + ESC_EXTHZ0_UART5 + ESC_EXTHZ0_UART6 \
                                    + ESC_EXTHZ0_UART7 + ESC_EXTHZ0_UART8 )
#define ESC_EXTHZ1_DLD0 0x0001
#define ESC_EXTHZ1_DLD1 0x0002
#define ESC_EXTHZ1_DLD2 0x0004
#define ESC_EXTHZ1_DLD3 0x0008
#define ESC_EXTHZ1_DLD4 0x0010
#define ESC_EXTHZ1_DLD5 0x0020
#define ESC_EXTHZ1_DLD6 0x0040
#define ESC_EXTHZ1_DLD7 0x0080
#define ESC_EXTHZ1_DLDRST 0x0100
#define ESC_EXTHZ1_DLDTCK 0x0200
#define ESC_EXTHZ1_DLDMREQ 0x0400
#define ESC_PSW_UIPWRSPD 0x02
#define ESC_PSW_AIFPWRSPD 0x04
#define ESC_PSW_IPSPWRSPD 0x08
#define ESC_PSW_PRTPWRSPD 0x10
#define ESC_PSW_PSWRBTD_ENABLE 0x00
#define ESC_PSW_PSWRBTD_DISABLE 0x01
#define ESC_PSI_PWRSINT_UP 0x01
#define IPSCLKGEN_SWRESET_RST 0x0001
#define IPSCLKGEN_SWRESET_X2RST0 0x0010
#define IPSCLKGEN_SWRESET_X2RST1 0x0020
#define IPSCLKGEN_SWRESET_CGRST 0x0100
#define IPSCLKGEN_CSEL_INCLK 0x00000001
#define IPSCLKGEN_CSEL_RCLK1_RCLK0 0x00000100
#define IPSCLKGEN_CSEL_RCLK1_RCLK1 0x00000000
#define IPSCLKGEN_CSEL_RCLK2_RCLK0 0x00000020
#define IPSCLKGEN_CSEL_RCLK2_RCLK1 0x00000060
#define IPSCLKGEN_CSEL_RCLK2_RCLK2 0x00000000
#define IPSCLKGEN_CSEL_SYSCLK 0x00000100
#define IPSCLKGEN_CSEL_PLLTH 0x00010000
#define IPSCLKGEN_PLLENA_PLLENA 0x01
#define IPSCLKGEN_INT_PLLLOCKSTS 0x00000001
#define IPSCLKGEN_INT_PLLLOCKENA 0x00000100
#define IPSCLKGEN_INT_PLLLOCKFLG 0x00010000
#define ESC_UI2_BITMAP_ES (ESC_UI2_LCDCLKEN_ENABLE | ESC_UI2_LVDSCLK_ENABLE)
#define ESC_PSPDHZ0_IITIF_ES ( ESC_PSPDHZ0_GBUS | ESC_PSPDHZ0_IITMC \
                                    | ESC_PSPDHZ0_IPSBLK \
                                    | ESC_PSPDHZ0_UART4 )
#ifdef CONFIG_BOARD_BARAMOS
#define ESC_PSPDHZ0_ARM_ES ( ESC_PSPDHZ0_UART3 | ESC_PSPDHZ0_UART7 \
                                    | ESC_PSPDHZ0_UART8 | ESC_PSPDHZ0_I2C0 \
                                    | ESC_PSPDHZ0_I2C1 | ESC_PSPDHZ0_I2C2 )
#else
#define ESC_PSPDHZ0_ARM_ES ( ESC_PSPDHZ0_UART3 | ESC_PSPDHZ0_UART7 \
                                    | ESC_PSPDHZ0_UART8 )
#endif
#define ESC_PSPDMR_IITIF_ES ( ESC_PSPDM_GBUS \
                                    | ESC_PSPDM_IITMC | ESC_PSPDM_IPSBLK )
#define ESC_PSPDMR_ARM_ES ( ESC_PSPDM_ARM )
#define IPSCLKGEN_SWRESET_IITIF_ES ( IPSCLKGEN_SWRESET_RST | IPSCLKGEN_SWRESET_X2RST0 \
                                    | IPSCLKGEN_SWRESET_X2RST1 | IPSCLKGEN_SWRESET_CGRST )
#define ESC_PSPDHZ0_IOTIF_ES ( ESC_PSPDHZ0_PRNBLK | ESC_PSPDHZ0_UART0 )
#define ESC_PSPDHZ0_MCU_ES ( ESC_PSPDHZ0_PRNBLK | ESC_PSPDHZ0_UART0 \
                                    | ESC_PSPDHZ0_UART5 | ESC_PSPDHZ0_UART6 )
#define ESC_PSPDMR_CLKSLP_ES ( ESC_PSPDM_PRNBLK | ESC_PSPDM_SCANBLK )
#define ESC_PRT3_CLKSLP_ES (ESC_PRT3_PRNCLKEN | ESC_PRT3_IMGCLK_IMG0CLKEN << 8 \
                                    | ESC_PRT3_IMGCLK_IMG1CLKEN << 8 | ESC_PRT3_CVCLKEN << 16 )
#define ESC_PWM3_CLKSLP_ES ( ESC_PWM3_PWMCLKKEN | ESC_PWM3_PWMCLKYEN \
                                    | ESC_PWM3_PWMCLKMEN | ESC_PWM3_PWMCLKCEN )
#ifdef __cplusplus
}
#endif
#endif
