summaryrefslogtreecommitdiff
path: root/platform
AgeCommit message (Collapse)Author
2018-08-30store .data section directly in RAM areaStefan Agner
Since the use of a elf binary is anyway required, we can place sections freely in memory. Therefor it is not necessary to store the variable initialization section (.data) after the code (.text) section and copy it in the firmwares startup code. Instead, just let the elf loader load the .data section directly to its final place. With that the program header look like this: Program Header: LOAD off 0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12 filesz 0x00000240 memsz 0x00000240 flags r-- LOAD off 0x00002000 vaddr 0x1fff8000 paddr 0x1fff8000 align 2**12 filesz 0x00006534 memsz 0x00006534 flags rwx LOAD off 0x00009000 vaddr 0x20000000 paddr 0x20000000 align 2**12 filesz 0x000001d0 memsz 0x00005dc8 flags rw- Note the additional program header which loads the .data section directly to the data region at 0x20000000. This safes space in the code region and slightly improves the startup time since the copy loop is not required. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-05-22MCIMX7D_M4_ddr: add symbols for memory areaStefan Agner
Add symbols which define the DDR memory area. This is useful to setup the RDC memory region mapping. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-05-22rdc: add macros for memory alignmentStefan Agner
Add helper macros which allow to align memory for RDC memory region mappings. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-05-16restore stackpointer in vector tableStefan Agner
When using the elf file format the vector table gets linked directly to 0x0 (0x180000 for data bus/A7 bus). U-Boots bootaux command tries to be helpful and writes the start address to that location (since this was necessary for binary files which have a relocated vector table). This is not usually a problem, since we restore the stack pointer imeaditly at the beginning. However, the FreeRTOS port code relies on a complete vector table (see prvPortStartFirstTask in Source/portable/GCC/ARM_CM4F/port.c). This needs to be fixed in U-Boot: U-Boot should not write into the vector table if it is provided by the elf binary. For now, work around by restoring the stack pointer entry in the vector table in the firmware startup code. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-05-16use OCRAM_S for interrupt vectors by defaultStefan Agner
The Cortex-M4 core starts executing at 0x00000000, which is OCRAM_S. So far the bootloader (bootaux) copied the reset vector and the initial stack pointer to that location, however, this does not work well when using debuggers. Also, newer U-Boot support elf loading, which allow to load the reset vector directly to the right location. It also safes some bytes in the area where the firmware is stored. This basically mandantes to use elf files since bin firmware files can not be sparse... Hence disable building bin files by default. Preserve the old linker files with _bin extension in case bin files are still preferred. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-05-12unify linker scriptsStefan Agner
The section definitions of all linker scripts is actually the same, unify them and use INCLUDE. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-05-03startup: initialize stack pointer in startup codeStefan Agner
Initialize stack pointer in startup code. This fixes issues when loading the firmware with loading mechanism which do not setup the stack pointer correctly (e.g. Toradex U-Boot 2016.11 with elf file format). Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-12-02increase and move location of memory in OCRAM linker fileStefan Agner
Move the memory (m_data) area in the OCRAM linker file to the EPDC OCRAM area. Also use the code bus for the code area instead of the system bus which should improve performance. This allows firmware of up to ~64KiB and memory of 128KiB. Note: To get more heap space in FreeRTOS configTOTAL_HEAP_SIZE in FreeRTOSConfig.h needs to be adjusted as well. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-11-25increase memory in DDR linker fileStefan Agner
Increase the memory (m_data) area in the DDR linker file. Also use the code bus for the code area instead of the system bus. This aligns with the _tcm.ld file and should improve performance. Note: To get more heap space in FreeRTOS configTOTAL_HEAP_SIZE in FreeRTOSConfig.h needs to be adjusted as well. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-11-10adjust DDR locations to be at the end of 256MiB boundaryStefan Agner
The linker file to build a firmware running from DDR memory (MCIMX7D_M4_ddr.ld) currently puts the firmware at the end of the 512MiB boundary. That is not a valid memory area for the Colibri iMX7S module (which comes with 256MiB of DDR memory). In practise it actually does work because out-of-bound addresses usually just mirror the content of the lower address, but it is a behavior which should not be relied upon. This change moves the firmware location to a valid location for all our modules at the end of the 256MiB boundary (0x8ff00000, allows for a firmware up to ~960kiB). Furthermore, the VirtIO VRING offset is currently at the end of the 1024MiB boundary. Again, due to the mirroring behavior this worked in practise, but it should not be relied upon. Hence move the VRING to the end of the 256MiB boundary too (0x8fff0000). The firmware size has been choosen so that the VRING just fits after the firmware. Note that since the VRING offsets are hardcoded, this change needs a corresponding change in the Linux kernel source: arch/arm/mach-imx/imx_rpmsg.c (function imx_rpmsg_probe) Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2016-08-09resync with FreeRTOS_iMX7D_1.0.1 GAColibri_iMX7_M4_FreeRTOS_V1.0.1_20160810Stefan Agner
2016-05-09resync with FreeRTOS_BSP_1.0.1_iMX7DStefan Agner
2016-02-02Minor fix.HEADColibri_iMX7_M4_FreeRTOS_V1.0.0_20160210masterWojciech Strozynski
2016-02-02Added new linker script - ocramWojciech Strozynski
2016-01-22[#5806] Added CCM gates for PWMsWojciech Strozynski
2016-01-12platform: debug_console_imx: add modem mode supportStefan Agner
Add mode parameter which allows to select DCE/DTE mode of the debug UART.
2016-01-12drivers: uart_imx: fix modem modeStefan Agner
Fix assertion in modem mode to allow using DTE mode.
2016-01-12initial commit, FreeRTOS_BSP_1.0.0_iMX7DStefan Agner