Path: blob/master/arch/arm/mach-bcmring/include/mach/reg_umi.h
10820 views
/*****************************************************************************1* Copyright 2005 - 2008 Broadcom Corporation. All rights reserved.2*3* Unless you and Broadcom execute a separate written software license4* agreement governing use of this software, this software is licensed to you5* under the terms of the GNU General Public License version 2, available at6* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").7*8* Notwithstanding the above, under no circumstances may you combine this9* software in any way with any other Broadcom software provided under a10* license other than the GPL, without Broadcom's express prior written11* consent.12*****************************************************************************/1314/*15*16*****************************************************************************17*18* REG_UMI.h19*20* PURPOSE:21*22* This file contains definitions for the nand registers:23*24* NOTES:25*26*****************************************************************************/2728#if !defined(__ASM_ARCH_REG_UMI_H)29#define __ASM_ARCH_REG_UMI_H3031/* ---- Include Files ---------------------------------------------------- */32#include <csp/reg.h>33#include <mach/csp/mm_io.h>3435/* ---- Constants and Types ---------------------------------------------- */3637/* Unified Memory Interface Ctrl Register */38#define HW_UMI_BASE MM_IO_BASE_UMI3940/* Flash bank 0 timing and control register */41#define REG_UMI_FLASH0_TCR __REG32(HW_UMI_BASE + 0x00)42/* Flash bank 1 timing and control register */43#define REG_UMI_FLASH1_TCR __REG32(HW_UMI_BASE + 0x04)44/* Flash bank 2 timing and control register */45#define REG_UMI_FLASH2_TCR __REG32(HW_UMI_BASE + 0x08)46/* MMD interface and control register */47#define REG_UMI_MMD_ICR __REG32(HW_UMI_BASE + 0x0c)48/* NAND timing and control register */49#define REG_UMI_NAND_TCR __REG32(HW_UMI_BASE + 0x18)50/* NAND ready/chip select register */51#define REG_UMI_NAND_RCSR __REG32(HW_UMI_BASE + 0x1c)52/* NAND ECC control & status register */53#define REG_UMI_NAND_ECC_CSR __REG32(HW_UMI_BASE + 0x20)54/* NAND ECC data register XXB2B1B0 */55#define REG_UMI_NAND_ECC_DATA __REG32(HW_UMI_BASE + 0x24)56/* BCH ECC Parameter N */57#define REG_UMI_BCH_N __REG32(HW_UMI_BASE + 0x40)58/* BCH ECC Parameter T */59#define REG_UMI_BCH_K __REG32(HW_UMI_BASE + 0x44)60/* BCH ECC Parameter K */61#define REG_UMI_BCH_T __REG32(HW_UMI_BASE + 0x48)62/* BCH ECC Contro Status */63#define REG_UMI_BCH_CTRL_STATUS __REG32(HW_UMI_BASE + 0x4C)64/* BCH WR ECC 31:0 */65#define REG_UMI_BCH_WR_ECC_0 __REG32(HW_UMI_BASE + 0x50)66/* BCH WR ECC 63:32 */67#define REG_UMI_BCH_WR_ECC_1 __REG32(HW_UMI_BASE + 0x54)68/* BCH WR ECC 95:64 */69#define REG_UMI_BCH_WR_ECC_2 __REG32(HW_UMI_BASE + 0x58)70/* BCH WR ECC 127:96 */71#define REG_UMI_BCH_WR_ECC_3 __REG32(HW_UMI_BASE + 0x5c)72/* BCH WR ECC 155:128 */73#define REG_UMI_BCH_WR_ECC_4 __REG32(HW_UMI_BASE + 0x60)74/* BCH Read Error Location 1,0 */75#define REG_UMI_BCH_RD_ERR_LOC_1_0 __REG32(HW_UMI_BASE + 0x64)76/* BCH Read Error Location 3,2 */77#define REG_UMI_BCH_RD_ERR_LOC_3_2 __REG32(HW_UMI_BASE + 0x68)78/* BCH Read Error Location 5,4 */79#define REG_UMI_BCH_RD_ERR_LOC_5_4 __REG32(HW_UMI_BASE + 0x6c)80/* BCH Read Error Location 7,6 */81#define REG_UMI_BCH_RD_ERR_LOC_7_6 __REG32(HW_UMI_BASE + 0x70)82/* BCH Read Error Location 9,8 */83#define REG_UMI_BCH_RD_ERR_LOC_9_8 __REG32(HW_UMI_BASE + 0x74)84/* BCH Read Error Location 11,10 */85#define REG_UMI_BCH_RD_ERR_LOC_B_A __REG32(HW_UMI_BASE + 0x78)8687/* REG_UMI_FLASH0/1/2_TCR, REG_UMI_SRAM0/1_TCR bits */88/* Enable wait pin during burst write or read */89#define REG_UMI_TCR_WAITEN 0x8000000090/* Enable mem ctrlr to work with ext mem of lower freq than AHB clk */91#define REG_UMI_TCR_LOWFREQ 0x4000000092/* 1=synch write, 0=async write */93#define REG_UMI_TCR_MEMTYPE_SYNCWRITE 0x2000000094/* 1=synch read, 0=async read */95#define REG_UMI_TCR_MEMTYPE_SYNCREAD 0x1000000096/* 1=page mode read, 0=normal mode read */97#define REG_UMI_TCR_MEMTYPE_PAGEREAD 0x0800000098/* page size/burst size (wrap only) */99#define REG_UMI_TCR_MEMTYPE_PGSZ_MASK 0x07000000100/* 4 word */101#define REG_UMI_TCR_MEMTYPE_PGSZ_4 0x00000000102/* 8 word */103#define REG_UMI_TCR_MEMTYPE_PGSZ_8 0x01000000104/* 16 word */105#define REG_UMI_TCR_MEMTYPE_PGSZ_16 0x02000000106/* 32 word */107#define REG_UMI_TCR_MEMTYPE_PGSZ_32 0x03000000108/* 64 word */109#define REG_UMI_TCR_MEMTYPE_PGSZ_64 0x04000000110/* 128 word */111#define REG_UMI_TCR_MEMTYPE_PGSZ_128 0x05000000112/* 256 word */113#define REG_UMI_TCR_MEMTYPE_PGSZ_256 0x06000000114/* 512 word */115#define REG_UMI_TCR_MEMTYPE_PGSZ_512 0x07000000116/* Page read access cycle / Burst write latency (n+2 / n+1) */117#define REG_UMI_TCR_TPRC_TWLC_MASK 0x00f80000118/* Bus turnaround cycle (n) */119#define REG_UMI_TCR_TBTA_MASK 0x00070000120/* Write pulse width cycle (n+1) */121#define REG_UMI_TCR_TWP_MASK 0x0000f800122/* Write recovery cycle (n+1) */123#define REG_UMI_TCR_TWR_MASK 0x00000600124/* Write address setup cycle (n+1) */125#define REG_UMI_TCR_TAS_MASK 0x00000180126/* Output enable delay cycle (n) */127#define REG_UMI_TCR_TOE_MASK 0x00000060128/* Read access cycle / Burst read latency (n+2 / n+1) */129#define REG_UMI_TCR_TRC_TLC_MASK 0x0000001f130131/* REG_UMI_MMD_ICR bits */132/* Flash write protection pin control */133#define REG_UMI_MMD_ICR_FLASH_WP 0x8000134/* Extend hold time for sram0, sram1 csn (39 MHz operation) */135#define REG_UMI_MMD_ICR_XHCS 0x4000136/* Enable SDRAM 2 interface control */137#define REG_UMI_MMD_ICR_SDRAM2EN 0x2000138/* Enable merge of flash banks 0/1 to 512 MBit bank */139#define REG_UMI_MMD_ICR_INST512 0x1000140/* Enable merge of flash banks 1/2 to 512 MBit bank */141#define REG_UMI_MMD_ICR_DATA512 0x0800142/* Enable SDRAM interface control */143#define REG_UMI_MMD_ICR_SDRAMEN 0x0400144/* Polarity of busy state of Burst Wait Signal */145#define REG_UMI_MMD_ICR_WAITPOL 0x0200146/* Enable burst clock stopped when not accessing external burst flash/sram */147#define REG_UMI_MMD_ICR_BCLKSTOP 0x0100148/* Enable the peri1_csn to replace flash1_csn in 512 Mb flash mode */149#define REG_UMI_MMD_ICR_PERI1EN 0x0080150/* Enable the peri2_csn to replace sdram_csn */151#define REG_UMI_MMD_ICR_PERI2EN 0x0040152/* Enable the peri3_csn to replace sdram2_csn */153#define REG_UMI_MMD_ICR_PERI3EN 0x0020154/* Enable sram bank1 for H/W controlled MRS */155#define REG_UMI_MMD_ICR_MRSB1 0x0010156/* Enable sram bank0 for H/W controlled MRS */157#define REG_UMI_MMD_ICR_MRSB0 0x0008158/* Polarity for assert3ed state of H/W controlled MRS */159#define REG_UMI_MMD_ICR_MRSPOL 0x0004160/* 0: S/W controllable ZZ/MRS/CRE/P-Mode pin */161/* 1: H/W controlled ZZ/MRS/CRE/P-Mode, same timing as CS */162#define REG_UMI_MMD_ICR_MRSMODE 0x0002163/* MRS state for S/W controlled mode */164#define REG_UMI_MMD_ICR_MRSSTATE 0x0001165166/* REG_UMI_NAND_TCR bits */167/* Enable software to control CS */168#define REG_UMI_NAND_TCR_CS_SWCTRL 0x80000000169/* 16-bit nand wordsize if set */170#define REG_UMI_NAND_TCR_WORD16 0x40000000171/* Bus turnaround cycle (n) */172#define REG_UMI_NAND_TCR_TBTA_MASK 0x00070000173/* Write pulse width cycle (n+1) */174#define REG_UMI_NAND_TCR_TWP_MASK 0x0000f800175/* Write recovery cycle (n+1) */176#define REG_UMI_NAND_TCR_TWR_MASK 0x00000600177/* Write address setup cycle (n+1) */178#define REG_UMI_NAND_TCR_TAS_MASK 0x00000180179/* Output enable delay cycle (n) */180#define REG_UMI_NAND_TCR_TOE_MASK 0x00000060181/* Read access cycle (n+2) */182#define REG_UMI_NAND_TCR_TRC_TLC_MASK 0x0000001f183184/* REG_UMI_NAND_RCSR bits */185/* Status: Ready=1, Busy=0 */186#define REG_UMI_NAND_RCSR_RDY 0x02187/* Keep CS asserted during operation */188#define REG_UMI_NAND_RCSR_CS_ASSERTED 0x01189190/* REG_UMI_NAND_ECC_CSR bits */191/* Interrupt status - read-only */192#define REG_UMI_NAND_ECC_CSR_NANDINT 0x80000000193/* Read: Status of ECC done, Write: clear ECC interrupt */194#define REG_UMI_NAND_ECC_CSR_ECCINT_RAW 0x00800000195/* Read: Status of R/B, Write: clear R/B interrupt */196#define REG_UMI_NAND_ECC_CSR_RBINT_RAW 0x00400000197/* 1 = Enable ECC Interrupt */198#define REG_UMI_NAND_ECC_CSR_ECCINT_ENABLE 0x00008000199/* 1 = Assert interrupt at rising edge of R/B_ */200#define REG_UMI_NAND_ECC_CSR_RBINT_ENABLE 0x00004000201/* Calculate ECC by 0=512 bytes, 1=256 bytes */202#define REG_UMI_NAND_ECC_CSR_256BYTE 0x00000080203/* Enable ECC in hardware */204#define REG_UMI_NAND_ECC_CSR_ECC_ENABLE 0x00000001205206/* REG_UMI_BCH_CTRL_STATUS bits */207/* Shift to Indicate Number of correctable errors detected */208#define REG_UMI_BCH_CTRL_STATUS_NB_CORR_ERROR_SHIFT 20209/* Indicate Number of correctable errors detected */210#define REG_UMI_BCH_CTRL_STATUS_NB_CORR_ERROR 0x00F00000211/* Indicate Errors detected during read but uncorrectable */212#define REG_UMI_BCH_CTRL_STATUS_UNCORR_ERR 0x00080000213/* Indicate Errors detected during read and are correctable */214#define REG_UMI_BCH_CTRL_STATUS_CORR_ERR 0x00040000215/* Flag indicates BCH's ECC status of read process are valid */216#define REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID 0x00020000217/* Flag indicates BCH's ECC status of write process are valid */218#define REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID 0x00010000219/* Pause ECC calculation */220#define REG_UMI_BCH_CTRL_STATUS_PAUSE_ECC_DEC 0x00000010221/* Enable Interrupt */222#define REG_UMI_BCH_CTRL_STATUS_INT_EN 0x00000004223/* Enable ECC during read */224#define REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN 0x00000002225/* Enable ECC during write */226#define REG_UMI_BCH_CTRL_STATUS_ECC_WR_EN 0x00000001227/* Mask for location */228#define REG_UMI_BCH_ERR_LOC_MASK 0x00001FFF229/* location within a byte */230#define REG_UMI_BCH_ERR_LOC_BYTE 0x00000007231/* location within a word */232#define REG_UMI_BCH_ERR_LOC_WORD 0x00000018233/* location within a page (512 byte) */234#define REG_UMI_BCH_ERR_LOC_PAGE 0x00001FE0235#define REG_UMI_BCH_ERR_LOC_ADDR(index) (__REG32(HW_UMI_BASE + 0x64 + (index / 2)*4) >> ((index % 2) * 16))236#endif237238239