Merge branch '2022-01-06-assorted-important-fixes'

- Revert a clk change, to enable some platforms to work again
- Updates to the udoo NEO family of boards to work correctly
- Fix SiFive Unleashes/Unmatched boards booting
- Update rockchip maintainer entry
This commit is contained in:
Tom Rini 2022-01-07 09:30:59 -05:00
commit a14af7216a
9 changed files with 124 additions and 71 deletions

View file

@ -1,7 +0,0 @@
// SPDX-License-Identifier: GPL-2.0+
/ {
aliases {
mmc0 = &usdhc2;
};
};

View file

@ -117,7 +117,7 @@ int misc_init_r(void)
void *board_fdt_blob_setup(int *err)
{
*err = 0;
if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
if (gd->arch.firmware_fdt_addr)
return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
}

View file

@ -14,7 +14,7 @@
void *board_fdt_blob_setup(int *err)
{
*err = 0;
if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
if (gd->arch.firmware_fdt_addr)
return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
}

View file

@ -1,5 +1,5 @@
LION-RK3368 (RK3368-uQ7 system-on-module)
M: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
M: Quentin Schulz <quentin.schulz@theobroma-systems.com>
M: Klaus Goger <klaus.goger@theobroma-systems.com>
S: Maintained
F: board/theobroma-systems/lion_rk3368

View file

@ -1,5 +1,5 @@
PUMA-RK3399
M: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
M: Quentin Schulz <quentin.schulz@theobroma-systems.com>
M: Klaus Goger <klaus.goger@theobroma-systems.com>
S: Maintained
F: board/theobroma-systems/puma_rk3399

View file

@ -19,6 +19,8 @@
#include <asm/mach-imx/iomux-v3.h>
#include <dm.h>
#include <env.h>
#include <mmc.h>
#include <fsl_esdhc_imx.h>
#include <asm/arch/crm_regs.h>
#include <asm/io.h>
#include <asm/mach-imx/mxc_i2c.h>
@ -73,6 +75,8 @@ enum {
#define BOARD_DETECT_PAD_CFG (MUX_PAD_CTRL(BOARD_DETECT_PAD_CTRL) | \
MUX_MODE_SION)
#define OCRAM_START 0x8f8000
int dram_init(void)
{
gd->ram_size = imx_ddr_size();
@ -214,19 +218,25 @@ static iomux_v3_cfg_t const uart1_pads[] = {
MX6_PAD_GPIO1_IO05__UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
};
static iomux_v3_cfg_t const usdhc2_pads[] = {
MX6_PAD_SD2_CLK__USDHC2_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL),
MX6_PAD_SD2_CMD__USDHC2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
MX6_PAD_SD2_DATA0__USDHC2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
MX6_PAD_SD2_DATA1__USDHC2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
MX6_PAD_SD2_DATA2__USDHC2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
MX6_PAD_SD2_DATA3__USDHC2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
/* CD pin */
MX6_PAD_SD1_DATA0__GPIO6_IO_2 | MUX_PAD_CTRL(NO_PAD_CTRL),
/* Power */
MX6_PAD_SD1_CMD__GPIO6_IO_1 | MUX_PAD_CTRL(NO_PAD_CTRL),
};
static iomux_v3_cfg_t const phy_control_pads[] = {
/* 25MHz Ethernet PHY Clock */
MX6_PAD_ENET2_RX_CLK__ENET2_REF_CLK_25M |
MUX_PAD_CTRL(ENET_CLK_PAD_CTRL),
};
static iomux_v3_cfg_t const board_recognition_pads[] = {
/*Connected to R184*/
MX6_PAD_NAND_READY_B__GPIO4_IO_13 | BOARD_DETECT_PAD_CFG,
/*Connected to R185*/
MX6_PAD_NAND_ALE__GPIO4_IO_0 | BOARD_DETECT_PAD_CFG,
};
static iomux_v3_cfg_t const wdog_b_pad = {
MX6_PAD_GPIO1_IO13__GPIO1_IO_13 | MUX_PAD_CTRL(WDOG_PAD_CTRL),
};
@ -249,6 +259,7 @@ static int setup_fec(void)
ARRAY_SIZE(phy_control_pads));
/* Reset PHY */
gpio_request(IMX_GPIO_NR(2, 1), "enet_rst");
gpio_direction_output(IMX_GPIO_NR(2, 1) , 0);
udelay(10000);
gpio_set_value(IMX_GPIO_NR(2, 1), 1);
@ -280,15 +291,97 @@ int board_init(void)
ARRAY_SIZE(peri_3v3_pads));
/* Active high for ncp692 */
gpio_request(IMX_GPIO_NR(4, 16), "ncp692");
gpio_direction_output(IMX_GPIO_NR(4, 16) , 1);
#ifdef CONFIG_SYS_I2C_MXC
setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
#endif
setup_fec();
return 0;
}
int board_early_init_f(void)
{
setup_iomux_uart();
return 0;
}
static struct fsl_esdhc_cfg usdhc_cfg[1] = {
{USDHC2_BASE_ADDR},
};
#define USDHC2_PWR_GPIO IMX_GPIO_NR(6, 1)
#define USDHC2_CD_GPIO IMX_GPIO_NR(6, 2)
int board_mmc_getcd(struct mmc *mmc)
{
return !gpio_get_value(USDHC2_CD_GPIO);
}
int board_mmc_init(struct bd_info *bis)
{
SETUP_IOMUX_PADS(usdhc2_pads);
usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
usdhc_cfg[0].max_bus_width = 4;
gpio_request(IMX_GPIO_NR(6, 1), "usdhc2_pwr");
gpio_request(IMX_GPIO_NR(6, 2), "usdhc2_cd");
gpio_direction_input(USDHC2_CD_GPIO);
gpio_direction_output(USDHC2_PWR_GPIO, 1);
return fsl_esdhc_initialize(bis, &usdhc_cfg[0]);
}
static char *board_string(int type)
{
switch (type) {
case UDOO_NEO_TYPE_BASIC:
return "BASIC";
case UDOO_NEO_TYPE_BASIC_KS:
return "BASICKS";
case UDOO_NEO_TYPE_FULL:
return "FULL";
case UDOO_NEO_TYPE_EXTENDED:
return "EXTENDED";
}
return "UNDEFINED";
}
/* Override the default implementation, DT model is not accurate */
int show_board_info(void)
{
int *board_type = (int *)OCRAM_START;
printf("Board: UDOO Neo %s\n", board_string(*board_type));
return 0;
}
int board_late_init(void)
{
int *board_type = (int *)OCRAM_START;
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
env_set("board_name", board_string(*board_type));
#endif
return 0;
}
#ifdef CONFIG_SPL_BUILD
#include <linux/libfdt.h>
#include <asm/arch/mx6-ddr.h>
static const iomux_v3_cfg_t board_recognition_pads[] = {
/*Connected to R184*/
MX6_PAD_NAND_READY_B__GPIO4_IO_13 | BOARD_DETECT_PAD_CFG,
/*Connected to R185*/
MX6_PAD_NAND_ALE__GPIO4_IO_0 | BOARD_DETECT_PAD_CFG,
};
static int get_board_value(void)
{
int r184, r185;
@ -296,6 +389,8 @@ static int get_board_value(void)
imx_iomux_v3_setup_multiple_pads(board_recognition_pads,
ARRAY_SIZE(board_recognition_pads));
gpio_request(IMX_GPIO_NR(4, 13), "r184");
gpio_request(IMX_GPIO_NR(4, 0), "r185");
gpio_direction_input(IMX_GPIO_NR(4, 13));
gpio_direction_input(IMX_GPIO_NR(4, 0));
@ -315,49 +410,6 @@ static int get_board_value(void)
return (r184 << 1) + r185;
}
int board_early_init_f(void)
{
setup_iomux_uart();
setup_fec();
return 0;
}
static char *board_string(void)
{
switch (get_board_value()) {
case UDOO_NEO_TYPE_BASIC:
return "BASIC";
case UDOO_NEO_TYPE_BASIC_KS:
return "BASICKS";
case UDOO_NEO_TYPE_FULL:
return "FULL";
case UDOO_NEO_TYPE_EXTENDED:
return "EXTENDED";
}
return "UNDEFINED";
}
int checkboard(void)
{
printf("Board: UDOO Neo %s\n", board_string());
return 0;
}
int board_late_init(void)
{
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
env_set("board_name", board_string());
#endif
return 0;
}
#ifdef CONFIG_SPL_BUILD
#include <linux/libfdt.h>
#include <asm/arch/mx6-ddr.h>
static const struct mx6sx_iomux_ddr_regs mx6_ddr_ioregs = {
.dram_dqm0 = 0x00000028,
.dram_dqm1 = 0x00000028,
@ -453,7 +505,7 @@ static void ccgr_init(void)
static void spl_dram_init(void)
{
int board = get_board_value();
int *board_type = (int *)OCRAM_START;
struct mx6_ddr_sysinfo sysinfo = {
.dsize = 1, /* width of data bus: 1 = 32 bits */
@ -470,8 +522,11 @@ static void spl_dram_init(void)
.rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */
};
*board_type = get_board_value();
mx6sx_dram_iocfg(32, &mx6_ddr_ioregs, &mx6_grp_ioregs);
if (board == UDOO_NEO_TYPE_BASIC || board == UDOO_NEO_TYPE_BASIC_KS)
if (*board_type == UDOO_NEO_TYPE_BASIC ||
*board_type == UDOO_NEO_TYPE_BASIC_KS)
mx6_dram_cfg(&sysinfo, &neo_basic_mmcd_calib,
&neo_basic_mem_ddr);
else

View file

@ -27,6 +27,7 @@ CONFIG_SPL_FS_EXT4=y
CONFIG_SPL_WATCHDOG=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
# CONFIG_CMD_PINMUX is not set
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_CACHE=y
@ -35,6 +36,7 @@ CONFIG_CMD_EXT4_WRITE=y
CONFIG_OF_CONTROL=y
CONFIG_ENV_OVERWRITE=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_SYS_MMC_ENV_DEV=1
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_BOUNCE_BUFFER=y
CONFIG_SYS_I2C_LEGACY=y
@ -45,12 +47,18 @@ CONFIG_PHYLIB=y
CONFIG_PHY_MICREL=y
CONFIG_PHY_MICREL_KSZ8XXX=y
CONFIG_DM_ETH=y
CONFIG_DM_MDIO=y
CONFIG_FEC_MXC=y
CONFIG_RGMII=y
CONFIG_MII=y
CONFIG_PINCTRL=y
CONFIG_PINCTRL_IMX6=y
CONFIG_POWER_LEGACY=y
CONFIG_POWER_I2C=y
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_ANATOP=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_USB_STORAGE=y
CONFIG_MXC_UART=y
CONFIG_IMX_THERMAL=y

View file

@ -846,17 +846,13 @@ void devm_clk_put(struct udevice *dev, struct clk *clk)
int clk_uclass_post_probe(struct udevice *dev)
{
int ret;
/*
* when a clock provider is probed. Call clk_set_defaults()
* also after the device is probed. This takes care of cases
* where the DT is used to setup default parents and rates
* using assigned-clocks
*/
ret = clk_set_defaults(dev, CLK_DEFAULTS_POST);
if (ret)
return log_ret(ret);
clk_set_defaults(dev, CLK_DEFAULTS_POST);
return 0;
}

View file

@ -29,7 +29,7 @@
"fdt_addr=0x83000000\0" \
"fdt_addr_r=0x83000000\0" \
"ip_dyn=yes\0" \
"mmcdev=0\0" \
"mmcdev=1\0" \
"mmcrootfstype=ext4\0" \
"findfdt="\
"if test $board_name = BASIC; then " \
@ -49,7 +49,8 @@
BOOTENV
#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 0) \
func(MMC, mmc, 1) \
func(USB, usb, 0) \
func(DHCP, dhcp, na)
#include <config_distro_bootcmd.h>