imx233: add emi debug info

Change-Id: I33317ae26b70c825d4c5e3aaac364da5e0dc06c2
This commit is contained in:
Amaury Pouly 2013-07-07 17:29:14 +02:00
parent af4e408555
commit 659febc749
3 changed files with 63 additions and 1 deletions

View file

@ -20,6 +20,7 @@
****************************************************************************/
#include "emi-imx233.h"
#include "clkctrl-imx233.h"
#include "string.h"
struct emi_reg_t
{
@ -199,3 +200,16 @@ void imx233_emi_set_frequency(unsigned long freq)
restore_interrupt(oldstatus);
}
#endif
struct imx233_emi_info_t imx233_emi_get_info(void)
{
struct imx233_emi_info_t info;
memset(&info, 0, sizeof(info));
info.rows = 13 - BF_RD(DRAM_CTL10, ADDR_PINS);
info.columns = 12 - BF_RD(DRAM_CTL11, COLUMN_SIZE);
info.cas = BF_RD(DRAM_CTL13, CASLAT_LIN);
info.banks = 4;
info.chips = __builtin_popcount(BF_RD(DRAM_CTL14, CS_MAP));
info.size = 2 * (1 << (info.rows + info.columns)) * info.chips * info.banks;
return info;
}