Hi all,
Now I am writing a code to use the SD card to load the firmware, but not use the DMA.
The MMU configuration is as below:
void MMUConfigAndEnable(void) { /* ** Define DDR memory region of AM335x. DDR can be configured as Normal ** memory with R/W access in user/privileged modes. The cache attributes ** specified here are, ** Inner - Write through, No Write Allocate ** Outer - Write Back, Write Allocate */ REGION regionDdr = { MMU_PGTYPE_SECTION, START_ADDR_DDR, NUM_SECTIONS_DDR, MMU_MEMTYPE_NORMAL_NON_SHAREABLE(MMU_CACHE_WT_NOWA, MMU_CACHE_WB_WA), MMU_REGION_NON_SECURE, MMU_AP_PRV_RW_USR_RW, (unsigned int*)pageTable }; /* ** Define OCMC RAM region of AM335x. Same Attributes of DDR region given. */ REGION regionOcmc = { MMU_PGTYPE_SECTION, START_ADDR_OCMC, NUM_SECTIONS_OCMC, MMU_MEMTYPE_NORMAL_NON_SHAREABLE(MMU_CACHE_WT_NOWA, MMU_CACHE_WB_WA), MMU_REGION_NON_SECURE, MMU_AP_PRV_RW_USR_RW, (unsigned int*)pageTable }; /* ** Define Device Memory Region. The region between OCMC and DDR is ** configured as device memory, with R/W access in user/privileged modes. ** Also, the region is marked 'Execute Never'. */ REGION regionDev = { MMU_PGTYPE_SECTION, START_ADDR_DEV, NUM_SECTIONS_DEV, MMU_MEMTYPE_STRONG_ORD_SHAREABLE, MMU_REGION_NON_SECURE, MMU_AP_PRV_RW_USR_RW | MMU_SECTION_EXEC_NEVER, (unsigned int*)pageTable }; /* Initialize the page table and MMU */ MMUInit((unsigned int*)pageTable); /* Map the defined regions */ MMUMemRegionMap(®ionDdr); MMUMemRegionMap(®ionOcmc); MMUMemRegionMap(®ionDev); /* Now Safe to enable MMU */ MMUEnable((unsigned int*)pageTable); }
With this configuration, the auto_mount will return error in the ff.c. While, when I disable the cache by comment out CacheEnable(CACHE_ALL);, it can work well.
For the device memory, I tried the MMU_MEMTYPE_STRONG_ORD_SHAREABLE, the same issue. and when tried MMU_MEMTYPE_DEVICE_NON_SHAREABLE, the uart, and SDIO will not work at all.
So could you help to check it, and give some comments on how to configure the cache.
Thanks!
Yaoming.