Commit Graph

1157 Commits

Author SHA1 Message Date
Andrew Thompson
70dd8d2da0 MFC r200014
Remove unknown ath hal device entries.
2010-05-25 02:28:39 +00:00
Alexander Motin
4567e8334a MFC r207536, r207696, r208183:
Import mvs(4) - Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA controllers
driver for CAM ATA subsystem. This driver supports same hardware as
atamarvell, ataadaptec and atamvsata drivers from ata(4), but provides
many additional features, such as NCQ, PMP, etc.
2010-05-19 14:50:07 +00:00
Attilio Rao
d5a628572d MFC r207922, r207925, r207929, r208052:
- Change the db_printf return value in order to catch up with printf
- Make witness_list_locks() and witness_display_spinlock() accept
  callbacks for printf-like functions in order to queue the output on the
  correct channel.
2010-05-18 10:24:23 +00:00
Konstantin Belousov
19effccdee MFC r204051 (by imp):
n64 has a different size for KINFO_PROC_SIZE.

Approved by:	imp

MFC r207152:
Move the constants specifying the size of struct kinfo_proc into
machine-specific header files. Add KINFO_PROC32_SIZE for struct
kinfo_proc32 for architectures providing COMPAT_FREEBSD32. Add
CTASSERT for the size of struct kinfo_proc32.

MFC r207269:
Style: use #define<TAB> instead of #define<SPACE>.
2010-05-08 18:54:47 +00:00
Andrew Thompson
ad65806013 MFC r207077
Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had
 the illusion of a tunable setting but was always turned on regardless.
2010-04-29 22:44:04 +00:00
Alexander Motin
48e700702f MFC r206053, r206054:
Fill extended ATA command registers in cPRD to support 48bit commands.
2010-04-15 12:30:46 +00:00
Marcel Moolenaar
dfeca18773 MFC rev 198341 and 198342:
o   Introduce vm_sync_icache() for making the I-cache coherent with
    the memory or D-cache, depending on the semantics of the platform.
    vm_sync_icache() is basically a wrapper around pmap_sync_icache(),
    that translates the vm_map_t argumument to pmap_t.
o   Introduce pmap_sync_icache() to all PMAP implementation. For powerpc
    it replaces the pmap_page_executable() function, added to solve
    the I-cache problem in uiomove_fromphys().
o   In proc_rwmem() call vm_sync_icache() when writing to a page that
    has execute permissions. This assures that when breakpoints are
    written, the I-cache will be coherent and the process will actually
    hit the breakpoint.
o   This also fixes the Book-E PMAP implementation that was missing
    necessary locking while trying to deal with the I-cache coherency
    in pmap_enter() (read: mmu_booke_enter_locked).
2010-03-31 02:43:58 +00:00
Rafal Jaworowski
7088545a40 MFC r205027
Let detailed info about CPU features print on Marvell Sheeva CPU as well.

Provide missing entry in the cpu_classes[].

Reported by:	Maks Verver
2010-03-18 11:53:32 +00:00
Rafal Jaworowski
9f36044770 MFC r205028
Fix ARM cache handling yet more.

 1) vm_machdep.c: remove the dangling allocations so they do not
    un-necessarily turn off the cache upon consecutive access.

 2) busdma_machdep.c: remove the same amount than shadow mapped.

Reported by:	Maks Verver
Submitted by:	Mark Tinguely
Reviewed by:	Grzegorz Bernacki
2010-03-15 19:59:16 +00:00
Rafal Jaworowski
7bfaecdca3 MFC r204764
Provide correct TCLK value for Kirkwood A1 silicon revision.

While there improve SOC ID output accordingly.

Obtained from:	Semihalf
2010-03-15 19:51:24 +00:00
Bernd Walter
6c96d2f595 MFC 204462,204463,204476: fix multicast hashes 2010-03-13 16:37:17 +00:00
Rafal Jaworowski
0500dff0e4 MFC r204283
Do not force verbose and single mode in non-metadata boot case.

We want to go multi-user by default also in case of booting without
loader(8).
2010-03-04 20:22:48 +00:00
Rafal Jaworowski
a911d19dfe MFC r203637:
Improve checking whether an ARM VA has a valid mapping before performing cache
sync.

VIPT/PIPT caches need valid VA-PA mapping in PTE for a cache operation to
succeed (unlike VIVT). Prior to this fix pmap was using l2pte_valid() for that
check, but this is not sufficient as the function merely checks if a PTE
exists (there can be existing but _invalid_ entries in the table).

A new pmap_has_valid_mapping() routine is introduced to do this job right by
checking proper PTE flags.

Among other potential problems this cures coherency issues with L2 caches on
MV-78100.

Submitted by:	Grzegorz Bernacki, Piotr Ziecik
Reviewed, tested by:	marcel
Obtained from:	Semihalf
2010-02-15 15:00:40 +00:00
Warner Losh
1b1bff673f Revert 201158. DEFAULTS isn't for this kind of thing.a 2010-01-04 21:33:10 +00:00
Doug Barton
be0d315238 MFC r200594:
Add INCLUDE_CONFIG_FILE, and a note in comments about how to also
include the comments with CONFIGARGS
2009-12-29 05:35:25 +00:00
Konstantin Belousov
43ba78037b MFC r198507:
Use kern_sigprocmask() instead of direct manipulation of td_sigmask to
reschedule newly blocked signals.

MFC r198590:
Trapsignal() calls kern_sigprocmask() when delivering catched signal
with proc lock held.

MFC r198670:
For trapsignal() and postsig(), kern_sigprocmask() is called with
both process lock and curproc->p_sigacts->ps_mtx locked. Prevent lock
recursion on ps_mtx in reschedule_signals().
2009-12-19 11:31:28 +00:00
Konstantin Belousov
f0087a7a3c MFC r199135:
Extract the code that records syscall results in the frame into MD
function cpu_set_syscall_retval().
2009-12-12 20:06:25 +00:00
Alexander Motin
71e7360ed9 MFC r200171, r200182, r200275, r200295, r200359:
Introduce ATA_CAM kernel option, turning ata(4) controller drivers into
cam(4) interface modules. When enabled, this option deprecates all ata(4)
peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers
(ada, cd, ...) and interfaces to be natively used instead.

As side effect of this, ata(4) mode setting code was completely rewritten
to make controller API more strict and permit above change. While doing
this, SATA revision was separated from PATA mode. It allows DMA-incapable
SATA devices to operate and makes hw.ata.(ata|atapi)_dma tunable work again.

Also allow ata(4) controller drivers (except some specific or broken ones)
to handle larger data transfers. Previous constraint of 64K was artificial
and is not really required by PCI ATA BM specification or hardware.

Submitted by:   nwitehorn (powerpc part)
2009-12-12 10:37:31 +00:00
Bjoern A. Zeeb
c4de0a57f3 MFC r197729:
Make sure that the primary native brandinfo always gets added
  first and the native ia32 compat as middle (before other things).
  o(ld)brandinfo as well as third party like linux, kfreebsd, etc.
  stays on SI_ORDER_ANY coming last.

  The reason for this is only to make sure that even in case we would
  overflow the MAX_BRANDS sized array, the native FreeBSD brandinfo
  would still be there and the system would be operational.

Reviewed by:	kib
2009-12-05 20:43:15 +00:00
Alexander Motin
555a8009dd MFC r198717:
- Remove most of direct relations between ATA(4) peripherial and controller
levels. It makes logic more transparent and is a mandatory step to wrap
ATA(4) controller level into ATA-native CAM SIM.
- Tune AHCI and SATA2 SiI drivers memory allocation a bit to allow bigger
I/O transaction sizes without additional cost.
2009-11-23 08:45:17 +00:00
Alan Cox
ebc91405bd MFC r197316
Add a new sysctl for reporting all of the supported page sizes.
2009-10-31 18:54:26 +00:00
Konstantin Belousov
55f128de91 MFC r197933:
Define architectural load bases for PIE binaries.

MFC r198203 (by marius):
Change load base for sparc to match default gcc memory layout model.

Approved by:	re (kensmith)
2009-10-20 13:32:28 +00:00
Rafal Jaworowski
e9667e8ff1 MFC r196531-196534,196536
Clean up Marvell platform code.

Introduce SheevaPlug support.

   - The device is based on Marvell 88F6281 system on chip.
   - More info about the platform at http://www.plugcomputer.org

   - To build the FreeBSD kernel:
     make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG

   - Installation notes at: http://wiki.freebsd.org/FreeBSDMarvell

Submitted by:	Michal Hajduk
Approved by:	re (kib)
Obtained from:	Semihalf
2009-09-16 12:07:58 +00:00
Konstantin Belousov
2af00decb8 MFC r196730:
Remove the altkstacks, instead instantiate threads with kernel stack
allocated with the right size from the start. For the thread that has
kernel stack cached, verify that requested stack size is equial to the
actual, and reallocate the stack if sizes differ.

Introduce separate kernel stack cache that keeps some limited amount of
preallocated kernel stacks to lower the latency of thread allocation.

Not a merge: instead of removing td_altkstack* members of struct thread,
replace them with placeholders to keep struct thread layout on the
stable branch.

Also, record r196640, r196644 and r196648 as merged.

Approved by:	re (kensmith)
2009-09-08 15:31:23 +00:00
Stanislav Sedov
3a68500f53 - Merge r196246:
Proprely intialize UART parameters at probe stage, so uart(4)
  will initialize the FIFO memory correctly on attach.  Before
  that this values was intialized in only in at91_usart_bus_attach
  which is called after the uart(4) memory allocation happens.

Approved by:	re (kib)
MFC after:	1 week
2009-08-15 15:18:29 +00:00
Rafal Jaworowski
60df4aa103 MFC r196193:
Use correct wbinv operation in pmap_l2cache_wbinv_range().

Submitted by:	Michal Hajduk
Reviewed by:	stas
Approved by:	re (kib)
Obtained from:	Semihalf
2009-08-13 16:01:19 +00:00
Robert Watson
530c006014 Merge the remainder of kern_vimage.c and vimage.h into vnet.c and
vnet.h, we now use jails (rather than vimages) as the abstraction
for virtualization management, and what remained was specific to
virtual network stacks.  Minor cleanups are done in the process,
and comments updated to reflect these changes.

Reviewed by:	bz
Approved by:	re (vimage blanket)
2009-08-01 19:26:27 +00:00
John Baldwin
013818111a Add a new type of VM object: OBJT_SG. An OBJT_SG object is very similar to
a device pager (OBJT_DEVICE) object in that it uses fictitious pages to
provide aliases to other memory addresses.  The primary difference is that
it uses an sglist(9) to determine the physical addresses for a given offset
into the object instead of invoking the d_mmap() method in a device driver.

Reviewed by:	alc
Approved by:	re (kensmith)
MFC after:	2 weeks
2009-07-24 13:50:29 +00:00
Rafal Jaworowski
84a5818564 Make dcache_inv_range() point to the proper routines on ARM9 and ARM9E/ARM10.
On some ARM variations CPU func dispatcher has the D-cache invalidate method
point to write-back invalidate, which is wrong, and can lead to a crash/panic
on affected platforms.

Spotted by:	HPS
Reviewed by:	cognet
Approved by:	re (kib)
2009-07-21 08:29:19 +00:00
Rafal Jaworowski
331f685743 ARM pmap fixes.
a)  nocache-remap problem

   When a page is remapped into a non-cacheable virtual memory region there
   was no associated write-back invalidate operation performed. We remove
   writeback of the original buffer size from bus_dmamem_alloc() and add
   appropriate L1/L2 flush operation.

b) missing write-back invalidate operation

   In pmap_kremove a page is removed so we must do a write-back
   invalidate operation aligned to the page virtual address.

Submitted by:	Michal Hajduk
Reviewed by:	Mark Tinguely, rpaulo, stas
Approved by:	re (kib)
Obtained from:	Semihalf
2009-07-20 07:53:07 +00:00
Rui Paulo
8b9fde4324 Add IEEE80211_SUPPORT_MESH, following similar change to nanobsd and
other GENERIC kernels.

Approved by:	re (kib)
2009-07-17 18:35:45 +00:00
Alan Cox
3153e878dd Add support to the virtual memory system for configuring machine-
dependent memory attributes:

Rename vm_cache_mode_t to vm_memattr_t.  The new name reflects the
fact that there are machine-dependent memory attributes that have
nothing to do with controlling the cache's behavior.

Introduce vm_object_set_memattr() for setting the default memory
attributes that will be given to an object's pages.

Introduce and use pmap_page_{get,set}_memattr() for getting and
setting a page's machine-dependent memory attributes.  Add full
support for these functions on amd64 and i386 and stubs for them on
the other architectures.  The function pmap_page_set_memattr() is also
responsible for any other machine-dependent aspects of changing a
page's memory attributes, such as flushing the cache or updating the
direct map.  The uses include kmem_alloc_contig(), vm_page_alloc(),
and the device pager:

  kmem_alloc_contig() can now be used to allocate kernel memory with
  non-default memory attributes on amd64 and i386.

  vm_page_alloc() and the device pager will set the memory attributes
  for the real or fictitious page according to the object's default
  memory attributes.

Update the various pmap functions on amd64 and i386 that map pages to
incorporate each page's memory attributes in the mapping.

Notes: (1) Inherent to this design are safety features that prevent
the specification of inconsistent memory attributes by different
mappings on amd64 and i386.  In addition, the device pager provides a
warning when a device driver creates a fictitious page with memory
attributes that are inconsistent with the real page that the
fictitious page is an alias for. (2) Storing the machine-dependent
memory attributes for amd64 and i386 as a dedicated "int" in "struct
md_page" represents a compromise between space efficiency and the ease
of MFCing these changes to RELENG_7.

In collaboration with: jhb

Approved by:	re (kib)
2009-07-12 23:31:20 +00:00
Sam Leffler
8c393fd1f0 Cleanup ALIGNED_POINTER:
o add to platforms where it was missing (arm, i386, powerpc, sparc64, sun4v)
o define as "1" on amd64 and i386 where there is no restriction
o make the type returned consistent with ALIGN
o remove _ALIGNED_POINTER
o make associated comments consistent

Reviewed by:	bde, imp, marcel
Approved by:	re (kensmith)
2009-07-05 17:45:48 +00:00
Rafal Jaworowski
f981547c99 Map DPCPU pages into ARM kernel VA space.
DPCPU area was not properly mapped into kernel VA space, which caused page
fault on the first DPCPU access. This patch fixes the problem by mapping DPCPU
area into kernel VA space.

Submitted by:	Michal Hajduk, Piotr Ziecik
Reviewed by:	cognet, stas
Approved by:	re (kib)
Obtained from:	Semihalf
2009-07-01 20:07:44 +00:00
Alan Cox
5797795f5a Correct the #endif comment.
Noticed by:	jmallett
Approved by:	re (kib)
2009-06-26 16:22:24 +00:00
Robert Watson
eb956cd041 Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/
IF_ADDR_UNLOCK() across network device drivers when accessing the
per-interface multicast address list, if_multiaddrs.  This will
allow us to change the locking strategy without affecting our driver
programming interface or binary interface.

For two wireless drivers, remove unnecessary locking, since they
don't actually access the multicast address list.

Approved by:	re (kib)
MFC after:	6 weeks
2009-06-26 11:45:06 +00:00
Alan Cox
e999111ae7 This change is the next step in implementing the cache control functionality
required by video card drivers.  Specifically, this change introduces
vm_cache_mode_t with an appropriate VM_CACHE_DEFAULT definition on all
architectures.  In addition, this changes adds a vm_cache_mode_t parameter
to kmem_alloc_contig() and vm_phys_alloc_contig().  These will be the
interfaces for allocating mapped kernel memory and physical memory,
respectively, with non-default cache modes.

In collaboration with:	jhb
2009-06-26 04:47:43 +00:00
Sam Leffler
8351cacf89 temporarily disable optional uarts; apparently we hang when probing them
(and they are not present)
2009-06-25 18:07:19 +00:00
Rafal Jaworowski
ebeaf70342 Enable all populated TWSI (I2C) controllers on Marvell SOCs.
Obtained from:	Semihalf
2009-06-25 10:03:51 +00:00
Olivier Houchard
aeb56f0662 Fix typo. 2009-06-24 21:03:59 +00:00
Olivier Houchard
f03aef6beb Fix typo. 2009-06-24 21:00:13 +00:00
Rafal Jaworowski
9d02143909 Introduce ata(4) support for Marvell integrated SATA controllers (found on
88F5xxx, 88F6xxx and MV78xxx system on chip devices).

Reviewed by:	stas
Obtained from:	Semihalf
2009-06-24 15:41:18 +00:00
Jeff Roberson
50c202c592 Implement a facility for dynamic per-cpu variables.
- Modules and kernel code alike may use DPCPU_DEFINE(),
   DPCPU_GET(), DPCPU_SET(), etc. akin to the statically defined
   PCPU_*.  Requires only one extra instruction more than PCPU_* and is
   virtually the same as __thread for builtin and much faster for shared
   objects.  DPCPU variables can be initialized when defined.
 - Modules are supported by relocating the module's per-cpu linker set
   over space reserved in the kernel.  Modules may fail to load if there
   is insufficient space available.
 - Track space available for modules with a one-off extent allocator.
   Free may block for memory to allocate space for an extent.

Reviewed by:    jhb, rwatson, kan, sam, grehan, marius, marcel, stas
2009-06-23 22:42:39 +00:00
Sam Leffler
ea158edaa6 Now that we have UARTs running with fast interrupt handlers the ata
driver's i/o ops must be locked to avoid chaos.  Extend the cambria
bus tag to support ata and add a spin lock.  The ata driver is
hacked to use that instead of it's builtin hack for ixp425.  Once
the ata driver is fixed to not be confused about byte order we can
generalize the cambria bus tag code and make it generally useful.

While here take advantage of our being ixp435-specific to remove
delays when switching between byte+word accesses and to eliminate
the 2us delay for the uarts (the spin lock overhead looks to do
this for us).
2009-06-23 19:29:23 +00:00
Sam Leffler
dbdc502de6 use consistent style 2009-06-23 19:05:02 +00:00
Sam Leffler
3616874919 kill left over cruft 2009-06-22 23:22:38 +00:00
Sam Leffler
412501cdfd enable optional GPS+RS485 uarts 2009-06-22 22:54:44 +00:00
Sam Leffler
982cb04f16 o add a bus space tag that forces a 2usec delay between r/w ops; this is
used for the optional GPS+RS485 uarts on the Gateworks Cambria boards
  which otherwise are unreliable
o setup the hack bus space tag for the GPS+RS485 uarts
o program the gpio interrupts for the uarts to be edge-rising
o force timing on the expansion bus for the uarts to be "slow"

Thanks to Chris Lang of Gateworks for these tips.
2009-06-22 22:54:13 +00:00
Sam Leffler
cb206d66bf fix typo 2009-06-22 22:47:06 +00:00
Sam Leffler
a34dbf45de o remove hack to write UUE+RTOIE in the uart's IER; force them with hints
o honor hints for the rclk
2009-06-22 22:46:37 +00:00