2009-03-24 12:02:42     Simple-gpio backporting

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

2009-03-24 12:02:42     Simple-gpio backporting

blue hash (UNITED STATES)

Message: 71455   

 

Hi,

 

I'm trying to backport the simple-gpio module to toggle LEDS on the BF537. I've read the simple-gpio wiki page and did everything accordingly. However during boot up I get a kernel panic as in the attached file.

 

I have the /sys/class/simple-gpio/ directory, but nothing in it.  I used information from the following two threads.

 

http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&thread_id=29113&_forum_action=ForumMessageBrowse

 

http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&thread_id=26649&_forum_action=ForumMessageBrowse

 

kpanic.txt

QuoteReplyEditDelete

 

 

2009-03-24 12:03:09     Re: Simple-gpio backporting

blue hash (UNITED STATES)

Message: 71456   

 

I forgot to add, I'm on 2008RC1

QuoteReplyEditDelete

 

 

2009-03-24 15:29:49     Re: Simple-gpio backporting

Mike Frysinger (UNITED STATES)

Message: 71465   

 

you probably didnt update your board resources properly.  you need to declare the resources and add them to the resource list.

QuoteReplyEditDelete

 

 

2009-03-24 16:57:22     Re: Simple-gpio backporting

blue hash (UNITED STATES)

Message: 71468   

 

I didnt follow what you meant by resource list. I did the below. Am I missing out anything else?

 

In my stamp.c, I did the following:

 

static struct resource bfin_gpios_resources = {

    .start = 0,

    .end   = MAX_BLACKFIN_GPIOS - 1,

    .flags = IORESOURCE_IRQ,

};

 

static struct platform_device bfin_gpios_device = {

    .name = "simple-gpio",

    .id = -1,

    .num_resources = 1,

    .resource = &bfin_gpios_resources,

};

 

And in static platform_device *stamp_devices[] __initdata, I added

 

&bfin_gpios_resources

 

QuoteReplyEditDelete

 

 

2009-03-24 18:11:08     Re: Simple-gpio backporting

Mike Frysinger (UNITED STATES)

Message: 71471   

 

that should be it.  are you sure the panic is coming from simple-gpio and not something else ?

QuoteReplyEditDelete

 

 

2009-03-25 08:23:48     Re: Simple-gpio backporting

blue hash (UNITED STATES)

Message: 71525   

 

I'm sure thats the one. When &bfin_gpio_resources is commented out in __initdata, the panic goes away, but there is nothing under sys/class/simple-gpio.

 

Is there a kernel option I need to enable? Hotplugging is on. Thanks.

Attachments

Outcomes