blob: 44e34309009d29e59e970663b58bb4dedc01ae57 [file] [log] [blame]
Ilko Ilievf0a2c7b2009-04-16 21:30:48 +02001/*
2 * (C) Copyright 2007-2008
Stelian Popc9e798d2011-11-01 00:00:39 +01003 * Stelian Pop <stelian@popies.net>
Ilko Ilievf0a2c7b2009-04-16 21:30:48 +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 Ilievf0a2c7b2009-04-16 21:30:48 +02008 */
9
10#include <common.h>
Ilko Ilievf0a2c7b2009-04-16 21:30:48 +020011#include <asm/arch/at91_pmc.h>
Asen Dimov684a5672011-06-08 22:01:16 +000012#include <asm/arch/gpio.h>
13#include <asm/io.h>
Ilko Ilievf0a2c7b2009-04-16 21:30:48 +020014
15void coloured_LED_init(void)
16{
Asen Dimov684a5672011-06-08 22:01:16 +000017 struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
Asen Dimov20d98c22010-04-19 14:18:43 +030018
Ilko Ilievf0a2c7b2009-04-16 21:30:48 +020019 /* Enable clock */
Asen Dimov684a5672011-06-08 22:01:16 +000020 writel(1 << ATMEL_ID_PIOB, &pmc->pcer);
Ilko Ilievf0a2c7b2009-04-16 21:30:48 +020021
Asen Dimov20d98c22010-04-19 14:18:43 +030022 at91_set_pio_output(CONFIG_RED_LED, 1);
23 at91_set_pio_output(CONFIG_GREEN_LED, 1);
Ilko Ilievf0a2c7b2009-04-16 21:30:48 +020024
Asen Dimov20d98c22010-04-19 14:18:43 +030025 at91_set_pio_value(CONFIG_RED_LED, 0);
26 at91_set_pio_value(CONFIG_GREEN_LED, 1);
Ilko Ilievf0a2c7b2009-04-16 21:30:48 +020027}