diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 18:19:05 -0700 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 18:19:05 -0700 | 
| commit | 61464c8357c8f6b780e4c44f5c79471799c51ca7 (patch) | |
| tree | 4509cf075403965528f380f2f825c46908fb7d4e /drivers/mtd/nand/nand_bcm_umi.h | |
| parent | 47061eda2584b9e4516d1e3a9713406a3a559ac8 (diff) | |
| parent | 9cf1c871526cf6bfec2a653e1e068ee72592542c (diff) | |
| download | olio-linux-3.10-61464c8357c8f6b780e4c44f5c79471799c51ca7.tar.xz olio-linux-3.10-61464c8357c8f6b780e4c44f5c79471799c51ca7.zip  | |
Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM soc general cleanups from Olof Johansson:
 "This is a large branch that contains a handful of different cleanups:
   - Fixing up the I/O space remapping on PCI on ARM.  This is a series
     from Rob Herring that restructures how all pci devices allocate I/O
     space, and it's part of the work to allow multiplatform kernels.
   - A number of cleanup series for OMAP, moving and removing some
     headers, sparse irq rework and in general preparation for
     multiplatform.
   - Final removal of all non-DT boards for Tegra, it is now
     device-tree-only!
   - Removal of a stale platform, nxp4008.  It's an old mobile chipset
     that is no longer in use, and was very likely never really used
     with a mainline kernel.  We have not been able to find anyone
     interested in keeping it around in the kernel.
   - Removal of the legacy dmaengine driver on tegra
  + A handful of other things that I haven't described above."
Fix up some conflicts with the staging tree (and because nxp4008 was
removed)
* tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (184 commits)
  ARM: OMAP2+: serial: Change MAX_HSUART_PORTS to 6
  ARM: OMAP4: twl-common: Support for additional devices on i2c1 bus
  ARM: mmp: using for_each_set_bit to simplify the code
  ARM: tegra: harmony: fix ldo7 regulator-name
  ARM: OMAP2+: Make omap4-keypad.h local
  ARM: OMAP2+: Make l4_3xxx.h local
  ARM: OMAP2+: Make l4_2xxx.h local
  ARM: OMAP2+: Make l3_3xxx.h local
  ARM: OMAP2+: Make l3_2xxx.h local
  ARM: OMAP1: Move irda.h from plat to mach
  ARM: OMAP2+: Make hdq1w.h local
  ARM: OMAP2+: Make gpmc-smsc911x.h local
  ARM: OMAP2+: Make gpmc-smc91x.h local
  ARM: OMAP1: Move flash.h from plat to mach
  ARM: OMAP2+: Make debug-devices.h local
  ARM: OMAP1: Move board-voiceblue.h from plat to mach
  ARM: OMAP1: Move board-sx1.h from plat to mach
  ARM: OMAP2+: Make omap-wakeupgen.h local
  ARM: OMAP2+: Make omap-secure.h local
  ARM: OMAP2+: Make ctrl_module_wkup_44xx.h local
  ...
Diffstat (limited to 'drivers/mtd/nand/nand_bcm_umi.h')
| -rw-r--r-- | drivers/mtd/nand/nand_bcm_umi.h | 73 | 
1 files changed, 36 insertions, 37 deletions
diff --git a/drivers/mtd/nand/nand_bcm_umi.h b/drivers/mtd/nand/nand_bcm_umi.h index 198b304d6f7..d90186684db 100644 --- a/drivers/mtd/nand/nand_bcm_umi.h +++ b/drivers/mtd/nand/nand_bcm_umi.h @@ -17,7 +17,7 @@  /* ---- Include Files ---------------------------------------------------- */  #include <mach/reg_umi.h>  #include <mach/reg_nand.h> -#include <cfg_global.h> +#include <mach/cfg_global.h>  /* ---- Constants and Types ---------------------------------------------- */  #if (CFG_GLOBAL_CHIP_FAMILY == CFG_GLOBAL_CHIP_FAMILY_BCMRING) @@ -48,7 +48,7 @@ int nand_bcm_umi_bch_correct_page(uint8_t *datap, uint8_t *readEccData,  /* Check in device is ready */  static inline int nand_bcm_umi_dev_ready(void)  { -	return REG_UMI_NAND_RCSR & REG_UMI_NAND_RCSR_RDY; +	return readl(®_UMI_NAND_RCSR) & REG_UMI_NAND_RCSR_RDY;  }  /* Wait until device is ready */ @@ -62,10 +62,11 @@ static inline void nand_bcm_umi_wait_till_ready(void)  static inline void nand_bcm_umi_hamming_enable_hwecc(void)  {  	/* disable and reset ECC, 512 byte page */ -	REG_UMI_NAND_ECC_CSR &= ~(REG_UMI_NAND_ECC_CSR_ECC_ENABLE | -		REG_UMI_NAND_ECC_CSR_256BYTE); +	writel(readl(®_UMI_NAND_ECC_CSR) & ~(REG_UMI_NAND_ECC_CSR_ECC_ENABLE | +		REG_UMI_NAND_ECC_CSR_256BYTE), ®_UMI_NAND_ECC_CSR);  	/* enable ECC */ -	REG_UMI_NAND_ECC_CSR |= REG_UMI_NAND_ECC_CSR_ECC_ENABLE; +	writel(readl(®_UMI_NAND_ECC_CSR) | REG_UMI_NAND_ECC_CSR_ECC_ENABLE, +		®_UMI_NAND_ECC_CSR);  }  #if NAND_ECC_BCH @@ -76,18 +77,18 @@ static inline void nand_bcm_umi_hamming_enable_hwecc(void)  static inline void nand_bcm_umi_bch_enable_read_hwecc(void)  {  	/* disable and reset ECC */ -	REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID; +	writel(REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID, ®_UMI_BCH_CTRL_STATUS);  	/* Turn on ECC */ -	REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN; +	writel(REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN, ®_UMI_BCH_CTRL_STATUS);  }  /* Enable BCH Write ECC */  static inline void nand_bcm_umi_bch_enable_write_hwecc(void)  {  	/* disable and reset ECC */ -	REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID; +	writel(REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID, ®_UMI_BCH_CTRL_STATUS);  	/* Turn on ECC */ -	REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_ECC_WR_EN; +	writel(REG_UMI_BCH_CTRL_STATUS_ECC_WR_EN, ®_UMI_BCH_CTRL_STATUS);  }  /* Config number of BCH ECC bytes */ @@ -99,9 +100,9 @@ static inline void nand_bcm_umi_bch_config_ecc(uint8_t numEccBytes)  	uint32_t numBits = numEccBytes * 8;  	/* disable and reset ECC */ -	REG_UMI_BCH_CTRL_STATUS = -	    REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID | -	    REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID; +	writel(REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID | +	       REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID, +	       ®_UMI_BCH_CTRL_STATUS);  	/* Every correctible bit requires 13 ECC bits */  	tValue = (uint32_t) (numBits / ECC_BITS_PER_CORRECTABLE_BIT); @@ -113,23 +114,21 @@ static inline void nand_bcm_umi_bch_config_ecc(uint8_t numEccBytes)  	kValue = nValue - (tValue * ECC_BITS_PER_CORRECTABLE_BIT);  	/* Write the settings */ -	REG_UMI_BCH_N = nValue; -	REG_UMI_BCH_T = tValue; -	REG_UMI_BCH_K = kValue; +	writel(nValue, ®_UMI_BCH_N); +	writel(tValue, ®_UMI_BCH_T); +	writel(kValue, ®_UMI_BCH_K);  }  /* Pause during ECC read calculation to skip bytes in OOB */  static inline void nand_bcm_umi_bch_pause_read_ecc_calc(void)  { -	REG_UMI_BCH_CTRL_STATUS = -	    REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN | -	    REG_UMI_BCH_CTRL_STATUS_PAUSE_ECC_DEC; +	writel(REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN | REG_UMI_BCH_CTRL_STATUS_PAUSE_ECC_DEC, ®_UMI_BCH_CTRL_STATUS);  }  /* Resume during ECC read calculation after skipping bytes in OOB */  static inline void nand_bcm_umi_bch_resume_read_ecc_calc(void)  { -	REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN; +	writel(REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN, ®_UMI_BCH_CTRL_STATUS);  }  /* Poll read ECC calc to check when hardware completes */ @@ -139,7 +138,7 @@ static inline uint32_t nand_bcm_umi_bch_poll_read_ecc_calc(void)  	do {  		/* wait for ECC to be valid */ -		regVal = REG_UMI_BCH_CTRL_STATUS; +		regVal = readl(®_UMI_BCH_CTRL_STATUS);  	} while ((regVal & REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID) == 0);  	return regVal; @@ -149,7 +148,7 @@ static inline uint32_t nand_bcm_umi_bch_poll_read_ecc_calc(void)  static inline void nand_bcm_umi_bch_poll_write_ecc_calc(void)  {  	/* wait for ECC to be valid */ -	while ((REG_UMI_BCH_CTRL_STATUS & REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID) +	while ((readl(®_UMI_BCH_CTRL_STATUS) & REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID)  	       == 0)  		;  } @@ -170,9 +169,9 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize,  	if (pageSize != NAND_DATA_ACCESS_SIZE) {  		/* skip BI */  #if defined(__KERNEL__) && !defined(STANDALONE) -		*oobp++ = REG_NAND_DATA8; +		*oobp++ = readb(®_NAND_DATA8);  #else -		REG_NAND_DATA8; +		readb(®_NAND_DATA8);  #endif  		numToRead--;  	} @@ -180,9 +179,9 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize,  	while (numToRead > numEccBytes) {  		/* skip free oob region */  #if defined(__KERNEL__) && !defined(STANDALONE) -		*oobp++ = REG_NAND_DATA8; +		*oobp++ = readb(®_NAND_DATA8);  #else -		REG_NAND_DATA8; +		readb(®_NAND_DATA8);  #endif  		numToRead--;  	} @@ -193,11 +192,11 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize,  		while (numToRead > 11) {  #if defined(__KERNEL__) && !defined(STANDALONE) -			*oobp = REG_NAND_DATA8; +			*oobp = readb(®_NAND_DATA8);  			eccCalc[eccPos++] = *oobp;  			oobp++;  #else -			eccCalc[eccPos++] = REG_NAND_DATA8; +			eccCalc[eccPos++] = readb(®_NAND_DATA8);  #endif  			numToRead--;  		} @@ -207,9 +206,9 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize,  		if (numToRead == 11) {  			/* read BI */  #if defined(__KERNEL__) && !defined(STANDALONE) -			*oobp++ = REG_NAND_DATA8; +			*oobp++ = readb(®_NAND_DATA8);  #else -			REG_NAND_DATA8; +			readb(®_NAND_DATA8);  #endif  			numToRead--;  		} @@ -219,11 +218,11 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize,  	nand_bcm_umi_bch_resume_read_ecc_calc();  	while (numToRead) {  #if defined(__KERNEL__) && !defined(STANDALONE) -		*oobp = REG_NAND_DATA8; +		*oobp = readb(®_NAND_DATA8);  		eccCalc[eccPos++] = *oobp;  		oobp++;  #else -		eccCalc[eccPos++] = REG_NAND_DATA8; +		eccCalc[eccPos++] = readb(®_NAND_DATA8);  #endif  		numToRead--;  	} @@ -255,7 +254,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,  	if (pageSize == NAND_DATA_ACCESS_SIZE) {  		/* Now fill in the ECC bytes */  		if (numEccBytes >= 13) -			eccVal = REG_UMI_BCH_WR_ECC_3; +			eccVal = readl(®_UMI_BCH_WR_ECC_3);  		/* Usually we skip CM in oob[0,1] */  		NAND_BCM_UMI_ECC_WRITE(numEccBytes, 15, &oobp[0], @@ -268,7 +267,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,  			eccVal & 0xff);	/* ECC 12 */  		if (numEccBytes >= 9) -			eccVal = REG_UMI_BCH_WR_ECC_2; +			eccVal = readl(®_UMI_BCH_WR_ECC_2);  		NAND_BCM_UMI_ECC_WRITE(numEccBytes, 12, &oobp[3],  			(eccVal >> 24) & 0xff);	/* ECC11 */ @@ -281,7 +280,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,  		/* Now fill in the ECC bytes */  		if (numEccBytes >= 13) -			eccVal = REG_UMI_BCH_WR_ECC_3; +			eccVal = readl(®_UMI_BCH_WR_ECC_3);  		/* Usually skip CM in oob[1,2] */  		NAND_BCM_UMI_ECC_WRITE(numEccBytes, 15, &oobp[1], @@ -294,7 +293,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,  			eccVal & 0xff);	/* ECC12 */  		if (numEccBytes >= 9) -			eccVal = REG_UMI_BCH_WR_ECC_2; +			eccVal = readl(®_UMI_BCH_WR_ECC_2);  		NAND_BCM_UMI_ECC_WRITE(numEccBytes, 12, &oobp[4],  			(eccVal >> 24) & 0xff);	/* ECC11 */ @@ -309,7 +308,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,  		eccVal & 0xff);	/* ECC8 */  	if (numEccBytes >= 5) -		eccVal = REG_UMI_BCH_WR_ECC_1; +		eccVal = readl(®_UMI_BCH_WR_ECC_1);  	NAND_BCM_UMI_ECC_WRITE(numEccBytes, 8, &oobp[8],  		(eccVal >> 24) & 0xff);	/* ECC7 */ @@ -321,7 +320,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,  		eccVal & 0xff);	/* ECC4 */  	if (numEccBytes >= 1) -		eccVal = REG_UMI_BCH_WR_ECC_0; +		eccVal = readl(®_UMI_BCH_WR_ECC_0);  	NAND_BCM_UMI_ECC_WRITE(numEccBytes, 4, &oobp[12],  		(eccVal >> 24) & 0xff);	/* ECC3 */  |