From: Lothar Waßmann Date: Mon, 18 Apr 2016 07:43:23 +0000 (+0200) Subject: karo: tx6: replace open coded interpretation of cpurev by calls to is_cpu_type() X-Git-Tag: KARO-TX6-2016-04-26~10 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=commitdiff_plain;h=30401a38543b1ed9439818c6f30d1f34909d64b5 karo: tx6: replace open coded interpretation of cpurev by calls to is_cpu_type() --- diff --git a/board/karo/tx6/tx6qdl.c b/board/karo/tx6/tx6qdl.c index 5a0e2a8193..6a0564ef94 100644 --- a/board/karo/tx6/tx6qdl.c +++ b/board/karo/tx6/tx6qdl.c @@ -345,23 +345,18 @@ int checkboard(void) u32 cpurev = get_cpu_rev(); char *cpu_str = "?"; - switch ((cpurev >> 12) & 0xff) { - case MXC_CPU_MX6SL: + if (is_cpu_type(MXC_CPU_MX6SL)) { cpu_str = "SL"; tx6_mod_suffix = "?"; - break; - case MXC_CPU_MX6DL: + } else if (is_cpu_type(MXC_CPU_MX6DL)) { cpu_str = "DL"; tx6_mod_suffix = "U"; - break; - case MXC_CPU_MX6SOLO: + } else if (is_cpu_type(MXC_CPU_MX6SOLO)) { cpu_str = "SOLO"; tx6_mod_suffix = "S"; - break; - case MXC_CPU_MX6Q: + } else if (is_cpu_type(MXC_CPU_MX6Q)) { cpu_str = "Q"; tx6_mod_suffix = "Q"; - break; } printf("CPU: Freescale i.MX6%s rev%d.%d at %d MHz\n", @@ -470,8 +465,6 @@ static int tx6_pmic_probe(void) int board_init(void) { int ret; - u32 cpurev = get_cpu_rev(); - int cpu_variant = (cpurev >> 12) & 0xff; int pmic_id; debug("%s@%d: \n", __func__, __LINE__); @@ -482,7 +475,7 @@ int board_init(void) printf("Board: Ka-Ro TX6%s-%d%d%d%c\n", tx6_mod_suffix, - cpu_variant == MXC_CPU_MX6Q ? 1 : 8, + is_cpu_type(MXC_CPU_MX6Q) ? 1 : 8, is_lvds(), tx6_get_mod_rev(pmic_id), tx6_mem_suffix()); diff --git a/board/karo/tx6/tx6ul.c b/board/karo/tx6/tx6ul.c index b8ff2c8f4f..a7e6d5f3f5 100644 --- a/board/karo/tx6/tx6ul.c +++ b/board/karo/tx6/tx6ul.c @@ -357,23 +357,16 @@ int checkboard(void) u32 cpurev = get_cpu_rev(); char *cpu_str = "?"; - switch ((cpurev >> 12) & 0xff) { - case MXC_CPU_MX6SL: + if (is_cpu_type(MXC_CPU_MX6SL)) cpu_str = "SL"; - break; - case MXC_CPU_MX6DL: + else if (is_cpu_type(MXC_CPU_MX6DL)) cpu_str = "DL"; - break; - case MXC_CPU_MX6SOLO: + else if (is_cpu_type(MXC_CPU_MX6SOLO)) cpu_str = "SOLO"; - break; - case MXC_CPU_MX6Q: + else if (is_cpu_type(MXC_CPU_MX6Q)) cpu_str = "Q"; - break; - case MXC_CPU_MX6UL: + else if (is_cpu_type(MXC_CPU_MX6UL)) cpu_str = "UL"; - break; - } printf("CPU: Freescale i.MX6%s rev%d.%d at %d MHz\n", cpu_str,