m5stack_core2: SDHC: SD card support added

* SD card support via sdhc-spi driver added. SPI speed is
configured to 20MHz for stability reasons. Some cards
seem to not working properly with 25HMz or even higher speeds.
* Pinmux ctrl for SPI3 pins reworked. Native cs removed
as gpio chip-selects are required.

Signed-off-by: Martin Kiepfer <mrmarteng@teleschirm.org>
This commit is contained in:
Martin Kiepfer 2023-11-26 16:27:41 +01:00 committed by Henrik Brix Andersen
parent c1bbd48659
commit 04c165ad4d
2 changed files with 16 additions and 15 deletions

View file

@ -39,8 +39,7 @@
spim3_default: spim3_default {
group1 {
pinmux = <SPIM3_MISO_GPIO38>,
<SPIM3_SCLK_GPIO18>,
<SPIM3_CSEL_GPIO5>;
<SPIM3_SCLK_GPIO18>;
};
group2 {
pinmux = <SPIM3_MOSI_GPIO23>;
@ -48,18 +47,6 @@
};
};
spim2_default: spim2_default {
group1 {
pinmux = <SPIM2_SCLK_GPIO6>,
<SPIM2_MISO_GPIO7>,
<SPIM2_CSEL_GPIO11>;
};
group2 {
pinmux = <SPIM2_MOSI_GPIO8>;
output-low;
};
};
i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SDA_GPIO21>,

View file

@ -182,10 +182,12 @@
pinctrl-names = "default";
dma-enabled;
clock-frequency = <20000000>;
cs-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
cs-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>,
<&gpio0 4 GPIO_ACTIVE_LOW>;
ili9342c: ili9342c@0 {
compatible = "ilitek,ili9342c";
status = "okay";
spi-max-frequency = <30000000>;
reg = <0>;
cmd-data-gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
@ -197,6 +199,18 @@
height = <240>;
rotation = <0>;
};
sdhc0: sdhc@1 {
compatible = "zephyr,sdhc-spi-slot";
reg = <1>;
status = "okay";
spi-max-frequency = <20000000>;
mmc {
compatible = "zephyr,sdmmc-disk";
status = "okay";
};
};
};