summaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge/i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/stoneyridge/i2c.c')
-rw-r--r--src/soc/amd/stoneyridge/i2c.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/soc/amd/stoneyridge/i2c.c b/src/soc/amd/stoneyridge/i2c.c
new file mode 100644
index 0000000000..2837a910be
--- /dev/null
+++ b/src/soc/amd/stoneyridge/i2c.c
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2017 Google
+ *
+ * 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.
+ */
+
+#include <drivers/i2c/designware/dw_i2c.h>
+#include <soc/iomap.h>
+
+const uintptr_t i2c_bus_address[] = { I2C_BASE_ADDRESS,
+ I2C_BASE_ADDRESS + I2C_DEVICE_SIZE * 1,
+ I2C_BASE_ADDRESS + I2C_DEVICE_SIZE * 2,
+ I2C_BASE_ADDRESS + I2C_DEVICE_SIZE * 3,
+ };
+
+
+uintptr_t dw_i2c_base_address(unsigned int bus)
+{
+ return bus < I2C_DEVICE_COUNT ? i2c_bus_address[bus] : 0;
+}