Re: [U-Boot] i.MX6 PAD_CTL_SPEED_LOW possibly wrong
Hi Mark, On Fri, Apr 13, 2018 at 11:41 AM, Jonas Mark (BT-FIR/ENG1)wrote: > i.MX 6 UltraLite RM:only available under a licensing agreement It is available at: https://www.nxp.com/docs/en/reference-manual/IMX6ULRM.pdf > Combining the knowledge from the RMs above and the existing code, it > seems that only the SoloLite is different. Thus, I propose the > attached patch. Please send it via git send-email. Thanks. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 03/11] net: Move net command options to the cmd menu
From: Joe HershbergerTo: u-boot@lists.denx.de Cc: Heinrich ; Michal Simek ; Simon Glass ; Duncan Hare ; Chris Packham ; Tom Rini ; Maxime Ripard ; Joe Hershberger Sent: Friday, April 13, 2018 1:28 PM Subject: [PATCH v2 03/11] net: Move net command options to the cmd menu Options that controlled the tftp and bootp commands depended on their commands, but lived in the net menu. Move them so they are in a consistent location. Signed-off-by: Joe Hershberger Reviewed-by: Chris Packham Reviewed-by: Duncan Hare config CMD_NFS bool "nfs" default y help Acquire a network IP address using the link-local protocol Should Help text be "Transfer file with NFS Protocol" ? ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2, u-boot, 1/2] reset: Add get/assert/deassert/release for bulk of reset signals
On 04/11/2018 04:05 PM, Tom Rini wrote: > On Tue, Apr 03, 2018 at 11:40:50AM +0200, Neil Armstrong wrote: > >> This patch adds a "bulk" API to the reset API in order to get/deassert/ >> assert/release a group of reset signals associated with a device. >> >> This bulk API will avoid adding a copy of the same code to manage >> a group of reset signals in drivers. >> >> Signed-off-by: Neil Armstrong>> Reviewed-by: Simon Glass > > Applied to u-boot/master, thanks! Breaks building of designware_i2c.c and also isn't checkpatch clean. ERROR: trailing whitespace #90: FILE: drivers/reset/reset-uclass.c:87: +^I$ total: 1 errors, 0 warnings, 0 checks, 229 lines checked -- Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [RFC][PATCH] cmd: fdt: Fix fdt address information after the movement
On 04/01/2018 04:14 PM, Simon Glass wrote: > Hi Marek, Hi, > On 24 February 2018 at 19:09, Marek Vasutwrote: >> From: Hiroyuki Yokoyama >> >> This patch fixes the address information of fdt. >> >> wrong case: >> => fdt addr 0x4800 >> => fdt move 0x4800 0x4100 0xa000 >> => fdt addr >> The address of the fdt is 4800 >> >> Active address in this case is 0x4100. >> >> Signed-off-by: Hiroyuki Yokoyama >> Signed-off-by: Marek Vasut >> Cc: Hiroyuki Yokoyama >> Cc: Nobuhiro Iwamatsu >> Cc: Pantelis Antoniou >> --- >> cmd/fdt.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/cmd/fdt.c b/cmd/fdt.c >> index b783b0df42..1245bc24eb 100644 >> --- a/cmd/fdt.c >> +++ b/cmd/fdt.c >> @@ -204,6 +204,8 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, >> char * const argv[]) >> return 1; >> } >> working_fdt = newaddr; >> + env_set_hex("fdtaddr", (ulong)working_fdt); > > Shouldn't this be map_to_sysmem(working_fdt)? Should it ? The other question I have is, is this possibly changing the U-Boot API and is that a problem ? btw sorry, must've missed this mail. -- Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH V2] ARM: rmobile: Zap CONFIG_MMC_RENESAS_TUNING
Drop the CONFIG_MMC_RENESAS_TUNING symbol from Gen3 configs. This symbol is no longer used after the Matsushita SDHI driver, instead the renesas-sdhi driver uses CONFIG_MMC_HS200_SUPPORT to discern whether the tuning support should be compiled in. Signed-off-by: Marek VasutCc: Tom Rini Cc: Nobuhiro Iwamatsu -- V2: Submit this on top of configs which are actually in mainline --- configs/r8a7795_salvator-x_defconfig | 1 - configs/r8a7795_ulcb_defconfig | 1 - configs/r8a7796_salvator-x_defconfig | 1 - configs/r8a7796_ulcb_defconfig | 1 - configs/r8a77970_eagle_defconfig | 1 - configs/r8a77995_draak_defconfig | 1 - 6 files changed, 6 deletions(-) diff --git a/configs/r8a7795_salvator-x_defconfig b/configs/r8a7795_salvator-x_defconfig index b48513ca2a..6b5f109870 100644 --- a/configs/r8a7795_salvator-x_defconfig +++ b/configs/r8a7795_salvator-x_defconfig @@ -41,7 +41,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_DM_ETH=y diff --git a/configs/r8a7795_ulcb_defconfig b/configs/r8a7795_ulcb_defconfig index a45aec3c43..4b2afb8874 100644 --- a/configs/r8a7795_ulcb_defconfig +++ b/configs/r8a7795_ulcb_defconfig @@ -41,7 +41,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_DM_ETH=y diff --git a/configs/r8a7796_salvator-x_defconfig b/configs/r8a7796_salvator-x_defconfig index 680c7d9226..3abd82ccd4 100644 --- a/configs/r8a7796_salvator-x_defconfig +++ b/configs/r8a7796_salvator-x_defconfig @@ -42,7 +42,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_DM_ETH=y diff --git a/configs/r8a7796_ulcb_defconfig b/configs/r8a7796_ulcb_defconfig index 2b552cc531..fedb82f6d5 100644 --- a/configs/r8a7796_ulcb_defconfig +++ b/configs/r8a7796_ulcb_defconfig @@ -42,7 +42,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_DM_ETH=y diff --git a/configs/r8a77970_eagle_defconfig b/configs/r8a77970_eagle_defconfig index 56c949f135..eb8666abca 100644 --- a/configs/r8a77970_eagle_defconfig +++ b/configs/r8a77970_eagle_defconfig @@ -41,7 +41,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_PHY_MICREL=y CONFIG_PHY_MICREL_KSZ90X1=y CONFIG_DM_ETH=y diff --git a/configs/r8a77995_draak_defconfig b/configs/r8a77995_draak_defconfig index 9792f5efe7..ce92fbae56 100644 --- a/configs/r8a77995_draak_defconfig +++ b/configs/r8a77995_draak_defconfig @@ -42,7 +42,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_CFI_FLASH=y -- 2.16.2 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] mmc: tmio: Rename Matsushita to TMIO
Synchronize the naming with Linux, call the common code TMIO. No functional change. Signed-off-by: Marek VasutCc: Jaehoon Chung Cc: Masahiro Yamada --- drivers/mmc/Makefile | 4 +- drivers/mmc/matsushita-common.h| 151 drivers/mmc/renesas-sdhi.c | 108 +++--- drivers/mmc/{matsushita-common.c => tmio-common.c} | 414 ++--- drivers/mmc/tmio-common.h | 151 drivers/mmc/uniphier-sd.c | 16 +- 6 files changed, 422 insertions(+), 422 deletions(-) delete mode 100644 drivers/mmc/matsushita-common.h rename drivers/mmc/{matsushita-common.c => tmio-common.c} (51%) create mode 100644 drivers/mmc/tmio-common.h diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile index f2c6280686..cf46c332f1 100644 --- a/drivers/mmc/Makefile +++ b/drivers/mmc/Makefile @@ -62,6 +62,6 @@ obj-$(CONFIG_MMC_SDHCI_XENON) += xenon_sdhci.o obj-$(CONFIG_MMC_SDHCI_ZYNQ) += zynq_sdhci.o obj-$(CONFIG_MMC_SUNXI)+= sunxi_mmc.o -obj-$(CONFIG_MMC_UNIPHIER) += matsushita-common.o uniphier-sd.o -obj-$(CONFIG_RENESAS_SDHI) += matsushita-common.o renesas-sdhi.o +obj-$(CONFIG_MMC_UNIPHIER) += tmio-common.o uniphier-sd.o +obj-$(CONFIG_RENESAS_SDHI) += tmio-common.o renesas-sdhi.o obj-$(CONFIG_MMC_BCM2835) += bcm2835_sdhost.o diff --git a/drivers/mmc/matsushita-common.h b/drivers/mmc/matsushita-common.h deleted file mode 100644 index 34631cb43e..00 --- a/drivers/mmc/matsushita-common.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (C) 2016 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier:GPL-2.0+ - */ - -#ifndef __MATSUSHITA_COMMON_H__ -#define __MATSUSHITA_COMMON_H__ - -#define MATSU_SD_CMD 0x000 /* command */ -#define MATSU_SD_CMD_NOSTOP BIT(14) /* No automatic CMD12 issue */ -#define MATSU_SD_CMD_MULTI BIT(13) /* multiple block transfer */ -#define MATSU_SD_CMD_RD BIT(12) /* 1: read, 0: write */ -#define MATSU_SD_CMD_DATABIT(11) /* data transfer */ -#define MATSU_SD_CMD_APP BIT(6) /* ACMD preceded by CMD55 */ -#define MATSU_SD_CMD_NORMAL (0 << 8)/* auto-detect of resp-type */ -#define MATSU_SD_CMD_RSP_NONE(3 << 8)/* response: none */ -#define MATSU_SD_CMD_RSP_R1 (4 << 8)/* response: R1, R5, R6, R7 */ -#define MATSU_SD_CMD_RSP_R1B (5 << 8)/* response: R1b, R5b */ -#define MATSU_SD_CMD_RSP_R2 (6 << 8)/* response: R2 */ -#define MATSU_SD_CMD_RSP_R3 (7 << 8)/* response: R3, R4 */ -#define MATSU_SD_ARG 0x008 /* command argument */ -#define MATSU_SD_STOP 0x010 /* stop action control */ -#define MATSU_SD_STOP_SECBIT(8) /* use sector count */ -#define MATSU_SD_STOP_STPBIT(0) /* issue CMD12 */ -#define MATSU_SD_SECCNT0x014 /* sector counter */ -#define MATSU_SD_RSP10 0x018 /* response[39:8] */ -#define MATSU_SD_RSP32 0x020 /* response[71:40] */ -#define MATSU_SD_RSP54 0x028 /* response[103:72] */ -#define MATSU_SD_RSP76 0x030 /* response[127:104] */ -#define MATSU_SD_INFO1 0x038 /* IRQ status 1 */ -#define MATSU_SD_INFO1_CDBIT(5) /* state of card detect */ -#define MATSU_SD_INFO1_INSERTBIT(4) /* card inserted */ -#define MATSU_SD_INFO1_REMOVEBIT(3) /* card removed */ -#define MATSU_SD_INFO1_CMP BIT(2) /* data complete */ -#define MATSU_SD_INFO1_RSP BIT(0) /* response complete */ -#define MATSU_SD_INFO2 0x03c /* IRQ status 2 */ -#define MATSU_SD_INFO2_ERR_ILA BIT(15) /* illegal access err */ -#define MATSU_SD_INFO2_CBSY BIT(14) /* command busy */ -#define MATSU_SD_INFO2_SCLKDIVEN BIT(13) /* command setting reg ena */ -#define MATSU_SD_INFO2_BWE BIT(9) /* write buffer ready */ -#define MATSU_SD_INFO2_BRE BIT(8) /* read buffer ready */ -#define MATSU_SD_INFO2_DAT0 BIT(7) /* SDDAT0 */ -#define MATSU_SD_INFO2_ERR_RTO BIT(6) /* response time out */ -#define MATSU_SD_INFO2_ERR_ILR BIT(5) /* illegal read err */ -#define MATSU_SD_INFO2_ERR_ILW BIT(4) /* illegal write err */ -#define MATSU_SD_INFO2_ERR_TOBIT(3) /* time out error */ -#define MATSU_SD_INFO2_ERR_END BIT(2) /* END bit error */ -#define MATSU_SD_INFO2_ERR_CRC BIT(1) /* CRC error */ -#define MATSU_SD_INFO2_ERR_IDX BIT(0) /* cmd index error */ -#define MATSU_SD_INFO1_MASK0x040 -#define
[U-Boot] [PATCH] ARM: rmobile: Zap CONFIG_MMC_RENESAS_TUNING
Drop the CONFIG_MMC_RENESAS_TUNING symbol from Gen3 configs. This symbol is no longer used after the Matsushita SDHI driver, instead the renesas-sdhi driver uses CONFIG_MMC_HS200_SUPPORT to discern whether the tuning support should be compiled in. Signed-off-by: Marek VasutCc: Tom Rini Cc: Nobuhiro Iwamatsu --- configs/r8a7795_salvator-x_defconfig | 1 - configs/r8a7795_ulcb_defconfig | 1 - configs/r8a7796_salvator-x_defconfig | 1 - configs/r8a7796_ulcb_defconfig | 1 - configs/r8a77970_eagle_defconfig | 1 - configs/r8a77995_draak_defconfig | 1 - 6 files changed, 6 deletions(-) diff --git a/configs/r8a7795_salvator-x_defconfig b/configs/r8a7795_salvator-x_defconfig index c143a7f20a..47bee99cc8 100644 --- a/configs/r8a7795_salvator-x_defconfig +++ b/configs/r8a7795_salvator-x_defconfig @@ -50,7 +50,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_CFI_FLASH=y diff --git a/configs/r8a7795_ulcb_defconfig b/configs/r8a7795_ulcb_defconfig index af5af8265a..2a875a9304 100644 --- a/configs/r8a7795_ulcb_defconfig +++ b/configs/r8a7795_ulcb_defconfig @@ -50,7 +50,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_CFI_FLASH=y diff --git a/configs/r8a7796_salvator-x_defconfig b/configs/r8a7796_salvator-x_defconfig index d665b6a258..fcee724992 100644 --- a/configs/r8a7796_salvator-x_defconfig +++ b/configs/r8a7796_salvator-x_defconfig @@ -51,7 +51,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_CFI_FLASH=y diff --git a/configs/r8a7796_ulcb_defconfig b/configs/r8a7796_ulcb_defconfig index 90bb4dee23..e8d03d08b7 100644 --- a/configs/r8a7796_ulcb_defconfig +++ b/configs/r8a7796_ulcb_defconfig @@ -51,7 +51,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_CFI_FLASH=y diff --git a/configs/r8a77970_eagle_defconfig b/configs/r8a77970_eagle_defconfig index 8ef43e9a42..e966faa084 100644 --- a/configs/r8a77970_eagle_defconfig +++ b/configs/r8a77970_eagle_defconfig @@ -48,7 +48,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_SPANSION=y diff --git a/configs/r8a77995_draak_defconfig b/configs/r8a77995_draak_defconfig index 1239303fd0..a39b4bb79b 100644 --- a/configs/r8a77995_draak_defconfig +++ b/configs/r8a77995_draak_defconfig @@ -49,7 +49,6 @@ CONFIG_MMC_IO_VOLTAGE=y CONFIG_MMC_UHS_SUPPORT=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_RENESAS_SDHI=y -CONFIG_MMC_RENESAS_TUNING=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y CONFIG_CFI_FLASH=y -- 2.16.2 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] ARM: rmobile: Convert TPL to SPL
There is currently no use for building the SPL anymore, since the SPI loader can easily be replaced by TPL and TPL does load U-Boot directly. Upgrade TPL to SPL and replace what used to be SPL with it. This way we build the U-Boot sources only twice, not thrice. Signed-off-by: Marek VasutCc: Nobuhiro Iwamatsu --- arch/arm/mach-rmobile/Kconfig.32 | 8 ++- arch/arm/mach-rmobile/include/mach/boot0.h | 4 ++-- arch/arm/mach-rmobile/lowlevel_init_ca15.S | 2 +- board/renesas/porter/porter_spl.c | 34 +- board/renesas/stout/stout_spl.c| 34 +- configs/porter_defconfig | 30 +- configs/stout_defconfig| 30 +- include/configs/porter.h | 8 +++ include/configs/stout.h| 8 +++ 9 files changed, 51 insertions(+), 107 deletions(-) diff --git a/arch/arm/mach-rmobile/Kconfig.32 b/arch/arm/mach-rmobile/Kconfig.32 index d5b00ef379..bcadb21ba9 100644 --- a/arch/arm/mach-rmobile/Kconfig.32 +++ b/arch/arm/mach-rmobile/Kconfig.32 @@ -70,21 +70,17 @@ config TARGET_PORTER bool "Porter board" select DM select DM_SERIAL - select SUPPORT_TPL select SUPPORT_SPL - select SPL_DM if SPL select USE_TINY_PRINTF - select TPL_TINY_MEMSET + select SPL_TINY_MEMSET config TARGET_STOUT bool "Stout board" select DM select DM_SERIAL - select SUPPORT_TPL select SUPPORT_SPL - select SPL_DM if SPL select USE_TINY_PRINTF - select TPL_TINY_MEMSET + select SPL_TINY_MEMSET endchoice diff --git a/arch/arm/mach-rmobile/include/mach/boot0.h b/arch/arm/mach-rmobile/include/mach/boot0.h index 3edd461cbf..61044698bf 100644 --- a/arch/arm/mach-rmobile/include/mach/boot0.h +++ b/arch/arm/mach-rmobile/include/mach/boot0.h @@ -1,5 +1,5 @@ /* - * Specialty padding for the RCar Gen2 TPL JTAG loading + * Specialty padding for the RCar Gen2 SPL JTAG loading * * SPDX-License-Identifier:GPL-2.0 */ @@ -10,7 +10,7 @@ _start: ARM_VECTORS -#ifdef CONFIG_TPL_BUILD +#ifdef CONFIG_SPL_BUILD .word 0x0badc0d3; .word 0x0badc0d3; .word 0x0badc0d3; diff --git a/arch/arm/mach-rmobile/lowlevel_init_ca15.S b/arch/arm/mach-rmobile/lowlevel_init_ca15.S index ef2280bea4..806a3bc2f9 100644 --- a/arch/arm/mach-rmobile/lowlevel_init_ca15.S +++ b/arch/arm/mach-rmobile/lowlevel_init_ca15.S @@ -11,7 +11,7 @@ #include ENTRY(lowlevel_init) -#ifndef CONFIG_TPL_BUILD +#ifndef CONFIG_SPL_BUILD mrc p15, 0, r4, c0, c0, 5 /* mpidr */ orr r4, r4, r4, lsr #6 and r4, r4, #7 /* id 0-3 = ca15.0,1,2,3 */ diff --git a/board/renesas/porter/porter_spl.c b/board/renesas/porter/porter_spl.c index 4b4dd4d4aa..55f4cace0c 100644 --- a/board/renesas/porter/porter_spl.c +++ b/board/renesas/porter/porter_spl.c @@ -27,7 +27,6 @@ #define SD2CKCR0xE615026C #define SD_97500KHZ0x7 -#ifdef CONFIG_TPL_BUILD struct reg_config { u16 off; u32 val; @@ -45,7 +44,7 @@ static void dbsc_wait(u16 reg) ; } -static void tpl_init_sys(void) +static void spl_init_sys(void) { u32 r0 = 0; @@ -65,7 +64,7 @@ static void tpl_init_sys(void) :"=r"(r0)); } -static void tpl_init_pfc(void) +static void spl_init_pfc(void) { static const struct reg_config pfc_with_unlock[] = { { 0x0090, 0x6000 }, @@ -125,7 +124,7 @@ static void tpl_init_pfc(void) pfc_base | pfc_without_unlock[i].off); } -static void tpl_init_gpio(void) +static void spl_init_gpio(void) { static const u16 gpio_offs[] = { 0x1000, 0x2000, 0x3000, 0x4000, 0x5000, 0x5400, 0x5800 @@ -164,7 +163,7 @@ static void tpl_init_gpio(void) writel(gpio_clr[i].val, gpio_base | 0x04 | gpio_clr[i].off); } -static void tpl_init_lbsc(void) +static void spl_init_lbsc(void) { static const struct reg_config lbsc_config[] = { { 0x00, 0x0020 }, @@ -192,7 +191,7 @@ static void tpl_init_lbsc(void) writel(0, lbsc_base | lbsc_offs[i]); } -static void tpl_init_dbsc(void) +static void spl_init_dbsc(void) { static const struct reg_config dbsc_config1[] = { { 0x0280, 0xa55a }, @@ -412,7 +411,7 @@ static void tpl_init_dbsc(void) } -static void tpl_init_qspi(void) +static void spl_init_qspi(void) { mstp_clrbits_le32(MSTPSR9, SMSTPCR9, QSPI_MSTP917); @@ -446,14 +445,13 @@ void board_init_f(ulong dummy) */ writel(SD_97500KHZ, SD2CKCR); - tpl_init_sys(); - tpl_init_pfc(); - tpl_init_gpio(); - tpl_init_lbsc(); - tpl_init_dbsc(); - tpl_init_qspi(); + spl_init_sys(); +
Re: [U-Boot] Make cmd_get_data_size() a dependency of setexpr
On Wed, Feb 07, 2018 at 03:31:02PM +0800, qlb1234 wrote: > This commit broke the command setexpr. > > http://git.denx.de/?p=u-boot.git;a=commit;h=6f62d7c4f7a2242a76e19b09dccca6f68776e788 > > setexpr uses cmd_get_data_size(). If none of I2C, ITEST or PCI is > chosen, setexpr will fail to be built. > > --- include/command.h > +++ include/command.h > @@ -80,13 +80,14 @@ > * void function (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); > */ > > #if defined(CONFIG_CMD_MEMORY) || \ > defined(CONFIG_CMD_I2C) || \ > defined(CONFIG_CMD_ITEST) || \ > - defined(CONFIG_CMD_PCI) > + defined(CONFIG_CMD_PCI) || \ > + defined(CONFIG_CMD_SETEXPR) > #define CMD_DATA_SIZE > extern int cmd_get_data_size(char* arg, int default_size); > #endif This seems like a reasonable fix and patch, thanks. However, you need to repost this with your real name used as the author and a signed-off-by line, 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] [U-Boot, v1, 2/2] configs: dra7xx_evm/dra7xx_hs_evm: Enable AHCI and PIPE3
On Fri, Apr 06, 2018 at 11:13:54AM +0200, Jean-Jacques Hiblot wrote: > Those options are required to enable support for SATA on DRA7 platforms. > > Signed-off-by: Jean-Jacques HiblotApplied to u-boot/master, 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] configs: Fixup some CPSW-related items
On Tue, Apr 10, 2018 at 11:51:53AM -0400, Tom Rini wrote: > - For am335x_pdu001 we do not want the CPSW driver, drop it > - Re-sync the defconfig for am43xx_evm_rtconly as it came in after the > patch that converted CPSW to Kconfig was posted but before it was > applied. > - Drop empty section / comments from pengwyn > - Drop empty section / comments from baltos and drop unused > CONFIG_SPL_NET_VCI_STRING (it does not enable CONFIG_SPL_NET_SUPPORT > currently and SPL_NET_VCI_STRING has been migrated already). > > Cc: Felix Brack> Cc: Lokesh Vutla > Cc: Yegor Yefremov > Cc: Lothar Felten > Fixes: f02b8d17619f ("Migrate CONFIG_DRIVER_TI_CPSW to Kconfig") > Signed-off-by: Tom Rini > Reviewed-by: Felix Brack > Tested-by: Felix Brack Applied to u-boot/master, 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] [U-Boot, 1/1] vexpress: fix syntax error in armv7_boot_nonsec_default()
On Tue, Apr 10, 2018 at 11:11:53PM +0200, Heinrich Schuchardt wrote: > With CONFIG_ARMV7_BOOT_SEC_DEFAULT=y a syntax error occurs. > Add the missing semicolon. > > Signed-off-by: Heinrich SchuchardtApplied to u-boot/master, 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] [U-Boot,v2] kconfig: add CONFIG_CC_COVERAGE
On Mon, Apr 09, 2018 at 05:11:45PM +0200, Christian Gmeiner wrote: > Make it possible to use gcc code coverage analysis. > > v1 -> v2: > - Kconfig: remove not needed 'default n' > - Makefile: use consistent spacing > > Signed-off-by: Christian Gmeiner> Reviewed-by: Tom Rini Applied to u-boot/master, 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] [U-Boot, v2] vxworks: fixed cpu enable using PSCI on armv8
On Tue, Apr 10, 2018 at 12:36:36PM +0300, Vasyl Vavrychuk wrote: > Without armv8_setup_psci register VBAR_EL3 is not set up property which > makes SMC calls jump to invalid location. > > smp_kick_all_cpus is required to make slave cpus leave gic_wait_for_interrupt. > Without this they will never pursue booting process. > > Fix was applied to the two ways of booting VxWorks: bootvx and bootm commands. > > This implementation is very similar to what is done in boot_jump_linux > in arch/arm/lib/bootm.c file. > > Tested on VxWorks 7 release SR0520 2017-12-08 Intel Stratix 10 SX SoC > Development Kit board. > > Signed-off-by: Vasyl Vavrychuk> Reviewed-by: Bin Meng Applied to u-boot/master, 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] [U-Boot,v1,1/2] dwc_ahci: Fix breakage
On Fri, Apr 06, 2018 at 11:13:53AM +0200, Jean-Jacques Hiblot wrote: > The dwc_ahci has been broken for quite some time now. The breakage has been > introduced by the series "dm: scsi: Enhance SCSI support for driver model" > > Use ahci_bind_scsi() and ahci_probe_scsi() to properly bind and probe the > driver. > > Signed-off-by: Jean-Jacques HiblotApplied to u-boot/master, thanks! -- Tom signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 10/11] Revert "Kconfig: cmd: Make networking command dependent on NET"
This reverts the parts of commit 3b3ea2c56ec4bc5588281fd103c744e608f8b25c where it changed the EFI dependency on NET. Signed-off-by: Joe HershbergerReviewed-by: Duncan Hare --- Changes in v2: None Kconfig | 2 +- cmd/bootefi.c| 4 ++-- lib/efi_loader/Makefile | 2 +- lib/efi_loader/efi_device_path.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Kconfig b/Kconfig index 0b73006..081be6c 100644 --- a/Kconfig +++ b/Kconfig @@ -71,7 +71,7 @@ config DISTRO_DEFAULTS select CMD_BOOTI if ARM64 select CMD_DHCP if CMD_NET select CMD_PING if CMD_NET - select CMD_PXE if NET && CMD_NET + select CMD_PXE if NET select CMD_EXT2 select CMD_EXT4 select CMD_FAT diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 5a2a810..5498a5f 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -56,7 +56,7 @@ efi_status_t efi_init_obj_list(void) if (ret != EFI_SUCCESS) goto out; #endif -#ifdef CONFIG_CMD_NET +#ifdef CONFIG_NET ret = efi_net_register(); if (ret != EFI_SUCCESS) goto out; @@ -511,7 +511,7 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path) bootefi_device_path = efi_dp_from_part(desc, part); } else { -#ifdef CONFIG_CMD_NET +#ifdef CONFIG_NET bootefi_device_path = efi_dp_from_eth(); #endif } diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile index d2ce897..55c97c0 100644 --- a/lib/efi_loader/Makefile +++ b/lib/efi_loader/Makefile @@ -22,5 +22,5 @@ obj-y += efi_watchdog.o obj-$(CONFIG_LCD) += efi_gop.o obj-$(CONFIG_DM_VIDEO) += efi_gop.o obj-$(CONFIG_PARTITIONS) += efi_disk.o -obj-$(CONFIG_CMD_NET) += efi_net.o +obj-$(CONFIG_NET) += efi_net.o obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index ab28b2f..e965f1d 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -747,7 +747,7 @@ struct efi_device_path *efi_dp_from_file(struct blk_desc *desc, int part, return start; } -#ifdef CONFIG_CMD_NET +#ifdef CONFIG_NET struct efi_device_path *efi_dp_from_eth(void) { #ifndef CONFIG_DM_ETH -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 11/11] xilinx: Only enable dist boot pxe when DHCP is enabled
Otherwise, we see this: In file included from include/configs/zynq-common.h:183:0, from include/config.h:5, from include/common.h:21, from env/common.c:11: include/config_distro_bootcmd.h:319:2: error: expected ?}? before ?BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE? BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE ^ include/config_distro_bootcmd.h:319:2: note: in definition of macro ?BOOTENV_DEV_NAME_PXE? Signed-off-by: Joe Hershberger--- Changes in v2: - New patch include/configs/socfpga_common.h | 2 +- include/configs/xilinx_zynqmp.h | 2 +- include/configs/zynq-common.h| 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index 6580ffc..cf1f2b1 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -292,7 +292,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void); #define BOOT_TARGET_DEVICES_DHCP(func) #endif -#ifdef CONFIG_CMD_PXE +#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP) #define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na) #else #define BOOT_TARGET_DEVICES_PXE(func) diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 56c8b0c..5827911 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -172,7 +172,7 @@ # define BOOT_TARGET_DEVICES_USB(func) #endif -#if defined(CONFIG_CMD_PXE) +#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP) # define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na) #else # define BOOT_TARGET_DEVICES_PXE(func) diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 6d99249..ae82a7a 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -162,7 +162,7 @@ #define BOOT_TARGET_DEVICES_USB(func) #endif -#if defined(CONFIG_CMD_PXE) +#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP) #define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na) #else #define BOOT_TARGET_DEVICES_PXE(func) -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 05/11] net: Improve menu options and help for BOOTP options
The options were pretty unhelpful, so improve them some. Signed-off-by: Joe HershbergerReviewed-by: Chris Packham --- Changes in v2: None cmd/Kconfig | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index a89d5ac..6664379 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1042,23 +1042,32 @@ config CMD_DHCP Boot image via network using DHCP/TFTP protocol config BOOTP_BOOTPATH - bool "Enable BOOTP BOOTPATH" + bool "Request & store 'rootpath' from BOOTP/DHCP server" depends on CMD_BOOTP + help + Even though the config is called BOOTP_BOOTPATH, it stores the + path in the variable 'rootpath'. config BOOTP_DNS - bool "Enable bootp DNS" + bool "Request & store 'dnsip' from BOOTP/DHCP server" depends on CMD_BOOTP + help + The primary DNS server is stored as 'dnsip'. If two servers are + returned, you must set BOOTP_DNS2 to store that second server IP + also. config BOOTP_GATEWAY - bool "Enable BOOTP gateway" + bool "Request & store 'gatewayip' from BOOTP/DHCP server" depends on CMD_BOOTP config BOOTP_HOSTNAME - bool "Enable BOOTP hostname" + bool "Request & store 'hostname' from BOOTP/DHCP server" depends on CMD_BOOTP + help + The name may or may not be qualified with the local domain name. config BOOTP_SUBNETMASK - bool "Enable BOOTP subnetmask" + bool "Request & store 'netmask' from BOOTP/DHCP server" depends on CMD_BOOTP config BOOTP_PXE -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 06/11] net: Add the BOOTP_DNS2 option to Kconfig
Commit 3b3ea2c56ec4bc5 ("Kconfig: cmd: Make networking command dependent on NET") removed the help documentation from the README but didn't add it back to Kconfig. Signed-off-by: Joe HershbergerReviewed-by: Chris Packham Reviewed-by: Duncan Hare --- Changes in v2: None cmd/Kconfig | 11 +++ 1 file changed, 11 insertions(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index 6664379..43efe7d 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1056,6 +1056,17 @@ config BOOTP_DNS returned, you must set BOOTP_DNS2 to store that second server IP also. +config BOOTP_DNS2 + bool "Store 'dnsip2' from BOOTP/DHCP server" + depends on BOOTP_DNS + help + If a DHCP client requests the DNS server IP from a DHCP server, + it is possible that more than one DNS serverip is offered to the + client. If CONFIG_BOOTP_DNS2 is enabled, the secondary DNS + server IP will be stored in the additional environment + variable "dnsip2". The first DNS serverip is always + stored in the variable "dnsip", when BOOTP_DNS is defined. + config BOOTP_GATEWAY bool "Request & store 'gatewayip' from BOOTP/DHCP server" depends on CMD_BOOTP -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 07/11] net: Improve BOOTP PXE config option
Improve the documentation and correct the listed dependencies. Signed-off-by: Joe HershbergerReviewed-by: Duncan Hare --- Changes in v2: None cmd/Kconfig | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index 43efe7d..0d077bd 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1082,12 +1082,14 @@ config BOOTP_SUBNETMASK depends on CMD_BOOTP config BOOTP_PXE - bool "Enable BOOTP PXE" - depends on CMD_BOOTP + bool "Send PXE client arch to BOOTP/DHCP server" + depends on CMD_BOOTP && CMD_PXE + help + Supported for ARM, ARM64, and x86 for now. config BOOTP_PXE_CLIENTARCH hex - depends on CMD_BOOTP + depends on BOOTP_PXE default 0x16 if ARM64 default 0x15 if ARM default 0 if X86 -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 09/11] net: Make core net code depend on NET instead of CMD_NET
No commands are necessary to have a network stack. Signed-off-by: Joe HershbergerReviewed-by: Duncan Hare --- Changes in v2: None net/Makefile | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/Makefile b/net/Makefile index ed102ec..ce6e5ad 100644 --- a/net/Makefile +++ b/net/Makefile @@ -8,18 +8,18 @@ #ccflags-y += -DDEBUG obj-y += checksum.o -obj-$(CONFIG_CMD_NET) += arp.o +obj-$(CONFIG_NET) += arp.o obj-$(CONFIG_CMD_BOOTP) += bootp.o obj-$(CONFIG_CMD_CDP) += cdp.o obj-$(CONFIG_CMD_DNS) += dns.o ifdef CONFIG_DM_ETH -obj-$(CONFIG_CMD_NET) += eth-uclass.o +obj-$(CONFIG_NET) += eth-uclass.o else -obj-$(CONFIG_CMD_NET) += eth_legacy.o +obj-$(CONFIG_NET) += eth_legacy.o endif -obj-$(CONFIG_CMD_NET) += eth_common.o +obj-$(CONFIG_NET) += eth_common.o obj-$(CONFIG_CMD_LINK_LOCAL) += link_local.o -obj-$(CONFIG_CMD_NET) += net.o +obj-$(CONFIG_NET) += net.o obj-$(CONFIG_CMD_NFS) += nfs.o obj-$(CONFIG_CMD_PING) += ping.o obj-$(CONFIG_CMD_RARP) += rarp.o -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 02/11] net: Fix distro default dependencies
PING requires CMD_NET, not NET. Also, CMD_NET already depends on NET, so no need to directly depend on it. Signed-off-by: Joe Hershberger--- Changes in v2: - Fixed dependencies on CMD_NET - New patch Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kconfig b/Kconfig index 6670913..f319750 100644 --- a/Kconfig +++ b/Kconfig @@ -69,14 +69,14 @@ config DISTRO_DEFAULTS imply USE_BOOTCOMMAND select CMD_BOOTZ if ARM && !ARM64 select CMD_BOOTI if ARM64 - select CMD_DHCP if NET && CMD_NET + select CMD_DHCP if CMD_NET + select CMD_PING if CMD_NET select CMD_PXE if NET && CMD_NET select CMD_EXT2 select CMD_EXT4 select CMD_FAT select CMD_FS_GENERIC imply CMD_MII if NET - select CMD_PING if NET select CMD_PART if PARTITIONS select HUSH_PARSER select BOOTP_BOOTPATH if NET && CMD_NET -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 01/11] net: Make CMD_NET a menuconfig
Previously, CMD_NET was an alias for 2 commands (bootp and tftpboot) and they we not able to be disabled. Separate out those 2 commands and move CMD_NET up to the menu level, which more accurately represents the code. Signed-off-by: Joe HershbergerReviewed-by: Chris Packham Reviewed-by: Duncan Hare --- Changes in v2: None cmd/Kconfig | 25 + cmd/net.c| 4 net/Kconfig | 19 +-- net/Makefile | 4 ++-- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index d440675..fb74227 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1021,25 +1021,35 @@ config CMD_SETEXPR endmenu -menu "Network commands" - if NET -config CMD_NET - bool "bootp, tftpboot" +menuconfig CMD_NET + bool "Network commands" + default y + +if CMD_NET + +config CMD_BOOTP + bool "bootp" default y help - Network commands. bootp - boot image via network using BOOTP/TFTP protocol + +config CMD_TFTPBOOT + bool "tftpboot" + default y + help tftpboot - boot image via network using TFTP protocol config CMD_TFTPPUT bool "tftp put" + depends on CMD_TFTPBOOT help TFTP put command, for uploading files to a server config CMD_TFTPSRV bool "tftpsrv" + depends on CMD_TFTPBOOT help Act as a TFTP server and boot the first received file @@ -1050,13 +1060,12 @@ config CMD_RARP config CMD_DHCP bool "dhcp" - depends on CMD_NET + depends on CMD_BOOTP help Boot image via network using DHCP/TFTP protocol config CMD_PXE bool "pxe" - depends on CMD_NET select MENU help Boot image via network using PXE protocol @@ -1107,7 +1116,7 @@ config CMD_ETHSW endif -endmenu +endif menu "Misc commands" diff --git a/cmd/net.c b/cmd/net.c index d7c776a..67888d4 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -14,6 +14,7 @@ static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []); +#ifdef CONFIG_CMD_BOOTP static int do_bootp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { return netboot_common(BOOTP, cmdtp, argc, argv); @@ -24,7 +25,9 @@ U_BOOT_CMD( "boot image via network using BOOTP/TFTP protocol", "[loadAddress] [[hostIPaddr:]bootfilename]" ); +#endif +#ifdef CONFIG_CMD_TFTPBOOT int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int ret; @@ -40,6 +43,7 @@ U_BOOT_CMD( "boot image via network using TFTP protocol", "[loadAddress] [[hostIPaddr:]bootfilename]" ); +#endif #ifdef CONFIG_CMD_TFTPPUT static int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) diff --git a/net/Kconfig b/net/Kconfig index 143c441..d421a34 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -24,7 +24,7 @@ config NETCONSOLE config NET_TFTP_VARS bool "Control TFTP timeout and count through environment" - depends on CMD_NET + depends on CMD_TFTPBOOT default y help If set, allows controlling the TFTP timeout through the @@ -35,39 +35,38 @@ config NET_TFTP_VARS config BOOTP_BOOTPATH bool "Enable BOOTP BOOTPATH" - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_DNS bool "Enable bootp DNS" - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_GATEWAY bool "Enable BOOTP gateway" - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_HOSTNAME bool "Enable BOOTP hostname" - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_PXE bool "Enable BOOTP PXE" - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_SUBNETMASK bool "Enable BOOTP subnetmask" - depends on CMD_NET - depends on CMD_NET + depends on CMD_BOOTP config BOOTP_PXE_CLIENTARCH hex - depends on CMD_NET + depends on CMD_BOOTP default 0x16 if ARM64 default 0x15 if ARM default 0 if X86 config BOOTP_VCI_STRING string - depends on CMD_NET + depends on CMD_BOOTP default "U-Boot.armv7" if CPU_V7 || CPU_V7M default "U-Boot.armv8" if ARM64 default "U-Boot.arm" if ARM diff --git a/net/Makefile b/net/Makefile index ae54eee..ed102ec 100644 --- a/net/Makefile +++ b/net/Makefile @@ -9,7 +9,7 @@ obj-y += checksum.o obj-$(CONFIG_CMD_NET) += arp.o -obj-$(CONFIG_CMD_NET) += bootp.o +obj-$(CONFIG_CMD_BOOTP) += bootp.o obj-$(CONFIG_CMD_CDP) += cdp.o obj-$(CONFIG_CMD_DNS) += dns.o ifdef CONFIG_DM_ETH @@ -24,7 +24,7 @@ obj-$(CONFIG_CMD_NFS) += nfs.o obj-$(CONFIG_CMD_PING) += ping.o obj-$(CONFIG_CMD_RARP) += rarp.o obj-$(CONFIG_CMD_SNTP) += sntp.o -obj-$(CONFIG_CMD_NET) += tftp.o +obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o #
[U-Boot] [PATCH v2 08/11] net: Make the BOOTP options default
The BOOTP options used to be and should still be default for all boards with CMD_NET enabled. One should not be forced to use DISTRO_DEFAULTS to get them. Signed-off-by: Joe HershbergerReviewed-by: Duncan Hare --- Changes in v2: None Kconfig | 6 -- cmd/Kconfig | 6 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Kconfig b/Kconfig index f319750..0b73006 100644 --- a/Kconfig +++ b/Kconfig @@ -79,12 +79,6 @@ config DISTRO_DEFAULTS imply CMD_MII if NET select CMD_PART if PARTITIONS select HUSH_PARSER - select BOOTP_BOOTPATH if NET && CMD_NET - select BOOTP_DNS if NET && CMD_NET - select BOOTP_GATEWAY if NET && CMD_NET - select BOOTP_HOSTNAME if NET && CMD_NET - select BOOTP_PXE if NET && CMD_NET - select BOOTP_SUBNETMASK if NET && CMD_NET select CMDLINE_EDITING select AUTO_COMPLETE select SYS_LONGHELP diff --git a/cmd/Kconfig b/cmd/Kconfig index 0d077bd..bc1d2f3 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1043,6 +1043,7 @@ config CMD_DHCP config BOOTP_BOOTPATH bool "Request & store 'rootpath' from BOOTP/DHCP server" + default y depends on CMD_BOOTP help Even though the config is called BOOTP_BOOTPATH, it stores the @@ -1050,6 +1051,7 @@ config BOOTP_BOOTPATH config BOOTP_DNS bool "Request & store 'dnsip' from BOOTP/DHCP server" + default y depends on CMD_BOOTP help The primary DNS server is stored as 'dnsip'. If two servers are @@ -1069,20 +1071,24 @@ config BOOTP_DNS2 config BOOTP_GATEWAY bool "Request & store 'gatewayip' from BOOTP/DHCP server" + default y depends on CMD_BOOTP config BOOTP_HOSTNAME bool "Request & store 'hostname' from BOOTP/DHCP server" + default y depends on CMD_BOOTP help The name may or may not be qualified with the local domain name. config BOOTP_SUBNETMASK bool "Request & store 'netmask' from BOOTP/DHCP server" + default y depends on CMD_BOOTP config BOOTP_PXE bool "Send PXE client arch to BOOTP/DHCP server" + default y depends on CMD_BOOTP && CMD_PXE help Supported for ARM, ARM64, and x86 for now. -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 03/11] net: Move net command options to the cmd menu
Options that controlled the tftp and bootp commands depended on their commands, but lived in the net menu. Move them so they are in a consistent location. Signed-off-by: Joe HershbergerReviewed-by: Chris Packham --- Changes in v2: - Move eth_sw and pxe commands out of cmd_net cmd/Kconfig | 64 ++--- net/Kconfig | 50 --- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index fb74227..7f47819 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1035,6 +1035,45 @@ config CMD_BOOTP help bootp - boot image via network using BOOTP/TFTP protocol +config BOOTP_BOOTPATH + bool "Enable BOOTP BOOTPATH" + depends on CMD_BOOTP + +config BOOTP_DNS + bool "Enable bootp DNS" + depends on CMD_BOOTP + +config BOOTP_GATEWAY + bool "Enable BOOTP gateway" + depends on CMD_BOOTP + +config BOOTP_HOSTNAME + bool "Enable BOOTP hostname" + depends on CMD_BOOTP + +config BOOTP_SUBNETMASK + bool "Enable BOOTP subnetmask" + depends on CMD_BOOTP + +config BOOTP_PXE + bool "Enable BOOTP PXE" + depends on CMD_BOOTP + +config BOOTP_PXE_CLIENTARCH + hex + depends on CMD_BOOTP + default 0x16 if ARM64 + default 0x15 if ARM + default 0 if X86 + +config BOOTP_VCI_STRING + string + depends on CMD_BOOTP + default "U-Boot.armv7" if CPU_V7 || CPU_V7M + default "U-Boot.armv8" if ARM64 + default "U-Boot.arm" if ARM + default "U-Boot" + config CMD_TFTPBOOT bool "tftpboot" default y @@ -1053,6 +1092,17 @@ config CMD_TFTPSRV help Act as a TFTP server and boot the first received file +config NET_TFTP_VARS + bool "Control TFTP timeout and count through environment" + depends on CMD_TFTPBOOT + default y + help + If set, allows controlling the TFTP timeout through the + environment variable tftptimeout, and the TFTP maximum + timeout count through the variable tftptimeoutcountmax. + If unset, timeout and maximum are hard-defined as 1 second + and 10 timouts per TFTP transfer. + config CMD_RARP bool "rarpboot" help @@ -1064,12 +1114,6 @@ config CMD_DHCP help Boot image via network using DHCP/TFTP protocol -config CMD_PXE - bool "pxe" - select MENU - help - Boot image via network using PXE protocol - config CMD_NFS bool "nfs" default y @@ -1106,6 +1150,8 @@ config CMD_LINK_LOCAL help Acquire a network IP address using the link-local protocol +endif + config CMD_ETHSW bool "ethsw" help @@ -1114,7 +1160,11 @@ config CMD_ETHSW operations such as enabling / disabling a port and viewing/maintaining the filtering database (FDB) -endif +config CMD_PXE + bool "pxe" + select MENU + help + Boot image via network using PXE protocol endif diff --git a/net/Kconfig b/net/Kconfig index d421a34..f2363e5 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -22,54 +22,4 @@ config NETCONSOLE Support the 'nc' input/output device for networked console. See README.NetConsole for details. -config NET_TFTP_VARS - bool "Control TFTP timeout and count through environment" - depends on CMD_TFTPBOOT - default y - help - If set, allows controlling the TFTP timeout through the - environment variable tftptimeout, and the TFTP maximum - timeout count through the variable tftptimeoutcountmax. - If unset, timeout and maximum are hard-defined as 1 second - and 10 timouts per TFTP transfer. - -config BOOTP_BOOTPATH - bool "Enable BOOTP BOOTPATH" - depends on CMD_BOOTP - -config BOOTP_DNS - bool "Enable bootp DNS" - depends on CMD_BOOTP - -config BOOTP_GATEWAY - bool "Enable BOOTP gateway" - depends on CMD_BOOTP - -config BOOTP_HOSTNAME - bool "Enable BOOTP hostname" - depends on CMD_BOOTP - -config BOOTP_PXE - bool "Enable BOOTP PXE" - depends on CMD_BOOTP - -config BOOTP_SUBNETMASK - bool "Enable BOOTP subnetmask" - depends on CMD_BOOTP - -config BOOTP_PXE_CLIENTARCH - hex - depends on CMD_BOOTP -default 0x16 if ARM64 -default 0x15 if ARM -default 0 if X86 - -config BOOTP_VCI_STRING - string - depends on CMD_BOOTP - default "U-Boot.armv7" if CPU_V7 || CPU_V7M - default "U-Boot.armv8" if ARM64 - default "U-Boot.arm" if ARM - default "U-Boot" - endif # if NET -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 00/11] net: Clean up the menus and dependencies among commands and options
There have been a few issues persisting in the net menus and a recent change that went in (Kconfig: cmd: Make networking command dependent on NET) caused a few new issues. Clean up these things and further move to separate CMD_NET from NET along appropriate boundaries. Changes in v2: - Fixed dependencies on CMD_NET - Move eth_sw and pxe commands out of cmd_net - New patch Joe Hershberger (11): net: Make CMD_NET a menuconfig net: Fix distro default dependencies net: Move net command options to the cmd menu net: Move the DHCP command below the BOOTP command net: Improve menu options and help for BOOTP options net: Add the BOOTP_DNS2 option to Kconfig net: Improve BOOTP PXE config option net: Make the BOOTP options default net: Make core net code depend on NET instead of CMD_NET Revert "Kconfig: cmd: Make networking command dependent on NET" xilinx: Only enable dist boot pxe when DHCP is enabled Kconfig | 12 +--- cmd/Kconfig | 127 +-- cmd/bootefi.c| 4 +- cmd/net.c| 4 ++ include/configs/socfpga_common.h | 2 +- include/configs/xilinx_zynqmp.h | 2 +- include/configs/zynq-common.h| 2 +- lib/efi_loader/Makefile | 2 +- lib/efi_loader/efi_device_path.c | 2 +- net/Kconfig | 51 net/Makefile | 14 ++--- 11 files changed, 128 insertions(+), 94 deletions(-) -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 04/11] net: Move the DHCP command below the BOOTP command
Move DHCP to directly follow BOOTP so that Kconfig can show the dependency as a hierarchy. Signed-off-by: Joe HershbergerReviewed-by: Chris Packham Reviewed-by: Duncan Hare --- Changes in v2: None cmd/Kconfig | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index 7f47819..a89d5ac 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1035,6 +1035,12 @@ config CMD_BOOTP help bootp - boot image via network using BOOTP/TFTP protocol +config CMD_DHCP + bool "dhcp" + depends on CMD_BOOTP + help + Boot image via network using DHCP/TFTP protocol + config BOOTP_BOOTPATH bool "Enable BOOTP BOOTPATH" depends on CMD_BOOTP @@ -1108,12 +1114,6 @@ config CMD_RARP help Boot image via network using RARP/TFTP protocol -config CMD_DHCP - bool "dhcp" - depends on CMD_BOOTP - help - Boot image via network using DHCP/TFTP protocol - config CMD_NFS bool "nfs" default y -- 1.7.11.5 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: zynq: Disable NFS and MII on zc770 xm011
Hi Michal, On Thu, Apr 12, 2018 at 5:35 AM, Michal Simekwrote: > Disable NFS/MII because this board has no ethernet enabled. This might not be necessary after the series I made for cleaning up the NET menus. I'll be sending a v2 shortly. > > Signed-off-by: Michal Simek > --- > > configs/zynq_zc770_xm011_defconfig | 2 ++ > configs/zynq_zc770_xm011_x16_defconfig | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/configs/zynq_zc770_xm011_defconfig > b/configs/zynq_zc770_xm011_defconfig > index 9613b8af258c..5cc739f255e8 100644 > --- a/configs/zynq_zc770_xm011_defconfig > +++ b/configs/zynq_zc770_xm011_defconfig > @@ -25,6 +25,8 @@ CONFIG_CMD_GPIO=y > CONFIG_CMD_NAND_LOCK_UNLOCK=y > # CONFIG_CMD_SETEXPR is not set > # CONFIG_CMD_NET is not set > +# CONFIG_CMD_NFS is not set > +# CONFIG_CMD_MII is not set > CONFIG_CMD_CACHE=y > # CONFIG_SPL_DOS_PARTITION is not set > # CONFIG_SPL_ISO_PARTITION is not set > diff --git a/configs/zynq_zc770_xm011_x16_defconfig > b/configs/zynq_zc770_xm011_x16_defconfig > index 08cb0419b65f..756200a9ae11 100644 > --- a/configs/zynq_zc770_xm011_x16_defconfig > +++ b/configs/zynq_zc770_xm011_x16_defconfig > @@ -25,6 +25,8 @@ CONFIG_CMD_GPIO=y > CONFIG_CMD_NAND_LOCK_UNLOCK=y > # CONFIG_CMD_SETEXPR is not set > # CONFIG_CMD_NET is not set > +# CONFIG_CMD_NFS is not set > +# CONFIG_CMD_MII is not set > CONFIG_CMD_CACHE=y > # CONFIG_SPL_DOS_PARTITION is not set > # CONFIG_SPL_ISO_PARTITION is not set > -- > 2.17.0 > > ___ > 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 v9 1/3] Adding TCP and wget into u-boot
The subject for the cover letter (what you currently have as the first line of text in this commit's message) should be moved to the first line inside of the 'Cover-letter:' tag. On Sun, Mar 25, 2018 at 1:06 PM,wrote: > From: Duncan Hare > > cover-letter: I mentioned this last time, but you still didn't change it. You need a Capitol letter 'C' in Cover-letter: The cover letter will get sent as a separate email. > Why netboot: > Central management, including logs and change control, > coupled with with enhanced security and unauthorized > change detection and remediation by exposing a > small attack surface. > > Why TCP: > > Currently file transfer are done using tftp or NFS both > over udp. This requires a request to be sent from client > (u-boot) to the boot server. > > For a 4 Mbyte kernel, with a 1k block size this requires > 4,000 request for a block. > > Using a large block size, one greater than the Ethernet > maximum frame size limitation, would require fragmentation, > which u-boot supports. However missing fragment recovery > requires timeout detection and re-transmission requests > for missing fragments. > > UDP is ideally suited to fast single packet exchanges, > inquiry/response, for example dns, becuse of the lack of > connection overhead. > > UDP as a file transport mechanism is slow, even in low > latency networks, because file transfer with udp requires > poll/response mechanism to provide transfer integrity. > > In networks with large latency, for example: the internet, > UDP is even slower. What is a 30 second transfer on a local > boot server and LAN increase to over 3 minutes, because of > all the requests/response traffic. > > This was anticipated in the evolution of the IP protocols > and TCP was developed and then enhanced for high latency high > bandwidth networks. > > The current standard is TCP with selective acknowledgment. > > In our testing we have reduce kernel transmission time to > around 0.4 seconds for a 4Mbyte kernel, with a 100 Mbps > downlink. > > Why http and wget: > > HTTP is the most efficient file retrieval protocol in common > use. The client send a single request, after TCP connection, > to receive a file of any length. > > WGET is the application which implements http file transfer > outside browsers as a file transfer protocol. Versions of > wget exists on many operating systems. > END > > Signed-off-by: Duncan Hare > --- > > Added a protocol parameter to ip packet sending in net.c > Added UDP protocol for current applications to minimize > code changes to existing net apps. > > All the code is new, and not copied from any source. > This commentary should not be tagged for patman at all. Please remove the 'Series-notes:' tag. > > Changes in v9: > Initial changes for adding TCP This should be the first line of the patch, not listed under Series-changes: > > include/net.h | 25 +++-- > net/net.c | 52 ++-- > net/ping.c| 9 ++--- > 3 files changed, 55 insertions(+), 31 deletions(-) > > diff --git a/include/net.h b/include/net.h > index 455b48f6c7..7e5f5a6a5b 100644 > --- a/include/net.h > +++ b/include/net.h > @@ -15,17 +15,26 @@ > #include > #include /* for nton* / ntoh* stuff */ > > -#define DEBUG_LL_STATE 0 /* Link local state machine changes */ > -#define DEBUG_DEV_PKT 0/* Packets or info directed to the > device */ > -#define DEBUG_NET_PKT 0/* Packets on info on the network at > large */ > +#define DEBUG_LL_STATE 0 /* Link local state machine changes */ > +#define DEBUG_DEV_PKT 0 /* Packets or info directed to the device */ > +#define DEBUG_NET_PKT 0 /* Packets on info on the network at large */ > #define DEBUG_INT_STATE 0 /* Internal network state changes */ > > /* > * The number of receive packet buffers, and the required packet buffer > * alignment in memory. > * > + * The number of buffers for TCP is used to calculate a static TCP window > + * size, becuse TCP window size is a promise to the sending TCP to be > able > + * to buffer up to the window size of data. > + * When the sending TCP has a window size of outstanding unacknowledged > + * data, the sending TCP will stop sending. > */ > > +#if defined(CONFIG_TCP) > +#define CONFIG_SYS_RX_ETH_BUFFER 12/* For TCP */ > +#endif > + > #ifdef CONFIG_SYS_RX_ETH_BUFFER > # define PKTBUFSRX CONFIG_SYS_RX_ETH_BUFFER > #else > @@ -354,6 +363,7 @@ struct vlan_ethernet_hdr { > > #define IPPROTO_ICMP1 /* Internet Control Message Protocol*/ > #define IPPROTO_UDP17 /* User Datagram Protocol */ > +#define IPPROTO_TCP 6 /* Transmission Control Protocol*/ > > /* > * Internet Protocol (IP) header. > @@ -596,10 +606,10 @@ int net_set_ether(uchar *xet, const uchar > *dest_ethaddr, uint
Re: [U-Boot] [PATCH] net: sh_eth: Add remaining Gen2 DT compatible
On Thu, Apr 12, 2018 at 2:54 PM, Marek Vasutwrote: > Add compatible strings for R8A7790, R8A7793 and R8A7794, since the > contemporary DTs use those don't have a generic match value. > > Signed-off-by: Marek Vasut > Cc: Nobuhiro Iwamatsu > Cc: Joe Hershberger Acked-by: Joe Hershberger ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/1] sunxi: R40: add support for gigabit ethernet
On Thu, Apr 12, 2018 at 1:19 PM, Lothar Feltenwrote: > This patch adds support for the gigabit interface found on the > Allwinner R40/V40 CPU. > It does not support the 100Mbit interface (EMAC). > > Fixes: > - add GMAC gating clock and reset control > - GPIO mux settings > - device tree entries > > Tested on BananaPi M2 Berry (R40), custom board (V40). > > Signed-off-by: Lothar Felten > --- > arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts | 14 ++ > arch/arm/dts/sun8i-r40.dtsi | 37 > +++ > arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 10 +++- > board/sunxi/gmac.c| 5 +++- > configs/Bananapi_M2_Ultra_defconfig | 4 +++ > drivers/net/sun8i_emac.c | 2 ++ > 6 files changed, 70 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts > b/arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts > index ab471ab0bf..25f2112fbf 100644 > --- a/arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts > +++ b/arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts > @@ -67,3 +67,17 @@ > pinctrl-0 = <_pb_pins>; > status = "okay"; > }; > + > + { > + pinctrl-names = "default"; > + pinctrl-0 = <_pins_rgmii>; > + status = "okay"; > + phy-handle = <_phy>; > +}; > + > + { > + rgmii_phy: ethernet-phy@1 { > + compatible = "ethernet-phy-ieee802.3-c22"; > + reg = <1>; > + }; > +}; > diff --git a/arch/arm/dts/sun8i-r40.dtsi b/arch/arm/dts/sun8i-r40.dtsi > index 48ec2e855a..93bf811014 100644 > --- a/arch/arm/dts/sun8i-r40.dtsi > +++ b/arch/arm/dts/sun8i-r40.dtsi > @@ -114,6 +114,12 @@ > #size-cells = <1>; > ranges; > > + syscon: syscon@1c0 { > + compatible = "allwinner,sun8i-r40-system-controller", > + "syscon"; > + reg = <0x01c0 0x1000>; > + }; > + > pio: pinctrl@1c20800 { > compatible = "allwinner,sun8i-r40-pinctrl"; > reg = <0x01c20800 0x400>; > @@ -126,6 +132,15 @@ > #interrupt-cells = <3>; > #gpio-cells = <3>; > > + gmac_pins_rgmii: gmac_rgmii { > + pins = "PA0", "PA1", "PA2", > + "PA3", "PA4", "PA5", "PA6", > + "PA7", "PA8", "PA10", > + "PA11", "PA12", "PA13", > + "PA15", "PA16"; > + function = "gmac"; > + }; > + > i2c0_pins: i2c0_pins { > pins = "PB0", "PB1"; > function = "i2c0"; > @@ -159,6 +174,28 @@ > #size-cells = <0>; > }; > > + gmac: ethernet@01c5 { > + compatible = "allwinner,sun8i-h3-emac"; > + syscon = <>; > + reg = <0x01c5 0x2000>; > + interrupts = ; > + interrupt-names = "macirq"; > + clocks = <>, <>; > + clock-names = "stmmaceth", "allwinner_gmac_tx"; > + #address-cells = <1>; > + #size-cells = <0>; > + pinctrl-names = "default"; > + pinctrl-0 = <_pins_rgmii>; > + phy-mode = "rgmii"; > + status = "disabled"; > + > + mdio: mdio { > + #address-cells = <1>; > + #size-cells = <0>; > + compatible = "snps,dwmac-mdio"; > + }; > + }; > + > gic: interrupt-controller@1c81000 { > compatible = "arm,cortex-a7-gic", > "arm,cortex-a15-gic"; > reg = <0x01c81000 0x1000>, > diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h > b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h > index d35aa479f7..5af8c64fa2 100644 > --- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h > +++ b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h > @@ -61,7 +61,11 @@ struct sunxi_ccm_reg { > u32 reserved11; > u32 sata_clk_cfg; /* 0xc8 SATA clock control (R40 only) */ > u32 usb_clk_cfg;/* 0xcc USB clock control */ > - u32 gmac_clk_cfg; /* 0xd0 GMAC clock control */ > +#ifndef CONFIG_MACH_SUN8I_R40 You should use positive logic for this type of thing (where you have both cases). > + u32 gmac_clk_cfg; /* 0xd0 GMAC clock control (not for R40) */ > +#else > + u32 cir0_clk_cfg; /* 0xd0 CIR0
[U-Boot] [PATCH] ARM: rmobile: Shrink the TPL
Shrink the TPL by using tiny printf and tiny memset by default. This removes the biggest symbol -- vsnprintf_internal -- from the TPL and reduces the text segment by about 2 kiB. Signed-off-by: Marek VasutCc: Nobuhiro Iwamatsu --- arch/arm/mach-rmobile/Kconfig.32 | 4 configs/porter_defconfig | 1 - configs/stout_defconfig | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rmobile/Kconfig.32 b/arch/arm/mach-rmobile/Kconfig.32 index 37e0cbab79..d5b00ef379 100644 --- a/arch/arm/mach-rmobile/Kconfig.32 +++ b/arch/arm/mach-rmobile/Kconfig.32 @@ -73,6 +73,8 @@ config TARGET_PORTER select SUPPORT_TPL select SUPPORT_SPL select SPL_DM if SPL + select USE_TINY_PRINTF + select TPL_TINY_MEMSET config TARGET_STOUT bool "Stout board" @@ -81,6 +83,8 @@ config TARGET_STOUT select SUPPORT_TPL select SUPPORT_SPL select SPL_DM if SPL + select USE_TINY_PRINTF + select TPL_TINY_MEMSET endchoice diff --git a/configs/porter_defconfig b/configs/porter_defconfig index 3e0900e840..3b79ac5e27 100644 --- a/configs/porter_defconfig +++ b/configs/porter_defconfig @@ -98,4 +98,3 @@ CONFIG_DM_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_PCI=y CONFIG_USB_STORAGE=y -CONFIG_TPL_TINY_MEMSET=y diff --git a/configs/stout_defconfig b/configs/stout_defconfig index bc5c561c21..a839f55ed7 100644 --- a/configs/stout_defconfig +++ b/configs/stout_defconfig @@ -98,4 +98,3 @@ CONFIG_DM_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_PCI=y CONFIG_USB_STORAGE=y -CONFIG_TPL_TINY_MEMSET=y -- 2.16.2 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PULL] u-boot-sh/master
On Thu, Apr 12, 2018 at 05:28:35AM +0200, Marek Vasut wrote: > The following changes since commit > d79dfd4519c3f357a2523acfeb26eca6f59eae4d: > > > > > > spl: ram: Add TPL Kconfig symbols (2018-04-11 13:22:06 -0400) > > > > > > are available in the Git repository at: > > git://git.denx.de/u-boot-sh.git master > > for you to fetch changes up to 97ed677831e45b789fc19bd807273ff34486efb8: > > ARM: rmobile: Set maximum kernel size to 64 MiB on Gen3 (2018-04-11 > 23:19:52 +0200) > Applied to u-boot/master, 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] [PULL] u-boot-usb/master
On Thu, Apr 12, 2018 at 05:30:06AM +0200, Marek Vasut wrote: > The following changes since commit c4446b1d6c96de406972690083e2884bf69bce5c: > > Merge git://git.denx.de/u-boot-ubi (2018-04-11 10:05:41 -0400) > > are available in the Git repository at: > > git://git.denx.de/u-boot-usb.git master > > for you to fetch changes up to 2960e27e3834ef2e6d506b21a582bd97ac18bbb0: > > phy: Add Amlogic Meson USB2 & USB3 Generic PHY drivers (2018-04-11 > 17:22:07 +0200) > Applied to u-boot/master, 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] [PATCH 03/12] libfdt: Safer access to strings section
On Thu, Apr 12, 2018 at 02:39:19PM +1000, David Gibson wrote: > On Tue, Apr 10, 2018 at 10:42:45AM -0400, Simon Glass wrote: > > +U-Boot, Tom, Masahiro > > > > Hi David, > > > > On 10 April 2018 at 01:22, David Gibsonwrote: > > > On Wed, Apr 04, 2018 at 01:21:10AM +0800, Simon Glass wrote: > > >> Hi David, > > >> > > >> On 3 April 2018 at 23:02, David Gibson > > >> wrote: > > >> > > > >> > On Fri, Mar 30, 2018 at 04:42:21PM +0800, Simon Glass wrote: > > >> > > Hi David, > > >> > > > > >> > > On 26 March 2018 at 07:25, David Gibson > > >> > > wrote: > > >> > > > fdt_string() is used to retrieve strings from a DT blob's strings > > >> > > > section. > > >> > > > It's rarely used directly, but is widely used internally. > > >> > > > > > >> > > > However, it doesn't do any bounds checking, which means in the > > >> > > > case of a > > >> > > > corrupted blob it could access bad memory, which libfdt is > > >> > > > supposed to > > >> > > > avoid. > > >> > > > > > >> > > > This write a safe alternative to fdt_string, fdt_get_string(). It > > >> > > > checks > > >> > > > both that the given offset is within the string section and that > > >> > > > the string > > >> > > > it points to is properly \0 terminated within the section. It > > >> > > > also returns > > >> > > > the string's length as a convenience (since it needs to determine > > >> > > > to do the > > >> > > > checks anyway). > > >> > > > > > >> > > > fdt_string() is rewritten in terms of fdt_get_string() for > > >> > > > compatibility. > > >> > > > > > >> > > > Most of the diff here is actually testing infrastructure. > > >> > > > > > >> > > > Signed-off-by: David Gibson > > >> > > > --- > > >> > > > libfdt/fdt_ro.c | 61 > > >> > > > +++-- > > >> > > > libfdt/libfdt.h | 18 ++- > > >> > > > libfdt/version.lds | 2 +- > > >> > > > tests/.gitignore | 1 + > > >> > > > tests/Makefile.tests | 2 +- > > >> > > > tests/run_tests.sh | 1 + > > >> > > > tests/testdata.h | 1 + > > >> > > > tests/testutils.c| 11 +-- > > >> > > > tests/trees.S| 26 > > >> > > > tests/truncated_string.c | 79 > > >> > > > > > >> > > > 10 files changed, 193 insertions(+), 9 deletions(-) > > >> > > > create mode 100644 tests/truncated_string.c > > >> > > > > >> > > Similar code-size quesiton here. It looks like a lot of checking > > >> > > code. > > >> > > Can we have an option to remove it? > > >> > > > >> > Again, I'm disinclined without a concrete example of a problem. Fwiw > > >> > the code size change is +276 bytes on my setup. > > >> > > >> That might not sound like a lot, but the overhead of DT in U-Boot is > > >> about 3KB, so this adds nearly 10%. > > > > > > Hm. And how much is it compared to the whole U-Boot blob? > > > > > >> The specific problem is that when U-Boot SPL gets too big boards don't > > >> boot. Because we take the upstream libfdt this will affect U-Boot. > > >> > > >> Do you have any thoughts on how we could avoid this size increase? > > > > > > So, again, I'm very disinclined to prioritize size over memory safety > > > without a *concrete* example. i.e. "We hit this specific problem with > > > size on this specific board that we were really using" rather than > > > just "it might be a problem". > > > > > > IMO, thinking of it in terms of the "increase" is the wrong way > > > arond. If size is really a problem for you, you want to consider how > > > you can reduce it in any way, not just rolling back the most recent > > > changes. The most obvious one to me would be to try > > > -ffunction-sections to exclude any functions that aren't actually used > > > by u-boot (if this is helpful and the compiler's an issue, I'd be > > > willing to consider splitting up libfdt into a bunch more C files). > > > > Actually U-Boot does use that option. Believe me, a lot of work has > > gone into making this small. There is constant pressure to > > reduce/retain the size in SPL so that we can stay below limits. E.g. > > firefly-rk3288 has a 30KB limit for SPL. Current problems are the > > 64-bit Allwinner parts which are right up against the limit at > > present. > > > > Also, Masahiro recently did some work to make U-Boot's version of > > libfdt the same as is used by Linux, so any changes will impact us > > quite quickly. > > Hm, ok, point taken. > > I did some quick hacks and I think it wouldn't be too hard to add a > "-DUNSAFE" or similar option that would turn off most of the checking > and save a substantial amount of code. > > I don't really have time to polish this up myself, but I'd be happy to > merge patches that add something like this. I am disinclined to hold > up this safety work for it, though. > > If someone tackles this,
Re: [U-Boot] [PATCH] bootm: Align cache flush begin address
On Fri, Apr 13, 2018 at 04:07:20PM +0100, Bryan O'Donoghue wrote: > commit b4d956f6bc0f ("bootm: Align cache flush end address correctly") > aligns the end address of the cache flush operation to a cache-line size to > ensure lower-layers in the code accept the range provided and flush. > > A similar action should be taken for the begin address of a cache flush > operation. The load address may not be aligned to a cache-line boundary, so > ensure the passed address is aligned. > > Signed-off-by: Bryan O'Donoghue> Reported-by: Breno Matheus Lima > Cc: Simon Glass > --- > common/bootm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/common/bootm.c b/common/bootm.c > index adb1213..45d140c 100644 > --- a/common/bootm.c > +++ b/common/bootm.c > @@ -447,7 +447,8 @@ static int bootm_load_os(bootm_headers_t *images, > unsigned long *load_end, > bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE); > return err; > } > - flush_cache(load, ALIGN(*load_end - load, ARCH_DMA_MINALIGN)); > + flush_cache(ALIGN(load, ARCH_DMA_MINALIGN), > + ALIGN(*load_end - load, ARCH_DMA_MINALIGN)); Am I wrong in thinking that we would want ALIGN_DOWN for load here? -- Tom signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] rpi: Adjust fdt_addr_r to a sane address
Back in the old days, 0x100 was used as the address to pass the device tree from firmware into the kernel. This has since changed to a more dynamic location, so using 0x100 actually breaks more things than it helps with. Let's move the device tree default location for distro boot to a more sane place that gives us enough head room in low memory. Reported-by: Tuomas TynkkynenSigned-off-by: Alexander Graf --- include/configs/rpi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/rpi.h b/include/configs/rpi.h index 325e52a019..fcf7e0976b 100644 --- a/include/configs/rpi.h +++ b/include/configs/rpi.h @@ -124,7 +124,7 @@ #define ENV_MEM_LAYOUT_SETTINGS \ "fdt_high=\0" \ "initrd_high=\0" \ - "fdt_addr_r=0x0100\0" \ + "fdt_addr_r=0x01f0\0" \ "pxefile_addr_r=0x0010\0" \ "kernel_addr_r=0x0100\0" \ "scriptaddr=0x0200\0" \ -- 2.12.3 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 12/17] warp7: select uuid partition based on rootpart
Assigning the UUID discovery path to a tweakable environment variable means that later steps in the boot process - particularly a boot script can change the target root partition of a particular Linux boot. Retargeting the rootfs is an important feature when doing ping/pong upgrades allowing a boot script to select ping or pong as necessary without reprogramming the bootloader. Signed-off-by: Bryan O'Donoghue--- include/configs/warp7.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 344042c..54b3b31 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -45,7 +45,8 @@ "ip_dyn=yes\0" \ "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ - "finduuid=part uuid mmc 0:2 uuid\0" \ + "rootpart=" __stringify(CONFIG_WARP7_ROOT_PART) "\0" \ + "finduuid=part uuid mmc 0:${rootpart} uuid\0" \ "mmcargs=setenv bootargs console=${console},${baudrate} " \ "root=PARTUUID=${uuid} rootwait rw\0" \ "loadbootscript=" \ -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 13/17] warp7: Define the name of a signed boot-script file
We need to know the name of a signed boot-script, its better to have a separate variable for this then to simply append some fixed string to an existing image name. Signed-off-by: Bryan O'Donoghue--- include/configs/warp7.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 54b3b31..0ed95d8 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -33,6 +33,7 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_DFU_ENV_SETTINGS \ "script=boot.scr\0" \ + "script_signed=boot.scr.imx-signed\0" \ "image=zImage\0" \ "console=ttymxc0\0" \ "ethact=usb_ether\0" \ -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 14/17] warp7: add warp7_auth_or_fail
Doing secure boot on the WaRP7 using a common image format and the same variable to represent the base address for each call means we can reduce down the command to a single environment command. This patch adds warp7_auth_or_fail as a wrapper around "hab_auth_img_or_fail ${hab_ivt_addr} ${filesize} 0". Signed-off-by: Bryan O'Donoghue--- include/configs/warp7.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 0ed95d8..454bc1c 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -50,6 +50,7 @@ "finduuid=part uuid mmc 0:${rootpart} uuid\0" \ "mmcargs=setenv bootargs console=${console},${baudrate} " \ "root=PARTUUID=${uuid} rootwait rw\0" \ + "warp7_auth_or_fail=hab_auth_img_or_fail ${hab_ivt_addr} ${filesize} 0;\0" \ "loadbootscript=" \ "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ "bootscript=echo Running bootscript from mmc ...; " \ -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 10/17] warp7: Make CONFIG_SYS_FDT_ADDR a define
In order to sign images with the IMX code-signing-tool (CST) we need to know the load address of a given image. The best way to derive this load address is to make it into a define - so that u-boot.cfg contains the address - which we can then parse when generating the IMX CST headers. Signed-off-by: Bryan O'DonoghueReviewed-by: Ryan Harkin --- board/warp7/Kconfig | 6 ++ include/configs/warp7.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/board/warp7/Kconfig b/board/warp7/Kconfig index 61c33fb..00df19d 100644 --- a/board/warp7/Kconfig +++ b/board/warp7/Kconfig @@ -6,4 +6,10 @@ config SYS_BOARD config SYS_CONFIG_NAME default "warp7" +config SYS_FDT_ADDR + hex "FDT load address" + default 0x8300 + help + The address the FDT file should be loaded to. + endif diff --git a/include/configs/warp7.h b/include/configs/warp7.h index e12b90b..344042c 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -39,7 +39,7 @@ "fdt_high=0x\0" \ "initrd_high=0x\0" \ "fdt_file=imx7s-warp.dtb\0" \ - "fdt_addr=0x8300\0" \ + "fdt_addr=" __stringify(CONFIG_SYS_FDT_ADDR)"\0" \ "optee_addr=" __stringify(CONFIG_OPTEE_LOAD_ADDR)"\0" \ "boot_fdt=try\0" \ "ip_dyn=yes\0" \ -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 05/17] warp7: Allocate specific region of memory to OPTEE
Subtracts CONFIG_OPTEE_TZDRAM_SIZE from the available DRAM size. On WaRP7 we simply define the OPTEE region as from the maximum DRAM address minus CONFIG_OPTEE_TZDRAM_SIZE bytes. Note the OPTEE boot process will itself subtract the DRAM region it lives in from the memory map passed to Linux. Signed-off-by: Bryan O'Donoghue--- board/warp7/warp7.c | 5 + 1 file changed, 5 insertions(+) diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c index 0d3d324..56f0cdd 100644 --- a/board/warp7/warp7.c +++ b/board/warp7/warp7.c @@ -58,6 +58,11 @@ int dram_init(void) { gd->ram_size = PHYS_SDRAM_SIZE; + /* Subtract the defined OPTEE runtime firmware length */ +#ifdef CONFIG_OPTEE_TZDRAM_SIZE + gd->ram_size -= CONFIG_OPTEE_TZDRAM_SIZE; +#endif + return 0; } -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 07/17] warp7: Specify CONFIG_OPTEE_LOAD_ADDR
In order to sign images with the IMX code-signing-tool (CST) we need to know the load address of a given image. The best way to derive this load address is to make it into a define - so that u-boot.cfg contains the address - which we can then parse when generating the IMX CST headers. This patch makes the OPTEE_LOAD_ADDR available via u-boot.cfg for further parsing by external tools. Signed-off-by: Bryan O'DonoghueReviewed-by: Ryan Harkin --- configs/warp7_defconfig | 1 + include/configs/warp7.h | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index 3dbcd69..c647cd0 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -45,3 +45,4 @@ CONFIG_USB_ETH_CDC=y CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00" CONFIG_OF_LIBFDT=y CONFIG_OPTEE=y +CONFIG_OPTEE_LOAD_ADDR=0x8400 diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 10db716..e12b90b 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -40,6 +40,7 @@ "initrd_high=0x\0" \ "fdt_file=imx7s-warp.dtb\0" \ "fdt_addr=0x8300\0" \ + "optee_addr=" __stringify(CONFIG_OPTEE_LOAD_ADDR)"\0" \ "boot_fdt=try\0" \ "ip_dyn=yes\0" \ "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 06/17] warp7: Print out the OPTEE DRAM region
Right now a region of 0x30 bytes is allocated at the end of DRAM for the purposes of loading an OPTEE firmware inside of it. This patch adds the printout of the relevant address ranges. Signed-off-by: Bryan O'Donoghue--- board/warp7/warp7.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c index 56f0cdd..da52b18 100644 --- a/board/warp7/warp7.c +++ b/board/warp7/warp7.c @@ -181,7 +181,17 @@ int checkboard(void) else mode = "non-secure"; +#ifdef CONFIG_OPTEE_TZDRAM_SIZE + unsigned long optee_start, optee_end; + + optee_end = PHYS_SDRAM + PHYS_SDRAM_SIZE; + optee_start = optee_end - CONFIG_OPTEE_TZDRAM_SIZE; + + printf("Board: WARP7 in %s mode OPTEE DRAM 0x%08lx-0x%08lx\n", + mode, optee_start, optee_end); +#else printf("Board: WARP7 in %s mode\n", mode); +#endif return 0; } -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 16/17] warp7: defconfig: Enable CMD_SETEXPR
setexpr allows us to do arithmetic for env variables - something that is both useful and required when doing HAB authentication without hard-coding HAB load addresses. This patch enables CMD_SETEXPR for the WaRP7 defconfig. Signed-off-by: Bryan O'Donoghue--- configs/warp7_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index d5dc009..13c760d 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -21,7 +21,7 @@ CONFIG_CMD_MMC=y CONFIG_CMD_PART=y CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y -# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_SETEXPR=y CONFIG_CMD_DHCP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT2=y -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 17/17] warp7: Add support for automated secure boot.scr verification
This patch adds support for verifying a signed boot.scr. With this in place it's possible for run-time Linux to update boot.scr to set different variables such as switching between different boot partitions, pointing to different kernels etc and for u-boot to verify these changes via the HAB prior to executing the commands contained in boot.scr. Signed-off-by: Bryan O'Donoghue--- include/configs/warp7.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/configs/warp7.h b/include/configs/warp7.h index fe9b7d5..f340bff 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -53,6 +53,14 @@ "root=PARTUUID=${uuid} rootwait rw\0" \ "ivt_offset=" __stringify(BOOTROM_IVT_HDR_OFFSET)"\0"\ "warp7_auth_or_fail=hab_auth_img_or_fail ${hab_ivt_addr} ${filesize} 0;\0" \ + "do_bootscript_hab=" \ + "if test ${hab_enabled} -eq 1; then " \ + "setexpr hab_ivt_addr ${loadaddr} - ${ivt_offset}; " \ + "setenv script ${script_signed}; " \ + "load mmc ${mmcdev}:${mmcpart} ${hab_ivt_addr} ${script}; " \ + "run warp7_auth_or_fail; " \ + "run bootscript; "\ + "fi;\0" \ "loadbootscript=" \ "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ "bootscript=echo Running bootscript from mmc ...; " \ @@ -79,6 +87,7 @@ #define CONFIG_BOOTCOMMAND \ "mmc dev ${mmcdev};" \ "mmc dev ${mmcdev}; if mmc rescan; then " \ + "run do_bootscript_hab;" \ "if run loadbootscript; then " \ "run bootscript; " \ "else " \ -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 08/17] warp7: defconfig: Enable CONFIG_SECURE_BOOT
Various function associated with booting the WaRP7 in High Assurance Boot (HAB) mode are enabled by switching on CONFIG_SECURE_BOOT. This patch enables CONFIG_SECURE_BOOT for the WaRP7 defconfig. Signed-off-by: Bryan O'Donoghue--- configs/warp7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index c647cd0..efb6f51 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_MX7=y +CONFIG_SECURE_BOOT=y CONFIG_SYS_TEXT_BASE=0x8780 CONFIG_TARGET_WARP7=y CONFIG_ARMV7_BOOT_SEC_DEFAULT=y -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 11/17] warp7: Add Kconfig WARP7_ROOT_PART
Adding CONFIG_WARP7_ROOT_PART allows a defconfig to specify which partition is use as the root partition on WaRP7, this is a desirable change in order to support a different partitioning schemes. The default is the current partition #2. Signed-off-by: Bryan O'Donoghue--- board/warp7/Kconfig | 8 1 file changed, 8 insertions(+) diff --git a/board/warp7/Kconfig b/board/warp7/Kconfig index 00df19d..c089bca 100644 --- a/board/warp7/Kconfig +++ b/board/warp7/Kconfig @@ -6,6 +6,14 @@ config SYS_BOARD config SYS_CONFIG_NAME default "warp7" +config WARP7_ROOT_PART + int "Partition number to use for root filesystem" + default 2 + help + The partition number to use for root filesystem this is the + partition that is typically specified with root=/dev/sdaX or + which gets converted into a root=PARTUUID=some_uuid. + config SYS_FDT_ADDR hex "FDT load address" default 0x8300 -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 02/17] warp7: hab: Add a CSF location definition
In order to correctly produce an image with a IVT/DCD header we need to define a CSF in imximage.cfg. We just use the mx7 default here. All we have to do with this option switched on is "make u-boot.imx" and we then will get - u-boot.imx - u-boot.imx.log The log file is really important because it gives the addresses for the HAB that we will require to sign the u-boot image using the CST. Since the addresses can change this logfile is a critical output. Signed-off-by: Bryan O'Donoghue--- board/warp7/imximage.cfg | 4 1 file changed, 4 insertions(+) diff --git a/board/warp7/imximage.cfg b/board/warp7/imximage.cfg index 5b42793..51a5bff 100644 --- a/board/warp7/imximage.cfg +++ b/board/warp7/imximage.cfg @@ -13,6 +13,10 @@ #include IMAGE_VERSION 2 +#ifdef CONFIG_SECURE_BOOT +CSF CONFIG_CSF_SIZE +#endif + BOOT_FROM sd /* -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 15/17] warp7: hab: Set environment variable indicating IVT offset
This patch introduces the environment variable ivt_offset. When we define a load address for Linux or DTB or any file the IVT associated with that file is prepended. We extract the actual load addresses from u-boot.cfg and feed these values into the code-signing process - hence we want u-boot to have the real load addresses exported in uboot.cfg. ivt_offset represents the addition or subtraction from the load address that must happen to find an IVT header. Signed-off-by: Bryan O'Donoghue--- include/configs/warp7.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 454bc1c..fe9b7d5 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -10,6 +10,7 @@ #define __WARP7_CONFIG_H #include "mx7_common.h" +#include #define PHYS_SDRAM_SIZESZ_512M @@ -50,6 +51,7 @@ "finduuid=part uuid mmc 0:${rootpart} uuid\0" \ "mmcargs=setenv bootargs console=${console},${baudrate} " \ "root=PARTUUID=${uuid} rootwait rw\0" \ + "ivt_offset=" __stringify(BOOTROM_IVT_HDR_OFFSET)"\0"\ "warp7_auth_or_fail=hab_auth_img_or_fail ${hab_ivt_addr} ${filesize} 0;\0" \ "loadbootscript=" \ "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 04/17] warp7: defconfig: Enable OPTEE for WaRP7
Requires setting CONFIG_OPTEE=y and setting an OPTEE TrustZone DRAM base in include/configs/warp7.h. Signed-off-by: Bryan O'Donoghue--- configs/warp7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index d720bac..3dbcd69 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -44,3 +44,4 @@ CONFIG_USB_ETHER=y CONFIG_USB_ETH_CDC=y CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00" CONFIG_OF_LIBFDT=y +CONFIG_OPTEE=y -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 03/17] warp7: hab: Set environment variable indicating HAB enable
This patch adds an environment variable called "hab_enabled" which gets set to a boolean status indicating whether HAB is enabled or not. Subsequent patches can use this environment variable to determine if its necessary to run a given binary through the hab_auth_img console command. Signed-off-by: Bryan O'Donoghue--- board/warp7/warp7.c | 8 include/configs/warp7.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c index 327f656..0d3d324 100644 --- a/board/warp7/warp7.c +++ b/board/warp7/warp7.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -203,6 +204,13 @@ int board_late_init(void) */ clrsetbits_le16(>wcr, 0, 0x10); +#ifdef CONFIG_SECURE_BOOT + /* Determine HAB state */ + env_set_ulong(HAB_ENABLED_ENVNAME, imx_hab_is_enabled()); +#else + env_set_ulong(HAB_ENABLED_ENVNAME, 0); +#endif + #ifdef CONFIG_SERIAL_TAG /* Set serial# standard environment variable based on OTP settings */ get_board_serial(); diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 98fedb8..10db716 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -139,4 +139,7 @@ #define CONFIG_USBNET_DEV_ADDR "de:ad:be:af:00:01" +/* Environment variable name to represent HAB enable state */ +#define HAB_ENABLED_ENVNAME"hab_enabled" + #endif -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 09/17] warp7: defconfig: Enable CONFIG_BOOTM_TEE
This patch enables CONFIG_BOOTM_TEE. Once enabled its possible to chain-load Linux through OPTEE. Loading kernel to 0x8080 => run loadimage Load FDT to 0x8300 => run loadfdt Load OPTEE to 0x8400 => fatload mmc 0:5 0x8400 /lib/firmware/uTee.optee Then chain-load to the kernel via OPTEE => bootm 0x8400 - 0x8300 Image Name: Image Type: ARM Trusted Execution Environment Kernel Image (uncompressed) Data Size:249844 Bytes = 244 KiB Load Address: 9de4 Entry Point: 9e00 Verifying Checksum ... OK Loading Kernel Image ... OK Signed-off-by: Bryan O'Donoghue--- configs/warp7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index efb6f51..d5dc009 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -47,3 +47,4 @@ CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00" CONFIG_OF_LIBFDT=y CONFIG_OPTEE=y CONFIG_OPTEE_LOAD_ADDR=0x8400 +CONFIG_BOOTM_OPTEE=y -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 00/17] warp7: Enable automated OPTEE/HAB boot flow
https://git.linaro.org/landing-teams/working/mbl/u-boot.git/log/?h=linaro-mbl%2bbod v3: - Reword commit message of patch #16 - Breno - This patchset now relies on five in-flight patch-sets the first four of which should be applied first 1. [PATCH v3 0/3] NXP WaARP7 set serial# from OTP fuses for USB iSerial Already has a Reviewed-by from Fabio 2. [PATCH v3 0/2] imx: hab: Add helper functions for scripted HAB auth Has a Reviewed-by: from Breno 3. [PATCH v3 0/2] WaRP7 unify secure and non-secure defconfigs 4. Pierre-Jean's generic load patches [U-Boot] [PATCH v3 1/2] warp7: include/configs: use generic fs commands in CONFIG_EXTRA_ENV_SETTINGS [U-Boot] [PATCH v3 2/2] warp7: configs: enable CONFIG_CMD_FS_GENERIC 5. [PATCH] bootm: Align cache flush begin address This last patch can be applied in any order v2: - Ensure warp7_defconfig boots existing yocto with this change plus the automated HAB layer being added here following on from "[PATCH v3 0/2] WaRP7 unify secure and non-secure defconfigs" - Fix reference to partition #1 versus partition #2 in select uuidpart patch - Rebase on top of Pierre-Jean Texier generic load patches - Drop my patch which did the same thing as Pierre-Jean's patch via ${loadcmd} - Update example boot.scr from v1 to reflect use of generic 'load' command - This patchset now relies on four in-flight patch-sets which all have the relevant Reviewed-by tags from the board Maintainer Fabio. 1. [PATCH v3 0/3] NXP WaARP7 set serial# from OTP fuses for USB iSerial Already has a Reviewed-by from Fabio 2. [PATCH v3 0/2] imx: hab: Add helper functions for scripted HAB auth Has a Reviewed-by: from Breno 3. [PATCH v3 0/2] WaRP7 unify secure and non-secure defconfigs 4. Pierre-Jean's generic load patches [U-Boot] [PATCH v3 1/2] warp7: include/configs: use generic fs commands in CONFIG_EXTRA_ENV_SETTINGS [U-Boot] [PATCH v3 2/2] warp7: configs: enable CONFIG_CMD_FS_GENERIC v1: This series enables an automated HAB verified secure boot which chain-loads via OPTEE see `git show 5cf3251..c225e7c` for details. This set depends on three in-flight patchsets 1. [PATCH v3 0/3] NXP WaARP7 set serial# from OTP fuses for USB iSerial Already has a Reviewed-by from Fabio 2. [PATCH v3 0/2] imx: hab: Add helper functions for scripted HAB auth Has a Reviewed-by: from Breno 3. [PATCH] configs: warp7: Fix CAAM on boot with tip-of-tree I'm trying not to make this cover email too long. So - once this set is applied it is possible to boot from the BootROM using HAB to verify - u-boot - boot.scr - Kernel - DTB Chainload via OPTEE and boot up to Linux. If there is a HAB failure at any stage of the process we force-drop down to the USB HID failover mode, from which we can send up a recovery image to unblock. I've run the WaRP7 default u-boot and this new version on NXP's reference yocto image and verified that that yocto image boots with both versions of the WaRP7 -> warp7_defconfig and warp7_secure_defconfig. http://freescale.github.io/#download -> BoardsWaRPboard community - WaRP - Wearable Reference PlatformFSL Community BSP 2.3fsl-image-multimediawayland In addition the modifications targeting warp7_secure_defconfig mean it is possible to chain-load via OPTEE using scripted HAB to verify images prior to exiting the u-boot domain. Here is an example of the scripting we are doing which shows further reuse of shell functions introduced in previous patches. Example secure-boot boot.scr.imx-signed # This section is responsbile for loading a signed Linux kernel setenv image_signed zImage.imx-signed if test ${hab_enabled} -eq 1; then setexpr hab_ivt_addr ${loadaddr} - ${ivt_offset} load mmc ${mmcdev}:${mmcpart} ${hab_ivt_addr} ${image_signed} run warp7_auth_or_fail else run loadimage; fi # This section is responsbile for loading a signed FDT image setenv fdt_file_signed imx7s-warp.dtb.imx-signed if test ${hab_enabled} -eq 1; then setexpr hab_ivt_addr ${fdt_addr} - ${ivt_offset} load mmc ${mmcdev}:${mmcpart} ${hab_ivt_addr} ${fdt_file_signed} run warp7_auth_or_fail else run loadfdt; fi # Boot from rootfs1 by default setenv mmcpart 3 # But if the rootfs2 file exists in partition 2, boot from rootfs2 ext4size mmc 0:2 rootfs2 && setenv mmcpart 5 # This section is responsbile for loading a signed OPTEE image setenv optee_file /lib/firmware/uTee.optee setenv optee_file_signed /lib/firmware/uTee.optee.imx-signed setenv loadoptee "load mmc ${mmcdev}:${mmcpart} ${optee_addr} ${optee_file}" if test ${hab_enabled} -eq 1; then setexpr hab_ivt_addr ${optee_addr} - ${ivt_offset} load mmc ${mmcdev}:${mmcpart} ${hab_ivt_addr} ${optee_file_signed} run warp7_auth_or_fail else run loadoptee; fi # Set UUID mmcpart will be used to pass root id to kernel setenv rootpart ${mmcpart} run finduuid; run mmcargs; # Now boot echo Booting secure Linux/OPTEE OS
[U-Boot] [PATCH v3 01/17] imximage: Specify default IVT offset in IMX image
This patch adds BOOTROM_IVT_HDR_OFFSET at 0xC00. The BootROM expects to find the IVT header at a particular offset in an i.MX image. Defining the expected offset of the IVT header in the first-stage BootROM image format is of use of later stage authentication routines where those routines continue to follow the first-stage authentication layout. This patch defines the first stage offset which later patch make use of. Signed-off-by: Bryan O'DonoghueCc: Utkarsh Gupta Cc: Breno Lima Cc: Fabio Estevam --- include/imximage.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/imximage.h b/include/imximage.h index 553b852..800fd63 100644 --- a/include/imximage.h +++ b/include/imximage.h @@ -14,6 +14,9 @@ #define APP_CODE_BARKER0xB1 #define DCD_BARKER 0xB17219E9 +/* Specify the offset of the IVT in the IMX header as expected by BootROM */ +#define BOOTROM_IVT_HDR_OFFSET 0xC00 + /* * NOTE: This file must be kept in sync with arch/arm/include/asm/\ * mach-imx/imximage.cfg because tools/imximage.c can not -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 07/17] warp7: Specify CONFIG_OPTEE_LOAD_ADDR
On 07/04/18 13:23, Breno Matheus Lima wrote: Hi Bryan, 2018-04-02 19:42 GMT-03:00 Bryan O'Donoghue: In order to sign images with the IMX code-signing-tool (CST) we need to know the load address of a given image. The best way to derive this load address is to make it into a define - so that u-boot.cfg contains the address - which we can then parse when generating the IMX CST headers. This patch makes the OPTEE_LOAD_ADDR available via u-boot.cfg for further parsing by external tools. Signed-off-by: Bryan O'Donoghue Reviewed-by: Ryan Harkin --- configs/warp7_defconfig | 1 + include/configs/warp7.h | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index 3dbcd69..c647cd0 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -45,3 +45,4 @@ CONFIG_USB_ETH_CDC=y CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00" CONFIG_OF_LIBFDT=y CONFIG_OPTEE=y +CONFIG_OPTEE_LOAD_ADDR=0x8400 I'm seeing the following in my U-Boot environment variables, seems that CONFIG_OPTEE_LOAD_ADDR it's not being correctly defined: Can you try again after doing this make clean; make mrproper; make warp7_config;make u-boot.imx arch=ARM CROSS_COMPILE=/opt/linaro/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- works for me ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] bootm: Align cache flush begin address
commit b4d956f6bc0f ("bootm: Align cache flush end address correctly") aligns the end address of the cache flush operation to a cache-line size to ensure lower-layers in the code accept the range provided and flush. A similar action should be taken for the begin address of a cache flush operation. The load address may not be aligned to a cache-line boundary, so ensure the passed address is aligned. Signed-off-by: Bryan O'DonoghueReported-by: Breno Matheus Lima Cc: Simon Glass --- common/bootm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/bootm.c b/common/bootm.c index adb1213..45d140c 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -447,7 +447,8 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end, bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE); return err; } - flush_cache(load, ALIGN(*load_end - load, ARCH_DMA_MINALIGN)); + flush_cache(ALIGN(load, ARCH_DMA_MINALIGN), + ALIGN(*load_end - load, ARCH_DMA_MINALIGN)); debug(" kernel loaded at 0x%08lx, end = 0x%08lx\n", load, *load_end); bootstage_mark(BOOTSTAGE_ID_KERNEL_LOADED); -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] i.MX6 PAD_CTL_SPEED_LOW possibly wrong
Hello, In arch/arm/include/asm/mach-imx/iomux-v3.h you find defines of PAD_CTL_SPEED_*. For the i.MX 6 SX, i.MX 6 UL, and the i.MX 6 ULL the PAD_CTL_SPEED_LOW field is set to 0. For all other i.MX6 processors it will be 1. I compared that to the definition found in the i.MX 6Solo/6DualLite Application Processor Reference Manual, Rev. 3, Page 2646 [1] for the IOMUXC_SW_PAD_CTL_PAD_SD2_CLK register. I found that the i.MX 6 S and i.MX 6 DL the PAD_CTL_SPEED_LOW field shall be 0, too. I then checked more Reference Manuals (RM) looking at the IOMUXC_SW_PAD_CTL_PAD_SD2_CLK or IOMUXC_SW_PAD_CTL_PAD_GPIO1_IO00 register and found the following. i.MX 6 Solo RM [1]: 00 Low, 01 Medium, 10 Medium, 11 Maximum i.MX 6 DualLite RM [1]: 00 Low, 01 Medium, 10 Medium, 11 Maximum i.MX 6 Dual RM [2]: 00 Low, 01 Medium, 10 Medium, 11 Maximum i.MX 6 Quad RM [2]: 00 Low, 01 Medium, 10 Medium, 11 Maximum i.MX 6 SoloLite RM [3]: 00 RESERVED, 01 Low, 10 Medium, 11 Maximum i.MX 6 SoloX RM [4]:00 Low, 01 Medium, 10 Medium, 11 Maximum i.MX 6 DualPlus RM [5]: 00 Low, 01 Medium, 10 Medium, 11 Maximum i.MX 6 QuadPlus RM [5]: 00 Low, 01 Medium, 10 Medium, 11 Maximum i.MX 6 ULL RM [6]: 00 Low, 01 Medium, 10 Medium, 11 Maximum i.MX 6 UltraLite RM:only available under a licensing agreement Combining the knowledge from the RMs above and the existing code, it seems that only the SoloLite is different. Thus, I propose the attached patch. Greetings, Mark [1] https://www.nxp.com/docs/en/reference-manual/IMX6SDLRM.pdf [2] https://www.nxp.com/docs/en/reference-manual/IMX6DQRM.pdf [3] https://www.nxp.com/docs/en/reference-manual/IMX6SLRM.pdf [4] https://www.nxp.com/docs/en/reference-manual/IMX6SXRM.pdf [5] https://www.nxp.com/docs/en/reference-manual/iMX6DQPRM.pdf [6] https://www.nxp.com/docs/en/reference-manual/IMX6ULLRM.pdf 0001-arm-imx6-fix-PAD_CTL_SPEED_LOW-constant.patch Description: 0001-arm-imx6-fix-PAD_CTL_SPEED_LOW-constant.patch ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] u-boot 2018 SPI SPL
On Fri, Apr 13, 2018 at 10:13 AM, Mehmet Ali İPİNwrote: > > Dear Fabio, > > > I received the following message > > U-Boot SPL 2018.01 (Jan 17 2018 - 05:49:34) Please use mainline 2018.03 or 2018.05-rc1 instead. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [U-Boot, 36/36] rockchip: add common board file for rockchip platform
Kever, > On 13 Apr 2018, at 09:51, Kever Yangwrote: > On 04/08/2018 09:45 AM, Kever Yang wrote: > +__weak int arch_cpu_init(void) +{ +return 0; +} + +__weak int rk_board_init_f(void) +{ +return 0; +} >>> This doesn't really help in modularising our board-support and I am >>> not a fan of adding something like 'rk_board_init_f' in the first place. >>> >>> Instead this should be implemented in a way that actually makes the >>> code structure easier and more resilient for the future (having __weak >>> functions at the architecture-level doesn't really help)... in fact >>> the only other uses of __weak in the U-Boot source-base are within >>> SPL, as there's no other way to provide hooks there. >> I know your proposal is to use DM for board init, then could you make it >> more >> clear about how to handle this in your solution? >> We need to do: >> - same board init flow for all rockchip platform; >> - something different but common in soc level; >> - something different in board level; > > I didn't see your response for this, could you send out your patches? This isn’t at the stage of a patch-set yet… I had asked for comments to this, so we could design this in a way that benefits all platforms. > I admit that I'm not very clear about the limitation of '__weak' function, > but I do see there are many '__weak' function in common/board_f/r.c, > and my common board file is connect to the board_r.c. I like __weak as a way to provide a hook for something that is part of the common API (so it’s ok, if spl.c uses this). However, I don’t want individual platforms to suddenly expose new extension points. And with the two examples above (arch_cpu_init and rk_board_init_f), you basically highlight what’s wrong about using __weak at this level: 1 arch_cpu_init is an extension point to do low-level initialisation for a CPU (not a board). Implementation for it usually live below arch/arm/cpu and takes care of things like MMU maintenance. Now we suddenly provide this below arch/arm/mach-rockchip … and using a __weak function. This goes against everything that users will expect. So just move it to arch/arm/cpu (you’ll probably need to have 2 separate ones for armv7 and armv8) and nothing unexpected will ever happen. 2 If we rk_board_init_f here, we are again changing the extension API of U-Boot: board_init_f belongs to each board (i.e. any board can expect to override it w/o ill effect), but now you’d suddenly create a link error. Instead users need to override rk_board_init_f. This is a documentation nightmare (and the current solution would be to provide a common function that all board_init_f implementations could call as their head or tail…). My question—as to whether the DM could/should be extended to CPUs, SoCs, architectures and boards—was meant to discuss exactly these observed issues in how boards and SoCs today interact. I usually don’t mind to touch APIs and extend them (or the driver model), but a solution for how to handle board/SoC/CPU init sequences is nothing I want to start before getting an actual design discussion going and reaching something resembling a consensus of how this aspect of U-Boot should be structured in a year’s (or two years’) time. > > @Simon, @Tom, > Could you kindly give some comment here? > > Thanks, > - Kever ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] u-boot 2018 SPI SPL
Dear Fabio, I received the following message U-Boot SPL 2018.01 (Jan 17 2018 - 05:49:34) SPL: Unsupported Boot Device! SPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ### I am searching the cause of error; but if you know answer please help me. Thanks and best regards. -Original Message- From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Mehmet Ali İPİN Sent: Thursday, April 12, 2018 4:36 PM To: Fabio EstevamCc: u-boot@lists.denx.de Subject: Re: [U-Boot] u-boot 2018 SPI SPL Dear Fabio, Thank you very much. I will check and inform you. Best regards. -Original Message- From: Fabio Estevam [mailto:feste...@gmail.com] Sent: Thursday, April 12, 2018 4:28 PM To: Mehmet Ali İPİN Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] u-boot 2018 SPI SPL Hi Mehmet, On Thu, Apr 12, 2018 at 10:17 AM, Mehmet Ali İPİN wrote: > Dear Sir/Madam, > > Hello, > > We have developed an i.mx6dl board which is based on "MX6 Dual Lite SABRE AI > CPU2 Card with AVB". I am using version u-boot-2018.01 with SPL. > I am downloading SPL and u-boot.img with USB loader; downloaded kernel and > device tree files and run them in nfs tftp search over ethernet.. > > Then I programmed the SPI NOR flash with u-boot with spi read/write commands > for both u-boot.imx/and u-boot.img images with offset value of 0x400 in Flash > address, set boot pins accordingly, saw signals at clock, CS and Data pins of > flash after reset, but never see a boot (character at terminal) for last few > weeks. > > As I know, make command is generating code for SD card, and SPL code is > waiting u-boot to be loaded from USB port. I searched many NXP/denx forums; > i.mx6 linux kernel ref. Manuals for u-boot with SPL, I found NXP supports > u-boot.imx images, but did not support SPL+u-boot.img. > > So I would be very grateful, if any of you know which (and how) files, > parameters (and/or make command) should be set for u-boot.img+SPL boot for > SPI nor flash boot in u-boot 2018.1? Or give link to document(s), which > explain the i.mx6dl SPL and u-boot.img boot process for SPI nor flash > (except i.mx6 ref manual).. Take a look at board/congatec/cgtqmx6eval/README (2. Flashing U-Boot in the SPI NOR). It explains how to flash SPL + u-boot.img into SPI NOR on a mx6 board. ___ 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] [U-Boot, 36/36] rockchip: add common board file for rockchip platform
On Fri, Apr 13, 2018 at 03:51:07PM +0800, Kever Yang wrote: > Hi Philipp, > > > On 04/08/2018 09:45 AM, Kever Yang wrote: > >>> +__weak int arch_cpu_init(void) > >>> +{ > >>> + return 0; > >>> +} > >>> + > >>> +__weak int rk_board_init_f(void) > >>> +{ > >>> + return 0; > >>> +} > >> This doesn't really help in modularising our board-support and I am > >> not a fan of adding something like 'rk_board_init_f' in the first place. > >> > >> Instead this should be implemented in a way that actually makes the > >> code structure easier and more resilient for the future (having __weak > >> functions at the architecture-level doesn't really help)... in fact > >> the only other uses of __weak in the U-Boot source-base are within > >> SPL, as there's no other way to provide hooks there. > > I know your proposal is to use DM for board init, then could you make it > > more > > clear about how to handle this in your solution? > > We need to do: > > - same board init flow for all rockchip platform; > > - something different but common in soc level; > > - something different in board level; > > I didn't see your response for this, could you send out your patches? > > I admit that I'm not very clear about the limitation of '__weak' function, > but I do see there are many '__weak' function in common/board_f/r.c, > and my common board file is connect to the board_r.c. > > @Simon, @Tom, > Could you kindly give some comment here? I am perhaps more of a fan of using weak functions than other people are. The problem with weak functions is that you must know when designing the code that it can safely only be overridden in one place per build. Otherwise the results are not predictable. -- Tom signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v4 2/4] tools: zynqmpimage: Move defines to header
We will add support for ZynqMP bif input files later, so let's move all structure definitions into a header file that can be used by that one as well. Signed-off-by: Alexander Graf--- tools/zynqmpimage.c | 115 + tools/zynqmpimage.h | 132 2 files changed, 133 insertions(+), 114 deletions(-) create mode 100644 tools/zynqmpimage.h diff --git a/tools/zynqmpimage.c b/tools/zynqmpimage.c index 62c0f85af4..3bd23b9bf8 100644 --- a/tools/zynqmpimage.c +++ b/tools/zynqmpimage.c @@ -58,122 +58,9 @@ #include "imagetool.h" #include "mkimage.h" +#include "zynqmpimage.h" #include -#define HEADER_INTERRUPT_DEFAULT (cpu_to_le32(0xeafe)) -#define HEADER_REGINIT_NULL (cpu_to_le32(0x)) -#define HEADER_WIDTHDETECTION (cpu_to_le32(0xaa995566)) -#define HEADER_IMAGEIDENTIFIER (cpu_to_le32(0x584c4e58)) -#define HEADER_CPU_SELECT_A53_64BIT(0x2 << 10) - -enum { - ENCRYPTION_EFUSE = 0xa5c3c5a3, - ENCRYPTION_OEFUSE = 0xa5c3c5a7, - ENCRYPTION_BBRAM = 0x3a5c3c5a, - ENCRYPTION_OBBRAM = 0xa35c7ca5, - ENCRYPTION_NONE = 0x0, -}; - -struct zynqmp_reginit { - uint32_t address; - uint32_t data; -}; - -#define HEADER_INTERRUPT_VECTORS 8 -#define HEADER_REGINITS256 - -struct image_header_table { - uint32_t version; /* 0x00 */ - uint32_t nr_parts;/* 0x04 */ - uint32_t partition_header_offset; /* 0x08, divided by 4 */ - uint32_t image_header_offset; /* 0x0c, divided by 4 */ - uint32_t auth_certificate_offset; /* 0x10 */ - uint32_t boot_device; /* 0x14 */ - uint32_t __reserved1[9]; /* 0x18 - 0x38 */ - uint32_t checksum;/* 0x3c */ -}; - -#define PART_ATTR_VEC_LOCATION 0x80 -#define PART_ATTR_BS_BLOCK_SIZE_MASK 0x70 -#define PART_ATTR_BS_BLOCK_SIZE_DEFAULT0x00 -#define PART_ATTR_BS_BLOCK_SIZE_8MB0x40 -#define PART_ATTR_BIG_ENDIAN 0x04 -#define PART_ATTR_PART_OWNER_MASK 0x03 -#define PART_ATTR_PART_OWNER_FSBL 0x00 -#define PART_ATTR_PART_OWNER_UBOOT 0x01 -#define PART_ATTR_RSA_SIG 0x008000 -#define PART_ATTR_CHECKSUM_MASK0x007000 -#definePART_ATTR_CHECKSUM_NONE 0x00 -#definePART_ATTR_CHECKSUM_MD5 0x001000 -#definePART_ATTR_CHECKSUM_SHA2 0x002000 -#definePART_ATTR_CHECKSUM_SHA3 0x003000 -#define PART_ATTR_DEST_CPU_SHIFT 8 -#define PART_ATTR_DEST_CPU_MASK0x000f00 -#definePART_ATTR_DEST_CPU_NONE 0x00 -#definePART_ATTR_DEST_CPU_A53_00x000100 -#definePART_ATTR_DEST_CPU_A53_10x000200 -#definePART_ATTR_DEST_CPU_A53_20x000300 -#definePART_ATTR_DEST_CPU_A53_30x000400 -#definePART_ATTR_DEST_CPU_R5_0 0x000500 -#definePART_ATTR_DEST_CPU_R5_1 0x000600 -#definePART_ATTR_DEST_CPU_R5_L 0x000700 -#definePART_ATTR_DEST_CPU_PMU 0x000800 -#define PART_ATTR_ENCRYPTED0x80 -#define PART_ATTR_DEST_DEVICE_SHIFT4 -#define PART_ATTR_DEST_DEVICE_MASK 0x70 -#definePART_ATTR_DEST_DEVICE_NONE 0x00 -#definePART_ATTR_DEST_DEVICE_PS0x10 -#definePART_ATTR_DEST_DEVICE_PL0x20 -#definePART_ATTR_DEST_DEVICE_PMU 0x30 -#definePART_ATTR_DEST_DEVICE_XIP 0x40 -#define PART_ATTR_A53_EXEC_AARCH32 0x08 -#define PART_ATTR_TARGET_EL_SHIFT 1 -#define PART_ATTR_TARGET_EL_MASK 0x06 -#define PART_ATTR_TZ_SECURE0x01 - -static const char *dest_cpus[0x10] = { - "none", "a5x-0", "a5x-1", "a5x-2", "a5x-3", "r5-0", "r5-1", - "r5-lockstep", "pmu", "unknown", "unknown", "unknown", "unknown", - "unknown", "unknown", "unknown" -}; - -struct partition_header { - uint32_t len_enc; /* 0x00, divided by 4 */ - uint32_t len_unenc; /* 0x04, divided by 4 */ - uint32_t len; /* 0x08, divided by 4 */ - uint32_t next_partition_offset; /* 0x0c */ - uint64_t entry_point; /* 0x10 */ - uint64_t load_address;/* 0x18 */ - uint32_t offset; /* 0x20, divided by 4 */ - uint32_t attributes; /* 0x24 */ - uint32_t __reserved1; /* 0x28 */ - uint32_t checksum_offset; /* 0x2c, divided by 4 */ - uint32_t __reserved2; /* 0x30 */ - uint32_t auth_certificate_offset; /* 0x34 */ - uint32_t __reserved3; /* 0x38 */ - uint32_t checksum;/* 0x3c */ -}; - -struct zynqmp_header { - uint32_t
[U-Boot] [PATCH v4 3/4] MAINTAINERS: Declare tools/zynq*.{c, h} as Xilinx maintained
The zynqimage.c, zynqmpimage.c and the new zynqmpbif.c files are all maintained by Xilinx for the Zynq platforms. Let's match them accordingly in the MAINTAINERS file. Signed-off-by: Alexander Graf--- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 44eeefa635..bf7f7bf23c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -289,7 +289,8 @@ F: drivers/spi/zynq_spi.c F: drivers/usb/host/ehci-zynq.c F: drivers/watchdog/cdns_wdt.c F: include/zynqmppl.h -F: tools/zynqimage.c +F: tools/zynq*.c +F: tools/zynq*.h N: zynqmp BUILDMAN -- 2.12.3 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v4 0/4] tools: zynqmpimage: Support partitions
A good chunk of the booting chain of ZynqMP based systems is open source (depending on your definition of it), except for the image generation flow. This patch set aims to change that, with read and write support for boot.bin partitions which allows us to create boot.bin files using only open source tools. v1 -> v2: - Add bif based generation - Add documentation pointer - Split definitions into separate header v2 -> v3: - zero initialize header - reduce default debug verbosity v3 -> v4: - checkpatch fixes - new patch: MAINTAINERS: Declare tools/zynq*.{c,h} as Xilinx maintained - add error handling - add fsbl_config support - add aarch32 support - allow a5x to be written as a53 - add offset support - add support for partition_owner - ensure pmufw comes before bootloader - simplify fsbl_config - add non-a53 boot support Alexander Graf (4): tools: zynqmpimage: Add partition read support tools: zynqmpimage: Move defines to header MAINTAINERS: Declare tools/zynq*.{c,h} as Xilinx maintained tools: zynqmpimage: Add bif support MAINTAINERS |3 +- common/image.c |1 + include/image.h |1 + tools/Makefile |1 + tools/imagetool.h |1 + tools/mkimage.c |7 + tools/zynqmpbif.c | 1008 +++ tools/zynqmpimage.c | 142 +--- tools/zynqmpimage.h | 139 +++ 9 files changed, 1260 insertions(+), 43 deletions(-) create mode 100644 tools/zynqmpbif.c create mode 100644 tools/zynqmpimage.h -- 2.12.3 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v4 4/4] tools: zynqmpimage: Add bif support
The officially described way to generate boot.bin files for ZynqMP is to describe the contents of the target binary using a file of the "bif" format. This file then links to other files that all get packed into a bootable image. This patch adds support to read such a .bif file and generate a respective ZynqMP boot.bin file that can include the normal image and pmu files, but also supports image partitions now. This makes it a handy replacement for the proprietary "bootgen" utility that is currently used to generate boot.bin files with FSBL. Signed-off-by: Alexander Graf--- v2 -> v3: - zero initialize header - reduce default debug verbosity v3 -> v4: - add error handling - add fsbl_config support - add aarch32 support - allow a5x to be written as a53 - add offset support - add support for partition_owner - ensure pmufw comes before bootloader - simplify fsbl_config - add non-a53 boot support - checkpatch fixes --- common/image.c |1 + include/image.h |1 + tools/Makefile |1 + tools/imagetool.h |1 + tools/mkimage.c |7 + tools/zynqmpbif.c | 1008 +++ tools/zynqmpimage.c |4 +- tools/zynqmpimage.h |7 + 8 files changed, 1028 insertions(+), 2 deletions(-) create mode 100644 tools/zynqmpbif.c diff --git a/common/image.c b/common/image.c index e1c50eb25d..f30dfa229b 100644 --- a/common/image.c +++ b/common/image.c @@ -159,6 +159,7 @@ static const table_entry_t uimage_type[] = { { IH_TYPE_VYBRIDIMAGE, "vybridimage", "Vybrid Boot Image", }, { IH_TYPE_ZYNQIMAGE, "zynqimage", "Xilinx Zynq Boot Image" }, { IH_TYPE_ZYNQMPIMAGE, "zynqmpimage", "Xilinx ZynqMP Boot Image" }, + { IH_TYPE_ZYNQMPBIF, "zynqmpbif", "Xilinx ZynqMP Boot Image (bif)" }, { IH_TYPE_FPGA, "fpga", "FPGA Image" }, { IH_TYPE_TEE,"tee","Trusted Execution Environment Image",}, { IH_TYPE_FIRMWARE_IVT, "firmware_ivt", "Firmware with HABv4 IVT" }, diff --git a/include/image.h b/include/image.h index a579c5f509..c5af912aeb 100644 --- a/include/image.h +++ b/include/image.h @@ -269,6 +269,7 @@ enum { IH_TYPE_RKSPI, /* Rockchip SPI image */ IH_TYPE_ZYNQIMAGE, /* Xilinx Zynq Boot Image */ IH_TYPE_ZYNQMPIMAGE,/* Xilinx ZynqMP Boot Image */ + IH_TYPE_ZYNQMPBIF, /* Xilinx ZynqMP Boot Image (bif) */ IH_TYPE_FPGA, /* FPGA Image */ IH_TYPE_VYBRIDIMAGE,/* VYBRID .vyb Image */ IH_TYPE_TEE,/* Trusted Execution Environment OS Image */ diff --git a/tools/Makefile b/tools/Makefile index 8143c25666..204685ec9e 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -113,6 +113,7 @@ dumpimage-mkimage-objs := aisimage.o \ ublimage.o \ zynqimage.o \ zynqmpimage.o \ + zynqmpbif.o \ $(LIBFDT_OBJS) \ gpimage.o \ gpimage-common.o \ diff --git a/tools/imagetool.h b/tools/imagetool.h index e67de9b5ad..6a7e7386f7 100644 --- a/tools/imagetool.h +++ b/tools/imagetool.h @@ -232,6 +232,7 @@ time_t imagetool_get_source_date( void pbl_load_uboot(int fd, struct image_tool_params *mparams); +int zynqmpbif_copy_image(int fd, struct image_tool_params *mparams); #define ___cat(a, b) a ## b #define __cat(a, b) ___cat(a, b) diff --git a/tools/mkimage.c b/tools/mkimage.c index 4e561820e7..fe861f5405 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -514,6 +514,13 @@ int main(int argc, char **argv) } else if (params.type == IH_TYPE_PBLIMAGE) { /* PBL has special Image format, implements its' own */ pbl_load_uboot(ifd, ); + } else if (params.type == IH_TYPE_ZYNQMPBIF) { + /* Image file is meta, walk through actual targets */ + int ret; + + ret = zynqmpbif_copy_image(ifd, ); + if (ret) + return ret; } else { copy_file(ifd, params.datafile, pad_len); } diff --git a/tools/zynqmpbif.c b/tools/zynqmpbif.c new file mode 100644 index 00..6c8f66055d --- /dev/null +++ b/tools/zynqmpbif.c @@ -0,0 +1,1008 @@ +/* + * Copyright (C) 2018 Alexander Graf + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include "imagetool.h" +#include "mkimage.h" +#include "zynqmpimage.h" +#include +#include + +struct bif_entry { + const char *filename; + uint64_t flags; + uint64_t dest_cpu; + uint64_t exp_lvl; + uint64_t dest_dev; + uint64_t load; + uint64_t entry; + size_t offset; +}; + +enum bif_flag {
[U-Boot] [PATCH v4 1/4] tools: zynqmpimage: Add partition read support
The zynqmp image format has support for inline partitions which are used by FSBL to describe payloads that are loaded by FSBL itself. While we can't create images that contain partitions (yet), we should still at least be able to examine them and show the user what's inside when we analyze an image created by bootgen. Signed-off-by: Alexander Graf--- v1 -> v2: - prettify defines - fix offset and size outputs - add u-boot as payload target - align CPU names with bif - add shift constants - add U-Boot as potential partition owner - mention documentation source - add HEADER_CPU_SELECT_A53_64BIT define v3 -> v4: - fix checkpatch --- tools/zynqmpimage.c | 175 +++- 1 file changed, 173 insertions(+), 2 deletions(-) diff --git a/tools/zynqmpimage.c b/tools/zynqmpimage.c index a61fb17c40..62c0f85af4 100644 --- a/tools/zynqmpimage.c +++ b/tools/zynqmpimage.c @@ -7,6 +7,7 @@ * The following Boot Header format/structures and values are defined in the * following documents: * * ug1085 ZynqMP TRM doc v1.4 (Chapter 11, Table 11-4) + * * ug1137 ZynqMP Software Developer Guide v6.0 (Chapter 16) * * Expected Header Size = 0x9C0 * Forced as 'little' endian, 32-bit words @@ -63,6 +64,7 @@ #define HEADER_REGINIT_NULL (cpu_to_le32(0x)) #define HEADER_WIDTHDETECTION (cpu_to_le32(0xaa995566)) #define HEADER_IMAGEIDENTIFIER (cpu_to_le32(0x584c4e58)) +#define HEADER_CPU_SELECT_A53_64BIT(0x2 << 10) enum { ENCRYPTION_EFUSE = 0xa5c3c5a3, @@ -80,6 +82,78 @@ struct zynqmp_reginit { #define HEADER_INTERRUPT_VECTORS 8 #define HEADER_REGINITS256 +struct image_header_table { + uint32_t version; /* 0x00 */ + uint32_t nr_parts;/* 0x04 */ + uint32_t partition_header_offset; /* 0x08, divided by 4 */ + uint32_t image_header_offset; /* 0x0c, divided by 4 */ + uint32_t auth_certificate_offset; /* 0x10 */ + uint32_t boot_device; /* 0x14 */ + uint32_t __reserved1[9]; /* 0x18 - 0x38 */ + uint32_t checksum;/* 0x3c */ +}; + +#define PART_ATTR_VEC_LOCATION 0x80 +#define PART_ATTR_BS_BLOCK_SIZE_MASK 0x70 +#define PART_ATTR_BS_BLOCK_SIZE_DEFAULT0x00 +#define PART_ATTR_BS_BLOCK_SIZE_8MB0x40 +#define PART_ATTR_BIG_ENDIAN 0x04 +#define PART_ATTR_PART_OWNER_MASK 0x03 +#define PART_ATTR_PART_OWNER_FSBL 0x00 +#define PART_ATTR_PART_OWNER_UBOOT 0x01 +#define PART_ATTR_RSA_SIG 0x008000 +#define PART_ATTR_CHECKSUM_MASK0x007000 +#definePART_ATTR_CHECKSUM_NONE 0x00 +#definePART_ATTR_CHECKSUM_MD5 0x001000 +#definePART_ATTR_CHECKSUM_SHA2 0x002000 +#definePART_ATTR_CHECKSUM_SHA3 0x003000 +#define PART_ATTR_DEST_CPU_SHIFT 8 +#define PART_ATTR_DEST_CPU_MASK0x000f00 +#definePART_ATTR_DEST_CPU_NONE 0x00 +#definePART_ATTR_DEST_CPU_A53_00x000100 +#definePART_ATTR_DEST_CPU_A53_10x000200 +#definePART_ATTR_DEST_CPU_A53_20x000300 +#definePART_ATTR_DEST_CPU_A53_30x000400 +#definePART_ATTR_DEST_CPU_R5_0 0x000500 +#definePART_ATTR_DEST_CPU_R5_1 0x000600 +#definePART_ATTR_DEST_CPU_R5_L 0x000700 +#definePART_ATTR_DEST_CPU_PMU 0x000800 +#define PART_ATTR_ENCRYPTED0x80 +#define PART_ATTR_DEST_DEVICE_SHIFT4 +#define PART_ATTR_DEST_DEVICE_MASK 0x70 +#definePART_ATTR_DEST_DEVICE_NONE 0x00 +#definePART_ATTR_DEST_DEVICE_PS0x10 +#definePART_ATTR_DEST_DEVICE_PL0x20 +#definePART_ATTR_DEST_DEVICE_PMU 0x30 +#definePART_ATTR_DEST_DEVICE_XIP 0x40 +#define PART_ATTR_A53_EXEC_AARCH32 0x08 +#define PART_ATTR_TARGET_EL_SHIFT 1 +#define PART_ATTR_TARGET_EL_MASK 0x06 +#define PART_ATTR_TZ_SECURE0x01 + +static const char *dest_cpus[0x10] = { + "none", "a5x-0", "a5x-1", "a5x-2", "a5x-3", "r5-0", "r5-1", + "r5-lockstep", "pmu", "unknown", "unknown", "unknown", "unknown", + "unknown", "unknown", "unknown" +}; + +struct partition_header { + uint32_t len_enc; /* 0x00, divided by 4 */ + uint32_t len_unenc; /* 0x04, divided by 4 */ + uint32_t len; /* 0x08, divided by 4 */ + uint32_t next_partition_offset; /* 0x0c */ + uint64_t entry_point; /* 0x10 */ + uint64_t load_address;/* 0x18 */ + uint32_t offset; /* 0x20, divided by 4 */ + uint32_t attributes; /* 0x24 */ + uint32_t __reserved1; /* 0x28 */ +
Re: [U-Boot] [PATCH] fit: skip signature verification if board request
2018-04-13 1:24 GMT+08:00 Simon Glass: > Hi, > > On 11 April 2018 at 09:13, Jun Nie wrote: >> It may be unnecessary to check signature on unlocked board. >> Get the hint from platform specific code to support secure boot >> and non-secure boot with the same binary, so that boot is not >> blocked if board is not locked and has no key for signature >> verification. >> >> Signed-off-by: Jun Nie >> --- > > Instead of a weak function can you please add a parameter to this > function (perhaps a flags word?) and a add test for this case to the > test? > > Regards, > Simon Sure, I can add a parameter to the function. But not sure what's the usage of it in your mind. Maybe "int flag" is enough for you? Do you mean add implementation of this function for a specific platform for "add test"? Best Regards, Jun ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] fit: skip signature verification if board request
2018-04-12 21:53 GMT+08:00 Tom Rini: > On Wed, Apr 11, 2018 at 11:13:05PM +0800, Jun Nie wrote: > >> It may be unnecessary to check signature on unlocked board. >> Get the hint from platform specific code to support secure boot >> and non-secure boot with the same binary, so that boot is not >> blocked if board is not locked and has no key for signature >> verification. >> >> Signed-off-by: Jun Nie >> --- > I'm not sure I like the concept here. Wouldn't this make it easier to > break in to a secure setup with some binary editing? Or is that really > no worse than today? Also, can you please follow up with an > implementation of fit_board_skip_sig_verification? Thanks! > > -- > Tom SoC boot ROM shall verify signature of SPL before running. Binary editing shall make signature invalid. If it is possible to run an edited SPL, the secure boot is already hacked and this patch does not make it worse. I surely will post implementation, which is just reading some register to get fuse value for lock status. I post this patch to get opinions from community first. Jun ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] x86: Rename coreboot-x86 to coreboot
On Fri, Apr 13, 2018 at 4:04 AM, Simon Glasswrote: > We only use coreboot as a target on x86 platforms, since on ARM platforms > U-Boot always runs as the primary boot loader. Rename the coreboot-x86 > platform to reflect this. > > Signed-off-by: Simon Glass > --- > > board/coreboot/coreboot/MAINTAINERS| 2 +- > configs/{coreboot-x86_defconfig => coreboot_defconfig} | 0 > doc/README.x86 | 2 +- > 3 files changed, 2 insertions(+), 2 deletions(-) > rename configs/{coreboot-x86_defconfig => coreboot_defconfig} (100%) > Reviewed-by: Bin Meng ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] chiliSOM: USB bug
On 13.04.2018 11:12, sdrb wrote: Marcin Niestroj wrote: On 12.04.2018 13:35, sdrb wrote: Marcin Niestroj wrote: On 12.04.2018 11:09, sdrb wrote: Marcin Niestrój wrote: >> Could you describe what is you BOOT[4:0] configuration? And you want to boot from MMC1, right? If I read the BOOT[4:0] properly it is: 0011. I want to boot from SD card. Please provide these 5 pins (including 4 and 0) configuration. Sorry for misprint - SYSBOOT[4:0] pins are as follows: 00011. Unfortunately I can't reproduce this issue on my side with chiliboard. It's hard to tell what could be the problem when using you board. What RAM vendor is on chiliSOM you have on your board? Maybe there DDR is not initialized with proper timing? Don't have other ideas for now. If I identified properly the chip it is Samsung. We had an issue with Samsung DDR on chiliSOM with one of our clients and his board. We have used a workaround patch to sleep between DDR initialization and copying u-boot.img to RAM. If there was no delay, then RAM memory was in undefined behavior, resulting in very strange runtime errors. We used u-boot 2014.07 back then. However I see that commit 69b918b65d11 ("am33xx,ddr3: fix ddr3 sdram configuration") already addresses this issue, but in a different way than we did back then. So I have no idea now what goes wrong in your case. -- Marcin Niestroj ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3 1/3] tools: zynqmpimage: Add partition read support
Hi, On 12.4.2018 15:48, Alexander Graf wrote: > The zynqmp image format has support for inline partitions which are > used by FSBL to describe payloads that are loaded by FSBL itself. > > While we can't create images that contain partitions (yet), we should > still at least be able to examine them and show the user what's inside > when we analyze an image created by bootgen. > > Signed-off-by: Alexander Graf> > --- > > v1 -> v2: > > - prettify defines > - fix offset and size outputs > - add u-boot as payload target > - align CPU names with bif > - add shift constants > - add U-Boot as potential partition owner > - mention documentation source > - add HEADER_CPU_SELECT_A53_64BIT define first of all please run checkpatch on this patch. I see several issues there. The rest looks good. Thanks, Michal -- Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3 3/3] tools: zynqmpimage: Add bif support
On 12.4.2018 15:48, Alexander Graf wrote: > The officially described way to generate boot.bin files for ZynqMP is to > describe the contents of the target binary using a file of the "bif" format. > This file then links to other files that all get packed into a bootable image. > > This patch adds support to read such a .bif file and generate a respective > ZynqMP boot.bin file that can include the normal image and pmu files, but also > supports image partitions now. This makes it a handy replacement for the > proprietary "bootgen" utility that is currently used to generate boot.bin > files with FSBL. > > Signed-off-by: Alexander Graf> > --- > > v2 -> v3: > > - zero initialize header > - reduce default debug verbosity > --- > common/image.c | 1 + > include/image.h | 1 + > tools/Makefile | 1 + > tools/imagetool.h | 1 + > tools/mkimage.c | 3 + > tools/zynqmpbif.c | 839 > > tools/zynqmpimage.c | 4 +- > tools/zynqmpimage.h | 3 + > 8 files changed, 851 insertions(+), 2 deletions(-) > create mode 100644 tools/zynqmpbif.c > > diff --git a/common/image.c b/common/image.c > index e1c50eb25d..f30dfa229b 100644 > --- a/common/image.c > +++ b/common/image.c > @@ -159,6 +159,7 @@ static const table_entry_t uimage_type[] = { > { IH_TYPE_VYBRIDIMAGE, "vybridimage", "Vybrid Boot Image", }, > { IH_TYPE_ZYNQIMAGE, "zynqimage", "Xilinx Zynq Boot Image" }, > { IH_TYPE_ZYNQMPIMAGE, "zynqmpimage", "Xilinx ZynqMP Boot Image" > }, > + { IH_TYPE_ZYNQMPBIF, "zynqmpbif", "Xilinx ZynqMP Boot Image > (bif)" }, > { IH_TYPE_FPGA, "fpga", "FPGA Image" }, > { IH_TYPE_TEE,"tee","Trusted Execution > Environment Image",}, > { IH_TYPE_FIRMWARE_IVT, "firmware_ivt", "Firmware with HABv4 IVT" > }, > diff --git a/include/image.h b/include/image.h > index a579c5f509..c5af912aeb 100644 > --- a/include/image.h > +++ b/include/image.h > @@ -269,6 +269,7 @@ enum { > IH_TYPE_RKSPI, /* Rockchip SPI image */ > IH_TYPE_ZYNQIMAGE, /* Xilinx Zynq Boot Image */ > IH_TYPE_ZYNQMPIMAGE,/* Xilinx ZynqMP Boot Image */ > + IH_TYPE_ZYNQMPBIF, /* Xilinx ZynqMP Boot Image (bif) */ > IH_TYPE_FPGA, /* FPGA Image */ > IH_TYPE_VYBRIDIMAGE,/* VYBRID .vyb Image */ > IH_TYPE_TEE,/* Trusted Execution Environment OS Image */ > diff --git a/tools/Makefile b/tools/Makefile > index 8143c25666..204685ec9e 100644 > --- a/tools/Makefile > +++ b/tools/Makefile > @@ -113,6 +113,7 @@ dumpimage-mkimage-objs := aisimage.o \ > ublimage.o \ > zynqimage.o \ > zynqmpimage.o \ > + zynqmpbif.o \ > $(LIBFDT_OBJS) \ > gpimage.o \ > gpimage-common.o \ > diff --git a/tools/imagetool.h b/tools/imagetool.h > index e67de9b5ad..d78a9458f4 100644 > --- a/tools/imagetool.h > +++ b/tools/imagetool.h > @@ -232,6 +232,7 @@ time_t imagetool_get_source_date( > > > void pbl_load_uboot(int fd, struct image_tool_params *mparams); > +void zynqmpbif_copy_image(int fd, struct image_tool_params *mparams); This should return value which you will check > > #define ___cat(a, b) a ## b > #define __cat(a, b) ___cat(a, b) > diff --git a/tools/mkimage.c b/tools/mkimage.c > index 4e561820e7..72183f5f2b 100644 > --- a/tools/mkimage.c > +++ b/tools/mkimage.c > @@ -514,6 +514,9 @@ int main(int argc, char **argv) > } else if (params.type == IH_TYPE_PBLIMAGE) { > /* PBL has special Image format, implements its' own */ > pbl_load_uboot(ifd, ); > + } else if (params.type == IH_TYPE_ZYNQMPBIF) { > + /* Image file is meta, walk through actual targets */ > + zynqmpbif_copy_image(ifd, ); The same here because if there is for example comment in bif format which is permitted than you need to error out. > } else { > copy_file(ifd, params.datafile, pad_len); > } > diff --git a/tools/zynqmpbif.c b/tools/zynqmpbif.c > new file mode 100644 > index 00..d60eff1d8b > --- /dev/null > +++ b/tools/zynqmpbif.c > @@ -0,0 +1,839 @@ > +/* > + * Copyright (C) 2018 Alexander Graf > + * > + * SPDX-License-Identifier: GPL-2.0+ > + */ > + > +#include "imagetool.h" > +#include "mkimage.h" > +#include "zynqmpimage.h" > +#include > +#include > + > +struct bif_entry { > + const char *filename; > + uint64_t flags; > + uint64_t dest_cpu; > + uint64_t exp_lvl; > + uint64_t dest_dev; > + uint64_t load; > + uint64_t entry; > +}; > + > +enum bif_flag { > + BIF_FLAG_AESKEYFILE, > + BIF_FLAG_INIT, > +
Re: [U-Boot] [PATCH 1/1] rockchip: rk3288: provide ${fdtfile}
On 04/13/2018 10:01 AM, Kever Yang wrote: Hi Heinrich, Does this fdtfile will used for kernel? There should be a fdt config for kernel dtb in boot config file, and we should not use U-Boot dtb for kernel, they are different. Thanks, - Kever On 04/13/2018 03:54 PM, Kever Yang wrote: Hi Heinrich, What kind of issue do you met without this patch? I think distro boot always work fine in my side without this patch. Run make tinker-rk3288_defconfig In the environment you get: soc=rockchip board=tinker_rk3288 According to doc/README.pxe: If the fdtfile environment variable is set, / is retrieved. Otherwise, the filename is generated from the soc and board environment, i.e. /-.dtb is retrieved. The logic is implemented in file cmd/pxe.c. So instead of retrieving tinker_rk3288.dtb we will try to read rockchip-tinker_rk3288.dtb which is incorrect. If you want to look downstream, Debian package flash-kernel uses ${fdtfile} as the preferred way to identify the dtb file. The variable is prerequisite for images that shall run on different SOCs. See /etc/flash-kernel/bootscript/bootscr.uboot-generic. Best regards Heinrich Thanks, - Kever On 04/13/2018 06:45 AM, Heinrich Schuchardt wrote: All rk3288 default configs define CONFIG_DEFAULT_DEVICE_TREE. So we can use it to define ${fdtfile} in rk3288_common.h. This variable is needed by the distro boot command. Signed-off-by: Heinrich Schuchardt--- include/configs/rk3288_common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 78595b86ec..762a206143 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -73,6 +73,7 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "fdt_high=0x0fff\0" \ "initrd_high=0x0fff\0" \ + "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ "partitions=" PARTS_DEFAULT \ ENV_MEM_LAYOUT_SETTINGS \ ROCKCHIP_DEVICE_SETTINGS \ ___ 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] chiliSOM: USB bug
Marcin Niestroj wrote: On 12.04.2018 13:35, sdrb wrote: Marcin Niestroj wrote: On 12.04.2018 11:09, sdrb wrote: Marcin Niestrój wrote: >> Could you describe what is you BOOT[4:0] configuration? And you want to boot from MMC1, right? If I read the BOOT[4:0] properly it is: 0011. I want to boot from SD card. Please provide these 5 pins (including 4 and 0) configuration. Sorry for misprint - SYSBOOT[4:0] pins are as follows: 00011. Unfortunately I can't reproduce this issue on my side with chiliboard. It's hard to tell what could be the problem when using you board. What RAM vendor is on chiliSOM you have on your board? Maybe there DDR is not initialized with proper timing? Don't have other ideas for now. If I identified properly the chip it is Samsung. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] image: Display FIT signature for configs
The signature/hash information are displayed for images but nor for configurations. Add subnodes printing in fit_conf_print() like it's done in fit_image_print() --- common/image-fit.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/common/image-fit.c b/common/image-fit.c index 4b03390454..b87f4420fa 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1589,6 +1589,7 @@ void fit_conf_print(const void *fit, int noffset, const char *p) const char *uname; int ret; int fdt_index, loadables_index; + int ndepth; /* Mandatory properties */ ret = fit_get_desc(fit, noffset, ); @@ -1638,6 +1639,16 @@ void fit_conf_print(const void *fit, int noffset, const char *p) } printf("%s\n", uname); } + + /* Process all hash subnodes of the component image node */ + for (ndepth = 0, noffset = fdt_next_node(fit, noffset, ); +(noffset >= 0) && (ndepth > 0); +noffset = fdt_next_node(fit, noffset, )) { + if (ndepth == 1) { + /* Direct child node of the component image node */ + fit_image_print_verification_data(fit, noffset, p); + } + } } static int fit_image_select(const void *fit, int rd_noffset, int verify) -- 2.17.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v1] rockchip: defconfig: puma-rk3399: enable RTC
commit: 52280315a4 ("rtc: rewrite isl1208 to support DM") enables us to use the on-module RTC emulation with the rk3399 device model i2c driver. Signed-off-by: Klaus Goger--- configs/puma-rk3399_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig index 4324a82e76..b809a7 100644 --- a/configs/puma-rk3399_defconfig +++ b/configs/puma-rk3399_defconfig @@ -80,6 +80,8 @@ CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y CONFIG_RAM=y CONFIG_SPL_RAM=y +CONFIG_DM_RTC=y +CONFIG_RTC_ISL1208=y CONFIG_DEBUG_UART_BASE=0xFF18 CONFIG_DEBUG_UART_CLOCK=2400 CONFIG_DEBUG_UART_SHIFT=2 -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] skylake fsp
Hi all Currently I am trying to get the skylake fsp working with u-boot but I run into some issues: 1) I see the postcode POST_BIST_FAILURE triggered in car_init I am not sure how this could happen and I am not sure from where the BIST value comes from. I can see the following call chain start16(..) _start(..) car_init(..) 2) If I remove that check the last post code I see is POST_PRE_MRC It looks like fsp_init(..) gets called and hags. I am thankful for every hint I could get. In the meantime I will have a deeper look at the coreboot sources. -- thanks -- Christian Gmeiner, MSc https://christian-gmeiner.info ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/1] rockchip: rk3288: provide ${fdtfile}
> From: Kever Yang> Date: Fri, 13 Apr 2018 15:54:07 +0800 > > Hi Heinrich, > > What kind of issue do you met without this patch? > > I think distro boot always work fine in my side without this patch. Without this, U-Boot won't load a new device tree from disk before starting the EFI application. This means the device tree provided by U-Boot will be used which doesn't work very well with newer kernels. > Thanks, > - Kever > On 04/13/2018 06:45 AM, Heinrich Schuchardt wrote: > > All rk3288 default configs define CONFIG_DEFAULT_DEVICE_TREE. > > So we can use it to define ${fdtfile} in rk3288_common.h. > > > > This variable is needed by the distro boot command. > > > > Signed-off-by: Heinrich Schuchardt > > --- > > include/configs/rk3288_common.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/include/configs/rk3288_common.h > > b/include/configs/rk3288_common.h > > index 78595b86ec..762a206143 100644 > > --- a/include/configs/rk3288_common.h > > +++ b/include/configs/rk3288_common.h > > @@ -73,6 +73,7 @@ > > #define CONFIG_EXTRA_ENV_SETTINGS \ > > "fdt_high=0x0fff\0" \ > > "initrd_high=0x0fff\0" \ > > + "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ > > "partitions=" PARTS_DEFAULT \ > > ENV_MEM_LAYOUT_SETTINGS \ > > ROCKCHIP_DEVICE_SETTINGS \ > > > ___ > 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 1/1] rockchip: rk3288: provide ${fdtfile}
Hi Heinrich, Does this fdtfile will used for kernel? There should be a fdt config for kernel dtb in boot config file, and we should not use U-Boot dtb for kernel, they are different. Thanks, - Kever On 04/13/2018 03:54 PM, Kever Yang wrote: > Hi Heinrich, > > What kind of issue do you met without this patch? > > I think distro boot always work fine in my side without this patch. > > Thanks, > - Kever > On 04/13/2018 06:45 AM, Heinrich Schuchardt wrote: >> All rk3288 default configs define CONFIG_DEFAULT_DEVICE_TREE. >> So we can use it to define ${fdtfile} in rk3288_common.h. >> >> This variable is needed by the distro boot command. >> >> Signed-off-by: Heinrich Schuchardt>> --- >> include/configs/rk3288_common.h | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/include/configs/rk3288_common.h >> b/include/configs/rk3288_common.h >> index 78595b86ec..762a206143 100644 >> --- a/include/configs/rk3288_common.h >> +++ b/include/configs/rk3288_common.h >> @@ -73,6 +73,7 @@ >> #define CONFIG_EXTRA_ENV_SETTINGS \ >> "fdt_high=0x0fff\0" \ >> "initrd_high=0x0fff\0" \ >> +"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ >> "partitions=" PARTS_DEFAULT \ >> ENV_MEM_LAYOUT_SETTINGS \ >> ROCKCHIP_DEVICE_SETTINGS \ > > ___ > 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] chiliSOM: USB bug
On 12.04.2018 13:35, sdrb wrote: Marcin Niestroj wrote: On 12.04.2018 11:09, sdrb wrote: Marcin Niestrój wrote: >> Could you describe what is you BOOT[4:0] configuration? And you want to boot from MMC1, right? If I read the BOOT[4:0] properly it is: 0011. I want to boot from SD card. Please provide these 5 pins (including 4 and 0) configuration. Sorry for misprint - SYSBOOT[4:0] pins are as follows: 00011. Unfortunately I can't reproduce this issue on my side with chiliboard. It's hard to tell what could be the problem when using you board. What RAM vendor is on chiliSOM you have on your board? Maybe there DDR is not initialized with proper timing? Don't have other ideas for now. Regards, WK -- Marcin Niestroj ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/1] rockchip: rk3288: provide ${fdtfile}
Hi Heinrich, What kind of issue do you met without this patch? I think distro boot always work fine in my side without this patch. Thanks, - Kever On 04/13/2018 06:45 AM, Heinrich Schuchardt wrote: > All rk3288 default configs define CONFIG_DEFAULT_DEVICE_TREE. > So we can use it to define ${fdtfile} in rk3288_common.h. > > This variable is needed by the distro boot command. > > Signed-off-by: Heinrich Schuchardt> --- > include/configs/rk3288_common.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h > index 78595b86ec..762a206143 100644 > --- a/include/configs/rk3288_common.h > +++ b/include/configs/rk3288_common.h > @@ -73,6 +73,7 @@ > #define CONFIG_EXTRA_ENV_SETTINGS \ > "fdt_high=0x0fff\0" \ > "initrd_high=0x0fff\0" \ > + "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ > "partitions=" PARTS_DEFAULT \ > ENV_MEM_LAYOUT_SETTINGS \ > ROCKCHIP_DEVICE_SETTINGS \ ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [U-Boot, 36/36] rockchip: add common board file for rockchip platform
Hi Philipp, On 04/08/2018 09:45 AM, Kever Yang wrote: >>> +__weak int arch_cpu_init(void) >>> +{ >>> + return 0; >>> +} >>> + >>> +__weak int rk_board_init_f(void) >>> +{ >>> + return 0; >>> +} >> This doesn't really help in modularising our board-support and I am >> not a fan of adding something like 'rk_board_init_f' in the first place. >> >> Instead this should be implemented in a way that actually makes the >> code structure easier and more resilient for the future (having __weak >> functions at the architecture-level doesn't really help)... in fact >> the only other uses of __weak in the U-Boot source-base are within >> SPL, as there's no other way to provide hooks there. > I know your proposal is to use DM for board init, then could you make it > more > clear about how to handle this in your solution? > We need to do: > - same board init flow for all rockchip platform; > - something different but common in soc level; > - something different in board level; I didn't see your response for this, could you send out your patches? I admit that I'm not very clear about the limitation of '__weak' function, but I do see there are many '__weak' function in common/board_f/r.c, and my common board file is connect to the board_r.c. @Simon, @Tom, Could you kindly give some comment here? Thanks, - Kever ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v4] arm64: Add SMC and HVC commands
This patch adds smc and hvc commands, that allow issuing Secure Monitor Calls and Hypervisor Calls conforming to the ARM SMC Calling Convention. Add Kconfig items to allow each command can be individually enabled. Signed-off-by: Michalis Pappas--- Changes for v2: - Update help message with additional information on usefulness - Remove default=n from Kconfig Changes for v3: - Replace dependency on ARM64 with ARM_SMCCC in Kconfig Changes for v4: - Add list of changes cmd/Kconfig | 14 ++ cmd/Makefile | 2 ++ cmd/smccc.c | 72 3 files changed, 88 insertions(+) create mode 100644 cmd/smccc.c diff --git a/cmd/Kconfig b/cmd/Kconfig index 136836d146..2176b98ccb 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1348,6 +1348,20 @@ config CMD_HASH saved to memory or to an environment variable. It is also possible to verify a hash against data in memory. +config CMD_HVC + bool "Support the 'hvc' command" + depends on ARM_SMCCC + help + Allows issuing Hypervisor Calls (HVCs). Mostly useful for + development and testing. + +config CMD_SMC + bool "Support the 'smc' command" + depends on ARM_SMCCC + help + Allows issuing Secure Monitor Calls (SMCs). Mostly useful for + development and testing. + config HASH_VERIFY bool "hash -v" depends on CMD_HASH diff --git a/cmd/Makefile b/cmd/Makefile index 9a358e4801..5656a1a40a 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -61,6 +61,7 @@ obj-$(CONFIG_CMD_FS_GENERIC) += fs.o obj-$(CONFIG_CMD_FUSE) += fuse.o obj-$(CONFIG_CMD_GETTIME) += gettime.o obj-$(CONFIG_CMD_GPIO) += gpio.o +obj-$(CONFIG_CMD_HVC) += smccc.o obj-$(CONFIG_CMD_I2C) += i2c.o obj-$(CONFIG_CMD_IOTRACE) += iotrace.o obj-$(CONFIG_CMD_HASH) += hash.o @@ -113,6 +114,7 @@ obj-$(CONFIG_CMD_SHA1SUM) += sha1sum.o obj-$(CONFIG_CMD_SETEXPR) += setexpr.o obj-$(CONFIG_CMD_SPI) += spi.o obj-$(CONFIG_CMD_STRINGS) += strings.o +obj-$(CONFIG_CMD_SMC) += smccc.o obj-$(CONFIG_CMD_TERMINAL) += terminal.o obj-$(CONFIG_CMD_TIME) += time.o obj-$(CONFIG_CMD_TRACE) += trace.o diff --git a/cmd/smccc.c b/cmd/smccc.c new file mode 100644 index 00..2fa7c23999 --- /dev/null +++ b/cmd/smccc.c @@ -0,0 +1,72 @@ +/* + * Copyright 2018 + * Michalis Pappas + * + * SPDX-License-Identifier:GPL-2.0+ + */ +#include +#include +#include +#include +#include +#include + +static int do_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + struct arm_smccc_res res; + + unsigned long fid; + + unsigned long a1; + unsigned long a2; + unsigned long a3; + unsigned long a4; + unsigned long a5; + unsigned long a6; + unsigned long a7; + + if (argc < 2) + return CMD_RET_USAGE; + + fid = simple_strtoul(argv[1], NULL, 16); + + a1 = argc > 2 ? simple_strtoul(argv[2], NULL, 16) : 0; + a2 = argc > 3 ? simple_strtoul(argv[3], NULL, 16) : 0; + a3 = argc > 4 ? simple_strtoul(argv[4], NULL, 16) : 0; + a4 = argc > 5 ? simple_strtoul(argv[5], NULL, 16) : 0; + a5 = argc > 6 ? simple_strtoul(argv[6], NULL, 16) : 0; + a6 = argc > 7 ? simple_strtoul(argv[7], NULL, 16) : 0; + a7 = argc > 8 ? simple_strtoul(argv[8], NULL, 16) : 0; + + if (!strcmp(argv[0], "smc")) + arm_smccc_smc(fid, a1, a2, a3, a4, a5, a6, a7, ); + else + arm_smccc_hvc(fid, a1, a2, a3, a4, a5, a6, a7, ); + + printf("Res: %ld %ld %ld %ld\n", res.a0, res.a1, res.a2, res.a3); + + return 0; +} + +#ifdef CONFIG_CMD_SMC +U_BOOT_CMD( + smc,8, 2, do_call, + "Issue a Secure Monitor Call", + " [arg1 ... arg6] [id]\n" + " - fid Function ID\n" + " - arg SMC arguments, passed to X1-X6 (default to zero)\n" + " - id Secure OS ID / Session ID, passed to W7 (defaults to zero)\n" +); +#endif + +#ifdef CONFIG_CMD_HVC +U_BOOT_CMD( + hvc,8, 2, do_call, + "Issue a Hypervisor Call", + " [arg1...arg7] [id]\n" + " - fid Function ID\n" + " - arg HVC arguments, passed to X1-X6 (default to zero)\n" + " - id Session ID, passed to W7 (defaults to zero)\n" +); +#endif + -- 2.17.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] armv8: ls1088aqds: Enable mdio commands on u-boot prompt
Signed-off-by: Ashish Kumar--- board/freescale/ls1088a/eth_ls1088aqds.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/board/freescale/ls1088a/eth_ls1088aqds.c b/board/freescale/ls1088a/eth_ls1088aqds.c index 7fe446e..d09e077 100644 --- a/board/freescale/ls1088a/eth_ls1088aqds.c +++ b/board/freescale/ls1088a/eth_ls1088aqds.c @@ -5,12 +5,14 @@ */ #include +#include #include #include #include #include #include #include +#include #include #include #include -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] env: Relocate env drivers if manual reloc is required
Hi, On 12.4.2018 18:42, Simon Glass wrote: > Hi Michal, > > On 12 April 2018 at 04:26, Michal Simekwrote: >> From: Siva Durga Prasad Paladugu >> >> Relocate env drivers if manual relocation is enabled. This >> patch fixes the issue of u-boot hang incase if env is >> present in any of the flash devices. >> >> Signed-off-by: Siva Durga Prasad Paladugu >> Signed-off-by: Michal Simek >> --- >> >> env/common.c | 1 + >> env/env.c | 21 + >> include/environment.h | 5 + >> 3 files changed, 27 insertions(+) > > Reviewed-by: Simon Glass > > Please see below > >> >> diff --git a/env/common.c b/env/common.c >> index f21ff7009695..d282868ee51b 100644 >> --- a/env/common.c >> +++ b/env/common.c >> @@ -227,6 +227,7 @@ void env_relocate(void) >> { >> #if defined(CONFIG_NEEDS_MANUAL_RELOC) >> env_reloc(); >> + fix_envdriver(); >> env_htab.change_ok += gd->reloc_off; >> #endif >> if (gd->env_valid == ENV_INVALID) { >> diff --git a/env/env.c b/env/env.c >> index 3795dbc24e2b..15a0597100f4 100644 >> --- a/env/env.c >> +++ b/env/env.c >> @@ -10,6 +10,27 @@ >> >> DECLARE_GLOBAL_DATA_PTR; >> >> +#if defined(CONFIG_NEEDS_MANUAL_RELOC) >> +void fix_envdriver(void) > > How about env_fix_drivers() ? The env_ prefix is nice for something in > the environment code. > > [..] > v2 sent with name changed. Thanks, Michal ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot