[PATCH 1/2] Initial bsp for Tiny6410

Peng Fan van.freenix at gmail.com
Wed Apr 17 15:06:26 UTC 2013


Sorry for missing the License in clock/support.c

I will try printk.Because the first version of the bsp does not include the
shared "start.S",
I wrote the Uart_ code  to debug the bsp specific start.S.




2013/4/17 Sebastian Huber <sebastian.huber at embedded-brains.de>

> On 04/17/2013 02:54 PM, Peng Fan wrote:
>
>> diff --git a/c/src/lib/libbsp/arm/**tiny6410/debug/debug.c
>> b/c/src/lib/libbsp/arm/**tiny6410/debug/debug.c
>> new file mode 100644
>> index 0000000..a57e4c9
>> --- /dev/null
>> +++ b/c/src/lib/libbsp/arm/**tiny6410/debug/debug.c
>> @@ -0,0 +1,57 @@
>> +/*
>> + *  Low level debug function
>> + *
>> + *  Copyright (c) 2013 by PengFan<van.freenix at gmail.com>
>> + *
>> + *  The license and distribution terms for this file may be
>> + *  found in the file LICENSE in this distribution or at
>> + *http://www.rtems.com/license/**LICENSE<http://www.rtems.com/license/LICENSE>
>> .
>>
>> + *
>> + */
>> +
>> +#include <bsp.h>
>> +#include <s3c64xx.h>
>> +void debug_led(uint32_t val)
>> +{
>> +       uint32_t *addr = (uint32_t *)0x7f008800;
>> +       *addr = val;
>> +}
>> +
>> +
>> +static void Delay(void)
>> +{
>> +    volatile int i;
>> +
>> +    for(i=0 ; i < 1000 ; i++)
>> +    {
>> +    }
>> +}
>> +
>> +void Uart_SendByte(int data)
>> +{
>> +    while(!(rUTRSTAT0 & 0x2));   //Wait until THR is empty.
>> +    Delay();
>> +    rUTXH0 = (unsigned char)data;
>> +}
>> +
>> +void Uart_SendString(char *pt)
>> +{
>> +    while(*pt)
>> +        Uart_SendByte(*pt++);
>> +    Uart_SendByte('\r');
>> +    Uart_SendByte('\n');
>> +}
>> +
>> +void printhex(unsigned int data)
>> +{
>> +       int i = 0,a = 0;
>> +       for (i = 0; i < 8; i++) {
>> +               a = (data>>(32-(i+1)*4))&0xf;
>> +               if (((a<=9)&&(a>=0)))
>> +                       Uart_SendByte(a + 0x30);
>> +               else if ((a <= 0xf) && (a >= 0xa))
>> +                       Uart_SendByte(a-0xa+0x61);
>> +       }
>> +       Uart_SendByte('\r');
>> +       Uart_SendByte('\n');
>> +}
>>
>
> Can't you use printk() for this?
>
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-**brains.de<sebastian.huber at embedded-brains.de>
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> ______________________________**_________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/**listinfo/rtems-devel<http://www.rtems.org/mailman/listinfo/rtems-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130417/54299a2a/attachment.html>


More information about the devel mailing list