[U-Boot] [patch] Add display cpuinfo for Atmel at91sam9261 Cores

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon May 18 22:25:43 CEST 2009


On 22:06 Sat 02 May     , Remy Bohmer wrote:
> This patch adds support for displaying CPU type information
> about Atmel AT91 cores during boot. It currently only configures it for the
> at91sam9261ek board, but it can easily be configured for all at91 based cores.
please do this in two seperate patch
please ask Stelian
CC
btw please use git
> 
> This patch also provides at91_dbgu.h which is also used by the upcoming
> USB CDC-ethernet and USB-gadget support for this board.
> 
> Signed-off-by: Remy Böhmer <linux at bohmer.net>
> ---
>  cpu/arm926ejs/at91/Makefile           |    1 
>  cpu/arm926ejs/at91/cpuinfo.c          |   83 ++++++++++++++++++++++++++++
>  include/asm-arm/arch-at91/at91_dbgu.h |   69 +++++++++++++++++++++++
>  include/asm-arm/arch-at91/cpu.h       |   99 ++++++++++++++++++++++++++++++++++
>  include/configs/at91sam9261ek.h       |    2 
>  5 files changed, 254 insertions(+)
>  create mode 100644 cpu/arm926ejs/at91/cpuinfo.c
>  create mode 100644 include/asm-arm/arch-at91/at91_dbgu.h
>  create mode 100644 include/asm-arm/arch-at91/cpu.h
> 
> Index: u-boot-usb.tmp/cpu/arm926ejs/at91/Makefile
> ===================================================================
> --- u-boot-usb.tmp.orig/cpu/arm926ejs/at91/Makefile	2009-05-02 21:43:41.000000000 +0200
> +++ u-boot-usb.tmp/cpu/arm926ejs/at91/Makefile	2009-05-02 22:01:46.000000000 +0200
> @@ -55,6 +55,7 @@ COBJS-y				+= at91sam9rl_serial.o
>  COBJS-$(CONFIG_HAS_DATAFLASH)	+= at91sam9rl_spi.o
>  endif
>  COBJS-$(CONFIG_AT91_LED)	+= led.o
> +COBJS-$(CONFIG_DISPLAY_CPUINFO) +=cpuinfo.o
>  COBJS-y += clock.o
>  COBJS-y += cpu.o
>  COBJS-y	+= timer.o
> Index: u-boot-usb.tmp/cpu/arm926ejs/at91/cpuinfo.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ u-boot-usb.tmp/cpu/arm926ejs/at91/cpuinfo.c	2009-05-02 22:01:46.000000000 +0200
> @@ -0,0 +1,83 @@
> +#include <command.h>
> +#include <common.h>
> +#include <arm926ejs.h>
> +#include <asm/hardware.h>
> +#include <asm/arch/at91_dbgu.h>
> +#include <asm/arch/io.h>
> +
> +int print_cpuinfo(void)
> +{
> +	unsigned long cidr;
> +	const char *txt;
> +
> +	cidr = at91_sys_read(AT91_DBGU_CIDR);
> +
could you use the CONFIG_ARM926EJS and other configs to reduce the size impact
> +	switch ((cidr & AT91_CIDR_EPROC) >> 5) {
> +	case 0x1: txt = "ARM946ES";	break;
> +	case 0x2: txt = "ARM7TDMI";	break;
> +	case 0x4: txt = "ARM920T";	break;
> +	case 0x5: txt = "ARM926EJS";	break;
> +	default:  txt = "undefined";	break;
> +	}
> +	printf("Embedded Processor: %s\n", txt);
otherwise ok

Best Regards,
J.


More information about the U-Boot mailing list