blob: cc4c2a072bb06298e0b8a46115b1a8e437f6b4b0 [file] [log] [blame]
Ilko Iliev32949232009-06-12 21:20:39 +02001/*
2 * (C) Copyright 2007-2008
Stelian Popc9e798d2011-11-01 00:00:39 +01003 * Stelian Pop <stelian@popies.net>
Ilko Iliev32949232009-06-12 21:20:39 +02004 * Lead Tech Design <www.leadtechdesign.com>
5 * Ilko Iliev <www.ronetix.at>
6 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Ilko Iliev32949232009-06-12 21:20:39 +02008 */
9
10#include <common.h>
Andreas Bießmannbcf9fe32013-11-29 12:13:46 +010011#include <asm/gpio.h>
Ilko Iliev32949232009-06-12 21:20:39 +020012#include <asm/arch/at91_pmc.h>
Asen Dimovf47316a2011-07-26 04:48:41 +000013#include <asm/arch/gpio.h>
Ilko Iliev32949232009-06-12 21:20:39 +020014
15void coloured_LED_init(void)
16{
Asen Dimovf47316a2011-07-26 04:48:41 +000017 struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
Asen Dimove3150c72010-04-06 16:18:04 +030018
Ilko Iliev32949232009-06-12 21:20:39 +020019 /* Enable clock */
Asen Dimovf47316a2011-07-26 04:48:41 +000020 writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
Ilko Iliev32949232009-06-12 21:20:39 +020021
Andreas Bießmannbcf9fe32013-11-29 12:13:46 +010022 gpio_direction_output(CONFIG_RED_LED, 1);
23 gpio_direction_output(CONFIG_GREEN_LED, 1);
24 gpio_direction_output(CONFIG_YELLOW_LED, 1);
Ilko Iliev32949232009-06-12 21:20:39 +020025
Andreas Bießmannbcf9fe32013-11-29 12:13:46 +010026 gpio_set_value(CONFIG_RED_LED, 0);
27 gpio_set_value(CONFIG_GREEN_LED, 1);
28 gpio_set_value(CONFIG_YELLOW_LED, 1);
Ilko Iliev32949232009-06-12 21:20:39 +020029}