[coreboot-gerrit] Patch set updated for coreboot: 3d04b8a tegra: correct gpio_index_to_port() calculation

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Wed Mar 25 15:56:07 CET 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8908

-gerrit

commit 3d04b8aa114a37a4ab2d2b41171e35905227ba09
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Mon Aug 4 15:40:50 2014 -0500

    tegra: correct gpio_index_to_port() calculation
    
    The gpio_index_to_port() incorrectly was dividing by
    GPIO_PORTS_PER_BANK on a value including the bit number. After
    masking off the BANK offset just divide by the number of gpios
    in a port to get the port offset.
    
    BUG=chrome-os-partner:29981
    BRANCH=None
    TEST=Built and ran through to depthcharge. Printed bank, port, and
         bit numbers for validation.
    
    Change-Id: I3fbbb90f369bace90e787148a58795b7b1b40c1b
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: 97e1f830b4a8e948673433bfa6d81586204b6ee2
    Original-Change-Id: I8bb50e922c9fd7c0a1c247ba95394f6deb9f1533
    Original-Signed-off-by: Aaron Durbin <adurbin at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/210909
    Original-Reviewed-by: Furquan Shaikh <furquan at chromium.org>
---
 src/soc/nvidia/tegra/gpio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/soc/nvidia/tegra/gpio.h b/src/soc/nvidia/tegra/gpio.h
index da8a4da..2ad3ab3 100644
--- a/src/soc/nvidia/tegra/gpio.h
+++ b/src/soc/nvidia/tegra/gpio.h
@@ -90,7 +90,7 @@ static inline int gpio_index_to_bank(int index)
 
 static inline int gpio_index_to_port(int index)
 {
-	return (index % GPIO_GPIOS_PER_BANK) / GPIO_PORTS_PER_BANK;
+	return (index % GPIO_GPIOS_PER_BANK) / GPIO_GPIOS_PER_PORT;
 }
 
 static inline int gpio_to_bit(int index)



More information about the coreboot-gerrit mailing list