diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-07-17 17:25:58 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-07-17 17:25:58 -0400 |
commit | 77e77e1b61b422698a17da9eaafe6ce89dc242e2 (patch) | |
tree | 398d0e7c2064a9d81c85cc699aa3a703a33451fa | |
parent | ff6091436239f618205bfcc86fb5bda4e28f47a1 (diff) | |
parent | 2aa1ecf731fc4211a6b453167dff44c778789743 (diff) |
Merge branch 'next/devel-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/soc
From Kukjin Kim <kgene.kim@samsung.com>:
This is general development for Samsung stuff for v3.6
* 'next/devel-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
ARM: SAMSUNG: Introduce Kconfig variable for Samsung custom clk API
ARM: EXYNOS: Add missing static storage class specifier in pmu.c file
ARM: EXYNOS: Make combiner_init function static
ARM: EXYNOS: Update HSOTG PHY clock setting for EXYNOS4X12
ARM: EXYNOS: Clear SYS_WDTRESET bit to use watchdog reset
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/arm/mach-exynos/common.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/regs-pmu.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/regs-usb-phy.h | 20 | ||||
-rw-r--r-- | arch/arm/mach-exynos/pmu.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-exynos/setup-usb-phy.c | 60 | ||||
-rw-r--r-- | arch/arm/plat-samsung/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/plat-samsung/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/cpu.h | 4 |
8 files changed, 92 insertions, 26 deletions
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 742edd3bbec3..1b0922cda4ab 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c | |||
@@ -540,7 +540,8 @@ static struct irq_domain_ops combiner_irq_domain_ops = { | |||
540 | .map = combiner_irq_domain_map, | 540 | .map = combiner_irq_domain_map, |
541 | }; | 541 | }; |
542 | 542 | ||
543 | void __init combiner_init(void __iomem *combiner_base, struct device_node *np) | 543 | static void __init combiner_init(void __iomem *combiner_base, |
544 | struct device_node *np) | ||
544 | { | 545 | { |
545 | int i, irq, irq_base; | 546 | int i, irq, irq_base; |
546 | unsigned int max_nr, nr_irq; | 547 | unsigned int max_nr, nr_irq; |
diff --git a/arch/arm/mach-exynos/include/mach/regs-pmu.h b/arch/arm/mach-exynos/include/mach/regs-pmu.h index 43a99e6f56ab..d4e392b811a3 100644 --- a/arch/arm/mach-exynos/include/mach/regs-pmu.h +++ b/arch/arm/mach-exynos/include/mach/regs-pmu.h | |||
@@ -232,6 +232,11 @@ | |||
232 | 232 | ||
233 | #define EXYNOS5_USB_CFG S5P_PMUREG(0x0230) | 233 | #define EXYNOS5_USB_CFG S5P_PMUREG(0x0230) |
234 | 234 | ||
235 | #define EXYNOS5_AUTO_WDTRESET_DISABLE S5P_PMUREG(0x0408) | ||
236 | #define EXYNOS5_MASK_WDTRESET_REQUEST S5P_PMUREG(0x040C) | ||
237 | |||
238 | #define EXYNOS5_SYS_WDTRESET (1 << 20) | ||
239 | |||
235 | #define EXYNOS5_ARM_CORE0_SYS_PWR_REG S5P_PMUREG(0x1000) | 240 | #define EXYNOS5_ARM_CORE0_SYS_PWR_REG S5P_PMUREG(0x1000) |
236 | #define EXYNOS5_DIS_IRQ_ARM_CORE0_LOCAL_SYS_PWR_REG S5P_PMUREG(0x1004) | 241 | #define EXYNOS5_DIS_IRQ_ARM_CORE0_LOCAL_SYS_PWR_REG S5P_PMUREG(0x1004) |
237 | #define EXYNOS5_DIS_IRQ_ARM_CORE0_CENTRAL_SYS_PWR_REG S5P_PMUREG(0x1008) | 242 | #define EXYNOS5_DIS_IRQ_ARM_CORE0_CENTRAL_SYS_PWR_REG S5P_PMUREG(0x1008) |
diff --git a/arch/arm/mach-exynos/include/mach/regs-usb-phy.h b/arch/arm/mach-exynos/include/mach/regs-usb-phy.h index c337cf3a71bf..07277735252e 100644 --- a/arch/arm/mach-exynos/include/mach/regs-usb-phy.h +++ b/arch/arm/mach-exynos/include/mach/regs-usb-phy.h | |||
@@ -35,11 +35,21 @@ | |||
35 | #define PHY1_COMMON_ON_N (1 << 7) | 35 | #define PHY1_COMMON_ON_N (1 << 7) |
36 | #define PHY0_COMMON_ON_N (1 << 4) | 36 | #define PHY0_COMMON_ON_N (1 << 4) |
37 | #define PHY0_ID_PULLUP (1 << 2) | 37 | #define PHY0_ID_PULLUP (1 << 2) |
38 | #define CLKSEL_MASK (0x3 << 0) | 38 | |
39 | #define CLKSEL_SHIFT (0) | 39 | #define EXYNOS4_CLKSEL_SHIFT (0) |
40 | #define CLKSEL_48M (0x0 << 0) | 40 | |
41 | #define CLKSEL_12M (0x2 << 0) | 41 | #define EXYNOS4210_CLKSEL_MASK (0x3 << 0) |
42 | #define CLKSEL_24M (0x3 << 0) | 42 | #define EXYNOS4210_CLKSEL_48M (0x0 << 0) |
43 | #define EXYNOS4210_CLKSEL_12M (0x2 << 0) | ||
44 | #define EXYNOS4210_CLKSEL_24M (0x3 << 0) | ||
45 | |||
46 | #define EXYNOS4X12_CLKSEL_MASK (0x7 << 0) | ||
47 | #define EXYNOS4X12_CLKSEL_9600K (0x0 << 0) | ||
48 | #define EXYNOS4X12_CLKSEL_10M (0x1 << 0) | ||
49 | #define EXYNOS4X12_CLKSEL_12M (0x2 << 0) | ||
50 | #define EXYNOS4X12_CLKSEL_19200K (0x3 << 0) | ||
51 | #define EXYNOS4X12_CLKSEL_20M (0x4 << 0) | ||
52 | #define EXYNOS4X12_CLKSEL_24M (0x5 << 0) | ||
43 | 53 | ||
44 | #define EXYNOS4_RSTCON EXYNOS4_HSOTG_PHYREG(0x08) | 54 | #define EXYNOS4_RSTCON EXYNOS4_HSOTG_PHYREG(0x08) |
45 | #define HOST_LINK_PORT_SWRST_MASK (0xf << 6) | 55 | #define HOST_LINK_PORT_SWRST_MASK (0xf << 6) |
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index 4aacb66f7161..3a48c852be6c 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c | |||
@@ -315,7 +315,7 @@ static struct exynos_pmu_conf exynos5250_pmu_config[] = { | |||
315 | { PMU_TABLE_END,}, | 315 | { PMU_TABLE_END,}, |
316 | }; | 316 | }; |
317 | 317 | ||
318 | void __iomem *exynos5_list_both_cnt_feed[] = { | 318 | static void __iomem *exynos5_list_both_cnt_feed[] = { |
319 | EXYNOS5_ARM_CORE0_OPTION, | 319 | EXYNOS5_ARM_CORE0_OPTION, |
320 | EXYNOS5_ARM_CORE1_OPTION, | 320 | EXYNOS5_ARM_CORE1_OPTION, |
321 | EXYNOS5_ARM_COMMON_OPTION, | 321 | EXYNOS5_ARM_COMMON_OPTION, |
@@ -329,7 +329,7 @@ void __iomem *exynos5_list_both_cnt_feed[] = { | |||
329 | EXYNOS5_TOP_PWR_SYSMEM_OPTION, | 329 | EXYNOS5_TOP_PWR_SYSMEM_OPTION, |
330 | }; | 330 | }; |
331 | 331 | ||
332 | void __iomem *exynos5_list_diable_wfi_wfe[] = { | 332 | static void __iomem *exynos5_list_diable_wfi_wfe[] = { |
333 | EXYNOS5_ARM_CORE1_OPTION, | 333 | EXYNOS5_ARM_CORE1_OPTION, |
334 | EXYNOS5_FSYS_ARM_OPTION, | 334 | EXYNOS5_FSYS_ARM_OPTION, |
335 | EXYNOS5_ISP_ARM_OPTION, | 335 | EXYNOS5_ISP_ARM_OPTION, |
@@ -390,6 +390,8 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode) | |||
390 | 390 | ||
391 | static int __init exynos_pmu_init(void) | 391 | static int __init exynos_pmu_init(void) |
392 | { | 392 | { |
393 | unsigned int value; | ||
394 | |||
393 | exynos_pmu_config = exynos4210_pmu_config; | 395 | exynos_pmu_config = exynos4210_pmu_config; |
394 | 396 | ||
395 | if (soc_is_exynos4210()) { | 397 | if (soc_is_exynos4210()) { |
@@ -399,6 +401,18 @@ static int __init exynos_pmu_init(void) | |||
399 | exynos_pmu_config = exynos4x12_pmu_config; | 401 | exynos_pmu_config = exynos4x12_pmu_config; |
400 | pr_info("EXYNOS4x12 PMU Initialize\n"); | 402 | pr_info("EXYNOS4x12 PMU Initialize\n"); |
401 | } else if (soc_is_exynos5250()) { | 403 | } else if (soc_is_exynos5250()) { |
404 | /* | ||
405 | * When SYS_WDTRESET is set, watchdog timer reset request | ||
406 | * is ignored by power management unit. | ||
407 | */ | ||
408 | value = __raw_readl(EXYNOS5_AUTO_WDTRESET_DISABLE); | ||
409 | value &= ~EXYNOS5_SYS_WDTRESET; | ||
410 | __raw_writel(value, EXYNOS5_AUTO_WDTRESET_DISABLE); | ||
411 | |||
412 | value = __raw_readl(EXYNOS5_MASK_WDTRESET_REQUEST); | ||
413 | value &= ~EXYNOS5_SYS_WDTRESET; | ||
414 | __raw_writel(value, EXYNOS5_MASK_WDTRESET_REQUEST); | ||
415 | |||
402 | exynos_pmu_config = exynos5250_pmu_config; | 416 | exynos_pmu_config = exynos5250_pmu_config; |
403 | pr_info("EXYNOS5250 PMU Initialize\n"); | 417 | pr_info("EXYNOS5250 PMU Initialize\n"); |
404 | } else { | 418 | } else { |
diff --git a/arch/arm/mach-exynos/setup-usb-phy.c b/arch/arm/mach-exynos/setup-usb-phy.c index 1af0a7f44e00..b81cc569a8dd 100644 --- a/arch/arm/mach-exynos/setup-usb-phy.c +++ b/arch/arm/mach-exynos/setup-usb-phy.c | |||
@@ -31,27 +31,55 @@ static void exynos4210_usb_phy_clkset(struct platform_device *pdev) | |||
31 | struct clk *xusbxti_clk; | 31 | struct clk *xusbxti_clk; |
32 | u32 phyclk; | 32 | u32 phyclk; |
33 | 33 | ||
34 | /* set clock frequency for PLL */ | ||
35 | phyclk = readl(EXYNOS4_PHYCLK) & ~CLKSEL_MASK; | ||
36 | |||
37 | xusbxti_clk = clk_get(&pdev->dev, "xusbxti"); | 34 | xusbxti_clk = clk_get(&pdev->dev, "xusbxti"); |
38 | if (xusbxti_clk && !IS_ERR(xusbxti_clk)) { | 35 | if (xusbxti_clk && !IS_ERR(xusbxti_clk)) { |
39 | switch (clk_get_rate(xusbxti_clk)) { | 36 | if (soc_is_exynos4210()) { |
40 | case 12 * MHZ: | 37 | /* set clock frequency for PLL */ |
41 | phyclk |= CLKSEL_12M; | 38 | phyclk = readl(EXYNOS4_PHYCLK) & ~EXYNOS4210_CLKSEL_MASK; |
42 | break; | 39 | |
43 | case 24 * MHZ: | 40 | switch (clk_get_rate(xusbxti_clk)) { |
44 | phyclk |= CLKSEL_24M; | 41 | case 12 * MHZ: |
45 | break; | 42 | phyclk |= EXYNOS4210_CLKSEL_12M; |
46 | default: | 43 | break; |
47 | case 48 * MHZ: | 44 | case 48 * MHZ: |
48 | /* default reference clock */ | 45 | phyclk |= EXYNOS4210_CLKSEL_48M; |
49 | break; | 46 | break; |
47 | default: | ||
48 | case 24 * MHZ: | ||
49 | phyclk |= EXYNOS4210_CLKSEL_24M; | ||
50 | break; | ||
51 | } | ||
52 | writel(phyclk, EXYNOS4_PHYCLK); | ||
53 | } else if (soc_is_exynos4212() || soc_is_exynos4412()) { | ||
54 | /* set clock frequency for PLL */ | ||
55 | phyclk = readl(EXYNOS4_PHYCLK) & ~EXYNOS4X12_CLKSEL_MASK; | ||
56 | |||
57 | switch (clk_get_rate(xusbxti_clk)) { | ||
58 | case 9600 * KHZ: | ||
59 | phyclk |= EXYNOS4X12_CLKSEL_9600K; | ||
60 | break; | ||
61 | case 10 * MHZ: | ||
62 | phyclk |= EXYNOS4X12_CLKSEL_10M; | ||
63 | break; | ||
64 | case 12 * MHZ: | ||
65 | phyclk |= EXYNOS4X12_CLKSEL_12M; | ||
66 | break; | ||
67 | case 19200 * KHZ: | ||
68 | phyclk |= EXYNOS4X12_CLKSEL_19200K; | ||
69 | break; | ||
70 | case 20 * MHZ: | ||
71 | phyclk |= EXYNOS4X12_CLKSEL_20M; | ||
72 | break; | ||
73 | default: | ||
74 | case 24 * MHZ: | ||
75 | /* default reference clock */ | ||
76 | phyclk |= EXYNOS4X12_CLKSEL_24M; | ||
77 | break; | ||
78 | } | ||
79 | writel(phyclk, EXYNOS4_PHYCLK); | ||
50 | } | 80 | } |
51 | clk_put(xusbxti_clk); | 81 | clk_put(xusbxti_clk); |
52 | } | 82 | } |
53 | |||
54 | writel(phyclk, EXYNOS4_PHYCLK); | ||
55 | } | 83 | } |
56 | 84 | ||
57 | static int exynos4210_usb_phy0_init(struct platform_device *pdev) | 85 | static int exynos4210_usb_phy0_init(struct platform_device *pdev) |
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index a2fae4ea0936..9b4cfd412b1b 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig | |||
@@ -78,6 +78,10 @@ config S5P_HRT | |||
78 | 78 | ||
79 | # clock options | 79 | # clock options |
80 | 80 | ||
81 | config SAMSUNG_CLOCK | ||
82 | bool | ||
83 | default y if !COMMON_CLK | ||
84 | |||
81 | config SAMSUNG_CLKSRC | 85 | config SAMSUNG_CLKSRC |
82 | bool | 86 | bool |
83 | help | 87 | help |
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index 860b2db4db15..abf2f3b66988 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile | |||
@@ -15,8 +15,8 @@ obj-y += init.o cpu.o | |||
15 | obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o | 15 | obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o |
16 | obj-$(CONFIG_S5P_HRT) += s5p-time.o | 16 | obj-$(CONFIG_S5P_HRT) += s5p-time.o |
17 | 17 | ||
18 | obj-y += clock.o | 18 | obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o |
19 | obj-y += pwm-clock.o | 19 | obj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.o |
20 | 20 | ||
21 | obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o | 21 | obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o |
22 | obj-$(CONFIG_S5P_CLOCK) += s5p-clock.o | 22 | obj-$(CONFIG_S5P_CLOCK) += s5p-clock.o |
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h index 0721293fad63..ace4451b7651 100644 --- a/arch/arm/plat-samsung/include/plat/cpu.h +++ b/arch/arm/plat-samsung/include/plat/cpu.h | |||
@@ -132,6 +132,10 @@ IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK) | |||
132 | 132 | ||
133 | #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } | 133 | #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } |
134 | 134 | ||
135 | #ifndef KHZ | ||
136 | #define KHZ (1000) | ||
137 | #endif | ||
138 | |||
135 | #ifndef MHZ | 139 | #ifndef MHZ |
136 | #define MHZ (1000*1000) | 140 | #define MHZ (1000*1000) |
137 | #endif | 141 | #endif |