Commit fe388fac authored by Olof Johansson's avatar Olof Johansson

Merge tag 'samsung-exynos' of...

Merge tag 'samsung-exynos' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/soc

Samsung Exynos updates for 3.16

- add new SoCs support
  : exynos3250, 5260, 5410 and 5800

- enable multi-platform on exynos
  : consolidate exynos related Kconfig entries

* tag 'samsung-exynos' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung: (22 commits)
  ARM: EXYNOS: Enable multi-platform build support
  ARM: EXYNOS: Consolidate Kconfig entries
  ARM: EXYNOS: Add support for EXYNOS5410 SoC
  ARM: EXYNOS: Support secondary CPU boot of Exynos3250
  ARM: EXYNOS: Add Exynos3250 SoC ID
  ARM: EXYNOS: Add 5800 SoC support
  ARM: EXYNOS: initial board support for exynos5260 SoC
  cpufreq: exynos: Fix the compile error
  ARM: S3C24XX: move debug-macro.S into the common space
  ARM: S3C24XX: use generic DEBUG_UART_PHY/_VIRT in debug macro
  ARM: S3C24XX: trim down debug uart handling
  ARM: compressed/head.S: remove s3c24xx special case
  ARM: EXYNOS: Remove unnecessary inclusion of cpu.h
  ARM: EXYNOS: Migrate Exynos specific macros from plat to mach
  ARM: EXYNOS: Remove exynos_subsys registration
  ARM: EXYNOS: Remove duplicate lines in Makefile
  ARM: EXYNOS: use v7_exit_coherency_flush macro for cache disabling
  ARM: dts: Remove g2d_pd node for exynos5420
  ARM: dts: Remove mau_pd node for exynos5420
  ARM: exynos_defconfig: enable HS-I2C to fix for mmc partition mount
  ...
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 8792f592 9dfa92ec
...@@ -828,26 +828,6 @@ config ARCH_S5PV210 ...@@ -828,26 +828,6 @@ config ARCH_S5PV210
help help
Samsung S5PV210/S5PC110 series based systems Samsung S5PV210/S5PC110 series based systems
config ARCH_EXYNOS
bool "Samsung EXYNOS"
select ARCH_HAS_CPUFREQ
select ARCH_HAS_HOLES_MEMORYMODEL
select ARCH_REQUIRE_GPIOLIB
select ARCH_SPARSEMEM_ENABLE
select ARM_GIC
select COMMON_CLK_SAMSUNG
select CPU_V7
select GENERIC_CLOCKEVENTS
select HAVE_S3C2410_I2C if I2C
select HAVE_S3C2410_WATCHDOG if WATCHDOG
select HAVE_S3C_RTC if RTC_CLASS
select NEED_MACH_MEMORY_H
select SPARSE_IRQ
select SRAM
select USE_OF
help
Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
config ARCH_DAVINCI config ARCH_DAVINCI
bool "TI DaVinci" bool "TI DaVinci"
select ARCH_HAS_HOLES_MEMORYMODEL select ARCH_HAS_HOLES_MEMORYMODEL
......
...@@ -616,6 +616,7 @@ choice ...@@ -616,6 +616,7 @@ choice
config DEBUG_S3C_UART0 config DEBUG_S3C_UART0
depends on PLAT_SAMSUNG depends on PLAT_SAMSUNG
select DEBUG_EXYNOS_UART if ARCH_EXYNOS select DEBUG_EXYNOS_UART if ARCH_EXYNOS
select DEBUG_S3C24XX_UART if ARCH_S3C24XX
bool "Use S3C UART 0 for low-level debug" bool "Use S3C UART 0 for low-level debug"
help help
Say Y here if you want the debug print routines to direct Say Y here if you want the debug print routines to direct
...@@ -628,6 +629,7 @@ choice ...@@ -628,6 +629,7 @@ choice
config DEBUG_S3C_UART1 config DEBUG_S3C_UART1
depends on PLAT_SAMSUNG depends on PLAT_SAMSUNG
select DEBUG_EXYNOS_UART if ARCH_EXYNOS select DEBUG_EXYNOS_UART if ARCH_EXYNOS
select DEBUG_S3C24XX_UART if ARCH_S3C24XX
bool "Use S3C UART 1 for low-level debug" bool "Use S3C UART 1 for low-level debug"
help help
Say Y here if you want the debug print routines to direct Say Y here if you want the debug print routines to direct
...@@ -640,6 +642,7 @@ choice ...@@ -640,6 +642,7 @@ choice
config DEBUG_S3C_UART2 config DEBUG_S3C_UART2
depends on PLAT_SAMSUNG depends on PLAT_SAMSUNG
select DEBUG_EXYNOS_UART if ARCH_EXYNOS select DEBUG_EXYNOS_UART if ARCH_EXYNOS
select DEBUG_S3C24XX_UART if ARCH_S3C24XX
bool "Use S3C UART 2 for low-level debug" bool "Use S3C UART 2 for low-level debug"
help help
Say Y here if you want the debug print routines to direct Say Y here if you want the debug print routines to direct
...@@ -661,6 +664,33 @@ choice ...@@ -661,6 +664,33 @@ choice
The uncompressor code port configuration is now handled The uncompressor code port configuration is now handled
by CONFIG_S3C_LOWLEVEL_UART_PORT. by CONFIG_S3C_LOWLEVEL_UART_PORT.
config DEBUG_S3C2410_UART0
depends on ARCH_S3C24XX
select DEBUG_S3C2410_UART
bool "Use S3C2410/S3C2412 UART 0 for low-level debug"
help
Say Y here if you want the debug print routines to direct
their output to UART 0. The port must have been initialised
by the boot-loader before use.
config DEBUG_S3C2410_UART1
depends on ARCH_S3C24XX
select DEBUG_S3C2410_UART
bool "Use S3C2410/S3C2412 UART 1 for low-level debug"
help
Say Y here if you want the debug print routines to direct
their output to UART 1. The port must have been initialised
by the boot-loader before use.
config DEBUG_S3C2410_UART2
depends on ARCH_S3C24XX
select DEBUG_S3C2410_UART
bool "Use S3C2410/S3C2412 UART 2 for low-level debug"
help
Say Y here if you want the debug print routines to direct
their output to UART 2. The port must have been initialised
by the boot-loader before use.
config DEBUG_SOCFPGA_UART config DEBUG_SOCFPGA_UART
depends on ARCH_SOCFPGA depends on ARCH_SOCFPGA
bool "Use SOCFPGA UART for low-level debug" bool "Use SOCFPGA UART for low-level debug"
...@@ -912,6 +942,13 @@ endchoice ...@@ -912,6 +942,13 @@ endchoice
config DEBUG_EXYNOS_UART config DEBUG_EXYNOS_UART
bool bool
config DEBUG_S3C2410_UART
bool
select DEBUG_S3C24XX_UART
config DEBUG_S3C24XX_UART
bool
config DEBUG_OMAP2PLUS_UART config DEBUG_OMAP2PLUS_UART
bool bool
depends on ARCH_OMAP2PLUS depends on ARCH_OMAP2PLUS
...@@ -971,6 +1008,7 @@ config DEBUG_LL_INCLUDE ...@@ -971,6 +1008,7 @@ config DEBUG_LL_INCLUDE
DEBUG_IMX6SX_UART DEBUG_IMX6SX_UART
default "debug/msm.S" if DEBUG_MSM_UART || DEBUG_QCOM_UARTDM default "debug/msm.S" if DEBUG_MSM_UART || DEBUG_QCOM_UARTDM
default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
default "debug/s3c24xx.S" if DEBUG_S3C24XX_UART
default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
default "debug/sti.S" if DEBUG_STI_UART default "debug/sti.S" if DEBUG_STI_UART
default "debug/tegra.S" if DEBUG_TEGRA_UART default "debug/tegra.S" if DEBUG_TEGRA_UART
...@@ -1027,6 +1065,12 @@ config DEBUG_UART_PHYS ...@@ -1027,6 +1065,12 @@ config DEBUG_UART_PHYS
default 0x40090000 if ARCH_LPC32XX default 0x40090000 if ARCH_LPC32XX
default 0x40100000 if DEBUG_PXA_UART1 default 0x40100000 if DEBUG_PXA_UART1
default 0x42000000 if ARCH_GEMINI default 0x42000000 if ARCH_GEMINI
default 0x50000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
DEBUG_S3C2410_UART0)
default 0x50004000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART1 || \
DEBUG_S3C2410_UART1)
default 0x50008000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART2 || \
DEBUG_S3C2410_UART2)
default 0x7c0003f8 if FOOTBRIDGE default 0x7c0003f8 if FOOTBRIDGE
default 0x80070000 if DEBUG_IMX23_UART default 0x80070000 if DEBUG_IMX23_UART
default 0x80074000 if DEBUG_IMX28_UART default 0x80074000 if DEBUG_IMX28_UART
...@@ -1059,7 +1103,7 @@ config DEBUG_UART_PHYS ...@@ -1059,7 +1103,7 @@ config DEBUG_UART_PHYS
depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
DEBUG_LL_UART_EFM32 || \ DEBUG_LL_UART_EFM32 || \
DEBUG_UART_8250 || DEBUG_UART_PL01X || \ DEBUG_UART_8250 || DEBUG_UART_PL01X || \
DEBUG_MSM_UART || DEBUG_QCOM_UARTDM DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART
config DEBUG_UART_VIRT config DEBUG_UART_VIRT
hex "Virtual base address of debug UART" hex "Virtual base address of debug UART"
...@@ -1077,6 +1121,12 @@ config DEBUG_UART_VIRT ...@@ -1077,6 +1121,12 @@ config DEBUG_UART_VIRT
default 0xf2100000 if DEBUG_PXA_UART1 default 0xf2100000 if DEBUG_PXA_UART1
default 0xf4090000 if ARCH_LPC32XX default 0xf4090000 if ARCH_LPC32XX
default 0xf4200000 if ARCH_GEMINI default 0xf4200000 if ARCH_GEMINI
default 0xf7000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
DEBUG_S3C2410_UART0)
default 0xf7004000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART1 || \
DEBUG_S3C2410_UART1)
default 0xf7008000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART2 || \
DEBUG_S3C2410_UART2)
default 0xf7fc9000 if DEBUG_BERLIN_UART default 0xf7fc9000 if DEBUG_BERLIN_UART
default 0xf8009000 if DEBUG_VEXPRESS_UART0_CA9 default 0xf8009000 if DEBUG_VEXPRESS_UART0_CA9
default 0xf8090000 if DEBUG_VEXPRESS_UART0_RS1 default 0xf8090000 if DEBUG_VEXPRESS_UART0_RS1
...@@ -1120,7 +1170,7 @@ config DEBUG_UART_VIRT ...@@ -1120,7 +1170,7 @@ config DEBUG_UART_VIRT
default DEBUG_UART_PHYS if !MMU default DEBUG_UART_PHYS if !MMU
depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
DEBUG_UART_8250 || DEBUG_UART_PL01X || \ DEBUG_UART_8250 || DEBUG_UART_PL01X || \
DEBUG_MSM_UART || DEBUG_QCOM_UARTDM DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART
config DEBUG_UART_8250_SHIFT config DEBUG_UART_8250_SHIFT
int "Register offset shift for the 8250 debug UART" int "Register offset shift for the 8250 debug UART"
......
...@@ -60,11 +60,6 @@ ...@@ -60,11 +60,6 @@
add \rb, \rb, #0x00010000 @ Ser1 add \rb, \rb, #0x00010000 @ Ser1
#endif #endif
.endm .endm
#elif defined(CONFIG_ARCH_S3C24XX)
.macro loadsp, rb, tmp
mov \rb, #0x50000000
add \rb, \rb, #0x4000 * CONFIG_S3C_LOWLEVEL_UART_PORT
.endm
#else #else
.macro loadsp, rb, tmp .macro loadsp, rb, tmp
addruart \rb, \tmp addruart \rb, \tmp
......
...@@ -364,16 +364,4 @@ wakeup { ...@@ -364,16 +364,4 @@ wakeup {
gpio-key,wakeup; gpio-key,wakeup;
}; };
}; };
amba {
mdma1: mdma@11C10000 {
/*
* MDMA1 can support both secure and non-secure
* AXI transactions. When this is enabled in the kernel
* for boards that run in secure mode, we are getting
* imprecise external aborts causing the kernel to oops.
*/
status = "disabled";
};
};
}; };
...@@ -264,16 +264,6 @@ disp_pd: power-domain@100440C0 { ...@@ -264,16 +264,6 @@ disp_pd: power-domain@100440C0 {
reg = <0x100440C0 0x20>; reg = <0x100440C0 0x20>;
}; };
mau_pd: power-domain@100440E0 {
compatible = "samsung,exynos4210-pd";
reg = <0x100440E0 0x20>;
};
g2d_pd: power-domain@10044100 {
compatible = "samsung,exynos4210-pd";
reg = <0x10044100 0x20>;
};
msc_pd: power-domain@10044120 { msc_pd: power-domain@10044120 {
compatible = "samsung,exynos4210-pd"; compatible = "samsung,exynos4210-pd";
reg = <0x10044120 0x20>; reg = <0x10044120 0x20>;
...@@ -381,6 +371,13 @@ mdma1: mdma@11C10000 { ...@@ -381,6 +371,13 @@ mdma1: mdma@11C10000 {
#dma-cells = <1>; #dma-cells = <1>;
#dma-channels = <8>; #dma-channels = <8>;
#dma-requests = <1>; #dma-requests = <1>;
/*
* MDMA1 can support both secure and non-secure
* AXI transactions. When this is enabled in the kernel
* for boards that run in secure mode, we are getting
* imprecise external aborts causing the kernel to oops.
*/
status = "disabled";
}; };
}; };
...@@ -775,6 +772,5 @@ sss: sss@10830000 { ...@@ -775,6 +772,5 @@ sss: sss@10830000 {
interrupts = <0 112 0>; interrupts = <0 112 0>;
clocks = <&clock 471>; clocks = <&clock 471>;
clock-names = "secss"; clock-names = "secss";
samsung,power-domain = <&g2d_pd>;
}; };
}; };
...@@ -65,6 +65,7 @@ CONFIG_TCG_TIS_I2C_INFINEON=y ...@@ -65,6 +65,7 @@ CONFIG_TCG_TIS_I2C_INFINEON=y
CONFIG_I2C=y CONFIG_I2C=y
CONFIG_I2C_MUX=y CONFIG_I2C_MUX=y
CONFIG_I2C_ARB_GPIO_CHALLENGE=y CONFIG_I2C_ARB_GPIO_CHALLENGE=y
CONFIG_I2C_EXYNOS5=y
CONFIG_I2C_S3C2410=y CONFIG_I2C_S3C2410=y
CONFIG_DEBUG_GPIO=y CONFIG_DEBUG_GPIO=y
# CONFIG_HWMON is not set # CONFIG_HWMON is not set
......
...@@ -12,41 +12,13 @@ ...@@ -12,41 +12,13 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <mach/map.h>
#include <mach/regs-gpio.h>
#include <linux/serial_s3c.h> #include <linux/serial_s3c.h>
#define S3C2410_UART1_OFF (0x4000) #define S3C2410_UART1_OFF (0x4000)
#define SHIFT_2440TXF (14-9)
.macro addruart, rp, rv, tmp .macro addruart, rp, rv, tmp
ldr \rp, = S3C24XX_PA_UART ldr \rp, = CONFIG_DEBUG_UART_PHYS
ldr \rv, = S3C24XX_VA_UART ldr \rv, = CONFIG_DEBUG_UART_VIRT
#if CONFIG_DEBUG_S3C_UART != 0
add \rp, \rp, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART)
add \rv, \rv, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART)
#endif
.endm
.macro fifo_full_s3c24xx rd, rx
@ check for arm920 vs arm926. currently assume all arm926
@ devices have an 64 byte FIFO identical to the s3c2440
mrc p15, 0, \rd, c0, c0
and \rd, \rd, #0xff0
teq \rd, #0x260
beq 1004f
mrc p15, 0, \rd, c1, c0
tst \rd, #1
addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
bic \rd, \rd, #0xff000
ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)]
and \rd, \rd, #0x00ff0000
teq \rd, #0x00440000 @ is it 2440?
1004:
ldr \rd, [\rx, # S3C2410_UFSTAT]
moveq \rd, \rd, lsr #SHIFT_2440TXF
tst \rd, #S3C2410_UFSTAT_TXFULL
.endm .endm
.macro fifo_full_s3c2410 rd, rx .macro fifo_full_s3c2410 rd, rx
...@@ -54,30 +26,6 @@ ...@@ -54,30 +26,6 @@
tst \rd, #S3C2410_UFSTAT_TXFULL tst \rd, #S3C2410_UFSTAT_TXFULL
.endm .endm
/* fifo level reading */
.macro fifo_level_s3c24xx rd, rx
@ check for arm920 vs arm926. currently assume all arm926
@ devices have an 64 byte FIFO identical to the s3c2440
mrc p15, 0, \rd, c0, c0
and \rd, \rd, #0xff0
teq \rd, #0x260
beq 10000f
mrc p15, 0, \rd, c1, c0
tst \rd, #1
addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART)
bic \rd, \rd, #0xff000
ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)]
and \rd, \rd, #0x00ff0000
teq \rd, #0x00440000 @ is it 2440?
10000:
ldr \rd, [\rx, # S3C2410_UFSTAT]
andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
.endm
.macro fifo_level_s3c2410 rd, rx .macro fifo_level_s3c2410 rd, rx
ldr \rd, [\rx, # S3C2410_UFSTAT] ldr \rd, [\rx, # S3C2410_UFSTAT]
and \rd, \rd, #S3C2410_UFSTAT_TXMASK and \rd, \rd, #S3C2410_UFSTAT_TXMASK
...@@ -88,12 +36,9 @@ ...@@ -88,12 +36,9 @@
* used variants of these * used variants of these
*/ */
#if defined(CONFIG_CPU_LLSERIAL_S3C2410_ONLY) #if defined(CONFIG_DEBUG_S3C2410_UART)
#define fifo_full fifo_full_s3c2410 #define fifo_full fifo_full_s3c2410
#define fifo_level fifo_level_s3c2410 #define fifo_level fifo_level_s3c2410
#elif !defined(CONFIG_CPU_LLSERIAL_S3C2440_ONLY)
#define fifo_full fifo_full_s3c24xx
#define fifo_level fifo_level_s3c24xx
#endif #endif
/* include the reset of the code which will do the work */ /* include the reset of the code which will do the work */
......
...@@ -7,97 +7,102 @@ ...@@ -7,97 +7,102 @@
# Configuration options for the EXYNOS4 # Configuration options for the EXYNOS4
config ARCH_EXYNOS
bool "Samsung EXYNOS" if ARCH_MULTI_V7
select ARCH_HAS_BANDGAP
select ARCH_HAS_CPUFREQ
select ARCH_HAS_HOLES_MEMORYMODEL
select ARCH_REQUIRE_GPIOLIB
select ARM_AMBA
select ARM_GIC
select COMMON_CLK_SAMSUNG
select HAVE_ARM_SCU if SMP
select HAVE_S3C2410_I2C if I2C
select HAVE_S3C2410_WATCHDOG if WATCHDOG
select HAVE_S3C_RTC if RTC_CLASS
select PINCTRL
select PINCTRL_EXYNOS
select PM_GENERIC_DOMAINS if PM_RUNTIME
select S5P_DEV_MFC
select SRAM
help
Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)
if ARCH_EXYNOS if ARCH_EXYNOS
menu "SAMSUNG EXYNOS SoCs Support" menu "SAMSUNG EXYNOS SoCs Support"
config ARCH_EXYNOS3
bool "SAMSUNG EXYNOS3"
select ARM_CPU_SUSPEND if PM
help
Samsung EXYNOS3 (Crotex-A7) SoC based systems
config ARCH_EXYNOS4 config ARCH_EXYNOS4
bool "SAMSUNG EXYNOS4" bool "SAMSUNG EXYNOS4"
default y default y
select ARM_AMBA select ARM_CPU_SUSPEND if PM_SLEEP
select CLKSRC_OF
select CLKSRC_SAMSUNG_PWM if CPU_EXYNOS4210 select CLKSRC_SAMSUNG_PWM if CPU_EXYNOS4210
select CPU_EXYNOS4210 select CPU_EXYNOS4210
select GIC_NON_BANKED select GIC_NON_BANKED
select KEYBOARD_SAMSUNG if INPUT_KEYBOARD select KEYBOARD_SAMSUNG if INPUT_KEYBOARD
select HAVE_ARM_SCU if SMP
select HAVE_SMP
select MIGHT_HAVE_CACHE_L2X0 select MIGHT_HAVE_CACHE_L2X0
select PINCTRL
select PM_GENERIC_DOMAINS if PM_RUNTIME
select S5P_DEV_MFC
help help
Samsung EXYNOS4 SoCs based systems Samsung EXYNOS4 (Cortex-A9) SoC based systems
config ARCH_EXYNOS5 config ARCH_EXYNOS5
bool "SAMSUNG EXYNOS5" bool "SAMSUNG EXYNOS5"
select ARM_AMBA default y
select CLKSRC_OF
select HAVE_ARM_SCU if SMP
select HAVE_SMP
select PINCTRL
help help
Samsung EXYNOS5 (Cortex-A15) SoC based systems Samsung EXYNOS5 (Cortex-A15/A7) SoC based systems
comment "EXYNOS SoCs" comment "EXYNOS SoCs"
config SOC_EXYNOS3250
bool "SAMSUNG EXYNOS3250"
default y
depends on ARCH_EXYNOS3
config CPU_EXYNOS4210 config CPU_EXYNOS4210
bool "SAMSUNG EXYNOS4210" bool "SAMSUNG EXYNOS4210"
default y default y
depends on ARCH_EXYNOS4 depends on ARCH_EXYNOS4
select ARCH_HAS_BANDGAP
select ARM_CPU_SUSPEND if PM_SLEEP
select PINCTRL_EXYNOS
select SAMSUNG_DMADEV
help
Enable EXYNOS4210 CPU support
config SOC_EXYNOS4212 config SOC_EXYNOS4212
bool "SAMSUNG EXYNOS4212" bool "SAMSUNG EXYNOS4212"
default y default y
depends on ARCH_EXYNOS4 depends on ARCH_EXYNOS4
select ARCH_HAS_BANDGAP
select PINCTRL_EXYNOS
select SAMSUNG_DMADEV
help
Enable EXYNOS4212 SoC support
config SOC_EXYNOS4412 config SOC_EXYNOS4412
bool "SAMSUNG EXYNOS4412" bool "SAMSUNG EXYNOS4412"
default y default y
depends on ARCH_EXYNOS4 depends on ARCH_EXYNOS4
select ARCH_HAS_BANDGAP
select PINCTRL_EXYNOS
select SAMSUNG_DMADEV
help
Enable EXYNOS4412 SoC support
config SOC_EXYNOS5250 config SOC_EXYNOS5250
bool "SAMSUNG EXYNOS5250" bool "SAMSUNG EXYNOS5250"
default y default y
depends on ARCH_EXYNOS5 depends on ARCH_EXYNOS5
select ARCH_HAS_BANDGAP
select PINCTRL_EXYNOS config SOC_EXYNOS5260
select PM_GENERIC_DOMAINS if PM_RUNTIME bool "SAMSUNG EXYNOS5260"
select S5P_DEV_MFC default y
select SAMSUNG_DMADEV depends on ARCH_EXYNOS5
help
Enable EXYNOS5250 SoC support config SOC_EXYNOS5410
bool "SAMSUNG EXYNOS5410"
default y
depends on ARCH_EXYNOS5
config SOC_EXYNOS5420 config SOC_EXYNOS5420
bool "SAMSUNG EXYNOS5420" bool "SAMSUNG EXYNOS5420"
default y default y
depends on ARCH_EXYNOS5 depends on ARCH_EXYNOS5
select PM_GENERIC_DOMAINS if PM_RUNTIME
help
Enable EXYNOS5420 SoC support
config SOC_EXYNOS5440 config SOC_EXYNOS5440
bool "SAMSUNG EXYNOS5440" bool "SAMSUNG EXYNOS5440"
default y default y
depends on ARCH_EXYNOS5 depends on ARCH_EXYNOS5
select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
select ARCH_HAS_BANDGAP
select ARCH_HAS_OPP select ARCH_HAS_OPP
select HAVE_ARM_ARCH_TIMER select HAVE_ARM_ARCH_TIMER
select AUTO_ZRELADDR select AUTO_ZRELADDR
...@@ -108,6 +113,11 @@ config SOC_EXYNOS5440 ...@@ -108,6 +113,11 @@ config SOC_EXYNOS5440
help help
Enable EXYNOS5440 SoC support Enable EXYNOS5440 SoC support
config SOC_EXYNOS5800
bool "SAMSUNG EXYNOS5800"
default y
depends on SOC_EXYNOS5420
endmenu endmenu
config EXYNOS5420_MCPM config EXYNOS5420_MCPM
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
# #
# Licensed under GPLv2 # Licensed under GPLv2
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/$(src)/include -I$(srctree)/arch/arm/plat-samsung/include
obj-y := obj-y :=
obj-m := obj-m :=
obj-n := obj-n :=
...@@ -12,21 +14,16 @@ obj- := ...@@ -12,21 +14,16 @@ obj- :=
# Core # Core
obj-$(CONFIG_ARCH_EXYNOS) += exynos.o obj-$(CONFIG_ARCH_EXYNOS) += exynos.o pmu.o exynos-smc.o firmware.o
obj-$(CONFIG_PM_SLEEP) += pm.o sleep.o obj-$(CONFIG_PM_SLEEP) += pm.o sleep.o
obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
obj-$(CONFIG_CPU_IDLE) += cpuidle.o obj-$(CONFIG_CPU_IDLE) += cpuidle.o
obj-$(CONFIG_ARCH_EXYNOS) += pmu.o
obj-$(CONFIG_SMP) += platsmp.o headsmp.o obj-$(CONFIG_SMP) += platsmp.o headsmp.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
obj-$(CONFIG_ARCH_EXYNOS) += exynos-smc.o
obj-$(CONFIG_ARCH_EXYNOS) += firmware.o
plus_sec := $(call as-instr,.arch_extension sec,+sec) plus_sec := $(call as-instr,.arch_extension sec,+sec)
AFLAGS_exynos-smc.o :=-Wa,-march=armv7-a$(plus_sec) AFLAGS_exynos-smc.o :=-Wa,-march=armv7-a$(plus_sec)
......
...@@ -15,6 +15,102 @@ ...@@ -15,6 +15,102 @@
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/of.h> #include <linux/of.h>
#define EXYNOS3250_SOC_ID 0xE3472000
#define EXYNOS3_SOC_MASK 0xFFFFF000
#define EXYNOS4210_CPU_ID 0x43210000
#define EXYNOS4212_CPU_ID 0x43220000
#define EXYNOS4412_CPU_ID 0xE4412200
#define EXYNOS4_CPU_MASK 0xFFFE0000
#define EXYNOS5250_SOC_ID 0x43520000
#define EXYNOS5410_SOC_ID 0xE5410000
#define EXYNOS5420_SOC_ID 0xE5420000
#define EXYNOS5440_SOC_ID 0xE5440000
#define EXYNOS5800_SOC_ID 0xE5422000
#define EXYNOS5_SOC_MASK 0xFFFFF000
extern unsigned long samsung_cpu_id;
#define IS_SAMSUNG_CPU(name, id, mask) \
static inline int is_samsung_##name(void) \
{ \
return ((samsung_cpu_id & mask) == (id & mask)); \
}
IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK)
IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK)
IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK)
IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK)
IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK)
IS_SAMSUNG_CPU(exynos5410, EXYNOS5410_SOC_ID, EXYNOS5_SOC_MASK)
IS_SAMSUNG_CPU(exynos5420, EXYNOS5420_SOC_ID, EXYNOS5_SOC_MASK)
IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK)
IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK)
#if defined(CONFIG_SOC_EXYNOS3250)
# define soc_is_exynos3250() is_samsung_exynos3250()
#else
# define soc_is_exynos3250() 0
#endif
#if defined(CONFIG_CPU_EXYNOS4210)
# define soc_is_exynos4210() is_samsung_exynos4210()
#else
# define soc_is_exynos4210() 0
#endif
#if defined(CONFIG_SOC_EXYNOS4212)
# define soc_is_exynos4212() is_samsung_exynos4212()
#else
# define soc_is_exynos4212() 0
#endif
#if defined(CONFIG_SOC_EXYNOS4412)
# define soc_is_exynos4412() is_samsung_exynos4412()
#else
# define soc_is_exynos4412() 0
#endif
#define EXYNOS4210_REV_0 (0x0)
#define EXYNOS4210_REV_1_0 (0x10)
#define EXYNOS4210_REV_1_1 (0x11)
#if defined(CONFIG_SOC_EXYNOS5250)
# define soc_is_exynos5250() is_samsung_exynos5250()
#else
# define soc_is_exynos5250() 0
#endif
#if defined(CONFIG_SOC_EXYNOS5410)
# define soc_is_exynos5410() is_samsung_exynos5410()
#else
# define soc_is_exynos5410() 0
#endif
#if defined(CONFIG_SOC_EXYNOS5420)
# define soc_is_exynos5420() is_samsung_exynos5420()
#else
# define soc_is_exynos5420() 0
#endif
#if defined(CONFIG_SOC_EXYNOS5440)
# define soc_is_exynos5440() is_samsung_exynos5440()
#else
# define soc_is_exynos5440() 0
#endif
#if defined(CONFIG_SOC_EXYNOS5800)
# define soc_is_exynos5800() is_samsung_exynos5800()
#else
# define soc_is_exynos5800() 0
#endif
#define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4212() || \
soc_is_exynos4412())
#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \
soc_is_exynos5420() || soc_is_exynos5800())
void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1); void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1);
struct map_desc; struct map_desc;
...@@ -70,4 +166,7 @@ extern void exynos_cluster_power_down(int cluster); ...@@ -70,4 +166,7 @@ extern void exynos_cluster_power_down(int cluster);
extern void exynos_cluster_power_up(int cluster); extern void exynos_cluster_power_up(int cluster);
extern int exynos_cluster_power_state(int cluster); extern int exynos_cluster_power_state(int cluster);
extern void s5p_init_cpu(void __iomem *cpuid_addr);
extern unsigned int samsung_rev(void);
#endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <asm/unified.h> #include <asm/unified.h>
#include <asm/cpuidle.h> #include <asm/cpuidle.h>
#include <plat/cpu.h>
#include <plat/pm.h> #include <plat/pm.h>
#include <mach/map.h> #include <mach/map.h>
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/memory.h> #include <asm/memory.h>
#include <plat/cpu.h>
#include "common.h" #include "common.h"
#include "mfc.h" #include "mfc.h"
#include "regs-pmu.h" #include "regs-pmu.h"
...@@ -244,17 +242,6 @@ void __init exynos_init_io(void) ...@@ -244,17 +242,6 @@ void __init exynos_init_io(void)
exynos_map_io(); exynos_map_io();
} }
struct bus_type exynos_subsys = {
.name = "exynos-core",
.dev_name = "exynos-core",
};
static int __init exynos_core_init(void)
{
return subsys_system_register(&exynos_subsys, NULL);
}
core_initcall(exynos_core_init);
static int __init exynos4_l2x0_cache_init(void) static int __init exynos4_l2x0_cache_init(void)
{ {
int ret; int ret;
...@@ -306,12 +293,15 @@ static void __init exynos_dt_machine_init(void) ...@@ -306,12 +293,15 @@ static void __init exynos_dt_machine_init(void)
} }
static char const *exynos_dt_compat[] __initconst = { static char const *exynos_dt_compat[] __initconst = {
"samsung,exynos3",
"samsung,exynos3250",
"samsung,exynos4", "samsung,exynos4",
"samsung,exynos4210", "samsung,exynos4210",
"samsung,exynos4212", "samsung,exynos4212",
"samsung,exynos4412", "samsung,exynos4412",
"samsung,exynos5", "samsung,exynos5",
"samsung,exynos5250", "samsung,exynos5250",
"samsung,exynos5260",
"samsung,exynos5420", "samsung,exynos5420",
"samsung,exynos5440", "samsung,exynos5440",
NULL NULL
......
...@@ -29,6 +29,21 @@ static int exynos_do_idle(void) ...@@ -29,6 +29,21 @@ static int exynos_do_idle(void)
static int exynos_cpu_boot(int cpu) static int exynos_cpu_boot(int cpu)
{ {
/*
* Exynos3250 doesn't need to send smc command for secondary CPU boot
* because Exynos3250 removes WFE in secure mode.
*/
if (soc_is_exynos3250())
return 0;
/*
* The second parameter of SMC_CMD_CPU1BOOT command means CPU id.
* But, Exynos4212 has only one secondary CPU so second parameter
* isn't used for informing secure firmware about CPU id.
*/
if (soc_is_exynos4212())
cpu = 0;
exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0); exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
return 0; return 0;
} }
...@@ -40,7 +55,10 @@ static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr) ...@@ -40,7 +55,10 @@ static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
if (!sysram_ns_base_addr) if (!sysram_ns_base_addr)
return -ENODEV; return -ENODEV;
boot_reg = sysram_ns_base_addr + 0x1c + 4*cpu; boot_reg = sysram_ns_base_addr + 0x1c;
if (!soc_is_exynos4212() && !soc_is_exynos3250())
boot_reg += 4*cpu;
__raw_writel(boot_addr, boot_reg); __raw_writel(boot_addr, boot_reg);
return 0; return 0;
......
...@@ -19,61 +19,9 @@ ...@@ -19,61 +19,9 @@
#include <asm/cp15.h> #include <asm/cp15.h>
#include <asm/smp_plat.h> #include <asm/smp_plat.h>
#include <plat/cpu.h>
#include "common.h" #include "common.h"
#include "regs-pmu.h" #include "regs-pmu.h"
static inline void cpu_enter_lowpower_a9(void)
{
unsigned int v;
asm volatile(
" mcr p15, 0, %1, c7, c5, 0\n"
" mcr p15, 0, %1, c7, c10, 4\n"
/*
* Turn off coherency
*/
" mrc p15, 0, %0, c1, c0, 1\n"
" bic %0, %0, %3\n"
" mcr p15, 0, %0, c1, c0, 1\n"
" mrc p15, 0, %0, c1, c0, 0\n"
" bic %0, %0, %2\n"
" mcr p15, 0, %0, c1, c0, 0\n"
: "=&r" (v)
: "r" (0), "Ir" (CR_C), "Ir" (0x40)
: "cc");
}
static inline void cpu_enter_lowpower_a15(void)
{
unsigned int v;
asm volatile(
" mrc p15, 0, %0, c1, c0, 0\n"
" bic %0, %0, %1\n"
" mcr p15, 0, %0, c1, c0, 0\n"
: "=&r" (v)
: "Ir" (CR_C)
: "cc");
flush_cache_louis();
asm volatile(
/*
* Turn off coherency
*/
" mrc p15, 0, %0, c1, c0, 1\n"
" bic %0, %0, %1\n"
" mcr p15, 0, %0, c1, c0, 1\n"
: "=&r" (v)
: "Ir" (0x40)
: "cc");
isb();
dsb();
}
static inline void cpu_leave_lowpower(void) static inline void cpu_leave_lowpower(void)
{ {
unsigned int v; unsigned int v;
...@@ -132,19 +80,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious) ...@@ -132,19 +80,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
void __ref exynos_cpu_die(unsigned int cpu) void __ref exynos_cpu_die(unsigned int cpu)
{ {
int spurious = 0; int spurious = 0;
int primary_part = 0;
/* v7_exit_coherency_flush(louis);
* we're ready for shutdown now, so do it.
* Exynos4 is A9 based while Exynos5 is A15; check the CPU part
* number by reading the Main ID register and then perform the
* appropriate sequence for entering low power.
*/
asm("mrc p15, 0, %0, c0, c0, 0" : "=r"(primary_part) : : "cc");
if ((primary_part & 0xfff0) == 0xc0f0)
cpu_enter_lowpower_a15();
else
cpu_enter_lowpower_a9();
platform_do_lowpower(cpu, &spurious); platform_do_lowpower(cpu, &spurious);
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
#include <asm/smp_scu.h> #include <asm/smp_scu.h>
#include <asm/firmware.h> #include <asm/firmware.h>
#include <plat/cpu.h>
#include "common.h" #include "common.h"
#include "regs-pmu.h" #include "regs-pmu.h"
...@@ -72,7 +70,7 @@ static inline void __iomem *cpu_boot_reg(int cpu) ...@@ -72,7 +70,7 @@ static inline void __iomem *cpu_boot_reg(int cpu)
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
if (soc_is_exynos4412()) if (soc_is_exynos4412())
boot_reg += 4*cpu; boot_reg += 4*cpu;
else if (soc_is_exynos5420()) else if (soc_is_exynos5420() || soc_is_exynos5800())
boot_reg += 4; boot_reg += 4;
return boot_reg; return boot_reg;
} }
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <asm/smp_scu.h> #include <asm/smp_scu.h>
#include <asm/suspend.h> #include <asm/suspend.h>
#include <plat/cpu.h>
#include <plat/pm-common.h> #include <plat/pm-common.h>
#include <plat/pll.h> #include <plat/pll.h>
#include <plat/regs-srom.h> #include <plat/regs-srom.h>
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/bug.h> #include <linux/bug.h>
#include <plat/cpu.h>
#include "common.h" #include "common.h"
#include "regs-pmu.h" #include "regs-pmu.h"
......
...@@ -28,7 +28,6 @@ config CPU_S3C2410 ...@@ -28,7 +28,6 @@ config CPU_S3C2410
bool "SAMSUNG S3C2410" bool "SAMSUNG S3C2410"
default y default y
select CPU_ARM920T select CPU_ARM920T
select CPU_LLSERIAL_S3C2410
select S3C2410_COMMON_CLK select S3C2410_COMMON_CLK
select S3C2410_DMA if S3C24XX_DMA select S3C2410_DMA if S3C24XX_DMA
select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ
...@@ -41,7 +40,6 @@ config CPU_S3C2410 ...@@ -41,7 +40,6 @@ config CPU_S3C2410
config CPU_S3C2412 config CPU_S3C2412
bool "SAMSUNG S3C2412" bool "SAMSUNG S3C2412"
select CPU_ARM926T select CPU_ARM926T
select CPU_LLSERIAL_S3C2440
select S3C2412_COMMON_CLK select S3C2412_COMMON_CLK
select S3C2412_DMA if S3C24XX_DMA select S3C2412_DMA if S3C24XX_DMA
select S3C2412_PM if PM select S3C2412_PM if PM
...@@ -51,7 +49,6 @@ config CPU_S3C2412 ...@@ -51,7 +49,6 @@ config CPU_S3C2412
config CPU_S3C2416 config CPU_S3C2416
bool "SAMSUNG S3C2416/S3C2450" bool "SAMSUNG S3C2416/S3C2450"
select CPU_ARM926T select CPU_ARM926T
select CPU_LLSERIAL_S3C2440
select S3C2416_PM if PM select S3C2416_PM if PM
select S3C2443_COMMON_CLK select S3C2443_COMMON_CLK
select S3C2443_DMA if S3C24XX_DMA select S3C2443_DMA if S3C24XX_DMA
...@@ -61,7 +58,6 @@ config CPU_S3C2416 ...@@ -61,7 +58,6 @@ config CPU_S3C2416
config CPU_S3C2440 config CPU_S3C2440
bool "SAMSUNG S3C2440" bool "SAMSUNG S3C2440"
select CPU_ARM920T select CPU_ARM920T
select CPU_LLSERIAL_S3C2440
select S3C2410_COMMON_CLK select S3C2410_COMMON_CLK
select S3C2410_PM if PM select S3C2410_PM if PM
select S3C2440_DMA if S3C24XX_DMA select S3C2440_DMA if S3C24XX_DMA
...@@ -71,7 +67,6 @@ config CPU_S3C2440 ...@@ -71,7 +67,6 @@ config CPU_S3C2440
config CPU_S3C2442 config CPU_S3C2442
bool "SAMSUNG S3C2442" bool "SAMSUNG S3C2442"
select CPU_ARM920T select CPU_ARM920T
select CPU_LLSERIAL_S3C2440
select S3C2410_COMMON_CLK select S3C2410_COMMON_CLK
select S3C2410_DMA if S3C24XX_DMA select S3C2410_DMA if S3C24XX_DMA
select S3C2410_PM if PM select S3C2410_PM if PM
...@@ -86,7 +81,6 @@ config CPU_S3C244X ...@@ -86,7 +81,6 @@ config CPU_S3C244X
config CPU_S3C2443 config CPU_S3C2443
bool "SAMSUNG S3C2443" bool "SAMSUNG S3C2443"
select CPU_ARM920T select CPU_ARM920T
select CPU_LLSERIAL_S3C2440
select S3C2443_COMMON_CLK select S3C2443_COMMON_CLK
select S3C2443_DMA if S3C24XX_DMA select S3C2443_DMA if S3C24XX_DMA
help help
...@@ -148,28 +142,6 @@ config S3C2410_PM ...@@ -148,28 +142,6 @@ config S3C2410_PM
help help
Power Management code common to S3C2410 and better Power Management code common to S3C2410 and better
# low-level serial option nodes
config CPU_LLSERIAL_S3C2410_ONLY
bool
default y if CPU_LLSERIAL_S3C2410 && !CPU_LLSERIAL_S3C2440
config CPU_LLSERIAL_S3C2440_ONLY
bool
default y if CPU_LLSERIAL_S3C2440 && !CPU_LLSERIAL_S3C2410
config CPU_LLSERIAL_S3C2410
bool
help
Selected if there is an S3C2410 (or register compatible) serial
low-level implementation needed
config CPU_LLSERIAL_S3C2440
bool
help
Selected if there is an S3C2440 (or register compatible) serial
low-level implementation needed
config S3C24XX_PLL config S3C24XX_PLL
bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)" bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)"
depends on ARM_S3C24XX_CPUFREQ depends on ARM_S3C24XX_CPUFREQ
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
# #
# Licensed under GPLv2 # Licensed under GPLv2
ccflags-$(CONFIG_ARCH_MULTI_V7) += -I$(srctree)/$(src)/include
ccflags-$(CONFIG_ARCH_EXYNOS) += -I$(srctree)/arch/arm/mach-exynos/include
obj-y := obj-y :=
obj-m := obj-m :=
obj-n := dummy.o obj-n := dummy.o
......
...@@ -43,16 +43,6 @@ extern unsigned long samsung_cpu_id; ...@@ -43,16 +43,6 @@ extern unsigned long samsung_cpu_id;
#define S5PV210_CPU_ID 0x43110000 #define S5PV210_CPU_ID 0x43110000
#define S5PV210_CPU_MASK 0xFFFFF000 #define S5PV210_CPU_MASK 0xFFFFF000
#define EXYNOS4210_CPU_ID 0x43210000
#define EXYNOS4212_CPU_ID 0x43220000
#define EXYNOS4412_CPU_ID 0xE4412200
#define EXYNOS4_CPU_MASK 0xFFFE0000
#define EXYNOS5250_SOC_ID 0x43520000
#define EXYNOS5420_SOC_ID 0xE5420000
#define EXYNOS5440_SOC_ID 0xE5440000
#define EXYNOS5_SOC_MASK 0xFFFFF000
#define IS_SAMSUNG_CPU(name, id, mask) \ #define IS_SAMSUNG_CPU(name, id, mask) \
static inline int is_samsung_##name(void) \ static inline int is_samsung_##name(void) \
{ \ { \
...@@ -68,12 +58,6 @@ IS_SAMSUNG_CPU(s5p6440, S5P6440_CPU_ID, S5P64XX_CPU_MASK) ...@@ -68,12 +58,6 @@ IS_SAMSUNG_CPU(s5p6440, S5P6440_CPU_ID, S5P64XX_CPU_MASK)
IS_SAMSUNG_CPU(s5p6450, S5P6450_CPU_ID, S5P64XX_CPU_MASK) IS_SAMSUNG_CPU(s5p6450, S5P6450_CPU_ID, S5P64XX_CPU_MASK)
IS_SAMSUNG_CPU(s5pc100, S5PC100_CPU_ID, S5PC100_CPU_MASK) IS_SAMSUNG_CPU(s5pc100, S5PC100_CPU_ID, S5PC100_CPU_MASK)
IS_SAMSUNG_CPU(s5pv210, S5PV210_CPU_ID, S5PV210_CPU_MASK) IS_SAMSUNG_CPU(s5pv210, S5PV210_CPU_ID, S5PV210_CPU_MASK)
IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK)
IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK)
IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK)
IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK)
IS_SAMSUNG_CPU(exynos5420, EXYNOS5420_SOC_ID, EXYNOS5_SOC_MASK)
IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK)
#if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \ #if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \
defined(CONFIG_CPU_S3C2416) || defined(CONFIG_CPU_S3C2440) || \ defined(CONFIG_CPU_S3C2416) || defined(CONFIG_CPU_S3C2440) || \
...@@ -126,50 +110,6 @@ IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK) ...@@ -126,50 +110,6 @@ IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK)
# define soc_is_s5pv210() 0 # define soc_is_s5pv210() 0
#endif #endif
#if defined(CONFIG_CPU_EXYNOS4210)
# define soc_is_exynos4210() is_samsung_exynos4210()
#else
# define soc_is_exynos4210() 0
#endif
#if defined(CONFIG_SOC_EXYNOS4212)
# define soc_is_exynos4212() is_samsung_exynos4212()
#else
# define soc_is_exynos4212() 0
#endif
#if defined(CONFIG_SOC_EXYNOS4412)
# define soc_is_exynos4412() is_samsung_exynos4412()
#else
# define soc_is_exynos4412() 0
#endif
#define EXYNOS4210_REV_0 (0x0)
#define EXYNOS4210_REV_1_0 (0x10)
#define EXYNOS4210_REV_1_1 (0x11)
#if defined(CONFIG_SOC_EXYNOS5250)
# define soc_is_exynos5250() is_samsung_exynos5250()
#else
# define soc_is_exynos5250() 0
#endif
#if defined(CONFIG_SOC_EXYNOS5420)
# define soc_is_exynos5420() is_samsung_exynos5420()
#else
# define soc_is_exynos5420() 0
#endif
#if defined(CONFIG_SOC_EXYNOS5440)
# define soc_is_exynos5440() is_samsung_exynos5440()
#else
# define soc_is_exynos5440() 0
#endif
#define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4212() || \
soc_is_exynos4412())
#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5420())
#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
#ifndef KHZ #ifndef KHZ
...@@ -239,7 +179,6 @@ extern struct bus_type s3c2443_subsys; ...@@ -239,7 +179,6 @@ extern struct bus_type s3c2443_subsys;
extern struct bus_type s3c6410_subsys; extern struct bus_type s3c6410_subsys;
extern struct bus_type s5p64x0_subsys; extern struct bus_type s5p64x0_subsys;
extern struct bus_type s5pv210_subsys; extern struct bus_type s5pv210_subsys;
extern struct bus_type exynos_subsys;
extern void (*s5pc1xx_idle)(void); extern void (*s5pc1xx_idle)(void);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/of.h>
#include <plat/cpu.h> #include <plat/cpu.h>
...@@ -163,14 +164,22 @@ static int exynos_cpufreq_probe(struct platform_device *pdev) ...@@ -163,14 +164,22 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
if (!exynos_info) if (!exynos_info)
return -ENOMEM; return -ENOMEM;
if (soc_is_exynos4210()) if (of_machine_is_compatible("samsung,exynos4210")) {
exynos_info->type = EXYNOS_SOC_4210;
ret = exynos4210_cpufreq_init(exynos_info); ret = exynos4210_cpufreq_init(exynos_info);
else if (soc_is_exynos4212() || soc_is_exynos4412()) } else if (of_machine_is_compatible("samsung,exynos4212")) {
exynos_info->type = EXYNOS_SOC_4212;
ret = exynos4x12_cpufreq_init(exynos_info); ret = exynos4x12_cpufreq_init(exynos_info);
else if (soc_is_exynos5250()) } else if (of_machine_is_compatible("samsung,exynos4412")) {
exynos_info->type = EXYNOS_SOC_4412;
ret = exynos4x12_cpufreq_init(exynos_info);
} else if (of_machine_is_compatible("samsung,exynos5250")) {
exynos_info->type = EXYNOS_SOC_5250;
ret = exynos5250_cpufreq_init(exynos_info); ret = exynos5250_cpufreq_init(exynos_info);
else } else {
return 0; pr_err("%s: Unknown SoC type\n", __func__);
return -ENODEV;
}
if (ret) if (ret)
goto err_vdd_arm; goto err_vdd_arm;
......
...@@ -17,6 +17,13 @@ enum cpufreq_level_index { ...@@ -17,6 +17,13 @@ enum cpufreq_level_index {
L20, L20,
}; };
enum exynos_soc_type {
EXYNOS_SOC_4210,
EXYNOS_SOC_4212,
EXYNOS_SOC_4412,
EXYNOS_SOC_5250,
};
#define APLL_FREQ(f, a0, a1, a2, a3, a4, a5, a6, a7, b0, b1, b2, m, p, s) \ #define APLL_FREQ(f, a0, a1, a2, a3, a4, a5, a6, a7, b0, b1, b2, m, p, s) \
{ \ { \
.freq = (f) * 1000, \ .freq = (f) * 1000, \
...@@ -34,6 +41,7 @@ struct apll_freq { ...@@ -34,6 +41,7 @@ struct apll_freq {
}; };
struct exynos_dvfs_info { struct exynos_dvfs_info {
enum exynos_soc_type type;
unsigned long mpll_freq_khz; unsigned long mpll_freq_khz;
unsigned int pll_safe_idx; unsigned int pll_safe_idx;
struct clk *cpu_clk; struct clk *cpu_clk;
......
...@@ -100,7 +100,6 @@ static struct apll_freq apll_freq_4412[] = { ...@@ -100,7 +100,6 @@ static struct apll_freq apll_freq_4412[] = {
static void exynos4x12_set_clkdiv(unsigned int div_index) static void exynos4x12_set_clkdiv(unsigned int div_index)
{ {
unsigned int tmp; unsigned int tmp;
unsigned int stat_cpu1;
/* Change Divider - CPU0 */ /* Change Divider - CPU0 */
...@@ -115,13 +114,11 @@ static void exynos4x12_set_clkdiv(unsigned int div_index) ...@@ -115,13 +114,11 @@ static void exynos4x12_set_clkdiv(unsigned int div_index)
tmp = apll_freq_4x12[div_index].clk_div_cpu1; tmp = apll_freq_4x12[div_index].clk_div_cpu1;
__raw_writel(tmp, EXYNOS4_CLKDIV_CPU1); __raw_writel(tmp, EXYNOS4_CLKDIV_CPU1);
if (soc_is_exynos4212())
stat_cpu1 = 0x11;
else
stat_cpu1 = 0x111;
while (__raw_readl(EXYNOS4_CLKDIV_STATCPU1) & stat_cpu1) do {
cpu_relax(); cpu_relax();
tmp = __raw_readl(EXYNOS4_CLKDIV_STATCPU1);
} while (tmp != 0x0);
} }
static void exynos4x12_set_apll(unsigned int index) static void exynos4x12_set_apll(unsigned int index)
...@@ -184,7 +181,7 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info) ...@@ -184,7 +181,7 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info)
if (IS_ERR(mout_apll)) if (IS_ERR(mout_apll))
goto err_mout_apll; goto err_mout_apll;
if (soc_is_exynos4212()) if (info->type == EXYNOS_SOC_4212)
apll_freq_4x12 = apll_freq_4212; apll_freq_4x12 = apll_freq_4212;
else else
apll_freq_4x12 = apll_freq_4412; apll_freq_4x12 = apll_freq_4412;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment