Skip to contentSkip to conversation

ARM: i.MX6: Specify OCRAM base address and size

PATCH Superseded John Watts 3 participants 7 messages Jan 26, 2023 – Jan 30, 2023

Subsystems (3)
lore
Share & tools
lore

John Watts

author
#0 lore raw

PATCH 1/1 ARM: i.MX6: Specify OCRAM base address and size

The i.MX6 includes some on-chip RAM: 128KiB on most variants, with 256KiB on the Dual and Quad variants.

This region is where the first stage of Barebox gets loaded if RAM initialization isn't hard coded using DCD information.

Add the base address and size so it can be used to calculate where to put the stack at boot.

---
 arch/arm/mach-imx/include/mach/imx6-regs.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-imx/include/mach/imx6-regs.h +4 -0
index 39e2751533..4acbb9796b 100644
@@ -3,6 +3,10 @@
 #ifndef __MACH_IMX6_REGS_H
 #define __MACH_IMX6_REGS_H
 
+/* Set MAX_SIZE to 128K, only the Quad and Dual have 256K */
+#define MX6_OCRAM_BASE_ADDR		0x00900000
+#define MX6_OCRAM_MAX_SIZE		0x00100000
+
 #define MX6_APBH_BASE_ADDR		0x00110000
 #define MX6_GPMI_BASE_ADDR		0x00112000
 #define MX6_BCH_BASE_ADDR		0x00114000
Signature · 1 line
2.39.1
#1 lore raw

Hi John,

thanks for the patch.

Quoted 19 lines · John Watts

The i.MX6 includes some on-chip RAM: 128KiB on most variants, with 256KiB on the Dual and Quad variants.

This region is where the first stage of Barebox gets loaded if RAM initialization isn't hard coded using DCD information.

Add the base address and size so it can be used to calculate where to put the stack at boot.

---
 arch/arm/mach-imx/include/mach/imx6-regs.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-imx/include/mach/imx6-regs.h +0 -0
index 39e2751533..4acbb9796b 100644

arch/arm/mach-imx/include/mach/imx6-regs.h line 8

Quoted 6 lines
arch/arm/mach-imx/include/mach/imx6-regs.h +3 -0
@@ -3,6 +3,10 @@
 #ifndef __MACH_IMX6_REGS_H
 #define __MACH_IMX6_REGS_H
 
+/* Set MAX_SIZE to 128K, only the Quad and Dual have 256K */
+#define MX6_OCRAM_BASE_ADDR		0x00900000
+#define MX6_OCRAM_MAX_SIZE		0x00100000
					^

But this is not 128K instead it is 1M, therefore and for better readability can we please use the SZ_128K macro? :)

Regards,
Marco

author
#2 lore raw

PATCH v2 1/1 ARM: i.MX6: Specify OCRAM base address and size

In reply to John Watts

The i.MX6 includes some on-chip RAM: 128KiB on most variants, with 256KiB on the Dual and Quad variants.

This region is where the first stage of Barebox gets loaded if RAM initialization isn't hard coded using DCD information.

Add the base address and size so it can be used to calculate where to put the stack at boot.

---
Changes v1 -> v2:
- Fixed wrong size (thanks Marco!)

---
 arch/arm/mach-imx/include/mach/imx6-regs.h | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-imx/include/mach/imx6-regs.h +6 -0
index 39e2751533..89a3b267c6 100644
@@ -3,6 +3,12 @@
 #ifndef __MACH_IMX6_REGS_H
 #define __MACH_IMX6_REGS_H
 
+#include <linux/sizes.h>
+
+/* Set MAX_SIZE to 128K, only the Quad and Dual have 256K */
+#define MX6_OCRAM_BASE_ADDR		0x00900000
+#define MX6_OCRAM_MAX_SIZE		SZ_128K
+
 #define MX6_APBH_BASE_ADDR		0x00110000
 #define MX6_GPMI_BASE_ADDR		0x00112000
 #define MX6_BCH_BASE_ADDR		0x00114000
Signature · 1 line
2.39.1
Reviewed-by on v2 1/1
#3 lore raw

Hi John,

Quoted 10 lines · John Watts

The i.MX6 includes some on-chip RAM: 128KiB on most variants, with 256KiB on the Dual and Quad variants.

This region is where the first stage of Barebox gets loaded if RAM initialization isn't hard coded using DCD information.

Add the base address and size so it can be used to calculate where to put the stack at boot.

author
#4 lore raw
Quoted 9 lines · Marco Felsch

Hi John,

Quoted 6 lines · John Watts

The i.MX6 includes some on-chip RAM: 128KiB on most variants, with 256KiB on the Dual and Quad variants.

This region is where the first stage of Barebox gets loaded if RAM initialization isn't hard coded using DCD information.

Quoted 6 lines
Quoted 4 lines

Add the base address and size so it can be used to calculate where to put the stack at boot.

Do I add that to a V3? :)
Should I add the review stuff to my Novena patches too?

John.

#5 lore raw
Quoted 10 lines · John Watts
Quoted 9 lines · Marco Felsch

Hi John,

Quoted 6 lines · John Watts

The i.MX6 includes some on-chip RAM: 128KiB on most variants, with 256KiB on the Dual and Quad variants.

This region is where the first stage of Barebox gets loaded if RAM initialization isn't hard coded using DCD information.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Add the base address and size so it can be used to calculate where to put the stack at boot.

Do I add that to a V3? :)

No. I collect the Reviewed-by tags while applying. Or better, git b4 does this automatically for me ;)

Quoted 1 line

Should I add the review stuff to my Novena patches too?

Usually when sending a new series you add the tags you got from the previous one, but just adding tags is not a reason for resending.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
Applied
#6 lore raw
In reply to John Watts
Quoted 9 lines · John Watts

The i.MX6 includes some on-chip RAM: 128KiB on most variants, with 256KiB on the Dual and Quad variants.

This region is where the first stage of Barebox gets loaded if RAM initialization isn't hard coded using DCD information.

Add the base address and size so it can be used to calculate where to put the stack at boot.

Quoted 7 lines

---
Changes v1 -> v2:
- Fixed wrong size (thanks Marco!)

---
 arch/arm/mach-imx/include/mach/imx6-regs.h | 6 ++++++
 1 file changed, 6 insertions(+)

Applied, thanks

Sascha

Quoted 23 lines
arch/arm/mach-imx/include/mach/imx6-regs.h +6 -0
index 39e2751533..89a3b267c6 100644
@@ -3,6 +3,12 @@
 #ifndef __MACH_IMX6_REGS_H
 #define __MACH_IMX6_REGS_H
 
+#include <linux/sizes.h>
+
+/* Set MAX_SIZE to 128K, only the Quad and Dual have 256K */
+#define MX6_OCRAM_BASE_ADDR		0x00900000
+#define MX6_OCRAM_MAX_SIZE		SZ_128K
+
 #define MX6_APBH_BASE_ADDR		0x00110000
 #define MX6_GPMI_BASE_ADDR		0x00112000
 #define MX6_BCH_BASE_ADDR		0x00114000
Signature · 1 line
2.39.1
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |