mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
Convert CONFIG_CLOCK_SYNTHESIZER to Kconfig
This converts the following to Kconfig: CONFIG_CLOCK_SYNTHESIZER Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
a9ee1ad95a
commit
b20e79f0bb
8 changed files with 25 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue