]> git.ipfire.org Git - people/ms/u-boot.git/blob - arch/arm/mach-mvebu/armada3700/sata.c
e0e8381fab6f86f20ffbdc8153e3fb8ca0d108fd
[people/ms/u-boot.git] / arch / arm / mach-mvebu / armada3700 / 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 DECLARE_GLOBAL_DATA_PTR;
12
13 /*
14 * Dummy implementation that can be overwritten by a board
15 * specific function
16 */
17 __weak int board_ahci_enable(void)
18 {
19 return 0;
20 }
21
22 static int mvebu_ahci_probe(struct udevice *dev)
23 {
24 /*
25 * Board specific SATA / AHCI enable code, e.g. enable the
26 * AHCI power or deassert reset
27 */
28 board_ahci_enable();
29
30 ahci_init(dev_get_addr_ptr(dev));
31
32 return 0;
33 }
34
35 static const struct udevice_id mvebu_ahci_ids[] = {
36 { .compatible = "marvell,armada-3700-ahci" },
37 { }
38 };
39
40 U_BOOT_DRIVER(ahci_mvebu_drv) = {
41 .name = "ahci_mvebu",
42 .id = UCLASS_AHCI,
43 .of_match = mvebu_ahci_ids,
44 .probe = mvebu_ahci_probe,
45 };