Commit Graph

1864 Commits

Author SHA1 Message Date
tsutsui f9712fccb8 uvm.page_idle_zero now is a bool, not a 32bit value any more.
BTW, is it still worth to have uvm_pageidlezero()? Which port uses it?
2007-02-23 15:11:36 +00:00
matt c8513022b4 Fix more boolean_t -> bool lossage 2007-02-22 05:28:53 +00:00
thorpej 712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
mrg 4410329b87 add a pair of new bus_dma(9) functions:
int _bus_dmatag_subregion(bus_dma_tag_t tag,
				  bus_addr_t min_addr,
				  bus_addr_t max_addr,
				  bus_dma_tag_t *newtag,
				  int flags)
	void _bus_dmatag_destroy(bus_dma_tag_t tag)

that allow a (normally broken/limited) device to restrict the bus address
range it can talk to.  this is used by bce(4) to limit DMA addresses to
1GB range, the maximum the chip can address.

all this is from Yorick Hardy <yhardy@uj.ac.za> with input from several
people on tech-kern.

XXX: bus_dma(9) needs an update still.
2007-02-21 20:41:23 +00:00
simonb ca3eaca4a4 Fix a tyop. 2007-02-21 14:52:32 +00:00
dyoung 91ab437064 Expand SMIPS so that the 'tags' make-target covers more sources.
Sort.
2007-02-21 02:28:30 +00:00
dyoung f0a3da8a33 Following other platform-dependent MIPS code, use SI_NQUEUES for
the length of the si_to_sr table.
2007-02-21 02:26:15 +00:00
simonb 374aec7877 Fix checks for 64-bit MIPS (MIPS64 _doesn't_ mean 64-bit MIPS(!)). 2007-02-19 22:04:07 +00:00
dyoung 4f62f7609b Create tags for alchemy, atheros, bonito. 2007-02-19 08:19:14 +00:00
jmcneill 692a0ae545 Only define COM_ARBUS_BAUD if not already defined elsewhere. 2007-02-17 23:25:26 +00:00
pavel 934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
oster 204d46e90b Fix typo from newlock2 merge, allowing MIPS64 to build again. 2007-02-16 03:30:48 +00:00
ad 3363855a4a Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
2007-02-16 02:53:43 +00:00
ad 58c53b4195 Pacify lint/gcc. 2007-02-15 15:27:53 +00:00
nakayama f7be5e7f25 s/___asm/__asm/ 2007-02-10 17:34:46 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
dyoung 9e85b986d1 Stop using _IPL_NSOFT because nothing defines it, and it is
unnecessary to specify the length of the arrays mips_ipl_si_to_sr,
anyway.
2007-02-06 05:39:16 +00:00
hubertf 142c2a33ba Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
2007-01-24 13:08:11 +00:00
martin e131201724 When converting FP exception codes, prefer overflow/underflow over
inexact result - this makes regress/lib/libc/ieeefp/except a bit happier.
2006-12-26 23:26:13 +00:00
martin e404fd2fc6 Make the DDB_TRACE variant compilable 2006-12-26 12:28:31 +00:00
wiz 3ed1aa9185 Spell "separate" correctly. From Zafer Aydogan. 2006-12-25 18:39:47 +00:00
yamt 8bf7662829 merge yamt-splraiseipl branch.
- finish implementing splraiseipl (and makeiplcookie).
	  http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
	- complete workqueue(9) and fix its ipl problem, which is reported
	  to cause audio skipping.
	- fix netbt (at least compilation problems) for some ports.
	- fix PR/33218.
2006-12-21 15:55:21 +00:00
simonb a236c92fa8 Fix a tyop, and a few other little punctuation nits while here. 2006-12-19 01:13:05 +00:00
simonb 346a126e90 Handle KSEG0 addresses specifically in pmap_extract(), similar
to how other KSEG-style pmaps (alpha, sh3, sh5) do.

Add a DIAGNOSTIC panic for KSEG1 addresses (nothing should touch
uncached memory, right?)

Clean up the the pmapdebug printfs a little too (athough with
more ugly #ifdef DEBUG bits of code).
XXX: should use DPRINTF() type printfs here.


Fixes panic running regress/sys/kern/umount on MIPS platforms
reported by Martin Husemann.
2006-12-18 00:40:26 +00:00
simonb f5b5aea261 Fix a grammatical nit near the previous typo fix.
Left the now somewhat bogus mips3_ prefixes in comments as is for now...

Thanks Pooka.
2006-12-12 12:03:45 +00:00
simonb 7641a1d1ad Fix a tyop in a comment. 2006-12-12 08:44:18 +00:00
tsutsui 7cb169d2dd Disable sosend_loan() in sys/kern/uipc_socket.c temporarily on CPUs
which have virtual address indexed cache and whose pmaps don't always
allow normal shared mappings even for read only pages.

In future, these pmaps should be rewritten to handle such read only
shared mappings properly like ARM pmap, but currently we just disable
sosend_loan() to avoid unnecessary uncached mappings and cache flushes
on MIPS3 CPUs, or map/unmap thrashing on SH4.

Discussed with thorpej a while ago.
2006-11-18 14:25:39 +00:00
tsutsui 44e83481b7 Defer _spl0() or _splnone() calls (which enable hardware interrupts)
from cpu_configure(9) to cpu_initclocks(9) on mips ports which use
mips3_clockintr.c:mips3_clockintr() (i.e. CPU INT5 clock) to avoid
hardclock(9) before softclock interrupt is initialized in initclocks().
This should be harmless because initclocks() is a part of configure()
in these days and there is no MI function which expects hardware
interrupts between cpu_configure(9) and cpu_initclocks(9).

Disccussed on tech-kern and port-mips.
2006-11-17 21:01:03 +00:00
martin 0a67366540 Make the syscall "code" variable unsigned - we don't test for negative
values when range checking.
2006-11-01 22:37:35 +00:00
he 8a7e351ffd Constify, since the new gcc propagates constness to struct members. 2006-10-23 19:49:47 +00:00
mrg 065b4dbdca fix errors in the previous changes. 2006-10-21 08:09:58 +00:00
mrg 648bbec934 in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev.  this occurs when we try to set the dumpdev to a device
with no driver loaded.  this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf().  (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.
2006-10-21 05:54:31 +00:00
gdamore e8ac1cad77 This commit provides substantial fixes and functionality for SPI flash.
Specifically, the SPI flash now operates as a nearly fully functional block
device (other than lacking disklabel support).  It does some basic translation
stuff, so that if you attempt to write a block, the underlying flash sectors
(usually 64k in size) will be read, erased and rewritten.

To minize thrashing, the spiflash strategy routine attempts to gather writes
to the same sector together, so that in the typical case you will not have to
repeatedly erase/rewrite the sector.  It also attempts to check and verify
whether an erase cycle is truly needed.  There are still access patterns that
will cause multiple erases to occur, and so I heartily discourage the use
of these flash devices for storing anything other than small configuration
data, or write-once images.  If you want to do more than that, then someone
should try to write a real flash translation layer.

The drivers attempt to provide some level of asynchronous operation, so that
while you are erasing or writing to the flash, other things can reasonably
take place.

Note that spiflash does not do bad block remapping.  It also doesn't detect
when a device is in read-only mode, or if some sectors are read-only.  It
only supports uniform sectored NOR flash.  It lacks any code to deal with
disklabels, and does not offer any disk related ioctls.

These limitations aside, it would not be terribly hard, I think, to break
out the code I've done to create a generic "norflash" driver, backed by
a "common" spiflash module.  Then other flash drivers (e.g. athflash, etc.)
could benefit from the ability to use this as a block device.  I've tried
to architect it to support that, if someone else wants to do the work.
(Hi Jared!)

The primary reason that I've not added code to deal with disklabels is that
I had a difficult time figuring out which framework (disklabels or wedges)
to use, and which bits of code were necessary to implement.  In the case of
the flash devices I'm working with, a parser to deal with redboot FIS images
(partitions) would need to be added.  I was prepared to do this, but gave
up owing to the complete and total lack of any API or design documentation
pertaining to the requirements for disk drivers and disklabel management or
wedges.   I would strongly encourage someone who knows something about
wedges or disklabels to write a simple document (or even a dummy driver)
showing which interfaces should be provided in new mass storage drivers.

This work was funded by the Champaign-Urbana Community Wireless Network
Project.
2006-10-20 06:41:46 +00:00
gdamore 1f351906f2 Forgot to commit this file when adding SPI support to Atheros. 2006-10-14 15:33:23 +00:00
gdamore 5bf8068cbb Add Atheros SPI controller. This is a "pseudo-controller", as it has some
artificial limitations which really only make it good for use with serial
flash devices.  One of the more annoying limitations is a restriction that
it can only transfer 8 bytes at a time. (4 command/address, plus 4 data.)

The driver includes design to work around those limitations, but these
changes are only appropriate for serial flash devices.

This driver is designed to run in interrupt driven mode, but due to lack
of adequate documentation, we run it in polled mode.

A subsequent commit will introduce the MI M25P flash driver, which has been
tested and is known to function somewhat reasonably..
2006-10-07 07:18:02 +00:00
tnozaki 44eb8f042e fix gcc -Werror -Wmissing-braces problem
mbstate_t(this is opaque object)'s initializer should be ``{ 0 }'',
so changed 1st field of union from character array to integer.
2006-10-04 13:51:59 +00:00
gdamore bcad08160c Add Alchemy PSC SPI bus protocol driver. Not activated on any boards yet,
that requires an evbmips commit.
2006-10-02 08:00:07 +00:00
gdamore 3bd9bd2f64 Make PSC better able to support different protocols, as developed for SPI.
The main changes needed are:

	1) pass address and IRQ information from aubus (auspi uses interrupts)

	2) all Au1550 PSC protocols have the same status and register bits
	   for enable, so clean that up (clock registers could be different)

	3) improve timeout logic on enable (a fixed delay isn't good enough)

	4) make aupsc_print return QUIET, as it is annoying to see messages
	   for unconfigured protocols.  This whole mechanism should be re-
	   engineered, to either use indirect configuration or provide more
	   detailed board-driven configuration.  A comment to that effect is
	   placed in the source.

This is shown to work on DBAU1550.
2006-10-02 07:32:16 +00:00
gdamore 871bc9f71c Add register values required to configure PSC/SPI devices on Alchemy AU1550.
Fairly soon I will be committing a new SPI bus framwork and an Alchemy
Au1550 implementation of the framework.
2006-10-02 06:44:00 +00:00
gdamore 4d15d9eb84 Fix incorrect code which ignored "req", causing all interrupts to get
assigned to request 0.  With this change, ethernet interrupts are assigned
to req1, seperately from req0.  This potentially gives better performance
by shortening the list of handlers walked somewhat.
2006-10-02 02:08:36 +00:00
elad 65792a0340 More from Matt Fleming:
Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
2006-10-01 20:31:49 +00:00
elad e8373398dc Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks! 2006-10-01 18:56:21 +00:00
gdamore 179079c753 Dynamically calculate the memory size. The math is suspect, but the
results are at least accurate.  (This was reverse engineered from the
redboot sources, which is one of the reasons why the math is suspect.)
2006-09-26 17:09:32 +00:00
gdamore e653071cb2 Initial import of AR2315 support, specifically the Meraki Mini (see
the Meraki web site at http://www.meraki.net/ )  This includes changes
to the AR5312 to make it more conducive to sharing code with the AR5315,
and also includes improved early console support.

All devices including ethernet and wlan interfaces on the Meraki Mini are
functional with this port, _except_ SPI flash, which will be introduced
later.

This port was funded by the Champaign-Urbana Communit Wireless Network
Project (CUWiN).
2006-09-26 06:37:31 +00:00
jmcneill f135e0d607 Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
2006-09-24 03:53:07 +00:00
gdamore 7c9507a357 Get rid of annoying and useless missed frame message, no other driver
echos this "non-error" message (not even tulip.c).  Included is an
explanatory message stating that these counters should probably all be
converted to evcnt counters.
2006-09-20 05:37:22 +00:00
tsutsui e5dc12ca9c Change mips3_clockintr() to take (struct clockframe *) rather than
pc and status since it calls hardclock(9) anyway.
OK'ed by gdamore on port-mips.
2006-09-10 14:27:38 +00:00
simonb 30151b7fc1 Fix a white-space nit. 2006-09-09 04:01:37 +00:00
gdamore bf6fc8ef63 Various improvements to make the common mips3 clock handling more generally
useful.  The functions delay, cpu_initclocks, and setstatclcokrate have been
renamed to mips3_delay, mips3_initclocks, and mips3_setstatclockrate.

We provide weak aliases for the original names, so machdep code doesn't have
to provide wrapper routines.  (Giving good performance.)

I've moved mips3_clockintr, mips3_initclocks, and mips3_setstatclockrate to
their own mips3_clockintr file, because some ports may not be able to use
these, and its senseless to carry that baggage.
2006-09-08 23:39:27 +00:00
gdamore cc68dbd9e5 Rename init_mips3_tc to mips3_init_tc() for consistency, and make it
extern.
2006-09-08 22:14:14 +00:00