How to swap SD2_DATA3 and SD2_DATA0 in software?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to swap SD2_DATA3 and SD2_DATA0 in software?

1,384 Views
triedgetech
Contributor III

In PICO-PI-IMX8M-MINI, the top carrier/CPU's connector E1 has the pins for DATA0 and DATA3 in this order:

sd2.JPG

Which is not convenient for custom PCB

I'd like the connector's pin 66

swapped with DATA3, on software level.

I tried doing so by swapping the function names in imx8mm-pinfunc.h

Original:

 

#define MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0              0x0DC 0x344 0x000 0x0 0x0
#define MX8MM_IOMUXC_SD2_DATA0_GPIO2_IO15                0x0DC 0x344 0x000 0x5 0x0
#define MX8MM_IOMUXC_SD2_DATA0_CCMSRCGPCMIX_OBSERVE2     0x0DC 0x344 0x000 0x6 0x0
#define MX8MM_IOMUXC_SD2_DATA0_OBSERVE_MUX_OUT2          0x0DC 0x344 0x000 0x7 0x0
#define MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3              0x0E8 0x350 0x000 0x0 0x0
#define MX8MM_IOMUXC_SD2_DATA3_GPIO2_IO18                0x0E8 0x350 0x000 0x5 0x0
#define MX8MM_IOMUXC_SD2_DATA3_CCMSRCGPCMIX_EARLY_RESET  0x0E8 0x350 0x000 0x6 0x0

 

 

Swapped:

 

#define MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3                         0x0DC 0x344 0x000 0x0 0x0
#define MX8MM_IOMUXC_SD2_DATA3_GPIO2_IO18                           0x0DC 0x344 0x000 0x5 0x0
#define MX8MM_IOMUXC_SD2_DATA3_CCMSRCGPCMIX_EARLY_RESET             0x0DC 0x344 0x000 0x6 0x0

#define MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0                         0x0E8 0x350 0x000 0x0 0x0
#define MX8MM_IOMUXC_SD2_DATA0_GPIO2_IO15                           0x0E8 0x350 0x000 0x5 0x0
#define MX8MM_IOMUXC_SD2_DATA0_CCMSRCGPCMIX_OBSERVE2                0x0E8 0x350 0x000 0x6 0x0
#define MX8MM_IOMUXC_SD2_DATA0_OBSERVE_MUX_OUT2                     0x0E8 0x350 0x000 0x7 0x0

 

both in kernel and u-boot, relevant dts got recompiled (imx8mm-pico-pi.dtb), flashed/replaced them in the device's OS, yet I got sd card initialization error.

For some reason, changing imx8mm-pinfunc.h didn't alter the pin 66 or pin 68 functions, they stayed as they were, why??

How do I change functions for pin 66 and pin 68 (cpu balls AB23 and V23) respectively? Or is it not possible unless input-output multiplexer (IOMUX) allows it for a particular pad in the alternative function/mux_mode?

Tags (2)
0 Kudos
Reply
1 Reply

1,305 Views
kef2
Senior Contributor V

Not possible, unless you GPIO bit bang SD pads. If DATA0 would be not involved, then perhaps you could think about bit swapped contents in flash memory. As well, hmm, bit swapped addresses of flash memory. But DATA0 is used to send commands in single pin mode.. Single pin mode still is necessary at least to identify memory chip. 

Swapping IOMUX names doesn't make any sense. There's still USDHC controller inside of the chip with dedicated signal names data0-data3. IOMUX allows routing dataN to different pads, but there's no routing means to swap something like data0 with data3.

0 Kudos
Reply