From 8bf29b59fce8cc381114929082202d800e313ad5 Mon Sep 17 00:00:00 2001 From: Simon Kagstrom Date: Tue, 7 Jul 2009 13:58:51 +0200 Subject: Add unaligned.h for arm This patch adds unaligned.h for ARM (needed to build with LZO compression). The file is taken from the linux kernel, but includes u-boot headers instead. Signed-off-by: Simon Kagstrom Acked-by: Stefan Roese --- include/asm-arm/unaligned.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 include/asm-arm/unaligned.h (limited to 'include/asm-arm') diff --git a/include/asm-arm/unaligned.h b/include/asm-arm/unaligned.h new file mode 100644 index 0000000000..d644df7526 --- /dev/null +++ b/include/asm-arm/unaligned.h @@ -0,0 +1,18 @@ +#ifndef _ASM_ARM_UNALIGNED_H +#define _ASM_ARM_UNALIGNED_H + +#include +#include + +/* + * Select endianness + */ +#ifndef __ARMEB__ +#define get_unaligned __get_unaligned_le +#define put_unaligned __put_unaligned_le +#else +#define get_unaligned __get_unaligned_be +#define put_unaligned __put_unaligned_be +#endif + +#endif /* _ASM_ARM_UNALIGNED_H */ -- cgit From 688b6a0ff2dcbb0c7e63ef63cbbcc291f14f321f Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Thu, 16 Jul 2009 09:59:10 +0200 Subject: arm, kirkwood: added KW_TWSI_BASE in kirkwood.h Signed-off-by: Heiko Schocher --- include/asm-arm/arch-kirkwood/kirkwood.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-kirkwood/kirkwood.h b/include/asm-arm/arch-kirkwood/kirkwood.h index 47679dd441..2470efbd8c 100644 --- a/include/asm-arm/arch-kirkwood/kirkwood.h +++ b/include/asm-arm/arch-kirkwood/kirkwood.h @@ -44,6 +44,7 @@ #define KW_REG_UNDOC_0x1470 (KW_REGISTER(0x1470)) #define KW_REG_UNDOC_0x1478 (KW_REGISTER(0x1478)) +#define KW_TWSI_BASE (KW_REGISTER(0x11000)) #define KW_UART0_BASE (KW_REGISTER(0x12000)) #define KW_UART1_BASE (KW_REGISTER(0x12100)) #define KW_MPP_BASE (KW_REGISTER(0x10000)) -- cgit From ec16441085f471c03a8c0909579463e31e5b947a Mon Sep 17 00:00:00 2001 From: Dieter Kiermaier Date: Mon, 29 Jun 2009 14:45:08 +0200 Subject: Kirkwood: add Marvell Kirkwood gpio driver Signed-off-by: Dieter Kiermaier Acked-by: Prafulla Wadaskar Tested-by: Heiko Schocher --- include/asm-arm/arch-kirkwood/gpio.h | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 include/asm-arm/arch-kirkwood/gpio.h (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-kirkwood/gpio.h b/include/asm-arm/arch-kirkwood/gpio.h new file mode 100644 index 0000000000..5c869198a7 --- /dev/null +++ b/include/asm-arm/arch-kirkwood/gpio.h @@ -0,0 +1,51 @@ +/* + * arch/asm-arm/mach-kirkwood/include/mach/gpio.h + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +/* + * Based on (mostly copied from) plat-orion based Linux 2.6 kernel driver. + * Removed kernel level irq handling. Took some macros from kernel to + * allow build. + * + * Dieter Kiermaier dk-arm-linux@gmx.de + */ + +#ifndef __KIRKWOOD_GPIO_H +#define __KIRKWOOD_GPIO_H + +/* got from kernel include/linux/kernel.h */ +#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +/* got from kernel include/linux/bitops.h */ +#define BITS_PER_BYTE 8 +#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) + +#define GPIO_MAX 50 +#define GPIO_OFF(pin) (((pin) >> 5) ? 0x0040 : 0x0000) +#define GPIO_OUT(pin) (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x00) +#define GPIO_IO_CONF(pin) (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x04) +#define GPIO_BLINK_EN(pin) (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x08) +#define GPIO_IN_POL(pin) (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x0c) +#define GPIO_DATA_IN(pin) (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x10) +#define GPIO_EDGE_CAUSE(pin) (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x14) +#define GPIO_EDGE_MASK(pin) (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x18) +#define GPIO_LEVEL_MASK(pin) (KW_GPIO0_BASE + GPIO_OFF(pin) + 0x1c) + +/* + * Kirkwood-specific GPIO API + */ +int kw_gpio_is_valid(unsigned pin, int mode); +int kw_gpio_direction_input(unsigned pin); +int kw_gpio_direction_output(unsigned pin, int value); +int kw_gpio_get_value(unsigned pin); +void kw_gpio_set_value(unsigned pin, int value); +void kw_gpio_set_blink(unsigned pin, int blink); +void kw_gpio_set_unused(unsigned pin); + +#define GPIO_INPUT_OK (1 << 0) +#define GPIO_OUTPUT_OK (1 << 1) + +#endif -- cgit From 57215cd2e59fd403248df8f2f195e382900d5fc2 Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Thu, 16 Jul 2009 09:58:31 +0200 Subject: arm, kirkwood: added kw_gpio_set_valid() in gpio.h Signed-off-by: Heiko Schocher --- include/asm-arm/arch-kirkwood/gpio.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-kirkwood/gpio.h b/include/asm-arm/arch-kirkwood/gpio.h index 5c869198a7..a79102ba54 100644 --- a/include/asm-arm/arch-kirkwood/gpio.h +++ b/include/asm-arm/arch-kirkwood/gpio.h @@ -37,6 +37,8 @@ /* * Kirkwood-specific GPIO API */ + +void kw_gpio_set_valid(unsigned pin, int mode); int kw_gpio_is_valid(unsigned pin, int mode); int kw_gpio_direction_input(unsigned pin); int kw_gpio_direction_output(unsigned pin, int value); -- cgit