2 * Infineon Reference 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.
14 #include <prom/admboot.h>
16 #define EASY_CONFIG_OFFSET 0x10000
17 #define EASY_CONFIG_SIZE 0x1000
19 static struct mtd_partition easy_partitions[] = {
24 .mask_flags = MTD_WRITEABLE,
27 .offset = MTDPART_OFS_APPEND,
31 .offset = MTDPART_OFS_APPEND,
32 .size = MTDPART_SIZ_FULL,
36 static __init void easy_setup_mac(void)
41 err = admboot_get_mac_base(EASY_CONFIG_OFFSET,
42 EASY_CONFIG_SIZE, mac_base);
44 if ((err) || !is_valid_ether_addr(mac_base))
45 random_ether_addr(mac_base);
47 adm5120_setup_eth_macs(mac_base);
50 static void switch_bank_gpio3(unsigned bank)
54 gpio_set_value(ADM5120_GPIO_PIN3, 0);
57 gpio_set_value(ADM5120_GPIO_PIN3, 1);
62 void __init easy_setup_pqfp(void)
64 /* setup flash A20 line */
65 gpio_request(ADM5120_GPIO_PIN3, NULL);
66 gpio_direction_output(ADM5120_GPIO_PIN3, 0);
67 adm5120_flash0_data.switch_bank = switch_bank_gpio3;
69 adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
70 adm5120_flash0_data.parts = easy_partitions;
72 adm5120_add_device_uart(0);
73 adm5120_add_device_uart(1);
75 adm5120_add_device_flash(0);
80 static void switch_bank_gpio5(unsigned bank)
84 gpio_set_value(ADM5120_GPIO_PIN5, 0);
87 gpio_set_value(ADM5120_GPIO_PIN5, 1);
92 void __init easy_setup_bga(void)
94 /* setup flash A20 line */
95 gpio_request(ADM5120_GPIO_PIN5, NULL);
96 gpio_direction_output(ADM5120_GPIO_PIN5, 0);
97 adm5120_flash0_data.switch_bank = switch_bank_gpio5;
99 adm5120_flash0_data.nr_parts = ARRAY_SIZE(easy_partitions);
100 adm5120_flash0_data.parts = easy_partitions;
102 adm5120_add_device_uart(0);
103 adm5120_add_device_uart(1);
105 adm5120_add_device_flash(0);