Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/include/asm/setup.h |
| 3 | * |
| 4 | * Copyright (C) 1997-1999 Russell King |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | * Structure passed to kernel to tell it about the |
| 11 | * hardware it's running on. See Documentation/arm/Setup |
| 12 | * for more info. |
| 13 | */ |
| 14 | #ifndef __ASMARM_SETUP_H |
| 15 | #define __ASMARM_SETUP_H |
| 16 | |
David Howells | cb8db5d | 2012-10-12 13:05:52 +0100 | [diff] [blame] | 17 | #include <uapi/asm/setup.h> |
Adrian Bunk | 7d1362c | 2006-12-06 20:40:38 -0800 | [diff] [blame] | 18 | |
Adrian Bunk | 7d1362c | 2006-12-06 20:40:38 -0800 | [diff] [blame] | 19 | |
David Rientjes | b91d8a1 | 2007-05-11 16:18:55 -0700 | [diff] [blame] | 20 | #define __tag __used __attribute__((__section__(".taglist.init"))) |
Adrian Bunk | 7d1362c | 2006-12-06 20:40:38 -0800 | [diff] [blame] | 21 | #define __tagtable(tag, fn) \ |
Russell King | c1f2d99 | 2011-07-05 23:59:56 +0100 | [diff] [blame] | 22 | static const struct tagtable __tagtable_##fn __tag = { tag, fn } |
Adrian Bunk | 7d1362c | 2006-12-06 20:40:38 -0800 | [diff] [blame] | 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | /* |
| 25 | * Memory map description |
| 26 | */ |
Russell King | 958cab0 | 2011-12-11 10:04:00 +0000 | [diff] [blame] | 27 | #define NR_BANKS CONFIG_ARM_NR_BANKS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
Russell King | 456335e | 2006-09-27 10:00:54 +0100 | [diff] [blame] | 29 | struct membank { |
Will Deacon | f60892d | 2011-02-15 12:44:10 +0100 | [diff] [blame] | 30 | phys_addr_t start; |
Peter Maydell | a5d5f7d | 2012-07-12 23:57:35 +0100 | [diff] [blame] | 31 | phys_addr_t size; |
Russell King | be37030 | 2010-05-07 17:40:33 +0100 | [diff] [blame] | 32 | unsigned int highmem; |
Russell King | 456335e | 2006-09-27 10:00:54 +0100 | [diff] [blame] | 33 | }; |
| 34 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | struct meminfo { |
| 36 | int nr_banks; |
Russell King | 456335e | 2006-09-27 10:00:54 +0100 | [diff] [blame] | 37 | struct membank bank[NR_BANKS]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | }; |
| 39 | |
Nicolas Pitre | 4b5f32c | 2008-10-06 13:24:40 -0400 | [diff] [blame] | 40 | extern struct meminfo meminfo; |
| 41 | |
Russell King | be37030 | 2010-05-07 17:40:33 +0100 | [diff] [blame] | 42 | #define for_each_bank(iter,mi) \ |
| 43 | for (iter = 0; iter < (mi)->nr_banks; iter++) |
Russell King | d2a38ef | 2008-10-01 16:56:15 +0100 | [diff] [blame] | 44 | |
| 45 | #define bank_pfn_start(bank) __phys_to_pfn((bank)->start) |
| 46 | #define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size) |
| 47 | #define bank_pfn_size(bank) ((bank)->size >> PAGE_SHIFT) |
| 48 | #define bank_phys_start(bank) (bank)->start |
| 49 | #define bank_phys_end(bank) ((bank)->start + (bank)->size) |
| 50 | #define bank_phys_size(bank) (bank)->size |
| 51 | |
Peter Maydell | a5d5f7d | 2012-07-12 23:57:35 +0100 | [diff] [blame] | 52 | extern int arm_add_memory(phys_addr_t start, phys_addr_t size); |
Grant Likely | 93c02ab | 2011-04-28 14:27:21 -0600 | [diff] [blame] | 53 | extern void early_print(const char *str, ...); |
| 54 | extern void dump_machine_table(void); |
Grant Likely | 9eb8f67 | 2011-04-28 14:27:20 -0600 | [diff] [blame] | 55 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | #endif |