blob: 1d1e3df8ba90f22cf898e8f5523080fb93f9f4da [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Stefan Roesed5c51322014-10-22 12:13:11 +02002/*
3 * (C) Copyright 2009
4 * Marvell Semiconductor <www.marvell.com>
5 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
Stefan Roesed5c51322014-10-22 12:13:11 +02006 */
7
8#include <common.h>
9#include <asm/io.h>
10#include <asm/arch/cpu.h>
11#include <asm/arch/soc.h>
12
13/*
14 * mvebu_config_gpio - GPIO configuration
15 */
16void mvebu_config_gpio(u32 gpp0_oe_val, u32 gpp1_oe_val,
17 u32 gpp0_oe, u32 gpp1_oe)
18{
19 struct kwgpio_registers *gpio0reg =
20 (struct kwgpio_registers *)MVEBU_GPIO0_BASE;
21 struct kwgpio_registers *gpio1reg =
22 (struct kwgpio_registers *)MVEBU_GPIO1_BASE;
23
24 /* Init GPIOS to default values as per board requirement */
25 writel(gpp0_oe_val, &gpio0reg->dout);
26 writel(gpp1_oe_val, &gpio1reg->dout);
27 writel(gpp0_oe, &gpio0reg->oe);
28 writel(gpp1_oe, &gpio1reg->oe);
29}