-
- /* If target has no cache, always use BUS mode
- * to access memory. */
- struct nds32_memory *memory = &(nds32->memory);
-
- if (memory->dcache.line_size == 0) {
- /* There is no Dcache. */
- nds32->memory.access_channel = NDS_MEMORY_ACC_BUS;
- } else if (memory->dcache.enable == false) {
- /* Dcache is disabled. */
- nds32->memory.access_channel = NDS_MEMORY_ACC_BUS;
- } else {
- /* There is Dcache and Dcache is enabled. */
- if (strcmp(CMD_ARGV[0], "bus") == 0)
- nds32->memory.access_channel = NDS_MEMORY_ACC_BUS;
- else if (strcmp(CMD_ARGV[0], "cpu") == 0)
- nds32->memory.access_channel = NDS_MEMORY_ACC_CPU;
- else /* default access channel is NDS_MEMORY_ACC_CPU */
- nds32->memory.access_channel = NDS_MEMORY_ACC_CPU;
- }
-
- aice_memory_access(aice, nds32->memory.access_channel);
+ if (strcmp(CMD_ARGV[0], "bus") == 0)
+ memory->access_channel = NDS_MEMORY_ACC_BUS;
+ else if (strcmp(CMD_ARGV[0], "cpu") == 0)
+ memory->access_channel = NDS_MEMORY_ACC_CPU;
+ else /* default access channel is NDS_MEMORY_ACC_CPU */
+ memory->access_channel = NDS_MEMORY_ACC_CPU;
+
+ LOG_DEBUG("memory access channel is changed to %s",
+ NDS_MEMORY_ACCESS_NAME[memory->access_channel]);
+
+ aice_memory_access(aice, memory->access_channel);
+ } else {
+ command_print(CMD_CTX, "%s: memory access channel: %s",
+ target_name(target),
+ NDS_MEMORY_ACCESS_NAME[memory->access_channel]);