]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Convert CONFIG_CLOCK_SYNTHESIZER to Kconfig
authorTom Rini <trini@konsulko.com>
Wed, 23 Mar 2022 21:20:07 +0000 (17:20 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 1 Apr 2022 14:28:47 +0000 (10:28 -0400)
This converts the following to Kconfig:
   CONFIG_CLOCK_SYNTHESIZER

Signed-off-by: Tom Rini <trini@konsulko.com>
arch/arm/mach-omap2/am33xx/Kconfig
arch/arm/mach-omap2/am33xx/clk_synthesizer.c
configs/am335x_boneblack_vboot_defconfig
configs/am335x_evm_defconfig
configs/am335x_evm_spiboot_defconfig
configs/am335x_hs_evm_defconfig
configs/am335x_hs_evm_uart_defconfig
include/configs/am335x_evm.h

index b8e115dc92bfca9596ff29ac8870bf30eec196e5..23865d4c070422e668ddcc3a76dc04cbb54a9a0f 100644 (file)
@@ -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
index 59f0d8ea71b860f3c994866a6edbf411deb3442a..c9b9502aef6230b73f69a8c3598cc27f0dba6626 100644 (file)
@@ -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
index c255d172f2aa156f0195c2e2dc17aafe13c4ff90..3e1296916cba8c76aab56e62bf5a9456f7abc72f 100644 (file)
@@ -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
index 497127d4065b68d12a08a4b047b80a102a32a633..fa97ec12d824613004b4ee4605048539c107d2b8 100644 (file)
@@ -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
index 50653ab91331f6c8013adec7496cb96259cb9fa2..abcc3e6e79f9e2bbfde8abff482157fc6a0a5707 100644 (file)
@@ -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
index 01a4c9ebc10d11958b09a6ac5ba4c5004877c469..b6fd86fa16736c78acc933b6da33659c8b44eb3f 100644 (file)
@@ -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
index 0f590500304a1b21560b8589d1d34c192c3d7d1b..15483176caa6887fdd1f77bf975679645e554c4b 100644 (file)
@@ -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
index e786672b83da7f33c663db8acda04a13c841937e..c4c8f222bd85adcdbc313d865bb847e7963893f4 100644 (file)
 #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 */