Stelian Pop | fa506a9 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 1 | /* |
Stelian Pop | 9606b3c | 2008-05-08 22:52:10 +0200 | [diff] [blame] | 2 | * [origin: Linux kernel include/asm-arm/arch-at91/hardware.h] |
Stelian Pop | 177e8a5 | 2008-03-26 19:52:31 +0100 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2003 SAN People |
| 5 | * Copyright (C) 2003 ATMEL |
Stelian Pop | fa506a9 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 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 | * |
Stelian Pop | fa506a9 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 12 | */ |
Stelian Pop | 177e8a5 | 2008-03-26 19:52:31 +0100 | [diff] [blame] | 13 | |
Stelian Pop | fa506a9 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 14 | #ifndef __ASM_ARCH_HARDWARE_H |
| 15 | #define __ASM_ARCH_HARDWARE_H |
| 16 | |
| 17 | #include <asm/sizes.h> |
| 18 | |
Stelian Pop | 177e8a5 | 2008-03-26 19:52:31 +0100 | [diff] [blame] | 19 | #if defined(CONFIG_AT91RM9200) |
| 20 | #include <asm/arch/at91rm9200.h> |
| 21 | #elif defined(CONFIG_AT91SAM9260) |
| 22 | #include <asm/arch/at91sam9260.h> |
Stelian Pop | 0176d43 | 2008-03-26 18:52:33 +0100 | [diff] [blame] | 23 | #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 Pop | 177e8a5 | 2008-03-26 19:52:31 +0100 | [diff] [blame] | 27 | #elif defined(CONFIG_AT91SAM9261) |
| 28 | #include <asm/arch/at91sam9261.h> |
| 29 | #elif defined(CONFIG_AT91SAM9263) |
| 30 | #include <asm/arch/at91sam9263.h> |
| 31 | #elif defined(CONFIG_AT91SAM9RL) |
| 32 | #include <asm/arch/at91sam9rl.h> |
| 33 | #elif defined(CONFIG_AT91CAP9) |
| 34 | #include <asm/arch/at91cap9.h> |
| 35 | #define AT91_BASE_EMAC AT91CAP9_BASE_EMAC |
| 36 | #define AT91_BASE_SPI AT91CAP9_BASE_SPI0 |
| 37 | #define AT91_ID_UHP AT91CAP9_ID_UHP |
| 38 | #define AT91_PMC_UHP AT91CAP9_PMC_UHP |
| 39 | #elif defined(CONFIG_AT91X40) |
| 40 | #include <asm/arch/at91x40.h> |
| 41 | #else |
| 42 | #error "Unsupported AT91 processor" |
| 43 | #endif |
Stelian Pop | fa506a9 | 2008-01-31 21:15:53 +0000 | [diff] [blame] | 44 | |
| 45 | /* |
| 46 | * container_of - cast a member of a structure out to the containing structure |
| 47 | * |
| 48 | * @ptr: the pointer to the member. |
| 49 | * @type: the type of the container struct this is embedded in. |
| 50 | * @member: the name of the member within the struct. |
| 51 | */ |
| 52 | #define container_of(ptr, type, member) ({ \ |
| 53 | const typeof(((type *)0)->member) *__mptr = (ptr); \ |
| 54 | (type *)((char *)__mptr - offsetof(type, member)); }) |
| 55 | |
| 56 | #endif |