Pinebook SDIO gpio control using SD card slot blog post
#6
The purpose of this post is to document the changes I made to the dts;  these changes are experimental and may not be entirely correct. Do not copy these changes;  or do so at your own risk.  These changes are static (I recompiled the dtb and the changes do not modify on-the-fly). 

The dts is decompiled from the ayufan image 0.7.3 using dtc device-tree-compiler. I made three sets of changes; each will be listed in its own code block with line numbers.  Essentially the changes disable the sdmmc for @sdc0 and set the bindings (may not be correct) for @sdc0  gpio(s)  PF0 - PF5.

The changes are listed in the order they appear in the source:

When I make changes to my experimental dts, I will update these code blocks to reflect the most recent revision;  the following is the second revision.

[change 1]

Code:
[old source 1]
948                         [email protected] {
949                                 allwinner,pins = "PF0", "PF1", "PF2", "PF3"     , "PF4", "PF5";
950                                 allwinner,function = "io_disabled";
951                                 allwinner,muxsel = <0x7>;
952                                 allwinner,drive = <0x1>;
953                                 allwinner,pull = <0x1>;
954                                 linux,phandle = <0x64>;
955                                 phandle = <0x64>;
956                         };

[new change 1]  950, 951, 953
948                         [email protected] {
949                                 allwinner,pins = "PF0", "PF1", "PF2", "PF3"     , "PF4", "PF5";
950                                 allwinner,function = "gpio_in";
951                                 allwinner,muxsel = <0x0>;
952                                 allwinner,drive = <0x0>;
953                                 allwinner,pull = <0x1>;
954                                 linux,phandle = <0x64>;
955                                 phandle = <0x64>;
956                         };

[change 2]

Code:
[old source 2]
1554                         [email protected] {
1555                                 linux,phandle = <0xc0>;
1556                                 phandle = <0xc0>;
1557                                 allwinner,pins = "PF0", "PF1", "PF2", "PF3"     , "PF4", "PF5";
1558                                 allwinner,function = "sdc0";
1559                                 allwinner,pname = "sdc0_d1", "sdc0_d0", "sd     c0_clk", "sdc0_cmd", "sdc0_d3", "sdc0_d2";
1560                                 allwinner,muxsel = <0x2>;
1561                                 allwinner,pull = <0x1>;
1562                                 allwinner,drive = <0x2>;
1563                                 allwinner,data = <0xffffffff>;
1564                         };

[new change 2]   1560, 1562
1554                         [email protected] {
1555                                 linux,phandle = <0xc0>;
1556                                 phandle = <0xc0>;
1557                                 allwinner,pins = "PF0", "PF1", "PF2", "PF3"     , "PF4", "PF5";
1558                                 allwinner,function = "sdc0";
1559                                 allwinner,pname = "sdc0_d1", "sdc0_d0", "sd     c0_clk", "sdc0_cmd", "sdc0_d3", "sdc0_d2";
1560                                 allwinner,muxsel = <0x0>;
1561                                 allwinner,pull = <0x1>;
1562                                 allwinner,drive = <0x0>;
1563                                 allwinner,data = <0xffffffff>;
1564                         };

[change 3]

Code:
[old source 3]
2169                 [email protected] {
2170                         compatible = "allwinner,sun50i-sdmmc0";
2171                         device_type = "sdc0";
2172                         reg = <0x0 0x1c0f000 0x0 0x1000>;
2173                         interrupts = <0x0 0x3c 0x104>;
2174                         clocks = <0x6 0x5a 0x60 0x61 0x62>;
2175                         clock-names = "osc24m", "pll_periph", "mmc", "ahb",      "rst";
2176                         pinctrl-names = "default", "sleep";
2177                         pinctrl-1 = <0x64>;
2178                         max-frequency = <0x2faf080>;
2179                         bus-width = <0x4>;
2180                         broken-cd;
2181                         status = "okay";
2182                         pinctrl-0 = <0xc0>;
2183                         cd-gpios = <0x30 0x5 0x6 0x0 0x1 0x2 0xffffffff>;
2184                         sunxi-power-save-mode;
2185                         vmmc = "vcc-sdcv";
2186                         vqmmc = "vcc-sdcvq33";
2187                         vdmmc = "vcc-sdc";
2188                 };

[new change 3]   2181
2169                 [email protected] {
2170                         compatible = "allwinner,sun50i-sdmmc0";
2171                         device_type = "sdc0";
2172                         reg = <0x0 0x1c0f000 0x0 0x1000>;
2173                         interrupts = <0x0 0x3c 0x104>;
2174                         clocks = <0x6 0x5a 0x60 0x61 0x62>;
2175                         clock-names = "osc24m", "pll_periph", "mmc", "ahb",      "rst";
2176                         pinctrl-names = "default", "sleep";
2177                         pinctrl-1 = <0x64>;
2178                         max-frequency = <0x2faf080>;
2179                         bus-width = <0x4>;
2180                         broken-cd;
2181                         status = "disabled";
2182                         pinctrl-0 = <0xc0>;
2183                         cd-gpios = <0x30 0x5 0x6 0x0 0x1 0x2 0xffffffff>;
2184                         sunxi-power-save-mode;
2185                         vmmc = "vcc-sdcv";
2186                         vqmmc = "vcc-sdcvq33";
2187                         vdmmc = "vcc-sdc";
2188                 };


Note:   Line numbers following [new change X] indicate specific changed lines.

Note:   The original source may be compared with the changed source in each code block.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply


Messages In This Thread
RE: Pinebook SDIO gpio control using SD card slot blog post - by MarkHaysHarris777 - 07-23-2017, 04:14 AM

Possibly Related Threads...
Thread Author Replies Views Last Post
  pinebook to pro upgrade path? dhosh 13 626 11-14-2019, 11:25 AM
Last Post: bcnaz
  Pinebook 11" Keyboard Corkonian 2 204 11-02-2019, 07:41 AM
Last Post: Corkonian
  Pinebook battery connector and reuse binholz 2 231 10-17-2019, 11:05 AM
Last Post: tophneal
  [SOLVED] Pinebook stopped to charge UltraBloxX 7 472 10-17-2019, 04:09 AM
Last Post: pfeerick
  Pinebook 1080p screen with other SBC? binholz 5 314 08-07-2019, 05:56 AM
Last Post: jezek
  Pinebook internals kodkuce 1 334 07-30-2019, 02:45 PM
Last Post: binholz
  how to install emmc in just arrived pinebook dkebler 11 6,574 06-13-2019, 01:13 AM
Last Post: zk1sps
  Pinebook Pro Video Out Options faroh8Je 2 184 06-12-2019, 05:16 AM
Last Post: Luke
  Pinebook HDMI not working DarkShadow 3 279 05-16-2019, 03:56 PM
Last Post: DarkShadow
  Pinebook Pro Network diagnostics hardware xavi 3 282 05-01-2019, 09:53 PM
Last Post: tllim

Forum Jump:


Users browsing this thread: 1 Guest(s)