diff options
author | Antony Pavlov <antonynpavlov@gmail.com> | 2011-08-05 14:58:42 +0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-08-05 18:20:30 +0200 |
commit | 017d5ca933ca2745d577ad4698f6ac884b43c36f (patch) | |
tree | 5ee8745e786d3e7207b6b691799fddd6be8ba8b2 /arch/mips/lib/cpuinfo.c | |
parent | 0a0479d426a463752015c888707dc8cd7325d0ff (diff) | |
download | barebox-017d5ca933ca2745d577ad4698f6ac884b43c36f.tar.gz barebox-017d5ca933ca2745d577ad4698f6ac884b43c36f.tar.xz |
MIPS: add draft cpuinfo command
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/mips/lib/cpuinfo.c')
-rw-r--r-- | arch/mips/lib/cpuinfo.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/mips/lib/cpuinfo.c b/arch/mips/lib/cpuinfo.c new file mode 100644 index 0000000000..7bdb02b8aa --- /dev/null +++ b/arch/mips/lib/cpuinfo.c @@ -0,0 +1,38 @@ +/* + * cpuinfo - show information about MIPS CPU + * + * Copyright (C) 2011 Antony Pavlov <antonynpavlov@gmail.com> + * + * This file is part of barebox. + * See file CREDITS for list of people who contributed to this project. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <common.h> +#include <command.h> +#include <asm/mipsregs.h> + +static int do_cpuinfo(struct command *cmdtp, int argc, char *argv[]) +{ + printf("CP0_PRID = 0x%08x\n", read_c0_prid()); + printf("CP0_CONFIG = 0x%08x\n", read_c0_config()); + + return 0; +} + +BAREBOX_CMD_START(cpuinfo) + .cmd = do_cpuinfo, + .usage = "Show info about CPU", +BAREBOX_CMD_END |