summaryrefslogtreecommitdiffstats
path: root/arch/ppc/lib
Commit message (Collapse)AuthorAgeFilesLines
* ppc: bootm: Drop usage of data->oftreeSascha Hauer2018-06-151-18/+17
| | | | | | | The ppc bootm code uses data->oftree to store its private data pointers. Drop this and use a local variable instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ppc: bootm: remove unnecessary parameterSascha Hauer2018-06-151-4/+3
| | | | | | | bootm_relocate_fdt takes the os address as parameter, but this can be extracted from struct image_data, so drop the parameter. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ppc: bootm: rename variablesSascha Hauer2018-06-151-12/+14
| | | | | | | | In bootm_relocate_fdt 'addr' is used for two different purposes, once for the os address and once for the new fdt. Make the code more readable by using two variables describing their meaning, 'os' and 'newfdt'. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: Move bulk of boot.h to bootm.hSascha Hauer2016-07-261-0/+1
| | | | | | | | The majority of the stuff currently in include/boot.h is about bootm code implemented common/bootm.c. To be more consistent move it to a new file include/bootm.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: Push dryrun to handlersSascha Hauer2016-01-261-0/+3
| | | | | | | We can make the dryrun option more useful by calling into the handlers. With this we can detect more cases that can go wrong during boot. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* restart: replace reset_cpu with registered restart handlersSascha Hauer2015-08-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | This replaces the reset_cpu() function which every SoC or board must provide with registered handlers. This makes it possible to have multiple reset functions for boards which have multiple ways to reset the machine. Also boards which have no way at all to reset the machine no longer have to provide a dummy reset_cpu() function. The problem this solves is that some machines have external PMICs or similar to reset the system which have to be preferred over the internal SoC reset, because the PMIC can reset not only the SoC but also the external devices. To pick the right way to reset a machine each handler has a priority. The default priority is 100 and all currently existing restart handlers are registered with this priority. of_get_restart_priority() allows to retrieve the priority from the device tree which makes it possible for boards to give certain restart handlers a higher priority in order to use this one instead of the default one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* powerpc: include <linux/stringify.h> to avoid dupulicated definesMasahiro Yamada2015-01-131-3/+1
| | | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kbuild: move asm-offsets.h rule to ./KbuildMasahiro Yamada2015-01-081-0/+21
| | | | | | | | | | | | | | | Currently, MIPS is the only architecture that needs include/generated/asm-offsets.h, but we have got ./Kbuild file now. It is a good reason to move asm-offsets.h rule from arch/mips/Makefile to ./Kbuild and add dummy asm-offsets.c for the other architectures. asm-offsets.h would be useful for all the architectures. This commit does not implement include/generated/bounds.h, but if necessary, it is easy to implement it. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MPC85xx: fix memory layout to prevent corruption during memtestRenaud Barbier2014-03-031-5/+1
| | | | | | | | | | | | Memory regions on MPC85xx boards are incorrectly defined leading to corruption when running memory tests. This patch updates the memory layout of MPC85xx boards so that critical memory regions can be correctly reserved during the memory test. Tested on the P2020RDB and DA923RC. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: introduce bootm_load_os helperSascha Hauer2014-01-101-2/+4
| | | | | | | | | | The common bootm code used to load uImage contents to SDRAM before calling into the handlers if possible. This makes the handlers complicated since they have to handle many cases. Instead, introduce a helper to load the os after the handlers have figured out a good load address. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ppc: bootm: relocate fdt to valid boot memoryRenaud Barbier2013-09-091-1/+48
| | | | | | | | | | | | | | For the MPC85xx family of SOCs Linux expects any boot firmware information to be passed in the first 64MiB of memory. This adds support to ensure that the device tree is relocated to a valid location if it is outside that address range. For the other SOC family currently present in the ppc architecture, the default is not to relocate as at Linux startup the virtual address equals the physical address. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: Pass unflattened devicetree to handlersSascha Hauer2013-03-061-0/+8
| | | | | | | | | This makes it possible to modify the tree in the handlers. This is necessary because the initrd addresses are only known inside the handlers, but not to the generic bootm code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: fix format specifiersSascha Hauer2013-01-271-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-177-28/+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>
* Set _text_base to the firmware relocation addressRenaud Barbier2012-05-171-0/+4
| | | | | | | | | | _text_base assignment has been removed earlier from lib/board.c for the mpc5xxx. For the 85xx, _text_base is set to where the firmware relocates in memory as passed by the function input variable. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ppc reloc.S: use a common trap relocation functionRenaud Barbier2012-05-112-0/+48
| | | | | | | | | The trap relocation function trap_reloc can be used across several PPC platforms and is added to the ppc library. Accordingly, the definition of trap_reloc is removed from mach-mpc5xxx/start.S Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Preparation stage to support multiple PPC architecturesRenaud Barbier2012-05-022-75/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arch/ppc/Kconfig is reworked to make the configuration environment architecture neutral. All MPC5200 configuration is moved to the MPC5200 architecture specific configuration file. These modifications are reflected in the PCM030 board support. arch/ppc/Makefile compilation directives are updated in preparation for the introduction of future cpus/machines. lib/time.c is moved to the architecture specific directory and the building instructions updated in the Make files. The file is cleaned up of unused code. The definition of L1_CACHE_... is updated and CACHELINE_SIZE is defined in ppc/include/asm/cache.h for future use by the mpc85xx. The file mach-mpc5xxx/pci_mpc5200.c and mach-mpc5xxx/start.S are updated accordingly. The declaration of search_exception_table is moved in include/asm/common.h because it is used across architectures. mach-mpc5xxx/traps.c is also updated to reflect this change. The definition of exception in asm/ppc_asm.tmpl is updated for future use by the mpc85xx. The file starts.S in mach-mpc5xxx is updated accordingly. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ppc: remove unused init_board_data functionSascha Hauer2012-04-132-50/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'work/uimage' into nextSascha Hauer2011-12-171-9/+7
|\ | | | | | | | | | | | | | | | | Conflicts: arch/ppc/lib/ppclinux.c commands/bootm.c include/boot.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * bootm: use new uimage codeSascha Hauer2011-12-151-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches the bootm code to the new uimage code. Also bootm can now handle other types of images than uImages. Currently the only architecture making use of this is arm which allows to boot zImages, raw images and barebox images. I intended to make a more bisectable series from this but I failed becuase there are many dependencies and no matter how I tried the patches grew bigger and and bigger. So I decided to put this all in a single patch. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ppc: switch to libfdt based oftree implementationSascha Hauer2011-12-141-225/+6
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'pu/ppc-oftree' into nextSascha Hauer2011-12-151-225/+6
|\ \
| * | ppc: switch to libfdt based oftree implementationSascha Hauer2011-12-151-225/+6
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / remove unused watchdog headerSascha Hauer2011-12-153-3/+0
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fix malloc space sizesSascha Hauer2011-12-031-1/+1
| | | | | | end is start + size - 1, not start + size. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: push relocate_image up to the generic commandSascha Hauer2011-11-291-3/+0
| | | | | | | | | All handlers used to just relocate the image without any checks, so we are doomed if we write outside of SDRAM or will overwrite ourselves. Move the relocation up to the generic part where we have a chance of catching these issues. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove irq support fragmentsSascha Hauer2011-11-283-141/+0
| | | | | | | | We never had interrupt support in barebox and we have no plans to add interrupt support. Even if we do I doubt the current fragments of irq support are helpful, so remove them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ppc: hardcode sdram base to 0x0Sascha Hauer2011-09-271-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove EARLY_INIT and EARLY_CONSOLE supportSascha Hauer2011-09-271-3/+0
| | | | | | Bitrotted over time and nearly unused, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename include/mem_malloc.h to include/memory.hSascha Hauer2011-09-231-1/+1
| | | | | | | Which is a better name and also better to collect other things. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove unused global_data.hSascha Hauer2011-08-011-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* barebox compilation with gcc 4.5.2 and ptxdistAndre Naujoks2011-07-281-0/+14
| | | | | | | | | From 9b3985045da1161a934cba48749fe1759e62dae6 Mon Sep 17 00:00:00 2001 From: Andre Naujoks <nautsch2@googlemail.com> Date: Wed, 27 Jul 2011 11:29:43 +0200 Subject: [PATCH 2/2] Ported ppc ashrdi3 from linux kernel Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* barebox compilation with gcc 4.5.2 and ptxdistAndre Naujoks2011-07-282-0/+240
| | | | | | | | | From c479527616c5fc79c608e21573373a5a324f6e9b Mon Sep 17 00:00:00 2001 From: Andre Naujoks <nautsch2@googlemail.com> Date: Wed, 27 Jul 2011 11:28:35 +0200 Subject: [PATCH 1/2] Ported crtsavres from linux kernel to barebox Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ppc: fix printf compiler warningsSascha Hauer2011-01-071-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: switch mask to CLOCKSOURCE_MASKJean-Christophe PLAGNIOL-VILLARD2010-11-291-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove strange flush_cache functionsSascha Hauer2010-10-212-51/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: remove confusing image_check_* functionsSascha Hauer2010-10-131-1/+1
| | | | | | | | | | | The function names do not make it clear what return value is expected and do not save a single line of code. Put the code inline and unbreak the wrong checks introduced with a3c1e5d888d0ee317ffc7635694684bb71213c9c. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Eric BĂ©nard <eric@eukrea.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Replace direct header access with the API routinesJean-Christophe PLAGNIOL-VILLARD2010-10-081-3/+3
| | | | | | Copied from U-Boot Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Revert "Replace direct header access with the API routines"Sascha Hauer2010-10-071-3/+3
| | | | | | | | | | This reverts commit 0ceafe14be072696eff3e549d8c7b7de8a3e416d. Conflicts: include/image.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Replace direct header access with the API routinesJean-Christophe PLAGNIOL-VILLARD2010-09-241-3/+3
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-153-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* [PPC] Move include/asm-ppc/arch-* to arch/ppc/*/include/machJean-Christophe PLAGNIOL-VILLARD2009-10-221-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* remove SHOW_BOOT_PROGRESSSascha Hauer2009-03-192-14/+0
| | | | | | Though useful it is currently unsued and broken. Should be reimplemented Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fix compiler warningSascha Hauer2008-08-131-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* [memory layout]: streamline memory layoutSascha Hauer2008-06-041-1/+2
| | | | | | | Memory layout can now be specified via kconfig options. Two possibilities exist: default layout means the layout is stack / malloc heap / U-Boot. The user can also specify fixed addresses for each TEXT_BASE / stack / malloc heap.
* [ppc] Fixed orphaned CONFIG_INTERRUPTSCarsten Schlote2008-02-212-2/+2
| | | | | | Changed CONFIG to CONFIG_USE_IRQ Signed-off-by: Carsten Schlote <c.schlote@konzeptpark.de>
* - Add functions to register image handlers for booting uImagesSascha Hauer2008-02-201-17/+29
|
* CONFIG_MODULE -> CONFIG_MODULESSascha Hauer2007-10-041-1/+1
|
* fix read_file()Sascha Hauer2007-10-011-1/+1
|
* add powerpc specific bits for modulesSascha Hauer2007-10-012-0/+298
|