mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 05:31:32 +00:00
dm: am33xx: Provide platform data for GPIOs
Provide suitable platform data for am33xx boards, so that these boards can use driver model for GPIO access. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
This commit is contained in:
parent
5915a2ad0d
commit
d12010b099
1 changed files with 28 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <dm.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <spl.h>
|
#include <spl.h>
|
||||||
#include <asm/arch/cpu.h>
|
#include <asm/arch/cpu.h>
|
||||||
|
@ -36,6 +37,31 @@
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
#ifdef CONFIG_DM_GPIO
|
||||||
|
static const struct omap_gpio_platdata am33xx_gpio[] = {
|
||||||
|
{ 0, AM33XX_GPIO0_BASE, METHOD_GPIO_24XX },
|
||||||
|
{ 1, AM33XX_GPIO1_BASE, METHOD_GPIO_24XX },
|
||||||
|
{ 2, AM33XX_GPIO2_BASE, METHOD_GPIO_24XX },
|
||||||
|
{ 3, AM33XX_GPIO3_BASE, METHOD_GPIO_24XX },
|
||||||
|
#ifdef CONFIG_AM43XX
|
||||||
|
{ 4, AM33XX_GPIO4_BASE, METHOD_GPIO_24XX },
|
||||||
|
{ 5, AM33XX_GPIO5_BASE, METHOD_GPIO_24XX },
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
U_BOOT_DEVICES(am33xx_gpios) = {
|
||||||
|
{ "gpio_omap", &am33xx_gpio[0] },
|
||||||
|
{ "gpio_omap", &am33xx_gpio[1] },
|
||||||
|
{ "gpio_omap", &am33xx_gpio[2] },
|
||||||
|
{ "gpio_omap", &am33xx_gpio[3] },
|
||||||
|
#ifdef CONFIG_AM43XX
|
||||||
|
{ "gpio_omap", &am33xx_gpio[4] },
|
||||||
|
{ "gpio_omap", &am33xx_gpio[5] },
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
static const struct gpio_bank gpio_bank_am33xx[] = {
|
static const struct gpio_bank gpio_bank_am33xx[] = {
|
||||||
{ (void *)AM33XX_GPIO0_BASE, METHOD_GPIO_24XX },
|
{ (void *)AM33XX_GPIO0_BASE, METHOD_GPIO_24XX },
|
||||||
{ (void *)AM33XX_GPIO1_BASE, METHOD_GPIO_24XX },
|
{ (void *)AM33XX_GPIO1_BASE, METHOD_GPIO_24XX },
|
||||||
|
@ -49,6 +75,8 @@ static const struct gpio_bank gpio_bank_am33xx[] = {
|
||||||
|
|
||||||
const struct gpio_bank *const omap_gpio_bank = gpio_bank_am33xx;
|
const struct gpio_bank *const omap_gpio_bank = gpio_bank_am33xx;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_OMAP_HSMMC) && !defined(CONFIG_SPL_BUILD)
|
#if defined(CONFIG_OMAP_HSMMC) && !defined(CONFIG_SPL_BUILD)
|
||||||
int cpu_mmc_init(bd_t *bis)
|
int cpu_mmc_init(bd_t *bis)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue