summaryrefslogtreecommitdiffstats
path: root/sys/boot/mips
Commit message (Collapse)AuthorAgeFilesLines
* MFC r309369,310850,310853:tsoome2017-02-062-6/+6
| | | | | | | | | | libstand: dosfs cstyle cleanup for return keyword. dosfs support in libstand is broken since r298230 PR: 214423 Submitted by: Mikhail Kupchik Reported by: Mikhail Kupchik Approved by: imp (mentor)
* MFC r310267: Deduplicate loader vers.c Makefile rulesemaste2017-01-202-9/+2
| | | | | | | | The Makefile rule to create vers.c for loader version info was previously duplicated in each of the various loader Makefiles. Instead, share a common rule in Makefile.inc. Sponsored by: The FreeBSD Foundation
* MFC r310225: Reduce boot loader version string duplicationemaste2017-01-172-5/+2
| | | | | Instead of repeating "%s, Revision %s" "(%s %s)" in each loader, just create the full version string in vers.c
* MFC r307238:bapt2016-11-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | Stop closing the network device when netbooting for loaders using the common dev_net.c code. The NETIF_OPEN_CLOSE_ONCE flag was added in r201932 to prevent that behaviour on some architectures (sparc64 and powerpc64) the default was left to always open and close the device for each open and close of a file by the loader because it was necessary for u-boot on arm. Since it has been added, the flag was turned on for every arches including the u-boot loader for arm. This also fixes netbooting on RPi3 (tested by gonzo@) For the loader.efi it greatly speeds up netbooting Reviewed by: emaste, gonzo, tsoome Approved by: gonzo MFC after: 1 month Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D8230
* sys: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-211-1/+1
| | | | | | | | | | rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted.
* sys/boot: use our nitems() macro when it is available through param.h.pfg2016-04-191-1/+1
| | | | | | No functional change, only trivial cases are done in this sweep, Discussed in: freebsd-current
* A new implementation of the loader block cacheallanjude2016-04-182-8/+8
| | | | | | | | | | | | | | | | | The block cache implementation in loader has proven to be almost useless, and in worst case even slowing down the disk reads due to insufficient cache size and extra memory copy. Also the current cache implementation does not cache reads from CDs, or work with zfs built on top of multiple disks. Instead of an LRU, this code uses a simple hash (O(1) read from cache), and instead of a single global cache, a separate cache per block device. The cache also implements limited read-ahead to increase performance. To simplify read ahead management, the read ahead will not wrap over bcache end, so in worst case, single block physical read will be performed to fill the last block in bcache. Booting from a virtual CD over IPMI: 0ms latency, before: 27 second, after: 7 seconds 60ms latency, before: over 12 minutes, after: under 5 minutes. Submitted by: Toomas Soome <tsoome@me.com> Reviewed by: delphij (previous version), emaste (previous version) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D4713
* This review aims at introducing ubldr (loader with U-Boot interface) for MIPSsgalabov2016-02-298-1/+538
| | | | | | | | | | | | | | | | | | | | | | | | (32 and 64-bit, LE and BE). The changes were tested with QEMU's 'mips' target. Most of the implementation was lifted from the ARM version, the appropriate MIPS-specific things were implemented. With these changes I am able to go all the way through the u-boot->ubldr->kernel boot chain in QEMU on all combinations of bit-ness and endian-ness. For the tests I've used FAT32 disk images (as FAT32 is supported by U-boot), which include /boot/kernel/kernel and /boot/kernel/ubldr.bin In U-boot I do: fatload ide 0 <LOAD_ADDR> /boot/kernel/ubldr.bin; go <LOAD_ADDR> where LOAD_ADDR is 80800000 for 32-bit and ffffffff80800000 for 64-bit Then it's the usual ubldr that takes over and loads and starts a kernel. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D5313
* Currently BERI's loader is including the 32-bit version of the FICL MIPS ↵sgalabov2016-02-261-1/+1
| | | | | | | | | sysdep.h (sys/boot/ficl/mips/sysdep.h) instead of the 64-bit version (sys/boot/ficl/mips64/sysdep.h). Although this may not be an issue in practice, it would be more correct if the 64-bit version was used. Also, using the 64-bit version would make it easier to add support for 64-bit ubldr on MIPS. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5310
* Fix mistake when transitioning to the new defines with ZFS loader. Iimp2016-01-271-1/+1
| | | | | | | | hate adding yet another define, but it is the lessor of the evil choices available. Kill another evil by removing PATH_BOOT3 and replacing it with PATH_LOADER or PATH_LOADER_ZFS as appropriate. PR: 206659
* Remove static from these two. They slipped through the cracks.imp2016-01-261-1/+1
| | | | MFC After: 1 week
* RBX_ defines are in rbx.h, move it there.imp2016-01-261-38/+1
| | | | Differential Revision: https://reviews.freebsd.org/D5038
* Move all the separate copies of the same strings into paths.h. There'simp2016-01-261-5/+2
| | | | | | nothing machine specific about these. Differential Revision: https://reviews.freebsd.org/D5038
* Increase BERI boot components section alignment to 16emaste2016-01-202-6/+6
| | | | | | | | | | | | The .text, .bss, and .data sections claimed 16-byte alignment, but were only aligned to 8 by the linker script. Discovered with elfcopy(1) from elftoolchain, which performs validation absent from the binutils strip(1). ELF tool chain ticket #512. Reported by: brooks Reviewed by: brooks Sponsored by: DARPA, AFRL
* Remove guards around overwriting loader.rc and menu.rcallanjude2015-08-061-7/+1
| | | | | | | | | | | | | | There have been .local version of each for user modifications for some time This allows users to receive future updates to these files PR: 183765 Submitted by: Bertram Scharpf, Nikolai Lifanov (patch) Reviewed by: dteske, loos, eadler Approved by: bapt (mentor) MFC after: 1 month Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3176
* Fix fallouts from r284590bapt2015-06-191-0/+1
| | | | Reported by: kib
* Fix mips build, really. :-(jkim2015-04-031-1/+1
|
* Revert .PATH changes to fix mips build.jkim2015-04-031-0/+1
| | | | | Reported by: bz Pointy hat to: jkim
* Install newly added brand-*.4th and logo-*.4th files and reduce duplication.jkim2015-04-021-6/+1
| | | | | Reviewed by: dteske Pointy hat to: dteske
* Ensure the cross assembler, linker and objcopy are used for the build32dim2015-04-021-1/+1
| | | | | | | | stage, just like for the regular world stage. Reviewed by: rodrigc, imp, bapt, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D2187
* Increase BERI loader section alignment to 16emaste2014-12-031-3/+3
| | | | | | | | | | The .text, .bss, and .data sections claimed 16-byte alignment, but were only aligned to 8 by the linker script. Discovered with strip(1) from elftoolchain, which performs validation absent from the binutils strip(1). Sponsored by: DARPA, AFRL
* Revert r267233 for now. PIE support needs to be reworked.bdrewery2014-08-192-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | 1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other build-only utility libraries. 2. Another 40% is fixed by generating _pic.a variants of various libraries. 3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR) where it never would work anyhow, such as csu or loader. This suggests there may be better ways of adding support to the tree. Many of these cases can be fixed such that -fPIE will work but there is really no reason to have it in those cases. 4. Some of the uses are working around hacks done to some Makefiles that are really building libraries but have been using bsd.prog.mk because the code is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have been needed. We likely do want to enable PIE by default (opt-out) for non-tree consumers (such as ports). For in-tree though we probably want to only enable PIE (opt-in) for common attack targets such as remote service daemons and setuid utilities. This is also a great performance compromise since ASLR is expected to reduce performance. As such it does not make sense to enable it in all utilities such as ls(1) that have little benefit to having it enabled. Reported by: kib
* Give loaders more control over the Forth initialization process. Inmarcel2014-07-271-1/+1
| | | | | | | | | | | | | | | | | | | particular, allow loaders to define the name of the RC script the interpreter needs to use. Use this new-found control to have the PXE loader (when compiled with TFTP support and not NFS support) read from ${bootfile}.4th, where ${bootfile} is the name of the file fetched by the PXE firmware. The normal startup process involves reading the following files: 1. /boot/boot.4th 2. /boot/loader.rc or alternatively /boot/boot.conf When these come from a FreeBSD-defined file system, this is all good. But when we boot over the network, subdirectories and fixed file names are often painful to administrators and there's really no way for them to change the behaviour of the loader. Obtained from: Juniper Networks, Inc.
* Reviewed by: impsjg2014-07-261-2/+2
| | | | | LDFLAGS is supposed to be given to CC not LD. Define _LDFLAGS as a filtered version of LDFLAGS safe to give to LD
* In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.bdrewery2014-06-082-0/+4
| | | | | | | | | | | | | | | | This is currently an opt-in build flag. Once ASLR support is ready and stable it should changed to opt-out and be enabled by default along with ASLR. Each application Makefile uses opt-out to ensure that ASLR will be enabled by default in new directories when the system is compiled with PIE/ASLR. [2] Mark known build failures as NO_PIE for now. The only known runtime failure was rtld. [1] http://www.bsdcan.org/2014/schedule/events/452.en.html Submitted by: Shawn Webb <lattera@gmail.com> Discussed between: des@ and Shawn Webb [2]
* Add optional support for USB to BERI loader. Fix the linker script sohselasky2014-05-303-4/+27
| | | | | | that the garbage collection feature can be used when linking. Sponsored by: DARPA, AFRL
* Fix delay() function in the BERI loader code.hselasky2014-05-301-5/+17
| | | | | Reviewed by: brooks @ Sponsored by: DARPA, AFRL
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffimp2014-05-061-1/+1
| | | | from the latter.
* NO_MAN= has been deprecated in favor of MAN= for some time, go aheadimp2014-04-131-1/+1
| | | | | | and finish the job. ncurses is now the only Makefile in the tree that uses it since it wasn't a simple mechanical change, and will be addressed in a future commit.
* Build the BERI boot loader on 64-bit MIPS (but not 32-bit MIPS). Whilerwatson2014-02-231-1/+6
| | | | | | | | these binaries aren't immediately useful on other MIPSes, still build them as part of mips64 world in order to expose them to tinderbox. MFC after: 3 weeks Sponsored by: DARPA, AFRL
* Temporarily unhook BERI boot loader from the build until 32-bit MIPSrwatson2014-02-191-0/+2
| | | | properly excludes building our 64-bit only boot-loader adaptation.
* Replace Apache-style license on two Makefiles with stock 2-clause BSD;rwatson2014-02-182-34/+39
| | | | | | | | license, although the former is pretty safe, it wasn't intended to be used in the version of MIPS boot2/loader upstreamed to FreeBSD. MFC after: 3 weeks Sponsored by: DARPA, AFRL
* Commit a first cut at ports of boot2 and loader to 64-bit MIPS, with arwatson2014-02-1833-0/+3829
particular interest in (and support for) SRI International and the University of Cambridge's BERI FPGA soft-core processor. This includes micro device drivers for the Altera JTAG UART console, memory-mapped flash, and the Altera SD Card IP core in both boot2 and loader. boot2 can be written to the on-board Intel StrataFlash on the DE4 board, and loader can be placed in StrataFlash or the SD Card. Plenty of XXX comments, but works quite well locally in practice and I am using it daily. Although I had originally ported the ARM version of boot2, the current version is x86-derived as that proved more feature-complete. As we don't currently use partitions on our flash disks, support for that has been commented out relative to x86, but would be easy to add back. FDT support has not yet been hooked up, although some skeleton parts have been put in place for that. This may well be a useful starting point for ports to other 32-bit and 64-bit MIPS-ISA systems. This merge is synchronised to CheriBSD github commit e41d74fd719525d4dd7a7ee499114679165eeaf6, but with some additions of $FreeBSD. MFC after: 3 weeks Sponsored by: DARPA, AFRAL
OpenPOWER on IntegriCloud