summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/embest-riotboard/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/boards/embest-riotboard/board.c')
-rw-r--r--arch/arm/boards/embest-riotboard/board.c64
1 files changed, 20 insertions, 44 deletions
diff --git a/arch/arm/boards/embest-riotboard/board.c b/arch/arm/boards/embest-riotboard/board.c
index 2e0cc9f0ab..ebaff48388 100644
--- a/arch/arm/boards/embest-riotboard/board.c
+++ b/arch/arm/boards/embest-riotboard/board.c
@@ -10,59 +10,35 @@
#include <envfs.h>
#include <gpio.h>
#include <init.h>
-#include <mach/generic.h>
-#include <mach/imx6-regs.h>
-#include <mach/imx6.h>
-#include <mach/bbu.h>
+#include <mach/imx/generic.h>
+#include <mach/imx/imx6-regs.h>
+#include <mach/imx/imx6.h>
+#include <mach/imx/bbu.h>
#include <mfd/imx6q-iomuxc-gpr.h>
#include <linux/sizes.h>
#include <linux/phy.h>
+#include <deep-probe.h>
-static int ar8035_phy_fixup(struct phy_device *dev)
+static int riotboard_probe(struct device *dev)
{
- u16 val;
-
- /* Ar803x phy SmartEEE feature cause link status generates glitch,
- * which cause ethernet link down/up issue, so disable SmartEEE
- */
- phy_write(dev, 0xd, 0x3);
- phy_write(dev, 0xe, 0x805d);
- phy_write(dev, 0xd, 0x4003);
-
- val = phy_read(dev, 0xe);
- phy_write(dev, 0xe, val & ~(1 << 8));
-
- /* To enable AR8031 ouput a 125MHz clk from CLK_25M */
- phy_write(dev, 0xd, 0x7);
- phy_write(dev, 0xe, 0x8016);
- phy_write(dev, 0xd, 0x4007);
-
- val = phy_read(dev, 0xe);
- val &= 0xffe3;
- val |= 0x18;
- phy_write(dev, 0xe, val);
-
- /* introduce tx clock delay */
- phy_write(dev, 0x1d, 0x5);
- val = phy_read(dev, 0x1e);
- val |= 0x0100;
- phy_write(dev, 0x1e, val);
-
- return 0;
-}
-
-static int riotboard_device_init(void)
-{
- if (!of_machine_is_compatible("riot,imx6s-riotboard"))
- return 0;
-
- phy_register_fixup_for_uid(0x004dd072, 0xffffffef, ar8035_phy_fixup);
-
imx6_bbu_internal_mmc_register_handler("emmc", "/dev/mmc3.barebox",
BBU_HANDLER_FLAG_DEFAULT);
+ imx6_bbu_internal_mmc_register_handler("sd", "/dev/mmc2", 0);
barebox_set_hostname("riotboard");
return 0;
}
-device_initcall(riotboard_device_init);
+
+static const struct of_device_id riotboard_of_match[] = {
+ { .compatible = "riot,imx6s-riotboard"},
+ { /* sentinel */ },
+};
+BAREBOX_DEEP_PROBE_ENABLE(riotboard_of_match);
+
+static struct driver riotboard_board_driver = {
+ .name = "board-riotboard",
+ .probe = riotboard_probe,
+ .of_compatible = DRV_OF_COMPAT(riotboard_of_match),
+};
+device_platform_driver(riotboard_board_driver);