Commit Graph

2413 Commits

Author SHA1 Message Date
Andrey V. Elsukov
3db1bfd80d Bump USERBOOT_VERSION.
Requested by:	dfr
2012-08-05 17:04:58 +00:00
Yoshihiro Takahashi
7361df284b Reduce diffs against i386. 2012-08-05 14:48:55 +00:00
Andrey V. Elsukov
4c89da6c18 Teach the ZFS use new partitions API when probing.
Note: now ZFS does probe only for partitions with type "freebsd-zfs"
and "freebsd".
2012-08-05 14:48:28 +00:00
Andrey V. Elsukov
6f6aad97b6 Remove unneeded flag. 2012-08-05 14:38:53 +00:00
Andrey V. Elsukov
a86f714d15 Add offset field to the i386_devdesc structure to be compatible with
disk_devdesc structure. Update biosdisk driver to the new disk API.
2012-08-05 14:37:48 +00:00
Yoshihiro Takahashi
d68fc999de Reduce diffs against i386. 2012-08-05 14:11:07 +00:00
Yoshihiro Takahashi
72b179343b MFi386: the part of r219452 and r236405.
- bunch of variables are turned into uint8_t.
  - Remove unnecessary initializations.
2012-08-05 14:05:11 +00:00
Andrey V. Elsukov
95caf34849 When GPT signature is invalid in the primary GPT header, then try to
read backup GPT header.

Submitted by:	hrs (previous version)
2012-08-05 12:57:38 +00:00
Andrey V. Elsukov
2c6f04dc0a Introduce new API to work with disks from the loader's drivers.
It uses new API from the part.c to work with partition tables.

Update userboot's disk driver to use new API. Note that struct
loader_callbacks_v1 has changed.
2012-08-05 12:15:15 +00:00
Andrey V. Elsukov
9cef000008 Remove unused variables. 2012-08-05 11:59:46 +00:00
Andrey V. Elsukov
a0ff532148 Create the interface to work with various partition tables from the
loader(8). The following partition tables are supported: BSD label, GPT,
MBR, EBR and VTOC8.
2012-08-05 11:29:44 +00:00
Marius Strobl
614e309803 Pull the tier-2 card and change the sparc64 ZFS loader to no longer probe
all diskN aliases for providers (which more or less corresponds to how the
x86 version behaves) but instead probe only those listed in the boot-device
OFW environment variable. This has the following advantages:
- avoids otherwise unavoidable OFW warnings about failures to open disks
  for which aliases exist but no actual hardware is connected
- avoids issues due to different diskN naming schemes
- aligns us with Solaris

MFC after:	3 days
2012-07-27 18:23:11 +00:00
Andrey A. Chernov
283e000db4 Try to avoid all files dependence on the modification time of the large and
often modified directory created symbolic links points to - it cause
unnecessary full rebuilds each time make runs when directory is changed.
So do it only if symbolic link does not exists, which usually means that
objdir is clean anyway.

MFC after:      1 week
2012-07-26 10:10:54 +00:00
Warner Losh
15fda8888a Use the pin number rather than the hybrid pin number + name. 2012-07-15 05:35:14 +00:00
Devin Teske
d35c4b1d44 Fix domain.
Approved by:	emaste
2012-07-14 01:45:35 +00:00
Warner Losh
51763c6303 Generalize this for loading the loader into the SPI. Plus trim about
100 bytes from the binary with silly tricks.  Hope to get this small
enough to run on the models that have 4k SRAM.  We are close compiled
for the at91rm9200, but still need to trim for the target.
2012-07-07 04:55:42 +00:00
Warner Losh
1d4fae3825 Allow other SOCs to be compiled in, first step. 2012-07-07 04:51:59 +00:00
Warner Losh
c4a9bff135 Strip out the useless junk. All we really care about is the text,
data and bss sections.  All the rest is needed for normal binaries,
but boot loaders aren't normal.
2012-07-07 04:49:53 +00:00
Xin LI
a2953f767d MFV: Update zlib to 1.2.7.
(x86 assembler optimization disabled for now because it
requires the new .cfi_* directives that is not supported
by base system binutils).

MFC after:	1 week
2012-06-21 21:47:08 +00:00
John Baldwin
32abc7ddc1 Don't return an error if a kld does not contain any modules (e.g. a
kld that only contained a sysctl).  The kernel linker allows such
modules, so the boot loader should not reject them.

MFC after:	2 weeks
2012-06-20 21:06:51 +00:00
Martin Matuska
253a9c296c Fix ZFS boot with pre-features pools (version <= 28) broken in r236884
Reported by:	mav
MFC after:	1 month
2012-06-13 08:00:32 +00:00
Martin Matuska
2d9cf57e18 Introduce "feature flags" for ZFS pools (bump SPA version to 5000).
Add first feature "com.delphix:async_destroy" (asynchronous destroy
of ZFS datasets).
Implement features support in ZFS boot code.

Illumos revisions merged:
13700:2889e2596bd6
13701:1949b688d5fb
2619 asynchronous destruction of ZFS file systems
2747 SPA versioning with zfs feature flags

References:
https://www.illumos.org/issues/2619
https://www.illumos.org/issues/2747

Obtained from:	illumos (issue #2619, #2747)
MFC after:	1 month
2012-06-11 11:35:22 +00:00
Marius Strobl
10ee2f9a87 The loaddev environment variable is not modifiable once set, so it is not
update for ZFS. It seems that this does not really affect anything except
the help command. Nevertheless, rearrange things so loaddev is set only
once in all cases in order to get it right.
Pointed out by: avg

MFC after:	r235364
2012-06-04 20:56:40 +00:00
Marius Strobl
f6dd28dc27 The workaround added in r151650 for handling firmwares that don't allow
a single device to be opened multiple times concurrently unfortunately
isn't sufficient with ZFS. This is due to the fact, that ZFS may open
different partitions of a single device simultaneously. So the best we
can do in this case is to cache the lastly used device path and close
and open devices in ofwd_strategy() as needed.

PR:		165025
Submitted by:	Gavin Mu
MFC after:	1 week
2012-06-04 20:45:33 +00:00
John Baldwin
370b70dc03 Remove unnecessary initializations. The BSS of boot2 is in fact
zero'd when boot2 begins execution by the _start() routine in btxcsu.S.

MFC after:	1 week
2012-06-01 15:48:24 +00:00
Kevin Lo
544c5e5b53 Make sure that each va_start has one and only one matching va_end,
especially in error cases.
2012-05-29 01:48:06 +00:00
Tim Kientzle
81174e7872 Allow the load address used by ARM ubldr to be set via Make argument.
In particular, this simplifies scripts that build system
images.
2012-05-27 16:27:04 +00:00
Rafal Jaworowski
3eef23db5e Import DTS files for the upcoming DPAA QorIQ (PowerPC) support.
- P2041RDB
  - P3041DS
  - P5020DS

Obtained from:	Freescale
2012-05-25 20:43:38 +00:00
Gleb Kurtsou
491a40587d Use 32-bit ufs_ino_t instead of ino_t to keep boot2 small and prevent
unnecessary 64-bit math on 32-bit machines.

Sponsored by:	Google Summer of Code 2011
2012-05-25 09:36:39 +00:00
Warren Block
344c81a166 Fixes to man8 groff mandoc style, usage mistakes, or typos.
PR:		168016
Submitted by:	Nobuyuki Koganemaru
Approved by:	gjb
MFC after:	3 days
2012-05-24 02:24:03 +00:00
Grzegorz Bernacki
9c12d78912 Divide nand flash for DB6281 into two partitions. One for u-boot
and second one for general use.

Obtained from: Semihalf
Supported by:  FreeBSD Foundation, Juniper Networks
2012-05-22 09:27:57 +00:00
Grzegorz Bernacki
4ffd4dfe17 Add a new geom class which allows to divide NAND Flash chip
into partitions.

Partitions are created based on data in dts file which are
extracted and interpreted by slicer.

Obtained from: Semihalf
Supported by:  FreeBSD Foundation, Juniper Networks
2012-05-22 08:33:14 +00:00
Tim Kientzle
5f5ec09bfb Determine kernel load address dynamically from u-boot memory map.
The generic ELF loading code maps the kernel into low memory
by subtracting KERN_BASE.  So the copyin/copyout/readin functions
are always called with low addresses.  This code finds the largest
DRAM block from the U-Boot memory map and adds that base to
the addresses.

In particular, this fixes ubldr on AM3358, which has DRAM
mapped to 0x80000000 at power-on.
2012-05-20 18:07:35 +00:00
Grzegorz Bernacki
b91fab4255 Add architecture dependent code to support NAND Framework on Marvell SoCs.
Obtained from: Semihalf
Supported by:  FreeBSD Foundation, Juniper Networks
2012-05-18 14:41:14 +00:00
Devin Teske
4c4947ad9d Update contact info.
PR:		N/A (mentor approved)
Submitted by:	dteske
Reviewed by:	dteske (mentor approved)
Approved by:	emaste (mentor)
MFC after:	1 week
2012-05-17 20:00:34 +00:00
Grzegorz Bernacki
7f725bcd5c Import work done under project/nand (@235533) into head.
The NAND Flash environment consists of several distinct components:
  - NAND framework (drivers harness for NAND controllers and NAND chips)
  - NAND simulator (NANDsim)
  - NAND file system (NAND FS)
  - Companion tools and utilities
  - Documentation (manual pages)

This work is still experimental. Please use with caution.

Obtained from: Semihalf
Supported by:  FreeBSD Foundation, Juniper Networks
2012-05-17 10:11:18 +00:00
Tim Kientzle
c3a9b90973 Access the device tree blob via copyin/copyout.
The code previously assumed that copyin/copyout did no
address translation and that the device tree blob could
be manipulated in-place (with only a few adjustments for
the ELF loader offset).  This isn't possible on all platforms,
so the revised code uses copyout() to copy the device tree
blob into a heap-allocated buffer and then updates the
device tree with copyout().  This isn't ideal, since it
bloats the loader memory usage, but seems the only feasible
approach (short of rewriting all of the fdt manipulation
routines).
2012-05-17 04:04:48 +00:00
Andriy Gapon
76438db6a7 libpc98: unbreak after zfs-related changes in libi386 code
Pointyhat to:	avg
MFC after:	1 month
2012-05-13 11:34:05 +00:00
Andriy Gapon
0a56cdf866 zfs boot: cleanup remnants of temporary compat code
MFC after:	1 month
2012-05-13 10:54:43 +00:00
Andriy Gapon
dfc351d8e9 zfs boot code: mark spa_t arguments as const where they are used as such
MFC after:	1 month
2012-05-13 09:22:18 +00:00
Andriy Gapon
32df866434 sparc64/zfs boot: take advantage of new libzfsboot capabilities
Also drop the now unneeded compatibility shims.

Tested by:	marius
MFC after:	1 month
2012-05-12 20:27:33 +00:00
Andriy Gapon
f7f7b759f6 zfs boot code: use %j and uintmax_t instead %ll and uint64_t in printfs
This is to silence warnings that result from different definitions of
uint64_t on different architectures, specifically i386 and sparc64.

MFC after:	1 month
2012-05-12 20:23:30 +00:00
Andriy Gapon
0da23ac99d zfs boot: try to set vfs.root.mountfrom from currdev as a fallback
This way with the new zfsloader there is no need to explicitly set zfs
root filesystem either via vfs.root.mountfrom or fstab.
It should be automatically picked up from currdev which is by default
is set from bootfs.

Tested by:	Florian Wagner <florian@wagner-flo.net> (x86)
MFC after:	1 month
2012-05-12 09:07:41 +00:00
Andriy Gapon
1702e62f67 zfsboot/zfsloader: support accessing filesystems within a pool
In zfs loader zfs device name format now is "zfs:pool/fs",
fully qualified file path is "zfs:pool/fs:/path/to/file"
loader allows accessing files from various pools and filesystems as well
as changing currdev to a different pool/filesystem.

zfsboot accepts kernel/loader name in a format pool:fs:path/to/file or,
as before, pool:path/to/file; in the latter case a default filesystem
is used (pool root or bootfs).  zfsboot passes guids of the selected
pool and dataset to zfsloader to be used as its defaults.

zfs support should be architecture independent and is provided
in a separate library, but architectures wishing to use this zfs support
still have to provide some glue code and their devdesc should be
compatible with zfs_devdesc.
arch_zfs_probe method is used to discover all disk devices that may
be part of ZFS pool(s).

libi386 unconditionally includes zfs support, but some zfs-specific
functions are stubbed out as weak symbols.  The strong definitions
are provided in libzfsboot.
This change mean that the size of i386_devspec becomes larger
to match zfs_devspec.

Backward-compatibility shims are provided for recently added sparc64
zfs boot support.  Currently that architecture still works the old
way and does not support the new features.

TODO:
- clear up pool root filesystem vs pool bootfs filesystem distinction
- update sparc64 support
- set vfs.root.mountfrom based on currdev (for zfs)

Mid-future TODO:
- loader sub-menu for selecting alternative boot environment

Distant future TODO:
- support accessing snapshots, using a snapshot as readonly root

Reviewed by:	marius (sparc64),
		Gavin Mu <gavin.mu@gmail.com> (sparc64)
Tested by:	Florian Wagner <florian@wagner-flo.net> (x86),
		marius (sparc64)
No objections:	fs@, hackers@
MFC after:	1 month
2012-05-12 09:03:30 +00:00
Dimitry Andric
d681f8bf6c Fix sys/boot/i386/cdboot/cdboot.S compilation with clang after r235219.
This file uses .code16 directives, which are not yet supported by
clang's integrated assembler.

MFC after:	1 month
2012-05-11 18:07:23 +00:00
Warner Losh
498131c705 Add support for passing in the board ID.
# This doesn't implement the full Linux boot ABI for arm yet.
# since there's no ATAGs list passed in for r2, and r0 has
# boot options rather than 0 as specified in the standard.
# Commited code to the tree won't touch any of this anyway, but
# future code may be able to use this.
2012-05-11 14:45:29 +00:00
Warner Losh
9434786e88 Hack to unbreak boot2 for at91rm9200 boot loader. When the at91sam
code came in, it moved things around which wound up breaking the
build.  We have to do this bit of a hack to avoid duplication of a lot
of #defines.
2012-05-11 14:40:25 +00:00
Andriy Gapon
006d25ce15 MFi386: improve argument passing via btxldr
use related definitions in i386 bootargs.h

Reviewed by:	nyan, jhb
MFC after:	1 month
2012-05-11 09:46:17 +00:00
Tim Kientzle
9b1cb34ced Don't hang if there is no /cpus node in the device tree. 2012-05-11 04:18:39 +00:00
Andriy Gapon
3b135bc51c cdboot, pxeldr: make use of bootargs.h instead of redefining flag constants
Reviewed by:	jhb
MFC after:	1 month
2012-05-10 09:47:04 +00:00