aboutsummaryrefslogtreecommitdiffstats
path: root/roms/u-boot/board/atmel/at91sam9263ek/led.c
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2019-04-29 01:17:54 +0100
committerfishsoupisgood <github@madingley.org>2019-05-27 03:43:43 +0100
commit3f2546b2ef55b661fd8dd69682b38992225e86f6 (patch)
tree65ca85f13617aee1dce474596800950f266a456c /roms/u-boot/board/atmel/at91sam9263ek/led.c
downloadqemu-master.tar.gz
qemu-master.tar.bz2
qemu-master.zip
Initial import of qemu-2.4.1HEADmaster
Diffstat (limited to 'roms/u-boot/board/atmel/at91sam9263ek/led.c')
-rw-r--r--roms/u-boot/board/atmel/at91sam9263ek/led.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/roms/u-boot/board/atmel/at91sam9263ek/led.c b/roms/u-boot/board/atmel/at91sam9263ek/led.c
new file mode 100644
index 00000000..e317d998
--- /dev/null
+++ b/roms/u-boot/board/atmel/at91sam9263ek/led.c
@@ -0,0 +1,30 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian@popies.net>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91sam9263.h>
+
+void coloured_LED_init(void)
+{
+ /* Enable clock */
+ at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC;
+
+ writel(1 << ATMEL_ID_PIOB | 1 << ATMEL_ID_PIOCDE,
+ &pmc->pcer);
+
+ at91_set_gpio_output(CONFIG_RED_LED, 1);
+ at91_set_gpio_output(CONFIG_GREEN_LED, 1);
+ at91_set_gpio_output(CONFIG_YELLOW_LED, 1);
+
+ at91_set_gpio_value(CONFIG_RED_LED, 0);
+ at91_set_gpio_value(CONFIG_GREEN_LED, 1);
+ at91_set_gpio_value(CONFIG_YELLOW_LED, 1);
+}