diff options
author | Luka Perkov <luka@openwrt.org> | 2013-10-02 00:33:47 +0000 |
---|---|---|
committer | Luka Perkov <luka@openwrt.org> | 2013-10-02 00:33:47 +0000 |
commit | 0331657a4f65aef4fb28eb0e537b5d227cc2eb4f (patch) | |
tree | 10ddb2ae149d2400da98f2b48027da097e9b72bc /target/linux/kirkwood/patches-3.10/0022-net-mv643xx_eth-proper-initialization-for-Kirkwood-S.patch | |
parent | 7d1e5ae918ad606b6990d700368f4fe18c845773 (diff) | |
download | upstream-0331657a4f65aef4fb28eb0e537b5d227cc2eb4f.tar.gz upstream-0331657a4f65aef4fb28eb0e537b5d227cc2eb4f.tar.bz2 upstream-0331657a4f65aef4fb28eb0e537b5d227cc2eb4f.zip |
kirkwood: add linux 3.10 support
Backport appropriate patches to allow using device tree only board
defintions.
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
SVN-Revision: 38280
Diffstat (limited to 'target/linux/kirkwood/patches-3.10/0022-net-mv643xx_eth-proper-initialization-for-Kirkwood-S.patch')
-rw-r--r-- | target/linux/kirkwood/patches-3.10/0022-net-mv643xx_eth-proper-initialization-for-Kirkwood-S.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/target/linux/kirkwood/patches-3.10/0022-net-mv643xx_eth-proper-initialization-for-Kirkwood-S.patch b/target/linux/kirkwood/patches-3.10/0022-net-mv643xx_eth-proper-initialization-for-Kirkwood-S.patch new file mode 100644 index 0000000000..b83120bb65 --- /dev/null +++ b/target/linux/kirkwood/patches-3.10/0022-net-mv643xx_eth-proper-initialization-for-Kirkwood-S.patch @@ -0,0 +1,54 @@ +From 3b0f26629fef1b55a71031b4ef4db27d0a66a0be Mon Sep 17 00:00:00 2001 +From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> +Date: Wed, 29 May 2013 21:32:47 +0200 +Subject: [PATCH 22/29] net: mv643xx_eth: proper initialization for Kirkwood + SoCs + +Ethernet controllers found on Kirkwood SoCs not only suffer from loosing +MAC address register contents on clock gating but also some important +registers are reset to values that would break ethernet. This patch +clears the CLK125_BYPASS_EN bit for DT enabled Kirkwood only by using +of_device_is_compatible() instead of #ifdefs. Non-DT Kirkwood is not +affected as it installs a clock gating workaround because of the MAC +address issue above. Other Orion SoCs do not suffer from register reset, +do not have the bit in question, or do not have the register at all. +Moreover, system controllers on PPC using this driver should also be +protected from clearing that bit. + +Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> +--- + drivers/net/ethernet/marvell/mv643xx_eth.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c +index 946033b..af6bdcc 100644 +--- a/drivers/net/ethernet/marvell/mv643xx_eth.c ++++ b/drivers/net/ethernet/marvell/mv643xx_eth.c +@@ -116,6 +116,8 @@ static char mv643xx_eth_driver_version[] = "1.4"; + #define LINK_UP 0x00000002 + #define TXQ_COMMAND 0x0048 + #define TXQ_FIX_PRIO_CONF 0x004c ++#define PORT_SERIAL_CONTROL1 0x004c ++#define CLK125_BYPASS_EN 0x00000010 + #define TX_BW_RATE 0x0050 + #define TX_BW_MTU 0x0058 + #define TX_BW_BURST 0x005c +@@ -2701,6 +2703,15 @@ static int mv643xx_eth_probe(struct platform_device *pdev) + + mp->dev = dev; + ++ /* Kirkwood resets some registers on gated clocks. Especially ++ * CLK125_BYPASS_EN must be cleared but is not available on ++ * all other SoCs/System Controllers using this driver. ++ */ ++ if (of_device_is_compatible(pdev->dev.of_node, ++ "marvell,kirkwood-eth-port")) ++ wrlp(mp, PORT_SERIAL_CONTROL1, ++ rdlp(mp, PORT_SERIAL_CONTROL1) & ~CLK125_BYPASS_EN); ++ + /* + * Start with a default rate, and if there is a clock, allow + * it to override the default. +-- +1.8.4.rc1 + |