4 * Cellvision/SparkLAN boards
6 * Copyright (C) 2007 OpenWrt.org
7 * Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
18 #include <asm/bootinfo.h>
21 #include <adm5120_board.h>
22 #include <adm5120_platform.h>
23 #include <adm5120_irq.h>
25 static void switch_bank_gpio5(unsigned bank
)
29 gpio_set_value(ADM5120_GPIO_PIN5
, 0);
32 gpio_set_value(ADM5120_GPIO_PIN5
, 1);
37 static struct adm5120_pci_irq cas771_pci_irqs
[] __initdata
= {
38 PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0
),
39 PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI1
),
40 PCIIRQ(3, 2, 3, ADM5120_IRQ_PCI2
)
43 static struct mtd_partition cas6xx_partitions
[] = {
48 .mask_flags
= MTD_WRITEABLE
,
51 .offset
= MTDPART_OFS_APPEND
,
55 .offset
= MTDPART_OFS_APPEND
,
59 .offset
= MTDPART_OFS_APPEND
,
63 .offset
= MTDPART_OFS_APPEND
,
64 .size
= MTDPART_SIZ_FULL
,
68 static struct mtd_partition cas7xx_partitions
[] = {
73 .mask_flags
= MTD_WRITEABLE
,
76 .offset
= MTDPART_OFS_APPEND
,
80 .offset
= MTDPART_OFS_APPEND
,
84 .offset
= MTDPART_OFS_APPEND
,
85 .size
= MTDPART_SIZ_FULL
,
89 static struct platform_device
*cas6xx_devices
[] __initdata
= {
90 &adm5120_flash0_device
,
93 static struct platform_device
*cas7xx_devices
[] __initdata
= {
94 &adm5120_flash0_device
,
97 static void __init
cas6xx_setup(void)
99 gpio_request(ADM5120_GPIO_PIN5
, NULL
); /* for flash A20 line */
100 gpio_direction_output(ADM5120_GPIO_PIN5
, 0);
102 /* setup data for flash0 device */
103 adm5120_flash0_data
.switch_bank
= switch_bank_gpio5
;
104 adm5120_flash0_data
.nr_parts
= ARRAY_SIZE(cas6xx_partitions
);
105 adm5120_flash0_data
.parts
= cas6xx_partitions
;
107 /* TODO: setup mac address */
110 static void __init
cas7xx_setup(void)
112 gpio_request(ADM5120_GPIO_PIN5
, NULL
); /* for flash A20 line */
113 gpio_direction_output(ADM5120_GPIO_PIN5
, 0);
115 /* setup data for flash0 device */
116 adm5120_flash0_data
.switch_bank
= switch_bank_gpio5
;
117 adm5120_flash0_data
.nr_parts
= ARRAY_SIZE(cas7xx_partitions
);
118 adm5120_flash0_data
.parts
= cas7xx_partitions
;
120 /* TODO: setup mac address */
123 static void __init
nfs_setup(void)
125 gpio_request(ADM5120_GPIO_PIN5
, NULL
); /* for flash A20 line */
126 gpio_direction_output(ADM5120_GPIO_PIN5
, 0);
128 /* setup data for flash0 device */
129 adm5120_flash0_data
.switch_bank
= switch_bank_gpio5
;
130 adm5120_flash0_data
.nr_parts
= ARRAY_SIZE(cas6xx_partitions
);
131 adm5120_flash0_data
.parts
= cas6xx_partitions
;
133 /* TODO: setup mac address */
136 unsigned char nfs_vlans
[6] = { /* TODO: not tested */
137 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
140 /*--------------------------------------------------------------------------*/
142 ADM5120_BOARD_START(CAS630
, "Cellvision CAS-630/630W")
143 .board_setup
= cas6xx_setup
,
145 .num_devices
= ARRAY_SIZE(cas6xx_devices
),
146 .devices
= cas6xx_devices
,
147 /* TODO: PCI IRQ map */
150 ADM5120_BOARD_START(CAS670
, "Cellvision CAS-670/670W")
151 .board_setup
= cas6xx_setup
,
153 .num_devices
= ARRAY_SIZE(cas6xx_devices
),
154 .devices
= cas6xx_devices
,
155 /* TODO: PCI IRQ map */
158 ADM5120_BOARD_START(CAS700
, "Cellvision CAS-700/700W")
159 .board_setup
= cas7xx_setup
,
161 .num_devices
= ARRAY_SIZE(cas7xx_devices
),
162 .devices
= cas7xx_devices
,
163 /* TODO: PCI IRQ map */
166 ADM5120_BOARD_START(CAS771
, "Cellvision CAS-771/771W")
167 .board_setup
= cas7xx_setup
,
169 .num_devices
= ARRAY_SIZE(cas7xx_devices
),
170 .devices
= cas7xx_devices
,
171 .pci_nr_irqs
= ARRAY_SIZE(cas771_pci_irqs
),
172 .pci_irq_map
= cas771_pci_irqs
,
175 ADM5120_BOARD_START(CAS790
, "Cellvision CAS-790")
176 .board_setup
= cas7xx_setup
,
178 .num_devices
= ARRAY_SIZE(cas7xx_devices
),
179 .devices
= cas7xx_devices
,
180 /* TODO: PCI IRQ map */
183 ADM5120_BOARD_START(CAS861
, "Cellvision CAS-861/861W")
184 .board_setup
= cas7xx_setup
,
186 .num_devices
= ARRAY_SIZE(cas7xx_devices
),
187 .devices
= cas7xx_devices
,
188 /* TODO: PCI IRQ map */
191 ADM5120_BOARD_START(NFS101U
, "Cellvision NFS-101U/101WU")
192 .board_setup
= nfs_setup
,
194 .eth_vlans
= nfs_vlans
,
195 .num_devices
= ARRAY_SIZE(cas6xx_devices
),
196 .devices
= cas6xx_devices
,
197 /* TODO: PCI IRQ map */