Skip to content

Commit b850f1b

Browse files
MCHP-MPU-Solutions-SHAcfriedt
authored andcommitted
soc: microchip: sam: update for sama7g5 sdmmc
Update MMU and GCLK configurations for sdmmc. Signed-off-by: CHEN Xing <[email protected]>
1 parent d04ae0f commit b850f1b

File tree

1 file changed

+16
-0
lines changed
  • soc/microchip/sam/sama7g5

1 file changed

+16
-0
lines changed

soc/microchip/sam/sama7g5/soc.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ static const struct arm_mmu_region mmu_regions[] = {
3535

3636
MMU_REGION_FLAT_ENTRY("sckc", SCKC_BASE_ADDRESS, 0x4,
3737
MT_STRONGLY_ORDERED | MPERM_R | MPERM_W),
38+
39+
MMU_REGION_FLAT_ENTRY("sdmmc0", SDMMC0_BASE_ADDRESS, 0x4000,
40+
MT_STRONGLY_ORDERED | MPERM_R | MPERM_W),
41+
42+
MMU_REGION_FLAT_ENTRY("sdmmc1", SDMMC1_BASE_ADDRESS, 0x4000,
43+
MT_STRONGLY_ORDERED | MPERM_R | MPERM_W),
3844
};
3945

4046
const struct arm_mmu_config mmu_config = {
@@ -53,4 +59,14 @@ void soc_early_init_hook(void)
5359
PMC_REGS->PMC_PCR = PMC_PCR_CMD(1) | PMC_PCR_GCLKEN(1) | PMC_PCR_EN(1) |
5460
PMC_PCR_GCLKDIV(40 - 1) | PMC_PCR_GCLKCSS_SYSPLL |
5561
PMC_PCR_PID(ID_PIT64B0);
62+
63+
/* Enable Generic clock for SDMMC0, frequency is 200MHz */
64+
PMC_REGS->PMC_PCR = PMC_PCR_CMD(1) | PMC_PCR_GCLKEN(1) | PMC_PCR_EN(1) |
65+
PMC_PCR_GCLKDIV(2 - 1) | PMC_PCR_GCLKCSS_SYSPLL |
66+
PMC_PCR_PID(ID_SDMMC0);
67+
68+
/* Enable Generic clock for SDMMC1, frequency is 200MHz */
69+
PMC_REGS->PMC_PCR = PMC_PCR_CMD(1) | PMC_PCR_GCLKEN(1) | PMC_PCR_EN(1) |
70+
PMC_PCR_GCLKDIV(2 - 1) | PMC_PCR_GCLKCSS_SYSPLL |
71+
PMC_PCR_PID(ID_SDMMC1);
5672
}

0 commit comments

Comments
 (0)