xref: /openbmc/u-boot/board/atmel/at91sam9263ek/led.c (revision 1a459660)
18e429b3eSStelian Pop /*
28e429b3eSStelian Pop  * (C) Copyright 2007-2008
3c9e798d3SStelian Pop  * Stelian Pop <stelian@popies.net>
48e429b3eSStelian Pop  * Lead Tech Design <www.leadtechdesign.com>
58e429b3eSStelian Pop  *
6*1a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
78e429b3eSStelian Pop  */
88e429b3eSStelian Pop 
98e429b3eSStelian Pop #include <common.h>
10cd46b0f2SXu, Hong #include <asm/io.h>
118e429b3eSStelian Pop #include <asm/arch/gpio.h>
12cd46b0f2SXu, Hong #include <asm/arch/at91_pmc.h>
13cd46b0f2SXu, Hong #include <asm/arch/at91sam9263.h>
148e429b3eSStelian Pop 
158e429b3eSStelian Pop void coloured_LED_init(void)
168e429b3eSStelian Pop {
178e429b3eSStelian Pop 	/* Enable clock */
18cd46b0f2SXu, Hong 	at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
198e429b3eSStelian Pop 
20cd46b0f2SXu, Hong 	writel(1 << ATMEL_ID_PIOB | 1 << ATMEL_ID_PIOCDE,
211b34f00cSJens Scharsig 		&pmc->pcer);
228e429b3eSStelian Pop 
23cd46b0f2SXu, Hong 	at91_set_gpio_output(CONFIG_RED_LED, 1);
24cd46b0f2SXu, Hong 	at91_set_gpio_output(CONFIG_GREEN_LED, 1);
25cd46b0f2SXu, Hong 	at91_set_gpio_output(CONFIG_YELLOW_LED, 1);
261b34f00cSJens Scharsig 
27cd46b0f2SXu, Hong 	at91_set_gpio_value(CONFIG_RED_LED, 0);
28cd46b0f2SXu, Hong 	at91_set_gpio_value(CONFIG_GREEN_LED, 1);
29cd46b0f2SXu, Hong 	at91_set_gpio_value(CONFIG_YELLOW_LED, 1);
308e429b3eSStelian Pop }
31