Commit Graph

2568 Commits

Author SHA1 Message Date
kientzle
777410321b 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
jhb
15f6025f53 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
gber
8ead7d44b7 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
wkoszek
1497a98f71 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
gonzo
17c176d04d Move pinmux configuration to board-specific config. It will vary
from board to board.
2013-04-26 17:27:53 +00:00
dim
b2f606714a 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
gonzo
6460865378 Split BeagleBone DTS to generic AM335x part and Beagle-bone specific 2013-04-22 18:53:36 +00:00
ae
77bba67eef 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
kientzle
a04522357c 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
kientzle
1fd889a6f3 Fix two broken macros. 2013-04-07 05:40:49 +00:00
avg
47b0933c6d 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
f370876f88 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
kientzle
01d37a7164 Initialize sym_count to 0.
This fixes a compiler warning introduced in r248121.
2013-03-30 16:33:16 +00:00
ray
a88f1a3d13 Integrate Efika MX project back to home.
Sponsored by:	The FreeBSD Foundation
2013-03-20 15:39:27 +00:00
ian
84fe418fcb 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
7323532fa2 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
65c312a935 Enable uart driver for A10.
Approved by: gonzo@
2013-03-01 01:47:11 +00:00
ian
767ecbeac8 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
d2e4d8580d 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
kientzle
59678235a8 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
gonzo
61f5e2d8e6 - 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
kientzle
02ee499236 "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
kientzle
8321b23854 Print kernel args as late as possible before jumping into kernel. 2013-02-23 20:27:03 +00:00
kib
cda69c9622 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
kientzle
e341f5a967 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
kientzle
35a51d801b 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
kientzle
dad21c930a 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
gonzo
1da1883208 Enable USB1 (which is EHCI0) for Allwinner A10
Tested by: ganbold@
2013-02-15 21:29:03 +00:00
gonzo
b841d961bd Add watchdog driver for Allwinner A10 2013-02-11 11:31:23 +00:00
kientzle
5eaca6e3c2 Provide verbose help for fdt commands on platforms that use it. 2013-02-11 02:15:26 +00:00
ae
a16dc1156c Add bootcamp support to the loader.
Tested by:	dchagin
MFC after:	1 week
2013-02-10 19:27:17 +00:00
hselasky
07c18e4e92 - 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
hselasky
d169cde81c Correctly list the usbloader dependencies. 2013-02-08 23:13:46 +00:00
andrew
18658720df * 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
hselasky
2e6231f8eb 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
hselasky
7dec4a9503 Fix depend target. 2013-02-05 12:37:50 +00:00
ganbold
5e7c84227a Add gpio driver and update dts and kernel config accordingly.
Approved by: gonzo@
2013-02-05 02:25:13 +00:00
hselasky
fed1587f36 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
2d2ebd5bc0 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
dae46a4471 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
dmarion
a27f0d1a31 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
fc8455d839 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
8533809c9b 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
jhb
c6a2bfeec0 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
ef3e178ab5 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
kientzle
aa7091a3ab Use correct size for AM335x CPSW memory window. 2013-01-21 01:02:49 +00:00
avg
51fe15e297 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
000e41994b Link against compiler-rt to pull in the required __aeabi_* functions 2013-01-19 22:12:57 +00:00
kientzle
e2c2dc3692 Use correct GPIO interrupt lines. 2013-01-19 17:22:12 +00:00
ganbold
a0e69297d0 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