Commit Graph

1176 Commits

Author SHA1 Message Date
scw 84f125b78d Modify db_{read,write}_bytes() to do a single 16- or 32-bit read/write if
'size' is 2 or 4 respectively.
This makes reading/writing hardware registers work as expected in all cases.
2003-06-06 10:07:07 +00:00
scw 72ab47548b Add entries for byte-wide {read,write,set} region. 2003-06-06 09:05:42 +00:00
scw 233a67b251 - Rearrange the PXA2x0 support code to better support attaching
child drivers such as interrupt and gpio controllers.
 - Add a function to probe SDRAM size at boot time.
 - Add a function to configure the Clock Manager's CKEN settings.
 - Add an INTC driver.
 - Add a GPIO driver.
 - Add attach glue for the PXA2x0's "almost" 16550-compatible uarts.
 - Tweak the LCD driver to use the GPIO driver's services for setting
   up GPIO pin function.
2003-06-05 13:48:26 +00:00
simonb b71607572c Remove prototype for strtoul() that was in the wrong place. 2003-06-04 13:30:05 +00:00
ichiro 079fe66132 delete unneed bit for uart initialize.
and bug fix mistaken function
2003-06-03 14:13:30 +00:00
ichiro bedffd532c fix interrupt number
swap uart0 and uart1
2003-06-03 09:20:20 +00:00
ichiro 745355a88e add pci configuration register and commands 2003-06-02 10:40:52 +00:00
ichiro b65e980ad1 change into the form KNF 2003-06-01 21:35:39 +00:00
ichiro 4d110df451 add console unit number to configuration parameter.
move structure of uart information
2003-06-01 01:49:56 +00:00
ichiro a52b2549e2 print description of Console and enable ixpcom0/1 in configuration 2003-05-31 23:57:45 +00:00
ichiro c5980a60b3 cosmetic change & some bugfix 2003-05-31 11:27:01 +00:00
ichiro 972193a992 some bug fix 2003-05-31 06:24:18 +00:00
kristerw 28f5335a9f Fix LINTSTUB comments. 2003-05-31 01:40:05 +00:00
ichiro 0c9cb92a41 bug fix 2003-05-31 00:58:40 +00:00
thorpej 6955d47610 Make big-endian mode a little closer to working on the BRH. I can talk
to both the EEPROM *and* the PHY on the Ethernet interface now, at least,
though it is still not completely working.

Many thanks to Stephen Goadhouse at ADI for some hints.
2003-05-30 18:38:02 +00:00
ichiro fda7b1bfdf About CP14 register, ixp425 does not need xscalereg.h 2003-05-25 01:30:52 +00:00
ichiro 46192ffb9b add registers
Performance Monitoring Unit - Coprocessor14
2003-05-24 23:48:44 +00:00
thorpej 80c79650a2 Now that the pmap doesn't fall over when we use pld, enable it if
__XSCALE__ is defined.  This nearly doubles the lmbench bw-pipe
performance on an ADI BRH board.
2003-05-24 05:31:04 +00:00
ichiro 97106736c6 add IXDP425 PCI interrupt
fix some typo
2003-05-24 01:59:32 +00:00
ichiro 2ad510ea55 delete definition (DEBUG) 2003-05-23 10:14:03 +00:00
ichiro 07fcae9efc hide debug messages(mapping) 2003-05-23 09:41:02 +00:00
briggs faaab85482 Sprinkle a few aprint_normal()s in place of printf(). 2003-05-23 05:21:26 +00:00
ichiro 00eb02e3da support IXP425 Intel Network Processor
running on BigEndian
2003-05-23 00:57:23 +00:00
thorpej fac0ce9387 Remove old pmap support. 2003-05-22 19:18:31 +00:00
thorpej 1963a8521c Use virtual_avail and virtual_end to compute the size of the available
kernel VM space for VM_MAX_KERNEL_BUF, and move the definition into
generic ARM code.
2003-05-22 05:25:48 +00:00
thorpej 55073c92c1 Move the new pmap from arm32/pmap_new.c to arm32/pmap.c, fully replacing
the old.
2003-05-21 18:07:07 +00:00
thorpej c8bed530ac Remove #ifdefs supporting the old pmap, switching fully to the new. 2003-05-21 18:04:42 +00:00
briggs acec11e5ac Use the GDB5 breakpoint value for the kernel breakpoint assembly statement
since this value will be properly recognized by gdb_trapper().
Pointed out by bsh.  Thanks!
2003-05-21 13:39:01 +00:00
bsh 7ba6ee4ca8 fix warning when KGDB is defined and DDB is not defined. 2003-05-21 06:40:29 +00:00
thorpej df7c83c4a0 Rewrite pagemove() to use pmap functions, rather than frobbing PTEs
directly.  The old code was totally bogus for the new pmap.  New code
lifted from SH5 port.

Fixes panics in ffs_balloc_ufs2() seen while stress-testing a file
system on an XScale-based server platform.
2003-05-17 00:41:36 +00:00
ichiro 9bccf5da79 add CPU types
IXP425 xscale-core NetworkProcessor

later, Ill commit codes for IXP425-evaluation board
2003-05-13 11:45:52 +00:00
bsh a6f754db03 + use system's real PCLK frequency for calculation, instead of a compile
time constant.

+ make delay() more accurate.
2003-05-13 08:07:39 +00:00
bsh b4e06de16e use system's real PCLK frequency instead of a compile time constant for
baudrate divisor setup.
2003-05-13 06:29:53 +00:00
bsh 2b33d23a8c + fix a bug to think FIFO full as FIFO empty.
+ on rx buffer overflow case, disable error interrupt as wel as rx
  interrupt.

+ FIFO is always enabled.
2003-05-13 06:26:57 +00:00
bsh 51712a0aa1 white space nit. 2003-05-13 06:12:45 +00:00
bsh 3675ae2669 + use SWRCON register for software reset.
+ add s3c2800_clock_freq(): calculate [FHP]CLK from values in PLL
  control registers and S3C2XX0_XTAL_CLK.
2003-05-13 05:15:08 +00:00
bsh ca05494daf add an option to set external X'tal frequency. 2003-05-13 05:10:55 +00:00
bsh ab094d4717 add fields to hold FCLK, HCLK, and PCLK frequency. 2003-05-13 05:06:39 +00:00
kleink 776138ea69 Rename <sys/float_ieee.h> to <sys/float_ieee754.h>, following libc's
convention for these.
2003-05-12 15:22:53 +00:00
bsh ac7984d2fd add an arg to s3c2800_intr_establish() for interrupt type. 2003-05-12 07:49:10 +00:00
bsh a99b5e08a5 + add an arg to s3c2800_intr_establish() for interrupt type:
IST_EDGE_{FALLING,RISING,BOTH}, or IST_LEVEL_{LOW,HIGH}. This
  argument is valid only for GPIO interrupts (IRQ0..7).

+ Don't clear interrupt pending bits for IIC in interrupt handler.
  Since clearing these bits starts next IIC transmission immediately,
  IIC driver should handle these.
2003-05-12 07:48:37 +00:00
bsh fda719999a add PLLCON register definitions. 2003-05-12 05:22:31 +00:00
thorpej e43fecb228 Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself.  This paves the way for some future changes.
2003-05-10 23:12:28 +00:00
thorpej 36da248c07 Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.
2003-05-10 21:10:23 +00:00
thorpej 2a90e2a9c9 Remove redundant bounds_check_with_label() prototype. 2003-05-10 16:12:02 +00:00
fvdl d88cf589cb A few ISA sound drivers like to share dma channels, and hence deferred
isa_dmamap_create() calls to their open/close entrypoints. This worked
with some luck, but broke on i386 when _bus_dmamap_create started
to allocate bounce buffers upfront, since memory below 16M may well
not be available when the sound devices is opened for the Nth time.

To fix this, create a new simple interface, isa_drq_alloc/isa_drq_free,
wrappers around already existing bitmask macros. These are expected
to be used before an isa_dmamap_create call, and after an
isa_dmamap_destroy call, respectively. For the sb and ad1848 drivers,
they're deferred until open/close.

All isa_dmamap_create calls can now use BUS_DMA_ALLOCNOW and be done
at attach time.
2003-05-09 23:51:25 +00:00
thorpej b77900c3c2 Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM.  Machine-dependent code is
responsible for initializing them before main() is called.  Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).
2003-05-08 18:13:12 +00:00
reinoud 733594dd05 Some entries were missing so i'd better add them for completion. 2003-05-06 00:29:57 +00:00
thorpej a6b1913724 Make the ARM_VECTORS_* unsigned. 2003-05-04 02:00:10 +00:00
thorpej 46ffc57a80 VM_{MIN,MAX}* are now the same for ARM32_PMAP_NEW with both new and
old VM layout, so merge the two cases.
2003-05-04 01:54:32 +00:00
thorpej bbba90a2fb Don't expose KERNEL_TEXT_BASE outside of board-specific code. This gives
individual board start-up code more flexibility about where the kernel
starts in the kernel address space.
2003-05-03 18:25:28 +00:00
wiz 1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
thorpej 78fac054fa In db_write_bytes(), use kernel_text rather than KERNEL_TEXT_BASE. 2003-05-03 17:32:59 +00:00
thorpej 69b2e108bb Remove the non-ELF case in db_machine_init(). 2003-05-03 17:29:27 +00:00
thorpej 6923eb1e4a Fix a couple of comments. 2003-05-03 16:18:57 +00:00
bsh 2de6557e88 fix typo in an error message. reported by Jonathan Cline on port-arm. 2003-05-03 05:19:00 +00:00
bsh 00095bbed3 delete duplicated #include. reported by Jonathan Cline on port-arm. 2003-05-03 05:17:54 +00:00
thorpej aae7e372b7 Reduce differences between ARM32_NEW_VM_LAYOUT and not; always pass
the start and end of the kernel managed virtual address space to
pmap_bootstrap() in the new pmap.
2003-05-03 03:49:03 +00:00
thorpej 38d274c953 ARM32_PMAP_NEEDS_PTE_SYNC no longer exists. 2003-05-03 00:47:42 +00:00
thorpej 79a7aff0fd Don't need to reserve a page of space before KERNEL_BASE in the
ARM32_NEW_VM_LAYOUT case.
2003-05-02 23:26:47 +00:00
thorpej 4eeee795e8 Eliminate PTE_BASE and the PT-PT completely in the ARM32_PMAP_NEW case.
Also in the ARM32_PMAP_NEW case, reclaim the USPACE-bytes of wasted space
at the top of the user address that hasn't been needed for a very very
long time.
2003-05-02 23:22:33 +00:00
thorpej 21b77f9aec Eliminate the last reference to PTE_BASE in the new pmap. 2003-05-02 21:54:38 +00:00
scw 36664b74fa Rework pmap_growkernel() to *not* use the regular pmap_alloc_l2_bucket()
for L2 allocation. This avoids potential recursive calls into
uvm_km_kmemalloc() via the pool allocator.

Bug spotted by Allen Briggs while trying to boot on a machine with 512MB
of memory.
2003-05-02 19:01:00 +00:00
dsl d91455ce26 Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
2003-05-02 08:45:10 +00:00
thorpej 5e36c42a5d Don't consider lack of disk label to be an error. This addresses
PR kern/21408 for all of the ARM ports.  Other ports should follow
this example.
2003-04-30 19:05:21 +00:00
scw 8c5c893bf7 Add a BKPT_ADDR() macro which gives MD code a chance to munge a
breakpoint address before it's used. Currently a no-op on all but sh5.

This is useful on sh5, for example, to mask off the instruction
type encoding in the bottom two address bits, and makes it possible
to do "db> break $rXX" instead of manually munging the address.
2003-04-29 17:06:03 +00:00
scw cbf4243cd7 KERNEL_TEXT_BASE is not defined for ARM32_NEW_VM_LAYOUT. 2003-04-29 13:27:21 +00:00
thorpej b43b1645a2 Use aprint*(). 2003-04-29 01:07:30 +00:00
bjh21 4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
scw 6b08b996ba Fix the bug reported by Richard Earnshaw in port-arm32/21349.
Make sure to check the access permissions before doing
ref/mod/domain fixups. This is particularly important
on machines with ARM_VECTORS_LOW.
2003-04-28 15:57:23 +00:00
briggs a2f6e1f09a Add arm32 machine-specific remote kgdb support. Largely
from PR port-arm/15530 by bsh@, but with some updates from
me, including a fresh arm32/kgdb_machdep.c--ported from pc532.
2003-04-28 01:54:49 +00:00
chris 70a9a33cc8 Remove a strh. I don't think it's available on archv3 and it doesn't work
on acorn32's with an SA110 in them as the bus doesn't support halfword
transfers.
2003-04-26 17:50:21 +00:00
ragge 69a66687f8 Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
2003-04-26 11:05:05 +00:00
ragge 766d04f56a Add ksyms device major. 2003-04-25 21:10:46 +00:00
thorpej d1c431c7e1 pmap_link_l2pt(): If not ARM32_NEW_VM_LAYOUT, add an assertion that
the VA that the page table maps is aligned to a 4MB boundary.
2003-04-22 13:49:48 +00:00
thorpej bbef46a7e9 Some ARM32_PMAP_NEW-related cleanup:
* Define a new "MMU type", ARM_MMU_SA1.  While the SA-1's MMU is basically
  compatible with the generic, the SA-1 cache does not have a write-through
  mode, and it is useful to know have an indication of this.
* Add a new PMAP_NEEDS_PTE_SYNC indicator, and try to evaluate it at
  compile time.  We evaluate it like so:
  - If SA-1-style MMU is the only type configured -> 1
  - If SA-1-style MMU is not configured -> 0
  - Otherwise, defer to a run-time variable.
  If PMAP_NEEDS_PTE_SYNC might evaluate to true (SA-1 only or run-time
  check), then we also define PMAP_INCLUDE_PTE_SYNC so that e.g. assembly
  code can include the necessary run-time support.  PMAP_INCLUDE_PTE_SYNC
  largely replaces the ARM32_PMAP_NEEDS_PTE_SYNC manual setting Steve
  included with the original new pmap.
* In the new pmap, make pmap_pte_init_generic() check to see if the CPU
  has a write-back cache.  If so, init the PT cache mode to C=1,B=0 to get
  write-through mode.  Otherwise, init the PT cache mode to C=1,B=1.
* Add a new pmap_pte_init_arm8().  Old pmap, same as generic.  New pmap,
  sets page table cacheability to 0 (ARM8 has a write-back cache, but
  flushing it is quite expensive).
* In the new pmap, make pmap_pte_init_arm9() reset the PT cache mode to
  C=1,B=0, since the write-back check in generic gets it wrong for ARM9,
  since we use write-through mode all the time on ARM9 right now.  (What
  this really tells me is that the test for write-through cache is less
  than perfect, but we can fix that later.)
* Add a new pmap_pte_init_sa1().  Old pmap, same as generic.  New pmap,
  does generic initialization, then resets page table cache mode to
  C=1,B=1, since C=1,B=0 does not produce write-through on the SA-1.
2003-04-22 00:24:48 +00:00
thorpej 215580f2da Defflag XSCALE_CACHE_READ_WRITE_ALLOCATE and XSCALE_NO_COALESCE_WRITES. 2003-04-21 05:36:14 +00:00
thorpej 0f16fc12a0 #ifdef, not #if, for XSCALE_NO_COALESCE_WRITES. 2003-04-21 04:33:30 +00:00
thorpej 9884510327 Add a driver for the reset button on the ADI BECC. 2003-04-20 20:50:49 +00:00
thorpej 14acc892ca Fix a typo that prevented the large inbound PCI memory window from
being programmed (guess RedBoot allowed us to get lucky).
2003-04-20 17:17:01 +00:00
thorpej 4b39c84472 Reinstate one change from rev. 1.12, but differently. Preload r2 with
0 before frobbing the control register, and use r2 in the ARMv4 TLB
flush.
2003-04-20 16:21:40 +00:00
thorpej b534f5853c Back out previous. There were several problems with the patch that
was checked in:
* It was not actually disabling the MMU, and so jumping to the
  reset vector would happily cause a panic(), since it would be
  the kernel's reset vector, not the ROM's.
* In the event the system was using high vectors, VECRELOC was not
  getting cleared, which has the potential to wreak havoc when re-entering
  the ROM.
* It was totally broken for CPUs < ARMv4; you still need to disable
  the MMU on those, just need to skip the ARMv4 TLB flush.
* The code that was checked in would only work if the kernel is mapped
  VA==PA.  For systems where the kernel is NOT mapped VA==PA, you only
  get the prefetch depth # of insns (2) after the MMU is turned off before
  you have fix the PC.

Backing out the change fixes rebooting on several evbarm platforms.
2003-04-20 15:42:51 +00:00
christos a2dfb1b570 PR/3012: Greg A. Woods: Write all float.h files [except the vax of course]
in terms of float_ieee.h
2003-04-19 23:05:28 +00:00
thorpej ec678aa9cd Use L1_S_MAPPABLE_P() and L2_L_MAPPABLE_P(). 2003-04-18 23:46:12 +00:00
thorpej 8896997409 Gah, fix *another* typo. 2003-04-18 23:45:50 +00:00
thorpej 21e8a3bc0f Oops, fix typo. 2003-04-18 22:44:54 +00:00
thorpej 08330568d0 Define two new macros to test if a mapping is mappable with an L1 Section
mapping or an L2 Large Page mapping.
2003-04-18 22:39:56 +00:00
thorpej 78b1b81e74 Add a comment indicating that the current method of enabling high vectors
requires that the CPU control vector be properly readable.  I believe that
all CPUs that have high vector support have a readable CPU control register,
but if we ever encounter one that does not, then we'll have to adjust this
code.
2003-04-18 22:30:05 +00:00
scw 3fe47173f5 Didn't mean to leave PMAP_DEBUG enabled ... 2003-04-18 11:55:26 +00:00
scw 41a1932e58 Add the generic arm32 bits of the new pmap, contributed by Wasabi Systems.
Some features of the new pmap are:

 - It allows L1 descriptor tables to be shared efficiently between
   multiple processes. A typical "maxusers 32" kernel, where NPROC is set
   to 532, requires 35 L1s. A "maxusers 2" kernel runs quite happily
   with just 4 L1s. This completely solves the problem of running out
   of contiguous physical memory for allocating new L1s at runtime on a
   busy system.

 - Much improved cache/TLB management "smarts". This change ripples
   out to encompass the low-level context switch code, which is also
   much smarter about when to flush the cache/TLB, and when not to.

 - Faster allocation of L2 page tables and associated metadata thanks,
   in part, to the pool_cache enhancements recently contributed to
   NetBSD by Wasabi Systems.

 - Faster VM space teardown due to accurate referenced tracking of L2
   page tables.

 - Better/faster cache-alias tracking.

The new pmap is enabled by adding options ARM32_PMAP_NEW to the kernel
config file, and making the necessary changes to the port-specific
initarm() function. Several ports have already been converted and will
be committed shortly.
2003-04-18 11:08:24 +00:00
scw 9c5cceb804 In arm32_vector_init(), if the vector page is ARM_VECTORS_HIGH, make
sure the CPU_CONTROL_VECRELOC bit is set in the cpu control register
before returning.
2003-04-18 10:51:35 +00:00
scw c8ba6cb1b9 - In the various cpu_setup() functions, check if the vector page
is at ARM_VECTORS_HIGH and set CPU_CONTROL_VECRELOC if so.

- Don't de-ref a NULL args pointer in parse_cpu_options().
2003-04-18 10:45:23 +00:00
bouyer aec10dd80c Nake return values from bounds_check_with_label() conform to the man
page: -1 for error, 0 for EOF, 1 otherwise. Inspired by an OpenBSD commit
message, pointed out by Miod Vallat in private mail.
vax/mba/hp.c: check return value <= 0, not < 0 to be concistent with how
other places handle return values from bounds_check_with_label().
2003-04-16 15:00:59 +00:00
rjs 971ce6c243 Remove membase and memsize device config parameters. 2003-04-14 14:20:10 +00:00
rjs 9e4c3aa218 Remove unused structure member variables. 2003-04-14 14:18:41 +00:00
rjs 8704a520e3 Remove unused sa_membase and sa_memsize structure member variables. 2003-04-14 14:16:10 +00:00
nathanw ff28c51cc0 Make cpu_getmcontext() run the PC through ras_lookup() so that kernel
getcontext() plus userlevel setcontext() (as used in libpthread) respects
the atomicity of RAS regions.
2003-04-11 22:02:28 +00:00
thorpej bcea7d5f28 Use cached physical addresses for mbufs and clusters to save having
to extract the physical address from the virtual.

On the ARM, also use the "read-only at MMU" indication to avoid a
redundant cache clean operation.

Other platforms should use these two as examples of how to use these
new pool/mbuf features to improve network performance.  Note this requires
a platform to provide a working POOL_VTOPHYS().

Part 3 in a series of simple patches contributed by Wasabi Systems
to improve network performance.
2003-04-09 18:51:35 +00:00
thorpej a0aee79a1d Add the ability for pool caches to cache the physical address of
objects.  Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86.  Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.
2003-04-09 18:22:13 +00:00
thorpej 4d402f3790 Fix a typo. 2003-04-09 02:34:31 +00:00