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 2022/10/12 02:58:34 UTC

[GitHub] [incubator-nuttx] zyfeier opened a new pull request, #7288: armv7-a: add l2 page mapping interface

zyfeier opened a new pull request, #7288:
URL: https://github.com/apache/incubator-nuttx/pull/7288

   ## Summary
   
   Add ARMv7-A L2 page mapping interface.
   
   User can use these interface to configure 4K L2 page when CONFIG_PAGING is not enable.
   The mmu_l2_map_page function is used to configure consecutive page tables.
   And mmu_l1_map_page function is used to configure an entry point to an L2 translation table.
   
   ## Impact
   
   NA
   
   ## Testing
   
   Test use V200Z-R-EVB board.


-- 
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


[GitHub] [incubator-nuttx] masayuki2009 commented on a diff in pull request #7288: armv7-a: add l2 page mapping interface

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on code in PR #7288:
URL: https://github.com/apache/incubator-nuttx/pull/7288#discussion_r992985722


##########
arch/arm/src/armv7-a/mmu.h:
##########
@@ -605,10 +605,17 @@
 #endif
 
 #define MMU_L1_DATAFLAGS      (PMD_TYPE_PTE | PMD_PTE_PXN | PMD_PTE_DOM(0))
-#define MMU_L2_UDATAFLAGS     (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW01)
-#define MMU_L2_KDATAFLAGS     (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW1)
-#define MMU_L2_UALLOCFLAGS    (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW01)
-#define MMU_L2_KALLOCFLAGS    (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW1)
+#ifndef CONFIG_SMP
+#  define MMU_L2_UDATAFLAGS   (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW01)
+#  define MMU_L2_KDATAFLAGS   (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW1)
+#  define MMU_L2_UALLOCFLAGS  (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW01)
+#  define MMU_L2_KALLOCFLAGS  (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW1)
+#else
+#  define MMU_L2_UDATAFLAGS   (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_S | PTE_AP_RW01)
+#  define MMU_L2_KDATAFLAGS   (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_S | PTE_AP_RW1)
+#  define MMU_L2_UALLOCFLAGS  (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_S | PTE_AP_RW01)
+#  define MMU_L2_KALLOCFLAGS  (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_S | PTE_AP_RW1)
+#endif

Review Comment:
   @zyfeier 
   I think the above changes regarding macros do not relate to the new l2 page mapping interface.
   



-- 
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


[GitHub] [incubator-nuttx] zyfeier commented on a diff in pull request #7288: armv7-a: add l2 page mapping interface

Posted by GitBox <gi...@apache.org>.
zyfeier commented on code in PR #7288:
URL: https://github.com/apache/incubator-nuttx/pull/7288#discussion_r993185388


##########
arch/arm/src/armv7-a/mmu.h:
##########
@@ -605,10 +605,17 @@
 #endif
 
 #define MMU_L1_DATAFLAGS      (PMD_TYPE_PTE | PMD_PTE_PXN | PMD_PTE_DOM(0))
-#define MMU_L2_UDATAFLAGS     (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW01)
-#define MMU_L2_KDATAFLAGS     (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW1)
-#define MMU_L2_UALLOCFLAGS    (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW01)
-#define MMU_L2_KALLOCFLAGS    (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW1)
+#ifndef CONFIG_SMP
+#  define MMU_L2_UDATAFLAGS   (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW01)
+#  define MMU_L2_KDATAFLAGS   (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW1)
+#  define MMU_L2_UALLOCFLAGS  (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW01)
+#  define MMU_L2_KALLOCFLAGS  (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_AP_RW1)
+#else
+#  define MMU_L2_UDATAFLAGS   (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_S | PTE_AP_RW01)
+#  define MMU_L2_KDATAFLAGS   (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_S | PTE_AP_RW1)
+#  define MMU_L2_UALLOCFLAGS  (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_S | PTE_AP_RW01)
+#  define MMU_L2_KALLOCFLAGS  (PTE_TYPE_SMALL | PTE_WRITE_BACK | PTE_S | PTE_AP_RW1)
+#endif

Review Comment:
   Yes, i'll split into two patch.



##########
arch/arm/src/armv7-a/mmu.h:
##########
@@ -907,6 +914,21 @@ struct section_mapping_s
   uint32_t mmuflags;   /* MMU settings for the region (e.g., cache-able) */
   uint32_t nsections;  /* Number of mappings in the region */
 };
+
+struct page_entry_s
+{
+  uint32_t physbase;        /* Physical address of the region to be mapped */
+  uint32_t virtbase;        /* Virtual address of the region to be mapped */
+  uint32_t mmuflags;        /* MMU settings for the region (e.g., cache-able) */
+  uint32_t npages;          /* Number of mappings in the region */
+};
+
+struct page_mapping_s
+{
+  uint32_t l2table;           /* Virtual address of l2 table */
+  uint32_t entrynum;          /* Page entry number */
+  struct page_entry_s *entry; /* Page entry */

Review Comment:
   Done



-- 
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


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #7288: armv7-a: add l2 page mapping interface

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7288:
URL: https://github.com/apache/incubator-nuttx/pull/7288


-- 
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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7288: armv7-a: add l2 page mapping interface

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7288:
URL: https://github.com/apache/incubator-nuttx/pull/7288#discussion_r992963782


##########
arch/arm/src/armv7-a/mmu.h:
##########
@@ -907,6 +914,21 @@ struct section_mapping_s
   uint32_t mmuflags;   /* MMU settings for the region (e.g., cache-able) */
   uint32_t nsections;  /* Number of mappings in the region */
 };
+
+struct page_entry_s
+{
+  uint32_t physbase;        /* Physical address of the region to be mapped */
+  uint32_t virtbase;        /* Virtual address of the region to be mapped */
+  uint32_t mmuflags;        /* MMU settings for the region (e.g., cache-able) */
+  uint32_t npages;          /* Number of mappings in the region */
+};
+
+struct page_mapping_s
+{
+  uint32_t l2table;           /* Virtual address of l2 table */
+  uint32_t entrynum;          /* Page entry number */
+  struct page_entry_s *entry; /* Page entry */

Review Comment:
   add const?



-- 
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