Commit Graph

315 Commits

Author SHA1 Message Date
ad
4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
garbled
d974db0ada Merge the ppcoea-renovation branch to HEAD.
This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree.  Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches.  The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
2007-10-17 19:52:51 +00:00
ad
9f56dfa520 Merge brelse() changes from the vmlocking branch. 2007-10-08 18:02:53 +00:00
martin
984c6bf848 Bump SYMTAB_SPACE significantly, so that the MTX-1 kernel builds with
symbols again.
2007-08-11 23:48:04 +00:00
ad
66fefd117b It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:15:35 +00:00
ad
63811f5275 Generic soft interrupts are mandatory. 2007-07-14 21:48:17 +00:00
dyoung
1ee8f4a418 Extract common code from i386, xen, and sparc64, creating
config_handle_wedges() and read_disk_sectors().  On x86, handle_wedges()
is a thin wrapper for config_handle_wedges().  Share opendisk()
across architectures.

Add kernel code in support of specifying a root partition by wedge
name.  E.g., root specifications "wedge:wd0a", "wedge:David's Root
Volume" are possible.  (Patches for config(1) coming soon.)

In support of moving disks between architectures (esp. i386 <->
evbmips), I've written a routine convertdisklabel() that ensures
that the raw partition is at RAW_DISK by following these steps:

        0 If we have read a disklabel that has a RAW_PART with
          p_offset == 0 and p_size != 0, then use that raw partition.

        1 If we have read a disklabel that has both partitions 'c'
          and 'd', and RAW_PART has p_offset != 0 or p_size == 0,
          but the other partition is suitable for a raw partition
          (p_offset == 0, p_size != 0), then swap the two partitions
          and use the new raw partition.

        2 If the architecture's raw partition is 'd', and if there
          is no partition 'd', but there is a partition 'c' that
          is suitable for a raw partition, then copy partition 'c'
          to partition 'd'.

        3 Determine the drive's last sector, using either the
          d_secperunit the drive reported, or by guessing (0x1fffffff).
          If we cannot read the drive's last sector, then fail.

        4 If we have read a disklabel that has no partition slot
          RAW_PART, then create a partition RAW_PART.  Make it span
          the whole drive.

        5 If there are fewer than MAXPARTITIONS partitions,
          then "slide" the unsuitable raw partition RAW_PART, and
          subsequent partitions, into partition slots RAW_PART+1
          and subsequent slots.  Create a raw partition at RAW_PART.
          Make it span the whole drive.

The convertdisklabel() procedure can probably stand to be simplified,
but it ought to deal with all but an extraordinarily broken disklabel,
now.

i386: compiled and tested, sparc64: compiled, evbmips: compiled.
2007-06-24 01:43:34 +00:00
dyoung
82cc8fc351 In sys/kern/Make.tags.inc, create an intermediate variable FINDCOMM.
FINDCOMM contains the find(1) command that produces the list of
NetBSD sources that all architectures share, COMM.  For backwards
compatibility, evaluate FINDCOMM to produce ${COMM}.

In arch/evbmips/Makefile, use FINDCOMM directly, because the
command-line 'echo $COMM ...' was too long.
2007-06-24 01:03:35 +00:00
tsutsui
73b3a64df4 Move declaretions of _spl*() and _{clr,set}softintr() functions
(which are in mips/locore.S) into <mips/locore.h>
from various MD files.
2007-06-17 06:04:27 +00:00
dyoung
4d1beb764e Make ADM5120 boards use the "common" disk subroutines, such as
readdisklabel(9), which are better than the evbmips disk subroutines
at finding a BSD disklabel at a different location than the evbmips
default of sector 0, offset 64.  Helps me boot a RouterBOARD 153
from a CompactFlash containing both a Master Boot Record at sector
0, and a BSD disklabel at sector 1, offset 0.
2007-06-05 21:53:10 +00:00
he
e9e5beefa0 Now that curcpu() is defined in terms of curlwp() for mips, we need to
include <sys/lwp.h> where curcpu() is used.
2007-05-20 17:06:25 +00:00
yamt
f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +00:00
macallan
cd8fb15721 include files.wsfb 2007-04-10 02:29:42 +00:00
dyoung
5770bb4c31 Add extio, gpio. Remove admflash. Makes the compile again. 2007-04-03 23:53:34 +00:00
dyoung
eabf98a2cc Add extio and gpio so that this compiles again. 2007-04-03 21:54:01 +00:00
dyoung
aa13eb6f2f Add extio and gpio at mainbus so that this builds. 2007-04-03 18:06:31 +00:00
dyoung
29bf5964b4 Auto-detect RAM size. 2007-04-03 18:05:57 +00:00
dyoung
8db8860cb3 Add an example kernel configuration for the RouterBOARD 153.
XXX This is a fairly specialized configuration that I use for a
XXX wireless router.
2007-03-20 09:22:01 +00:00
dyoung
320845dda2 Add a port to the Infineon ADM5120.
Basics: the ADM5120 is a 175 MHz MIPS32 4Kc processor featuring a
6-port ethernet 10/100 switch with Auto MDI/X, a PCI controller,
USB 1.1 controller, UART, watchdog timer, eight GPIO pins, and a
multiport memory controller with both NOR and NAND flash support.
This code supports most of the devices on the ADM5120, including
the 6-port switch (each port attaches as an ethernet, admsw0 through
admsw5), the PCI controller, USB controller, GPIO, watchdog, and
UART.

Remaining work: the port includes no NOR/NAND flash drivers.  No
bootloader is included.  I have only tested the PCI bus driver with
the use of one PCI slot on the RouterBOARD 153.  It is not possible
to exploit the capabilities of the ethernet switch using bridge(4).
I have only netbooted the ADM5120 on the RB153.  Booting other
boards, and booting from flash memory, remains to be done.

Hardware availability: many low-cost routers, including the
RouterBOARD 100 series at RouterBOARD.com, use the Infineon ADM5120
processor.

Credits: Ruslan Ermilov and Vsevolod Lobko ported to the ADM5120,
and they wrote device drivers for the UART, USB controller, and
10/100 switch.  Matt Isaacs brought the port up-to-date with
NetBSD-current, made it compile, and ran it first on the RB153.
I added drivers for the PCI controller, GPIO, and watchdog timer.
I produced the bus attachment for the CompactFlash slot with advice
from Mikrotik technical support and from Matt Thomas.
2007-03-20 08:52:00 +00:00
dyoung
0a000a82df Remove the tags file before rebuilding it. 2007-03-14 19:00:57 +00:00
drochner
ab07e481e4 It doesn't make sense to specify "configuration" and "interface"
locators for uhub because a hub can't have sub-devices.
This might be sanity-checked eventually.
Same for ubt now after the change to device attachment.
2007-03-14 12:27:20 +00:00
simonb
a92d5c5157 Fix some caddr_t rototill fallout. 2007-03-06 00:48:07 +00:00
dogcow
f18ef70a25 semimechanically convert 'void foo' -> 'void *foo', as part of the continuing
caddr_t fallout.
2007-03-05 21:05:00 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
kiyohara
8147572ab4 s/Sever/Server/ 2007-02-23 13:34:34 +00:00
thorpej
8b3bae6275 TRUE -> true, FALSE -> false 2007-02-22 05:19:00 +00:00
jmcneill
e9a5822887 Add example config file for Netgear WGT624 v3 wireless router. 2007-02-17 23:26:03 +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
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +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
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
scw
efb2b3439f Partition sizes are specified in terms of the physical sector size of the disk. 2006-11-25 13:09:14 +00:00
scw
e07faf8a74 Replace the myriad copies of bounds_check_with_label() with a single MI
version.

Add disk_blocksize(9) so that disk drivers can record the physical
block size of a disk if it is different to DEV_BSIZE. Right now this
simply initialises dk_blkshift and dk_byteshift according to the
supplied block size. This information is used in the MI version of
bounds_check_with_label().
2006-11-25 11:59:55 +00:00
riz
11f6dc7a44 Don't worry about the ELF32_MACHDEP_ENDIANNESS macro when compiling
a host tool - it's never used there.
2006-11-25 07:32:53 +00:00
wiz
6919c6578c s/independant/independent/, from Zafer. 2006-11-24 22:04:21 +00:00
tsutsui
9cdb8836f5 Fix wrong prototype declarations of _spl*() functions.
Pointed out by Havard Eidnes.
XXX: should these decls be in <mips/intr.h> or <mips/locore.h>?

While here, remove "extern" keyword from function declarations.
2006-11-18 16:40:21 +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
gdamore
83060aef95 Active SPI connected STMicro serial flash. Note that this driver is still
a bit rudimentary, but it works well enough to read flash at least.
2006-10-07 07:24:23 +00:00
gdamore
e7ee9e199f Add major for spiflash. Note that this major should probably be moved out
to device-independent space, but we might well choose to wait to do that
until _after_ we have a full MI flash framework.
2006-10-07 07:22:36 +00:00
gdamore
118d36b6e7 Add the final glue bits required to enable the SPI interface on the
DBAU1550.  This is parameterized somewhat as machdep pluggable code, so
different boards can supply different implementations.

At the moment, the DBAU1550 is the only Au1550 board I know of with SPI
connected devices.

I have not enabled I2C on the DBAU1550, as we do not have drivers for either
of the I2C connected devices (a different temperature/voltage sensor and
a serial eeprom.)
2006-10-02 08:13:53 +00:00
chs
e8295642bd remove MALLOC_NOINLINE, it doesn't do anything anymore. 2006-10-02 03:28:29 +00:00
manu
f309b668fd - Document COMPAT_15 as doing nothing
- Add COMPAT_15 to all the kernel that had COMPAT_14, for the sake of coherency
- Remove the only occurences of #ifdef COMPAT_15 in the tree: for the ARM
ports, COMPAT_15 was always used in conjunction with EXEC_AOUT. Only EXEC_AOUT
matters here.

This address kern/18407
2006-09-27 21:42:04 +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
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
65d14d5f62 Add ath@pci.
Bump SYMTAB_SPACE.
2006-09-09 04:00:24 +00:00
simonb
1592ce0c68 Move the "reseting board..." printf to before the first code that can
reset a board.
2006-09-09 03:58:46 +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
simonb
66e9a5e5c7 Print out a "\n" after calling mc146818_attach().
Pointed out by Izumi Tsutsui.
2006-09-07 04:59:30 +00:00
gdamore
1f585717a8 This is a boat-load of changes designed to finish parameterizing the
stuff necessary to separate out AR5312 from AR5315.  This includes:

	1) rework of arbus IRQs, so that IRQs are now seperately specified
	   as either MISC or CPU irqs
	2) move board/chip-specific addresses into chip-dependent file
	3) unencumber argpio from ar5312 specifics, using properties to pass
	   details such as reset-pin and sysled-pin.
	4) an option to select which WiSoC is to be configured is provided.

AR5315 support should be forthcoming shortly now.
2006-09-04 05:17:26 +00:00
gdamore
3bc99cc29a Use new common, MIPS3 clock handling. This eliminates some port-specific
code in favor of common MIPS3 code.
2006-09-02 22:54:47 +00:00