Commit Graph

1354 Commits

Author SHA1 Message Date
rearnsha cfcc3a8ad4 Add support for ARM10 class devices. 2003-09-06 08:55:42 +00:00
rearnsha e1f8618cbd Add arm1020E cpu id 2003-09-06 08:43:02 +00:00
mycroft e5168f409e Use generic versions of rr_1, wr_1, sr_1 -- some PCMCIA cards use these. 2003-09-03 03:15:02 +00:00
mycroft f13bd83ab3 Minor tweak for some macros elsewhere. 2003-09-03 03:12:28 +00:00
mycroft 1e2b27307d Add some register definitions. 2003-09-03 03:11:50 +00:00
mycroft b715eaff3c Recognize some TI processors -- not that you'd want to use them. 2003-09-03 02:07:07 +00:00
bsh de45322924 support EXTINT[4:23] as interrupt sources. They are cascaded to
IRQ4 (EXTINT[4:7]) and 5 (EXTINT[8:23]). ssextio driver handles these interrupts.
2003-08-29 12:57:50 +00:00
bsh 23b593ca51 + set vendor name as Samsung.
+ delete debug printf() and use aprint_normal()
2003-08-29 12:38:48 +00:00
bsh 7726d33fed + fix the definition of timer #4 observation register. This change fixed
delay() bug.

+ match the names of timer registers to those in user's manual.
2003-08-27 03:57:05 +00:00
bsh 13543d215c move some definitions of register block size from s3c24[10]0reg.h
to s3c24x0reg.h when they are same for S3C2410 and 2400, and rename them as
S3C24X0_FOO_SIZE.
2003-08-27 03:46:05 +00:00
mrg 0e001a53fa make it "static long nil;" as it's used as &nil in an array wanting long *'s.
makes GCC3 happy.
2003-08-25 04:51:10 +00:00
itojun 4440262659 create /dev/crypto 2003-08-22 05:06:22 +00:00
bsh 10c7bfc755 split StrongArm companion chip (sacc) driver so that we can support
sacc on other platforms than hpcarm (evbarm for example).

codes specific to hpcarm are extracted and moved to hpcarm/dev/.
2003-08-08 12:29:22 +00:00
bsh 02087c6497 make this compile again. (arm32_bus_dma_tag._cookie) 2003-08-07 16:58:35 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
ichiro 208a93d254 fix dont reset register when every interrupt.
pointed by Shoichi Miyake port-arm/22392
2003-08-07 13:32:27 +00:00
bsh f2de581410 forgot to add copyright. 2003-08-05 11:44:28 +00:00
bsh 3245163bdf support S3C2410's built-in USB host controller, which is OHCI
compliant.
2003-08-05 11:28:59 +00:00
bsh 0b5ec916cd add busdma tag to s3c2xx0_softc and attach arg.
initialize busdma tag in s3c2410_attach()
2003-08-05 11:26:54 +00:00
bsh 3bf70b2edf add s3c2xx0_busdma.c which is used to initialize bus dma tag. 2003-08-05 11:24:08 +00:00
bsh 3410ad1777 various bug fixes. Now SMDK2410 evboard boots up to single user mode
using install ramdisk.
2003-08-04 12:41:44 +00:00
bsh 50c0756fc2 bit polarity of interrupt mask registers don't match between s3c2800
and s3c24[10]0.  define macro s3c2xx0_update_hw_mask() for it.
2003-08-04 12:34:08 +00:00
bsh 950a49dffb initialize global_intr_mask. 2003-08-04 12:31:12 +00:00
bsh 1df8bfd121 Samsung's S3C2800 and S3C24[10]0 CPUs have same built-in UART block,
but there are very small diffs in register definitions.  For that, add
new options SSCOM_S3C{2800,2410,2400} and include appropriate
s3c*reg.h.

SSCOM_S3C2410 is also needed for interrupt controller differences.
2003-08-04 12:28:49 +00:00
bsh b335250276 + fix TCON register bit definitions. Thank you Samsung for stupid
register design.

+ add definitions for UART registers that are not compatible with
  S3C2800's.
2003-08-04 12:19:38 +00:00
bsh 23ba082952 + cleanup attach message.
+ use aprint_normal()
2003-08-04 12:09:19 +00:00
bsh d10f592c16 fix comments. 2003-08-04 10:24:15 +00:00
bsh 250a139bc5 change an arg of s3c2800_clk_freq() to match with s3c24x0_clk_freq(). 2003-08-01 00:41:42 +00:00
bsh b80cc89773 tweak to share s3c2xx0_intr.c for S3C2800 and S3C2410.
move init_interrupt_masks() from s3c2xx0_intr.c to s3c2800_intr.c, since
it doesn't work for S3C2410.
2003-08-01 00:40:17 +00:00
bsh d887fc052f delete an incorrecct comment
delete unused definitions
2003-08-01 00:30:21 +00:00
bsh 2393816ede add SSCOM_S3C2410 option. 2003-07-31 20:34:15 +00:00
bsh 86ab1d6591 the first cut of Samsung S3C2410 support.
It is Samsung's another ARM920 based SoC.

XXX: not tested much yet.
2003-07-31 19:49:41 +00:00
bsh eb6fd47108 split sscomintr() to sscomtxintr() and sscomrxintr(). 2003-07-31 19:08:10 +00:00
bsh 675f6328c9 + enable nested interrupts. This change stopped silo overflow messages
at 115200bps.

+ disable all hard interrupts by default.

+ rewrite s3c2xx0_(un)mask_interrupt() to make them faster.
2003-07-30 18:25:50 +00:00
he d3c139da44 Initialize the new _cookie member of arm32_bus_dma_tag to NULL. 2003-07-30 17:28:19 +00:00
thorpej d55cef76bf Add an opaque cookie field to the bus dma tag. 2003-07-28 17:35:54 +00:00
thorpej adef1b7dab Add PBIU register bits. 2003-07-28 16:53:31 +00:00
itojun 3f14c71f75 reserve cdev major # for PF. ok'ed by technical-exec 2003-07-27 14:17:57 +00:00
thorpej 472c98cf7a Fix think'o in last. Pointed out by Izumi Tsutsui. 2003-07-27 04:52:28 +00:00
thorpej ca601a7747 Flesh out inittodr() and resettodr(). 2003-07-26 05:51:11 +00:00
briggs d4f2e39afc Clear ARM32_DMAMAP_COHERENT in _bus_dmamap_load_buffer for userspace mappings. 2003-07-24 16:22:01 +00:00
bsh 5d7bb2a528 $Id$ -> $NetBSD$ 2003-07-23 09:26:15 +00:00
igy fcd9e244be Delaying to mask interrupt by hardware until actually it occurs.
The new code maintains two variables 'current_spl_level' and
'hardware_spl_level'.  Variable hardware_spl_level reflects actual
priority level at the hardware's point of view.  hardware_spl_level is
always synchronized to hardware.

splraise() just increases current_spl_level.  splx() sets
current_spl_level.  If (and only if) hardware_spl_level and
current_spl_level is not same, splx() synchronizes interrupt mask
register and hardware_spl_level to current_spl_level.

In most case, splraise() raises current_spl_level and splx() restores
only current_spl_level.

When an interrupt occurs, hardware_spl_level and interrupt mask
register are synchronized to current_spl_level.

In this implementation, during a higher priority interrupt handler is
running, lower priority interrupts never cause intr_dispatch() to run.
It will avoid some race condition.
2003-07-21 06:17:32 +00:00
lukem 08716eae82 __KERNEL_RCSID() 2003-07-15 00:24:37 +00:00
lukem 1b7326b581 use __KERNEL_RCSID() in a consistent manner 2003-07-14 22:48:19 +00:00
lukem de043b8788 use __KERNEL_RCSID(0, instead of RCSID( in the kernel 2003-07-14 15:17:13 +00:00
igy b449da1391 KNF 2003-07-13 09:25:50 +00:00
igy a90b1b8eca code clean up 2003-07-13 08:56:16 +00:00
igy 3e9598d4fa move window of pci i/o cycle to higher address 2003-07-13 08:26:31 +00:00
igy cdb56b83f6 mapping pci configuration space (not subregion) 2003-07-13 07:15:22 +00:00
igy 1087696257 using common bus_space_tag in ixpsip too 2003-07-13 02:48:41 +00:00
igy 365f7e1994 sharing bus_space_tag among ixpio, pci mem and i/o. 2003-07-13 02:11:58 +00:00
igy 2a9dfe7684 using devmap for static mapping 2003-07-13 01:01:50 +00:00
thorpej 88f63e28d6 Make faulting in DDB continue back in the top-level command
loop properly.
2003-07-09 20:14:14 +00:00
dogcow ccd442eae3 gcc 3.2 complained about the missing __volatile and extra tokens after #endif. 2003-07-05 06:53:08 +00:00
ichiro c2cac1cbd8 add sdram configration register 2003-07-02 14:03:52 +00:00
ichiro 38e0b1c5c5 use struct pmap_devmap 2003-07-02 11:02:28 +00:00
ichiro 25096a1afe backout to recent changes w/o lwp changes 2003-07-02 10:40:46 +00:00
thorpej 22c08fe417 PCI-X requires that that devices updated their PCIXSR on every
config write with the device number specified in AD[15:11].  If
we don't set this field when issuing a Type 0 cycle, each device
could end of thinking it is at device 0, which can cause a number
of problems.  Doing this unconditionally should be OK when only
PCI devices are present.
2003-06-30 15:27:12 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
chris 6721e83cfc Fixes to get cats build going following proc to lwp changes. 2003-06-29 14:51:04 +00:00
ichiro 904951f445 struct proc * -> struct lwp * 2003-06-29 11:10:35 +00:00
ichiro 4eee2aed2e struct proc * -> struct lwp *
ixp425_com:
add some status flags
2003-06-29 10:51:29 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
chris 93632a0574 Fix for port-arm/21962. Rather than fixing the #ifndef spl0, I removed
the test as spl0 is actually a macro for splx(0). The code now calls
splx(0)

(note building with the #ifdef fixed, caused the build to fail on a
GENERIC acorn32 kernel.)
2003-06-23 09:05:22 +00:00
bsh 7aeb49a6b4 don't map PCI device's I/O ports at address 0.
This fixed a problem when 3com 3C905 is a only PCI card on SMDK2800.
2003-06-18 10:56:35 +00:00
bsh 1928d3ed36 enable BTUART 2003-06-18 09:40:06 +00:00
bsh d8193564ca protect with #ifndef _LOCORE so that assembler codes can share
definitions in this file such as PMAP_DOMAIN_KERNEL.
2003-06-18 02:58:09 +00:00
bsh ddb2467dd1 make this compile again:
+ we don't have struct pxa2x0_softc anymore.
   + call pxa2x0_clkman_config() to provide clock to LCDC block.
2003-06-17 09:43:14 +00:00
bsh 3c87cee70f white space nit. 2003-06-17 09:32:38 +00:00
thorpej 452a8fdae2 Rename IPL_IMP -> IPL_VM. 2003-06-16 20:00:56 +00:00
fvdl 7dd7f8baa2 Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
2003-06-15 23:08:53 +00:00
thorpej cf8a25bdfc Add another devmap routine that allows bootstrap code to register
a devmap reflecting mappings that are created by really early
bootstrap code before pmap_devmap_bootstrap() is called.
2003-06-15 18:18:16 +00:00
thorpej 87d5bba5b3 Replace the ad-hoc "section mapping table" for static device mappings
with a more generic "devmap" structure that can also handle mappings
made with large and small pages.  Add new pmap routines to enter these
mappings during bootstrap (and "remember" the devmap), and routines to
look up the static mappings once the kernel is running.
2003-06-15 17:45:21 +00:00
thorpej 5ae120da7b Introduce a new "type" field in the softc which is used to indicate
the general UART type.  Currently, we have "normal", "hayesp" and
"pxa2x0" types.  Replace the corresponding hw flags with the new type
values.
2003-06-14 16:25:52 +00:00
scw e9bb3437d0 - Correct a couple of comments.
- Set AC97_MODR to the right value.
 - Add AC97_FEFIE.
2003-06-11 20:43:01 +00:00
scw 12b4852056 Gah, fix previous. s/defopt/defflag/ 2003-06-06 19:56:59 +00:00
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
thorpej 9a8042f242 Use PAGE_SIZE rather than NBPG. 2003-04-08 22:57:53 +00:00
rjs 5043a41a74 Add bs_mmap and make hack in bs_mmap conditional on hpcarm. 2003-04-06 12:56:45 +00:00
briggs 7679f5b28b Channel active is bit 10, not 9. 2003-04-05 04:18:26 +00:00
he e7dc774449 Including <uvm/uvm_extern.h> exposed the fact that we had a benign
type mismatch for SetCPSR.  Remove local extern declaration, since
it's now superfluous.
2003-04-03 17:47:04 +00:00
thorpej cc2c493bc4 Use PAGE_SIZE rather than NBPG. 2003-04-02 07:35:54 +00:00
thorpej 95281cabad Use PAGE_SIZE rather than NBPG. 2003-04-01 23:19:08 +00:00
thorpej d071d9a8d0 Use PAGE_SIZE rather than NBPG. 2003-04-01 15:02:05 +00:00
chris d19c70cbe2 Fix for PR arm/17971. Used patch as provided
Compiled, but no hardware to test on.
2003-03-31 19:52:35 +00:00
bsh 347085b57d put options XSCALE_CACHE_WRITE_THROUGH into opt_cpuoptions.h.
add XSCALE_CACHE_WRITE_BACK.
2003-03-29 07:59:41 +00:00
bsh 105db01dcd for Intel PXA2[15][05] processors, select write-back/write-through
cache based on CPU id.  write-through on PXA2[15]0 B2 stepping and
earlier. write-back on C0 and C1 stepping (a.k.a PXA2[15]5 A0)

options XSCALE_CACHE_WRITE_{THROUGH,BACK} can override it.

for other XScale CPUs than PXA2xx, XSCALE_CACHE_WRITE_THROUGH works
same as before.
2003-03-29 07:58:16 +00:00
mycroft 15e5d9ec58 Add a couple of byte-wide variants that weren't implemented -- I guess because
nobody else has a byte-accessible bus.
2003-03-27 19:46:14 +00:00
mycroft 49f94a02b4 Remove references to variables that aren't used here. 2003-03-27 19:42:30 +00:00
mycroft 6b44caa63e Doh, fix a pasto -- the ldr/str mask had a bad bit set. 2003-03-27 16:58:36 +00:00
mycroft a589baf905 Fix multiple problems with ldrh/strh/ldrsb/ldrsh disassembly:
* The offset format was wrong.
* There is no post-increment or index register update.
* It wasn't even matching because the mask was wrong.
Also touch up ldr/str disassembly slightly.
2003-03-27 16:42:40 +00:00
mycroft 0c23a8613a Fix multiple bugs in the way we do the v4 MMU disable -- it was blasting way
too many bits (including some reserved ones) and was writing the wrong value
for the TLB flush.
Also, if the flag is off, don't write the control register!
2003-03-26 17:36:56 +00:00
thorpej 0abb67bb3b Bump copyright date for last. 2003-03-25 19:47:30 +00:00
thorpej 891be168b5 Add support for attaching on-chip peripherals to the BECC using
indirect configuration (because the BECC is a soft-core, it could
have a variety of peripherals in the FPGA).  Also add support for
local untranslated DMA.
2003-03-25 19:45:52 +00:00
igy 4691b478a0 Add __KERNEL_RCSID tags 2003-03-25 06:12:46 +00:00
bsh 3034a15d1f + fix a crash when write-back cache is used, by calling PTE_SYNC()
after tweaking page table entry.

+ 4th argument of bus_space_map() is not only for BUS_SPACE_MAP_CACHEABLE.
2003-03-24 04:15:49 +00:00
chris c9033077aa Garbage collect pmap_map, the last (and only?) use has been removed. 2003-03-23 15:59:23 +00:00
chris a97b660835 When doing a kernel dump use the pmap_k* funcs. Also make sure that all
data is written to ram.  This avoids issues with tlb's not being flushed
etc.

As discussed a long time ago on port-arm
2003-03-23 15:49:25 +00:00
chris 9fd86b683f Add __KERNEL_RCSID tags to footbridge files. 2003-03-23 14:12:25 +00:00