[target][uzed] add debug led support

Change-Id: Ia077ae7f2f81a2b43a73dd5bc3b5f9cd624af10a
This commit is contained in:
Travis Geiselbrecht
2015-04-01 16:34:42 -07:00
parent 529f536b3e
commit 8ddb0a2f53
3 changed files with 16 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008 Brian Swetland
* Copyright (c) 2015 Travis Geiselbrecht
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
@@ -20,22 +20,8 @@
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
.global dcc_putc
.global dcc_getc
/* gpios on the microzed target */
#define GPIO_LEDR (47)
#if defined(ARM_ISA_ARMV6) || defined(ARM_ISA_ARMV7)
dcc_getc:
mrc 14, 0, r0, c0, c1, 0
tst r0, #(1 << 30)
moveq r0, #-1
mrcne 14, 0, r0, c0, c5, 0
bx lr
dcc_putc:
mrc 14, 0, r15, c0, c1, 0
mcrcc 14, 0, r0, c0, c5, 0
movcc r0, #0
movcs r0, #-1
bx lr
#endif

View File

@@ -13,7 +13,8 @@ GLOBAL_INCLUDES += \
$(LOCAL_DIR)/include
GLOBAL_DEFINES += \
EXTERNAL_CLOCK_FREQ=33333333
EXTERNAL_CLOCK_FREQ=33333333 \
TARGET_HAS_DEBUG_LED=1 \
MODULE_SRCS += \
$(LOCAL_DIR)/target.c

View File

@@ -20,6 +20,8 @@
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <dev/gpio.h>
#include <target/gpioconfig.h>
#include <platform/zynq.h>
#include <platform/gem.h>
@@ -172,6 +174,8 @@ const zynq_clk_cfg_t zynq_clk_cfg = {
void target_early_init(void)
{
gpio_config(GPIO_LEDR, GPIO_OUTPUT);
gpio_set(GPIO_LEDR, 0);
}
void target_init(void)
@@ -179,3 +183,9 @@ void target_init(void)
gem_init(GEM0_BASE, 256*1024);
}
void target_set_debug_led(unsigned int led, bool on)
{
if (led == 0)
gpio_set(GPIO_LEDR, on);
}