blob: e7c572d8ba5cf40faa163698ccd5cb74cc23b683 [file] [log] [blame]
Stelian Popfa506a92008-01-31 21:15:53 +00001/*
Stelian Pop4f6c8102008-05-08 20:52:10 +02002 * [origin: Linux kernel include/asm-arm/arch-at91/hardware.h]
Stelian Pop177e8a52008-03-26 19:52:31 +01003 *
4 * Copyright (C) 2003 SAN People
5 * Copyright (C) 2003 ATMEL
Stelian Popfa506a92008-01-31 21:15:53 +00006 *
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 *
Stelian Popfa506a92008-01-31 21:15:53 +000012 */
Stelian Pop177e8a52008-03-26 19:52:31 +010013
Stelian Popfa506a92008-01-31 21:15:53 +000014#ifndef __ASM_ARCH_HARDWARE_H
15#define __ASM_ARCH_HARDWARE_H
16
17#include <asm/sizes.h>
18
Stelian Pop177e8a52008-03-26 19:52:31 +010019#if defined(CONFIG_AT91RM9200)
20#include <asm/arch/at91rm9200.h>
21#elif defined(CONFIG_AT91SAM9260)
22#include <asm/arch/at91sam9260.h>
Stelian Pop0176d432008-03-26 18:52:33 +010023#define AT91_BASE_EMAC AT91SAM9260_BASE_EMAC
24#define AT91_BASE_SPI AT91SAM9260_BASE_SPI0
25#define AT91_ID_UHP AT91SAM9260_ID_UHP
26#define AT91_PMC_UHP AT91SAM926x_PMC_UHP
Stelian Pop177e8a52008-03-26 19:52:31 +010027#elif defined(CONFIG_AT91SAM9261)
28#include <asm/arch/at91sam9261.h>
Stelian Popd99a8ff2008-05-08 20:52:22 +020029#define AT91_BASE_SPI AT91SAM9261_BASE_SPI0
30#define AT91_ID_UHP AT91SAM9261_ID_UHP
31#define AT91_PMC_UHP AT91SAM926x_PMC_UHP
Stelian Pop177e8a52008-03-26 19:52:31 +010032#elif defined(CONFIG_AT91SAM9263)
33#include <asm/arch/at91sam9263.h>
Stelian Pop8e429b32008-05-08 18:52:23 +020034#define AT91_BASE_EMAC AT91SAM9263_BASE_EMAC
35#define AT91_BASE_SPI AT91SAM9263_BASE_SPI0
36#define AT91_ID_UHP AT91SAM9263_ID_UHP
37#define AT91_PMC_UHP AT91SAM926x_PMC_UHP
Stelian Pop177e8a52008-03-26 19:52:31 +010038#elif defined(CONFIG_AT91SAM9RL)
39#include <asm/arch/at91sam9rl.h>
Stelian Pop2118ebb2008-05-08 18:52:25 +020040#define AT91_BASE_SPI AT91SAM9RL_BASE_SPI
41#define AT91_ID_UHP AT91SAM9RL_ID_UHP
Stelian Pop177e8a52008-03-26 19:52:31 +010042#elif defined(CONFIG_AT91CAP9)
43#include <asm/arch/at91cap9.h>
44#define AT91_BASE_EMAC AT91CAP9_BASE_EMAC
45#define AT91_BASE_SPI AT91CAP9_BASE_SPI0
46#define AT91_ID_UHP AT91CAP9_ID_UHP
47#define AT91_PMC_UHP AT91CAP9_PMC_UHP
48#elif defined(CONFIG_AT91X40)
49#include <asm/arch/at91x40.h>
50#else
51#error "Unsupported AT91 processor"
52#endif
Stelian Popfa506a92008-01-31 21:15:53 +000053
54/*
55 * container_of - cast a member of a structure out to the containing structure
56 *
57 * @ptr: the pointer to the member.
58 * @type: the type of the container struct this is embedded in.
59 * @member: the name of the member within the struct.
60 */
61#define container_of(ptr, type, member) ({ \
62 const typeof(((type *)0)->member) *__mptr = (ptr); \
63 (type *)((char *)__mptr - offsetof(type, member)); })
64
65#endif