Commit Graph

572 Commits

Author SHA1 Message Date
ad 6ba528b5bc Remove softdep, pass 1. We are focused on improving journalling.
Proposed on tech-kern@.
2008-11-24 11:41:07 +00:00
ad 5b57d1bcce LKM -> MODULAR 2008-11-13 10:51:23 +00:00
ad 0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
dyoung 94d985722a It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled.  So I have made two changes:

1 Do not call pmf_system_shutdown() from doshutdownhooks().  Instead,
change every call to doshutdownhooks() to a call to doshutdownhooks()
followed by a call to pmf_system_shutdown().  No functional change
is intended by this change.

2 Make i386 re-enable interrupts briefly while it calls
pmf_system_shutdown().  I leave it to others either to fix the
other ports, or to factor out some MI shutdown code, as joerg@
suggests, and fix that.  Note that a functional change *is* intended
by this change.

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.
2008-11-11 06:46:40 +00:00
tls fca9d633b9 Add accept filters to GENERIC kernels where they exist. 2008-08-10 15:31:20 +00:00
simonb 0751ba4bff Add "options WAPBL" to standard GENERIC/INSTALL type configs. 2008-07-31 07:40:59 +00:00
phx 1edc11edbf No longer used. 2008-05-18 12:14:08 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
garbled 9792283735 SMP support for ofppc. (finally) Much thanks to Matt Thomas for help in
figuring out all the crazy nuances of getting this working, and to
Michael Lorenz for testing/fixing my changes on macppc.  Tested with a
quad-proc 7044-270.
Summary of changes:

Bumped CPU_MAXNUM to 16 on ofppc.
Added md_* routines to ofppc/cpu.c, to sync the timebase, and awaken the CPUs.
Fixed a bug in the test for a 64bit bridge cpu early in locore.S
Added code to set the interrupt priority for all CPUs with an openpic.
Change rtas to probe before cpus, to allow use of the rtas freeze/thaw
timebase code routines.
Fix CPU_INFO_FOREACH macro to iterate through detected cpus, not CPU_MAXNUM.
Change most uses of ci_cpuid to ci_index, to deal with CPUs that do not allow
writing to SPR_PIR.  Don't write SPR_PIR unless the secondary cpu identifies
itself as 0.
Change the hatchstack/interrupt stack allocations to allocate a 8192byte
interrupt stack, and a 4096 byte hatch stack, align them to 16 bytes, and
allocate them no lower than 0x10000.  Allocate them separately to prevent the
hatch stack corrupting the interrupt stack later on.
If the CPU is a 64bit cpu, copy SPR_ASR in cpu_hatch()
Set the idle stack to ci->ci_data.cpu_idlelwp->l_addr->u_pcb.pcb_sp.
Add OF_start_cpu().  Add a routine to ofwoea_initppc to spin up secondary
procs early, and place them into a spinloop waiting for the hatch routines
to be ready.
Modify the ipi routines to deal with openpics that reverse byte order on read
from an ipi register. (such as on the 7044)
Change the rtas setup to allocate the rtas physical base address above
the kernel, to avoid mucking up the hatch/interrupt stacks.
2008-04-08 02:33:03 +00:00
phx 232fdde483 Activate genfb, pckbc, pckbd, pms, wskbd, wsmouse and wsdisplay.
Those devices work reliable on a Pegasos2 system with serial console and
with a real keyboard/monitor.
2008-03-29 21:55:32 +00:00
phx 834524db94 INSECURE option is required for the Xserver to access /dev/mem.
Approved by garbled.
2008-03-08 20:51:57 +00:00
phx d40e0abd20 Define PCI_MAGIC_IO_RANGE for X11 server. The address chosen may change.
Approved by garbled.
2008-03-07 17:13:49 +00:00
phx cb8c72e1d4 Added scsibus at umass for USB keys and ADOSFS for mounting Amiga file systems
on Pegasos computers.
Approved by garbled.
2008-02-23 21:16:05 +00:00
drochner bb33f35f20 Since files.wscons et al. are included by ~all ports anyway, include
them in the mi "files" file, and remove include statements from md files.
These shouldn't pull in additional kernel code when not in use, so it
shouldn't do any harm except a risk of namespace collisions which
should be easy to fix.
2008-02-20 21:43:33 +00:00
tsutsui 00bd6f7500 Remove obsolete platform support options. 2008-02-15 12:28:09 +00:00
garbled 53ee4a269c Fix a botch in the comparison of two addresses, where I forgot to add in
the offset of a range.  With this fix to the openpic initialization,
ofppc now boots single user on a 7046-B50.  Thanks to Jochen Kunz for
giving me remote access to a B50 to hack on it.
2008-02-13 21:12:32 +00:00
garbled dc6a7fd211 Add support to ofwboot for booting on the 7046-B50. Also likely to work
on the 7043-150.  The B50 wants not only a note at the head of the
binary, like the 7044 did, but it also wants a PHDR that points at it.
Because the IBM firmware doesn't like the real note section that ld
generates (it puts it at the end of the file), we instead point PT_NOTE
at the text section.  This works, because at the top of the text section,
there is a note hacked in, which was required for the 7044.

Also, change the mode from virtual mode to real mode in the note, because
the B50 hangs if you load it in virtual.  Tested to work on a B50, 7044,
and Pegasos2.

Yay IBM.
2008-02-13 20:11:38 +00:00
tsutsui 0a19cf05af Use options<space><tab>.
XXX FIREPOWER options are obsolete?
2008-02-13 14:10:05 +00:00
garbled ddf7aaf7e5 Add a very quick and simple hack to allow ofwboot to be compiled into a
program that dumps the entire ofw device tree automatically.  I needed
this functionality to collect ofw dumps from users, and it doesn't hurt
to just commit it, as it's all protected inside a #ifdef OFWDUMP.
2008-02-12 04:27:46 +00:00
garbled 55804a6f72 Use model_init to clean up how we decide the ranges for
PCI_NETBSD_CONFIGURE.  Add some code to hopefully better handle the
firepower and powerstackII, based on the OFW dumps from those machines.
Untested on those machines, but doesn't break anything on pegasos/7044.
2008-02-11 17:32:18 +00:00
garbled 23c459473f Add some simple code to print out what the OFW thinks the cache
configuration of the machine is.  Amusingly, the OFW on the pegasos is
dead wrong.

Bump CPU_MAXNUM to 8, because, thats probably a reasonable number for now.
2008-02-07 19:48:37 +00:00
garbled a72063accc Nevermind, just yank the bridge64 kernels entirely. I don't want to end
up like i386 here.
2008-02-05 19:02:52 +00:00
garbled 094e746de5 Make bridge mode standard in GENERIC, yank INSTALL_B64 2008-02-05 19:01:23 +00:00
garbled 4b513a9954 Rewrite a big chunk of the pmap and locore code for powerpc to better
deal with the 64bit bridge mode.  pmap changes by Matt Thomas, rest by myself.

Change pmap.c to work similar to exec_elf.c to allow us to compile in
multiple pmaps to a single kernel.  This allows the pmap for bridge64 to
co-exist with the 32bit pmap.

Yank __HAVE_PMAP_PHYSSEG from all the oea code.

Add a new global, "oeacpufeat", which is used early in locore to determine
certain cpu features.  This allows us to conditionalize code early in the boot
for certain CPUs that have special needs.

Yank most of the ifdef PPC_OEA_BRIDGE64 code from almost every file it was
found in.  Some of it seemed incorrect, and my 7044 booted just fine
without it.  It would appear that the bridge cpus treat BAT instructions
as nops, so they seem to be safe.

In ofppc, check the oeacpufeat, and if we are on a 64bit proc, clear
MSR[SF], and ASR[V].

With all of these changes, a kernel with both PPC_OEA and PPC_OEA_BRIDGE64
will boot on the POWERIII-2 cpu.  However, it will not yet boot on a 32bit
cpu, because of CACHELINESIZE.  Work remains to be done there to fix that.
2008-02-05 18:10:46 +00:00
garbled 7636840ee2 Apparently BRIDGE mode allows BAT registers, so re-enable that code.
Change the pegasos PCI_NETBSD_CONFIGURE arguments around to wire up mem
space into the correct area, and move the io regs a little to make it
work properly. Just avoid the secondary PCI entirely.
Change the list of things that we fiddle with in pci_conf_hook.  Map mem
on the fwohci, avoid display cards, avoid IO on the auvia.
Change some printf's to aprint_*
Yank a call to genppc_pci_indirect_make_tag and change it to the
bus-independant pci call instead. (in pci_conf_hook)
2008-01-28 18:24:21 +00:00
garbled 2849d0b8df Add padding to align the rodata section. This fixes a strange bug
where the bootloader would freak out if various printfs were enabled or
disabled.

Add code to autodetect a 64bit cpu, and attempt to load a different set
of kernels if they exist.

Bump version to 1.9
2008-01-24 19:52:53 +00:00
garbled 0beb82c81b Add another optional argument to mkbootinfo.sh, the location of the bitmap. 2008-01-24 01:12:57 +00:00
garbled 7c8654b9e9 Add an install kernel for 64bit bridge mode cpus. This will hopefully go
away in the next few months.
2008-01-23 23:11:22 +00:00
garbled ad9b9c40d6 Add a new mkbootinfo.sh script that builds a bootinfo.txt file. Remove a
printf in ofwboot.
2008-01-23 23:09:42 +00:00
joerg 3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
garbled 80a83a2b7e Add support to ofppc for the IBM 7044-270 machine. This is a POWER3-II
based machine.  Currently the kernel to run on this machine is
incompatible with the standard GENERIC kernel, so for now, we have a
separate GENERIC_B64. Eventually, I hope to combine the two.

Please note, this is a port of 32bit ofppc, not a powerpc64 port.

Thanks to Matt Thomas and Kevin Bowling for helping to make this port
possible.

Summary of changes:

Change ofwpci to use the ofmethod config for configuring the PCI bus,
rather than indirect configuration.
Move the wiring of the interrupt controllers from at the start of the
boot, into the configuration of the first PCI bus.
Rewrite the map_isa_ioregs() hack to work on a machine without BATs
Fix a ton of bugs in the genofw_find_pics routine, and in the map_space code.
Split the pic_openpic into openpic_common and pic_openpic.
Create a new pic_distopenpic driver, for the distributed openpic found on
some newer IBM machines.
Fix a bad panic in pmap_extract on 64bit bridge mode
2008-01-17 23:42:57 +00:00
mrg 626bd12a5c enable PCI_NETBSD_CONFIGURE for ofppc.
the call to pci_configure_bus(9) and it's supporting code is
copied verbatim from the prep port.

this allows us to completely remove the really gross pegasos
specific pegasospci_indirect_attach_hook() that set various
pci command regs, since all those devices (mostly work now,
see below) and additionally PCI plugin cards work now too.

it also makes the pegasos onboard vr(4) ethernet work with
disk boot (it previously only worked with netboot.)

in the generic macppc ofw pci conf hook and for pegasos,
don't configure the viaide(4) device, and don't configure
memory space on the fwohci(4) device.


with this, and my other recent ofppc/ppc changes the pegasos
port is mostly functional.  the marvell gige is not working,
and my 512mb appears as only about 256mb, but otherwise
this port is almost done!
2008-01-11 05:18:58 +00:00
garbled 0d31ffa76d Remove alloc.h too, no longer needed. 2008-01-09 19:39:07 +00:00
garbled dc535894e1 Changes to the ofppc ofwboot to make it boot on an IBM CHRP RS/6000.
Tested on a pegasos II and a 7044-270.  Also, switch away from the hacked
up alloc.c we were using, and use the stock libsa one.
2008-01-09 19:34:44 +00:00
mrg 58b3d9db6c extend the grossness that is pegasospci_indirect_attach_hook() a little
further and enable the vr(4) located at pci 0 dev 13 fn 0.

now my vr(4) works from disk boot.
2008-01-09 07:35:29 +00:00
mrg 9c1261344f support FS_RAID partitions, and increase the offset by
RF_PROTECTED_SECTORS (64) if so.
2008-01-03 06:40:02 +00:00
mrg a386f0e8b3 build an INSTALL kernel. it's just GENERIC with md(4) root space. 2008-01-02 11:32:15 +00:00
mrg 3259c65b6e add COMPAT_40, raid and RAID_AUTOCONFIG options. 2008-01-02 02:32:25 +00:00
ad 2ecdf58c2c Remove systrace. Ok core@. 2007-12-31 15:31:24 +00:00
garbled 0abe9cf449 Add one more convenience function to rtas, rtas_has_func, and add a
global int machine_has_rtas that can be used to decide if a machine has
rtas functionality or not.  Take a crack at power off support for the
pegasos, which doesn't work right, probably due to a firmware bug.
2007-12-28 05:12:41 +00:00
garbled f217f96524 Take advantage of the new rtas_call function and get rid of the uneeded
rtas_reboot() function.  Still reboots even.
2007-12-28 04:47:37 +00:00
garbled 47b06f10ce change some printf's to aprint_normal. 2007-12-27 17:49:36 +00:00
garbled 28d432f9cc Add an infinate loop after the reboot call so we don't somehow drop past
it if it fails.
2007-12-27 17:25:02 +00:00
garbled cbd61cd9a6 Enable l2 cache on the pegasos 2007-12-27 05:41:51 +00:00
perry 970ad9314d Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.
2007-12-24 15:46:45 +00:00
phx 66e67a4f6b Make USB, IEEE1394 and viaaudio attach to the Pegasos2.
USB works fine. IEEE1394 is untested. Audio doesn't work (playing white noise).
Need to set IO/MEM-enable for IEEE1394 and audio, as the firmware (Smart
Firmware 1.2) doesn't do it.
Patch approved by Tim Rightnour.
2007-12-24 13:54:58 +00:00
phx d2a9b2ff83 VT8231 IDE workaround for native mode with "compatibility" interrupts 14/15.
This time done right by calling pciide_machdep_compat_intr_establish() to
get a MD interrupt handler.
Verified that it compiles for XEN again.
2007-12-20 22:24:40 +00:00
phx 5dda38d449 wsmux was missing.
Switched to a smaller default font.
2007-12-15 16:09:08 +00:00
garbled 76a99a952a Fix the endless stream of 7's problem on i8259-like interrupt controllers
once and for all.  The i8259 does not like to be read in a loop, when an
interrupt comes in, it will return a valid value, however, if you keep
reading it until there are no outstanding interrupts, it will return 7
(which is the lpt interrupt).  Change the pic handler to give an argument
to the get_irq functions of mode, which indicates if this is the first
time we are asking, or if we are just rechecking in a loop.  Non-i8259
handlers can safely ignore this argument.

Tested to fix the stream of 7's problem on prep and ofppc.  Got rid of
the nasty hack in ofppc with this too, and the prep machine seems to take
less interrupts now, which is a good thing.
2007-12-11 18:04:18 +00:00
garbled 05fd0d9547 Switch ofppc to the unified powerpc majors file. This should make single
user mode work.
2007-12-10 18:19:45 +00:00