2010-08-10 05:09:12     loading firmware to slave blackfin

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

2010-08-10 05:09:12     loading firmware to slave blackfin

Mike Sinkovsky (RUSSIAN FEDERATION)

Message: 92285   

 

I have board with two blackfin processors - one running linux, and another used as DSP.

Firmware for secondary blackfin must be loaded from linux, via SPI interface .

 

Problem is that there is HWAIT signal from secondary processor -- similar to RTS/CTS signal in UART.

But as I can see SPI host driver does not support this signal?

 

Then the only way is manually loading firmware one byte at a time, and checking HWAIT, someting like this:

 

for (i = 0; i < firmware_len; i++) {

    while (gpio_get_value(PIO_HWAIT) != 0) {

        if (time_after(jiffies, timeout))

            return -ENODEV;

        cpu_relax();

    }

    spi_write(spi, &firmware[i], 1);

}

 

But I thint this procedure will be very slow and ineffective...

Isn't there more effective ways to do this?

QuoteReplyEditDelete

 

 

2010-08-10 09:59:23     Re: loading firmware to slave blackfin

Ian Jeffray (UNITED KINGDOM)

Message: 92287   

 

If you look at the code that's in the blackfin ROM for the SPI slave boot mode, you'll see it only asserts HWAIT for the periods where it's copying the blocks to their final destination.   I successfully booted BF561s from a BF537 running uCLinux by simply parsing the .DXE format being sent to the BF561s such that I could just poll HWAIT between blocks.   It's pretty easy to implement, really.   Unfortunately I do not have access to this hardware any more so I can't help you with an actual implementation I'm afraid.

QuoteReplyEditDelete

 

 

2010-08-10 12:52:53     Re: loading firmware to slave blackfin

Mike Frysinger (UNITED STATES)

Message: 92292   

 

you can do GPIO/SPI parsing from userspace.  so no need to have the boot code load the firmware from kernel mode.

QuoteReplyEditDelete

 

 

2010-08-12 04:41:05     Re: loading firmware to slave blackfin

Mike Sinkovsky (RUSSIAN FEDERATION)

Message: 92368   

 

OK, I have succesfully loaded a minial LDR file into secondary blackfin processor.

 

Previously I always used VisualDSP compiler to build firmwares, but now I want to use linux toolchain.

Where can I find a minimal example of this?

Should I use bfin-elf-* verisin of toolchain, or bfin-uclinux-* ?

As I can see, u-boot and kernel uses bfin-uclinux?

QuoteReplyEditDelete

 

 

2010-08-12 06:58:52     Re: loading firmware to slave blackfin

Mike Frysinger (UNITED STATES)

Message: 92371   

 

bfin-uclinux is used only because linux & u-boot provide the entire environment.  unless you also want to provide everything (like headers that define MMRs), then you should use bfin-elf.

 

bfin-elf-ldr can be used to turn ELFs into LDRs.

QuoteReplyEditDelete

Attachments

    Outcomes