diff options
author | Chris Ching <chingcodes@chromium.org> | 2017-12-20 16:06:03 -0700 |
---|---|---|
committer | Chris Ching <chingcodes@chromium.org> | 2018-01-03 22:33:49 +0000 |
commit | 6fc39d47d017409a30239a031b16413e30700452 (patch) | |
tree | f3b2a71f182ffd7982faa1fce31f93ec6f958232 /src/soc/amd/stoneyridge/i2c.c | |
parent | fc511277a57857fe5fd41bf0d877d1dd17f3b92f (diff) | |
download | coreboot-6fc39d47d017409a30239a031b16413e30700452.tar.xz |
soc/amd/stoneyridge: Add I2C support
BUG=b:69416132
BRANCH=none
TEST=make
Change-Id: Id940af917c9525aba7bc25eea0821f5f36a36653
Signed-off-by: Chris Ching <chingcodes@chromium.org>
Reviewed-on: https://review.coreboot.org/22959
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/amd/stoneyridge/i2c.c')
-rw-r--r-- | src/soc/amd/stoneyridge/i2c.c | 29 |
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; +} |