Skip to content

Commit cb6612a

Browse files
balika011frank-w
authored andcommitted
msdc: multi-slot support
1 parent 6fe6aaa commit cb6612a

File tree

5 files changed

+910
-510
lines changed

5 files changed

+910
-510
lines changed

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso

-43
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,6 @@
1111
compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
1212

1313
fragment@0 {
14-
target-path = "/soc/mmc@11230000";
15-
__overlay__ {
16-
pinctrl-names = "default", "state_uhs";
17-
pinctrl-0 = <&mmc0_pins_emmc_51>;
18-
pinctrl-1 = <&mmc0_pins_emmc_51>;
19-
bus-width = <8>;
20-
max-frequency = <200000000>;
21-
cap-mmc-highspeed;
22-
mmc-hs200-1_8v;
23-
mmc-hs400-1_8v;
24-
hs400-ds-delay = <0x12814>;
25-
vqmmc-supply = <&reg_1p8v>;
26-
vmmc-supply = <&reg_3p3v>;
27-
non-removable;
28-
no-sd;
29-
no-sdio;
30-
status = "okay";
31-
#address-cells = <1>;
32-
#size-cells = <0>;
33-
34-
card@0 {
35-
compatible = "mmc-card";
36-
reg = <0>;
37-
38-
block {
39-
compatible = "block-device";
40-
partitions {
41-
block-partition-env {
42-
partname = "ubootenv";
43-
nvmem-layout {
44-
compatible = "u-boot,env-layout";
45-
};
46-
};
47-
emmc_rootfs: block-partition-production {
48-
partname = "production";
49-
};
50-
};
51-
};
52-
};
53-
};
54-
};
55-
56-
fragment@2 {
5714
target-path = "/chosen";
5815
__overlay__ {
5916
rootdisk-emmc = <&emmc_rootfs>;

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso

-41
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,10 @@
77
/dts-v1/;
88
/plugin/;
99

10-
#include <dt-bindings/gpio/gpio.h>
11-
1210
/ {
1311
compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
1412

1513
fragment@1 {
16-
target-path = "/soc/mmc@11230000";
17-
__overlay__ {
18-
pinctrl-names = "default", "state_uhs";
19-
pinctrl-0 = <&mmc0_pins_sdcard>;
20-
pinctrl-1 = <&mmc0_pins_sdcard>;
21-
cd-gpios = <&pio 12 GPIO_ACTIVE_LOW>;
22-
bus-width = <4>;
23-
max-frequency = <52000000>;
24-
cap-sd-highspeed;
25-
vmmc-supply = <&reg_3p3v>;
26-
vqmmc-supply = <&reg_3p3v>;
27-
no-mmc;
28-
status = "okay";
29-
#address-cells = <1>;
30-
#size-cells = <0>;
31-
32-
card@0 {
33-
compatible = "mmc-card";
34-
reg = <0>;
35-
36-
block {
37-
compatible = "block-device";
38-
partitions {
39-
block-partition-env {
40-
partname = "ubootenv";
41-
nvmem-layout {
42-
compatible = "u-boot,env-layout";
43-
};
44-
};
45-
sd_rootfs: block-partition-production {
46-
partname = "production";
47-
};
48-
};
49-
};
50-
};
51-
};
52-
};
53-
54-
fragment@2 {
5514
target-path = "/chosen";
5615
__overlay__ {
5716
rootdisk-sd = <&sd_rootfs>;

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts

+101
Original file line numberDiff line numberDiff line change
@@ -407,3 +407,104 @@
407407
&xphy {
408408
status = "okay";
409409
};
410+
411+
&msdc {
412+
status = "okay";
413+
#address-cells = <1>;
414+
#size-cells = <0>;
415+
416+
pinctrl-names = "emmc-default", "emmc-state_uhs", "sdcard-default", "sdcard-state_uhs";
417+
pinctrl-0 = <&mmc_pins_emmc_51>;
418+
pinctrl-1 = <&mmc_pins_emmc_51>;
419+
pinctrl-2 = <&mmc_pins_sdcard>;
420+
pinctrl-3 = <&mmc_pins_sdcard>;
421+
422+
mmc0: slot@0 {
423+
compatible = "mediatek,mmc-slot";
424+
reg = <0>;
425+
426+
bus-width = <8>;
427+
max-frequency = <200000000>;
428+
429+
pinctrl-default = "emmc-default";
430+
pinctrl-state_uhs = "emmc-state_uhs";
431+
432+
cap-mmc-highspeed;
433+
434+
mmc-hs200-1_8v;
435+
mmc-hs400-1_8v;
436+
hs400-ds-delay = <0x12814>;
437+
vqmmc-supply = <&reg_1p8v>;
438+
vmmc-supply = <&reg_3p3v>;
439+
440+
non-removable;
441+
no-sd;
442+
no-sdio;
443+
444+
#address-cells = <1>;
445+
#size-cells = <0>;
446+
447+
card@0 {
448+
compatible = "mmc-card";
449+
reg = <0>;
450+
451+
block {
452+
compatible = "block-device";
453+
partitions {
454+
block-partition-env {
455+
partname = "ubootenv";
456+
nvmem-layout {
457+
compatible = "u-boot,env-layout";
458+
};
459+
};
460+
emmc_rootfs: block-partition-production {
461+
partname = "production";
462+
};
463+
};
464+
};
465+
};
466+
};
467+
468+
mmc1: slot@1 {
469+
compatible = "mediatek,mmc-slot";
470+
reg = <1>;
471+
472+
pinctrl-default = "sdcard-default";
473+
pinctrl-state_uhs = "sdcard-state_uhs";
474+
475+
cd-gpios = <&pio 12 GPIO_ACTIVE_LOW>;
476+
477+
bus-width = <4>;
478+
max-frequency = <52000000>;
479+
480+
cap-sd-highspeed;
481+
482+
vqmmc-supply = <&reg_3p3v>;
483+
vmmc-supply = <&reg_3p3v>;
484+
485+
no-mmc;
486+
487+
#address-cells = <1>;
488+
#size-cells = <0>;
489+
490+
card@0 {
491+
compatible = "mmc-card";
492+
reg = <0>;
493+
494+
block {
495+
compatible = "block-device";
496+
partitions {
497+
block-partition-env {
498+
partname = "ubootenv";
499+
nvmem-layout {
500+
compatible = "u-boot,env-layout";
501+
};
502+
};
503+
sd_rootfs: block-partition-production {
504+
partname = "production";
505+
};
506+
};
507+
};
508+
};
509+
};
510+
};

arch/arm64/boot/dts/mediatek/mt7988a.dtsi

+4-4
Original file line numberDiff line numberDiff line change
@@ -433,21 +433,21 @@
433433
};
434434
};
435435

436-
mmc0_pins_emmc_45: mmc0-emmc-45-pins {
436+
mmc_pins_emmc_45: mmc-emmc-45-pins {
437437
mux {
438438
function = "flash";
439439
groups = "emmc_45";
440440
};
441441
};
442442

443-
mmc0_pins_emmc_51: mmc0-emmc-51-pins {
443+
mmc_pins_emmc_51: mmc-emmc-51-pins {
444444
mux {
445445
function = "flash";
446446
groups = "emmc_51";
447447
};
448448
};
449449

450-
mmc0_pins_sdcard: mmc0-sdcard-pins {
450+
mmc_pins_sdcard: mmc-sdcard-pins {
451451
mux {
452452
function = "flash";
453453
groups = "sdcard";
@@ -859,7 +859,7 @@
859859
status = "disabled";
860860
};
861861

862-
mmc0: mmc@11230000 {
862+
msdc: mmc@11230000 {
863863
compatible = "mediatek,mt7988-mmc";
864864
reg = <0 0x11230000 0 0x1000>,
865865
<0 0x11D60000 0 0x1000>;

0 commit comments

Comments
 (0)