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 <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/gpio.h>
16 #include <asm/bootinfo.h>
18 #include <asm/mach-adm5120/adm5120_info.h>
19 #include <asm/mach-adm5120/adm5120_board.h>
20 #include <asm/mach-adm5120/adm5120_platform.h>
21 #include <asm/mach-adm5120/adm5120_irq.h>
23 #include <asm/mach-adm5120/prom/myloader.h>
27 #define COMPEX_GPIO_DEV_MASK (1 << ADM5120_GPIO_PIN5)
29 static void switch_bank_gpio5(unsigned bank)
33 gpio_set_value(ADM5120_GPIO_PIN5, 0);
36 gpio_set_value(ADM5120_GPIO_PIN5, 1);
41 void __init compex_mac_setup(void)
45 if (!myloader_present())
48 for (i = 0; i < 6; i++)
49 for (j = 0; j < 6; j++)
50 adm5120_eth_macs[i][j] = myloader_info.macs[i][j];
53 void __init compex_generic_setup(void)
55 gpio_request(ADM5120_GPIO_PIN5, NULL); /* for flash A20 line */
56 gpio_direction_output(ADM5120_GPIO_PIN5, 0);
58 adm5120_flash0_data.switch_bank = switch_bank_gpio5;
59 adm5120_add_device_flash(0);
61 adm5120_add_device_gpio(COMPEX_GPIO_DEV_MASK);