]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARC: mm: Decouple RAM base address from kernel link address
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Tue, 15 Aug 2017 18:13:54 +0000 (21:13 +0300)
committerVineet Gupta <vgupta@synopsys.com>
Fri, 1 Sep 2017 18:26:27 +0000 (11:26 -0700)
[Needed for HSDK]

Currently the first page of system (hence RAM base) is assumed to be
@ CONFIG_LINUX_LINK_BASE, where kernel itself is linked.

However is case of HSDK platform, for reasons explained in that patch,
this is not true. kernel needs to be linked @ 0x9000_0000 while DDR
is still wired at 0x8000_0000. To properly account for this 256M of RAM,
we need to introduce a new option and base page frame accountiing off of
it.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
[vgupta: renamed  CONFIG_KERNEL_RAM_BASE_ADDRESS => CONFIG_LINUX_RAM_BASE
       : simplified changelog]

arch/arc/Kconfig
arch/arc/boot/dts/axc001.dtsi
arch/arc/boot/dts/axc003.dtsi
arch/arc/boot/dts/axc003_idu.dtsi
arch/arc/boot/dts/nsim_hs.dts
arch/arc/include/asm/page.h
arch/arc/mm/cache.c
arch/arc/mm/init.c

index 7db85ab00c522315c3108930365fc57c59fd311c..65b7549e17db3c02c160a709acb9c165fd25c30a 100644 (file)
@@ -418,7 +418,7 @@ endif       # ISA_ARCV2
 endmenu   # "ARC CPU Configuration"
 
 config LINUX_LINK_BASE
-       hex "Linux Link Address"
+       hex "Kernel link address"
        default "0x80000000"
        help
          ARC700 divides the 32 bit phy address space into two equal halves
@@ -431,6 +431,14 @@ config LINUX_LINK_BASE
          If you don't know what the above means, leave this setting alone.
          This needs to match memory start address specified in Device Tree
 
+config LINUX_RAM_BASE
+       hex "RAM base address"
+       default LINUX_LINK_BASE
+       help
+         By default Linux is linked at base of RAM. However in some special
+         cases (such as HSDK), Linux can't be linked at start of DDR, hence
+         this option.
+
 config HIGHMEM
        bool "High Memory Support"
        select ARCH_DISCONTIGMEM_ENABLE
index a380ffa1a4589b11de92a5a0c21bc831e6dc751b..fdc266504ada273e6efaf72c18cc8c2e2f48edf2 100644 (file)
@@ -99,7 +99,7 @@ mb_intc: dw-apb-ictl@0xe0012000 {
 
        memory {
                device_type = "memory";
-               /* CONFIG_KERNEL_RAM_BASE_ADDRESS needs to match low mem start */
+               /* CONFIG_LINUX_RAM_BASE needs to match low mem start */
                reg = <0x0 0x80000000 0x0 0x1b000000>;  /* (512 - 32) MiB */
        };
 
index dca7e39409beb7b9a472365022b61e6a3f46ad87..4e6e9f57e790ac0cefcade55664124c9351e830e 100644 (file)
@@ -109,7 +109,7 @@ mb_intc: dw-apb-ictl@0xe0012000 {
 
        memory {
                device_type = "memory";
-               /* CONFIG_KERNEL_RAM_BASE_ADDRESS needs to match low mem start */
+               /* CONFIG_LINUX_RAM_BASE needs to match low mem start */
                reg = <0x0 0x80000000 0x0 0x20000000    /* 512 MiB low mem */
                       0x1 0xc0000000 0x0 0x40000000>;  /* 1 GiB highmem */
        };
index 5b56beffc1c5137b402d7db4d85db979e4ea3eef..63954a8b0100ebf5746394fedb62b4825048d903 100644 (file)
@@ -115,7 +115,7 @@ mb_intc: dw-apb-ictl@0xe0012000 {
 
        memory {
                device_type = "memory";
-               /* CONFIG_KERNEL_RAM_BASE_ADDRESS needs to match low mem start */
+               /* CONFIG_LINUX_RAM_BASE needs to match low mem start */
                reg = <0x0 0x80000000 0x0 0x20000000    /* 512 MiB low mem */
                       0x1 0xc0000000 0x0 0x40000000>;  /* 1 GiB highmem */
        };
index 3772c40c245ecaf546de55aac1a48e7fdff0ca85..8d787b251f73746191cfea3bd176bfb2869eccce 100644 (file)
@@ -18,7 +18,7 @@ / {
 
        memory {
                device_type = "memory";
-               /* CONFIG_LINUX_LINK_BASE needs to match low mem start */
+               /* CONFIG_LINUX_RAM_BASE needs to match low mem start */
                reg = <0x0 0x80000000 0x0 0x20000000    /* 512 MB low mem */
                       0x1 0x00000000 0x0 0x40000000>;  /* 1 GB highmem */
        };
index 296c3426a6ad3589df2926c50c26832960a48ab8..109baa06831cecc38cf1d9f11ba447a31c0c4b14 100644 (file)
@@ -85,7 +85,7 @@ typedef pte_t * pgtable_t;
  */
 #define virt_to_pfn(kaddr)     (__pa(kaddr) >> PAGE_SHIFT)
 
-#define ARCH_PFN_OFFSET                virt_to_pfn(CONFIG_LINUX_LINK_BASE)
+#define ARCH_PFN_OFFSET                virt_to_pfn(CONFIG_LINUX_RAM_BASE)
 
 #ifdef CONFIG_FLATMEM
 #define pfn_valid(pfn)         (((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
index d68d36c1590957e52b8abaa8648337f2d21b861a..eee924dfffa6e1baf08221ee5e7e2cd23937d782 100644 (file)
@@ -1173,7 +1173,7 @@ noinline void __init arc_ioc_setup(void)
        write_aux_reg(ARC_REG_IO_COH_AP0_SIZE, order_base_2(mem_sz >> 10) - 2);
 
        /* for now assume kernel base is start of IOC aperture */
-       ioc_base = CONFIG_LINUX_LINK_BASE;
+       ioc_base = CONFIG_LINUX_RAM_BASE;
 
        if (ioc_base % mem_sz != 0)
                panic("IOC Aperture start must be aligned to the size of the aperture");
index 8c9415ed62804d0a8b4a35df176f1b43e6c1be44..ba145065c579bfff5af1d0ca4e569a8b8c49da32 100644 (file)
@@ -26,7 +26,7 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD] __aligned(PAGE_SIZE);
 char empty_zero_page[PAGE_SIZE] __aligned(PAGE_SIZE);
 EXPORT_SYMBOL(empty_zero_page);
 
-static const unsigned long low_mem_start = CONFIG_LINUX_LINK_BASE;
+static const unsigned long low_mem_start = CONFIG_LINUX_RAM_BASE;
 static unsigned long low_mem_sz;
 
 #ifdef CONFIG_HIGHMEM
@@ -63,7 +63,7 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
 
        if (!low_mem_sz) {
                if (base != low_mem_start)
-                       panic("CONFIG_LINUX_LINK_BASE != DT memory { }");
+                       panic("CONFIG_LINUX_RAM_BASE != DT memory { }");
 
                low_mem_sz = size;
                in_use = 1;
@@ -161,7 +161,7 @@ void __init setup_arch_memory(void)
         * We can't use the helper free_area_init(zones[]) because it uses
         * PAGE_OFFSET to compute the @min_low_pfn which would be wrong
         * when our kernel doesn't start at PAGE_OFFSET, i.e.
-        * PAGE_OFFSET != CONFIG_LINUX_LINK_BASE
+        * PAGE_OFFSET != CONFIG_LINUX_RAM_BASE
         */
        free_area_init_node(0,                  /* node-id */
                            zones_size,         /* num pages per zone */