Difference between revisions of "Memory organization (Naon)"

From DAVE Developer's Wiki
Jump to: navigation, search
(SPI NOR Flash)
(NAND Flash)
(18 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
{{InfoBoxTop}}
 
{{InfoBoxTop}}
 
{{AppliesToNaon}}
 
{{AppliesToNaon}}
{{Applies To Maya}}
 
{{AppliesToDido}}
 
 
{{InfoBoxBottom}}
 
{{InfoBoxBottom}}
  
== Introduction ==
+
=== Introduction ===
Naon memory organization and mapping is quite complex, due to DM8148's multiprocessor nature and the availability of several memory devices connected to the processor. This section will provide an overview of such architecture while following sections will describe in more detail memory map for each device. Please refer to [[:Category:Naon|Naon block diagram]].
 
  
About system RAM, DM8148 provides two controllers. Each one can be interfaced to one SDRAM bank through a physical interface called EMIF (EMIF0 and EMIF1). EMIF0 is connected to 32-bit DDR2 SDRAM bank (up to 512 MByte). EMIF1 is not connected to any device, hence is permanently disabled.
+
Memory Map for Naon Module is quite complex, due it's multiprocessor nature.
  
About non-volatile memories, the following devices populate Naon module:
+
Before start reading regarding memory map in details, please take a look at generic [http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map EZSDK Memory Map] on Texas Instruments Wiki.
* SPI NOR flash
 
** connected to SPI0 port
 
** by default acts as boot memory
 
** maximum size: up to 64 MByte
 
* NAND flash
 
** connected to GPMC bus (CS0n)
 
** optionally can act as boot memory
 
* EEPROM
 
** connected to I2C3 bus.
 
  
==NELK memory maps==
 
This section describes in detail default memories mapping configuration used in Naon Embedded Linux Kit.
 
 
=== RAM Memory Map ===
 
=== RAM Memory Map ===
Before start reading memory map in detail, please take a look at generic [http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map EZSDK Memory Map] on Texas Instruments Wiki.
 
  
RAM memory map is the most complex part of this architecture, because the user should allocate the different area used by Cortex-A8 processor (which runs the [[:Category:Linux|Linux]] OS), the two media controllers (Cortex-M3, that take care of the whole video processing subsystem) and DSP.
+
RAM memory map is the most complex part of this architecture, because the user should allocate the different area used by Cortex-A8 processor (which runs the [[:Category:Linux|Linux]] OS), the two media controller (Cortex-M3, that take care of the whole video processing subsystem) and DSP.
  
 
This memory map is statically defined in various places, so the user has a limited options in changing this. Anyway it's useful to know how this memory is shared between the various processors to develop correctly the end-user multimedia application and to know exactly how much memory a processor can use.
 
This memory map is statically defined in various places, so the user has a limited options in changing this. Anyway it's useful to know how this memory is shared between the various processors to develop correctly the end-user multimedia application and to know exactly how much memory a processor can use.
  
Please download the [http://www.dave.eu/reserved-area NAON-Memory-Map.ods] spreadsheet to view the memory map. The region are named exactly as in [http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map EZSDK Memory Map]
+
Please download the [[File:NELK Memory Map.zip|NELK Memory Map]] spreadsheet to view the memory map. The region are named exactly as in [http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map EZSDK Memory Map]
 
 
{{Board Specific Information|text=Memory map spreadsheet also include non-volatile memory mapping: it also ease resize operation of those memories}}
 
  
 
=== Non-Volatile Memory Map ===
 
=== Non-Volatile Memory Map ===
Line 39: Line 22:
 
Due the fact that different memory size are available on request on Naon SOM, we will review here only the default memory size. Anyway, the beginning of each memory is the same for all of them due boot system restrictions.
 
Due the fact that different memory size are available on request on Naon SOM, we will review here only the default memory size. Anyway, the beginning of each memory is the same for all of them due boot system restrictions.
  
Each section correspond to a [[:Category:Linux|Linux]] [[wikipedia:Memory Technology Device|MTD]] partition. User can change partition at runtime or by statically by changing Kernel sources. See [[Memory Tecnology Device (MTD)]] for more detail regarding this topic.
+
Each section correspond to a [[:Category:Linux|Linux]] MTD partition. User can change partition at runtime or by statically by changing Kernel sources. See [[MTD Partition]] for more detail regarding this topic.
  
 
==== SPI NOR Flash ====
 
==== SPI NOR Flash ====
Line 75: Line 58:
 
|-
 
|-
 
|80000
 
|80000
|4096
+
|3072
|400000
+
|300000
 
|Linux Kernel
 
|Linux Kernel
 
|-
 
|-
|480000
+
|380000
|28160
+
|5120
|1B80000
+
|500000
 
|FREE
 
|FREE
 
|}
 
|}
Line 87: Line 70:
 
The last section is Free for use by the user (e.g. for a ramdisk, a redundant Kernel image or generic storage).
 
The last section is Free for use by the user (e.g. for a ramdisk, a redundant Kernel image or generic storage).
  
{{Board Specific Information|text=Redundant environment for SPI NOR flash not yet available}}
+
{{Board Specific Information|text=Redundant environment for SPI NOR flash is available on request}}
  
 
==== NAND Flash ====
 
==== NAND Flash ====
Line 100: Line 83:
 
|-
 
|-
 
|0
 
|0
|0,125
+
|0,25
|20000
+
|40000
 
|U-boot 1st stage
 
|U-boot 1st stage
 
|-
 
|-
|20000
+
|40000
 
|0,25
 
|0,25
 
|40000
 
|40000
 
|U-boot 2nd stage
 
|U-boot 2nd stage
 
|-
 
|-
|60000
+
|80000
|0,125
+
|0,25
|20000
+
|40000
 
|U-Boot env1
 
|U-Boot env1
 
|-
 
|-
|50000
+
|C0000
|0,125
+
|0,25
|20000
+
|40000
 
|U-boot env2
 
|U-boot env2
 
|-
 
|-
|A0000
+
|100000
|4
+
|2,5
|400000
+
|280000
 
|Linux Kernel
 
|Linux Kernel
 
|-
 
|-
|4A0000
+
|380000
|123,375
+
|127
|7B60000
+
|7F00000
 
|File System (small)
 
|File System (small)
 
|-
 
|-
|8000000
+
|8280000
 
|896
 
|896
 
|38000000
 
|38000000
 
|File System (big)
 
|File System (big)
 
|}
 
|}
 
=== Kernel Command Line parameters ===
 
 
Some parameters should be passed to the Linux kernel via command line. Here is a brief explanation of them and their an example of use (taken from the current default memory map):
 
 
* <code>mem=xxxM</code> set the maximum memory given to Linux kernel. In this way the kernel does not use all the memory found and leave memory for Cortex-M3. E.g. <code>mem=176M</code>. In the Naon Memory Map is called ''LINUX_MEM_1''.
 
* <code>vram=xxxM</code> set the size of memory reserved for video ram (framebuffers). E.g <code>vram=46M</code>. See the [[Memory organization (Naon)#Change_FB_size|Change FB size]] section below.
 
* <code>notifyk.vpssm3_sva=address</code> address of notify memory for HDVPSS. E.g <code>notifyk.vpssm3_sva=0xBF900000</code>In the Naon Memory Map is called ''HDVPSS_NOTIFY_MEM''
 
 
Always refer to the Naon Memory Map for the correct value to use.
 
  
 
=== User Options ===
 
=== User Options ===
  
Without rebuilding Media Controller Firmware (which needs NDA from TI or '''DAVE Embedded Systems''' support) user can change some memory map parameter on the fly.
+
Without rebuilding Media Controller Firmware (which needs NDA from TI or Dave support) user can change some memory map parameter on the fly.
  
 
==== Change FB size ====
 
==== Change FB size ====
  
Current NELK support up to 3 Frame Buffers. See [[Frame Buffer Management -Naon-]] for more information regarding NELK Frame Buffers.
+
Current LELK support up to 3 Frame Buffers. See [[Frame Buffer Management -Naon-]] for more information regarding NELK Frame Buffers.
  
 
User can choose how much of Linux kernel memory give to the frame buffer driver and how to divide this memory into the 3 available frame buffer.
 
User can choose how much of Linux kernel memory give to the frame buffer driver and how to divide this memory into the 3 available frame buffer.
Line 160: Line 133:
  
 
E.g. to use 46MiB of RAM for 3 frame buffer, divided in 24MiB for fb0, 16MiB for fb1 and 6MiB for fb2, use:
 
E.g. to use 46MiB of RAM for 3 frame buffer, divided in 24MiB for fb0, 16MiB for fb1 and 6MiB for fb2, use:
* <code>vram=46M</code> as command line parameter
+
* <code>vmem=46M</code> as command line parameter
 
* <code>modprobe ti81xxfb vram=0:24M,1:16M,2:6M</code> command to load fb module
 
* <code>modprobe ti81xxfb vram=0:24M,1:16M,2:6M</code> command to load fb module
  
 
User that needs more Linux user space memory and needs only one frame buffer, can, for example, use 6MiB of RAM used only by the first FB, so:
 
User that needs more Linux user space memory and needs only one frame buffer, can, for example, use 6MiB of RAM used only by the first FB, so:
* <code>vram=6M</code> as command line parameter
+
* <code>vmem=6M</code> as command line parameter
 
* <code>modprobe ti81xxfb vram=0:6M</code> command to load fb module
 
* <code>modprobe ti81xxfb vram=0:6M</code> command to load fb module
  
 
Please note that <code>ti81xxfb</code> is usually loaded at startup from <code>/etc/init.d/load-hd-firmware.sh</code>: user that would like to change the default configuration should change this file.
 
Please note that <code>ti81xxfb</code> is usually loaded at startup from <code>/etc/init.d/load-hd-firmware.sh</code>: user that would like to change the default configuration should change this file.

Revision as of 13:23, 2 May 2012

Info Box
Naon am387x-dm814x.png Applies to Naon

Introduction[edit | edit source]

Memory Map for Naon Module is quite complex, due it's multiprocessor nature.

Before start reading regarding memory map in details, please take a look at generic EZSDK Memory Map on Texas Instruments Wiki.

RAM Memory Map[edit | edit source]

RAM memory map is the most complex part of this architecture, because the user should allocate the different area used by Cortex-A8 processor (which runs the Linux OS), the two media controller (Cortex-M3, that take care of the whole video processing subsystem) and DSP.

This memory map is statically defined in various places, so the user has a limited options in changing this. Anyway it's useful to know how this memory is shared between the various processors to develop correctly the end-user multimedia application and to know exactly how much memory a processor can use.

Please download the NELK Memory Map spreadsheet to view the memory map. The region are named exactly as in EZSDK Memory Map

Non-Volatile Memory Map[edit | edit source]

Due the fact that different memory size are available on request on Naon SOM, we will review here only the default memory size. Anyway, the beginning of each memory is the same for all of them due boot system restrictions.

Each section correspond to a Linux MTD partition. User can change partition at runtime or by statically by changing Kernel sources. See MTD Partition for more detail regarding this topic.

SPI NOR Flash[edit | edit source]

SPI NOR Flash is the main boot memory, where available, for Naon module. Due the fact that SPI NOR is a non-XIP memory, Naon uses two-stage U-Boot for booting.

Here is the layout of the default 8MiB memory:

Base Address (HEX) Size (KiB) Size (HEX) Usage
0 128 20000 U-boot 1st stage
20000 256 40000 U-boot 2nd stage
60000 64 10000 U-boot env1
70000 64 10000 U-boot env2
80000 3072 300000 Linux Kernel
380000 5120 500000 FREE

The last section is Free for use by the user (e.g. for a ramdisk, a redundant Kernel image or generic storage).


Info-icon.png Redundant environment for SPI NOR flash is available on request Info-icon.png

NAND Flash[edit | edit source]

Nand Flash is the main storage memory, even if can be used for boot too. By default Naon is provided with 1GiB Nand but other memory size is available on request. The default Nand partitioning is detailed in the following table:

Base Address (HEX) Size (MiB) Size (HEX) Usage
0 0,25 40000 U-boot 1st stage
40000 0,25 40000 U-boot 2nd stage
80000 0,25 40000 U-Boot env1
C0000 0,25 40000 U-boot env2
100000 2,5 280000 Linux Kernel
380000 127 7F00000 File System (small)
8280000 896 38000000 File System (big)

User Options[edit | edit source]

Without rebuilding Media Controller Firmware (which needs NDA from TI or Dave support) user can change some memory map parameter on the fly.

Change FB size[edit | edit source]

Current LELK support up to 3 Frame Buffers. See Frame Buffer Management -Naon- for more information regarding NELK Frame Buffers.

User can choose how much of Linux kernel memory give to the frame buffer driver and how to divide this memory into the 3 available frame buffer.

The amount of memory that the kernel reserve to the FB is given by the vram command line parameter. For more information in how to change kernel command like parameter see Change Linux Command Line Parameter from U-boot

The amount of memory given away to each frame buffer is described by vram ti81xxfb's module parameter.

E.g. to use 46MiB of RAM for 3 frame buffer, divided in 24MiB for fb0, 16MiB for fb1 and 6MiB for fb2, use:

  • vmem=46M as command line parameter
  • modprobe ti81xxfb vram=0:24M,1:16M,2:6M command to load fb module

User that needs more Linux user space memory and needs only one frame buffer, can, for example, use 6MiB of RAM used only by the first FB, so:

  • vmem=6M as command line parameter
  • modprobe ti81xxfb vram=0:6M command to load fb module

Please note that ti81xxfb is usually loaded at startup from /etc/init.d/load-hd-firmware.sh: user that would like to change the default configuration should change this file.