diff options
author | Tom Rini <trini@konsulko.com> | 2015-05-05 10:32:08 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-05-05 10:32:08 -0400 |
commit | 1131d4e22cf8f13d0dabaad7f1b84d9baffdfbd6 (patch) | |
tree | 89f46db2de98f59883ba6e4390f91af1599e9956 /arch/arm/mach-mvebu/gpio.c | |
parent | ff7e9cfc338ecd6db5ed7d6ff8fb7a2889b0131c (diff) | |
parent | 2083db7a75792d317a8e726e8be72abea8941d03 (diff) |
Merge git://git.denx.de/u-boot-marvell
Diffstat (limited to 'arch/arm/mach-mvebu/gpio.c')
-rw-r--r-- | arch/arm/mach-mvebu/gpio.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-mvebu/gpio.c b/arch/arm/mach-mvebu/gpio.c new file mode 100644 index 0000000000..56e54e0a62 --- /dev/null +++ b/arch/arm/mach-mvebu/gpio.c @@ -0,0 +1,30 @@ +/* + * (C) Copyright 2009 + * Marvell Semiconductor <www.marvell.com> + * Written-by: Prafulla Wadaskar <prafulla@marvell.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <asm/io.h> +#include <asm/arch/cpu.h> +#include <asm/arch/soc.h> + +/* + * mvebu_config_gpio - GPIO configuration + */ +void mvebu_config_gpio(u32 gpp0_oe_val, u32 gpp1_oe_val, + u32 gpp0_oe, u32 gpp1_oe) +{ + struct kwgpio_registers *gpio0reg = + (struct kwgpio_registers *)MVEBU_GPIO0_BASE; + struct kwgpio_registers *gpio1reg = + (struct kwgpio_registers *)MVEBU_GPIO1_BASE; + + /* Init GPIOS to default values as per board requirement */ + writel(gpp0_oe_val, &gpio0reg->dout); + writel(gpp1_oe_val, &gpio1reg->dout); + writel(gpp0_oe, &gpio0reg->oe); + writel(gpp1_oe, &gpio1reg->oe); +} |