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 /*--------------------------------------------------------------------------*/
125 ADM5120_BOARD_START(CAS630, "Cellvision CAS-630/630W")
126 .board_setup = cas6xx_setup,
128 .num_devices = ARRAY_SIZE(cas6xx_devices),
129 .devices = cas6xx_devices,
130 /* TODO: PCI IRQ map */
133 ADM5120_BOARD_START(CAS670, "Cellvision CAS-670/670W")
134 .board_setup = cas6xx_setup,
136 .num_devices = ARRAY_SIZE(cas6xx_devices),
137 .devices = cas6xx_devices,
138 /* TODO: PCI IRQ map */
141 ADM5120_BOARD_START(CAS700, "Cellvision CAS-700/700W")
142 .board_setup = cas7xx_setup,
144 .num_devices = ARRAY_SIZE(cas7xx_devices),
145 .devices = cas7xx_devices,
146 /* TODO: PCI IRQ map */
149 ADM5120_BOARD_START(CAS771, "Cellvision CAS-771/771W")
150 .board_setup = cas7xx_setup,
152 .num_devices = ARRAY_SIZE(cas7xx_devices),
153 .devices = cas7xx_devices,
154 .pci_nr_irqs = ARRAY_SIZE(cas771_pci_irqs),
155 .pci_irq_map = cas771_pci_irqs,
158 ADM5120_BOARD_START(CAS790, "Cellvision CAS-790")
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(CAS861, "Cellvision CAS-861/861W")
167 .board_setup = cas7xx_setup,
169 .num_devices = ARRAY_SIZE(cas7xx_devices),
170 .devices = cas7xx_devices,
171 /* TODO: PCI IRQ map */