M
M
Maxim Petrov2019-01-23 16:12:13
linux
Maxim Petrov, 2019-01-23 16:12:13

How to make SD work in mmc-spi mode on Altera NIOS2 processor running Linux?

Hello.
I have a NIOS2 software processor running Linux with kernel 4.9.76. An SD card is connected to the processor via the Altera spi (3-wire) IP core. The kernel has support for Altera SPI Controller and MMC/SD over SPI.
A section describing the connection has been added to the dts file:

SDcard: [email protected] {
#address-cells = <1>;
#size-cells = <0>;
compatible = "altr,spi-18.0", "altr,spi-1.0";
reg = <0x00000000 0x00000020>;
interrupt-parent = <&nios2_gen2_0>;
interrupts = <3>;
[email protected] {
compatible = "mmc-spi-slot";
spi-max-frequency = <10000000>;
reg=<0x00000000>;
voltage-ranges = <3300 3300>;
status="okay";
}; //end [email protected]
};

When loading the OS, messages are constantly issued mmc0: error -110 whilst initialising SD card
Not very good at working with mmc. I climbed inside the driver with a debugger and saw that an error is generated when the flash drive is initialized in the mmc_wait_for_app_cmd function after successfully reading the OCR and CID registers.
Tried to install another flash. The situation is the same. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2019-01-23
@jcmvbkbc

error -110 whilst initialising SD card
What could be the problem?

110 -- ETIMEDOUT. There's still a lot of things happening "after a successful reading of the OCR and CID registers", you need to more accurately determine the place where the error comes from.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question