ar8216: Fix problem with AR8337 MAC swap handling
[openwrt.git] / target / linux / generic / files / include / linux / ar8216_platform.h
index 5c75777..d70f11a 100644 (file)
@@ -44,8 +44,10 @@ struct ar8327_pad_cfg {
        bool pipe_rxclk_sel;
        bool txclk_delay_en;
        bool rxclk_delay_en;
+       bool sgmii_delay_en;
        enum ar8327_clk_delay_sel txclk_delay_sel;
        enum ar8327_clk_delay_sel rxclk_delay_sel;
+       bool mac06_exchange_en;
 };
 
 enum ar8327_port_speed {
@@ -62,6 +64,11 @@ struct ar8327_port_cfg {
        int duplex:1;
 };
 
+struct ar8327_sgmii_cfg {
+       u32 sgmii_ctrl;
+       bool serdes_aen;
+};
+
 struct ar8327_led_cfg {
        u32 led_ctrl0;
        u32 led_ctrl1;
@@ -70,13 +77,57 @@ struct ar8327_led_cfg {
        bool open_drain;
 };
 
+enum ar8327_led_num {
+       AR8327_LED_PHY0_0 = 0,
+       AR8327_LED_PHY0_1,
+       AR8327_LED_PHY0_2,
+       AR8327_LED_PHY1_0,
+       AR8327_LED_PHY1_1,
+       AR8327_LED_PHY1_2,
+       AR8327_LED_PHY2_0,
+       AR8327_LED_PHY2_1,
+       AR8327_LED_PHY2_2,
+       AR8327_LED_PHY3_0,
+       AR8327_LED_PHY3_1,
+       AR8327_LED_PHY3_2,
+       AR8327_LED_PHY4_0,
+       AR8327_LED_PHY4_1,
+       AR8327_LED_PHY4_2,
+};
+
+enum ar8327_led_mode {
+       AR8327_LED_MODE_HW = 0,
+       AR8327_LED_MODE_SW,
+};
+
+struct ar8327_led_info {
+       const char *name;
+       const char *default_trigger;
+       bool active_low;
+       enum ar8327_led_num led_num;
+       enum ar8327_led_mode mode;
+};
+
+#define AR8327_LED_INFO(_led, _mode, _name) {  \
+       .name = (_name),                        \
+       .led_num = AR8327_LED_ ## _led,         \
+       .mode = AR8327_LED_MODE_ ## _mode       \
+}
+
 struct ar8327_platform_data {
        struct ar8327_pad_cfg *pad0_cfg;
        struct ar8327_pad_cfg *pad5_cfg;
        struct ar8327_pad_cfg *pad6_cfg;
+       struct ar8327_sgmii_cfg *sgmii_cfg;
        struct ar8327_port_cfg port0_cfg;
        struct ar8327_port_cfg port6_cfg;
        struct ar8327_led_cfg *led_cfg;
+
+       int (*get_port_link)(unsigned port);
+
+       unsigned num_leds;
+       const struct ar8327_led_info *leds;
 };
 
-#endif /* AR8216_PLATFORM_H */
\ No newline at end of file
+#endif /* AR8216_PLATFORM_H */
+