[U-Boot] [PATCH 4/4] board: ti: am335x-ice: Configure the CDCE913 clock synthesizer
Tero Kristo
t-kristo at ti.com
Fri Sep 27 16:14:29 UTC 2019
AM335x-ICE boards contain the CDCE913 clock synthesizer, and their
reset crystal capacitance load value of 10pF is wrong leading into
lost packets in certain networking tests. Add DT data for this
device, and probe it from the board file to program the crystal
capacitance load value to 0pF to avoid any problems.
Signed-off-by: Tero Kristo <t-kristo at ti.com>
---
arch/arm/dts/am335x-icev2-u-boot.dtsi | 21 +++++++++++++++++++++
board/ti/am335x/board.c | 4 ++++
configs/am335x_evm_defconfig | 2 ++
3 files changed, 27 insertions(+)
create mode 100644 arch/arm/dts/am335x-icev2-u-boot.dtsi
diff --git a/arch/arm/dts/am335x-icev2-u-boot.dtsi b/arch/arm/dts/am335x-icev2-u-boot.dtsi
new file mode 100644
index 0000000000..cc9569af03
--- /dev/null
+++ b/arch/arm/dts/am335x-icev2-u-boot.dtsi
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/
+ */
+/ {
+ xtal25mhz: xtal25mhz {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <25000000>;
+ };
+};
+
+&i2c0 {
+ cdce913: cdce913 at 65 {
+ compatible = "ti,cdce913";
+ reg = <0x65>;
+ clocks = <&xtal25mhz>;
+ #clock-cells = <1>;
+ xtal-load-pf = <0>;
+ };
+};
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 7eaa6cd96d..499c872227 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -791,6 +791,7 @@ int board_init(void)
#ifdef CONFIG_BOARD_LATE_INIT
int board_late_init(void)
{
+ struct udevice *dev;
#if !defined(CONFIG_SPL_BUILD)
uint8_t mac_addr[6];
uint32_t mac_hi, mac_lo;
@@ -871,6 +872,9 @@ int board_late_init(void)
env_set("serial#", board_serial);
}
+ /* Just probe the potentially supported cdce913 device */
+ uclass_get_device(UCLASS_CLK, 0, &dev);
+
return 0;
}
#endif
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 2aa9b65caf..93a28b290b 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -77,3 +77,5 @@ CONFIG_DYNAMIC_CRC_TABLE=y
CONFIG_RSA=y
CONFIG_LZO=y
# CONFIG_OF_LIBFDT_OVERLAY is not set
+CONFIG_CLK=y
+CONFIG_CLK_CDCE9XX=y
--
2.17.1
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
More information about the U-Boot
mailing list