diff mbox

[3/4] ARM: nommu: display vectors base

Message ID 20170118203837.6536-1-afzal.mohd.ma@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

afzal mohammed Jan. 18, 2017, 8:38 p.m. UTC
The exception base address is now dynamically estimated for no-MMU
case, display it.

Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com>
---
 arch/arm/mm/init.c | 5 +++++
 arch/arm/mm/mm.h   | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

Comments

Russell King (Oracle) Jan. 18, 2017, 10:13 p.m. UTC | #1
On Thu, Jan 19, 2017 at 02:08:37AM +0530, afzal mohammed wrote:
> The exception base address is now dynamically estimated for no-MMU
> case, display it.
> 
> Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com>
> ---
>  arch/arm/mm/init.c | 5 +++++
>  arch/arm/mm/mm.h   | 5 +++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index cf47f86f79ed..9e11f255c3bf 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -522,7 +522,12 @@ void __init mem_init(void)
>  			"      .data : 0x%p" " - 0x%p" "   (%4td kB)\n"
>  			"       .bss : 0x%p" " - 0x%p" "   (%4td kB)\n",
>  
> +#ifdef CONFIG_MMU
>  			MLK(UL(VECTORS_BASE), UL(VECTORS_BASE) + (PAGE_SIZE)),
> +#else
> +			MLK_ROUNDUP(vectors_base, vectors_base + PAGE_SIZE),

I think MLK() will do here - no need to use the rounding-up version
as PAGE_SIZE is a multiple of 1k.
afzal mohammed Jan. 19, 2017, 1:16 p.m. UTC | #2
Hi,

On Wed, Jan 18, 2017 at 10:13:15PM +0000, Russell King - ARM Linux wrote:
> On Thu, Jan 19, 2017 at 02:08:37AM +0530, afzal mohammed wrote:

> > +			MLK_ROUNDUP(vectors_base, vectors_base + PAGE_SIZE),
> 
> I think MLK() will do here - no need to use the rounding-up version
> as PAGE_SIZE is a multiple of 1k.

Yes, i will replace it.

Earlier, used MLK(), got some build error, now checking again, no
build error, i should have messed up something at that time.

Regards
afzal
Russell King (Oracle) Jan. 30, 2017, 12:09 p.m. UTC | #3
On Thu, Jan 19, 2017 at 06:46:32PM +0530, Afzal Mohammed wrote:
> Hi,
> 
> On Wed, Jan 18, 2017 at 10:13:15PM +0000, Russell King - ARM Linux wrote:
> > On Thu, Jan 19, 2017 at 02:08:37AM +0530, afzal mohammed wrote:
> 
> > > +			MLK_ROUNDUP(vectors_base, vectors_base + PAGE_SIZE),
> > 
> > I think MLK() will do here - no need to use the rounding-up version
> > as PAGE_SIZE is a multiple of 1k.
> 
> Yes, i will replace it.
> 
> Earlier, used MLK(), got some build error, now checking again, no
> build error, i should have messed up something at that time.

Sorry for the delayed response.

With that change, you can get rid of this preprocessor conditional.
Arrange to have VECTORS_BASE defined to vectors_base in the nommu
part of asm/memory.h.  You'll also need to move the extern of that
there too.

Thanks.
diff mbox

Patch

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index cf47f86f79ed..9e11f255c3bf 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -522,7 +522,12 @@  void __init mem_init(void)
 			"      .data : 0x%p" " - 0x%p" "   (%4td kB)\n"
 			"       .bss : 0x%p" " - 0x%p" "   (%4td kB)\n",
 
+#ifdef CONFIG_MMU
 			MLK(UL(VECTORS_BASE), UL(VECTORS_BASE) + (PAGE_SIZE)),
+#else
+			MLK_ROUNDUP(vectors_base, vectors_base + PAGE_SIZE),
+#endif
+
 #ifdef CONFIG_HAVE_TCM
 			MLK(DTCM_OFFSET, (unsigned long) dtcm_end),
 			MLK(ITCM_OFFSET, (unsigned long) itcm_end),
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index ce727d47275c..546f09437fca 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -79,8 +79,9 @@  struct static_vm {
 extern struct list_head static_vmlist;
 extern struct static_vm *find_static_vm_vaddr(void *vaddr);
 extern __init void add_static_vm_early(struct static_vm *svm);
-
-#endif
+#else /* CONFIG_MMU */
+extern unsigned long vectors_base;
+#endif /* CONFIG_MMU */
 
 #ifdef CONFIG_ZONE_DMA
 extern phys_addr_t arm_dma_limit;