Hi,

I have read that we can set different drive capability for GPIO bits in
raspberry pi (from 2mA to 16 mA).
My JTAG target (actel igloo) for some reason has strong pull down
implemented (as advised in actel hardware example) on the tck and reset
lines (1k and 500 ohm...)
So it could be that output current of raspberry in not sufficient
depending on how it is programmed.
I try to look in openocd bcm2835gpio.c what is the drive capability that
is assigned to the GPIO lines used in the JTAG. Unfortunately there is
no code corresponding to that.
The documentation I can find
( www.raspberrypi.org/wp-content/.../BCM2835-ARM-Peripherals.pdf‎ )
describe register at address 7e20 xxxx and I can check that code in
openocd bcm2835gpio.c
make sense in init, set, reset and read back the GPIO lines.
Problem is that I find nowhere in official documentation how to set
output drive capability.
I find here:
http://www.scribd.com/doc/101830961/GPIO-Pads-Control2
that this is done in register:
0x 7e10 002c , 0x 7e10 0030 and 0x 7e10 0034
I have no idea where the person that wrote this document knows about that...

Anyway I can suggest this code (not yet tested) for
bcm2835gpio.c
Please advise me about coding and I have zero knowledge in git so I
don't know how to contribute correctly. Code is untested
and I don't know everything I am doing. So I appreciate some help before
I try to blow my raspberry and my igloo chip.

#define BCM2835_GPIO_PIN   (BCM2835_PERI_BASE + 0x100000) /* GPIO PIN
capability register for pins 0-27*/
static volatile uint32_t *pio_base_para;
static int pin_gpio_para;

in bcm2835gpio_init:

pio_base_para = mmap(NULL, sysconf(_SC_PAGE_SIZE), PROT_READ |
PROT_WRITE,MAP_SHARED, dev_mem_fd, BCM2835_GPIO_PIN);
if (pio_base_para == MAP_FAILED) {
         perror("mmap");
         close(dev_mem_fd);
         return ERROR_JTAG_INIT_FAILED;     }
pin_gpio_para=*(pio_base_para+11);
pin_gpio_para&=0x1f;
pin_gpio_para|=0x5A000000;
*(pio_base_para+11)=0x5A00001F;


and in bcm2835gpio_quit
*(pio_base_para+11)=pin_gpio_par;

Thanks

-- 
Nicolas Produit
ISDC, Data Centre for Astrophysics   Phone:+41 22 379 2140
16, Chemin d'Ecogia                  Fax:  +41 22 379 2133
CH-1290 Versoix                      www:  http://isdc.unige.ch/~produit

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to