Commit Graph

711 Commits

Author SHA1 Message Date
simonb 2f766ff3c2 Use the base space tag from the attach args, don't recreate it all the
time.
Clean up some include files.
2002-08-13 06:15:15 +00:00
simonb f0302072f1 Use "ibm4xx" instead of "galaxy"; galaxy was an early code name for the
405GP.
2002-08-13 05:43:24 +00:00
simonb 42dede3769 Move 4xx devices to their own config include file so they can be used
elsewhere.
2002-08-13 05:29:25 +00:00
simonb 9e00d2d7f9 Fix include file location botch in previous. 2002-08-13 05:25:39 +00:00
simonb 497d6762cf Split out device register definitions to their own files as the are
common across many of the 4xx parts.  Leaves ibm405gp.h with device
address information specific to the 405GP CPU.  Now allows opb.c to
support multiple 4xx CPU types.
2002-08-13 04:57:48 +00:00
matt c75c0aa911 Print DAR and DSISR on user ALIgnment traps (e.g. treat them as being
similar to DSI tracks).
2002-08-12 22:44:03 +00:00
simonb b16f7fe1fc Add a pvr field to 'struct opb_dev', to allow the opb_devs array to
contain info about on-chip devices for more than one CPU type.
2002-08-12 07:55:08 +00:00
simonb 6bf1aaf8eb Reorganise the IBM 4xx bus layout, using terminology from the IBM
documentation:
 - Remove "mainbus" altogether.
 - The new root is "plb" - the Processor Local Bus.
 - Attached to this is the "opb" - the On-chip Peripheral Bus, to which
   all the on-chip devices are attached (except the cpu and pci host
   bridge).
 - Port-specific code can pass an array of 'struct plb_dev' to
   config_rootfound() to attach extra devices to the plb.  The walnut
   port attaches a "pbus" (Peripheral Bus) in here for the RTC and
   pc keyboard controller to attach to.
There is still much 405GP specific code; the next round of changes will
generalise this to enable easier support for other 4xx CPUs.
2002-08-12 02:06:18 +00:00
simonb 95319edf4a Add some IBM 4xx CPU PVR values; sort PVRs numerically.
White space nits.
2002-08-11 13:33:00 +00:00
simonb ef1df3654e Define the 4xx PVR values in one place only. 2002-08-11 13:32:20 +00:00
matt dcab4f46e8 Switch back to kenter_pa/kremove 2002-08-11 02:17:30 +00:00
matt 549ac19770 Add IBM Power3 CPUID. 2002-08-10 21:38:06 +00:00
matt 67f40b1907 More refinement, only map B_READ buf with VM_PROT_WRITE (all pages always
have VM_PROT_READ).  Also, pass PMAP_WIRED to pmap_enter (for non-mpc6xx
pmaps).  This will give pmap clues about flushing any "icache ok state".
2002-08-10 18:49:56 +00:00
matt 246ee3ef1d Switch vmap*buf back to using pmap_enter/pmap_remove. This is so that
accesses to the buffer will cause the reference and modified bits for
the pages to be udpated appropriately.
2002-08-10 16:28:49 +00:00
simonb 5b415a20e5 Fix for when EMAC_EVENT_COUNTERS isn't defined. Problem reported by
Allen Briggs.
2002-08-09 14:10:30 +00:00
simonb acce3a5e36 Add a driver the for IBM 405gp (and possibly other IBM 4xx cpus) ethernet
MAC (emac).  Much thanks to Jason Thorpe for debugging help writing this
driver.  Tested on the walnut, and an earlier version of this driver works
on the OpenBlockSS.
2002-08-09 04:17:26 +00:00
matt 0fb9cba190 Add SPR_ASR from OEA-64. Change mfspr to use register_t. 2002-08-08 22:49:09 +00:00
chs 0a97a311e2 it's PPC_HAVE_FPU, not PPC_HAS_FPU.
also, include the headers that turn on FPU and AltiVec features
in case no one else does.
2002-08-08 01:27:35 +00:00
matt e66a17771e Disable PTE_EXEC optimization until I figure out why it fails on 750 but
not 74xx.
2002-08-07 19:04:05 +00:00
tsubai e373d8b520 Re-correct previous. It's intentional. 2002-08-07 08:01:57 +00:00
briggs 0b956d0b8b Implement pmc(9) -- An interface to hardware performance monitoring
counters.  These counters do not exist on all CPUs, but where they
do exist, can be used for counting events such as dcache misses that
would otherwise be difficult or impossible to instrument by code
inspection or hardware simulation.

pmc(9) is meant to be a general interface.  Initially, the Intel XScale
counters are the only ones supported.
2002-08-07 05:14:47 +00:00
matt a2e9fe106d Correct __va_list typedef for GCC 3.* to match the GCC 3.* definition. 2002-08-07 00:11:59 +00:00
chs f7fb853264 be sure to re-enable interrupts before calling trap() a second time
due to an AST.  the rule is that we must always have interrupts
enabled when acquiring kernel_lock, so that we can process blocking IPIs
from another CPU which is already holding kernel_lock.
reduce differences between the MP and non-MP versions of this file.
2002-08-06 06:21:58 +00:00
chs f73abf90fb on MP systems, if the firmware didn't configure the L2 cache
on the non-boot CPUs, copy the L2CR configuration from the boot CPU.
also, fix the code that configures the L2 cache so that it works at all.
while I'm here, use mfspr() and mtspr() instead of inline asms.
2002-08-06 06:20:08 +00:00
chs 2928d8ba05 actually we shouldn't hold kernel_lock while calling postsig(). 2002-08-06 06:18:24 +00:00
chs 0924752f24 add the MSSCR0 register and some more L2CR fields. 2002-08-06 06:17:50 +00:00
chs 461184c6b6 fix the calculation of the address of the IPI dispatch register. 2002-08-06 06:16:42 +00:00
chs 301f1ebf31 move more inlines to cpu.h: mftb(), mftbl() and mfpvr().
(the mftb() in pmap.c only wanted the lower 32 bits, so that's now mftbl()).
2002-08-06 06:14:33 +00:00
enami a55bfb4d51 A cosmetic change. 2002-08-05 02:56:58 +00:00
enami 1aaddc3669 - Care about carry bit when adding short value to force 4 byte boundary.
It may contain any 32 bit value there.
- Use correct instruction to clear carry bit.
- Don't use series of load with update instruction.  It's slower.
2002-08-05 02:55:39 +00:00
simonb 7cfa7d3ce0 Sprinkle a small amount of KNF. 2002-08-03 13:12:44 +00:00
chs 810cde53cc use a completely separate trap handler for syscall traps.
this reduces syscall overhead by 10% to 20% depending on cpu type.
2002-08-02 03:46:42 +00:00
simonb d16ca1844f Add driver for 405gp (and other 4xx?) watchdog timer. 2002-08-01 23:15:37 +00:00
matt 3e158de7c1 Don't define register references if not KERNEL or STANDALONE. 2002-07-30 06:09:10 +00:00
itojun f8e5e9c295 be friendly with gcc-3.1.1 -O2, which takes advantage of ANSI C
pointer aliasing rule (gcc optimization/7427).  from tsubai, sync w/kame
2002-07-29 09:14:36 +00:00
chs 03315186b6 install atomic.h. 2002-07-28 07:11:25 +00:00
chs a7171ee431 add some atomic operations. 2002-07-28 07:09:28 +00:00
chs fccc379b30 restructure the FPU and AltiVEC code so that it works for MP. 2002-07-28 07:07:44 +00:00
chs 64094057a1 resync the MP and non-MP trap_subr's. 2002-07-28 07:06:27 +00:00
chs a7763f6e2c create a syscall_plain() like on other platforms
and avoid getting the kernel lock for MPSAFE syscalls.
2002-07-28 07:05:53 +00:00
chs 0e5816fca3 remove a local copy of mfmsr(). 2002-07-28 07:05:19 +00:00
chs 7f81a49168 propagate the MP idle-loop fix to ppc from the other ports:
Move call to sched_unlock_idle to later in the context switch to
  eliminate a race where another processor could grab the outgoing
  process before we were done saving our state into it, with predictable
  results.

  Bug spotted by Frank van der Linden <fvdl@wasabisystems.com>

also, don't re-enable interrupts temporarily in the middle of
switching to a new process, just wait until we're completely switched.
this didn't work on MP and it's not worth the effort.
2002-07-28 07:05:06 +00:00
chs badae2dc11 disable the PTE_EXEC optimization for MP for now.
PTE_EXEC needs to become a per-CPU flag eventually.
2002-07-28 07:03:47 +00:00
chs 9b01e8d8ce split off the part of cpu_attach_common() that pokes at special CPU registers
into a separate function so that we can run it on each CPU we configure
rather than always on the boot CPU.
2002-07-28 07:03:15 +00:00
chs 84b41b2adb rearrange the PCB structure a bit so it's easier to look at in ddb. 2002-07-28 07:02:54 +00:00
chs 4b5a2a3f79 define CPU_INFO iterators so that the CPU-states sysctl works for MP. 2002-07-28 07:02:29 +00:00
matt f9be6bb495 Cleanup AltiVec data stream issues with context switching. Don't stop
data streams on execptions/interrupts since the processor will suspend
them for us.  Only stop them on 1) process exit, 2) another process gets
its address space loaded, and 3) (for completeness only) we save a process's
AltiVec context.
2002-07-25 23:46:47 +00:00
matt a660a9325f Set normal memory PTEs with PTE_M (memory coherent). Change how we
remember the "exec"ness of a page.  If a managed page is pmap_enter'ed
with VM_PROT_EXECUTE, remember that it's an "exec"page.  Such that when
additional mapping are performed, no synch'ing of the I-cache is needed.
Revoke "exec"ness when the page is mapped into the kernel with VM_PROT_WRITE
or the pmap_page_protect is called with VM_PROT_NONE.
2002-07-25 23:33:04 +00:00
chs 4e9f286b98 for MP builds, save and restore sprg0 (which contains the curcpu pointer)
around restoring OFW's sprg registers while calling into OFW.
2002-07-24 06:04:43 +00:00
chs 185a5bbcf0 rename the intr_depth field of struct intrframe to avoid a name conflict
in MULTIPROCESSOR builds.
2002-07-24 05:44:37 +00:00