All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Fixes and clean-up in preparation for booting ti81xx
@ 2015-01-13 23:13 ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel

Hi all,

The ti81xx support has been in a sorry half-merged state for
past few years in the mainline kernel. Let's get it working
by first fixing the issues.

Note that another series of patches is needed to add the 81xx
related data files.

Regards,

Tony

Tony Lindgren (7):
  ARM: OMAP2+: Remove unused ti81xx platform init code
  ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
  ARM: OMAP2+: Fix ti81xx devtype
  ARM: OMAP2+: Fix ti81xx class type
  ARM: OMAP2+: Fix dm814 and dm816 for clocks and timer init
  ARM: OMAP2+: Fix reboot for 81xx
  ARM: OMAP2+: Disable omap3 PM init for ti81xx

 arch/arm/mach-omap2/Makefile                |  1 +
 arch/arm/mach-omap2/cclock3xxx_data.c       |  6 +----
 arch/arm/mach-omap2/clock.c                 |  5 +++++
 arch/arm/mach-omap2/common.h                | 11 ++++++++-
 arch/arm/mach-omap2/control.h               |  4 ++++
 arch/arm/mach-omap2/id.c                    |  2 ++
 arch/arm/mach-omap2/io.c                    | 26 ++++++++++++++++-----
 arch/arm/mach-omap2/omap_phy_internal.c     | 35 -----------------------------
 arch/arm/mach-omap2/powerdomains3xxx_data.c |  2 +-
 arch/arm/mach-omap2/prm_common.c            |  4 ++++
 arch/arm/mach-omap2/soc.h                   |  4 ++--
 arch/arm/mach-omap2/ti81xx-restart.c        | 31 +++++++++++++++++++++++++
 arch/arm/mach-omap2/timer.c                 |  2 ++
 arch/arm/mach-omap2/usb-musb.c              | 12 ++--------
 arch/arm/mach-omap2/usb.h                   |  2 --
 15 files changed, 86 insertions(+), 61 deletions(-)
 create mode 100644 arch/arm/mach-omap2/ti81xx-restart.c

-- 
2.1.4


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 0/7] Fixes and clean-up in preparation for booting ti81xx
@ 2015-01-13 23:13 ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

The ti81xx support has been in a sorry half-merged state for
past few years in the mainline kernel. Let's get it working
by first fixing the issues.

Note that another series of patches is needed to add the 81xx
related data files.

Regards,

Tony

Tony Lindgren (7):
  ARM: OMAP2+: Remove unused ti81xx platform init code
  ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
  ARM: OMAP2+: Fix ti81xx devtype
  ARM: OMAP2+: Fix ti81xx class type
  ARM: OMAP2+: Fix dm814 and dm816 for clocks and timer init
  ARM: OMAP2+: Fix reboot for 81xx
  ARM: OMAP2+: Disable omap3 PM init for ti81xx

 arch/arm/mach-omap2/Makefile                |  1 +
 arch/arm/mach-omap2/cclock3xxx_data.c       |  6 +----
 arch/arm/mach-omap2/clock.c                 |  5 +++++
 arch/arm/mach-omap2/common.h                | 11 ++++++++-
 arch/arm/mach-omap2/control.h               |  4 ++++
 arch/arm/mach-omap2/id.c                    |  2 ++
 arch/arm/mach-omap2/io.c                    | 26 ++++++++++++++++-----
 arch/arm/mach-omap2/omap_phy_internal.c     | 35 -----------------------------
 arch/arm/mach-omap2/powerdomains3xxx_data.c |  2 +-
 arch/arm/mach-omap2/prm_common.c            |  4 ++++
 arch/arm/mach-omap2/soc.h                   |  4 ++--
 arch/arm/mach-omap2/ti81xx-restart.c        | 31 +++++++++++++++++++++++++
 arch/arm/mach-omap2/timer.c                 |  2 ++
 arch/arm/mach-omap2/usb-musb.c              | 12 ++--------
 arch/arm/mach-omap2/usb.h                   |  2 --
 15 files changed, 86 insertions(+), 61 deletions(-)
 create mode 100644 arch/arm/mach-omap2/ti81xx-restart.c

-- 
2.1.4

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code
  2015-01-13 23:13 ` Tony Lindgren
@ 2015-01-13 23:13   ` Tony Lindgren
  -1 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Brian Hutchinson

The support for 81xx was never working in mainline, and it
will be only supported in device tree mode. Let's remove all
the remaining 81xx related platform code.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/cclock3xxx_data.c   |  6 +-----
 arch/arm/mach-omap2/omap_phy_internal.c | 35 ---------------------------------
 arch/arm/mach-omap2/usb-musb.c          | 12 ++---------
 arch/arm/mach-omap2/usb.h               |  2 --
 4 files changed, 3 insertions(+), 52 deletions(-)

diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
index 644ff32..e79c80b 100644
--- a/arch/arm/mach-omap2/cclock3xxx_data.c
+++ b/arch/arm/mach-omap2/cclock3xxx_data.c
@@ -3634,10 +3634,6 @@ int __init omap3xxx_clk_init(void)
 		omap_clocks_register(omap36xx_am35xx_omap3430es2plus_clks,
 				     ARRAY_SIZE(omap36xx_am35xx_omap3430es2plus_clks));
 		omap_clocks_register(omap3xxx_clks, ARRAY_SIZE(omap3xxx_clks));
-	} else if (soc_is_am33xx()) {
-		cpu_mask = RATE_IN_AM33XX;
-	} else if (cpu_is_ti814x()) {
-		cpu_mask = RATE_IN_TI814X;
 	} else if (cpu_is_omap34xx()) {
 		if (omap_rev() == OMAP3430_REV_ES1_0) {
 			cpu_mask = RATE_IN_3430ES1;
@@ -3681,7 +3677,7 @@ int __init omap3xxx_clk_init(void)
 	 * Lock DPLL5 -- here only until other device init code can
 	 * handle this
 	 */
-	if (!cpu_is_ti81xx() && (omap_rev() >= OMAP3430_REV_ES2_0))
+	if (omap_rev() >= OMAP3430_REV_ES2_0)
 		omap3_clk_lock_dpll5();
 
 	/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index 1a19fa0..8e90356 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -152,38 +152,3 @@ void am35x_set_mode(u8 musb_mode)
 
 	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
 }
-
-void ti81xx_musb_phy_power(u8 on)
-{
-	void __iomem *scm_base = NULL;
-	u32 usbphycfg;
-
-	scm_base = ioremap(TI81XX_SCM_BASE, SZ_2K);
-	if (!scm_base) {
-		pr_err("system control module ioremap failed\n");
-		return;
-	}
-
-	usbphycfg = readl_relaxed(scm_base + USBCTRL0);
-
-	if (on) {
-		if (cpu_is_ti816x()) {
-			usbphycfg |= TI816X_USBPHY0_NORMAL_MODE;
-			usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC;
-		} else if (cpu_is_ti814x()) {
-			usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN
-				| USBPHY_DPINPUT | USBPHY_DMINPUT);
-			usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN
-				| USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL);
-		}
-	} else {
-		if (cpu_is_ti816x())
-			usbphycfg &= ~TI816X_USBPHY0_NORMAL_MODE;
-		else if (cpu_is_ti814x())
-			usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;
-
-	}
-	writel_relaxed(usbphycfg, scm_base + USBCTRL0);
-
-	iounmap(scm_base);
-}
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index bc89723..e4562b2 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -82,16 +82,8 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
 	musb_plat.mode = board_data->mode;
 	musb_plat.extvbus = board_data->extvbus;
 
-	if (soc_is_am35xx()) {
-		oh_name = "am35x_otg_hs";
-		name = "musb-am35x";
-	} else if (cpu_is_ti81xx()) {
-		oh_name = "usb_otg_hs";
-		name = "musb-ti81xx";
-	} else {
-		oh_name = "usb_otg_hs";
-		name = "musb-omap2430";
-	}
+	oh_name = "usb_otg_hs";
+	name = "musb-omap2430";
 
         oh = omap_hwmod_lookup(oh_name);
         if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
diff --git a/arch/arm/mach-omap2/usb.h b/arch/arm/mach-omap2/usb.h
index 4ba2ae7..3395365 100644
--- a/arch/arm/mach-omap2/usb.h
+++ b/arch/arm/mach-omap2/usb.h
@@ -68,5 +68,3 @@ extern void am35x_musb_reset(void);
 extern void am35x_musb_phy_power(u8 on);
 extern void am35x_musb_clear_irq(void);
 extern void am35x_set_mode(u8 musb_mode);
-extern void ti81xx_musb_phy_power(u8 on);
-
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code
@ 2015-01-13 23:13   ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-arm-kernel

The support for 81xx was never working in mainline, and it
will be only supported in device tree mode. Let's remove all
the remaining 81xx related platform code.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/cclock3xxx_data.c   |  6 +-----
 arch/arm/mach-omap2/omap_phy_internal.c | 35 ---------------------------------
 arch/arm/mach-omap2/usb-musb.c          | 12 ++---------
 arch/arm/mach-omap2/usb.h               |  2 --
 4 files changed, 3 insertions(+), 52 deletions(-)

diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
index 644ff32..e79c80b 100644
--- a/arch/arm/mach-omap2/cclock3xxx_data.c
+++ b/arch/arm/mach-omap2/cclock3xxx_data.c
@@ -3634,10 +3634,6 @@ int __init omap3xxx_clk_init(void)
 		omap_clocks_register(omap36xx_am35xx_omap3430es2plus_clks,
 				     ARRAY_SIZE(omap36xx_am35xx_omap3430es2plus_clks));
 		omap_clocks_register(omap3xxx_clks, ARRAY_SIZE(omap3xxx_clks));
-	} else if (soc_is_am33xx()) {
-		cpu_mask = RATE_IN_AM33XX;
-	} else if (cpu_is_ti814x()) {
-		cpu_mask = RATE_IN_TI814X;
 	} else if (cpu_is_omap34xx()) {
 		if (omap_rev() == OMAP3430_REV_ES1_0) {
 			cpu_mask = RATE_IN_3430ES1;
@@ -3681,7 +3677,7 @@ int __init omap3xxx_clk_init(void)
 	 * Lock DPLL5 -- here only until other device init code can
 	 * handle this
 	 */
-	if (!cpu_is_ti81xx() && (omap_rev() >= OMAP3430_REV_ES2_0))
+	if (omap_rev() >= OMAP3430_REV_ES2_0)
 		omap3_clk_lock_dpll5();
 
 	/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index 1a19fa0..8e90356 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -152,38 +152,3 @@ void am35x_set_mode(u8 musb_mode)
 
 	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
 }
-
-void ti81xx_musb_phy_power(u8 on)
-{
-	void __iomem *scm_base = NULL;
-	u32 usbphycfg;
-
-	scm_base = ioremap(TI81XX_SCM_BASE, SZ_2K);
-	if (!scm_base) {
-		pr_err("system control module ioremap failed\n");
-		return;
-	}
-
-	usbphycfg = readl_relaxed(scm_base + USBCTRL0);
-
-	if (on) {
-		if (cpu_is_ti816x()) {
-			usbphycfg |= TI816X_USBPHY0_NORMAL_MODE;
-			usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC;
-		} else if (cpu_is_ti814x()) {
-			usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN
-				| USBPHY_DPINPUT | USBPHY_DMINPUT);
-			usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN
-				| USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL);
-		}
-	} else {
-		if (cpu_is_ti816x())
-			usbphycfg &= ~TI816X_USBPHY0_NORMAL_MODE;
-		else if (cpu_is_ti814x())
-			usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;
-
-	}
-	writel_relaxed(usbphycfg, scm_base + USBCTRL0);
-
-	iounmap(scm_base);
-}
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index bc89723..e4562b2 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -82,16 +82,8 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
 	musb_plat.mode = board_data->mode;
 	musb_plat.extvbus = board_data->extvbus;
 
-	if (soc_is_am35xx()) {
-		oh_name = "am35x_otg_hs";
-		name = "musb-am35x";
-	} else if (cpu_is_ti81xx()) {
-		oh_name = "usb_otg_hs";
-		name = "musb-ti81xx";
-	} else {
-		oh_name = "usb_otg_hs";
-		name = "musb-omap2430";
-	}
+	oh_name = "usb_otg_hs";
+	name = "musb-omap2430";
 
         oh = omap_hwmod_lookup(oh_name);
         if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
diff --git a/arch/arm/mach-omap2/usb.h b/arch/arm/mach-omap2/usb.h
index 4ba2ae7..3395365 100644
--- a/arch/arm/mach-omap2/usb.h
+++ b/arch/arm/mach-omap2/usb.h
@@ -68,5 +68,3 @@ extern void am35x_musb_reset(void);
 extern void am35x_musb_phy_power(u8 on);
 extern void am35x_musb_clear_irq(void);
 extern void am35x_set_mode(u8 musb_mode);
-extern void ti81xx_musb_phy_power(u8 on);
-
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 2/7] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
  2015-01-13 23:13 ` Tony Lindgren
@ 2015-01-13 23:13   ` Tony Lindgren
  -1 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Brian Hutchinson

We need to check if we got the clock before trying to do anything
with it. Otherwise we will get something like this:

Unable to handle kernel paging request at virtual address fffffffe
...
[<c04bef78>] (clk_prepare) from [<c00338a4>] (omap2_clk_enable_init_clocks+0x50/0x8)
[<c00338a4>] (omap2_clk_enable_init_clocks) from [<c0876838>] (dm816x_dt_clk_init+0)
...

Let's add check for the clock and WARN if the init clock was not
found.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/clock.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 6ad5b4d..89a0732 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -620,6 +620,11 @@ void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks)
 
 	for (i = 0; i < num_clocks; i++) {
 		init_clk = clk_get(NULL, clk_names[i]);
+		if (IS_ERR(init_clk)) {
+			WARN(1, "omap clock: could not find init clock %s\n",
+			     clk_names[i]);
+			continue;
+		}
 		clk_prepare_enable(init_clk);
 	}
 }
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 2/7] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
@ 2015-01-13 23:13   ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-arm-kernel

We need to check if we got the clock before trying to do anything
with it. Otherwise we will get something like this:

Unable to handle kernel paging request at virtual address fffffffe
...
[<c04bef78>] (clk_prepare) from [<c00338a4>] (omap2_clk_enable_init_clocks+0x50/0x8)
[<c00338a4>] (omap2_clk_enable_init_clocks) from [<c0876838>] (dm816x_dt_clk_init+0)
...

Let's add check for the clock and WARN if the init clock was not
found.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/clock.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 6ad5b4d..89a0732 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -620,6 +620,11 @@ void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks)
 
 	for (i = 0; i < num_clocks; i++) {
 		init_clk = clk_get(NULL, clk_names[i]);
+		if (IS_ERR(init_clk)) {
+			WARN(1, "omap clock: could not find init clock %s\n",
+			     clk_names[i]);
+			continue;
+		}
 		clk_prepare_enable(init_clk);
 	}
 }
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 3/7] ARM: OMAP2+: Fix ti81xx devtype
  2015-01-13 23:13 ` Tony Lindgren
@ 2015-01-13 23:13   ` Tony Lindgren
  -1 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Brian Hutchinson

Otherwise we get error "Cannot detect omap type!" and many
things can fail with following:

Unhandled fault: imprecise external abort (0xc06) at 0xc6031fb0

This is because the omap_type is being used to set up th SoC
specific functions for omaps.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/control.h | 4 ++++
 arch/arm/mach-omap2/id.c      | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index a3c0133..0fba6d1 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -53,6 +53,7 @@
 #define OMAP343X_CONTROL_GENERAL_WKUP	0xa60
 
 /* TI81XX spefic control submodules */
+#define TI81XX_CONTROL_DEVBOOT		0x040
 #define TI81XX_CONTROL_DEVCONF		0x600
 
 /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
@@ -246,6 +247,9 @@
 #define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
 #define OMAP3_PADCONF_SAD2D_IDLEACK    0x254
 
+/* TI81XX CONTROL_DEVBOOT register offsets */
+#define TI81XX_CONTROL_STATUS		(TI81XX_CONTROL_DEVBOOT + 0x000)
+
 /* TI81XX CONTROL_DEVCONF register offsets */
 #define TI81XX_CONTROL_DEVICE_ID	(TI81XX_CONTROL_DEVCONF + 0x000)
 
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index c25feba..2a2f4d5 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -56,6 +56,8 @@ int omap_type(void)
 
 	if (cpu_is_omap24xx()) {
 		val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
+	} else if (cpu_is_ti81xx()) {
+		val = omap_ctrl_readl(TI81XX_CONTROL_STATUS);
 	} else if (soc_is_am33xx() || soc_is_am43xx()) {
 		val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
 	} else if (cpu_is_omap34xx()) {
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 3/7] ARM: OMAP2+: Fix ti81xx devtype
@ 2015-01-13 23:13   ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-arm-kernel

Otherwise we get error "Cannot detect omap type!" and many
things can fail with following:

Unhandled fault: imprecise external abort (0xc06) at 0xc6031fb0

This is because the omap_type is being used to set up th SoC
specific functions for omaps.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/control.h | 4 ++++
 arch/arm/mach-omap2/id.c      | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index a3c0133..0fba6d1 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -53,6 +53,7 @@
 #define OMAP343X_CONTROL_GENERAL_WKUP	0xa60
 
 /* TI81XX spefic control submodules */
+#define TI81XX_CONTROL_DEVBOOT		0x040
 #define TI81XX_CONTROL_DEVCONF		0x600
 
 /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
@@ -246,6 +247,9 @@
 #define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
 #define OMAP3_PADCONF_SAD2D_IDLEACK    0x254
 
+/* TI81XX CONTROL_DEVBOOT register offsets */
+#define TI81XX_CONTROL_STATUS		(TI81XX_CONTROL_DEVBOOT + 0x000)
+
 /* TI81XX CONTROL_DEVCONF register offsets */
 #define TI81XX_CONTROL_DEVICE_ID	(TI81XX_CONTROL_DEVCONF + 0x000)
 
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index c25feba..2a2f4d5 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -56,6 +56,8 @@ int omap_type(void)
 
 	if (cpu_is_omap24xx()) {
 		val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
+	} else if (cpu_is_ti81xx()) {
+		val = omap_ctrl_readl(TI81XX_CONTROL_STATUS);
 	} else if (soc_is_am33xx() || soc_is_am43xx()) {
 		val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
 	} else if (cpu_is_omap34xx()) {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 4/7] ARM: OMAP2+: Fix ti81xx class type
  2015-01-13 23:13 ` Tony Lindgren
@ 2015-01-13 23:13   ` Tony Lindgren
  -1 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Brian Hutchinson

Otherwise it will return true for cpu_is_omap34xx() which we don't
want for the clocks and hwmod. It's closer to am33xx for the clocks
and hwmod than to the omap34xx. We also want to be able to detect
814x and 816x separately as at least the clocks are different with
814x using a apll and 816x using a fapll for the source clocks.

Note that we can also remove omap3xxx_clk_init() call as it's wrong
and ti81xx are booting in device tree only mode.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/common.h                |  3 ++-
 arch/arm/mach-omap2/io.c                    | 25 +++++++++++++++++++++----
 arch/arm/mach-omap2/powerdomains3xxx_data.c |  2 +-
 arch/arm/mach-omap2/soc.h                   |  4 ++--
 4 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 377eea8..900ebdd 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -110,7 +110,8 @@ void omap3630_init_early(void);
 void omap3_init_early(void);	/* Do not use this one */
 void am33xx_init_early(void);
 void am35xx_init_early(void);
-void ti81xx_init_early(void);
+void ti814x_init_early(void);
+void ti816x_init_early(void);
 void am33xx_init_early(void);
 void am43xx_init_early(void);
 void am43xx_init_late(void);
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index a1bd6af..b957776 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)
 		omap_clk_soc_init = am35xx_dt_clk_init;
 }
 
-void __init ti81xx_init_early(void)
+void __init ti814x_init_early(void)
 {
-	omap2_set_globals_tap(OMAP343X_CLASS,
+	omap2_set_globals_tap(TI814X_CLASS,
+			      OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
+	omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
+				  NULL);
+	omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE));
+	omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
+	omap3xxx_check_revision();
+	ti81xx_check_features();
+	omap3xxx_voltagedomains_init();
+	omap3xxx_powerdomains_init();
+	omap3xxx_clockdomains_init();
+	omap3xxx_hwmod_init();
+	omap_hwmod_init_postsetup();
+	if (of_have_populated_dt())
+		omap_clk_soc_init = ti81xx_dt_clk_init;
+}
+
+void __init ti816x_init_early(void)
+{
+	omap2_set_globals_tap(TI816X_CLASS,
 			      OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
 	omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
 				  NULL);
@@ -509,8 +528,6 @@ void __init ti81xx_init_early(void)
 	omap_hwmod_init_postsetup();
 	if (of_have_populated_dt())
 		omap_clk_soc_init = ti81xx_dt_clk_init;
-	else
-		omap_clk_soc_init = omap3xxx_clk_init;
 }
 
 void __init omap3_init_late(void)
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index 328c103..70bc706 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)
 {
 	unsigned int rev;
 
-	if (!cpu_is_omap34xx())
+	if (!cpu_is_omap34xx() && !cpu_is_ti81xx())
 		return;
 
 	pwrdm_register_platform_funcs(&omap3_pwrdm_operations);
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index c1a3b44..f97654d 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -423,13 +423,13 @@ IS_OMAP_TYPE(3430, 0x3430)
 #define OMAP3630_REV_ES1_1	(OMAP363X_CLASS | (0x1 << 8))
 #define OMAP3630_REV_ES1_2	(OMAP363X_CLASS | (0x2 << 8))
 
-#define TI816X_CLASS		0x81600034
+#define TI816X_CLASS		0x81600081
 #define TI8168_REV_ES1_0	TI816X_CLASS
 #define TI8168_REV_ES1_1	(TI816X_CLASS | (0x1 << 8))
 #define TI8168_REV_ES2_0	(TI816X_CLASS | (0x2 << 8))
 #define TI8168_REV_ES2_1	(TI816X_CLASS | (0x3 << 8))
 
-#define TI814X_CLASS		0x81400034
+#define TI814X_CLASS		0x81400081
 #define TI8148_REV_ES1_0	TI814X_CLASS
 #define TI8148_REV_ES2_0	(TI814X_CLASS | (0x1 << 8))
 #define TI8148_REV_ES2_1	(TI814X_CLASS | (0x2 << 8))
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 4/7] ARM: OMAP2+: Fix ti81xx class type
@ 2015-01-13 23:13   ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-arm-kernel

Otherwise it will return true for cpu_is_omap34xx() which we don't
want for the clocks and hwmod. It's closer to am33xx for the clocks
and hwmod than to the omap34xx. We also want to be able to detect
814x and 816x separately as at least the clocks are different with
814x using a apll and 816x using a fapll for the source clocks.

Note that we can also remove omap3xxx_clk_init() call as it's wrong
and ti81xx are booting in device tree only mode.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/common.h                |  3 ++-
 arch/arm/mach-omap2/io.c                    | 25 +++++++++++++++++++++----
 arch/arm/mach-omap2/powerdomains3xxx_data.c |  2 +-
 arch/arm/mach-omap2/soc.h                   |  4 ++--
 4 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 377eea8..900ebdd 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -110,7 +110,8 @@ void omap3630_init_early(void);
 void omap3_init_early(void);	/* Do not use this one */
 void am33xx_init_early(void);
 void am35xx_init_early(void);
-void ti81xx_init_early(void);
+void ti814x_init_early(void);
+void ti816x_init_early(void);
 void am33xx_init_early(void);
 void am43xx_init_early(void);
 void am43xx_init_late(void);
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index a1bd6af..b957776 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)
 		omap_clk_soc_init = am35xx_dt_clk_init;
 }
 
-void __init ti81xx_init_early(void)
+void __init ti814x_init_early(void)
 {
-	omap2_set_globals_tap(OMAP343X_CLASS,
+	omap2_set_globals_tap(TI814X_CLASS,
+			      OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
+	omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
+				  NULL);
+	omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE));
+	omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
+	omap3xxx_check_revision();
+	ti81xx_check_features();
+	omap3xxx_voltagedomains_init();
+	omap3xxx_powerdomains_init();
+	omap3xxx_clockdomains_init();
+	omap3xxx_hwmod_init();
+	omap_hwmod_init_postsetup();
+	if (of_have_populated_dt())
+		omap_clk_soc_init = ti81xx_dt_clk_init;
+}
+
+void __init ti816x_init_early(void)
+{
+	omap2_set_globals_tap(TI816X_CLASS,
 			      OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
 	omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
 				  NULL);
@@ -509,8 +528,6 @@ void __init ti81xx_init_early(void)
 	omap_hwmod_init_postsetup();
 	if (of_have_populated_dt())
 		omap_clk_soc_init = ti81xx_dt_clk_init;
-	else
-		omap_clk_soc_init = omap3xxx_clk_init;
 }
 
 void __init omap3_init_late(void)
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index 328c103..70bc706 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)
 {
 	unsigned int rev;
 
-	if (!cpu_is_omap34xx())
+	if (!cpu_is_omap34xx() && !cpu_is_ti81xx())
 		return;
 
 	pwrdm_register_platform_funcs(&omap3_pwrdm_operations);
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index c1a3b44..f97654d 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -423,13 +423,13 @@ IS_OMAP_TYPE(3430, 0x3430)
 #define OMAP3630_REV_ES1_1	(OMAP363X_CLASS | (0x1 << 8))
 #define OMAP3630_REV_ES1_2	(OMAP363X_CLASS | (0x2 << 8))
 
-#define TI816X_CLASS		0x81600034
+#define TI816X_CLASS		0x81600081
 #define TI8168_REV_ES1_0	TI816X_CLASS
 #define TI8168_REV_ES1_1	(TI816X_CLASS | (0x1 << 8))
 #define TI8168_REV_ES2_0	(TI816X_CLASS | (0x2 << 8))
 #define TI8168_REV_ES2_1	(TI816X_CLASS | (0x3 << 8))
 
-#define TI814X_CLASS		0x81400034
+#define TI814X_CLASS		0x81400081
 #define TI8148_REV_ES1_0	TI814X_CLASS
 #define TI8148_REV_ES2_0	(TI814X_CLASS | (0x1 << 8))
 #define TI8148_REV_ES2_1	(TI814X_CLASS | (0x2 << 8))
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 5/7] ARM: OMAP2+: Fix dm814 and dm816 for clocks and timer init
  2015-01-13 23:13 ` Tony Lindgren
@ 2015-01-13 23:13   ` Tony Lindgren
  -1 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Brian Hutchinson, Paul Walmsley, Tero Kristo

Fix dm814 and dm816 clocks and timer init.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/prm_common.c | 4 ++++
 arch/arm/mach-omap2/timer.c      | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 779940c..b658785 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[] = {
 	{ .compatible = "ti,am3-scrm" },
 	{ .compatible = "ti,am4-prcm" },
 	{ .compatible = "ti,am4-scrm" },
+	{ .compatible = "ti,dm814-prcm" },
+	{ .compatible = "ti,dm814-scrm" },
+	{ .compatible = "ti,dm816-prcm" },
+	{ .compatible = "ti,dm816-scrm" },
 	{ .compatible = "ti,omap2-prcm" },
 	{ .compatible = "ti,omap2-scrm" },
 	{ .compatible = "ti,omap3-prm" },
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 4f61148..376b099 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 = {
 	{ .compatible = "ti,omap3430-timer", },
 	{ .compatible = "ti,omap4430-timer", },
 	{ .compatible = "ti,omap5430-timer", },
+	{ .compatible = "ti,dm814-timer", },
+	{ .compatible = "ti,dm816-timer", },
 	{ .compatible = "ti,am335x-timer", },
 	{ .compatible = "ti,am335x-timer-1ms", },
 	{ }
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 5/7] ARM: OMAP2+: Fix dm814 and dm816 for clocks and timer init
@ 2015-01-13 23:13   ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-arm-kernel

Fix dm814 and dm816 clocks and timer init.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/prm_common.c | 4 ++++
 arch/arm/mach-omap2/timer.c      | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 779940c..b658785 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[] = {
 	{ .compatible = "ti,am3-scrm" },
 	{ .compatible = "ti,am4-prcm" },
 	{ .compatible = "ti,am4-scrm" },
+	{ .compatible = "ti,dm814-prcm" },
+	{ .compatible = "ti,dm814-scrm" },
+	{ .compatible = "ti,dm816-prcm" },
+	{ .compatible = "ti,dm816-scrm" },
 	{ .compatible = "ti,omap2-prcm" },
 	{ .compatible = "ti,omap2-scrm" },
 	{ .compatible = "ti,omap3-prm" },
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 4f61148..376b099 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 = {
 	{ .compatible = "ti,omap3430-timer", },
 	{ .compatible = "ti,omap4430-timer", },
 	{ .compatible = "ti,omap5430-timer", },
+	{ .compatible = "ti,dm814-timer", },
+	{ .compatible = "ti,dm816-timer", },
 	{ .compatible = "ti,am335x-timer", },
 	{ .compatible = "ti,am335x-timer-1ms", },
 	{ }
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx
  2015-01-13 23:13 ` Tony Lindgren
@ 2015-01-13 23:13   ` Tony Lindgren
  -1 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Brian Hutchinson

We are missing proper hooks for 81xx for reboot to work.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Makefile         |  1 +
 arch/arm/mach-omap2/common.h         |  8 ++++++++
 arch/arm/mach-omap2/ti81xx-restart.c | 31 +++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+)
 create mode 100644 arch/arm/mach-omap2/ti81xx-restart.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 5d27dfd..3a6463f 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -58,6 +58,7 @@ AFLAGS_sram34xx.o			:=-Wa,-march=armv7-a
 # Restart code (OMAP4/5 currently in omap4-common.c)
 obj-$(CONFIG_SOC_OMAP2420)		+= omap2-restart.o
 obj-$(CONFIG_SOC_OMAP2430)		+= omap2-restart.o
+obj-$(CONFIG_SOC_TI81XX)		+= ti81xx-restart.o
 obj-$(CONFIG_SOC_AM33XX)		+= am33xx-restart.o
 obj-$(CONFIG_SOC_AM43XX)		+= omap4-restart.o
 obj-$(CONFIG_ARCH_OMAP3)		+= omap3-restart.o
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 900ebdd..65b4371 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -164,6 +164,14 @@ static inline void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
 }
 #endif
 
+#ifdef CONFIG_SOC_TI81XX
+void ti81xx_restart(enum reboot_mode mode, const char *cmd);
+#else
+static inline void ti81xx_restart(enum reboot_mode mode, const char *cmd)
+{
+}
+#endif
+
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
 	defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
 void omap44xx_restart(enum reboot_mode mode, const char *cmd);
diff --git a/arch/arm/mach-omap2/ti81xx-restart.c b/arch/arm/mach-omap2/ti81xx-restart.c
new file mode 100644
index 0000000..68b29be
--- /dev/null
+++ b/arch/arm/mach-omap2/ti81xx-restart.c
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/reboot.h>
+
+#include "iomap.h"
+#include "common.h"
+#include "control.h"
+#include "prm3xxx.h"
+
+#define TI81XX_PRM_DEVICE_RSTCTRL	0x00a0
+#define TI81XX_GLOBAL_RST_COLD		BIT(1)
+
+/**
+ * ti81xx_restart - trigger a software restart of the SoC
+ * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
+ * @cmd: passed from the userspace program rebooting the system (if provided)
+ *
+ * Resets the SoC.  For @cmd, see the 'reboot' syscall in
+ * kernel/sys.c.  No return value.
+ */
+void ti81xx_restart(enum reboot_mode mode, const char *cmd)
+{
+	omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
+				   TI81XX_PRM_DEVICE_RSTCTRL);
+	while (1);
+}
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx
@ 2015-01-13 23:13   ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-arm-kernel

We are missing proper hooks for 81xx for reboot to work.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Makefile         |  1 +
 arch/arm/mach-omap2/common.h         |  8 ++++++++
 arch/arm/mach-omap2/ti81xx-restart.c | 31 +++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+)
 create mode 100644 arch/arm/mach-omap2/ti81xx-restart.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 5d27dfd..3a6463f 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -58,6 +58,7 @@ AFLAGS_sram34xx.o			:=-Wa,-march=armv7-a
 # Restart code (OMAP4/5 currently in omap4-common.c)
 obj-$(CONFIG_SOC_OMAP2420)		+= omap2-restart.o
 obj-$(CONFIG_SOC_OMAP2430)		+= omap2-restart.o
+obj-$(CONFIG_SOC_TI81XX)		+= ti81xx-restart.o
 obj-$(CONFIG_SOC_AM33XX)		+= am33xx-restart.o
 obj-$(CONFIG_SOC_AM43XX)		+= omap4-restart.o
 obj-$(CONFIG_ARCH_OMAP3)		+= omap3-restart.o
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 900ebdd..65b4371 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -164,6 +164,14 @@ static inline void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
 }
 #endif
 
+#ifdef CONFIG_SOC_TI81XX
+void ti81xx_restart(enum reboot_mode mode, const char *cmd);
+#else
+static inline void ti81xx_restart(enum reboot_mode mode, const char *cmd)
+{
+}
+#endif
+
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
 	defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
 void omap44xx_restart(enum reboot_mode mode, const char *cmd);
diff --git a/arch/arm/mach-omap2/ti81xx-restart.c b/arch/arm/mach-omap2/ti81xx-restart.c
new file mode 100644
index 0000000..68b29be
--- /dev/null
+++ b/arch/arm/mach-omap2/ti81xx-restart.c
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/reboot.h>
+
+#include "iomap.h"
+#include "common.h"
+#include "control.h"
+#include "prm3xxx.h"
+
+#define TI81XX_PRM_DEVICE_RSTCTRL	0x00a0
+#define TI81XX_GLOBAL_RST_COLD		BIT(1)
+
+/**
+ * ti81xx_restart - trigger a software restart of the SoC
+ * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
+ * @cmd: passed from the userspace program rebooting the system (if provided)
+ *
+ * Resets the SoC.  For @cmd, see the 'reboot' syscall in
+ * kernel/sys.c.  No return value.
+ */
+void ti81xx_restart(enum reboot_mode mode, const char *cmd)
+{
+	omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
+				   TI81XX_PRM_DEVICE_RSTCTRL);
+	while (1);
+}
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 7/7] ARM: OMAP2+: Disable omap3 PM init for ti81xx
  2015-01-13 23:13 ` Tony Lindgren
@ 2015-01-13 23:13   ` Tony Lindgren
  -1 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Brian Hutchinson

We cannot use the omap3 pm support on 81xx.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/io.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index b957776..e4a5630 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -568,7 +568,6 @@ void __init am35xx_init_late(void)
 void __init ti81xx_init_late(void)
 {
 	omap_common_late_init();
-	omap3_pm_init();
 	omap2_clk_enable_autoidle_all();
 }
 #endif
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 33+ messages in thread

* [PATCH 7/7] ARM: OMAP2+: Disable omap3 PM init for ti81xx
@ 2015-01-13 23:13   ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-13 23:13 UTC (permalink / raw)
  To: linux-arm-kernel

We cannot use the omap3 pm support on 81xx.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/io.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index b957776..e4a5630 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -568,7 +568,6 @@ void __init am35xx_init_late(void)
 void __init ti81xx_init_late(void)
 {
 	omap_common_late_init();
-	omap3_pm_init();
 	omap2_clk_enable_autoidle_all();
 }
 #endif
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 33+ messages in thread

* Re: [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code
  2015-01-13 23:13   ` Tony Lindgren
@ 2015-01-14  1:19     ` Felipe Balbi
  -1 siblings, 0 replies; 33+ messages in thread
From: Felipe Balbi @ 2015-01-14  1:19 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, linux-arm-kernel, Brian Hutchinson

[-- Attachment #1: Type: text/plain, Size: 4775 bytes --]

On Tue, Jan 13, 2015 at 03:13:51PM -0800, Tony Lindgren wrote:
> The support for 81xx was never working in mainline, and it
> will be only supported in device tree mode. Let's remove all
> the remaining 81xx related platform code.

you should probably also mention here that you're dropping unnecessary
non-DT AM33xx support since that has never booted on legacy mode.

Other than that

Reviewed-by: Felipe Balbi <balbi@ti.com>


> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/cclock3xxx_data.c   |  6 +-----
>  arch/arm/mach-omap2/omap_phy_internal.c | 35 ---------------------------------
>  arch/arm/mach-omap2/usb-musb.c          | 12 ++---------
>  arch/arm/mach-omap2/usb.h               |  2 --
>  4 files changed, 3 insertions(+), 52 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
> index 644ff32..e79c80b 100644
> --- a/arch/arm/mach-omap2/cclock3xxx_data.c
> +++ b/arch/arm/mach-omap2/cclock3xxx_data.c
> @@ -3634,10 +3634,6 @@ int __init omap3xxx_clk_init(void)
>  		omap_clocks_register(omap36xx_am35xx_omap3430es2plus_clks,
>  				     ARRAY_SIZE(omap36xx_am35xx_omap3430es2plus_clks));
>  		omap_clocks_register(omap3xxx_clks, ARRAY_SIZE(omap3xxx_clks));
> -	} else if (soc_is_am33xx()) {
> -		cpu_mask = RATE_IN_AM33XX;
> -	} else if (cpu_is_ti814x()) {
> -		cpu_mask = RATE_IN_TI814X;
>  	} else if (cpu_is_omap34xx()) {
>  		if (omap_rev() == OMAP3430_REV_ES1_0) {
>  			cpu_mask = RATE_IN_3430ES1;
> @@ -3681,7 +3677,7 @@ int __init omap3xxx_clk_init(void)
>  	 * Lock DPLL5 -- here only until other device init code can
>  	 * handle this
>  	 */
> -	if (!cpu_is_ti81xx() && (omap_rev() >= OMAP3430_REV_ES2_0))
> +	if (omap_rev() >= OMAP3430_REV_ES2_0)
>  		omap3_clk_lock_dpll5();
>  
>  	/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
> diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
> index 1a19fa0..8e90356 100644
> --- a/arch/arm/mach-omap2/omap_phy_internal.c
> +++ b/arch/arm/mach-omap2/omap_phy_internal.c
> @@ -152,38 +152,3 @@ void am35x_set_mode(u8 musb_mode)
>  
>  	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
>  }
> -
> -void ti81xx_musb_phy_power(u8 on)
> -{
> -	void __iomem *scm_base = NULL;
> -	u32 usbphycfg;
> -
> -	scm_base = ioremap(TI81XX_SCM_BASE, SZ_2K);
> -	if (!scm_base) {
> -		pr_err("system control module ioremap failed\n");
> -		return;
> -	}
> -
> -	usbphycfg = readl_relaxed(scm_base + USBCTRL0);
> -
> -	if (on) {
> -		if (cpu_is_ti816x()) {
> -			usbphycfg |= TI816X_USBPHY0_NORMAL_MODE;
> -			usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC;
> -		} else if (cpu_is_ti814x()) {
> -			usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN
> -				| USBPHY_DPINPUT | USBPHY_DMINPUT);
> -			usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN
> -				| USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL);
> -		}
> -	} else {
> -		if (cpu_is_ti816x())
> -			usbphycfg &= ~TI816X_USBPHY0_NORMAL_MODE;
> -		else if (cpu_is_ti814x())
> -			usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;
> -
> -	}
> -	writel_relaxed(usbphycfg, scm_base + USBCTRL0);
> -
> -	iounmap(scm_base);
> -}
> diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
> index bc89723..e4562b2 100644
> --- a/arch/arm/mach-omap2/usb-musb.c
> +++ b/arch/arm/mach-omap2/usb-musb.c
> @@ -82,16 +82,8 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
>  	musb_plat.mode = board_data->mode;
>  	musb_plat.extvbus = board_data->extvbus;
>  
> -	if (soc_is_am35xx()) {
> -		oh_name = "am35x_otg_hs";
> -		name = "musb-am35x";
> -	} else if (cpu_is_ti81xx()) {
> -		oh_name = "usb_otg_hs";
> -		name = "musb-ti81xx";
> -	} else {
> -		oh_name = "usb_otg_hs";
> -		name = "musb-omap2430";
> -	}
> +	oh_name = "usb_otg_hs";
> +	name = "musb-omap2430";
>  
>          oh = omap_hwmod_lookup(oh_name);
>          if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
> diff --git a/arch/arm/mach-omap2/usb.h b/arch/arm/mach-omap2/usb.h
> index 4ba2ae7..3395365 100644
> --- a/arch/arm/mach-omap2/usb.h
> +++ b/arch/arm/mach-omap2/usb.h
> @@ -68,5 +68,3 @@ extern void am35x_musb_reset(void);
>  extern void am35x_musb_phy_power(u8 on);
>  extern void am35x_musb_clear_irq(void);
>  extern void am35x_set_mode(u8 musb_mode);
> -extern void ti81xx_musb_phy_power(u8 on);
> -
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code
@ 2015-01-14  1:19     ` Felipe Balbi
  0 siblings, 0 replies; 33+ messages in thread
From: Felipe Balbi @ 2015-01-14  1:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 13, 2015 at 03:13:51PM -0800, Tony Lindgren wrote:
> The support for 81xx was never working in mainline, and it
> will be only supported in device tree mode. Let's remove all
> the remaining 81xx related platform code.

you should probably also mention here that you're dropping unnecessary
non-DT AM33xx support since that has never booted on legacy mode.

Other than that

Reviewed-by: Felipe Balbi <balbi@ti.com>


> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/cclock3xxx_data.c   |  6 +-----
>  arch/arm/mach-omap2/omap_phy_internal.c | 35 ---------------------------------
>  arch/arm/mach-omap2/usb-musb.c          | 12 ++---------
>  arch/arm/mach-omap2/usb.h               |  2 --
>  4 files changed, 3 insertions(+), 52 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
> index 644ff32..e79c80b 100644
> --- a/arch/arm/mach-omap2/cclock3xxx_data.c
> +++ b/arch/arm/mach-omap2/cclock3xxx_data.c
> @@ -3634,10 +3634,6 @@ int __init omap3xxx_clk_init(void)
>  		omap_clocks_register(omap36xx_am35xx_omap3430es2plus_clks,
>  				     ARRAY_SIZE(omap36xx_am35xx_omap3430es2plus_clks));
>  		omap_clocks_register(omap3xxx_clks, ARRAY_SIZE(omap3xxx_clks));
> -	} else if (soc_is_am33xx()) {
> -		cpu_mask = RATE_IN_AM33XX;
> -	} else if (cpu_is_ti814x()) {
> -		cpu_mask = RATE_IN_TI814X;
>  	} else if (cpu_is_omap34xx()) {
>  		if (omap_rev() == OMAP3430_REV_ES1_0) {
>  			cpu_mask = RATE_IN_3430ES1;
> @@ -3681,7 +3677,7 @@ int __init omap3xxx_clk_init(void)
>  	 * Lock DPLL5 -- here only until other device init code can
>  	 * handle this
>  	 */
> -	if (!cpu_is_ti81xx() && (omap_rev() >= OMAP3430_REV_ES2_0))
> +	if (omap_rev() >= OMAP3430_REV_ES2_0)
>  		omap3_clk_lock_dpll5();
>  
>  	/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
> diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
> index 1a19fa0..8e90356 100644
> --- a/arch/arm/mach-omap2/omap_phy_internal.c
> +++ b/arch/arm/mach-omap2/omap_phy_internal.c
> @@ -152,38 +152,3 @@ void am35x_set_mode(u8 musb_mode)
>  
>  	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
>  }
> -
> -void ti81xx_musb_phy_power(u8 on)
> -{
> -	void __iomem *scm_base = NULL;
> -	u32 usbphycfg;
> -
> -	scm_base = ioremap(TI81XX_SCM_BASE, SZ_2K);
> -	if (!scm_base) {
> -		pr_err("system control module ioremap failed\n");
> -		return;
> -	}
> -
> -	usbphycfg = readl_relaxed(scm_base + USBCTRL0);
> -
> -	if (on) {
> -		if (cpu_is_ti816x()) {
> -			usbphycfg |= TI816X_USBPHY0_NORMAL_MODE;
> -			usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC;
> -		} else if (cpu_is_ti814x()) {
> -			usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN
> -				| USBPHY_DPINPUT | USBPHY_DMINPUT);
> -			usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN
> -				| USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL);
> -		}
> -	} else {
> -		if (cpu_is_ti816x())
> -			usbphycfg &= ~TI816X_USBPHY0_NORMAL_MODE;
> -		else if (cpu_is_ti814x())
> -			usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;
> -
> -	}
> -	writel_relaxed(usbphycfg, scm_base + USBCTRL0);
> -
> -	iounmap(scm_base);
> -}
> diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
> index bc89723..e4562b2 100644
> --- a/arch/arm/mach-omap2/usb-musb.c
> +++ b/arch/arm/mach-omap2/usb-musb.c
> @@ -82,16 +82,8 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
>  	musb_plat.mode = board_data->mode;
>  	musb_plat.extvbus = board_data->extvbus;
>  
> -	if (soc_is_am35xx()) {
> -		oh_name = "am35x_otg_hs";
> -		name = "musb-am35x";
> -	} else if (cpu_is_ti81xx()) {
> -		oh_name = "usb_otg_hs";
> -		name = "musb-ti81xx";
> -	} else {
> -		oh_name = "usb_otg_hs";
> -		name = "musb-omap2430";
> -	}
> +	oh_name = "usb_otg_hs";
> +	name = "musb-omap2430";
>  
>          oh = omap_hwmod_lookup(oh_name);
>          if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
> diff --git a/arch/arm/mach-omap2/usb.h b/arch/arm/mach-omap2/usb.h
> index 4ba2ae7..3395365 100644
> --- a/arch/arm/mach-omap2/usb.h
> +++ b/arch/arm/mach-omap2/usb.h
> @@ -68,5 +68,3 @@ extern void am35x_musb_reset(void);
>  extern void am35x_musb_phy_power(u8 on);
>  extern void am35x_musb_clear_irq(void);
>  extern void am35x_set_mode(u8 musb_mode);
> -extern void ti81xx_musb_phy_power(u8 on);
> -
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150113/95f98eb0/attachment.sig>

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 2/7] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
  2015-01-13 23:13   ` Tony Lindgren
@ 2015-01-14  1:21     ` Felipe Balbi
  -1 siblings, 0 replies; 33+ messages in thread
From: Felipe Balbi @ 2015-01-14  1:21 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, linux-arm-kernel, Brian Hutchinson

[-- Attachment #1: Type: text/plain, Size: 1849 bytes --]

On Tue, Jan 13, 2015 at 03:13:52PM -0800, Tony Lindgren wrote:
> We need to check if we got the clock before trying to do anything
> with it. Otherwise we will get something like this:
> 
> Unable to handle kernel paging request at virtual address fffffffe
> ...
> [<c04bef78>] (clk_prepare) from [<c00338a4>] (omap2_clk_enable_init_clocks+0x50/0x8)
> [<c00338a4>] (omap2_clk_enable_init_clocks) from [<c0876838>] (dm816x_dt_clk_init+0)
> ...
> 
> Let's add check for the clock and WARN if the init clock was not
> found.
> 
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Just one minor nit below, other than that:

Reviewed-by: Felipe Balbi <balbi@ti.com>

> ---
>  arch/arm/mach-omap2/clock.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
> index 6ad5b4d..89a0732 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -620,6 +620,11 @@ void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks)
>  
>  	for (i = 0; i < num_clocks; i++) {
>  		init_clk = clk_get(NULL, clk_names[i]);
> +		if (IS_ERR(init_clk)) {
> +			WARN(1, "omap clock: could not find init clock %s\n",
> +			     clk_names[i]);

you can combine the if with the WARN():

		if (WARN(IS_ERR(init_clk), "could not find init clock %s\n",
			clk_names[i]))

not that I also removed that "omap clock" prefix because WARN() will
print the file name anyway.

> +			continue;
> +		}
>  		clk_prepare_enable(init_clk);
>  	}
>  }
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 2/7] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
@ 2015-01-14  1:21     ` Felipe Balbi
  0 siblings, 0 replies; 33+ messages in thread
From: Felipe Balbi @ 2015-01-14  1:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 13, 2015 at 03:13:52PM -0800, Tony Lindgren wrote:
> We need to check if we got the clock before trying to do anything
> with it. Otherwise we will get something like this:
> 
> Unable to handle kernel paging request at virtual address fffffffe
> ...
> [<c04bef78>] (clk_prepare) from [<c00338a4>] (omap2_clk_enable_init_clocks+0x50/0x8)
> [<c00338a4>] (omap2_clk_enable_init_clocks) from [<c0876838>] (dm816x_dt_clk_init+0)
> ...
> 
> Let's add check for the clock and WARN if the init clock was not
> found.
> 
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Just one minor nit below, other than that:

Reviewed-by: Felipe Balbi <balbi@ti.com>

> ---
>  arch/arm/mach-omap2/clock.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
> index 6ad5b4d..89a0732 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -620,6 +620,11 @@ void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks)
>  
>  	for (i = 0; i < num_clocks; i++) {
>  		init_clk = clk_get(NULL, clk_names[i]);
> +		if (IS_ERR(init_clk)) {
> +			WARN(1, "omap clock: could not find init clock %s\n",
> +			     clk_names[i]);

you can combine the if with the WARN():

		if (WARN(IS_ERR(init_clk), "could not find init clock %s\n",
			clk_names[i]))

not that I also removed that "omap clock" prefix because WARN() will
print the file name anyway.

> +			continue;
> +		}
>  		clk_prepare_enable(init_clk);
>  	}
>  }
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150113/f31d214b/attachment.sig>

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx
  2015-01-13 23:13   ` Tony Lindgren
@ 2015-01-14  1:24     ` Felipe Balbi
  -1 siblings, 0 replies; 33+ messages in thread
From: Felipe Balbi @ 2015-01-14  1:24 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, linux-arm-kernel, Brian Hutchinson

[-- Attachment #1: Type: text/plain, Size: 3139 bytes --]

On Tue, Jan 13, 2015 at 03:13:56PM -0800, Tony Lindgren wrote:
> We are missing proper hooks for 81xx for reboot to work.
> 
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/Makefile         |  1 +
>  arch/arm/mach-omap2/common.h         |  8 ++++++++
>  arch/arm/mach-omap2/ti81xx-restart.c | 31 +++++++++++++++++++++++++++++++
>  3 files changed, 40 insertions(+)
>  create mode 100644 arch/arm/mach-omap2/ti81xx-restart.c
> 
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 5d27dfd..3a6463f 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -58,6 +58,7 @@ AFLAGS_sram34xx.o			:=-Wa,-march=armv7-a
>  # Restart code (OMAP4/5 currently in omap4-common.c)
>  obj-$(CONFIG_SOC_OMAP2420)		+= omap2-restart.o
>  obj-$(CONFIG_SOC_OMAP2430)		+= omap2-restart.o
> +obj-$(CONFIG_SOC_TI81XX)		+= ti81xx-restart.o
>  obj-$(CONFIG_SOC_AM33XX)		+= am33xx-restart.o
>  obj-$(CONFIG_SOC_AM43XX)		+= omap4-restart.o
>  obj-$(CONFIG_ARCH_OMAP3)		+= omap3-restart.o
> diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
> index 900ebdd..65b4371 100644
> --- a/arch/arm/mach-omap2/common.h
> +++ b/arch/arm/mach-omap2/common.h
> @@ -164,6 +164,14 @@ static inline void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
>  }
>  #endif
>  
> +#ifdef CONFIG_SOC_TI81XX
> +void ti81xx_restart(enum reboot_mode mode, const char *cmd);
> +#else
> +static inline void ti81xx_restart(enum reboot_mode mode, const char *cmd)
> +{
> +}
> +#endif
> +
>  #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
>  	defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
>  void omap44xx_restart(enum reboot_mode mode, const char *cmd);
> diff --git a/arch/arm/mach-omap2/ti81xx-restart.c b/arch/arm/mach-omap2/ti81xx-restart.c
> new file mode 100644
> index 0000000..68b29be
> --- /dev/null
> +++ b/arch/arm/mach-omap2/ti81xx-restart.c
> @@ -0,0 +1,31 @@
> +/*
> + * 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.
> + */
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/reboot.h>
> +
> +#include "iomap.h"
> +#include "common.h"
> +#include "control.h"
> +#include "prm3xxx.h"
> +
> +#define TI81XX_PRM_DEVICE_RSTCTRL	0x00a0
> +#define TI81XX_GLOBAL_RST_COLD		BIT(1)
> +
> +/**
> + * ti81xx_restart - trigger a software restart of the SoC
> + * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
> + * @cmd: passed from the userspace program rebooting the system (if provided)
> + *
> + * Resets the SoC.  For @cmd, see the 'reboot' syscall in
> + * kernel/sys.c.  No return value.
> + */
> +void ti81xx_restart(enum reboot_mode mode, const char *cmd)
> +{
> +	omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
> +				   TI81XX_PRM_DEVICE_RSTCTRL);

do you need to check that mode == REBOOT_COLD here ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx
@ 2015-01-14  1:24     ` Felipe Balbi
  0 siblings, 0 replies; 33+ messages in thread
From: Felipe Balbi @ 2015-01-14  1:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 13, 2015 at 03:13:56PM -0800, Tony Lindgren wrote:
> We are missing proper hooks for 81xx for reboot to work.
> 
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/Makefile         |  1 +
>  arch/arm/mach-omap2/common.h         |  8 ++++++++
>  arch/arm/mach-omap2/ti81xx-restart.c | 31 +++++++++++++++++++++++++++++++
>  3 files changed, 40 insertions(+)
>  create mode 100644 arch/arm/mach-omap2/ti81xx-restart.c
> 
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 5d27dfd..3a6463f 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -58,6 +58,7 @@ AFLAGS_sram34xx.o			:=-Wa,-march=armv7-a
>  # Restart code (OMAP4/5 currently in omap4-common.c)
>  obj-$(CONFIG_SOC_OMAP2420)		+= omap2-restart.o
>  obj-$(CONFIG_SOC_OMAP2430)		+= omap2-restart.o
> +obj-$(CONFIG_SOC_TI81XX)		+= ti81xx-restart.o
>  obj-$(CONFIG_SOC_AM33XX)		+= am33xx-restart.o
>  obj-$(CONFIG_SOC_AM43XX)		+= omap4-restart.o
>  obj-$(CONFIG_ARCH_OMAP3)		+= omap3-restart.o
> diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
> index 900ebdd..65b4371 100644
> --- a/arch/arm/mach-omap2/common.h
> +++ b/arch/arm/mach-omap2/common.h
> @@ -164,6 +164,14 @@ static inline void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
>  }
>  #endif
>  
> +#ifdef CONFIG_SOC_TI81XX
> +void ti81xx_restart(enum reboot_mode mode, const char *cmd);
> +#else
> +static inline void ti81xx_restart(enum reboot_mode mode, const char *cmd)
> +{
> +}
> +#endif
> +
>  #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
>  	defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
>  void omap44xx_restart(enum reboot_mode mode, const char *cmd);
> diff --git a/arch/arm/mach-omap2/ti81xx-restart.c b/arch/arm/mach-omap2/ti81xx-restart.c
> new file mode 100644
> index 0000000..68b29be
> --- /dev/null
> +++ b/arch/arm/mach-omap2/ti81xx-restart.c
> @@ -0,0 +1,31 @@
> +/*
> + * 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.
> + */
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/reboot.h>
> +
> +#include "iomap.h"
> +#include "common.h"
> +#include "control.h"
> +#include "prm3xxx.h"
> +
> +#define TI81XX_PRM_DEVICE_RSTCTRL	0x00a0
> +#define TI81XX_GLOBAL_RST_COLD		BIT(1)
> +
> +/**
> + * ti81xx_restart - trigger a software restart of the SoC
> + * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
> + * @cmd: passed from the userspace program rebooting the system (if provided)
> + *
> + * Resets the SoC.  For @cmd, see the 'reboot' syscall in
> + * kernel/sys.c.  No return value.
> + */
> +void ti81xx_restart(enum reboot_mode mode, const char *cmd)
> +{
> +	omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
> +				   TI81XX_PRM_DEVICE_RSTCTRL);

do you need to check that mode == REBOOT_COLD here ?

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150113/5a6e3206/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code
  2015-01-14  1:19     ` Felipe Balbi
@ 2015-01-14 17:19       ` Tony Lindgren
  -1 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-14 17:19 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-omap, linux-arm-kernel, Brian Hutchinson

* Felipe Balbi <balbi@ti.com> [150113 17:23]:
> On Tue, Jan 13, 2015 at 03:13:51PM -0800, Tony Lindgren wrote:
> > The support for 81xx was never working in mainline, and it
> > will be only supported in device tree mode. Let's remove all
> > the remaining 81xx related platform code.
> 
> you should probably also mention here that you're dropping unnecessary
> non-DT AM33xx support since that has never booted on legacy mode.
> 
> Other than that
> 
> Reviewed-by: Felipe Balbi <balbi@ti.com>

Thanks, the 81xx legacy booting support already got removed, these
are just left overs I noticed.

I've updated the description with the following:

The support for 81xx was never working in mainline, and the
broken legacy booting support has been removed. There are
patches coming to make 81xx boot with device tree, and for
that we won't need any of this legacy platform code, so let's
just remove it.

Regards,

Tony 

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code
@ 2015-01-14 17:19       ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-14 17:19 UTC (permalink / raw)
  To: linux-arm-kernel

* Felipe Balbi <balbi@ti.com> [150113 17:23]:
> On Tue, Jan 13, 2015 at 03:13:51PM -0800, Tony Lindgren wrote:
> > The support for 81xx was never working in mainline, and it
> > will be only supported in device tree mode. Let's remove all
> > the remaining 81xx related platform code.
> 
> you should probably also mention here that you're dropping unnecessary
> non-DT AM33xx support since that has never booted on legacy mode.
> 
> Other than that
> 
> Reviewed-by: Felipe Balbi <balbi@ti.com>

Thanks, the 81xx legacy booting support already got removed, these
are just left overs I noticed.

I've updated the description with the following:

The support for 81xx was never working in mainline, and the
broken legacy booting support has been removed. There are
patches coming to make 81xx boot with device tree, and for
that we won't need any of this legacy platform code, so let's
just remove it.

Regards,

Tony 

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 2/7] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
  2015-01-14  1:21     ` Felipe Balbi
@ 2015-01-14 17:27       ` Tony Lindgren
  -1 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-14 17:27 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-omap, linux-arm-kernel, Brian Hutchinson

* Felipe Balbi <balbi@ti.com> [150113 17:25]:
> On Tue, Jan 13, 2015 at 03:13:52PM -0800, Tony Lindgren wrote:
> > We need to check if we got the clock before trying to do anything
> > with it. Otherwise we will get something like this:
> > 
> > Unable to handle kernel paging request at virtual address fffffffe
> > ...
> > [<c04bef78>] (clk_prepare) from [<c00338a4>] (omap2_clk_enable_init_clocks+0x50/0x8)
> > [<c00338a4>] (omap2_clk_enable_init_clocks) from [<c0876838>] (dm816x_dt_clk_init+0)
> > ...
> > 
> > Let's add check for the clock and WARN if the init clock was not
> > found.
> > 
> > Cc: Brian Hutchinson <b.hutchman@gmail.com>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> 
> Just one minor nit below, other than that:
> 
> Reviewed-by: Felipe Balbi <balbi@ti.com>
> 
> > ---
> >  arch/arm/mach-omap2/clock.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
> > index 6ad5b4d..89a0732 100644
> > --- a/arch/arm/mach-omap2/clock.c
> > +++ b/arch/arm/mach-omap2/clock.c
> > @@ -620,6 +620,11 @@ void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks)
> >  
> >  	for (i = 0; i < num_clocks; i++) {
> >  		init_clk = clk_get(NULL, clk_names[i]);
> > +		if (IS_ERR(init_clk)) {
> > +			WARN(1, "omap clock: could not find init clock %s\n",
> > +			     clk_names[i]);
> 
> you can combine the if with the WARN():
> 
> 		if (WARN(IS_ERR(init_clk), "could not find init clock %s\n",
> 			clk_names[i]))
> 
> not that I also removed that "omap clock" prefix because WARN() will
> print the file name anyway.
> 
> > +			continue;
> > +		}
> >  		clk_prepare_enable(init_clk);
> >  	}
> >  }

Sure makes sense to me. Updated patch below.

Regards,

Tony

8< -------------
From: Tony Lindgren <tony@atomide.com>
Date: Mon, 22 Dec 2014 08:19:07 -0800
Subject: [PATCH] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks

We need to check if we got the clock before trying to do anything
with it. Otherwise we will get something like this:

Unable to handle kernel paging request at virtual address fffffffe
...
[<c04bef78>] (clk_prepare) from [<c00338a4>] (omap2_clk_enable_init_clocks+0x50/0x8)
[<c00338a4>] (omap2_clk_enable_init_clocks) from [<c0876838>] (dm816x_dt_clk_init+0)
...

Let's add check for the clock and WARN if the init clock was not
found.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <t-kristo@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

--- 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)
 
 	for (i = 0; i < num_clocks; i++) {
 		init_clk = clk_get(NULL, clk_names[i]);
+		if (WARN(IS_ERR(init_clk), "could not find init clock %s\n",
+				clk_names[i]))
+			continue;
 		clk_prepare_enable(init_clk);
 	}
 }

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 2/7] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
@ 2015-01-14 17:27       ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-14 17:27 UTC (permalink / raw)
  To: linux-arm-kernel

* Felipe Balbi <balbi@ti.com> [150113 17:25]:
> On Tue, Jan 13, 2015 at 03:13:52PM -0800, Tony Lindgren wrote:
> > We need to check if we got the clock before trying to do anything
> > with it. Otherwise we will get something like this:
> > 
> > Unable to handle kernel paging request at virtual address fffffffe
> > ...
> > [<c04bef78>] (clk_prepare) from [<c00338a4>] (omap2_clk_enable_init_clocks+0x50/0x8)
> > [<c00338a4>] (omap2_clk_enable_init_clocks) from [<c0876838>] (dm816x_dt_clk_init+0)
> > ...
> > 
> > Let's add check for the clock and WARN if the init clock was not
> > found.
> > 
> > Cc: Brian Hutchinson <b.hutchman@gmail.com>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> 
> Just one minor nit below, other than that:
> 
> Reviewed-by: Felipe Balbi <balbi@ti.com>
> 
> > ---
> >  arch/arm/mach-omap2/clock.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
> > index 6ad5b4d..89a0732 100644
> > --- a/arch/arm/mach-omap2/clock.c
> > +++ b/arch/arm/mach-omap2/clock.c
> > @@ -620,6 +620,11 @@ void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks)
> >  
> >  	for (i = 0; i < num_clocks; i++) {
> >  		init_clk = clk_get(NULL, clk_names[i]);
> > +		if (IS_ERR(init_clk)) {
> > +			WARN(1, "omap clock: could not find init clock %s\n",
> > +			     clk_names[i]);
> 
> you can combine the if with the WARN():
> 
> 		if (WARN(IS_ERR(init_clk), "could not find init clock %s\n",
> 			clk_names[i]))
> 
> not that I also removed that "omap clock" prefix because WARN() will
> print the file name anyway.
> 
> > +			continue;
> > +		}
> >  		clk_prepare_enable(init_clk);
> >  	}
> >  }

Sure makes sense to me. Updated patch below.

Regards,

Tony

8< -------------
From: Tony Lindgren <tony@atomide.com>
Date: Mon, 22 Dec 2014 08:19:07 -0800
Subject: [PATCH] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks

We need to check if we got the clock before trying to do anything
with it. Otherwise we will get something like this:

Unable to handle kernel paging request at virtual address fffffffe
...
[<c04bef78>] (clk_prepare) from [<c00338a4>] (omap2_clk_enable_init_clocks+0x50/0x8)
[<c00338a4>] (omap2_clk_enable_init_clocks) from [<c0876838>] (dm816x_dt_clk_init+0)
...

Let's add check for the clock and WARN if the init clock was not
found.

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <t-kristo@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

--- 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)
 
 	for (i = 0; i < num_clocks; i++) {
 		init_clk = clk_get(NULL, clk_names[i]);
+		if (WARN(IS_ERR(init_clk), "could not find init clock %s\n",
+				clk_names[i]))
+			continue;
 		clk_prepare_enable(init_clk);
 	}
 }

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx
  2015-01-14  1:24     ` Felipe Balbi
@ 2015-01-14 19:04       ` Tony Lindgren
  -1 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-14 19:04 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-omap, linux-arm-kernel, Brian Hutchinson

* Felipe Balbi <balbi@ti.com> [150113 17:28]:
> On Tue, Jan 13, 2015 at 03:13:56PM -0800, Tony Lindgren wrote:
> > +
> > +#define TI81XX_PRM_DEVICE_RSTCTRL	0x00a0
> > +#define TI81XX_GLOBAL_RST_COLD		BIT(1)
> > +
> > +/**
> > + * ti81xx_restart - trigger a software restart of the SoC
> > + * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
> > + * @cmd: passed from the userspace program rebooting the system (if provided)
> > + *
> > + * Resets the SoC.  For @cmd, see the 'reboot' syscall in
> > + * kernel/sys.c.  No return value.
> > + */
> > +void ti81xx_restart(enum reboot_mode mode, const char *cmd)
> > +{
> > +	omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
> > +				   TI81XX_PRM_DEVICE_RSTCTRL);
> 
> do you need to check that mode == REBOOT_COLD here ?

Looks like not, trying to use the warm reset bit does not seem to do
anything and probably requires manually resetting clocks into bypass
mode or something.

I'll just add a comment about that.

Regards,

Tony

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx
@ 2015-01-14 19:04       ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-14 19:04 UTC (permalink / raw)
  To: linux-arm-kernel

* Felipe Balbi <balbi@ti.com> [150113 17:28]:
> On Tue, Jan 13, 2015 at 03:13:56PM -0800, Tony Lindgren wrote:
> > +
> > +#define TI81XX_PRM_DEVICE_RSTCTRL	0x00a0
> > +#define TI81XX_GLOBAL_RST_COLD		BIT(1)
> > +
> > +/**
> > + * ti81xx_restart - trigger a software restart of the SoC
> > + * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
> > + * @cmd: passed from the userspace program rebooting the system (if provided)
> > + *
> > + * Resets the SoC.  For @cmd, see the 'reboot' syscall in
> > + * kernel/sys.c.  No return value.
> > + */
> > +void ti81xx_restart(enum reboot_mode mode, const char *cmd)
> > +{
> > +	omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
> > +				   TI81XX_PRM_DEVICE_RSTCTRL);
> 
> do you need to check that mode == REBOOT_COLD here ?

Looks like not, trying to use the warm reset bit does not seem to do
anything and probably requires manually resetting clocks into bypass
mode or something.

I'll just add a comment about that.

Regards,

Tony

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx
  2015-01-14 19:04       ` Tony Lindgren
@ 2015-01-14 19:30         ` Felipe Balbi
  -1 siblings, 0 replies; 33+ messages in thread
From: Felipe Balbi @ 2015-01-14 19:30 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Felipe Balbi, linux-omap, linux-arm-kernel, Brian Hutchinson

[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]

On Wed, Jan 14, 2015 at 11:04:19AM -0800, Tony Lindgren wrote:
> * Felipe Balbi <balbi@ti.com> [150113 17:28]:
> > On Tue, Jan 13, 2015 at 03:13:56PM -0800, Tony Lindgren wrote:
> > > +
> > > +#define TI81XX_PRM_DEVICE_RSTCTRL	0x00a0
> > > +#define TI81XX_GLOBAL_RST_COLD		BIT(1)
> > > +
> > > +/**
> > > + * ti81xx_restart - trigger a software restart of the SoC
> > > + * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
> > > + * @cmd: passed from the userspace program rebooting the system (if provided)
> > > + *
> > > + * Resets the SoC.  For @cmd, see the 'reboot' syscall in
> > > + * kernel/sys.c.  No return value.
> > > + */
> > > +void ti81xx_restart(enum reboot_mode mode, const char *cmd)
> > > +{
> > > +	omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
> > > +				   TI81XX_PRM_DEVICE_RSTCTRL);
> > 
> > do you need to check that mode == REBOOT_COLD here ?
> 
> Looks like not, trying to use the warm reset bit does not seem to do
> anything and probably requires manually resetting clocks into bypass
> mode or something.
> 
> I'll just add a comment about that.

alright, in that case:

Reviewed-by: Felipe Balbi <balbi@ti.com>

:-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx
@ 2015-01-14 19:30         ` Felipe Balbi
  0 siblings, 0 replies; 33+ messages in thread
From: Felipe Balbi @ 2015-01-14 19:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 14, 2015 at 11:04:19AM -0800, Tony Lindgren wrote:
> * Felipe Balbi <balbi@ti.com> [150113 17:28]:
> > On Tue, Jan 13, 2015 at 03:13:56PM -0800, Tony Lindgren wrote:
> > > +
> > > +#define TI81XX_PRM_DEVICE_RSTCTRL	0x00a0
> > > +#define TI81XX_GLOBAL_RST_COLD		BIT(1)
> > > +
> > > +/**
> > > + * ti81xx_restart - trigger a software restart of the SoC
> > > + * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
> > > + * @cmd: passed from the userspace program rebooting the system (if provided)
> > > + *
> > > + * Resets the SoC.  For @cmd, see the 'reboot' syscall in
> > > + * kernel/sys.c.  No return value.
> > > + */
> > > +void ti81xx_restart(enum reboot_mode mode, const char *cmd)
> > > +{
> > > +	omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
> > > +				   TI81XX_PRM_DEVICE_RSTCTRL);
> > 
> > do you need to check that mode == REBOOT_COLD here ?
> 
> Looks like not, trying to use the warm reset bit does not seem to do
> anything and probably requires manually resetting clocks into bypass
> mode or something.
> 
> I'll just add a comment about that.

alright, in that case:

Reviewed-by: Felipe Balbi <balbi@ti.com>

:-)

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150114/aa8a5bd7/attachment.sig>

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code
  2015-01-18 20:32 [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code Matthijs van Duin
@ 2015-01-19 17:15   ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-19 17:15 UTC (permalink / raw)
  To: Matthijs van Duin; +Cc: linux-omap, linux-arm-kernel, Brian Hutchinson

* Matthijs van Duin <matthijsvanduin@gmail.com> [150118 12:35]:
> > --- a/arch/arm/mach-omap2/usb-musb.c
> > +++ b/arch/arm/mach-omap2/usb-musb.c
> > @@ -82,16 +82,8 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
> >   musb_plat.mode = board_data->mode;
> >   musb_plat.extvbus = board_data->extvbus;
> >
> > - if (soc_is_am35xx()) {
> 
> Was it intentional that this patch also removed a test for am35xx
> (rather than am335x) ?

Oops that was not intentional. However, with the pending patches to
make am3517 dt only, this won't hurt anything as the only legacy
platform then left are omap3430 to omap3730 which us the default
musb-omap2430.

Regards,

Tony

^ permalink raw reply	[flat|nested] 33+ messages in thread

* [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code
@ 2015-01-19 17:15   ` Tony Lindgren
  0 siblings, 0 replies; 33+ messages in thread
From: Tony Lindgren @ 2015-01-19 17:15 UTC (permalink / raw)
  To: linux-arm-kernel

* Matthijs van Duin <matthijsvanduin@gmail.com> [150118 12:35]:
> > --- a/arch/arm/mach-omap2/usb-musb.c
> > +++ b/arch/arm/mach-omap2/usb-musb.c
> > @@ -82,16 +82,8 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
> >   musb_plat.mode = board_data->mode;
> >   musb_plat.extvbus = board_data->extvbus;
> >
> > - if (soc_is_am35xx()) {
> 
> Was it intentional that this patch also removed a test for am35xx
> (rather than am335x) ?

Oops that was not intentional. However, with the pending patches to
make am3517 dt only, this won't hurt anything as the only legacy
platform then left are omap3430 to omap3730 which us the default
musb-omap2430.

Regards,

Tony

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code
@ 2015-01-18 20:32 Matthijs van Duin
  2015-01-19 17:15   ` Tony Lindgren
  0 siblings, 1 reply; 33+ messages in thread
From: Matthijs van Duin @ 2015-01-18 20:32 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Brian Hutchinson

> --- a/arch/arm/mach-omap2/usb-musb.c
> +++ b/arch/arm/mach-omap2/usb-musb.c
> @@ -82,16 +82,8 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
>   musb_plat.mode = board_data->mode;
>   musb_plat.extvbus = board_data->extvbus;
>
> - if (soc_is_am35xx()) {

Was it intentional that this patch also removed a test for am35xx
(rather than am335x) ?

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2015-01-19 17:19 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-13 23:13 [PATCH 0/7] Fixes and clean-up in preparation for booting ti81xx Tony Lindgren
2015-01-13 23:13 ` Tony Lindgren
2015-01-13 23:13 ` [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code Tony Lindgren
2015-01-13 23:13   ` Tony Lindgren
2015-01-14  1:19   ` Felipe Balbi
2015-01-14  1:19     ` Felipe Balbi
2015-01-14 17:19     ` Tony Lindgren
2015-01-14 17:19       ` Tony Lindgren
2015-01-13 23:13 ` [PATCH 2/7] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks Tony Lindgren
2015-01-13 23:13   ` Tony Lindgren
2015-01-14  1:21   ` Felipe Balbi
2015-01-14  1:21     ` Felipe Balbi
2015-01-14 17:27     ` Tony Lindgren
2015-01-14 17:27       ` Tony Lindgren
2015-01-13 23:13 ` [PATCH 3/7] ARM: OMAP2+: Fix ti81xx devtype Tony Lindgren
2015-01-13 23:13   ` Tony Lindgren
2015-01-13 23:13 ` [PATCH 4/7] ARM: OMAP2+: Fix ti81xx class type Tony Lindgren
2015-01-13 23:13   ` Tony Lindgren
2015-01-13 23:13 ` [PATCH 5/7] ARM: OMAP2+: Fix dm814 and dm816 for clocks and timer init Tony Lindgren
2015-01-13 23:13   ` Tony Lindgren
2015-01-13 23:13 ` [PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx Tony Lindgren
2015-01-13 23:13   ` Tony Lindgren
2015-01-14  1:24   ` Felipe Balbi
2015-01-14  1:24     ` Felipe Balbi
2015-01-14 19:04     ` Tony Lindgren
2015-01-14 19:04       ` Tony Lindgren
2015-01-14 19:30       ` Felipe Balbi
2015-01-14 19:30         ` Felipe Balbi
2015-01-13 23:13 ` [PATCH 7/7] ARM: OMAP2+: Disable omap3 PM init for ti81xx Tony Lindgren
2015-01-13 23:13   ` Tony Lindgren
2015-01-18 20:32 [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code Matthijs van Duin
2015-01-19 17:15 ` Tony Lindgren
2015-01-19 17:15   ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.