summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap/omap_generic.c
Commit message (Collapse)AuthorAgeFilesLines
* default environment: make string arguments constSascha Hauer2024-02-201-0/+1
| | | | | | | | | | | | | Change default_environment_path_set() to take a const char * and let default_environment_path_get() return a const char *. Also, do not keep a copy of the string passed to default_environment_path_set() rather than the original string to make it more clear where the path is allocated. This allows us to free the string passed to default_environment_path_set() after usage by some callers. Link: https://lore.barebox.org/20240219105507.1618465-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: omap: Make multi-arch safeSascha Hauer2023-03-071-1/+7
| | | | | | Make sure the initcalls do not execute on foreign SoCs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: omap: Move mach header files to include/mach/omapSascha Hauer2023-03-061-8/+8
| | | | | | | | | | Currently arch specific headers can be included with longer possible as there won't be a single mach anymore. Move all omap specific header files to include/mach/omap/ to prepare for multi-arch support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: OMAP: Rework watchdog codeAlexander Shiyan2022-06-141-0/+18
| | | | | | | | | | This patch introduces the omap_watchdog_disable() function, since the WDT core is the same for different OMAP variants, it can be used for all supported SOCs. Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Link: https://lore.barebox.org/20220609091946.20028-1-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: omap: Fix error printingSascha Hauer2017-06-271-2/+2
| | | | | | | | | Presumably the code wanted to print the error with the %d format specifier. Actually pass the error code by using PTR_ERR() and not IS_ERR(). While at it use %ld to print a unsigned long variable to get rid of a compiler warning. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: mach-omap: Change mountpoint of boot partitionsDaniel Schultz2017-05-171-11/+25
| | | | | | | | | | | | If using EMMC and SD as bootsources, mounting the boot partition of both devices to /boot makes trouble. Either the correct device is mounted to /boot or a remount of /boot has to be performed. To ensure this problem each MMCn bootsource will be mounted to his own path in /mnt/mmcN.0 Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: Move bulk of boot.h to bootm.hSascha Hauer2016-07-261-1/+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>
* string: Fix (v)asprintf prototypesSascha Hauer2016-04-151-1/+1
| | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: Push dryrun to handlersSascha Hauer2016-01-261-0/+5
| | | | | | | 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>
* ARM: omap: Use correct device to mount on /bootSascha Hauer2015-11-101-14/+7
| | | | | | | | | | | | | | | The current code tests if a partition (i.e. disk0.0) exists and instead of mounting boot from this partition it uses the whole device (disk0). This only works because the the FAT code accepts a MBR as input and automatically skips it. Let the code use the partition to mount /boot instead as it was intended. We don't have to stat() the partition device, since this error will be caught by mount() anyway, so remove the unnecessary stat(). Reported-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* omap socfpga: Switch in flash env loading to use different configTrent Piepho2015-11-051-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | On these systems, the base arch has code to load the in flash environment from a file located in a FAT filesystem. This was controlled by the config option DEFAULT_ENVIRONMENT. However, that option turns on compiling the env into the barebox binary itself, as a backup if the in flash env can't be loaded. Most other boards have in flash env support unconditionally. But omap and socfpga also have xloader configurations, which aren't supposed to have environment support, either in flash or compiled in. If the in flash env code were unconditional, then the xloaders would gain it. So the code depends on ENV_HANDLING, which is only set on those boards that are supposed to have an in flash env and not set on all the boards that aren't supposed to have it. If someone wanted to create a board that did have a saved env, but used an alternate to this generic omap/socfpga file in FAT method, then they'd probably want to create a new config option to control this code and have it not be enabled for their board. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* restart: replace reset_cpu with registered restart handlersSascha Hauer2015-08-271-11/+0
| | | | | | | | | | | | | | | | | | | | | | 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>
* move file helper functions to separate fileSascha Hauer2014-08-071-0/+1
| | | | | | | | | | We have our file helper functions in several places. Move them all to lib/libfile.c. With this we no longer have file helpers in fs/fs.c which contains the core fs functions and no functions in lib/libbb.c which are not from busybox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mount: support filesystem options passed via -oUwe Kleine-König2014-02-101-1/+1
| | | | | | | | | | | Similar to mount(8) the barebox command mount now supports passing a string to the file system driver via -o. This is used in the next commit to let the user specify port numbers for nfs mounts. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* environment: Use accessor functions for default environment pathSascha Hauer2014-01-271-1/+1
| | | | | | | | | default_environment_path only exists when CONFIG_ENV_HANDLING is enabled. Boards would have to #ifdef this if they wanted to use default_environment_path. Use accessor functions instead which can be ifdeffed on a single place. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: OMAP: Safe boot info in fixed SRAM addressSascha Hauer2013-12-101-4/+13
| | | | | | | | | | | | | Storing the boot information in the image itself and passing a pointer around between images is cumbersome and doesn't fit well with multiimage support where the pointer we pass around is already occupied by the devicetree. Do the same as U-Boot does and store the boot information at the bottom of the SRAM public stack. To maintain the compatibility between new xloaders and older barebox binaries we still pass the boot information to the next stage via pointer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: OMAP: centralize omap startupSascha Hauer2013-11-221-0/+52
| | | | | | | | | This introduces a single omap_init function which detects the SoC and does all further SoC initialization. This is done to get rid of initcalls without proper SoC protection. The same has been done for i.MX already. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: OMAP: Make cpu_is_* macros runtime if necessarySascha Hauer2013-11-221-4/+7
| | | | | | | Currently unused, just preparation for the next steps when we'll get multiarch support for OMAP. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: OMAP: select correct reset_cpu function at runtimeSascha Hauer2013-11-221-0/+14
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: OMAP: unconditionally use /boot/barebox.envSascha Hauer2013-09-271-4/+1
| | | | | | | The startup process falls back to /dev/defaultenv automatically, no need to decide here. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: OMAP: register OMAP specific barebox bootm handlerSascha Hauer2013-09-271-0/+54
| | | | | | | | | The OMAP ROM code passes the boot information via r0 to the bootloader. Add an OMAP specific barebox handler to pass this information to the next stage. This allows us to chainload bootloaders without loosing the information where we booted from. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: OMAP: Add missing includeSascha Hauer2013-09-271-3/+5
| | | | | | | | Include mach/generic.h where omap_set_bootmmc_devname is declared. Change the argument of omap_set_bootmmc_devname to const char * to fix the resulting conflicting prototypes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: omap: Allow to set mmc devname used for bootingSascha Hauer2013-08-271-3/+28
| | | | | | | | | | | This adds a omap_set_bootmmc_devname function which can be used to specify the MMC boot device. In an xload configuration this is then used to load the next stage. In a regular build this is used to mount /boot. Also a device_detect_by_name is added to allow to disable probing for sd/mmc cards during startup. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* omap: move to common bootsource frameworkJan Luebbe2013-04-181-13/+2
| | | | | | | | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Folded fix into this patch: [PATCH] omap4 regression: set correct boot source Signed-off-by: Vicente Bergas <vicencb@gmail.com>
* OMAP: Add option to use environment from MMCTeresa Gámez2013-04-031-0/+33
| | | | | | | | | | Make loading environment from MMC generic for all OMAP. Tested on AM335x, OMAP4. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Tested-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* OMAP: Move bootsource functionsTeresa Gámez2013-04-031-0/+32
The bootsource functions are not specific to the first stage bootloader. They may also be used for detecting the bootsource to decide where to load the environment from. Also clean up includes in board files. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>