[kernel] fix mini_fo on 2.6.26-rc4
[openwrt.git] / target / linux / ixp4xx / patches-2.6.24 / 204-npe_driver_ixp43x_support.patch
1 Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/ixp4xx_npe.c
2 ===================================================================
3 --- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/ixp4xx_npe.c
4 +++ linux-2.6.24.7/arch/arm/mach-ixp4xx/ixp4xx_npe.c
5 @@ -571,8 +571,8 @@ int npe_load_firmware(struct npe *npe, c
6 for (i = 0; i < image->size; i++)
7 image->data[i] = swab32(image->data[i]);
8
9 - if (!cpu_is_ixp46x() && ((image->id >> 28) & 0xF /* device ID */)) {
10 - print_npe(KERN_INFO, npe, "IXP46x firmware ignored on "
11 + if (cpu_is_ixp42x() && ((image->id >> 28) & 0xF /* device ID */)) {
12 + print_npe(KERN_INFO, npe, "IXP46x/IXP43x firmware ignored on "
13 "IXP42x\n");
14 goto err;
15 }
16 @@ -594,7 +594,7 @@ int npe_load_firmware(struct npe *npe, c
17 "revision 0x%X:%X\n", (image->id >> 16) & 0xFF,
18 (image->id >> 8) & 0xFF, image->id & 0xFF);
19
20 - if (!cpu_is_ixp46x()) {
21 + if (cpu_is_ixp42x()) {
22 if (!npe->id)
23 instr_size = NPE_A_42X_INSTR_SIZE;
24 else
25 Index: linux-2.6.24.7/drivers/net/arm/ixp4xx_eth.c
26 ===================================================================
27 --- linux-2.6.24.7.orig/drivers/net/arm/ixp4xx_eth.c
28 +++ linux-2.6.24.7/drivers/net/arm/ixp4xx_eth.c
29 @@ -32,6 +32,7 @@
30 #include <linux/kernel.h>
31 #include <linux/mii.h>
32 #include <linux/platform_device.h>
33 +#include <asm/arch/cpu.h>
34 #include <asm/arch/npe.h>
35 #include <asm/arch/qmgr.h>
36
37 @@ -1335,12 +1336,16 @@ static struct platform_driver drv = {
38
39 static int __init eth_init_module(void)
40 {
41 - if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEB_ETH0))
42 - return -ENOSYS;
43
44 - /* All MII PHY accesses use NPE-B Ethernet registers */
45 spin_lock_init(&mdio_lock);
46 - mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT;
47 + if (!cpu_is_ixp43x())
48 + /* All MII PHY accesses use NPE-B Ethernet registers */
49 + mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT;
50 +
51 + else
52 + /* IXP43x lacks NPE-B and uses NPE-C for MII PHY access */
53 + mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthC_BASE_VIRT;
54 +
55 __raw_writel(DEFAULT_CORE_CNTRL, &mdio_regs->core_control);
56
57 return platform_driver_register(&drv);
58 Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/cpu.h
59 ===================================================================
60 --- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/cpu.h
61 +++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/cpu.h
62 @@ -34,6 +34,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 Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
72 ===================================================================
73 --- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
74 +++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
75 @@ -628,11 +628,12 @@
76 #define IXP4XX_FEATURE_XSCALE_MAX_FREQ (3 << 22)
77 #define IXP4XX_FEATURE_RESERVED (0xFF << 24)
78
79 -#define IXP4XX_FEATURE_IXP46X_ONLY (IXP4XX_FEATURE_ECC_TIMESYNC | \
80 +#define IXP4XX_FEATURE_IXP43X_46X (IXP4XX_FEATURE_ECC_TIMESYNC | \
81 IXP4XX_FEATURE_USB_HOST | \
82 IXP4XX_FEATURE_NPEA_ETH | \
83 - IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \
84 - IXP4XX_FEATURE_RSA | \
85 IXP4XX_FEATURE_XSCALE_MAX_FREQ)
86
87 +#define IXP4XX_FEATURE_IXP46X_ONLY (IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \
88 + IXP4XX_FEATURE_RSA)
89 +
90 #endif
This page took 0.048326 seconds and 5 git commands to generate.