Commit Graph

199 Commits

Author SHA1 Message Date
kiyohara
c353b58b7a Issue the STOP-bit if needed.
And remove #ifdef ARMADAXP.
2013-08-03 07:39:31 +00:00
christos
2432e2b578 There is no opt_mvsoc.h; the #ifdef ARMADAXP should be changed to some
inherited device property.
2013-05-13 15:47:18 +00:00
khorben
706bb852e6 Removed an unused variable.
"go ahead" rkujawa@
2013-05-06 23:09:34 +00:00
rkujawa
648f6a20d2 Support Marvell Armada XP.
Obtained from Marvell, Semihalf.
2013-05-01 12:30:02 +00:00
rkujawa
a6a9912488 TWSI controller on Armada XP is a bit different. Support that.
Obtained from Marvell, Semihalf.
2013-05-01 12:25:31 +00:00
rkujawa
e97aea6084 Add IDs for Marvell Armada XP and ATTR_SDRAM registers used with IO cache coherency.
Obtained from Marvell, Semihalf.
2013-05-01 12:23:24 +00:00
rkujawa
f60821d1be Avoid configuring root complex on MV78460.
Obtained from Marvell, Semihalf.
2013-05-01 12:21:47 +00:00
rkujawa
055ac78ac4 Support SATA on Marvell Armada XP.
Obtained from Marvell, Semihalf.
2013-05-01 12:19:49 +00:00
rkujawa
1ed09d9cf0 Add support for Marvell's SPI controller as found on Armada XP.
Obtained from Semihalf.
2013-05-01 12:17:17 +00:00
msaitoh
c73456fec2 Fix a bug that a multicast filter entry is incorrectly overrode
on some cases.
2012-12-28 08:16:53 +00:00
msaitoh
a23ec4c8a4 Check wheter an MII PHY is really connected or not.
This change privents panic if MII PHY port is not used.
2012-12-20 10:01:28 +00:00
msaitoh
af1c5c02a9 Add MVGBE_EVENT_COUNTERS for debugging. Count rxoverrrun and wdogsoft. 2012-11-09 09:04:19 +00:00
msaitoh
04c8bb64f2 Fix a bug that MVGBE_JLEN is miscalculated. 2012-11-08 15:39:29 +00:00
msaitoh
c9fb3a9800 When an interrput is link change, notify link change to mii layer using
mii_pollstat().
2012-11-08 14:37:47 +00:00
msaitoh
4d1a9736e4 Don't use M_HASFCS flag. 2012-11-08 14:32:01 +00:00
msaitoh
5c86b9383c No functional change.
- Change style a bit.
- use "csc" for the variable name of struct mvgbec_softc in mvgbec_attach()
  for consistency.
2012-11-01 02:46:41 +00:00
chs
cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
msaitoh
68c182ec5d Add missing mii_tick() call. 2012-10-26 21:03:26 +00:00
msaitoh
e8d66652c1 Fix a bug that kernel panics when the system get a packet while calling
mvgbe_stop (via ifconfig down).
2012-10-17 18:12:59 +00:00
msaitoh
1bf68f95d9 Add code to modify interrupt coalescing with sysctl.
- both TX side an RX side.
 - different setting for each port
 - TX side is hw.mvgbe.mvgbe*.ipginttx
 - RX side is hw.mvgbe.mvgbe*.ipgintrx
 - The default value is 768.
 - The lowest value is 0
 - For highest value, 0x3777 is used for V1, and 0xffff is used for V2.
2012-10-16 19:49:41 +00:00
msaitoh
3f974a9659 Add Interrupt Coalescing setting by Robert Swindells. 2012-10-14 19:17:08 +00:00
msaitoh
cfbd580d96 - The MVGBE_RX_MAX_FRAME_LEN_ERROR bit is used to check whether a packet
is fragmented or not, so define new MVGBE_RX_IP_FRAGMENT with the same
  value and use it.
- Remove the checking whether a packet length is lower than 72 octet.
  This check is not used in Linux and FreeBSD. Tested with me (for Kirkwood)
  and Kiyohara (for DiscoveryII).
2012-10-12 10:38:06 +00:00
msaitoh
05a67a38f2 Fix udpcsum-rx bug on fragmented case this time.
- Fix the usage of a local variable for csum_flags.
  - It seemd that sometimes MVGBE_RX_L4_CHECKSUM_OK bit were set to 0
    even if the checksum is correct and the packet was not fragmented.
    So we don't set M_CSUM_TCP_UDP_BAD even if csum bit is 0.
2012-10-04 14:21:00 +00:00
msaitoh
ca34255e60 - Fix a bug that a fragmented packet is marked as bad checksum. It causes
a real bug when HW checksum offload function is used. It was easy to
  reproduce with NFS UDP mount.
- Fix a potential bug that a packet other than TCP and UDP is marked as bad
  checksum.
2012-10-02 15:22:46 +00:00
msaitoh
ba5d11d6ea Fix device timeout problem.
- Change the synching order of descriptors. First, sync descriptors except
  first and then sync the first descriptor.
- To recover from an race condition, reduce the if_timer from 5 to 1 and
  when timeout occur write MVGBE_TQC_ENQ bit again.
2012-09-21 00:26:15 +00:00
msaitoh
d74909fbf4 Add "static". 2012-09-10 13:36:40 +00:00
matt
a8140c3a49 Fix pci_conf_hook/interrupt for ARM. 2012-09-07 04:25:36 +00:00
msaitoh
8d4dcb44cb Add missing bus_dmamap_sync() for the RX buffer. 2012-09-06 03:45:02 +00:00
kiyohara
068a6eb9af Add Marvell CESA(Cryptographic Engines and Security Accelerator) module driver.
But support only PIO-mode now.  Also AES-CBC not supported.
 Don't know how to process to AES CBC in PIO-mode. I haven't found IV registers.
2012-07-27 03:00:01 +00:00
kiyohara
52b45b8c4d Support Kirkwoods. Kirkwoods has 4ch for XORE and not has IDMAC. tested on OpenBlockS A6 with ch0 only. 2012-07-23 06:09:47 +00:00
matt
0bc3200029 Fix mii_statchg to take a 'struct ifnet *' instead of device_t. This fixes
problem with a common MDIO bus used for multiple interfaces.
Some drivers converted to CFATTACL_DECL_NEW.
2012-07-22 14:32:49 +00:00
kiyohara
22a31fe368 TWSI size is 0x100. Not 0x1000. 2012-07-21 04:23:16 +00:00
kiyohara
7ae4f9e50f Don't send a stop bit immediately after start bit transmission. 2012-07-21 04:21:14 +00:00
kiyohara
c2250163ce Add 88F6282. tested only OpenBlockS A6.
Also fix irq 11 to 15.  irq of 2nd NIC is 15.
Remove white-space.
2012-07-18 09:21:37 +00:00
kiyohara
1a7ac6e40d Add 88F6282. tested only OpenBlockS A6. 2012-07-18 09:18:30 +00:00
kiyohara
ea897a5d7b Add 88f6282. 2012-07-12 09:39:53 +00:00
tls
7b0b7dedd9 Entropy-pool implementation move and cleanup.
1) Move core entropy-pool code and source/sink/sample management code
   to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
   source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
   avoid expensive operations on disabled entropy sources; make the
   rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
   have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
   system events, and skew between clocks, with a sample implementation
   for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files).  Tested with release
builds on amd64 and evbarm and live testing on amd64.
2012-02-02 19:42:57 +00:00
matt
4b50cb788d Use proper ANSI prototypes for foo() -> foo(void)
Caught when compiling with -Wold-style-definition
2012-01-30 23:31:27 +00:00
para
89c9828deb converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged
2012-01-27 18:52:47 +00:00
tls
3afd44cf08 First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>.  This change includes
the following:

	An initial cleanup and minor reorganization of the entropy pool
	code in sys/dev/rnd.c and sys/dev/rndpool.c.  Several bugs are
	fixed.  Some effort is made to accumulate entropy more quickly at
	boot time.

	A generic interface, "rndsink", is added, for stream generators to
	request that they be re-keyed with good quality entropy from the pool
	as soon as it is available.

	The arc4random()/arc4randbytes() implementation in libkern is
	adjusted to use the rndsink interface for rekeying, which helps
	address the problem of low-quality keys at boot time.

	An implementation of the FIPS 140-2 statistical tests for random
	number generator quality is provided (libkern/rngtest.c).  This
	is based on Greg Rose's implementation from Qualcomm.

	A new random stream generator, nist_ctr_drbg, is provided.  It is
	based on an implementation of the NIST SP800-90 CTR_DRBG by
	Henric Jungheim.  This generator users AES in a modified counter
	mode to generate a backtracking-resistant random stream.

	An abstraction layer, "cprng", is provided for in-kernel consumers
	of randomness.  The arc4random/arc4randbytes API is deprecated for
	in-kernel use.  It is replaced by "cprng_strong".  The current
	cprng_fast implementation wraps the existing arc4random
	implementation.  The current cprng_strong implementation wraps the
	new CTR_DRBG implementation.  Both interfaces are rekeyed from
	the entropy pool automatically at intervals justifiable from best
	current cryptographic practice.

	In some quick tests, cprng_fast() is about the same speed as
	the old arc4randbytes(), and cprng_strong() is about 20% faster
	than rnd_extract_data().  Performance is expected to improve.

	The AES code in src/crypto/rijndael is no longer an optional
	kernel component, as it is required by cprng_strong, which is
	not an optional kernel component.

	The entropy pool output is subjected to the rngtest tests at
	startup time; if it fails, the system will reboot.  There is
	approximately a 3/10000 chance of a false positive from these
	tests.  Entropy pool _input_ from hardware random numbers is
	subjected to the rngtest tests at attach time, as well as the
	FIPS continuous-output test, to detect bad or stuck hardware
	RNGs; if any are detected, they are detached, but the system
	continues to run.

	A problem with rndctl(8) is fixed -- datastructures with
	pointers in arrays are no longer passed to userspace (this
	was not a security problem, but rather a major issue for
	compat32).  A new kernel will require a new rndctl.

	The sysctl kern.arandom() and kern.urandom() nodes are hooked
	up to the new generators, but the /dev/*random pseudodevices
	are not, yet.

	Manual pages for the new kernel interfaces are forthcoming.
2011-11-19 22:51:18 +00:00
jakllsch
dc0fd6acd4 Add workaround for infrequently encountered DMA engine limitation. 2011-11-19 17:01:38 +00:00
rjs
2f0663d472 Only zero MVGBE_MTU on Orion platforms. 2011-09-06 19:38:23 +00:00
jakllsch
883c2687f6 We occasionally will try to set up the multicast filter in a context that
kmem(9) is unusable (such as transmit timeout). Thus, put the filter table
on the stack instead, all 528 bytes of it.
2011-09-01 14:46:23 +00:00
jakllsch
74623c9c5f Initialize MVGBE_MTU to 0, as suggested by the Orion databook.
If the platform firmware did not initialize this to 0 for us,
we were unable to transmit frames.
2011-09-01 14:39:03 +00:00
rjs
b891527cb7 Use new style BPF calls. 2011-07-30 19:06:57 +00:00
matt
02e9f71ae1 Use cfdata_t 2011-07-28 15:36:47 +00:00
dyoung
a6b2b8396b PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name.  Correct that.

Rename PCI_FLAGS_IO_ENABLED to PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_ENABLED to PCI_FLAGS_MEM_OKAY, thus making their names
consistent with the other PCI flags and poisoning 3rd-party driver
sources that use the flags in the old bad way.

This patch produces no binary changes in this set of PCI kernels when
they are compiled w/o 'options DIAGNOSTIC' and w/ -V MKREPRO=yes:

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
2011-05-17 17:34:47 +00:00
rmind
2626d57668 Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency.  Remove some unnecessary malloc.h inclusions as well.
2011-04-24 16:26:51 +00:00
dyoung
d3e53912d2 Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args.  Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
    pci_intr_map() was a leftover from Xen 2.  Probably a bug.  I
    stopped writing it.  I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
    Probably a bug.  I use a temporary variable.  I have not tested this
    change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
    Probably a bug.  Use a local pci_attach_args.  I have not tested
    this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
    caller's pci_attach_args.  Probably a bug.  Make a local copy of the
    caller's pci_attach_args and modify the copy.  I have not tested
    this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
	HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
	KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
	TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
	OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
2011-04-04 20:37:49 +00:00
christos
97ea5c269b fix typo, and use the parent to determine the offset. From Dave Mills 2011-03-07 13:58:32 +00:00