summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap/xload.c
Commit message (Collapse)AuthorAgeFilesLines
* arm: mach-omap: xload: Enable network interfaceTeresa Remmet2018-11-161-0/+2
| | | | | | | | | Since f0624a701513 ("net: Do not route traffic to interfaces that are not up") interfaces need to be "up" before used. To make enthernet boot work again enable the interface after dhcp is set up. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: omap: xload: Fix network boot filenameSascha Hauer2018-09-181-2/+5
| | | | | | | | | | | | The dhcp code no longer exports the "bootfile" environment variable. It now uses global.dhcp.bootfile. Since global variable support is not necessarily part of the MLO we instead use struct dhcp_result * to get the bootfile information. Fixes: 528298b702 ("net: dhcp: rework") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Dennis Menschel <menschel-d@posteo.de>
* net: dhcp: reworkSascha Hauer2017-12-141-1/+1
| | | | | | | | | | | | | | | The DHCP code is a mess. It is not clear which options are sent to the server and which options are returned from the server. Also environment variables are read from and written to all over the place. This patch cleans this up. There now is struct dhcp_req_param which is used for options sent to the server and struct dhcp_result which contains the values sent from the server. The values from the server are written to the barebox variables in a single place. Also it's now possible to call the dhcp code without modifying barebox variables at all, storing the result only in the dhcp result struct. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Allow to specify network deviceSascha Hauer2017-12-141-1/+9
| | | | | | | | | Instead of allowing to DHCP only on the "current" network device, allow to specify the desired network device. This is a first step to get rid of the concept of a "current" network device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* convert users to %pI4Sascha Hauer2016-09-221-3/+6
| | | | | | | Convert users of ip_to_string() and print_IPaddr() to %pI4 and remove the now unused functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* OMAP: xload: nand: Check for redundant barebox partitionTeresa Remmet2016-06-301-1/+16
| | | | | | | | Add a support for a redundant barebox backup partition if loading barebox image from first barebox partitions fails. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* OMAP: xload: Factor out reading image from mtd partitionTeresa Remmet2016-06-301-49/+22
| | | | | | | Remove code duplication of reading images out of mtd partitions. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string: Fix (v)asprintf prototypesSascha Hauer2016-04-151-2/+2
| | | | | | | | | | 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>
* xload: be more flexible when searching for second stage bootloader.Vicente Bergas2015-10-021-1/+3
| | | | | | | | | | | | | | | | A first stage bootloader can read fat and ext4 filesystems, and even both can be compiled-in at the same time. But then xload has a hardcoded fat filesystem mount option which renders ext4 unusable. This patch tries to mount it as ext4 if the fat attempt fails. Then, a typical use case of an ext4 formatted filesystem is it to be a standard linux filesystem, which contains boot-related files in /boot. So, when searching for the second stage bootloader, try /boot/barebox.bin after not finding it in /barebox.bin Signed-off-by: Vicente Bergas <vicencb@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-08-061-4/+26
|\
| * ARM: am33xx: netboot use ramfsJan Remmet2015-07-081-4/+26
| | | | | | | | | | | | | | | | | | | | Older tftp server don't send the file size. Then tftpfs needs temporary place to store the file. mount ramfs and then tftpfs in a own mount point Signed-off-by: Jan Remmet <j.remmet@phytec.de> Tested-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | xload: fix use after freeMichael Grzeschik2015-07-271-2/+3
| | | | | | | | | | | | | | | | The variable partname is used in the error path for debugging. We have to free it after this use. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: omap: xload: Fix func uninitialized warningSascha Hauer2015-07-131-0/+1
|/ | | | | | | When doing USB boot without having it enabled in the config func is used unitialized. Explicitly set this to NULL so that booting fails in this case. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: OMAP: Add omap3 USB loader toolSascha Hauer2015-07-021-2/+6
| | | | | | | | | | | | The OMAP3 supports uploading the first stage bootloader via USB. The ROM leaves the MUSB controller enabled and it can then be used to upload a 2nd stage image. This patch adds the omap3-usb-loader tool and the necessary barebox support to upload the 2nd stage image. The omap usb loader tool is downloaded from https://github.com/grant-h/omap_loader and changed to also accept CHSETTINGS images. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: am33xx: Add network bootWadim Egorov2015-06-051-0/+51
| | | | | Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-081-1/+1
| | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: omap: Add bootsource serial to xloadJan Weitzel2014-11-191-0/+46
| | | | | | | | | | | If booted from serial via xmodem, also get barebox.bin per xmodem For first stage you need the .pblx file instead of MLO. Add serial boot to am335x_mlo_defconfig introduce some cleanups by savedefconfig Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> 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-2/+2
| | | | | | | | | | | 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>
* ARM: OMAP: register OMAP specific barebox bootm handlerSascha Hauer2013-09-271-8/+2
| | | | | | | | | 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: Allow to set mmc devname used for bootingSascha Hauer2013-08-271-3/+16
| | | | | | | | | | | 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>
* ARM OMAP: get barebox partion information from boardcodeTeresa Gámez2013-07-101-7/+31
| | | | | | | | | The size and offset of the barebox partition in nand and spi nor flash may vary on different boards. Make it possible to pass this information over boardfile if needed. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: omap: store boot source info from ROM loaderTeresa Gámez2013-07-101-2/+6
| | | | | | | | | | | | | | | | | | The ROM loader passes the address of a buffer to the MLO in register 0. Store this data so we can find the boot source later. On the same way the bootinformation are passed to the barebox, then. It has to be enshured that r0 contains always the buffer or the boot source detection will not work. Applied this on all OMAPs. This patch is based on work of Jan Luebbe <jlu@pengutronix.de>. Compile tested on all OMAP boards. Tested on pcm049, phyCARD-A-L1 and pcm051. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Tested-by: Christoph Fritz <chf.fritz@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* omap: move to common bootsource frameworkJan Luebbe2013-04-181-12/+14
| | | | | | | | | | | 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: Move bootsource functionsTeresa Gámez2013-04-031-12/+1
| | | | | | | | | | | 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>
* startup: call a barebox_main function pointer at the end of the startupSascha Hauer2013-01-201-1/+10
| | | | | | | | | | | | | | | | | Currently Kconfig dependencies are used to allow non-interactive builds. This leads to problems in Kconfig getting the dependencies right. This patch adds a barebox_main function pointer which is called at the end of the startup process. This defaults to run_shell when a shell is enabled. With this the HAVE_NOSHELL Kconfig variable can be removed. Non interactive builds can now be enabled for every board allowing to compile a binary without further Kconfig dependencies. This also allows for more flexibility, for example boards may decide to try non-interactive startup first and call run_shell if that fails. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: beaglebone: add first-stage support for AM335x and boardJan Luebbe2012-12-201-0/+2
| | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* omap4: add support for loading second stage from usbVicente2012-11-161-0/+26
| | | | | Signed-off-by: Vicente <vicencb@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* xload: add SPI as a boot modeJan Luebbe2012-09-111-0/+40
| | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* xload: make internal functions staticJan Luebbe2012-09-111-4/+4
| | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* xload: get barebox size from barebox_arm_headJan Weitzel2012-09-071-4/+53
| | | | | | | | | Add functions to read the barebox_arm_head, check barebox magicword and read out the barebox image size. Create a inital partion of 1Mb to access the barebox image on nand. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Removed duplicate definition for DEVFS_PARTITION_xxxAlexander Shiyan2012-05-131-1/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* omap: xload: Make error more specificSanjeev Premi2012-02-141-2/+3
| | | | | | | | | | | | Current message indicating that SD card isn't mounted is misleading if the card has only one partition. Updated the message to indicate that mounting the specific partition failed. Signed-off-by: Sanjeev Premi <premi@ti.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* omap: Unify run_shell() in xload configurationSanjeev Premi2011-11-111-0/+41
| | | | | | | | | | | | | | Currently, there are multiple definitions of run_shell() for each board that can be build in "xload" configuration. Now there is only one function used by all boards. The functions defined in xload.c are used only when "xload" configuration used; but it gets compiled unconditionally. This has been fixed as well. Signed-off-by: Sanjeev Premi <premi@ti.com> Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM omap: add xload helper functionsSascha Hauer2011-04-121-0/+54
Add some common xload helper functions to determine the boot source on omap3/4 and to load images from mmc and nand. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>