Commit Graph

2219 Commits

Author SHA1 Message Date
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
Ian Lepore
97247a2acf A variety of cleanups...
- Use named constants for register bits, instead of mystery numebrs
   scattered around in the code.
 - Use inline functions for bus space read/write, instead of macros
   that rely on global variables.
 - Move the timecounter struct into the softc instead of treating it
   as a global variable.  Backlink from it to the softc.
 - This leaves a pointer to the softc as the only static/global variable
   and it's now used only by DELAY().
2013-12-22 21:44:32 +00:00
Ian Lepore
b125ed0241 Map out all the timer-related registers, and define named constants for
the bits within the registers.
2013-12-22 21:35:18 +00:00
Ian Lepore
299e547f97 Shorten the DMTIMER_ prefix used for register names to DMT_. This is in
preparation for adding more complete register defintions, some of which
have fairly long names.
2013-12-22 20:40:56 +00:00
Aleksandr Rybalko
e58e20aeda Add Freescale i.MX515 vt(9) driver.
Sponsored by:	The FreeBSD Foundation
2013-12-22 16:09:29 +00:00
Warner Losh
f83ed22cb6 Plumb the cn_grab and cn_ungrab routines down into the uart
clients. Mask RX interrupts while grabbed on the atmel serial
driver. This UART interrupts every character. When interrupts are
enabled at the mountroot> prompt, this means the ISR eats the
characters. Rather than try to create a cooperative buffering system
for the low level kernel console, instead just mask out the ISR. For
NS8250 and decsendents this isn't needed, since interrupts only happen
after 14 or more characters (depending on the fifo settings). Plumb
such that these are optional so there's no change in behavior for all
the other UART clients. ddb worked on this platform because all
interrupts were disabled while it was running, so this problem wasn't
noticed. The mountroot> issue has been around for a very very long
time.

MFC after:	3 days
2013-12-21 16:23:31 +00:00
Ganbold Tsagaankhuu
543c9e95f2 Add identification and necessary type checks for Krait CPU cores. Krait CPU is used in
Qualcomm Snapdragon S4 and Snapdragon 400/600/800 SoCs and has architectural
similarities to ARM Cortex-A15. As for development boards IFC6400 series embedded
boards from Inforce Computing uses Snapdragon S4 Pro/APQ8064.

Approved by: stas (mentor)
2013-12-20 00:56:23 +00:00
Aleksandr Rybalko
86b04d42ec Fix copyright and some style(9) things.
Sponsored by:	The FreeBSD Foundation
2013-12-17 15:34:38 +00:00