meminfo: rename and add to build

* 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 <libv@skynet.be>
This commit is contained in:
Luc Verhaegen 2014-08-10 15:44:45 +02:00 committed by Alejandro Mery
parent bfc61ea903
commit d4e34bcb5a
4 changed files with 11 additions and 1 deletions

1
.gitignore vendored
View File

@ -5,5 +5,6 @@ bootinfo
fel
pio
nand-part
meminfo
*.o
*.swp

View File

@ -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"; \

6
README
View File

@ -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.

View File

@ -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;