public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH 20/22] Convert CONFIG_CLOCK_SYNTHESIZER to Kconfig
Date: Wed, 23 Mar 2022 17:20:07 -0400	[thread overview]
Message-ID: <20220323212009.1066483-20-trini@konsulko.com> (raw)
In-Reply-To: <20220323212009.1066483-1-trini@konsulko.com>

This converts the following to Kconfig:
   CONFIG_CLOCK_SYNTHESIZER

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/arm/mach-omap2/am33xx/Kconfig           | 13 +++++++++++++
 arch/arm/mach-omap2/am33xx/clk_synthesizer.c | 14 +++++++-------
 configs/am335x_boneblack_vboot_defconfig     |  1 +
 configs/am335x_evm_defconfig                 |  1 +
 configs/am335x_evm_spiboot_defconfig         |  1 +
 configs/am335x_hs_evm_defconfig              |  1 +
 configs/am335x_hs_evm_uart_defconfig         |  1 +
 include/configs/am335x_evm.h                 |  5 -----
 8 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap2/am33xx/Kconfig b/arch/arm/mach-omap2/am33xx/Kconfig
index b8e115dc92bf..23865d4c0704 100644
--- a/arch/arm/mach-omap2/am33xx/Kconfig
+++ b/arch/arm/mach-omap2/am33xx/Kconfig
@@ -207,6 +207,19 @@ config TARGET_PDU001
 
 endchoice
 
+config CLOCK_SYNTHESIZER
+	bool "CDCE913 and CDCEL913 clock synthesizer support"
+	help
+	  The CDCE913 and CDCEL913 devices are modular PLL-based, low cost,
+	  high performance , programmable clock synthesizers. They generate
+	  up to 3 output clocks from a single input frequency. Each output can
+	  be programmed for any clock-frequency.
+
+config CLK_SYNTHESIZER_I2C_ADDR
+	hex "Clock synthesizer i2c bus address"
+	depends on CLOCK_SYNTHESIZER
+	default 0x65
+
 endif
 
 if AM43XX
diff --git a/arch/arm/mach-omap2/am33xx/clk_synthesizer.c b/arch/arm/mach-omap2/am33xx/clk_synthesizer.c
index 59f0d8ea71b8..c9b9502aef62 100644
--- a/arch/arm/mach-omap2/am33xx/clk_synthesizer.c
+++ b/arch/arm/mach-omap2/am33xx/clk_synthesizer.c
@@ -31,12 +31,12 @@ static int clk_synthesizer_reg_read(struct udevice *dev, int addr, u8 *buf)
 
 #if !CONFIG_IS_ENABLED(DM_I2C)
 	/* Send the command byte */
-	rc = i2c_write(CLK_SYNTHESIZER_I2C_ADDR, addr, 1, buf, 1);
+	rc = i2c_write(CONFIG_CLK_SYNTHESIZER_I2C_ADDR, addr, 1, buf, 1);
 	if (rc)
 		printf("Failed to send command to clock synthesizer\n");
 
 	/* Read the Data */
-	return i2c_read(CLK_SYNTHESIZER_I2C_ADDR, addr, 1, buf, 1);
+	return i2c_read(CONFIG_CLK_SYNTHESIZER_I2C_ADDR, addr, 1, buf, 1);
 #else
 	/* Send the command byte */
 	rc = dm_i2c_reg_write(dev, addr, *buf);
@@ -73,7 +73,7 @@ static int clk_synthesizer_reg_write(struct udevice *dev, int addr, u8 val)
 	cmd[1] = val;
 
 #if !CONFIG_IS_ENABLED(DM_I2C)
-	rc = i2c_write(CLK_SYNTHESIZER_I2C_ADDR, addr, 1, cmd, 2);
+	rc = i2c_write(CONFIG_CLK_SYNTHESIZER_I2C_ADDR, addr, 1, cmd, 2);
 #else
 	rc = dm_i2c_write(dev, addr, cmd, 2);
 #endif
@@ -97,17 +97,17 @@ int setup_clock_synthesizer(struct clk_synth *data)
 	u8 val = 0;
 	struct udevice *dev = NULL;
 #if !CONFIG_IS_ENABLED(DM_I2C)
-	rc =  i2c_probe(CLK_SYNTHESIZER_I2C_ADDR);
+	rc =  i2c_probe(CONFIG_CLK_SYNTHESIZER_I2C_ADDR);
 	if (rc) {
 		printf("i2c probe failed at address 0x%x\n",
-		       CLK_SYNTHESIZER_I2C_ADDR);
+		       CONFIG_CLK_SYNTHESIZER_I2C_ADDR);
 		return rc;
 	}
 #else
-	rc = i2c_get_chip_for_busnum(0, CLK_SYNTHESIZER_I2C_ADDR, 1, &dev);
+	rc = i2c_get_chip_for_busnum(0, CONFIG_CLK_SYNTHESIZER_I2C_ADDR, 1, &dev);
 	if (rc) {
 		printf("failed to get device for synthesizer at address 0x%x\n",
-		       CLK_SYNTHESIZER_I2C_ADDR);
+		       CONFIG_CLK_SYNTHESIZER_I2C_ADDR);
 		return rc;
 	}
 #endif
diff --git a/configs/am335x_boneblack_vboot_defconfig b/configs/am335x_boneblack_vboot_defconfig
index c255d172f2aa..3e1296916cba 100644
--- a/configs/am335x_boneblack_vboot_defconfig
+++ b/configs/am335x_boneblack_vboot_defconfig
@@ -6,6 +6,7 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-boneblack"
 CONFIG_AM33XX=y
+CONFIG_CLOCK_SYNTHESIZER=y
 CONFIG_SPL=y
 CONFIG_ENV_OFFSET_REDUND=0x280000
 CONFIG_DISTRO_DEFAULTS=y
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 497127d4065b..fa97ec12d824 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -4,6 +4,7 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
 CONFIG_AM33XX=y
+CONFIG_CLOCK_SYNTHESIZER=y
 CONFIG_AM335X_USB0=y
 CONFIG_AM335X_USB0_PERIPHERAL=y
 CONFIG_AM335X_USB1=y
diff --git a/configs/am335x_evm_spiboot_defconfig b/configs/am335x_evm_spiboot_defconfig
index 50653ab91331..abcc3e6e79f9 100644
--- a/configs/am335x_evm_spiboot_defconfig
+++ b/configs/am335x_evm_spiboot_defconfig
@@ -6,6 +6,7 @@ CONFIG_ENV_OFFSET=0x100000
 CONFIG_SPL_DM_SPI=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
 CONFIG_AM33XX=y
+CONFIG_CLOCK_SYNTHESIZER=y
 # CONFIG_SPL_MMC is not set
 CONFIG_SPL=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
diff --git a/configs/am335x_hs_evm_defconfig b/configs/am335x_hs_evm_defconfig
index 01a4c9ebc10d..b6fd86fa1673 100644
--- a/configs/am335x_hs_evm_defconfig
+++ b/configs/am335x_hs_evm_defconfig
@@ -6,6 +6,7 @@ CONFIG_ISW_ENTRY_ADDR=0x40300350
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
 CONFIG_AM33XX=y
+CONFIG_CLOCK_SYNTHESIZER=y
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_TIMESTAMP=y
diff --git a/configs/am335x_hs_evm_uart_defconfig b/configs/am335x_hs_evm_uart_defconfig
index 0f590500304a..15483176caa6 100644
--- a/configs/am335x_hs_evm_uart_defconfig
+++ b/configs/am335x_hs_evm_uart_defconfig
@@ -6,6 +6,7 @@ CONFIG_ISW_ENTRY_ADDR=0x40301950
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
 CONFIG_AM33XX=y
+CONFIG_CLOCK_SYNTHESIZER=y
 # CONFIG_SPL_MMC is not set
 CONFIG_SPL=y
 # CONFIG_SPL_FS_FAT is not set
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index e786672b83da..c4c8f222bd85 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -243,9 +243,4 @@
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 #endif  /* NOR support */
 
-#ifdef CONFIG_DRIVER_TI_CPSW
-#define CONFIG_CLOCK_SYNTHESIZER
-#define CLK_SYNTHESIZER_I2C_ADDR 0x65
-#endif
-
 #endif	/* ! __CONFIG_AM335X_EVM_H */
-- 
2.25.1


  parent reply	other threads:[~2022-03-23 21:22 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23 21:19 [PATCH 01/22] Convert CONFIG_CF_DSPI to Kconfig Tom Rini
2022-03-23 21:19 ` [PATCH 02/22] Convert CONFIG_MCFTMR " Tom Rini
2022-03-23 21:19 ` [PATCH 03/22] stmark2: Remove CONFIG_SERIAL_FLASH Tom Rini
2022-03-23 21:19 ` [PATCH 04/22] Convert CONFIG_MCFRTC et al to Kconfig Tom Rini
2022-03-23 21:19 ` [PATCH 05/22] stmark2: Migrate CONFIG_SYS_EXTRA_OPTIONS " Tom Rini
2022-03-23 21:19 ` [PATCH 06/22] mx28evk_auart_console: Remove CONFIG_SYS_EXTRA_OPTIONS Tom Rini
2022-03-23 21:19 ` [PATCH 07/22] Convert CONFIG_EMMC_BOOT et al to Kconfig Tom Rini
2022-03-23 21:19 ` [PATCH 08/22] keymile: Move sourcing of common Kconfig Tom Rini
2022-03-24  7:45   ` Holger Brunck
2022-03-23 21:19 ` [PATCH 09/22] kmtegr1: Drop CONFIG_KMTEGR1 Tom Rini
2022-03-24  4:59   ` Heiko Schocher
2022-03-24  7:46   ` Holger Brunck
2022-03-23 21:19 ` [PATCH 10/22] Convert CONFIG_KM_COGE5UN et al to Kconfig Tom Rini
2022-03-24  7:46   ` Holger Brunck
2022-03-23 21:19 ` [PATCH 11/22] mpc8548cds: Rework CONFIG_LEGACY usage Tom Rini
2022-03-23 21:19 ` [PATCH 12/22] Convert CONFIG_LSCHLV2 to Kconfig et al Tom Rini
2022-03-24 17:48   ` Michael Walle
2022-03-23 21:20 ` [PATCH 13/22] Convert CONFIG_LPUART et al to Kconfig Tom Rini
2022-03-23 21:20 ` [PATCH 14/22] MPC837XERDB: Move CONFIG_PCIE " Tom Rini
2022-03-23 21:20 ` [PATCH 15/22] am43xx_evm_qspiboot: Remove CONFIG_SYS_EXTRA_OPTIONS Tom Rini
2022-03-23 21:20 ` [PATCH 16/22] Convert CONFIG_SDCARD et al to Kconfig Tom Rini
2022-03-23 21:20 ` [PATCH 17/22] global: Remove CONFIG_SYS_USE_DATAFLASH* Tom Rini
2022-03-23 21:20 ` [PATCH 18/22] Convert CONFIG_SYS_USE_NORFLASH et al to Kconfig Tom Rini
2022-03-23 21:20 ` [PATCH 19/22] exynos: Drop CONFIG_CLK_* Tom Rini
2022-03-25  4:41   ` Minkyu Kang
2022-03-28 23:14   ` Jaehoon Chung
2022-03-23 21:20 ` Tom Rini [this message]
2022-03-23 21:20 ` [PATCH 21/22] Convert CONFIG_CLOCKS to Kconfig Tom Rini
2022-03-23 21:20 ` [PATCH 22/22] p1_p2_rdb: Remove CONFIG_CPLD_[BO]R_PRELIM Tom Rini
2022-04-01 18:45 ` [PATCH 01/22] Convert CONFIG_CF_DSPI to Kconfig Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220323212009.1066483-20-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox