[U-Boot] [PATCH v1 1/4] kconfig: Update comment regarding CONFIG_IS_ENABLED(FOO) for TPL
This patch adds some commit info for CONFIG_IS_ENABLED(FOO) when used in TPL context. Signed-off-by: Lukasz Majewski --- include/linux/kconfig.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h index fbfc7188b8..3a2da738c4 100644 --- a/include/linux/kconfig.h +++ b/include/linux/kconfig.h @@ -75,6 +75,7 @@ * CONFIG_VAL(FOO) evaluates to the value of * CONFIG_FOO if CONFIG_SPL_BUILD is undefined, * CONFIG_SPL_FOO if CONFIG_SPL_BUILD is defined. + * CONFIG_TPL_FOO if CONFIG_TPL_BUILD is defined. */ #define CONFIG_VAL(option) config_val(option) @@ -82,6 +83,7 @@ * CONFIG_IS_ENABLED(FOO) evaluates to * 1 if CONFIG_SPL_BUILD is undefined and CONFIG_FOO is set to 'y' or 'm', * 1 if CONFIG_SPL_BUILD is defined and CONFIG_SPL_FOO is set to 'y' or 'm', + * 1 if CONFIG_TPL_BUILD is defined and CONFIG_TPL_FOO is set to 'y' or 'm', * 0 otherwise. */ #define CONFIG_IS_ENABLED(option) \ -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v1 3/4] spi: Move DM_SPI_FLASH and SPI_FLASH_DATAFLASH to Kconfig (for ls1021aXXX)
This patch moves the CONFIG_DM_SPI_FLASH and CONFIG_SPI_FLASH_DATAFLASH to be defined in Kconfig, not in board specific header file (include/configs/.h). Before this change the CONFIG_DM_SPI_FLASH was not set in .config (so it was not possible to use CONFIG_IS_ENABLED(DM_SPI_FLASH) in SPI DM/DTS converted drivers), but it was set in u-boot.cfg file. Signed-off-by: Lukasz Majewski --- arch/arm/Kconfig | 6 -- include/configs/ls1021aiot.h | 6 -- include/configs/ls1021aqds.h | 8 include/configs/ls1021atwr.h | 5 - 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 656ac9c543..f10ca68511 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1341,6 +1341,8 @@ config TARGET_LS1021AQDS select SUPPORT_SPL select SYS_FSL_DDR select FSL_DDR_INTERACTIVE + select DM_SPI_FLASH if FSL_DSPI || FSL_QSPI + select SPI_FLASH_DATAFLASH if FSL_DSPI || FSL_QSPI imply SCSI config TARGET_LS1021ATWR @@ -1354,6 +1356,7 @@ config TARGET_LS1021ATWR select CPU_V7_HAS_VIRT select LS1_DEEP_SLEEP select SUPPORT_SPL + select DM_SPI_FLASH if FSL_DSPI || FSL_QSPI imply SCSI config TARGET_LS1021ATSN @@ -1378,6 +1381,7 @@ config TARGET_LS1021AIOT select CPU_V7_HAS_NONSEC select CPU_V7_HAS_VIRT select SUPPORT_SPL + select DM_SPI_FLASH if FSL_DSPI || FSL_QSPI imply SCSI help Support for Freescale LS1021AIOT platform. @@ -1811,5 +1815,3 @@ config SPL_LDSCRIPT default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if (ARCH_MX23 || ARCH_MX28) && !SPL_FRAMEWORK default "arch/arm/cpu/arm1136/u-boot-spl.lds" if CPU_ARM1136 default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64 - - diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h index ee570bc1a9..0ab1fb17a6 100644 --- a/include/configs/ls1021aiot.h +++ b/include/configs/ls1021aiot.h @@ -139,12 +139,6 @@ #define CONFIG_SPI_FLASH_SPANSION #endif -/* DM SPI */ -#if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI) -#define CONFIG_CMD_SF -#define CONFIG_DM_SPI_FLASH -#endif - /* * eTSEC */ diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h index 66771e279b..e2529dfb9c 100644 --- a/include/configs/ls1021aqds.h +++ b/include/configs/ls1021aqds.h @@ -363,14 +363,6 @@ unsigned long get_board_ddr_clk(void); #define QSPI0_AMBA_BASE0x4000 #define FSL_QSPI_FLASH_SIZE(1 << 24) #define FSL_QSPI_FLASH_NUM 2 - -/* DSPI */ - -/* DM SPI */ -#if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI) -#define CONFIG_DM_SPI_FLASH -#define CONFIG_SPI_FLASH_DATAFLASH -#endif #endif /* diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h index 31abee81ed..397afb668b 100644 --- a/include/configs/ls1021atwr.h +++ b/include/configs/ls1021atwr.h @@ -238,11 +238,6 @@ /* DSPI */ #endif -/* DM SPI */ -#if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI) -#define CONFIG_DM_SPI_FLASH -#endif - /* * Video */ -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v1 4/4] spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*
This change allows more fine tuning of driver model based SPI support in SPL and TPL. It is now possible to explicitly enable/disable the DM_SPI support in SPL and TPL via Kconfig option. Before this change it was necessary to use: /* SPI Flash Configs */ #if defined(CONFIG_SPL_BUILD) #undef CONFIG_DM_SPI #undef CONFIG_DM_SPI_FLASH #undef CONFIG_SPI_FLASH_MTD #endif in the ./include/configs/.h, which is error prone and shall be avoided when we strive to switch to Kconfig. The goal of this patch: Provide distinction for DM_SPI support in both U-Boot proper and SPL (TPL). Valid use case is when U-Boot proper wants to use DM_SPI, but SPL must still support non DM driver. Another use case is the conversion of non DM/DTS SPI driver to support DM/DTS. When such driver needs to work in both SPL and U-Boot proper, the distinction is needed in Kconfig (also if SPL version of the driver supports OF_PLATDATA). In the end of the day one would have to support following use cases (in single driver file - e.g. mxs_spi.c): - U-Boot proper driver supporting DT/DTS - U-Boot proper driver without DT/DTS support (deprecated) - SPL driver without DT/DTS support - SPL (and TPL) driver with DT/DTS (when the SoC has enough resources to run full blown DT/DTS) - SPL driver with DT/DTS and SPL_OF_PLATDATA (when one have constrained environment with no fitImage and OF_LIBFDT support). Some boards do require SPI support (with DM) in SPL (TPL) and some only have DM_SPI{_FLASH} defined to allow compiling SPL. This patch converts #ifdef CONFIG_DM_SPI* to #if CONFIG_IS_ENABLED(DM_SPI) and provides corresponding defines in Kconfig. Signed-off-by: Lukasz Majewski --- === BIG FAT NOTE (REQUEST FOR TESTING): === The adjustments were done only to make the buildman / travis-CI build clean. Board maintainers are kindly ask to check if there are no failures on boards booting (or unintentional increase of binary size). Note: = Some boards require adjustments in ./configs/_defconfig (like Siemens). Other boards require modification in arch/arm/Kconfig (like MVEBU) Yet another ones - like ones from Samsung - doesn't use SPL at all. There are also boards - like i.MX{25678} - which (till now) doesn't use SPI drivers supporting DM in their SPL. Applied on top of -master branch: 'commit feb5a02f869d ("Merge branch 'master' of git://git.denx.de/u-boot-sh")' Travis-CI (clean build): https://travis-ci.org/lmajewski/u-boot-dfu/builds/570594278 --- arch/arm/Kconfig| 13 + board/l+g/vinco/vinco.c | 4 ++-- cmd/sf.c| 4 ++-- cmd/spi.c | 6 +++--- common/spl/Kconfig | 28 configs/am57xx_evm_defconfig| 2 ++ configs/am57xx_hs_evm_defconfig | 2 ++ configs/am57xx_hs_evm_usb_defconfig | 2 ++ configs/axm_defconfig | 2 ++ configs/chromebook_link64_defconfig | 2 ++ configs/chromebook_samus_tpl_defconfig | 4 configs/dra7xx_evm_defconfig| 2 ++ configs/dra7xx_hs_evm_defconfig | 2 ++ configs/dra7xx_hs_evm_usb_defconfig | 2 ++ configs/imx28_xea_defconfig | 2 ++ configs/j721e_evm_a72_defconfig | 2 ++ configs/j721e_evm_r5_defconfig | 2 ++ configs/ls1021aiot_qspi_defconfig | 2 ++ configs/ls1021aiot_sdcard_defconfig | 2 ++ configs/ls1021aqds_qspi_defconfig | 1 + configs/ls1021aqds_sdcard_qspi_defconfig| 1 + configs/ls1021atwr_qspi_defconfig | 1 + configs/sama5d2_xplained_spiflash_defconfig | 2 ++ configs/sama5d3xek_spiflash_defconfig | 7 --- configs/sama5d4_xplained_spiflash_defconfig | 2 ++ configs/sama5d4ek_spiflash_defconfig| 2 ++ configs/stm32mp15_basic_defconfig | 2 ++ configs/taurus_defconfig| 2 ++ drivers/mtd/spi/Makefile| 4 ++-- drivers/mtd/spi/sf_probe.c | 8 drivers/net/fm/fm.c | 4 ++-- drivers/spi/Makefile| 2 +- drivers/spi/atmel_spi.c | 4 ++-- drivers/spi/davinci_spi.c | 6 +++--- drivers/spi/fsl_dspi.c | 5 +++-- drivers/spi/kirkwood_spi.c | 2 +- drivers/spi/mxc_spi.c | 6 +++--- drivers/spi/omap3_spi.c | 4 ++-- drivers/spi/sh_qspi.c | 4 ++-- env/sf.c| 2 +- include/spi.h | 8 include/spi_flash.h | 2 +- test/dm/spi.c | 2 +- 43 files changed, 127 insertions(+), 41 deletions(-) diff --git a/arch/arm/Kconf
[U-Boot] [PATCH v1 2/4] spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a)
This patch fixes issue with defining the DM_SPI_FLASH in the configs/include/ instead of enabling this option in Kconfig. The problem is that CONFIG_IS_ENABLED(DM_SPI_FLASH) shows false as there is no DM_SPI_FLASH=y in .config (but the define is set in u-boot.cfg). As a result conversion of DM_SPI_FLASH to using CONFIG_IS_ENABLED() is not working properly. Signed-off-by: Lukasz Majewski --- arch/arm/Kconfig | 4 include/configs/ls1043a_common.h | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 3f0e301d41..656ac9c543 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1395,6 +1395,8 @@ config TARGET_LS1043AQDS select BOARD_LATE_INIT select SUPPORT_SPL select FSL_DDR_INTERACTIVE if !SPL + select FSL_DSPI if !SPL + select DM_SPI_FLASH if FSL_DSPI imply SCSI imply SCSI_AHCI help @@ -1409,6 +1411,8 @@ config TARGET_LS1043ARDB select BOARD_EARLY_INIT_F select BOARD_LATE_INIT select SUPPORT_SPL + select FSL_DSPI if !SPL + select DM_SPI_FLASH if FSL_DSPI help Support for Freescale LS1043ARDB platform. diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h index 70447a2183..fd8bf705cd 100644 --- a/include/configs/ls1043a_common.h +++ b/include/configs/ls1043a_common.h @@ -165,9 +165,7 @@ /* DSPI */ #ifndef SPL_NO_DSPI -#define CONFIG_FSL_DSPI #ifdef CONFIG_FSL_DSPI -#define CONFIG_DM_SPI_FLASH #define CONFIG_SPI_FLASH_STMICRO /* cs0 */ #define CONFIG_SPI_FLASH_SST /* cs1 */ #define CONFIG_SPI_FLASH_EON /* cs2 */ -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 1/5] doc: fix: Replace SPL_OF_PLATDATA with OF_PLATDATA in examples
The of-plat.rst file till this change has been using #if CONFIG_IS_ENABLED(SPL_OF_PLATDATA) it its examples. This is at best misleading as SPL_OF_PLATDATA is always defined when we want to use this SPL tinification feature (also in U-Boot proper). As a result the OF_PLATDATA SPL specific code is also compiled in when U-Boot proper is build. Signed-off-by: Lukasz Majewski --- doc/driver-model/of-plat.rst | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/driver-model/of-plat.rst b/doc/driver-model/of-plat.rst index 0d3cd8c01e..a38e58e4d2 100644 --- a/doc/driver-model/of-plat.rst +++ b/doc/driver-model/of-plat.rst @@ -224,7 +224,7 @@ For example: #include struct mmc_platdata { -#if CONFIG_IS_ENABLED(SPL_OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_PLATDATA) /* Put this first since driver model will copy the data here */ struct dtd_mmc dtplat; #endif @@ -237,7 +237,7 @@ For example: static int mmc_ofdata_to_platdata(struct udevice *dev) { -#if !CONFIG_IS_ENABLED(SPL_OF_PLATDATA) +#if !CONFIG_IS_ENABLED(OF_PLATDATA) /* Decode the device tree data */ struct mmc_platdata *plat = dev_get_platdata(dev); const void *blob = gd->fdt_blob; @@ -253,7 +253,7 @@ For example: { struct mmc_platdata *plat = dev_get_platdata(dev); -#if CONFIG_IS_ENABLED(SPL_OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_PLATDATA) /* Decode the of-platdata from the C structures */ struct dtd_mmc *dtplat = &plat->dtplat; @@ -308,7 +308,7 @@ The dt-structs.h file includes the generated file (include/generated//dt-structs.h) if CONFIG_SPL_OF_PLATDATA is enabled. Otherwise (such as in U-Boot proper) these structs are not available. This prevents them being used inadvertently. All usage must be bracketed with -#if CONFIG_IS_ENABLED(SPL_OF_PLATDATA). +#if CONFIG_IS_ENABLED(OF_PLATDATA). The dt-platdata.c file contains the device declarations and is is built in spl/dt-platdata.c. -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 4/5] spi: Add support for SPL_OF_PLATDATA to mxs_spi.c driver
After this patch the mxs_spi.c DM/DTS driver can be used at early SPL to read payload from SPI-NOR memories. It was necessary to adjust its name to 'fsl_imx_2{38}_spi' to match requirements for SPL_OF_PLATDATA usage. Signed-off-by: Lukasz Majewski --- drivers/spi/mxs_spi.c | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index b79a72db2b..051263663d 100644 --- a/drivers/spi/mxs_spi.c +++ b/drivers/spi/mxs_spi.c @@ -57,7 +57,18 @@ static inline struct mxs_spi_slave *to_mxs_slave(struct spi_slave *slave) #else #include #include +#include + +#ifdef CONFIG_MX28 +#define dtd_fsl_imx_spi dtd_fsl_imx28_spi +#else /* CONFIG_MX23 */ +#define dtd_fsl_imx_spi dtd_fsl_imx23_spi +#endif + struct mxs_spi_platdata { +#if CONFIG_IS_ENABLED(OF_PLATDATA) + struct dtd_fsl_imx_spi dtplat; +#endif s32 frequency; /* Default clock frequency, -1 for none */ fdt_addr_t base;/* SPI IP block base address */ int num_cs; /* Number of CSes supported */ @@ -430,11 +441,26 @@ static int mxs_spi_probe(struct udevice *bus) int ret; debug("%s: probe\n", __func__); + +#if CONFIG_IS_ENABLED(OF_PLATDATA) + struct dtd_fsl_imx_spi *dtplat = &plat->dtplat; + struct phandle_1_arg *p1a = &dtplat->clocks[0]; + + priv->regs = (struct mxs_ssp_regs *)dtplat->reg[0]; + priv->dma_channel = dtplat->dmas[1]; + priv->clk_id = p1a->arg[0]; + priv->max_freq = dtplat->spi_max_frequency; + plat->num_cs = dtplat->num_cs; + + debug("OF_PLATDATA: regs: 0x%x max freq: %d clkid: %d\n", + (unsigned int)priv->regs, priv->max_freq, priv->clk_id); +#else priv->regs = (struct mxs_ssp_regs *)plat->base; priv->max_freq = plat->frequency; priv->dma_channel = plat->dma_id; priv->clk_id = plat->clk_id; +#endif mxs_reset_block(&priv->regs->hw_ssp_ctrl0_reg); @@ -571,16 +597,20 @@ static int mxs_ofdata_to_platdata(struct udevice *bus) return 0; } -#endif static const struct udevice_id mxs_spi_ids[] = { { .compatible = "fsl,imx23-spi" }, { .compatible = "fsl,imx28-spi" }, { } }; +#endif U_BOOT_DRIVER(mxs_spi) = { - .name = "mxs_spi", +#ifdef CONFIG_MX28 + .name = "fsl_imx28_spi", +#else /* CONFIG_MX23 */ + .name = "fsl_imx23_spi", +#endif .id = UCLASS_SPI, #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) .of_match = mxs_spi_ids, -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 3/5] spi: fix: Call mxs_reset_block() during DM/DTS probe
Without this change the DM/DTS version of mxs_spi driver doesn't reset the SPI IP block in probe. As a result this driver (when used solely on U-Boot proper) relies on reset performed by mxs spi driver in SPL. In the use case where eMMC is used in SPL as a boot primary device, the mxs_reset_block() is not called at all and DM/DTS aware SPI driver in U-Boot proper is malfunctioning. Signed-off-by: Lukasz Majewski --- drivers/spi/mxs_spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index 3a9756fbf1..b79a72db2b 100644 --- a/drivers/spi/mxs_spi.c +++ b/drivers/spi/mxs_spi.c @@ -436,6 +436,8 @@ static int mxs_spi_probe(struct udevice *bus) priv->dma_channel = plat->dma_id; priv->clk_id = plat->clk_id; + mxs_reset_block(&priv->regs->hw_ssp_ctrl0_reg); + ret = mxs_dma_init_channel(priv->dma_channel); if (ret) { printf("%s: DMA init channel error %d\n", __func__, ret); -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 2/5] dts: imx28: Remove #include "imx28.dtsi" from imx28-u-boot.dtsi file
After this change it is possible to use imx28--u-boot.dtsi with the imx28-u-boot.dtsi explicitly included without breaking setup from imx28-.dts file. The problem is that the imx28.dtsi included in a wrong place overrides the changes made in imx28-.dts. As a result some devices are "disabled" in the final DTB. Signed-off-by: Lukasz Majewski --- arch/arm/dts/imx28-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/dts/imx28-u-boot.dtsi b/arch/arm/dts/imx28-u-boot.dtsi index d545b402a7..9db72a6be3 100644 --- a/arch/arm/dts/imx28-u-boot.dtsi +++ b/arch/arm/dts/imx28-u-boot.dtsi @@ -5,7 +5,6 @@ * * SPDX-License-Identifier: GPL-2.0+ or X11 */ -#include "imx28.dtsi" &gpio0 { gpio-ranges = <&pinctrl 0 0 29>; -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 5/5] mmc: Convert mxsmmc eMMC driver for i.MX2{38} to DM/DTS
This patch converts the mxsmmc driver to support DM/DTS. Moreover, it is also possible to use it in early SPL with SPL_OF_PLATDATA enabled. Signed-off-by: Lukasz Majewski --- drivers/mmc/mxsmmc.c | 439 +++ 1 file changed, 369 insertions(+), 70 deletions(-) diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c index 92db4ae5a6..a01f81e47e 100644 --- a/drivers/mmc/mxsmmc.c +++ b/drivers/mmc/mxsmmc.c @@ -2,6 +2,9 @@ /* * Freescale i.MX28 SSP MMC driver * + * Copyright (C) 2019 DENX Software Engineering + * Lukasz Majewski, DENX Software Engineering, lu...@denx.de + * * Copyright (C) 2011 Marek Vasut * on behalf of DENX Software Engineering GmbH * @@ -16,6 +19,7 @@ * (C) Copyright 2003 * Kyle Harris, Nexus Technologies, Inc. khar...@nexus-tech.net */ + #include #include #include @@ -27,19 +31,53 @@ #include #include +#defineMXSMMC_MAX_TIMEOUT 1 +#define MXSMMC_SMALL_TRANSFER 512 + +#if !CONFIG_IS_ENABLED(DM_MMC) struct mxsmmc_priv { int id; - struct mxs_ssp_regs *regs; - uint32_tbuswidth; int (*mmc_is_wp)(int); int (*mmc_cd)(int); - struct mxs_dma_desc *desc; struct mmc_config cfg;/* mmc configuration */ + struct mxs_dma_desc *desc; + uint32_tbuswidth; + struct mxs_ssp_regs *regs; }; +#else /* CONFIG_IS_ENABLED(DM_MMC) */ +#include +#include +#include + +#ifdef CONFIG_MX28 +#define dtd_fsl_imx_mmc dtd_fsl_imx28_mmc +#else /* CONFIG_MX23 */ +#define dtd_fsl_imx_mmc dtd_fsl_imx23_mmc +#endif -#defineMXSMMC_MAX_TIMEOUT 1 -#define MXSMMC_SMALL_TRANSFER 512 +struct mxsmmc_platdata { +#if CONFIG_IS_ENABLED(OF_PLATDATA) + struct dtd_fsl_imx_mmc dtplat; +#endif + struct mmc_config cfg; + struct mmc mmc; + fdt_addr_t base; + int non_removable; + int buswidth; + int dma_id; + int clk_id; +}; +struct mxsmmc_priv { + int clkid; + struct mxs_dma_desc *desc; + u32 buswidth; + struct mxs_ssp_regs *regs; + unsigned intdma_channel; +}; +#endif + +#if !CONFIG_IS_ENABLED(DM_MMC) static int mxsmmc_cd(struct mxsmmc_priv *priv) { struct mxs_ssp_regs *ssp_regs = priv->regs; @@ -50,6 +88,131 @@ static int mxsmmc_cd(struct mxsmmc_priv *priv) return !(readl(&ssp_regs->hw_ssp_status) & SSP_STATUS_CARD_DETECT); } +static const struct mmc_ops mxsmmc_ops = { + .send_cmd = mxsmmc_send_cmd, + .set_ios= mxsmmc_set_ios, + .init = mxsmmc_init, +}; + +static int mxsmmc_set_ios(struct mmc *mmc) +{ + struct mxs_ssp_regs *ssp_regs = priv->regs; + + /* Set the clock speed */ + if (mmc->clock) + mxs_set_ssp_busclock(priv->id, mmc->clock / 1000); + + switch (mmc->bus_width) { + case 1: + priv->buswidth = SSP_CTRL0_BUS_WIDTH_ONE_BIT; + break; + case 4: + priv->buswidth = SSP_CTRL0_BUS_WIDTH_FOUR_BIT; + break; + case 8: + priv->buswidth = SSP_CTRL0_BUS_WIDTH_EIGHT_BIT; + break; + } + + /* Set the bus width */ + clrsetbits_le32(&ssp_regs->hw_ssp_ctrl0, + SSP_CTRL0_BUS_WIDTH_MASK, priv->buswidth); + + debug("MMC%d: Set %d bits bus width\n", + mmc->block_dev.devnum, mmc->bus_width); + + return 0; +} + +static int mxsmmc_init(struct mmc *mmc) +{ + struct mxsmmc_priv *priv = mmc->priv; + struct mxs_ssp_regs *ssp_regs = priv->regs; + + /* Reset SSP */ + mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg); + + /* Reconfigure the SSP block for MMC operation */ + writel(SSP_CTRL1_SSP_MODE_SD_MMC | + SSP_CTRL1_WORD_LENGTH_EIGHT_BITS | + SSP_CTRL1_DMA_ENABLE | + SSP_CTRL1_POLARITY | + SSP_CTRL1_RECV_TIMEOUT_IRQ_EN | + SSP_CTRL1_DATA_CRC_IRQ_EN | + SSP_CTRL1_DATA_TIMEOUT_IRQ_EN | + SSP_CTRL1_RESP_TIMEOUT_IRQ_EN | + SSP_CTRL1_RESP_ERR_IRQ_EN, + &ssp_regs->hw_ssp_ctrl1_set); + + /* Set initial bit clock 400 KHz */ + mxs_set_ssp_busclock(priv->id, 400); + + /* Send initial 74 clock cycles (185 us @ 400 KHz)*/ + writel(SSP_CMD0_CONT_CLKING_EN, &ssp_regs->hw_ssp_cmd0_set); + udelay(200); + writel(SSP_CMD0_CONT_CLKING_EN, &ssp_regs->hw_ssp_cmd0_clr); + + return 0; +} + +int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int), int (*cd)(int)) +{ + struct mmc *mmc = NULL; + struct mxsmmc_priv *priv = NULL; + int ret; + const unsigned int mxsmmc_clk_id = mxs_ssp_clock_by_bus(id); + + if (!mxs_ssp_bus_id_valid(id)) + return -ENODEV; + + priv
Re: [U-Boot] [U-BOOT PATCH] riscv: sifive: fu540: set serial environment variable from otp
On Mon, Aug 12, 2019 at 12:12 PM Sagar Shrikant Kadam wrote: > > This patch sets the serial# environment variable by reading the > board serial number from the OTP memory region. > > Signed-off-by: Sagar Shrikant Kadam > --- > board/sifive/fu540/fu540.c | 18 ++ > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c > index 11daf1a..06bf442 100644 > --- a/board/sifive/fu540/fu540.c > +++ b/board/sifive/fu540/fu540.c > @@ -122,10 +122,20 @@ static void fu540_setup_macaddr(u32 serialnum) > > int misc_init_r(void) > { > - /* Set ethaddr environment variable if not set */ > - if (!env_get("ethaddr")) > - fu540_setup_macaddr(fu540_read_serialnum()); > - > + u32 serial_num; > + char buf[11] = {0}; > + > + /* Set ethaddr environment variable from board serial number */ > + if (!env_get("serial#")) { > + serial_num = fu540_read_serialnum(); > + if (!serial_num) { > + WARN(1, "Board serial number should not be 0 !!"); > + return 0; > + } > + snprintf(buf, sizeof(buf), "%08x", serial_num); > + env_set("serial#", buf); > + fu540_setup_macaddr(serial_num); > + } > return 0; > } > > -- > 2.7.4 > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > https://lists.denx.de/listinfo/u-boot Looks good to me. Reviewed-by: Anup Patel Regards, Anup ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 5/7] boards: meson: add g12a sei510
On 06/08/2019 17:43, Neil Armstrong wrote: > From: Jerome Brunet > > The SEI510 board is based on the Amlogic S905X2 SoC > from the Amlogic G12A SoC family. > > The board has the following specifications : > - Amlogic S905X2 ARM Cortex-A53 quad-core SoC > - XGB DDR4 SDRAM > - 10/100 Ethernet (Internal PHY) > - 1 x USB 3.0 Host > - eMMC > - SDcard > - Infrared receiver > - SDIO WiFi Module > > The board default behaviour is for booting Android and triggers > fastboot on recovery or reboot mode. > > USB vendor ID (used by fastboot) is 0x18d1 (Google) for > default udev rules for existing android users work out of the box. > > Signed-off-by: Kevin Hilman > Signed-off-by: Jerome Brunet > Signed-off-by: Guillaume La Roque > Signed-off-by: Neil Armstrong > --- > board/amlogic/sei510/MAINTAINERS | 5 ++ > board/amlogic/sei510/Makefile| 6 ++ > board/amlogic/sei510/README | 123 +++ > board/amlogic/sei510/sei510.c| 26 ++ > configs/sei510_defconfig | 74 + > include/configs/sei510.h | 137 +++ > 6 files changed, 371 insertions(+) > create mode 100644 board/amlogic/sei510/MAINTAINERS > create mode 100644 board/amlogic/sei510/Makefile > create mode 100644 board/amlogic/sei510/README > create mode 100644 board/amlogic/sei510/sei510.c > create mode 100644 configs/sei510_defconfig > create mode 100644 include/configs/sei510.h > > diff --git a/board/amlogic/sei510/MAINTAINERS > b/board/amlogic/sei510/MAINTAINERS > new file mode 100644 > index 00..792ae22176 > --- /dev/null > +++ b/board/amlogic/sei510/MAINTAINERS > @@ -0,0 +1,5 @@ > +U200 ---/\ wrong board name and missing mailing-list, will fix while applying > +M: Neil Armstrong > +S: Maintained > +F: board/amlogic/sei510/ > +F: configs/sei510_defconfig > diff --git a/board/amlogic/sei510/Makefile b/board/amlogic/sei510/Makefile > new file mode 100644 > index 00..03399a3849 > --- /dev/null > +++ b/board/amlogic/sei510/Makefile > @@ -0,0 +1,6 @@ > +# SPDX-License-Identifier: GPL-2.0+ > +# > +# (C) Copyright 2016 BayLibre, SAS > +# Author: Neil Armstrong > + > +obj-y:= sei510.o > diff --git a/board/amlogic/sei510/README b/board/amlogic/sei510/README > new file mode 100644 > index 00..216ff06093 > --- /dev/null > +++ b/board/amlogic/sei510/README > @@ -0,0 +1,123 @@ > +U-Boot for Amlogic SEI510 > +=== > + > +SEI510 is a custemer board manufactured by SEI Robotics with the following ---/\ Typo here, will fix while applying > +specifications: > + > + - Amlogic S905X2 ARM Cortex-A53 quad-core SoC > + - 2GB DDR4 SDRAM > + - 10/100 Ethernet (Internal PHY) > + - 1 x USB 3.0 Host > + - eMMC > + - SDcard > + - Infrared receiver > + - SDIO WiFi Module > + > +Currently the u-boot port supports the following devices: > + - serial > + - Ethernet > + - Regulators > + - Clock controller > + > +u-boot compilation > +== > + > + > export ARCH=arm > + > export CROSS_COMPILE=aarch64-none-elf- > + > make sei510_defconfig > + > make > + > +Image creation > +== > + > +Amlogic doesn't provide sources for the firmware and for tools needed > +to create the bootloader image, so it is necessary to obtain them from > +the git tree published by the board vendor: > + > + > wget > https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz > + > wget > https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz > + > tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz > + > tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz > + > export > PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH > + > git clone https://github.com/BayLibre/u-boot.git -b > buildroot-openlinux-20180418 amlogic-u-boot > + > cd amlogic-u-boot > + > make g12a_u200_v1_defconfig > + > make > + > export UBOOTDIR=$PWD > + > +Download the latest Amlogic Buildroot package, and extract it : > + > wget > http://openlinux2.amlogic.com:8000/ARM/filesystem/Linux_BSP/buildroot_openlinux_kernel_4.9_fbdev_20180706.tar.gz > + > tar xfz buildroot_openlinux_kernel_4.9_fbdev_20180706.tar.gz > buildroot_openlinux_kernel_4.9_fbdev_20180706/bootloader > + > export BRDIR=$PWD/buildroot_openlinux_kernel_4.9_fbdev_20180706 > + > export FIPDIR=$BRDIR/bootloader/uboot-repo/fip > + > +Go back to mainline U-Boot source tree then : > + > mkdir fip > + > + > wget > https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh > -O fip/blx_fix.sh > + > cp $UBOOTDIR/build/scp_task/bl301.bin fip/ > + > cp $UBOOTDIR/build/board/amlogic/g12a_u200_v1/firmware/acs.bin fip/ > + > cp $BRDIR/bootloader/uboot-repo/bl2/bin/g12a/bl2.bin fip/ > + > cp $BRDIR/bootloader/uboot-repo/bl30/bin/g12a/bl30.bin
[U-Boot] [PATCH] imx: Add support for i.MX28 based XEA board
From: Mans Rullgard This patch introduces support for i.MX28 based XEA board. This board supports DM/DTS in U-Boot proper as well as DM aware drivers in SPL (u-boot.sb). More detailed information regarding usage of it can be found in ./board/liebherr/xea/README file. U-Boot SPL 2019.10-rc1-00233-g6aa549f05c (Aug 12 2019 - 09:23:36 +0200) Trying to boot from MMC1 MMC0: Command 8 timeout (status 0xf0344020) mmc_load_image_raw_sector: mmc block read error U-Boot 2019.10-rc1-00233-g6aa549f05c (Aug 12 2019 - 09:23:36 +0200) CPU: Freescale i.MX28 rev1.2 at 454 MHz BOOT: SSP SPI #3, master, 3V3 NOR Model: Liebherr (LWE) XEA i.MX28 Board DRAM: 128 MiB MMC: MXS MMC: 0 Loading Environment from SPI Flash... SF: Detected n25q128a13 with page size 256 Bytes, erase size 64 KiB, total 16 MiB OK In:serial Out: serial Err: serial Net: Warning: ethernet@800f (eth0) using random MAC address - ce:e1:9e:46:f3:a2 eth0: ethernet@800f Hit any key to stop autoboot: 0 Signed-off-by: Mans Rullgard Signed-off-by: Lukasz Majewski --- Dependencies: - The whole patch series (1-4) starting at: https://patchwork.ozlabs.org/patch/1145520/ - Fixes/conversion for i.MX28 spi and emmc (the whole series 1-5): https://patchwork.ozlabs.org/patch/1145527/ --- arch/arm/dts/Makefile | 3 + arch/arm/dts/imx28-xea-u-boot.dtsi | 38 + arch/arm/dts/imx28-xea.dts | 110 ++ arch/arm/mach-imx/mxs/Kconfig | 4 + board/liebherr/xea/Kconfig | 24 +++ board/liebherr/xea/MAINTAINERS | 6 + board/liebherr/xea/Makefile| 12 ++ board/liebherr/xea/README | 63 board/liebherr/xea/spl_xea.c | 301 + board/liebherr/xea/xea.c | 120 +++ configs/imx28_xea_defconfig| 103 + include/configs/xea.h | 196 12 files changed, 980 insertions(+) create mode 100644 arch/arm/dts/imx28-xea-u-boot.dtsi create mode 100644 arch/arm/dts/imx28-xea.dts create mode 100644 board/liebherr/xea/Kconfig create mode 100644 board/liebherr/xea/MAINTAINERS create mode 100644 board/liebherr/xea/Makefile create mode 100644 board/liebherr/xea/README create mode 100644 board/liebherr/xea/spl_xea.c create mode 100644 board/liebherr/xea/xea.c create mode 100644 configs/imx28_xea_defconfig create mode 100644 include/configs/xea.h diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 9e7d6d6490..32b933 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -544,6 +544,9 @@ dtb-$(CONFIG_VF610) += vf500-colibri.dtb \ vf610-pcm052.dtb \ vf610-bk4r1.dtb +dtb-$(CONFIG_MX28) += \ + imx28-xea.dtb + dtb-$(CONFIG_MX53) += imx53-cx9020.dtb \ imx53-kp.dtb \ imx53-m53menlo.dtb diff --git a/arch/arm/dts/imx28-xea-u-boot.dtsi b/arch/arm/dts/imx28-xea-u-boot.dtsi new file mode 100644 index 00..59b3bd4c2b --- /dev/null +++ b/arch/arm/dts/imx28-xea-u-boot.dtsi @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2019 + * Lukasz Majewski, DENX Software Engineering, lu...@denx.de + * + * SPDX-License-Identifier: GPL-2.0+ or X11 + */ + +/* + * The minimal augmentation DTS U-Boot file to allow eMMC driver + * configuration in SPL for falcon boot. + */ +#include "imx28-u-boot.dtsi" +/ { + apb@8000 { + u-boot,dm-spl; + + apbh@8000 { + u-boot,dm-spl; + }; + + apbx@8004 { + u-boot,dm-spl; + }; + }; +}; + +&clks { + u-boot,dm-spl; +}; + +&ssp0 { + u-boot,dm-spl; +}; + +&ssp3 { + u-boot,dm-spl; +}; diff --git a/arch/arm/dts/imx28-xea.dts b/arch/arm/dts/imx28-xea.dts new file mode 100644 index 00..5de6774c5a --- /dev/null +++ b/arch/arm/dts/imx28-xea.dts @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2019 + * Lukasz Majewski, DENX Software Engineering, lu...@denx.de + * + * SPDX-License-Identifier: GPL-2.0+ or X11 + * + */ + +/dts-v1/; + +#include "imx28.dtsi" + +/ { + model = "Liebherr (LWE) XEA i.MX28 Board"; + compatible = "lwe,xea", "fsl,imx28"; + + aliases { + spi3 = &ssp3; + }; + + memory@4000 { + device_type = "memory"; + reg = <0x4000 0x1000>; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "3P3V"; + regulator-min-microvolt = <330>; + regulator-max-microvolt = <330>; + regulator-always-on; + }; + + reg_fec_3v3: regulator-fec-3v3 { + compatible = "regulator-fixed"; + regulator-name = "fec-3v3"; + regulator-min-microvolt = <330>; + regulator-max-microvolt = <330>; + gpio = <&gp
Re: [U-Boot] [U-BOOT PATCH] riscv: sifive: fu540: set serial environment variable from otp
On Mon, Aug 12, 2019 at 2:42 PM Sagar Shrikant Kadam wrote: > > This patch sets the serial# environment variable by reading the > board serial number from the OTP memory region. > > Signed-off-by: Sagar Shrikant Kadam > --- > board/sifive/fu540/fu540.c | 18 ++ > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c > index 11daf1a..06bf442 100644 > --- a/board/sifive/fu540/fu540.c > +++ b/board/sifive/fu540/fu540.c > @@ -122,10 +122,20 @@ static void fu540_setup_macaddr(u32 serialnum) > > int misc_init_r(void) > { > - /* Set ethaddr environment variable if not set */ > - if (!env_get("ethaddr")) > - fu540_setup_macaddr(fu540_read_serialnum()); > - > + u32 serial_num; > + char buf[11] = {0}; buf[9] should be enough. > + > + /* Set ethaddr environment variable from board serial number */ > + if (!env_get("serial#")) { > + serial_num = fu540_read_serialnum(); > + if (!serial_num) { > + WARN(1, "Board serial number should not be 0 !!"); nits: please use true instead of 1, and adding a '\n' at the end. > + return 0; > + } > + snprintf(buf, sizeof(buf), "%08x", serial_num); > + env_set("serial#", buf); > + fu540_setup_macaddr(serial_num); > + } > return 0; > } Regards, Bin ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 1/3] net: add dm_eth_phy_connect helper to link eth/PHY based on DT
The helper is useful for platforms that link ethernet interfaces and PHYs in device tree using current bindings. Drivers could do this directly, but the code is generic enough and helps keep drivers simpler. The patch also adds dm_mdio_phy_scan useful to scan a MDIO bus for PHYs. Signed-off-by: Alex Marginean --- Changes in v2: - Moved MDIO scan code into dm_mdio_phy_scan which is also exported - Use interface instead of if_type for consistency include/miiphy.h | 25 + net/mdio-uclass.c | 126 ++ 2 files changed, 151 insertions(+) diff --git a/include/miiphy.h b/include/miiphy.h index 9b97d09f18..727d5ceeef 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -165,6 +165,31 @@ struct phy_device *dm_mdio_phy_connect(struct udevice *dev, int addr, struct udevice *ethdev, phy_interface_t interface); +/** + * dm_mdio_phy_scan - Scan for a PHY on the given MDIO bus + * + * @dev: mdio dev + * @ethdev: ethernet device to connect to the PHY + * @interface: MAC-PHY protocol + * @mask: bitmask of PHY addresses to scan, use all Fs to scan all addresses + * + * @return pointer to phy_device, or 0 on error + */ +struct phy_device *dm_mdio_phy_scan(struct udevice *dev, struct udevice *ethdev, + phy_interface_t interface, uint mask); + +/** + * dm_eth_phy_connect - Connect an Eth device to a PHY based on device tree + * + * Picks up the DT phy-handle/mdio-handle and phy-mode from ethernet device node + * and connects the ethernet device to the linked PHY. + * + * @dev: ethernet device + * + * @return pointer to phy_device, or 0 on error + */ +struct phy_device *dm_eth_phy_connect(struct udevice *dev); + #endif #ifdef CONFIG_DM_MDIO_MUX diff --git a/net/mdio-uclass.c b/net/mdio-uclass.c index 36a404ff44..bac3144514 100644 --- a/net/mdio-uclass.c +++ b/net/mdio-uclass.c @@ -105,6 +105,132 @@ struct phy_device *dm_mdio_phy_connect(struct udevice *dev, int addr, return phy_connect(pdata->mii_bus, addr, ethdev, interface); } +struct phy_device *dm_mdio_phy_scan(struct udevice *dev, struct udevice *ethdev, + phy_interface_t interface, uint mask) +{ + struct mdio_perdev_priv *pdata; + struct phy_device *phy; + + pdata = dev_get_uclass_priv(dev); + + phy = phy_find_by_mask(pdata->mii_bus, mask, interface); + if (phy) + phy_connect_dev(phy, ethdev); + else + dev_dbg(dev, "no PHY detected on bus\n"); + + return phy; +} + +static struct phy_device *dm_eth_connect_phy_handle(struct udevice *dev, + phy_interface_t interface) +{ + u32 phy_phandle, phy_addr; + struct udevice *mdio_dev; + struct phy_device *phy; + ofnode phy_node; + + if (ofnode_read_u32(dev->node, "phy-handle", &phy_phandle)) { + dev_dbg(dev, "phy-handle missing in ethernet node\n"); + return NULL; + } + + phy_node = ofnode_get_by_phandle(phy_phandle); + if (!ofnode_valid(phy_node)) { + dev_dbg(dev, "invalid phy node\n"); + return NULL; + } + + if (ofnode_read_u32(phy_node, "reg", &phy_addr)) { + dev_dbg(dev, "missing reg property in phy node\n"); + return NULL; + } + + if (uclass_get_device_by_ofnode(UCLASS_MDIO, + ofnode_get_parent(phy_node), + &mdio_dev)) { + dev_dbg(dev, "can't find MDIO bus for node %s\n", + ofnode_get_name(ofnode_get_parent(phy_node))); + return NULL; + } + + phy = dm_mdio_phy_connect(mdio_dev, phy_addr, dev, interface); + phy->node = phy_node; + + return phy; +} + +static struct phy_device *dm_eth_connect_mdio_handle(struct udevice *dev, +phy_interface_t interface) +{ + u32 mdio_phandle; + ofnode mdio_node; + struct udevice *mdio_dev; + uint mask = 0x; + + if (ofnode_read_u32(dev->node, "mdio-handle", &mdio_phandle)) { + dev_dbg(dev, "mdio-handle missing in ethernet node\n"); + return NULL; + } + + mdio_node = ofnode_get_by_phandle(mdio_phandle); + if (!ofnode_valid(mdio_node)) { + dev_dbg(dev, "invalid mdio node\n"); + return NULL; + } + + if (uclass_get_device_by_ofnode(UCLASS_MDIO, mdio_node, &mdio_dev)) { + dev_dbg(dev, "can't find MDIO bus for node %s\n", + ofnode_get_name(mdio_node)); + return NULL; + } + + return dm_mdio_phy_scan(mdio_dev, dev, interface, mask); +} + +/* Connect to a PHY linked in eth DT node */ +struct phy_device *dm_eth_phy_c
[U-Boot] [PATCH v2 3/3] drivers: net: fsl_enetc: use dm_eth_phy_connect helper
Uses the new dm_eth_phy_connect helper to connect to the PHY to simplify the code. Signed-off-by: Alex Marginean --- Changes in v2: - don't use phy pointer if NULL drivers/net/fsl_enetc.c | 52 +++-- drivers/net/fsl_enetc.h | 1 + 2 files changed, 10 insertions(+), 43 deletions(-) diff --git a/drivers/net/fsl_enetc.c b/drivers/net/fsl_enetc.c index e7c5062c39..928d071815 100644 --- a/drivers/net/fsl_enetc.c +++ b/drivers/net/fsl_enetc.c @@ -200,56 +200,20 @@ static void enetc_start_pcs(struct udevice *dev) } /* Configure the actual/external ethernet PHY, if one is found */ -static void enetc_start_phy(struct udevice *dev) +static void enetc_config_phy(struct udevice *dev) { struct enetc_priv *priv = dev_get_priv(dev); - struct udevice *miidev; - struct phy_device *phy; - u32 phandle, phy_id; - ofnode phy_node; int supported; - if (!ofnode_valid(dev->node)) { - enetc_dbg(dev, "no enetc ofnode found, skipping PHY set-up\n"); - return; - } - - if (ofnode_read_u32(dev->node, "phy-handle", &phandle)) { - enetc_dbg(dev, "phy-handle not found, skipping PHY set-up\n"); - return; - } - - phy_node = ofnode_get_by_phandle(phandle); - if (!ofnode_valid(phy_node)) { - enetc_dbg(dev, "invalid phy node, skipping PHY set-up\n"); - return; - } - enetc_dbg(dev, "phy node: %s\n", ofnode_get_name(phy_node)); + priv->phy = dm_eth_phy_connect(dev); - if (ofnode_read_u32(phy_node, "reg", &phy_id)) { - enetc_dbg(dev, - "missing reg in PHY node, skipping PHY set-up\n"); + if (!priv->phy) return; - } - - if (uclass_get_device_by_ofnode(UCLASS_MDIO, - ofnode_get_parent(phy_node), - &miidev)) { - enetc_dbg(dev, "can't find MDIO bus for node %s\n", - ofnode_get_name(ofnode_get_parent(phy_node))); - return; - } - - phy = dm_mdio_phy_connect(miidev, phy_id, dev, priv->if_type); - if (!phy) { - enetc_dbg(dev, "dm_mdio_phy_connect returned null\n"); - return; - } supported = GENMASK(6, 0); /* speeds up to 1G & AN */ - phy->advertising = phy->supported & supported; - phy_config(phy); - phy_startup(phy); + priv->phy->advertising = priv->phy->supported & supported; + + phy_config(priv->phy); } /* @@ -464,7 +428,9 @@ static int enetc_start(struct udevice *dev) enetc_setup_rx_bdr(dev); enetc_start_pcs(dev); - enetc_start_phy(dev); + enetc_config_phy(dev); + if (priv->phy) + phy_startup(priv->phy); return 0; } diff --git a/drivers/net/fsl_enetc.h b/drivers/net/fsl_enetc.h index 0bb4cdff47..9a36cdad80 100644 --- a/drivers/net/fsl_enetc.h +++ b/drivers/net/fsl_enetc.h @@ -154,6 +154,7 @@ struct enetc_priv { int if_type; struct mii_dev imdio; + struct phy_device *phy; }; /* register accessors */ -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 2/3] doc: bindings: add mdio-handle property to ethernet nodes
Adds an optional mdio-handle property which identifies a MDIO bus which can be scanned to find the relevant PHY. The property is ignored if phy-handle is also present. Signed-off-by: Alex Marginean --- Changes in v2: none doc/device-tree-bindings/net/ethernet.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/device-tree-bindings/net/ethernet.txt b/doc/device-tree-bindings/net/ethernet.txt index 3fc360523b..9f9629f8d6 100644 --- a/doc/device-tree-bindings/net/ethernet.txt +++ b/doc/device-tree-bindings/net/ethernet.txt @@ -9,6 +9,8 @@ The following properties are common to the Ethernet controllers: - max-speed: number, specifies maximum speed in Mbit/s supported by the device; - max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather than the maximum frame size (there's contradiction in ePAPR). +- mdio-handle: phandle, specifies a reference to a MDIO bus to be scanned to + find the PHY device. Ignored if phy-handle is also present. - phy-mode: string, operation mode of the PHY interface; supported values are "mii", "gmii", "sgmii", "qsgmii", "tbi", "rev-mii", "rmii", "rgmii", "rgmii-id", "rgmii-rxid", "rgmii-txid", "rtbi", "smii", "xgmii"; this is now a de-facto -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] net: add dm_eth_phy_connect helper to link eth/PHY based on DT
On 8/7/2019 7:08 PM, Alex Marginean wrote: The helper is useful for platforms that link ethernet interfaces and PHYs in device tree using current bindings. Drivers could do this directly, but the code is generic enough and helps keep drivers simpler. Signed-off-by: Alex Marginean --- include/miiphy.h | 12 + net/mdio-uclass.c | 118 ++ 2 files changed, 130 insertions(+) superseded by https://patchwork.ozlabs.org/project/uboot/list/?series=124537 Thanks! Alex ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] riscv: cpu: Skip unavailable hart in the get_count() op
Hi Lukas > > From: Auer, Lukas [mailto:lukas.a...@aisec.fraunhofer.de] > > Sent: Thursday, August 08, 2019 10:04 PM > > To: bmeng...@gmail.com > > Cc: Rick Jian-Zhi Chen(陳建志); u-boot@lists.denx.de > > Subject: Re: [PATCH] riscv: cpu: Skip unavailable hart in the get_count() op > > > > Hi Bin, > > > > On Thu, 2019-08-08 at 21:25 +0800, Bin Meng wrote: > > > Hi Lukas, > > > > > > On Thu, Aug 8, 2019 at 7:22 PM Auer, Lukas > > > wrote: > > > > Hi Bin, > > > > > > > > On Thu, 2019-08-08 at 00:52 -0700, Bin Meng wrote: > > > > > We should not count in hart that is marked as not available in the > > > > > device tree in riscv_cpu_get_count(). > > > > > > > > > > > > > I think it might make sense to also exclude harts that are not > > > > listed as available in the available_harts mask. So the same logic > > > > as in arch/riscv/lib/smp.c. In this case, the bind function should > > > > probably check the mask as well. > > > > > > > > > > Yes, the check to available_harts mask can be added in > > > riscv_cpu_get_count(). I will do that. > > > > > > However, I doubt we could do available_harts mask check in the bind > > > function. If it returns error for non-available harts, the whole > > > initialization process fails. > > > > > > > You are right, I did not think about that. Perhaps it's best to ignore the > > available_harts mask in the count function as well then. > > > > It just checked where cpu_get_count() is used. The Andes PLIC driver > > (lib/andes_plic.c) uses it in a way that the patch might break the driver. > > It > > iterates over all harts, assuming the first hart is 0 and the last hart the > > result of > > cpu_get_count(). If any of the harts is set to disabled, this will no > > longer be > > true. It's probably best to update the driver to use the > > ofnode_for_each_subnode() macro to iterate over all harts. Rick, can you > > update the driver? Yes, I will prepare a patch to update it. Thanks for your catch and reminding. Regards, Rick > > > > Thanks, > > Lukas > > > > > > Looks good otherwise! > > > > > > > > Reviewed-by: Lukas Auer > > > > > > > > > > Regards, > > > Bin ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] Pull request: u-boot-riscv/master
Hi Tom, Please pull some riscv updates: - Fix sifive serial y-modem transfer. - Access CSRs using CSR numbers. - Update doc sifive-fu540 - Support big endian hosts and target. - Support SPL and OpenSBI (FW_DYNAMIC firmware) boot. https://travis-ci.org/rickchen36/u-boot-riscv/builds/570682542 Thanks Rick The following changes since commit feb5a02f869d5678190dfc915ef6c2781b4f7a6c: Merge branch 'master' of git://git.denx.de/u-boot-sh (2019-08-10 17:57:58 -0400) are available in the Git repository at: g...@gitlab.denx.de:u-boot/custodians/u-boot-riscv.git for you to fetch changes up to 30c150bae4e3a61f87a159579cd3784f4d64e79e: riscv: qemu: Fix kconfig build warning (2019-08-12 13:30:53 +0800) Anup Patel (1): doc: sifive-fu540: Update README to explicitly load DTB for Linux Bin Meng (3): riscv: Sync csr.h with Linux kernel v5.2 riscv: Access CSRs using CSR numbers riscv: qemu: Fix kconfig build warning Lukas Auer (10): fdtdec: make CONFIG_OF_PRIOR_STAGE available in SPL Makefile: support building SPL FIT images without device trees spl: fit: use U-Boot device tree when FIT image has no device tree riscv: add run mode configuration for SPL riscv: add SPL support riscv: support SPL stack and global data relocation riscv: add a generic FIT generator script riscv: set default FIT generator script and build target for SPL builds riscv: qemu: add SPL configuration doc: update QEMU RISC-V documentation Marcus Comstedt (2): riscv: tools: Fix prelink-riscv to work on big endian hosts riscv: tools: Add big endian target support to prelink-riscv Sagar Shrikant Kadam (1): riscv : serial: use rx watermark to indicate rx data is present Kconfig | 4 +- Makefile| 8 ++- arch/Kconfig| 6 ++ arch/riscv/Kconfig | 36 -- arch/riscv/cpu/ax25/Kconfig | 6 +- arch/riscv/cpu/cpu.c| 15 ++--- arch/riscv/cpu/generic/Kconfig | 5 +- arch/riscv/cpu/start.S | 65 -- arch/riscv/cpu/u-boot-spl.lds | 82 +++ arch/riscv/include/asm/asm.h| 68 +++ arch/riscv/include/asm/csr.h| 74 - arch/riscv/include/asm/encoding.h | 240 +- arch/riscv/include/asm/spl.h| 31 + arch/riscv/lib/Makefile | 8 ++- arch/riscv/lib/mkimage_fit_opensbi.sh | 100 arch/riscv/lib/spl.c| 48 ++ board/emulation/qemu-riscv/Kconfig | 11 board/emulation/qemu-riscv/MAINTAINERS | 2 + board/emulation/qemu-riscv/qemu-riscv.c | 17 + common/spl/spl.c| 2 +- common/spl/spl_fit.c| 37 +++ configs/qemu-riscv32_spl_defconfig | 11 configs/qemu-riscv64_spl_defconfig | 12 doc/board/emulation/qemu-riscv.rst | 60 - doc/board/sifive/fu540.rst | 396 + drivers/serial/serial_sifive.c | 23 ++- include/configs/qemu-riscv.h| 14 include/fdtdec.h| 2 +- lib/fdtdec.c| 6 +- tools/prelink-riscv.c | 39 --- tools/prelink-riscv.inc | 60 + 31 files changed, 962 insertions(+), 526 deletions(-) create mode 100644 arch/riscv/cpu/u-boot-spl.lds create mode 100644 arch/riscv/include/asm/asm.h create mode 100644 arch/riscv/include/asm/spl.h create mode 100755 arch/riscv/lib/mkimage_fit_opensbi.sh create mode 100644 arch/riscv/lib/spl.c create mode 100644 configs/qemu-riscv32_spl_defconfig create mode 100644 configs/qemu-riscv64_spl_defconfig ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v1 0/4] spi: Split CONFIG_DM_SPI* to CONFIG_{SPL_TPL}DM_SPI*
This patch series introduces new SPL and TPL specific Kconfig entries for DM_SPI* options. Such change allows using the spi driver in SPL/TPL or U-Boot proper. First two patches - related to ls10{42}* NXP soc fix some issues with defining the DM_SPI* defines in .h file instead of Kconfig. This series doesn't introduce build breaks, but board maintainers are kindly asked to check if their boards still boots. Lukasz Majewski (4): kconfig: Update comment regarding CONFIG_IS_ENABLED(FOO) for TPL spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a) spi: Move DM_SPI_FLASH and SPI_FLASH_DATAFLASH to Kconfig (for ls1021aXXX) spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI* arch/arm/Kconfig| 23 +-- board/l+g/vinco/vinco.c | 4 ++-- cmd/sf.c| 4 ++-- cmd/spi.c | 6 +++--- common/spl/Kconfig | 28 configs/am57xx_evm_defconfig| 2 ++ configs/am57xx_hs_evm_defconfig | 2 ++ configs/am57xx_hs_evm_usb_defconfig | 2 ++ configs/axm_defconfig | 2 ++ configs/chromebook_link64_defconfig | 2 ++ configs/chromebook_samus_tpl_defconfig | 4 configs/dra7xx_evm_defconfig| 2 ++ configs/dra7xx_hs_evm_defconfig | 2 ++ configs/dra7xx_hs_evm_usb_defconfig | 2 ++ configs/imx28_xea_defconfig | 2 ++ configs/j721e_evm_a72_defconfig | 2 ++ configs/j721e_evm_r5_defconfig | 2 ++ configs/ls1021aiot_qspi_defconfig | 2 ++ configs/ls1021aiot_sdcard_defconfig | 2 ++ configs/ls1021aqds_qspi_defconfig | 1 + configs/ls1021aqds_sdcard_qspi_defconfig| 1 + configs/ls1021atwr_qspi_defconfig | 1 + configs/sama5d2_xplained_spiflash_defconfig | 2 ++ configs/sama5d3xek_spiflash_defconfig | 7 --- configs/sama5d4_xplained_spiflash_defconfig | 2 ++ configs/sama5d4ek_spiflash_defconfig| 2 ++ configs/stm32mp15_basic_defconfig | 2 ++ configs/taurus_defconfig| 2 ++ drivers/mtd/spi/Makefile| 4 ++-- drivers/mtd/spi/sf_probe.c | 8 drivers/net/fm/fm.c | 4 ++-- drivers/spi/Makefile| 2 +- drivers/spi/atmel_spi.c | 4 ++-- drivers/spi/davinci_spi.c | 6 +++--- drivers/spi/fsl_dspi.c | 5 +++-- drivers/spi/kirkwood_spi.c | 2 +- drivers/spi/mxc_spi.c | 6 +++--- drivers/spi/omap3_spi.c | 4 ++-- drivers/spi/sh_qspi.c | 4 ++-- env/sf.c| 2 +- include/configs/ls1021aiot.h| 6 -- include/configs/ls1021aqds.h| 8 include/configs/ls1021atwr.h| 5 - include/configs/ls1043a_common.h| 2 -- include/linux/kconfig.h | 2 ++ include/spi.h | 8 include/spi_flash.h | 2 +- test/dm/spi.c | 2 +- 48 files changed, 137 insertions(+), 64 deletions(-) -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] cmd: avb: Fix requested partitions list
Hi Sam, On Fri, Aug 9, 2019 at 7:16 PM Sam Protsenko wrote: > > The requested_partitions[] array should contain only boot partitions. > Usually it's only 'boot' partition, as can be seen in [1]. Also, seems > like the requested_partitions[] are only used when there is no 'vbmeta' > partition [2], which is not a regular use-case. > > Make requested_partitions[] contain only 'boot' partition as it was > supposed to be, and also make that array to be a local in > do_avb_verify_part() function, as nobody else needs that. > > [1] > https://android.googlesource.com/platform/external/avb/+/master/test/avb_slot_verify_unittest.cc#108 > [2] > https://android.googlesource.com/platform/external/avb/+/master/libavb/avb_slot_verify.c#1461 > > Signed-off-by: Sam Protsenko > --- > cmd/avb.c | 6 +- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/cmd/avb.c b/cmd/avb.c > index d1942d6605..8f2bb85fce 100644 > --- a/cmd/avb.c > +++ b/cmd/avb.c > @@ -14,11 +14,6 @@ > #define AVB_BOOTARGS "avb_bootargs" > static struct AvbOps *avb_ops; > > -static const char * const requested_partitions[] = {"boot", > -"system", > -"vendor", > -NULL}; > - > int do_avb_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) > { > unsigned long mmc_dev; > @@ -231,6 +226,7 @@ int do_avb_get_uuid(cmd_tbl_t *cmdtp, int flag, > int do_avb_verify_part(cmd_tbl_t *cmdtp, int flag, >int argc, char *const argv[]) > { > + const char * const requested_partitions[] = {"boot", NULL}; > AvbSlotVerifyResult slot_result; > AvbSlotVerifyData *out_data; > char *cmdline; > -- > 2.20.1 > Thanks for the patch. Current snapshot of libavb in U-boot is a bit out-dated (~2 years) and before introducing patches that can leverage new features from the mainline libavb(taking into account that you're referring to Jul 30, 2019 patch 36d41d9223 ("Add AVB_SLOT_VERIFY_FLAGS_NO_VBMETA_PARTITION flag")) it makes sense to update libavb in U-boot first: The best approach I see here (just to summarize what we've already discussed): 1. Update libavb to the latest stable version 2. Check if `avb verify` still behaves as expected on non-AB setups. 3. Introduce support of AB slots and different fixes like this one Thanks -- Best regards - Freundliche Grüsse - Meilleures salutations Igor Opaniuk mailto: igor.opan...@gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/1] cmd/bdinfo: sandbox: print the relocation offset
On 8/12/19 6:07 AM, Bin Meng wrote: On Sat, Aug 10, 2019 at 5:35 AM Heinrich Schuchardt wrote: On the sandbox provide the relocation offset. This value can be used for debugging with GDB using the `add-symbol-file u-boot ' command. Signed-off-by: Heinrich Schuchardt --- cmd/bdinfo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index 86c17dc427..560c039d37 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -395,6 +395,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_bi_boot_params(bd); print_bi_dram(bd); + print_num("reloc off", (uintptr_t)(gd->reloc_off + gd->arch.ram_buf)); Shouldn't we print gd->relocaddr directly? There are three address spaces involved: * The physical address space that you see on the address lines of the RAM. * The virtual address space of the process in the operating system which is mapped by the MMU to the physical address space. This is the address space from which memory is allocated by calling mmap(). * The virtual address space use for testing by the sandbox. For debugging with GDB we need the virtual address used by the process of the operating system as relocation target. This is in the range of the addresses assigned by calling mmap(). gd->relocaddr is an address in the virtual address space of the sandbox. It is not an address in the memory space reserved by the mmap() call. Here is an example: => bdinfo boot_params = 0x DRAM bank = 0x -> start= 0x -> size = 0x0800 relocaddr = 0x07e1 // gd->relocaddr reloc off = 0x5557a047d000 // gd->reloc_off + gd->arch.ram_buf ethaddr = 00:00:11:22:33:44 IP addr = 1.2.3.4 For testing the sandbox here stipulates a virtual address space of [0x0-0x800]. But the addresses the CPU uses in the user process are 0x5557a047c000 and above as shown by the pmap command: $ $ pmap 15398 | grep u-boot 15398: ./u-boot 55579047c000 1840K r-x-- u-boot 555790648000 28K r-x-- u-boot 55579064f000108K rwx-- u-boot Best regards Heinrich print_eth_ip_addr(); #if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) -- Regards, Bin ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 0/9] km: Kconfig and driver model implementations
On 09.07.19 09:28, Pascal Linder wrote: This series of patches contains the driver model implementation for the UART and Ethernet interface on KM Kirkwood boards. Moreover, the conversion from header files to Kconfig has been advanced. Finally, three now unmaintained boards are removed in order to clean up the source code. The patches cannot directly be put on mainline, as they depend on a previously sent series that is, however, not yet mainlined. Meant is the SPI driver model implementation that is found on the mailing list over following link: https://lists.denx.de/pipermail/u-boot/2019-June/373115.html. Most importantly it is the first patch of the series setting up a new Kconfig file organization for KM boards, which is required. Holger Brunck (2): powerpc/km: remove unmaintained target KMVECT1 powerpc/km: remove unmaintained board KMLION1 Pascal Linder (7): km: add Kconfig menus for KM boards km: remove obsolete definitions in KM header files km: clean up header files for KM Kirkwood boards km: fixed typo in KM Kirkwood header file km/uart: port UART interface of KM Kirkwood boards to driver model km/rgmii: port Ethernet interface of KM Kirkwood boards to driver model km/arm: remove unmaintained target PORTL2 All patches applied to: u-boot-marvell/master. Thanks, Stefan arch/arm/dts/kirkwood-km_common.dtsi | 1 + arch/powerpc/cpu/mpc83xx/Kconfig | 4 - board/keymile/Kconfig| 101 +++ board/keymile/common/common.h| 4 - board/keymile/common/ivm.c | 5 - board/keymile/km83xx/Kconfig | 19 -- board/keymile/km83xx/MAINTAINERS | 1 - board/keymile/km83xx/km83xx.c| 81 -- board/keymile/km_arm/Kconfig | 31 ++ board/keymile/km_arm/MAINTAINERS | 1 - board/keymile/kmp204x/MAINTAINERS| 1 - configs/km_kirkwood_pci_defconfig| 1 + configs/kmcoge5un_defconfig | 3 + configs/kmlion1_defconfig| 57 configs/kmnusa_defconfig | 4 + configs/kmsugp1_defconfig| 4 + configs/kmsuv31_defconfig| 2 + configs/kmvect1_defconfig| 180 configs/mgcoge3un_defconfig | 2 + configs/portl2_defconfig | 46 --- include/configs/km/keymile-common.h | 8 - include/configs/km/km-mpc83xx.h | 4 - include/configs/km/km-powerpc.h | 13 - include/configs/km/km_arm.h | 54 +--- include/configs/km/kmp204x-common.h | 409 -- include/configs/km_kirkwood.h| 28 +- include/configs/kmp204x.h| 410 +-- include/configs/kmvect1.h| 61 scripts/config_whitelist.txt | 22 -- 29 files changed, 541 insertions(+), 1016 deletions(-) delete mode 100644 configs/kmlion1_defconfig delete mode 100644 configs/kmvect1_defconfig delete mode 100644 configs/portl2_defconfig delete mode 100644 include/configs/km/kmp204x-common.h delete mode 100644 include/configs/kmvect1.h ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PULL u-boot] Please pull u-boot-amlogic-20190812
Hi Tom, This PR adds support for the SEI Robotic SEI510 board and synced with Linux 5.3-rc1. The CI jobs passed at https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic/pipelines/438 Thanks, Neil The following changes since commit feb5a02f869d5678190dfc915ef6c2781b4f7a6c: Merge branch 'master' of git://git.denx.de/u-boot-sh (2019-08-10 17:57:58 -0400) are available in the Git repository at: https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic.git tags/u-boot-amlogic-20190812 for you to fetch changes up to eb1677250d704b93169a58114a74424c7bfa495a: configs: sei510: disable PSCI_RESET to support fastboot reboot_flag (2019-08-12 10:05:10 +0200) - amlogic: add support for the SEI Robotic SEI510 Jerome Brunet (1): boards: meson: add g12a sei510 Neil Armstrong (6): ARM: dts: Import Amlogic G12A SEI510 DT from Linux 5.3-rc1 configs: meson64: permit redefining ENV_SIZE arm: meson: add sm cmd to retrieve SoC serial arm: meson: add sm command to retrieve the reboot reason ARM: meson: Add support for fastboot_set_reboot_flag() configs: sei510: disable PSCI_RESET to support fastboot reboot_flag arch/arm/dts/Makefile| 1 + arch/arm/dts/meson-g12a-sei510.dts | 502 +++ arch/arm/include/asm/arch-meson/sm.h | 18 ++ arch/arm/mach-meson/board-common.c | 33 +++ arch/arm/mach-meson/sm.c | 133 ++ board/amlogic/sei510/MAINTAINERS | 7 + board/amlogic/sei510/Makefile| 6 + board/amlogic/sei510/README | 123 + board/amlogic/sei510/sei510.c| 26 ++ configs/sei510_defconfig | 75 ++ include/configs/meson64.h| 2 + include/configs/sei510.h | 137 ++ 12 files changed, 1063 insertions(+) create mode 100644 arch/arm/dts/meson-g12a-sei510.dts create mode 100644 board/amlogic/sei510/MAINTAINERS create mode 100644 board/amlogic/sei510/Makefile create mode 100644 board/amlogic/sei510/README create mode 100644 board/amlogic/sei510/sei510.c create mode 100644 configs/sei510_defconfig create mode 100644 include/configs/sei510.h ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: configs: Enable DM_ETH for SBx81LIFKW and SBx81LIFXCAT
On 10.07.19 11:00, Chris Packham wrote: The mvgbe driver supports DM_ETH so switch these boards to using it. Signed-off-by: Chris Packham Applied to: u-boot-marvell/master. Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH u-boot-marvell 1/1] arm: mvebu: turris_omnia: update defconfig
On 16.07.19 15:50, Marek Behún wrote: Add Macronis SPI flash support - some Omnia routers are shipped with this SPI flash chip. Also add the memtest command to defconfig. Signed-off-by: Marek Behún Applied to: u-boot-marvell/master. Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH u-boot-marvell 1/1] pci: pci_mvebu: set BAR0 after memory space is set
On 07.08.19 15:01, Marek Behún wrote: The non-DM version of this driver used to set BAR0 register after the calls to pci_set_region. I found out that for some strange reason the ath10k driver in kernel fails to work if this is done the other way around. I know that Linux's driver should not depend on how U-Boot does things, but for some strange reason it does and this seems to be the simplest solution. Fix it since it caused regressions on Omnia. Signed-off-by: Marek Behún Cc: Stefan Roese Cc: Dirk Eibach Cc: Mario Six Cc: Chris Packham Cc: Phil Sutter Cc: VlaoMao Applied to: u-boot-marvell/master. Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] verified boot against a chain of public keys
I am about to embark on the task of adding support for importing and using multiple keys in the verified boot process. Does u-boot already support this? Has anybody (else) thought about it? Basically, I would like to add the ability to import a public key into u-boot, which must be signed by the (one of) the existing key(s), and use that key to validate the image that I want to boot (or additional keys I would like to import). In essence, I would like to add a signature chain to u-boot that can be loaded at runtime. I am about to dive into the code and see if I think this is a good or bad idea from the perspective of the code, but, in parallel, I thought I should ask for some perspective from the community. It seems to me that I could package up the key to be imported into a .dts file, sign that using mkimage, and "boot" it into u-boot with the "bootm" command. (I would prefer to use a "loadkey" command, just to make things clear.). It seems like most of the machinery I need should already be there. It also seems like it should be pretty easy to teach u-boot to support having multiple keys in memory (using the key-name-hint), and, in fact, that capability may already be there. (I'll know shortly after I start digging further into the code). Anyway, back to the opening paragraph... Does u-boot already support anything like this? Do folks think this is a good idea? a bad idea? a difficult idea? an easy idea? Any thoughts? --wpd ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] Please pull u-boot-marvell/master
Hi Tom, please pull the first Marvell patches in this merge window with the following changes: - Various improvements to Keymile boards - mostly DT conversation (Pascal & Holger) - Removal of now unsupported Keymile boards (Pascal & Holger) - Small MVEBU PCI fix (Marek) - Turris Omnia defconfig update (Marek) - Misc Allied Telesis defconfig updates (Chris) Thanks, Stefan The following changes since commit feb5a02f869d5678190dfc915ef6c2781b4f7a6c: Merge branch 'master' of git://git.denx.de/u-boot-sh (2019-08-10 17:57:58 -0400) are available in the Git repository at: g...@gitlab.denx.de:u-boot/custodians/u-boot-marvell.git for you to fetch changes up to 193a1e9f196b7fb7e913a70936c8a49060a1859c: pci: pci_mvebu: set BAR0 after memory space is set (2019-08-12 13:59:31 +0200) Chris Packham (1): ARM: configs: Enable DM_ETH for SBx81LIFKW and SBx81LIFXCAT Holger Brunck (2): powerpc/km: remove unmaintained target KMVECT1 powerpc/km: remove unmaintained board KMLION1 Marek Behún (2): arm: mvebu: turris_omnia: update defconfig pci: pci_mvebu: set BAR0 after memory space is set Pascal Linder (7): km: add Kconfig menus for KM boards km: remove obsolete definitions in KM header files km: clean up header files for KM Kirkwood boards km: fixed typo in KM Kirkwood header file km/uart: port UART interface of KM Kirkwood boards to driver model km/rgmii: port Ethernet interface of KM Kirkwood boards to driver model km/arm: remove unmaintained target PORTL2 arch/arm/dts/kirkwood-km_common.dtsi | 1 + arch/powerpc/cpu/mpc83xx/Kconfig | 4 - board/keymile/Kconfig| 101 + board/keymile/common/common.h| 4 - board/keymile/common/ivm.c | 5 - board/keymile/km83xx/Kconfig | 19 -- board/keymile/km83xx/MAINTAINERS | 1 - board/keymile/km83xx/km83xx.c| 81 --- board/keymile/km_arm/Kconfig | 31 +++ board/keymile/km_arm/MAINTAINERS | 1 - board/keymile/kmp204x/MAINTAINERS| 1 - configs/SBx81LIFKW_defconfig | 3 + configs/SBx81LIFXCAT_defconfig | 3 + configs/km_kirkwood_pci_defconfig| 1 + configs/kmcoge5un_defconfig | 3 + configs/kmlion1_defconfig| 57 - configs/kmnusa_defconfig | 4 + configs/kmsugp1_defconfig| 4 + configs/kmsuv31_defconfig| 2 + configs/kmvect1_defconfig| 180 --- configs/mgcoge3un_defconfig | 2 + configs/portl2_defconfig | 46 configs/turris_omnia_defconfig | 3 + drivers/pci/pci_mvebu.c | 8 +- include/configs/km/keymile-common.h | 8 - include/configs/km/km-mpc83xx.h | 4 - include/configs/km/km-powerpc.h | 13 -- include/configs/km/km_arm.h | 54 + include/configs/km/kmp204x-common.h | 409 -- include/configs/km_kirkwood.h| 28 +-- include/configs/kmp204x.h| 410 +-- include/configs/kmvect1.h| 61 -- scripts/config_whitelist.txt | 22 -- 33 files changed, 554 insertions(+), 1020 deletions(-) delete mode 100644 configs/kmlion1_defconfig delete mode 100644 configs/kmvect1_defconfig delete mode 100644 configs/portl2_defconfig delete mode 100644 include/configs/km/kmp204x-common.h delete mode 100644 include/configs/kmvect1.h ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] rockchip: ram: rk3399: fix setting for some type of dram
We need to store all the ram related cap/map info back to register after all the init has been done in case some of register was reset during the process. Signed-off-by: YouMin Chen Signed-off-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 81fc71c051..edbc34327c 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -2592,8 +2592,11 @@ static int sdram_init(struct dram_info *dram, } sdram_print_ddr_info(cap_info, ¶ms->base); + set_memory_map(chan, channel, params); + cap_info->ddrconfig = calculate_ddrconfig(params, channel); set_ddrconfig(chan, params, channel, cap_info->ddrconfig); + set_cap_relate_config(chan, params, channel); } if (params->base.num_channels == 0) { -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 14/15] rockchip: rk3399: Add bootcount support
Hi Jagan, On 2019/7/29 下午3:47, Jagan Teki wrote: Add bootcount support for Rockchip rk3399. The bootcount value is preserved in PMU_SYS_REG0 register, PMU_SYS_REG0 has been used by other case in Rockchip, we don't recommend to use it, the PMUGRF_OS_REG3 is still reserved now, could you use it instead? Thanks, - Kever this would help to support redundent boot. Once the redundant boot triggers, the altboot command will look for extlinux-rollback.conf on particular bootable partition which supposed to be a recovery partition where redundant boot required. Signed-off-by: Jagan Teki --- arch/arm/mach-rockchip/Kconfig| 2 ++ arch/arm/mach-rockchip/rk3399/Kconfig | 10 ++ include/configs/rk3399_common.h | 5 - 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 17f31e89f3..dd5055ed69 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -184,6 +184,8 @@ config ROCKCHIP_RK3399 imply TPL_CLK imply TPL_TINY_MEMSET imply TPL_ROCKCHIP_COMMON_BOARD + imply SYS_BOOTCOUNT_SINGLEWORD if BOOTCOUNT_LIMIT + imply CMD_BOOTCOUNT if BOOTCOUNT_LIMIT help The Rockchip RK3399 is a ARM-based SoC with a dual-core Cortex-A72 and quad-core Cortex-A53. diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig index 6660d05349..68ac913bcb 100644 --- a/arch/arm/mach-rockchip/rk3399/Kconfig +++ b/arch/arm/mach-rockchip/rk3399/Kconfig @@ -91,6 +91,16 @@ config TPL_STACK config TPL_TEXT_BASE default 0xff8c2000 +if BOOTCOUNT_LIMIT + +config BOOTCOUNT_BOOTLIMIT + default 3 + +config SYS_BOOTCOUNT_ADDR + default 0xff3100f0 # PMU_SYS_REG0 + +endif # BOOTCOUNT_LIMIT + source "board/rockchip/evb_rk3399/Kconfig" source "board/theobroma-systems/puma_rk3399/Kconfig" source "board/vamrs/rock960_rk3399/Kconfig" diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h index 67b48e03ba..ace82928d1 100644 --- a/include/configs/rk3399_common.h +++ b/include/configs/rk3399_common.h @@ -70,7 +70,10 @@ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \ ROCKCHIP_DEVICE_SETTINGS \ - BOOTENV + BOOTENV \ + "altbootcmd=" \ + "setenv boot_syslinux_conf extlinux/extlinux-rollback.conf;" \ + "run distro_bootcmd\0" #endif ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/1] cmd/bdinfo: sandbox: print the relocation offset
Hi Heinrich, On Mon, Aug 12, 2019 at 7:17 PM Heinrich Schuchardt wrote: > > On 8/12/19 6:07 AM, Bin Meng wrote: > > On Sat, Aug 10, 2019 at 5:35 AM Heinrich Schuchardt > > wrote: > >> > >> On the sandbox provide the relocation offset. This value can be used for > >> debugging with GDB using the `add-symbol-file u-boot ' command. > >> > >> Signed-off-by: Heinrich Schuchardt > >> --- > >> cmd/bdinfo.c | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c > >> index 86c17dc427..560c039d37 100644 > >> --- a/cmd/bdinfo.c > >> +++ b/cmd/bdinfo.c > >> @@ -395,6 +395,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, > >> char * const argv[]) > >> > >> print_bi_boot_params(bd); > >> print_bi_dram(bd); > >> + print_num("reloc off", (uintptr_t)(gd->reloc_off + > >> gd->arch.ram_buf)); > > > > Shouldn't we print gd->relocaddr directly? > > There are three address spaces involved: > > * The physical address space that you see on the address lines of the RAM. > * The virtual address space of the process in the operating system which > is mapped by the MMU to the physical address space. This is the address > space from which memory is allocated by calling mmap(). > * The virtual address space use for testing by the sandbox. > > For debugging with GDB we need the virtual address used by the process > of the operating system as relocation target. This is in the range of > the addresses assigned by calling mmap(). > > gd->relocaddr is an address in the virtual address space of the sandbox. > It is not an address in the memory space reserved by the mmap() call. > What I did for debugging sandbox u-boot, was: $ gdb u-boot >>> b do_pci then type "pci" in the U-Boot shell, the breakpoint hits. No relocation is needed. Are you doing something different? > Here is an example: > > => bdinfo > boot_params = 0x > DRAM bank = 0x > -> start= 0x > -> size = 0x0800 > relocaddr = 0x07e1 // gd->relocaddr > reloc off = 0x5557a047d000 // gd->reloc_off + gd->arch.ram_buf > ethaddr = 00:00:11:22:33:44 > IP addr = 1.2.3.4 > > For testing the sandbox here stipulates a virtual address space of > [0x0-0x800]. But the addresses the CPU uses in the user process are > 0x5557a047c000 and above as shown by the pmap command: > > $ $ pmap 15398 | grep u-boot > 15398: ./u-boot > 55579047c000 1840K r-x-- u-boot > 555790648000 28K r-x-- u-boot > 55579064f000108K rwx-- u-boot > Regards, Bin ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [RFC PATCH] rockchip, Makefile: add u-boot-tpl-with-spl.img target
вс, 11 авг. 2019 г. в 22:10, Mark Kettenis : > > > From: "Matwey V. Kornilov" > > Date: Sun, 11 Aug 2019 11:06:02 +0300 > > > > Many Rockchip platforms require the same u-boot deploy procedure > > when TPL and SPL both enabled. > > > > The following examples are taken from doc/README.rockchip > > and board/theobroma-systems/lion_rk3368/README: > > > > RK3288: > > > > ./tools/mkimage -n rk3288 -T rksd -d ./tpl/u-boot-tpl.bin out > > cat ./spl/u-boot-spl-dtb.bin >> out > > sudo dd if=out of=/dev/mmcblk0 seek=64 > > > > RK3328: > > > > ./tools/mkimage -n rk3328 -T rksd -d ./tpl/u-boot-tpl.bin idbloader.img > > cat ./spl/u-boot-spl.bin >> idbloader.img > > sudo dd if=idbloader.img of=/dev/mmcblk0 seek=64 > > > > RK3368: > > > > ./tools/mkimage -n rk3368 -T rksd -d tpl/u-boot-tpl.bin spl-3368.img > > cat spl/u-boot-spl-dtb.bin >> spl-3368.img > > dd if=spl-3368.img of=/dev/sdb seek=64 > > > > RK3399: > > > > ./tools/mkimage -n rk3399 -T rksd -d ./tpl/u-boot-tpl-dtb.bin out > > cat ./spl/u-boot-spl-dtb.bin >> out > > sudo dd if=out of=/dev/sdc seek=64 > > > > Here, we introduce generic u-boot-tpl-with-spl.img target > > which is the TPL image followed by the SPL binary. > > Nice. Only comment/question I have is whether we should go with your > name (which fits well with the way we name other U-Boot components) or > use idbloader.img which is the name used in some external > documentation such as: > > http://opensource.rock-chips.com/wiki_Boot_option I think it is for maintainers to decide. What does idb in "idbloader" stands for? > > Cheers, > > Mark > > > Signed-off-by: Matwey V. Kornilov > > --- > > Makefile | 12 > > 1 file changed, 12 insertions(+) > > > > diff --git a/Makefile b/Makefile > > index 8513db94e3..4d70b6ac2e 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -882,6 +882,10 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy) > > ALL-y += u-boot-with-dtb.bin > > endif > > > > +ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy) > > +ALL-y += u-boot-tpl-with-spl.img > > +endif > > + > > LDFLAGS_u-boot += $(LDFLAGS_FINAL) > > > > # Avoid 'Not enough room for program headers' error on binutils 2.28 > > onwards. > > @@ -1293,6 +1297,14 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O > > binary \ > > u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE > > $(call if_changed,pad_cat) > > > > +ifeq ($(CONFIG_ARCH_ROCKCHIP),y) > > +MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T rksd > > +tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE > > + $(call if_changed,mkimage) > > +u-boot-tpl-with-spl.img: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE > > + $(call if_changed,cat) > > +endif > > + > > ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy) > > MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE) > > > > -- > > 2.16.4 > > > > ___ > > U-Boot mailing list > > U-Boot@lists.denx.de > > https://lists.denx.de/listinfo/u-boot -- With best regards, Matwey V. Kornilov ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/3] spl: mmc: support uboot image offset on main partition
Hi Baruch, On 06.08.19 08:15, Stefan Roese wrote: On 29.07.19 09:12, Baruch Siach wrote: On Armada 38x platforms the ROM code loads SPL from offset 0 of eMMC hardware boot partitions. When there are no boot partitions (i.e. SD card) the ROM skips the first sector that usually contains the (logical) partition table. Since the generated .kwb image contains the main U-Boot image in a fixed location (0x140 sectors by default), we end up with the main U-Boot image in offset of 1 sector. The current workaround is to manually set CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x141 to compensate for that. This patch uses the run-time detected boot partition to determine the right offset of the main U-Boot partition. The generated .kwb image is now compatible with both eMMC boot partition, and SD card main data partition. Signed-off-by: Baruch Siach --- v2: Rebase on top of current master --- common/spl/Kconfig | 12 common/spl/spl_mmc.c | 15 +-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 5d6da5db89bc..e43eefe046bc 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -293,6 +293,18 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR Address on the MMC to load U-Boot from, when the MMC is being used in raw mode. Units: MMC sectors (1 sector = 512 bytes). +config SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET + hex "U-Boot main hardware partition image offset" + depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR + default 0x0 + help + On some platforms SPL location depends on hardware partition. The ROM + code skips the MBR sector when loading SPL from main hardware data + partition. This adds offset to the main U-Boot image. Set this symbol + to the number of skipped sectors. + + If unsure, leave the default. + config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION bool "MMC Raw mode: by partition" help diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index b3619889f794..72439c029f4a 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -49,6 +49,16 @@ static ulong h_spl_load_read(struct spl_load_info *load, ulong sector, return blk_dread(mmc_get_blk_desc(mmc), sector, count, buf); } +static __maybe_unused unsigned long spl_mmc_raw_uboot_offset(int part) +{ +#if IS_ENABLED(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR) Use if (IS_ENABLED()) instead ? + if (part == 0) Why is this restricted to part == 0 ? Any updates on this? Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/3] arm: mvebu: clearfog: set uboot image SD card offset
Hi Baruch, On 06.08.19 08:20, Stefan Roese wrote: On 29.07.19 09:12, Baruch Siach wrote: Armada 38x ROM skips the first SD card offset when loading SPL. This affects the location of the main U-Boot image. SPL MMC code now supports U-Boot image offset based on run-time detection of the boot partition. Use this feature to make the same generated image support both SD card and eMMC boot partition. Signed-off-by: Baruch Siach --- configs/clearfog_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig index b7b886be4f7a..3609445c1e95 100644 --- a/configs/clearfog_defconfig +++ b/configs/clearfog_defconfig @@ -22,7 +22,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_SPL_TEXT_BASE=0x4030 -CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x141 +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x1 While looking at this patch, shouldn't this new Kconfig symbol include "SECTOR" for better transparency? And why "DATA"? Perhaps use CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR_OFFSET? Any updates on this? Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 01/11] include: phy: define XFI and USXGMII interface types
Drivers currently use XGMII for XFI and USXGMII and, where needed, use other information to identify the actual protocol on the board. With these two defined drivers can now rely on DT phy-mode property. Signed-off-by: Alex Marginean --- include/phy_interface.h | 4 1 file changed, 4 insertions(+) diff --git a/include/phy_interface.h b/include/phy_interface.h index c6823189f8..73f3a3679c 100644 --- a/include/phy_interface.h +++ b/include/phy_interface.h @@ -31,6 +31,8 @@ typedef enum { PHY_INTERFACE_MODE_XLAUI, PHY_INTERFACE_MODE_CAUI2, PHY_INTERFACE_MODE_CAUI4, + PHY_INTERFACE_MODE_XFI, + PHY_INTERFACE_MODE_USXGMII, PHY_INTERFACE_MODE_NONE,/* Must be last */ PHY_INTERFACE_MODE_COUNT, @@ -58,6 +60,8 @@ static const char * const phy_interface_strings[] = { [PHY_INTERFACE_MODE_XLAUI] = "xlaui4", [PHY_INTERFACE_MODE_CAUI2] = "caui2", [PHY_INTERFACE_MODE_CAUI4] = "caui4", + [PHY_INTERFACE_MODE_XFI]= "xfi", + [PHY_INTERFACE_MODE_USXGMII]= "usxgmii", [PHY_INTERFACE_MODE_NONE] = "", }; -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 00/11] Aquantia PHY driver updates to reduce FW dependency
The main purpose of this patch series is to allow the AQR driver to run on a larger number of boards without having to use a custom aquantia FW on each of them. Configuration points that are exclusively controlled by PHY firmware are not configured based on phydev->interface as well as new DT node properties. The patch set introduces a couple of new interface types (XFI and USXGMII), introduces a couple of binding documents and updates the ENETC eth driver to use the new interface types. Changes in v2: - Flip USX AN bit both ways as needed, in v1 it was only set for USXGMII but not reset for XFI - Use CONFIG_DM_ETH instead of CONFIG_OF_CONTROL around the codeu using phydev->node - Use variable name interface instead of if_type for consistency with the rest of the code. Alex Marginean (11): include: phy: define XFI and USXGMII interface types include: phy: add data field for private driver data drivers: net: aquantia: use XFI, USXGMII interface types drivers: net: aquantia: add PHY generation information drivers: net: aquantia: set up SI protocol based on interface type drivers: net: aquantia: set MDI reversal based on DT property drivers: net: aquantia: set SMBus addr based on DT property drivers: net: aquantia: use SI and LI status in loop waiting for link up doc: bindings: add bindings document for PHY nodes doc: bindings: Aquantia PHY node binding drivers: net: fsl_enetc: use XFI, USXGMII interface type macros doc/device-tree-bindings/net/aquantia-phy.txt | 25 ++ doc/device-tree-bindings/net/phy.txt | 24 ++ drivers/net/fsl_enetc.c | 2 + drivers/net/phy/aquantia.c| 229 -- include/phy.h | 3 + include/phy_interface.h | 4 + 6 files changed, 268 insertions(+), 19 deletions(-) create mode 100644 doc/device-tree-bindings/net/aquantia-phy.txt create mode 100644 doc/device-tree-bindings/net/phy.txt -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 03/11] drivers: net: aquantia: use XFI, USXGMII interface types
The PHY supports XFI and USXGMII, the notable difference being that USX AN is enabled for USXGMII. Legacy code uses XGMII for any 10G proto and detects whether USX AN should be enabled or not using a PHY status register. Keep that functionality too, so we don't break existing drivers. Signed-off-by: Razvan Ionut Cirjan Signed-off-by: Alex Marginean --- drivers/net/phy/aquantia.c | 47 ++ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c index 465ec2d342..7be1a40608 100644 --- a/drivers/net/phy/aquantia.c +++ b/drivers/net/phy/aquantia.c @@ -256,8 +256,10 @@ static int aquantia_upload_firmware(struct phy_device *phydev) int aquantia_config(struct phy_device *phydev) { + int interface = phydev->interface; u32 val, id, rstatus, fault; u32 reg_val1 = 0; + int usx_an = 0; id = phy_read(phydev, MDIO_MMD_VEND1, GLOBAL_FIRMWARE_ID); rstatus = phy_read(phydev, MDIO_MMD_VEND1, GLOBAL_RSTATUS_1); @@ -278,17 +280,34 @@ int aquantia_config(struct phy_device *phydev) if (ret != 0) return ret; } + /* +* for backward compatibility convert XGMII into either XFI or USX based +* on FW config +*/ + if (interface == PHY_INTERFACE_MODE_XGMII) { + reg_val1 = phy_read(phydev, MDIO_MMD_PHYXS, + AQUANTIA_SYSTEM_INTERFACE_SR); + if ((reg_val1 & AQUANTIA_SI_IN_USE_MASK) == AQUANTIA_SI_USXGMII) + interface = PHY_INTERFACE_MODE_USXGMII; + else + interface = PHY_INTERFACE_MODE_XFI; + } val = phy_read(phydev, MDIO_MMD_PMAPMD, MII_BMCR); - if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { + switch (interface) { + case PHY_INTERFACE_MODE_SGMII: /* 1000BASE-T mode */ phydev->advertising = SUPPORTED_1000baseT_Full; phydev->supported = phydev->advertising; val = (val & ~AQUNTIA_SPEED_LSB_MASK) | AQUNTIA_SPEED_MSB_MASK; phy_write(phydev, MDIO_MMD_PMAPMD, MII_BMCR, val); - } else if (phydev->interface == PHY_INTERFACE_MODE_XGMII) { + break; + case PHY_INTERFACE_MODE_USXGMII: + usx_an = 1; + /* FALLTHROUGH */ + case PHY_INTERFACE_MODE_XFI: /* 10GBASE-T mode */ phydev->advertising = SUPPORTED_1baseT_Full; phydev->supported = phydev->advertising; @@ -299,40 +318,40 @@ int aquantia_config(struct phy_device *phydev) AQUNTIA_SPEED_LSB_MASK | AQUNTIA_SPEED_MSB_MASK); - val = phy_read(phydev, MDIO_MMD_PHYXS, - AQUANTIA_SYSTEM_INTERFACE_SR); /* If SI is USXGMII then start USXGMII autoneg */ - if ((val & AQUANTIA_SI_IN_USE_MASK) == AQUANTIA_SI_USXGMII) { - reg_val1 = phy_read(phydev, MDIO_MMD_PHYXS, -AQUANTIA_VENDOR_PROVISIONING_REG); + reg_val1 = phy_read(phydev, MDIO_MMD_PHYXS, +AQUANTIA_VENDOR_PROVISIONING_REG); + if (usx_an) { reg_val1 |= AQUANTIA_USX_AUTONEG_CONTROL_ENA; - - phy_write(phydev, MDIO_MMD_PHYXS, - AQUANTIA_VENDOR_PROVISIONING_REG, - reg_val1); printf("%s: system interface USXGMII\n", phydev->dev->name); } else { + reg_val1 &= ~AQUANTIA_USX_AUTONEG_CONTROL_ENA; printf("%s: system interface XFI\n", phydev->dev->name); } - } else if (phydev->interface == PHY_INTERFACE_MODE_SGMII_2500) { + phy_write(phydev, MDIO_MMD_PHYXS, + AQUANTIA_VENDOR_PROVISIONING_REG, reg_val1); + break; + case PHY_INTERFACE_MODE_SGMII_2500: /* 2.5GBASE-T mode */ phydev->advertising = SUPPORTED_1000baseT_Full; phydev->supported = phydev->advertising; phy_write(phydev, MDIO_MMD_AN, AQUNTIA_10G_CTL, 1); phy_write(phydev, MDIO_MMD_AN, AQUNTIA_VENDOR_P1, 0x9440); - } else if (phydev->interface == PHY_INTERFACE_MODE_MII) { + break; + case PHY_INTERFACE_MODE_MII: /* 100BASE-TX mode */ phydev->advertising = SUPPORTED_100baseT_Full; phydev->supported = phydev->advertising; val = (val & ~AQUNTIA_SPEED_MSB_MASK) | AQUNTIA_SPEED_LSB_MASK; phy_write(phydev, MDIO_MMD_PMAPMD, MII_BMCR, val); - }
[U-Boot] [PATCH v2 02/11] include: phy: add data field for private driver data
This is useful to carry custom information between the driver structure associated with a specific HW and the driver code. Signed-off-by: Alex Marginean --- include/phy.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/phy.h b/include/phy.h index f4530faeb9..58455d6493 100644 --- a/include/phy.h +++ b/include/phy.h @@ -110,6 +110,9 @@ struct phy_driver { u16 val); struct list_head list; + + /* driver private data */ + ulong data; }; struct phy_device { -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 06/11] drivers: net: aquantia: set MDI reversal based on DT property
MDI pins up to the RJ45 connector may be reversed on the board and the default PHY configuration applied by firmware may or may not match that. Add an optional DT property to configure MDI reversal for this case. Signed-off-by: Alex Marginean --- drivers/net/phy/aquantia.c | 39 ++ 1 file changed, 39 insertions(+) diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c index 52d5b5b7b1..1f3f4ccca1 100644 --- a/drivers/net/phy/aquantia.c +++ b/drivers/net/phy/aquantia.c @@ -64,6 +64,13 @@ #define UP_RUN_STALL_OVERRIDE BIT(6) #define UP_RUN_STALL BIT(0) +#define AQUANTIA_PMA_RX_VENDOR_P1 0xe400 +#define AQUANTIA_PMA_RX_VENDOR_P1_MDI_MSK GENMASK(1, 0) +/* MDI reversal configured through registers */ +#define AQUANTIA_PMA_RX_VENDOR_P1_MDI_CFG BIT(1) +/* MDI reversal enabled */ +#define AQUANTIA_PMA_RX_VENDOR_P1_MDI_REV BIT(0) + /* * global start rate, the protocol associated with this speed is used by default * on SI. @@ -324,6 +331,36 @@ static int aquantia_set_proto(struct phy_device *phydev) return 0; } +static int aquantia_dts_config(struct phy_device *phydev) +{ +#ifdef CONFIG_DM_ETH + ofnode node = phydev->node; + u32 prop; + u16 reg; + + /* this code only works on gen2 and gen3 PHYs */ + if (phydev->drv->data != AQUANTIA_GEN2 && + phydev->drv->data != AQUANTIA_GEN3) + return -ENOTSUPP; + + if (!ofnode_valid(node)) + return 0; + + if (!ofnode_read_u32(node, "mdi-reversal", &prop)) { + debug("mdi-reversal = %d\n", (int)prop); + reg = phy_read(phydev, MDIO_MMD_PMAPMD, + AQUANTIA_PMA_RX_VENDOR_P1); + reg &= ~AQUANTIA_PMA_RX_VENDOR_P1_MDI_MSK; + reg |= AQUANTIA_PMA_RX_VENDOR_P1_MDI_CFG; + reg |= prop ? AQUANTIA_PMA_RX_VENDOR_P1_MDI_REV : 0; + phy_write(phydev, MDIO_MMD_PMAPMD, AQUANTIA_PMA_RX_VENDOR_P1, + reg); + } + +#endif + return 0; +} + static bool aquantia_link_is_up(struct phy_device *phydev) { u16 reg, regmask; @@ -403,6 +440,8 @@ int aquantia_config(struct phy_device *phydev) /* configure protocol based on phydev->interface */ aquantia_set_proto(phydev); + /* apply custom configuration based on DT */ + aquantia_dts_config(phydev); /* wake PHY back up */ phy_write(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GLOBAL_SC, 0); -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 09/11] doc: bindings: add bindings document for PHY nodes
It defines that PHY nodes must be children on MDIO bus nodes and defines the only required property in U-Boot, reg. This property along with the example provided are copied over from Linux. Signed-off-by: Alex Marginean --- doc/device-tree-bindings/net/phy.txt | 24 1 file changed, 24 insertions(+) create mode 100644 doc/device-tree-bindings/net/phy.txt diff --git a/doc/device-tree-bindings/net/phy.txt b/doc/device-tree-bindings/net/phy.txt new file mode 100644 index 00..6599c667b5 --- /dev/null +++ b/doc/device-tree-bindings/net/phy.txt @@ -0,0 +1,24 @@ +PHY nodes + +If the device tree is used to describe networking interfaces, U-Boot expects a +node for each PHY. Parent node for such a PHY node is expected to correspond to +a MDIO bus and the bus is used to access the PHY. + +Required properties: + + - reg : The ID number for the phy, usually a small integer + +Example: + +ethernet-phy@0 { + compatible = "ethernet-phy-id0141.0e90", "ethernet-phy-ieee802.3-c22"; + interrupt-parent = <&PIC>; + interrupts = <35 IRQ_TYPE_EDGE_RISING>; + reg = <0>; + + resets = <&rst 8>; + reset-names = "phy"; + reset-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; + reset-assert-us = <1000>; + reset-deassert-us = <2000>; +}; -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 05/11] drivers: net: aquantia: set up SI protocol based on interface type
If PHY is not ready for data by the time _config is called, reconfigure the PHY system interface to use the proper protocol based on phydev->interface, just in case the defaults set by PHY firmware don't match current configuration. Signed-off-by: Alex Marginean --- drivers/net/phy/aquantia.c | 110 + 1 file changed, 110 insertions(+) diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c index c4f11f2860..52d5b5b7b1 100644 --- a/drivers/net/phy/aquantia.c +++ b/drivers/net/phy/aquantia.c @@ -21,6 +21,7 @@ #define AQUNTIA_SPEED_MSB_MASK 0x40 #define AQUANTIA_SYSTEM_INTERFACE_SR 0xe812 +#define AQUANTIA_SYSTEM_INTERFACE_SR_READYBIT(0) #define AQUANTIA_VENDOR_PROVISIONING_REG 0xC441 #define AQUANTIA_FIRMWARE_ID0x20 #define AQUANTIA_RESERVED_STATUS0xc885 @@ -33,6 +34,9 @@ #define AQUANTIA_SI_USXGMII 0x0018 /* registers in MDIO_MMD_VEND1 region */ +#define AQUANTIA_VND1_GLOBAL_SC0x000 +#define AQUANTIA_VND1_GLOBAL_SC_LPBIT(0xb) + #define GLOBAL_FIRMWARE_ID 0x20 #define GLOBAL_FAULT 0xc850 #define GLOBAL_RSTATUS_1 0xc885 @@ -60,6 +64,26 @@ #define UP_RUN_STALL_OVERRIDE BIT(6) #define UP_RUN_STALL BIT(0) +/* + * global start rate, the protocol associated with this speed is used by default + * on SI. + */ +#define AQUANTIA_VND1_GSTART_RATE 0x31a +#define AQUANTIA_VND1_GSTART_RATE_OFF 0 +#define AQUANTIA_VND1_GSTART_RATE_100M1 +#define AQUANTIA_VND1_GSTART_RATE_1G 2 +#define AQUANTIA_VND1_GSTART_RATE_10G 3 +#define AQUANTIA_VND1_GSTART_RATE_2_5G4 +#define AQUANTIA_VND1_GSTART_RATE_5G 5 + +/* SYSCFG registers for 100M, 1G, 2.5G, 5G, 10G */ +#define AQUANTIA_VND1_GSYSCFG_BASE 0x31b +#define AQUANTIA_VND1_GSYSCFG_100M 0 +#define AQUANTIA_VND1_GSYSCFG_1G 1 +#define AQUANTIA_VND1_GSYSCFG_2_5G 2 +#define AQUANTIA_VND1_GSYSCFG_5G 3 +#define AQUANTIA_VND1_GSYSCFG_10G 4 + /* addresses of memory segments in the phy */ #define DRAM_BASE_ADDR 0x3FFE #define IRAM_BASE_ADDR 0x4000 @@ -260,6 +284,72 @@ static int aquantia_upload_firmware(struct phy_device *phydev) } #endif +struct { + u16 syscfg; + int cnt; + u16 start_rate; +} aquantia_syscfg[PHY_INTERFACE_MODE_COUNT] = { + [PHY_INTERFACE_MODE_SGMII] = {0x04b, AQUANTIA_VND1_GSYSCFG_1G, + AQUANTIA_VND1_GSTART_RATE_1G}, + [PHY_INTERFACE_MODE_SGMII_2500] = {0x144, AQUANTIA_VND1_GSYSCFG_2_5G, + AQUANTIA_VND1_GSTART_RATE_2_5G}, + [PHY_INTERFACE_MODE_XGMII] = {0x100, AQUANTIA_VND1_GSYSCFG_10G, + AQUANTIA_VND1_GSTART_RATE_10G}, + [PHY_INTERFACE_MODE_XFI] ={0x100, AQUANTIA_VND1_GSYSCFG_10G, + AQUANTIA_VND1_GSTART_RATE_10G}, + [PHY_INTERFACE_MODE_USXGMII] ={0x080, AQUANTIA_VND1_GSYSCFG_10G, + AQUANTIA_VND1_GSTART_RATE_10G}, +}; + +static int aquantia_set_proto(struct phy_device *phydev) +{ + int i; + + /* this code only works on gen2 and gen3 PHYs */ + if (phydev->drv->data != AQUANTIA_GEN2 && + phydev->drv->data != AQUANTIA_GEN3) + return -ENOTSUPP; + + if (!aquantia_syscfg[phydev->interface].cnt) + return 0; + + /* set the default rate to enable the SI link */ + phy_write(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GSTART_RATE, + aquantia_syscfg[phydev->interface].start_rate); + + for (i = 0; i <= aquantia_syscfg[phydev->interface].cnt; i++) + phy_write(phydev, MDIO_MMD_VEND1, + AQUANTIA_VND1_GSYSCFG_BASE + i, + aquantia_syscfg[phydev->interface].syscfg); + return 0; +} + +static bool aquantia_link_is_up(struct phy_device *phydev) +{ + u16 reg, regmask; + int devad, regnum; + + /* +* On Gen 2 and 3 we have a bit that indicates that both system and +* line side are ready for data, use that if possible. +*/ + if (phydev->drv->data == AQUANTIA_GEN2 || + phydev->drv->data == AQUANTIA_GEN3) { + devad = MDIO_MMD_PHYXS; + regnum = AQUANTIA_SYSTEM_INTERFACE_SR; + regmask = AQUANTIA_SYSTEM_INTERFACE_SR_READY; + } else { + devad = MDIO_MMD_AN; + regnum = MDIO_STAT1; + regmask = MDIO_AN_STAT1_COMPLETE; + } + /* the register should be latched, do a double read */ + phy_read(phydev, devad, regnum); + reg = phy_read(phydev, devad, regnum); + + return !!(reg & regmask); +} + int aquantia_config(struct phy_device *phydev) { int interface = phydev->interface; @@ -299,6
[U-Boot] [PATCH v2 04/11] drivers: net: aquantia: add PHY generation information
Uses the data field in phy_driver structure to identify the PHY generation. This is useful for custom configuration as non-generic PHY registers are not 100% compatible between generations. Signed-off-by: Alex Marginean --- drivers/net/phy/aquantia.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c index 7be1a40608..c4f11f2860 100644 --- a/drivers/net/phy/aquantia.c +++ b/drivers/net/phy/aquantia.c @@ -69,6 +69,12 @@ #define VERSION_STRING_OFFSET 0x0200 #define HEADER_OFFSET 0x300 +/* driver private data */ +#define AQUANTIA_NA0 +#define AQUANTIA_GEN1 1 +#define AQUANTIA_GEN2 2 +#define AQUANTIA_GEN3 3 + #pragma pack(1) struct fw_header { u8 padding[4]; @@ -452,6 +458,7 @@ struct phy_driver aqr105_driver = { .config = &aquantia_config, .startup = &aquantia_startup, .shutdown = &gen10g_shutdown, + .data = AQUANTIA_GEN1, }; struct phy_driver aqr106_driver = { @@ -478,6 +485,7 @@ struct phy_driver aqr107_driver = { .config = &aquantia_config, .startup = &aquantia_startup, .shutdown = &gen10g_shutdown, + .data = AQUANTIA_GEN2, }; struct phy_driver aqr112_driver = { @@ -491,6 +499,7 @@ struct phy_driver aqr112_driver = { .config = &aquantia_config, .startup = &aquantia_startup, .shutdown = &gen10g_shutdown, + .data = AQUANTIA_GEN3, }; struct phy_driver aqr405_driver = { @@ -504,6 +513,7 @@ struct phy_driver aqr405_driver = { .config = &aquantia_config, .startup = &aquantia_startup, .shutdown = &gen10g_shutdown, + .data = AQUANTIA_GEN1, }; struct phy_driver aqr412_driver = { @@ -517,6 +527,7 @@ struct phy_driver aqr412_driver = { .config = &aquantia_config, .startup = &aquantia_startup, .shutdown = &gen10g_shutdown, + .data = AQUANTIA_GEN3, }; int phy_aquantia_init(void) -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 07/11] drivers: net: aquantia: set SMBus addr based on DT property
Aquantia PHYs have a SMBus interface mostly used for debug. The addresses on this interface are normally set up by PHY firmware, but depending on the board they may end up not being unique. Add an optional DT property used to change SMBus address if needed. Signed-off-by: Alex Marginean --- drivers/net/phy/aquantia.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c index 1f3f4ccca1..8a3df692d1 100644 --- a/drivers/net/phy/aquantia.c +++ b/drivers/net/phy/aquantia.c @@ -91,6 +91,9 @@ #define AQUANTIA_VND1_GSYSCFG_5G 3 #define AQUANTIA_VND1_GSYSCFG_10G 4 +#define AQUANTIA_VND1_SMBUS0 0xc485 +#define AQUANTIA_VND1_SMBUS1 0xc495 + /* addresses of memory segments in the phy */ #define DRAM_BASE_ADDR 0x3FFE #define IRAM_BASE_ADDR 0x4000 @@ -356,6 +359,18 @@ static int aquantia_dts_config(struct phy_device *phydev) phy_write(phydev, MDIO_MMD_PMAPMD, AQUANTIA_PMA_RX_VENDOR_P1, reg); } + if (!ofnode_read_u32(node, "smb-addr", &prop)) { + debug("smb-addr = %x\n", (int)prop); + /* +* there are two addresses here, normally just one bus would +* be in use so we're setting both regs using the same DT +* property. +*/ + phy_write(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_SMBUS0, + (u16)(prop << 1)); + phy_write(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_SMBUS1, + (u16)(prop << 1)); + } #endif return 0; -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 08/11] drivers: net: aquantia: use SI and LI status in loop waiting for link up
In some cases the link on the system interface of the aquantia PHY comes up after the link on line interface. The link state loop only checks the line side, which may result in first packet sent being lost. Use aquantia_link_is_up instead, which checks both system and line side on gen 2/3 PHYs to avoid losing the 1st packet. Signed-off-by: Alex Marginean --- drivers/net/phy/aquantia.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c index 8a3df692d1..855a100656 100644 --- a/drivers/net/phy/aquantia.c +++ b/drivers/net/phy/aquantia.c @@ -543,17 +543,14 @@ int aquantia_startup(struct phy_device *phydev) phydev->duplex = DUPLEX_FULL; /* if the AN is still in progress, wait till timeout. */ - phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1); - reg = phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1); - if (!(reg & MDIO_AN_STAT1_COMPLETE)) { + if (!aquantia_link_is_up(phydev)) { printf("%s Waiting for PHY auto negotiation to complete", phydev->dev->name); do { udelay(1000); - reg = phy_read(phydev, MDIO_MMD_AN, MDIO_STAT1); if ((i++ % 500) == 0) printf("."); - } while (!(reg & MDIO_AN_STAT1_COMPLETE) && + } while (!aquantia_link_is_up(phydev) && i < (4 * PHY_ANEG_TIMEOUT)); if (i > PHY_ANEG_TIMEOUT) -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v1 0/4] spi: Split CONFIG_DM_SPI* to CONFIG_{SPL_TPL}DM_SPI*
On Mon, Aug 12, 2019 at 2:08 AM Lukasz Majewski wrote: > > This patch series introduces new SPL and TPL specific Kconfig entries for > DM_SPI* options. Such change allows using the spi driver in SPL/TPL or > U-Boot proper. > > First two patches - related to ls10{42}* NXP soc fix some issues with > defining the DM_SPI* defines in .h file instead of Kconfig. > > This series doesn't introduce build breaks, but board maintainers are kindly > asked to check if their boards still boots. > FYI, when I pulled the latest u-boot/master, this patch didn't apply cleanly, so I ended up having to skip a few items that wouldn't impact the da850-evm which boots from SPI flash. From what I can tell, this seems to work just fine on the da850-evm Tested-by: Adam Ford #da850-evm > > > Lukasz Majewski (4): > kconfig: Update comment regarding CONFIG_IS_ENABLED(FOO) for TPL > spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a) > spi: Move DM_SPI_FLASH and SPI_FLASH_DATAFLASH to Kconfig (for > ls1021aXXX) > spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI* > > arch/arm/Kconfig| 23 +-- > board/l+g/vinco/vinco.c | 4 ++-- > cmd/sf.c| 4 ++-- > cmd/spi.c | 6 +++--- > common/spl/Kconfig | 28 > configs/am57xx_evm_defconfig| 2 ++ > configs/am57xx_hs_evm_defconfig | 2 ++ > configs/am57xx_hs_evm_usb_defconfig | 2 ++ > configs/axm_defconfig | 2 ++ > configs/chromebook_link64_defconfig | 2 ++ > configs/chromebook_samus_tpl_defconfig | 4 > configs/dra7xx_evm_defconfig| 2 ++ > configs/dra7xx_hs_evm_defconfig | 2 ++ > configs/dra7xx_hs_evm_usb_defconfig | 2 ++ > configs/imx28_xea_defconfig | 2 ++ > configs/j721e_evm_a72_defconfig | 2 ++ > configs/j721e_evm_r5_defconfig | 2 ++ > configs/ls1021aiot_qspi_defconfig | 2 ++ > configs/ls1021aiot_sdcard_defconfig | 2 ++ > configs/ls1021aqds_qspi_defconfig | 1 + > configs/ls1021aqds_sdcard_qspi_defconfig| 1 + > configs/ls1021atwr_qspi_defconfig | 1 + > configs/sama5d2_xplained_spiflash_defconfig | 2 ++ > configs/sama5d3xek_spiflash_defconfig | 7 --- > configs/sama5d4_xplained_spiflash_defconfig | 2 ++ > configs/sama5d4ek_spiflash_defconfig| 2 ++ > configs/stm32mp15_basic_defconfig | 2 ++ > configs/taurus_defconfig| 2 ++ > drivers/mtd/spi/Makefile| 4 ++-- > drivers/mtd/spi/sf_probe.c | 8 > drivers/net/fm/fm.c | 4 ++-- > drivers/spi/Makefile| 2 +- > drivers/spi/atmel_spi.c | 4 ++-- > drivers/spi/davinci_spi.c | 6 +++--- > drivers/spi/fsl_dspi.c | 5 +++-- > drivers/spi/kirkwood_spi.c | 2 +- > drivers/spi/mxc_spi.c | 6 +++--- > drivers/spi/omap3_spi.c | 4 ++-- > drivers/spi/sh_qspi.c | 4 ++-- > env/sf.c| 2 +- > include/configs/ls1021aiot.h| 6 -- > include/configs/ls1021aqds.h| 8 > include/configs/ls1021atwr.h| 5 - > include/configs/ls1043a_common.h| 2 -- > include/linux/kconfig.h | 2 ++ > include/spi.h | 8 > include/spi_flash.h | 2 +- > test/dm/spi.c | 2 +- > 48 files changed, 137 insertions(+), 64 deletions(-) > > -- > 2.11.0 > ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 11/11] drivers: net: fsl_enetc: use XFI, USXGMII interface type macros
Apply 10G PCS init for USXGMII, XFI interface types. Signed-off-by: Alex Marginean --- drivers/net/fsl_enetc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/fsl_enetc.c b/drivers/net/fsl_enetc.c index 928d071815..ec0ac8b606 100644 --- a/drivers/net/fsl_enetc.c +++ b/drivers/net/fsl_enetc.c @@ -194,6 +194,8 @@ static void enetc_start_pcs(struct udevice *dev) enetc_init_rgmii(dev); break; case PHY_INTERFACE_MODE_XGMII: + case PHY_INTERFACE_MODE_USXGMII: + case PHY_INTERFACE_MODE_XFI: enetc_init_sxgmii(dev); break; }; -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 10/11] doc: bindings: Aquantia PHY node binding
A couple of optional properties have been introduced for Aquantia PHY allowing the driver to set up wiring related configuration points that are otherwise driven by firmware. Signed-off-by: Alex Marginean --- doc/device-tree-bindings/net/aquantia-phy.txt | 25 +++ 1 file changed, 25 insertions(+) create mode 100644 doc/device-tree-bindings/net/aquantia-phy.txt diff --git a/doc/device-tree-bindings/net/aquantia-phy.txt b/doc/device-tree-bindings/net/aquantia-phy.txt new file mode 100644 index 00..89ce61e05b --- /dev/null +++ b/doc/device-tree-bindings/net/aquantia-phy.txt @@ -0,0 +1,25 @@ +PHY nodes for Aquantia devices. + +This text describes properties that are applicable to Aquantia PHY nodes in +addition to the bindings in phy.txt. + +Aquantia PHYs allow some flexibility in the way they are wired in a system, +they allow MDI pins to be reversed, LEDs linked up in different weays, have an +I2C slave interface that can be used for debug. Normally the configuration +corresponding to these is driven by the PHY firmware with the downside that +a custom firmware is needed for each integration of a PHY. +Several optional bindings are defined that allow these configuration points to +be driven by the PHY driver and reduce dependency on specific FW versions. + +Optional properties: +mdi-reversal: 0 or 1 indicating that reversal must be disabled/enabled. + Firmware default is used if the property is missing. +smb-addr: I2C/SMBus address to use, firmware default is used if the property + is missing. + +Example node: +phy@00 { + reg = <0x00>; + mdi-reversal = <1>; + smb-addr = <0x25>; +}; -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 00/11] Aquantia PHY driver updates to reduce FW dependency
On 8/8/2019 7:45 PM, Alex Marginean wrote: The main purpose of this patch series is to allow the AQR driver to run on a larger number of boards without having to use a custom aquantia FW on each of them. Configuration points that are exclusively controlled by PHY firmware are not configured based on phydev->interface as well as new DT node properties. The patch set introduces a couple of new interface types (XFI and USXGMII), introduces a couple of binding documents and updates the ENETC eth driver to use the new interface types. Alex Marginean (11): include: phy: define XFI and USXGMII interface types include: phy: add data field for private driver data drivers: net: aquantia: use XFI, USXGMII interface types drivers: net: aquantia: add PHY generation information drivers: net: aquantia: set up SI protocol based on interface type drivers: net: aquantia: set MDI reversal based on DT property drivers: net: aquantia: set SMBus addr based on DT property drivers: net: aquantia: use SI and LI status in loop waiting for link up doc: bindings: add bindings document for PHY nodes doc: bindings: Aquantia PHY node binding drivers: net: fsl_enetc: use XFI, USXGMII interface type macros doc/device-tree-bindings/net/aquantia-phy.txt | 25 ++ doc/device-tree-bindings/net/phy.txt | 24 ++ drivers/net/fsl_enetc.c | 2 + drivers/net/phy/aquantia.c| 219 -- include/phy.h | 3 + include/phy_interface.h | 4 + 6 files changed, 263 insertions(+), 14 deletions(-) create mode 100644 doc/device-tree-bindings/net/aquantia-phy.txt create mode 100644 doc/device-tree-bindings/net/phy.txt series superseded by https://patchwork.ozlabs.org/project/uboot/list/?series=124595 Thanks! Alex ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] cmd: avb: Fix requested partitions list
Hi all, On Mon, Aug 12, 2019 at 02:13:55PM +0300, Igor Opaniuk wrote: [..] > Current snapshot of libavb in U-boot is a bit out-dated (~2 years) and > before introducing patches that can leverage new features from the mainline > libavb(taking into account that you're referring to Jul 30, 2019 patch > 36d41d9223 ("Add AVB_SLOT_VERIFY_FLAGS_NO_VBMETA_PARTITION flag")) > it makes sense to update libavb in U-boot first: > > The best approach I see here (just to summarize what we've already discussed): > 1. Update libavb to the latest stable version FWIW, this sounds good. jFYI, U-Boot seems to contain the android-o-mr1-iot-preview-8 version of libavb (heuristics applied since commit [1] didn't include any information about the version). FWIW, in case of an alignment to AOSP, the list of libavb commits to be backported is shown in [2]. The diff stats is visible in [3]. FWIW w.r.t. integration strategy, we better use 'git cherry-pick --strategy=subtree -Xsubtree=lib/' instead of manual copying the libavb contents from https://android.googlesource.com/platform/external/avb/, since the latter would overwrite local U-Boot fixes like commit [4]. [1] https://gitlab.denx.de/u-boot/u-boot/commit/d8f9d2af96b38f ("avb2.0: add Android Verified Boot 2.0 library") [2] avb (master) git log --oneline --no-merges --no-decorate \ android-o-mr1-iot-preview-8..5fbb42a189aa -- libavb 36d41d922380 Add AVB_SLOT_VERIFY_FLAGS_NO_VBMETA_PARTITION flag. 3deffc556cfa Fix the identification of vbmeta partition 2ea684dbd612 Adds avb_strncmp helper 31f5f91352e6 Libavb: Check rollback index location against 0. 0a4e345d73f9 Fix a bug that may cause inifinite loop. d91e04e2c163 Fix a bug that would cause OoB read. 18b535905bab Fix a stack-use-after-scope bug. 5786fa2f2cfa Fix a memory leak bug. a6c9ad41f779 Fix a bug that would cause OoB memory read. 9ba3b6613b4e Fix AvbSlotVerifyData->cmdline might be NULL 5abd6bc25789 Allow system partition to be absent 8127dae6e4f5 Only automatically initialize new persistent digest values when locked 4f137c38f838 libavb: Use size_t instead of uint32_t for lengths in avb_sha*() functions. 818cf5674077 libavb: Only query partition GUIDs when the cmdline needs them. 49936b4c0109 libavb: Support vbmeta blobs in beginning of partition. 6f4de3181429 libavb: Add ERROR_MODE_MANAGED_RESTART_AND_EIO for managing dm-verity state. 2367b46287bd Implement initialization of new persistent digest values [3] avb (master) git diff --shortstat \ android-o-mr1-iot-preview-8..5fbb42a189aa -- libavb 12 files changed, 704 insertions(+), 208 deletions(-) [4] https://gitlab.denx.de/u-boot/u-boot/commit/ecc6f6bea6a2 ("libavb: Handle wrong hashtree_error_mode in avb_append_options()") -- Best Regards, Eugeniu. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [U-BOOT PATCH] riscv: sifive: fu540: set serial environment variable from otp
Hi Anup, On Mon, Aug 12, 2019 at 1:00 PM Anup Patel wrote: > > On Mon, Aug 12, 2019 at 12:12 PM Sagar Shrikant Kadam > wrote: > > > > This patch sets the serial# environment variable by reading the > > board serial number from the OTP memory region. > > > > Signed-off-by: Sagar Shrikant Kadam > > --- > > board/sifive/fu540/fu540.c | 18 ++ > > 1 file changed, 14 insertions(+), 4 deletions(-) > > > > diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c > > index 11daf1a..06bf442 100644 > > --- a/board/sifive/fu540/fu540.c > > +++ b/board/sifive/fu540/fu540.c > > @@ -122,10 +122,20 @@ static void fu540_setup_macaddr(u32 serialnum) > > > > int misc_init_r(void) > > { > > - /* Set ethaddr environment variable if not set */ > > - if (!env_get("ethaddr")) > > - fu540_setup_macaddr(fu540_read_serialnum()); > > - > > + u32 serial_num; > > + char buf[11] = {0}; > > + > > + /* Set ethaddr environment variable from board serial number */ > > + if (!env_get("serial#")) { > > + serial_num = fu540_read_serialnum(); > > + if (!serial_num) { > > + WARN(1, "Board serial number should not be 0 !!"); > > + return 0; > > + } > > + snprintf(buf, sizeof(buf), "%08x", serial_num); > > + env_set("serial#", buf); > > + fu540_setup_macaddr(serial_num); > > + } > > return 0; > > } > > > > -- > > 2.7.4 > > > > ___ > > U-Boot mailing list > > U-Boot@lists.denx.de > > https://lists.denx.de/listinfo/u-boot > > Looks good to me. > > Reviewed-by: Anup Patel > Thanks for the review. BR, Sagar > Regards, > Anup ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/3] spl: mmc: support uboot image offset on main partition
Hi Stefan, On Mon, Aug 12, 2019 at 03:13:58PM +0200, Stefan Roese wrote: > On 06.08.19 08:15, Stefan Roese wrote: > > On 29.07.19 09:12, Baruch Siach wrote: > > > On Armada 38x platforms the ROM code loads SPL from offset 0 of eMMC > > > hardware boot partitions. When there are no boot partitions (i.e. SD > > > card) the ROM skips the first sector that usually contains the (logical) > > > partition table. Since the generated .kwb image contains the main U-Boot > > > image in a fixed location (0x140 sectors by default), we end up with the > > > main U-Boot image in offset of 1 sector. The current workaround is to > > > manually set CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x141 to > > > compensate for that. > > > > > > This patch uses the run-time detected boot partition to determine the > > > right offset of the main U-Boot partition. The generated .kwb image is > > > now compatible with both eMMC boot partition, and SD card main data > > > partition. > > > > > > Signed-off-by: Baruch Siach > > > --- > > > v2: Rebase on top of current master > > > --- > > >common/spl/Kconfig | 12 > > >common/spl/spl_mmc.c | 15 +-- > > >2 files changed, 25 insertions(+), 2 deletions(-) > > > > > > diff --git a/common/spl/Kconfig b/common/spl/Kconfig > > > index 5d6da5db89bc..e43eefe046bc 100644 > > > --- a/common/spl/Kconfig > > > +++ b/common/spl/Kconfig > > > @@ -293,6 +293,18 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR > > > Address on the MMC to load U-Boot from, when the MMC is being > > > used > > > in raw mode. Units: MMC sectors (1 sector = 512 bytes). > > > +config SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET > > > + hex "U-Boot main hardware partition image offset" > > > + depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR > > > + default 0x0 > > > + help > > > + On some platforms SPL location depends on hardware partition. The ROM > > > + code skips the MBR sector when loading SPL from main hardware data > > > + partition. This adds offset to the main U-Boot image. Set this symbol > > > + to the number of skipped sectors. > > > + > > > + If unsure, leave the default. > > > + > > >config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION > > > bool "MMC Raw mode: by partition" > > > help > > > diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c > > > index b3619889f794..72439c029f4a 100644 > > > --- a/common/spl/spl_mmc.c > > > +++ b/common/spl/spl_mmc.c > > > @@ -49,6 +49,16 @@ static ulong h_spl_load_read(struct spl_load_info > > > *load, ulong sector, > > > return blk_dread(mmc_get_blk_desc(mmc), sector, count, buf); > > >} > > > +static __maybe_unused unsigned long spl_mmc_raw_uboot_offset(int part) > > > +{ > > > +#if IS_ENABLED(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR) > > > > Use if (IS_ENABLED()) instead ? CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET is not defined when CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is disabled. Using 'if (IS_ENABLED())' would break the build. > > > > > + if (part == 0) > > > > Why is this restricted to part == 0 ? As explained in the commit log, the ROM skips the first sector of the main data partition (where part == 0). Otherwise (where part != 0), the ROM load SPL from sector 0. That is the whole point of this patch set. Detect the SPL offset at run-time, instead of hard coding it at build time. > Any updates on this? Thanks for the reminder. I somehow missed your previous email. baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}ooO--U--Ooo{= - bar...@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/3] arm: mvebu: clearfog: set uboot image SD card offset
Hi Stefan, On Mon, Aug 12, 2019 at 03:14:16PM +0200, Stefan Roese wrote: > On 06.08.19 08:20, Stefan Roese wrote: > > On 29.07.19 09:12, Baruch Siach wrote: > > > Armada 38x ROM skips the first SD card offset when loading SPL. This > > > affects the location of the main U-Boot image. SPL MMC code now supports > > > U-Boot image offset based on run-time detection of the boot partition. > > > Use this feature to make the same generated image support both SD card > > > and eMMC boot partition. > > > > > > Signed-off-by: Baruch Siach > > > --- > > >configs/clearfog_defconfig | 2 +- > > >1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig > > > index b7b886be4f7a..3609445c1e95 100644 > > > --- a/configs/clearfog_defconfig > > > +++ b/configs/clearfog_defconfig > > > @@ -22,7 +22,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y > > ># CONFIG_DISPLAY_BOARDINFO is not set > > >CONFIG_DISPLAY_BOARDINFO_LATE=y > > >CONFIG_SPL_TEXT_BASE=0x4030 > > > -CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x141 > > > +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x1 > > > > While looking at this patch, shouldn't this new Kconfig symbol > > include "SECTOR" for better transparency? And why "DATA"? > > Perhaps use CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR_OFFSET? "DATA" is for the main eMMC data hardware partition, as opposed to boot partitions. This offset only applied to data partition. The symbol name should reflect that, I think. We could use CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_SECTOR_OFFSET. Isn't that too long? baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}ooO--U--Ooo{= - bar...@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [U-BOOT PATCH] riscv: sifive: fu540: set serial environment variable from otp
Hi Bin, On Mon, Aug 12, 2019 at 2:34 PM Bin Meng wrote: > > On Mon, Aug 12, 2019 at 2:42 PM Sagar Shrikant Kadam > wrote: > > > > This patch sets the serial# environment variable by reading the > > board serial number from the OTP memory region. > > > > Signed-off-by: Sagar Shrikant Kadam > > --- > > board/sifive/fu540/fu540.c | 18 ++ > > 1 file changed, 14 insertions(+), 4 deletions(-) > > > > diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c > > index 11daf1a..06bf442 100644 > > --- a/board/sifive/fu540/fu540.c > > +++ b/board/sifive/fu540/fu540.c > > @@ -122,10 +122,20 @@ static void fu540_setup_macaddr(u32 serialnum) > > > > int misc_init_r(void) > > { > > - /* Set ethaddr environment variable if not set */ > > - if (!env_get("ethaddr")) > > - fu540_setup_macaddr(fu540_read_serialnum()); > > - > > + u32 serial_num; > > + char buf[11] = {0}; > > buf[9] should be enough. > > > + > > + /* Set ethaddr environment variable from board serial number */ > > + if (!env_get("serial#")) { > > + serial_num = fu540_read_serialnum(); > > + if (!serial_num) { > > + WARN(1, "Board serial number should not be 0 !!"); > > nits: please use true instead of 1, and adding a '\n' at the end. > Thanks for your suggestions, I will incorporate these in the next version of this patch. BR, Sagar Kadam > > + return 0; > > + } > > + snprintf(buf, sizeof(buf), "%08x", serial_num); > > + env_set("serial#", buf); > > + fu540_setup_macaddr(serial_num); > > + } > > return 0; > > } > > Regards, > Bin ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [U-BOOT PATCH v1] set serial environment variable
This patch sets serial environment variable by reading the OTP memory region of FU540-C000 SoC which is mounted on HiFive Unleashed A00 board. The patch is based on master branch of[1] [1] https://gitlab.denx.de/u-boot/custodians/u-boot-riscv Following is the result: U-Boot 2019.10-rc1-03748-gab38b00-dirty (Aug 11 2019 - 23:14:27 -0700) CPU: rv64imafdc Model: SiFive HiFive Unleashed A00 DRAM: 8 GiB MMC: spi@1005:mmc@0: 0 In:serial@1001 Out: serial@1001 Err: serial@1001 Net: eth0: ethernet@1009 Hit any key to stop autoboot: 0 => env print serial# serial#=00d0 Change history against base patch: V1: -Reduced buf size by 2 bytes as suggested by Bin Meng. -Used true as argument to WARN message instead of 1. -Terminated the WARN message with newline. Sagar Shrikant Kadam (1): riscv: sifive: fu540: set serial environment variable from otp board/sifive/fu540/fu540.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [U-BOOT PATCH v1] riscv: sifive: fu540: set serial environment variable from otp
This patch sets the serial# environment variable by reading the board serial number from the OTP memory region. Signed-off-by: Sagar Shrikant Kadam Reviewed-by: Anup Patel --- board/sifive/fu540/fu540.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c index 11daf1a..47a2090 100644 --- a/board/sifive/fu540/fu540.c +++ b/board/sifive/fu540/fu540.c @@ -122,10 +122,20 @@ static void fu540_setup_macaddr(u32 serialnum) int misc_init_r(void) { - /* Set ethaddr environment variable if not set */ - if (!env_get("ethaddr")) - fu540_setup_macaddr(fu540_read_serialnum()); - + u32 serial_num; + char buf[9] = {0}; + + /* Set ethaddr environment variable from board serial number */ + if (!env_get("serial#")) { + serial_num = fu540_read_serialnum(); + if (!serial_num) { + WARN(true, "Board serial number should not be 0 !!\n"); + return 0; + } + snprintf(buf, sizeof(buf), "%08x", serial_num); + env_set("serial#", buf); + fu540_setup_macaddr(serial_num); + } return 0; } -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v4 1/3] rockchip: rk3399: derive ethaddr from cpuid
Generate a MAC address based on the cpuid available in the efuse block: Use the first 6 byte of the cpuid's SHA256 hash and set the locally administered bits. Also ensure that the multicast bit is cleared. The MAC address is only generated and set if there is no ethaddr present in the saved environment. This is based off of Klaus Goger's work in 8adc9d Signed-off-by: Rohan Garg --- arch/arm/include/asm/arch-rockchip/misc.h | 13 +++ arch/arm/mach-rockchip/Makefile | 4 + arch/arm/mach-rockchip/board.c| 21 arch/arm/mach-rockchip/misc.c | 114 ++ 4 files changed, 152 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/misc.h create mode 100644 arch/arm/mach-rockchip/misc.c diff --git a/arch/arm/include/asm/arch-rockchip/misc.h b/arch/arm/include/asm/arch-rockchip/misc.h new file mode 100644 index 00..b6b03c934e --- /dev/null +++ b/arch/arm/include/asm/arch-rockchip/misc.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * RK3399: Architecture common definitions + * + * Copyright (C) 2019 Collabora Inc - https://www.collabora.com/ + * Rohan Garg + */ + +int rockchip_cpuid_from_efuse(const u32 cpuid_offset, + const u32 cpuid_length, + u8 *cpuid); +int rockchip_cpuid_set(const u8 *cpuid, const u32 cpuid_length); +int rockchip_setup_macaddr(void); diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index aed379a0dc..207f900011 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -25,6 +25,10 @@ endif obj-$(CONFIG_$(SPL_TPL_)RAM) += sdram_common.o +ifdef CONFIG_MISC_INIT_R +obj-y += misc.o +endif + obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036/ obj-$(CONFIG_ROCKCHIP_RK3128) += rk3128/ ifndef CONFIG_TPL_BUILD diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index b2a88e789d..4a30a1865e 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -11,6 +11,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -102,3 +103,23 @@ int fastboot_set_reboot_flag(void) return 0; } #endif + +__weak int misc_init_r(void) +{ + const u32 cpuid_offset = 0x7; + const u32 cpuid_length = 0x10; + u8 cpuid[cpuid_length]; + int ret; + + ret = rockchip_cpuid_from_efuse(cpuid_offset, cpuid_length, cpuid); + if (ret) + return ret; + + ret = rockchip_cpuid_set(cpuid, cpuid_length); + if (ret) + return ret; + + ret = rockchip_setup_macaddr(); + + return ret; +} diff --git a/arch/arm/mach-rockchip/misc.c b/arch/arm/mach-rockchip/misc.c new file mode 100644 index 00..2144b41eae --- /dev/null +++ b/arch/arm/mach-rockchip/misc.c @@ -0,0 +1,114 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * RK3399: Architecture common definitions + * + * Copyright (C) 2019 Collabora Inc - https://www.collabora.com/ + * Rohan Garg + * + * Based on puma-rk3399.c: + * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH + */ + +#include +#include +#include +#include +#include +#include + +#include + +int rockchip_setup_macaddr(void) +{ +#if CONFIG_IS_ENABLED(CMD_NET) + int ret; + const char *cpuid = env_get("cpuid#"); + u8 hash[SHA256_SUM_LEN]; + int size = sizeof(hash); + u8 mac_addr[6]; + + /* Only generate a MAC address, if none is set in the environment */ + if (env_get("ethaddr")) + return -1; + + if (!cpuid) { + debug("%s: could not retrieve 'cpuid#'\n", __func__); + return -1; + } + + ret = hash_block("sha256", (void *)cpuid, strlen(cpuid), hash, &size); + if (ret) { + debug("%s: failed to calculate SHA256\n", __func__); + return -1; + } + + /* Copy 6 bytes of the hash to base the MAC address on */ + memcpy(mac_addr, hash, 6); + + /* Make this a valid MAC address and set it */ + mac_addr[0] &= 0xfe; /* clear multicast bit */ + mac_addr[0] |= 0x02; /* set local assignment bit (IEEE802) */ + eth_env_set_enetaddr("ethaddr", mac_addr); +#endif + return 0; +} + +int rockchip_cpuid_from_efuse(const u32 cpuid_offset, + const u32 cpuid_length, + u8 *cpuid) +{ +#if CONFIG_IS_ENABLED(ROCKCHIP_EFUSE) + struct udevice *dev; + int ret; + + /* retrieve the device */ + ret = uclass_get_device_by_driver(UCLASS_MISC, + DM_GET_DRIVER(rockchip_efuse), &dev); + if (ret) { + debug("%s: could not find efuse device\n", __func__); + return -1; + } + + /* read the cpu_id range from the efuses */ + ret = misc_read(dev, cpuid_offset, cpuid, sizeof(cpuid)); + if (ret) {
[U-Boot] [PATCH v4 2/3] rockchip: rk3399: Enable CONFIG_MISC_INIT_R for the Rock PI 4
This enables us to set a static MAC address Signed-off-by: Rohan Garg --- configs/rock-pi-4-rk3399_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/rock-pi-4-rk3399_defconfig b/configs/rock-pi-4-rk3399_defconfig index 14ae39a561..602be5a928 100644 --- a/configs/rock-pi-4-rk3399_defconfig +++ b/configs/rock-pi-4-rk3399_defconfig @@ -56,3 +56,4 @@ CONFIG_USB_ETHER_SMSC95XX=y CONFIG_USE_TINY_PRINTF=y CONFIG_SPL_TINY_MEMSET=y CONFIG_ERRNO_STR=y +CONFIG_MISC_INIT_R=y -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v4 3/3] board: puma: Use rockchip_* helpers to setup cpuid and macaddr
We should use the shared helpers to setup the necessary parts Signed-off-by: Rohan Garg --- .../puma_rk3399/puma-rk3399.c | 108 +++--- 1 file changed, 18 insertions(+), 90 deletions(-) diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c index a7e7f022ba..562a6ec9c8 100644 --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c @@ -18,97 +18,10 @@ #include #include #include +#include #include #include -static void setup_macaddr(void) -{ -#if CONFIG_IS_ENABLED(CMD_NET) - int ret; - const char *cpuid = env_get("cpuid#"); - u8 hash[SHA256_SUM_LEN]; - int size = sizeof(hash); - u8 mac_addr[6]; - - /* Only generate a MAC address, if none is set in the environment */ - if (env_get("ethaddr")) - return; - - if (!cpuid) { - debug("%s: could not retrieve 'cpuid#'\n", __func__); - return; - } - - ret = hash_block("sha256", (void *)cpuid, strlen(cpuid), hash, &size); - if (ret) { - debug("%s: failed to calculate SHA256\n", __func__); - return; - } - - /* Copy 6 bytes of the hash to base the MAC address on */ - memcpy(mac_addr, hash, 6); - - /* Make this a valid MAC address and set it */ - mac_addr[0] &= 0xfe; /* clear multicast bit */ - mac_addr[0] |= 0x02; /* set local assignment bit (IEEE802) */ - eth_env_set_enetaddr("ethaddr", mac_addr); -#endif -} - -static void setup_serial(void) -{ -#if CONFIG_IS_ENABLED(ROCKCHIP_EFUSE) - const u32 cpuid_offset = 0x7; - const u32 cpuid_length = 0x10; - - struct udevice *dev; - int ret, i; - u8 cpuid[cpuid_length]; - u8 low[cpuid_length/2], high[cpuid_length/2]; - char cpuid_str[cpuid_length * 2 + 1]; - u64 serialno; - char serialno_str[17]; - - /* retrieve the device */ - ret = uclass_get_device_by_driver(UCLASS_MISC, - DM_GET_DRIVER(rockchip_efuse), &dev); - if (ret) { - debug("%s: could not find efuse device\n", __func__); - return; - } - - /* read the cpu_id range from the efuses */ - ret = misc_read(dev, cpuid_offset, &cpuid, sizeof(cpuid)); - if (ret) { - debug("%s: reading cpuid from the efuses failed\n", - __func__); - return; - } - - memset(cpuid_str, 0, sizeof(cpuid_str)); - for (i = 0; i < 16; i++) - sprintf(&cpuid_str[i * 2], "%02x", cpuid[i]); - - debug("cpuid: %s\n", cpuid_str); - - /* -* Mix the cpuid bytes using the same rules as in -* ${linux}/drivers/soc/rockchip/rockchip-cpuinfo.c -*/ - for (i = 0; i < 8; i++) { - low[i] = cpuid[1 + (i << 1)]; - high[i] = cpuid[i << 1]; - } - - serialno = crc32_no_comp(0, low, 8); - serialno |= (u64)crc32_no_comp(serialno, high, 8) << 32; - snprintf(serialno_str, sizeof(serialno_str), "%016llx", serialno); - - env_set("cpuid#", cpuid_str); - env_set("serial#", serialno_str); -#endif -} - static void setup_iodomain(void) { const u32 GRF_IO_VSEL_GPIO4CD_SHIFT = 3; @@ -198,8 +111,23 @@ static int setup_boottargets(void) int misc_init_r(void) { - setup_serial(); - setup_macaddr(); + const u32 cpuid_offset = 0x7; + const u32 cpuid_length = 0x10; + u8 cpuid[cpuid_length]; + int ret; + + ret = rockchip_cpuid_from_efuse(cpuid_offset, cpuid_length, cpuid); + if (ret) + return ret; + + ret = rockchip_cpuid_set(cpuid, cpuid_length); + if (ret) + return ret; + + ret = rockchip_setup_macaddr(); + if (ret) + return ret; + setup_iodomain(); setup_boottargets(); -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [U-BOOT PATCH v1] riscv: sifive: fu540: set serial environment variable from otp
On Mon, Aug 12, 2019 at 10:58 PM Sagar Shrikant Kadam wrote: > > This patch sets the serial# environment variable by reading the > board serial number from the OTP memory region. > > Signed-off-by: Sagar Shrikant Kadam > Reviewed-by: Anup Patel > --- > board/sifive/fu540/fu540.c | 18 ++ > 1 file changed, 14 insertions(+), 4 deletions(-) > Reviewed-by: Bin Meng Tested-by: Bin Meng ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 2/2] gitlab-ci: Consolidate some testsuite jobs
We do not need to split binman, buildman, dtoc and patman test suite runs into 3 jobs. Instead, run them as a single job. Signed-off-by: Tom Rini --- .gitlab-ci.yml | 42 +++--- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 98e03d6ffb43..84e79bf03218 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -145,36 +145,24 @@ Build tools-only: script: - make tools-only_config tools-only -j$(nproc) -# Run various tool tests -Run patman testsuite: +Run binman, buildman, dtoc and patman testsuites: tags: [ 'all' ] stage: testsuites script: -- git config --global user.name "GitLab CI Runner" -- git config --global user.email tr...@konsulko.com -- export USER=gitlab -- ./tools/patman/patman --test - -Run buildman testsuite: - tags: [ 'all' ] - stage: testsuites - script: -- export USER=gitlab -- ./tools/buildman/buildman -t - -Run binman and dtoc testsuite: - tags: [ 'all' ] - stage: testsuites - script: -- virtualenv /tmp/venv -- . /tmp/venv/bin/activate -- pip install pyelftools -- export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/sandbox_spl; - ./tools/buildman/buildman -P sandbox_spl && - export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"; - export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"; - ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test && - ./tools/dtoc/dtoc -t +- git config --global user.name "GitLab CI Runner"; + git config --global user.email tr...@konsulko.com; + export USER=gitlab; + virtualenv /tmp/venv; + . /tmp/venv/bin/activate; + pip install pyelftools; + export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/sandbox_spl; + export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"; + export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"; + ./tools/buildman/buildman -P sandbox_spl; + ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test; + ./tools/buildman/buildman -t; + ./tools/dtoc/dtoc -t; + ./tools/patman/patman --test # Test sandbox with test.py sandbox test.py: -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 1/2] gitlab-ci: Add USER environment variable to buildman/patman tests
The way that some of the tests here are designed, they expect USER to be set in the environment. This is not the case in the docker images, so set a reasonable value. Signed-off-by: Tom Rini --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0759561ce9a8..98e03d6ffb43 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -152,12 +152,14 @@ Run patman testsuite: script: - git config --global user.name "GitLab CI Runner" - git config --global user.email tr...@konsulko.com +- export USER=gitlab - ./tools/patman/patman --test Run buildman testsuite: tags: [ 'all' ] stage: testsuites script: +- export USER=gitlab - ./tools/buildman/buildman -t Run binman and dtoc testsuite: -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v1 0/4] spi: Split CONFIG_DM_SPI* to CONFIG_{SPL_TPL}DM_SPI*
Hi Adam, > On Mon, Aug 12, 2019 at 2:08 AM Lukasz Majewski wrote: > > > > This patch series introduces new SPL and TPL specific Kconfig > > entries for DM_SPI* options. Such change allows using the spi > > driver in SPL/TPL or U-Boot proper. > > > > First two patches - related to ls10{42}* NXP soc fix some issues > > with defining the DM_SPI* defines in .h file instead of > > Kconfig. > > > > This series doesn't introduce build breaks, but board maintainers > > are kindly asked to check if their boards still boots. > > > > FYI, when I pulled the latest u-boot/master, this patch didn't apply > cleanly, so I ended up having to skip a few items that wouldn't impact > the da850-evm which boots from SPI flash. I see. I've applied it on the newest master: SHA1: feb5a02f869d5678190dfc915ef6c2781b4f7a6c > > From what I can tell, this seems to work just fine on the da850-evm > > Tested-by: Adam Ford #da850-evm > Thanks for testing :-) > > > > > > Lukasz Majewski (4): > > kconfig: Update comment regarding CONFIG_IS_ENABLED(FOO) for TPL > > spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a) > > spi: Move DM_SPI_FLASH and SPI_FLASH_DATAFLASH to Kconfig (for > > ls1021aXXX) > > spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI* > > > > arch/arm/Kconfig| 23 > > +-- board/l+g/vinco/vinco.c > > | 4 ++-- cmd/sf.c| 4 ++-- > > cmd/spi.c | 6 +++--- > > common/spl/Kconfig | 28 > > configs/am57xx_evm_defconfig > > | 2 ++ configs/am57xx_hs_evm_defconfig | 2 ++ > > configs/am57xx_hs_evm_usb_defconfig | 2 ++ > > configs/axm_defconfig | 2 ++ > > configs/chromebook_link64_defconfig | 2 ++ > > configs/chromebook_samus_tpl_defconfig | 4 > > configs/dra7xx_evm_defconfig| 2 ++ > > configs/dra7xx_hs_evm_defconfig | 2 ++ > > configs/dra7xx_hs_evm_usb_defconfig | 2 ++ > > configs/imx28_xea_defconfig | 2 ++ > > configs/j721e_evm_a72_defconfig | 2 ++ > > configs/j721e_evm_r5_defconfig | 2 ++ > > configs/ls1021aiot_qspi_defconfig | 2 ++ > > configs/ls1021aiot_sdcard_defconfig | 2 ++ > > configs/ls1021aqds_qspi_defconfig | 1 + > > configs/ls1021aqds_sdcard_qspi_defconfig| 1 + > > configs/ls1021atwr_qspi_defconfig | 1 + > > configs/sama5d2_xplained_spiflash_defconfig | 2 ++ > > configs/sama5d3xek_spiflash_defconfig | 7 --- > > configs/sama5d4_xplained_spiflash_defconfig | 2 ++ > > configs/sama5d4ek_spiflash_defconfig| 2 ++ > > configs/stm32mp15_basic_defconfig | 2 ++ > > configs/taurus_defconfig| 2 ++ > > drivers/mtd/spi/Makefile| 4 ++-- > > drivers/mtd/spi/sf_probe.c | 8 > > drivers/net/fm/fm.c | 4 ++-- > > drivers/spi/Makefile| 2 +- > > drivers/spi/atmel_spi.c | 4 ++-- > > drivers/spi/davinci_spi.c | 6 +++--- > > drivers/spi/fsl_dspi.c | 5 +++-- > > drivers/spi/kirkwood_spi.c | 2 +- > > drivers/spi/mxc_spi.c | 6 +++--- > > drivers/spi/omap3_spi.c | 4 ++-- > > drivers/spi/sh_qspi.c | 4 ++-- > > env/sf.c| 2 +- > > include/configs/ls1021aiot.h| 6 -- > > include/configs/ls1021aqds.h| 8 > > include/configs/ls1021atwr.h| 5 - > > include/configs/ls1043a_common.h| 2 -- > > include/linux/kconfig.h | 2 ++ > > include/spi.h | 8 > > include/spi_flash.h | 2 +- > > test/dm/spi.c | 2 +- > > 48 files changed, 137 insertions(+), 64 deletions(-) > > > > -- > > 2.11.0 > > Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de pgpyVAgna0a3b.pgp Description: OpenPGP digital signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] travis.yml: change Ubuntu version to xenial
On Wed, Jul 17, 2019 at 08:24:18PM +0300, Ramon Fried wrote: > > > On July 17, 2019 7:42:30 PM GMT+03:00, Tom Rini wrote: > >On Wed, Jul 17, 2019 at 07:37:23PM +0300, Ramon Fried wrote: > >> > >> > >> On July 17, 2019 4:29:04 PM GMT+03:00, Tom Rini > >wrote: > >> >On Mon, Jul 15, 2019 at 03:26:27AM +0300, Ramon Fried wrote: > >> > > >> >> trusty is getting old, move to xenial (16.04) > >> >> to get updated gcc and other tools. > >> >> > >> >> Signed-off-by: Ramon Fried > >> >> --- > >> >> .travis.yml | 2 +- > >> >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> >> > >> >> diff --git a/.travis.yml b/.travis.yml > >> >> index c21ca4..1640fbb6dd 100644 > >> >> --- a/.travis.yml > >> >> +++ b/.travis.yml > >> >> @@ -4,7 +4,7 @@ > >> >> # build U-Boot on Travis CI - https://travis-ci.org/ > >> >> > >> >> sudo: required > >> >> -dist: trusty > >> >> +dist: xenial > >> >> > >> >> language: c > >> >> > >> > > >> >Oh good, they're finally not stuck on "Trusty". But I still think > >we > >> >need to move to GitLab CI runners instead, so we can have better > >> >control > >> >over (and provide resources for) running the builds instead. > >> This can be an intermediate state until movement to gitlab CI is > >complete. > >> Thanks, Ramon > > > >What's the case where things aren't working, today, that xenial fixes? > >And please note that the GitLab CI move is underway (I posted > >translating .travis.yml to .gitlab-ci.yml a while ago, now that the > >merge window is open I need to apply it, the current new travis stuff, > >and update it again). > host compilation with a more recent gcc compiler (5.4). instead of (4.8). > newer supporting packages. One other concern I have here (so please v2) is that we aren't updating the section to grab a "xenial" LLVM toolchain, just trusty still. Thanks! -- Tom signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [RFC PATCH] rockchip, Makefile: add u-boot-tpl-with-spl.img target
Hi Mark, On Sun, 11 Aug 2019 at 12:53, Mark Kettenis wrote: > > > From: Simon Glass > > Date: Sun, 11 Aug 2019 12:37:13 -0600 > > > > Hi, > > > > On Sun, 11 Aug 2019 at 07:51, Chris Webb wrote: > > > > > > Matwey V. Kornilov wrote: > > > > > > > Here, we introduce generic u-boot-tpl-with-spl.img target which is the > > > > TPL image followed by the SPL binary. > > > > > > Having built U-Boot TPL + SPL images over and over again for testing on > > > various rk3399 hardware, something like this would certainly be a > > > convenience. It would simplify instructions to end users too. > > > > How about using binman for rockchip? It is designed to put various > > images together. > > For a simple concatenation? Well, for producing an image that works. E.g. producing a full image (TPL, SPL and U-Boot) for an SD card - it would be nice to have u-boot-rockchip.sd.bin or something like that. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] Booting Linux kernel on x86_64
> On Aug 10, 2019, at 8:42 AM, Andy Shevchenko > wrote: > > You may try to enable 'earlyprintk=efi' (newer kernels have different > approach, i.e. 'earlycon=efifb') and also add 'keep_bootcon' to see if > the problem is at the beginning or ending stages of boot process. > > > > -- > With Best Regards, > Andy Shevchenko Andy, This worked for me and I was able to see that the kernel was booting but was unable to mount the rootfs. It also told me that my framebuffer isn’t being initialized properly so I wasn’t seeing screen output. Thanks much for the suggestions! Ryan Wilkins ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] core: ofnode: do not assert if node not valid in ofnode_get_name()【请注意,邮件由s...@google.com代发】
Hi Kever, On Sun, 11 Aug 2019 at 22:34, Kever Yang wrote: > > Hi Simon, > > > Who is suppose to apply this patch, it's delegate to Philipp now, > should I take it? I will leave that to you two. Regards, Simon > > > Thanks, > > - Kever > > On 2019/7/25 上午3:48, Simon Glass wrote: > > On Thu, 18 Jul 2019 at 20:24, Kever Yang wrote: > >> In some case with LIVE DT, some node always not valid, or not have > >> a valid name, eg. blk driver add by mmc. > >> Return fail instead of Assert for this kind of ofnode, and this > >> help with assert happen from time to time when of_live is enabled > >> and DEBUG is enabled. > >> > >> Signed-off-by: Kever Yang > >> --- > >> > >> drivers/core/ofnode.c | 6 +- > >> 1 file changed, 5 insertions(+), 1 deletion(-) > > Reviewed-by: Simon Glass > > > > ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] travis.yml: change Ubuntu version to xenial
On Mon, Aug 12, 2019 at 7:41 PM Tom Rini wrote: > > On Wed, Jul 17, 2019 at 08:24:18PM +0300, Ramon Fried wrote: > > > > > > On July 17, 2019 7:42:30 PM GMT+03:00, Tom Rini wrote: > > >On Wed, Jul 17, 2019 at 07:37:23PM +0300, Ramon Fried wrote: > > >> > > >> > > >> On July 17, 2019 4:29:04 PM GMT+03:00, Tom Rini > > >wrote: > > >> >On Mon, Jul 15, 2019 at 03:26:27AM +0300, Ramon Fried wrote: > > >> > > > >> >> trusty is getting old, move to xenial (16.04) > > >> >> to get updated gcc and other tools. > > >> >> > > >> >> Signed-off-by: Ramon Fried > > >> >> --- > > >> >> .travis.yml | 2 +- > > >> >> 1 file changed, 1 insertion(+), 1 deletion(-) > > >> >> > > >> >> diff --git a/.travis.yml b/.travis.yml > > >> >> index c21ca4..1640fbb6dd 100644 > > >> >> --- a/.travis.yml > > >> >> +++ b/.travis.yml > > >> >> @@ -4,7 +4,7 @@ > > >> >> # build U-Boot on Travis CI - https://travis-ci.org/ > > >> >> > > >> >> sudo: required > > >> >> -dist: trusty > > >> >> +dist: xenial > > >> >> > > >> >> language: c > > >> >> > > >> > > > >> >Oh good, they're finally not stuck on "Trusty". But I still think > > >we > > >> >need to move to GitLab CI runners instead, so we can have better > > >> >control > > >> >over (and provide resources for) running the builds instead. > > >> This can be an intermediate state until movement to gitlab CI is > > >complete. > > >> Thanks, Ramon > > > > > >What's the case where things aren't working, today, that xenial fixes? > > >And please note that the GitLab CI move is underway (I posted > > >translating .travis.yml to .gitlab-ci.yml a while ago, now that the > > >merge window is open I need to apply it, the current new travis stuff, > > >and update it again). > > host compilation with a more recent gcc compiler (5.4). instead of (4.8). > > newer supporting packages. > > One other concern I have here (so please v2) is that we aren't updating > the section to grab a "xenial" LLVM toolchain, just trusty still. > Thanks! I thought we dropped this altogether because of the move to gitlab. Aren't we ? Thanks, Ramon. > > -- > Tom ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] travis.yml: change Ubuntu version to xenial
On Mon, Aug 12, 2019 at 07:53:07PM +0300, Ramon Fried wrote: > On Mon, Aug 12, 2019 at 7:41 PM Tom Rini wrote: > > > > On Wed, Jul 17, 2019 at 08:24:18PM +0300, Ramon Fried wrote: > > > > > > > > > On July 17, 2019 7:42:30 PM GMT+03:00, Tom Rini > > > wrote: > > > >On Wed, Jul 17, 2019 at 07:37:23PM +0300, Ramon Fried wrote: > > > >> > > > >> > > > >> On July 17, 2019 4:29:04 PM GMT+03:00, Tom Rini > > > >wrote: > > > >> >On Mon, Jul 15, 2019 at 03:26:27AM +0300, Ramon Fried wrote: > > > >> > > > > >> >> trusty is getting old, move to xenial (16.04) > > > >> >> to get updated gcc and other tools. > > > >> >> > > > >> >> Signed-off-by: Ramon Fried > > > >> >> --- > > > >> >> .travis.yml | 2 +- > > > >> >> 1 file changed, 1 insertion(+), 1 deletion(-) > > > >> >> > > > >> >> diff --git a/.travis.yml b/.travis.yml > > > >> >> index c21ca4..1640fbb6dd 100644 > > > >> >> --- a/.travis.yml > > > >> >> +++ b/.travis.yml > > > >> >> @@ -4,7 +4,7 @@ > > > >> >> # build U-Boot on Travis CI - https://travis-ci.org/ > > > >> >> > > > >> >> sudo: required > > > >> >> -dist: trusty > > > >> >> +dist: xenial > > > >> >> > > > >> >> language: c > > > >> >> > > > >> > > > > >> >Oh good, they're finally not stuck on "Trusty". But I still think > > > >we > > > >> >need to move to GitLab CI runners instead, so we can have better > > > >> >control > > > >> >over (and provide resources for) running the builds instead. > > > >> This can be an intermediate state until movement to gitlab CI is > > > >complete. > > > >> Thanks, Ramon > > > > > > > >What's the case where things aren't working, today, that xenial fixes? > > > >And please note that the GitLab CI move is underway (I posted > > > >translating .travis.yml to .gitlab-ci.yml a while ago, now that the > > > >merge window is open I need to apply it, the current new travis stuff, > > > >and update it again). > > > host compilation with a more recent gcc compiler (5.4). instead of (4.8). > > > newer supporting packages. > > > > One other concern I have here (so please v2) is that we aren't updating > > the section to grab a "xenial" LLVM toolchain, just trusty still. > > Thanks! > > I thought we dropped this altogether because of the move to gitlab. > Aren't we ? While I personally would like to drop Travis, we do not have a good alternative for non-custodians to use as the free build resources from gitlab.com have the same "break the job up into tons of chunks" problem and not everyone has access to a faster-than-travis machine. -- Tom signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [RFC PATCH] rockchip, Makefile: add u-boot-tpl-with-spl.img target
> From: Simon Glass > Date: Mon, 12 Aug 2019 10:45:46 -0600 > > Hi Mark, > > On Sun, 11 Aug 2019 at 12:53, Mark Kettenis wrote: > > > > > From: Simon Glass > > > Date: Sun, 11 Aug 2019 12:37:13 -0600 > > > > > > Hi, > > > > > > On Sun, 11 Aug 2019 at 07:51, Chris Webb wrote: > > > > > > > > Matwey V. Kornilov wrote: > > > > > > > > > Here, we introduce generic u-boot-tpl-with-spl.img target which is the > > > > > TPL image followed by the SPL binary. > > > > > > > > Having built U-Boot TPL + SPL images over and over again for testing on > > > > various rk3399 hardware, something like this would certainly be a > > > > convenience. It would simplify instructions to end users too. > > > > > > How about using binman for rockchip? It is designed to put various > > > images together. > > > > For a simple concatenation? > > Well, for producing an image that works. E.g. producing a full image > (TPL, SPL and U-Boot) for an SD card - it would be nice to have > u-boot-rockchip.sd.bin or something like that. True. That'd be an image you write at certain offset I suppose so it preserves the MBR/partition tables? ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [RFC PATCH] rockchip, Makefile: add u-boot-tpl-with-spl.img target
Hi Mark, On Mon, 12 Aug 2019 at 10:56, Mark Kettenis wrote: > > > From: Simon Glass > > Date: Mon, 12 Aug 2019 10:45:46 -0600 > > > > Hi Mark, > > > > On Sun, 11 Aug 2019 at 12:53, Mark Kettenis wrote: > > > > > > > From: Simon Glass > > > > Date: Sun, 11 Aug 2019 12:37:13 -0600 > > > > > > > > Hi, > > > > > > > > On Sun, 11 Aug 2019 at 07:51, Chris Webb wrote: > > > > > > > > > > Matwey V. Kornilov wrote: > > > > > > > > > > > Here, we introduce generic u-boot-tpl-with-spl.img target which is > > > > > > the > > > > > > TPL image followed by the SPL binary. > > > > > > > > > > Having built U-Boot TPL + SPL images over and over again for testing > > > > > on > > > > > various rk3399 hardware, something like this would certainly be a > > > > > convenience. It would simplify instructions to end users too. > > > > > > > > How about using binman for rockchip? It is designed to put various > > > > images together. > > > > > > For a simple concatenation? > > > > Well, for producing an image that works. E.g. producing a full image > > (TPL, SPL and U-Boot) for an SD card - it would be nice to have > > u-boot-rockchip.sd.bin or something like that. > > True. That'd be an image you write at certain offset I suppose so it > preserves the MBR/partition tables? Well I suppose so, but I think it is also useful to write out the whole thing, so that it at least boots. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/1] network: set timeline for CONFIG_DM_ETH conversion
On Fri, 9 Aug 2019 at 16:10, Heinrich Schuchardt wrote: > > The driver model has been supported for network drivers since 2015. It is > time to convert the remaining boards. Set July 2020 as a timeline. > > Signed-off-by: Heinrich Schuchardt > --- > Makefile | 11 +++ > doc/driver-model/migration.rst | 8 > 2 files changed, 19 insertions(+) > Reviewed-by: Simon Glass ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2] travis.yml: change Ubuntu version to xenial
trusty is getting old, move to xenial (16.04) to get updated gcc and other tools. Signed-off-by: Ramon Fried --- v2: update llvm-toolchain also to xenial .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d330dda5b1..59d2e97fe0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ # build U-Boot on Travis CI - https://travis-ci.org/ sudo: required -dist: trusty +dist: xenial language: c @@ -12,7 +12,7 @@ addons: apt: sources: - ubuntu-toolchain-r-test -- llvm-toolchain-trusty-7 +- llvm-toolchain-xenial-7 packages: - cppcheck - sloccount @@ -61,7 +61,7 @@ install: env: global: -- PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin +- PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin:/usr/local/bin - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci - BUILD_DIR=build - HOSTCC="cc" -- 2.22.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] travis.yml: change Ubuntu version to xenial
On Mon, Aug 12, 2019 at 7:55 PM Tom Rini wrote: > > On Mon, Aug 12, 2019 at 07:53:07PM +0300, Ramon Fried wrote: > > On Mon, Aug 12, 2019 at 7:41 PM Tom Rini wrote: > > > > > > On Wed, Jul 17, 2019 at 08:24:18PM +0300, Ramon Fried wrote: > > > > > > > > > > > > On July 17, 2019 7:42:30 PM GMT+03:00, Tom Rini > > > > wrote: > > > > >On Wed, Jul 17, 2019 at 07:37:23PM +0300, Ramon Fried wrote: > > > > >> > > > > >> > > > > >> On July 17, 2019 4:29:04 PM GMT+03:00, Tom Rini > > > > >wrote: > > > > >> >On Mon, Jul 15, 2019 at 03:26:27AM +0300, Ramon Fried wrote: > > > > >> > > > > > >> >> trusty is getting old, move to xenial (16.04) > > > > >> >> to get updated gcc and other tools. > > > > >> >> > > > > >> >> Signed-off-by: Ramon Fried > > > > >> >> --- > > > > >> >> .travis.yml | 2 +- > > > > >> >> 1 file changed, 1 insertion(+), 1 deletion(-) > > > > >> >> > > > > >> >> diff --git a/.travis.yml b/.travis.yml > > > > >> >> index c21ca4..1640fbb6dd 100644 > > > > >> >> --- a/.travis.yml > > > > >> >> +++ b/.travis.yml > > > > >> >> @@ -4,7 +4,7 @@ > > > > >> >> # build U-Boot on Travis CI - https://travis-ci.org/ > > > > >> >> > > > > >> >> sudo: required > > > > >> >> -dist: trusty > > > > >> >> +dist: xenial > > > > >> >> > > > > >> >> language: c > > > > >> >> > > > > >> > > > > > >> >Oh good, they're finally not stuck on "Trusty". But I still think > > > > >we > > > > >> >need to move to GitLab CI runners instead, so we can have better > > > > >> >control > > > > >> >over (and provide resources for) running the builds instead. > > > > >> This can be an intermediate state until movement to gitlab CI is > > > > >complete. > > > > >> Thanks, Ramon > > > > > > > > > >What's the case where things aren't working, today, that xenial fixes? > > > > >And please note that the GitLab CI move is underway (I posted > > > > >translating .travis.yml to .gitlab-ci.yml a while ago, now that the > > > > >merge window is open I need to apply it, the current new travis stuff, > > > > >and update it again). > > > > host compilation with a more recent gcc compiler (5.4). instead of > > > > (4.8). > > > > newer supporting packages. > > > > > > One other concern I have here (so please v2) is that we aren't updating > > > the section to grab a "xenial" LLVM toolchain, just trusty still. > > > Thanks! > > > > I thought we dropped this altogether because of the move to gitlab. > > Aren't we ? > > While I personally would like to drop Travis, we do not have a good > alternative for non-custodians to use as the free build resources from > gitlab.com have the same "break the job up into tons of chunks" problem > and not everyone has access to a faster-than-travis machine. Sending V2 shortly. > > -- > Tom ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [RFC PATCH] rockchip, Makefile: add u-boot-tpl-with-spl.img target
Mark Kettenis wrote: [Simon Glass wrote:] Well, for producing an image that works. E.g. producing a full image (TPL, SPL and U-Boot) for an SD card - it would be nice to have u-boot-rockchip.sd.bin or something like that. True. That'd be an image you write at certain offset I suppose so it preserves the MBR/partition tables? This is also just concatenation and padding, surely? tools/mkimage -n rk3399 -T rksd -d tpl/u-boot-tpl-dtb.bin u-boot-sd.img cat spl/u-boot-spl-dtb.bin >>u-boot-sd.img dd if=u-boot.itb of=u-boot-sd.img seek=16320 # 16384 - 64 ...or truncate(1) and cat(1) instead of dd(1) if you prefer. As you say, Mark, this assumes it's meant to be written at offset 64 sectors in to avoid blowing away the partition table. (Pad with 64 leading NULs if it's supposed to be a bootable card image I guess.) My worry about using binman for cracking such a simple nut is the dependencies it pulls in that wouldn't otherwise be needed: the documentation suggests at least lzma-alone, liblz4, and pyelftools. We've just exorcised the pyelftools requirement for building Rockchip u-boot; it would be a pity for to re-inflict it on users and casual developers just for a convenience feature. Best wishes, Chris. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] mmc: mtk-sd: Add MT8183 SoC support
Add support for the MT8183 in the MediaTek MMC driver. Signed-off-by: Fabien Parent --- drivers/mmc/mtk-sd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c index 780d3069eb..220bc09164 100644 --- a/drivers/mmc/mtk-sd.c +++ b/drivers/mmc/mtk-sd.c @@ -1391,9 +1391,19 @@ static const struct msdc_compatible mt8516_compat = { .stop_clk_fix = true, }; +static const struct msdc_compatible mt8183_compat = { + .clk_div_bits = 12, + .pad_tune0 = true, + .async_fifo = true, + .data_tune = true, + .busy_check = true, + .stop_clk_fix = true, +}; + static const struct udevice_id msdc_ids[] = { { .compatible = "mediatek,mt7623-mmc", .data = (ulong)&mt7623_compat }, { .compatible = "mediatek,mt8516-mmc", .data = (ulong)&mt8516_compat }, + { .compatible = "mediatek,mt8183-mmc", .data = (ulong)&mt8183_compat }, {} }; -- 2.23.0.rc1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/1] network: set timeline for CONFIG_DM_ETH conversion
On Fri, Aug 9, 2019 at 5:11 PM Heinrich Schuchardt wrote: > > The driver model has been supported for network drivers since 2015. It is > time to convert the remaining boards. Set July 2020 as a timeline. > > Signed-off-by: Heinrich Schuchardt Acked-by: Joe Hershberger ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 1/3] configs: Remove unneeded overlay_files environment variable
The variable 'name_overlays' serves the same purpose. Remove 'overlay_files' and use 'name_overlays' everywhere. Signed-off-by: Andrew F. Davis --- include/configs/am65x_evm.h | 5 ++--- include/configs/j721e_evm.h | 6 ++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h index 1415bb1b15..6072e4a48c 100644 --- a/include/configs/am65x_evm.h +++ b/include/configs/am65x_evm.h @@ -66,8 +66,7 @@ #define EXTRA_ENV_AM65X_BOARD_SETTINGS \ "findfdt=" \ "setenv name_fdt k3-am654-base-board.dtb;" \ - "setenv fdtfile ${name_fdt};" \ - "setenv overlay_files ${name_overlays}\0" \ + "setenv fdtfile ${name_fdt}\0" \ "loadaddr=0x8008\0" \ "fdtaddr=0x8200\0" \ "overlayaddr=0x8300\0" \ @@ -88,7 +87,7 @@ "get_overlay_mmc=" \ "fdt address ${fdtaddr};" \ "fdt resize 0x10;" \ - "for overlay in $overlay_files;"\ + "for overlay in $name_overlays;"\ "do;" \ "load mmc ${bootpart} ${overlayaddr} ${bootdir}/${overlay};" \ "fdt apply ${overlayaddr};" \ diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h index 5b35e22c85..f8d4d7bdf8 100644 --- a/include/configs/j721e_evm.h +++ b/include/configs/j721e_evm.h @@ -60,9 +60,7 @@ /* U-Boot general configuration */ #define EXTRA_ENV_J721E_BOARD_SETTINGS \ "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ - "findfdt=" \ - "setenv fdtfile ${default_device_tree};"\ - "setenv overlay_files ${name_overlays}\0" \ + "findfdt=setenv fdtfile ${default_device_tree}\0" \ "loadaddr=0x8008\0" \ "fdtaddr=0x8200\0" \ "overlayaddr=0x8300\0" \ @@ -83,7 +81,7 @@ "get_overlay_mmc=" \ "fdt address ${fdtaddr};" \ "fdt resize 0x10;" \ - "for overlay in $overlay_files;"\ + "for overlay in $name_overlays;"\ "do;" \ "load mmc ${bootpart} ${overlayaddr} ${bootdir}/${overlay} && " \ "fdt apply ${overlayaddr};" \ -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 2/3] configs: Rename environment variable fit_loadaddr to addr_fit
This is the first part of a larger effort I would like to propose to unify and simplify the default set of environment variables. When many early environment variables were named there were fewer images being loaded, usually just a kernel. At this time names like 'loadaddr' would suffice. Now we have more images and many more commands that act on them, often re-using the same variable for several different uses. The contents of a variable are also not immediately known causing one to have to look up a chain of variables to understand what a command is actually doing. I suggest the following. To start, all variables containing names should be prefixed with name_ and addresses with addr_. This is like how K2 already does things and allows for simple universal commands like: get_fdt_nfs=nfs ${addr_fdt} /boot/${name_fdt} Which is very clear on what is intended here and would work across all board that using the this naming convention. We can do this one variable at a time, start here with addr_fit. Signed-off-by: Andrew F. Davis --- include/configs/k2g_evm.h| 2 +- include/configs/ti_armv7_common.h| 4 ++-- include/configs/ti_armv7_keystone2.h | 12 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/configs/k2g_evm.h b/include/configs/k2g_evm.h index 3ec5a5acf5..b39e956def 100644 --- a/include/configs/k2g_evm.h +++ b/include/configs/k2g_evm.h @@ -69,7 +69,7 @@ "run run_mon_hs; " \ "run init_${boot}; "\ "run get_fit_${boot}; " \ - "bootm ${fit_loadaddr}#${name_fdt}" + "bootm ${addr_fit}#${name_fdt}" #endif /* NAND Configuration */ diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h index 828fb1b2a5..ece329fc7d 100644 --- a/include/configs/ti_armv7_common.h +++ b/include/configs/ti_armv7_common.h @@ -52,9 +52,9 @@ #define DEFAULT_FIT_TI_ARGS \ "boot_fit=0\0" \ - "fit_loadaddr=0x9000\0" \ + "addr_fit=0x9000\0" \ "fit_bootfile=fitImage\0" \ - "update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}\0" \ + "update_to_fit=setenv loadaddr ${addr_fit}; setenv bootfile ${fit_bootfile}\0" \ "loadfit=run args_mmc; bootm ${loadaddr}#${fdtfile};\0" \ /* diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h index b44b51bbd1..401dec4493 100644 --- a/include/configs/ti_armv7_keystone2.h +++ b/include/configs/ti_armv7_keystone2.h @@ -240,11 +240,11 @@ "get_mon_net=dhcp ${addr_mon} ${tftp_root}/${name_mon}\0" \ "get_mon_nfs=nfs ${addr_mon} ${nfs_root}/boot/${name_mon}\0"\ "get_mon_ubi=ubifsload ${addr_mon} ${bootdir}/${name_mon}\0"\ - "get_fit_net=dhcp ${fit_loadaddr} ${tftp_root}" \ + "get_fit_net=dhcp ${addr_fit} ${tftp_root}" \ "/${fit_bootfile}\0"\ - "get_fit_nfs=nfs ${fit_loadaddr} ${nfs_root}/boot/${fit_bootfile}\0"\ - "get_fit_ubi=ubifsload ${fit_loadaddr} ${bootdir}/${fit_bootfile}\0"\ - "get_fit_mmc=load mmc ${bootpart} ${fit_loadaddr} " \ + "get_fit_nfs=nfs ${addr_fit} ${nfs_root}/boot/${fit_bootfile}\0"\ + "get_fit_ubi=ubifsload ${addr_fit} ${bootdir}/${fit_bootfile}\0"\ + "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \ "${bootdir}/${fit_bootfile}\0" \ "get_uboot_net=dhcp ${loadaddr} ${tftp_root}/${name_uboot}\0" \ "get_uboot_nfs=nfs ${loadaddr} ${nfs_root}/boot/${name_uboot}\0" \ @@ -261,7 +261,7 @@ "get_fdt_ramfs=dhcp ${fdtaddr} ${tftp_root}/${name_fdt}\0" \ "get_kern_ramfs=dhcp ${loadaddr} ${tftp_root}/${name_kern}\0" \ "get_mon_ramfs=dhcp ${addr_mon} ${tftp_root}/${name_mon}\0" \ - "get_fit_ramfs=dhcp ${fit_loadaddr} ${tftp_root}" \ + "get_fit_ramfs=dhcp ${addr_fit} ${tftp_root}" \ "/${fit_bootfile}\0"\ "get_fs_ramfs=dhcp ${rdaddr} ${tftp_root}/${name_fs}\0" \ "get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}\0" \ @@ -290,7 +290,7 @@ "run run_mon_hs; " \ "run init_${boot}; "\ "run get_fit_${boot}; " \ - "bootm ${fit_loadaddr}#${name_fdt}" + "bootm ${addr_fit}#${name_fdt}" #endif #endif -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 3/3] configs: Rename environment variable fit_bootfile to name_fit
Like we did with 'fit_loadaddr' to 'addr_fit', the variable 'fit_bootfile' contains a name and so should be prefixed with name_. Make this change here. Signed-off-by: Andrew F. Davis --- include/configs/ti_armv7_common.h| 4 ++-- include/configs/ti_armv7_keystone2.h | 13 + 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h index ece329fc7d..2058f8de0f 100644 --- a/include/configs/ti_armv7_common.h +++ b/include/configs/ti_armv7_common.h @@ -53,8 +53,8 @@ #define DEFAULT_FIT_TI_ARGS \ "boot_fit=0\0" \ "addr_fit=0x9000\0" \ - "fit_bootfile=fitImage\0" \ - "update_to_fit=setenv loadaddr ${addr_fit}; setenv bootfile ${fit_bootfile}\0" \ + "name_fit=fitImage\0" \ + "update_to_fit=setenv loadaddr ${addr_fit}; setenv bootfile ${name_fit}\0" \ "loadfit=run args_mmc; bootm ${loadaddr}#${fdtfile};\0" \ /* diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h index 401dec4493..03753c5b52 100644 --- a/include/configs/ti_armv7_keystone2.h +++ b/include/configs/ti_armv7_keystone2.h @@ -240,12 +240,10 @@ "get_mon_net=dhcp ${addr_mon} ${tftp_root}/${name_mon}\0" \ "get_mon_nfs=nfs ${addr_mon} ${nfs_root}/boot/${name_mon}\0"\ "get_mon_ubi=ubifsload ${addr_mon} ${bootdir}/${name_mon}\0"\ - "get_fit_net=dhcp ${addr_fit} ${tftp_root}" \ - "/${fit_bootfile}\0"\ - "get_fit_nfs=nfs ${addr_fit} ${nfs_root}/boot/${fit_bootfile}\0"\ - "get_fit_ubi=ubifsload ${addr_fit} ${bootdir}/${fit_bootfile}\0"\ - "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \ - "${bootdir}/${fit_bootfile}\0" \ + "get_fit_net=dhcp ${addr_fit} ${tftp_root}/${name_fit}\0" \ + "get_fit_nfs=nfs ${addr_fit} ${nfs_root}/boot/${name_fit}\0"\ + "get_fit_ubi=ubifsload ${addr_fit} ${bootdir}/${name_fit}\0"\ + "get_fit_mmc=load mmc ${bootpart} ${addr_fit} ${bootdir}/${name_fit}\0" \ "get_uboot_net=dhcp ${loadaddr} ${tftp_root}/${name_uboot}\0" \ "get_uboot_nfs=nfs ${loadaddr} ${nfs_root}/boot/${name_uboot}\0" \ "burn_uboot_spi=sf probe; sf erase 0 0x10; "\ @@ -261,8 +259,7 @@ "get_fdt_ramfs=dhcp ${fdtaddr} ${tftp_root}/${name_fdt}\0" \ "get_kern_ramfs=dhcp ${loadaddr} ${tftp_root}/${name_kern}\0" \ "get_mon_ramfs=dhcp ${addr_mon} ${tftp_root}/${name_mon}\0" \ - "get_fit_ramfs=dhcp ${addr_fit} ${tftp_root}" \ - "/${fit_bootfile}\0"\ + "get_fit_ramfs=dhcp ${addr_fit} ${tftp_root}/${name_fit}\0" \ "get_fs_ramfs=dhcp ${rdaddr} ${tftp_root}/${name_fs}\0" \ "get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}\0" \ "get_ubi_nfs=nfs ${addr_ubi} ${nfs_root}/boot/${name_ubi}\0"\ -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] ARM: aspeed: Add SD host controller driver
Add support for the Aspeed SD host controller engine. This involves adding an MMC SDHCI driver and various additions to the clock and reset drivers for Aspeed chips. Signed-off-by: Eddie James --- arch/arm/include/asm/arch-aspeed/scu_ast2500.h | 3 + arch/arm/include/asm/gpio.h| 3 +- arch/arm/mach-aspeed/ast2500-board.c | 3 + drivers/clk/aspeed/clk_ast2500.c | 27 + drivers/mmc/Kconfig| 11 drivers/mmc/Makefile | 1 + drivers/mmc/aspeed_sdhci.c | 78 ++ drivers/pinctrl/aspeed/pinctrl_ast2500.c | 2 + 8 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 drivers/mmc/aspeed_sdhci.c diff --git a/arch/arm/include/asm/arch-aspeed/scu_ast2500.h b/arch/arm/include/asm/arch-aspeed/scu_ast2500.h index 4988ced..8db4901 100644 --- a/arch/arm/include/asm/arch-aspeed/scu_ast2500.h +++ b/arch/arm/include/asm/arch-aspeed/scu_ast2500.h @@ -22,6 +22,8 @@ #define SCU_MPLL_POST_MASK (0x3f << SCU_MPLL_POST_SHIFT) #define SCU_PCLK_DIV_SHIFT 23 #define SCU_PCLK_DIV_MASK (7 << SCU_PCLK_DIV_SHIFT) +#define SCU_SDCLK_DIV_SHIFT12 +#define SCU_SDCLK_DIV_MASK (7 << SCU_SDCLK_DIV_SHIFT) #define SCU_HPLL_DENUM_SHIFT 0 #define SCU_HPLL_DENUM_MASK0x1f #define SCU_HPLL_NUM_SHIFT 5 @@ -107,6 +109,7 @@ #define SCU_CLKSTOP_MAC1 (1 << 20) #define SCU_CLKSTOP_MAC2 (1 << 21) +#define SCU_CLKSTOP_SDCLK (1 << 27) #define SCU_D2PLL_EXT1_OFF (1 << 0) #define SCU_D2PLL_EXT1_BYPASS (1 << 1) diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h index 370031f..38a5922 100644 --- a/arch/arm/include/asm/gpio.h +++ b/arch/arm/include/asm/gpio.h @@ -1,6 +1,7 @@ #if !defined(CONFIG_ARCH_UNIPHIER) && !defined(CONFIG_ARCH_STI) && \ !defined(CONFIG_ARCH_K3) && !defined(CONFIG_ARCH_BCM6858) && \ - !defined(CONFIG_ARCH_BCM63158) && !defined(CONFIG_ARCH_ROCKCHIP) + !defined(CONFIG_ARCH_BCM63158) && !defined(CONFIG_ARCH_ROCKCHIP) && \ + !defined(CONFIG_ARCH_ASPEED) #include #endif #include diff --git a/arch/arm/mach-aspeed/ast2500-board.c b/arch/arm/mach-aspeed/ast2500-board.c index e7edd54..52a4e05 100644 --- a/arch/arm/mach-aspeed/ast2500-board.c +++ b/arch/arm/mach-aspeed/ast2500-board.c @@ -4,6 +4,7 @@ */ #include #include +#include #include #include #include @@ -55,6 +56,8 @@ int board_init(void) { gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + mmc_initialize(gd->bd); + return 0; } diff --git a/drivers/clk/aspeed/clk_ast2500.c b/drivers/clk/aspeed/clk_ast2500.c index dbee13a..9249cf9 100644 --- a/drivers/clk/aspeed/clk_ast2500.c +++ b/drivers/clk/aspeed/clk_ast2500.c @@ -143,6 +143,17 @@ static ulong ast2500_clk_get_rate(struct clk *clk) rate = rate / apb_div; } break; + case BCLK_SDCLK: + { + ulong apb_div = 4 + 4 * ((readl(&priv->scu->clk_sel1) + & SCU_SDCLK_DIV_MASK) +>> SCU_SDCLK_DIV_SHIFT); + rate = ast2500_get_hpll_rate(clkin, +readl(&priv-> + scu->h_pll_param)); + rate = rate / apb_div; + } + break; case PCLK_UART1: rate = ast2500_get_uart_clk_rate(priv->scu, 1); break; @@ -436,6 +447,22 @@ static int ast2500_clk_enable(struct clk *clk) struct ast2500_clk_priv *priv = dev_get_priv(clk->dev); switch (clk->id) { + case BCLK_SDCLK: + if (readl(&priv->scu->clk_stop_ctrl1) & SCU_CLKSTOP_SDCLK) { + ast_scu_unlock(priv->scu); + + setbits_le32(&priv->scu->sysreset_ctrl1, +SCU_SYSRESET_SDIO); + udelay(100); + clrbits_le32(&priv->scu->clk_stop_ctrl1, +SCU_CLKSTOP_SDCLK); + mdelay(10); + clrbits_le32(&priv->scu->sysreset_ctrl1, +SCU_SYSRESET_SDIO); + + ast_scu_lock(priv->scu); + } + break; /* * For MAC clocks the clock rate is * configured based on whether RGMII or RMII mode has been selected diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index c6812f6..536f66a 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -421,6 +421,17 @@ config SPL_MMC_SDHCI_ADMA This enables support for the ADMA (Advanced DMA) defined in the
[U-Boot] [PATCH] ARM: omapl138_lcdk: Enable USB
The OMAPL138-lcdk has two USB controllers which are currently disabled. This patch enables them. Signed-off-by: Adam Ford diff --git a/configs/omapl138_lcdk_defconfig b/configs/omapl138_lcdk_defconfig index 26b4950f8f..db0ccfb68f 100644 --- a/configs/omapl138_lcdk_defconfig +++ b/configs/omapl138_lcdk_defconfig @@ -54,8 +54,18 @@ CONFIG_SF_DEFAULT_SPEED=3000 CONFIG_DM_ETH=y CONFIG_MII=y CONFIG_DRIVER_TI_EMAC=y +CONFIG_PHY=y +CONFIG_PHY_DA8XX_USB=y CONFIG_SPECIFY_CONSOLE_INDEX=y CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y CONFIG_USE_TINY_PRINTF=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_DA8XX=y +CONFIG_USB_MUSB_HOST=y +CONFIG_USB_MUSB_DA8XX=y +CONFIG_USB_MUSB_PIO_ONLY=y +CONFIG_USB_STORAGE=y # CONFIG_SPL_OF_LIBFDT is not set diff --git a/include/configs/omapl138_lcdk.h b/include/configs/omapl138_lcdk.h index db4a663c53..d4f404a78b 100644 --- a/include/configs/omapl138_lcdk.h +++ b/include/configs/omapl138_lcdk.h @@ -208,6 +208,12 @@ #define CONFIG_SYS_LOAD_ADDR (PHYS_SDRAM_1 + 0x70) #define CONFIG_MX_CYCLIC +/* + * USB Configs + */ +#define CONFIG_USB_OHCI_NEW +#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15 + /* * Linux Information */ -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] Booting Linux kernel on x86_64
Hi Ryan, On Tue, Aug 13, 2019 at 12:48 AM Ryan Wilkins wrote: > > > > > On Aug 10, 2019, at 8:42 AM, Andy Shevchenko > > wrote: > > > > You may try to enable 'earlyprintk=efi' (newer kernels have different > > approach, i.e. 'earlycon=efifb') and also add 'keep_bootcon' to see if > > the problem is at the beginning or ending stages of boot process. > > > > > > > > -- > > With Best Regards, > > Andy Shevchenko > > > Andy, > > This worked for me and I was able to see that the kernel was booting but was > unable to mount the rootfs. It also told me that my framebuffer isn’t being > initialized properly so I wasn’t seeing screen output. > I was able to boot U-Boot as an EFI payload on QEMU, then boot a Linux 4.17 kernel from the payload. The kernel correctly detects the framebuffer and was able to draw a penguin. > Thanks much for the suggestions! Regards, Bin ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [RFC PATCH] rockchip, Makefile: add u-boot-tpl-with-spl.img target
On 2019/8/12 下午9:05, Matwey V. Kornilov wrote: вс, 11 авг. 2019 г. в 22:10, Mark Kettenis : From: "Matwey V. Kornilov" Date: Sun, 11 Aug 2019 11:06:02 +0300 Many Rockchip platforms require the same u-boot deploy procedure when TPL and SPL both enabled. The following examples are taken from doc/README.rockchip and board/theobroma-systems/lion_rk3368/README: RK3288: ./tools/mkimage -n rk3288 -T rksd -d ./tpl/u-boot-tpl.bin out cat ./spl/u-boot-spl-dtb.bin >> out sudo dd if=out of=/dev/mmcblk0 seek=64 RK3328: ./tools/mkimage -n rk3328 -T rksd -d ./tpl/u-boot-tpl.bin idbloader.img cat ./spl/u-boot-spl.bin >> idbloader.img sudo dd if=idbloader.img of=/dev/mmcblk0 seek=64 RK3368: ./tools/mkimage -n rk3368 -T rksd -d tpl/u-boot-tpl.bin spl-3368.img cat spl/u-boot-spl-dtb.bin >> spl-3368.img dd if=spl-3368.img of=/dev/sdb seek=64 RK3399: ./tools/mkimage -n rk3399 -T rksd -d ./tpl/u-boot-tpl-dtb.bin out cat ./spl/u-boot-spl-dtb.bin >> out sudo dd if=out of=/dev/sdc seek=64 Here, we introduce generic u-boot-tpl-with-spl.img target which is the TPL image followed by the SPL binary. Nice. Only comment/question I have is whether we should go with your name (which fits well with the way we name other U-Boot components) or use idbloader.img which is the name used in some external documentation such as: http://opensource.rock-chips.com/wiki_Boot_option I think it is for maintainers to decide. What does idb in "idbloader" stands for? The 'idb' means 'ID Block' which is header for Rockchip BootRom, and idbloader including header(2KB)+TPL+SPL, which is able to be understand by the BootRom. So this name is very clear to tell people what it is, eg, the idbloader may come from rockchip binary loader with: header(2KB)+ddr.bin+miniloader.bin. I would prefer to use idbloader.img. Thanks, - Kever Cheers, Mark Signed-off-by: Matwey V. Kornilov --- Makefile | 12 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 8513db94e3..4d70b6ac2e 100644 --- a/Makefile +++ b/Makefile @@ -882,6 +882,10 @@ ifeq ($(CONFIG_MPC85xx)$(CONFIG_OF_SEPARATE),yy) ALL-y += u-boot-with-dtb.bin endif +ifeq ($(CONFIG_ARCH_ROCKCHIP)$(CONFIG_SPL)$(CONFIG_TPL),yyy) +ALL-y += u-boot-tpl-with-spl.img +endif + LDFLAGS_u-boot += $(LDFLAGS_FINAL) # Avoid 'Not enough room for program headers' error on binutils 2.28 onwards. @@ -1293,6 +1297,14 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE $(call if_changed,pad_cat) +ifeq ($(CONFIG_ARCH_ROCKCHIP),y) +MKIMAGEFLAGS_u-boot-tpl.img = -n $(CONFIG_SYS_SOC) -T rksd +tpl/u-boot-tpl.img: tpl/u-boot-tpl.bin FORCE + $(call if_changed,mkimage) +u-boot-tpl-with-spl.img: tpl/u-boot-tpl.img spl/u-boot-spl.bin FORCE + $(call if_changed,cat) +endif + ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy) MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE) -- 2.16.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 14/15] rockchip: rk3399: Add bootcount support【请注意,邮件由u-boot-boun...@lists.denx.de代发】
On 2019/8/12 下午8:16, Kever Yang wrote: Hi Jagan, On 2019/7/29 下午3:47, Jagan Teki wrote: Add bootcount support for Rockchip rk3399. The bootcount value is preserved in PMU_SYS_REG0 register, PMU_SYS_REG0 has been used by other case in Rockchip, we don't Please ignore this mail, I mixing the registers in PMU and PMUGRF, the PMU_SYS_REG0 is not used yet and you can use it. Thanks, - Kever recommend to use it, the PMUGRF_OS_REG3 is still reserved now, could you use it instead? Thanks, - Kever this would help to support redundent boot. Once the redundant boot triggers, the altboot command will look for extlinux-rollback.conf on particular bootable partition which supposed to be a recovery partition where redundant boot required. Signed-off-by: Jagan Teki --- arch/arm/mach-rockchip/Kconfig | 2 ++ arch/arm/mach-rockchip/rk3399/Kconfig | 10 ++ include/configs/rk3399_common.h | 5 - 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 17f31e89f3..dd5055ed69 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -184,6 +184,8 @@ config ROCKCHIP_RK3399 imply TPL_CLK imply TPL_TINY_MEMSET imply TPL_ROCKCHIP_COMMON_BOARD + imply SYS_BOOTCOUNT_SINGLEWORD if BOOTCOUNT_LIMIT + imply CMD_BOOTCOUNT if BOOTCOUNT_LIMIT help The Rockchip RK3399 is a ARM-based SoC with a dual-core Cortex-A72 and quad-core Cortex-A53. diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig index 6660d05349..68ac913bcb 100644 --- a/arch/arm/mach-rockchip/rk3399/Kconfig +++ b/arch/arm/mach-rockchip/rk3399/Kconfig @@ -91,6 +91,16 @@ config TPL_STACK config TPL_TEXT_BASE default 0xff8c2000 +if BOOTCOUNT_LIMIT + +config BOOTCOUNT_BOOTLIMIT + default 3 + +config SYS_BOOTCOUNT_ADDR + default 0xff3100f0 # PMU_SYS_REG0 + +endif # BOOTCOUNT_LIMIT + source "board/rockchip/evb_rk3399/Kconfig" source "board/theobroma-systems/puma_rk3399/Kconfig" source "board/vamrs/rock960_rk3399/Kconfig" diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h index 67b48e03ba..ace82928d1 100644 --- a/include/configs/rk3399_common.h +++ b/include/configs/rk3399_common.h @@ -70,7 +70,10 @@ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "partitions=" PARTS_DEFAULT \ ROCKCHIP_DEVICE_SETTINGS \ - BOOTENV + BOOTENV \ + "altbootcmd=" \ + "setenv boot_syslinux_conf extlinux/extlinux-rollback.conf;" \ + "run distro_bootcmd\0" #endif ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] Booting Linux kernel on x86_64
Hi Ryan, On Tue, Aug 13, 2019 at 8:23 AM Bin Meng wrote: > > Hi Ryan, > > On Tue, Aug 13, 2019 at 12:48 AM Ryan Wilkins > wrote: > > > > > > > > > On Aug 10, 2019, at 8:42 AM, Andy Shevchenko > > > wrote: > > > > > > You may try to enable 'earlyprintk=efi' (newer kernels have different > > > approach, i.e. 'earlycon=efifb') and also add 'keep_bootcon' to see if > > > the problem is at the beginning or ending stages of boot process. > > > > > > > > > > > > -- > > > With Best Regards, > > > Andy Shevchenko > > > > > > Andy, > > > > This worked for me and I was able to see that the kernel was booting but > > was unable to mount the rootfs. It also told me that my framebuffer isn’t > > being initialized properly so I wasn’t seeing screen output. > > > > I was able to boot U-Boot as an EFI payload on QEMU, then boot a Linux > 4.17 kernel from the payload. The kernel correctly detects the > framebuffer and was able to draw a penguin. Did you enable CONFIG_FB_VESA in the kernel? Regards, Bin ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] Booting Linux kernel on x86_64
> On Aug 12, 2019, at 9:05 PM, Bin Meng wrote: > > Did you enable CONFIG_FB_VESA in the kernel? > I added that in today and it worked. I had EFI FB support compiled in but I didn’t have FB VESA so this was preventing me to seeing any output on the screen which led me to believe that u-boot wasn’t booting my kernel. Thank you very much, Bin and Andy, for your assistance with this. I appreciate it. Best, Ryan ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [U-BOOT PATCH v1] riscv: sifive: fu540: set serial environment variable from otp
Hi Bin, On Mon, Aug 12, 2019 at 8:43 PM Bin Meng wrote: > > On Mon, Aug 12, 2019 at 10:58 PM Sagar Shrikant Kadam > wrote: > > > > This patch sets the serial# environment variable by reading the > > board serial number from the OTP memory region. > > > > Signed-off-by: Sagar Shrikant Kadam > > Reviewed-by: Anup Patel > > --- > > board/sifive/fu540/fu540.c | 18 ++ > > 1 file changed, 14 insertions(+), 4 deletions(-) > > > > Reviewed-by: Bin Meng > Tested-by: Bin Meng Thanks for Reviewing and Testing the patch. Regards, Sagar ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: aspeed: Add SD host controller driver
> Subject: [U-Boot][PATCH] ARM: aspeed: Add SD host controller driver > > Add support for the Aspeed SD host controller engine. This involves adding an > MMC SDHCI driver and various additions to the clock and reset drivers for > Aspeed chips. > > Signed-off-by: Eddie James > --- > arch/arm/include/asm/arch-aspeed/scu_ast2500.h | 3 + > arch/arm/include/asm/gpio.h| 3 +- > arch/arm/mach-aspeed/ast2500-board.c | 3 + > drivers/clk/aspeed/clk_ast2500.c | 27 + > drivers/mmc/Kconfig| 11 > drivers/mmc/Makefile | 1 + > drivers/mmc/aspeed_sdhci.c | 78 Please split the patch. Thanks, Peng. > ++ > drivers/pinctrl/aspeed/pinctrl_ast2500.c | 2 + > 8 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 > drivers/mmc/aspeed_sdhci.c > > diff --git a/arch/arm/include/asm/arch-aspeed/scu_ast2500.h > b/arch/arm/include/asm/arch-aspeed/scu_ast2500.h > index 4988ced..8db4901 100644 > --- a/arch/arm/include/asm/arch-aspeed/scu_ast2500.h > +++ b/arch/arm/include/asm/arch-aspeed/scu_ast2500.h > @@ -22,6 +22,8 @@ > #define SCU_MPLL_POST_MASK (0x3f << SCU_MPLL_POST_SHIFT) > #define SCU_PCLK_DIV_SHIFT 23 > #define SCU_PCLK_DIV_MASK(7 << SCU_PCLK_DIV_SHIFT) > +#define SCU_SDCLK_DIV_SHIFT 12 > +#define SCU_SDCLK_DIV_MASK (7 << SCU_SDCLK_DIV_SHIFT) > #define SCU_HPLL_DENUM_SHIFT 0 > #define SCU_HPLL_DENUM_MASK 0x1f > #define SCU_HPLL_NUM_SHIFT 5 > @@ -107,6 +109,7 @@ > > #define SCU_CLKSTOP_MAC1 (1 << 20) > #define SCU_CLKSTOP_MAC2 (1 << 21) > +#define SCU_CLKSTOP_SDCLK(1 << 27) > > #define SCU_D2PLL_EXT1_OFF (1 << 0) > #define SCU_D2PLL_EXT1_BYPASS(1 << 1) > diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h > index 370031f..38a5922 100644 > --- a/arch/arm/include/asm/gpio.h > +++ b/arch/arm/include/asm/gpio.h > @@ -1,6 +1,7 @@ > #if !defined(CONFIG_ARCH_UNIPHIER) && !defined(CONFIG_ARCH_STI) && > \ > !defined(CONFIG_ARCH_K3) && !defined(CONFIG_ARCH_BCM6858) && > \ > - !defined(CONFIG_ARCH_BCM63158) > && !defined(CONFIG_ARCH_ROCKCHIP) > + !defined(CONFIG_ARCH_BCM63158) > && !defined(CONFIG_ARCH_ROCKCHIP) && \ > + !defined(CONFIG_ARCH_ASPEED) > #include > #endif > #include > diff --git a/arch/arm/mach-aspeed/ast2500-board.c > b/arch/arm/mach-aspeed/ast2500-board.c > index e7edd54..52a4e05 100644 > --- a/arch/arm/mach-aspeed/ast2500-board.c > +++ b/arch/arm/mach-aspeed/ast2500-board.c > @@ -4,6 +4,7 @@ > */ > #include > #include > +#include > #include > #include > #include > @@ -55,6 +56,8 @@ int board_init(void) > { > gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; > > + mmc_initialize(gd->bd); > + > return 0; > } > > diff --git a/drivers/clk/aspeed/clk_ast2500.c > b/drivers/clk/aspeed/clk_ast2500.c > index dbee13a..9249cf9 100644 > --- a/drivers/clk/aspeed/clk_ast2500.c > +++ b/drivers/clk/aspeed/clk_ast2500.c > @@ -143,6 +143,17 @@ static ulong ast2500_clk_get_rate(struct clk *clk) > rate = rate / apb_div; > } > break; > + case BCLK_SDCLK: > + { > + ulong apb_div = 4 + 4 * ((readl(&priv->scu->clk_sel1) > + & SCU_SDCLK_DIV_MASK) > + >> SCU_SDCLK_DIV_SHIFT); > + rate = ast2500_get_hpll_rate(clkin, > + readl(&priv-> > +scu->h_pll_param)); > + rate = rate / apb_div; > + } > + break; > case PCLK_UART1: > rate = ast2500_get_uart_clk_rate(priv->scu, 1); > break; > @@ -436,6 +447,22 @@ static int ast2500_clk_enable(struct clk *clk) > struct ast2500_clk_priv *priv = dev_get_priv(clk->dev); > > switch (clk->id) { > + case BCLK_SDCLK: > + if (readl(&priv->scu->clk_stop_ctrl1) & SCU_CLKSTOP_SDCLK) { > + ast_scu_unlock(priv->scu); > + > + setbits_le32(&priv->scu->sysreset_ctrl1, > + SCU_SYSRESET_SDIO); > + udelay(100); > + clrbits_le32(&priv->scu->clk_stop_ctrl1, > + SCU_CLKSTOP_SDCLK); > + mdelay(10); > + clrbits_le32(&priv->scu->sysreset_ctrl1, > + SCU_SYSRESET_SDIO); > + > + ast_scu_lock(priv->scu); > + } > + break; > /* >* For MAC clocks the clock rate is >* configured based on whether RGMII or RMII mode has been selected > diff --git a/