blob: e0e8381fab6f86f20ffbdc8153e3fb8ca0d108fd [file] [log] [blame]
Stefan Roesef61aefc2016-05-17 15:00:30 +02001/*
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
11DECLARE_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
22static 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
35static const struct udevice_id mvebu_ahci_ids[] = {
36 { .compatible = "marvell,armada-3700-ahci" },
37 { }
38};
39
40U_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};