Commit Graph

2768 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
4a9af7d53f Add the initial version of if_nf10bmac(4), a driver to support an
NetFPGA-10G Embedded CPU Ethernet Core.

The current version operates on a simple PIO based interface connected
to a NetFPGA-10G port.

To avoid confusion: this driver operates on a CPU running on the FPGA,
e.g. BERI/mips, and is not suited for the PCI host interface.

MFC after:	1 week
Relnotes:	yes
Sponsored by:	DARPA/AFRL
2014-04-17 12:33:26 +00:00
Christian Brueffer
5c3739b2f2 Re-indent break statement.
MFC after:	1 week
2014-04-14 22:49:37 +00:00
Rui Paulo
4566dd369d Improve the i.MX53 / Digi DTS:
* Fix the IPU address.
* Fix the PATA definition.
* Add another I2C.
* Add more UARTs.
* Add SATA.
2014-04-13 22:35:39 +00:00
Nathan Whitehorn
5e1254e13b Apparently some of the i386 boot blocks are so close to full that adding
single lines to ufsread.c spills them over. Duplicate a whole bunch of
code to get file sizes into boot1.efi/boot1.c rather than modifying
ufsread.c.
2014-04-13 14:50:52 +00:00
Nathan Whitehorn
2a11027fd3 Add my copyright here. Most of this is unmodified from the original sparc64
version, but at least some indication of changes that postdate the actual
invention of EFI is probably a good idea.
2014-04-13 06:30:02 +00:00
Nathan Whitehorn
40adc3db02 Fix buildworld. I had some local bits in my build tree that caused this
to work by accident.
2014-04-13 06:24:01 +00:00
Warner Losh
3bdf775801 NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
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.
2014-04-13 05:21:56 +00:00
Nathan Whitehorn
337bb26472 Add a simple EFI stub loader. This is a quick and dirty of boot1.chrp from
the PowerPC port with all the Open Firmware bits removed and replaced by
their EFI counterparts. On the whole, I think I prefer Open Firmware.

This code is supposed to be an immutable shim that sits on the EFI system
partition, loads /boot/loader.efi from UFS and tells the real loader what
disk/partition to look at. It finds the UFS root partition by the somewhat
braindead approach of picking the first UFS partition it can find. Better
approaches are called for, but this works for now. This shim loader will
also be useful for secure boot in the future, which will require some
rearchitecture.
2014-04-13 01:14:25 +00:00
Ed Maste
7a5f5e3794 Fix EFI loader object tree creation on 9.x build hosts
Previously ${COMPILER_TYPE} was checked in sys/boot/amd64, and the efi
subdirectory was skipped altogether for gcc (since GCC does not support
a required attribute).  However, during the early buildworld stages
${COMPILER_TYPE} is the existing system compiler (i.e., gcc on 9.x build
hosts), not the compiler that will eventually be used.  This caused
"make obj" to skip the efi subdirectory.  In later build stages
${COMPILER_TYPE} is "clang", and then the efi loader would attempt to
build in the source directory.

Sponsored by:	The FreeBSD Foundation
2014-04-10 16:53:21 +00:00
Ed Maste
9e61717ac8 (Re)connect sys/boot/amd64 to the build
Sponsored by:	The FreeBSD Foundation
2014-04-08 19:19:58 +00:00
Ed Maste
b900a57189 Add explicit casts to quiet warnings in libefi
Sponsored by:	The FreeBSD Foundation
2014-04-08 18:21:38 +00:00
Ed Maste
f58d027be1 Fix printf args for 64-bit archs
Sponsored by:	The FreeBSD Foundation
2014-04-08 18:02:32 +00:00
Ed Maste
6cf1ada9e1 Correct a variable's type for 64-bit Ficl
FICL_INT is long.
2014-04-08 17:50:27 +00:00
Ed Maste
6d2723543a Revert r264132, disconnecting sys/boot/amd64 for now
Some 64-bit Ficl warnings broke tinderbox builds.
2014-04-08 17:40:09 +00:00
Rui Paulo
9e63671c57 Updates to i.MX53:
* Define support for the SDHCI driver, although it doesn't work yet
* Fix the memory mappings for IPU [1]

Reviewed by:	ray [1]
2014-04-08 04:05:04 +00:00
Warner Losh
29aa8ff1dd These were bogusly placed in the arm directory. Move them to their
proper location in powerpc directory.
2014-04-07 16:38:31 +00:00
Ed Maste
731d7808a3 Do not build the amd64 UEFI loader with GCC
The UEFI loader causes buildworld to fail when building with (in-tree)
GCC, due to a typedef redefinition.  As it happens the in-tree GCC
cannot successfully build the UEFI loader anyhow, as it does not support
__attribute__((ms_abi)).  Thus, just avoid trying to build it with GCC,         rather than disconnecting it from the build until the underlying issue
is fixed.

Sponsored by:	The FreeBSD Foundation
2014-04-07 00:49:15 +00:00
Rui Paulo
1c6ca154ca Fix the memory region. This board has two memory regions. 2014-04-06 23:22:42 +00:00
Ian Lepore
210c907c98 Define the full 1024M of ram on the imx53 QSB board. 2014-04-06 21:45:38 +00:00
Warner Losh
99bccc04fc Fix the mips64el build: mips64el should use the mips64 directory, not the mips64el directory. 2014-04-06 19:51:57 +00:00
Ed Maste
3d79118758 Connect sys/boot/amd64 to the build
Sponsored by:	The FreeBSD Foundation
2014-04-04 18:07:21 +00:00
Ed Maste
7de2785827 Fix printf format mismatches
Sponsored by:	The FreeBSD Foundation
2014-04-04 13:35:36 +00:00
Ian Lepore
ef3c56a250 Various fixes to the ti_sdhci driver, mostly to make it work on Pandaboard.
- Don't allow high-speed mode on OMAP4 due to hardware erratum.
 - Check the proper bit in the status register when waiting for the
   controller to come out of reset.
 - Add handling for the "non-removable" fdt property by always returning
   "card is present" status.
 - Add the non-removable property for the MMC card on a Beaglebone Black.
 - Add the non-removable property for Pandaboard as a workaround.

For Pandaboard the card detect pin is handled by the twl6030 fpga device
which gets an interrupt on pin change and then has to query the fpga
for the actual status.  We don't have code to do that yet.

Submitted by:	Svatopluk Kraus <onwahe@gmail.com>
2014-04-04 00:59:40 +00:00
Ed Maste
8c00aba8c4 Support UEFI booting on amd64 via loader.efi
This is largely the work from the projects/uefi branch, with some
additional refinements.  This is derived from (and replaces) the
original i386 efi implementation; i386 support will be restored later.

Specific revisions of note from projects/uefi:

r247380:

  Adjust our load device when we boot from CD under UEFI.

  The process for booting from a CD under UEFI involves adding a FAT
  filesystem containing your loader code as an El Torito boot image.
  When UEFI detects this, it provides a block IO instance that points at
  the FAT filesystem as a child of the device that represents the CD
  itself. The problem being that the CD device is flagged as a "raw
  device" while the boot image is flagged as a "logical partition". The
  existing EFI partition code only looks for logical partitions and so
  the CD filesystem was rendered invisible.

  To fix this, check the type of each block IO device. If it's found to
  be a CD, and thus an El Torito boot image, look up its parent device
  and add that instead so that the loader will then load the kernel from
  the CD filesystem.  This is done by using the handle for the boot
  filesystem as an alias.

  Something similar to this will be required for booting from other
  media as well as the loader will live in the EFI system partition, not
  on the partition containing the kernel.

r246231:

  Add necessary code to hand off from loader to an amd64 kernel.

r246335:

  Grab the EFI memory map and store it as module metadata on the kernel.

  This is the same approach used to provide the BIOS SMAP to the kernel.

r246336:

  Pass the ACPI table metadata via hints so the kernel ACPI code can
  find them.

r246608:

  Rework copy routines to ensure we always use memory allocated via EFI.

  The previous code assumed it could copy wherever it liked. This is not
  the case. The approach taken by this code is pretty ham-fisted in that
  it simply allocates a large (32MB) buffer area and stages into that,
  then copies the whole area into place when it's time to execute. A more
  elegant solution could be used but this works for now.

r247214:

  Fix a number of problems preventing proper handover to the kernel.

  There were two issues at play here. Firstly, there was nothing
  preventing UEFI from placing the loader code above 1GB in RAM. This
  meant that when we switched in the page tables the kernel expects to
  be running on, we are suddenly unmapped and things no longer work. We
  solve this by making our trampoline code not dependent on being at any
  given position and simply copying it to a "safe" location before
  calling it.

  Secondly, UEFI could allocate our stack wherever it wants. As it
  happened on my PC, that was right where I was copying the kernel to.
  This did not cause happiness. The solution to this was to also switch
  to a temporary stack in a safe location before performing the final
  copy of the loaded kernel.

r246231:

  Add necessary code to hand off from loader to an amd64 kernel.

r246335:

  Grab the EFI memory map and store it as module metadata on the kernel.

  This is the same approach used to provide the BIOS SMAP to the kernel.

r246336:

  Pass the ACPI table metadata via hints so the kernel ACPI code can
  find them.

r246608:

  Rework copy routines to ensure we always use memory allocated via EFI.

  The previous code assumed it could copy wherever it liked. This is not
  the case. The approach taken by this code is pretty ham-fisted in that
  it simply allocates a large (32MB) buffer area and stages into that,
  then copies the whole area into place when it's time to execute. A more
  elegant solution could be used but this works for now.

r247214:

  Fix a number of problems preventing proper handover to the kernel.

  There were two issues at play here. Firstly, there was nothing
  preventing UEFI from placing the loader code above 1GB in RAM. This
  meant that when we switched in the page tables the kernel expects to
  be running on, we are suddenly unmapped and things no longer work. We
  solve this by making our trampoline code not dependent on being at any
  given position and simply copying it to a "safe" location before
  calling it.

  Secondly, UEFI could allocate our stack wherever it wants. As it
  happened on my PC, that was right where I was copying the kernel to.
  This did not cause happiness. The solution to this was to also switch
  to a temporary stack in a safe location before performing the final
  copy of the loaded kernel.

r247216:

  Use the UEFI Graphics Output Protocol to get the parameters of the
  framebuffer.

Sponsored by:	The FreeBSD Foundation
2014-04-04 00:16:46 +00:00
Ed Maste
b4b05481d9 Add -fPIC for amd64
Sponsored by:	The FreeBSD Foundation
2014-04-03 23:10:23 +00:00
Ed Maste
ee83e77448 Merge efilib changes from projects/uefi
r247216:

  Add the ability for a device to have an "alias" handle.

r247379:

  Fix network device registration.

r247380:

  Adjust our load device when we boot from CD under UEFI.

  The process for booting from a CD under UEFI involves adding a FAT
  filesystem containing your loader code as an El Torito boot image.
  When UEFI detects this, it provides a block IO instance that points
  at the FAT filesystem as a child of the device that represents the CD
  itself. The problem being that the CD device is flagged as a "raw
  device" while the boot image is flagged as a "logical partition".
  The existing EFI partition code only looks for logical partitions and
  so the CD filesystem was rendered invisible.

  To fix this, check the type of each block IO device. If it's found to
  be a CD, and thus an El Torito boot image, look up its parent device
  and add that instead so that the loader will then load the kernel from
  the CD filesystem.  This is done by using the handle for the boot
  filesystem as an alias.

  Something similar to this will be required for booting from other media
  as well as the loader will live in the EFI system partition, not on the
  partition containing the kernel.

r247381:

  Remove a scatalogical debug printf that crept in.
2014-04-03 21:39:59 +00:00
Ed Maste
04555dfd89 Build boot/ficl as 64-bit library on amd64
The 32-bit bootloaders on amd64 now use the 32-bit version in ficl32,
as is done with libstand32.  The native 64-bit ficl will be used by the
upcoming UEFI loader.

Sponsored by:	The FreeBSD Foundation
2014-04-03 21:18:03 +00:00
Ed Maste
772d1a1bba Put each source file on a separate line
This will simplify rebasing the amd64 UEFI patch set.

Sponsored by:	The FreeBSD Foundation
2014-04-03 16:21:37 +00:00
Ruslan Bukin
12899ea195 - Setup both secure and non-secure timer IRQs.
We don't know our ARM security state, so one of them will operate.
- Don't set frequency, since it's unpossible in non-secure state.
  Only rely on DTS clock-frequency value or get clock from timer.

Discussed with:	ian, cognet
2014-04-03 05:48:56 +00:00
Ian Lepore
a3ff7ef69c Switch imx6 to using the mpcore per-cpu event timers, but continue to use
the GPT timer, which is fixed-frequency, as a timecounter.
2014-04-02 21:06:43 +00:00
Ed Maste
f3c22563bd Merge r246607 by benno from projects/uefi
Use EFI types for EFI values (silences warnings).

EFI UINTN is actually a 64-bit type on 64-bit processors.

Sponsored by:	The FreeBSD Foundation
2014-03-31 14:12:27 +00:00
Ruslan Bukin
657fae63fc Add support for keyboard used in Samsung Chromebook (ARM machine)
Support covers device drivers for:
- Interrupt Combiner
- gpio/pad, External Interrupts Controller (pad)
- I2C Interface
- Chrome Embedded Controller
- Chrome Keyboard

Also:
- Use new gpio dev class in EHCI driver
- Expand device tree information
2014-03-30 15:22:36 +00:00
Ganbold Tsagaankhuu
fe47fb7b1c Switch to my freebsd.org emal address in copyright.
Approved by:	stas (mentor)
2014-03-25 08:31:47 +00:00
Luiz Otavio O Souza
855feb6867 Adds the ADC driver for TI AM3xxx SoC family.
The ADC has a 12bit resolution and its raw output can be read via sysctl(8)
interface.

The driver allows the setup of ADC clock, samples average and open delay
(the number of clock cycles to wait before start the conversion).

The TSC_ADC module is set in the general purpose mode (no touchscreen
support).

Tested on Beaglebone-black.

Written based on AM335x TRM.

Reviewed by:	rpaulo
Approved by:	adrian (mentor)
Tested by:	me, Brian J. McGovern, Sulev-Madis Silber (ketas)
2014-03-24 20:06:27 +00:00
Bjoern A. Zeeb
e84dc12907 For the moment also disable interrupts on the altera-jtag-uart imitation
and force polling mode.
2014-03-23 20:35:58 +00:00
Bjoern A. Zeeb
da1b85e4b2 For BERI on NetFPGA assume HZ=100 by default.
Remove the uart support in favour of a "jtag-uart" interface imitation
providing a much simpler interface, directly exported to the host,
allowing the toolchain to be shared with BERI on Altera. [1]

Submitted by:	Jong Hun HAN (jong.han cl.cam.ac.uk) [1]
MFC after:	2 weeks
2014-03-22 13:06:32 +00:00
Andrey V. Elsukov
4c659be325 When loader(8) inspects MBR, it chooses GPT as main partition table,
when MBR contains only PMBR entry or it is bootcamp-compatible.
If MBR has PMBR entry and some other, the loader rejects it.

Make these checks to be less strict. If loader decided that PMBR
isn't suitable for GPT, it will use MBR.

Reported by:	Paul Thornton
Tested by:	Paul Thornton
MFC after:	1 week
2014-03-21 09:29:01 +00:00
Ruslan Bukin
5637e3c775 Add support for Samsung Chromebook (ARM Cortex A15 machine). 2014-03-20 17:10:01 +00:00
Ruslan Bukin
d74318a415 - Add display-related and clk devices to the tree
- Prevent resources intersection with EHCI driver
2014-03-20 17:03:44 +00:00
Ian Lepore
796e9260a7 Cosmetic changes to printed output, mostly related to probing devices...
- Display slice and partition as <auto> instead of 0 or -1 when they're
   not set to specific values (the paritition=-1 was confusing folks).
 - When loaderdev isn't set in the u-boot environment, say so rather
   than displaying unknown device ''.
 - Print the loader(8) ident/version info earlier, so that all device-
   related info appears together afterwards.

The one change here that isn't purely cosmetic is to call setheap()
earlier.  The comment says "Initialise heap as early as possible", now
that's more accurate.  It shouldn't make any functional difference, but
may be safer if future changes lead to trying to allocate memory earlier.
2014-03-17 16:10:42 +00:00
Ian Lepore
4f4ee43a1b Fix the paren nesting so that the network device is probed if the load
device type is either network or wildcard.
2014-03-17 13:54:53 +00:00
Ian Lepore
1c598434b9 Fix an uninitialized variable error I perpetrated when splitting some
code into a separate function.  Pass the missing value from main() to
the probe_disks() function.
2014-03-14 00:49:02 +00:00
Ed Maste
d33542f1e1 Connect 64-bit boot ficl to the build
It is not yet used, but this will ensure it doesn't get broken.

Sponsored by:	The FreeBSD Foundation
2014-03-13 19:26:23 +00:00
Ed Maste
80cd00209b Add amd64 EFI headers
Sponsored by:	The FreeBSD Foundation
2014-03-13 18:17:18 +00:00
Ian Lepore
8e97c09f47 Enhance the mechanism that lets you configure the ubldr boot device by
setting the u-boot environment variable loaderdev=.  It used to accept only
'disk' or 'net'.  Now it allows specification of unit, slice, and partition
as well.  In addition to the generic 'disk' it also accepts specific
storage device types such as 'mmc' or 'sata'.

If there isn't a loaderdev env var, the historical behavior is maintained.
It will use the first storage device it finds, or a network device if
no working storage device exists.

99% of the work on this was done by Patrick Kelsey, but I made some
changes, so if anything goes wrong, blame me.

Submitted by:	Patrick Kelsey <kelsey@ieee.org>
2014-03-11 22:02:49 +00:00
Roger Pau Monné
aa389b4f8c howto_names: unify declaration
Approved by: gibbs
Sponsored by: Citrix Systems R&D

boot/i386/efi/bootinfo.c:
boot/i386/libi386/bootinfo.c:
boot/ia64/common/bootinfo.c:
boot/powerpc/ofw/metadata.c:
boot/powerpc/ps3/metadata.c:
boot/sparc64/loader/metadata.c:
boot/uboot/common/metadata.c:
boot/userboot/userboot/bootinfo.c:
i386/xen/xen_machdep.c:
 - Include sys/boot.h
 - Remove custom definition of howto_names.

sys/boot.h:
 - Define howto_names.

x86/xen/pv.c:
 - Include sys/boot.h
2014-03-11 10:13:06 +00:00
Warner Losh
c916572f5b Initial cut for DTS on the hl201 board. 2014-03-08 03:22:20 +00:00
Ruslan Bukin
bcec4b54f3 - Export panel info to DTS
- Reset all the layers before setup first one
- Enable display
2014-03-07 16:14:51 +00:00
Ruslan Bukin
0c94becea6 Add driver for Port control and interrupts (PORT).
PORT is responsible for external interrupts management,
so move IRQ lines from GPIO driver.
2014-03-07 07:06:36 +00:00
Ian Lepore
d1c926defd Use an empty ranges statement for the bus, because all the children on the
bus have their register properties declared as full physical addresses,
not offsets from a base range for the bus.
2014-03-04 14:19:15 +00:00