Commit Graph

2055 Commits

Author SHA1 Message Date
Olivier Houchard
97e7a34397 Try to make sure the frame is indeed in the kernel memory. 2013-10-22 21:47:34 +00:00
Oleksandr Tymoshenko
5ad43f4b9a Make watchdog function conform watchdog(9):
Set error to 0 when watchdog is armed and disable it when timeout
is too large to be set.
2013-10-22 05:22:46 +00:00
Oleksandr Tymoshenko
00b1705bdc - Implement watchdog function and register it with watchdog list 2013-10-22 05:19:42 +00:00
Ganbold Tsagaankhuu
8f011d4075 Move and rename dwc otg driver to more
generic one as it appears to work
for rk3188 SoC based board too.

No objections from: hselasky@
Reviewed by: ray@
2013-10-21 09:34:04 +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
dc82313758 Add a driver for the Freescale Fast Ethernet Controller found on various
Freescale SoCs including the i.MX series.  This also works for the newer
SoCs with the ENET gigabit controller, but doesn't use any of the new
hardware features other than enabling gigabit speed.
2013-10-20 21:07:38 +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
Ian Lepore
ac640932f4 Clock divisors 0-3 correspond to dividing by 1-4, so add 1 before dividing. 2013-10-19 21:33:06 +00:00
Randall Stewart
03466868c3 Corrects the Kirkwood dreamplug to use
the right register for power managment. It
was incorrectly using the clock register
which also caused the status to be the
opposite of what it is supposed to be.
1 - its disabled
0 - its enabled

Per kirkwood spec FSS_88F6180_9x_6281_OpenSource.pdf
2013-10-19 06:47:02 +00:00
Olivier Houchard
f8c98b1227 There's no need to guard pmap_extract(), it won't be called until well after
the VM has been properly initialized.

Spotted out by:	alc
2013-10-18 22:47:10 +00:00
Olivier Houchard
64238eb48e KERNBASE is unsigned, so we'd better use hs instead of ge.
Pointy hat to:	cognet
Suggested by:	ian
2013-10-18 17:21:47 +00:00
Olivier Houchard
4798c89190 Increase the KVA available for xscale CPUs. 2013-10-17 22:12:32 +00:00
Olivier Houchard
f4b13928b8 Spell cpu_l2cache_wb_range correctly. 2013-10-17 21:38:14 +00:00
Olivier Houchard
f81c09049a - Switch to use WBWA mappings for page tables on armv6, this is needed for SMP.
- Fix PTE_SYNC() for PIPT L2 caches, using the virtual address wasn't so useful.
- Use PTE_SYNC() for >= armv6
2013-10-17 21:06:19 +00:00
Olivier Houchard
e49341e87c Make casuword() atomic for armv6 2013-10-17 17:11:15 +00:00
Olivier Houchard
a1739e7e15 If we avoid to use the page at addr 0, we should adjust the size to reflect it. 2013-10-17 09:57:09 +00:00
Ian Lepore
78a60b7f95 Invalidate the entire L2 cache before enabling it. Say whether it
has been enabled or disabled.
2013-10-16 19:06:44 +00:00
Ian Lepore
b3f2c51066 Add cases for the combinations of busdma sync op flags that we handle
correctly by doing nothing, then add a panic for the default case, because
that implies that some driver asked for a sync (probably incorrectly) and
nothing was done.
2013-10-16 16:35:25 +00:00
Ian Lepore
8160dc4983 When calculating the number of bounce pages needed, round the maxsize
up to a multiple of PAGE_SIZE, and add one page because there can always
be one more boundary crossing than the number of pages in the transfer.
2013-10-16 16:32:35 +00:00
Ruslan Bukin
03a1c6d1f9 Add CPU ID for ARM Cortex A5.
Approved by:	cognet (mentor)
2013-10-16 15:20:27 +00:00
Ian Lepore
3c35b4deb3 Fix a register name typo. The effect was that CPU_CONTROL_AFLT_ENABLE
wasn't being set, but it was almost assuredly already turned on anyway
by the bootloader.
2013-10-16 14:24:22 +00:00
Kevin Lo
1fa042f0ad Remove unsigned comparison < 0
Found by:	LLVM
Reviewed by:	zbb
2013-10-15 09:29:36 +00:00
Dimitry Andric
f63ada9b97 In sys/arm/versatile/versatile_pci.c, add a default handler, to fix a
gcc warning about uninitialized use of a variable.

Approved by:	re (gjb)
2013-10-10 19:40:01 +00:00
Dimitry Andric
98c28062e0 Remove redundant redeclarations of uart_s3c2410_class in
sys/arm/s3c2xx0/uart_bus_s3c2410.c and uart_cpu_s3c2410.c, to silence
two gcc warnings.

Approved by:	re (gjb)
X-MFC-With:	r252394
2013-10-09 17:05:02 +00:00
Ruslan Bukin
6b7adc0cbd - Enable unmapped buffers on Exynos5 again, because
board now able to see all the 2GB ram it has
- Also unbreak gcc build

Approved by:	cognet (mentor)
Approved by:	re (marius)
2013-10-01 12:01:20 +00:00
Luiz Otavio O Souza
c58e1e485c Fix DELAY() on RPi, the wrong math was making it take twice it should.
Reported by:	Alexander <sht@ropnet.ru>
Approved by:	adrian (mentor)
Approved by:	re (gjb)
2013-09-23 14:00:18 +00:00
Gleb Smirnoff
255c1caae3 - Create kern.ipc.sendfile namespace, and put the new "readhead" OID
there as "kern.ipc.sendfile.readahead".
- Push all nsfbuf related tunables into MD code. Don't move them
  to new namespace in favor of POLA.

Reviewed by:	scottl
Approved by:	re (gjb)
2013-09-22 13:36:52 +00:00
Zbigniew Bodek
e4b318d69c Fix GCC build for all ARMs. Revert bug introduced in r255613.
Previous change applied in r255613 fixed build for ARMv6 but
broke it for previous architecture revisions. This commit
eventually fixes GCC build for all ARM revisions.

Approved by:	cognet (mentor)
Approved by:	re (kib)
2013-09-20 20:44:32 +00:00
Alan Cox
deb179bb4c The pmap function pmap_clear_reference() is no longer used. Remove it.
pmap_clear_reference() has had exactly one caller in the kernel for
several years, more precisely, since FreeBSD 8.  Now, that call no
longer exists.

Approved by:	re (kib)
Sponsored by:	EMC / Isilon Storage Division
2013-09-20 04:30:18 +00:00
Pawel Jakub Dawidek
3fded357af Fix panic in ktrcapfail() when no capability rights are passed.
While here, correct all consumers to pass NULL instead of 0 as we pass
capability rights as pointers now, not uint64_t.

Reported by:	Daniel Peyrolon
Tested by:	Daniel Peyrolon
Approved by:	re (marius)
2013-09-18 19:26:08 +00:00
Zbigniew Bodek
e478f35505 Fix GCC build error when building for ARMv6
Apply theravens's idea to move __strong_reference
macros into the proper ifdef section.

Approved by:	cognet (mentor)
Approved by:	re
2013-09-16 10:46:58 +00:00
Zbigniew Bodek
760488b93c Implement pmap_advise() for ARMv6/v7 pmap module
Apply the given advice to the specified range of addresses within the
given pmap. Depending on the advice, clear the referenced and/or
modified flags in each mapping. Superpage within the given range will
be demoted or destroyed.

Reviewed by:	alc
Approved by:	cognet (mentor)
Approved by:	re
2013-09-16 10:39:35 +00:00
Zbigniew Bodek
8b78ad43bc Write protect base page after superpage demotion so that it may repromote
When clearing the modification status of the superpage, one of the
base pages produced during demotion should be marked as write disabled.
The intention is that subsequent write access may repromote.
In the current implementation this was done wrong as write permission was
granted instead of forbidden.

Approved by:	cognet (mentor)
Approved by:	re
2013-09-16 10:34:44 +00:00
Luiz Otavio O Souza
44d06d8d9a Export a function to allow BCM2835's peripheral devices to enable their
altenate pin function (from GPIO pins) as needed.

Approved by:	adrian (mentor)
2013-09-07 18:48:15 +00:00
Andrew Turner
0a10f22a30 On ARM EABI double precision floating point values are stored in the
endian the CPU is in, i.e. little-endian on most ARM cores.

This allows ARMv4 and ARMv5 boards to boot with the ARM EABI.
2013-09-07 14:04:10 +00:00
Gleb Smirnoff
fee4c621fc Fix of r255318: move sf_buf_alloc()/sf_buf_free() out of #ifdef
ARM_USE_SMALL_ALLOC.
2013-09-07 07:56:55 +00:00
Luiz Otavio O Souza
8d900240b0 Fix an off-by-one bug in ar71xx_gpio and bcm2835_gpio which makes the last
pin unavailable.

Reported and tested by:	sbruno (ar71xx)
Approved by:	adrian (mentor)
Pointy hat to:	loos
2013-09-06 23:39:56 +00:00
Gleb Smirnoff
2ee9b44cae Fix build with gcc. Move sf_buf_alloc()/sf_buf_free() declarations
to MD headers.
2013-09-06 17:44:13 +00:00
Rui Paulo
dd639923b9 Revert accidental commit. 2013-09-02 17:07:46 +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
David Chisnall
e1c0c6422a Unconditionally compile the __sync_* atomics support functions into compiler-rt
for ARM.
This is quite ugly, because it has to work around a clang bug that does not
allow built-in functions to be defined, even when they're ones that are
expected to be built as part of a library.

Reviewed by:	ed
2013-08-31 08:50:45 +00:00
Rui Paulo
c2b340cb73 Fix a typo in a comment. 2013-08-31 07:08:21 +00:00
Alan Cox
51321f7c31 Significantly reduce the cost, i.e., run time, of calls to madvise(...,
MADV_DONTNEED) and madvise(..., MADV_FREE).  Specifically, introduce a new
pmap function, pmap_advise(), that operates on a range of virtual addresses
within the specified pmap, allowing for a more efficient implementation of
MADV_DONTNEED and MADV_FREE.  Previously, the implementation of
MADV_DONTNEED and MADV_FREE relied on per-page pmap operations, such as
pmap_clear_reference().  Intuitively, the problem with this implementation
is that the pmap-level locks are acquired and released and the page table
traversed repeatedly, once for each resident page in the range
that was specified to madvise(2).  A more subtle flaw with the previous
implementation is that pmap_clear_reference() would clear the reference bit
on all mappings to the specified page, not just the mapping in the range
specified to madvise(2).

Since our malloc(3) makes heavy use of madvise(2), this change can have a
measureable impact.  For example, the system time for completing a parallel
"buildworld" on a 6-core amd64 machine was reduced by about 1.5% to 2.0%.

Note: This change only contains pmap_advise() implementations for a subset
of our supported architectures.  I will commit implementations for the
remaining architectures after further testing.  For now, a stub function is
sufficient because of the advisory nature of pmap_advise().

Discussed with: jeff, jhb, kib
Tested by:      pho (i386), marcel (ia64)
Sponsored by:   EMC / Isilon Storage Division
2013-08-29 15:49:05 +00:00
Rafal Jaworowski
b949475db0 Introduce superpages support for ARMv6/v7.
Promoting base pages to superpages can increase TLB coverage and allow for
efficient use of page table entries.  This development provides FreeBSD/ARM
with superpages management mechanism roughly equivalent to what we have for
i386 and amd64 architectures.

1. Add mechanism for automatic promotion of 4KB page mappings to 1MB section
   mappings (and demotion when not needed, respectively).

2. Managed and non-kernel mappings are now superpages-aware.

3. The functionality can be enabled by setting "vm.pmap.sp_enabled" tunable to
   a non-zero value (either in loader.conf or by modifying "sp_enabled"
   variable in pmap-v6.c file).  By default, automatic promotion is currently
   disabled.

Submitted by:	Zbigniew Bodek <zbb@semihalf.com>
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation, Semihalf
2013-08-26 17:12:30 +00:00
Rafal Jaworowski
995c2b63f7 Provide settings for superpage reservation system on ARM.
This allows for enabling and configuring superpages reservation mechanism in
order to allocate and populate 256 4KB base pages (for the purpose of
promotion to a 1MB superpage).

Submitted by:	Zbigniew Bodek <zbb@semihalf.com>
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation, Semihalf
2013-08-26 16:23:54 +00:00
Rafal Jaworowski
026bf0a293 Add missing TAILQ initializer (omitted in r250634).
Submitted by:	Zbigniew Bodek <zbb@semihalf.com>
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation, Semihalf
2013-08-26 15:38:27 +00:00
Andrew Turner
30ea211052 Update the root device to be correct for use with crochet. 2013-08-26 10:27:15 +00:00
Andrew Turner
74dcb850cc Revert r251370 as it contains a deadlock. 2013-08-26 10:24:59 +00:00
Andrew Turner
85e8977a2c Add the frame information to cpu_switch to allow us to unwind out of it,
for example when dumping threads in the kernel debugger.
2013-08-25 11:23:38 +00:00
Andrew Turner
da154710c4 Add the unwind information to irq_entry so we can pass through it when
unwinding the stack.
2013-08-25 11:21:03 +00:00