Commit Graph

1968 Commits

Author SHA1 Message Date
Ian Lepore
992a44320c Tweak the imx debug console code so that it works with multiple SoCs.
Instead of hard-coding the uart register addresses for the imx51, use
a variable that defaults to the imx51 address.  When debugging another
imx-family SoC, the variable can be set early in initarm() to provide
full console/printf support for debugging early boot.
2013-08-03 13:31:10 +00:00
Olivier Houchard
cca928b9e1 Only receive the interrupts on the first core, to avoid duplicate interrupts. 2013-08-02 20:32:26 +00:00
Ganbold Tsagaankhuu
dd5c5e7147 Add identification for Cortex-A7 (R0) cores.
Reviewed by: cognet@
2013-08-01 10:06:19 +00:00
David E. O'Brien
0e6a0799a9 Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
Rui Paulo
db10a06d50 Initialisation routines for the mailbox, spinlock and PRU-ICSS clocks. 2013-07-31 05:52:03 +00:00
Olivier Houchard
1c282eb0d8 The errata 727915 requires a different workaround for r2p0, we have to
explicitely clean/invalidate every cache line using way/set operations.
2013-07-29 21:45:39 +00:00
Olivier Houchard
9703669c4a Remove useless cache operations. 2013-07-29 21:32:57 +00:00
David E. O'Brien
99ff83da74 Decouple yarrow from random(4) device.
* Make Yarrow an optional kernel component -- enabled by "YARROW_RNG" option.
  The files sha2.c, hash.c, randomdev_soft.c and yarrow.c comprise yarrow.

* random(4) device doesn't really depend on rijndael-*.  Yarrow, however, does.

* Add random_adaptors.[ch] which is basically a store of random_adaptor's.
  random_adaptor is basically an adapter that plugs in to random(4).
  random_adaptor can only be plugged in to random(4) very early in bootup.
  Unplugging random_adaptor from random(4) is not supported, and is probably a
  bad idea anyway, due to potential loss of entropy pools.
  We currently have 3 random_adaptors:
  + yarrow
  + rdrand (ivy.c)
  + nehemeiah

* Remove platform dependent logic from probe.c, and move it into
  corresponding registration routines of each random_adaptor provider.
  probe.c doesn't do anything other than picking a specific random_adaptor
  from a list of registered ones.

* If the kernel doesn't have any random_adaptor adapters present then the
  creation of /dev/random is postponed until next random_adaptor is kldload'ed.

* Fix randomdev_soft.c to refer to its own random_adaptor, instead of a
  system wide one.

Submitted by: arthurmesh@gmail.com, obrien
Obtained from: Juniper Networks
Reviewed by: obrien
2013-07-29 20:26:27 +00:00
Olivier Houchard
18f8f46e9f Explicitely include <machine/pcb.h>, so that we get the definition of
struct pcb.

Submitted by:	Zbyszek Bodek <zbb@semihalf.com>
Pointy hat to: 	cognet
2013-07-29 12:55:37 +00:00
Olivier Houchard
36bc03ee96 Define KDB_STOPPEDPCB, so that we can access the backtraces of threads running
on other cores.
2013-07-29 08:07:35 +00:00
Andriy Gapon
a29cc9a34b Revert r253748,253749
This WIP should not have been committed yet.

Pointyhat to:	avg
2013-07-28 18:44:17 +00:00
Andriy Gapon
366d8bfb7b put contents of cpu.h under _KERNEL
no userland-serviceable parts inside

MFC after:	20 days
2013-07-28 18:32:27 +00:00
Ian Lepore
2a2599f695 Rename the existing std.imx and imx.files to std.imx51 and files.imx51, to
pave the way for adding imx6 support.
2013-07-28 17:37:30 +00:00
Rui Paulo
e3542928e3 Revert ROOTDEVNAME change from previous commit. 2013-07-25 03:44:12 +00:00
Rui Paulo
54d04d168c Enable modules for the BeagleBone and for the Raspberry Pi. 2013-07-25 03:31:27 +00:00
Andrew Turner
b18f8431a0 Start adding support to build bits of our code using the Thumb-2
instruction set. Thumb-2 requires an if-then instruction to implement
conditional codes.

When building for ARM mode the it-then instructions do not generate any
assembled instruction as per the ARMv7-A Architecture Reference Manual, and
are safe to use.

While this allows the atomic instructions to be built, it doesn't mean we
fully support Thumb code. It works in small tests, but is still known to
fail in a large number of places.

While here add a check for the armv6t2 architecture.
2013-07-20 09:24:48 +00:00
Andrew Turner
5655a322c0 Fix vfp:
- We should check is_d32 to see howmany registers we have
 - In vfp_restore mark vfpscr as an output register

Without the second part it appears we can return the incorrect value from
vfp_bounce if the VFP condition flags are set as it may override the
register holding the return value.
2013-07-16 23:19:05 +00:00
Rui Paulo
9c9a49c494 Move the Raspberry Pi low level options out of the kernel config and into
std.rpi + std.bcm2835.

Reviewed by:	imp
2013-07-15 07:01:30 +00:00
Andrey V. Elsukov
05d1f5bce0 Introduce new structure sfstat for collecting sendfile's statistics
and remove corresponding fields from struct mbstat. Use PCPU counters
and SFSTAT_INC() macro for update these statistics.

Discussed with:	glebius
2013-07-15 06:16:57 +00:00
Rui Paulo
8945bee0c7 Indent the "scp=... rlv=..." to make it easier to read the backtrace. 2013-07-13 00:39:07 +00:00
Aleksandr Rybalko
614901534b Remove trailing whitespaces. 2013-07-10 10:15:38 +00:00
Rui Paulo
b2b175ba30 Improve a comment. 2013-07-09 02:50:05 +00:00
Ed Maste
37a1b03c4b Remove extraneous format string converison specifier
Submitted by:	wxs@
2013-07-09 01:55:34 +00:00
Oleksandr Tymoshenko
c0195195d5 Add IDs for TPS65217C and TPS65217D 2013-07-08 05:06:32 +00:00
Oleksandr Tymoshenko
f1fa19dfe7 - AM335x requires updated soft-reset logic too 2013-07-08 04:27:03 +00:00
Rui Paulo
279cd1010a Convert bcm2835_mbox to the new mbox interface.
Reviewed by:	gonzo
2013-07-07 21:23:58 +00:00
Rui Paulo
8c78ddbaa3 Another warning. 2013-07-07 21:20:52 +00:00
Rui Paulo
175a0c9859 armadaxp_idcache_wbinv_all() is in this file. 2013-07-07 19:22:31 +00:00
Rui Paulo
afed56936c Fix all the compiler warnings in elf_trampoline.c. 2013-07-07 19:19:18 +00:00
Oleksandr Tymoshenko
9afdeb10e4 - Add USFS driver as an example of device mode for AM335x-based devices 2013-07-07 04:24:38 +00:00
Oleksandr Tymoshenko
5a2168b2ef - Add USBSS driver for AM335x SoC. Driver is a wrapper around Mentors Graphic
USB OTG core.
2013-07-07 04:22:08 +00:00
Rui Paulo
522b93a92a Don't clear the SYSCONFIG register on boot.
This follows section 18.4.2.2 SD Soft Reset Flow in the TI AM335x Technical
Reference Manual and seems to fix the "ti_mmchs0: Error: current cmd NULL,
already done?" messages.
2013-07-06 04:18:34 +00:00
Andrew Turner
4bfe2da96a Fix the build with gcc.
Gcc outputs pre-UAL asm and expects the ldcl instruction with a condition
in the form ldc<c>l, where the code produces the instruction in the UAL
form ldcl<c>. Work around this by checking if we are using clang or gcc and
adjusting the instruction.

While here correct the cmp instruction's value to include the # before the
immediate value.
2013-07-05 20:21:59 +00:00
Aleksandr Rybalko
959631351b o Make fields names short.
o Slim down reg fields comments.
2013-07-05 13:37:57 +00:00
Oleksandr Tymoshenko
179232d853 Add support for ePWM submodule of PWMSS
ePWM is controlled by sysctl nodes dev.am335x_pwm.N.period,
dev.am335x_pwm.N.dutyA and dev.am335x_pwm.N.dutyB that controls
PWM period and duty cycles for channels A and B respectively.

Period and duty cycle are measured in clock ticks. Default
clock frequency for AM335x PWM subsystem is 100MHz
2013-07-04 20:13:22 +00:00
Grzegorz Bernacki
fc4c2354ff Remove redundant clearing of the PGA_WRITEABLE flag in
pmap_remove_all()

This flag should already be cleared by pmap_nuke_pv()

Submitted by:   Zbigniew Bodek <zbb@semihalf.com>
Sponsored by:   The FreeBSD Foundation, Semihalf
2013-07-04 10:40:24 +00:00
Grzegorz Bernacki
ad55cd76a6 Fix modified bit emulation for ARMv6/v7
When doing pmap_enter_locked(), enable write permission only when access
type indicates attempt to write. Otherwise, leave the page read only but
mark it writable in pv_flags.

This will result in:
1. Marking page writable during pmap_enter() but only when ensured that it
   will be written right away so that we will not get redundant permissions
   fault on write attempt.
2. Keeping page read only when it is permitted to be written but there was
   no actual write attempt. Hence, we will get permissions fault on write
   access and mark page writable in pmap_fault_fixup() what will indicate
   modification status.

Submitted by:   Zbigniew Bodek <zbb@semihalf.com>
Sponsored by:   The FreeBSD Foundation, Semihalf
2013-07-04 10:38:14 +00:00
Oleksandr Tymoshenko
64cf3edab8 Fix one of INVARIANTS-related UMA panics on ARM
Force UMA zone to allocate service structures like slabs using own
allocator.  uma_debug code performs atomic ops on uma_slab_t fields
and safety of this operation is not guaranteed for write-back caches
2013-07-03 23:38:02 +00:00
Andrew Turner
4579f5e5c1 Enable VFP on Raspberry Pi. This has worked as of r251712. 2013-07-02 19:35:04 +00:00
Michael Tuexen
004f2eb2c1 Enable SCTP, since it is also enabled on GENERIC and it works fine on
the Raspberry Pi.

Discussed with: rpaulo
2013-07-01 18:58:59 +00:00
Rui Paulo
95506b814d The mbox driver is actually MP safe, so set the right flag in
bus_setup_intr().
2013-07-01 06:33:35 +00:00
Rui Paulo
623b72a733 Disable debugging. 2013-07-01 06:32:56 +00:00
Rui Paulo
b7a6be5c7c Use the new FDT_FILE rpi.dts. 2013-07-01 05:01:27 +00:00
Konstantin Belousov
70a7dd5d5b Fix issues with zeroing and fetching the counters, on x86 and ppc64.
Issues were noted by Bruce Evans and are present on all architectures.

On i386, a counter fetch should use atomic read of 64bit value,
otherwise carry from the increment on other CPU could be lost for the
given fetch, making error of 2^32.  If 64bit read (cmpxchg8b) is not
available on the machine, it cannot be SMP and it is enough to disable
preemption around read to avoid the split read.

On x86 the counter increment is not atomic on purpose, which makes it
possible for the store of the incremented result to override just
zeroed per-cpu slot.  The effect would be a counter going off by
arbitrary value after zeroing.  Perform the counter zeroing on the
same processor which does the increments, making the operations
mutually exclusive.  On i386, same as for the fetching, if the
cmpxchg8b is not available, machine is not SMP and we disable
preemption for zeroing.

PowerPC64 is treated the same as amd64.

For other architectures, the changes made to allow the compilation to
succeed, without fixing the issues with zeroing or fetching.  It
should be possible to handle them by using the 64bit loads and stores
atomic WRT preemption (assuming the architectures also converted from
using critical sections to proper asm).  If architecture does not
provide the facility, using global (spin) mutex would be non-optimal
but working solution.

Noted by:  bde
Sponsored by:	The FreeBSD Foundation
2013-07-01 02:48:27 +00:00
Rui Paulo
7476f6973c Add INET6. 2013-06-30 23:29:24 +00:00
Aleksandr Rybalko
71c80b4ea0 Replace some spaces to tab. 2013-06-30 19:53:52 +00:00
Aleksandr Rybalko
8f1bc52dfb Decrypt magic numbers - define names for fields of Generic Timer's CNTKCTL reg.
Submitted by:	Ruslan Bukin <br@bsdpad.com>
2013-06-30 19:52:41 +00:00
Olivier Houchard
247602e3ea In generic_bs_map(), use kmem_alloc_nofault() instead of kmem_alloc(), as we
only need virtual addresses.

Submitted by:	alc
2013-06-30 19:36:17 +00:00
Aleksandr Rybalko
94addbe133 Arndale Board (by Insignal) kernel config file.
More info on the Wiki page https://wiki.freebsd.org/FreeBSD/arm/ArndaleBoard

Submitted by:	Ruslan Bukin <br@bsdpad.com>
Reviewed by:	gonzo
2013-06-29 23:58:16 +00:00
Oleksandr Tymoshenko
396e0d581d - Fix IMAPx registers values calculation
- Initialize SMAPx registers too although they're unused in QEMU
- Do not pass IO/MEM resources to upper bus for activation, handle them locally.
    Previously ACTIVATE method of upper bus was no-op so nothing bad
    happened. But now FDT maps physaddr to vaddr and it causes
    troubles: fdtbus_activate_resource resource assumes that
    bustag/bushandle are already set which in this case is wrong.
2013-06-29 23:51:17 +00:00