]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/asm-arm/arch-at91sam9/hardware.h
AT91SAM9: Move CONFIG_HAS_DATAFLASH to Makefile
[people/ms/u-boot.git] / include / asm-arm / arch-at91sam9 / hardware.h
CommitLineData
fa506a92 1/*
177e8a5a
SP
2 * include/asm-arm/arch-at91/hardware.h
3 *
4 * Copyright (C) 2003 SAN People
5 * Copyright (C) 2003 ATMEL
fa506a92
SP
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
fa506a92 12 */
177e8a5a 13
fa506a92
SP
14#ifndef __ASM_ARCH_HARDWARE_H
15#define __ASM_ARCH_HARDWARE_H
16
17#include <asm/sizes.h>
18
177e8a5a
SP
19#if defined(CONFIG_AT91RM9200)
20#include <asm/arch/at91rm9200.h>
21#elif defined(CONFIG_AT91SAM9260)
22#include <asm/arch/at91sam9260.h>
23#elif defined(CONFIG_AT91SAM9261)
24#include <asm/arch/at91sam9261.h>
25#elif defined(CONFIG_AT91SAM9263)
26#include <asm/arch/at91sam9263.h>
27#elif defined(CONFIG_AT91SAM9RL)
28#include <asm/arch/at91sam9rl.h>
29#elif defined(CONFIG_AT91CAP9)
30#include <asm/arch/at91cap9.h>
31#define AT91_BASE_EMAC AT91CAP9_BASE_EMAC
32#define AT91_BASE_SPI AT91CAP9_BASE_SPI0
33#define AT91_ID_UHP AT91CAP9_ID_UHP
34#define AT91_PMC_UHP AT91CAP9_PMC_UHP
35#elif defined(CONFIG_AT91X40)
36#include <asm/arch/at91x40.h>
37#else
38#error "Unsupported AT91 processor"
39#endif
fa506a92
SP
40
41/*
42 * container_of - cast a member of a structure out to the containing structure
43 *
44 * @ptr: the pointer to the member.
45 * @type: the type of the container struct this is embedded in.
46 * @member: the name of the member within the struct.
47 */
48#define container_of(ptr, type, member) ({ \
49 const typeof(((type *)0)->member) *__mptr = (ptr); \
50 (type *)((char *)__mptr - offsetof(type, member)); })
51
52#endif