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                         sdc0@1 {
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                         sdc0@1 {
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                         sdc0@0 {
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                         sdc0@0 {
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                 sdmmc@01c0f000 {
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                 sdmmc@01c0f000 {
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! )


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 1080p power/barrel connector/cable cel 0 533 08-03-2023, 11:43 AM
Last Post: cel
  eMMC compatible with Pinebook leperotero 0 1,355 07-19-2022, 07:15 AM
Last Post: leperotero
Heart [solved] Anyone selling their Pinebook? feyn 0 1,205 07-11-2022, 03:38 PM
Last Post: feyn
  Move PB Pro eMMC 128 GB to Pinebook 11 1080p petet0n76 1 1,611 06-07-2022, 10:35 PM
Last Post: tllim
  UART switch Pinebook 11.6" irongarment 3 3,281 01-03-2022, 03:28 AM
Last Post: kqlnut
Exclamation "6" Key direly needed for 11" Pinebook Corkonian 1 2,573 09-25-2021, 12:03 AM
Last Post: tllim
  SD card read/write troubles jezek 1 2,963 03-26-2021, 09:27 AM
Last Post: jezek
  Pinebook 14 " Battery Swollen/Bulged billjon 1 3,581 01-13-2021, 11:03 AM
Last Post: barray
  touchpad on pinebook issues? ron_burgundy 14 13,652 12-19-2020, 06:55 PM
Last Post: ron_burgundy
  CH341 boards for GPIO xalius 1 4,111 11-22-2020, 10:50 AM
Last Post: pinephonenewbee

Forum Jump:


Users browsing this thread: 1 Guest(s)