Staging: Panel: panel: Fixed checkpatch line length warnings
[linux/fpc-iii.git] / arch / arm / mach-at91 / board-dt-sama5.c
blob705305e62bbc2928826c7d989468fbe56f55bcc1
1 /*
2 * Setup code for SAMA5 Evaluation Kits with Device Tree support
4 * Copyright (C) 2013 Atmel,
5 * 2013 Ludovic Desroches <ludovic.desroches@atmel.com>
7 * Licensed under GPLv2 or later.
8 */
10 #include <linux/types.h>
11 #include <linux/init.h>
12 #include <linux/module.h>
13 #include <linux/gpio.h>
14 #include <linux/micrel_phy.h>
15 #include <linux/of.h>
16 #include <linux/of_irq.h>
17 #include <linux/of_platform.h>
18 #include <linux/phy.h>
20 #include <asm/setup.h>
21 #include <asm/irq.h>
22 #include <asm/mach/arch.h>
23 #include <asm/mach/map.h>
24 #include <asm/mach/irq.h>
26 #include "at91_aic.h"
27 #include "generic.h"
30 static const struct of_device_id irq_of_match[] __initconst = {
32 { .compatible = "atmel,sama5d3-aic", .data = at91_aic5_of_init },
33 { /*sentinel*/ }
36 static void __init at91_dt_init_irq(void)
38 of_irq_init(irq_of_match);
41 static int ksz9021rn_phy_fixup(struct phy_device *phy)
43 int value;
45 #define GMII_RCCPSR 260
46 #define GMII_RRDPSR 261
47 #define GMII_ERCR 11
48 #define GMII_ERDWR 12
50 /* Set delay values */
51 value = GMII_RCCPSR | 0x8000;
52 phy_write(phy, GMII_ERCR, value);
53 value = 0xF2F4;
54 phy_write(phy, GMII_ERDWR, value);
55 value = GMII_RRDPSR | 0x8000;
56 phy_write(phy, GMII_ERCR, value);
57 value = 0x2222;
58 phy_write(phy, GMII_ERDWR, value);
60 return 0;
63 static void __init sama5_dt_device_init(void)
65 if (of_machine_is_compatible("atmel,sama5d3xcm"))
66 phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
67 ksz9021rn_phy_fixup);
69 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
72 static const char *sama5_dt_board_compat[] __initdata = {
73 "atmel,sama5",
74 NULL
77 DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)")
78 /* Maintainer: Atmel */
79 .init_time = at91sam926x_pit_init,
80 .map_io = at91_map_io,
81 .handle_irq = at91_aic5_handle_irq,
82 .init_early = at91_dt_initialize,
83 .init_irq = at91_dt_init_irq,
84 .init_machine = sama5_dt_device_init,
85 .dt_compat = sama5_dt_board_compat,
86 MACHINE_END