Early products of S5PV210, EVT0, had several errata that require kernel to avoid using some parts/instructions of the CPU or to add protection instructions. There are products with such early production CPUs; thus, we want to distinguish them in kernel. This patch is to distinguish such products. Include <mach/hardware.h> and access s5pv210_evt0 For example, if (s5pv210_evt0) { ... execute code targeted only to EVT0 ... } else { ... execute normal code ... } For Aquila machine. (mach-aquila.c) Part of Aquila machines have the early production CPUs that require to address errata issues. Note that we don't do this for GONI machines because they have never used early production CPUs with errata. Besides, please note that there are other boards that use such early produces other than Aquila. However, those boards/machines are not registered at the /linux/arch/arm/tools/mach-types, yet; thus, we have omitted them in this patch. For Goni machine. (mach-goni.c) We do not have Goni machines with EVT0, yet. Signed-off-by: MyungJoo Ham <myungjoo.ham@xxxxxxxxxxx> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx> -- v5 updates: - rename revision check function. - revise revision check functions so that it does not access board-related information. - chipid is used to identify EVT revision. - added "s5pv210_revision_or_later()" function v6 updates: - removed consideration for EVT1-FUSED v7 updates: - removed revision check function and access EVT info directly. --- arch/arm/mach-s5pv210/cpu.c | 3 +++ arch/arm/mach-s5pv210/include/mach/hardware.h | 11 ++++++++++- arch/arm/mach-s5pv210/mach-aquila.c | 9 +++++++++ arch/arm/mach-s5pv210/mach-goni.c | 3 +++ 4 files changed, 25 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c index 94c632b..5d1e46e 100644 --- a/arch/arm/mach-s5pv210/cpu.c +++ b/arch/arm/mach-s5pv210/cpu.c @@ -27,6 +27,7 @@ #include <asm/proc-fns.h> #include <mach/map.h> #include <mach/regs-clock.h> +#include <mach/hardware.h> #include <plat/cpu.h> #include <plat/devs.h> @@ -128,6 +129,8 @@ static struct sys_device s5pv210_sysdev = { .cls = &s5pv210_sysclass, }; +bool s5pv210_evt0; + static int __init s5pv210_core_init(void) { return sysdev_class_register(&s5pv210_sysclass); diff --git a/arch/arm/mach-s5pv210/include/mach/hardware.h b/arch/arm/mach-s5pv210/include/mach/hardware.h index fada7a3..d400ea0 100644 --- a/arch/arm/mach-s5pv210/include/mach/hardware.h +++ b/arch/arm/mach-s5pv210/include/mach/hardware.h @@ -13,6 +13,15 @@ #ifndef __ASM_ARCH_HARDWARE_H #define __ASM_ARCH_HARDWARE_H __FILE__ -/* currently nothing here, placeholder */ +extern bool s5pv210_evt0; + +/* + * get_s5pv210_revision_chipid returns s5pv210_revision if the + * EVT revision can be determined by the chipid(PRO_ID) register. + * However, note that only EVT1-FUSED can be identified from it and + * it cannot distinguish between EVT0 and EVT1. In such case, it + * returns EVT_UNKNOWN. In such case use set_s5pv210_revision() to + * set the revision number manually. + */ #endif /* __ASM_ARCH_HARDWARE_H */ diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c index 46d5c7e..234a4e3 100644 --- a/arch/arm/mach-s5pv210/mach-aquila.c +++ b/arch/arm/mach-s5pv210/mach-aquila.c @@ -30,6 +30,7 @@ #include <mach/regs-clock.h> #include <mach/regs-fb.h> #include <mach/gpio.h> +#include <mach/hardware.h> #include <plat/gpio-cfg.h> #include <plat/regs-serial.h> @@ -536,6 +537,14 @@ static void __init aquila_map_io(void) static void __init aquila_machine_init(void) { + /* CPU Revision (EVTx) */ + s5pv210_evt0 = false; + if (system_rev & 0x0800) { + if ((system_rev & 0xF) < 8) + s5pv210_evt0 = true; + } else if (system_rev & 0x2000) + s5pv210_evt0 = true; + /* PMIC */ aquila_pmic_init(); i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs, diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c index 380d2ae..8bdd92c 100644 --- a/arch/arm/mach-s5pv210/mach-goni.c +++ b/arch/arm/mach-s5pv210/mach-goni.c @@ -32,6 +32,7 @@ #include <mach/regs-clock.h> #include <mach/regs-fb.h> #include <mach/gpio.h> +#include <mach/hardware.h> #include <plat/gpio-cfg.h> #include <plat/regs-serial.h> @@ -520,6 +521,8 @@ static void __init goni_map_io(void) static void __init goni_machine_init(void) { + s5pv210_evt0 = false; + /* PMIC */ goni_pmic_init(); i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs, -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html