fd1e486ba11f043382cdd537ea63afb1ee53f42e
[openwrt.git] / target / linux / kirkwood / patches / 200-iconnect.patch
1 --- a/arch/arm/mach-kirkwood/Makefile
2 +++ b/arch/arm/mach-kirkwood/Makefile
3 @@ -8,6 +8,7 @@
4  obj-$(CONFIG_MACH_DOCKSTAR)            += dockstar-setup.o
5  obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG)    += sheevaplug-setup.o
6  obj-$(CONFIG_MACH_GURUPLUG)            += guruplug-setup.o
7 +obj-$(CONFIG_MACH_ICONNECT)            += iconnect-setup.o
8  obj-$(CONFIG_MACH_TS219)               += ts219-setup.o tsx1x-common.o
9  obj-$(CONFIG_MACH_TS41X)               += ts41x-setup.o tsx1x-common.o
10  obj-$(CONFIG_MACH_OPENRD)              += openrd-setup.o
11 --- a/arch/arm/mach-kirkwood/Kconfig
12 +++ b/arch/arm/mach-kirkwood/Kconfig 
13 @@ -105,6 +105,12 @@
14           Say 'Y' here if you want your kernel to support the
15           Seagate FreeAgent DockStar.
16  
17 +config MACH_ICONNECT
18 +       bool "Iomega iConnect Wireless"
19 +       help
20 +         Say 'Y' here if you want your kernel to support the
21 +         Iomega iConnect Wireless.
22 +
23  endmenu
24  
25  endif
26 --- /dev/null 
27 +++ b/arch/arm/mach-kirkwood/iconnect-setup.c 
28 @@ -0,0 +1,95 @@
29 +/*
30 + * arch/arm/mach-kirkwood/iconnect-setup.c
31 + *
32 + * Iomega iConnect Wireless
33 + *
34 + * This file is licensed under the terms of the GNU General Public
35 + * License version 2.  This program is licensed "as is" without any
36 + * warranty of any kind, whether express or implied.
37 + */
38 +
39 +#include <linux/kernel.h>
40 +#include <linux/init.h>
41 +#include <linux/platform_device.h>
42 +#include <linux/irq.h>
43 +#include <linux/mtd/partitions.h>
44 +#include <linux/mv643xx_eth.h>
45 +#include <linux/ethtool.h>
46 +#include <asm/mach-types.h>
47 +#include <asm/mach/arch.h>
48 +#include <mach/kirkwood.h>
49 +#include "common.h"
50 +#include "mpp.h"
51 +
52 +static struct mtd_partition iconnect_nand_parts[] = {
53 +       {
54 +               .name = "u-boot",
55 +               .offset = 0,
56 +               .size = SZ_1M
57 +       }, {
58 +               .name = "uImage",
59 +               .offset = MTDPART_OFS_NXTBLK,
60 +               .size = SZ_1M + SZ_2M
61 +       }, {
62 +               .name = "rootfs",
63 +               .offset = MTDPART_OFS_NXTBLK,
64 +               .size = SZ_32M,
65 +       }, {
66 +               .name = "data",
67 +               .offset = MTDPART_OFS_NXTBLK,
68 +               .size = MTDPART_SIZ_FULL
69 +       },
70 +};
71 +
72 +static struct mv643xx_eth_platform_data iconnect_ge00_data = {
73 +       .phy_addr       = MV643XX_ETH_PHY_ADDR(11),
74 +};
75 +
76 +static unsigned int iconnect_mpp_config[] __initdata = {
77 +       MPP8_TW_SDA,
78 +       MPP9_TW_SCK,
79 +       MPP10_UART0_TXD,
80 +       MPP11_UART0_RXD,
81 +       MPP28_GPIO,
82 +       0
83 +};
84 +
85 +static void __init iconnect_init(void)
86 +{
87 +       u32 dev, rev;
88 +
89 +       /*
90 +        * Basic setup. Needs to be called early.
91 +        */
92 +       kirkwood_init();
93 +       kirkwood_mpp_conf(iconnect_mpp_config);
94 +
95 +       kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
96 +       kirkwood_ehci_init();
97 +
98 +       kirkwood_ge00_init(&iconnect_ge00_data);
99 +       kirkwood_pcie_id(&dev, &rev);
100 +
101 +       kirkwood_uart0_init();
102 +       kirkwood_i2c_init();
103 +}
104 +
105 +static int __init iconnect_pci_init(void)
106 +{
107 +       if (machine_is_iconnect())
108 +               kirkwood_pcie_init();
109 +
110 +       return 0;
111 +}
112 +subsys_initcall(iconnect_pci_init);
113 +
114 +
115 +MACHINE_START(ICONNECT, "Iomega iConnect Wireless")
116 +       .phys_io        = KIRKWOOD_REGS_PHYS_BASE,
117 +       .io_pg_offst    = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
118 +       .boot_params    = 0x00000100,
119 +       .init_machine   = iconnect_init,
120 +       .map_io         = kirkwood_map_io,
121 +       .init_irq       = kirkwood_init_irq,
122 +       .timer          = &kirkwood_timer,
123 +MACHINE_END