diff options
Diffstat (limited to 'board/ti/am57xx/board.c')
-rw-r--r-- | board/ti/am57xx/board.c | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 00f05986b4..72c4312837 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c | |||
@@ -712,7 +712,7 @@ err: | |||
712 | } | 712 | } |
713 | #endif | 713 | #endif |
714 | 714 | ||
715 | #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC) | 715 | #if defined(CONFIG_GENERIC_MMC) |
716 | int board_mmc_init(bd_t *bis) | 716 | int board_mmc_init(bd_t *bis) |
717 | { | 717 | { |
718 | omap_mmc_init(0, 0, 0, -1, -1); | 718 | omap_mmc_init(0, 0, 0, -1, -1); |
@@ -721,6 +721,67 @@ int board_mmc_init(bd_t *bis) | |||
721 | } | 721 | } |
722 | #endif | 722 | #endif |
723 | 723 | ||
724 | #if defined(CONFIG_IODELAY_RECALIBRATION) && \ | ||
725 | (defined(CONFIG_SPL_BUILD) || !defined(CONFIG_DM_MMC)) | ||
726 | |||
727 | struct pinctrl_desc { | ||
728 | const char *name; | ||
729 | struct omap_hsmmc_pinctrl_state *pinctrl; | ||
730 | }; | ||
731 | |||
732 | static struct pinctrl_desc pinctrl_descs_hsmmc1[] = { | ||
733 | {"default", &hsmmc1_default}, | ||
734 | {"hs", &hsmmc1_default}, | ||
735 | {NULL} | ||
736 | }; | ||
737 | |||
738 | static struct pinctrl_desc pinctrl_descs_hsmmc2_am572[] = { | ||
739 | {"default", &hsmmc2_default_hs}, | ||
740 | {"hs", &hsmmc2_default_hs}, | ||
741 | {"ddr_1_8v", &hsmmc2_ddr_am572}, | ||
742 | {NULL} | ||
743 | }; | ||
744 | |||
745 | static struct pinctrl_desc pinctrl_descs_hsmmc2_am571[] = { | ||
746 | {"default", &hsmmc2_default_hs}, | ||
747 | {"hs", &hsmmc2_default_hs}, | ||
748 | {"ddr_1_8v", &hsmmc2_ddr_am571}, | ||
749 | {NULL} | ||
750 | }; | ||
751 | |||
752 | struct omap_hsmmc_pinctrl_state *platform_fixup_get_pinctrl_by_mode | ||
753 | (struct hsmmc *base, const char *mode) | ||
754 | { | ||
755 | struct pinctrl_desc *p = NULL; | ||
756 | |||
757 | switch ((uint32_t)base) { | ||
758 | case OMAP_HSMMC1_BASE: | ||
759 | p = pinctrl_descs_hsmmc1; | ||
760 | break; | ||
761 | case OMAP_HSMMC2_BASE: | ||
762 | if (is_dra72x()) | ||
763 | p = pinctrl_descs_hsmmc2_am571; | ||
764 | else | ||
765 | p = pinctrl_descs_hsmmc2_am572; | ||
766 | break; | ||
767 | default: | ||
768 | break; | ||
769 | } | ||
770 | |||
771 | if (!p) { | ||
772 | printf("%s no pinctrl defined for MMC@%p\n", __func__, | ||
773 | base); | ||
774 | return NULL; | ||
775 | } | ||
776 | while (p->name) { | ||
777 | if (strcmp(mode, p->name) == 0) | ||
778 | return p->pinctrl; | ||
779 | p++; | ||
780 | } | ||
781 | return NULL; | ||
782 | } | ||
783 | #endif | ||
784 | |||
724 | #ifdef CONFIG_OMAP_HSMMC | 785 | #ifdef CONFIG_OMAP_HSMMC |
725 | int platform_fixup_disable_uhs_mode(void) | 786 | int platform_fixup_disable_uhs_mode(void) |
726 | { | 787 | { |