summaryrefslogtreecommitdiffstats
path: root/scripts/imx/imx.c
diff options
context:
space:
mode:
authorAlexander Kurz <akurz@blala.de>2016-06-30 11:10:20 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-04 09:30:56 +0200
commit7e97af88585996b02c424bf0956a73e459bed76c (patch)
treef4519a997192e5dcaa857e6107328c3cfe1569f7 /scripts/imx/imx.c
parentc8608f07720a0bd2cc0da57dcfc1c6e21816b587 (diff)
downloadbarebox-7e97af88585996b02c424bf0956a73e459bed76c.tar.gz
barebox-7e97af88585996b02c424bf0956a73e459bed76c.tar.xz
ARM: i.MX: central SOC type definition
Move the definition of iMX CPU types to an individual file to allow on-purpose inclusion. Eliminate magic number CPU type encoding in the scripts/imx subdir using the new include file. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/imx/imx.c')
-rw-r--r--scripts/imx/imx.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/imx/imx.c b/scripts/imx/imx.c
index f1accc4708..4ec8c89541 100644
--- a/scripts/imx/imx.c
+++ b/scripts/imx/imx.c
@@ -23,6 +23,7 @@
#include <stdint.h>
#include <errno.h>
#include <linux/kernel.h>
+#include <mach/imx_cpu_types.h>
#include "imx.h"
@@ -216,11 +217,11 @@ struct soc_type {
};
static struct soc_type socs[] = {
- { .name = "imx25", .header_version = 1, .cpu_type = 25},
- { .name = "imx35", .header_version = 1, .cpu_type = 35 },
- { .name = "imx51", .header_version = 1, .cpu_type = 51 },
- { .name = "imx53", .header_version = 2, .cpu_type = 53 },
- { .name = "imx6", .header_version = 2, .cpu_type = 6 },
+ { .name = "imx25", .header_version = 1, .cpu_type = IMX_CPU_IMX25 },
+ { .name = "imx35", .header_version = 1, .cpu_type = IMX_CPU_IMX35 },
+ { .name = "imx51", .header_version = 1, .cpu_type = IMX_CPU_IMX51 },
+ { .name = "imx53", .header_version = 2, .cpu_type = IMX_CPU_IMX53 },
+ { .name = "imx6", .header_version = 2, .cpu_type = IMX_CPU_IMX6 },
};
static int do_soc(struct config_data *data, int argc, char *argv[])
@@ -238,7 +239,7 @@ static int do_soc(struct config_data *data, int argc, char *argv[])
data->header_version = socs[i].header_version;
data->cpu_type = socs[i].cpu_type;
- if (data->cpu_type == 35)
+ if (data->cpu_type == IMX_CPU_IMX35)
data->load_size += HEADER_LEN;
return 0;