Signed-off-by: Luc Verhaegen <[email protected]>
---
 meminfo.c |   65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/meminfo.c b/meminfo.c
index 8961fb2..bc8bb82 100644
--- a/meminfo.c
+++ b/meminfo.c
@@ -162,6 +162,7 @@ sunxi_dram_clock_read(unsigned int *clock)
        switch (soc_version) {
        case SUNXI_SOC_SUN6I:
        case SUNXI_SOC_SUN8I:
+       case SUNXI_SOC_SUN9I:
        case SUNXI_SOC_SUN10I:
                n++;
                break;
@@ -708,6 +709,67 @@ sun8i_dram_regs_print(void)
        return 0;
 }
 
+/*
+ *
+ */
+#define SUN9I_IO_DRAMCOM_BASE 0x01C62000
+#define SUN9I_IO_DRAMCOM_SIZE 0x1000
+#define SUN9I_IO_DRAMCTL0_BASE 0x01C63000
+#define SUN9I_IO_DRAMCTL0_SIZE 0x1000
+#define SUN9I_IO_DRAMCTL1_BASE 0x01C64000
+#define SUN9I_IO_DRAMCTL1_SIZE 0x1000
+#define SUN9I_IO_DRAMPHY0_BASE 0x01C65000
+#define SUN9I_IO_DRAMPHY0_SIZE 0x1000
+#define SUN9I_IO_DRAMPHY1_BASE 0x01C66000
+#define SUN9I_IO_DRAMPHY1_SIZE 0x1000
+
+static int
+sun9i_dram_regs_print(void)
+{
+       unsigned int clock;
+       int ret;
+
+       ret = sunxi_dram_clock_read(&clock);
+       if (ret)
+               return ret;
+
+       printf("DRAM Clock: %dMHz\n", clock);
+
+       ret = dram_register_range_print(SUN9I_IO_DRAMCOM_BASE,
+                                       SUN9I_IO_DRAMCOM_SIZE,
+                                       "DRAM COM", "SDR_COM");
+       if (ret)
+               return ret;
+
+
+       ret = dram_register_range_print(SUN9I_IO_DRAMCTL0_BASE,
+                                       SUN9I_IO_DRAMCTL0_SIZE,
+                                       "DRAM CTL0", "SDR_CTL0");
+       if (ret)
+               return ret;
+
+       ret = dram_register_range_print(SUN9I_IO_DRAMCTL1_BASE,
+                                       SUN9I_IO_DRAMCTL1_SIZE,
+                                       "DRAM CTL1", "SDR_CTL1");
+       if (ret)
+               return ret;
+
+
+       ret = dram_register_range_print(SUN9I_IO_DRAMPHY0_BASE,
+                                       SUN9I_IO_DRAMPHY0_SIZE,
+                                       "DRAM PHY0", "SDR_PHY0");
+       if (ret)
+               return ret;
+
+       ret = dram_register_range_print(SUN9I_IO_DRAMPHY1_BASE,
+                                       SUN9I_IO_DRAMPHY1_SIZE,
+                                       "DRAM PHY1", "SDR_PHY1");
+       if (ret)
+               return ret;
+
+       return 0;
+}
+
 static void
 print_usage(const char *name)
 {
@@ -765,6 +827,7 @@ main(int argc, char *argv[])
        ret = soc_version_read();
        if (ret)
                return ret;
+
        switch (soc_version) {
        case SUNXI_SOC_SUN4I:
        case SUNXI_SOC_SUN5I:
@@ -775,6 +838,8 @@ main(int argc, char *argv[])
        case SUNXI_SOC_SUN8I:
        case SUNXI_SOC_SUN10I:
                return sun8i_dram_regs_print();
+       case SUNXI_SOC_SUN9I:
+               return sun9i_dram_regs_print();
        default:
                fprintf(stderr, "Error: unknown or unhandled Soc: 0x%04X\n",
                        soc_version);
-- 
1.7.7

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to