diff options
author | Huang Shijie <b32955@freescale.com> | 2012-09-13 02:57:56 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-09-29 10:55:18 -0400 |
commit | d37e02d8f3a892b57738f1c1431779d5939214d1 (patch) | |
tree | fde851a10fb36607c90a9abd992d3b18cb7a2e8a /drivers/mtd/nand | |
parent | ae70ba2d6078d60c527c93076133accf59becaf8 (diff) |
mtd: gpmi: add a new field for HW_GPMI_CTRL1
add the WRN_DLY_SEL field for HW_GPMI_CTRL1.
This field is used as delay for gpmi write strobe.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-lib.c | 6 | ||||
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-nand.h | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-regs.h | 9 |
3 files changed, 17 insertions, 0 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c index 41e905dfc39..2d1f77c0527 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c | |||
@@ -731,6 +731,7 @@ return_results: | |||
731 | hw->use_half_periods = dll_use_half_periods; | 731 | hw->use_half_periods = dll_use_half_periods; |
732 | hw->sample_delay_factor = sample_delay_factor; | 732 | hw->sample_delay_factor = sample_delay_factor; |
733 | hw->device_busy_timeout = GPMI_DEFAULT_BUSY_TIMEOUT; | 733 | hw->device_busy_timeout = GPMI_DEFAULT_BUSY_TIMEOUT; |
734 | hw->wrn_dly_sel = BV_GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS; | ||
734 | 735 | ||
735 | /* Return success. */ | 736 | /* Return success. */ |
736 | return 0; | 737 | return 0; |
@@ -769,6 +770,11 @@ void gpmi_begin(struct gpmi_nand_data *this) | |||
769 | 770 | ||
770 | /* [3] The following code is to set the HW_GPMI_CTRL1. */ | 771 | /* [3] The following code is to set the HW_GPMI_CTRL1. */ |
771 | 772 | ||
773 | /* Set the WRN_DLY_SEL */ | ||
774 | writel(BM_GPMI_CTRL1_WRN_DLY_SEL, gpmi_regs + HW_GPMI_CTRL1_CLR); | ||
775 | writel(BF_GPMI_CTRL1_WRN_DLY_SEL(hw.wrn_dly_sel), | ||
776 | gpmi_regs + HW_GPMI_CTRL1_SET); | ||
777 | |||
772 | /* DLL_ENABLE must be set to 0 when setting RDN_DELAY or HALF_PERIOD. */ | 778 | /* DLL_ENABLE must be set to 0 when setting RDN_DELAY or HALF_PERIOD. */ |
773 | writel(BM_GPMI_CTRL1_DLL_ENABLE, gpmi_regs + HW_GPMI_CTRL1_CLR); | 779 | writel(BM_GPMI_CTRL1_DLL_ENABLE, gpmi_regs + HW_GPMI_CTRL1_CLR); |
774 | 780 | ||
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h index c814bddaffc..5c11e761a32 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h | |||
@@ -195,6 +195,7 @@ struct gpmi_nand_data { | |||
195 | * @use_half_periods: Indicates the clock is running slowly, so the | 195 | * @use_half_periods: Indicates the clock is running slowly, so the |
196 | * NFC DLL should use half-periods. | 196 | * NFC DLL should use half-periods. |
197 | * @sample_delay_factor: The sample delay factor. | 197 | * @sample_delay_factor: The sample delay factor. |
198 | * @wrn_dly_sel: The delay on the GPMI write strobe. | ||
198 | */ | 199 | */ |
199 | struct gpmi_nfc_hardware_timing { | 200 | struct gpmi_nfc_hardware_timing { |
200 | /* for HW_GPMI_TIMING0 */ | 201 | /* for HW_GPMI_TIMING0 */ |
@@ -209,6 +210,7 @@ struct gpmi_nfc_hardware_timing { | |||
209 | /* for HW_GPMI_CTRL1 */ | 210 | /* for HW_GPMI_CTRL1 */ |
210 | bool use_half_periods; | 211 | bool use_half_periods; |
211 | uint8_t sample_delay_factor; | 212 | uint8_t sample_delay_factor; |
213 | uint8_t wrn_dly_sel; | ||
212 | }; | 214 | }; |
213 | 215 | ||
214 | /** | 216 | /** |
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-regs.h b/drivers/mtd/nand/gpmi-nand/gpmi-regs.h index 8994e201924..53397cc290f 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-regs.h +++ b/drivers/mtd/nand/gpmi-nand/gpmi-regs.h | |||
@@ -108,6 +108,15 @@ | |||
108 | #define HW_GPMI_CTRL1_CLR 0x00000068 | 108 | #define HW_GPMI_CTRL1_CLR 0x00000068 |
109 | #define HW_GPMI_CTRL1_TOG 0x0000006c | 109 | #define HW_GPMI_CTRL1_TOG 0x0000006c |
110 | 110 | ||
111 | #define BP_GPMI_CTRL1_WRN_DLY_SEL 22 | ||
112 | #define BM_GPMI_CTRL1_WRN_DLY_SEL (0x3 << BP_GPMI_CTRL1_WRN_DLY_SEL) | ||
113 | #define BF_GPMI_CTRL1_WRN_DLY_SEL(v) \ | ||
114 | (((v) << BP_GPMI_CTRL1_WRN_DLY_SEL) & BM_GPMI_CTRL1_WRN_DLY_SEL) | ||
115 | #define BV_GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS 0x0 | ||
116 | #define BV_GPMI_CTRL1_WRN_DLY_SEL_6_TO_10NS 0x1 | ||
117 | #define BV_GPMI_CTRL1_WRN_DLY_SEL_7_TO_12NS 0x2 | ||
118 | #define BV_GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY 0x3 | ||
119 | |||
111 | #define BM_GPMI_CTRL1_BCH_MODE (1 << 18) | 120 | #define BM_GPMI_CTRL1_BCH_MODE (1 << 18) |
112 | 121 | ||
113 | #define BP_GPMI_CTRL1_DLL_ENABLE 17 | 122 | #define BP_GPMI_CTRL1_DLL_ENABLE 17 |