ARM: S5PV210: CPUFREQ Initial Support
Subsystems (3)
v5 cover ARM: S5PV210: CPUFREQ Initial Support
S5PV210 CPUFREQ Initial Support.
This is a series of patches to enable CPUFREQ for S5PV210.
Although this works without PMIC's DVS support, it is not as effective without DVS support as supposed. AVS is not supported in this version.
At the patch revision v5, the following patches are updated from v4.
- 1/7: ARM: S5PV210: Allow to probe EVT revision number
* Renamed revision check function
* Revise revision check function so that it does not access board-specific information
* Chip-ID is used to identify some of EVT revisions.
* Added "s5pv210_revision_or_later()" function
- 6/7: ARM: S5PV210: clock registers (CLK_DIV/SRC/STAT)
* Added entry infromation for G3D/G2D/MFC of the register S5P_CLK_[DIV|MUX]_STAT[0|1]. These entries are accessed multiple times at /arch/arm/mach-s5pv210/cpufreq.c.
- 7/7: ARM: S5PV210: Initial CPUFREQ Support
* Remove unnecessary USE_FREQ_TABLE
* Renamed functions in cpufreq.c
* Initialization of s5pv210_cpufreq_target (previously, s5pv210_target) is revised (initilization --> first_run)
* "workaround" --> "revision"
* CLK_*_STATx register entries use macros: they are used multiple times.
MyungJoo Ham (7):
ARM: S5PV210: Allow to probe EVT revision number.
ARM: Samsung SoC: added hclk/pclk info to s3c_freq for s5pv210
cpu-freq
ARM: S5P: Added default pll values for APLL 800/1000MHz
ARM: S5P: Virtual Addresses for DMCx registers.
ARM: S5PV210: Access for DMCx registers
ARM: S5PV210: clock registers (CLK_DIV/SRC/STAT)
ARM: S5PV210: Initial CPUFREQ Support
arch/arm/Kconfig | 1 + arch/arm/mach-s5pv210/Kconfig | 5 + arch/arm/mach-s5pv210/Makefile | 2 + arch/arm/mach-s5pv210/cpu.c | 41 ++- arch/arm/mach-s5pv210/cpufreq.c | 790 +++++++++++++++++++++++ arch/arm/mach-s5pv210/include/mach/cpu-freq.h | 38 ++ arch/arm/mach-s5pv210/include/mach/hardware.h | 19 +- arch/arm/mach-s5pv210/include/mach/map.h | 4 + arch/arm/mach-s5pv210/include/mach/regs-clock.h | 60 ++- arch/arm/mach-s5pv210/mach-aquila.c | 14 + arch/arm/mach-s5pv210/mach-goni.c | 8 + arch/arm/plat-s5p/include/plat/map-s5p.h | 3 + arch/arm/plat-s5p/include/plat/pll.h | 3 + arch/arm/plat-samsung/include/plat/cpu-freq.h | 6 + 14 files changed, 989 insertions(+), 5 deletions(-) create mode 100644 arch/arm/mach-s5pv210/cpufreq.c create mode 100644 arch/arm/mach-s5pv210/include/mach/cpu-freq.h
PATCH v5 1/7 ARM: S5PV210: Allow to probe EVT revision number.
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 call s5pv210_revision().
For example,
if (s5pv210_revision(EVT0)) {
... execute code targeted only to EVT0 ...
} else {
... execute normal code ...
}Call set_s5pv210_revision(EVTx) when the EVT revision number can be identified. We have EVT0, EVT1, and EVT1-Fused avaialble right now and only EVT1-Fused has the unique revision number at chipid (PRO_ID register). A function, get_s5pv210_revision_chipid(), returns EVT revision number if the revision is identified by the chipid; otherwise, the function returns EVT_UNKNOWN. When EVT cannot be identified with chipid, it can be identified at board support file (arch/arm/mach-s5pv210/mach-*.c), not at the cpu file (arch/arm/mach-s5pv210/cpu.c).
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)
It's either EVT1 or EVT1-Fused; thus, it can be identified by get_s5pv210_revision_chipid() function.
--
v5:
- 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
--- arch/arm/mach-s5pv210/cpu.c | 29 +++++++++++++++++++++++++ arch/arm/mach-s5pv210/include/mach/hardware.h | 19 +++++++++++++++- arch/arm/mach-s5pv210/mach-aquila.c | 14 ++++++++++++ arch/arm/mach-s5pv210/mach-goni.c | 8 +++++++ 4 files changed, 69 insertions(+), 1 deletions(-)
arch/arm/mach-s5pv210/cpu.c +29 -0
@@ -24,9 +24,11 @@#include <asm/mach/map.h> #include <asm/mach/irq.h> +#include <asm/mach-types.h> #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 +130,33 @@ static struct sys_device s5pv210_sysdev = { .cls = &s5pv210_sysclass, }; +static enum s5pv210_revision s5pv210_evt_number =EVT_UNKNOWN ; + +bool s5pv210_revision (enum s5pv210_revision rev) +{ +return rev == s5pv210_evt_number; +} + +bool s5pv210_revision_or_later (enum s5pv210_revision rev) +{ +return rev >= s5pv210_evt_number; +} + +void set_s5pv210_revision (enum s5pv210_revision rev) +{ + s5pv210_evt_number = rev; +} + +enum s5pv210_revision get_s5pv210_revision_chipid (void ) +{ +unsigned int reg =__raw_readl (S5P_VA_CHIPID ); + +if ((reg &0xf0 ) ==0x20 ) +return EVT1_FUSED ; + +return EVT_UNKNOWN ; +} +static int __init s5pv210_core_init (void ) {return sysdev_class_register (&s5pv210_sysclass);
arch/arm/mach-s5pv210/include/mach/hardware.h +18 -1
@@ -13,6 +13,23 @@#ifndef __ASM_ARCH_HARDWARE_H#define __ASM_ARCH_HARDWARE_H __FILE__ -/* currently nothing here, placeholder */ +enum s5pv210_revision {EVT_UNKNOWN =0 , +EVT0 , +EVT1 , +EVT1_FUSED }; + +extern bool s5pv210_revision (enum s5pv210_revision ); +extern bool s5pv210_revision_or_later (enum s5pv210_revision ); +extern void set_s5pv210_revision (enum s5pv210_revision ); + +/* +* 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. +*/ +extern enum s5pv210_revision get_s5pv210_revision_chipid (void );#endif /* __ASM_ARCH_HARDWARE_H */
arch/arm/mach-s5pv210/mach-aquila.c +14 -0
@@ -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,19 @@ static void __init aquila_map_io(void)static void __init aquila_machine_init (void ) { +enum s5pv210_revision cpurev =get_s5pv210_revision_chipid (); + +/* CPU Revision (EVTx) */ +if (cpurev ==EVT_UNKNOWN ) { + cpurev =EVT1 ; +if (system_rev &0x0800 ) { +if ((system_rev &0xF ) <8 ) + cpurev =EVT0 ; + }else if (system_rev &0x2000 ) + cpurev =EVT0 ; + } +set_s5pv210_revision (cpurev); +/* PMIC */ aquila_pmic_init (); i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs,
arch/arm/mach-s5pv210/mach-goni.c +8 -0
@@ -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,13 @@ static void __init goni_map_io(void)static void __init goni_machine_init (void ) { +enum s5pv210_revision cpurev =get_s5pv210_revision_chipid (); + +/* CPU Revision (EVTx) */ +if (cpurev ==EVT_UNKNOWN ) + cpurev =EVT1 ; +set_s5pv210_revision (cpurev); +/* PMIC */ goni_pmic_init (); i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs,
Signature · 1 line
1.6.3.3
PATCH v5 2/7 ARM: Samsung SoC: added hclk/pclk info to s3c_freq for s5pv210 cpu-freq
S5PV210 requires msys/dsys info as well; thus, we've included those at struct s3c_freq, which is used by CPUFREQ of S5PV210.
--- arch/arm/plat-samsung/include/plat/cpu-freq.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/plat-samsung/include/plat/cpu-freq.h +6 -0
@@ -38,6 +38,12 @@ struct s3c_freq {unsigned long hclk_tns;/* in 10ths of ns */ unsigned long hclk;unsigned long pclk; +#ifdef CONFIG_ARCH_S5PV210 +unsigned long hclk_msys; +unsigned long pclk_msys; +unsigned long hclk_dsys; +unsigned long pclk_dsys; +#endif };/**
Signature · 1 line
1.6.3.3
PATCH v5 3/7 ARM: S5P: Added default pll values for APLL 800/1000MHz
CPUFREQ of S5PV210 uses different APLL settings according to different CPU frequencies. We provide such settings values for CPUFREQ at pll.h.
Note that at 1GHz of ARMCLK, APLL should be 1GHz and for other lower ARMCLK, APLL should be 800MHz.
--- arch/arm/plat-s5p/include/plat/pll.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/plat-s5p/include/plat/pll.h +3 -0
@@ -21,6 +21,9 @@#include <asm/div64.h> +#define PLL45XX_APLL_VAL_1000 ((1 << 31) | (125<<16) | (3<<8) | (1)) +#define PLL45XX_APLL_VAL_800 ((1 << 31) | (100<<16) | (3<<8) | (1)) +enum pll45xx_type_t { pll_4500, pll_4502,
Signature · 1 line
1.6.3.3
PATCH v5 4/7 ARM: S5P: Virtual Addresses for DMCx registers.
The CPUFREQ driver requires an access to DMCx registers. We
define virtual addresses of DMCx registers.
--- arch/arm/plat-s5p/include/plat/map-s5p.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/plat-s5p/include/plat/map-s5p.h +3 -0
@@ -31,4 +31,7 @@#define VA_VIC2 VA_VIC(2)#define VA_VIC3 VA_VIC(3) +#define S5P_VA_DMC0 S3C_ADDR(0x00a00000) +#define S5P_VA_DMC1 S3C_ADDR(0x00b00000) +#endif /* __ASM_PLAT_MAP_S5P_H */
Signature · 1 line
1.6.3.3
PATCH v5 5/7 ARM: S5PV210: Access for DMCx registers
The CPUFREQ driver requires an access to DMCx registers. We
define physical addresses and mapping between physical and virtual addresses of DMCx registers.
--- arch/arm/mach-s5pv210/cpu.c | 12 +++++++++++- arch/arm/mach-s5pv210/include/mach/map.h | 4 ++++ 2 files changed, 15 insertions(+), 1 deletions(-)
arch/arm/mach-s5pv210/cpu.c +11 -1
@@ -61,7 +61,17 @@ static struct map_desc s5pv210_iodesc[] __initdata = { .pfn = __phys_to_pfn(S5PV210_PA_SROMC), .length = SZ_4K, .type = MT_DEVICE, - } + }, { + .virtual = (unsigned long)S5P_VA_DMC0, + .pfn = __phys_to_pfn(S5PV210_PA_DMC0), + .length = SZ_4K, + .type = MT_DEVICE, + }, { + .virtual = (unsigned long)S5P_VA_DMC1, + .pfn = __phys_to_pfn(S5PV210_PA_DMC1), + .length = SZ_4K, + .type = MT_DEVICE, + }, };static void s5pv210_idle (void )
arch/arm/mach-s5pv210/include/mach/map.h +4 -0
@@ -108,4 +108,8 @@#define SAMSUNG_PA_ADC S5PV210_PA_ADC#define SAMSUNG_PA_KEYPAD S5PV210_PA_KEYPAD +/* DMC */ +#define S5PV210_PA_DMC0 (0xF0000000) +#define S5PV210_PA_DMC1 (0xF1400000) +#endif /* __ASM_ARCH_MAP_H */
Signature · 1 line
1.6.3.3
PATCH v5 6/7 ARM: S5PV210: clock registers (CLK_DIV/SRC/STAT)
Previously, most of CLK_DIV/SRC register accessing mask and shift values were used at arch/arm/mach-s5pv210/clock.c only; thus we had not been using macros for these. However, as CPUFREQ uses those shift and mask values as well, we'd better define them at a single location, whose proper location would be regs-clock.h.
Note that only the information about registers used by CPUFREQ are defined. However, we may need to define other registers later if we add other parts. Besides, later, we will probably need to use these macros at arch/arm/mach-s5pv210/clock.c as well especially for entries that are used out of clock.c as well.
--
v5:
- Added macros for G2D/G3D/MFC's DIV/MUX_STAT, which tracks changing status of G2D/G3D/MFC. These are added because they are used multiple times at arch/arm/mach-s5pv210/cpufreq.c
--- arch/arm/mach-s5pv210/include/mach/regs-clock.h | 60 +++++++++++++++++++++- 1 files changed, 57 insertions(+), 3 deletions(-)
arch/arm/mach-s5pv210/include/mach/regs-clock.h +57 -3
@@ -66,11 +66,30 @@#define S5P_CLKGATE_BUS0 S5P_CLKREG(0x484)#define S5P_CLKGATE_BUS1 S5P_CLKREG(0x488)#define S5P_CLK_OUT S5P_CLKREG(0x500) +#define S5P_CLK_DIV_STAT0 S5P_CLKREG(0x1000) +#define S5P_CLK_DIV_STAT1 S5P_CLKREG(0x1004) +#define S5P_CLK_MUX_STAT0 S5P_CLKREG(0x1100) +#define S5P_CLK_MUX_STAT1 S5P_CLKREG(0x1104) + +#define S5P_ARM_MCS_CON S5P_CLKREG(0x6100)/* CLKSRC0 */ -#define S5P_CLKSRC0_MUX200_MASK (0x1<<16) -#define S5P_CLKSRC0_MUX166_MASK (0x1<<20) -#define S5P_CLKSRC0_MUX133_MASK (0x1<<24) +#define S5P_CLKSRC0_APLL_MASK (0x1 << 0) +#define S5P_CLKSRC0_APLL_SHIFT (0) +#define S5P_CLKSRC0_MPLL_MASK (0x1 << 4) +#define S5P_CLKSRC0_MPLL_SHIFT (4) +#define S5P_CLKSRC0_EPLL_MASK (0x1 << 8) +#define S5P_CLKSRC0_EPLL_SHIFT (8) +#define S5P_CLKSRC0_VPLL_MASK (0x1 << 12) +#define S5P_CLKSRC0_VPLL_SHIFT (12) +#define S5P_CLKSRC0_MUX200_MASK (0x1 << 16) +#define S5P_CLKSRC0_MUX200_SHIFT (16) +#define S5P_CLKSRC0_MUX166_MASK (0x1 << 20) +#define S5P_CLKSRC0_MUX166_SHIFT (20) +#define S5P_CLKSRC0_MUX133_MASK (0x1 << 24) +#define S5P_CLKSRC0_MUX133_SHIFT (24) +#define S5P_CLKSRC0_ONENAND_MASK (0x1 << 28) +#define S5P_CLKSRC0_ONENAND_SHIFT (28)/* CLKDIV0 */ #define S5P_CLKDIV0_APLL_SHIFT (0)
@@ -90,6 +109,41 @@#define S5P_CLKDIV0_PCLK66_SHIFT (28)#define S5P_CLKDIV0_PCLK66_MASK (0x7 << S5P_CLKDIV0_PCLK66_SHIFT) +/* CLKSRC2 */ +#define S5P_CLKSRC2_G3D_MASK (0x3 << 0) +#define S5P_CLKSRC2_G3D_SHIFT (0) +#define S5P_CLKSRC2_MFC_MASK (0x3 << 4) +#define S5P_CLKSRC2_MFC_SHIFT (4) +#define S5P_CLKSRC2_G2D_MASK (0x3 << 8) +#define S5P_CLKSRC2_G2D_SHIFT (8) + +/* CLKDIV2 */ +#define S5P_CLKDIV2_G3D_MASK (0xF << 0) +#define S5P_CLKDIV2_G3D_SHIFT (0) +#define S5P_CLKDIV2_MFC_MASK (0xF << 4) +#define S5P_CLKDIV2_MFC_SHIFT (4) +#define S5P_CLKDIV2_G2D_MASK (0xF << 8) +#define S5P_CLKDIV2_G2D_SHIFT (8) + +/* CLKDIV6 */ +#define S5P_CLKDIV6_ONEDRAM_MASK (0xf<<28) +#define S5P_CLKDIV6_ONEDRAM_SHIFT (28) + +/* CLK_DIV_STAT0 */ +#define S5P_CLKDIV_STAT0_G3D (1 << 16) +#define S5P_CLKDIV_STAT0_MFC (1 << 17) + +/* CLK_DIV_STAT1 */ +#define S5P_CLKDIV_STAT1_G2D (1 << 20) + +/* CLK_MUX_STAT0 */ +#define S5P_CLKMUX_STAT0_MUX200 (1 << 18) + +/* CLK_MUX_STAT1 */ +#define S5P_CLKMUX_STAT1_G3D (1 << 3) +#define S5P_CLKMUX_STAT1_MFC (1 << 7) +#define S5P_CLKMUX_STAT1_G2D (1 << 27) +/* Registers related to power management */ #define S5P_PWR_CFG S5P_CLKREG(0xC000)#define S5P_EINT_WAKEUP_MASK S5P_CLKREG(0xC004)
Signature · 1 line
1.6.3.3
PATCH v5 7/7 ARM: S5PV210: Initial CPUFREQ Support
S5PV210 CPUFREQ Support.
This CPUFREQ may work without PMIC's DVS support. However, it is not as effective without DVS support as supposed. AVS is not supported in this version.
Note that CLK_SRC of some clocks including ARMCLK, G3D, G2D, MFC, and ONEDRAM are modified directly without updating clksrc_src representations of the clocks. Because CPUFREQ reverts the CLK_SRC to the supposed values, this does not affect the consistency as long as there are no other modules that modifies clock sources of ARMCLK, G3D, G2D, MFC, and ONEDRAM (and only CPUFREQ should have the control). As soon as clock framework is settled, we may update source clocks (.parent field) of those clocks accordingly later.
--
v2:
- Ramp-up delay is removed. (let regulator framework do the job)
- Provide proper max values for regulator_set_voltage
- Removed unneccesary #ifdef's.
- Removed unnecessary initialiser for CLK_OUT
v3:
- Style corrections (pr_info/pr_err, ...)
- Revised dvs_conf struct
v4:
- Renamed cpufreq-s5pv210.c -> cpufreq.c
- Style corrections (less #ifdef's, comments)
- Removed unncessary codes
- Remove #ifdef for WORKAROUND, use s5pv210_workaround()
- Renamed some static variables (get rid of s5pv210 prefix)
- Added machine dependency to Kconfig/Makefile
- DMC0, DMC1 refresh counter is not updated by a hardcoded value, but with the value given as the default and relative clock speeds. Besides, the algorithm to update DMC0/1 refresh counter is reformed.
v5:
- Remove unnecessary USE_FREQ_TABLE
- Renamed functions
- s5pv210_cpufreq_target's initialization revised. (first_run)
- "workaround" --> "revision"
- CLK_*_STAT register entries use macros: they are used mutiple times.
--- arch/arm/Kconfig | 1 + arch/arm/mach-s5pv210/Kconfig | 5 + arch/arm/mach-s5pv210/Makefile | 2 + arch/arm/mach-s5pv210/cpufreq.c | 790 +++++++++++++++++++++++++ arch/arm/mach-s5pv210/include/mach/cpu-freq.h | 38 ++ 5 files changed, 836 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pv210/cpufreq.c create mode 100644 arch/arm/mach-s5pv210/include/mach/cpu-freq.h
arch/arm/Kconfig +1 -0
@@ -701,6 +701,7 @@ config ARCH_S5PV210 select HAVE_CLK select ARM_L1_CACHE_SHIFT_6 select ARCH_USES_GETTIMEOFFSET + select ARCH_HAS_CPUFREQ help Samsung S5PV210/S5PC110 series based systems
arch/arm/mach-s5pv210/Kconfig +5 -0
@@ -14,6 +14,7 @@ config CPU_S5PV210 select PLAT_S5P select S3C_PL330_DMA select S5P_EXT_INT + select S5PV210_CPU_FREQ if CPU_FREQ help Enable S5PV210 CPU support
@@ -101,4 +102,8 @@ config MACH_SMDKC110 Machine support for Samsung SMDKC110 S5PC110(MCP) is one of package option of S5PV210 +config S5PV210_CPU_FREQ + bool "S5PV210 CPU-FREQ Support" + depends on CPU_S5PV210 && CPU_FREQ + endif
arch/arm/mach-s5pv210/Makefile +2 -0
@@ -34,3 +34,5 @@ obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o + +obj-$(CONFIG_S5PV210_CPU_FREQ) += cpufreq.o
arch/arm/mach-s5pv210/cpufreq.c new file +790 -0
790 lines not on this page · raw message
arch/arm/mach-s5pv210/include/mach/cpu-freq.h new file +38 -0
@@ -0,0 +1,38 @@ +/* arch/arm/mach-s5pv210/include/mach/cpu-freq.h +* +* Copyright (c) 2010 Samsung Electronics +* +* MyungJoo Ham <[email protected]> +* +* S5PV210/S5PC110 CPU frequency scaling support +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __ASM_ARCH_CPU_FREQ_H +#define __ASM_ARCH_CPU_FREQ_H + +#include <linux/cpufreq.h> + +enum perf_level { +L0 =0 , +L1 , +L2 , +L3 , +L4 , +}; + +#ifdef CONFIG_PM +#define SLEEP_FREQ (800 * 1000)/* Use 800MHz when entering sleep */ + +/* additional symantics for "relation" in cpufreq with pm */ +#define DISABLE_FURTHER_CPUFREQ 0x10 +#define ENABLE_FURTHER_CPUFREQ 0x20 +#define MASK_FURTHER_CPUFREQ 0x30 +/* With 0x00(NOCHANGE), it depends on the previous "further" status */ + +#endif /* CONFIG_PM */ + +#endif /* __ASM_ARCH_CPU_FREQ_H */
Signature · 1 line
1.6.3.3
PATCH v5 3/7 ARM: S5P: Added default pll values for APLL 800/1000MHz
In reply to MyungJoo HamHello.
Quoted 9 lines · MyungJoo Ham
CPUFREQ of S5PV210 uses different APLL settings according to different CPU frequencies. We provide such settings values for CPUFREQ at
pll.h.Note that at 1GHz of ARMCLK, APLL should be 1GHz and for other lower ARMCLK, APLL should be 800MHz.
Signed-off-by MyungJoo Ham <[email protected]>Signed-off-by Kyungmin Park <[email protected]>
[...]
arch/arm/plat-s5p/include/plat/pll.h line 26
Quoted 11 lines
arch/arm/plat-s5p/include/plat/pll.h +3
-0@@ -21,6 +21,9 @@#include <asm/div64.h> +#define PLL45XX_APLL_VAL_1000 ((1 << 31) | (125<<16) | (3<<8) | (1)) +#define PLL45XX_APLL_VAL_800 ((1 << 31) | (100<<16) | (3<<8) | (1)) +
Incosistent spacing. Why there spaces around the first << but not around
the following? Should be spaces around every <<...
WBR, Sergei
PATCH v5 1/7 ARM: S5PV210: Allow to probe EVT revision number.
In reply to MyungJoo HamReview
Quoted 110 lines · MyungJoo Ham
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 calls5pv210_revision().For example,
if (s5pv210_revision(EVT0)) { ... execute code targeted only to EVT0 ... } else { ... execute normal code ... }Call
set_s5pv210_revision(EVTx)when the EVT revision number can be identified. We have EVT0, EVT1, and EVT1-Fused avaialble right now and only EVT1-Fused has the unique revision number at chipid (PRO_IDregister). A function,get_s5pv210_revision_chipid(), returns EVT revision number if the revision is identified by the chipid; otherwise, the function returnsEVT_UNKNOWN. When EVT cannot be identified with chipid, it can be identified at board support file (arch/arm/mach-s5pv210/mach-*.c), not at the cpu file (arch/arm/mach-s5pv210/cpu.c).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)It's either EVT1 or EVT1-Fused; thus, it can be identified by
get_s5pv210_revision_chipid()function.Signed-off-by MyungJoo Ham <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--
v5:
- 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--- arch/arm/mach-s5pv210/cpu.c | 29 +++++++++++++++++++++++++ arch/arm/mach-s5pv210/include/mach/hardware.h | 19 +++++++++++++++- arch/arm/mach-s5pv210/mach-aquila.c | 14 ++++++++++++ arch/arm/mach-s5pv210/mach-goni.c | 8 +++++++ 4 files changed, 69 insertions(+), 1 deletions(-)arch/arm/mach-s5pv210/cpu.c +29
-0@@ -24,9 +24,11 @@#include <asm/mach/map.h> #include <asm/mach/irq.h> +#include <asm/mach-types.h> #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 +130,33 @@ static struct sys_device s5pv210_sysdev = { .cls = &s5pv210_sysclass, }; +static enum s5pv210_revision s5pv210_evt_number =EVT_UNKNOWN ; + +bool s5pv210_revision (enum s5pv210_revision rev) +{ +return rev == s5pv210_evt_number; +} + +bool s5pv210_revision_or_later (enum s5pv210_revision rev) +{ +return rev >= s5pv210_evt_number; +} + +void set_s5pv210_revision (enum s5pv210_revision rev) +{ + s5pv210_evt_number = rev; +} + +enum s5pv210_revision get_s5pv210_revision_chipid (void ) +{ +unsigned int reg =__raw_readl (S5P_VA_CHIPID ); + +if ((reg &0xf0 ) ==0x20 ) +return EVT1_FUSED ; + +return EVT_UNKNOWN ; +} +static int __init s5pv210_core_init (void ) {return sysdev_class_register (&s5pv210_sysclass);(quoted diff) +0
-0
b/arch/arm/mach-
arch/arm/mach-s5pv210/include/mach/hardware.h line 19
Quoted 13 lines
s5pv210/include/mach/hardware.h
index fada7a3..c1702d6 100644arch/arm/mach-s5pv210/include/mach/hardware.h +4
-1@@ -13,6 +13,23 @@#ifndef __ASM_ARCH_HARDWARE_H#define __ASM_ARCH_HARDWARE_H __FILE__ -/* currently nothing here, placeholder */ +enum s5pv210_revision {EVT_UNKNOWN =0 , +EVT0 , +EVT1 , +EVT1_FUSED };
Do we really need checking of 'EVT1_FUSED' in kernel?
Review
Quoted 17 lines
arch/arm/mach-s5pv210/include/mach/hardware.h +14
-0+ +extern bool s5pv210_revision (enum s5pv210_revision ); +extern bool s5pv210_revision_or_later (enum s5pv210_revision ); +extern void set_s5pv210_revision (enum s5pv210_revision ); + +/* +* 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. +*/ +extern enum s5pv210_revision get_s5pv210_revision_chipid (void );#endif /* __ASM_ARCH_HARDWARE_H */ (quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-
Quoted 13 lines
aquila.c
index 46d5c7e..25f45d1 100644arch/arm/mach-s5pv210/mach-aquila.c +1
-0@@ -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>
arch/arm/mach-s5pv210/mach-aquila.c static void __init aquila_map_io(void) · line 543
Quoted 7 lines
arch/arm/mach-s5pv210/mach-aquila.c +4
-0@@ -536,6 +537,19 @@ static void __init aquila_map_io(void)static void __init aquila_machine_init (void ) { +enum s5pv210_revision cpurev =get_s5pv210_revision_chipid (); + +/* CPU Revision (EVTx) */ +if (cpurev ==EVT_UNKNOWN ) {
If don't need 'EVT1_FUSED', maybe just need to check system_rev.
Quoted 5 lines
arch/arm/mach-s5pv210/mach-aquila.c +4
-0+ cpurev =EVT1 ; +if (system_rev &0x0800 ) { +if ((system_rev &0xF ) <8 ) + cpurev =EVT0 ;
...
Quoted 2 lines
arch/arm/mach-s5pv210/mach-aquila.c +2
-0+ }else if (system_rev &0x2000 ) + cpurev =EVT0 ;
...
Review
Quoted 8 lines
arch/arm/mach-s5pv210/mach-aquila.c +3
-0+ } +set_s5pv210_revision (cpurev); +/* PMIC */ aquila_pmic_init (); i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4,
i2c_gpio_pmic_devs,(quoted diff) +0
-0
b/arch/arm/mach-s5pv210/mach-
Quoted 13 lines
goni.c
index 380d2ae..25a26ed 100644arch/arm/mach-s5pv210/mach-goni.c +1
-0@@ -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>
arch/arm/mach-s5pv210/mach-goni.c static void __init goni_map_io(void) · line 528
Quoted 8 lines
arch/arm/mach-s5pv210/mach-goni.c +5
-0@@ -520,6 +521,13 @@ static void __init goni_map_io(void)static void __init goni_machine_init (void ) { +enum s5pv210_revision cpurev =get_s5pv210_revision_chipid (); + +/* CPU Revision (EVTx) */ +if (cpurev ==EVT_UNKNOWN ) + cpurev =EVT1 ;
is it available only EVT1 on GONI?
Quoted 7 lines
arch/arm/mach-s5pv210/mach-goni.c +2
-0+set_s5pv210_revision (cpurev); +/* PMIC */ goni_pmic_init (); i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4,
i2c_gpio_pmic_devs,
--
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH v5 1/7 ARM: S5PV210: Allow to probe EVT revision number.
Quoted 120 lines · Kukjin Kim
Review
Quoted 110 lines · MyungJoo Ham
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 calls5pv210_revision().For example,
? ? ? if (
s5pv210_revision(EVT0)) {
? ? ? ? ? ? ? ... execute code targeted only to EVT0 ... ? ? ? } else {
? ? ? ? ? ? ? ... execute normal code ...
? ? ? }Call
set_s5pv210_revision(EVTx)when the EVT revision number can be identified. We have EVT0, EVT1, and EVT1-Fused avaialble right now and only EVT1-Fused has the unique revision number at chipid (PRO_IDregister). A function,get_s5pv210_revision_chipid(), returns EVT revision number if the revision is identified by the chipid; otherwise, the function returnsEVT_UNKNOWN. When EVT cannot be identified with chipid, it can be identified at board support file (arch/arm/mach-s5pv210/mach-*.c), not at the cpu file (arch/arm/mach-s5pv210/cpu.c).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)It's either EVT1 or EVT1-Fused; thus, it can be identified by
get_s5pv210_revision_chipid()function.Signed-off-by MyungJoo Ham <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--
v5:
? ? ? - 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
---
?arch/arm/mach-s5pv210/cpu.c ? ? ? ? ? ? ? ? ? | ? 29
+++++++++++++++++++++++++?arch/arm/mach-s5pv210/include/mach/hardware.h | ? 19 +++++++++++++++- ?arch/arm/mach-s5pv210/mach-aquila.c ? ? ? ? ? | ? 14 ++++++++++++ ?arch/arm/mach-s5pv210/mach-goni.c ? ? ? ? ? ? | ? ?8 +++++++?4 files changed, 69 insertions(+), 1 deletions(-)
arch/arm/mach-s5pv210/cpu.c +0
-0@@ -24,9 +24,11 @@?#include <
asm/mach/map.h>
?#include <asm/mach/irq.h>+#include <
asm/mach-types.h>
?#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>arch/arm/mach-s5pv210/cpu.c +27
-0@@ -128,6 +130,33 @@ static struct sys_device s5pv210_sysdev = { ? ? ? .cls ? ?= &s5pv210_sysclass, ?}; +static enum s5pv210_revision s5pv210_evt_number =EVT_UNKNOWN ; + +bool s5pv210_revision (enum s5pv210_revision rev) +{ + ? ? return rev == s5pv210_evt_number; +} + +bool s5pv210_revision_or_later (enum s5pv210_revision rev) +{ + ? ? return rev >= s5pv210_evt_number; +} + +void set_s5pv210_revision (enum s5pv210_revision rev) +{ + ? ? s5pv210_evt_number = rev; +} + +enum s5pv210_revision get_s5pv210_revision_chipid (void ) +{ + ? ? unsigned int reg = __raw_readl(S5P_VA_CHIPID); + + ? ? if ((reg & 0xf0) == 0x20) + ? ? ? ? ? ? return EVT1_FUSED; + + ? ? return EVT_UNKNOWN; +} + ?static int __init s5pv210_core_init(void) ?{ ? ? ? return sysdev_class_register(&s5pv210_sysclass);(quoted diff) +0
-0b/arch/arm/mach-
Quoted 8 lines
s5pv210/include/mach/hardware.h
index fada7a3..c1702d6 100644arch/arm/mach-s5pv210/include/mach/hardware.h +0
-0@@ -13,6 +13,23 @@?#ifndef
__ASM_ARCH_HARDWARE_H
?#define__ASM_ARCH_HARDWARE_H__FILE__
Quoted 7 lines
arch/arm/mach-s5pv210/include/mach/hardware.h
Quoted 5 lines
arch/arm/mach-s5pv210/include/mach/hardware.h +4
-1-/* currently nothing here, placeholder */ +enum s5pv210_revision {EVT_UNKNOWN =0 , + ? ? EVT0, + ? ? EVT1, + ? ? EVT1_FUSED };Do we really need checking of '
EVT1_FUSED' in kernel?
Um.. so far, we don't have cases that require FUSED mode separated. I have added EVT1_FUSED for "future-use". However, it appears that EVT1_FUSED is not going to affect the kernel-level codes and I think we may get rid of it for the efficiency.
Quoted 107 lines
Quoted 16 lines
arch/arm/mach-s5pv210/include/mach/hardware.h +14
-0+ +extern bool s5pv210_revision (enum s5pv210_revision ); +extern bool s5pv210_revision_or_later (enum s5pv210_revision ); +extern void set_s5pv210_revision (enum s5pv210_revision ); + +/* +* 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. +*/ +extern enum s5pv210_revision get_s5pv210_revision_chipid (void );Review
Quoted 2 lines
?#endif /*
__ASM_ARCH_HARDWARE_H*/(quoted diff) +0
-0b/arch/arm/mach-s5pv210/mach-
Quoted 13 lines
aquila.c
index 46d5c7e..25f45d1 100644arch/arm/mach-s5pv210/mach-aquila.c +0
-0@@ -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>arch/arm/mach-s5pv210/mach-aquila.c static void __init aquila_map_io(void) · line 543
Quoted 7 lines
arch/arm/mach-s5pv210/mach-aquila.c +4
-0@@ -536,6 +537,19 @@ static void __init aquila_map_io(void) ?static void __init aquila_machine_init(void) ?{ + ? ? enum s5pv210_revision cpurev = get_s5pv210_revision_chipid(); + + ? ? /* CPU Revision (EVTx) */ + ? ? if (cpurev == EVT_UNKNOWN) {If don't need '
EVT1_FUSED', maybe just need to checksystem_rev.Quoted 5 lines
arch/arm/mach-s5pv210/mach-aquila.c +4
-0+ ? ? ? ? ? ? cpurev = EVT1; + ? ? ? ? ? ? if (system_rev & 0x0800) { + ? ? ? ? ? ? ? ? ? ? if ((system_rev & 0xF) < 8) + ? ? ? ? ? ? ? ? ? ? ? ? ? ? cpurev = EVT0;...
Quoted 2 lines
+ ? ? ? ? ? ? } else if (
system_rev&0x2000)
+ ? ? ? ? ? ? ? ? ? ? cpurev = EVT0;...
Review
Quoted 8 lines
+ ? ? }
+ ? ?set_s5pv210_revision(cpurev);
+
? ? ? /* PMIC */
? ? ?aquila_pmic_init();
? ? ? i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4,i2c_gpio_pmic_devs,(quoted diff) +0
-0b/arch/arm/mach-s5pv210/mach-
Quoted 13 lines
goni.c
index 380d2ae..25a26ed 100644arch/arm/mach-s5pv210/mach-goni.c +0
-0@@ -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>arch/arm/mach-s5pv210/mach-goni.c static void __init goni_map_io(void) · line 528
Quoted 8 lines
arch/arm/mach-s5pv210/mach-goni.c +5
-0@@ -520,6 +521,13 @@ static void __init goni_map_io(void) ?static void __init goni_machine_init(void) ?{ + ? ? enum s5pv210_revision cpurev = get_s5pv210_revision_chipid(); + + ? ? /* CPU Revision (EVTx) */ + ? ? if (cpurev == EVT_UNKNOWN) + ? ? ? ? ? ? cpurev = EVT1;is it available only EVT1 on GONI?
Quoted 7 lines
arch/arm/mach-s5pv210/mach-goni.c +2
-0+ ? ? set_s5pv210_revision(cpurev); +? ? ? /* PMIC */
? ? ?goni_pmic_init();
? ? ? i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4,i2c_gpio_pmic_devs,
--Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
Signature · 5 lines
MyungJoo Ham (???), Ph.D. Mobile Software Platform Lab, Digital Media and Communications (DMC) Business Samsung Electronics cell: 82-10-6714-2858
PATCH v5 1/7 ARM: S5PV210: Allow to probe EVT revision number.
Quoted 130 lines · MyungJoo Ham
Quoted 120 lines · Kukjin Kim
Review
Quoted 110 lines · MyungJoo Ham
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 calls5pv210_revision().For example,
if (s5pv210_revision(EVT0)) { ... execute code targeted only to EVT0 ... } else { ... execute normal code ... }Call
set_s5pv210_revision(EVTx)when the EVT revision number can be identified. We have EVT0, EVT1, and EVT1-Fused avaialble right now and only EVT1-Fused has the unique revision number at chipid (PRO_IDregister). A function,get_s5pv210_revision_chipid(), returns EVT revision number if the revision is identified by the chipid; otherwise, the function returnsEVT_UNKNOWN. When EVT cannot be identified with chipid, it can be identified at board support file (arch/arm/mach-s5pv210/mach-*.c), not at the cpu file (arch/arm/mach-s5pv210/cpu.c).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)It's either EVT1 or EVT1-Fused; thus, it can be identified by
get_s5pv210_revision_chipid()function.Signed-off-by MyungJoo Ham <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--
v5:
- 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--- arch/arm/mach-s5pv210/cpu.c | 29 +++++++++++++++++++++++++ arch/arm/mach-s5pv210/include/mach/hardware.h | 19 +++++++++++++++- arch/arm/mach-s5pv210/mach-aquila.c | 14 ++++++++++++ arch/arm/mach-s5pv210/mach-goni.c | 8 +++++++ 4 files changed, 69 insertions(+), 1 deletions(-)arch/arm/mach-s5pv210/cpu.c +29
-0@@ -24,9 +24,11 @@#include <asm/mach/map.h> #include <asm/mach/irq.h> +#include <asm/mach-types.h> #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 +130,33 @@ static struct sys_device s5pv210_sysdev = { .cls = &s5pv210_sysclass, }; +static enum s5pv210_revision s5pv210_evt_number =EVT_UNKNOWN ; + +bool s5pv210_revision (enum s5pv210_revision rev) +{ +return rev == s5pv210_evt_number; +} + +bool s5pv210_revision_or_later (enum s5pv210_revision rev) +{ +return rev >= s5pv210_evt_number; +} + +void set_s5pv210_revision (enum s5pv210_revision rev) +{ + s5pv210_evt_number = rev; +} + +enum s5pv210_revision get_s5pv210_revision_chipid (void ) +{ +unsigned int reg =__raw_readl (S5P_VA_CHIPID ); + +if ((reg &0xf0 ) ==0x20 ) +return EVT1_FUSED ; + +return EVT_UNKNOWN ; +} +static int __init s5pv210_core_init (void ) {return sysdev_class_register (&s5pv210_sysclass);(quoted diff) +0
-0b/arch/arm/mach-
Quoted 8 lines
s5pv210/include/mach/hardware.h
index fada7a3..c1702d6 100644arch/arm/mach-s5pv210/include/mach/hardware.h +0
-0@@ -13,6 +13,23 @@#ifndef __ASM_ARCH_HARDWARE_H#define __ASM_ARCH_HARDWARE_H __FILE__Quoted 7 lines
arch/arm/mach-s5pv210/include/mach/hardware.h line 19
Quoted 5 lines
arch/arm/mach-s5pv210/include/mach/hardware.h +4
-1-/* currently nothing here, placeholder */ +enum s5pv210_revision {EVT_UNKNOWN =0 , +EVT0 , +EVT1 , +EVT1_FUSED };Do we really need checking of '
EVT1_FUSED' in kernel?
Quoted 5 lines
Um.. so far, we don't have cases that require FUSED mode separated. I have added
EVT1_FUSEDfor "future-use". However, it appears thatEVT1_FUSEDis not going to affect the kernel-level codes and I think we may get rid of it for the efficiency.
Yes, I mean that...only used it in boo-loader.
Quoted 33 lines
Quoted 33 lines
Review
Quoted 18 lines
arch/arm/mach-s5pv210/include/mach/hardware.h +14
-0+ +extern bool s5pv210_revision (enum s5pv210_revision ); +extern bool s5pv210_revision_or_later (enum s5pv210_revision ); +extern void set_s5pv210_revision (enum s5pv210_revision ); + +/* +* 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. +*/ +extern enum s5pv210_revision get_s5pv210_revision_chipid (void );#endif /* __ASM_ARCH_HARDWARE_H */ (quoted diff) +0
-0b/arch/arm/mach-s5pv210/mach-
Quoted 14 lines
aquila.c
index 46d5c7e..25f45d1 100644arch/arm/mach-s5pv210/mach-aquila.c +1
-0@@ -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,19 @@ static void __init aquila_map_io(void)
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-s5pv210/mach-aquila.c static void __init aquila_map_io(void) · line 543
Quoted 6 lines
arch/arm/mach-s5pv210/mach-aquila.c +4
-0static void __init aquila_machine_init (void ) { +enum s5pv210_revision cpurev =get_s5pv210_revision_chipid (); + +/* CPU Revision (EVTx) */ +if (cpurev ==EVT_UNKNOWN ) {If don't need '
EVT1_FUSED', maybe just need to checksystem_rev.
...so no need to add 'enum s5pv210_revision'
Just checking system_rev is enough...in your machine_init.
Quoted 47 lines
Quoted 47 lines
Quoted 6 lines
arch/arm/mach-s5pv210/mach-aquila.c +4
-0+ cpurev =EVT1 ; +if (system_rev &0x0800 ) { +if ((system_rev &0xF ) <8 ) + cpurev =EVT0 ;...
Quoted 2 lines
arch/arm/mach-s5pv210/mach-aquila.c +2
-0+ }else if (system_rev &0x2000 ) + cpurev =EVT0 ;...
Review
Quoted 8 lines
arch/arm/mach-s5pv210/mach-aquila.c +3
-0+ } +set_s5pv210_revision (cpurev); +/* PMIC */ aquila_pmic_init (); i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4,
i2c_gpio_pmic_devs,(quoted diff) +0
-0b/arch/arm/mach-s5pv210/mach-
Quoted 13 lines
goni.c
index 380d2ae..25a26ed 100644arch/arm/mach-s5pv210/mach-goni.c +1
-0@@ -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> arch/arm/mach-s5pv210/mach-goni.c static void __init goni_map_io(void) · line 528
Quoted 8 lines
arch/arm/mach-s5pv210/mach-goni.c +5
-0@@ -520,6 +521,13 @@ static void __init goni_map_io(void)static void __init goni_machine_init (void ) { +enum s5pv210_revision cpurev =get_s5pv210_revision_chipid (); + +/* CPU Revision (EVTx) */ +if (cpurev ==EVT_UNKNOWN ) + cpurev =EVT1 ;is it available only EVT1 on GONI?
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
arch/arm/mach-s5pv210/mach-goni.c +2
-0+set_s5pv210_revision (cpurev); +/* PMIC */ goni_pmic_init (); i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4,
i2c_gpio_pmic_devs,
--
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.