summaryrefslogtreecommitdiffstats
path: root/common/memory.c
Commit message (Collapse)AuthorAgeFilesLines
* memory: of_fixup: adapt to new memory layoutMarco Felsch2019-02-121-18/+57
| | | | | | | | | | | | | | | Since kernel 4.16 the memory nodes got a @<reg> suffix so the fixup won't work correctly anymore, because instead of adapting the extisting one the fixup creates a new node and keeps the old (maybe incorrect) node. To be compatible with the old and new layout delete the found memory node and create a new one. The new node follows the new @<reg> style. The patch also renames the node parameter to make it clearer. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: Add functions to find free RAMSascha Hauer2018-04-041-0/+51
| | | | | | | The bootm code needs to put the Kernel image and initrd into free RAM. Add some functions to find free RAM chunks to help this code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Use of_property_write_string() where appropriateSascha Hauer2017-03-301-1/+1
| | | | | | | Replace users which use of_set_property() to set a property to a string with of_property_write_string(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: move x86 efi boot support to x86 archJean-Christophe PLAGNIOL-VILLARD2017-02-271-1/+1
| | | | | | | prepare to drop the efi arch as efi boot up is not arch sepecific Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* malloc: Add a function to detect if malloc pool is already initializedSascha Hauer2015-01-051-0/+8
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let request_iomem_region return an error pointerSascha Hauer2014-09-161-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let __request_region return an error pointerSascha Hauer2014-09-161-1/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add initial EFI architecture supportSascha Hauer2014-07-161-1/+1
| | | | | | | This adds support for running barebox in an EFI environment on X86 PC hardware. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: Allow for I/O mapped I/OMichel Stam2014-04-081-1/+2
| | | | | | | | Rework the current framework so that I/O mapped I/O resources are also possible. Signed-off-by: Michel Stam <michel@reverze.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: Add a context pointer to fixup functionsSascha Hauer2013-11-061-2/+2
| | | | | | | If drivers want to fixup their specific instance they need some context to know which instance they have to fixup. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: remove unused libfdtSascha Hauer2013-03-061-1/+0
| | | | | | | Now that we are completely independent of libfdt remove the unused code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: memory: Use of_write_numberSascha Hauer2013-03-061-19/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: fixup unflattened devicetreeSascha Hauer2013-03-061-34/+14
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* barebox-data: add barebox-data sectionsAlexander Aring2013-01-181-0/+4
| | | | | | | | Add barebox-data section in arm branch to get complete barebox regions in sdram regions tree. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memory: fix size address calculationAlexander Aring2013-01-141-2/+2
| | | | | | | | | | | | | | | | | | | Fix size address calculation. Global variables from <asm/sections.h> which are defined in linker script *.lds files for end addresses has already a +1 calculation. For example: stext = 0x100 with a size about 0x50 will result a etext = 0x150. In this case a correct size calculation is (etext - stext) = 0x50. In function 'request_sdram_region' the end address will be calculated with (start + size - 1) which result a correct end address of 0x149 in this example. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memory: return error in barebox_add_memory_bankSascha Hauer2012-10-081-3/+5
| | | | | | | | When a memory bank is already registered, return an error code instead of throwing a bug. This can happen if a board has registered a memory bank and the same bank is then probed from the devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: store 'end' instead of 'size' in struct resourceSascha Hauer2012-07-011-2/+2
| | | | | | | | | | Storing the size instead of the resource end in struct resource was a mistake. 'size' ranges from 0 to UINT[32|64]_MAX + 1 which obviously leads to problems. 'end' on the other hand will never exceed UINT[32|64]_MAX. Also this way we can express a iomem region covering the whole address space. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: memory: fix off-by-one in tlsf_createMarc Kleine-Budde2012-04-241-1/+1
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add tlsf-based malloc implementationAntony Pavlov2011-12-231-0/+8
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fix "no previous prototype for 'sbrk'" warningAntony Pavlov2011-12-091-0/+1
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memory: do not try to reserve iomem on sandboxSascha Hauer2011-12-071-1/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* register sdram as resourcesSascha Hauer2011-12-041-0/+58
| | | | | | | Also, request the sdram regions used by the barebox binary, bss, malloc space and stack. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* oftree: add fixup for memory nodesSascha Hauer2011-10-191-0/+80
| | | | | | | | Thanks to a common memory handling barebox knows the sdram banks and sizes, so we can add a common fixup functions for the nodes in the devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce generic memory bank handlingSascha Hauer2011-09-231-0/+18
| | | | | | | | | On arm we have the concept of memory banks which can be registered and iterated over. This is useful for other architectures aswell, so add some generic infrastructure for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* malloc: put common memory functions to seperate fileSascha Hauer2011-04-111-0/+71
These functions are needed independently of the specific malloc implementation, so move them out. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>