Commit Graph

223 Commits

Author SHA1 Message Date
thorpej 222fd9910b Add a netbsd-wm0 kernel config. 2002-03-29 20:29:30 +00:00
thorpej 6a9768d2bf Fix resetting the board at reboot. 2002-03-29 02:22:34 +00:00
thorpej 8345db18a3 Example gzboot config for the IQ80321. 2002-03-28 20:44:07 +00:00
thorpej b5b0fd2467 Define CONADDR. 2002-03-28 20:41:45 +00:00
thorpej 242be7009e Rename iq80310_cons.c to ns16550.c. Require that CONADDR be
defined by the Makefile at build time.
2002-03-28 20:40:47 +00:00
thorpej bb52a97b63 Kernel configuration file for the IQ80321 eval board. 2002-03-27 21:52:19 +00:00
thorpej 592e882ae0 Support for the Intel IQ80321 eval board for the i80321 I/O Processor. 2002-03-27 21:51:28 +00:00
thorpej 33bf2a81e0 Note that this module will also work with the IQ80321 eval board. 2002-03-27 04:14:25 +00:00
thorpej eb1415ce49 Stand-alone memory sizing routine for the Intel i80321 I/O processor
("Verde").
2002-03-27 04:13:39 +00:00
thorpej 41f47f03e7 Restructure a few things in order to support other XScale core
I/O processors:
* The i80200 and the i80321 have the same CPU ID, so split the
  CPU_XSCALE option into CPU_XSCALE_80200 and CPU_XSCALE_80321
  options, and don't let them both be defined at the same time.
  XXX May want to revisit this in the future.
* Split some registers common between the i80200 and i80321 into
  <arm/xscale/xscalereg.h>.
* Rename a few existing functions.
2002-03-26 19:29:44 +00:00
thorpej dbe6d8291b * Fix use of pmap_curmaxkvaddr.
* Use the PTP hint in the pmap.
2002-03-25 04:51:19 +00:00
thorpej 5ffc15a083 Use vtopte() instead of pmap_pte(). 2002-03-24 18:12:54 +00:00
thorpej aa1563948c * arm_byte_to_page() -> arm_btop()
* arm_page_to_byte() -> arm_ptob()
2002-03-24 03:37:18 +00:00
thorpej 110e2a57ff * Change all uses of KERNEL_SPACE_START to KERNEL_BASE.
* Delete now unused KERNEL_SPACE_START.
2002-03-23 02:53:59 +00:00
thorpej 0ba36d6f6f * Rename PROCESS_PAGE_TBLS_BASE -> PTE_BASE
* Rename ALT_PAGE_TBLS_BASE -> APTE_BASE
* Garbage-collect PAGE_TABLE_SPACE_START
2002-03-23 02:22:56 +00:00
briggs d099df10f4 Use obio_bs_rr_1.
In obio_bs_map(): Create a mapping for regions that are not in the
	standard on-board I/O space.
2002-03-19 01:36:13 +00:00
atatat 31144d9976 Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command".  ERESTART is -1, which can lead to
confusion.  ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4.  No ioctl code should now return -1 anywhere.  The
ioctl() system call is now properly restartable.
2002-03-17 19:40:26 +00:00
lukem cd19d52695 * rename MINIROOTSIZE to MEMORY_DISK_SIZE, so that all md(4) options
are now consistently named
* fold opt_mdsize.h into opt_md.h
2002-03-10 19:56:37 +00:00
thorpej e0ea696615 * Add support for running the IQ80310 kernel where KERNEL_BASE !=
physical memory start.  Garbage-collect some cruft while here.
* Move the kernel up to 0xc0000000, giving a 1G/3G kernel/user split.
* Adjust the Integrator startup code accordingly.
2002-03-03 21:22:15 +00:00
thorpej e23381908a inittodr(): Actually initialize time from the file system time. 2002-03-03 21:10:40 +00:00
chris 1181e367e0 Implement pmap_growkernel for arm32 based ports.
Note that this has been compiled on some systems, cats, IQ80310, IPAQ, netwinder and shark (note that shark's build is currently broken due to other reasons), but only actually run on cats.
Shark doesn't make use of the functionality as I believe there has to be a correlation between OFW and the kernel tables so that calls into OFW work.
2002-03-03 11:22:58 +00:00
thorpej 20dd585980 Add RCS ID. 2002-03-02 22:29:40 +00:00
thorpej ebcb5cdd36 Move the DBSYM bits up in the file. 2002-03-02 22:23:10 +00:00
simonb 4324f37586 Use "#define<tab>". 2002-02-28 03:17:23 +00:00
thorpej c92241b420 Correct a comment. 2002-02-24 20:51:56 +00:00
thorpej 4af7d26f26 Fix a couple of comments. 2002-02-24 20:44:28 +00:00
thorpej 0a4bc3ccd5 This file is obsolete. 2002-02-24 20:32:40 +00:00
thorpej 39c165f331 Add support for relocating gzboot's .text out of flash and into
RAM (while still decompressing the image directly from flash).

This makes gzboot run a LOT faster.
2002-02-24 20:29:44 +00:00
thorpej d819468d64 Improve zlib error reporting. 2002-02-24 18:36:29 +00:00
thorpej 0780eaaa32 Use bcopy() and bzero(), since the rest of libsa does. This means
we don't have to pull in memset() and memcpy() from libsa.
2002-02-23 20:48:14 +00:00
thorpej 59f1dfe1c2 Don't need to provide zcalloc() and zcfree(); there are such routines
in libz.
2002-02-23 20:34:41 +00:00
thorpej 524d248b59 Fix the -DRELOC=... CPP flag. Add -DDYNAMIC_CRC_TABLE to shrink
the text (and, thus, the space taken up in flash) a bit.
2002-02-23 20:19:52 +00:00
briggs caaef6d0d0 Implement obio_bs_rr_1. 2002-02-23 19:55:34 +00:00
thorpej a91d5a1a99 Example Makefile and linker script for building a run-from-flash
gzboot image for the IQ80310 with room for 2M of compressed data.
2002-02-23 19:16:54 +00:00
thorpej c39065eb62 Add support for running directly out of flash:
* Require that the builder Makefile provide a linker script.
* After making sure the MMU is disabled, check to see if
  _etext == __data_start.  If not, then copy the .data contents
  into RAM.
* Put the stack in .bss.
2002-02-23 18:19:09 +00:00
thorpej 87de164ab4 Fix a silly bug in the propellor spinning code. 2002-02-23 17:25:32 +00:00
thorpej d114b32f24 Add some nops after we enable the MMU, for good measure (enough for
the nops to be the prefetch'd insns when the MMU switch occurs).
2002-02-23 05:58:46 +00:00
thorpej f31f6affa9 Make sure the MMU is enabled after we switch to the new kernel
page tables (gzboot disables the MMU before it does its work).
2002-02-23 05:55:26 +00:00
thorpej 0fac1c42e9 gzboot -- boot a gzip'd kernel image. This is useful for booting
compressed kernel images from flash.

This needs more work, but is a good first-pass.
2002-02-23 05:41:14 +00:00
thorpej 1152fa21da Add some simple standalone device drivers for IOP310-based boards. 2002-02-23 05:12:01 +00:00
thorpej ac5d6ab89f Fix the "va" argument to pmap_map_entry() when mapping kernel_ptpt. 2002-02-22 17:26:36 +00:00
thorpej 37595cfcf8 Fix the "va" argument to pmap_map_entry() when mapping kernel_ptpt.
This happened to work in the IOP310 because the kernel runs VA==PA.
2002-02-22 17:23:13 +00:00
thorpej 5164bca298 Also generate flat binary kernels for the IQ80310. 2002-02-22 05:07:46 +00:00
thorpej bb84e85802 Change pmap_map_entry() to work like pmap_map_chunk(): take a pointer
to the L1 table and a virtual address, and no pointer to the L2 table.
The L2 table will be looked up by pmap_map_entry(), which will panic
if the there is no L2 table for the requested VA.

NOTE: IT IS EXTREMELY IMPORTANT THAT THE CORRECT VIRTUAL ADDRESS
BE PROVIDED TO pmap_map_entry()!  Notably, the code that mapped
the kernel L2 tables into the kernel PT mapping L2 table were not
passing actual virtual addresses, but rather offsets into the range
mapped by the L2 table.  I have fixed up all of these call sites,
and tested the resulting kernel on both an IQ80310 and a Shark.
Other portmasters should examine their pmap_map_entry() calls if
their new kernels fail.
2002-02-22 04:49:19 +00:00
thorpej 79738a99e9 Keep track of which kernel PTs are available during bootstrap,
and let pmap_map_chunk() lookup the correct one to use for the
current VA.  Eliminate the "l2table" argument to pmap_map_chunk().

Add a second L2 table for mapping kernel text/data/bss on the
IQ80310 (fixes booting kernels with ramdisks).
2002-02-21 21:58:00 +00:00
thorpej 15e0450397 Always pass the L1 table to pmap_map_chunk(). This allows pmap_map_chunk()
to perform some error checking.
2002-02-21 05:25:23 +00:00
thorpej 454e106a48 map_chunk() -> pmap_map_chunk(), and move it to pmap.c 2002-02-21 02:52:19 +00:00
skrll 2de2e35201 Fix typo in comment. 2002-02-20 20:47:40 +00:00
thorpej 425011f621 map_pagetable() -> pmap_link_l2pt(), and move it to pmap.c 2002-02-20 20:41:15 +00:00
thorpej c44b9117f0 Collapse map_entry{,ro,nc}() into a single pmap_map_entry() that
takes a prot and a "cacheable" indicator.
2002-02-20 02:32:56 +00:00
thorpej 9c31f51c34 Rename map_section() to pmap_map_section(), move it to pmap.c, and give it
an extra argument (prot - specifies protection of the mapping).
2002-02-20 00:10:15 +00:00
briggs acf12a854d Use the MI md_root 2002-02-19 17:41:15 +00:00
thorpej cd98cbf7fb * For platforms which are already ELF, remove the definition of
MACHINE_ARCH since <arm/param.h> already sets it correctly to "arm".
* For platforms which are not yet ELF, defined MACHINE_ARCH to "arm32"
  if __ELF__ is not defined by the C preprocessor.
* In <arm/param.h>, clarify the rules about when MACHINE and
  MACHINE_ARCH are defined, and to what.  Also, for ELF platforms,
  int the non-_KERNEL case, force both MACHINE and MACHINE_ARCH to "arm",
  rather than allowing platform-specifc code to define either.
2002-02-12 06:58:18 +00:00
thorpej e01bd95698 * The Npwr only has 5 interrupt sources, all in XINT3, so don't bother
reading XINT0 (which isn't even implemented by the CPLD on Npwr).
* Adjust the mask of valid IRQ bits for the Npwr.
2002-02-09 03:52:31 +00:00
thorpej 727b4699ce The Npwr has a 19-bit timer. Make sure values programmed into
the counter fit.
2002-02-08 23:50:53 +00:00
thorpej 9716a068b6 * No need to specify the console speed anymore; it defaults to the
correct speed if IOP310_TEAMASA_NPWR is defined.
* Just wildcard the "wm" and "siop" devices.
* Comment out raid and ccd for now.
2002-02-08 03:43:41 +00:00
thorpej 66c81951ae Default the console to the correct speed on the Npwr (so that
it doesn't have to be set in the kernel config file).
2002-02-08 03:41:56 +00:00
briggs efca4d520d Wire the internal devices to the right interrupts on NPWR. 2002-02-08 03:28:24 +00:00
thorpej 987cb42a95 No point in setting the ATU Subsys vendor/dev ID on boards that
can't plug into a PCI host.
2002-02-08 02:31:12 +00:00
thorpej 367a9543a7 The Npwr doesn't have the board_rev/cpld_rev/backplane_det registers,
do don't bother reading them.
2002-02-08 02:30:12 +00:00
briggs 6331bb5b24 Let this compile with the IOP310_TEAMASA_NPWR option. 2002-02-08 01:42:41 +00:00
briggs 07ec97aeba finish conversion from TEAMASA_NPWR to IOP310_TEAMASA_NPWR 2002-02-08 01:41:48 +00:00
thorpej 140c8fe847 Don't hard-code the console address in error messages. 2002-02-07 23:53:01 +00:00
thorpej 2b9837b4d9 Add support for the Team ASA Npwr IOP310-based server appliance. 2002-02-07 21:34:23 +00:00
thorpej 9265cef48c irq_init() -> iq80310_intr_init() 2002-01-30 04:01:36 +00:00
thorpej 48499c673e Pull in <evbarm/ifpga/irqhandler.h> for now. 2002-01-30 04:00:47 +00:00
thorpej 2bc996b0bc New interrupt framework for NetBSD/evbarm, and accompanying new
interrupt code for the IQ80310 board support package.

XXX The Integrator board support package still uses the old-style
arm32 interrupt code, so some compatibility hacks have been added
for it.  When the Integrator uses new-style interrupts, those hacks
can go away.
2002-01-30 03:59:39 +00:00
thorpej 558b6aece0 Move the generic ARM soft interrupt code into a generic place. 2002-01-29 22:54:14 +00:00
jdolecek 6d265bd894 add options PIPE_SOCKETPAIR to individual kernel configs
the option is commented out on everything but kernels I was able
to recognize as INSTALL-like or ones for small memory machines
2002-01-27 13:23:08 +00:00
thorpej 08342df793 Overhaul bus_dmamap_sync for the ARM:
* Track which process (XXX really, vmspace) owns the mapping.  When
  we sync the map, if the mapping doesn't belong to the kernel or to
  the current process (XXX really, vmspace), then no cache fobbing
  is necessary, since the cache is Wb-Inv'd on context switch (XXX need
  to revisit this when we support FCSE).
* Be smarter about which cache operation we do when sync'ing the map:
  - PREREAD -- Invalidate D$ (XXX right now, we actually do Wb-Inv)
  - PREWRITE -- Write-back D$ (note, we do NOT invalidate here)
  - PREREAD|PREWRITE -- Wb-Inv D$

More work is needed here.  In particular, a version for CPUs
with write-through caches should be provided, to eliminate
the write-back steps (which are noops on such CPUs, but skipping
two branches would be nice).
2002-01-25 20:57:41 +00:00
thorpej 4e990d9ccb Overhaul of the ARM cache code. This is mostly a simplification
pass.  Rather than providing a whole slew of cache operations that
aren't ever used, distill them down to some useful primitives:

	icache_sync_all         Synchronize I-cache
	icache_sync_range       Synchronize I-cache range

	dcache_wbinv_all        Write-back and Invalidate D-cache
	dcache_wbinv_range      Write-back and Invalidate D-cache range
	dcache_inv_range        Invalidate D-cache range
	dcache_wb_range         Write-back D-cache range

	idcache_wbinv_all       Write-back and Invalidate D-cache,
				Invalidate I-cache
	idcache_wbinv_range     Write-back and Invalidate D-cache,
				Invalidate I-cache range

Note: This does not yet include an overhaul of the actual asm files
that implement the primitives.  Instead, we've provided a safe default
for each CPU type, and the individual CPU types can now be optimized
one at a time.
2002-01-25 19:19:22 +00:00
thorpej 0404ff83b9 Generic soft interrupt support for the evbarm port. Two caveats:
* This is not currently used by the in-tree evbarm interrupt code.  New
  interrupt code will appear "soon" which makes use of this file.
* This file will probably move to a generic ARM location eventually.
2002-01-24 18:48:03 +00:00
thorpej c50e5f6562 Don't need pciide_machdep.c 2002-01-24 06:51:30 +00:00
briggs 2341768d92 Two changes for XScale:
1) Add defparam XSCALE_CCLKCFG to define a parameter for the
	   CCLKCFG register.  Default it to '9' on the IQ80310.
	2) Add a sleep call to the xscale CPU function vector (replacing
	   the nullop) which should drop the CPU into "idle" mode when
	   cpu_switch finds nothing on the run queues.
2002-01-24 04:23:18 +00:00
thorpej ffe44b126d Pull in files.i80200 2002-01-24 03:57:36 +00:00
thorpej ae267d2bc7 s/CPLD/iq80310/g 2002-01-24 03:34:28 +00:00
thorpej e594c94727 Some prototype cleanup. 2002-01-20 03:41:47 +00:00
thorpej d2ee788a90 Document the CONUNIT and CONSPEED config options. 2002-01-18 19:47:38 +00:00
thorpej d25c8d3cac Allow the console unit to be overridden with the CONUNIT configuration
option.
2002-01-18 19:47:05 +00:00
thorpej f11f32eed1 Since we build with DDB by default, build with SYMTAB_SPACE by default,
as well.
2002-01-16 23:49:41 +00:00
thorpej bd500cc450 When mapping the kernel text/data/bss:
* Round the text size up the next page, don't truncate it.
* Pass the kernel L1 table to map_chunk() so that it can try
  to use section mappings.
2002-01-16 23:37:05 +00:00
thorpej fd8ee60d12 Correct KERNEL_TEXT_BASE. 2002-01-16 23:33:51 +00:00
thorpej 1e0e569ced Remove the "fiqhandler" definitions. 2002-01-13 19:20:06 +00:00
briggs b89eed2156 If we're attaching UART2, then use UART2 in failure-case panic()s. 2002-01-04 21:18:59 +00:00
thorpej 014157862c * Share a common vector page between arm26 and arm32.
* Use a common set of exception handlers for all arm32 platforms.
* New FIQ framework based on discussions with Ben Harris, shared
  between arm26 and arm32.
2001-12-20 01:20:21 +00:00
atatat b45c51b1fc Roll the rest of the ports over to the new MI kernel build machinery.
Any problems reported by testers have been fixed, and massive
cross-compiling of kernels has shown that any problems that remain
with actually building kernels are not related to this.
2001-12-09 05:00:40 +00:00
thorpej a5a8439141 Make the snake slither in a slightly more interesting pattern that
also happens to have 8 positions (and thus has a slightly more efficient
implementation).
2001-12-01 21:23:17 +00:00
thorpej 216b9b2ea6 - Don't enable FIQs; nothing uses them (yet).
- Steer i80200 PMU and BCU interrupts to IRQ# (for lack of a better
  place, at the moment).
- Disable all interrupts other than external-IRQ# in the i80200 ICU;
  we don't deal with any of the others, yet.
2001-12-01 06:15:36 +00:00
thorpej a7cfcd87fd Implement a "snake" for the 7-segment display. 2001-12-01 02:04:27 +00:00
thorpej 5f8b540ed9 Remove U from the display seg constants. 2001-12-01 02:02:46 +00:00
thorpej e41179bfd0 Need <arm/cpufunc.h> for cache-related variables. 2001-11-30 19:43:20 +00:00
thorpej 0046f5dadd - Comment-out EXT2FS, MSDOSFS.
- Uncomment FDESC, KERNFS, PROCFS,
- Add commented-out DEBUG.
- Hard-wire the location of some of the on-board PCI devices.
- Also build a "netbsd-fxp0" with the root FS hard-wired to
  the on-board Ethernet.
2001-11-30 03:01:23 +00:00
thorpej c5ecb8d8c5 Use the new arm_dcache_align variable to set the PCI device BHLC
register.
2001-11-29 02:26:50 +00:00
thorpej 636e9cd08b Add a "cacheline_size" argument to pci_configure_bus(). It is used
to set the cacheline size in the BHLC register.  This should be the
size of the largest D-cache line on a system.
2001-11-28 23:48:34 +00:00
lukem ecb81c3f6d - convert usage of "defopt" to "defflag" where the relevant option does
not support a value (e.g., it's to be used as "options FOO" instead of
  "options FOO=xxx"). options that take a value were converted to
  defparam recently.
- minor whitespace & formatting cleanups
2001-11-28 10:21:10 +00:00
thorpej a9b25a66fa When processing ASTs:
- Loop until astpending is clear upon return from ast().
- Clear astpending *before* re-enabling interrupts.
2001-11-28 01:31:59 +00:00
thorpej 7184ed949e Update copyright notice. 2001-11-27 00:35:34 +00:00
thorpej 34ce8c531b Don't need to include <machine/irqhandler.h> 2001-11-27 00:34:48 +00:00
thorpej 8cd82ab7b7 Move interrupt-related stuff out of the generic 32-bit ARM genassym.cf
and into platform-specific genassym.cf files.
2001-11-27 00:15:58 +00:00
thorpej c8c624e4aa Don't include <machine/psl.h> directly. 2001-11-26 20:49:04 +00:00