Commit Graph

147 Commits (e890a3bc9a2bc8713be6719796724c4e24ecdfb9)

Author SHA1 Message Date
Felix Fietkau e890a3bc9a ramips: make ethernet register map u16 instead of u32
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44940
9 years ago
Felix Fietkau 37912d66c2 ramips: increase NAPI weight for mt7621 to improve routing performance a bit more
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44918
9 years ago
John Crispin c7229b96b7 ralink: support change tx/rx ring size
Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 44741
9 years ago
John Crispin 2c94eef5df ralink: use random generate mac address instead of default one.
Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 44740
9 years ago
John Crispin 0f4431758b ralink: fix when tx done is 0 also need to clean interrupt status
Signed-off-by: michael lee <igvtee@gmail.com>
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 44401
9 years ago
John Crispin 07352ca2c7 ralink: fix hw status almost full not work on mt7620 and mt7621
the old FE_INT_STATUS register becomes two registers.
FE_INT_STATUS and INT_STATUS. so the hw status almost full
must change to read from FE_INT_STATUS register.
tx/rx done read from INT_STATUS register.

mt7620 datasheet define CNT_GDM1_AF at BIT(29).
but after test it should be BIT(13). why?

Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 44371
9 years ago
John Crispin 654bc380ec ralink: add 3.18 support
keep default as 3.14, mt7621 gic need to be ported to 3.18

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 44349
9 years ago
Felix Fietkau 10c8d8c483 ramips: fix ethernet driver tx completion polling
- budget is decremented with completed frames, so don't check if done is
smaller
- ACK the interrupt before processing further frames to fix a small race
condition.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44234
10 years ago
John Crispin c56cf3edc7 ralink: check ethernet MAC address whether it is valid
The mac address usually write in factory block. but sometime user erase this block , the mac address will change to ff:ff:ff:ff:ff:ff.
This patch is purpose to fix this issue.

Signed-off-by: wengbj <linux.c@foxmail.com>

SVN-Revision: 44166
10 years ago
Felix Fietkau bef829efa5 ralink: fix ethernet feature TSO not work
* fix TSO features verify on mt7621 firewrt board
* improve tx clean up. no need to access uncached
  memory. also use TX_DTX register instead of
  read tx ring DONE bit
* mt7621 need napi weight 64 to get more performance
* remove netif_receive_skb, after kernel version
  3.7 tcp4_gro_receive can handle tcp checksum.
  on rt2880 use iperf tcp LAN to WAN throughput test.
  with gro 135 Mbits/sec. without gro 80.4Mbits/sec.

Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 44118
10 years ago
Felix Fietkau 3ec294a825 ralink: init tx/rx vlan offload register for mt7621
on mt7621 don't have tx vlan vid registers.
so set FE_REG_FE_DMA_VID_BASE to 0.
set rx vlan offload register to disable.

Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 44117
10 years ago
Felix Fietkau e634e07893 ralink: use fe_max_buf_size to get rx buffer size
the rx_buf_size now is 1534 when mtu is 1500.
the ethernet frame with vlan tag and FCS is 1522.
so the buffer is enough.

Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 44116
10 years ago
Felix Fietkau 5d4837706a ramips: fix ethernet vlan tx offload support check
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44115
10 years ago
Felix Fietkau 9e7cc83edc ralink: fix ethernet rx buffer size breakage
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44047
10 years ago
Felix Fietkau a4460ca5a7 ralink: improve check rx sg function. use check frags instead of function call
Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 44046
10 years ago
Felix Fietkau b3ca42ec8f ralink: correct handle hardware rx 2bytes offset
Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 44045
10 years ago
Felix Fietkau 03ea0cf6f1 ralink: use fe_reset to control all reset
Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 44044
10 years ago
Felix Fietkau 50588ef192 ralink: improve tx_timeout function
* use default timeout value
* print more debug ring info
* move timeout reset function to workqueue

Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 44043
10 years ago
Felix Fietkau a5b578c2d9 ralink: reduce access to uncached tx/rx dma ring buffer
Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 44041
10 years ago
Felix Fietkau 00db07be58 ramips: fix tx bql related race condition in the ethernet driver
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43995
10 years ago
Felix Fietkau acfc6c153b ramips: use a larger number of rx descriptors on mt7621 to work around rx overrun related packet loss
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43953
10 years ago
Felix Fietkau 05d4b8c79b ramips: remove interrupt coalescing, it is unnecessary with napi polling and could reduce throughput
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43952
10 years ago
Felix Fietkau 10c2bdbc4f ramips: disable ethernet checksum offloads for mt7621, they are broken
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43811
10 years ago
Felix Fietkau 51b1f0ca5c ramips: use netif_receive_skb instead of napi_gro_receive when rx csum offload is unavailable
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43810
10 years ago
John Crispin e1f6d0dd0a ralink: fix tx vlan offload and hardware status
hardware status and tx vlan offload support on all targets
except rt5350. so i modify the IS_ENABLE condition only for
mt7621.
support mt7621 hardware status reference by SDK. but i don't
have mt7621. if not work just set mt7621 FE_REG_FE_COUNTER_BASE
to 0 to let software count.

Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 43303
10 years ago
John Crispin a5f562993e ralink: support netconsole
Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 43302
10 years ago
John Crispin 9c5dfd9546 ralink: improve tx vlan offload
hardware tx vlan offload only support max 16 vids
now use add/delete vlan interface to update vlan id table
when duplicate vlan id index detect.
disable hardware tx vlan offload support.

Signed-off-by: michael lee <igvtee@gmail.com>

SVN-Revision: 43301
10 years ago
John Crispin caa29dea2c ralink: update ethernet driver to use new ralink_soc variable
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43247
10 years ago
John Crispin bf8bb5b611 ralink: fix the 10mbit bug on mt7621
a missing "val =" caused the AN bit in the phy0 reg to be flushed.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43246
10 years ago
John Crispin 194ca6127e ralink: improve mt7530 support
the SDK does a bit of extra init that we did not do yet when using an external mt7530.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43245
10 years ago
John Crispin 062828aee0 ralink: mt7621 has a different base addr for PVID
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43243
10 years ago
John Crispin 86e3315ece ralink: add support for mt7621 ethernet
somehow all switch ports still come up as 10mbit.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43237
10 years ago
John Crispin e399931376 ralink: fix mdio polling of external phys if only 1 phy exists
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43235
10 years ago
John Crispin 9007e2244f ralink: mt7628 does not actually need this fix for the ethernet driver
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43206
10 years ago
John Crispin c32ad22e40 ralink: improve r43200
r43200 tries to detect if the fixup is needed or not. control the behaviour via
OF instead and disable unused ports.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43201
10 years ago
John Crispin 0cc0ba2b3a ralink: only apply ephy1 fixup if the phy is present
this broke e1700 lan2 as the fixup was applied to the phy inside the mt7530.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43200
10 years ago
John Crispin f8404aaf9e ralink: add mt7628 support to the ethernet driver
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43196
10 years ago
John Crispin 26504289df ralink: cleanup ethernet Makefile/Kconfig
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43195
10 years ago
John Crispin d524fe46fd ralink: move ethernet driver to files/
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43194
10 years ago
John Crispin d4db00205d move files to files-3.7
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36161
11 years ago
John Crispin 756a7c5451 fix for non-blinking LAN LEDs
https://dev.openwrt.org/ticket/12830

SVN-Revision: 35359
12 years ago
Gabor Juhos 57b7879a4e ramips: ramips_eth: use Kconfig definition to enable debug
The Kconfig identifier to enable debugging in the driver was different from the
actually used one. Fix that.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 34332
12 years ago
John Crispin ced0cf3a94 move ethernet hw init to init/uninit functions
This should fix the stalled irq problem seen by several people.
This is not the real fix, but rather moves the bug to the un/init patch of the driver.
The real bug still needs to be fixed, but this workaround should be suffcient to make
the ethernet stable.

SVN-Revision: 34177
12 years ago
John Crispin 34d57ebd8b add ethernet support for rt5350
SVN-Revision: 33548
12 years ago
John Crispin af0cd76937 make ramips ethernet use a register mapping table
SVN-Revision: 33547
12 years ago
Gabor Juhos d8b2fef763 ramips: Add missing andmask to ramips_esw register read for recv_good value.
Add missing andmask to ramips_esw register read for recv_good value.

Without the mask, recv_bad leaks into the recv_good packet count.
Didn't notice the bug before since you don't usually get bad
packets, so I only saw it when I was playing with overlength packets
earlier...

Signed-off-by: Tobias Diedrich <ranma+openwrt@tdiedrich.de>

SVN-Revision: 33322
12 years ago
Gabor Juhos 04c6143ca9 ramips: Use doubletagging to disable ramips_esw vlan by default, it seems more reliable.
Use doubletagging to disable ramips_esw vlan by default, it seems
more reliable.

Daniel Golle found an issue where sometimes (possibly only for
RT3352) the default vlan disable method (clearing en_vlan, untag,
doubletag and putting all ports into vlan 0) doesn't work and the
packets get sent out vlan-tagged with vlan 0.

Instead switch to using the doubletagging method (allow doubletagged
packets, put all ports into vlan 0 with untag enabled) by default.

Unless someone figures out a way to really globally disable vlan for
this switch, this seems like the best (most reliable) option.

I did some tests regarding maximum packet size and did not see any

difference between the two methods, both allow for slightly bigger packets
than the ramips_main.c ethernet driver (ping stops going through
above "ping -s 1472" (1514 bytes), on the switch packets are recv_good until
"ping -s 1490", or about 1532 bytes).

Signed-off-by: Tobias Diedrich <ranma+openwrt@tdiedrich.de>

SVN-Revision: 33321
12 years ago
Gabor Juhos bc4763a399 ramips: Power down phy on disabled switch ports
Power down phy on disabled switch ports.

Haven't measured this myself yet, but according to this
http://www.8devices.com/community/viewtopic.php?f=6&t=156
it can save about 300mW of power.

[juhosg: fix checkpatch warning]

Signed-off-by: Tobias Diedrich <ranma+openwrt@tdiedrich.de>

SVN-Revision: 33304
12 years ago
Gabor Juhos bb0785880a ramips: Rename POC registers
Rename POC registers.

The current code uses POC1-POC3.

The datasheet uses:
POC1: Port Control 0
POC1: Port Control 1
POC2: Port Control 2

So the first POC1 is a typo that should have been POC0, rename the
registers to POC0-POC2 accordingly.

Signed-off-by: Tobias Diedrich <ranma+openwrt@tdiedrich.de>

SVN-Revision: 33302
12 years ago
Gabor Juhos f1b9d77912 ramips: Minor ramips_esw.c cleanup
Stop handling VLAN setup in the kernel.
Removes the obsolete RT305X_ESW_VLAN_CONFIG_BYPASS option I added for
WL-351 and add some extra comments.
Also removes the en_vlan per-port flag that isn't very useful really, it now
is only controlled by the global enable_vlan flag.

Signed-off-by: Tobias Diedrich <ranma+openwrt@tdiedrich.de>

SVN-Revision: 33301
12 years ago