Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Simon Glass | 9c852d7 | 2016-03-16 07:44:36 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2016 Google, Inc |
Simon Glass | 9c852d7 | 2016-03-16 07:44:36 -0600 | [diff] [blame] | 4 | */ |
| 5 | |
Simon Glass | 9c852d7 | 2016-03-16 07:44:36 -0600 | [diff] [blame] | 6 | #include <dm.h> |
| 7 | #include <asm/pch_common.h> |
| 8 | |
| 9 | u32 pch_common_sir_read(struct udevice *dev, int idx) |
| 10 | { |
| 11 | u32 data; |
| 12 | |
| 13 | dm_pci_write_config32(dev, SATA_SIRI, idx); |
| 14 | dm_pci_read_config32(dev, SATA_SIRD, &data); |
| 15 | |
| 16 | return data; |
| 17 | } |
| 18 | |
| 19 | void pch_common_sir_write(struct udevice *dev, int idx, u32 value) |
| 20 | { |
| 21 | dm_pci_write_config32(dev, SATA_SIRI, idx); |
| 22 | dm_pci_write_config32(dev, SATA_SIRD, value); |
| 23 | } |