board: ti: am43xx-idk: Configure the CDCE913 clock synthesizer
authorTero Kristo <t-kristo@ti.com>
Fri, 27 Sep 2019 16:14:28 +0000 (19:14 +0300)
committerTom Rini <trini@konsulko.com>
Fri, 11 Oct 2019 17:32:39 +0000 (13:32 -0400)
AM43xx-IDK 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@ti.com>
arch/arm/dts/am437x-idk-evm-u-boot.dtsi
board/ti/am43xx/board.c
configs/am43xx_evm_defconfig

index 3aa9195e44d2b3f888c49a40f9cb13a98c703909..50fe09cfc368e1c52c148b6fc55ea26de8fc980a 100644 (file)
@@ -9,6 +9,12 @@
        ocp {
                u-boot,dm-spl;
        };
+
+       xtal25mhz: xtal25mhz {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <25000000>;
+       };
 };
 
 &uart0 {
 
 &i2c0 {
        u-boot,dm-spl;
+
+       cdce913: cdce913@65 {
+               compatible = "ti,cdce913";
+               reg = <0x65>;
+               clocks = <&xtal25mhz>;
+               #clock-cells = <1>;
+               xtal-load-pf = <0>;
+       };
 };
 
 &mmc1 {
index 2e09cc20e8c2d6df6978e094c2ad9257c2a067fc..f5ecf871bca87097d96501873c3fef0ceaea5cb0 100644 (file)
@@ -720,6 +720,7 @@ static int device_okay(const char *path)
 
 int board_late_init(void)
 {
+       struct udevice *dev;
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        set_board_info_env(NULL);
 
@@ -737,6 +738,10 @@ int board_late_init(void)
        if (device_okay("/ocp/omap_dwc3@483c0000"))
                enable_usb_clocks(1);
 #endif
+
+       /* Just probe the potentially supported cdce913 device */
+       uclass_get_device(UCLASS_CLK, 0, &dev);
+
        return 0;
 }
 #endif
index 7c74047f3ae6ce35958ad8dac44c96ac117f2a1f..7367c6952b0e31c1c8530ce36cd9b0848816df6b 100644 (file)
@@ -78,3 +78,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0403
 CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
+CONFIG_CLK=y
+CONFIG_CLK_CDCE9XX=y