2 * 8devices Rambutan board support
4 * Copyright (C) 2017 Mantas Pucka <mantas@8devices.com>
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.
11 #include <linux/pci.h>
12 #include <linux/phy.h>
13 #include <linux/gpio.h>
14 #include <linux/platform_device.h>
15 #include <linux/ath9k_platform.h>
17 #include <asm/mach-ath79/ath79.h>
18 #include <asm/mach-ath79/ar71xx_regs.h>
19 #include <linux/platform/ar934x_nfc.h>
20 #include <linux/ar8216_platform.h>
21 #include <linux/platform_data/phy-at803x.h>
24 #include "dev-gpio-buttons.h"
25 #include "dev-leds-gpio.h"
26 #include "dev-m25p80.h"
31 #include "machtypes.h"
34 static struct at803x_platform_data rambutan_ar8032_data
= {
39 static struct mdio_board_info rambutan_mdio0_info
[] = {
41 .bus_id
= "ag71xx-mdio.0",
43 .platform_data
= &rambutan_ar8032_data
,
47 static struct at803x_platform_data rambutan_ar8033_data
= {
49 .override_sgmii_aneg
= 1,
53 static struct mdio_board_info rambutan_mdio1_info
[] = {
55 .bus_id
= "ag71xx-mdio.1",
57 .platform_data
= &rambutan_ar8033_data
,
61 static void __init
rambutan_setup(void)
63 ath79_nfc_set_ecc_mode(AR934X_NFC_ECC_HW
);
67 ath79_register_wmac_simple();
69 mdiobus_register_board_info(rambutan_mdio0_info
,
70 ARRAY_SIZE(rambutan_mdio0_info
));
71 mdiobus_register_board_info(rambutan_mdio1_info
,
72 ARRAY_SIZE(rambutan_mdio1_info
));
73 ath79_register_mdio(0, 0x0);
74 ath79_register_mdio(1, 0x0);
76 ath79_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_MII
;
77 ath79_eth0_data
.phy_mask
= BIT(0);
78 ath79_eth0_data
.mii_bus_dev
= &ath79_mdio0_device
.dev
;
79 ath79_register_eth(0);
81 ath79_eth1_data
.phy_if_mode
= PHY_INTERFACE_MODE_SGMII
;
82 ath79_eth1_data
.phy_mask
= BIT(0);
83 ath79_eth1_data
.mii_bus_dev
= &ath79_mdio1_device
.dev
;
84 ath79_eth1_data
.enable_sgmii_fixup
= 1;
85 ath79_eth1_pll_data
.pll_1000
= 0x17000000;
86 ath79_eth1_pll_data
.pll_10
= 0x1313;
87 ath79_register_eth(1);
90 MIPS_MACHINE(ATH79_MACH_RAMBUTAN
, "RAMBUTAN", "8devices Rambutan board",