diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-04-20 18:05:37 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-05-08 08:04:19 +0200 |
commit | 0c095f9ae8215a08b223a14f487fc71d8c986ce0 (patch) | |
tree | 33aff541b9260a80444824fc9cfea8dc32b84c82 /arch/arm/mach-imx/vf610.c | |
parent | 4ace5528c093322f3e7aca405db5948b1d109b22 (diff) | |
download | barebox-0c095f9ae8215a08b223a14f487fc71d8c986ce0.tar.gz barebox-0c095f9ae8215a08b223a14f487fc71d8c986ce0.tar.xz |
ARM: VFxxx: Detect cpu variant on start
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/vf610.c')
-rw-r--r-- | arch/arm/mach-imx/vf610.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/vf610.c b/arch/arm/mach-imx/vf610.c new file mode 100644 index 0000000000..c2d02632f1 --- /dev/null +++ b/arch/arm/mach-imx/vf610.c @@ -0,0 +1,47 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * 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. + * + */ + +#include <init.h> +#include <common.h> +#include <io.h> +#include <linux/sizes.h> +#include <mach/generic.h> +#include <mach/revision.h> +#include <mach/vf610.h> + +int vf610_init(void) +{ + const char *cputypestr; + void __iomem *src = IOMEM(VF610_SRC_BASE_ADDR); + + switch (vf610_cpu_type()) { + case VF610_CPUTYPE_VF610: + cputypestr = "VF610"; + break; + case VF610_CPUTYPE_VF600: + cputypestr = "VF600"; + break; + case VF610_CPUTYPE_VF510: + cputypestr = "VF510"; + break; + case VF610_CPUTYPE_VF500: + cputypestr = "VF500"; + break; + default: + cputypestr = "unknown VFxxx"; + break; + } + + imx_set_silicon_revision(cputypestr, vf610_cpu_revision()); + return 0; +} |