6 * Copyright (C) 2007 OpenWrt.org
7 * Copyright (C) 2007,2008 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_defs.h>
22 #include <adm5120_irq.h>
23 #include <adm5120_board.h>
24 #include <adm5120_platform.h>
25 #include <adm5120_info.h>
27 static void switch_bank_gpio3(unsigned bank)
31 gpio_set_value(ADM5120_GPIO_PIN3, 0);
34 gpio_set_value(ADM5120_GPIO_PIN3, 1);
39 static void switch_bank_gpio5(unsigned bank)
43 gpio_set_value(ADM5120_GPIO_PIN5, 0);
46 gpio_set_value(ADM5120_GPIO_PIN5, 1);
51 static struct mtd_partition easy_partitions[] = {
56 .mask_flags = MTD_WRITEABLE,
59 .offset = MTDPART_OFS_APPEND,
63 .offset = MTDPART_OFS_APPEND,
64 .size = MTDPART_SIZ_FULL,
68 static struct adm5120_pci_irq easy5120rt_pci_irqs[] __initdata = {
69 PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
72 static struct platform_device *easy5120pata_devices[] __initdata = {
73 &adm5120_flash0_device,
74 /* TODO: add VINETIC2 device? */
77 static struct platform_device *easy5120rt_devices[] __initdata = {
78 &adm5120_flash0_device,
82 static struct platform_device *easy5120wvoip_devices[] __initdata = {
83 &adm5120_flash0_device,
84 /* TODO: add VINETIC2 device? */
87 static struct platform_device *easy83000_devices[] __initdata = {
88 &adm5120_flash0_device,
89 /* TODO: add VINAX device? */
92 static void __init easy_setup_pqfp(void)
94 gpio_request(ADM5120_GPIO_PIN3, NULL); /* for flash A20 line */
95 gpio_direction_output(ADM5120_GPIO_PIN3, 0);
97 /* setup data for flash0 device */
98 adm5120_flash0_data.switch_bank = switch_bank_gpio3;
99 adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
100 adm5120_flash0_data.parts = easy_partitions;
102 /* TODO: setup mac addresses */
105 static void __init easy_setup_bga(void)
107 gpio_request(ADM5120_GPIO_PIN5, NULL); /* for flash A20 line */
108 gpio_direction_output(ADM5120_GPIO_PIN5, 0);
110 /* setup data for flash0 device */
111 adm5120_flash0_data.switch_bank = switch_bank_gpio5;
112 adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
113 adm5120_flash0_data.parts = easy_partitions;
115 /* TODO: setup mac addresses */
118 unsigned char easy5120rt_vlans[6] = {
119 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
122 /*--------------------------------------------------------------------------*/
124 ADM5120_BOARD_START(EASY5120PATA, "Infineon EASY 5120P-ATA Reference Board")
125 .board_setup = easy_setup_pqfp,
127 .num_devices = ARRAY_SIZE(easy5120pata_devices),
128 .devices = easy5120pata_devices,
131 ADM5120_BOARD_START(EASY5120RT, "Infineon EASY 5120-RT Reference Board")
132 .board_setup = easy_setup_bga,
134 .eth_vlans = easy5120rt_vlans,
135 .num_devices = ARRAY_SIZE(easy5120rt_devices),
136 .devices = easy5120rt_devices,
137 .pci_nr_irqs = ARRAY_SIZE(easy5120rt_pci_irqs),
138 .pci_irq_map = easy5120rt_pci_irqs,
141 ADM5120_BOARD_START(EASY5120WVOIP, "Infineon EASY 5120-WVoIP Reference Board")
142 .board_setup = easy_setup_bga,
144 .num_devices = ARRAY_SIZE(easy5120wvoip_devices),
145 .devices = easy5120wvoip_devices,
148 ADM5120_BOARD_START(EASY83000, "Infineon EASY 83000 Reference Board")
149 .board_setup = easy_setup_pqfp,
151 .num_devices = ARRAY_SIZE(easy83000_devices),
152 .devices = easy83000_devices,