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>
24 static void switch_bank_gpio3(unsigned bank
)
28 gpio_set_value(ADM5120_GPIO_PIN3
, 0);
31 gpio_set_value(ADM5120_GPIO_PIN3
, 1);
36 static void switch_bank_gpio5(unsigned bank
)
40 gpio_set_value(ADM5120_GPIO_PIN5
, 0);
43 gpio_set_value(ADM5120_GPIO_PIN5
, 1);
48 static struct mtd_partition easy_partitions
[] = {
53 .mask_flags
= MTD_WRITEABLE
,
56 .offset
= MTDPART_OFS_APPEND
,
60 .offset
= MTDPART_OFS_APPEND
,
61 .size
= MTDPART_SIZ_FULL
,
65 static struct platform_device
*easy5120pata_devices
[] __initdata
= {
66 &adm5120_flash0_device
,
67 /* TODO: add VINETIC2 device? */
70 static struct platform_device
*easy5120rt_devices
[] __initdata
= {
71 &adm5120_flash0_device
,
74 static struct platform_device
*easy5120wvoip_devices
[] __initdata
= {
75 &adm5120_flash0_device
,
76 /* TODO: add VINETIC2 device? */
79 static struct platform_device
*easy83000_devices
[] __initdata
= {
80 &adm5120_flash0_device
,
81 /* TODO: add VINAX device? */
84 static void __init
easy_setup_pqfp(void)
86 gpio_request(ADM5120_GPIO_PIN3
, NULL
); /* for flash A20 line */
87 gpio_direction_output(ADM5120_GPIO_PIN3
, 0);
89 /* setup data for flash0 device */
90 adm5120_flash0_data
.switch_bank
= switch_bank_gpio3
;
91 adm5120_flash0_data
.nr_parts
= ARRAY_SIZE(easy_partitions
);
92 adm5120_flash0_data
.parts
= easy_partitions
;
94 /* TODO: setup mac addresses */
97 static void __init
easy_setup_bga(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(easy_partitions
);
105 adm5120_flash0_data
.parts
= easy_partitions
;
107 /* TODO: setup mac addresses */
110 /*--------------------------------------------------------------------------*/
112 ADM5120_BOARD_START(EASY5120PATA
, "Infineon EASY 5120P-ATA Reference Board")
113 .board_setup
= easy_setup_pqfp
,
115 .num_devices
= ARRAY_SIZE(easy5120pata_devices
),
116 .devices
= easy5120pata_devices
,
119 ADM5120_BOARD_START(EASY5120RT
, "Infineon EASY 5120-RT Reference Board")
120 .board_setup
= easy_setup_bga
,
122 .num_devices
= ARRAY_SIZE(easy5120rt_devices
),
123 .devices
= easy5120rt_devices
,
126 ADM5120_BOARD_START(EASY5120WVOIP
, "Infineon EASY 5120-WVoIP Reference Board")
127 .board_setup
= easy_setup_bga
,
129 .num_devices
= ARRAY_SIZE(easy5120wvoip_devices
),
130 .devices
= easy5120wvoip_devices
,
133 ADM5120_BOARD_START(EASY83000
, "Infineon EASY 83000 Reference Board")
134 .board_setup
= easy_setup_pqfp
,
136 .num_devices
= ARRAY_SIZE(easy83000_devices
),
137 .devices
= easy83000_devices
,