Commit Graph

2679 Commits

Author SHA1 Message Date
Zbigniew Bodek
b462915513 Enable UART busy detection handling for Armada XP - based board
All Armada XP chips should be affected. It is necessary to handle
busy interrupt/indication by enabling busy-detect property in DTS.

Tested by:	kevlo
Approved by:	cognet (mentor)
2013-10-26 17:27:32 +00:00
Luiz Otavio O Souza
09b2544b71 Remove all the instances of '#undef DEBUG' from kernel.
Suggested by:	rpaulo
Approved by:	adrian (mentor)
2013-10-25 18:38:44 +00:00
Luiz Otavio O Souza
07897970fb Add the Raspberry Pi SPI controller driver.
Reviewed by:	rpaulo
Approved by:	adrian (mentor)
2013-10-24 16:27:33 +00:00
Luiz Otavio O Souza
be9ddf4313 Add the Raspberry Pi BSC (I2C compliant) controller driver.
Reviewed by:	rpaulo
Approved by:	adrian (mentor)
2013-10-23 12:29:39 +00:00
Ganbold Tsagaankhuu
ac022df310 Add FDT for Radxa Rock board and Rockchip RK3188 SoC.
Reviewed by: ray@
2013-10-23 00:35:58 +00:00
Jung-uk Kim
2481ce2f25 Allow users to set UUID in network byte order regardless of SMBIOS version.
Define BOOT_NETWORK_ENDIAN_UUID in make.conf(5) to enable this feature.
2013-10-22 21:32:28 +00:00
Brooks Davis
cb7de87666 Sync BERI kernel configs with P4:
Switch the majority of device configuration to FDT from hints.

Add BERI_*_BASE configs to reduce duplication in the MDROOT and SDROOT
kernels.

Add NFS and GSSAPI support by default.

MFC after:	3 days
Sponsored by:	DARPA/AFRL
2013-10-22 15:45:31 +00:00
Ian Lepore
7a2ed7a8f4 Add configuration for the Freescale i.MX53 Quick Start Board. 2013-10-20 21:21:07 +00:00
Ian Lepore
62e8bfb82a Switch to using the standard uart console driver instead of the special
driver for early boot debugging.
2013-10-20 21:03:15 +00:00
Mark Murray
cc4d059c03 Merge from project branch. Uninteresting commits are trimmed.
Refactor of /dev/random device. Main points include:

* Userland seeding is no longer used. This auto-seeds at boot time
on PC/Desktop setups; this may need some tweeking and intelligence
from those folks setting up embedded boxes, but the work is believed
to be minimal.

* An entropy cache is written to /entropy (even during installation)
and the kernel uses this at next boot.

* An entropy file written to /boot/entropy can be loaded by loader(8)

* Hardware sources such as rdrand are fed into Yarrow, and are no
longer available raw.

------------------------------------------------------------------------
r256240 | des | 2013-10-09 21:14:16 +0100 (Wed, 09 Oct 2013) | 4 lines

Add a RANDOM_RWFILE option and hide the entropy cache code behind it.
Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA.
Add the RANDOM_* options to LINT.

------------------------------------------------------------------------
r256239 | des | 2013-10-09 21:12:59 +0100 (Wed, 09 Oct 2013) | 2 lines

Define RANDOM_PURE_RNDTEST for rndtest(4).

------------------------------------------------------------------------
r256204 | des | 2013-10-09 18:51:38 +0100 (Wed, 09 Oct 2013) | 2 lines

staticize struct random_hardware_source

------------------------------------------------------------------------
r256203 | markm | 2013-10-09 18:50:36 +0100 (Wed, 09 Oct 2013) | 2 lines

Wrap some policy-rich code in 'if NOTYET' until we can thresh out
what it really needs to do.

------------------------------------------------------------------------
r256184 | des | 2013-10-09 10:13:12 +0100 (Wed, 09 Oct 2013) | 2 lines

Re-add /dev/urandom for compatibility purposes.

------------------------------------------------------------------------
r256182 | des | 2013-10-09 10:11:14 +0100 (Wed, 09 Oct 2013) | 3 lines

Add missing include guards and move the existing ones out of the
implementation namespace.

------------------------------------------------------------------------
r256168 | markm | 2013-10-08 23:14:07 +0100 (Tue, 08 Oct 2013) | 10 lines

Fix some just-noticed problems:

o Allow this to work with "nodevice random" by fixing where the
MALLOC pool is defined.

o Fix the explicit reseed code. This was correct as submitted, but
in the project branch doesn't need to set the "seeded" bit as this
is done correctly in the "unblock" function.

o Remove some debug ifdeffing.

o Adjust comments.

------------------------------------------------------------------------
r256159 | markm | 2013-10-08 19:48:11 +0100 (Tue, 08 Oct 2013) | 6 lines

Time to eat crow for me.

I replaced the sx_* locks that Arthur used with regular mutexes;
this turned out the be the wrong thing to do as the locks need to
be sleepable. Revert this folly.

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com> (In original diff)

------------------------------------------------------------------------
r256138 | des | 2013-10-08 12:05:26 +0100 (Tue, 08 Oct 2013) | 10 lines

Add YARROW_RNG and FORTUNA_RNG to sys/conf/options.

Add a SYSINIT that forces a reseed during proc0 setup, which happens
fairly late in the boot process.

Add a RANDOM_DEBUG option which enables some debugging printf()s.

Add a new RANDOM_ATTACH entropy source which harvests entropy from the
get_cyclecount() delta across each call to a device attach method.

------------------------------------------------------------------------
r256135 | markm | 2013-10-08 07:54:52 +0100 (Tue, 08 Oct 2013) | 8 lines

Debugging. My attempt at EVENTHANDLER(multiuser) was a failure; use
EVENTHANDLER(mountroot) instead.

This means we can't count on /var being present, so something will
need to be done about harvesting /var/db/entropy/... .

Some policy now needs to be sorted out, and a pre-sync cache needs
to be written, but apart from that we are now ready to go.

Over to review.

------------------------------------------------------------------------
r256094 | markm | 2013-10-06 23:45:02 +0100 (Sun, 06 Oct 2013) | 8 lines

Snapshot.

Looking pretty good; this mostly works now. New code includes:

* Read cached entropy at startup, both from files and from loader(8)
preloaded entropy. Failures are soft, but announced. Untested.

* Use EVENTHANDLER to do above just before we go multiuser. Untested.

------------------------------------------------------------------------
r256088 | markm | 2013-10-06 14:01:42 +0100 (Sun, 06 Oct 2013) | 2 lines

Fix up the man page for random(4). This mainly removes no-longer-relevant
details about HW RNGs, reseeding explicitly and user-supplied
entropy.

------------------------------------------------------------------------
r256087 | markm | 2013-10-06 13:43:42 +0100 (Sun, 06 Oct 2013) | 6 lines

As userland writing to /dev/random is no more, remove the "better
than nothing" bootstrap mode.

Add SWI harvesting to the mix.

My box seeds Yarrow by itself in a few seconds! YMMV; more to follow.

------------------------------------------------------------------------
r256086 | markm | 2013-10-06 13:40:32 +0100 (Sun, 06 Oct 2013) | 11 lines

Debug run. This now works, except that the "live" sources haven't
been tested. With all sources turned on, this unlocks itself in
a couple of seconds! That is no my box, and there is no guarantee
that this will be the case everywhere.

* Cut debug prints.

* Use the same locks/mutexes all the way through.

* Be a tad more conservative about entropy estimates.

------------------------------------------------------------------------
r256084 | markm | 2013-10-06 13:35:29 +0100 (Sun, 06 Oct 2013) | 5 lines

Don't use the "real" assembler mnemonics; older compilers may not
understand them (like when building CURRENT on 9.x).

# Submitted by:	Konstantin Belousov <kostikbel@gmail.com>

------------------------------------------------------------------------
r256081 | markm | 2013-10-06 10:55:28 +0100 (Sun, 06 Oct 2013) | 12 lines

SNAPSHOT.

Simplify the malloc pools; We only need one for this device.

Simplify the harvest queue.

Marginally improve the entropy pool hashing, making it a bit faster
in the process.

Connect up the hardware "live" source harvesting. This is simplistic
for now, and will need to be made rate-adaptive.

All of the above passes a compile test but needs to be debugged.

------------------------------------------------------------------------
r256042 | markm | 2013-10-04 07:55:06 +0100 (Fri, 04 Oct 2013) | 25 lines

Snapshot. This passes the build test, but has not yet been finished or debugged.

Contains:

* Refactor the hardware RNG CPU instruction sources to feed into
the software mixer. This is unfinished. The actual harvesting needs
to be sorted out. Modified by me (see below).

* Remove 'frac' parameter from random_harvest(). This was never
used and adds extra code for no good reason.

* Remove device write entropy harvesting. This provided a weak
attack vector, was not very good at bootstrapping the device. To
follow will be a replacement explicit reseed knob.

* Separate out all the RANDOM_PURE sources into separate harvest
entities. This adds some secuity in the case where more than one
is present.

* Review all the code and fix anything obviously messy or inconsistent.
Address som review concerns while I'm here, like rename the pseudo-rng
to 'dummy'.

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com> (the first item)

------------------------------------------------------------------------
r255319 | markm | 2013-09-06 18:51:52 +0100 (Fri, 06 Sep 2013) | 4 lines

Yarrow wants entropy estimations to be conservative; the usual idea
is that if you are certain you have N bits of entropy, you declare
N/2.

------------------------------------------------------------------------
r255075 | markm | 2013-08-30 18:47:53 +0100 (Fri, 30 Aug 2013) | 4 lines

Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the
usual harvest queues. It was a nifty idea, but too heavyweight.

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com>

------------------------------------------------------------------------
r255071 | markm | 2013-08-30 12:42:57 +0100 (Fri, 30 Aug 2013) | 4 lines

Separate out the Software RNG entropy harvesting queue and thread
into its own files.

# Submitted by:	 Arthur Mesh <arthurmesh@gmail.com>

------------------------------------------------------------------------
r254934 | markm | 2013-08-26 20:07:03 +0100 (Mon, 26 Aug 2013) | 2 lines

Remove the short-lived namei experiment.

------------------------------------------------------------------------
r254928 | markm | 2013-08-26 19:35:21 +0100 (Mon, 26 Aug 2013) | 2 lines

Snapshot; Do some running repairs on entropy harvesting. More needs
to follow.

------------------------------------------------------------------------
r254927 | markm | 2013-08-26 19:29:51 +0100 (Mon, 26 Aug 2013) | 15 lines

Snapshot of current work;

1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific
or close enough to the Yarrow algorithm. For the rest use a neutral
name.

2) Tidy up headers; put private stuff in private places. More could
be done here.

3) Streamline the hashing/encryption; no need for a 256-bit counter;
128 bits will last for long enough.

There are bits of debug code lying around; these will be removed
at a later stage.

------------------------------------------------------------------------
r254784 | markm | 2013-08-24 14:54:56 +0100 (Sat, 24 Aug 2013) | 39 lines

1) example (partially humorous random_adaptor, that I call "EXAMPLE")
 * It's not meant to be used in a real system, it's there to show how
   the basics of how to create interfaces for random_adaptors. Perhaps
   it should belong in a manual page

2) Move probe.c's functionality in to random_adaptors.c
 * rename random_ident_hardware() to random_adaptor_choose()

3) Introduce a new way to choose (or select) random_adaptors via tunable
"rngs_want" It's a list of comma separated names of adaptors, ordered
by preferences. I.e.:
rngs_want="yarrow,rdrand"

Such setting would cause yarrow to be preferred to rdrand. If neither of
them are available (or registered), then system will default to
something reasonable (currently yarrow). If yarrow is not present, then
we fall back to the adaptor that's first on the list of registered
adaptors.

4) Introduce a way where RNGs can play a role of entropy source. This is
mostly useful for HW rngs.

The way I envision this is that every HW RNG will use this
functionality by default. Functionality to disable this is also present.
I have an example of how to use this in random_adaptor_example.c (see
modload event, and init function)

5) fix kern.random.adaptors from
kern.random.adaptors: yarrowpanicblock
to
kern.random.adaptors: yarrow,panic,block

6) add kern.random.active_adaptor to indicate currently selected
adaptor:
root@freebsd04:~ # sysctl kern.random.active_adaptor
kern.random.active_adaptor: yarrow

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com>

Submitted by:	Dag-Erling Smørgrav <des@FreeBSD.org>, Arthur Mesh <arthurmesh@gmail.com>
Reviewed by:	des@FreeBSD.org
Approved by:	re (delphij)
Approved by:	secteam (des,delphij)
2013-10-12 12:57:57 +00:00
John Baldwin
bf5147c58b Sanitize the %eflags returned by BIOS routines. Some BIOS routines enter
protected mode and may leave protected-mode-specific flags like PSL_NT set
when they return to real mode.  This can cause a fault when BTX re-enters
protected mode after the BIOS mode returns.

PR:		amd64/182740
Reported by:	Julian Pidancet <julian.pidancet@gmail.com>
Approved by:	re (gjb)
MFC after:	1 week
2013-10-10 19:51:38 +00:00
Mark Murray
1a3c1f06dd Snapshot.
Looking pretty good; this mostly works now. New code includes:

* Read cached entropy at startup, both from files and from loader(8) preloaded entropy. Failures are soft, but announced. Untested.

* Use EVENTHANDLER to do above just before we go multiuser. Untested.
2013-10-06 22:45:02 +00:00
Sergey Kandaurov
05d98029e9 Sweep man pages replacing ad -> ada.
Approved by:	re (blackend)
MFC after:	1 week
X-MFC note:	stable/9 only
2013-10-01 18:41:53 +00:00
Bryan Drewery
cd4bd9496e Use MK_SSP=no after including bsd.own.mk to disable SSP instead of user-knob
WITH[OUT]_SSP to avoid hitting an error if user has WITH_SSP in their
make.conf. Ports now use this knob.

  make[7]: "/usr/src/share/mk/bsd.own.mk" line 466: WITH_SSP and
  WITHOUT_SSP can't both be set.

This is similar to previous cleanup done in r188895

Approved by:	bapt
Reviewed by:	jlh (earlier version)
Approved by:	re (marius)
MFC after:	1 week
2013-09-29 20:20:17 +00:00
Andrew Turner
ca49624410 Fix ixp425 boot2 with ARM EABI:
- libkern is missing __aeabi_llsl, implement this by calling __ashldi3.
 - Because of how the asm entry macros are defined the boot2 code
   requires the unwind symbols to exist, include them in boot2.

Approved by:	re (marius)
2013-09-29 15:19:34 +00:00
Rui Paulo
530031a8f1 Initial support for the Digi ConnectCore(c) i.MX53 / Wi-i.MX53 boards.
There are many drivers missing, but we can reach single user mode now.

Hardware graciously donated by Douglas Beattie.
2013-09-01 20:15:35 +00:00
Devin Teske
f8dfdfbf4c Update copyright. 2013-08-27 06:09:28 +00:00
Devin Teske
e44da61e69 Building upon SVN r254237, disable automated activation of alternate layouts
and add support for default underride to $loader_version, acting as a way to
name a release. Release text is not displayed for the aforementioned feature
of alternate display layout (introduced in r254237); however, for all other
layouts (incl. default), the release name is displayed at lower-right.

See version.4th(8) for additional information and/or historical details.
NOTE: Also a minor edit to version.4th(8) while we're here.
2013-08-26 23:37:11 +00:00
Jung-uk Kim
ce7707b487 Set the hint for physical address of RSDP in hexadecimal as before r223262. 2013-08-23 18:52:36 +00:00
Ian Lepore
aef60d8c4a Add support for uarts other than the serial console in TI OMAP SoCs.
The TI uart hardware is ns16550-compatible, except that before it can
be used the clocks and power have to be enabled and a non-standard
mode control register has to be set to put the device in uart mode
(as opposed to irDa or other serial protocols).  This adds the extra
code in an extension to the standard ns8250 probe routine, and the
rest of the driver is just the standard ns8250 code.
2013-08-21 14:33:02 +00:00
Ian Lepore
59769a581f Make the standard sdhci(4) driver work for the TI OMAP family SoCs.
The MMCHS hardware is pretty much a standard SDHCI v2.0 controller with a
couple quirks, which are now supported by sdhci(4) as of r254507.

This should work for all TI SoCs that use the MMCHS hardware, but it has
only been tested on AM335x right now, so this enables it on those platforms
but leaves the existing ti_mmchs driver in place for other OMAP variants
until they can be tested.

This initial incarnation lacks DMA support (coming soon).  Even without it
this improves performance pretty noticibly over the ti_mmchs driver,
primarily because it now does multiblock IO.
2013-08-20 12:33:35 +00:00
Devin Teske
ea14379eaa Add optional support for default override of standard setup; but only if
corresponding functions are provided. If override function does not exist,
boot remains unmodified. This patch should not result in any changes.
2013-08-12 03:52:23 +00:00
Marcel Moolenaar
d6c0f33b57 Fix the freaddir implementation for the stand-alone interpreter.
Bug pointed out by: Jan Beich <jbeich@tormail.org>
2013-08-09 19:10:56 +00:00
Devin Teske
5b502b3b4c Update legacy static assignments in old code to support dynamic framing,
plotting, and alignment coinciding with enhancements in SVN r242667.
2013-08-08 22:34:00 +00:00
Devin Teske
5e82c321f8 Since the introduction of SVN r244048 and [follow-up] r244089, it is now
safe to build upon ``boot_serial?'' functionality to make safer UI choices.
2013-08-08 22:09:46 +00:00
Andrey V. Elsukov
4371b649aa Make the check for number of entries less strict.
Some partitioning tools can create GPT with number of entries less
than 128.

MFC after:	1 week
2013-08-08 11:24:25 +00:00
Ganbold Tsagaankhuu
696ec285aa Bring initial support for Allwinner A20 SoC (Cubieboard2).
Add support for A20 timer.
	Correct interrupt offset depending from chip.
	Add basic code for CPU configuration module.
	For now, add kernel config and dts file
	(only FDT blob related problem needs to be solved later in
	order to have one kernel for both cubieboard1 and 2).

Approved by: ray@
2013-08-07 11:07:56 +00:00
Marcel Moolenaar
e01c6f329a Change <sys/diskpc98.h> to not redefine the same symbols that are
being defined in <sys/diskmbr.h>. Instead give the symbols here a
"PC98_" prefix. This way, both <sys/diskmbr.h> and <sys/diskpc98.h>
can be included in the same C source file.

The renaming is trivial. The only gotcha is that DOSBBSECTOR is
also redefined from 0 to 1. This because DOSBBSECTOR was always
used in conjunction with an addition of 1. The PC98_BBSECTOR symbol
is defined as 1 and the expression is simplified.

Note: it is not believed that ports are seriously impacted; or at
all for that matter.

Approved by: nyan@
2013-08-07 00:00:48 +00:00
Olivier Houchard
7497e6267c Let the platform calculate the timer frequency at runtime, and use that for
the omap4, instead of relying on the (wrong) value provided in the dts.
2013-08-05 20:14:56 +00:00
Marcel Moolenaar
04ae0d7cc5 Fix the build of the testmain target. This target compiles a Forth
interpreter that can be run on the system and as such cannot be
compiled against libbstand. On the one hand this means we need to
include the usual headers for system interfaces that we use and
on the the other hand we can only use standard system interfaces.

While here, define local variables only when needed to make this
WARNS=2 clean on amd64.

PR:		172542
Obtained from:	peterj@
Pointed out by: Jan Beich <jbeich@tormail.org>
2013-08-01 18:06:58 +00:00
Rui Paulo
caa18d0c6c Add definitions for the Mailbox, Spinlock and PRU-ICSS devices. 2013-07-31 06:23:10 +00:00
Tim Kientzle
9759c7e7d2 Put in commented-out version of beastie menu commands
so that non-i386 users can easily experiment with this.
2013-07-27 18:19:28 +00:00
Tim Kientzle
183abe44fa Install Forth infrastructure along with ubldr.
Note:  loader.rc is installed as loader.rc.sample
so that by default, none of this is actually used.
2013-07-27 18:18:46 +00:00
Marcel Moolenaar
68fd965f98 Add 2 builtin words for working with directories:
isdir?		( fd -- bool )
	freaddir	( fd -- ptr len TRUE | FALSE )

The 'isdir?' word returns `true' if the file descriptor is for a
directory and `false' otherwise.

The 'freaddir' word reads the next directory entry and if successful,
returns its name and 'true'. Otherwise 'false' is returned.

These words give the loader the ability to scan directories and read
files contained in them for 'rc.d'-like flexibility in handling which
modules to load and/or which tunables to set.

Obtained from:	Juniper Networks, Inc.
2013-07-10 21:37:50 +00:00
Andriy Gapon
e4616f7bfb default loader.conf: there is no need to load zpool.cache now
kernel does not need it for importing a root pool.

MFC after:	4 weeks
2013-07-09 08:40:05 +00:00
Oleksandr Tymoshenko
4bab064ca8 - MMC1 (internal eMMC) pins should be configured as input-pullup, except
for reset pin
2013-07-08 04:30:12 +00:00
Oleksandr Tymoshenko
36b2854b79 - Add musb node to shared dtsi and proper pin configuratin for every
AM553x-based device
2013-07-07 04:23:29 +00:00
Oleksandr Tymoshenko
ef2f66be5b Add nodes for PWMSS1 and PWMSS2 2013-07-04 20:08:42 +00:00
Warren Block
9ce127ad76 Add descriptions to the FILES list, fix some mdoc complaints, move the
"neither" entry out of the table in BOOTING.

Submitted by:	joeld
Reviewed by:	joeld
MFC after:	1 week
2013-07-03 18:53:36 +00:00
Warren Block
42c916d7ee Add a new gptboot(8) man page. Factor out the redundant information
in gpart(8) and boot(8), adding references to gptboot(8) in both.

Reviewed by:	jhb, ae, pjd, Paul Schenkeveld <bsdcan@psconsult.nl>, david_a_bright@dell.com (portions), gjb
MFC after:	1 week
2013-07-01 22:38:36 +00:00
Rui Paulo
236bc8374d Split bcm2835-rpi-b.dts into bcm2835.dtsi and rpi.dts. This DTS actually works
on all R-Pi models because VideoCore binary patches it during boot.

Reviewed by:	gonzo
2013-07-01 05:01:01 +00:00
Aleksandr Rybalko
83bee1a9ba Add FDT for Arndale board and Samsung Exynos5250 SoC.
Submitted by:	Ruslan Bukin <br@bsdpad.com>
2013-06-29 12:24:11 +00:00
Marius Strobl
2fbad3a135 - The method introduced as part of r234898 for not altering the boot path
when booting from ZFS turned out to also cause the boot path not being
  adjusted if booting from CD-ROM with firmware versions that do not employ
  the "cdrom" alias in that case. So shuffle the code around instead in order
  to achieve the original intent. Ideally, we shouldn't fiddle with the boot
  path when booting from UFS on a disk either; unfortunately, there doesn't
  seem to be an universal way of telling disks and CD-ROMs apart, though. [1]
- Use NULL instead of 0 for pointers.

PR:		179289
MFC after:	1 week
2013-06-09 23:50:30 +00:00
Tijl Coosemans
53089271a1 Convert old make variable modifiers :U and :L to bmake :tu and :tl.
Reviewed by:	sjg
2013-06-02 11:44:23 +00:00
Yoshihiro Takahashi
9a068b2e34 MFi386: revision 245848
Always update the hw.uart.console hint.
2013-06-01 12:27:48 +00:00
Oleksandr Tymoshenko
b0dcf6c59c Add DTS for AM335x EVM with properly muxed PWM and LCD pins, and
LCD panel description
2013-05-27 00:26:29 +00:00
Oleksandr Tymoshenko
2389b66f69 Add PWM and LCDC nodes to base DTS for AM335x-based devices 2013-05-27 00:23:59 +00:00
Tim Kientzle
3f15ba3d2c Correct the spelling of "okay".
Add pinmux setting for the Reset GPIO pin for MMC1.
2013-05-18 12:54:37 +00:00
Tim Kientzle
2628555d5f Move 'compatible' line out of the common am335x.dtsi and into
the beaglebone-specific .dts file.

Add a new .dts for the BeagleBone Black with more memory,
slightly different pinmux initialization, and with mmchs1
configured (though the latter doesn't quite work yet).
2013-05-10 05:34:08 +00:00
John Baldwin
6c14193bd0 Don't pad disk partition sizes with leading zeros. This was already
fixed in a different way by the new disk code used for other
platforms.

MFC after:	1 week
2013-05-07 18:08:49 +00:00
Grzegorz Bernacki
99eef68204 Move initialization of CESA decoding windows from common section
to driver specific files.

- window initialization is done during device attach
- CESA TDMA decoding windows values are set based on DTS,
 not copied from CPU registers
- remove unnecessary virtual mapping
- update dts file

Obtained from: Semihalf
2013-05-06 13:34:36 +00:00
Wojciech A. Koszek
a9caca6a75 Add Xilinx Zynq ARM/FPGA SoC support to FreeBSD/arm port.
Submitted by:	Thomas Skibo <ThomasSkibo (at) sbcglobal.net>
Reviewed by:	wkoszek, freebsd-arm@ (no objections raised)
2013-04-27 22:38:29 +00:00
Oleksandr Tymoshenko
145f6092b9 Move pinmux configuration to board-specific config. It will vary
from board to board.
2013-04-26 17:27:53 +00:00
Dimitry Andric
dbfc29017c When rebooting (exiting) from the BTX loader, make sure to restore the
GDT from the correct segment, otherwise a triple fault would be caused.
In some virtual environments (VMware, VirtualBox, etc) this could lead
to a unhandled error or hang in the guest emulation software.

Thanks to avg and jhb for a few hints in the right direction.

Noticed by:	Jeremy Chadwick <jdc@koitsu.org> (and many others)
MFC after:	1 week
2013-04-24 17:20:45 +00:00
Oleksandr Tymoshenko
833addedf8 Split BeagleBone DTS to generic AM335x part and Beagle-bone specific 2013-04-22 18:53:36 +00:00
Andrey V. Elsukov
584a9cf8bf Since we didn't break the loop, we should set i to -1 to start from the
beginning.

Submitted by:	Steven Hartland
MFC after:	1 week
2013-04-21 09:10:35 +00:00
Tim Kientzle
a58e544f50 The CELL fields can be various integer types depending on the platform
(ARM uses 'int' and 'unsigned'; i386 uses 'long' and 'unsigned long'),
so we need explicit casts to long and unsigned long here to ensure
that the result matches the printf %ld and %lx specifiers.
2013-04-07 05:53:42 +00:00
Tim Kientzle
6f3d2cdd00 Fix two broken macros. 2013-04-07 05:40:49 +00:00
Andriy Gapon
a77cf1025c strncmp for boot code: fix an off by one error
Before this change strncmp would access and _compare_ n+1 characters
in the case where the first n characters match.

MFC after:	5 days
2013-04-05 09:14:30 +00:00
Ian Lepore
6fb87f7371 When running on armv6, set alignment checking to modulo-4 mode rather
than modulo-8, because clang emits ldrd and strd instructions for
addresses that are only 4-byte aligned
2013-03-31 22:43:16 +00:00
Tim Kientzle
2f37ec8b30 Initialize sym_count to 0.
This fixes a compiler warning introduced in r248121.
2013-03-30 16:33:16 +00:00
Aleksandr Rybalko
a2c472e741 Integrate Efika MX project back to home.
Sponsored by:	The FreeBSD Foundation
2013-03-20 15:39:27 +00:00
Ian Lepore
7554e820bb Attach the elf section headers to the loaded kernel as metadata, so
they can easily be used by later post-processing.  When searching for
a compiled-in fdt blob, use the section headers to get the size and
location of the .dynsym section to do a symbol search.

This fixes a problem where the search could overshoot the symbol
table and wander into the string table.  Sometimes that was harmless
and sometimes it lead to spurious panic messages about an offset
bigger than the module size.
2013-03-10 00:43:01 +00:00
Ian Lepore
dd9b8b36dd Since ubldr doesn't necessarily load a kernel at the physical address in the
elf headers, mask out the high nibble of that address.  This effectly makes
the entry point the offset from the load address, and it gets adjusted for
the actual load address before jumping to it.

Masking the high nibble makes assumptions about memory layout that are true
for all the arm platforms we support right now, but it makes me uneasy.
This needs to be revisited.
2013-03-09 23:05:19 +00:00
Ganbold Tsagaankhuu
341d7df3da Enable uart driver for A10.
Approved by: gonzo@
2013-03-01 01:47:11 +00:00
Ian Lepore
62e939ea17 Fix a typo that prevented booting a kernel that had virtual addresses in
the elf headers.
2013-02-27 19:59:41 +00:00
Ian Lepore
c6f9cfb723 Adjust the arm kernel entry point address properly regardless of whether the
e_entry field holds a physical or a virtual address.  Add a comment block
that explains the assumptions being made by the adjustment code.
2013-02-26 03:24:45 +00:00
Tim Kientzle
6d4a620eba Fix the bug I introduced in r247045.
After digging through more carefully, it looks like there's
no real need to have the DTB in the module directory.
So we can simplify a lot:  Just copy DTB into local heap
for "fdt addr" and U-Boot integration, drop all the extra
COPYIN() calls.

I've left one final COPYIN() to update the in-kernel DTB
for consistency with how this code used to work, but I'm
no longer convinced it's appropriate here.

I've also remove the mem_load_raw() utility that I added
to boot/common/module.c with r247045 since it's no longer
necessary.
2013-02-25 01:50:04 +00:00
Oleksandr Tymoshenko
c84251eb7e - Move dma, sdhci and mbox nodes down in dts in order to get them
initialized after FPIO controller since they might rely on GPIO
    functionality

- Update interrupts property of dma node to contain all allocated
    interrupts
2013-02-23 23:22:48 +00:00
Tim Kientzle
3bb97cef07 "fdt addr" gets run from loader.rc before the kernel is loaded.
This was broken by r247045 which tried to copy the FDT into the
module directory immediately.
Instead, store the address and arrange for the FDT to get
copied into the module directory later when the usual
FDT initialization runs.
2013-02-23 20:34:47 +00:00
Tim Kientzle
7beaf3ae9b Print kernel args as late as possible before jumping into kernel. 2013-02-23 20:27:03 +00:00
Konstantin Belousov
31a53cd036 Convert machine/elf.h, machine/frame.h, machine/sigframe.h,
machine/signal.h and machine/ucontext.h into common x86 includes,
copying from amd64 and merging with i386.

Kernel-only compat definitions are kept in the i386/include/sigframe.h
and i386/include/signal.h, to reduce amd64 kernel namespace pollution.
The amd64 compat uses its own definitions so far.

The _MACHINE_ELF_WANT_32BIT definition is to allow the
sys/boot/userboot/userboot/elf32_freebsd.c to use i386 ELF definitions
on the amd64 compile host.  The same hack could be usefully abused by
other code too.
2013-02-20 17:39:52 +00:00
Tim Kientzle
f87223581e Fix "fdt addr" to accept literal addresses rather than va offsets.
When initializing the fdt, query U-Boot as well.

With this change, it is now feasible to have U-Boot load
the FDT, ubldr will pull it from U-Boot and hand it to the
kernel.
2013-02-20 16:32:38 +00:00
Tim Kientzle
3e256ed764 Add mem_load_raw() for loading data from another location in memory.
This will be used by some upcoming changes to loader(8) FDT
handling to allow it to use an FDT provided by an earlier
boot stage the same as an FDT loaded from disk.
2013-02-18 23:13:13 +00:00
Tim Kientzle
3772ab21ab Clarify an error message. The addresses here are
really offsets within the primary mapped memory block
(which may not start at address zero).
2013-02-18 20:11:20 +00:00
Oleksandr Tymoshenko
aaa54dd138 Enable USB1 (which is EHCI0) for Allwinner A10
Tested by: ganbold@
2013-02-15 21:29:03 +00:00
Oleksandr Tymoshenko
3748deb755 Add watchdog driver for Allwinner A10 2013-02-11 11:31:23 +00:00
Tim Kientzle
53d21f0bbe Provide verbose help for fdt commands on platforms that use it. 2013-02-11 02:15:26 +00:00
Andrey V. Elsukov
c6e31e81e0 Add bootcamp support to the loader.
Tested by:	dchagin
MFC after:	1 week
2013-02-10 19:27:17 +00:00
Hans Petter Selasky
6950c75f40 - Move scratch data from the USB bus structure to the USB device structure
so that simultaneous access cannot happen. Protect scratch area using
the enumeration lock. Also reduce stack usage in usbd_transfer_setup()
by moving some big stack members to the scratch area. This saves around
200 bytes of stack.
- Fix a whitespace.

MFC after:	1 week
2013-02-10 10:56:13 +00:00
Hans Petter Selasky
c3400997c4 Correctly list the usbloader dependencies. 2013-02-08 23:13:46 +00:00
Andrew Turner
f892543501 * Add the integer div & mod functions and ARM EABI support functions to
libstand.
* Stop linking the ARM U-Boot loader against libgcc now libstand has the
  required symbols.
2013-02-05 20:03:58 +00:00
Hans Petter Selasky
9b3a48ee6f Add defines to more easily allow a single threaded version of the FreeBSD
USB stack. This is useful for non-kernel purposes, like the loader.
2013-02-05 14:44:25 +00:00
Hans Petter Selasky
4b037d67aa Fix depend target. 2013-02-05 12:37:50 +00:00
Ganbold Tsagaankhuu
d9a1428cab Add gpio driver and update dts and kernel config accordingly.
Approved by: gonzo@
2013-02-05 02:25:13 +00:00
Hans Petter Selasky
77a9c69878 Initial version of libusbboot, a fully stand-alone, single threaded and
functional compilation of the FreeBSD USB stack for use with boot loaders
and such.

Discussed with:		Hiroki Sato, hrs @ EuroBSDCon
2013-01-31 11:00:57 +00:00
Ian Lepore
33f9e1bd94 Do metadata relocation fixup on all loaded modules, not just the kernel.
Approved by:	cognet (mentor)
2013-01-30 23:49:36 +00:00
Ganbold Tsagaankhuu
458690fe41 Add simple clock driver and ehci glue code for a10
Update dts and kernel config

Approved by: gonzo@
2013-01-29 07:21:50 +00:00
Damjan Marion
d6f0d96723 Configure all GPIO pins as described in Beaglebone SRM.
Submitted by:   Emmanuel Vadot <elbarto@megadrive.org>
2013-01-28 09:47:00 +00:00
Ian Lepore
ecfc48a031 Add support for the GlobalScale Technologies DreamPlug computer.
This adds support for version 10, revision 01, but it should also work
without changes for the 0901 model, at least until we get drivers for the
two different wifi chips involved.

Many users contributed to and tested the various patchsets floating around
for the past year that have eventually evolved into this checkin, most notably
Richard Neese who provided the bulk of the kernel config file.

Approved by:	cognet (mentor)
2013-01-27 01:17:37 +00:00
Ganbold Tsagaankhuu
c0c4446155 Fix method of naming compatible string to follow
"<manufacturer>,<model>" as described in
http://www.devicetree.org/Device_Tree_Usage

Reviewed by: andrew@
Approved by: gonzo@
2013-01-25 07:21:22 +00:00
John Baldwin
44e54f208a Always update the hw.uart.console hint anytime a change is made to the
comconsole setup.  Previously the hint would be set when if you set a
custom port, but it would not be updated if you later set a custom speed.

Also, leave the hw.uart.console hint mutable so it can be overridden or
unset by the user if needed.

Reviewed by:	kib (earlier version)
MFC after:	1 week
2013-01-23 18:34:21 +00:00
Benno Rice
5660634004 Fix linking of loader.efi.
gcc handles -symbolic by passing -Bsymbolic through to ld. clang ignores
-symbolic and thus invokes ld without -Bsymbolic which leads to some symbols
not being properly linked in loader.efi. Fix this by using -Wl,-Bsymbolic which
passes -Bsymbolic to ld in both the gcc and clang cases.

Approved by:	rpaulo
2013-01-22 04:14:27 +00:00
Tim Kientzle
6f91e2520b Use correct size for AM335x CPSW memory window. 2013-01-21 01:02:49 +00:00
Andriy Gapon
4afa5361cc zfs/sparc64 boot: fix booting after r242230
arch_zfs_probe method is supposed to only probe for ZFS vdevs, but it can
not expect that ZFS data is in a ready state yet.
So, move some code from sparc64_zfs_probe to main to meet the constraints.

Reported by:	Chris Ross <cross+freebsd@distal.com>
Tested by:	Chris Ross <cross+freebsd@distal.com>
MFC after:	4 days
2013-01-20 19:55:49 +00:00
Andrew Turner
6c71f24345 Link against compiler-rt to pull in the required __aeabi_* functions 2013-01-19 22:12:57 +00:00
Tim Kientzle
3f67e83a60 Use correct GPIO interrupt lines. 2013-01-19 17:22:12 +00:00
Ganbold Tsagaankhuu
ebc93265c7 Initial support for Allwinner A10 SoC (Cubieboard)
Add simple console driver
	Add interrupt handling and timer codes
	Add kernel config file
	Add dts file
Approved by: gonzo
2013-01-15 08:26:16 +00:00
Sean Bruno
b9fd59b70c Quiesce some clang warnings while we're here doing stuff.
Submitted by:	Hiren Panchasara <hiren.panchasara@gmail.com>
Obtained from:	Yahoo! Inc
2013-01-14 15:05:22 +00:00
Peter Grehan
fc1ae0bc42 Bring in some userboot changes from the bhyve branch to reduce diffs.
r238966
  Bump up the heap size to 1MB. With a few kernel modules, libstand
  zalloc and userboot seem to want to use ~600KB of heap space, which
  results in a segfault when malloc fails in bhyveload.

r241180
  Clarify comment about default number of FICL dictionary cells.

r241153
  Allow the number of FICL dictionary cells to be overridden.
  Loading a 7.3 ISO with userboot/amd64 takes up 10035 cells,
  overflowing the long-standing default of 10000.

  Bump userboot's value up to 15000 cells.

Reviewed by:	dteske (r238966,241180)
Obtained from:	NetApp
2013-01-08 03:27:37 +00:00