GuanXuetao | b50f170 | 2011-01-15 18:16:59 +0800 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/unicore32/include/asm/memblock.h |
| 3 | * |
| 4 | * Code specific to PKUnity SoC and UniCore ISA |
| 5 | * |
| 6 | * Copyright (C) 2001-2010 GUAN Xue-tao |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | */ |
| 12 | |
| 13 | #ifndef __UNICORE_MEMBLOCK_H__ |
| 14 | #define __UNICORE_MEMBLOCK_H__ |
| 15 | |
| 16 | /* |
| 17 | * Memory map description |
| 18 | */ |
| 19 | # define NR_BANKS 8 |
| 20 | |
| 21 | struct membank { |
| 22 | unsigned long start; |
| 23 | unsigned long size; |
| 24 | unsigned int highmem; |
| 25 | }; |
| 26 | |
| 27 | struct meminfo { |
| 28 | int nr_banks; |
| 29 | struct membank bank[NR_BANKS]; |
| 30 | }; |
| 31 | |
| 32 | extern struct meminfo meminfo; |
| 33 | |
| 34 | #define for_each_bank(iter, mi) \ |
| 35 | for (iter = 0; iter < (mi)->nr_banks; iter++) |
| 36 | |
| 37 | #define bank_pfn_start(bank) __phys_to_pfn((bank)->start) |
| 38 | #define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size) |
| 39 | #define bank_pfn_size(bank) ((bank)->size >> PAGE_SHIFT) |
| 40 | #define bank_phys_start(bank) ((bank)->start) |
| 41 | #define bank_phys_end(bank) ((bank)->start + (bank)->size) |
| 42 | #define bank_phys_size(bank) ((bank)->size) |
| 43 | |
| 44 | extern void uc32_memblock_init(struct meminfo *); |
| 45 | |
| 46 | #endif |