[ar7] revert part of r16112, the setup.c part needs more testing
[openwrt.git] / target / linux / ixp4xx / patches-2.6.29 / 202-npe_driver_ixp43x_support.patch
1 From cba5c286f3ea34ea4767fc00c705434a00fe2c37 Mon Sep 17 00:00:00 2001
2 From: Imre Kaloz <kaloz@openwrt.org>
3 Date: Thu, 26 Jun 2008 01:58:02 +0200
4 Subject: [PATCH] Add support for the ethernet ports on IXP43x
5
6 ---
7 arch/arm/mach-ixp4xx/ixp4xx_npe.c | 6 +++---
8 drivers/net/arm/ixp4xx_eth.c | 13 +++++++++----
9 include/asm-arm/arch-ixp4xx/cpu.h | 2 ++
10 include/asm-arm/arch-ixp4xx/ixp4xx-regs.h | 7 ++++---
11 4 files changed, 18 insertions(+), 10 deletions(-)
12
13 --- a/arch/arm/mach-ixp4xx/ixp4xx_npe.c
14 +++ b/arch/arm/mach-ixp4xx/ixp4xx_npe.c
15 @@ -575,8 +575,8 @@ int npe_load_firmware(struct npe *npe, c
16 for (i = 0; i < image->size; i++)
17 image->data[i] = swab32(image->data[i]);
18
19 - if (!cpu_is_ixp46x() && ((image->id >> 28) & 0xF /* device ID */)) {
20 - print_npe(KERN_INFO, npe, "IXP46x firmware ignored on "
21 + if (cpu_is_ixp42x() && ((image->id >> 28) & 0xF /* device ID */)) {
22 + print_npe(KERN_INFO, npe, "IXP46x/IXP43x firmware ignored on "
23 "IXP42x\n");
24 goto err;
25 }
26 @@ -598,7 +598,7 @@ int npe_load_firmware(struct npe *npe, c
27 "revision 0x%X:%X\n", (image->id >> 16) & 0xFF,
28 (image->id >> 8) & 0xFF, image->id & 0xFF);
29
30 - if (!cpu_is_ixp46x()) {
31 + if (cpu_is_ixp42x()) {
32 if (!npe->id)
33 instr_size = NPE_A_42X_INSTR_SIZE;
34 else
35 --- a/drivers/net/arm/ixp4xx_eth.c
36 +++ b/drivers/net/arm/ixp4xx_eth.c
37 @@ -32,6 +32,7 @@
38 #include <linux/kernel.h>
39 #include <linux/phy.h>
40 #include <linux/platform_device.h>
41 +#include <mach/cpu.h>
42 #include <mach/npe.h>
43 #include <mach/qmgr.h>
44
45 @@ -337,7 +338,13 @@ static int ixp4xx_mdio_register(void)
46
47 /* All MII PHY accesses use NPE-B Ethernet registers */
48 spin_lock_init(&mdio_lock);
49 - mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT;
50 + if (!cpu_is_ixp43x())
51 + /* All MII PHY accesses use NPE-B Ethernet registers */
52 + mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT;
53 + else
54 + /* IXP43x lacks NPE-B and uses NPE-C for MII PHY access */
55 + mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthC_BASE_VIRT;
56 +
57 __raw_writel(DEFAULT_CORE_CNTRL, &mdio_regs->core_control);
58
59 mdio_bus->name = "IXP4xx MII Bus";
60 --- a/arch/arm/mach-ixp4xx/include/mach/cpu.h
61 +++ b/arch/arm/mach-ixp4xx/include/mach/cpu.h
62 @@ -35,6 +35,8 @@ static inline u32 ixp4xx_read_feature_bi
63 val &= ~IXP4XX_FEATURE_RESERVED;
64 if (!cpu_is_ixp46x())
65 val &= ~IXP4XX_FEATURE_IXP46X_ONLY;
66 + if (cpu_is_ixp42x())
67 + val &= ~IXP4XX_FEATURE_IXP43X_46X;
68
69 return val;
70 }
71 --- a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
72 +++ b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
73 @@ -628,11 +628,12 @@
74 #define IXP4XX_FEATURE_XSCALE_MAX_FREQ (3 << 22)
75 #define IXP4XX_FEATURE_RESERVED (0xFF << 24)
76
77 -#define IXP4XX_FEATURE_IXP46X_ONLY (IXP4XX_FEATURE_ECC_TIMESYNC | \
78 +#define IXP4XX_FEATURE_IXP43X_46X (IXP4XX_FEATURE_ECC_TIMESYNC | \
79 IXP4XX_FEATURE_USB_HOST | \
80 IXP4XX_FEATURE_NPEA_ETH | \
81 - IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \
82 - IXP4XX_FEATURE_RSA | \
83 IXP4XX_FEATURE_XSCALE_MAX_FREQ)
84
85 +#define IXP4XX_FEATURE_IXP46X_ONLY (IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \
86 + IXP4XX_FEATURE_RSA)
87 +
88 #endif
This page took 0.045222 seconds and 5 git commands to generate.