You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/12/20 15:15:07 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5040: mpfs: add opensbi support

pkarashchenko commented on a change in pull request #5040:
URL: https://github.com/apache/incubator-nuttx/pull/5040#discussion_r772446177



##########
File path: arch/risc-v/src/mpfs/mpfs_cache.c
##########
@@ -121,11 +144,28 @@ void mpfs_enable_cache(void)
   putreg32(LIBERO_SETTING_WAY_MASK_U54_4_ICACHE,
            MPFS_CACHE_WAY_MASK_U54_4_ICACHE);
 
-  /* L2 scratchpad region needs to be configured right here.  Currently
-   * we have no OpenSBI or other modules using the region so it isn't
-   * configured.  This corresponds to LIBERO_SETTING_NUM_SCRATCH_PAD_WAYS
-   * = 0.
-   */
+  /* Assign ways to Zero Device */
+
+  for (ways_inc = 0; ways_inc < LIBERO_SETTING_NUM_SCRATCH_PAD_WAYS; \

Review comment:
       ```suggestion
     for (ways_inc = 0; ways_inc < LIBERO_SETTING_NUM_SCRATCH_PAD_WAYS;
   ```

##########
File path: arch/risc-v/src/mpfs/mpfs_cache.c
##########
@@ -121,11 +144,28 @@ void mpfs_enable_cache(void)
   putreg32(LIBERO_SETTING_WAY_MASK_U54_4_ICACHE,
            MPFS_CACHE_WAY_MASK_U54_4_ICACHE);
 
-  /* L2 scratchpad region needs to be configured right here.  Currently
-   * we have no OpenSBI or other modules using the region so it isn't
-   * configured.  This corresponds to LIBERO_SETTING_NUM_SCRATCH_PAD_WAYS
-   * = 0.
-   */
+  /* Assign ways to Zero Device */
+
+  for (ways_inc = 0; ways_inc < LIBERO_SETTING_NUM_SCRATCH_PAD_WAYS; \
+       ++ways_inc)
+    {
+      /* Populate the scratchpad memory one way at a time */
+
+      putreg32(current_way, MPFS_CACHE_WAY_MASK_E51_DCACHE);
+      mb();
+
+      /* Write to the first 64-bit location of each cache block */
+
+      for (inc = 0; inc < (MPFS_WAY_BYTE_LENGTH / \

Review comment:
       ```suggestion
         for (inc = 0; inc < (MPFS_WAY_BYTE_LENGTH /
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org