diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2019-05-30 22:42:42 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-08-05 08:27:12 +0000 |
commit | c27f1c390a990eb38e4643a20ce9677330b1eb24 (patch) | |
tree | a3498274a6d978cfcafe4be65b87fc56f0c7ab20 /src/cpu/allwinner/a10/pinmux.c | |
parent | 041200fae35f3701c160f96fbb617cddb72375fa (diff) | |
download | coreboot-c27f1c390a990eb38e4643a20ce9677330b1eb24.tar.xz |
cpu/allwinner: Remove support
The Allwinner code was never completed and lacks a driver to load
romstage from the bootblock.
Change-Id: If2bae9e28a6e1ed6bfe0e9cb022ca410918cc4db
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33133
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/cpu/allwinner/a10/pinmux.c')
-rw-r--r-- | src/cpu/allwinner/a10/pinmux.c | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/src/cpu/allwinner/a10/pinmux.c b/src/cpu/allwinner/a10/pinmux.c deleted file mode 100644 index 3415e4fed5..0000000000 --- a/src/cpu/allwinner/a10/pinmux.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2013 Alexandru Gagniuc <mr.nuke.me@gmail.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * - * Helpers to multiplex and configure pins on Allwinner SoCs - * - */ - -#include "gpio.h" - -#include <device/mmio.h> - -static struct a10_gpio *const gpio = (void *)GPIO_BASE; - -/** - * \brief Set the pad function of a single pin - * - * @param[in] port GPIO port of the pin (GPA -> GPS) - * @param[in] pin the pin number in the given port (1 -> 31) - * @param[in] pad_func The peripheral function to which to connect this pin - */ -void gpio_set_pin_func(u8 port, u8 pin, u8 pad_func) -{ - u8 reg, bit; - u32 reg32; - - if ((port > GPS)) - return; - - pin &= 0x1f; - reg = pin / 8; - bit = (pin % 8) * 4; - - reg32 = read32(&gpio->port[port].cfg[reg]); - reg32 &= ~(0xf << bit); - reg32 |= (pad_func & 0xf) << bit; - write32(&gpio->port[port].cfg[reg], reg32); -} - -/** - * \brief Set the pad function of a group of pins - * - * Multiplex a group of pins to the same pad function. This is useful for - * peripherals that use the same function number for several pins. This function - * allows those pins to be set with a single call. - * - * Example: - * gpio_set_multipin_func(GPB, (1 << 23) | (1 << 22), 2); - * - * @param[in] port GPIO port of the pin (GPA -> GPS) - * @param[in] pin_mask 32-bit mask indicating which pins to re-multiplex. For - * each set bit, the corresponding pin will be multiplexed. - * @param[in] pad_func The peripheral function to which to connect the pins - */ -void gpio_set_multipin_func(u8 port, u32 pin_mask, u8 pad_func) -{ - int j; - u8 reg, bit; - u32 reg32, mask_offset; - - if ((port > GPS)) - return; - - for (reg = 0; reg < 4; reg++) { - mask_offset = 8 * reg; - /* Don't run the inner loop if we're not touching any pins */ - if (!(pin_mask & (0xff << mask_offset))) - continue; - - reg32 = read32(&gpio->port[port].cfg[reg]); - for (j = 0; j < 8; j++) { - if (!(pin_mask & (1 << (j + mask_offset)))) - continue; - bit = j * 4; - reg32 &= ~(0xf << bit); - reg32 |= (pad_func & 0xf) << bit; - } - write32(&gpio->port[port].cfg[reg], reg32); - } -} |