diff options
Diffstat (limited to 'src/soc/cavium/cn81xx')
-rw-r--r-- | src/soc/cavium/cn81xx/gpio.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/soc/cavium/cn81xx/gpio.c b/src/soc/cavium/cn81xx/gpio.c index 340ac1bc73..84e36d19fd 100644 --- a/src/soc/cavium/cn81xx/gpio.c +++ b/src/soc/cavium/cn81xx/gpio.c @@ -103,9 +103,9 @@ void gpio_set(gpio_t gpio, int value) printk(BIOS_SPEW, "GPIO(%u): level: %u\n", gpio, !!value); if (value) - write64(®s->tx_set, 1 << gpio); + write64(®s->tx_set, 1ULL << gpio); else - write64(®s->tx_clr, 1 << gpio); + write64(®s->tx_clr, 1ULL << gpio); } /* Set GPIO direction to OUTPUT with level */ @@ -153,9 +153,10 @@ int gpio_get(gpio_t gpio) return 0; const u64 reg = read64(®s->rx_dat); - printk(BIOS_SPEW, "GPIO(%u): input: %u\n", gpio, !!(reg & (1 << gpio))); + printk(BIOS_SPEW, "GPIO(%u): input: %u\n", gpio, + !!(reg & (1ULL << gpio))); - return !!(reg & (1 << gpio)); + return !!(reg & (1ULL << gpio)); } /* Read GPIO STRAP level sampled at cold boot */ @@ -167,9 +168,10 @@ int gpio_strap_value(gpio_t gpio) return 0; const u64 reg = read64(®s->strap); - printk(BIOS_SPEW, "GPIO(%u): strap: %u\n", gpio, !!(reg & (1 << gpio))); + printk(BIOS_SPEW, "GPIO(%u): strap: %u\n", gpio, + !!(reg & (1ULL << gpio))); - return !!(reg & (1 << gpio)); + return !!(reg & (1ULL << gpio)); } /* FIXME: Parse devicetree ? */ |