@@ -75,6 +75,25 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
7575 base , TO_MB (size ), !in_use ? "Not used" :"" );
7676}
7777
78+ void __init arch_zone_limits_init (unsigned long * max_zone_pfn )
79+ {
80+ /*----------------- node/zones setup --------------------------*/
81+ max_zone_pfn [ZONE_NORMAL ] = max_low_pfn ;
82+
83+ #ifdef CONFIG_HIGHMEM
84+ /*
85+ * max_high_pfn should be ok here for both HIGHMEM and HIGHMEM+PAE.
86+ * For HIGHMEM without PAE max_high_pfn should be less than
87+ * min_low_pfn to guarantee that these two regions don't overlap.
88+ * For PAE case highmem is greater than lowmem, so it is natural
89+ * to use max_high_pfn.
90+ *
91+ * In both cases, holes should be handled by pfn_valid().
92+ */
93+ max_zone_pfn [ZONE_HIGHMEM ] = max_high_pfn ;
94+ #endif
95+ }
96+
7897/*
7998 * First memory setup routine called from setup_arch()
8099 * 1. setup swapper's mm @init_mm
@@ -83,8 +102,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
83102 */
84103void __init setup_arch_memory (void )
85104{
86- unsigned long max_zone_pfn [MAX_NR_ZONES ] = { 0 };
87-
88105 setup_initial_init_mm (_text , _etext , _edata , _end );
89106
90107 /* first page of system - kernel .vector starts here */
@@ -122,9 +139,6 @@ void __init setup_arch_memory(void)
122139
123140 memblock_dump_all ();
124141
125- /*----------------- node/zones setup --------------------------*/
126- max_zone_pfn [ZONE_NORMAL ] = max_low_pfn ;
127-
128142#ifdef CONFIG_HIGHMEM
129143 /*
130144 * On ARC (w/o PAE) HIGHMEM addresses are actually smaller (0 based)
@@ -139,22 +153,9 @@ void __init setup_arch_memory(void)
139153 min_high_pfn = PFN_DOWN (high_mem_start );
140154 max_high_pfn = PFN_DOWN (high_mem_start + high_mem_sz );
141155
142- /*
143- * max_high_pfn should be ok here for both HIGHMEM and HIGHMEM+PAE.
144- * For HIGHMEM without PAE max_high_pfn should be less than
145- * min_low_pfn to guarantee that these two regions don't overlap.
146- * For PAE case highmem is greater than lowmem, so it is natural
147- * to use max_high_pfn.
148- *
149- * In both cases, holes should be handled by pfn_valid().
150- */
151- max_zone_pfn [ZONE_HIGHMEM ] = max_high_pfn ;
152-
153156 arch_pfn_offset = min (min_low_pfn , min_high_pfn );
154157 kmap_init ();
155158#endif /* CONFIG_HIGHMEM */
156-
157- free_area_init (max_zone_pfn );
158159}
159160
160161void __init arch_mm_preinit (void )
0 commit comments