This is an automated email from Gerrit.

Paul Fertser (fercer...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/1633

-- gerrit

commit 68729ac9dafe2b20aaebf1bf6cfbb134daefd0b4
Author: Paul Fertser <fercer...@gmail.com>
Date:   Wed Sep 18 23:42:50 2013 +0400

    bcm2835gpio: use maximum drive strength
    
    According to the docs, the default drive strength for the GPIO pads is
    8mA but they're capable of 16mA. Configure GPIO 0-27 to use the maximum
    (as they might be used on high enough frequency with JTAG).
    
    Change-Id: I621737a1b0a855bb97b56ce2cc46c0e385b74f5d
    Signed-off-by: Paul Fertser <fercer...@gmail.com>

diff --git a/src/jtag/drivers/bcm2835gpio.c b/src/jtag/drivers/bcm2835gpio.c
index 5af92c3..1f6e241 100644
--- a/src/jtag/drivers/bcm2835gpio.c
+++ b/src/jtag/drivers/bcm2835gpio.c
@@ -33,6 +33,8 @@
 #define BCM2835_PERI_BASE      0x20000000
 #define BCM2835_GPIO_BASE      (BCM2835_PERI_BASE + 0x200000) /* GPIO 
controller */
 
+#define BCM2835_PADS_GPIO_0_27 0x7e10002c
+
 /* GPIO setup macros */
 #define MODE_GPIO(g) (*(pio_base+((g)/10))>>(((g)%10)*3) & 7)
 #define INP_GPIO(g) do { *(pio_base+((g)/10)) &= ~(7<<(((g)%10)*3)); } while 
(0)
@@ -319,6 +321,18 @@ static int bcm2835gpio_init(void)
                return ERROR_JTAG_INIT_FAILED;
        }
 
+       static volatile uint32_t *pads_base;
+       pads_base = mmap(NULL, sysconf(_SC_PAGE_SIZE), PROT_READ | PROT_WRITE,
+                               MAP_SHARED, dev_mem_fd, BCM2835_PADS_GPIO_0_27);
+
+       if (pads_base == MAP_FAILED) {
+               perror("mmap");
+               close(dev_mem_fd);
+               return ERROR_JTAG_INIT_FAILED;
+       }
+
+       *pads_base = 0x5a000018 + 7;  /* 16mA drive strength */
+
        tdo_gpio_mode = MODE_GPIO(tdo_gpio);
        tdi_gpio_mode = MODE_GPIO(tdi_gpio);
        tck_gpio_mode = MODE_GPIO(tck_gpio);

-- 

------------------------------------------------------------------------------
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