<div dir="ltr">Hi Thomas,<br><div class="gmail_extra"><br><div class="gmail_quote">2016-08-01 20:15 GMT+08:00 Thomas Doerfler <span dir="ltr"><<a href="mailto:thomas.doerfler@embedded-brains.de" target="_blank">thomas.doerfler@embedded-brains.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
just out of curiosity (and because I might need a i.MX6 BSP for an<br>
upcoming project):<br>
<br>
What is the current state of the BSP? What are the plans for the near<br>
future?<br></blockquote><div><br></div><div>Sorry for late reply. No update (:, busy on other things.</div><div>I would like to support low end i.MX6 processors using RTEMS, but i do</div><div>not have much time on this.</div><div>I am happy to see, if you would like to upstream or reuse the code or else.</div><div><br></div><div>Regards,</div><div>Peng.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
wkr,<br>
<br>
Thomas.<br>
<br>
<br>
Am 14.04.2016 um 11:49 schrieb Peng Fan:<br>
> Initial BSP support for i.MX 6UltraLite EVK board.<br>
> Add uart driver<br>
> Add gpt driver to service tick function<br>
><br>
> The i.MX 6UltraLite is a high performance, ultra-efficient processor<br>
> family featuring an advanced implementation of a single ARM® Cortex®-A7<br>
> core, which operates at speeds up to 528 MHz. The i.MX 6UltraLite<br>
> applications processor includes an integrated power management module<br>
> that reduces the complexity of external power supply and simplifies<br>
> power sequencing.<br>
><br>
> Now, clock management module and pinmux module not added,<br>
> so relies the setting in U-Boot.<br>
> ---<br>
>  c/src/lib/libbsp/arm/<wbr>acinclude.m4                  |   2 +<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>Makefile.am          | 139 +++++++++++++++++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>README               |  28 ++++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>bsp_specs            |  13 ++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<a href="http://configure.ac" rel="noreferrer" target="_blank"><wbr>configure.ac</a>         |  34 +++++<br>
>  .../libbsp/arm/mx6ulevk/<wbr>console/console-config.c   |  82 +++++++++++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>console/imx-uart.c   | 131 ++++++++++++++++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>gpt.c                | 164 +++++++++++++++++++++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>include/bsp.h        | 121 +++++++++++++++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>include/imx6-gpt.h   |  48 ++++++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>include/imx6-uart.h  |  60 ++++++++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>include/irq.h        |  38 +++++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>include/tm27.h       |  24 +++<br>
>  .../libbsp/arm/mx6ulevk/make/<wbr>custom/mx6ulevk.cfg   |   9 ++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<a href="http://preinstall.am" rel="noreferrer" target="_blank"><wbr>preinstall.am</a>        | 151 +++++++++++++++++++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>startup/bspreset.c   |  24 +++<br>
>  c/src/lib/libbsp/arm/mx6ulevk/<wbr>startup/bspstart.c   |  25 ++++<br>
>  .../libbsp/arm/mx6ulevk/<wbr>startup/bspstarthooks.c    |  70 +++++++++<br>
>  .../libbsp/arm/mx6ulevk/<wbr>startup/linkcmds.mx6ulevk  |  48 ++++++<br>
>  19 files changed, 1211 insertions(+)<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>Makefile.am<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>README<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>bsp_specs<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<a href="http://configure.ac" rel="noreferrer" target="_blank"><wbr>configure.ac</a><br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>console/console-config.c<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>console/imx-uart.c<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>gpt.c<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>include/bsp.h<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>include/imx6-gpt.h<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>include/imx6-uart.h<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>include/irq.h<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>include/tm27.h<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>make/custom/mx6ulevk.cfg<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<a href="http://preinstall.am" rel="noreferrer" target="_blank"><wbr>preinstall.am</a><br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>startup/bspreset.c<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>startup/bspstart.c<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>startup/bspstarthooks.c<br>
>  create mode 100644 c/src/lib/libbsp/arm/mx6ulevk/<wbr>startup/linkcmds.mx6ulevk<br>
><br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>acinclude.m4 b/c/src/lib/libbsp/arm/<wbr>acinclude.m4<br>
> index f5ca105..c15dc82 100644<br>
> --- a/c/src/lib/libbsp/arm/<wbr>acinclude.m4<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>acinclude.m4<br>
> @@ -26,6 +26,8 @@ AC_DEFUN([RTEMS_CHECK_BSPDIR],<br>
>      AC_CONFIG_SUBDIRS([lpc24xx]);;<br>
>    lpc32xx )<br>
>      AC_CONFIG_SUBDIRS([lpc32xx]);;<br>
> +  mx6ulevk )<br>
> +    AC_CONFIG_SUBDIRS([mx6ulevk]);<wbr>;<br>
>    raspberrypi )<br>
>      AC_CONFIG_SUBDIRS([<wbr>raspberrypi]);;<br>
>    realview-pbx-a9 )<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/Makefile.am b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/Makefile.am<br>
> new file mode 100644<br>
> index 0000000..517b524<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/Makefile.am<br>
> @@ -0,0 +1,139 @@<br>
> +##<br>
> +#<br>
> +# @file<br>
> +#<br>
> +# @brief Makefile of libBSP for the i.MX 6UltraLite EVK platform (Cortex-A7).<br>
> +#<br>
> +<br>
> +ACLOCAL_AMFLAGS = -I ../../../../aclocal<br>
> +<br>
> +include $(top_srcdir)/../../../../<wbr>automake/<a href="http://compile.am" rel="noreferrer" target="_blank">compile.am</a><br>
> +<br>
> +include_bspdir = $(includedir)/bsp<br>
> +include_libcpudir = $(includedir)/libcpu<br>
> +<br>
> +dist_project_lib_DATA = bsp_specs<br>
> +<br>
> +#############################<wbr>##############################<wbr>####################<br>
> +#                  Header                                                     #<br>
> +#############################<wbr>##############################<wbr>####################<br>
> +<br>
> +include_HEADERS = include/bsp.h<br>
> +include_HEADERS += ../../shared/include/tm27.h<br>
> +<br>
> +nodist_include_HEADERS = ../../shared/include/coverhd.h \<br>
> +     include/bspopts.h<br>
> +<br>
> +nodist_include_bsp_HEADERS = ../../shared/include/bootcard.<wbr>h<br>
> +<br>
> +include_bsp_HEADERS =<br>
> +include_bsp_HEADERS += ../../shared/include/utility.h<br>
> +include_bsp_HEADERS += ../../shared/include/irq-<wbr>generic.h<br>
> +include_bsp_HEADERS += ../../shared/include/irq-info.<wbr>h<br>
> +include_bsp_HEADERS += ../../shared/include/<wbr>stackalloc.h<br>
> +include_bsp_HEADERS += ../../shared/include/uart-<wbr>output-char.h<br>
> +include_bsp_HEADERS += ../shared/include/arm-a8core-<wbr>start.h<br>
> +include_bsp_HEADERS += ../shared/include/arm-cp15-<wbr>start.h<br>
> +include_bsp_HEADERS += ../shared/include/arm-errata.h<br>
> +include_bsp_HEADERS += ../shared/include/arm-gic.h<br>
> +include_bsp_HEADERS += ../shared/include/arm-gic-irq.<wbr>h<br>
> +include_bsp_HEADERS += ../shared/include/arm-gic-<wbr>regs.h<br>
> +include_bsp_HEADERS += ../shared/include/arm-gic-<wbr>tm27.h<br>
> +include_bsp_HEADERS += ../shared/include/arm-release-<wbr>id.h<br>
> +include_bsp_HEADERS += ../shared/include/start.h<br>
> +include_bsp_HEADERS += include/irq.h<br>
> +include_bsp_HEADERS += include/imx6-uart.h<br>
> +include_bsp_HEADERS += include/imx6-gpt.h<br>
> +<br>
> +include_libcpu_HEADERS =<br>
> +include_libcpu_HEADERS += ../../../libcpu/arm/shared/<wbr>include/arm-cp15.h<br>
> +<br>
> +#############################<wbr>##############################<wbr>####################<br>
> +#                  Data                                                       #<br>
> +#############################<wbr>##############################<wbr>####################<br>
> +<br>
> +noinst_LIBRARIES = libbspstart.a<br>
> +<br>
> +libbspstart_a_SOURCES = ../shared/start/start.S<br>
> +<br>
> +project_lib_DATA = start.$(OBJEXT)<br>
> +<br>
> +project_lib_DATA += startup/linkcmds<br>
> +project_lib_DATA += startup/linkcmds.mx6ulevk<br>
> +<br>
> +EXTRA_DIST = startup/linkcmds.mx6ulevk<br>
> +<br>
> +#############################<wbr>##############################<wbr>####################<br>
> +#                  LibBSP                                                     #<br>
> +#############################<wbr>##############################<wbr>####################<br>
> +<br>
> +noinst_LIBRARIES += libbsp.a<br>
> +<br>
> +libbsp_a_SOURCES =<br>
> +libbsp_a_CPPFLAGS =<br>
> +libbsp_a_LIBADD =<br>
> +<br>
> +# Shared<br>
> +libbsp_a_SOURCES += ../../shared/bootcard.c<br>
> +libbsp_a_SOURCES += ../../shared/bspclean.c<br>
> +libbsp_a_SOURCES += ../../shared/bspgetworkarea.c<br>
> +libbsp_a_SOURCES += ../../shared/bsppredriverhook.<wbr>c<br>
> +libbsp_a_SOURCES += ../../shared/cpucounterdiff.c<br>
> +libbsp_a_SOURCES += ../../shared/<wbr>gnatinstallhandler.c<br>
> +libbsp_a_SOURCES += ../../shared/sbrk.c<br>
> +libbsp_a_SOURCES += ../../shared/timerstub.c<br>
> +libbsp_a_SOURCES += ../../shared/src/stackalloc.c<br>
> +libbsp_a_SOURCES += ../shared/abort/simple_abort.c<br>
> +libbsp_a_SOURCES += ../shared/startup/bsp-start-<wbr>memcpy.S<br>
> +libbsp_a_SOURCES += ../shared/arm-cp15-set-<wbr>exception-handler.c<br>
> +libbsp_a_SOURCES += ../shared/arm-cp15-set-ttb-<wbr>entries.c<br>
> +<br>
> +# Startup<br>
> +libbsp_a_SOURCES += startup/bspreset.c<br>
> +libbsp_a_SOURCES += startup/bspstart.c<br>
> +<br>
> +# IRQ<br>
> +libbsp_a_SOURCES += ../../shared/src/irq-default-<wbr>handler.c<br>
> +libbsp_a_SOURCES += ../../shared/src/irq-generic.c<br>
> +libbsp_a_SOURCES += ../../shared/src/irq-info.c<br>
> +libbsp_a_SOURCES += ../../shared/src/irq-legacy.c<br>
> +libbsp_a_SOURCES += ../../shared/src/irq-server.c<br>
> +libbsp_a_SOURCES += ../../shared/src/irq-shell.c<br>
> +libbsp_a_SOURCES += ../shared/arm-gic-irq.c<br>
> +<br>
> +# Console<br>
> +libbsp_a_SOURCES += ../../shared/console.c<br>
> +libbsp_a_SOURCES += ../../shared/console_control.c<br>
> +libbsp_a_SOURCES += ../../shared/console_read.c<br>
> +libbsp_a_SOURCES += ../../shared/console_select_<wbr>simple.c<br>
> +libbsp_a_SOURCES += ../../shared/console_write.c<br>
> +libbsp_a_SOURCES += ../../shared/console-output-<wbr>char.c<br>
> +libbsp_a_SOURCES += console/console-config.c<br>
> +libbsp_a_SOURCES += console/imx-uart.c<br>
> +<br>
> +#I2C<br>
> +<br>
> +#GPIO<br>
> +<br>
> +#RTC<br>
> +<br>
> +# Clock<br>
> +libbsp_a_SOURCES += ../../shared/clockdrv_shell.h<br>
> +libbsp_a_SOURCES += gpt.c<br>
> +<br>
> +# Cache<br>
> +libbsp_a_SOURCES += ../../../libcpu/shared/src/<wbr>cache_manager.c<br>
> +libbsp_a_SOURCES += ../../../libcpu/arm/shared/<wbr>include/cache_.h<br>
> +libbsp_a_CPPFLAGS += -I$(srcdir)/../../../libcpu/<wbr>arm/shared/include<br>
> +<br>
> +# Start hooks<br>
> +libbsp_a_SOURCES += startup/bspstarthooks.c<br>
> +<br>
> +#############################<wbr>##############################<wbr>####################<br>
> +#                  Special Rules                                              #<br>
> +#############################<wbr>##############################<wbr>####################<br>
> +<br>
> +DISTCLEANFILES = include/bspopts.h<br>
> +<br>
> +include $(srcdir)/<a href="http://preinstall.am" rel="noreferrer" target="_blank">preinstall.am</a><br>
> +include $(top_srcdir)/../../../../<wbr>automake/<a href="http://local.am" rel="noreferrer" target="_blank">local.am</a><br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/README b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/README<br>
> new file mode 100644<br>
> index 0000000..bca7661<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/README<br>
> @@ -0,0 +1,28 @@<br>
> +How to compile:<br>
> +$mkdir b-rtems<br>
> +$cd b-rtems<br>
> +$../rtems-source/configure --target=arm-rtems4.12 --enable-tests --disable-networking<br>
> +$gmake RTEMS_BSP="mx6ulevk"<br>
> +<br>
> +After compile:<br>
> +$arm-rtems4.12-objcopy -O binary hello.exe hello.bin<br>
> +$arm-rtems4.12-objcopy -O binary ticker.exe ticker.bin<br>
> +<br>
> +U-Boot source:<br>
> +<a href="http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/log/?h=imx_v2015.04_3.14.38_6ul_ga" rel="noreferrer" target="_blank">http://git.freescale.com/git/<wbr>cgit.cgi/imx/uboot-imx.git/<wbr>log/?h=imx_v2015.04_3.14.38_<wbr>6ul_ga</a><br>
> +Build U-Boot:<br>
> +$export CROSS_COMPILE=arm-poky-linux-<wbr>gnueabi-<br>
> +$make ARCH=arm mx6ul_14x14_evk_config<br>
> +$make<br>
> +Burn u-boot.imx to offset 0x400 of sd card.<br>
> +<br>
> +How to run using U-Boot:<br>
> +Run hello example<br>
> +=>fatload mmc 1:1 0x80000000 hello.bin<br>
> +=>dcache off; icache off; dcache flush; icache flush<br>
> +=>go 0x80000000<br>
> +<br>
> +Or using tftp to load test bin<br>
> +=>tftp 0x80000000 ticker.bin<br>
> +=>dcache off; icache off; dcache flush; icache flush<br>
> +=>go 0x80000000<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/bsp_specs b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/bsp_specs<br>
> new file mode 100644<br>
> index 0000000..32c105f<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/bsp_specs<br>
> @@ -0,0 +1,13 @@<br>
> +%rename endfile old_endfile<br>
> +%rename startfile old_startfile<br>
> +%rename link old_link<br>
> +<br>
> +*startfile:<br>
> +%{!qrtems: %(old_startfile)} \<br>
> +%{!nostdlib: %{qrtems: start.o%s crti.o%s crtbegin.o%s -e _start}}<br>
> +<br>
> +*link:<br>
> +%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N}<br>
> +<br>
> +*endfile:<br>
> +%{!qrtems: %(old_endfiles)} %{qrtems: crtend.o%s crtn.o%s }<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> new file mode 100644<br>
> index 0000000..6f2d1e4<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> @@ -0,0 +1,34 @@<br>
> +##<br>
> +#<br>
> +# @file<br>
> +#<br>
> +# @brief Configure script of LibBSP for the i.MX 6UltraLite Processor.<br>
> +#<br>
> +<br>
> +AC_PREREQ([2.69])<br>
> +AC_INIT([rtems-c-src-lib-<wbr>libbsp-arm-mx6ulevk],[_RTEMS_<wbr>VERSION],[<a href="http://www.rtems.org/bugzilla" rel="noreferrer" target="_blank">http://www.rtems.<wbr>org/bugzilla</a>])<br>
> +AC_CONFIG_SRCDIR([bsp_specs])<br>
> +RTEMS_TOP(../../../../../..)<br>
> +<br>
> +RTEMS_CANONICAL_TARGET_CPU<br>
> +AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.12.2])<br>
> +RTEMS_BSP_CONFIGURE<br>
> +<br>
> +RTEMS_PROG_CC_FOR_TARGET<br>
> +RTEMS_CANONICALIZE_TOOLS<br>
> +RTEMS_PROG_CCAS<br>
> +<br>
> +RTEMS_CHECK_NETWORKING<br>
> +AM_CONDITIONAL(HAS_<wbr>NETWORKING,test "$HAS_NETWORKING" = "yes")<br>
> +<br>
> +RTEMS_BSPOPTS_SET([BSP_START_<wbr>RESET_VECTOR],[*],[])<br>
> +RTEMS_BSPOPTS_HELP([BSP_<wbr>START_RESET_VECTOR],[reset vector address for BSP start])<br>
> +<br>
> +RTEMS_BSPOPTS_SET([BSP_<wbr>CONSOLE_MINOR],[*],[0])<br>
> +RTEMS_BSPOPTS_HELP([BSP_<wbr>CONSOLE_MINOR],[minor number of console device])<br>
> +<br>
> +RTEMS_BSP_CLEANUP_OPTIONS(0, 1)<br>
> +RTEMS_BSP_LINKCMDS<br>
> +<br>
> +AC_CONFIG_FILES([Makefile])<br>
> +AC_OUTPUT<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/console/console-<wbr>config.c b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/console/console-<wbr>config.c<br>
> new file mode 100644<br>
> index 0000000..cc6b074<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/console/console-<wbr>config.c<br>
> @@ -0,0 +1,82 @@<br>
> +/*<br>
> + * Copyright (c) 2016 Peng Fan <<a href="mailto:van.freenix@gmail.com">van.freenix@gmail.com</a>><br>
> + *<br>
> + * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.<br>
> + *<br>
> + *  embedded brains GmbH<br>
> + *  Dornierstr. 4<br>
> + *  82178 Puchheim<br>
> + *  Germany<br>
> + *  <<a href="mailto:info@embedded-brains.de">info@embedded-brains.de</a>><br>
> + *<br>
> + * The license and distribution terms for this file may be<br>
> + * found in the file LICENSE in this distribution or at<br>
> + * <a href="http://www.rtems.com/license/LICENSE" rel="noreferrer" target="_blank">http://www.rtems.com/license/<wbr>LICENSE</a>.<br>
> + */<br>
> +<br>
> +#include <libchip/serial.h><br>
> +<br>
> +#include <bsp.h><br>
> +#include <bsp/irq.h><br>
> +<br>
> +extern const console_fns imx_uart_fns;<br>
> +console_tbl Console_Configuration_Ports[] = {<br>
> +   {<br>
> +    .sDeviceName = "/dev/ttyS0",<br>
> +    .deviceType = SERIAL_CUSTOM,<br>
> +    .pDeviceFns = &imx_uart_fns,<br>
> +    .deviceProbe = NULL,<br>
> +    .pDeviceFlow = NULL,<br>
> +    .ulMargin = 0,<br>
> +    .ulHysteresis = 0,<br>
> +    .pDeviceParams = (void *) 115200,<br>
> +    .ulCtrlPort1 = UART_BASE,<br>
> +    .ulCtrlPort2 = 0,<br>
> +    .ulDataPort = 0,<br>
> +    .getRegister = NULL,<br>
> +    .setRegister = NULL,<br>
> +    .getData = NULL,<br>
> +    .setData = NULL,<br>
> +    .ulClock = 0,<br>
> +    .ulIntVector = UART_IRQ<br>
> +  }<br>
> +};<br>
> +<br>
> +unsigned long Console_Configuration_Count =<br>
> +  RTEMS_ARRAY_SIZE(Console_<wbr>Configuration_Ports);<br>
> +<br>
> +static void output_char(char c)<br>
> +{<br>
> +  int minor = (int) Console_Port_Minor;<br>
> +  const console_tbl *ct = Console_Port_Tbl != NULL ?<br>
> +    Console_Port_Tbl[minor] : &Console_Configuration_Ports[<wbr>minor];<br>
> +  const console_fns *cf = ct->pDeviceFns;<br>
> +<br>
> +  if (c == '\n') {<br>
> +    (*cf->deviceWritePolled)(<wbr>minor, '\r');<br>
> +  }<br>
> +<br>
> +  (*cf->deviceWritePolled)(<wbr>minor, c);<br>
> +}<br>
> +<br>
> +static void output_char_init(char c)<br>
> +{<br>
> +  if (Console_Port_Tbl == NULL) {<br>
> +    int minor;<br>
> +    const console_fns *cf;<br>
> +<br>
> +    bsp_console_select();<br>
> +<br>
> +    minor = (int) Console_Port_Minor;<br>
> +    cf = Console_Configuration_Ports[<wbr>minor].pDeviceFns;<br>
> +<br>
> +    (*cf->deviceInitialize)(minor)<wbr>;<br>
> +  }<br>
> +<br>
> +  BSP_output_char = output_char;<br>
> +  output_char(c);<br>
> +}<br>
> +<br>
> +BSP_output_char_function_type BSP_output_char = output_char_init;<br>
> +<br>
> +BSP_polling_getchar_function_<wbr>type BSP_poll_char = NULL;<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/console/imx-uart.c b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/console/imx-uart.c<br>
> new file mode 100644<br>
> index 0000000..dd7f8ae<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/console/imx-uart.c<br>
> @@ -0,0 +1,131 @@<br>
> +/*<br>
> + * Copyright (c) 2016 Peng Fan <<a href="mailto:van.freenix@gmail.com">van.freenix@gmail.com</a>>.<br>
> + *<br>
> + * The license and distribution terms for this file may be<br>
> + * found in the file LICENSE in this distribution or at<br>
> + * <a href="http://www.rtems.org/license/LICENSE" rel="noreferrer" target="_blank">http://www.rtems.org/license/<wbr>LICENSE</a>.<br>
> + */<br>
> +<br>
> +#include <bspopts.h><br>
> +<br>
> +#include <libchip/serial.h><br>
> +#include <libchip/sersupp.h><br>
> +<br>
> +#include <bsp.h><br>
> +#include <bsp/irq.h><br>
> +#include <bsp/utility.h><br>
> +#include <bsp/uart-output-char.h><br>
> +<br>
> +#include <bsp/imx6-uart.h><br>
> +<br>
> +static uint32_t imx_uart_get_regs(int minor)<br>
> +{<br>
> +  const console_tbl *ct = Console_Port_Tbl != NULL ?<br>
> +    Console_Port_Tbl[minor] : &Console_Configuration_Ports[<wbr>minor];<br>
> +<br>
> +  return ct->ulCtrlPort1;<br>
> +}<br>
> +<br>
> +/* Make weak and let the user override. */<br>
> +uint32_t imx_uart_input_clock(void) __attribute__ ((weak));<br>
> +<br>
> +uint32_t imx_uart_input_clock(void)<br>
> +{<br>
> +  /*<br>
> +   * Now we use clock set from U-Boot, 80M.<br>
> +   * TODO:<br>
> +   *   Handling clock<br>
> +   */<br>
> +  return 80000000;<br>
> +}<br>
> +<br>
> +static int imx_calculate_baudrate(uint32_<wbr>t  baudrate,<br>
> +                                  uint32_t* brgr,<br>
> +                                  uint32_t* bauddiv,<br>
> +                                  uint32_t  modereg)<br>
> +{<br>
> +  /*<br>
> +   * Use the initialized baudrate from U-Boot.<br>
> +   * TODO:<br>
> +   *   Add baudrate handling<br>
> +   */<br>
> +  return 0;<br>
> +}<br>
> +<br>
> +static void imx_uart_initialize(int minor)<br>
> +{<br>
> +  /* TODO */<br>
> +}<br>
> +<br>
> +static int imx_uart_first_open(int major, int minor, void *arg)<br>
> +{<br>
> +  rtems_libio_open_close_args_t *oc = (rtems_libio_open_close_args_t *) arg;<br>
> +  struct rtems_termios_tty *tty = (struct rtems_termios_tty *) oc->iop->data1;<br>
> +  console_data *cd = &Console_Port_Data[minor];<br>
> +  const console_tbl *ct = Console_Port_Tbl[minor];<br>
> +<br>
> +  cd->termios_data = tty;<br>
> +  rtems_termios_set_initial_<wbr>baud(tty, (rtems_termios_baud_t) ct->pDeviceParams);<br>
> +<br>
> +  return 0;<br>
> +}<br>
> +<br>
> +static int imx_uart_last_close(int major, int minor, void *arg)<br>
> +{<br>
> +  return 0;<br>
> +}<br>
> +<br>
> +static int imx_uart_read_polled(int minor)<br>
> +{<br>
> +  uint32_t reg_base = imx_uart_get_regs(minor);<br>
> +<br>
> +  while (readl(reg_base + UTS_OFF) & UTS_RXEMPTY)<br>
> +    ;<br>
> +<br>
> +  return (readl(reg_base + URXD_OFF) & URXD_RX_DATA);<br>
> +}<br>
> +<br>
> +static void imx_uart_write_polled(int minor, char c)<br>
> +{<br>
> +  uint32_t reg_base = imx_uart_get_regs(minor);<br>
> +<br>
> +  writel(c, reg_base + UTXD_OFF);<br>
> +<br>
> +  while (!(readl(reg_base + UTS_OFF) & UTS_TXEMPTY))<br>
> +    ;<br>
> +<br>
> +  if (c == '\n')<br>
> +    imx_uart_write_polled(minor, '\r');<br>
> +}<br>
> +<br>
> +static ssize_t imx_uart_write_support_polled(<br>
> +  int minor,<br>
> +  const char *s,<br>
> +  size_t n<br>
> +)<br>
> +{<br>
> +  ssize_t i = 0;<br>
> +<br>
> +  for (i = 0; i < n; ++i) {<br>
> +    imx_uart_write_polled(minor, s[i]);<br>
> +  }<br>
> +<br>
> +  return n;<br>
> +}<br>
> +<br>
> +static int imx_uart_set_attribues(int minor, const struct termios *term)<br>
> +{<br>
> +  return -1;<br>
> +}<br>
> +<br>
> +const console_fns imx_uart_fns = {<br>
> +  .deviceProbe = libchip_serial_default_probe,<br>
> +  .deviceFirstOpen = imx_uart_first_open,<br>
> +  .deviceLastClose = imx_uart_last_close,<br>
> +  .deviceRead = imx_uart_read_polled,<br>
> +  .deviceWrite = imx_uart_write_support_polled,<br>
> +  .deviceInitialize = imx_uart_initialize,<br>
> +  .deviceWritePolled = imx_uart_write_polled,<br>
> +  .deviceSetAttributes = imx_uart_set_attribues,<br>
> +  .deviceOutputUsesInterrupts = false<br>
> +};<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/gpt.c b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/gpt.c<br>
> new file mode 100644<br>
> index 0000000..47b1659<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/gpt.c<br>
> @@ -0,0 +1,164 @@<br>
> +/*<br>
> + * Copyright (c) 2016 Peng Fan <<a href="mailto:van.freenix@gmail.com">van.freenix@gmail.com</a>>.<br>
> + *<br>
> + * The license and distribution terms for this file may be<br>
> + * found in the file LICENSE in this distribution or at<br>
> + * <a href="http://www.rtems.org/license/LICENSE" rel="noreferrer" target="_blank">http://www.rtems.org/license/<wbr>LICENSE</a>.<br>
> + */<br>
> +<br>
> +#include <rtems.h><br>
> +#include <rtems/timecounter.h><br>
> +#include <bsp.h><br>
> +<br>
> +#include <bsp/irq.h><br>
> +<br>
> +#include <bsp/imx6-gpt.h><br>
> +<br>
> +static imx6_gpt_timer_t gpt_timer = {<br>
> +  .base = GPT_TIMER_BASE,<br>
> +  .irq_nr = GPT_IRQ,<br>
> +};<br>
> +<br>
> +static struct timecounter gpt_clock_tc;<br>
> +static struct imx6_gpt_timer *timer = &gpt_timer;<br>
> +<br>
> +static uint32_t gpt_clock_get_timecount(struct timecounter *tc)<br>
> +{<br>
> +  return readl(timer->base + GPT_CNT);<br>
> +}<br>
> +<br>
> +static inline void gpt_irq_enable(void)<br>
> +{<br>
> +  writel(1 << 0, timer->base + GPT_IR);<br>
> +}<br>
> +<br>
> +static inline void gpt_irq_disable(void)<br>
> +{<br>
> +  writel(0, timer->base + GPT_IR);<br>
> +}<br>
> +<br>
> +static inline void gpt_irq_ack(void)<br>
> +{<br>
> +  writel(TSTAT_OF1, timer->base + GPT_SR);<br>
> +}<br>
> +<br>
> +static void gpt_clock_initialize(void)<br>
> +{<br>
> +  uint32_t gpt_cr;<br>
> +  uint32_t tprer_val, cur_cnt;<br>
> +  uint32_t interval = 3 * rtems_configuration_get_<wbr>microseconds_per_tick();<br>
> +<br>
> +  /* Software reset */<br>
> +  writel(1 << 15, timer->base + GPT_CR);<br>
> +  /* Dead loop until reset finished */<br>
> +  while (readl(timer->base + GPT_CR) & (1 << 15));<br>
> +<br>
> +  writel(0, timer->base + GPT_CR);<br>
> +  writel(0, timer->base + GPT_PR);<br>
> +<br>
> +  gpt_cr = TCTL_CLK_OSC_DIV8 | TCTL_FRR | TCTL_WAITEN | TCTL_TEN;<br>
> +  gpt_cr |= TCTL_24MEN;<br>
> +<br>
> +  /* 3M = 24M / 8*/<br>
> +  tprer_val = 7 << TPRER_PRE24M;<br>
> +  writel(tprer_val, timer->base + GPT_PR);<br>
> +<br>
> +  writel(gpt_cr, timer->base + GPT_CR);<br>
> +<br>
> +  /* Install timecounter */ \<br>
> +  gpt_clock_tc.tc_get_timecount = gpt_clock_get_timecount;<br>
> +  gpt_clock_tc.tc_counter_mask = 0xffffffff;<br>
> +  /* Runs at 3M */<br>
> +  gpt_clock_tc.tc_frequency = 3000000;<br>
> +  gpt_clock_tc.tc_quality = RTEMS_TIMECOUNTER_QUALITY_<wbr>CLOCK_DRIVER;<br>
> +  rtems_timecounter_install(&<wbr>gpt_clock_tc);<br>
> +<br>
> +  /* Clear pending interrupt */<br>
> +  gpt_irq_ack();<br>
> +<br>
> +  /* Fill the value to trigger the tick compare event */<br>
> +  cur_cnt = readl(timer->base + GPT_CNT);<br>
> +  writel(cur_cnt + interval, timer->base + GPT_OCR1);<br>
> +<br>
> +  /* Enable interrupt */<br>
> +  gpt_irq_enable();<br>
> +}<br>
> +<br>
> +static void gpt_clock_at_tick(void)<br>
> +{<br>
> +  uint32_t gpt_cnt;<br>
> +  /*<br>
> +   * The GPT runs at 3M.<br>
> +   *<br>
> +   *             rtems_configuration_get_<wbr>microseconds_per_tick<br>
> +   * interval =         ----------------------<br>
> +   *                      1000000 / 3000000<br>
> +   */<br>
> +  uint32_t interval = 3 * rtems_configuration_get_<wbr>microseconds_per_tick();<br>
> +<br>
> +  gpt_irq_disable();<br>
> +  gpt_irq_ack();<br>
> +<br>
> +  gpt_cnt = readl(timer->base + GPT_CNT);<br>
> +  writel(gpt_cnt + interval, timer->base + GPT_OCR1);<br>
> +<br>
> +  gpt_irq_enable();<br>
> +}<br>
> +<br>
> +CPU_Counter_ticks _CPU_Counter_read(void)<br>
> +{<br>
> +  return gpt_clock_get_timecount(NULL);<br>
> +}<br>
> +<br>
> +static rtems_interrupt_handler clock_isr = NULL;<br>
> +<br>
> +static void gpt_clock_handler_install(<wbr>rtems_interrupt_handler isr)<br>
> +{<br>
> +  rtems_status_code sc = RTEMS_SUCCESSFUL;<br>
> +<br>
> +  sc = rtems_interrupt_handler_<wbr>install(<br>
> +    timer->irq_nr,<br>
> +    "Clock",<br>
> +    RTEMS_INTERRUPT_UNIQUE,<br>
> +    isr,<br>
> +    NULL<br>
> +  );<br>
> +<br>
> +  if (sc != RTEMS_SUCCESSFUL) {<br>
> +    rtems_fatal_error_occurred(<wbr>0xdeadbeef);<br>
> +  }<br>
> +  clock_isr = isr;<br>
> +}<br>
> +<br>
> +static void gpt_clock_cleanup(void)<br>
> +{<br>
> +  rtems_status_code sc = RTEMS_SUCCESSFUL;<br>
> +<br>
> +  gpt_irq_ack();<br>
> +<br>
> +  gpt_irq_disable();<br>
> +<br>
> +  /* Remove interrupt handler */<br>
> +  sc = rtems_interrupt_handler_<wbr>remove(<br>
> +    timer->irq_nr,<br>
> +    clock_isr,<br>
> +    NULL<br>
> +  );<br>
> +  if (sc != RTEMS_SUCCESSFUL) {<br>
> +    rtems_fatal_error_occurred(<wbr>0xdeadbeef);<br>
> +  }<br>
> +  clock_isr = NULL;<br>
> +}<br>
> +<br>
> +#define Clock_driver_support_at_tick() gpt_clock_at_tick()<br>
> +#define Clock_driver_support_<wbr>initialize_hardware() gpt_clock_initialize()<br>
> +#define Clock_driver_support_install_<wbr>isr(isr, old_isr) \<br>
> +  do {                   \<br>
> +    gpt_clock_handler_install(isr)<wbr>;          \<br>
> +    old_isr = NULL;              \<br>
> +  } while (0)<br>
> +<br>
> +#define Clock_driver_support_shutdown_<wbr>hardware() gpt_clock_cleanup()<br>
> +<br>
> +/* Include shared source clock driver code */<br>
> +#include "../../shared/clockdrv_shell.<wbr>h"<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/bsp.h b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/bsp.h<br>
> new file mode 100644<br>
> index 0000000..516294a<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/bsp.h<br>
> @@ -0,0 +1,121 @@<br>
> +/*<br>
> + * Copyright (c) 2016 Peng Fan <<a href="mailto:van.freenix@gmail.com">van.freenix@gmail.com</a>>.<br>
> + *<br>
> + * The license and distribution terms for this file may be<br>
> + * found in the file LICENSE in this distribution or at<br>
> + * <a href="http://www.rtems.org/license/LICENSE" rel="noreferrer" target="_blank">http://www.rtems.org/license/<wbr>LICENSE</a>.<br>
> + */<br>
> +<br>
> +#ifndef LIBBSP_ARM_MX6ULEVK_BSP_H<br>
> +#define LIBBSP_ARM_MX6ULEVK_BSP_H<br>
> +<br>
> +#include <bspopts.h><br>
> +#include <stdint.h><br>
> +#include <bsp/start.h><br>
> +#include <bsp/default-initial-<wbr>extension.h><br>
> +<br>
> +#include <rtems.h><br>
> +#include <rtems/irq-extension.h><br>
> +<br>
> +#define BSP_FEATURE_IRQ_EXTENSION<br>
> +<br>
> +/* Access memory-mapped I/O devices */<br>
> +#define mmio_read(a)    (*(volatile uint32_t *)(a))<br>
> +#define mmio_write(a,v) (*(volatile uint32_t *)(a) = (v))<br>
> +#define mmio_set(a,v)   mmio_write((a), mmio_read((a)) | (v))<br>
> +#define mmio_clear(a,v) mmio_write((a), mmio_read((a)) & ~(v))<br>
> +<br>
> +#define REG16(x)(*((volatile uint16_t *)(x)))<br>
> +#define REG(x)(*((volatile uint32_t *)(x)))<br>
> +#define BIT(x)(0x1 << x)<br>
> +<br>
> +#define udelay(u) rtems_task_wake_after(1 + ((u)/rtems_configuration_get_<wbr>microseconds_per_tick()))<br>
> +<br>
> +/* Write a uint32_t value to a memory address. */<br>
> +static inline void<br>
> +write32(uint32_t address, uint32_t value)<br>
> +{<br>
> +    REG(address) = value;<br>
> +}<br>
> +<br>
> +/* Read an uint32_t from a memory address */<br>
> +static inline uint32_t<br>
> +read32(uint32_t address)<br>
> +{<br>
> +    return REG(address);<br>
> +}<br>
> +<br>
> +/* Set a 32 bits value depending on a mask */<br>
> +static inline void<br>
> +set32(uint32_t address, uint32_t mask, uint32_t value)<br>
> +{<br>
> +    uint32_t val;<br>
> +    val = read32(address);<br>
> +    /* clear the bits */<br>
> +    val &= ~(mask);<br>
> +    /* apply the value using the mask */<br>
> +    val |= (value & mask);<br>
> +    write32(address, val);<br>
> +}<br>
> +<br>
> +/* Write a uint16_t value to a memory address. */<br>
> +static inline void<br>
> +write16(uint32_t address, uint16_t value)<br>
> +{<br>
> +    REG16(address) = value;<br>
> +}<br>
> +<br>
> +/* Read an uint16_t from a memory address */<br>
> +static inline uint16_t<br>
> +read16(uint32_t address)<br>
> +{<br>
> +    return REG16(address);<br>
> +}<br>
> +<br>
> +/* Data synchronization barrier */<br>
> +static inline void dsb(void)<br>
> +{<br>
> +    asm volatile("dsb" : : : "memory");<br>
> +}<br>
> +<br>
> +/* Instruction synchronization barrier */<br>
> +static inline void isb(void)<br>
> +{<br>
> +    asm volatile("isb" : : : "memory");<br>
> +}<br>
> +<br>
> +/* flush data cache */<br>
> +static inline void flush_data_cache(void)<br>
> +{<br>
> +    asm volatile(<br>
> +        "mov r0, #0\n"<br>
> +        "mcr p15, #0, r0, c7, c10, #4\n"<br>
> +        : /* No outputs */<br>
> +        : /* No inputs */<br>
> +        : "r0","memory"<br>
> +    );<br>
> +}<br>
> +<br>
> +#define __arch_getb(a)      (*(volatile unsigned char *)(a))<br>
> +#define __arch_getw(a)      (*(volatile unsigned short *)(a))<br>
> +#define __arch_getl(a)      (*(volatile unsigned int *)(a))<br>
> +<br>
> +#define __arch_putb(v,a)    (*(volatile unsigned char *)(a) = (v))<br>
> +#define __arch_putw(v,a)    (*(volatile unsigned short *)(a) = (v))<br>
> +#define __arch_putl(v,a)    (*(volatile unsigned int *)(a) = (v))<br>
> +<br>
> +#define writeb(v,c) ({ unsigned char  __v = v; __arch_putb(__v,c); __v; })<br>
> +#define writew(v,c) ({ unsigned short __v = v; __arch_putw(__v,c); __v; })<br>
> +#define writel(v,c) ({ unsigned int __v = v; __arch_putl(__v,c); __v; })<br>
> +<br>
> +#define readb(c)  ({ unsigned char  __v = __arch_getb(c); __v; })<br>
> +#define readw(c)  ({ unsigned short __v = __arch_getw(c); __v; })<br>
> +#define readl(c)  ({ unsigned int __v = __arch_getl(c); __v; })<br>
> +<br>
> +#define BSP_ARM_GIC_DIST_BASE 0x00a01000<br>
> +#define BSP_ARM_GIC_CPUIF_BASE 0x00a02000<br>
> +<br>
> +#define GPT_TIMER_BASE 0x02098000<br>
> +#define UART_BASE 0x02020000<br>
> +<br>
> +#endif /* LIBBSP_ARM_BEAGLE_BSP_H */<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/imx6-gpt.h b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/imx6-gpt.h<br>
> new file mode 100644<br>
> index 0000000..6ce9c15<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/imx6-gpt.h<br>
> @@ -0,0 +1,48 @@<br>
> +/*<br>
> + * Copyright (c) 2016 Peng Fan <<a href="mailto:van.freenix@gmail.com">van.freenix@gmail.com</a>>.<br>
> + *<br>
> + * The license and distribution terms for this file may be<br>
> + * found in the file LICENSE in this distribution or at<br>
> + * <a href="http://www.rtems.org/license/LICENSE" rel="noreferrer" target="_blank">http://www.rtems.org/license/<wbr>LICENSE</a>.<br>
> + */<br>
> +<br>
> +#ifndef LIBBSP_ARM_MX6ULEVK_GPT_H<br>
> +#define LIBBSP_ARM_MX6ULEVK_GPT_H<br>
> +<br>
> +#include <stdint.h><br>
> +<br>
> +/* i.MX6 GPT register bit definition */<br>
> +#define TCTL_WAITEN          (1 << 3)<br>
> +#define TCTL_CLK_IPG         (1 << 6)<br>
> +#define TCTL_CLK_PER         (2 << 6)<br>
> +#define TCTL_CLK_OSC_DIV8    (5 << 6)<br>
> +#define TCTL_CLK_OSC         (7 << 6)<br>
> +#define TCTL_24MEN           (1 << 10)<br>
> +#define TCTL_FRR             (1 << 9)<br>
> +#define TPRER_PRE24M         12<br>
> +#define IR                   0x0c<br>
> +#define TSTAT                0x08<br>
> +#define TSTAT_OF1            (1 << 0)<br>
> +#define TCN                  0x24<br>
> +#define TCMP                 0x10<br>
> +#define TCTL_TEN            (1 << 0) /* Enable module */<br>
> +<br>
> +/* Register offset */<br>
> +#define GPT_CR   0x0<br>
> +#define GPT_PR   0x4<br>
> +#define GPT_SR   0x8<br>
> +#define GPT_IR   0xC<br>
> +#define GPT_OCR1 0x10<br>
> +#define GPT_OCR2 0x14<br>
> +#define GPT_OCR3 0x18<br>
> +#define GPT_ICR1 0x1C<br>
> +#define GPT_ICR2 0x20<br>
> +#define GPT_CNT  0x24<br>
> +<br>
> +typedef struct imx6_gpt_timer<br>
> +{<br>
> +  uint32_t base;<br>
> +  int irq_nr;<br>
> +} imx6_gpt_timer_t;<br>
> +<br>
> +#endif<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/imx6-uart.h b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/imx6-uart.h<br>
> new file mode 100644<br>
> index 0000000..cbce66a<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/imx6-uart.h<br>
> @@ -0,0 +1,60 @@<br>
> +/*<br>
> + * Copyright (c) 2016 Peng Fan <<a href="mailto:van.freenix@gmail.com">van.freenix@gmail.com</a>>.<br>
> + *<br>
> + * The license and distribution terms for this file may be<br>
> + * found in the file LICENSE in this distribution or at<br>
> + * <a href="http://www.rtems.org/license/LICENSE" rel="noreferrer" target="_blank">http://www.rtems.org/license/<wbr>LICENSE</a>.<br>
> + */<br>
> +<br>
> +#ifndef LIBBSP_ARM_MX6ULEVK_UART_REGS_<wbr>H<br>
> +#define LIBBSP_ARM_MX6ULEVK_UART_REGS_<wbr>H<br>
> +<br>
> +/* Register offset */<br>
> +#define URXD_OFF  0x0<br>
> +#define UTXD_OFF  0x40<br>
> +#define UCR1_OFF  0x80<br>
> +#define UCR2_OFF  0x84<br>
> +#define UCR3_OFF  0x88<br>
> +#define UCR4_OFF  0x8c<br>
> +#define UFCR_OFF  0x90<br>
> +#define USR1_OFF  0x94<br>
> +#define USR2_OFF  0x98<br>
> +#define UESC_OFF  0x9c<br>
> +#define UTIM_OFF  0xa0<br>
> +#define UBIR_OFF  0xa4<br>
> +#define UBMR_OFF  0xa8<br>
> +#define UBRC_OFF  0xac<br>
> +#define ONEMS_OFF 0xb0<br>
> +#define UTS_OFF   0xb4<br>
> +<br>
> +/* Register Bit Fields.*/<br>
> +#define  URXD_CHARRDY    (1<<15)<br>
> +#define  URXD_ERR        (1<<14)<br>
> +#define  URXD_OVRRUN     (1<<13)<br>
> +#define  URXD_FRMERR     (1<<12)<br>
> +#define  URXD_BRK        (1<<11)<br>
> +#define  URXD_PRERR      (1<<10)<br>
> +#define  URXD_RX_DATA    (0xFF)<br>
> +#define  UCR1_ADEN       (1<<15)<br>
> +#define  UCR1_ADBR       (1<<14)<br>
> +#define  UCR1_TRDYEN     (1<<13)<br>
> +#define  UCR1_IDEN       (1<<12)<br>
> +#define  UCR1_RRDYEN     (1<<9)<br>
> +#define  UCR1_RDMAEN     (1<<8)<br>
> +#define  UCR1_IREN       (1<<7)<br>
> +#define  UCR1_TXMPTYEN   (1<<6)<br>
> +#define  UCR1_RTSDEN     (1<<5)<br>
> +#define  UCR1_SNDBRK     (1<<4)<br>
> +#define  UCR1_TDMAEN     (1<<3)<br>
> +#define  UCR1_UARTCLKEN  (1<<2)<br>
> +#define  UCR1_DOZE       (1<<1)<br>
> +#define  UCR1_UARTEN     (1<<0)<br>
> +#define  UTS_FRCPERR  (1<<13)<br>
> +#define  UTS_LOOP        (1<<12)<br>
> +#define  UTS_TXEMPTY  (1<<6)<br>
> +#define  UTS_RXEMPTY  (1<<5)<br>
> +#define  UTS_TXFULL   (1<<4)<br>
> +#define  UTS_RXFULL   (1<<3)<br>
> +#define  UTS_SOFTRST  (1<<0)<br>
> +<br>
> +#endif<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/irq.h b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/irq.h<br>
> new file mode 100644<br>
> index 0000000..ff75953<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/irq.h<br>
> @@ -0,0 +1,38 @@<br>
> +/*<br>
> + * Copyright (c) 2016 Peng Fan <<a href="mailto:van.freenix@gmail.com">van.freenix@gmail.com</a>>.<br>
> + *<br>
> + * The license and distribution terms for this file may be<br>
> + * found in the file LICENSE in this distribution or at<br>
> + * <a href="http://www.rtems.com/license/LICENSE" rel="noreferrer" target="_blank">http://www.rtems.com/license/<wbr>LICENSE</a>.<br>
> + */<br>
> +<br>
> +#ifndef LIBBSP_ARM_MX6ULEVK_IRQ_H<br>
> +#define LIBBSP_ARM_MX6ULEVK_IRQ_H<br>
> +<br>
> +#ifndef ASM<br>
> +<br>
> +#include <rtems/irq.h><br>
> +#include <rtems/irq-extension.h><br>
> +<br>
> +#include <bsp/arm-gic-irq.h><br>
> +<br>
> +#ifdef __cplusplus<br>
> +extern "C" {<br>
> +#endif /* __cplusplus */<br>
> +<br>
> +/*<br>
> + * Interrupt Vector numbers<br>
> + */<br>
> +#define UART_IRQ 58<br>
> +#define GPT_IRQ 87<br>
> +<br>
> +#define BSP_INTERRUPT_VECTOR_MIN 0<br>
> +#define BSP_INTERRUPT_VECTOR_MAX 158<br>
> +<br>
> +#ifdef __cplusplus<br>
> +}<br>
> +#endif /* __cplusplus */<br>
> +<br>
> +#endif /* ASM */<br>
> +<br>
> +#endif /* LIBBSP_ARM_MX6ULEVK_IRQ_H */<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/tm27.h b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/tm27.h<br>
> new file mode 100644<br>
> index 0000000..96ab469<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/include/tm27.h<br>
> @@ -0,0 +1,24 @@<br>
> +/*<br>
> + * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.<br>
> + *<br>
> + *  embedded brains GmbH<br>
> + *  Dornierstr. 4<br>
> + *  82178 Puchheim<br>
> + *  Germany<br>
> + *  <<a href="mailto:info@embedded-brains.de">info@embedded-brains.de</a>><br>
> + *<br>
> + * The license and distribution terms for this file may be<br>
> + * found in the file LICENSE in this distribution or at<br>
> + * <a href="http://www.rtems.com/license/LICENSE" rel="noreferrer" target="_blank">http://www.rtems.com/license/<wbr>LICENSE</a>.<br>
> + */<br>
> +<br>
> +#ifndef _RTEMS_TMTEST27<br>
> +#error "This is an RTEMS internal file you must not include directly."<br>
> +#endif<br>
> +<br>
> +#ifndef __tm27_h<br>
> +#define __tm27_h<br>
> +<br>
> +#include <bsp/arm-gic-tm27.h><br>
> +<br>
> +#endif /* __tm27_h */<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/make/custom/mx6ulevk.<wbr>cfg b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/make/custom/mx6ulevk.<wbr>cfg<br>
> new file mode 100644<br>
> index 0000000..162e1ad<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/make/custom/mx6ulevk.<wbr>cfg<br>
> @@ -0,0 +1,9 @@<br>
> +include $(RTEMS_ROOT)/make/custom/<wbr>default.cfg<br>
> +<br>
> +RTEMS_CPU_MODEL=mx6<br>
> +<br>
> +RTEMS_CPU = arm<br>
> +<br>
> +CPU_CFLAGS = -march=armv7-a -mfpu=neon -mfloat-abi=soft -mtune=cortex-a7<br>
> +<br>
> +CFLAGS_OPTIMIZE_V ?= -O0 -g<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/<a href="http://preinstall.am" rel="noreferrer" target="_blank">preinstall.am</a> b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/<a href="http://preinstall.am" rel="noreferrer" target="_blank">preinstall.am</a><br>
> new file mode 100644<br>
> index 0000000..7a0dee4<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/<a href="http://preinstall.am" rel="noreferrer" target="_blank">preinstall.am</a><br>
> @@ -0,0 +1,151 @@<br>
> +## Automatically generated by ampolish3 - Do not edit<br>
> +<br>
> +if AMPOLISH3<br>
> +$(srcdir)/<a href="http://preinstall.am" rel="noreferrer" target="_blank">preinstall.am</a>: Makefile.am<br>
> +     $(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/<a href="http://preinstall.am" rel="noreferrer" target="_blank">preinstall.am</a><br>
> +endif<br>
> +<br>
> +PREINSTALL_DIRS =<br>
> +DISTCLEANFILES += $(PREINSTALL_DIRS)<br>
> +<br>
> +all-local: $(TMPINSTALL_FILES)<br>
> +<br>
> +TMPINSTALL_FILES =<br>
> +CLEANFILES = $(TMPINSTALL_FILES)<br>
> +<br>
> +all-am: $(PREINSTALL_FILES)<br>
> +<br>
> +PREINSTALL_FILES =<br>
> +CLEANFILES += $(PREINSTALL_FILES)<br>
> +<br>
> +$(PROJECT_LIB)/$(dirstamp):<br>
> +     @$(MKDIR_P) $(PROJECT_LIB)<br>
> +     @: > $(PROJECT_LIB)/$(dirstamp)<br>
> +PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)<br>
> +<br>
> +$(PROJECT_INCLUDE)/$(<wbr>dirstamp):<br>
> +     @$(MKDIR_P) $(PROJECT_INCLUDE)<br>
> +     @: > $(PROJECT_INCLUDE)/$(dirstamp)<br>
> +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp):<br>
> +     @$(MKDIR_P) $(PROJECT_INCLUDE)/bsp<br>
> +     @: > $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +<br>
> +$(PROJECT_INCLUDE)/libcpu/$(<wbr>dirstamp):<br>
> +     @$(MKDIR_P) $(PROJECT_INCLUDE)/libcpu<br>
> +     @: > $(PROJECT_INCLUDE)/libcpu/$(<wbr>dirstamp)<br>
> +PREINSTALL_DIRS += $(PROJECT_INCLUDE)/libcpu/$(<wbr>dirstamp)<br>
> +<br>
> +$(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs<br>
> +PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp.h: include/bsp.h $(PROJECT_INCLUDE)/$(dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/imx6-<wbr>gpt.h: include/imx6-gpt.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/imx6-<wbr>gpt.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/imx6-<wbr>gpt.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/imx6-<wbr>uart.h: include/imx6-uart.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/imx6-<wbr>uart.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/imx6-<wbr>uart.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/tm27.h: include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/<wbr>bootcard.h: ../../shared/include/bootcard.<wbr>h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/<wbr>bootcard.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/<wbr>bootcard.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/<wbr>utility.h: ../../shared/include/utility.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/<wbr>utility.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/<wbr>utility.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/irq-<wbr>generic.h: ../../shared/include/irq-<wbr>generic.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-<wbr>generic.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-<wbr>generic.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/irq-<wbr>info.h: ../../shared/include/irq-info.<wbr>h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-<wbr>info.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-<wbr>info.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/<wbr>stackalloc.h: ../../shared/include/<wbr>stackalloc.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/<wbr>stackalloc.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/<wbr>stackalloc.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/uart-<wbr>output-char.h: ../../shared/include/uart-<wbr>output-char.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/uart-<wbr>output-char.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/uart-<wbr>output-char.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/arm-<wbr>a8core-start.h: ../shared/include/arm-a8core-<wbr>start.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/arm-<wbr>a8core-start.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/arm-<wbr>a8core-start.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/arm-<wbr>cp15-start.h: ../shared/include/arm-cp15-<wbr>start.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/arm-<wbr>cp15-start.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/arm-<wbr>cp15-start.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/arm-<wbr>errata.h: ../shared/include/arm-errata.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/arm-<wbr>errata.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/arm-<wbr>errata.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/arm-<wbr>release-id.h: ../shared/include/arm-release-<wbr>id.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/arm-<wbr>release-id.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/arm-<wbr>release-id.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/start.<wbr>h: ../shared/include/start.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/start.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/start.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/arm-<wbr>gic.h: ../shared/include/arm-gic.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/arm-<wbr>gic.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/arm-<wbr>gic.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/arm-<wbr>gic-irq.h: ../shared/include/arm-gic-irq.<wbr>h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/arm-<wbr>gic-irq.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/arm-<wbr>gic-irq.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/arm-<wbr>gic-regs.h: ../shared/include/arm-gic-<wbr>regs.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/arm-<wbr>gic-regs.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/arm-<wbr>gic-regs.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/arm-<wbr>gic-tm27.h: ../shared/include/arm-gic-<wbr>tm27.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/arm-<wbr>gic-tm27.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/arm-<wbr>gic-tm27.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/arm-<wbr>release-id.h: ../shared/include/arm-release-<wbr>id.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/arm-<wbr>release-id.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/arm-<wbr>release-id.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/bsp/irq.h: include/irq.h $(PROJECT_INCLUDE)/bsp/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h<br>
> +<br>
> +$(PROJECT_INCLUDE)/libcpu/<wbr>arm-cp15.h: ../../../libcpu/arm/shared/<wbr>include/arm-cp15.h $(PROJECT_INCLUDE)/libcpu/$(<wbr>dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/arm-<wbr>cp15.h<br>
> +PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/arm-<wbr>cp15.h<br>
> +<br>
> +$(PROJECT_LIB)/start.$(<wbr>OBJEXT): start.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_LIB)/start.$(OBJEXT)<br>
> +TMPINSTALL_FILES += $(PROJECT_LIB)/start.$(OBJEXT)<br>
> +<br>
> +$(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds<br>
> +TMPINSTALL_FILES += $(PROJECT_LIB)/linkcmds<br>
> +<br>
> +$(PROJECT_LIB)/linkcmds.<wbr>mx6ulevk: startup/linkcmds.mx6ulevk $(PROJECT_LIB)/$(dirstamp)<br>
> +     $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.<wbr>mx6ulevk<br>
> +TMPINSTALL_FILES += $(PROJECT_LIB)/linkcmds.<wbr>mx6ulevk<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/bspreset.c b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/bspreset.c<br>
> new file mode 100644<br>
> index 0000000..52d07cd<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/bspreset.c<br>
> @@ -0,0 +1,24 @@<br>
> +/*<br>
> + * Copyright (c) 2016 Peng Fan <<a href="mailto:van.freenix@gmail.com">van.freenix@gmail.com</a>><br>
> + *<br>
> + * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.<br>
> + *<br>
> + *  embedded brains GmbH<br>
> + *  Dornierstr. 4<br>
> + *  82178 Puchheim<br>
> + *  Germany<br>
> + *  <<a href="mailto:info@embedded-brains.de">info@embedded-brains.de</a>><br>
> + *<br>
> + * The license and distribution terms for this file may be<br>
> + * found in the file LICENSE in this distribution or at<br>
> + * <a href="http://www.rtems.com/license/LICENSE" rel="noreferrer" target="_blank">http://www.rtems.com/license/<wbr>LICENSE</a>.<br>
> + */<br>
> +<br>
> +#include <bsp/bootcard.h><br>
> +<br>
> +void bsp_reset(void)<br>
> +{<br>
> +  while (true) {<br>
> +    /* TODO */;<br>
> +  }<br>
> +}<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/bspstart.c b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/bspstart.c<br>
> new file mode 100644<br>
> index 0000000..8ebd187<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/bspstart.c<br>
> @@ -0,0 +1,25 @@<br>
> +/*<br>
> + * Copyright (c) 2016 Peng Fan <<a href="mailto:van.freenix@gmail.com">van.freenix@gmail.com</a>><br>
> + *<br>
> + * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.<br>
> + *<br>
> + *  embedded brains GmbH<br>
> + *  Dornierstr. 4<br>
> + *  82178 Puchheim<br>
> + *  Germany<br>
> + *  <<a href="mailto:info@embedded-brains.de">info@embedded-brains.de</a>><br>
> + *<br>
> + * The license and distribution terms for this file may be<br>
> + * found in the file LICENSE in this distribution or at<br>
> + * <a href="http://www.rtems.com/license/LICENSE" rel="noreferrer" target="_blank">http://www.rtems.com/license/<wbr>LICENSE</a>.<br>
> + */<br>
> +<br>
> +#include <bsp.h><br>
> +#include <bsp/bootcard.h><br>
> +#include <bsp/irq-generic.h><br>
> +<br>
> +void bsp_start(void)<br>
> +{<br>
> +  bsp_interrupt_initialize();<br>
> +  printk("\n RTEMS MX6ULEVK board \n");<br>
> +}<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/<wbr>bspstarthooks.c b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/<wbr>bspstarthooks.c<br>
> new file mode 100644<br>
> index 0000000..28288f9<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/<wbr>bspstarthooks.c<br>
> @@ -0,0 +1,70 @@<br>
> +/*<br>
> + * Copyright (c) 2016 Peng Fan <<a href="mailto:van.freenix@gmail.com">van.freenix@gmail.com</a>><br>
> + *<br>
> + * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.<br>
> + *<br>
> + *  embedded brains GmbH<br>
> + *  Dornierstr. 4<br>
> + *  82178 Puchheim<br>
> + *  Germany<br>
> + *  <<a href="mailto:info@embedded-brains.de">info@embedded-brains.de</a>><br>
> + *<br>
> + * The license and distribution terms for this file may be<br>
> + * found in the file LICENSE in this distribution or at<br>
> + * <a href="http://www.rtems.com/license/LICENSE" rel="noreferrer" target="_blank">http://www.rtems.com/license/<wbr>LICENSE</a>.<br>
> + */<br>
> +<br>
> +#include <bsp.h><br>
> +#include <bsp/start.h><br>
> +#include <bsp/arm-cp15-start.h><br>
> +#include <bsp/arm-a8core-start.h><br>
> +<br>
> +BSP_START_DATA_SECTION static const arm_cp15_start_section_config<br>
> +mx6ulevk_mmu_config_table[] = {<br>
> +  ARMV7_CP15_START_DEFAULT_<wbr>SECTIONS,<br>
> +  {<br>
> +    /* ARM CORE */<br>
> +    .begin = 0x00A00000U,<br>
> +    .end   = 0x00A08000U,<br>
> +    .flags = ARMV7_MMU_DEVICE<br>
> +  }, {<br>
> +    /* AIPS1 */<br>
> +    .begin = 0x02000000U,<br>
> +    .end   = 0x02100000U,<br>
> +    .flags = ARMV7_MMU_DEVICE<br>
> +  }, {<br>
> +    /* AIPS2 */<br>
> +    .begin = 0x02100000U,<br>
> +    .end   = 0x02200000U,<br>
> +    .flags = ARMV7_MMU_DEVICE<br>
> +  }<br>
> +};<br>
> +<br>
> +BSP_START_TEXT_SECTION static void setup_mmu_and_cache(void)<br>
> +{<br>
> +<br>
> +  uint32_t ctrl = arm_cp15_start_setup_mmu_and_<wbr>cache(<br>
> +    ARM_CP15_CTRL_A | ARM_CP15_CTRL_M,<br>
> +    ARM_CP15_CTRL_AFE | ARM_CP15_CTRL_Z<br>
> +  );<br>
> +<br>
> +  arm_cp15_start_setup_<wbr>translation_table_and_enable_<wbr>mmu_and_cache(<br>
> +    ctrl,<br>
> +    (uint32_t *) bsp_translation_table_base,<br>
> +    ARM_MMU_DEFAULT_CLIENT_DOMAIN,<br>
> +    &mx6ulevk_mmu_config_table[0],<br>
> +    RTEMS_ARRAY_SIZE(mx6ulevk_mmu_<wbr>config_table)<br>
> +  );<br>
> +}<br>
> +<br>
> +BSP_START_TEXT_SECTION void bsp_start_hook_0(void)<br>
> +{<br>
> +}<br>
> +<br>
> +BSP_START_TEXT_SECTION void bsp_start_hook_1(void)<br>
> +{<br>
> +  arm_a8core_start_hook_1();<br>
> +  bsp_start_copy_sections();<br>
> +  setup_mmu_and_cache();<br>
> +  bsp_start_clear_bss();<br>
> +}<br>
> diff --git a/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/linkcmds.<wbr>mx6ulevk b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/linkcmds.<wbr>mx6ulevk<br>
> new file mode 100644<br>
> index 0000000..20ea3eb<br>
> --- /dev/null<br>
> +++ b/c/src/lib/libbsp/arm/<wbr>mx6ulevk/startup/linkcmds.<wbr>mx6ulevk<br>
> @@ -0,0 +1,48 @@<br>
> +/**<br>
> + * @file<br>
> + *<br>
> + * @ingroup  arm_beagle<br>
> + *<br>
> + * @brief Linker script for beagles.<br>
> + */<br>
> +<br>
> +MEMORY {<br>
> +  /* Beagleboards and beaglebones all<br>
> +   * have either 256M or 512M memory. We just<br>
> +   * use 256M for all.<br>
> +   */<br>
> +  RAM      : ORIGIN = 0x80000000, LENGTH = 256M - 4M<br>
> +  RAM_MMU  : ORIGIN = 0x80000000 + 256M - 4M, LENGTH = 16k<br>
> +}<br>
> +<br>
> +REGION_ALIAS ("REGION_START",          RAM);<br>
> +REGION_ALIAS ("REGION_VECTOR",         RAM);<br>
> +REGION_ALIAS ("REGION_TEXT",           RAM);<br>
> +REGION_ALIAS ("REGION_TEXT_LOAD",      RAM);<br>
> +REGION_ALIAS ("REGION_RODATA",         RAM);<br>
> +REGION_ALIAS ("REGION_RODATA_LOAD",    RAM);<br>
> +REGION_ALIAS ("REGION_DATA",           RAM);<br>
> +REGION_ALIAS ("REGION_DATA_LOAD",      RAM);<br>
> +REGION_ALIAS ("REGION_FAST_TEXT",      RAM);<br>
> +REGION_ALIAS ("REGION_FAST_TEXT_LOAD", RAM);<br>
> +REGION_ALIAS ("REGION_FAST_DATA",      RAM);<br>
> +REGION_ALIAS ("REGION_FAST_DATA_LOAD", RAM);<br>
> +REGION_ALIAS ("REGION_BSS",            RAM);<br>
> +REGION_ALIAS ("REGION_WORK",           RAM);<br>
> +REGION_ALIAS ("REGION_STACK",          RAM);<br>
> +REGION_ALIAS ("REGION_NOCACHE",        RAM);<br>
> +REGION_ALIAS ("REGION_NOCACHE_LOAD",   RAM);<br>
> +<br>
> +bsp_stack_irq_size = DEFINED (bsp_stack_irq_size) ? bsp_stack_irq_size : 4096;<br>
> +bsp_stack_abt_size = DEFINED (bsp_stack_abt_size) ? bsp_stack_abt_size : 1024;<br>
> +<br>
> +bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1M;<br>
> +<br>
> +bsp_vector_table_in_start_<wbr>section = 1;<br>
> +<br>
> +bsp_translation_table_base = ORIGIN (RAM_MMU);<br>
> +bsp_translation_table_end = ORIGIN (RAM_MMU) + LENGTH (RAM_MMU);<br>
> +<br>
> +INCLUDE linkcmds.armv4<br>
> +<br>
> +HeapSize = 1024 * 1024;<br>
><br>
<br>
--<br>
------------------------------<wbr>--------------<br>
embedded brains GmbH<br>
Thomas Doerfler<br>
Dornierstr. 4<br>
D-82178 Puchheim<br>
Germany<br>
email: <a href="mailto:Thomas.Doerfler@embedded-brains.de">Thomas.Doerfler@embedded-<wbr>brains.de</a><br>
Phone: +49-89-18 94 741-12<br>
Fax:   +49-89-18 94 741-09<br>
PGP: Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
<br>
<br>
______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a></blockquote></div><br></div></div>