2 * Atheros PB92 board support
4 * Copyright (C) 2010 Felix Fietkau <nbd@openwrt.org>
5 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
6 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/partitions.h>
15 #include <asm/mach-ar71xx/ar71xx.h>
19 #include "dev-m25p80.h"
20 #include "dev-gpio-buttons.h"
21 #include "dev-pb9x-pci.h"
24 #ifdef CONFIG_MTD_PARTITIONS
25 static struct mtd_partition pb92_partitions
[] = {
30 .mask_flags
= MTD_WRITEABLE
,
47 .mask_flags
= MTD_WRITEABLE
,
50 #endif /* CONFIG_MTD_PARTITIONS */
52 static struct flash_platform_data pb92_flash_data
= {
53 #ifdef CONFIG_MTD_PARTITIONS
54 .parts
= pb92_partitions
,
55 .nr_parts
= ARRAY_SIZE(pb92_partitions
),
60 #define PB92_BUTTONS_POLL_INTERVAL 20
62 #define PB92_GPIO_BTN_SW4 8
63 #define PB92_GPIO_BTN_SW5 3
65 static struct gpio_button pb92_gpio_buttons
[] __initdata
= {
71 .gpio
= PB92_GPIO_BTN_SW4
,
78 .gpio
= PB92_GPIO_BTN_SW5
,
83 #define PB92_WAN_PHYMASK BIT(20)
84 #define PB92_LAN_PHYMASK (BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4))
85 #define PB92_MDIO_PHYMASK (PB92_LAN_PHYMASK | PB92_WAN_PHYMASK)
87 static void __init
pb92_init(void)
89 ar71xx_add_device_m25p80(&pb92_flash_data
);
91 ar71xx_add_device_mdio(~PB92_MDIO_PHYMASK
);
93 ar71xx_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_MII
;
94 ar71xx_eth0_data
.phy_mask
= PB92_WAN_PHYMASK
;
96 ar71xx_eth1_data
.phy_if_mode
= PHY_INTERFACE_MODE_RMII
;
97 ar71xx_eth1_data
.phy_mask
= PB92_LAN_PHYMASK
;
98 ar71xx_eth1_data
.speed
= SPEED_1000
;
99 ar71xx_eth1_data
.duplex
= DUPLEX_FULL
;
101 ar71xx_add_device_eth(0);
102 ar71xx_add_device_eth(1);
104 ar71xx_add_device_gpio_buttons(-1, PB92_BUTTONS_POLL_INTERVAL
,
105 ARRAY_SIZE(pb92_gpio_buttons
),
111 MIPS_MACHINE(AR71XX_MACH_PB92
, "PB92", "Atheros PB92", pb92_init
);