Skip to content

Commit

Permalink
dts: arm: nxp: rt106x: Unified OCRAM node
Browse files Browse the repository at this point in the history
The iMX RT1060 and RT1064 have additional dedicated 512KB on-chip ram.
This OCRAM2 is mapped at 0x20200000, formerly OCRAM1 (flexram) mapping
which is moved to 0x20280000 in order to guarentee global OCRAM memory
continuity regardless OCRAM1 size configuration (256KB by default).

In default configuration, this gives 768KB (512+256) on-chip ram:
0x20200000 to 0x202BFFFF.

OCRAM2:           0x20200000 - 0x2027FFFF
OCRAM1(FlexRam):  0x2028FFFF - 0x202BFFFF

Add this memory region as a single node in the rt1060 device tree.

Note: MPU expects power of two memory region, in case of 768KB, let
the MPU configure 1MB instead.

Signed-off-by: Loic Poulain <[email protected]>
  • Loading branch information
Loic Poulain authored and galak committed Mar 15, 2019
1 parent b8c1a0f commit 116dd8e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 9 additions & 7 deletions dts/arm/nxp/nxp_rt1060.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@

#include <nxp/nxp_rt.dtsi>

/ {
soc {
ocram1: ocram@20280000 {
compatible = "mmio-sram";
reg = <0x20280000 0x80000>;
};
};
/* i.MX rt1060 has two continuous on-chip RAM, one is part of the
* FlexRAM mapped at 0x20280000 (vs 0x20280000 on rt1050) and is
* configurable (256KB by defaults), the other one is dedicated 512KB
* ram (OCRAM2) mapped at 0x20200000. In order to have a continuous
* region, we describe them in one 768Kb unique node.
*/
&ocram0 {
compatible = "mmio-sram";
reg = <0x20200000 0xC0000>;
};
4 changes: 4 additions & 0 deletions soc/arm/nxp_imx/rt/arm_mpu_mem_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
#define REGION_SRAM_0_SIZE REGION_128K
#elif CONFIG_SRAM_SIZE == 256
#define REGION_SRAM_0_SIZE REGION_256K
#elif CONFIG_SRAM_SIZE == 512
#define REGION_SRAM_0_SIZE REGION_512K
#elif CONFIG_SRAM_SIZE == 768
#define REGION_SRAM_0_SIZE REGION_1M /* MPU expects power of two size */
#elif CONFIG_SRAM_SIZE == 32768
#define REGION_SRAM_0_SIZE REGION_32M
#else
Expand Down

0 comments on commit 116dd8e

Please sign in to comment.