Question for gpio regulator (regulator-fixed)

Hello,

I have question regarding the gpio regulator (regulator-fixed).

In my understanding, it has to define the consumer for regulator in device-tree. Otherwise, if there is no consumer, the regulator will be turned off.

There are several regulator-fixed: vdd-1v8-sd, vdd-hdmi-5v0, vdd_sys_en, avdd-cam-2v8, vdd-5v-sata.
It seems that vdd-5v-sata has a consumer: usb2-3. And vdd-hdmi-5v0 has consumers: 15210000.nvdisplay and 15200000.nvdisplay.
The rest vdd-1v8-sd, vdd_sys_en, avdd-cam-2v8 have NO consumer.

Does it mean that the GPIOs for these regulators are not used at all? And can I use these GPIOs for my own purpose?

Or are these GPIOs turned on by bootloader before Linux starts? (e.g. cboot, MB1, MB2)

Regards

hello lunarking1028,

here’s definition in device tree to indicate the regulator names and its voltage.
for example,
$L4T_Sources/r32.5/Linux_for_Tegra/source/public/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-fixed-regulator-p2822-1000.dtsi

        fixed-regulators {
                p2822_avdd_cam_2v8: regulator@107 {
                        compatible = "regulator-fixed";
                        reg = <107>;
                        regulator-name = "avdd-cam-2v8";
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
                        gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(N, 0) 0>;
                        enable-active-high;
                };

this is assigned in the camera sensor device tree, it’s shown as vana-supply for camera driver’s usage.
for example,
$L4T_Sources/r32.5/Linux_for_Tegra/source/public/hardware/nvidia/platform/t19x/galen/galen/kernel-dts/common/tegra194-p2822-0000-camera-e3333-a00.dtsi

                        i2c@0 {
                                reg = <0>;
                                ov5693_a@36 {
                                        vana-supply = <&p2822_avdd_cam_2v8>;

there’s camera board specific device tree, (i.e. OV5693 camera sensor drivers).
it’s compatible = "nvidia,ov5693"; variable to indicate which sensor driver it used, and the actual regulator that may used from kernel driver side.
for example,
$L4T_Sources/r32.5/Linux_for_Tegra/source/public/hardware/nvidia/platform/t19x/common/kernel-dts/t19x-common-modules/tegra194-camera-e3333-a00.dtsi

        i2c@3180000 {
                tca9548@77 {
                        i2c@0 {
                                ov5693_a@36 {
                                        compatible = "nvidia,ov5693";
                                        reg = <0x36>;
                                        devnode = "video0";
...
                                        avdd-reg = "vana";
                                        iovdd-reg = "vif";

thereafter, if you looking into sensor driver, ov5693.c
it’s compatible to indicate the device tree sources.
you’ll see parsing function to read the property from device tree, and it’ll able to have sensor operations.
for example,

static const struct of_device_id ov5693_of_match[] = {
        {
                .compatible = "nvidia,ov5693",
static struct camera_common_pdata *ov5693_parse_dt(struct tegracam_device *tc_dev)
{
...
        err = of_property_read_string(node, "avdd-reg", &board_priv_pdata->regulators.avdd);

so,
you may have your implementation in kernel drivers to use them,
if necessary, you may also extend the definition in device tree for adding regulators.
thanks

1 Like

Hi JerryChang,

Thanks for your reply and detailed explain.
I went through these signals from xavier-devkit schematic. I can see that they provide the 3.3V CAM_AVDD_EN and 2.8V AVDD_CAM_2V8 to MIPI CSI connector.

The camera (IMX390) that I am using doesn’t reference these regulators. We are also using the GMSLv2 serdes (MAX9295 and MAX9296) connected between the CSI and IMX390 camera. From device-tree binding, it seems that it is using CAM0_PWDN as a POE signal for all cameras. But vdd_sys_en and avdd-cam-2v8 regulators are NOT used/referenced in IMX390 and GMSLv2 device-tree.

Can I say that these power enable signals are provided as a generic “standard”. But whether they are used or not is camera vendor dependent?

Regards.

hello lunarking1028,

correct, it’s depends-on the vendor’s board design.

1 Like

I’m trying to understand the purpose of these generic regulators. For example, I see a few 5V regulators p2822_vdd_5v_sata, p2822_vdd_hdmi_5v0, p2822_vdd_fan. If I’ve an IO peripheral that uses 5V then which one should I use? How do I know that’s the correct one? Any reference doc will be helpful.
Thanks.

hello hj-ca,

you may access Jetson AGX Xavier OEM Product Design Guide for reference,
thanks

I’m sorry that document did not seem to help, I’ll clarify what reference information I’m looking for device tree understanding of power rails, power tree etc. Datasheet NVIDIA Jetson AGX Xavier Series System-on-Module has pin list in section 3.3. For example,

A4 SDCARD_D2 SD Card (or SDIO) Data 2 VDDIO_SDMMC1_H 3.3V Bi-Dir
The corresponding regulator for 3.3V defined as in tegra194-fixed-regulator-p2822-1000.dtsi
p2822_vdd_sdmmc1_sw: regulator@106 {
compatible = “regulator-fixed”;
reg = <106>;
regulator-name = “vdd-sdmmc1-sw”;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(A, 0) 0>;
enable-active-high;
};

From above, I can understand that I need to ensure that I’ve to have VDDIO_SDMMC1 referenced in the device tree for my carrier’s SD card to work.
I’m looking for similar reference for all regulators (for example p2822_vdd_5v_sata, p2822_vdd_hdmi_5v0, p2822_vdd_fan) that you provide in device trees with your BSP.
Thanks.

hello hj-ca,

please refer to post #3 for an example of the definition in device tree to indicate the regulator names and its voltage.
you’ll need to access Jetson AGX Xavier Developer Kit Carrier Board B03 Design Files, please check schematics for the details of the regulators.
thanks

Thanks, this helps. I found the piece of circuit for p2822_vdd_hdmi_5v0

p2822_vdd_hdmi_5v0: regulator@112 {
compatible = “regulator-fixed”;
reg = <112>;
regulator-name = “vdd-hdmi-5v0”;
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(A, 3) 0>;
enable-active-high;
};
What’s the significance of “reg = <112>;” here with respect to the schematic circuit? It seems to me some dummy index.

hello hj-ca,

it’s a dummy index for drivers to distinguish all regulators,
you may disassemble the device tree blob for checking, you’ll see there’re several regulators listed.
for example,
$ dtc -I dtb -O dts -o output.txt bootloader/tegra194-p2888-0001-p2822-0000.dtb

Thanks.