All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Pavel Machek <pavel@ucw.cz>,
	pali.rohar@gmail.com, sre@kernel.org,
	kernel list <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-omap@vger.kernel.org, khilman@kernel.org,
	aaro.koskinen@iki.fi, ivo.g.dimitrov.75@gmail.com,
	patrikbachan@gmail.com, serge@hallyn.com, abcloriens@gmail.com,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Russell King <linux@armlinux.org.uk>
Subject: Re: n900 in next-20170901
Date: Thu, 9 Nov 2017 22:23:40 -0800	[thread overview]
Message-ID: <20171110062340.GL28152@atomide.com> (raw)
In-Reply-To: <20171110061917.GK28152@atomide.com>

* Tony Lindgren <tony@atomide.com> [171109 22:19]:
> * Tony Lindgren <tony@atomide.com> [171110 03:28]:
> > Then I'll follow up on cleaning up save_secure_ram_context later.
> 
> Here's a better version, the static mapping did not get used.. It
> just moved the area so it happened to work. It needs to be set
> up as MT_MEMORY_RWX_NONCACHED instead.

And FYI, here's what I currently have for the follow-up patch,
but that can wait a bit.

Regards,

Tony

8< ------------------------
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -45,7 +45,6 @@
 #define PM_PWSTCTRL_MPU_P	OMAP3430_PRM_BASE + MPU_MOD + OMAP2_PM_PWSTCTRL
 #define CM_IDLEST1_CORE_V	OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1)
 #define CM_IDLEST_CKGEN_V	OMAP34XX_CM_REGADDR(PLL_MOD, CM_IDLEST)
-#define SRAM_BASE_P		OMAP3_SRAM_PA
 #define CONTROL_STAT		OMAP343X_CTRL_BASE + OMAP343X_CONTROL_STATUS
 #define CONTROL_MEM_RTA_CTRL	(OMAP343X_CTRL_BASE +\
 					OMAP36XX_CONTROL_MEM_RTA_CTRL)
@@ -103,10 +102,8 @@ ENTRY(save_secure_ram_context)
 	stmfd	sp!, {r4 - r11, lr}	@ save registers on stack
 	adr	r3, api_params		@ r3 points to parameters
 	str	r0, [r3,#0x4]		@ r0 has sdram address
-	ldr	r12, high_mask
-	and	r3, r3, r12
-	ldr	r12, sram_phy_addr_mask
-	orr	r3, r3, r12
+	ldr	r12, sram_phys_offset	@ load sram physical offset
+	sub	r3, r3, r12		@ parameters physical address
 	mov	r0, #25			@ set service ID for PPA
 	mov	r12, r0			@ copy secure service ID in r12
 	mov	r1, #0			@ set task id for ROM code in r1
@@ -121,10 +118,8 @@ ENTRY(save_secure_ram_context)
 	nop
 	ldmfd	sp!, {r4 - r11, pc}
 	.align
-sram_phy_addr_mask:
-	.word	SRAM_BASE_P
-high_mask:
-	.word	0xffff
+sram_phys_offset:
+	.word	OMAP34XX_SRAM_VIRT - OMAP34XX_SRAM_PHYS
 api_params:
 	.word	0x4, 0x0, 0x0, 0x1, 0x1
 ENDPROC(save_secure_ram_context)
@@ -521,7 +516,7 @@ pm_pwstctrl_mpu:
 scratchpad_base:
 	.word	SCRATCHPAD_BASE_P
 sram_base:
-	.word	SRAM_BASE_P + 0x8000
+	.word	OMAP34XX_SRAM_PHYS + 0x8000
 control_stat:
 	.word	CONTROL_STAT
 control_mem_rta:
diff --git a/arch/arm/mach-omap2/sram.c b/arch/arm/mach-omap2/sram.c
--- a/arch/arm/mach-omap2/sram.c
+++ b/arch/arm/mach-omap2/sram.c
@@ -31,7 +31,7 @@
 #include "sram.h"
 
 #define OMAP2_SRAM_PUB_PA	(OMAP2_SRAM_PA + 0xf800)
-#define OMAP3_SRAM_PUB_PA       (OMAP3_SRAM_PA + 0x8000)
+#define OMAP3_SRAM_PUB_PA       (OMAP34XX_SRAM_PHYS + 0x8000)
 
 #define SRAM_BOOTLOADER_SZ	0x00
 
@@ -105,7 +105,7 @@ static void __init omap_detect_sram(void)
 		}
 	} else {
 		if (cpu_is_omap34xx()) {
-			omap_sram_start = OMAP3_SRAM_PA;
+			omap_sram_start = OMAP34XX_SRAM_PHYS;
 			omap_sram_size = 0x10000; /* 64K */
 		} else {
 			omap_sram_start = OMAP2_SRAM_PA;
diff --git a/arch/arm/mach-omap2/sram.h b/arch/arm/mach-omap2/sram.h
--- a/arch/arm/mach-omap2/sram.h
+++ b/arch/arm/mach-omap2/sram.h
@@ -59,4 +59,3 @@ static inline void omap_push_sram_idle(void) {}
  * Used by the SRAM management code and the idle sleep code.
  */
 #define OMAP2_SRAM_PA		0x40200000
-#define OMAP3_SRAM_PA           0x40200000
-- 
2.15.0

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: n900 in next-20170901
Date: Thu, 9 Nov 2017 22:23:40 -0800	[thread overview]
Message-ID: <20171110062340.GL28152@atomide.com> (raw)
In-Reply-To: <20171110061917.GK28152@atomide.com>

* Tony Lindgren <tony@atomide.com> [171109 22:19]:
> * Tony Lindgren <tony@atomide.com> [171110 03:28]:
> > Then I'll follow up on cleaning up save_secure_ram_context later.
> 
> Here's a better version, the static mapping did not get used.. It
> just moved the area so it happened to work. It needs to be set
> up as MT_MEMORY_RWX_NONCACHED instead.

And FYI, here's what I currently have for the follow-up patch,
but that can wait a bit.

Regards,

Tony

8< ------------------------
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -45,7 +45,6 @@
 #define PM_PWSTCTRL_MPU_P	OMAP3430_PRM_BASE + MPU_MOD + OMAP2_PM_PWSTCTRL
 #define CM_IDLEST1_CORE_V	OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1)
 #define CM_IDLEST_CKGEN_V	OMAP34XX_CM_REGADDR(PLL_MOD, CM_IDLEST)
-#define SRAM_BASE_P		OMAP3_SRAM_PA
 #define CONTROL_STAT		OMAP343X_CTRL_BASE + OMAP343X_CONTROL_STATUS
 #define CONTROL_MEM_RTA_CTRL	(OMAP343X_CTRL_BASE +\
 					OMAP36XX_CONTROL_MEM_RTA_CTRL)
@@ -103,10 +102,8 @@ ENTRY(save_secure_ram_context)
 	stmfd	sp!, {r4 - r11, lr}	@ save registers on stack
 	adr	r3, api_params		@ r3 points to parameters
 	str	r0, [r3,#0x4]		@ r0 has sdram address
-	ldr	r12, high_mask
-	and	r3, r3, r12
-	ldr	r12, sram_phy_addr_mask
-	orr	r3, r3, r12
+	ldr	r12, sram_phys_offset	@ load sram physical offset
+	sub	r3, r3, r12		@ parameters physical address
 	mov	r0, #25			@ set service ID for PPA
 	mov	r12, r0			@ copy secure service ID in r12
 	mov	r1, #0			@ set task id for ROM code in r1
@@ -121,10 +118,8 @@ ENTRY(save_secure_ram_context)
 	nop
 	ldmfd	sp!, {r4 - r11, pc}
 	.align
-sram_phy_addr_mask:
-	.word	SRAM_BASE_P
-high_mask:
-	.word	0xffff
+sram_phys_offset:
+	.word	OMAP34XX_SRAM_VIRT - OMAP34XX_SRAM_PHYS
 api_params:
 	.word	0x4, 0x0, 0x0, 0x1, 0x1
 ENDPROC(save_secure_ram_context)
@@ -521,7 +516,7 @@ pm_pwstctrl_mpu:
 scratchpad_base:
 	.word	SCRATCHPAD_BASE_P
 sram_base:
-	.word	SRAM_BASE_P + 0x8000
+	.word	OMAP34XX_SRAM_PHYS + 0x8000
 control_stat:
 	.word	CONTROL_STAT
 control_mem_rta:
diff --git a/arch/arm/mach-omap2/sram.c b/arch/arm/mach-omap2/sram.c
--- a/arch/arm/mach-omap2/sram.c
+++ b/arch/arm/mach-omap2/sram.c
@@ -31,7 +31,7 @@
 #include "sram.h"
 
 #define OMAP2_SRAM_PUB_PA	(OMAP2_SRAM_PA + 0xf800)
-#define OMAP3_SRAM_PUB_PA       (OMAP3_SRAM_PA + 0x8000)
+#define OMAP3_SRAM_PUB_PA       (OMAP34XX_SRAM_PHYS + 0x8000)
 
 #define SRAM_BOOTLOADER_SZ	0x00
 
@@ -105,7 +105,7 @@ static void __init omap_detect_sram(void)
 		}
 	} else {
 		if (cpu_is_omap34xx()) {
-			omap_sram_start = OMAP3_SRAM_PA;
+			omap_sram_start = OMAP34XX_SRAM_PHYS;
 			omap_sram_size = 0x10000; /* 64K */
 		} else {
 			omap_sram_start = OMAP2_SRAM_PA;
diff --git a/arch/arm/mach-omap2/sram.h b/arch/arm/mach-omap2/sram.h
--- a/arch/arm/mach-omap2/sram.h
+++ b/arch/arm/mach-omap2/sram.h
@@ -59,4 +59,3 @@ static inline void omap_push_sram_idle(void) {}
  * Used by the SRAM management code and the idle sleep code.
  */
 #define OMAP2_SRAM_PA		0x40200000
-#define OMAP3_SRAM_PA           0x40200000
-- 
2.15.0

  reply	other threads:[~2017-11-10  6:23 UTC|newest]

Thread overview: 121+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-03 20:37 n900 in next-20170901 Pavel Machek
2017-09-03 20:37 ` Pavel Machek
2017-09-05 20:13 ` Tony Lindgren
2017-09-05 20:13   ` Tony Lindgren
2017-09-05 20:27   ` Vlastimil Babka
2017-09-05 20:27     ` Vlastimil Babka
2017-09-05 20:32     ` Tony Lindgren
2017-09-05 20:32       ` Tony Lindgren
2017-09-05 23:32   ` Joonsoo Kim
2017-09-05 23:32     ` Joonsoo Kim
2017-09-06 13:30     ` Tony Lindgren
2017-09-06 13:30       ` Tony Lindgren
2017-09-07  7:30       ` Joonsoo Kim
2017-09-07  7:30         ` Joonsoo Kim
2017-09-07 16:16         ` Tony Lindgren
2017-09-07 16:16           ` Tony Lindgren
2017-09-13  7:55           ` Joonsoo Kim
2017-09-13  7:55             ` Joonsoo Kim
2017-09-13 16:31             ` Tony Lindgren
2017-09-13 16:31               ` Tony Lindgren
2017-09-15  6:56               ` Joonsoo Kim
2017-09-15  6:56                 ` Joonsoo Kim
2017-09-21 17:28                 ` Tony Lindgren
2017-09-21 17:28                   ` Tony Lindgren
2017-09-25  8:08                   ` Joonsoo Kim
2017-09-25  8:08                     ` Joonsoo Kim
2017-09-25 14:54                     ` Tony Lindgren
2017-09-25 14:54                       ` Tony Lindgren
2017-10-18  8:29                       ` Joonsoo Kim
2017-10-18  8:29                         ` Joonsoo Kim
2017-10-19 18:30                         ` Tony Lindgren
2017-10-19 18:30                           ` Tony Lindgren
2017-10-20  1:55                           ` Joonsoo Kim
2017-10-20  1:55                             ` Joonsoo Kim
2017-10-20 17:31                             ` Tony Lindgren
2017-10-20 17:31                               ` Tony Lindgren
2017-10-23  4:53                               ` Joonsoo Kim
2017-10-23  4:53                                 ` Joonsoo Kim
2017-10-25 17:31                                 ` Tony Lindgren
2017-10-25 17:31                                   ` Tony Lindgren
2017-10-26  4:48                                   ` Joonsoo Kim
2017-10-26  4:48                                     ` Joonsoo Kim
2017-10-26 14:16                                     ` Tony Lindgren
2017-10-26 14:16                                       ` Tony Lindgren
2017-11-07  5:33                                       ` Joonsoo Kim
2017-11-07  5:33                                         ` Joonsoo Kim
2017-11-07 15:48                                         ` Tony Lindgren
2017-11-07 15:48                                           ` Tony Lindgren
2017-11-08  7:46                                           ` Joonsoo Kim
2017-11-08  7:46                                             ` Joonsoo Kim
2017-11-08 16:34                                             ` Tony Lindgren
2017-11-08 16:34                                               ` Tony Lindgren
2017-11-09  0:08                                               ` Joonsoo Kim
2017-11-09  0:08                                                 ` Joonsoo Kim
2017-11-09  0:11                                                 ` Tony Lindgren
2017-11-09  0:11                                                   ` Tony Lindgren
2017-11-09  0:36                                                   ` Joonsoo Kim
2017-11-09  0:36                                                     ` Joonsoo Kim
2017-11-09  3:50                                                     ` Joonsoo Kim
2017-11-09  3:50                                                       ` Joonsoo Kim
2017-11-09 15:08                                                       ` Tony Lindgren
2017-11-09 15:08                                                         ` Tony Lindgren
2017-11-10  0:13                                                         ` Joonsoo Kim
2017-11-10  0:13                                                           ` Joonsoo Kim
2017-11-10  3:26                                                           ` Tony Lindgren
2017-11-10  3:26                                                             ` Tony Lindgren
2017-11-10  6:19                                                             ` Tony Lindgren
2017-11-10  6:19                                                               ` Tony Lindgren
2017-11-10  6:23                                                               ` Tony Lindgren [this message]
2017-11-10  6:23                                                                 ` Tony Lindgren
2017-11-10  6:46                                                                 ` Joonsoo Kim
2017-11-10  6:46                                                                   ` Joonsoo Kim
2017-11-10 15:37                                                                   ` Tony Lindgren
2017-11-10 15:37                                                                     ` Tony Lindgren
2017-11-10  6:37                                                             ` Joonsoo Kim
2017-11-10  6:37                                                               ` Joonsoo Kim
2017-11-10 15:36                                                               ` Tony Lindgren
2017-11-10 15:36                                                                 ` Tony Lindgren
2017-11-13 21:15                                                                 ` Tony Lindgren
2017-11-13 21:15                                                                   ` Tony Lindgren
2017-11-14  6:40                                                                   ` Joonsoo Kim
2017-11-14  6:40                                                                     ` Joonsoo Kim
2017-11-14  6:37                                                                 ` Joonsoo Kim
2017-11-14  6:37                                                                   ` Joonsoo Kim
2017-11-14 17:37                                                                   ` Tony Lindgren
2017-11-14 17:37                                                                     ` Tony Lindgren
2017-11-14 19:31                                                                     ` Tero Kristo
2017-11-14 19:31                                                                       ` Tero Kristo
2017-11-14 19:31                                                                       ` Tero Kristo
2017-11-14 19:44                                                                       ` Tony Lindgren
2017-11-14 19:44                                                                         ` Tony Lindgren
2017-11-14 20:01                                                                         ` Tero Kristo
2017-11-14 20:01                                                                           ` Tero Kristo
2017-11-14 20:01                                                                           ` Tero Kristo
2017-11-14 20:54                                                                           ` Tony Lindgren
2017-11-14 20:54                                                                             ` Tony Lindgren
2017-11-15  0:51                                                                     ` Joonsoo Kim
2017-11-15  0:51                                                                       ` Joonsoo Kim
2017-11-15  2:04                                                                       ` Tony Lindgren
2017-11-15  2:04                                                                         ` Tony Lindgren
2017-11-15  2:48                                                                         ` Joonsoo Kim
2017-11-15  2:48                                                                           ` Joonsoo Kim
2017-11-15  2:53                                                                           ` Tony Lindgren
2017-11-15  2:53                                                                             ` Tony Lindgren
2017-11-15  2:53                                                                             ` Tony Lindgren
2017-09-15 13:18           ` Pavel Machek
2017-09-15 13:18             ` Pavel Machek
2017-09-18  2:01             ` Joonsoo Kim
2017-09-18  2:01               ` Joonsoo Kim
2017-09-18  8:11               ` Linux-next broken for 2 weeks was " Pavel Machek
2017-09-18  8:11                 ` Pavel Machek
2017-09-18 22:00                 ` Stephen Rothwell
2017-09-18 22:00                   ` Stephen Rothwell
2017-09-18 22:16                   ` Pavel Machek
2017-09-18 22:16                     ` Pavel Machek
2017-09-15 13:28         ` Pali Rohár
2017-09-15 13:28           ` Pali Rohár
2017-09-18  2:07           ` Joonsoo Kim
2017-09-18  2:07             ` Joonsoo Kim
2017-09-08  9:31   ` Pavel Machek
2017-09-08  9:31     ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171110062340.GL28152@atomide.com \
    --to=tony@atomide.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=abcloriens@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=khilman@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=pali.rohar@gmail.com \
    --cc=patrikbachan@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=serge@hallyn.com \
    --cc=sfr@canb.auug.org.au \
    --cc=sre@kernel.org \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.