Commit Graph

227 Commits

Author SHA1 Message Date
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
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 46192ffb9b add registers
Performance Monitoring Unit - Coprocessor14
2003-05-24 23:48:44 +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 b43b1645a2 Use aprint*(). 2003-04-29 01:07: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
briggs 7679f5b28b Channel active is bit 10, not 9. 2003-04-05 04:18:26 +00:00
thorpej 95281cabad Use PAGE_SIZE rather than NBPG. 2003-04-01 23:19:08 +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
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
bsh ae4f6e5092 add interrupt numbers for built-in peripherals.
add register definitions for DMA, AC97, and USB.
2003-03-18 11:23:03 +00:00
thorpej 23d2066add Cast the argument passed to vtophys() to a vaddr_t. 2003-03-04 01:10:50 +00:00
briggs 460f6b6383 Define the iopmu (even though it's not being used yet).
Export i80321_local_dma_init().
Make !sc->sc_is_host configuration a little more friendly.
Go back to using IABAR2 instead of IABAR3 for inbound SDRAM access.
2003-02-06 03:16:48 +00:00
briggs 87079147ff Add some more register definitions. 2003-02-06 03:01:32 +00:00
thorpej a264c879c9 Remove the DMA controller register defns from this file (much like
the AAU registers are not in this file) -- iopdma is not specific to
i80321.
2003-02-06 02:01:35 +00:00
briggs 6c79464645 Actually make a bitmask for ICU_INT_HWMASK. 2003-02-06 01:36:07 +00:00
briggs f339e5e9fe Get the interrupt mappings right for the slot. 2003-01-29 20:08:02 +00:00
thorpej f4ddf46102 Back out unintentional commit. 2003-01-25 02:12:22 +00:00
thorpej b1b164a859 Support for ADI Engineering's Big Endian Companion Chip for the
Intel i80200 XScale processor.  Despite its name, the BECC can
run in both big- and little-endian modes.
2003-01-25 01:57:17 +00:00
briggs ecc07a2e36 Use iwin[3] instead of iwin[2] for RAM access and leave iwin[2] unused. 2003-01-23 03:56:45 +00:00
briggs a4734dcbdd Program the BARs after the limit regs. When the BARs are written, the
value actually stored in the BAR is masked by the limit register.
2003-01-23 03:53:16 +00:00
thorpej 23bc250391 Merge the nathanw_sa branch. 2003-01-17 21:55:23 +00:00
thorpej b179f9cf73 Use the generic irq_dispatch.S 2003-01-03 00:55:59 +00:00
thorpej 6620220d46 Use the generic irq_dispatch.S 2003-01-03 00:41:19 +00:00
thorpej 6c9c7f3b21 Garbage-collect prev_intr_depth; nothing uses it. 2003-01-02 23:54:39 +00:00
thorpej 359ed65495 Use aprint_normal() for cfprint routines. 2003-01-01 00:46:13 +00:00
thorpej 1eab093085 * Use a device node for each DMA channel.
* Use aprint_normal() for cfprint routines.
2003-01-01 00:45:00 +00:00
thorpej 21fbbf679c Define a base for each DMA channel. 2003-01-01 00:44:34 +00:00
bsh 7b1d3e8b2b comment out a file that is not in the tree yet. 2002-12-20 01:10:11 +00:00
bsh b757504104 Config information for Intel PXA2xx application processors. 2002-12-18 05:47:31 +00:00
thorpej 9004406585 Error out if we get an unexpected buffer type. 2002-12-10 01:09:09 +00:00
briggs 458f8dc093 Restore .Lpmc_intr_return -- ben only removed one of two references to it. 2002-10-25 14:29:37 +00:00
bjh21 2a89b96077 Pull down rev 1.7.2.1 [must be careful which branch I commit to!]:
Reinstate .Lextirq_return: it was used in two places, and I only removed one
of them.
2002-10-21 18:09:18 +00:00
bsh 5e33e792f7 Support Intel PXA250 and PXA210 application processors. 2002-10-19 19:31:38 +00:00
bjh21 d599df9587 Continue the " - . - 8" purge. Specifically:
add	rd, pc, #foo - . - 8		->	adr	rd, foo
ldr	rd, [pc, #foo - . - 8]		->	ldr	rd, foo

Also, when saving the return address for a function pointer call, use
"mov lr, pc" just before the call unless the return address is somewhere
other than just after the call site.

Finally, a few obvious little micro-optimisations like using LDR directly
rather than ADR followed by LDR, and loading directly into PC rather than
bouncing via R0.
2002-10-14 22:32:50 +00:00
thorpej 855eefa351 Clean up some bad interaction between the spl inlining stuff and
strict-prototypes.
2002-10-09 00:03:42 +00:00
thorpej a4e06dd042 Move XScale common prototypes to xscalevar.h. Add xscale_pmc_dispatch()
prototype.  Include xscalevar.h has necessary to being prototypes into
scope.
2002-10-08 23:59:41 +00:00
thorpej 072eedb728 Add a symbolic constant for where external interrupts start. 2002-10-03 20:10:40 +00:00
thorpej c5e91d447d Use CFATTACH_DECL(). 2002-10-02 04:55:47 +00:00
thorpej 9a711d6985 Declare all cfattach structures const. 2002-09-27 20:29:02 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
thorpej d1ad2ac4f2 Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver.  The cfdriver is then looked
up in a list which is built at run-time.
2002-09-27 02:24:06 +00:00
briggs 37019d791a Use generic_bs_sr_4 for bus_space_set_region_4. 2002-08-29 17:29:34 +00:00
thorpej a7d44c2503 Use separate function pointers for dmamap_sync pre- vs post- operations.
Change the bus_dmamap_sync() macro to test the ops argument against pre-
and post- constants.  The compiler will optimize out dead code because
of the constants.  Since post- operations are not needed on ARM (except
for ISA bounce buffers), this eliminate a large number of function calls
which are noops, each of which cost at least 6 cycles just in the call
and return overhead (not to mention whatever other useless work the
compiler decides to do in the callee).
2002-08-17 20:46:26 +00:00
briggs 126f6cf9bc Add a new option EVBARM_BOARDTYPE to differentiate between different
evbarm ports.  Inline _splraise/_spllower/splx for i80321 and iq80310
for more performance.
2002-08-17 16:42:20 +00:00
thorpej 7cbd25232f Use correct-for-ELF local labels. 2002-08-17 03:14:47 +00:00
briggs b84fadb38b i80200_extirq_dispatch takes a struct irqframe * now. 2002-08-16 04:55:48 +00:00
thorpej 4706ae8670 Use cpsr_c rather then cpsr_all where appropriate. 2002-08-14 23:33:11 +00:00
thorpej eeebe88acf Don't need to frob CPSR in _splraise(). 2002-08-14 19:47:18 +00:00
thorpej 0291ab61ec * PMC_TYPE_I80200 -> PMC_CLASS_I80200 to reflect the terminology
used in pmc(3).
* Some minor namespace cleanup.
2002-08-09 05:27:09 +00:00
briggs 5da3a2950b When configuring a counter, do not assume that it's not been configured in
this process (mask off the register field before setting it).
2002-08-08 18:23:46 +00:00
thorpej f91adb85ce * XSCALE_PMC_TYPE_I80200 -> PMC_TYPE_I80200
* XSCALE_PMC_TYPE_CCNT -> PMC_TYPE_I80200_CCNT
* XSCALE_PMC_TYPE_PMCx -> PMC_TYPE_I80200_PMCx

Per discussion with Allen Briggs.
2002-08-07 21:11:35 +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
thorpej 0aa15bdf33 Add support for "xor5", "xor6", "xor7", and "xor8". 2002-08-04 02:26:18 +00:00
thorpej 3b50c1710c * Define the 8-input, 16-input, and 32-input descriptors.
* Adjust descriptor sync'ing to work with the additional descriptor
  formats.
2002-08-03 21:58:55 +00:00
thorpej a39c3378b6 Restructure the iopaau_function slightly to provide greater
flexibility when using different descriptor formats.
2002-08-03 21:31:16 +00:00
thorpej c070073d8e Add support for xor2, xor3, and xor4. Fix inverted direction
indications in some bus_dma operations.
2002-08-02 06:52:16 +00:00
thorpej 58983a92ba Let the "zero" and "fill8" functions share a bunch of code. 2002-08-02 02:08:11 +00:00
thorpej 321a514c93 Grr, RCS ID tag typo. 2002-08-02 00:36:38 +00:00
thorpej 036da55e8f Add support for the Intel i80321 I/O Processor's Application Accelerator
Unit.  The AAU provides block fill, block copy, XOR, and XOR-parity-check
operations.  We currently provide dmover(9) functions for "zero", "fill8",
and "copy".

Much of this code can be shared with the i80312 Companion I/O AAU, and
will be when support for the older chip is implemented.
2002-08-02 00:35:47 +00:00
thorpej d038c91c0c Delete all the AAU register definitions; they are moved to a separate
file in a future commit.
2002-08-02 00:33:29 +00:00
thorpej e3e6d7dfa5 Move the DMA tag initialization functions into i80312.c. 2002-08-01 19:55:02 +00:00
thorpej f546baba66 Move the DMA tag initialization functions into i80321.c. 2002-08-01 19:40:07 +00:00
thorpej dce4476374 Overhaul how DMA ranges work in the ARM bus_dma implementation.
A new "arm32_dma_range" structure now describes a DMA window, with
a system address base, bus address base, and length.  In addition to
providing info about which memory regions are legal for DMA, the new
structure provides address translation support, as well.

As before, if a tag does not list any ranges, then all addresses are
considered valid, and no DMA address translation is performed.

This allows us to remove a large chunk of code which was duplicated and
tweaked slightly (to do the address translation) from the stock ARM
bus_dma in the XScale IOP and ARM Integrator ports.

Test compiled on all ARM platforms, test booted on Intel IQ80321 and Shark.
2002-07-31 17:34:23 +00:00
thorpej 5fed6739d9 Use more descriptive interrupt names. 2002-07-30 04:45:41 +00:00
thorpej d8eb148780 Clean up some comments. 2002-07-29 22:00:00 +00:00
thorpej 2bbd3be11a Add support for the i80321 watchdog timer. 2002-07-29 18:40:04 +00:00
thorpej 2367c7fff8 Add support for attaching IOP built-in sub-devices (aau, dma, ssp,
watchdog, etc.)
2002-07-29 17:37:14 +00:00
thorpej c92ad565ad * Remove some AAU definitions -- they will be defined elsewhere in
a future commit.
* Fix a typo in the watchdog enable names.
* Add SSP (synchronous serial port, for SPI, Microwire, etc.) definitions.
2002-07-29 17:28:06 +00:00
thorpej 7b652cb939 Change the way that DMA map syncs are done. Instead of remembering
the virtual address for each DMA segment, just cache a pointer to the
original buffer/buftype used to load the DMA map, and use that.  This
lets us shrink the bus_dma_segment_t down from 12 bytes to 8, and the
cache flushing is also more efficient.

Tested on an i80321 -- changes to others are mechanical.
2002-07-28 17:54:05 +00:00
thorpej efe71a8aac Add support for DMA to/from the on-chip devices of the i80321 (no
PCI window translation).

XXX This would be better done by overhauling the shared ARM bus_dma code.
2002-07-25 15:00:48 +00:00
thorpej 7704072be3 Correct a comment. 2002-06-25 19:41:08 +00:00
thorpej fea38885e8 * Interrupt status is in cp13.4, not cp13.1 (D'oh!)
* Fix an inverted test.
2002-06-25 19:40:46 +00:00
thorpej f2bff71e47 Interrupt steering register is cp13.8, not cp13.2 (D'oh!). 2002-06-25 19:39:51 +00:00
thorpej 204183c0fa * Add "pcitag_t *pba_bridgetag" to pci_attach_args. This is set to
NULL for root PCI busses.  For busses behind a bridge, it points to
  a persistent copy of the bridge's pcitag_t.  This can be very useful
  for machine-dependent PCI bus enumeration code.
* Implement a machine-dependent pci_enumerate_bus() for sparc64 which
  uses OFW device nodes to enumerate the bus.  When a PCI bus that is
  behind a bridge is attached, pci_attach_hook() allocates a new PCI
  chipset tag for the new bus and sets it's "curnode" to the OFW node
  of the bridge.  This is used as a starting point when enumerating
  that bus.  Root busses get the OFW node of the host bridge (psycho).
* Garbage-collect "ofpci" and "ofppb" from the sparc64 port.
2002-05-16 01:01:28 +00:00
thorpej efb8222642 Fix error reporting in the bus_dmamap_load_mbuf() routines. 2002-05-02 16:50:39 +00:00
thorpej f23ba7637c Add Application Accelerator Unit registers. 2002-04-16 17:36:06 +00:00
thorpej bbdbd9ab37 Add i80321 DMA controller registers. 2002-04-16 04:50:14 +00:00
thorpej 80146a5185 Use the bus_space_generic bus space ops. 2002-04-12 19:02:30 +00:00
thorpej 70fbd8fba7 Fix soft interrupts. 2002-03-28 03:19:31 +00:00
thorpej 0b109cd060 iwin_base_lo is a BAR value; make sure to mask off the non-address
bits when using it.
2002-03-27 23:17:03 +00:00
thorpej f536211623 Basic support for the Intel i80321 I/O Processor (Xscale core).
Note: This is a snapshot of work-in-progress; there are still some
bugs to be shaken out.
2002-03-27 21:45:47 +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
briggs b72d845476 Actually set the i80312_softc global. 2002-02-14 02:38:22 +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 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 8ed8f67cf7 Make the software copy of INTCTL volatile. 2002-01-25 19:05:36 +00:00
thorpej bd098d4ca4 Fix a typo (thanks Allen). 2002-01-24 03:58:09 +00:00
thorpej 7c2247336b Clean up the i80312 PMU definitions. 2002-01-24 01:21:44 +00:00
thorpej e33cde5940 Add an IRQ vector to be shared by all i80200 applications. This
consults the interrupt source bits in the i80200 ICU and calls
a board-specific external IRQ dispatcher if an external IRQ is
pending.
2002-01-24 01:12:40 +00:00
thorpej d70b940ca2 Add generic code to manipulate the i80200 ICU. 2002-01-23 21:00:12 +00:00
thorpej 361cbb0a88 Make this usable directly by assembly code. 2002-01-23 20:58:29 +00:00
briggs e984bd475c Initialize pba_intrswiz and pba_intrtag before configuring PCI bus. 2002-01-04 22:39:47 +00:00
thorpej 631447bb4a Change some #if 0 to #ifdef VERBOSE_INIT_ARM. 2001-12-18 02:52:00 +00:00
thorpej 5936a89bf5 Add register definitions for the i80200 Interrupt Controller Unit,
Bus Controller Unit, and Performance Monitoring Unit.
2001-12-01 05:46:19 +00:00
thorpej 2b08dcc43b Clarify a comment to state that it is intentional that we attach
only the Secondary PCI bus (it's the only bus which can have a
device space hidden from any PCI host on the Primary bus).

Also, use the bus number from the PPB businfo register seecondary bus
field rather than hard-coding "1".
2001-11-30 19:29:44 +00:00
thorpej e90eccc52c Clarify a comment. 2001-11-30 19:26:03 +00:00
thorpej 8ae5055ed9 Add routines for accessing the general purpose I/O facility of
the i80312 Companion I/O chip.
2001-11-29 08:27:11 +00:00
thorpej 574dba96b1 Update copyright. 2001-11-29 08:26:18 +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
thorpej 85a1db0fda Disable MRL, MRM, and MWI for now. 2001-11-28 22:39:09 +00:00
thorpej bd3e75a9df Oops, make sure to add in the physical base of the PCI memory
window when mapping PCI mem space.  (Whee, I can take out my
local hack, now).
2001-11-28 21:08:47 +00:00
thorpej fe9e809208 Add a comment explaining that we expect the memory controller
registers to already be subregion'd off, and actually init
the PCI DMA tag.
2001-11-10 23:14:51 +00:00
thorpej d1f4bf74ca Add support for PCI DMA on the i80312. We currently just do
DMA via the Secondary Inbound window, for now.  Will probably
need to revisit this at some point.

Require that the board-specific i80312 front-end slice off a
subregion for the memory controller before calling i80312_attach(),
and fix a bug in the IQ80310 front-end that caused the Secondary
Inbound window to be configured incorrectly.
2001-11-09 23:15:52 +00:00
thorpej d32191e3da Add support for configuring the PCI bus (starting with the Secondary
bus only, for now).

XXX Some cleanup wrt. pci_conf_interrupt() needs to happen.
2001-11-09 19:48:35 +00:00
thorpej 82c11eec1c Clear the Master Abort after reading config space for a non-existent
PCI device.  Disable debugging messages, as PCI config space works now.
2001-11-09 18:04:10 +00:00
thorpej d16c00cfb2 Disable the ATU interrupt sources (i.e. interrupts that occur when
we get Master or Target aborts).
2001-11-09 17:44:43 +00:00
thorpej 660b98b7dc Snapshot of work-in-progress for Intel i80312 Companion I/O chip;
just basic Inbound and Outbound window setup is done, PCI configuration
space access (not quite working yet), and I/O and Memory space routines
so far.
2001-11-09 03:27:51 +00:00
thorpej 64f23a2423 Adjust the way the PMMRs are defined -- offsets from a base, not
absolutes.  Also, add PPB and more ATU registers.
2001-11-08 03:20:36 +00:00
thorpej af0d2bf570 Config info for the i80312 XScale companion I/O chip. 2001-11-05 23:38:55 +00:00
thorpej 20b742fd48 RCS ID. 2001-11-05 23:38:05 +00:00
thorpej 49951f6d12 Prototypes for i80312 routines. 2001-11-05 23:37:41 +00:00
thorpej 22514e4c7d Routines for handling the i80312 memory controller for XScale.
Currently includes a routine to determine memory size from the
SDRAM configuration registers.
2001-11-05 23:37:01 +00:00
thorpej fe988b60bb Add PCI window addresses. 2001-11-04 19:32:32 +00:00
thorpej 95a9886f49 Add a comment describing what this file is. 2001-11-04 01:23:49 +00:00
thorpej 8f626436b6 Add missing RCS ID, add missing name. 2001-11-04 01:16:01 +00:00
matt 779b9b4649 Fix some register definitions. 2001-09-05 17:05:36 +00:00
matt 4e642cc5fd Add i80312 register definitions (just registers for now). 2001-08-26 19:25:47 +00:00