2009-05-01 19:10:05     U-boot on a custom board that is based on the BF548 ezkit

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

2009-05-01 19:10:05     U-boot on a custom board that is based on the BF548 ezkit

Jay Walther (UNITED STATES)

Message: 73517   

 

I loaded the compiled image for u-boot on our board for a parallel flash using the 548 ezkit image that is on the website onto our custom board.  The UART, FLASH and RAM are all based on the ezkit design.  When I run there is no output from the serial port.  I know the port is working, because we have used the UART driver code from VDSP.  We are looking at u-boot as an alternative to writting our own bootloader, and I thought this would be an easy way to test it.

 

Any thoughts as to why this would not work?

 

 

 

Jay Walther

QuoteReplyEditDelete

 

 

2009-05-02 16:54:28     Re: U-boot on a custom board that is based on the BF548 ezkit

Nikolay Chokoev (IRELAND)

Message: 73528   

 

Hi Jay,

 

How do you boot U-boot? I mean do you load it to the Flash and boot from there or use JTAG to load it or....?

 

Which u-boot file do you use?

 

Best regards,

 

Nikolay

QuoteReplyEditDelete

 

 

2009-05-03 01:20:00     What I am using

Jay Walther (UNITED STATES)

Message: 73529   

 

Sorry, I will try to give you some more details.  I have tried two different files, the u-boot-bf548-ezkit-para-2008R1.5.ldr and the u-boot-cm-bf548-para-2008R1.5.ldr.  I loaded it using VDK and the flashloader into the onboard flash.  I can step through the assembly code with the VDSP debugger.  I havent loaded the linux tools yet, so I cannot create a debugable version.

 

This is also my first real development with the possiblity of using Linux so it would take awhile before I could get to a compiled version and get some experience using the tools.

QuoteReplyEditDelete

 

 

2009-05-04 10:20:54     Re: U-boot on a custom board that is based on the BF548 ezkit

Robin Getz (UNITED STATES)

Message: 73568   

 

Jay:

 

Did you look at:

 

https://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:porting

 

Things to check:

 

The boot mode you are using is the correct one defined.

 

The UART that you are using is the one defined.

 

After that - try turning on early debug, and see what comes out...

 

-Robin

QuoteReplyEditDelete

 

 

2009-05-05 14:37:05     Re: U-boot on a custom board that is based on the BF548 ezkit

Jay Walther (UNITED STATES)

Message: 73690   

 

Robin,

 

Thanks for your suggestions.  I have checked the boot mode, and it is correct, I have downloaded the toolchain, and ported the software for my board as described.  I found that the UART was using UART1, and I am using UART0 so I have changed that and also set the port in my .c file.  I have checked all of the defines, and they appear correct.

 

When I compile, I get the following error:

 

bfin-uclinux-objcopy -O srec u-boot u-boot.srec

bfin-uclinux-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin

tools/envcrc common/env_common.o --binary > env-ldr.o

bfin-uclinux-ldr -T bf548-0.1 -c u-boot.ldr u-boot --bmode PARA --use-vmas --initcode cpu/blackfin/initcode.o --punchit $((0x2000)):$((0x2000)):env-ldr.o  -J --dma 6

create: invalid option -- 'J'

bfin-uclinux-ldr: Unknown option 'J' or argument missing

 

Backtrace:

bfin-uclinux-ldr[0x8049d7a]

bfin-uclinux-ldr[0x804a718]

bfin-uclinux-ldr[0x804ae27]

/lib/libc.so.6(__libc_start_main+0xe5)[0x22b6e5]

bfin-uclinux-ldr(wait+0x35)[0x8049571]

make: *** [u-boot.ldr] Error 1

 

 

I am not sure where the --dam 6 is coming from.  The blackfin.mk file that this appears to be working in has the -J but no other options in those lines

 

any thoughts?

 

 

 

Jay

QuoteReplyEditDelete

 

 

2009-05-05 15:40:26     Re: U-boot on a custom board that is based on the BF548 ezkit

Robin Getz (UNITED STATES)

Message: 73693   

 

Jay:

 

trunk code requires trunk toolchain (explains the -j issue - for now, you can just remove it from the make file).

 

As for the --dma 6, that is coming from your board file -- board/*/config.mk

 

 

 

rgetz@imhotep:~/blackfin/trunk/u-boot/u-boot-2009.03> grep LDR_FLAGS board/*/config.mk | grep dma

board/bf533-ezkit/config.mk:LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

board/bf533-stamp/config.mk:LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

board/bf537-stamp/config.mk:LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

board/bf538f-ezkit/config.mk:LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

board/bf548-ezkit/config.mk:LDR_FLAGS-BFIN_BOOT_PARA       := --dma 6

board/bf548-ezkit/config.mk:LDR_FLAGS-BFIN_BOOT_FIFO       := --dma 1

board/bf548-ezkit/config.mk:LDR_FLAGS-BFIN_BOOT_SPI_MASTER := --dma 1

board/bf548-ezkit/config.mk:LDR_FLAGS-BFIN_BOOT_UART       := --dma 1

board/bf548-ezkit/config.mk:LDR_FLAGS-BFIN_BOOT_NAND       := --dma 6

board/cm-bf533/config.mk:LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

board/cm-bf537e/config.mk:LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

board/cm-bf548/config.mk:LDR_FLAGS-BFIN_BOOT_PARA       := --dma 6

board/cm-bf548/config.mk:LDR_FLAGS-BFIN_BOOT_FIFO       := --dma 1

board/cm-bf548/config.mk:LDR_FLAGS-BFIN_BOOT_SPI_MASTER := --dma 1

board/cm-bf548/config.mk:LDR_FLAGS-BFIN_BOOT_UART       := --dma 1

board/tcm-bf537/config.mk:LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8

 

 

-Robin

QuoteReplyEditDelete

 

 

2009-05-11 12:50:09     I can build now, but I still see no output

Jay Walther (UNITED STATES)

Message: 73954   

 

Robin,

 

Thanks, I am now able to build U-boot, I have changed the Uart to 0 for my board, but I still see no output to the Serial port with early debug defined.

 

I have seen a similar issue with example code, where changing the port did not affect the interrupt definitions, so that even though I changed my port to use Uart0 it still had the interrupts set for Uart1.

 

Where might I look verify this in the source?

 

 

 

Jay

QuoteReplyEditDelete

 

 

2009-05-11 14:09:53     Re: I can build now, but I still see no output

Mike Frysinger (UNITED STATES)

Message: 73955   

 

u-boot doesnt use interrupts.  it polls the registers directly.  and the UART used is selected by CONFIG_UART_CONSOLE.

QuoteReplyEditDelete

 

 

2009-05-12 16:17:00     Re: I can build now, but I still see no output

Jay Walther (UNITED STATES)

Message: 73997   

 

I have downloaded the mature source, to see if I can make it work, instead of the trunk source.  I have completed all of the instructions in the port instructions, and I can compile.  Since I don't have anyway to debug in linux at this time I am using VDSP++ to FLASH my board and the debugger to look at registers and ASM code.

 

int board_early_init_f(void)

{

 

    /* Port H: PH8 - PH13 == A4 - A9

     * address lines of the parallel asynchronous memory interface

     */

 

    /************************************************

    * configure GPIO                 *

    * set port H function enable register        *

    *  configure PH8-PH13 as peripheral (not GPIO)     *

    *************************************************/

    bfin_write_PORTH_FER(0x3F00);

 

    /************************************************

    * set port H MUX to configure PH8-PH13        *

    *  1st Function (MUX = 00) (bits 16-27 == 0)    *

    *  Set to address signals A4-A9         *

    *************************************************/

    bfin_write_PORTH_MUX(0);

 

    /************************************************

    * set port H direction register            *

    *  enable PH8-PH13 as outputs            *

    *************************************************/

    bfin_write_PORTH_DIR_SET(0x3F00);

 

    /* Port I: PI0 - PH14 == A10 - A24

     * address lines of the parallel asynchronous memory interface

     */

 

    /************************************************

    * set port I function enable register        *

    *  configure PI0-PI14 as peripheral (not GPIO)     *

    *************************************************/

    bfin_write_PORTI_FER(0x7fff);

 

    /**************************************************

    * set PORT I MUX to configure PI14-PI0 as      *

    * 1st Function (MUX=00) - address signals A10-A24 *

    ***************************************************/

    bfin_write_PORTI_MUX(0);

 

    /****************************************

    * set PORT I direction register        *

    *  enable PI0 - PI14 as outputs        *

    *****************************************/

    bfin_write_PORTI_DIR_SET(0x7fff);

 

    /*

     * Port E: PE7 - PE8 = UART0 TX and RX

     */

    bfin_write_PORTE_MUX(0);

    bfin_write_PORTE_FER(0x0180);

    bfin_write_PORTE_DIR_SET(0);

 

    return 0;

}

 

After running the code, and seeing no output on the UART0, which is where I have set the CONFIG_UART to I looked at the GPIO registers to make sure that port E is set for UART0 to be active,  The last three lines of code above do not appear to affect the PORTE registers at all.  All the other registers are set as shown.  If I set the registers manually, I still get no output.

 

 

 

Jay

QuoteReplyEditDelete

 

 

2009-05-14 08:15:45     Re: I can build now, but I still see no output

Mike Frysinger (UNITED STATES)

Message: 74063   

 

the define is not CONFIG_UART, it is CONFIG_UART_CONSOLE

 

why would you touch the DIR_SET reigster ?  that is only used for GPIO pins, not peripheral pins.

 

are you sure those lines of code are actually being executed ?  what if you put a SSYNC() after them ?

QuoteReplyEditDelete

 

 

2009-05-14 11:01:29     Re: I can build now, but I still see no output

Jay Walther (UNITED STATES)

Message: 74074   

 

Mike,

 

You are right, it is:

 

#define CONFIG_UART_CONSOLE    0

 

as far as knowing if the code is even running, I know the all the other ports listed there are getting set to the correct values, so I would assume that it is, but I cannot be sure since I don't have jtag tools that run under linux yet.

 

I will try your suggested changes and load it today to see if it makes any changes.

 

 

 

Thanks for your patience and suggestions,

 

Jay

QuoteReplyEditDelete

 

 

2009-05-14 14:22:24     Re: I can build now, but I still see no output

Mike Frysinger (UNITED STATES)

Message: 74081   

 

if you have some JTAG attached, you can manually break in by doing:

asm volatile ("emuexcpt;");

 

and then review settings before continuing

Attachments

    Outcomes