OLinuXino-LIME PC3 pin for SATA power controlling

Started by jmss, December 05, 2014, 02:04:03 AM

Previous topic - Next topic

jmss

Hi,

I'm setting pin PC3 from GPIO1 to 1 but it does not shut down SATA PWR connector:

root@lime:/sys/class/gpio# echo 11 > export
root@lime:/sys/class/gpio# cd gpio11
root@lime:/sys/class/gpio/gpio11# echo out > direction
root@lime:/sys/class/gpio/gpio11# cat value
0
root@lime:/sys/class/gpio/gpio11# echo 1 > value
root@lime:/sys/class/gpio/gpio11# cat value
1

Is this the correct way of cutting power in SATA PWR connector?

Thanks.

Gerrit

Quote from: jmss on December 05, 2014, 02:04:03 AM
Hi,

I'm setting pin PC3 from GPIO1 to 1 but it does not shut down SATA PWR connector:

root@lime:/sys/class/gpio# echo 11 > export
root@lime:/sys/class/gpio# cd gpio11
root@lime:/sys/class/gpio/gpio11# echo out > direction
root@lime:/sys/class/gpio/gpio11# cat value
0
root@lime:/sys/class/gpio/gpio11# echo 1 > value
root@lime:/sys/class/gpio/gpio11# cat value
1

Is this the correct way of cutting power in SATA PWR connector?

Thanks.

Its works here, only cd gpio11 must be cd gpio11_pc3
Make sure of course the disk is not mounted anymore



jmss

Thanks.

Maybe it's because I'm using Ubuntu image from Robert C. Nelson? Hence the _pc3 difference and maybe there's also something else missing?

There is no disk. I'm using it to power a PIC :)

Gerrit

#3
I checked it on a A10 because it uses the same GPIO setting but i noticed it is not the same in the fex file
A10
[gpio_para]
gpio_used = 1
gpio_num = 81
gpio_pin_1 = port:PG00<0><default><default><default>
gpio_pin_2 = port:PG01<0><default><default><default>
gpio_pin_3 = port:PG02<0><default><default><default>
gpio_pin_4 = port:PG03<0><default><default><default>
gpio_pin_5 = port:PG04<0><default><default><default>
gpio_pin_6 = port:PG05<0><default><default><default>
gpio_pin_7 = port:PG06<0><default><default><default>
gpio_pin_8 = port:PG07<0><default><default><default>
gpio_pin_9 = port:PG08<0><default><default><default>
gpio_pin_10 = port:PG11<0><default><default><default>
gpio_pin_11 = port:PC03<0><default><default><default>


A20
[sata_para]
sata_used = 1
sata_power_en = port:PC03<1><default><default><0>


A20
[gpio_para]
gpio_used = 1
gpio_num = 67
gpio_pin_1 = port:PG00<0><default><default><default>
gpio_pin_2 = port:PG01<0><default><default><default>
gpio_pin_3 = port:PG02<0><default><default><default>
gpio_pin_4 = port:PG03<0><default><default><default>
gpio_pin_5 = port:PG04<0><default><default><default>
gpio_pin_6 = port:PG05<0><default><default><default>
gpio_pin_7 = port:PG06<0><default><default><default>
gpio_pin_8 = port:PG07<0><default><default><default>
gpio_pin_9 = port:PG08<0><default><default><default>
gpio_pin_10 = port:PG09<0><default><default><default>
gpio_pin_11 = port:PC07<0><default><default><default>


I guess set sata_used = 0 and attach PC03 to a gpio_pin would be the solution

jmss

Thanks for checking that.

But if internally I set PC03 it should anyway interfere with SATA power.

In Ubuntu, DTS files are used instead of the FEX file and the entry looks like this:

pinctrl@01c20800 {
                        ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
                                allwinner,pins = "PC3";
                                allwinner,function = "gpio_out";
                                allwinner,drive = <0>;
                                allwinner,pull = <0>;
                        };


But in fact it may not be connected to GPIO 11 as in the case of Debian. I took the value 11 from https://www.olimex.com/wiki/A20-OLinuXino-LIME#GPIO_under_Linux but this is for Debian.

I'll try to find which GPIO to export to use PC3 in Ubuntu.