R3 router 12V/5V XH2.54

Hello All,

Working on a R3 Router project using OpenWRT.

Can anyone please explain what the 12V/5V XH2.54 is for?

image

I reckon the 12V/5V connector is intended for powering external peripherals, for example a 3.5" disk connected via USB3 or to an M.2 SATA host.

so is this voltage on/off controlled by the OpenWRT OS? I want to connect a fan to this connector or I can connect to a solid state relay and control the fan via relay (extra layer of protection)

Afaik it is always-on voltage,not switchable by software.

It is controllable, drive GPIO_8 (SATA_PWREN) high to use that interface.

@dangowrt, how can i define a regulator with 2 voltages and one gpio (i guess i can’t), but maybe define one with and one without the gpio…

so something like this:

reg_sata12v: regulator-sata12v {
	compatible = "regulator-fixed";
	regulator-name = "sata12v";
	regulator-min-microvolt = <12000000>;
	regulator-max-microvolt = <12000000>;
	gpio = <&pio 8 GPIO_ACTIVE_HIGH>;
	enable-active-high;
	regulator-always-on;
};

/* regulator also driven by gpio 8 */
reg_sata5v: regulator-sata5v {
	compatible = "regulator-fixed";
	regulator-name = "sata5v";
	regulator-min-microvolt = <5000000>;
	regulator-max-microvolt = <5000000>;
	enable-active-high;
	regulator-always-on;
};

or can we define both regulators with 1 gpio?

You can have two regulators, one for 12V which is controlled by the GPIO and 5V which is supplied by the 12V one. In that way, the impression in software will match that both regulators are power on/off using the GPIO. Ie. add vin-supply = <&reg_sata12v>; to the 5V one.

Or maybe use regulator-coupled-with instead.

1 Like

so basicly like this (currently untested):

edit: seems not working this way…i do not measure any voltage on the sata power socket @dale how did you tested this?

I set the gpio manually and measured 12v and 5v. It could be that you set pio_8 which is gpio_3, while you should set pio_13 which is the right one, gpio_8

1 Like

previous version was right (works with pio 8 now), but i accidentally uploaded an older itb file :stuck_out_tongue:

converted now to an overlay…works if it is loaded of course :slight_smile:

searching for a way to dynamically apply overlays in uboot from fit-image without creating an own conf for each possibility

currently patched my environment hard to load config always with -sata (but fit only contains this only for {sd,emmc}-nand)

seems like i can combine configs in uboot

https://u-boot.readthedocs.io/en/latest/usage/fit/overlay-fdt-boot.html#configuration-using-overlays-and-feature-selection

so i have a single conf node for sata-overlay and can call my fit with

#conf-$mmcdev-$spidev#sata

this seems to work well…