diff mbox

[U-Boot,2/8] ARM: keystone2: Enable CONFIG_DISPLAY_CPUINFO

Message ID 1437579558-26579-3-git-send-email-lokeshvutla@ti.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Lokesh Vutla July 22, 2015, 3:39 p.m. UTC
Add print_cpuinfo() function and enable
CONFIG_DISPLAY_CPUINFO for keystone platforms,
so that cpu info can be displayed during boot.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/mach-keystone/init.c        | 24 ++++++++++++++++++++++++
 include/configs/ti_armv7_keystone2.h |  1 +
 2 files changed, 25 insertions(+)

Comments

Vitaly Andrianov July 22, 2015, 3:56 p.m. UTC | #1
On 07/22/2015 11:39 AM, Lokesh Vutla wrote:
> Add print_cpuinfo() function and enable
> CONFIG_DISPLAY_CPUINFO for keystone platforms,
> so that cpu info can be displayed during boot.
>
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> ---
>   arch/arm/mach-keystone/init.c        | 24 ++++++++++++++++++++++++
>   include/configs/ti_armv7_keystone2.h |  1 +
>   2 files changed, 25 insertions(+)
>
> diff --git a/arch/arm/mach-keystone/init.c b/arch/arm/mach-keystone/init.c
> index c96845c..d742ad3 100644
> --- a/arch/arm/mach-keystone/init.c
> +++ b/arch/arm/mach-keystone/init.c
> @@ -149,3 +149,27 @@ void enable_caches(void)
>   	dcache_enable();
>   #endif
>   }
> +
> +#if defined(CONFIG_DISPLAY_CPUINFO)
> +int print_cpuinfo(void)
> +{
> +	u16 cpu = get_part_number();
> +
> +	puts("CPU: ");
> +	switch (cpu) {
> +	case CPU_66AK2Hx:
> +		puts("66AK2Hx\n");
> +		break;
> +	case CPU_66AK2Lx:
> +		puts("66AK2Lx\n");
> +		break;
> +	case CPU_66AK2Ex:
> +		puts("66AK2Ex\n");
> +		break;
> +	default:
> +		puts("Unknown\n");
> +	}
> +
> +	return 0;
> +}
> +#endif
> diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h
> index 198e365..056b938 100644
> --- a/include/configs/ti_armv7_keystone2.h
> +++ b/include/configs/ti_armv7_keystone2.h
> @@ -15,6 +15,7 @@
>   /* U-Boot Build Configuration */
>   #define CONFIG_SKIP_LOWLEVEL_INIT	/* U-Boot is a 2nd stage loader */
>   #define CONFIG_BOARD_EARLY_INIT_F
> +#define CONFIG_DISPLAY_CPUINFO
>
>   /* SoC Configuration */
>   #define CONFIG_ARCH_CPU_INIT
>
Reviewed-by: Vitaly Andrianov <vitalya@ti.com>
Tom Rini July 23, 2015, 7:29 p.m. UTC | #2
On Wed, Jul 22, 2015 at 09:09:12PM +0530, Lokesh Vutla wrote:

> Add print_cpuinfo() function and enable
> CONFIG_DISPLAY_CPUINFO for keystone platforms,
> so that cpu info can be displayed during boot.
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox

Patch

diff --git a/arch/arm/mach-keystone/init.c b/arch/arm/mach-keystone/init.c
index c96845c..d742ad3 100644
--- a/arch/arm/mach-keystone/init.c
+++ b/arch/arm/mach-keystone/init.c
@@ -149,3 +149,27 @@  void enable_caches(void)
 	dcache_enable();
 #endif
 }
+
+#if defined(CONFIG_DISPLAY_CPUINFO)
+int print_cpuinfo(void)
+{
+	u16 cpu = get_part_number();
+
+	puts("CPU: ");
+	switch (cpu) {
+	case CPU_66AK2Hx:
+		puts("66AK2Hx\n");
+		break;
+	case CPU_66AK2Lx:
+		puts("66AK2Lx\n");
+		break;
+	case CPU_66AK2Ex:
+		puts("66AK2Ex\n");
+		break;
+	default:
+		puts("Unknown\n");
+	}
+
+	return 0;
+}
+#endif
diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h
index 198e365..056b938 100644
--- a/include/configs/ti_armv7_keystone2.h
+++ b/include/configs/ti_armv7_keystone2.h
@@ -15,6 +15,7 @@ 
 /* U-Boot Build Configuration */
 #define CONFIG_SKIP_LOWLEVEL_INIT	/* U-Boot is a 2nd stage loader */
 #define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_DISPLAY_CPUINFO
 
 /* SoC Configuration */
 #define CONFIG_ARCH_CPU_INIT