1 // SPDX-License-Identifier: GPL-2.0+
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
10 static int mmc_nspi (const char *);
12 int do_dataflash_mmc_mux (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
15 case 2: /* on / off */
16 switch (mmc_nspi (argv[1])) {
17 case 0: AT91F_SelectSPI ();
19 case 1: AT91F_SelectMMC ();
22 case 1: /* get status */
23 printf ("Mux is configured to be %s\n",
24 AT91F_GetMuxStatus () ? "MMC" : "SPI");
32 static int mmc_nspi (const char *s)
34 if (strcmp (s, "mmc") == 0) {
36 } else if (strcmp (s, "spi") == 0) {
43 dataflash_mmc_mux, 2, 1, do_dataflash_mmc_mux,
44 "enable or disable MMC or SPI\n",
46 " - enable or disable MMC or SPI"