diff --git a/arch/arm/dts/ipq5018-emulation.dts b/arch/arm/dts/ipq5018-emulation.dts index 5009210dd6..f5c41ac8be 100644 --- a/arch/arm/dts/ipq5018-emulation.dts +++ b/arch/arm/dts/ipq5018-emulation.dts @@ -22,6 +22,7 @@ aliases { console = "/serial@78AF000"; mmc = "/sdhci@7804000"; + i2c0 = "/i2c@78b6000"; }; mmc: sdhci@7804000 { diff --git a/arch/arm/dts/ipq5018-soc.dtsi b/arch/arm/dts/ipq5018-soc.dtsi index 56016fc3c7..e8e4308511 100644 --- a/arch/arm/dts/ipq5018-soc.dtsi +++ b/arch/arm/dts/ipq5018-soc.dtsi @@ -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 = ; + drvstr = ; + oe = ; + }; + + gpio2 { + gpio = <6>; + func = <5>; + pull = ; + drvstr = ; + oe = ; + }; + + }; + }; }; diff --git a/arch/arm/include/asm/arch-ipq5018/clk.h b/arch/arm/include/asm/arch-ipq5018/clk.h new file mode 100644 index 0000000000..a6ccbdc67b --- /dev/null +++ b/arch/arm/include/asm/arch-ipq5018/clk.h @@ -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*/ diff --git a/arch/arm/include/asm/arch-qca-common/qca_common.h b/arch/arm/include/asm/arch-qca-common/qca_common.h index ed013c335f..fd5667e261 100644 --- a/arch/arm/include/asm/arch-qca-common/qca_common.h +++ b/arch/arm/include/asm/arch-qca-common/qca_common.h @@ -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 #include +#ifdef CONFIG_ARCH_IPQ5018 +#include +#endif + #ifdef CONFIG_ARCH_IPQ6018 #include #endif diff --git a/board/qca/arm/ipq5018/Makefile b/board/qca/arm/ipq5018/Makefile index 2d14ded75a..af85fabdea 100644 --- a/board/qca/arm/ipq5018/Makefile +++ b/board/qca/arm/ipq5018/Makefile @@ -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 diff --git a/board/qca/arm/ipq5018/clock.c b/board/qca/arm/ipq5018/clock.c new file mode 100644 index 0000000000..61a49164d5 --- /dev/null +++ b/board/qca/arm/ipq5018/clock.c @@ -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 +#include + +#ifdef CONFIG_IPQ5018_I2C +void i2c_clock_config(void) +{ + return; +} +#endif + diff --git a/include/configs/ipq5018.h b/include/configs/ipq5018.h index e94798ccc2..7b2472a2b5 100644 --- a/include/configs/ipq5018.h +++ b/include/configs/ipq5018.h @@ -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.