Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTR
[pandora-u-boot.git] / arch / arm / mach-mvebu / sata.c
1 /*
2  * Copyright (C) 2016 Stefan Roese <sr@denx.de>
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6
7 #include <common.h>
8 #include <ahci.h>
9 #include <dm.h>
10
11 /*
12  * Dummy implementation that can be overwritten by a board
13  * specific function
14  */
15 __weak int board_ahci_enable(void)
16 {
17         return 0;
18 }
19
20 #ifdef CONFIG_ARMADA_8K
21 /* CP110 has different AHCI port addresses */
22 void __iomem *ahci_port_base(void __iomem *base, u32 port)
23 {
24         return base + 0x10000 + (port * 0x10000);
25 }
26 #endif
27
28 static int mvebu_ahci_probe(struct udevice *dev)
29 {
30         /*
31          * Board specific SATA / AHCI enable code, e.g. enable the
32          * AHCI power or deassert reset
33          */
34         board_ahci_enable();
35
36         ahci_init(devfdt_get_addr_ptr(dev));
37
38         return 0;
39 }
40
41 static const struct udevice_id mvebu_ahci_ids[] = {
42         { .compatible = "marvell,armada-3700-ahci" },
43         { .compatible = "marvell,armada-8k-ahci" },
44         { }
45 };
46
47 U_BOOT_DRIVER(ahci_mvebu_drv) = {
48         .name           = "ahci_mvebu",
49         .id             = UCLASS_AHCI,
50         .of_match       = mvebu_ahci_ids,
51         .probe          = mvebu_ahci_probe,
52 };