Commit Graph

186 Commits

Author SHA1 Message Date
scw
26ebb442bf - Hook the PCI arbiter and error interrupts, and print something
useful should one occur.
- Manually poke some config values into the sh5pci host bridge's
  config registers since it doesn't appear in config. space.
- Reserve the first 256 bytes of i/o space to avoid assigning i/o
  address 0 to any cards.
- Slight tweak to the initialisation code after consultation with
  SuperH and the linux driver.
2002-10-04 10:22:24 +00:00
scw
a520b3b2c8 Convert to new devsw world order. 2002-10-04 10:16:56 +00:00
scw
f7f3db86ff When loading a DMA map, make sure the BUS_DMA_COHERENT flag in the
map accurately tracks the same flag in the segments belonging to it.
The map's copy can be set only if all the segments are coherent.

This finally gets NFS writes fully working on my PCI ex(4) card.
2002-10-04 09:20:20 +00:00
scw
99fec1b346 Minor pmap rototil:
- Track unmanaged mappings of RAM more closely by allocating a pvo
   for them. This allows us to check more accurately for multiple
   cache-mode-incompatible mappings.

 - As part of the above, implement pmap_steal_memory(). This has the
   beneficial side-effect of moving a fair chunk of kernel data
   structures into KSEG0.
2002-10-04 09:17:57 +00:00
scw
c859106ab8 Gee, this file is showing its origins... cpu_swapout() may invoke
panic() on MIPS, but really shouldn't do the same on SH5.
2002-10-02 16:19:59 +00:00
thorpej
89bf5a8f8e Add trailing ; to CFATTACH_DECL. 2002-10-02 15:52:22 +00:00
scw
b13817324e Fix the initial cacheline alignment case. This gets my PCI ex(4) card
pretty much working, at least for non-NFS use.

With NFS, it fails under pressure probably due to operand cache aliases
between KSEG0 and regular 4KB mappings elsewhere. Sigh.
2002-10-02 14:40:27 +00:00
scw
9e1133a710 In pmap_page_is_cacheable(), add an explicit check for KSEG0 addresses.
They don't show up in the page tables, so the default "not cacheable"
status is wrong.

This finally gets my ex(4) working on the Cayman's PCIbus.
2002-10-02 12:19:38 +00:00
scw
4c12ca2bdc Don't clear the original contents of r0 in sigreturn(). We're returning
to the interrupted context, not the sigreturn syscall stub.
2002-10-02 08:13:09 +00:00
scw
240029a2aa NetBSD/sh5 post-dates the old "signal trampoline" delivery mechanism,
so don't bother even pretending it exists.
2002-10-02 08:10:34 +00:00
scw
c4efa0ddba Change IPL_SOFTNET to 3. 2002-10-01 21:07:31 +00:00
scw
0e3aa70138 Count all soft interrupt events per level, rather than just
the first one per call to softintr_dispatch().
2002-10-01 21:04:59 +00:00
scw
92c80efadc Fix a soft interrupt botch which prevented softints being dispatched
on exit from regular h/w interrupts.
2002-10-01 20:41:52 +00:00
thorpej
3b6eef8108 Use CFATTACH_DECL(). 2002-10-01 19:24:47 +00:00
scw
2ce95435ad One of the last pieces of the SH5 pmap jigsaw; detect and deal with
operand cache synonyms and paradoxes for shared mappings:

 - Writable mappings are cache-inhibited if the underlying physical
   page is mapped at two or more *different* VAs.

   This means that read-only mappings at different VAs are still
   cacheable. While this could lead to operand cache synonyms, it
   won't cause data loss. At worst, we'd have the same read-only
   data in several cache-lines.

 - If a new cache-inhibited mapping is added for a page which has
   existing cacheable mappings, all the existing mappings must be
   made cache-inhibited.

 - Conversely, if a new cacheable mapping is added for a page which
   has existing cache-inhibited mappings, the new mapping must also
   be made cache-ibhibited.

 - When a mapping is removed, see if we can upgrade any of the
   underlying physical page's remaining mappings to cacheable.

TODO: Deal with operand cache aliases (if necessary).
2002-10-01 15:01:48 +00:00
scw
1e4acb4d20 Another temporary fix until I write a bootloader: run the kernel
through dbsym(8).
2002-10-01 07:56:45 +00:00
scw
5a512e6285 Flesh out bus_dmamap_sync(). 2002-10-01 07:55:17 +00:00
scw
02301c13c5 Add a #define for the SH5's cacheline size. 2002-10-01 07:50:36 +00:00
scw
a5ea619bef In pmap_extract() deal with KVAs in KSEG0 (which can be passed by the
bus_dma(9) code) instead of panicing.
2002-10-01 07:49:46 +00:00
scw
7a61cafd1e After the kernel is built, run it through objcopy to change the LMA
of the loadable sections to correspond to the physical address of
RAM in the Cayman. This is so sh5gdb uploads the image to the correct
place. (Should've done this ages ago instead of manually running a
script...)

This can be removed when I get a native bootloader written.
2002-09-28 18:35:38 +00:00
thorpej
8f6cdec6af Make _C_LABEL() pay attention to __NO_LEADING_UNDERSCORES__. 2002-09-28 15:50:37 +00:00
scw
d26f394149 Add audio(4). 2002-09-28 13:13:23 +00:00
scw
a7be636d26 Rename the SH5 PCI attachment to "sh5pci" instead of abusing the "pcibus"
config definition. The new config world order is more picky about such things.
2002-09-28 13:08:22 +00:00
scw
3e955d2331 PCI is pretty much done. 2002-09-28 13:06:49 +00:00
scw
94b4198ec9 Bump the scif console priority to CN_REMOTE for now. 2002-09-28 13:03:22 +00:00
scw
1c9cfe70b6 Const'ify the cfattach structure. 2002-09-28 11:18:01 +00:00
scw
251ba05b3f Support for the SH5 on-chip PCI bridge, and support for its deployment
in the Cayman board.
2002-09-28 11:16:36 +00:00
scw
171b08b4b9 Set the new process' FPSCR.DN bit so that denormalised FP numbers are
quietly flushed to zero before they're used.

While this isn't perfect, it seems to mimic the behaviour on i386 at least.
2002-09-28 11:11:01 +00:00
scw
3d776f64cf These hackish changes have been sitting around for a while. Commit
them so they don't get lost. This driver will be overhauled later
on anyway to make it shareable between sh[3-5].
2002-09-28 11:08:13 +00:00
scw
02787a17bc Wrap some expensive sanity checks in "ifdef PORTMASTER". 2002-09-28 11:04:26 +00:00
scw
4d809d551d The FP status register is 32-bits wide, so don't use register_t in
the various state frames.
2002-09-28 11:03:08 +00:00
scw
58931592a1 Honour BUS_DMA_COHERENT flag in bus_dmamem_map(), and g/c some dead code.
XXX: Still need to flesh out bus_dmamap_sync().
2002-09-28 10:57:44 +00:00
scw
05e55efada - Add pmap_page_is_cacheable() to allow the bus_dma code to query the
cacheable attribute of a mapping.
- Honour PMAP_NC in pmap_enter() using NOCACHE, instead of DEVICE.
- No longer need to re-fetch the ptel in pmap_pa_unmap_kva() as
  syncing the cache no longer risks causing a TLB miss.
2002-09-28 10:53:57 +00:00
scw
902d684338 - Add BUS_SPACE_MAP_PREFETCHABLE
- Re-define bus_size_t and bus_addr_t to be u_int32_t.
  While this may well lose for future silicon with NEFFBITS > 32, the
  original u_long was a waste on current designs (especially for _LP64).
2002-09-28 10:49:10 +00:00
scw
e168d3e25c SH5's on-chip PCI bridge is attached as "pcibus", not "pchb". 2002-09-28 10:44:40 +00:00
scw
9c10dff0fb Print the intevt code in hex. 2002-09-28 10:43:36 +00:00
scw
e578ac6fc3 Slight tweak to the linker emulation name now that I'm using ld(1)
from binutils-current.

Bump compiler optimisation to -O1.
2002-09-28 10:42:54 +00:00
thorpej
543bc9a286 The native compiler defines __NO_LEADING_UNDERSCORES__, so key off
that to determine if __LEADING_UNDERSCORE is necessary.
2002-09-28 02:27:03 +00:00
thorpej
f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
thorpej
6c88de3b53 Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.
2002-09-27 03:17:40 +00:00
scw
9393fbe941 Belated commit of code to calculate the delay constant used by delay(). 2002-09-22 20:57:23 +00:00
scw
f9c02a8bd0 An initial NetBSD/sh5 TODO list. 2002-09-22 20:54:33 +00:00
scw
84b2ccee63 Add sh5_nmi_clear(), a board-specific hook for clearing the NMI one-shot. 2002-09-22 20:48:09 +00:00
scw
aab9041eea In validate_kipt(), cacheable TLB entries are now legal. 2002-09-22 20:46:32 +00:00
scw
badd3d5d65 Performance tweak to the copy_page/zero_page asm code.
Allocate/Prefetch one cache-line ahead of the one we're about to deal with.

This reduces the chances of the cpu stalling while waiting for the cache
to flush a dirty line in order to satisfy the Allocate/Prefetch request.
2002-09-22 20:45:31 +00:00
scw
5a529aa332 - Add a /e option to db_stack_trace_print() which dumps the saved
registers in any trap/interrupt exception frame found.

- Slight tweak to more accurately detect the correct call-site when
  looking for a function's prologue.
2002-09-22 20:31:18 +00:00
simonb
63096043b3 Use "#define\t" instead of "#define ". 2002-09-22 08:30:56 +00:00
chs
c081614ea2 it really helps to get the stub right before cutting + pasting it 27 times.
alas, I did not.  doh.
2002-09-22 07:53:39 +00:00
chs
55e1f79335 add pmap_remove_all() hook (empty on most platforms so far). 2002-09-22 07:17:08 +00:00
gmcgarry
dca80f08fd Add __HAVE_MD_RUNQUEUE flag for MD code to override MI run queue primitives. 2002-09-22 04:11:32 +00:00