3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
11 static int mmc_nspi (const char *);
13 int do_dataflash_mmc_mux (cmd_tbl_t
*cmdtp
, int flag
, int argc
, char * const argv
[])
16 case 2: /* on / off */
17 switch (mmc_nspi (argv
[1])) {
18 case 0: AT91F_SelectSPI ();
20 case 1: AT91F_SelectMMC ();
23 case 1: /* get status */
24 printf ("Mux is configured to be %s\n",
25 AT91F_GetMuxStatus () ? "MMC" : "SPI");
33 static int mmc_nspi (const char *s
)
35 if (strcmp (s
, "mmc") == 0) {
37 } else if (strcmp (s
, "spi") == 0) {
44 dataflash_mmc_mux
, 2, 1, do_dataflash_mmc_mux
,
45 "enable or disable MMC or SPI\n",
47 " - enable or disable MMC or SPI"