Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
801c821f
Commit
801c821f
authored
Aug 18, 2014
by
Luc Verhaegen
Browse files
meminfo: various cleanups
No functional changes. Signed-off-by:
Luc Verhaegen
<
libv@skynet.be
>
parent
6db88cd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
meminfo.c
View file @
801c821f
/*
*
A10-
me
m
in
fo
*
Dumps DRAM controller settings
*
Copyright (C) 2012 Floris Bos <bos@je-eigen-do
mein
.nl>
*
Copyright (c) 2014 Luc Verhaegen <libv@skynet.be>
*
* Author: Floris Bos
* License: GPL
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Compile with: gcc -static -o a10-meminfo-static a10-meminfo.c
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <fcntl.h>
#include <assert.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdint.h>
#include <errno.h>
#include <sys/io.h>
typedef
uint32_t
u32
;
/* from u-boot code: */
struct
dram_para
{
u32
baseaddr
;
u32
clock
;
...
...
@@ -234,9 +237,10 @@ dram_para_print_uboot(struct dram_para *dram_para)
printf
(
"}
\n
"
);
}
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
*
argv
[])
{
struct
dram_para
p
=
{
0
};
struct
dram_para
dram_para
=
{
0
};
int
ret
;
devmem_fd
=
open
(
DEVMEM_FILE
,
O_RDWR
);
...
...
@@ -246,16 +250,15 @@ int main(int argc, char **argv)
return
errno
;
}
ret
=
dram_parameters_read
(
&
p
);
ret
=
dram_parameters_read
(
&
dram_para
);
if
(
ret
)
return
ret
;
ret
=
dram_clock_read
(
&
p
);
ret
=
dram_clock_read
(
&
dram_para
);
if
(
ret
)
return
ret
;
dram_para_print_uboot
(
&
p
);
dram_para_print_uboot
(
&
dram_para
);
return
0
;
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment