Fixes and clean-up in preparation for booting ti81xx
Subsystems (6)
Tony Lindgren
maintainercover Fixes and clean-up in preparation for booting ti81xx
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
Signature · 1 line
2.1.4
Tony Lindgren
maintainerPATCH 1/7 ARM: OMAP2+: Remove unused ti81xx platform init code
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.
--- 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(-)
arch/arm/mach-omap2/cclock3xxx_data.c +1 -5
@@ -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() */
arch/arm/mach-omap2/omap_phy_internal.c +0 -35
@@ -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); -}
arch/arm/mach-omap2/usb-musb.c +2 -10
@@ -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",
arch/arm/mach-omap2/usb.h +0 -2
@@ -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); -
Signature · 1 line
2.1.4
PATCH 1/7 ARM: OMAP2+: Remove unused ti81xx platform init code
Quoted 3 lines · Tony Lindgren
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
Quoted 116 lines
Cc Brian Hutchinson <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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(-)arch/arm/mach-omap2/cclock3xxx_data.c +1
-5@@ -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() */ arch/arm/mach-omap2/omap_phy_internal.c +0
-35@@ -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); -}arch/arm/mach-omap2/usb-musb.c +2
-10@@ -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",arch/arm/mach-omap2/usb.h +0
-2@@ -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); -Signature · 6 lines
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
Signature · 8 lines
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>
Tony Lindgren
maintainerPATCH 1/7 ARM: OMAP2+: Remove unused ti81xx platform init code
Quoted 11 lines · Felipe Balbi
Quoted 3 lines · Tony Lindgren
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 <[email protected]>
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
Tony Lindgren
maintainerPATCH 2/7 ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
In reply to Tony LindgrenWe 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.
--- arch/arm/mach-omap2/clock.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/mach-omap2/clock.c +5 -0
@@ -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); } }
Signature · 1 line
2.1.4
PATCH 2/7 ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
Quoted 9 lines · Tony Lindgren
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)
...
Quoted 5 lines
Let's add check for the clock and WARN if the init clock was not found.
Cc Brian Hutchinson <[email protected]>Signed-off-by Tony Lindgren <[email protected]>
Just one minor nit below, other than that:
Quoted 9 lines
--- arch/arm/mach-omap2/clock.c | 5 +++++ 1 file changed, 5 insertions(+)arch/arm/mach-omap2/clock.c +0
-0
arch/arm/mach-omap2/clock.c void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks) · line 625
Quoted 6 lines
arch/arm/mach-omap2/clock.c +3
-0@@ -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.
Quoted 12 lines
arch/arm/mach-omap2/clock.c +2
-0+continue ; + }clk_prepare_enable (init_clk); } }Signature · 6 lines
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
Signature · 8 lines
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>
Tony Lindgren
maintainerPATCH 2/7 ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
Quoted 41 lines · Felipe Balbi
Quoted 9 lines · Tony Lindgren
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)
...Quoted 5 lines
Let's add check for the clock and WARN if the init clock was not found.
Cc Brian Hutchinson <[email protected]>Signed-off-by Tony Lindgren <[email protected]>Just one minor nit below, other than that:
Reviewed-by Felipe Balbi <[email protected]>Quoted 9 lines
--- arch/arm/mach-omap2/clock.c | 5 +++++ 1 file changed, 5 insertions(+)arch/arm/mach-omap2/clock.c +0
-0arch/arm/mach-omap2/clock.c void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks) · line 625
Quoted 6 lines
arch/arm/mach-omap2/clock.c +3
-0@@ -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]))
Quoted 8 lines
not that I also removed that "omap clock" prefix because
WARN()will print the file name anyway.arch/arm/mach-omap2/clock.c void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks) · line 630
Quoted 5 lines
arch/arm/mach-omap2/clock.c +2
-0+continue ; + }clk_prepare_enable (init_clk); } }
Sure makes sense to me. Updated patch below.
Regards,
Tony
8< -------------
From: Tony Lindgren <[email protected]>
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.
arch/arm/mach-omap2/clock.c +3 -0
@@ -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); } }
Tony Lindgren
maintainerPATCH 3/7 ARM: OMAP2+: Fix ti81xx devtype
In reply to Tony LindgrenOtherwise 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.
--- arch/arm/mach-omap2/control.h | 4 ++++ arch/arm/mach-omap2/id.c | 2 ++ 2 files changed, 6 insertions(+)
arch/arm/mach-omap2/control.h +4 -0
@@ -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)
arch/arm/mach-omap2/id.c +2 -0
@@ -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 ()) {
Signature · 1 line
2.1.4
Tony Lindgren
maintainerPATCH 4/7 ARM: OMAP2+: Fix ti81xx class type
In reply to Tony LindgrenOtherwise 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.
--- 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(-)
arch/arm/mach-omap2/common.h +2 -1
@@ -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 );
arch/arm/mach-omap2/io.c +21 -4
@@ -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 )
arch/arm/mach-omap2/powerdomains3xxx_data.c +1 -1
@@ -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);
arch/arm/mach-omap2/soc.h +2 -2
@@ -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))
Signature · 1 line
2.1.4
Tony Lindgren
maintainerPATCH 5/7 ARM: OMAP2+: Fix dm814 and dm816 for clocks and timer init
In reply to Tony LindgrenFix dm814 and dm816 clocks and timer init.
--- arch/arm/mach-omap2/prm_common.c | 4 ++++ arch/arm/mach-omap2/timer.c | 2 ++ 2 files changed, 6 insertions(+)
arch/arm/mach-omap2/prm_common.c +4 -0
@@ -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" },
arch/arm/mach-omap2/timer.c +2 -0
@@ -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", }, { }
Signature · 1 line
2.1.4
Tony Lindgren
maintainerPATCH 6/7 ARM: OMAP2+: Fix reboot for 81xx
In reply to Tony LindgrenWe are missing proper hooks for 81xx for reboot to work.
--- 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
arch/arm/mach-omap2/Makefile +1 -0
@@ -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
arch/arm/mach-omap2/common.h +8 -0
@@ -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);
arch/arm/mach-omap2/ti81xx-restart.c new file +31 -0
@@ -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 ); +}
Signature · 1 line
2.1.4
PATCH 6/7 ARM: OMAP2+: Fix reboot for 81xx
Quoted 67 lines · Tony Lindgren
We are missing proper hooks for 81xx for reboot to work.
Cc Brian Hutchinson <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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.carch/arm/mach-omap2/Makefile +1
-0@@ -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.oarch/arm/mach-omap2/common.h +8
-0@@ -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);arch/arm/mach-omap2/ti81xx-restart.c new file +19
-0@@ -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
arch/arm/mach-omap2/ti81xx-restart.c line 29
Quoted 10 lines
arch/arm/mach-omap2/ti81xx-restart.c new file +10
-0+* @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 ?
Signature · 8 lines
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>
Tony Lindgren
maintainerPATCH 6/7 ARM: OMAP2+: Fix reboot for 81xx
Quoted 11 lines · Felipe Balbi
Quoted 10 lines · Tony Lindgren
arch/arm/mach-omap2/ti81xx-restart.c new file +10
-0+ +#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
Quoted 8 lines
arch/arm/mach-omap2/ti81xx-restart.c line 29
Quoted 6 lines
+ *
kernel/sys.c. No return value.
+ */arch/arm/mach-omap2/ti81xx-restart.c new file +4
-0+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_COLDhere ?
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
PATCH 6/7 ARM: OMAP2+: Fix reboot for 81xx
Quoted 21 lines · Tony Lindgren
Quoted 11 lines · Felipe Balbi
Quoted 10 lines · Tony Lindgren
arch/arm/mach-omap2/ti81xx-restart.c new file +10
-0+ +#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 Quoted 8 lines
arch/arm/mach-omap2/ti81xx-restart.c line 29
Quoted 6 lines
+ *
kernel/sys.c. No return value.
+ */arch/arm/mach-omap2/ti81xx-restart.c new file +4
-0+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_COLDhere ?
Quoted 5 lines
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:
:-)
Signature · 8 lines
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>
Tony Lindgren
maintainerPATCH 7/7 ARM: OMAP2+: Disable omap3 PM init for ti81xx
In reply to Tony LindgrenWe cannot use the omap3 pm support on 81xx.
--- arch/arm/mach-omap2/io.c | 1 - 1 file changed, 1 deletion(-)
arch/arm/mach-omap2/io.c +0 -1
@@ -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
Signature · 1 line
2.1.4