aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m32r/mm/discontig.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-03-07 15:36:19 -0500
committerArnd Bergmann <arnd@arndb.de>2018-03-09 17:20:00 -0500
commit553b085c2075f6a4a2591108554f830fa61e881f (patch)
tree68d63911f2c12e0fb9fa23498df9300442a88f92 /arch/m32r/mm/discontig.c
parentfd8773f9f544955f6f47dc2ac3ab85ad64376b7f (diff)
arch: remove m32r port
The Mitsubishi/Renesas m32r architecture has been around for many years, but the Linux port has been obsolete for a very long time as well, with the last significant updates done for linux-2.6.14. While some m32r microcontrollers are still being marketed by Renesas, those are apparently no longer possible to support, mainly due to the lack of an external memory interface. Hirokazu Takata was the maintainer until the architecture got marked Orphaned in 2014. Link: http://www.linux-m32r.org/ Link: https://www.renesas.com/en-eu/products/microcontrollers-microprocessors/m32r.html Cc: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/m32r/mm/discontig.c')
-rw-r--r--arch/m32r/mm/discontig.c163
1 files changed, 0 insertions, 163 deletions
diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c
deleted file mode 100644
index eb8e7966dcaf..000000000000
--- a/arch/m32r/mm/discontig.c
+++ /dev/null
@@ -1,163 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/arch/m32r/mm/discontig.c
4 *
5 * Discontig memory support
6 *
7 * Copyright (c) 2003 Hitoshi Yamamoto
8 */
9
10#include <linux/mm.h>
11#include <linux/bootmem.h>
12#include <linux/mmzone.h>
13#include <linux/initrd.h>
14#include <linux/nodemask.h>
15#include <linux/module.h>
16#include <linux/pfn.h>
17
18#include <asm/setup.h>
19
20extern char _end[];
21
22struct pglist_data *node_data[MAX_NUMNODES];
23EXPORT_SYMBOL(node_data);
24
25pg_data_t m32r_node_data[MAX_NUMNODES];
26
27/* Memory profile */
28typedef struct {
29 unsigned long start_pfn;
30 unsigned long pages;
31 unsigned long holes;
32 unsigned long free_pfn;
33} mem_prof_t;
34static mem_prof_t mem_prof[MAX_NUMNODES];
35
36extern unsigned long memory_start;
37extern unsigned long memory_end;
38
39static void __init mem_prof_init(void)
40{
41 unsigned long start_pfn, holes, free_pfn;
42 const unsigned long zone_alignment = 1UL << (MAX_ORDER - 1);
43 unsigned long ul;
44 mem_prof_t *mp;
45
46 /* Node#0 SDRAM */
47 mp = &mem_prof[0];
48 mp->start_pfn = PFN_UP(CONFIG_MEMORY_START);
49 mp->pages = PFN_DOWN(memory_end - memory_start);
50 mp->holes = 0;
51 mp->free_pfn = PFN_UP(__pa(_end));
52
53 /* Node#1 internal SRAM */
54 mp = &mem_prof[1];
55 start_pfn = free_pfn = PFN_UP(CONFIG_IRAM_START);
56 holes = 0;
57 if (start_pfn & (zone_alignment - 1)) {
58 ul = zone_alignment;
59 while (start_pfn >= ul)
60 ul += zone_alignment;
61
62 start_pfn = ul - zone_alignment;
63 holes = free_pfn - start_pfn;
64 }
65
66 mp->start_pfn = start_pfn;
67 mp->pages = PFN_DOWN(CONFIG_IRAM_SIZE) + holes;
68 mp->holes = holes;
69 mp->free_pfn = PFN_UP(CONFIG_IRAM_START);
70}
71
72unsigned long __init setup_memory(void)
73{
74 unsigned long bootmap_size;
75 unsigned long min_pfn;
76 int nid;
77 mem_prof_t *mp;
78
79 max_low_pfn = 0;
80 min_low_pfn = -1;
81
82 mem_prof_init();
83
84 for_each_online_node(nid) {
85 mp = &mem_prof[nid];
86 NODE_DATA(nid)=(pg_data_t *)&m32r_node_data[nid];
87 NODE_DATA(nid)->bdata = &bootmem_node_data[nid];
88 min_pfn = mp->start_pfn;
89 max_pfn = mp->start_pfn + mp->pages;
90 bootmap_size = init_bootmem_node(NODE_DATA(nid), mp->free_pfn,
91 mp->start_pfn, max_pfn);
92
93 free_bootmem_node(NODE_DATA(nid), PFN_PHYS(mp->start_pfn),
94 PFN_PHYS(mp->pages));
95
96 reserve_bootmem_node(NODE_DATA(nid), PFN_PHYS(mp->start_pfn),
97 PFN_PHYS(mp->free_pfn - mp->start_pfn) + bootmap_size,
98 BOOTMEM_DEFAULT);
99
100 if (max_low_pfn < max_pfn)
101 max_low_pfn = max_pfn;
102
103 if (min_low_pfn > min_pfn)
104 min_low_pfn = min_pfn;
105 }
106
107#ifdef CONFIG_BLK_DEV_INITRD
108 if (LOADER_TYPE && INITRD_START) {
109 if (INITRD_START + INITRD_SIZE <= PFN_PHYS(max_low_pfn)) {
110 reserve_bootmem_node(NODE_DATA(0), INITRD_START,
111 INITRD_SIZE, BOOTMEM_DEFAULT);
112 initrd_start = INITRD_START + PAGE_OFFSET;
113 initrd_end = initrd_start + INITRD_SIZE;
114 printk("initrd:start[%08lx],size[%08lx]\n",
115 initrd_start, INITRD_SIZE);
116 } else {
117 printk("initrd extends beyond end of memory "
118 "(0x%08lx > 0x%08llx)\ndisabling initrd\n",
119 INITRD_START + INITRD_SIZE,
120 (unsigned long long)PFN_PHYS(max_low_pfn));
121
122 initrd_start = 0;
123 }
124 }
125#endif /* CONFIG_BLK_DEV_INITRD */
126
127 return max_low_pfn;
128}
129
130#define START_PFN(nid) (NODE_DATA(nid)->bdata->node_min_pfn)
131#define MAX_LOW_PFN(nid) (NODE_DATA(nid)->bdata->node_low_pfn)
132
133void __init zone_sizes_init(void)
134{
135 unsigned long zones_size[MAX_NR_ZONES], zholes_size[MAX_NR_ZONES];
136 unsigned long low, start_pfn;
137 int nid, i;
138 mem_prof_t *mp;
139
140 for_each_online_node(nid) {
141 mp = &mem_prof[nid];
142 for (i = 0 ; i < MAX_NR_ZONES ; i++) {
143 zones_size[i] = 0;
144 zholes_size[i] = 0;
145 }
146 start_pfn = START_PFN(nid);
147 low = MAX_LOW_PFN(nid);
148 zones_size[ZONE_DMA] = low - start_pfn;
149 zholes_size[ZONE_DMA] = mp->holes;
150
151 node_set_state(nid, N_NORMAL_MEMORY);
152 free_area_init_node(nid, zones_size, start_pfn, zholes_size);
153 }
154
155 /*
156 * For test
157 * Use all area of internal RAM.
158 * see __alloc_pages()
159 */
160 NODE_DATA(1)->node_zones->watermark[WMARK_MIN] = 0;
161 NODE_DATA(1)->node_zones->watermark[WMARK_LOW] = 0;
162 NODE_DATA(1)->node_zones->watermark[WMARK_HIGH] = 0;
163}