blob: c50f0560950110b9f60d21f9ea9647be4ee77688 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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 Howellscb8db5d2012-10-12 13:05:52 +010017#include <uapi/asm/setup.h>
Adrian Bunk7d1362c2006-12-06 20:40:38 -080018
Adrian Bunk7d1362c2006-12-06 20:40:38 -080019
David Rientjesb91d8a12007-05-11 16:18:55 -070020#define __tag __used __attribute__((__section__(".taglist.init")))
Adrian Bunk7d1362c2006-12-06 20:40:38 -080021#define __tagtable(tag, fn) \
Russell Kingc1f2d992011-07-05 23:59:56 +010022static const struct tagtable __tagtable_##fn __tag = { tag, fn }
Adrian Bunk7d1362c2006-12-06 20:40:38 -080023
Linus Torvalds1da177e2005-04-16 15:20:36 -070024/*
25 * Memory map description
26 */
Russell King958cab02011-12-11 10:04:00 +000027#define NR_BANKS CONFIG_ARM_NR_BANKS
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
Russell King456335e2006-09-27 10:00:54 +010029struct membank {
Will Deaconf60892d2011-02-15 12:44:10 +010030 phys_addr_t start;
Peter Maydella5d5f7d2012-07-12 23:57:35 +010031 phys_addr_t size;
Russell Kingbe370302010-05-07 17:40:33 +010032 unsigned int highmem;
Russell King456335e2006-09-27 10:00:54 +010033};
34
Linus Torvalds1da177e2005-04-16 15:20:36 -070035struct meminfo {
36 int nr_banks;
Russell King456335e2006-09-27 10:00:54 +010037 struct membank bank[NR_BANKS];
Linus Torvalds1da177e2005-04-16 15:20:36 -070038};
39
Nicolas Pitre4b5f32c2008-10-06 13:24:40 -040040extern struct meminfo meminfo;
41
Russell Kingbe370302010-05-07 17:40:33 +010042#define for_each_bank(iter,mi) \
43 for (iter = 0; iter < (mi)->nr_banks; iter++)
Russell Kingd2a38ef2008-10-01 16:56:15 +010044
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 Maydella5d5f7d2012-07-12 23:57:35 +010052extern int arm_add_memory(phys_addr_t start, phys_addr_t size);
Grant Likely93c02ab2011-04-28 14:27:21 -060053extern void early_print(const char *str, ...);
54extern void dump_machine_table(void);
Grant Likely9eb8f672011-04-28 14:27:20 -060055
Linus Torvalds1da177e2005-04-16 15:20:36 -070056#endif