2 * Cellvision/SparkLAN boards
4 * Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
12 #include "cellvision.h"
14 #define CELLVISION_GPIO_FLASH_A20 ADM5120_GPIO_PIN5
15 #define CELLVISION_GPIO_DEV_MASK (1 << CELLVISION_GPIO_FLASH_A20)
17 #ifdef CONFIG_MTD_PARTITIONS
18 static struct mtd_partition cas6xx_partitions
[] = {
23 .mask_flags
= MTD_WRITEABLE
,
26 .offset
= MTDPART_OFS_APPEND
,
30 .offset
= MTDPART_OFS_APPEND
,
34 .offset
= MTDPART_OFS_APPEND
,
38 .offset
= MTDPART_OFS_APPEND
,
39 .size
= MTDPART_SIZ_FULL
,
43 static struct mtd_partition cas7xx_partitions
[] = {
48 .mask_flags
= MTD_WRITEABLE
,
51 .offset
= MTDPART_OFS_APPEND
,
55 .offset
= MTDPART_OFS_APPEND
,
59 .offset
= MTDPART_OFS_APPEND
,
60 .size
= MTDPART_SIZ_FULL
,
63 #endif /* CONFIG_MTD_PARTITIONS */
65 static void switch_bank_gpio5(unsigned bank
)
69 gpio_set_value(CELLVISION_GPIO_FLASH_A20
, 0);
72 gpio_set_value(CELLVISION_GPIO_FLASH_A20
, 1);
77 static void __init
cellvision_flash_setup(void)
79 /* setup flash A20 line */
80 gpio_request(CELLVISION_GPIO_FLASH_A20
, NULL
);
81 gpio_direction_output(CELLVISION_GPIO_FLASH_A20
, 0);
83 adm5120_flash0_data
.switch_bank
= switch_bank_gpio5
;
84 adm5120_add_device_flash(0);
87 void __init
cas6xx_flash_setup(void)
89 #ifdef CONFIG_MTD_PARTITIONS
90 adm5120_flash0_data
.nr_parts
= ARRAY_SIZE(cas6xx_partitions
);
91 adm5120_flash0_data
.parts
= cas6xx_partitions
;
92 #endif /* CONFIG_MTD_PARTITIONS */
94 cellvision_flash_setup();
97 void __init
cas7xx_flash_setup(void)
99 #ifdef CONFIG_MTD_PARTITIONS
100 adm5120_flash0_data
.nr_parts
= ARRAY_SIZE(cas7xx_partitions
);
101 adm5120_flash0_data
.parts
= cas7xx_partitions
;
102 #endif /* CONFIG_MTD_PARTITIONS */
104 cellvision_flash_setup();
108 void __init
cas6xx_setup(void)
110 cas6xx_flash_setup();
111 adm5120_add_device_switch(1, NULL
);
114 ADM5120_BOARD(MACH_ADM5120_CAS630
, "Cellvision CAS-630/630W", cas6xx_setup
);
115 ADM5120_BOARD(MACH_ADM5120_CAS670
, "Cellvision CAS-670/670W", cas6xx_setup
);
118 void __init
cas7xx_setup(void)
120 cas7xx_flash_setup();
121 adm5120_add_device_switch(1, NULL
);
125 ADM5120_BOARD(MACH_ADM5120_CAS700
, "Cellvision CAS-700/700W", cas7xx_setup
);
126 ADM5120_BOARD(MACH_ADM5120_CAS790
, "Cellvision CAS-790", cas7xx_setup
);
127 ADM5120_BOARD(MACH_ADM5120_CAS861
, "Cellvision CAS-861/861W", cas7xx_setup
);