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