avionic design with actual uboot and tooling
submodule of avionic design uboot bootloader and with included tools to get you started , read readme.md and readme-tk1-loader.md
This commit is contained in:
15
u-boot/board/freescale/mx25pdk/Kconfig
Normal file
15
u-boot/board/freescale/mx25pdk/Kconfig
Normal file
@@ -0,0 +1,15 @@
|
||||
if TARGET_MX25PDK
|
||||
|
||||
config SYS_BOARD
|
||||
default "mx25pdk"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "freescale"
|
||||
|
||||
config SYS_SOC
|
||||
default "mx25"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "mx25pdk"
|
||||
|
||||
endif
|
||||
6
u-boot/board/freescale/mx25pdk/MAINTAINERS
Normal file
6
u-boot/board/freescale/mx25pdk/MAINTAINERS
Normal file
@@ -0,0 +1,6 @@
|
||||
MX25PDK BOARD
|
||||
M: Fabio Estevam <fabio.estevam@nxp.com>
|
||||
S: Maintained
|
||||
F: board/freescale/mx25pdk/
|
||||
F: include/configs/mx25pdk.h
|
||||
F: configs/mx25pdk_defconfig
|
||||
9
u-boot/board/freescale/mx25pdk/Makefile
Normal file
9
u-boot/board/freescale/mx25pdk/Makefile
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
|
||||
#
|
||||
# (C) Copyright 2011 Freescale Semiconductor, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y := mx25pdk.o
|
||||
65
u-boot/board/freescale/mx25pdk/imximage.cfg
Normal file
65
u-boot/board/freescale/mx25pdk/imximage.cfg
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* (C) Copyright 2009
|
||||
* Stefano Babic DENX Software Engineering sbabic@denx.de.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*
|
||||
* Refer doc/README.imximage for more details about how-to configure
|
||||
* and create imximage boot image
|
||||
*
|
||||
* The syntax is taken as close as possible with the kwbimage
|
||||
*/
|
||||
|
||||
/*
|
||||
* Boot Device : one of
|
||||
* spi, sd (the board has no nand neither onenand)
|
||||
*/
|
||||
BOOT_FROM sd
|
||||
|
||||
/*
|
||||
* Device Configuration Data (DCD)
|
||||
*
|
||||
* Each entry must have the format:
|
||||
* Addr-type Address Value
|
||||
*
|
||||
* where:
|
||||
* Addr-type register length (1,2 or 4 bytes)
|
||||
* Address absolute address of the register
|
||||
* value value to be stored in the register
|
||||
*/
|
||||
/* EIM config-CS5 init -- CPLD */
|
||||
DATA 4 0xB8002050 0x0000D843
|
||||
DATA 4 0xB8002054 0x22252521
|
||||
DATA 4 0xB8002058 0x22220A00
|
||||
|
||||
/* DDR2 init */
|
||||
DATA 4 0xB8001004 0x0076E83A
|
||||
DATA 4 0xB8001010 0x00000204
|
||||
DATA 4 0xB8001000 0x92210000
|
||||
DATA 4 0x80000f00 0x12344321
|
||||
DATA 4 0xB8001000 0xB2210000
|
||||
DATA 1 0x82000000 0xda
|
||||
DATA 1 0x83000000 0xda
|
||||
DATA 1 0x81000400 0xda
|
||||
DATA 1 0x80000333 0xda
|
||||
|
||||
DATA 4 0xB8001000 0x92210000
|
||||
DATA 1 0x80000400 0x12345678
|
||||
|
||||
DATA 4 0xB8001000 0xA2210000
|
||||
DATA 4 0x80000000 0x87654321
|
||||
DATA 4 0x80000000 0x87654321
|
||||
|
||||
DATA 4 0xB8001000 0xB2210000
|
||||
DATA 1 0x80000233 0xda
|
||||
DATA 1 0x81000780 0xda
|
||||
DATA 1 0x81000400 0xda
|
||||
DATA 4 0xB8001000 0x82216080
|
||||
DATA 4 0x43FAC454 0x00001000
|
||||
|
||||
DATA 4 0x53F80008 0x20034000
|
||||
|
||||
/* Enable the clocks */
|
||||
DATA 4 0x53f8000c 0x1fffffff
|
||||
DATA 4 0x53f80010 0xffffffff
|
||||
DATA 4 0x53f80014 0xfdfff
|
||||
191
u-boot/board/freescale/mx25pdk/mx25pdk.c
Normal file
191
u-boot/board/freescale/mx25pdk/mx25pdk.c
Normal file
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
* (C) Copyright 2011 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* Author: Fabio Estevam <fabio.estevam@freescale.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/arch/iomux-mx25.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <mmc.h>
|
||||
#include <fsl_esdhc.h>
|
||||
#include <i2c.h>
|
||||
#include <power/pmic.h>
|
||||
#include <fsl_pmic.h>
|
||||
#include <mc34704.h>
|
||||
|
||||
#define FEC_RESET_B IMX_GPIO_NR(4, 8)
|
||||
#define FEC_ENABLE_B IMX_GPIO_NR(2, 3)
|
||||
#define CARD_DETECT IMX_GPIO_NR(2, 1)
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#ifdef CONFIG_FSL_ESDHC
|
||||
struct fsl_esdhc_cfg esdhc_cfg[1] = {
|
||||
{IMX_MMC_SDHC1_BASE},
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* FIXME: need to revisit this
|
||||
* The original code enabled PUE and 100-k pull-down without PKE, so the right
|
||||
* value here is likely:
|
||||
* 0 for no pull
|
||||
* or:
|
||||
* PAD_CTL_PUS_100K_DOWN for 100-k pull-down
|
||||
*/
|
||||
#define FEC_OUT_PAD_CTRL 0
|
||||
|
||||
#define I2C_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PUS_100K_UP | \
|
||||
PAD_CTL_ODE)
|
||||
|
||||
static void mx25pdk_fec_init(void)
|
||||
{
|
||||
static const iomux_v3_cfg_t fec_pads[] = {
|
||||
MX25_PAD_FEC_TX_CLK__FEC_TX_CLK,
|
||||
MX25_PAD_FEC_RX_DV__FEC_RX_DV,
|
||||
MX25_PAD_FEC_RDATA0__FEC_RDATA0,
|
||||
NEW_PAD_CTRL(MX25_PAD_FEC_TDATA0__FEC_TDATA0, FEC_OUT_PAD_CTRL),
|
||||
NEW_PAD_CTRL(MX25_PAD_FEC_TX_EN__FEC_TX_EN, FEC_OUT_PAD_CTRL),
|
||||
NEW_PAD_CTRL(MX25_PAD_FEC_MDC__FEC_MDC, FEC_OUT_PAD_CTRL),
|
||||
MX25_PAD_FEC_MDIO__FEC_MDIO,
|
||||
MX25_PAD_FEC_RDATA1__FEC_RDATA1,
|
||||
NEW_PAD_CTRL(MX25_PAD_FEC_TDATA1__FEC_TDATA1, FEC_OUT_PAD_CTRL),
|
||||
|
||||
NEW_PAD_CTRL(MX25_PAD_D12__GPIO_4_8, 0), /* FEC_RESET_B */
|
||||
NEW_PAD_CTRL(MX25_PAD_A17__GPIO_2_3, 0), /* FEC_ENABLE_B */
|
||||
};
|
||||
|
||||
static const iomux_v3_cfg_t i2c_pads[] = {
|
||||
NEW_PAD_CTRL(MX25_PAD_I2C1_CLK__I2C1_CLK, I2C_PAD_CTRL),
|
||||
NEW_PAD_CTRL(MX25_PAD_I2C1_DAT__I2C1_DAT, I2C_PAD_CTRL),
|
||||
};
|
||||
|
||||
imx_iomux_v3_setup_multiple_pads(fec_pads, ARRAY_SIZE(fec_pads));
|
||||
|
||||
/* Assert RESET and ENABLE low */
|
||||
gpio_direction_output(FEC_RESET_B, 0);
|
||||
gpio_direction_output(FEC_ENABLE_B, 0);
|
||||
|
||||
udelay(10);
|
||||
|
||||
/* Deassert RESET and ENABLE */
|
||||
gpio_set_value(FEC_RESET_B, 1);
|
||||
gpio_set_value(FEC_ENABLE_B, 1);
|
||||
|
||||
/* Setup I2C pins so that PMIC can turn on PHY supply */
|
||||
imx_iomux_v3_setup_multiple_pads(i2c_pads, ARRAY_SIZE(i2c_pads));
|
||||
}
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
/* dram_init must store complete ramsize in gd->ram_size */
|
||||
gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
|
||||
PHYS_SDRAM_1_SIZE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up input pins with hysteresis and 100-k pull-ups
|
||||
*/
|
||||
#define UART1_IN_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PUS_100K_UP)
|
||||
/*
|
||||
* FIXME: need to revisit this
|
||||
* The original code enabled PUE and 100-k pull-down without PKE, so the right
|
||||
* value here is likely:
|
||||
* 0 for no pull
|
||||
* or:
|
||||
* PAD_CTL_PUS_100K_DOWN for 100-k pull-down
|
||||
*/
|
||||
#define UART1_OUT_PAD_CTRL 0
|
||||
|
||||
static void mx25pdk_uart1_init(void)
|
||||
{
|
||||
static const iomux_v3_cfg_t uart1_pads[] = {
|
||||
NEW_PAD_CTRL(MX25_PAD_UART1_RXD__UART1_RXD, UART1_IN_PAD_CTRL),
|
||||
NEW_PAD_CTRL(MX25_PAD_UART1_TXD__UART1_TXD, UART1_OUT_PAD_CTRL),
|
||||
NEW_PAD_CTRL(MX25_PAD_UART1_RTS__UART1_RTS, UART1_OUT_PAD_CTRL),
|
||||
NEW_PAD_CTRL(MX25_PAD_UART1_CTS__UART1_CTS, UART1_IN_PAD_CTRL),
|
||||
};
|
||||
|
||||
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
|
||||
}
|
||||
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
mx25pdk_uart1_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_init(void)
|
||||
{
|
||||
/* address of boot parameters */
|
||||
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
struct pmic *p;
|
||||
int ret;
|
||||
|
||||
mx25pdk_fec_init();
|
||||
|
||||
ret = pmic_init(I2C_0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
p = pmic_get("FSL_PMIC");
|
||||
if (!p)
|
||||
return -ENODEV;
|
||||
|
||||
/* Turn on Ethernet PHY and LCD supplies */
|
||||
pmic_reg_write(p, MC34704_GENERAL2_REG, ONOFFE | ONOFFA);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FSL_ESDHC
|
||||
int board_mmc_getcd(struct mmc *mmc)
|
||||
{
|
||||
/* Set up the Card Detect pin. */
|
||||
imx_iomux_v3_setup_pad(NEW_PAD_CTRL(MX25_PAD_A15__GPIO_2_1, 0));
|
||||
|
||||
gpio_direction_input(CARD_DETECT);
|
||||
return !gpio_get_value(CARD_DETECT);
|
||||
}
|
||||
|
||||
int board_mmc_init(bd_t *bis)
|
||||
{
|
||||
static const iomux_v3_cfg_t sdhc1_pads[] = {
|
||||
NEW_PAD_CTRL(MX25_PAD_SD1_CMD__SD1_CMD, NO_PAD_CTRL),
|
||||
NEW_PAD_CTRL(MX25_PAD_SD1_CLK__SD1_CLK, NO_PAD_CTRL),
|
||||
NEW_PAD_CTRL(MX25_PAD_SD1_DATA0__SD1_DATA0, NO_PAD_CTRL),
|
||||
NEW_PAD_CTRL(MX25_PAD_SD1_DATA1__SD1_DATA1, NO_PAD_CTRL),
|
||||
NEW_PAD_CTRL(MX25_PAD_SD1_DATA2__SD1_DATA2, NO_PAD_CTRL),
|
||||
NEW_PAD_CTRL(MX25_PAD_SD1_DATA3__SD1_DATA3, NO_PAD_CTRL),
|
||||
};
|
||||
|
||||
imx_iomux_v3_setup_multiple_pads(sdhc1_pads, ARRAY_SIZE(sdhc1_pads));
|
||||
|
||||
esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC1_CLK);
|
||||
return fsl_esdhc_initialize(bis, &esdhc_cfg[0]);
|
||||
}
|
||||
#endif
|
||||
|
||||
int checkboard(void)
|
||||
{
|
||||
puts("Board: MX25PDK\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Lowlevel init isn't used on mx25pdk, so just provide a dummy one here */
|
||||
void lowlevel_init(void) {}
|
||||
Reference in New Issue
Block a user