summaryrefslogtreecommitdiff
path: root/src/include/device
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2020-01-06 12:31:34 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2020-01-09 21:25:41 +0000
commit1cae45432e90488c2e9e9ce635fece26ca4c2268 (patch)
tree14b3c1a7d47c8c1b41aba64d6f72050a74a9625c /src/include/device
parent5e9ae0c2bcabf3f2226265fcd8ce643ed97f1567 (diff)
device,sb/intel: Move SMBus host controller prototypes
Also change some of the types to match the register widths of the controller. It is expected that these prototypes will be used with SMBus host controllers inside AMD chipsets as well, thus the change of location. Change-Id: I88fe834f3eee7b7bfeff02f91a1c25bb5aee9b65 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38226 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include/device')
-rw-r--r--src/include/device/smbus_host.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/include/device/smbus_host.h b/src/include/device/smbus_host.h
new file mode 100644
index 0000000000..2aa160ffbd
--- /dev/null
+++ b/src/include/device/smbus_host.h
@@ -0,0 +1,35 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __DEVICE_SMBUS_HOST_H__
+#define __DEVICE_SMBUS_HOST_H__
+
+#include <stdint.h>
+
+/* Low-level SMBUS host controller. */
+
+int do_smbus_recv_byte(uintptr_t base, u8 device);
+int do_smbus_send_byte(uintptr_t base, u8 device, u8 val);
+int do_smbus_read_byte(uintptr_t base, u8 device, u8 address);
+int do_smbus_write_byte(uintptr_t base, u8 device, u8 address, u8 data);
+int do_smbus_read_word(uintptr_t base, u8 device, u8 address);
+int do_smbus_write_word(uintptr_t base, u8 device, u8 address, u16 data);
+
+int do_smbus_block_read(uintptr_t base, u8 device, u8 cmd, size_t max_bytes, u8 *buf);
+int do_smbus_block_write(uintptr_t base, u8 device, u8 cmd, size_t bytes, const u8 *buf);
+
+/* For Intel, implemented since ICH5. */
+int do_i2c_eeprom_read(uintptr_t base, u8 device, u8 offset, size_t bytes, u8 *buf);
+int do_i2c_block_write(uintptr_t base, u8 device, size_t bytes, u8 *buf);
+
+#endif