Commit Graph

275 Commits

Author SHA1 Message Date
christos 127c64cbda use PR_NOWAIT instead of 0 2017-11-09 22:22:58 +00:00
chs fd34ea77eb remove checks for failure after memory allocation calls that cannot fail:
kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
2017-06-01 02:45:05 +00:00
msaitoh eabd5e1de9 Remove extra 0x. This bug was added when replacing bitmask_snprintf(9) with
snprintb(3) (in between NetBSD 5 and 6). Old bitmask_snprint(9) didn't add
0x" automatically for hexadecimal value, so old code used it with "0x%s".
2017-03-31 08:38:13 +00:00
jakllsch c634706878 Add check during mvsdio_attach that CMD line is in idle state.
If the CMD line is not in idle state, the interrupt handler routine will
misbehave causing an endless interrupt handler loop.  This would prevent
the the kernel from getting to mountroot.

On my Pogoplug POGO-V4-A3-01, this was caused by U-Boot routing com1's TX
and RX signals to the SD card slot's CMD and DAT[0] lines respectively.

We should probably grow Marvell SoC MPP (pinmux) configuration frobs.
2017-03-03 16:52:08 +00:00
kiyohara 258d35a1f0 Add ATTR_AXI_DDR. 2017-01-09 14:06:35 +00:00
kiyohara 463bc92121 Support Marvell Dove. Use irq array. Dove's irqs not sequencial.
And remove debug printf().
2017-01-07 14:44:26 +00:00
kiyohara 8f245e3b7f Remove unused function. 2017-01-07 14:36:51 +00:00
kiyohara f342ff86d4 Fix macro MVXORE_CHAN2BASE(). The XORE has 2 channels per port. 2017-01-07 14:32:32 +00:00
kiyohara e51c7e73b4 Add tags for AXI_CS[01]. 2017-01-07 14:26:37 +00:00
kiyohara ba749f27a4 Support Marvell Dove. 2017-01-07 14:24:27 +00:00
kiyohara 89ea2da7c5 Change MVSPI_SIZE to 0x80 instead of 0x50. 2017-01-07 14:19:45 +00:00
ozaki-r dd8638eea5 Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input
The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
  - Where/When if_ipackets is counted up
  - Note that some drivers still update packet statistics in their own
    way (periodical update)
- Moved bpf_mtap run in softint
  - This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
2016-12-15 09:28:02 +00:00
ozaki-r c0e7885f20 Apply deferred if_start framework
if_schedule_deferred_start checks if the if_snd queue contains packets,
so drivers don't need to check it by themselves.
2016-12-08 01:12:00 +00:00
skrll d3e93ac2c2 Fix regisers typo 2016-10-20 09:53:07 +00:00
kiyohara 4964aa11de The bus_dmamap_sync(PREREAD) is unnecessary for sent mbuf.
Moreover bus_dmamap_sync(POSTWRITE), before unload.
2016-10-10 14:23:35 +00:00
christos 9015c01fa3 PR/51540: Henning Petersen: replace , with ; 2016-10-09 14:49:51 +00:00
kiyohara fa071fd5eb Add 88AP510. 2016-10-04 15:02:27 +00:00
ozaki-r d938d837b3 Introduce m_set_rcvif and m_reset_rcvif
The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
2016-06-10 13:27:10 +00:00
skrll 4e8e66439e Merge nick-nhusb
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
    - kern/48308
    - uhub status notification improvements
    - umass(4) probe fix (applied to HEAD already)
    - ohci(4) short transfer fix
2016-04-23 10:15:27 +00:00
jklos 7f15b0acd9 Add kernel configuration file for PogoPlug Pink, PogoPlug Mobile and
PogoPlug v4. Add conditional because PogoPlug v4 can't run SD interface at
50 MHz.
2016-03-12 00:41:30 +00:00
hikaru 03068386e3 Pass all unicast addresses if it is promisc mode. 2016-02-13 08:44:22 +00:00
hikaru e5a183c233 Make all packets are enqueued into queue 0.
queue 7 is not default, it is caused by the filter tables.
The fields are including queue number, not bitfields.
So MVXPE_DF_QUEUE_ALL (b111) means queue 7.

And also, pass all unicast addresses if it is promisc mode.
MVXPE_PXC_UPM is working in almost cases,
but this change is needed for some cases; bridging frames through inter units,
using products have consecutive MAC addresses.
2016-02-13 08:05:06 +00:00
hikaru cbb771782b Fix typo in sysctls. 2016-02-13 06:44:22 +00:00
hikaru 65e1200c74 Count up if_{opackets,oerrors,ierrors,collisions}.
And also "MAC Transmit Error" is tx error, not rx.
2016-02-13 06:33:21 +00:00
hikaru e48ad7e887 Style. 2016-02-13 06:12:46 +00:00
hikaru ea31d1a6f5 Preserve rx csum bad flags. 2016-02-13 06:02:31 +00:00
hikaru 3cb6f1bced Fix mitake, disable SERDES error interrupts again. 2016-02-13 05:47:38 +00:00
hikaru e26a9e7c97 Don't use RXTX intr that is excess and requires another IRQ handler,
and disable SERDES error interrupts.
2016-02-13 05:44:01 +00:00
hikaru d841c5696c Correct bus_dmamap_sync operaion. 2016-02-13 05:21:11 +00:00
hikaru 141ef376c5 Correct locks and missing breaks. 2016-02-13 03:33:02 +00:00
hikaru 16e5bed744 Fix the bitmask of MVXPE_PMACC0_FRAMESIZELIMIT. It did no harm. 2016-02-12 09:24:15 +00:00
kiyohara 5e7343a705 Add more #warning message 'Please use mvxpe instead of this'. 2016-02-09 12:53:17 +00:00
ozaki-r 9c4cd06355 Introduce softint-based if_input
This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
2016-02-09 08:32:07 +00:00
joerg 33ff1f692a Switch to generic __BIT/__BITS macro, which doesn't depend on
left-shifting negative values.
2016-01-15 12:09:15 +00:00
christos 5d545ea021 PR/50533: David Binderman: Fix incorrect logic 2015-12-13 18:35:26 +00:00
nonaka c7bca87e42 Use device name instead of fixed string "mvpex" for evcnt group. 2015-11-27 00:08:43 +00:00
msaitoh 605f564f52 PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
  if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
  Currently the following extended capabilities are decoded:
   - Advanced Error Reporting
   - Virtual Channel
   - Device Serial Number
   - Power Budgeting
   - Root Complex Link Declaration
   - Root Complex Event Collector Association
   - Access Control Services
   - Alternative Routing-ID Interpretation
   - Address Translation Services
   - Single Root IO Virtualization
   - Page Request
   - TPH Requester
   - Latency Tolerance Reporting
   - Secondary PCI Express
   - Process Address Space ID
   - LN Requester
   - L1 PM Substates
  The following extended capabilities are not decoded yet:
   - Root Complex Internal Link Control
   - Multi-Function Virtual Channel
   - RCRB Header
   - Vendor Unique
   - Configuration Access Correction
   - Multiple Root IO Virtualization
   - Multicast
   - Resizable BAR
   - Dynamic Power Allocation
   - Protocol Multiplexing
   - Downstream Port Containment
   - Precision Time Management
   - M-PCIe
   - Function Reading Status Queueing
   - Readiness Time Reporting
   - Designated Vendor-Specific
2015-10-02 05:22:49 +00:00
kiyohara a2bdc95972 Fix calculate to address for window register.
Thanks knakahara@.
2015-08-08 14:35:06 +00:00
knakahara 158635859e fix: panic at doing "vmstat -ev" after a PCIe device detached. 2015-07-28 01:57:55 +00:00
kamil f874bd0561 Improve spelling: regsiter -> register
This change is non-functional.

Approved by <riastradh>, <pgoyette>
2015-07-11 10:32:45 +00:00
knakahara 1770f95f58 fix: pexih->ih_evcnt->ev_name pointed stack address wrongly. 2015-06-24 10:00:37 +00:00
hsuenaga 1a8031e111 add new cryptographic accelerator driver 'mvxpsec.'
this driver controls CESA unit as same as mvcesa, but uses DMA engines and
does CBC operations, HMAC operations by hardware. about 2 kbytes of data
are processed at one. supported algorithms are:

 - DES-CBC, 3DES-CBC, AES-CBC
 - HMAC-SHA1, HMAC-MD5

non-CBC algorithm such as AES-GCM is not supported by CESA's acceleration
engine. mvcesa is still useful to implement such algorithms as combination of
accelerated block cipher and software chaining.
2015-06-03 04:20:02 +00:00
hsuenaga 149ad0c83b reduce magic numbers. SDRAM address space attribute register has cache coherency
control bits. this bit is important for AURORA_IO_CACHE_COHERENCY.
2015-06-03 04:00:06 +00:00
hsuenaga ea5bc4c33e separate buffer management codes 'mvxpbm.c' from if_mvxpe.c.
the buffer management(ex. fill the rx descriptors/buffers) is done by H/W in
ARMADA XP/380, and is done by S/W in ARMADA 370. the H/W BM support is not yet
implemented, so all devices use the S/W management mode at this time.
2015-06-03 03:55:47 +00:00
hsuenaga 9400e05df8 move Marvell ARMADA SoC's device driver definitions from arm/marvell
to dev/marvell.
2015-06-03 03:34:38 +00:00
hsuenaga 4e3bd6105a add new ethernet driver mvxpe for recent MARVELL's SoC after ARMADA/XP.
this driver supports 'counter mode', and is disabled by default.

ARMADA SoC family has new ethernet controller acceleration mode called
'enhanced mode' or 'counter mode.' it seems that backward compatibility mode
used by if_mvgbe is still working, but the specification of the old mode
is completely disappeared from SoC's reference manual.

I tested the driver using MIRABOX(ARMADA/370).
2015-05-03 14:38:09 +00:00
hsuenaga c3635de7de add u-boot argument parser for Marvell ARMADA XP/370.
use 'ethaddr' and 'eth1addr' in u-boot argument to setup MAC address of mvgbe.
2015-04-15 10:15:40 +00:00
riastradh 56d3242969 Include <sys/rndsource.h> where it is actually used.
I had removed <sys/rnd.h> from files that didn't mention anything of
the rnd(9) API.  But they included other files which assumed
<sys/rnd.h> had already been included.
2015-04-14 20:32:35 +00:00
riastradh 233f556c2e Convert sys/dev to use <sys/rndsource.h>. 2015-04-13 16:33:23 +00:00
joerg d40a88a875 sizeof doesn't evaluate the expression, so increment of rxd doesn't
happen. Move it out.
2015-01-11 22:59:57 +00:00