Commit Graph

2713 Commits

Author SHA1 Message Date
Ian Lepore
a4b43ebe9e If we can't find the u-boot api signature, exit with an error status that
includes "badab1"; u-boot displays the status in hex, so this may help
give some clue about why ubldr isn't working (more than -1 does anyway).
2014-03-01 19:25:23 +00:00
Ian Lepore
bc837fc0c0 Prevent fdt data loaded from a file from overwriting the kernel environment,
by having uboot_autoload() do the fdt setup (which may load a file) rather
than waiting until we're actually in the process of launching the kernel.

As part of making this happen...
 - Define LOADER_FDT_SUPPORT on the uboot/lib compile command line when
   MK_FDT is set.
 - Make fdt_setup_fdtb() public.
 - Declare public fdt_whatever() functions in a header instead of using
   scattered extern decls in .c files.
2014-03-01 19:02:00 +00:00
Warner Losh
b3feafa42a Fix syntax errors (missing ;) that bsdl dtc was tolerant of, but gpl
dtc isn't.
2014-02-28 22:37:40 +00:00
Warner Losh
eeb913c99f Integrate device-tree upstream files into the build process:
(1) Invoke cpp to bring in files via #include (although the old
    /include/ stuff is supported still).
(2) bring in files from either vendor tree or freebsd-custom files
    when building.
(3) move all dts* files from sys/boot/fdt/dts to
    sys/boot/fdt/dts/${MACHINE} as appropriate.
(4) encode all the magic to do the build in sys/tools/fdt/make_dtb.sh
    so that the different places in the tree use the exact same logic.
(5) switch back to gpl dtc by default. the bsdl one in the tree has
    significant issues not easily addressed by those unfamiliar with
    the code.
2014-02-28 18:29:09 +00:00
Dimitry Andric
e40a3fc365 Merge from head up to r262611. 2014-02-28 17:46:56 +00:00
Luiz Otavio O Souza
e42feeb782 Add geom_uncompress to the list of available geom modules on loader.conf.
Approved by:	adrian (mentor)
2014-02-27 13:31:54 +00:00
Dimitry Andric
bdc74e2bc0 Merge from head up to r262536. 2014-02-26 22:26:40 +00:00
Peter Grehan
ee89f3d53c Change the MK_ZFS != "no" case slightly to avoid a name
clash with LIBZFS in bsd.lib.mk

Submitted by:	Max N Boyarov   zotrix at bsd dot by
OK'd by:	sbruno
2014-02-26 04:49:09 +00:00
Sean Bruno
70c9dd3e3d Slightly better revision of teaching userboot how to respect MK_CDDL
Reviewed by:	grehan
2014-02-25 21:07:18 +00:00
Sean Bruno
4477cac768 Teach userboot to comply with WITHOUT_CDDL/WITHOUT_ZFS
Apparently, LIBZFS is set to a non-empty string when WITHOUT_CDDL/WITHOUT_ZFS
are set, I think this is a bug, but work around this feature for now.

Reviewed by:	grehan
2014-02-25 18:00:55 +00:00
Ruslan Bukin
ee270bbca3 - Pin configuration is a complete iomux register now and includes
drive strength, pull mode, mux mode, speed, etc.
- Add i2c devices to the tree
- Add IPG clock
2014-02-25 17:02:11 +00:00
Dimitry Andric
c3bb517174 Merge from head up to r262472. 2014-02-25 07:40:37 +00:00
Ruslan Bukin
9516467e96 Add support for Quartz Module.
Quartz is a tiny module utilized Freescale VF6xx
system-on-chip and development kit produced by
Device Solutions.

Quartz is available in a form of LGA (38x38x2mm)
or as a module with high-density connectors.

Sponsored by:	Device Solutions
2014-02-24 19:32:15 +00:00
Robert Watson
a7626073a0 Build FICL support into little-endian 64-bit MIPS boot-loader fragments;
while this won't actually be used for anything (yet), it doesn't hurt to
ensure it is exposed to the tinderbox.

Requested by:   imp, jmallett
MFC after:      3 weeks
2014-02-24 18:44:22 +00:00
Robert Watson
5af5d53deb Build 64-bit ELF support into little-endian 64-bit MIPS boot-loader
fragments; while this won't actually be used for anything (yet), it
doesn't hurt to ensure it is exposed to the tinderbox.

Requested by:	imp, jmallett
MFC after:	3 weeks
2014-02-24 18:44:03 +00:00
Luiz Otavio O Souza
b85b1bbd0f Enable the second and the third I2C controllers on Beaglebone-black.
The first I2C controller is only used to manage the on-board devices (PMIC
and HDMI framer) and its bus is not exposed on the expasion headers.

With this change the following pins on the P9 expansion headers are now
reserved as I2C pins:

 Pin 17 - I2C1 SCL
 Pin 18 - I2C1 SDA
 Pin 19 - I2C2 SCL
 Pin 20 - I2C2 SDA

The I2C2 is the bus that should be used to read the contents of cape
eeproms.

Approved by:	adrian (mentor, implicit)
2014-02-24 12:45:03 +00:00
Dimitry Andric
892620150f Merge from head up to r262415. 2014-02-23 23:33:11 +00:00
Robert Watson
d4b64c8983 Build the BERI boot loader on 64-bit MIPS (but not 32-bit MIPS). While
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
2014-02-23 22:20:52 +00:00
Robert Watson
56df0f7694 When building FDT on MIPS, use softfloat.
MFC after:	3 weeks
Sponsored by:	DARPA, AFRL
2014-02-23 22:12:25 +00:00
Robert Watson
347d368c80 On mips64, built 64-bit ELF support.
MFC after:	3 weeks
Sponsored by:	DARPA, AFRL
2014-02-23 22:11:26 +00:00
Robert Watson
02f21ea80b Give mips64 its own ficl configuration that sizes pointers/etc suitably for
a 64-bit architecture, rather than trying to share the 32-bit MIPS ficl
configuration.

When building ficl on MIPS, don't conflate 32-bit and 64-bit ISAs -- unlike
x86, we don't want a 32-bit loader on a 64-bit CPU.  Use quite conservative
code generation -- e.g., softfloat, no GOT, etc -- suitable for early boot.

MFC after:	3 weeks
Sponsored by:	DARPA, AFRL
2014-02-23 22:10:25 +00:00
Ian Lepore
abe4be7dfd Add a feature for automatically finding and loading a dtb file by name.
The name is taken from the u-boot env vars fdtfile or fdt_file.  If the
name isn't fully-qualified a search is done in module_path locations.

The search order for a usable dtb in fdt_setup_fdtp() is now

 - A dtb loaded with an explicit "load -t dtb" command.
 - A dtb already loaded into memory somehow[*] and pointed to by fdt_to_load.
 - A dtb in the memory pointed to by the u-boot env vars fdtaddr or fdt_addr.
 - A file named by the u-boot env vars fdtfile or fdt_file.
 - A static dtb compiled into the kernel.

* Presumably by some arch-specific command or code.
2014-02-22 22:18:20 +00:00
Ian Lepore
84207cf3b0 Change file_loadraw() from static to public. Change the order of its
arguments from type,filename to filename,type to be consistant with other
public file_whatever() functions, and change it to return a pointer to
the preloaded_file struct describing the file.  Adjust existing callers.
2014-02-22 22:03:26 +00:00
Ian Lepore
d000dd2f86 Change fdt_setup_fdtp() from "guess then fail" to more probe-like behavior.
The old code basically said it was going to use some particular blob
without knowing whether it could successfully do so, then it would invoke
the function to do that and return its status.  If it failed, you were
done, even if other blobs might be available.  Now the code attempts to use
some particular blob and if that succeeds it says so and returns success,
otherwise it moves on to try another potential blob.

One specific problem this solves is when u-boot sets an fdtaddr variable
to point to some memory address, then doesn't actually load a blob at
that address.  Now the header check will fail, and the code will move
on to the fallback dtb compiled into the kernel (if any).
2014-02-22 19:10:58 +00:00
Ian Lepore
324b64f7ac Allow the ubldr boot device to be choosen by a u-boot environment variable.
If a "loaderdev=<device>" env variable is set and the named device
exists, it is used.  If the device doesn't exist, fall back to the
historic "probe" loop that prefers disk devices over network devices.

If the env var is not set, preserve the historic behavior of using the
first working disk device provided by u-boot, or a network device if no
functional disk device is found and a network device exists.

The old probe loop is reworked so that it checks all bootable devices
provided by u-boot rather than taking an early-out on the first device
found.  This results in the cosmetic change of listing all potential boot
devices for the user, but the behavior of which device it chooses is the
same as it has always been.
2014-02-22 17:51:10 +00:00
Peter Grehan
cf087c12c2 ZFS boot support for bhyveload.
Modelled after the i386 zfsloader. However, with no
2nd stage zfsboot to search for a bootable dataset,
attempt a ZFS boot if there is more than one ZFS
dataset found during the disk probe.

sys/boot/userboot/zfs
 - build the ZFS boot library

sys/boot/userboot/userboot/
 conf.c
  - Add the ZFS pool and filesystem tables
 devicename.c
  - correctly format ZFS devices
 main.c
  - increase the size of the libstand malloc pool
  to account for the increased usage from ZFS buffers
  - probe for a ZFS dataset, and if one is
  found, attempt to boot from it.

usr.sbin/bhyveload/bhyveload.c
 - allow multiple invocations of the '-d' option
 to specify multiple disks e.g. a raidz set.
 Up to 32 disks are supported.

Tested with various combinations of GPT, MBR, single
and multiple disks, RAID-Z, mirrors.

Reviewed by:	neel
Discussed with:	avg
Tested by:	Michael Dexter and others
MFC after:	3 weeks
2014-02-22 07:18:06 +00:00
Ian Lepore
7c674742cb Look for both fdtaddr and fdt_addr env var names. Grepping the u-boot
source shows that board vendors seem to be about evenly split on this.

This commit is a trivial change to note that while the previous change
was supposed to be whitespace only, this functional change also crept in.
The added lines were:

  /* Board vendors use both fdtaddr and fdt_addr names.  Grrrr. */

  if (s == NULL)
	s = ub_env_get("fdt_addr");
2014-02-22 03:36:45 +00:00
Ian Lepore
f5658746ab Fix the strange 2-space indentation that appears only in this one function. 2014-02-22 03:29:53 +00:00
Dimitry Andric
9bc21aae69 Merge from head up to r262311. 2014-02-21 22:54:35 +00:00
Dimitry Andric
d7c3b3b9de For now, clang spells -mcmodel=medlow as -mcmodel=small. 2014-02-21 21:51:19 +00:00
Ian Lepore
86a5575402 Add basic cpu frequency control and temperature monitoring to imx6_anatop.
The temperature monitor device is enabled to sample the die temperature at
16hz.  The temperature is published via sysctl.  A callout routine at 10hz
monitors the temperature and throttles back the cpu if the temperature
goes over a user-settable throttle point (by default 10C less than the
critical high-point temperature for the chip).  The hardware is supposed
to be able to deliver an interrupt when the temperature exceeds a settable
limit, but the interrupt never arrives so for now a callout does the job.

At attach time we read the maximum cpu frequency the chip is allowed to run
at and the cpu is set to run at that speed.  It's reported at attach time.
A sysctl variable reports the current speed when queried.

New sysctl values:

  dev.imx6_anatop.0.cpu_mhz: 984
  dev.imx6_anatop.0.temperature: 37.9C
  dev.imx6_anatop.0.throttle_temperature: 95.0C

Steven Lawrance did the initial heavy lifting on this, but I changed
enough stuff that I'm the one to blame if anything breaks.

Submitted by:	Steven Lawrance <stl@koffein.net>
2014-02-21 06:00:06 +00:00
Luiz Otavio O Souza
69728ec82d Fix the boot on FDT-enabled systems after r261819.
While here, don't overwrite the error message on interactive use and add
the missing '\n' at end of error message for the non interactive use.

Tested by:	ian, myself
Approved by:	adrian (mentor, implicit)
2014-02-20 13:09:08 +00:00
Robert Watson
b1bdbe9d09 Temporarily unhook BERI boot loader from the build until 32-bit MIPS
properly excludes building our 64-bit only boot-loader adaptation.
2014-02-19 23:09:25 +00:00
Robert Watson
0c7090e31a Do build boot-loader FDT code on MIPS.
MFC after:	3 weeks
Sponsored by:	DARPA, AFRL
2014-02-19 17:44:59 +00:00
Robert Watson
2067168264 Replace Apache-style license on two Makefiles with stock 2-clause BSD;
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
2014-02-18 23:22:54 +00:00
Robert Watson
4527ee3e06 Commit a first cut at ports of boot2 and loader to 64-bit MIPS, with a
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
e41d74fd71, but with some additions of
$FreeBSD.

MFC after:	3 weeks
Sponsored by:	DARPA, AFRAL
2014-02-18 23:18:32 +00:00
Ruslan Bukin
586a16c431 Add driver for Synchronous Audio Interface (SAI).
SAI supports full-duplex serial interfaces with frame
synchronization such as I2S, AC97, TDM, and codec/DSP
interfaces.
2014-02-16 16:49:54 +00:00
Christian Brueffer
7f47cbd3ce Retire the nve(4) driver; nfe(4) has been the default driver for NVIDIA
nForce MCP adapters for a long time.

Yays:	jhb, remko, yongari
Nays:	none on the current and stable lists
2014-02-16 12:22:43 +00:00
Ian Lepore
844a97cdc2 Add a driver to provide access to imx6 on-chip one-time-programmble data.
Submitted by:	Steven Lawrance <stl@koffein.net>
2014-02-15 17:19:55 +00:00
Luiz Otavio O Souza
62564a0858 Make the gpioled(4) work out of the box on BBB.
Add gpioled(4) to BEAGLEBONE kernel and add the description of the four
on-board leds of beaglebone-black to its DTS file.

Approved by:	adrian (mentor, implicit)
2014-02-13 18:51:37 +00:00
Ian Lepore
1332dc8827 Validate the header of a new dtb before using it. Remove the comment
that says that should be done.
2014-02-13 04:13:50 +00:00
Ian Lepore
50618a328f Enable both sdcard slots, but not the sdio-based wifi that we don't yet
have a driver for.
2014-02-13 04:10:27 +00:00
Ian Lepore
e4366cae40 Add standard non-removable and cd-gpios properties to the usdhc devices.
That generates references to gpio devices, so uncomment them even though
there isn't a gpio driver to do anything with them yet.
2014-02-13 03:41:00 +00:00
Ruslan Bukin
f3a72e40b5 Add drivers for:
- Enhanced Direct Memory Access Controller (eDMA)
- Direct Memory Access Multiplexer (DMAMUX)
2014-02-08 19:47:59 +00:00
Ed Maste
90990e3bc1 Build a 32-bit libstand under sys/boot/ for ppc64
This change is equivalent to r261567 for i386/amd64.

Sponsored by:	The FreeBSD Foundation
2014-02-07 22:49:42 +00:00
Ed Maste
b0b98e9752 Don't force efi to a 32-bit build on amd64
Sponsored by:	The FreeBSD Foundation
2014-02-07 16:28:40 +00:00
Ed Maste
5a989e68f6 Build a 32-bit libstand under sys/boot/
A 32-bit libstand is needed on 64-bit platforms for use by various
bootloaders.  Previously only the 32-bit version was built, installed as
/usr/lib/libstand.a.

A new 64-bit libstand consumer will arrive in the near future, so move
the bootloader-specific 32-bit version to sys/boot/libstand32/.

Explicitly link against this version in the 32-bit loaders.

Sponsored by:	The FreeBSD Foundation
2014-02-06 21:54:21 +00:00
Warren Block
665c90aa49 Describe the use of a freebsd-boot GPT partition, brought up by Scot
Hetzel <swhetzel@gmail.com> on the -doc mailing list.

Also modify the Author section to be clear that I wrote the man page,
not gptboot.

MFC after:	3 days
2014-02-05 18:26:30 +00:00
John Baldwin
e432d5f6a7 Drop the 3rd clause from all 3 clause BSD licenses where I am the sole
holder to convert them to 2 clause BSD licenses.

MFC after:	1 week
2014-02-05 18:13:27 +00:00
John Baldwin
96c3037416 Similar to r130943 for cdboot.S, update the license on this file to a
stock 2-clause BSD license.

MFC after:	1 week
2014-02-05 17:22:54 +00:00