2011-01-03 09:13:54     Using sport 1 as console

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2011-01-03 09:13:54     Using sport 1 as console

Shyam sundar (INDIA)

Message: 97135   

 

Hello world,

 

I am trying to use sport 1 as uart console.

 

During the u-boot I am using uart-1 as the console.When kernel image gets loaded, I want to make use of sport 1 as an uart console.

 

I am seeing junk values on the console.Can anybody tell what could be the problem?

 

 

 

I added the following routine in the stamp.c

 

#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART

static struct resource bfin_sport1_uart_resources[] = {

{

  .start = SPORT1_TCR1,

  .end = SPORT1_MRCS3+4,

  .flags = IORESOURCE_MEM,

},

{

  .start = IRQ_SPORT1_RX,

  .end = IRQ_SPORT1_RX+1,

  .flags = IORESOURCE_IRQ,

},

{

  .start = IRQ_SPORT1_ERROR,

  .end = IRQ_SPORT1_ERROR,

  .flags = IORESOURCE_IRQ,

},

};

 

static unsigned short bfin_sport1_peripherals[] = {

P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,

P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0

};

 

static struct platform_device bfin_sport1_uart_device = {

.name = "bfin-sport-uart",

.id = 1,

.num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),

.resource = bfin_sport1_uart_resources,

.dev = {

.platform_data = &bfin_sport1_peripherals, /* Passed to driver */

},

};

#endif

 

 

 

I added the following lines in uclinuxdist-2009R1/linux-2.6.x/drivers/serial/Kconfig file

 

config uclinuxdist-2009R1/linux-2.6.x/drivers/serial

    bool "Selecting sport 1 for console"

    depends on SERIAL_BFIN_SPORT_CONSOLE=y

 

Modified ttyBF0 as ttySS1 in the file U-boot/u-boot-2008.10/include/configs/bfin_adi_common.h

 

#define CONFIG_BOOTARGS    \

    "root=/dev/mtdblock0 rw " \

    "clkin_hz=" MK_STR(CONFIG_CLKIN_HZ) " " \

    "earlyprintk=serial,uart" MK_STR(CONFIG_UART_CONSOLE) "," MK_STR(CONFIG_BAUDRATE) " " \

    CONFIG_BOOTARGS_VIDEO \

    "console=ttySS1," MK_STR(CONFIG_BAUDRATE)

QuoteReplyEditDelete

 

 

2011-01-03 09:26:02     Re: Using sport 1 as console

Mike Frysinger (UNITED STATES)

Message: 97138   

 

it doesnt make much sense to modify the hardcoded build parameters.  simply update the env of your running u-boot.

 

you should show what you're actually executing at runtime via u-boot.

 

what version of the kernel exactly are you using ?

QuoteReplyEditDelete

 

 

2011-01-04 00:09:27     Re: Using sport 1 as console

Shyam sundar (INDIA)

Message: 97154   

 

Hello mike,

 

The u-boot console on Uart 1 works fine. This is the info that will be shown during the u-boot.

 

U-Boot 2008.10-svn2396 (ADI-2009R1.1-rc1) (Jan  3 2011 - 18:16:22)

 

CPU:   ADSP bf537-0.3 (Detected Rev: 0.3) (spi flash boot)

Board: ADI BF537 stamp board

       Support: http://blackfin.uclinux.org/

Clock: VCO: 589.824 MHz, Core: 589.824 MHz, System: 98.304 MHz

RAM:   32 MB

Flash: ## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB

0 kB

SF: Got idcode ef 40 17

In:    serial

Out:   serial

Err:   serial

Net:   Blackfin EMAC

MAC:   96:8B:98:22:2E:29

Hit any key to stop autoboot:  0

bfin> tftpboot 0x1000000 sport_console

Using Blackfin EMAC device

TFTP from server 10.7.143.13; our IP address is 10.7.143.99

Filename 'sport_console'.

Load address: 0x1000000

Loading: #################################################################

         #################################################################

         #################################################################

         #################################################################

         #########

done

Bytes transferred = 3946631 (3c3887 hex)

bfin> bootm

## Booting kernel from Legacy Image at 01000000 ...

   Image Name:   Linux-2.6.28.10-ADI-2009R1.1

   Created:      2011-01-03  13:44:11 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    3946567 Bytes =  3.8 MB

   Load Address: 00001000

   Entry Point:  00173f5c

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 00173f5c

Linux version 2.6.28.10-ADI-2009R1.1 (ganeshn@ganeshn-desktop) (gcc version 4.1.2 (ADI svn)) #42 Mon Jan 3 19:14:07 IST 2011

bootconsole [early_shadow0] enabled

bootconsole [early_BFuart1] enabled

early printk enabled on early_BFuart1

Board Memory: 32MB

Kernel Managed Memory: 32MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x000f2d50

  rodata    = 0x000f2d50-0x0014251c

  bss       = 0x00143000-0x00155314

  data      = 0x00155314-0x00166000

    stack   = 0x00164000-0x00166000

  init      = 0x00166000-0x007eb000

  available = 0x007eb000-0x01eff000

  DMA Zone  = 0x01f00000-0x02000000

Hardware Trace Active and Enabled

Boot Mode: 3

Blackfin support (C) 2004-2009 Analog Devices, Inc.

Compiled for ADSP-BF537 Rev 0.3

Blackfin Linux support by http://blackfin.uclinux.org/

Processor Speed: 589 MHz core clock and 98 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

Data Cache Enabled for CPU0 (write-back)

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 7873

Kernel command line: root=/dev/mtdblock0 rw clkin_hz=24576000 earlyprintk=serial,uart1,57600 console=ttySS1,57600

Configuring Blackfin Priority Driven Interrupts

PID hash table entries: 128 (order: 7, 512 bytes)

console [ttySS1] enabled, bootconsole disabled

 

 

 

I am using uclinux-2009R1.1-RC4 on BF537 and using u-boot-2008.10 for Uboot!

QuoteReplyEditDelete

 

 

2011-01-04 00:10:35     Re: Using sport 1 as console

Shyam sundar (INDIA)

Message: 97155   

 

But the console display through sport1 is junk characters

QuoteReplyEditDelete

 

 

2011-01-04 00:44:03     Re: Using sport 1 as console

Mike Frysinger (UNITED STATES)

Message: 97156   

 

your command line looks fine.  are you sure your SPORT UART is wired up correctly ?  and your serial client is the right baud ?  what hardware exactly are you using ?

QuoteReplyEditDelete

 

 

2011-01-04 05:20:26     Re: Using sport 1 as console

Shyam sundar (INDIA)

Message: 97163   

 

Thanks mike :)!!

 

I referred to the EE-191 application note and found that the tx and rx connections were reversed.

 

Now,Uart-1 works as u-boot console and Sport-1 works as linux console

QuoteReplyEditDelete

 

 

2011-01-04 06:08:11     Re: Using sport 1 as console

Shyam sundar (INDIA)

Message: 97164   

 

Got a small problem!

 

Though the Sport-1 console is working, I do get some junk data printed continuously through the sport-1 console!

QuoteReplyEditDelete

Attachments

    Outcomes