From 6fe4e5e34c584f7f4ad2c071b311e6b6a878b623 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Sat, 6 Dec 2014 10:44:58 -0800 Subject: ipq806x: add i2c driver this change ports i2c and other relevant drivers from depthcharge for ipq806x. BUG=chrome-os-partner:33647 BRANCH=ToT TEST=Booted storm using vboot2 Change-Id: I3d9a431aa8adb9b91dbccdf031647dfadbafc24c Signed-off-by: Patrick Georgi Original-Commit-Id: a0c615d0a49fd9c0ffa231353800882fff6ab90b Original-Signed-off-by: Daisuke Nojiri Original-Change-Id: Id7cc3932ed4ae54f46336aaebde35e84125ebebd Original-Reviewed-on: https://chromium-review.googlesource.com/229428 Original-Reviewed-by: Vadim Bendebury Original-Tested-by: Vadim Bendebury Original-Commit-Queue: Vadim Bendebury Reviewed-on: http://review.coreboot.org/9685 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/soc/qualcomm/ipq806x/gsbi.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'src/soc/qualcomm/ipq806x/gsbi.c') diff --git a/src/soc/qualcomm/ipq806x/gsbi.c b/src/soc/qualcomm/ipq806x/gsbi.c index be75d9a043..3fc723a555 100644 --- a/src/soc/qualcomm/ipq806x/gsbi.c +++ b/src/soc/qualcomm/ipq806x/gsbi.c @@ -1,5 +1,5 @@ /* - * This file is part of the depthcharge project. + * This file is part of the coreboot project. * * Copyright (C) 2014 The Linux Foundation. All rights reserved. * @@ -28,8 +28,8 @@ */ #include -#include "drivers/gpio/ipq806x.h" -#include "ipq806x_gsbi.h" +#include +#include //TODO: To be implemented as part of the iomap. static int gsbi_base[] = { @@ -51,8 +51,6 @@ static int gsbi_base[] = { #define GSBI_APPS_NS_OFFSET 0x4 #define GSBI_APPS_MAX_OFFSET 0xff -#define GPIO_FUNC_I2C 0x1 - gsbi_return_t gsbi_init(gsbi_id_t gsbi_id, gsbi_protocol_t protocol) { unsigned i = 0; @@ -76,27 +74,9 @@ gsbi_return_t gsbi_init(gsbi_id_t gsbi_id, gsbi_protocol_t protocol) writel(0, GSBI_RESET(gsbi_id)); - switch (gsbi_id) { - case GSBI_ID_4: { - /* Configure GPIOs 13 - SCL, 12 - SDA, 2mA gpio_en */ - gpio_tlmm_config_set(12, GPIO_FUNC_I2C, - GPIO_NO_PULL, GPIO_2MA, 1); - gpio_tlmm_config_set(13, GPIO_FUNC_I2C, - GPIO_NO_PULL, GPIO_2MA, 1); - } - break; - case GSBI_ID_1: { - /* Configure GPIOs 54 - SCL, 53 - SDA, 2mA gpio_en */ - gpio_tlmm_config_set(54, GPIO_FUNC_I2C, - GPIO_NO_PULL, GPIO_2MA, 1); - gpio_tlmm_config_set(53, GPIO_FUNC_I2C, - GPIO_NO_PULL, GPIO_2MA, 1); - } - break; - default: { + if (gsbi_init_board(gsbi_id)) { ret = GSBI_UNSUPPORTED; goto bail_out; - } } /*Select i2c protocol*/ -- cgit v1.2.3