1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-09 12:06:41 +02:00

rockchip: Implement spl_gpio in the GPIO driver

Allow rockchip boards to use GPIOs before driver model is ready. This is
really only useful for setting GPIOs to enable the early debug console, if
needed on some platforms.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
This commit is contained in:
Simon Glass
2019-01-21 14:53:34 -07:00
committed by Philipp Tomsich
parent 3ec6f11c7d
commit aa48c94ca8
2 changed files with 69 additions and 0 deletions

View File

@@ -31,4 +31,27 @@ enum gpio_pu_pd {
GPIO_PULL_REPEAT,
};
/* These defines are only used by spl_gpio.h */
enum {
/* Banks have 8 GPIOs, so 3 bits, and there are 4 banks, so 2 bits */
GPIO_BANK_SHIFT = 3,
GPIO_BANK_MASK = 3 << GPIO_BANK_SHIFT,
GPIO_OFFSET_MASK = 0x1f,
};
#define GPIO(bank, offset) ((bank) << GPIO_BANK_SHIFT | (offset))
enum gpio_bank_t {
BANK_A = 0,
BANK_B,
BANK_C,
BANK_D,
};
enum gpio_dir_t {
GPIO_INPUT = 0,
GPIO_OUTPUT,
};
#endif