2 * AR8216 switch driver platform data
4 * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 #ifndef AR8216_PLATFORM_H
18 #define AR8216_PLATFORM_H
20 enum ar8327_pad_mode {
22 AR8327_PAD_MAC2MAC_MII,
23 AR8327_PAD_MAC2MAC_GMII,
25 AR8327_PAD_MAC2PHY_MII,
26 AR8327_PAD_MAC2PHY_GMII,
33 enum ar8327_clk_delay_sel {
34 AR8327_CLK_DELAY_SEL0 = 0,
35 AR8327_CLK_DELAY_SEL1,
36 AR8327_CLK_DELAY_SEL2,
37 AR8327_CLK_DELAY_SEL3,
40 struct ar8327_pad_cfg {
41 enum ar8327_pad_mode mode;
48 enum ar8327_clk_delay_sel txclk_delay_sel;
49 enum ar8327_clk_delay_sel rxclk_delay_sel;
50 bool mac06_exchange_en;
53 enum ar8327_port_speed {
54 AR8327_PORT_SPEED_10 = 0,
55 AR8327_PORT_SPEED_100,
56 AR8327_PORT_SPEED_1000,
59 struct ar8327_port_cfg {
61 enum ar8327_port_speed speed;
67 struct ar8327_sgmii_cfg {
72 struct ar8327_led_cfg {
81 AR8327_LED_PHY0_0 = 0,
98 enum ar8327_led_mode {
99 AR8327_LED_MODE_HW = 0,
103 struct ar8327_led_info {
105 const char *default_trigger;
107 enum ar8327_led_num led_num;
108 enum ar8327_led_mode mode;
111 #define AR8327_LED_INFO(_led, _mode, _name) { \
113 .led_num = AR8327_LED_ ## _led, \
114 .mode = AR8327_LED_MODE_ ## _mode \
117 struct ar8327_platform_data {
118 struct ar8327_pad_cfg *pad0_cfg;
119 struct ar8327_pad_cfg *pad5_cfg;
120 struct ar8327_pad_cfg *pad6_cfg;
121 struct ar8327_sgmii_cfg *sgmii_cfg;
122 struct ar8327_port_cfg port0_cfg;
123 struct ar8327_port_cfg port6_cfg;
124 struct ar8327_led_cfg *led_cfg;
126 int (*get_port_link)(unsigned port);
129 const struct ar8327_led_info *leds;
132 #endif /* AR8216_PLATFORM_H */