* rename a10-meminfo to meminfo
* add static build to Makefile
* fix operand warning
* built binary verified on proper linux and android

Signed-off-by: Luc Verhaegen <[email protected]>
---
 .gitignore                 |    1 +
 Makefile                   |    3 +++
 README                     |    6 ++++++
 a10-meminfo.c => meminfo.c |    2 +-
 4 files changed, 11 insertions(+), 1 deletions(-)
 rename a10-meminfo.c => meminfo.c (99%)

diff --git a/.gitignore b/.gitignore
index 22df838..490a572 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,5 +5,6 @@ bootinfo
 fel
 pio
 nand-part
+meminfo
 *.o
 *.swp
diff --git a/Makefile b/Makefile
index f58bced..922da8f 100644
--- a/Makefile
+++ b/Makefile
@@ -111,6 +111,9 @@ boot_head_sun5i.bin: boot_head_sun5i.elf
 
 bootinfo: bootinfo.c
 
+meminfo: meminfo.c
+       $(CROSS_COMPILE)gcc -g -O0 -Wall -static -o $@ $^
+
 .gitignore: Makefile
        @for x in $(TOOLS) '*.o' '*.swp'; do \
                echo "$$x"; \
diff --git a/README b/README
index 506930f..e71933f 100644
--- a/README
+++ b/README
@@ -60,5 +60,11 @@ phoenix_info:
        phoenixcard utility and optionally extracts the embedded boot
        code & firmware file from their hidden partitions.
 
+meminfo:
+       Tool for reading DRAM settings from registers. Compiled as a
+       static binary for use on android and other OSes. To build this,
+       get a toolchain, and run:
+               make CROSS_COMPILE=arm-linux-gnueabihf- meminfo
+
 This software is licensed under the terms of GPLv2+ as defined by the
 Free Software Foundation, details can be read in the COPYING file.
diff --git a/a10-meminfo.c b/meminfo.c
similarity index 99%
rename from a10-meminfo.c
rename to meminfo.c
index 9814783..4455bc0 100644
--- a/a10-meminfo.c
+++ b/meminfo.c
@@ -243,7 +243,7 @@ int main(int argc, char **argv)
     p.cas    = (r->mr >> 4 & 15);
     if (p.type == 3)
         p.cas += 4;
-    p.density  = 1 << 8+(r->dcr >> 3 & 7);
+    p.density  = (1 << 8) + (r->dcr >> 3 & 7);
     p.rank_num = (r->dcr >> 10 & 3)+1;
     p.io_width = (r->dcr >> 1 & 3) << 3;
     p.bus_width = ((r->dcr >> 6 & 3)+1) << 3;
-- 
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