Commit Graph

2226 Commits

Author SHA1 Message Date
John-Mark Gurney
6eebe8507a fix args to mtx_init
Note that this commit hasn't been compile tested because these files
are not hooked up to the build...

PR:		186129
Submitted by:	Takanori Sawada
Approved by:	rpaulo
2014-01-27 17:31:21 +00:00
Warner Losh
9107643c54 Before resetting the USART, delay a bit to allow the transmitter to
finish the current character to drain to avoid glitching. Also,
simplify the code a smidge.
2014-01-26 04:57:58 +00:00
Warner Losh
1fb293548d Make early printf output nicer by inserting a carriage return before
any linefeeds that are output.
2014-01-25 21:57:45 +00:00
Warner Losh
a500a7ce91 Bus space handles need to be the VA of the requested resource, not the
rounded page VA. Correct so the DBGU device can be mapped for FDT
console since it isn't on a page boundary.
2014-01-25 21:52:19 +00:00
Andrew Turner
9bd8ce289b Fix gcc with -Wstrict-prototypes by telling it bi_emac takes no parameters. 2014-01-25 19:36:27 +00:00
Andrew Turner
af3088290b Correct the alignment of sp through functions that use UNWINDSVCFRAME. We
were incorrectly adding the trap frame padding to the stack pointer after
reading it's value and unaligning it.
2014-01-24 20:51:56 +00:00
Warner Losh
26fb3de82c Remove obsolete option 2014-01-24 17:00:27 +00:00
Warner Losh
5fac1adda0 Fix comment to match option 2014-01-24 16:58:50 +00:00
Warner Losh
8a141da3d0 Fix comment to match option 2014-01-24 16:58:21 +00:00
Warner Losh
26c1c257fe Fix comment to match option 2014-01-24 16:57:42 +00:00
Warner Losh
624932ff81 Add NAND support
Fix comment
This board has 4 wire support
2014-01-24 16:56:27 +00:00
Warner Losh
0da1cf4094 Remove redundant declaration for uart devclass.
Commint some unrelated, but harmless, FDT ifdefs.
2014-01-24 16:50:15 +00:00
Warner Losh
8c9dc67411 Clean up HL201 config (for the hot-e 201 and 101 models from thinlinx).
Make comments match parameters
Add options for early printf so we get regression build testing on it.
Add preview of options for FDT support coming soon (I hope)
2014-01-22 22:01:29 +00:00
Warner Losh
52e996ac52 Implement support for early printf. You need to define SOCDEV_{PA,VA}
as described in the comments for the eputc function in your config file.
2014-01-22 21:49:20 +00:00
Warner Losh
88b842d215 Add support for mapping a small range of the SoC devices for debugging
purposes early in boot.
2014-01-22 21:23:58 +00:00
Warner Losh
99fd7cb44d We need nand now that the boards reference it. 2014-01-20 19:57:30 +00:00
Warner Losh
294ef64a17 Introduce grab and ungrab upcalls. When the kernel desires to grab the
console, it calls the grab functions. These functions should turn off
the RX interrupts, and any others that interfere. This makes mountroot
prompt work again. If there's more generalized need other than
prompting, many of these routines should be expanded to do those new
things.

Reviewed by:	bde (with reservations)
2014-01-19 19:36:11 +00:00
Warner Losh
1067f8879b Add nand device and NANDFS into the mix for those boards that have
support for it at the moment.
2014-01-19 18:09:00 +00:00
Warner Losh
2bff652222 Connect NAND for the SAM9260EK eval board, as well as the HotE HL-201.
# expect more refinement as do more boards.
2014-01-19 17:59:34 +00:00
Warner Losh
7b94bdc970 Add standard memory controller helper functions. 2014-01-19 17:45:13 +00:00
Aleksandr Rybalko
5f171f64a2 Fix build after FDT changes.
Sponsored by:	The FreeBSD Foundation
2014-01-16 14:48:23 +00:00
Warner Losh
7855b0bd68 Add data so we can convert a PIO unit number into a base address. 2014-01-15 19:53:36 +00:00
Warner Losh
db9765adeb Provide a simplified way to specify GPIO pins for the Atmel port. 2014-01-15 19:49:12 +00:00
Ian Lepore
afaa74ffe7 Add a prototype for the new arm_devmap_print_table(). This should have
been part of r260490.
2014-01-09 20:57:19 +00:00
Ian Lepore
a0e04ab3ff Add a function to print the contents of the static device mapping table,
and invoke it for bootverbose logging, and also from a new DDB command,
"show devmap".  Also tweak the format string for the bootverbose output
of physical memory chunks to get the leading zeros in the hex values.
2014-01-09 18:51:57 +00:00
Ian Lepore
14f4ecfafa Add option USB_HOST_ALIGN to configs that contain 'device usb'. Setting
this to the cache line size is required to avoid data corruption on armv4
and armv5, and improves performance on armv6, in both cases by avoiding
partial cacheline flushes for USB IO.
2014-01-08 03:42:09 +00:00
Ian Lepore
7c2136adbb Add option USB_HOST_ALIGN to configs that contain 'device usb'. Setting
this to the cache line size is required to avoid data corruption on armv4
and armv5, and improves performance on armv6, in both cases by avoiding
partial cacheline flushes for USB IO.

All these configs already exist in 10-stable.  A few that don't (and
thus can't be MFC'd yet) will be committed separately.
2014-01-08 03:40:18 +00:00
Andreas Tobler
6bb9be1b41 Fix arm build.
Reviewed by:	ian, zbb
2014-01-06 17:16:27 +00:00
Ian Lepore
358018a688 Switch to using arm_devmap_add_entry() to set up static device mapping.
This eliminates the hard-coded max kva and roughly doubles the available
kva space.
2014-01-06 16:57:22 +00:00
Ian Lepore
4f9ffa42b0 Don't try to find a static mapping before calling pmap_mapdev(), that logic
is now part of pmap_mapdev() and doesn't need to be duplicated here.
Likewise for unmapping.
2014-01-06 16:33:16 +00:00
Ian Lepore
62a70ef64d Allow 'no static device mappings' to potentially work. It's not clear that
every arm system must have some static mappings to work correctly (although
currently they all do), so remove some panic() calls (which would never
been seen anyway, because they would happen before a console is available).
2014-01-06 16:07:27 +00:00
Ian Lepore
fdadb971af Switch to using arm_devmap_add_entry() to set up static device mapping.
This eliminates the hard-coded max kva and roughly doubles the available
kva space.
2014-01-06 15:48:16 +00:00
Ian Lepore
02c7dba919 Remove dev/fdt/fdt_pci.c, which was code specific to Marvell ARM SoCs,
related to setting up static device mappings.  Since it was only used by
arm/mv/mv_pci.c, it's now just static functions within that file, plus
one public function that gets called only from arm/mv/mv_machdep.c.
2014-01-05 22:36:34 +00:00
Ian Lepore
8f4fa88900 Enable the cesa security/crypto device by providing the required property
in the dts source, and adding the right devices to the kernel config. Also
generally bring the kernel config into line with what we have for other
Marvell/Kirkwood systems (add lots of useful devices and options).

One particularly notable addition amongst the kernel config changes is
USB_HOST_ALIGN=32, which may help eliminate data corruption on USB drives.

PR:		kern/181975 arm/162159
2014-01-05 20:44:10 +00:00
Ian Lepore
170e15fb4c Add #include <machine/fdt.h> to a few files that used to get it via
pollution from other headers.
2014-01-05 20:09:51 +00:00
Nathan Whitehorn
dcd08302e5 Retire machine/fdt.h as a header used by MI code, as its function is now
obsolete. This involves the following pieces:
- Remove it entirely on PowerPC, where it is not used by MD code either
- Remove all references to machine/fdt.h in non-architecture-specific code
  (aside from uart_cpu_fdt.c, shared by ARM and MIPS, and so is somewhat
  non-arch-specific).
- Fix code relying on header pollution from machine/fdt.h includes
- Legacy fdtbus.c (still used on x86 FDT systems) now passes resource
  requests to its parent (nexus). This allows x86 FDT devices to allocate
  both memory and IO requests and removes the last notionally MI use of
  fdtbus_bs_tag.
- On those architectures that retain a machine/fdt.h, unused bits like
  FDT_MAP_IRQ and FDT_INTR_MAX have been removed.
2014-01-05 18:46:58 +00:00
Ian Lepore
51dbd04609 Convert from using fdt_immr style to arm_devmap_add_entry() to make
static device mappings.

This SoC relied heavily on the fact that all devices were static-mapped
at a fixed address, and it (rather bogusly) used bus_space read and write
calls passing hard-coded virtual addresses instead of proper bus handles,
relying on the fact that the virtual addresses of the mappings were known
at compile time, and relying on the implementation details of arm
bus_space never changing.  All such usage was replaced with calls to
bus_space_map() to obtain a proper bus handle for the read/write calls.

This required adjusting some of the #define values that map out hardware
registers, and some of them were renamed in the process to make it clear
which were defining absolute physical addresses and which were defining
offsets.  (The ones that just define offsets don't appear to be referenced
and probably serve no value other than perhaps documentation.)
2014-01-05 18:40:06 +00:00
Ian Lepore
caca500f02 Eliminate use of fdt_immr_addr(), it's not needed for this SoC. Convert
to the newer arm_devmap_add_entry() routine for creating device mappings.
2014-01-05 16:45:34 +00:00
Ian Lepore
6bd6fe5bbb Use the common armv6 fdt_bus_tag defintion instead of an essentially
identical local copy of it.
2014-01-05 15:33:33 +00:00
Ian Lepore
273f1d76d9 Doh! Use C comments, not C++. 2014-01-04 22:14:59 +00:00
Ian Lepore
219f39ba09 Convert static device mapping to use the new arm_devmap_add_entry(),
and add static mappings that cover most of the on-chip peripherals with
1MB section mappings.  This adds about 220MB or so available kva space
by not using a hard-coded 0xF0000000 as the mapping address.
2014-01-04 22:09:53 +00:00
Ian Lepore
c18fc3ff67 In pmap_mapdev(), first check whether a static mapping exists, and if so
use it rather than allocating kva space and making another mapping.  In
pmap_unmapdev(), don't unmap/free if the mapping is static.
2014-01-04 21:38:41 +00:00
Ian Lepore
f61b6fe561 Use bus_space_map() rather than pmap_mapdev() in nexus_activate_resource(),
when running on FDT systems.  Unmap memory in nexus_deactivate_resource().

Also, call rman_activate_resource() before mapping device memory, and only
do the mapping if it returns success.

Reviewed by:	nwhitehorn
2014-01-04 21:18:22 +00:00
Nathan Whitehorn
818f49fc98 Implement OFW_BUS_MAP_INTR() in terms of the FDT PIC table, which will
become an ARM-specific quirk.
2014-01-04 20:59:03 +00:00
Ian Lepore
faacdbd9cf Fix a typo that caused a loop to run beyond the end of the array it was
searching.  If you didn't configure a timer capture pin you'd get a data
abort as it wandered into the weeds, now you get a nice warning message
about your config, as originally intended.
2014-01-03 21:38:33 +00:00
Zbigniew Bodek
e1b5472915 Fix race condition in DELAY for SP804 timer.
Fix race condition in DELAY function: sc->tc was not initialized yet when
time_counter pointer was set, what resulted in NULL pointer dereference.

Export sysfreq to dts.

Submitted by:	Wojciech Macek <wma@semihalf.com>
Obtained from:	Semihalf
2014-01-01 20:35:38 +00:00
Zbigniew Bodek
4acd62c51e Add polarity and level support to ARM GIC
Add suport for setting triggering level and polarity in GIC.
New function pointer was added to nexus which corresponds
to the function which sets level/sense in the hardware (GIC).

Submitted by:	Wojciech Macek <wma@semihalf.com>
Obtained from:	Semihalf
2014-01-01 20:03:48 +00:00
Warner Losh
6f4f8f233c Set the SoC name for the atmelbus name. 2013-12-30 18:10:04 +00:00
Adrian Chadd
f553cf3bb9 Revert r252694 - which attempted to fix bit emulation for armv6/armv7.
This seems to cause issues with jemalloc + {dhclient, sshd}.

Thus, revert this for now until the root cause can be found and
fixed.

This should quieten some runtime problems with the Raspberry Pi.

PR: kern/185046
MFC after: 3 days
2013-12-27 05:01:13 +00:00
Ian Lepore
fb962e6dcf Add PPS support to the am335x timer driver. This uses the timer hardware's
capture mode together with the timecounter's PPS polling feature to get
very accurate PPS capture without any interrupt processing (or latency).

Hardware timers 4 through 7 have associated capture-trigger input pins.
When the PPS support is compiled in the code automatically chooses the
first timer it finds that has the capture-trigger pin set to input mode
(this is configured via the fdt data).
2013-12-22 23:03:29 +00:00