diff options
Diffstat (limited to 'board/isee/igep0146/igep0146.c')
-rw-r--r-- | board/isee/igep0146/igep0146.c | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/board/isee/igep0146/igep0146.c b/board/isee/igep0146/igep0146.c new file mode 100644 index 0000000..da7a348 --- /dev/null +++ b/board/isee/igep0146/igep0146.c @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2016 ISEE 2007 SL - http://www.isee.biz + * + * Source file for IGEP0046 board + * + * Author: Jose Miguel Sanchez Sanabria <jsanabria@iseebcn.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <asm/arch/clock.h> +#include <asm/arch/imx-regs.h> +#include <asm/arch/iomux.h> +#include <asm/arch/mx6-pins.h> +#include <asm/arch/mx6-ddr.h> +#include <linux/errno.h> +#include <asm/gpio.h> +#include <asm/imx-common/mxc_i2c.h> +#include <asm/imx-common/iomux-v3.h> +#include <asm/imx-common/boot_mode.h> +#include <malloc.h> +#include <asm/arch/crm_regs.h> +#include <asm/arch/sys_proto.h> +#include <asm/arch-mx6/sys_proto.h> +#include <asm/io.h> +#include "../common/igep_common.h" + +DECLARE_GLOBAL_DATA_PTR; + +/* MACRO MUX defines */ + +#define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ + PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST | PAD_CTL_HYS) + +#define GPIO_LED_PAD_CTRL (PAD_CTL_PUS_22K_UP | \ + PAD_CTL_SPEED_LOW | PAD_CTL_DSE_40ohm | \ + PAD_CTL_SRE_FAST ) + +int dram_init(void) +{ + gd->ram_size = imx_ddr_size(); + return 0; +} + +void dram_init_banksize(void) +{ + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; + gd->bd->bi_dram[0].size = imx_ddr_size(); +} + +/* UART MUX */ +static iomux_v3_cfg_t const uart3_pads[] = +{ + MX6_PAD_UART3_TX_DATA__UART3_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL), + MX6_PAD_UART3_RX_DATA__UART3_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL), +}; + +static iomux_v3_cfg_t const led_pads[] = { + MX6_PAD_GPIO1_IO08__GPIO1_IO08 | MUX_PAD_CTRL(GPIO_LED_PAD_CTRL), + MX6_PAD_GPIO1_IO09__GPIO1_IO09 | MUX_PAD_CTRL(GPIO_LED_PAD_CTRL), +}; + + +static void setup_iomux_uart(void) +{ + imx_iomux_v3_setup_multiple_pads(uart3_pads, ARRAY_SIZE(uart3_pads)); +} + +static void setup_iomux_leds(void) +{ + imx_iomux_v3_setup_multiple_pads(led_pads, ARRAY_SIZE(led_pads)); +} + + +int checkboard(void) +{ + return 0; +} + +int board_early_init_f(void) +{ + setup_iomux_uart(); + setup_iomux_leds(); + + /* configure LEDS */ + gpio_direction_output(IMX_GPIO_NR(1, 8), 1); + gpio_direction_output(IMX_GPIO_NR(1, 9), 0); + + return 0; +} + +int board_init(void) +{ + + return 0; +} + + +int board_late_init(void) +{ + checkboard(); + puts("\n"); + return 0; +} + +#ifdef CONFIG_LDO_BYPASS_CHECK +/* TODO, use external pmic, for now always ldo_enable */ +void ldo_mode_set(int ldo_bypass) +{ + return; +} +#endif
\ No newline at end of file |