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 | |
| 6 | #include <common.h> |
| 7 | #include <dm.h> |
| 8 | #include <asm/pch_common.h> |
| 9 | |
| 10 | u32 pch_common_sir_read(struct udevice *dev, int idx) |
| 11 | { |
| 12 | u32 data; |
| 13 | |
| 14 | dm_pci_write_config32(dev, SATA_SIRI, idx); |
| 15 | dm_pci_read_config32(dev, SATA_SIRD, &data); |
| 16 | |
| 17 | return data; |
| 18 | } |
| 19 | |
| 20 | void pch_common_sir_write(struct udevice *dev, int idx, u32 value) |
| 21 | { |
| 22 | dm_pci_write_config32(dev, SATA_SIRI, idx); |
| 23 | dm_pci_write_config32(dev, SATA_SIRD, value); |
| 24 | } |