aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2015-01-21 19:49:26 -0500
committerOlof Johansson <olof@lixom.net>2015-01-21 19:49:26 -0500
commit2b5901895833341fd7171273104eca67492c33f9 (patch)
treebbafcf7d53c6dd5f10ab9178a10e68d0e32be951
parent8614f9f7fc8fe569341be447277d52c44731c41a (diff)
parent13efcb188984f69e1f97b4d9e7d3663fb782946f (diff)
Merge tag 'omap-for-v3.20/fixes-not-urgent-pt1' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/fixes-non-critical
Merge "omap non-urgent fixes for v3.20" from Tony Lindgren: Non-urgent fixes for omap variant dm816x that has been in a sorry broken half merged state for a few years now. This gets us to the point where we can boot it properly once the related SoC data is added. Note that we've already made dm816x device tree only by removing the known broken board file. * tag 'omap-for-v3.20/fixes-not-urgent-pt1' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP2+: Disable omap3 PM init for ti81xx ARM: OMAP2+: Fix reboot for 81xx ARM: OMAP2+: Fix dm814 and dm816 for clocks and timer init ARM: OMAP2+: Fix ti81xx class type ARM: OMAP2+: Fix ti81xx devtype ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--arch/arm/mach-omap2/Makefile1
-rw-r--r--arch/arm/mach-omap2/clock.c3
-rw-r--r--arch/arm/mach-omap2/common.h11
-rw-r--r--arch/arm/mach-omap2/control.h4
-rw-r--r--arch/arm/mach-omap2/id.c2
-rw-r--r--arch/arm/mach-omap2/io.c26
-rw-r--r--arch/arm/mach-omap2/powerdomains3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/prm_common.c4
-rw-r--r--arch/arm/mach-omap2/soc.h4
-rw-r--r--arch/arm/mach-omap2/ti81xx-restart.c34
-rw-r--r--arch/arm/mach-omap2/timer.c2
11 files changed, 84 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 5d27dfdef66b..3a6463f88ea2 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -58,6 +58,7 @@ AFLAGS_sram34xx.o :=-Wa,-march=armv7-a
58# Restart code (OMAP4/5 currently in omap4-common.c) 58# Restart code (OMAP4/5 currently in omap4-common.c)
59obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o 59obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o
60obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o 60obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o
61obj-$(CONFIG_SOC_TI81XX) += ti81xx-restart.o
61obj-$(CONFIG_SOC_AM33XX) += am33xx-restart.o 62obj-$(CONFIG_SOC_AM33XX) += am33xx-restart.o
62obj-$(CONFIG_SOC_AM43XX) += omap4-restart.o 63obj-$(CONFIG_SOC_AM43XX) += omap4-restart.o
63obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o 64obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 6ad5b4dbd33e..4ae4ccebced2 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -620,6 +620,9 @@ void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks)
620 620
621 for (i = 0; i < num_clocks; i++) { 621 for (i = 0; i < num_clocks; i++) {
622 init_clk = clk_get(NULL, clk_names[i]); 622 init_clk = clk_get(NULL, clk_names[i]);
623 if (WARN(IS_ERR(init_clk), "could not find init clock %s\n",
624 clk_names[i]))
625 continue;
623 clk_prepare_enable(init_clk); 626 clk_prepare_enable(init_clk);
624 } 627 }
625} 628}
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 377eea849e7b..65b4371b3361 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -110,7 +110,8 @@ void omap3630_init_early(void);
110void omap3_init_early(void); /* Do not use this one */ 110void omap3_init_early(void); /* Do not use this one */
111void am33xx_init_early(void); 111void am33xx_init_early(void);
112void am35xx_init_early(void); 112void am35xx_init_early(void);
113void ti81xx_init_early(void); 113void ti814x_init_early(void);
114void ti816x_init_early(void);
114void am33xx_init_early(void); 115void am33xx_init_early(void);
115void am43xx_init_early(void); 116void am43xx_init_early(void);
116void am43xx_init_late(void); 117void am43xx_init_late(void);
@@ -163,6 +164,14 @@ static inline void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
163} 164}
164#endif 165#endif
165 166
167#ifdef CONFIG_SOC_TI81XX
168void ti81xx_restart(enum reboot_mode mode, const char *cmd);
169#else
170static inline void ti81xx_restart(enum reboot_mode mode, const char *cmd)
171{
172}
173#endif
174
166#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ 175#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
167 defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX) 176 defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
168void omap44xx_restart(enum reboot_mode mode, const char *cmd); 177void omap44xx_restart(enum reboot_mode mode, const char *cmd);
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index a3c013345c45..0fba6d1130a9 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -53,6 +53,7 @@
53#define OMAP343X_CONTROL_GENERAL_WKUP 0xa60 53#define OMAP343X_CONTROL_GENERAL_WKUP 0xa60
54 54
55/* TI81XX spefic control submodules */ 55/* TI81XX spefic control submodules */
56#define TI81XX_CONTROL_DEVBOOT 0x040
56#define TI81XX_CONTROL_DEVCONF 0x600 57#define TI81XX_CONTROL_DEVCONF 0x600
57 58
58/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */ 59/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
@@ -246,6 +247,9 @@
246#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250 247#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250
247#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254 248#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254
248 249
250/* TI81XX CONTROL_DEVBOOT register offsets */
251#define TI81XX_CONTROL_STATUS (TI81XX_CONTROL_DEVBOOT + 0x000)
252
249/* TI81XX CONTROL_DEVCONF register offsets */ 253/* TI81XX CONTROL_DEVCONF register offsets */
250#define TI81XX_CONTROL_DEVICE_ID (TI81XX_CONTROL_DEVCONF + 0x000) 254#define TI81XX_CONTROL_DEVICE_ID (TI81XX_CONTROL_DEVCONF + 0x000)
251 255
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index c25feba05818..2a2f4d56e4c8 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -56,6 +56,8 @@ int omap_type(void)
56 56
57 if (cpu_is_omap24xx()) { 57 if (cpu_is_omap24xx()) {
58 val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS); 58 val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
59 } else if (cpu_is_ti81xx()) {
60 val = omap_ctrl_readl(TI81XX_CONTROL_STATUS);
59 } else if (soc_is_am33xx() || soc_is_am43xx()) { 61 } else if (soc_is_am33xx() || soc_is_am43xx()) {
60 val = omap_ctrl_readl(AM33XX_CONTROL_STATUS); 62 val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
61 } else if (cpu_is_omap34xx()) { 63 } else if (cpu_is_omap34xx()) {
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index a1bd6affb508..e4a5630149e1 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -492,9 +492,28 @@ void __init am35xx_init_early(void)
492 omap_clk_soc_init = am35xx_dt_clk_init; 492 omap_clk_soc_init = am35xx_dt_clk_init;
493} 493}
494 494
495void __init ti81xx_init_early(void) 495void __init ti814x_init_early(void)
496{ 496{
497 omap2_set_globals_tap(OMAP343X_CLASS, 497 omap2_set_globals_tap(TI814X_CLASS,
498 OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
499 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
500 NULL);
501 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE));
502 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
503 omap3xxx_check_revision();
504 ti81xx_check_features();
505 omap3xxx_voltagedomains_init();
506 omap3xxx_powerdomains_init();
507 omap3xxx_clockdomains_init();
508 omap3xxx_hwmod_init();
509 omap_hwmod_init_postsetup();
510 if (of_have_populated_dt())
511 omap_clk_soc_init = ti81xx_dt_clk_init;
512}
513
514void __init ti816x_init_early(void)
515{
516 omap2_set_globals_tap(TI816X_CLASS,
498 OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE)); 517 OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
499 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE), 518 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
500 NULL); 519 NULL);
@@ -509,8 +528,6 @@ void __init ti81xx_init_early(void)
509 omap_hwmod_init_postsetup(); 528 omap_hwmod_init_postsetup();
510 if (of_have_populated_dt()) 529 if (of_have_populated_dt())
511 omap_clk_soc_init = ti81xx_dt_clk_init; 530 omap_clk_soc_init = ti81xx_dt_clk_init;
512 else
513 omap_clk_soc_init = omap3xxx_clk_init;
514} 531}
515 532
516void __init omap3_init_late(void) 533void __init omap3_init_late(void)
@@ -551,7 +568,6 @@ void __init am35xx_init_late(void)
551void __init ti81xx_init_late(void) 568void __init ti81xx_init_late(void)
552{ 569{
553 omap_common_late_init(); 570 omap_common_late_init();
554 omap3_pm_init();
555 omap2_clk_enable_autoidle_all(); 571 omap2_clk_enable_autoidle_all();
556} 572}
557#endif 573#endif
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index 328c1037cb60..70bc7066a4c2 100644
--- a/arch/arm/mach-omap2/powerdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c
@@ -464,7 +464,7 @@ void __init omap3xxx_powerdomains_init(void)
464{ 464{
465 unsigned int rev; 465 unsigned int rev;
466 466
467 if (!cpu_is_omap34xx()) 467 if (!cpu_is_omap34xx() && !cpu_is_ti81xx())
468 return; 468 return;
469 469
470 pwrdm_register_platform_funcs(&omap3_pwrdm_operations); 470 pwrdm_register_platform_funcs(&omap3_pwrdm_operations);
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 779940cb6e56..b6587854bca5 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -571,6 +571,10 @@ static const struct of_device_id omap_prcm_dt_match_table[] = {
571 { .compatible = "ti,am3-scrm" }, 571 { .compatible = "ti,am3-scrm" },
572 { .compatible = "ti,am4-prcm" }, 572 { .compatible = "ti,am4-prcm" },
573 { .compatible = "ti,am4-scrm" }, 573 { .compatible = "ti,am4-scrm" },
574 { .compatible = "ti,dm814-prcm" },
575 { .compatible = "ti,dm814-scrm" },
576 { .compatible = "ti,dm816-prcm" },
577 { .compatible = "ti,dm816-scrm" },
574 { .compatible = "ti,omap2-prcm" }, 578 { .compatible = "ti,omap2-prcm" },
575 { .compatible = "ti,omap2-scrm" }, 579 { .compatible = "ti,omap2-scrm" },
576 { .compatible = "ti,omap3-prm" }, 580 { .compatible = "ti,omap3-prm" },
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index c1a3b4416311..f97654d11ea5 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -423,13 +423,13 @@ IS_OMAP_TYPE(3430, 0x3430)
423#define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (0x1 << 8)) 423#define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (0x1 << 8))
424#define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (0x2 << 8)) 424#define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (0x2 << 8))
425 425
426#define TI816X_CLASS 0x81600034 426#define TI816X_CLASS 0x81600081
427#define TI8168_REV_ES1_0 TI816X_CLASS 427#define TI8168_REV_ES1_0 TI816X_CLASS
428#define TI8168_REV_ES1_1 (TI816X_CLASS | (0x1 << 8)) 428#define TI8168_REV_ES1_1 (TI816X_CLASS | (0x1 << 8))
429#define TI8168_REV_ES2_0 (TI816X_CLASS | (0x2 << 8)) 429#define TI8168_REV_ES2_0 (TI816X_CLASS | (0x2 << 8))
430#define TI8168_REV_ES2_1 (TI816X_CLASS | (0x3 << 8)) 430#define TI8168_REV_ES2_1 (TI816X_CLASS | (0x3 << 8))
431 431
432#define TI814X_CLASS 0x81400034 432#define TI814X_CLASS 0x81400081
433#define TI8148_REV_ES1_0 TI814X_CLASS 433#define TI8148_REV_ES1_0 TI814X_CLASS
434#define TI8148_REV_ES2_0 (TI814X_CLASS | (0x1 << 8)) 434#define TI8148_REV_ES2_0 (TI814X_CLASS | (0x1 << 8))
435#define TI8148_REV_ES2_1 (TI814X_CLASS | (0x2 << 8)) 435#define TI8148_REV_ES2_1 (TI814X_CLASS | (0x2 << 8))
diff --git a/arch/arm/mach-omap2/ti81xx-restart.c b/arch/arm/mach-omap2/ti81xx-restart.c
new file mode 100644
index 000000000000..6c3ce7c46ddd
--- /dev/null
+++ b/arch/arm/mach-omap2/ti81xx-restart.c
@@ -0,0 +1,34 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation.
5 */
6#include <linux/kernel.h>
7#include <linux/init.h>
8#include <linux/reboot.h>
9
10#include "iomap.h"
11#include "common.h"
12#include "control.h"
13#include "prm3xxx.h"
14
15#define TI81XX_PRM_DEVICE_RSTCTRL 0x00a0
16#define TI81XX_GLOBAL_RST_COLD BIT(1)
17
18/**
19 * ti81xx_restart - trigger a software restart of the SoC
20 * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
21 * @cmd: passed from the userspace program rebooting the system (if provided)
22 *
23 * Resets the SoC. For @cmd, see the 'reboot' syscall in
24 * kernel/sys.c. No return value.
25 *
26 * NOTE: Warm reset does not seem to work, may require resetting
27 * clocks to bypass mode.
28 */
29void ti81xx_restart(enum reboot_mode mode, const char *cmd)
30{
31 omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
32 TI81XX_PRM_DEVICE_RSTCTRL);
33 while (1);
34}
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 4f61148ec168..376b099ba84b 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -146,6 +146,8 @@ static const struct of_device_id omap_timer_match[] __initconst = {
146 { .compatible = "ti,omap3430-timer", }, 146 { .compatible = "ti,omap3430-timer", },
147 { .compatible = "ti,omap4430-timer", }, 147 { .compatible = "ti,omap4430-timer", },
148 { .compatible = "ti,omap5430-timer", }, 148 { .compatible = "ti,omap5430-timer", },
149 { .compatible = "ti,dm814-timer", },
150 { .compatible = "ti,dm816-timer", },
149 { .compatible = "ti,am335x-timer", }, 151 { .compatible = "ti,am335x-timer", },
150 { .compatible = "ti,am335x-timer-1ms", }, 152 { .compatible = "ti,am335x-timer-1ms", },
151 { } 153 { }