diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/avr32/mach-at32ap/hsmc.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/avr32/mach-at32ap/hsmc.c b/arch/avr32/mach-at32ap/hsmc.c index 7691721928a7..5e22a750632b 100644 --- a/arch/avr32/mach-at32ap/hsmc.c +++ b/arch/avr32/mach-at32ap/hsmc.c | |||
@@ -75,12 +75,35 @@ int smc_set_configuration(int cs, const struct smc_config *config) | |||
75 | return -EINVAL; | 75 | return -EINVAL; |
76 | } | 76 | } |
77 | 77 | ||
78 | switch (config->nwait_mode) { | ||
79 | case 0: | ||
80 | mode |= HSMC_BF(EXNW_MODE, HSMC_EXNW_MODE_DISABLED); | ||
81 | break; | ||
82 | case 1: | ||
83 | mode |= HSMC_BF(EXNW_MODE, HSMC_EXNW_MODE_RESERVED); | ||
84 | break; | ||
85 | case 2: | ||
86 | mode |= HSMC_BF(EXNW_MODE, HSMC_EXNW_MODE_FROZEN); | ||
87 | break; | ||
88 | case 3: | ||
89 | mode |= HSMC_BF(EXNW_MODE, HSMC_EXNW_MODE_READY); | ||
90 | break; | ||
91 | default: | ||
92 | return -EINVAL; | ||
93 | } | ||
94 | |||
95 | if (config->tdf_cycles) { | ||
96 | mode |= HSMC_BF(TDF_CYCLES, config->tdf_cycles); | ||
97 | } | ||
98 | |||
78 | if (config->nrd_controlled) | 99 | if (config->nrd_controlled) |
79 | mode |= HSMC_BIT(READ_MODE); | 100 | mode |= HSMC_BIT(READ_MODE); |
80 | if (config->nwe_controlled) | 101 | if (config->nwe_controlled) |
81 | mode |= HSMC_BIT(WRITE_MODE); | 102 | mode |= HSMC_BIT(WRITE_MODE); |
82 | if (config->byte_write) | 103 | if (config->byte_write) |
83 | mode |= HSMC_BIT(BAT); | 104 | mode |= HSMC_BIT(BAT); |
105 | if (config->tdf_mode) | ||
106 | mode |= HSMC_BIT(TDF_MODE); | ||
84 | 107 | ||
85 | pr_debug("smc cs%d: setup/%08x pulse/%08x cycle/%08x mode/%08x\n", | 108 | pr_debug("smc cs%d: setup/%08x pulse/%08x cycle/%08x mode/%08x\n", |
86 | cs, setup, pulse, cycle, mode); | 109 | cs, setup, pulse, cycle, mode); |