treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
[sfrench/cifs-2.6.git] / arch / unicore32 / include / asm / memblock.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * linux/arch/unicore32/include/asm/memblock.h
4  *
5  * Code specific to PKUnity SoC and UniCore ISA
6  *
7  * Copyright (C) 2001-2010 GUAN Xue-tao
8  */
9
10 #ifndef __UNICORE_MEMBLOCK_H__
11 #define __UNICORE_MEMBLOCK_H__
12
13 /*
14  * Memory map description
15  */
16 # define NR_BANKS 8
17
18 struct membank {
19         unsigned long start;
20         unsigned long size;
21         unsigned int highmem;
22 };
23
24 struct meminfo {
25         int nr_banks;
26         struct membank bank[NR_BANKS];
27 };
28
29 extern struct meminfo meminfo;
30
31 #define for_each_bank(iter, mi)                         \
32         for (iter = 0; iter < (mi)->nr_banks; iter++)
33
34 #define bank_pfn_start(bank)    __phys_to_pfn((bank)->start)
35 #define bank_pfn_end(bank)      __phys_to_pfn((bank)->start + (bank)->size)
36 #define bank_pfn_size(bank)     ((bank)->size >> PAGE_SHIFT)
37 #define bank_phys_start(bank)   ((bank)->start)
38 #define bank_phys_end(bank)     ((bank)->start + (bank)->size)
39 #define bank_phys_size(bank)    ((bank)->size)
40
41 extern void uc32_memblock_init(struct meminfo *);
42
43 #endif