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