diff options
Diffstat (limited to 'firmware/target/arm/imx233/emi-imx233.c')
-rw-r--r-- | firmware/target/arm/imx233/emi-imx233.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/emi-imx233.c b/firmware/target/arm/imx233/emi-imx233.c index c62fa58a99..7e44c17c05 100644 --- a/firmware/target/arm/imx233/emi-imx233.c +++ b/firmware/target/arm/imx233/emi-imx233.c | |||
@@ -20,6 +20,7 @@ | |||
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | #include "emi-imx233.h" | 21 | #include "emi-imx233.h" |
22 | #include "clkctrl-imx233.h" | 22 | #include "clkctrl-imx233.h" |
23 | #include "string.h" | ||
23 | 24 | ||
24 | struct emi_reg_t | 25 | struct emi_reg_t |
25 | { | 26 | { |
@@ -199,3 +200,16 @@ void imx233_emi_set_frequency(unsigned long freq) | |||
199 | restore_interrupt(oldstatus); | 200 | restore_interrupt(oldstatus); |
200 | } | 201 | } |
201 | #endif | 202 | #endif |
203 | |||
204 | struct imx233_emi_info_t imx233_emi_get_info(void) | ||
205 | { | ||
206 | struct imx233_emi_info_t info; | ||
207 | memset(&info, 0, sizeof(info)); | ||
208 | info.rows = 13 - BF_RD(DRAM_CTL10, ADDR_PINS); | ||
209 | info.columns = 12 - BF_RD(DRAM_CTL11, COLUMN_SIZE); | ||
210 | info.cas = BF_RD(DRAM_CTL13, CASLAT_LIN); | ||
211 | info.banks = 4; | ||
212 | info.chips = __builtin_popcount(BF_RD(DRAM_CTL14, CS_MAP)); | ||
213 | info.size = 2 * (1 << (info.rows + info.columns)) * info.chips * info.banks; | ||
214 | return info; | ||
215 | } \ No newline at end of file | ||