Skip to contentSkip to conversation

arm: omap5: am57/dra7: Fix SRAM_SCRATCH_SPACE_ADDR and SRAM_ROM_VECT_BASE

PATCH New Andrew Bradford 2 participants 2 messages Aug 5, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: omap5: am57/dra7: Fix SRAM_SCRATCH_SPACE_ADDR and SRAM_ROM_VECT_BASE

From: Andrew Bradford <[email protected]>

Both am57xx and dra7xx have 512 kiB of SRAM and the mapping within that SRAM is the same as omap5 (which has only 128 kiB) except for a much larger "Download image" area. So, fix am57xx and dra7xx location for SRAM_SCRATCH_SPACE_ADDR to mimmic omap5's locating of this area to a memory region defined by the TRM as "Reserved" immediately following the "Download image" region and fix the ROM code interrupt vector address SRAM_ROM_VECT_BASE to properly match the TRM.

---
 arch/arm/include/asm/arch-omap5/omap.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
arch/arm/include/asm/arch-omap5/omap.h +4 -6
index 2fd5cda..b9e4783 100644
@@ -179,21 +179,19 @@ struct s32ktimer {
  * and indicates the area for the downloaded image.  We use all of that
  * space for download and once up and running may use other parts of the
  * map for our needs.  We set a scratch space that is at the end of the
- * OMAP5 download area, but within the DRA7xx download area (as it is
- * much larger) and do not, at this time, make use of the additional
- * space.
+ * download area in an area marked reserved in the TRM.
  */
 #if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX)
 #define NON_SECURE_SRAM_START	0x40300000
 #define NON_SECURE_SRAM_END	0x40380000	/* Not inclusive */
+#define SRAM_SCRATCH_SPACE_ADDR	0x4037E000
+#define SRAM_ROM_VECT_BASE	0x4037F000
 #else
 #define NON_SECURE_SRAM_START	0x40300000
 #define NON_SECURE_SRAM_END	0x40320000	/* Not inclusive */
-#endif
 #define SRAM_SCRATCH_SPACE_ADDR	0x4031E000
-
-/* base address for indirect vectors (internal boot mode) */
 #define SRAM_ROM_VECT_BASE	0x4031F000
+#endif
 
 /* CONTROL_SRCOMP_XXX_SIDE */
 #define OVERRIDE_XS_SHIFT		30
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/1 arm: omap5: am57/dra7: Fix SRAM_SCRATCH_SPACE_ADDR and SRAM_ROM_VECT_BASE

Quoted 32 lines · Andrew Bradford

From: Andrew Bradford <[email protected]>

Both am57xx and dra7xx have 512 kiB of SRAM and the mapping within that SRAM is the same as omap5 (which has only 128 kiB) except for a much larger "Download image" area. So, fix am57xx and dra7xx location for SRAM_SCRATCH_SPACE_ADDR to mimmic omap5's locating of this area to a memory region defined by the TRM as "Reserved" immediately following the "Download image" region and fix the ROM code interrupt vector address SRAM_ROM_VECT_BASE to properly match the TRM.

---
 arch/arm/include/asm/arch-omap5/omap.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
arch/arm/include/asm/arch-omap5/omap.h +2 -3
index 2fd5cda..b9e4783 100644
@@ -179,21 +179,19 @@ struct s32ktimer {
  * and indicates the area for the downloaded image.  We use all of that
  * space for download and once up and running may use other parts of the
  * map for our needs.  We set a scratch space that is at the end of the
- * OMAP5 download area, but within the DRA7xx download area (as it is
- * much larger) and do not, at this time, make use of the additional
- * space.
+ * download area in an area marked reserved in the TRM.
  */
 #if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX)
 #define NON_SECURE_SRAM_START	0x40300000
 #define NON_SECURE_SRAM_END	0x40380000	/* Not inclusive */
+#define SRAM_SCRATCH_SPACE_ADDR	0x4037E000

arch/arm/include/asm/arch-omap5/omap.h struct s32ktimer { · line 194

Quoted 10 lines
arch/arm/include/asm/arch-omap5/omap.h +2 -3
+#define SRAM_ROM_VECT_BASE	0x4037F000
 #else
 #define NON_SECURE_SRAM_START	0x40300000
 #define NON_SECURE_SRAM_END	0x40320000	/* Not inclusive */
-#endif
 #define SRAM_SCRATCH_SPACE_ADDR	0x4031E000
-
-/* base address for indirect vectors (internal boot mode) */
 #define SRAM_ROM_VECT_BASE	0x4031F000
+#endif

So, this is totally following existing examples. But on further review, I don't like the existing examples, which, hey, is my fault, I wrote them. I don't like that mostly we put the scratch space into a "reserved" area (which may or may not trample ROM and that could be bad in some corner cases). Looking things over, we claim we need a maximum of 0x228 bytes of scratch space and we currently use more like 0x8a bytes of it. However, depending on the platform we are on, we may claim between 8 and 32 KiB for all of this. And stack in SPL is elsewhere in these defines and not a worry. I'm build testing a patch now and will boot test it on a good subset of the hardware before posting that should address all of this. Thanks for bringing it up!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160805/33976d88/attachment.sig>