ipq5018: Enable I2C support

Change-Id: Ifd672462a78f48a51f7c0d4fc5fdfb08d9ae9d57
Signed-off-by: Vandhiadevan Karunamoorthy <vkarunam@codeaurora.org>
This commit is contained in:
Vandhiadevan Karunamoorthy 2019-12-18 11:10:37 +05:30 committed by Gerrit - the friendly Code Review server
parent 346d35a139
commit f92636faf1
7 changed files with 89 additions and 2 deletions

View file

@ -22,6 +22,7 @@
aliases {
console = "/serial@78AF000";
mmc = "/sdhci@7804000";
i2c0 = "/i2c@78b6000";
};
mmc: sdhci@7804000 {

View file

@ -113,4 +113,31 @@
};
};
};
i2c@78b6000 {
compatible = "qcom,qup-i2c";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x78b6000 0x600>;
clock-frequency = <400000>;
i2c_gpio {
gpio1 {
gpio = <5>;
func = <5>;
pull = <GPIO_NO_PULL>;
drvstr = <GPIO_8MA>;
oe = <GPIO_OE_ENABLE>;
};
gpio2 {
gpio = <6>;
func = <5>;
pull = <GPIO_NO_PULL>;
drvstr = <GPIO_8MA>;
oe = <GPIO_OE_ENABLE>;
};
};
};
};

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2015-2016, 2018-2019 The Linux Foundation. All rights reserved.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
* 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 IPQ5018_CLK_H
#define IPQ5018_CLK_H
/* I2C clocks configuration */
#ifdef CONFIG_IPQ5018_I2C
void i2c_clock_config(void);
#endif
#endif /*IPQ5018_CLK_H*/

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
* Copyright (c) 2015-2017, 2019 The Linux Foundation. All rights reserved.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -16,6 +16,10 @@
#include <asm/u-boot.h>
#include <asm/arch-qca-common/smem.h>
#ifdef CONFIG_ARCH_IPQ5018
#include <asm/arch-ipq5018/clk.h>
#endif
#ifdef CONFIG_ARCH_IPQ6018
#include <asm/arch-ipq6018/clk.h>
#endif

View file

@ -1,5 +1,5 @@
ccflags-y += -I$(srctree)/board/qca/arm/ipq5018
cppflags-y += -I$(srctree)/board/qca/arm/ipq5018
obj-y := ipq5018.o
obj-y += clock.o

View file

@ -0,0 +1,23 @@
/*
* Copyright (c) 2015-2016, 2018-2019 The Linux Foundation. All rights reserved.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
* 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 <common.h>
#include <asm/arch-ipq5018/clk.h>
#ifdef CONFIG_IPQ5018_I2C
void i2c_clock_config(void)
{
return;
}
#endif

View file

@ -185,6 +185,16 @@ extern loff_t board_env_size;
#define CONFIG_MMC_FORCE_CAP_4BIT_BUSWIDTH
#endif
/*
* I2C Enable
*/
#define CONFIG_IPQ5018_I2C
#ifdef CONFIG_IPQ5018_I2C
#define CONFIG_SYS_I2C_QUP
#define CONFIG_CMD_I2C
#define CONFIG_DM_I2C
#endif
/*
* Expose SPI driver as a pseudo NAND driver to make use
* of U-Boot's MTD framework.