Merge tag 'u-boot-imx-20210616' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
u-boot-imx-20210616 ------------------- - imxrt : fixes, USB, imxrt1020-evk - imx8m: fix for verdin-imx8mm Add conga-QMX8 board - imx6 : documentation for pico-imx6: Add SeeedStudio NPI-IMX6ULL Support ventana: DM PCI - imx7d: added SMEGW01 board CI : https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/7765
This commit is contained in:
14
board/congatec/cgtqmx8/Kconfig
Normal file
14
board/congatec/cgtqmx8/Kconfig
Normal file
@@ -0,0 +1,14 @@
|
||||
if TARGET_CONGA_QMX8
|
||||
|
||||
config SYS_BOARD
|
||||
default "cgtqmx8"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "congatec"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "cgtqmx8"
|
||||
|
||||
source "board/congatec/common/Kconfig"
|
||||
|
||||
endif
|
||||
7
board/congatec/cgtqmx8/MAINTAINERS
Normal file
7
board/congatec/cgtqmx8/MAINTAINERS
Normal file
@@ -0,0 +1,7 @@
|
||||
i.MX8QM CGTQMX8 BOARD
|
||||
M: Oliver Graute <oliver.graute@kococonnector.com>
|
||||
S: Maintained
|
||||
F: board/congatec/cgtqmx8/
|
||||
F: arch/arm/dts/imx8qm-cgtqmx8.dts
|
||||
F: include/configs/cgtqmx8.h
|
||||
F: configs/cgtqmx8_defconfig
|
||||
11
board/congatec/cgtqmx8/Makefile
Normal file
11
board/congatec/cgtqmx8/Makefile
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Copyright 2017 NXP
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y += cgtqmx8.o
|
||||
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
obj-y += spl.o
|
||||
endif
|
||||
460
board/congatec/cgtqmx8/cgtqmx8.c
Normal file
460
board/congatec/cgtqmx8/cgtqmx8.c
Normal file
@@ -0,0 +1,460 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright 2018 congatec AG
|
||||
* Copyright (C) 2019 Oliver Graute <oliver.graute@kococonnector.com>
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <errno.h>
|
||||
#include <linux/libfdt.h>
|
||||
#include <fsl_esdhc.h>
|
||||
#include <init.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/sci/sci.h>
|
||||
#include <asm/arch/imx8-pins.h>
|
||||
#include <usb.h>
|
||||
#include <asm/arch/iomux.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <linux/delay.h>
|
||||
#include <power-domain.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#define ESDHC_PAD_CTRL ((SC_PAD_CONFIG_NORMAL << PADRING_CONFIG_SHIFT) | \
|
||||
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
|
||||
|
||||
#define ESDHC_CLK_PAD_CTRL ((SC_PAD_CONFIG_OUT_IN << PADRING_CONFIG_SHIFT) | \
|
||||
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
|
||||
|
||||
#define ENET_INPUT_PAD_CTRL ((SC_PAD_CONFIG_OD_IN << PADRING_CONFIG_SHIFT) | \
|
||||
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_DSE_18V_10MA << PADRING_DSE_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
|
||||
|
||||
#define ENET_NORMAL_PAD_CTRL ((SC_PAD_CONFIG_NORMAL << PADRING_CONFIG_SHIFT) | \
|
||||
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_DSE_18V_10MA << PADRING_DSE_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
|
||||
|
||||
#define FSPI_PAD_CTRL ((SC_PAD_CONFIG_NORMAL << PADRING_CONFIG_SHIFT) | \
|
||||
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
|
||||
|
||||
#define GPIO_PAD_CTRL ((SC_PAD_CONFIG_NORMAL << PADRING_CONFIG_SHIFT) | \
|
||||
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
|
||||
|
||||
#define I2C_PAD_CTRL ((SC_PAD_CONFIG_OUT_IN << PADRING_CONFIG_SHIFT) | \
|
||||
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_DSE_DV_LOW << PADRING_DSE_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
|
||||
|
||||
#define UART_PAD_CTRL ((SC_PAD_CONFIG_OUT_IN << PADRING_CONFIG_SHIFT) | \
|
||||
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
|
||||
(SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
|
||||
|
||||
static iomux_cfg_t uart0_pads[] = {
|
||||
SC_P_UART0_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
|
||||
SC_P_UART0_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
|
||||
};
|
||||
|
||||
void board_late_mmc_env_init(void);
|
||||
void init_clk_usdhc(u32 index);
|
||||
int fsl_esdhc_initialize(struct bd_info *bis, struct fsl_esdhc_cfg *cfg);
|
||||
|
||||
static void setup_iomux_uart(void)
|
||||
{
|
||||
imx8_iomux_setup_multiple_pads(uart0_pads, ARRAY_SIZE(uart0_pads));
|
||||
}
|
||||
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
/* sc_ipc_t ipcHndl = 0; */
|
||||
sc_err_t scierr = 0;
|
||||
|
||||
/* When start u-boot in XEN VM, directly return */
|
||||
/* if (IS_ENABLED(CONFIG_XEN)) */
|
||||
/* return 0; */
|
||||
|
||||
/* ipcHndl = gd->arch.ipc_channel_handle; */
|
||||
|
||||
/* Power up UART0, this is very early while power domain is not working */
|
||||
scierr = sc_pm_set_resource_power_mode(-1, SC_R_UART_0, SC_PM_PW_MODE_ON);
|
||||
if (scierr != SC_ERR_NONE)
|
||||
return 0;
|
||||
|
||||
/* Set UART0 clock root to 80 MHz */
|
||||
sc_pm_clock_rate_t rate = 80000000;
|
||||
|
||||
scierr = sc_pm_set_clock_rate(-1, SC_R_UART_0, 2, &rate);
|
||||
if (scierr != SC_ERR_NONE)
|
||||
return 0;
|
||||
|
||||
/* Enable UART0 clock root */
|
||||
scierr = sc_pm_clock_enable(-1, SC_R_UART_0, 2, true, false);
|
||||
if (scierr != SC_ERR_NONE)
|
||||
return 0;
|
||||
|
||||
setup_iomux_uart();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_FSL_ESDHC_IMX)
|
||||
|
||||
#define USDHC1_CD_GPIO IMX_GPIO_NR(5, 22)
|
||||
#define USDHC2_CD_GPIO IMX_GPIO_NR(4, 12)
|
||||
|
||||
static struct fsl_esdhc_cfg usdhc_cfg[CONFIG_SYS_FSL_USDHC_NUM] = {
|
||||
{USDHC1_BASE_ADDR, 0, 8},
|
||||
{USDHC2_BASE_ADDR, 0, 4},
|
||||
{USDHC3_BASE_ADDR, 0, 4},
|
||||
};
|
||||
|
||||
static iomux_cfg_t emmc0[] = {
|
||||
SC_P_EMMC0_CLK | MUX_PAD_CTRL(ESDHC_CLK_PAD_CTRL),
|
||||
SC_P_EMMC0_CMD | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_EMMC0_DATA0 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_EMMC0_DATA1 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_EMMC0_DATA2 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_EMMC0_DATA3 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_EMMC0_DATA4 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_EMMC0_DATA5 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_EMMC0_DATA6 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_EMMC0_DATA7 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_EMMC0_RESET_B | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_EMMC0_STROBE | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
};
|
||||
|
||||
static iomux_cfg_t usdhc1_sd[] = {
|
||||
SC_P_USDHC1_CLK | MUX_PAD_CTRL(ESDHC_CLK_PAD_CTRL),
|
||||
SC_P_USDHC1_CMD | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC1_DATA0 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC1_DATA1 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC1_DATA2 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC1_DATA3 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC1_DATA6 | MUX_MODE_ALT(2) | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC1_DATA7 | MUX_MODE_ALT(3) | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC1_RESET_B | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC1_VSELECT | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
};
|
||||
|
||||
static iomux_cfg_t usdhc2_sd[] = {
|
||||
SC_P_USDHC2_CLK | MUX_PAD_CTRL(ESDHC_CLK_PAD_CTRL),
|
||||
SC_P_USDHC2_CMD | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC2_DATA0 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC2_DATA1 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC2_DATA2 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC2_DATA3 | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC2_RESET_B | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC2_VSELECT | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC2_WP | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
SC_P_USDHC2_CD_B | MUX_MODE_ALT(3) | MUX_PAD_CTRL(ESDHC_PAD_CTRL),
|
||||
};
|
||||
|
||||
int board_mmc_init(struct bd_info *bis)
|
||||
{
|
||||
int i, ret;
|
||||
struct power_domain pd;
|
||||
|
||||
/*
|
||||
* According to the board_mmc_init() the following map is done:
|
||||
* (U-Boot device node) (Physical Port)
|
||||
* mmc0 (onboard eMMC) USDHC1
|
||||
* mmc1 (external SD card) USDHC2
|
||||
* mmc2 (onboard µSD) USDHC3
|
||||
*/
|
||||
for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
/* onboard eMMC */
|
||||
if (!imx8_power_domain_lookup_name("conn_sdhc0", &pd))
|
||||
power_domain_on(&pd);
|
||||
|
||||
imx8_iomux_setup_multiple_pads(emmc0, ARRAY_SIZE(emmc0));
|
||||
init_clk_usdhc(0);
|
||||
usdhc_cfg[i].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
|
||||
break;
|
||||
case 1:
|
||||
/* external SD card */
|
||||
if (!imx8_power_domain_lookup_name("conn_sdhc1", &pd))
|
||||
power_domain_on(&pd);
|
||||
|
||||
imx8_iomux_setup_multiple_pads(usdhc1_sd, ARRAY_SIZE(usdhc1_sd));
|
||||
init_clk_usdhc(1);
|
||||
usdhc_cfg[i].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
|
||||
gpio_request(USDHC1_CD_GPIO, "sd1_cd");
|
||||
gpio_direction_input(USDHC1_CD_GPIO);
|
||||
break;
|
||||
case 2:
|
||||
/* onboard µSD */
|
||||
if (!imx8_power_domain_lookup_name("conn_sdhc2", &pd))
|
||||
power_domain_on(&pd);
|
||||
|
||||
imx8_iomux_setup_multiple_pads(usdhc2_sd, ARRAY_SIZE(usdhc2_sd));
|
||||
init_clk_usdhc(2);
|
||||
usdhc_cfg[i].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
|
||||
gpio_request(USDHC2_CD_GPIO, "sd2_cd");
|
||||
gpio_direction_input(USDHC2_CD_GPIO);
|
||||
break;
|
||||
default:
|
||||
printf("Warning: you configured more USDHC controllers"
|
||||
"(%d) than supported by the board\n", i + 1);
|
||||
return 0;
|
||||
}
|
||||
ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]);
|
||||
if (ret) {
|
||||
printf("Warning: failed to initialize mmc dev %d\n", i);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_mmc_getcd(struct mmc *mmc)
|
||||
{
|
||||
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
|
||||
int ret = 0;
|
||||
|
||||
switch (cfg->esdhc_base) {
|
||||
case USDHC1_BASE_ADDR:
|
||||
ret = 1;
|
||||
break;
|
||||
case USDHC2_BASE_ADDR:
|
||||
ret = !gpio_get_value(USDHC1_CD_GPIO);
|
||||
break;
|
||||
case USDHC3_BASE_ADDR:
|
||||
ret = !gpio_get_value(USDHC2_CD_GPIO);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_FSL_ESDHC_IMX */
|
||||
|
||||
#if (IS_ENABLED(CONFIG_FEC_MXC))
|
||||
|
||||
#include <miiphy.h>
|
||||
|
||||
static iomux_cfg_t pad_enet0[] = {
|
||||
SC_P_ENET0_RGMII_RX_CTL | MUX_PAD_CTRL(ENET_INPUT_PAD_CTRL),
|
||||
SC_P_ENET0_RGMII_RXD0 | MUX_PAD_CTRL(ENET_INPUT_PAD_CTRL),
|
||||
SC_P_ENET0_RGMII_RXD1 | MUX_PAD_CTRL(ENET_INPUT_PAD_CTRL),
|
||||
SC_P_ENET0_RGMII_RXD2 | MUX_PAD_CTRL(ENET_INPUT_PAD_CTRL),
|
||||
SC_P_ENET0_RGMII_RXD3 | MUX_PAD_CTRL(ENET_INPUT_PAD_CTRL),
|
||||
SC_P_ENET0_RGMII_RXC | MUX_PAD_CTRL(ENET_INPUT_PAD_CTRL),
|
||||
SC_P_ENET0_RGMII_TX_CTL | MUX_PAD_CTRL(ENET_NORMAL_PAD_CTRL),
|
||||
SC_P_ENET0_RGMII_TXD0 | MUX_PAD_CTRL(ENET_NORMAL_PAD_CTRL),
|
||||
SC_P_ENET0_RGMII_TXD1 | MUX_PAD_CTRL(ENET_NORMAL_PAD_CTRL),
|
||||
SC_P_ENET0_RGMII_TXD2 | MUX_PAD_CTRL(ENET_NORMAL_PAD_CTRL),
|
||||
SC_P_ENET0_RGMII_TXD3 | MUX_PAD_CTRL(ENET_NORMAL_PAD_CTRL),
|
||||
SC_P_ENET0_RGMII_TXC | MUX_PAD_CTRL(ENET_NORMAL_PAD_CTRL),
|
||||
SC_P_ENET0_MDC | MUX_PAD_CTRL(ENET_NORMAL_PAD_CTRL),
|
||||
SC_P_ENET0_MDIO | MUX_PAD_CTRL(ENET_NORMAL_PAD_CTRL),
|
||||
};
|
||||
|
||||
static void setup_iomux_fec(void)
|
||||
{
|
||||
imx8_iomux_setup_multiple_pads(pad_enet0, ARRAY_SIZE(pad_enet0));
|
||||
}
|
||||
|
||||
static void enet_device_phy_reset(void)
|
||||
{
|
||||
gpio_set_value(FEC0_RESET, 0);
|
||||
udelay(50);
|
||||
gpio_set_value(FEC0_RESET, 1);
|
||||
|
||||
/* The board has a long delay for this reset to become stable */
|
||||
mdelay(200);
|
||||
}
|
||||
|
||||
int board_eth_init(struct bd_info *bis)
|
||||
{
|
||||
setup_iomux_fec();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_phy_config(struct phy_device *phydev)
|
||||
{
|
||||
phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x1f);
|
||||
phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x8);
|
||||
|
||||
phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x00);
|
||||
phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x82ee);
|
||||
phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05);
|
||||
phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100);
|
||||
|
||||
if (phydev->drv->config)
|
||||
phydev->drv->config(phydev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int setup_fec(void)
|
||||
{
|
||||
/* Reset ENET PHY */
|
||||
enet_device_phy_reset();
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MXC_GPIO
|
||||
|
||||
#define LVDS_ENABLE IMX_GPIO_NR(1, 6)
|
||||
#define BKL_ENABLE IMX_GPIO_NR(1, 7)
|
||||
|
||||
static iomux_cfg_t board_gpios[] = {
|
||||
SC_P_LVDS0_I2C0_SCL | MUX_MODE_ALT(3) | MUX_PAD_CTRL(GPIO_PAD_CTRL),
|
||||
SC_P_LVDS0_I2C0_SDA | MUX_MODE_ALT(3) | MUX_PAD_CTRL(GPIO_PAD_CTRL),
|
||||
SC_P_ESAI1_FST | MUX_MODE_ALT(3) | MUX_PAD_CTRL(GPIO_PAD_CTRL),
|
||||
};
|
||||
|
||||
static void board_gpio_init(void)
|
||||
{
|
||||
imx8_iomux_setup_multiple_pads(board_gpios, ARRAY_SIZE(board_gpios));
|
||||
|
||||
/* enable LVDS */
|
||||
gpio_request(LVDS_ENABLE, "lvds_enable");
|
||||
gpio_direction_output(LVDS_ENABLE, 1);
|
||||
|
||||
/* enable backlight */
|
||||
gpio_request(BKL_ENABLE, "bkl_enable");
|
||||
gpio_direction_output(BKL_ENABLE, 1);
|
||||
|
||||
/* ethernet reset */
|
||||
gpio_request(FEC0_RESET, "enet0_reset");
|
||||
gpio_direction_output(FEC0_RESET, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
int checkboard(void)
|
||||
{
|
||||
puts("Board: conga-QMX8\n");
|
||||
|
||||
build_info();
|
||||
print_bootinfo();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_init(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_XEN))
|
||||
return 0;
|
||||
|
||||
#ifdef CONFIG_MXC_GPIO
|
||||
board_gpio_init();
|
||||
#endif
|
||||
|
||||
#if (IS_ENABLED(CONFIG_FEC_MXC))
|
||||
setup_fec();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void detail_board_ddr_info(void)
|
||||
{
|
||||
puts("\nDDR ");
|
||||
}
|
||||
|
||||
/*
|
||||
* Board specific reset that is system reset.
|
||||
*/
|
||||
void reset_cpu(ulong addr)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF_BOARD_SETUP
|
||||
int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int board_mmc_get_env_dev(int devno)
|
||||
{
|
||||
/* Use EMMC */
|
||||
if (IS_ENABLED(CONFIG_XEN))
|
||||
return 0;
|
||||
|
||||
return devno;
|
||||
}
|
||||
|
||||
int mmc_map_to_kernel_blk(int dev_no)
|
||||
{
|
||||
/* Use EMMC */
|
||||
if (IS_ENABLED(CONFIG_XEN))
|
||||
return 0;
|
||||
|
||||
return dev_no;
|
||||
}
|
||||
|
||||
extern u32 _end_ofs;
|
||||
int board_late_init(void)
|
||||
{
|
||||
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
|
||||
env_set("board_name", "QMX8");
|
||||
env_set("board_rev", "iMX8QM");
|
||||
#endif
|
||||
|
||||
env_set("sec_boot", "no");
|
||||
#ifdef CONFIG_AHAB_BOOT
|
||||
env_set("sec_boot", "yes");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ENV_IS_IN_MMC
|
||||
board_late_mmc_env_init();
|
||||
#endif
|
||||
|
||||
#ifdef IMX_LOAD_HDMI_FIMRWARE
|
||||
char *end_of_uboot;
|
||||
char command[256];
|
||||
|
||||
end_of_uboot = (char *)(ulong)(CONFIG_SYS_TEXT_BASE + _end_ofs
|
||||
+ fdt_totalsize(gd->fdt_blob));
|
||||
end_of_uboot += 9;
|
||||
|
||||
/* load hdmitxfw.bin and hdmirxfw.bin*/
|
||||
memcpy(IMX_HDMI_FIRMWARE_LOAD_ADDR, end_of_uboot,
|
||||
IMX_HDMITX_FIRMWARE_SIZE + IMX_HDMIRX_FIRMWARE_SIZE);
|
||||
|
||||
sprintf(command, "hdp load 0x%x", IMX_HDMI_FIRMWARE_LOAD_ADDR);
|
||||
run_command(command, 0);
|
||||
|
||||
sprintf(command, "hdprx load 0x%x",
|
||||
IMX_HDMI_FIRMWARE_LOAD_ADDR + IMX_HDMITX_FIRMWARE_SIZE);
|
||||
run_command(command, 0);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FSL_FASTBOOT
|
||||
#ifdef CONFIG_ANDROID_RECOVERY
|
||||
int is_recovery_key_pressing(void)
|
||||
{
|
||||
return 0; /*TODO*/
|
||||
}
|
||||
#endif /*CONFIG_ANDROID_RECOVERY*/
|
||||
#endif /*CONFIG_FSL_FASTBOOT*/
|
||||
|
||||
/* Only Enable USB3 resources currently */
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
21
board/congatec/cgtqmx8/imximage.cfg
Normal file
21
board/congatec/cgtqmx8/imximage.cfg
Normal file
@@ -0,0 +1,21 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright 2018 NXP
|
||||
*/
|
||||
|
||||
#define __ASSEMBLY__
|
||||
|
||||
/* Boot from SD, sector size 0x400 */
|
||||
BOOT_FROM SD 0x400
|
||||
/* SoC type IMX8QM */
|
||||
SOC_TYPE IMX8QM
|
||||
/* Append seco container image */
|
||||
APPEND mx8qm-ahab-container.img
|
||||
/* Create the 2nd container */
|
||||
CONTAINER
|
||||
/* Add scfw image with exec attribute */
|
||||
IMAGE SCU mx8qm-val-scfw-tcm.bin
|
||||
/* Add ATF image with exec attribute */
|
||||
IMAGE A35 bl31.bin 0x80000000
|
||||
/* Add U-Boot image with load attribute */
|
||||
DATA A35 u-boot-dtb.bin 0x80020000
|
||||
77
board/congatec/cgtqmx8/spl.c
Normal file
77
board/congatec/cgtqmx8/spl.c
Normal file
@@ -0,0 +1,77 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright 2018 NXP
|
||||
*
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <init.h>
|
||||
#include <log.h>
|
||||
#include <spl.h>
|
||||
#include <dm/uclass.h>
|
||||
#include <dm/device.h>
|
||||
#include <dm/uclass-internal.h>
|
||||
#include <dm/device-internal.h>
|
||||
#include <dm/lists.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
void spl_board_init(void)
|
||||
{
|
||||
struct udevice *dev;
|
||||
int offset;
|
||||
|
||||
uclass_find_first_device(UCLASS_MISC, &dev);
|
||||
|
||||
for (; dev; uclass_find_next_device(&dev)) {
|
||||
if (device_probe(dev))
|
||||
continue;
|
||||
}
|
||||
|
||||
offset = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "nxp,imx8-pd");
|
||||
while (offset != -FDT_ERR_NOTFOUND) {
|
||||
lists_bind_fdt(gd->dm_root, offset_to_ofnode(offset),
|
||||
NULL, true);
|
||||
offset = fdt_node_offset_by_compatible(gd->fdt_blob, offset,
|
||||
"nxp,imx8-pd");
|
||||
}
|
||||
|
||||
uclass_find_first_device(UCLASS_POWER_DOMAIN, &dev);
|
||||
|
||||
for (; dev; uclass_find_next_device(&dev)) {
|
||||
if (device_probe(dev))
|
||||
continue;
|
||||
}
|
||||
|
||||
arch_cpu_init();
|
||||
|
||||
board_early_init_f();
|
||||
|
||||
timer_init();
|
||||
|
||||
preloader_console_init();
|
||||
|
||||
puts("Normal Boot\n");
|
||||
}
|
||||
|
||||
#if (IS_ENABLED(CONFIG_SPL_LOAD_FIT))
|
||||
int board_fit_config_name_match(const char *name)
|
||||
{
|
||||
/* Just empty function now - can't decide what to choose */
|
||||
debug("%s: %s\n", __func__, name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void board_init_f(ulong dummy)
|
||||
{
|
||||
/* Clear global data */
|
||||
memset((void *)gd, 0, sizeof(gd_t));
|
||||
|
||||
/* Clear the BSS. */
|
||||
memset(__bss_start, 0, __bss_end - __bss_start);
|
||||
|
||||
board_init_r(NULL, 0);
|
||||
}
|
||||
48
board/congatec/common/Kconfig
Normal file
48
board/congatec/common/Kconfig
Normal file
@@ -0,0 +1,48 @@
|
||||
if !ARCH_IMX8M && !ARCH_IMX8
|
||||
|
||||
config CHAIN_OF_TRUST
|
||||
depends on !FIT_SIGNATURE && SECURE_BOOT
|
||||
imply CMD_BLOB
|
||||
imply CMD_HASH if ARM
|
||||
select FSL_CAAM
|
||||
select SPL_BOARD_INIT if (ARM && SPL)
|
||||
select SHA_HW_ACCEL
|
||||
select SHA_PROG_HW_ACCEL
|
||||
select ENV_IS_NOWHERE
|
||||
select CMD_EXT4 if ARM
|
||||
select CMD_EXT4_WRITE if ARM
|
||||
bool
|
||||
default y
|
||||
|
||||
config CMD_ESBC_VALIDATE
|
||||
bool "Enable the 'esbc_validate' and 'esbc_halt' commands"
|
||||
default y if CHAIN_OF_TRUST
|
||||
help
|
||||
This option enables two commands used for secure booting:
|
||||
|
||||
esbc_validate - validate signature using RSA verification
|
||||
esbc_halt - put the core in spin loop (Secure Boot Only)
|
||||
|
||||
endif
|
||||
|
||||
config VOL_MONITOR_LTC3882_READ
|
||||
depends on VID
|
||||
bool "Enable the LTC3882 voltage monitor read"
|
||||
default n
|
||||
help
|
||||
This option enables LTC3882 voltage monitor read
|
||||
functionality. It is used by common VID driver.
|
||||
|
||||
config VOL_MONITOR_LTC3882_SET
|
||||
depends on VID
|
||||
bool "Enable the LTC3882 voltage monitor set"
|
||||
default n
|
||||
help
|
||||
This option enables LTC3882 voltage monitor set
|
||||
functionality. It is used by common VID driver.
|
||||
|
||||
config USB_TCPC
|
||||
bool "USB Typec port controller simple driver"
|
||||
default n
|
||||
help
|
||||
Enable USB type-c port controller (TCPC) driver
|
||||
23
board/congatec/common/Makefile
Normal file
23
board/congatec/common/Makefile
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# (C) Copyright 2006
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
MINIMAL=
|
||||
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
ifdef CONFIG_SPL_INIT_MINIMAL
|
||||
MINIMAL=y
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef MINIMAL
|
||||
# necessary to create built-in.o
|
||||
obj- := __dummy__.o
|
||||
else
|
||||
|
||||
obj-y += mmc.o
|
||||
|
||||
endif
|
||||
49
board/congatec/common/mmc.c
Normal file
49
board/congatec/common/mmc.c
Normal file
@@ -0,0 +1,49 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2016 Freescale Semiconductor, Inc.
|
||||
* Copyright 2018 NXP
|
||||
*
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <linux/errno.h>
|
||||
#include <asm/io.h>
|
||||
#include <env.h>
|
||||
#include <command.h>
|
||||
#include <stdbool.h>
|
||||
#include <mmc.h>
|
||||
|
||||
static int check_mmc_autodetect(void)
|
||||
{
|
||||
char *autodetect_str = env_get("mmcautodetect");
|
||||
|
||||
if ((autodetect_str) && (strcmp(autodetect_str, "yes") == 0))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This should be defined for each board */
|
||||
__weak int mmc_map_to_kernel_blk(int dev_no)
|
||||
{
|
||||
return dev_no;
|
||||
}
|
||||
|
||||
void board_late_mmc_env_init(void)
|
||||
{
|
||||
char cmd[32];
|
||||
char mmcblk[32];
|
||||
u32 dev_no = mmc_get_env_dev();
|
||||
|
||||
if (!check_mmc_autodetect())
|
||||
return;
|
||||
|
||||
env_set_ulong("mmcdev", dev_no);
|
||||
|
||||
/* Set mmcblk env */
|
||||
sprintf(mmcblk, "/dev/mmcblk%dp2 rootwait rw",
|
||||
mmc_map_to_kernel_blk(dev_no));
|
||||
env_set("mmcroot", mmcblk);
|
||||
|
||||
sprintf(cmd, "mmc dev %d", dev_no);
|
||||
run_command(cmd, 0);
|
||||
}
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "ventana_eeprom.h"
|
||||
|
||||
/* GPIO's common to all baseboards */
|
||||
#define GP_PHY_RST IMX_GPIO_NR(1, 30)
|
||||
#define GP_RS232_EN IMX_GPIO_NR(2, 11)
|
||||
#define GP_MSATA_SEL IMX_GPIO_NR(2, 8)
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <linux/ctype.h>
|
||||
#include <miiphy.h>
|
||||
#include <mtd_node.h>
|
||||
#include <netdev.h>
|
||||
#include <pci.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/libfdt.h>
|
||||
@@ -54,42 +53,6 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
struct ventana_board_info ventana_info;
|
||||
static int board_type;
|
||||
|
||||
/* ENET */
|
||||
static iomux_v3_cfg_t const enet_pads[] = {
|
||||
IOMUX_PADS(PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_TXC__RGMII_TXC | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_TD0__RGMII_TD0 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_TD1__RGMII_TD1 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_TD2__RGMII_TD2 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_TD3__RGMII_TD3 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_TX_CTL__RGMII_TX_CTL |
|
||||
MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_ENET_REF_CLK__ENET_TX_CLK |
|
||||
MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_RXC__RGMII_RXC | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_RD0__RGMII_RD0 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_RD1__RGMII_RD1 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_RD2__RGMII_RD2 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_RD3__RGMII_RD3 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
IOMUX_PADS(PAD_RGMII_RX_CTL__RGMII_RX_CTL |
|
||||
MUX_PAD_CTRL(ENET_PAD_CTRL)),
|
||||
/* PHY nRST */
|
||||
IOMUX_PADS(PAD_ENET_TXD0__GPIO1_IO30 | DIO_PAD_CFG),
|
||||
};
|
||||
|
||||
static void setup_iomux_enet(int gpio)
|
||||
{
|
||||
SETUP_IOMUX_PADS(enet_pads);
|
||||
|
||||
/* toggle PHY_RST# */
|
||||
gpio_request(gpio, "phy_rst#");
|
||||
gpio_direction_output(gpio, 0);
|
||||
mdelay(10);
|
||||
gpio_set_value(gpio, 1);
|
||||
mdelay(100);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USB_EHCI_MX6
|
||||
/* toggle USB_HUB_RST# for boards that have it; it is not defined in dt */
|
||||
int board_ehci_hcd_init(int port)
|
||||
@@ -195,40 +158,7 @@ int mv88e61xx_hw_reset(struct phy_device *phydev)
|
||||
}
|
||||
#endif // CONFIG_MV88E61XX_SWITCH
|
||||
|
||||
int board_eth_init(struct bd_info *bis)
|
||||
{
|
||||
#ifdef CONFIG_FEC_MXC
|
||||
struct ventana_board_info *info = &ventana_info;
|
||||
|
||||
if (test_bit(EECONFIG_ETH0, info->config)) {
|
||||
setup_iomux_enet(GP_PHY_RST);
|
||||
cpu_eth_init(bis);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_E1000
|
||||
e1000_initialize(bis);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CI_UDC
|
||||
/* For otg ethernet*/
|
||||
usb_eth_initialize(bis);
|
||||
#endif
|
||||
|
||||
/* default to the first detected enet dev */
|
||||
if (!env_get("ethprime")) {
|
||||
struct eth_device *dev = eth_get_dev_by_index(0);
|
||||
if (dev) {
|
||||
env_set("ethprime", dev->name);
|
||||
printf("set ethprime to %s\n", env_get("ethprime"));
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_VIDEO_IPUV3)
|
||||
|
||||
static void enable_hdmi(struct display_info_t const *dev)
|
||||
{
|
||||
imx_enable_hdmi_phy();
|
||||
@@ -427,7 +357,6 @@ int power_init_board(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_CMD_PCI)
|
||||
int imx6_pcie_toggle_reset(void)
|
||||
{
|
||||
if (board_type < GW_UNKNOWN) {
|
||||
@@ -448,6 +377,7 @@ int imx6_pcie_toggle_reset(void)
|
||||
#define MAX_PCI_DEVS 32
|
||||
struct pci_dev {
|
||||
pci_dev_t devfn;
|
||||
struct udevice *dev;
|
||||
unsigned short vendor;
|
||||
unsigned short device;
|
||||
unsigned short class;
|
||||
@@ -458,18 +388,21 @@ struct pci_dev pci_devs[MAX_PCI_DEVS];
|
||||
int pci_devno;
|
||||
int pci_bridgeno;
|
||||
|
||||
void board_pci_fixup_dev(struct pci_controller *hose, pci_dev_t dev,
|
||||
unsigned short vendor, unsigned short device,
|
||||
unsigned short class)
|
||||
void board_pci_fixup_dev(struct udevice *bus, struct udevice *udev)
|
||||
{
|
||||
int i;
|
||||
u32 dw;
|
||||
struct pci_child_plat *pdata = dev_get_parent_plat(udev);
|
||||
struct pci_dev *pdev = &pci_devs[pci_devno++];
|
||||
unsigned short vendor = pdata->vendor;
|
||||
unsigned short device = pdata->device;
|
||||
unsigned int class = pdata->class;
|
||||
pci_dev_t dev = dm_pci_get_bdf(udev);
|
||||
int i;
|
||||
|
||||
debug("%s: %02d:%02d.%02d: %04x:%04x\n", __func__,
|
||||
PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev), vendor, device);
|
||||
|
||||
/* store array of devs for later use in device-tree fixup */
|
||||
pdev->dev = udev;
|
||||
pdev->devfn = dev;
|
||||
pdev->vendor = vendor;
|
||||
pdev->device = device;
|
||||
@@ -496,19 +429,19 @@ void board_pci_fixup_dev(struct pci_controller *hose, pci_dev_t dev,
|
||||
if (vendor == PCI_VENDOR_ID_PLX &&
|
||||
(device & 0xfff0) == 0x8600 &&
|
||||
PCI_DEV(dev) == 0 && PCI_FUNC(dev) == 0) {
|
||||
ulong val;
|
||||
debug("configuring PLX 860X downstream PERST#\n");
|
||||
pci_hose_read_config_dword(hose, dev, 0x62c, &dw);
|
||||
dw |= 0xaaa8; /* GPIO1-7 outputs */
|
||||
pci_hose_write_config_dword(hose, dev, 0x62c, dw);
|
||||
pci_bus_read_config(bus, dev, 0x62c, &val, PCI_SIZE_32);
|
||||
val |= 0xaaa8; /* GPIO1-7 outputs */
|
||||
pci_bus_write_config(bus, dev, 0x62c, val, PCI_SIZE_32);
|
||||
|
||||
pci_hose_read_config_dword(hose, dev, 0x644, &dw);
|
||||
dw |= 0xfe; /* GPIO1-7 output high */
|
||||
pci_hose_write_config_dword(hose, dev, 0x644, dw);
|
||||
pci_bus_read_config(bus, dev, 0x644, &val, PCI_SIZE_32);
|
||||
val |= 0xfe; /* GPIO1-7 output high */
|
||||
pci_bus_write_config(bus, dev, 0x644, val, PCI_SIZE_32);
|
||||
|
||||
mdelay(100);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_CMD_PCI */
|
||||
|
||||
#ifdef CONFIG_SERIAL_TAG
|
||||
/*
|
||||
|
||||
91
board/out4/o4-imx6ull-nano/K4B4G1646D-BCMA.cfg
Normal file
91
board/out4/o4-imx6ull-nano/K4B4G1646D-BCMA.cfg
Normal file
@@ -0,0 +1,91 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
// Copyright (C) 2016 Freescale Semiconductor, Inc.
|
||||
// Copyright (C) 2021 Oleh Kravchenko <oleg@kaa.org.ua>
|
||||
|
||||
#define __ASSEMBLY__
|
||||
#include <config.h>
|
||||
|
||||
/* image version */
|
||||
|
||||
IMAGE_VERSION 2
|
||||
BOOT_FROM sd
|
||||
|
||||
#ifdef CONFIG_IMX_HAB
|
||||
CSF CONFIG_CSF_SIZE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* Enable all clocks */
|
||||
DATA 4 0x020c4068 0xffffffff
|
||||
DATA 4 0x020c406c 0xffffffff
|
||||
DATA 4 0x020c4070 0xffffffff
|
||||
DATA 4 0x020c4074 0xffffffff
|
||||
DATA 4 0x020c4078 0xffffffff
|
||||
DATA 4 0x020c407c 0xffffffff
|
||||
DATA 4 0x020c4080 0xffffffff
|
||||
|
||||
/* Samsung K4B4G1646D-BCMA */
|
||||
DATA 4 0x020e04b4 0x000c0000
|
||||
DATA 4 0x020e04ac 0x00000000
|
||||
DATA 4 0x020e027c 0x00000030
|
||||
DATA 4 0x020e0250 0x00000030
|
||||
DATA 4 0x020e024c 0x00000030
|
||||
DATA 4 0x020e0490 0x00000030
|
||||
DATA 4 0x020e0288 0x000c0030
|
||||
DATA 4 0x020e0270 0x00000000
|
||||
DATA 4 0x020e0260 0x00000030
|
||||
DATA 4 0x020e0264 0x00000030
|
||||
DATA 4 0x020e04a0 0x00000030
|
||||
DATA 4 0x020e0494 0x00020000
|
||||
DATA 4 0x020e0280 0x00000030
|
||||
DATA 4 0x020e0284 0x00000030
|
||||
DATA 4 0x020e04b0 0x00020000
|
||||
DATA 4 0x020e0498 0x00000030
|
||||
DATA 4 0x020e04a4 0x00000030
|
||||
DATA 4 0x020e0244 0x00000030
|
||||
DATA 4 0x020e0248 0x00000030
|
||||
DATA 4 0x021b001c 0x00008000
|
||||
DATA 4 0x021b0800 0xa1390003
|
||||
DATA 4 0x021b080c 0x00030009
|
||||
DATA 4 0x021b083c 0x01440148
|
||||
DATA 4 0x021b0848 0x40403640
|
||||
DATA 4 0x021b0850 0x4040322a
|
||||
DATA 4 0x021b081c 0x33333333
|
||||
DATA 4 0x021b0820 0x33333333
|
||||
DATA 4 0x021b082c 0xf3333333
|
||||
DATA 4 0x021b0830 0xf3333333
|
||||
DATA 4 0x021b08c0 0x00944009
|
||||
DATA 4 0x021b08b8 0x00000800
|
||||
DATA 4 0x021b0004 0x0002002d
|
||||
DATA 4 0x021b0008 0x1b333030
|
||||
DATA 4 0x021b000c 0x676b52f2
|
||||
DATA 4 0x021b0010 0x926d0b63
|
||||
DATA 4 0x021b0014 0x01ff00db
|
||||
DATA 4 0x021b0018 0x00211740
|
||||
DATA 4 0x021b001c 0x00008000
|
||||
DATA 4 0x021b002c 0x000026d2
|
||||
DATA 4 0x021b0030 0x006b1023
|
||||
DATA 4 0x021b0040 0x0000004f
|
||||
DATA 4 0x021b0000 0x84180000
|
||||
DATA 4 0x021b0890 0x00400000
|
||||
DATA 4 0x021b001c 0x02008032
|
||||
DATA 4 0x021b001c 0x00008033
|
||||
DATA 4 0x021b001c 0x00048031
|
||||
DATA 4 0x021b001c 0x15108030
|
||||
DATA 4 0x021b001c 0x04008040
|
||||
DATA 4 0x021b0020 0x00007800
|
||||
DATA 4 0x021b0818 0x00000227
|
||||
DATA 4 0x021b0004 0x0002552d
|
||||
DATA 4 0x021b0404 0x00011006
|
||||
DATA 4 0x021b001c 0x00000000
|
||||
64
board/out4/o4-imx6ull-nano/Kconfig
Normal file
64
board/out4/o4-imx6ull-nano/Kconfig
Normal file
@@ -0,0 +1,64 @@
|
||||
if TARGET_O4_IMX6ULL_NANO
|
||||
|
||||
config SYS_BOARD
|
||||
default "o4-imx6ull-nano"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "out4"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "o4-imx6ull-nano"
|
||||
|
||||
choice
|
||||
prompt "Memory model"
|
||||
default K4B4G1646D_BCMA
|
||||
help
|
||||
Memory type setup.
|
||||
|
||||
Please choose correct memory model here.
|
||||
|
||||
config K4B4G1646D_BCMA
|
||||
bool "K4B4G1646D-BCMA 256Mx16 (512 MiB/chip)"
|
||||
help
|
||||
Samsung DDR3 SDRAM
|
||||
K4B4G1646D-BCMA
|
||||
|
||||
config MT41K256M16HA_125E
|
||||
bool "MT41K256M16HA-125:E 256Mx16 (512 MiB/chip)"
|
||||
help
|
||||
Micron DDR3L SDRAM
|
||||
MT41K256M16HA-125:E
|
||||
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "Mainboard model"
|
||||
default O4_IMX_NANO
|
||||
help
|
||||
Mainboard setup.
|
||||
|
||||
Please choose correct main board model here.
|
||||
|
||||
config O4_IMX_NANO
|
||||
bool "O4-iMX-NANO"
|
||||
help
|
||||
A baseboard for EV-iMX280-NANO module:
|
||||
https://out4.ru/products/board/18-o4-imx-nano.html
|
||||
|
||||
config EV_IMX280_NANO_X_MB
|
||||
bool "EV-IMX280-NANO-X-MB"
|
||||
help
|
||||
A simple baseboard for EV-iMX280-NANO module:
|
||||
http://evodbg.net/products/mx28-eval-kits/14-ev-imx280-nano-x-mb.html
|
||||
|
||||
endchoice
|
||||
|
||||
config IMX_CONFIG
|
||||
default "board/out4/o4-imx6ull-nano/K4B4G1646D-BCMA.cfg" if K4B4G1646D_BCMA
|
||||
default "board/out4/o4-imx6ull-nano/MT41K256M16HA-125E.cfg" if MT41K256M16HA_125E
|
||||
|
||||
config DEFAULT_DEVICE_TREE
|
||||
default "o4-imx-nano" if O4_IMX_NANO
|
||||
default "ev-imx280-nano-x-mb" if EV_IMX280_NANO_X_MB
|
||||
|
||||
endif
|
||||
91
board/out4/o4-imx6ull-nano/MT41K256M16HA-125E.cfg
Normal file
91
board/out4/o4-imx6ull-nano/MT41K256M16HA-125E.cfg
Normal file
@@ -0,0 +1,91 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
// Copyright (C) 2016 Freescale Semiconductor, Inc.
|
||||
// Copyright (C) 2021 Oleh Kravchenko <oleg@kaa.org.ua>
|
||||
|
||||
#define __ASSEMBLY__
|
||||
#include <config.h>
|
||||
|
||||
/* image version */
|
||||
|
||||
IMAGE_VERSION 2
|
||||
BOOT_FROM sd
|
||||
|
||||
#ifdef CONFIG_IMX_HAB
|
||||
CSF CONFIG_CSF_SIZE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* Enable all clocks */
|
||||
DATA 4 0x020c4068 0xffffffff
|
||||
DATA 4 0x020c406c 0xffffffff
|
||||
DATA 4 0x020c4070 0xffffffff
|
||||
DATA 4 0x020c4074 0xffffffff
|
||||
DATA 4 0x020c4078 0xffffffff
|
||||
DATA 4 0x020c407c 0xffffffff
|
||||
DATA 4 0x020c4080 0xffffffff
|
||||
|
||||
/* Micron MT41K256M16HA-125:E */
|
||||
DATA 4 0x020e04b4 0x000c0000
|
||||
DATA 4 0x020e04ac 0x00000000
|
||||
DATA 4 0x020e027c 0x00000030
|
||||
DATA 4 0x020e0250 0x00000030
|
||||
DATA 4 0x020e024c 0x00000030
|
||||
DATA 4 0x020e0490 0x00000030
|
||||
DATA 4 0x020e0288 0x000c0030
|
||||
DATA 4 0x020e0270 0x00000000
|
||||
DATA 4 0x020e0260 0x00000030
|
||||
DATA 4 0x020e0264 0x00000030
|
||||
DATA 4 0x020e04a0 0x00000030
|
||||
DATA 4 0x020e0494 0x00020000
|
||||
DATA 4 0x020e0280 0x00000030
|
||||
DATA 4 0x020e0284 0x00000030
|
||||
DATA 4 0x020e04b0 0x00020000
|
||||
DATA 4 0x020e0498 0x00000030
|
||||
DATA 4 0x020e04a4 0x00000030
|
||||
DATA 4 0x020e0244 0x00000030
|
||||
DATA 4 0x020e0248 0x00000030
|
||||
DATA 4 0x021b001c 0x00008000
|
||||
DATA 4 0x021b0800 0xa1390003
|
||||
DATA 4 0x021b080c 0x0005000b
|
||||
DATA 4 0x021b083c 0x01400144
|
||||
DATA 4 0x021b0848 0x4040343a
|
||||
DATA 4 0x021b0850 0x4040342a
|
||||
DATA 4 0x021b081c 0x33333333
|
||||
DATA 4 0x021b0820 0x33333333
|
||||
DATA 4 0x021b082c 0xf3333333
|
||||
DATA 4 0x021b0830 0xf3333333
|
||||
DATA 4 0x021b08c0 0x00944009
|
||||
DATA 4 0x021b08b8 0x00000800
|
||||
DATA 4 0x021b0004 0x0002002d
|
||||
DATA 4 0x021b0008 0x1b333030
|
||||
DATA 4 0x021b000c 0x676b52f2
|
||||
DATA 4 0x021b0010 0x91eb0b63
|
||||
DATA 4 0x021b0014 0x01ff00db
|
||||
DATA 4 0x021b0018 0x00211740
|
||||
DATA 4 0x021b001c 0x00008000
|
||||
DATA 4 0x021b002c 0x000026d2
|
||||
DATA 4 0x021b0030 0x006b1023
|
||||
DATA 4 0x021b0040 0x0000004f
|
||||
DATA 4 0x021b0000 0x84180000
|
||||
DATA 4 0x021b0890 0x00400000
|
||||
DATA 4 0x021b001c 0x02008032
|
||||
DATA 4 0x021b001c 0x00008033
|
||||
DATA 4 0x021b001c 0x00048031
|
||||
DATA 4 0x021b001c 0x15108030
|
||||
DATA 4 0x021b001c 0x04008040
|
||||
DATA 4 0x021b0020 0x00007800
|
||||
DATA 4 0x021b0818 0x00000227
|
||||
DATA 4 0x021b0004 0x0002552d
|
||||
DATA 4 0x021b0404 0x00011006
|
||||
DATA 4 0x021b001c 0x00000000
|
||||
4
board/out4/o4-imx6ull-nano/Makefile
Normal file
4
board/out4/o4-imx6ull-nano/Makefile
Normal file
@@ -0,0 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
# Copyright (C) 2021 Oleh Kravchenko <oleg@kaa.org.ua>
|
||||
|
||||
obj-y := o4-imx6ull-nano.o
|
||||
88
board/out4/o4-imx6ull-nano/o4-imx6ull-nano.c
Normal file
88
board/out4/o4-imx6ull-nano/o4-imx6ull-nano.c
Normal file
@@ -0,0 +1,88 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
// Copyright (C) 2021 Oleh Kravchenko <oleg@kaa.org.ua>
|
||||
|
||||
#include <asm/arch-mx6/clock.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <asm/mach-imx/boot_mode.h>
|
||||
#include <common.h>
|
||||
#include <env.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
gd->ram_size = imx_ddr_size();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int setup_fec_clock(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_FEC_MXC) && !IS_ENABLED(CONFIG_CLK_IMX6Q)) {
|
||||
struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* Use 50M anatop loopback REF_CLK1 for ENET1,
|
||||
* clear gpr1[13], set gpr1[17].
|
||||
*/
|
||||
clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUX_GPR1_FEC1_MASK,
|
||||
IOMUX_GPR1_FEC1_CLOCK_MUX1_SEL_MASK);
|
||||
|
||||
ret = enable_fec_anatop_clock(0, ENET_50MHZ);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!IS_ENABLED(CONFIG_EV_IMX280_NANO_X_MB)) {
|
||||
/*
|
||||
* Use 50M anatop loopback REF_CLK2 for ENET2,
|
||||
* clear gpr1[14], set gpr1[18].
|
||||
*/
|
||||
clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUX_GPR1_FEC2_MASK,
|
||||
IOMUX_GPR1_FEC2_CLOCK_MUX1_SEL_MASK);
|
||||
|
||||
ret = enable_fec_anatop_clock(1, ENET_50MHZ);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
enable_enet_clk(1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_init(void)
|
||||
{
|
||||
/* Address of boot parameters */
|
||||
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
|
||||
|
||||
return setup_fec_clock();
|
||||
}
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_CMD_BMODE))
|
||||
add_board_boot_modes(NULL);
|
||||
|
||||
if (IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) {
|
||||
const char *model;
|
||||
|
||||
model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
|
||||
if (model)
|
||||
env_set("board_name", model);
|
||||
}
|
||||
|
||||
if (is_boot_from_usb()) {
|
||||
env_set("bootcmd", "run bootcmd_mfg");
|
||||
env_set("bootdelay", "0");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
12
board/seeed/npi_imx6ull/Kconfig
Normal file
12
board/seeed/npi_imx6ull/Kconfig
Normal file
@@ -0,0 +1,12 @@
|
||||
if TARGET_NPI_IMX6ULL
|
||||
|
||||
config SYS_BOARD
|
||||
default "npi_imx6ull"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "seeed"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "npi_imx6ull"
|
||||
|
||||
endif
|
||||
9
board/seeed/npi_imx6ull/MAINTAINERS
Normal file
9
board/seeed/npi_imx6ull/MAINTAINERS
Normal file
@@ -0,0 +1,9 @@
|
||||
NPI_IMX6ULL BOARD
|
||||
M: Navin Sankar Velliangiri <navin@linumiz.com>
|
||||
S: Maintained
|
||||
F: arch/arm/dts/imx6ull-seeed-npi-imx6ull-dev-board.dts
|
||||
F: arch/arm/dts/imx6ull-seeed-npi-imx6ull-u-boot.dtsi
|
||||
F: arch/arm/dts/imx6ull-seeed-npi-imx6ull.dtsi
|
||||
F: board/seeed/npi-imx6ull/
|
||||
F: configs/seeed_npi_imx6ull_defconfig
|
||||
F: include/configs/npi_imx6ull.h
|
||||
4
board/seeed/npi_imx6ull/Makefile
Normal file
4
board/seeed/npi_imx6ull/Makefile
Normal file
@@ -0,0 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
obj-y := npi_imx6ull.o
|
||||
obj-$(CONFIG_SPL_BUILD) += spl.o
|
||||
61
board/seeed/npi_imx6ull/README
Normal file
61
board/seeed/npi_imx6ull/README
Normal file
@@ -0,0 +1,61 @@
|
||||
How to use U-BOOT on SeeedStudio NPI-IMX6ULL Single Board Computer
|
||||
------------------------------------------------------------------
|
||||
|
||||
- Configure and build U-Boot for NPI-IMX6ULL:
|
||||
|
||||
$ export ARCH=arm
|
||||
$ export CROSS_COMPILE=arm-none-linux-gnueabihf-
|
||||
$ make seeed_npi_imx6ull_defconfig
|
||||
$ make
|
||||
|
||||
This will generate SPL and u-boot-dtb.img images.
|
||||
|
||||
Boot from MMC/SD:
|
||||
- The SPL and u-boot-dtb.img images need to be flashed into the micro SD card:
|
||||
|
||||
$ sudo dd if=SPL of=/dev/mmcblk0 bs=1k seek=1; sync
|
||||
$ sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 bs=1k seek=69; sync
|
||||
|
||||
- Boot mode settings:
|
||||
|
||||
Boot switch position: SW1 -> 0
|
||||
SW2 -> 1
|
||||
SW3 -> 0
|
||||
SW4 -> 0
|
||||
SW5 -> 1
|
||||
SW6 -> 0
|
||||
SW7 -> 0
|
||||
SW8 -> 1
|
||||
|
||||
Boot from NAND:
|
||||
- Boot the board using SD/MMC or Serial download and load the SPL into memory
|
||||
either from SD/MMC or TFTP.
|
||||
|
||||
Default MTD layout is 512k(spl),1m(uboot),1m(uboot-dup),-(ubi)
|
||||
|
||||
Flash SPL to NAND from SD/MMC,
|
||||
|
||||
$ ext4load mmc 0:2 $loadaddr SPL
|
||||
$ nand erase.part spl
|
||||
$ nandbcb init $loadaddr 0x0 $filesize
|
||||
|
||||
Flash u-boot image to NAND from SD/MMC,
|
||||
|
||||
$ ext4load mmc 0:2 $loadaddr u-boot-dtb.img
|
||||
$ nand erase.part uboot
|
||||
$ nand write $loadaddr uboot $filesize
|
||||
|
||||
- Boot mode settings:
|
||||
|
||||
Boot switch position: SW1 -> 0
|
||||
SW2 -> 1
|
||||
SW3 -> 1
|
||||
SW4 -> 0
|
||||
SW5 -> 0
|
||||
SW6 -> 1
|
||||
SW7 -> 0
|
||||
SW8 -> 0
|
||||
|
||||
- Connect the Serial cable to UART0 and the PC for the console.
|
||||
|
||||
- Reset the board using reset button and U-Boot should boot from NAND.
|
||||
114
board/seeed/npi_imx6ull/npi_imx6ull.c
Normal file
114
board/seeed/npi_imx6ull/npi_imx6ull.c
Normal file
@@ -0,0 +1,114 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (c) 2021 Linumiz
|
||||
* Author: Navin Sankar Velliangiri <navin@linumiz.com>
|
||||
*/
|
||||
|
||||
#include <init.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/crm_regs.h>
|
||||
#include <asm/arch/iomux.h>
|
||||
#include <asm/arch/mx6-pins.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <asm/mach-imx/iomux-v3.h>
|
||||
#include <asm/mach-imx/mxc_i2c.h>
|
||||
#include <fsl_esdhc_imx.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <miiphy.h>
|
||||
#include <net.h>
|
||||
#include <netdev.h>
|
||||
#include <usb.h>
|
||||
#include <usb/ehci-ci.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
gd->ram_size = imx_ddr_size();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#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)
|
||||
|
||||
static iomux_v3_cfg_t const uart1_pads[] = {
|
||||
MX6_PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
|
||||
MX6_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
|
||||
};
|
||||
|
||||
static void setup_iomux_uart(void)
|
||||
{
|
||||
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
|
||||
}
|
||||
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
setup_iomux_uart();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FEC_MXC
|
||||
|
||||
static int setup_fec(int fec_id)
|
||||
{
|
||||
struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
|
||||
int ret;
|
||||
|
||||
if (fec_id == 0) {
|
||||
/*
|
||||
* Use 50MHz anatop loopback REF_CLK1 for ENET1,
|
||||
* clear gpr1[13], set gpr1[17].
|
||||
*/
|
||||
clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUX_GPR1_FEC1_MASK,
|
||||
IOMUX_GPR1_FEC1_CLOCK_MUX1_SEL_MASK);
|
||||
} else {
|
||||
/*
|
||||
* Use 50MHz anatop loopbak REF_CLK2 for ENET2,
|
||||
* clear gpr1[14], set gpr1[18].
|
||||
*/
|
||||
clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUX_GPR1_FEC2_MASK,
|
||||
IOMUX_GPR1_FEC2_CLOCK_MUX1_SEL_MASK);
|
||||
}
|
||||
|
||||
ret = enable_fec_anatop_clock(fec_id, ENET_50MHZ);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
enable_enet_clk(1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_phy_config(struct phy_device *phydev)
|
||||
{
|
||||
phy_write(phydev, MDIO_DEVAD_NONE, 0x1f, 0x8190);
|
||||
|
||||
if (phydev->drv->config)
|
||||
phydev->drv->config(phydev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int board_init(void)
|
||||
{
|
||||
/* Address of boot parameters */
|
||||
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
|
||||
|
||||
#ifdef CONFIG_FEC_MXC
|
||||
setup_fec(CONFIG_FEC_ENET_DEV);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int checkboard(void)
|
||||
{
|
||||
printf("Board: Seeed NPi i.MX6ULL Dev Board\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
205
board/seeed/npi_imx6ull/spl.c
Normal file
205
board/seeed/npi_imx6ull/spl.c
Normal file
@@ -0,0 +1,205 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (c) 2021 Linumiz
|
||||
* Author: Navin Sankar Velliangiri <navin@linumiz.com>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <init.h>
|
||||
#include <spl.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/mx6-ddr.h>
|
||||
#include <asm/arch/mx6-pins.h>
|
||||
#include <asm/arch/crm_regs.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <fsl_esdhc_imx.h>
|
||||
|
||||
/* Configuration for Micron MT41K256M16TW-107 32M x 16 x 8 -> 512MiB */
|
||||
|
||||
static struct mx6ul_iomux_grp_regs mx6_grp_ioregs = {
|
||||
.grp_addds = 0x00000030,
|
||||
.grp_ddrmode_ctl = 0x00020000,
|
||||
.grp_b0ds = 0x00000030,
|
||||
.grp_ctlds = 0x00000030,
|
||||
.grp_b1ds = 0x00000030,
|
||||
.grp_ddrpke = 0x00000000,
|
||||
.grp_ddrmode = 0x00020000,
|
||||
.grp_ddr_type = 0x000c0000,
|
||||
};
|
||||
|
||||
static struct mx6ul_iomux_ddr_regs mx6_ddr_ioregs = {
|
||||
.dram_dqm0 = 0x00000030,
|
||||
.dram_dqm1 = 0x00000030,
|
||||
.dram_ras = 0x00000030,
|
||||
.dram_cas = 0x00000030,
|
||||
.dram_odt0 = 0x00000030,
|
||||
.dram_odt1 = 0x00000030,
|
||||
.dram_sdba2 = 0x00000000,
|
||||
.dram_sdclk_0 = 0x00000030,
|
||||
.dram_sdqs0 = 0x00000030,
|
||||
.dram_sdqs1 = 0x00000030,
|
||||
.dram_reset = 0x00000030,
|
||||
};
|
||||
|
||||
static struct mx6_mmdc_calibration mx6_mmcd_calib = {
|
||||
.p0_mpwldectrl0 = 0x00000000,
|
||||
.p0_mpdgctrl0 = 0x41480148,
|
||||
.p0_mprddlctl = 0x40403E42,
|
||||
.p0_mpwrdlctl = 0x40405852,
|
||||
};
|
||||
|
||||
struct mx6_ddr_sysinfo ddr_sysinfo = {
|
||||
.dsize = 0, /* Bus size = 16bit */
|
||||
.cs_density = 32,
|
||||
.ncs = 1,
|
||||
.cs1_mirror = 0,
|
||||
.rtt_wr = 1,
|
||||
.rtt_nom = 1,
|
||||
.walat = 1, /* Write additional latency */
|
||||
.ralat = 5, /* Read additional latency */
|
||||
.mif3_mode = 3, /* Command prediction working mode */
|
||||
.bi_on = 1, /* Bank interleaving enabled */
|
||||
.pd_fast_exit = 1,
|
||||
.sde_to_rst = 0x10,
|
||||
.rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */
|
||||
.ddr_type = DDR_TYPE_DDR3,
|
||||
.refsel = 1, /* Refresh cycles at 32KHz */
|
||||
.refr = 7, /* 8 refresh commands per refresh cycle */
|
||||
};
|
||||
|
||||
static struct mx6_ddr3_cfg mem_ddr = {
|
||||
.mem_speed = 1600,
|
||||
.density = 4,
|
||||
.width = 16,
|
||||
.banks = 8,
|
||||
.rowaddr = 15,
|
||||
.coladdr = 10,
|
||||
.pagesz = 2,
|
||||
.trcd = 1375,
|
||||
.trcmin = 4875,
|
||||
.trasmin = 3500,
|
||||
};
|
||||
|
||||
static void ccgr_init(void)
|
||||
{
|
||||
struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
|
||||
|
||||
writel(0xFFFFFFFF, &ccm->CCGR0);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR1);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR2);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR3);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR4);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR5);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR6);
|
||||
}
|
||||
|
||||
static void spl_dram_init(void)
|
||||
{
|
||||
mx6ul_dram_iocfg(mem_ddr.width, &mx6_ddr_ioregs, &mx6_grp_ioregs);
|
||||
mx6_dram_cfg(&ddr_sysinfo, &mx6_mmcd_calib, &mem_ddr);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FSL_ESDHC_IMX
|
||||
|
||||
#define USDHC_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
|
||||
PAD_CTL_PUS_22K_UP | PAD_CTL_SPEED_LOW | \
|
||||
PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST | \
|
||||
PAD_CTL_HYS)
|
||||
|
||||
static iomux_v3_cfg_t const usdhc1_pads[] = {
|
||||
MX6_PAD_SD1_CLK__USDHC1_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_SD1_CMD__USDHC1_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_SD1_DATA0__USDHC1_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_SD1_DATA1__USDHC1_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_SD1_DATA2__USDHC1_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_SD1_DATA3__USDHC1_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_UART1_RTS_B__USDHC1_CD_B | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
};
|
||||
|
||||
#ifndef CONFIG_NAND_MXS
|
||||
static iomux_v3_cfg_t const usdhc2_pads[] = {
|
||||
MX6_PAD_NAND_RE_B__USDHC2_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_NAND_WE_B__USDHC2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_NAND_DATA00__USDHC2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_NAND_DATA01__USDHC2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_NAND_DATA02__USDHC2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_NAND_DATA03__USDHC2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_NAND_DATA04__USDHC2_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_NAND_DATA05__USDHC2_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_NAND_DATA06__USDHC2_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
MX6_PAD_NAND_DATA07__USDHC2_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct fsl_esdhc_cfg usdhc_cfg[] = {
|
||||
{
|
||||
.esdhc_base = USDHC1_BASE_ADDR,
|
||||
.max_bus_width = 4,
|
||||
},
|
||||
#ifndef CONFIG_NAND_MXS
|
||||
{
|
||||
.esdhc_base = USDHC2_BASE_ADDR,
|
||||
.max_bus_width = 8,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
int board_mmc_getcd(struct mmc *mmc)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int board_mmc_init(struct bd_info *bis)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
SETUP_IOMUX_PADS(usdhc1_pads);
|
||||
usdhc_cfg[i].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
|
||||
break;
|
||||
#ifndef CONFIG_NAND_MXS
|
||||
case 1:
|
||||
SETUP_IOMUX_PADS(usdhc2_pads);
|
||||
usdhc_cfg[i].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
printf("Warning - USDHC%d controller not supporting\n",
|
||||
i + 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]);
|
||||
if (ret) {
|
||||
printf("Warning: failed to initialize mmc dev %d\n", i);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_FSL_ESDHC_IMX */
|
||||
|
||||
void board_init_f(ulong dummy)
|
||||
{
|
||||
ccgr_init();
|
||||
|
||||
/* Setup AIPS and disable watchdog */
|
||||
arch_cpu_init();
|
||||
|
||||
/* Setup iomux and fec */
|
||||
board_early_init_f();
|
||||
|
||||
/* Setup GP timer */
|
||||
timer_init();
|
||||
|
||||
/* UART clocks enabled and gd valid - init serial console */
|
||||
preloader_console_init();
|
||||
|
||||
/* DDR initialization */
|
||||
spl_dram_init();
|
||||
}
|
||||
12
board/storopack/smegw01/Kconfig
Normal file
12
board/storopack/smegw01/Kconfig
Normal file
@@ -0,0 +1,12 @@
|
||||
if TARGET_SMEGW01
|
||||
|
||||
config SYS_BOARD
|
||||
default "smegw01"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "storopack"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "smegw01"
|
||||
|
||||
endif
|
||||
7
board/storopack/smegw01/MAINTAINERS
Normal file
7
board/storopack/smegw01/MAINTAINERS
Normal file
@@ -0,0 +1,7 @@
|
||||
SMEGW01 BOARD
|
||||
M: Fabio Estevam <festevam@denx.de>
|
||||
S: Maintained
|
||||
F: board/storopack/
|
||||
F: arch/arm/dts/imx7d-smegw01.dts
|
||||
F: configs/smegw01_defconfig
|
||||
F: include/configs/smegw01.h
|
||||
4
board/storopack/smegw01/Makefile
Normal file
4
board/storopack/smegw01/Makefile
Normal file
@@ -0,0 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
# (C) Copyright 2016 NXP Semiconductors
|
||||
|
||||
obj-y := smegw01.o
|
||||
100
board/storopack/smegw01/imximage.cfg
Normal file
100
board/storopack/smegw01/imximage.cfg
Normal file
@@ -0,0 +1,100 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2017 PHYTEC America, LLC
|
||||
*
|
||||
* Refer doc/imx/mkimage/imximage.txt for more details about how-to configure
|
||||
* and create imximage boot image
|
||||
*
|
||||
* The syntax is taken as close as possible with the kwbimage
|
||||
*/
|
||||
|
||||
#define __ASSEMBLY__
|
||||
#include <config.h>
|
||||
|
||||
IMAGE_VERSION 2
|
||||
#ifdef CONFIG_IMX_HAB
|
||||
CSF CONFIG_CSF_SIZE
|
||||
#endif
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* DDR initialization came from Phytec */
|
||||
DATA 4 0x30340004 0x4F400005
|
||||
DATA 4 0x30360388 0x40000000
|
||||
DATA 4 0x30360384 0x40000000
|
||||
DATA 4 0x30391000 0x00000002
|
||||
DATA 4 0x307a0000 0x01040001
|
||||
DATA 4 0x307a01a0 0x80400003
|
||||
DATA 4 0x307a01a4 0x00100020
|
||||
DATA 4 0x307a01a8 0x80100004
|
||||
DATA 4 0x307a0064 0x0040002b
|
||||
DATA 4 0x307a0490 0x00000001
|
||||
DATA 4 0x307a00d0 0x00020083
|
||||
DATA 4 0x307a00d4 0x00690000
|
||||
DATA 4 0x307a00dc 0x09300004
|
||||
DATA 4 0x307a00e0 0x04080000
|
||||
DATA 4 0x307a00e4 0x00100004
|
||||
DATA 4 0x307a00f4 0x0000033f
|
||||
DATA 4 0x307a0100 0x090b1109
|
||||
DATA 4 0x307a0104 0x0007020d
|
||||
DATA 4 0x307a0108 0x03040407
|
||||
DATA 4 0x307a010c 0x00002006
|
||||
DATA 4 0x307a0110 0x04020205
|
||||
DATA 4 0x307a0114 0x03030202
|
||||
DATA 4 0x307a0120 0x00000802
|
||||
DATA 4 0x307a0180 0x00800020
|
||||
DATA 4 0x307a0184 0x02000100
|
||||
DATA 4 0x307a0190 0x02098204
|
||||
DATA 4 0x307a0194 0x00030303
|
||||
DATA 4 0x307a0200 0x00001f15
|
||||
DATA 4 0x307a0204 0x00080808
|
||||
DATA 4 0x307a0210 0x00000f0f
|
||||
DATA 4 0x307a0214 0x07070707
|
||||
DATA 4 0x307a0218 0x0f0f0707
|
||||
DATA 4 0x307a0240 0x06000604
|
||||
DATA 4 0x307a0244 0x00000001
|
||||
DATA 4 0x30391000 0x00000000
|
||||
DATA 4 0x30790000 0x17420f40
|
||||
DATA 4 0x30790004 0x10210100
|
||||
DATA 4 0x30790010 0x00060807
|
||||
DATA 4 0x307900b0 0x1010007e
|
||||
DATA 4 0x3079009c 0x00000d6e
|
||||
DATA 4 0x30790020 0x0a0a0a0a
|
||||
DATA 4 0x30790030 0x06060606
|
||||
DATA 4 0x30790050 0x01000010
|
||||
DATA 4 0x30790050 0x00000010
|
||||
DATA 4 0x307900c0 0x0e407304
|
||||
DATA 4 0x307900c0 0x0e447304
|
||||
DATA 4 0x307900c0 0x0e447306
|
||||
CHECK_BITS_SET 4 0x307900c4 0x1
|
||||
DATA 4 0x307900c0 0x0e447304
|
||||
DATA 4 0x307900c0 0x0e407304
|
||||
DATA 4 0x30384130 0x00000000
|
||||
DATA 4 0x30340020 0x00000178
|
||||
DATA 4 0x30384130 0x00000002
|
||||
DATA 4 0x30790018 0x0000000f
|
||||
CHECK_BITS_SET 4 0x307a0004 0x1
|
||||
95
board/storopack/smegw01/smegw01.c
Normal file
95
board/storopack/smegw01/smegw01.c
Normal file
@@ -0,0 +1,95 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
// Copyright (C) 2021 Fabio Estevam <festevam@denx.de>
|
||||
|
||||
#include <init.h>
|
||||
#include <net.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/arch/mx7-pins.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/mach-imx/hab.h>
|
||||
#include <asm/mach-imx/iomux-v3.h>
|
||||
#include <asm/io.h>
|
||||
#include <common.h>
|
||||
#include <env.h>
|
||||
#include <asm/arch/crm_regs.h>
|
||||
#include <asm/setup.h>
|
||||
#include <asm/bootm.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#define UART_PAD_CTRL (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU100KOHM | \
|
||||
PAD_CTL_HYS)
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
gd->ram_size = PHYS_SDRAM_SIZE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static iomux_v3_cfg_t const wdog_pads[] = {
|
||||
MX7D_PAD_GPIO1_IO00__WDOG1_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL),
|
||||
};
|
||||
|
||||
static iomux_v3_cfg_t const uart1_pads[] = {
|
||||
MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
|
||||
MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
|
||||
};
|
||||
|
||||
static void setup_iomux_uart(void)
|
||||
{
|
||||
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
|
||||
};
|
||||
|
||||
static int setup_fec(void)
|
||||
{
|
||||
struct iomuxc_gpr_base_regs *const iomuxc_gpr_regs =
|
||||
(struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
|
||||
int ret;
|
||||
|
||||
/* Use 125M anatop REF_CLK1 for ENET1, clear gpr1[13], gpr1[17]*/
|
||||
clrsetbits_le32(&iomuxc_gpr_regs->gpr[1],
|
||||
(IOMUXC_GPR_GPR1_GPR_ENET1_TX_CLK_SEL_MASK |
|
||||
IOMUXC_GPR_GPR1_GPR_ENET1_CLK_DIR_MASK), 0);
|
||||
|
||||
ret = set_clk_enet(ENET_125MHZ);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
setup_iomux_uart();
|
||||
setup_fec();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_init(void)
|
||||
{
|
||||
/* address of boot parameters */
|
||||
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
|
||||
|
||||
imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));
|
||||
|
||||
set_wdog_reset(wdog);
|
||||
|
||||
/*
|
||||
* Do not assert internal WDOG_RESET_B_DEB(controlled by bit 4),
|
||||
* since we use PMIC_PWRON to reset the board.
|
||||
*/
|
||||
clrsetbits_le16(&wdog->wcr, 0, 0x10);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -20,7 +20,7 @@ If the eMMC has already a U-Boot flashed then the user can
|
||||
go to step 2 below in order to update U-Boot.
|
||||
|
||||
Put pico board in USB download mode (Refer to the following link for details:
|
||||
https://www.technexion.com/support/knowledgebase/boot-configuration-settings-for-pico-baseboards/).
|
||||
https://developer.technexion.com/docs/pico-evaluation-kit-boot-mode-settings )
|
||||
|
||||
Connect a USB to serial adapter between the host PC and pico.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user