[ 11.771315] tc358743 9-000f: failed to get refclk: -2
[ 11.771321] tc358743: probe of 9-000f failed with error -2
[ 11.771356] tc358743 10-000f: failed to get refclk: -2
[ 11.771359] tc358743: probe of 10-000f failed with error -2
Im trying to port tc358743 camera drive on r36.4.
When I boot up the probe fails in my probe_of function with the error “failed to get refclk: -2”.
The code below fails.
tc358743.c
refclk = devm_clk_get(dev, "refclk");
if (IS_ERR(refclk)) {
if (PTR_ERR(refclk) != -EPROBE_DEFER)
dev_err(dev, "failed to get refclk: %ld\n",
PTR_ERR(refclk));
return PTR_ERR(refclk);
}
I gave refclk in device tree related code but still got error.
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
include <dt-bindings/clock/tegra234-clock.h> include <dt-bindings/gpio/tegra234-gpio.h>
What does ‘Confirm the refclk by checking /proc/device-tree/’ mean?
I did check the path.
test@test-desktop:/proc/device-tree$ grep -r refclk
grep: bus@0/cam_i2cmux/i2c@0/toshiba_tc358743_a@0f/clock-names: binary file matches
grep: bus@0/cam_i2cmux/i2c@1/toshiba_tc358743_c@0f/clock-names: binary file matches
test@test-desktop:/proc/device-tree$ cat bus@0/cam_i2cmux/i2c@0/toshiba_tc358743_a@0f/clock-names
refclk
Add the Config below in the file location ‘arch/amr64/configs/defconfig’
CONFIG_EMBEDDED=y
make ARCH=arm64 menuconfig
D Device Drivers
=> u Multimedia support
=> eeee Media ancillary drivers
==> v Video decoders
=> t TC358743 : set to ‘M’
make ARCH=arm64 savedefconfig
19. export CROSS_COMPILE=$HOME/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
20. make ARCH=arm64 -C kernel
21. export INSTALL_MOD_PATH=$PWD/rootfs/
22. sudo -E make ARCH=arm64 install -C kernel
23. cp kernel/kernel-jammy-src/arch/arm64/boot/Image …/kernel/Image
24. build modules of nvidia out-of-tree
export KERNEL_HEADERS=$PWD/kernel/kernel-jammy-src
make ARCH=arm64 modules
25. sudo -E make ARCH=arm64 modules_install
26. sudo ./tools/l4t_update_initrd.sh
27. Before building dtb, I blocked ‘//include "tegra234-p3768-camera-rbpcv2-imx219.dtsi’ in the ‘tegra234-p3768-0000+p3767-0000-dynamic.dts’ file and added the following ‘include "tegra234-p3768-camera-toshiba-tc358743.dtsi’.
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
When I run this, I get an error like ‘[ 11.771315] tc358743 9-000f: failed to get refclk: -2
[ 11.771321] tc358743: probe of 9-000f failed with error -2
[ 11.771356] tc358743 10-000f: failed to get refclk: -2
[ 11.771359] tc358743: probe of 10-000f failed with error -2’.
This is clk in the tc358743_probe_of function.
static int tc358743_probe_of(struct tc358743_state *state)
{
…
struct clk *refclk;
u32 bps_pr_lane;
int ret;
refclk = devm_clk_get(dev, "refclk");
if (IS_ERR(refclk)) {
if (PTR_ERR(refclk) != -EPROBE_DEFER)
dev_err(dev, "failed to get refclk: %ld\n",
PTR_ERR(refclk));
return PTR_ERR(refclk);
}
ep = of_graph_get_next_endpoint(dev->of_node, NULL);
if (!ep) {
dev_err(dev, "missing endpoint node\n");
return -EINVAL;
}
…
}
If i block clk, an error will occur right after ‘missing endpoint node’.