2009-06-24 09:22:38     l1.data can't be used in 2009R1

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

2009-06-24 09:22:38     l1.data can't be used in 2009R1

david wang (CHINA)

Message: 76242   

 

hi, all

 

  I'm moving my project from 2008R1.5 to 2009R1. But when I doing this job, My kernel will halt if I use l1.data in the kenerl driver like below,

 

  char test2[4] __attribute__((section(".l1.data"))) = {0, 0, 0, 0};

But the same code in 2008R1.5 has no problem.

 

I enabled I-Cache and D-Cache - only half of Bank A.

 

Does anyone know what's the problem? Thanks!

QuoteReplyEditDelete

 

 

2009-06-24 09:34:07     Re: l1.data can't be used in 2009R1

Mike Frysinger (UNITED STATES)

Message: 76244   

 

you should never use section("...").  use attribute((l1_data)).

 

saying "will halt" doesnt really provide any information at all.  you need to post real details in your questions.  what is the exact output when you boot the kernel ?  if you are getting no output, then use the post_mortem debug method to dump the kernel log buffer from u-boot.

QuoteReplyEditDelete

 

 

2009-06-24 09:46:53     Re: l1.data can't be used in 2009R1

david wang (CHINA)

Message: 76247   

 

Hi, Mike

 

  I've tried all other section param, like .l1.text, .l1.data.B, .l1.bss, .l1.bss.B . they are ok,  only the .l1.data not work.  But if I disable the D-Cache, event the .l1.data works. So I doubt the BFIN_DCACHE_BANKA not correct.

 

Btw, I think the BFIN_DCACHE_BANKA means only use half of Bank A to be data cache, and left the other half to be sram. So we have 16KB + 32 KB  = 48 KB sram if we enable the option Am I right?

 

//below is the dump when startup

 

## Booting image at 01000000 ...

   Image Name:   Linux-2.6.28.10-ADI-2009R1-svn68

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    3106938 Bytes =  3 MB

   Load Address: 00100000

   Entry Point:  0038f6e4

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 38f6e4 <--------------------------------------------------halt here

QuoteReplyEditDelete

 

 

2009-06-24 09:57:53     Re: l1.data can't be used in 2009R1

david wang (CHINA)

Message: 76248   

 

BTW,

 

the same result with __attribute__((l1_data)).

QuoteReplyEditDelete

 

 

2009-06-24 09:59:07     Re: l1.data can't be used in 2009R1

Mike Frysinger (UNITED STATES)

Message: 76249   

 

like i said, use the post mortem method:

  docs.blackfin.uclinux.org/doku.php?id=linux-kernel:debug:post_mortem

QuoteReplyEditDelete

 

 

2009-06-24 10:28:05     Re: l1.data can't be used in 2009R1

david wang (CHINA)

Message: 76254   

 

Hi, Mike

 

  It's unlucky that we don't have a reset buttom on the board. and I did things like "set bootargs $(bootargs) panic=3", but nothing happen after the board halt. So I can't  get the kernel message in u-boot. What shall I do?

QuoteReplyEditDelete

 

 

2009-06-24 10:40:55     Re: l1.data can't be used in 2009R1

Mike Frysinger (UNITED STATES)

Message: 76255   

 

then wire up a reset button.  or use JTAG.  or setup the watchdog to automatically reboot.

QuoteReplyEditDelete

 

 

2009-06-24 23:29:56     Re: l1.data can't be used in 2009R1

david wang (CHINA)

Message: 76284   

 

Hi, Mike

 

  Our hardware engineer told me it's impossible to add a reset buttom to the current board. So would you pls try my sample code?  It's very simple,

 

  //add below codes to anywhere of the kernel and compile, the run ramboot by tftp

 

int test1[4] __attribute__((l1_data))  = {0, 1, 2, 3};

QuoteReplyEditDelete

 

 

2009-06-24 23:31:29     Re: l1.data can't be used in 2009R1

Mike Frysinger (UNITED STATES)

Message: 76285   

 

we already know the l1 data attributes work

QuoteReplyEditDelete

 

 

2009-06-24 23:40:49     Re: l1.data can't be used in 2009R1

david wang (CHINA)

Message: 76287   

 

Hi, Mike

 

  Did you test the sample under 2009R1 branch and what's the option configuration for D-Cache?  When I disable the D-Cache, l1 data works. But if I enable D-Cache and Enable only 16KB of Bank A to be D-cache option, my board would not startup.

QuoteReplyEditDelete

 

 

2009-06-25 01:34:30     Re: l1.data can't be used in 2009R1

Mike Frysinger (UNITED STATES)

Message: 76289   

 

then you probably have too much stuff in L1.  remove some of it.

QuoteReplyEditDelete

 

 

2009-06-25 02:23:23     Re: l1.data can't be used in 2009R1

david wang (CHINA)

Message: 76293   

 

Hi, Mike

 

The problem is,

 

1) l1_data doesn't work but the l1.bss does.

 

2) l1.bss can't initial the buffer on compiling. like int test[4] __attribute__(section("l1.bss"))= {0,1,2,3};

 

3) I don't put any data into L1 except the test buffer. when I use section(".l1.bss") instead l1_data, the buffer is allocated at address of 0xff800000 which is the start address of L1. But I need to initial the global data at compile time, so I don't want to use l1.bss.

 

4) The same code in 2008R1.5 works.

QuoteReplyEditDelete

 

 

2009-06-25 04:11:42     Re: l1.data can't be used in 2009R1

david wang (CHINA)

Message: 76301   

 

I did a new test, when I build the test codes into module and inmod after system startup, it is ok.

QuoteReplyEditDelete

 

 

2009-06-25 05:18:19     Re: l1.data can't be used in 2009R1

david wang (CHINA)

Message: 76317   

 

Hi, Mike

 

  Pls tell me how to check which modules has used the l1 buffer?

 

  I've noticed that there're only 7K free l1_data_A left when system start, even if I remove all of my codes.

 

Thanks and Regards!

QuoteReplyEditDelete

 

 

2009-06-25 09:42:09     Re: l1.data can't be used in 2009R1

Mike Frysinger (UNITED STATES)

Message: 76327   

 

it's controlled in your kernel configuration.  look under Blackfin Processor Options -> Blackfin Kernel Optimizations

QuoteReplyEditDelete

Attachments

    Outcomes