blob: fa7d8a15d2a3add5c446d5f85697ce0d207d8ee8 [file] [log] [blame]
Furquan Shaikh20a91c92017-02-11 11:16:18 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2017 Google Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef __SPI_ACPI_CHIP_H__
17#define __SPI_ACPI_CHIP_H__
18
19#include <arch/acpi_device.h>
20
21struct drivers_spi_acpi_config {
22 const char *hid; /* ACPI _HID (required) */
23 const char *cid; /* ACPI _CID */
24 const char *name; /* ACPI Device Name */
25 const char *desc; /* Device Description */
26 unsigned uid; /* ACPI _UID */
Duncan Lauriec9db3842017-02-17 17:14:35 -080027 unsigned speed; /* Bus speed in Hz (default 1MHz) */
Furquan Shaikh20a91c92017-02-11 11:16:18 -080028 const char *compat_string; /* Compatible string for _HID=PRP0001 */
29 struct acpi_irq irq; /* Interrupt */
Duncan Lauriec9db3842017-02-17 17:14:35 -080030 unsigned wake; /* Wake GPE */
31
32 /* Use GPIO based interrupt instead of PIRQ */
33 struct acpi_gpio irq_gpio;
34
35 /* Disable reset and enable GPIO export in _CRS */
36 bool disable_gpio_export_in_crs;
37
38 /* Does the device have a power resource? */
39 bool has_power_resource;
40
41 /* GPIO used to take device out of reset or to put it into reset. */
42 struct acpi_gpio reset_gpio;
43 /* Delay to be inserted after device is taken out of reset. */
Shelley Chena0603392018-04-26 13:52:30 -070044 unsigned int reset_delay_ms;
45 /* Delay to be inserted after device is put into reset. */
46 unsigned int reset_off_delay_ms;
Duncan Lauriec9db3842017-02-17 17:14:35 -080047
48 /* GPIO used to enable device. */
49 struct acpi_gpio enable_gpio;
50 /* Delay to be inserted after device is enabled. */
Shelley Chena0603392018-04-26 13:52:30 -070051 unsigned int enable_delay_ms;
52 /* Delay to be inserted after device is disabled. */
53 unsigned int enable_off_delay_ms;
Furquan Shaikhedf459f2017-08-28 17:20:49 -070054
55 /* GPIO used to stop operation of device. */
56 struct acpi_gpio stop_gpio;
57 /* Delay to be inserted after disabling stop. */
Shelley Chena0603392018-04-26 13:52:30 -070058 unsigned int stop_delay_ms;
59 /* Delay to be inserted after enabling stop. */
60 unsigned int stop_off_delay_ms;
Furquan Shaikh20a91c92017-02-11 11:16:18 -080061};
62
63#endif /* __SPI_ACPI_CHIP_H__ */