From: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
To: netdev@vger.kernel.org
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Subject: [patch 2/2] Try to fix mvneta when compiled as module
Date: Fri, 21 Jun 2013 00:06:46 +0200 [thread overview]
Message-ID: <20130620221008.551534830@rtp-net.org> (raw)
In-Reply-To: 20130620220644.715387300@rtp-net.org
[-- Attachment #1: mvneta-init-fix.patch --]
[-- Type: text/plain, Size: 1570 bytes --]
When the mvneta driver is compiled as module, the clock is disabled before
it's loading. This will reset the registers values and all configuration
made by the bootloader.
This patch sets the "sgmii serdes configuration" register to a magical value
found in:
https://github.com/yellowback/ubuntu-precise-armadaxp/blob/master/arch/arm/mach-armadaxp/armada_xp_family/ctrlEnv/mvCtrlEnvLib.c
With this change, the interrupts are working/generated and ethernet is
working.
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Index: linux-next/drivers/net/ethernet/marvell/mvneta.c
===================================================================
--- linux-next.orig/drivers/net/ethernet/marvell/mvneta.c 2013-06-20 23:39:37.485391949 +0200
+++ linux-next/drivers/net/ethernet/marvell/mvneta.c 2013-06-20 23:39:37.481391949 +0200
@@ -88,6 +88,8 @@
#define MVNETA_TX_IN_PRGRS BIT(1)
#define MVNETA_TX_FIFO_EMPTY BIT(8)
#define MVNETA_RX_MIN_FRAME_SIZE 0x247c
+#define MVETH_SGMII_SERDES_CFG 0x24A0
+#define MVETH_SGMII_SERDES_STAT 0x24A4
#define MVNETA_TYPE_PRIO 0x24bc
#define MVNETA_FORCE_UNI BIT(21)
#define MVNETA_TXQ_CMD_1 0x24e4
@@ -655,6 +657,7 @@ static void mvneta_port_sgmii_config(str
val = mvreg_read(pp, MVNETA_GMAC_CTRL_2);
val |= MVNETA_GMAC2_PSC_ENABLE;
mvreg_write(pp, MVNETA_GMAC_CTRL_2, val);
+ mvreg_write(pp, MVETH_SGMII_SERDES_CFG, 0xcc7);
}
/* Start the Ethernet port RX and TX activity */
next prev parent reply other threads:[~2013-06-22 20:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 22:06 [patch 0/2] Fix system hang when loading mvneta module Arnaud Patard
2013-06-20 22:06 ` [patch 1/2] Fix hang when loading the mvneta driver Arnaud Patard
2013-06-20 22:06 ` Arnaud Patard [this message]
2013-06-23 8:06 ` [patch 2/2] Try to fix mvneta when compiled as module Thomas Petazzoni
2013-06-24 7:43 ` Arnaud Patard
2013-07-15 14:34 ` [patch 0/2] Fix system hang when loading mvneta module Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130620221008.551534830@rtp-net.org \
--to=arnaud.patard@rtp-net.org \
--cc=netdev@vger.kernel.org \
--cc=thomas.petazzoni@free-electrons.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).