[U-Boot] [PATCH] ARM: DRA72: DDR3: Add emif settings for 666MHz clock
From: R Sricharan r.sricha...@ti.com On DRA72x, EMIF supports DDR3 upto 667MHz. Adding the required settings for DDR3 at 666MHz and enabling it. Signed-off-by: R Sricharan r.sricha...@ti.com Signed-off-by: Lokesh Vutla lokeshvu...@ti.com --- arch/arm/cpu/armv7/omap5/hw_data.c | 39 +++-- arch/arm/cpu/armv7/omap5/sdram.c | 60 +- 2 files changed, 96 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c b/arch/arm/cpu/armv7/omap5/hw_data.c index 4db8492..95f1686 100644 --- a/arch/arm/cpu/armv7/omap5/hw_data.c +++ b/arch/arm/cpu/armv7/omap5/hw_data.c @@ -227,6 +227,16 @@ static const struct dpll_params usb_dpll_params_1920mhz[NUM_SYS_CLKS] = { {400, 15, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 38.4 MHz */ }; +static const struct dpll_params ddr_dpll_params_2664mhz[NUM_SYS_CLKS] = { + {111, 0, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */ + {333, 4, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 20 MHz */ + {555, 6, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 16.8 MHz */ + {555, 7, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 19.2 MHz */ + {666, 12, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 26 MHz */ + {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ + {555, 15, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 38.4 MHz */ +}; + static const struct dpll_params ddr_dpll_params_2128mhz[NUM_SYS_CLKS] = { {266, 2, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */ {266, 4, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 20 MHz */ @@ -286,6 +296,17 @@ struct dplls dra7xx_dplls = { .gmac = gmac_dpll_params_2000mhz, }; +struct dplls dra72x_dplls = { + .mpu = mpu_dpll_params_1ghz, + .core = core_dpll_params_2128mhz_dra7xx, + .per = per_dpll_params_768mhz_dra7xx, + .abe = abe_dpll_params_sysclk2_361267khz, + .iva = iva_dpll_params_2330mhz_dra7xx, + .usb = usb_dpll_params_1920mhz, + .ddr = ddr_dpll_params_2664mhz, + .gmac = gmac_dpll_params_2000mhz, +}; + struct pmic_data palmas = { .base_offset = PALMAS_SMPS_BASE_VOLT_UV, .step = 1, /* 10 mV represented in uV */ @@ -560,6 +581,18 @@ const struct ctrl_ioregs ioregs_dra7xx_es1 = { .ctrl_ddr_ctrl_ext_0 = 0xA200, }; +const struct ctrl_ioregs ioregs_dra72x_es1 = { + .ctrl_ddrch = 0x40404040, + .ctrl_lpddr2ch = 0x40404040, + .ctrl_ddr3ch = 0x60606080, + .ctrl_ddrio_0 = 0xA2084210, + .ctrl_ddrio_1 = 0x84210840, + .ctrl_ddrio_2 = 0x8421, + .ctrl_emif_sdram_config_ext = 0x0001C1A7, + .ctrl_emif_sdram_config_ext_final = 0x0001C1A7, + .ctrl_ddr_ctrl_ext_0 = 0xA200, +}; + void __weak hw_data_init(void) { u32 omap_rev = omap_revision(); @@ -592,7 +625,7 @@ void __weak hw_data_init(void) case DRA722_ES1_0: *prcm = dra7xx_prcm; - *dplls_data = dra7xx_dplls; + *dplls_data = dra72x_dplls; *omap_vcores = dra722_volts; *ctrl = dra7xx_ctrl; break; @@ -619,9 +652,11 @@ void get_ioregs(const struct ctrl_ioregs **regs) break; case DRA752_ES1_0: case DRA752_ES1_1: - case DRA722_ES1_0: *regs = ioregs_dra7xx_es1; break; + case DRA722_ES1_0: + *regs = ioregs_dra72x_es1; + break; default: printf(\n INVALID OMAP REVISION ); diff --git a/arch/arm/cpu/armv7/omap5/sdram.c b/arch/arm/cpu/armv7/omap5/sdram.c index ff9d603..7d8cec0 100644 --- a/arch/arm/cpu/armv7/omap5/sdram.c +++ b/arch/arm/cpu/armv7/omap5/sdram.c @@ -185,6 +185,30 @@ const struct emif_regs emif_2_regs_ddr3_532_mhz_1cs_dra_es1 = { .emif_rd_wr_exec_thresh = 0x0305 }; +const struct emif_regs emif_1_regs_ddr3_666_mhz_1cs_dra_es1 = { + .sdram_config_init = 0x61851AB2, + .sdram_config = 0x61851AB2, + .sdram_config2 = 0x0800, + .ref_ctrl = 0x1035, + .sdram_tim1 = 0xCCCF36B3, + .sdram_tim2 = 0x308F7FDA, + .sdram_tim3 = 0x027F88A8, + .read_idle_ctrl = 0x0005, + .zq_config = 0x0007190B, + .temp_alert_config = 0x, + .emif_ddr_phy_ctlr_1_init = 0x0024400A, + .emif_ddr_phy_ctlr_1= 0x0024400A, + .emif_ddr_ext_phy_ctrl_1= 0x10040100, + .emif_ddr_ext_phy_ctrl_2= 0x00A400A4, + .emif_ddr_ext_phy_ctrl_3= 0x00A900A9, + .emif_ddr_ext_phy_ctrl_4= 0x00B000B0, + .emif_ddr_ext_phy_ctrl_5= 0x00B000B0, + .emif_rd_wr_lvl_rmp_win = 0x, + .emif_rd_wr_lvl_rmp_ctl =
Re: [U-Boot] [PATCH 23/23] ARM: tegra: Enable PCIe on Jetson TK1
On 27/08/14 17:34, Thierry Reding wrote: [...] On my board, this call results in UART corruption, like this: tegra-pcie: non-prefetchable memory: 0x1300-0x2000 tegra-pcie: prefetchable memory: 0x2000-0x4000 ¥É½¥¹½bªÍ¥¹b2x1, 1x1 configuration ¹Í5Rþtegra-pcie: probing port 1, using 1 lanes Likely because GPIO#2 controls the +3.3V_LP0 rail, which powers the UART level shifters. Commenting the function call out fixes the corruption and PCI-E still works fine. If I add a udelay(500) after the above I'm not able to reproduce the UART breakage anymore. But I guess making the AS3722 GPIO code smarter would be helpful. In the kernel this is done by checking the invert bit and then setting the value accordingly. I suppose the same could be done for the mode bits. I'll see if I can work up a patch. How about this: [...] Yes, that helps. -- nvpublic ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 06/25] dm: spi: Add a uclass for SPI
On 15 July 2014 06:26, Simon Glass s...@chromium.org wrote: Add a uclass which provides access to SPI buses and includes operations required by SPI. For a time driver model will need to co-exist with the legacy SPI interface so some parts of the header file are changed depending on which is in use. The exports are adjusted also since some functions are not available with driver model. Boards must define CONFIG_DM_SPI to use driver model for SPI. Signed-off-by: Simon Glass s...@chromium.org --- common/exports.c | 4 +- drivers/spi/Makefile | 4 + drivers/spi/spi-uclass.c | 253 +++ include/dm/uclass-id.h | 1 + include/spi.h| 140 ++ 5 files changed, 401 insertions(+), 1 deletion(-) create mode 100644 drivers/spi/spi-uclass.c diff --git a/common/exports.c b/common/exports.c index b97ca48..88fcfc8 100644 --- a/common/exports.c +++ b/common/exports.c @@ -27,10 +27,12 @@ unsigned long get_version(void) # define i2c_write dummy # define i2c_read dummy #endif -#ifndef CONFIG_CMD_SPI +#if !defined(CONFIG_CMD_SPI) || defined(CONFIG_DM_SPI) # define spi_init dummy # define spi_setup_slave dummy # define spi_free_slavedummy +#endif +#ifndef CONFIG_CMD_SPI # define spi_claim_bus dummy # define spi_release_bus dummy # define spi_xfer dummy diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index f02c35a..d1f1dd0 100644 --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile @@ -6,7 +6,11 @@ # # There are many options which enable SPI, so make this library available +ifdef CONFIG_DM_SPI +obj-y += spi-uclass.o +else obj-y += spi.o +endif obj-$(CONFIG_EP93XX_SPI) += ep93xx_spi.o obj-$(CONFIG_ALTERA_SPI) += altera_spi.o diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c new file mode 100644 index 000..4057bce --- /dev/null +++ b/drivers/spi/spi-uclass.c @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2014 Google, Inc + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include dm.h +#include errno.h +#include fdtdec.h +#include spi.h +#include dm/device-internal.h +#include dm/uclass-internal.h +#include dm/root.h +#include dm/lists.h + +DECLARE_GLOBAL_DATA_PTR; + +static int spi_set_speed_mode(struct udevice *bus, int speed, int mode) +{ + struct dm_spi_ops *ops; + int ret; + + ops = spi_get_ops(bus); + if (ops-set_speed) + ret = (*ops-set_speed)(bus, speed); + else + ret = -EINVAL; + if (ret) { + printf(Cannot set speed (err=%d)\n, ret); + return ret; + } + + ops = spi_get_ops(bus); + if (ops-set_mode) + ret = (*ops-set_mode)(bus, mode); + else + ret = -EINVAL; + if (ret) { + printf(Cannot set mode (err=%d)\n, ret); + return ret; + } + + return 0; +} + +int spi_claim_bus(struct spi_slave *slave) +{ + struct udevice *dev = slave-dev; + struct udevice *bus = dev-parent; + struct dm_spi_ops *ops = spi_get_ops(bus); + struct dm_spi_bus *spi = bus-uclass_priv; + int speed; + int ret; + + speed = slave-max_hz; + if (spi-max_hz) { + if (speed) + speed = min(speed, spi-max_hz); + else + speed = spi-max_hz; + } + if (!speed) + speed = 10; + ret = spi_set_speed_mode(bus, speed, slave-mode); + if (ret) + return ret; + + return ops-claim_bus ? ops-claim_bus(bus) : 0; +} + +void spi_release_bus(struct spi_slave *slave) +{ + struct udevice *dev = slave-dev; + struct udevice *bus = dev-parent; + struct dm_spi_ops *ops = spi_get_ops(bus); + + if (ops-release_bus) + spi_get_ops(bus)-release_bus(bus); +} + +int spi_xfer(struct spi_slave *slave, unsigned int bitlen, +const void *dout, void *din, unsigned long flags) +{ + struct udevice *dev = slave-dev; + struct udevice *bus = dev-parent; + + if (bus-uclass-uc_drv-id != UCLASS_SPI) + return -EOPNOTSUPP; + + return spi_get_ops(bus)-xfer(bus, dev, bitlen, dout, din, flags); +} Cleared all these calls, as individual drivers/spi* will setup their ops and fills the priv data. So this uclass will call accordingly - correct? add if I'm missing anything. + +int spi_post_bind(struct udevice *dev) +{ + /* Scan the bus for devices */ + return dm_scan_fdt_node(dev, gd-fdt_blob, dev-of_offset, false); +} + +int spi_post_probe(struct udevice *dev) +{ + struct dm_spi_bus *spi = dev-uclass_priv; + + spi-max_hz = fdtdec_get_int(gd-fdt_blob, dev-of_offset, +
[U-Boot] [PATCH v2] nios2: link to CONFIG_SYS_MONITOR_BASE and remove text_base hook
This patch changes the link script to base at CONFIG_SYS_MONITOR_BASE. Then we can remove the text_base hook in nios2-generic board. Signed-off-by: Thomas Chou tho...@wytron.com.tw --- Changes in v2: - Remove text_base_hook() proto in nios2-generic.c arch/nios2/cpu/u-boot.lds |2 + board/altera/nios2-generic/Makefile|1 - board/altera/nios2-generic/nios2-generic.c |3 - board/altera/nios2-generic/text_base.S | 21 - board/altera/nios2-generic/u-boot.lds | 118 5 files changed, 2 insertions(+), 143 deletions(-) delete mode 100644 board/altera/nios2-generic/text_base.S delete mode 100644 board/altera/nios2-generic/u-boot.lds diff --git a/arch/nios2/cpu/u-boot.lds b/arch/nios2/cpu/u-boot.lds index be92e8e..6e174be 100644 --- a/arch/nios2/cpu/u-boot.lds +++ b/arch/nios2/cpu/u-boot.lds @@ -5,6 +5,7 @@ * SPDX-License-Identifier:GPL-2.0+ */ +#include config.h OUTPUT_FORMAT(elf32-littlenios2) OUTPUT_ARCH(nios2) @@ -12,6 +13,7 @@ ENTRY(_start) SECTIONS { + . = CONFIG_SYS_MONITOR_BASE; .text : { arch/nios2/cpu/start.o (.text) diff --git a/board/altera/nios2-generic/Makefile b/board/altera/nios2-generic/Makefile index d3c5b43..5e4192c 100644 --- a/board/altera/nios2-generic/Makefile +++ b/board/altera/nios2-generic/Makefile @@ -8,4 +8,3 @@ obj-y := nios2-generic.o obj-$(CONFIG_CMD_IDE) += ../common/cfide.o -obj-y += text_base.o diff --git a/board/altera/nios2-generic/nios2-generic.c b/board/altera/nios2-generic/nios2-generic.c index 5ab9471..834cbeb 100644 --- a/board/altera/nios2-generic/nios2-generic.c +++ b/board/altera/nios2-generic/nios2-generic.c @@ -14,8 +14,6 @@ #include asm/io.h #include asm/gpio.h -void text_base_hook(void); /* nop hook for text_base.S */ - #if defined(CONFIG_ENV_IS_IN_FLASH) defined(CONFIG_ENV_ADDR) \ defined(CONFIG_CFI_FLASH_MTD) static void __early_flash_cmd_reset(void) @@ -30,7 +28,6 @@ void early_flash_cmd_reset(void) int board_early_init_f(void) { - text_base_hook(); #ifdef CONFIG_ALTERA_PIO #ifdef LED_PIO_BASE altera_pio_init(LED_PIO_BASE, LED_PIO_WIDTH, 'o', diff --git a/board/altera/nios2-generic/text_base.S b/board/altera/nios2-generic/text_base.S deleted file mode 100644 index f236db1..000 --- a/board/altera/nios2-generic/text_base.S +++ /dev/null @@ -1,21 +0,0 @@ -/* - * text_base - * - * (C) Copyright 2010, Thomas Chou tho...@wytron.com.tw - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include config.h - -#ifdef CONFIG_SYS_MONITOR_BASE - .text - /* text base used in link script u-boot.lds */ - .global text_base - .equ text_base,CONFIG_SYS_MONITOR_BASE - /* dummy func to let linker include this file */ - .global text_base_hook -text_base_hook: - ret -#endif diff --git a/board/altera/nios2-generic/u-boot.lds b/board/altera/nios2-generic/u-boot.lds deleted file mode 100644 index e35fae5..000 --- a/board/altera/nios2-generic/u-boot.lds +++ /dev/null @@ -1,118 +0,0 @@ -/* - * (C) Copyright 2004, Psyent Corporation www.psyent.com - * Scott McNutt smcn...@psyent.com - * - * SPDX-License-Identifier:GPL-2.0+ - */ - - -OUTPUT_FORMAT(elf32-littlenios2) -OUTPUT_ARCH(nios2) -ENTRY(_start) - -SECTIONS -{ - . = text_base; - .text : - { - arch/nios2/cpu/start.o (.text) - *(.text) - *(.text.*) - *(.gnu.linkonce.t*) - *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) - *(.gnu.linkonce.r*) - } - . = ALIGN (4); - _etext = .; - PROVIDE (etext = .); - - /* CMD TABLE - sandwich this in between text and data so -* the initialization code relocates the command table as -* well -- admittedly, this is just pure laziness ;-) -*/ - - . = ALIGN(4); - .u_boot_list : { - KEEP(*(SORT(.u_boot_list*))); - } - - /* INIT DATA sections - Small data (see the gcc -G option) -* is always gp-relative. Here we make all init data sections -* adjacent to simplify the startup code -- and provide -* the global pointer for gp-relative access. -*/ - _data = .; - .data : - { - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - } - - . = ALIGN(16); - _gp = .;/* Global pointer addr */ - PROVIDE (gp = .); - - .sdata : - { - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) - } - . = ALIGN(4); - - _edata = .; - PROVIDE (edata = .); - - /* UNINIT DATA - Small uninitialized data is first so it's -* adjacent to sdata and can be referenced via gp. The normal -* bss follows. We keep it adjacent to simplify
Re: [U-Boot] [PATCH v2 13/40] i2c: Add high-level API
Hello Simon, Am 27.08.2014 21:10, schrieb Simon Glass: Hi Thierry, On 27 August 2014 05:41, Thierry Redingthierry.red...@gmail.com wrote: On Wed, Aug 27, 2014 at 11:56:41AM +0200, Heiko Schocher wrote: Hello Thierry, Am 27.08.2014 10:51, schrieb Thierry Reding: On Wed, Aug 27, 2014 at 09:07:58AM +0200, Heiko Schocher wrote: Hello Thierry, Am 27.08.2014 08:21, schrieb Thierry Reding: On Wed, Aug 27, 2014 at 07:21:51AM +0200, Heiko Schocher wrote: Hello Thierry, Am 26.08.2014 17:34, schrieb Thierry Reding: From: Thierry Redingtred...@nvidia.com This API operates on I2C adapters or I2C clients (a new type of object which is a bad idea ... that refers to a particular slave connected to an adapter). This is useful to avoid having to call i2c_set_bus_num() whenever a device is being accessed. But thats the supose of i2c_set_bus_num()! ... if you use an i2c bus, you must check before every access, if you are on it, if not, you must switch back to it... That's not what code does today. Everybody calls i2c_set_bus_num() once and then does a bunch of transactions on that bus. Given that U-Boot Yes, sadly. This has historical reasons ... doesn't run multithreaded this works. If you're really concerned about Yes, U-Boot is singlethread only. this being a problem, then it should be solved at a different level. It could be part of i2c_client for example, so that i2c_client_read() and i2c_client_write() would always perform this step. Burdening users with Exactly, thats right, and this is a goal from the CONFIG_SYS_I2C API! But why do you introduce i2c_client_read/write and do not add this step to i2c_read/write? - convert all i2c drivers, which are not yet converted to CONFIG_SYS_I2C (get also rid od CONFIG_HARD_I2C) - add busnumber to i2c_read/write API and make i2c_set_bus_num() static ... and fix all i2c_read/write() calls in U-Boot code ... I don't think adding a bus number as parameter is useful. Why not just use the I2C adapter directly? That way we don't have to keep looking it up in an array every time. You again just talk from i2c_adapter ... why you ignore i2c muxes? A bus is not only an i2c adapter ... I know. I keep saying i2c_adapter because in the rough sketch that I have in mind for how this could work eventually, an mux is just another special kind of i2c_adapter. Currently we have two versions of i2c_adapter: In a system without muxes, you can say: i2c bus == i2c adapter but in a system with muxes we have: i2c bus == i2c_bus_hose i2c commands use also a bus number starting from 0 ... the bus number has historical reasons... we could change this ... But if we introduce a new API, please with mux functionallity ... Hmm.. thinking about it ... if you want to introduce a new API, please start with using the DM for I2C! I can look into it, but it sounds like a task way beyond what I have time for right now. I can help if you are interested. I have patches for SPI at u-boot-dm.git (branch working) and would like to have I2C. They are sort-of similar so it might not be to hard to convert Tegra I2C over. The concept of a 'current' bus is broken IMO. Maybe the command line should have this concept, and maintain a 'current hose' or whatever. But drives and other code should specific what they need with each transaction. With DM that will likely be automatic. That sounds great! I vote for using DM. bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 0/6] Introduce low-level debug for ARM architecture
Hello Masahiro, On 08/28/2014 04:31 AM, Masahiro Yamada wrote: I have been in trouble for a while to debug some nasty problem where neighter a debugger nor printf() function is available. I found the lowlevel debug feature in ARM Linux can be used as is in U-Boot too. I tested this series on our SoCs (32bit ARM, specificly Coretex-A9). Because I was not sure about aarch64, I have this feature depend on ! ARM64. 1/6 and 2/6 refactor a bit and move CONFIG_ARM64 to Kconfig. 3/6 imports some source files from Linux 3.16 and 5/6 adds the Kconfig menu. Masahiro Yamada (6): vexpress64: kconfig: consolidate CONFIG_TARGET_VEXPRESS_AEMV8A_SEMI kconfig: armv8: move CONFIG_ARM64 to Kconfig arm: debug: import debug files from Linux 3.16 arm: debug: replace license blocks with SPDX arm: debug: add Kconfig entries for lowlevel debug arm: debug: adjust for U-Boot arch/arm/Kconfig | 13 +- arch/arm/Kconfig.debug | 64 ++ arch/arm/cpu/armv8/Kconfig | 7 + arch/arm/include/debug/8250.S | 52 + arch/arm/lib/Makefile | 2 + arch/arm/lib/debug.S | 136 board/armltd/vexpress64/Kconfig| 24 -- board/freescale/ls2085a/Kconfig| 8 - configs/ls2085a_emu_D4_defconfig | 2 +- configs/ls2085a_emu_defconfig | 2 +- configs/ls2085a_simu_defconfig | 2 +- configs/vexpress_aemv8a_defconfig | 1 - configs/vexpress_aemv8a_semi_defconfig | 4 +- include/linux/serial_reg.h | 388 + 14 files changed, 664 insertions(+), 41 deletions(-) create mode 100644 arch/arm/Kconfig.debug create mode 100644 arch/arm/cpu/armv8/Kconfig create mode 100644 arch/arm/include/debug/8250.S create mode 100644 arch/arm/lib/debug.S create mode 100644 include/linux/serial_reg.h Tested on Trats2(Exynos4412) - works fine. Tested-by: Przemyslaw Marczak p.marc...@samsung.com Best Regards, -- Przemyslaw Marczak Samsung RD Institute Poland Samsung Electronics p.marc...@samsung.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/8] ARM: PSCI: Alow arch specific DT patching
Hi Arnab, On Wed, Aug 27, 2014 at 09:29:55PM +0100, Arnab Basu wrote: Both ARMv7 and ARMv8 need to patch the device tree but the kind of patching done is different. This creates a function that can be defined by each architecture to handle the differences I have no problem with the patch, but what is it that we need to do differently for ARMv7 and ARMv8? Mark. Signed-off-by: Arnab Basu arnab.b...@freescale.com Reviewed-by: Bhupesh Sharma bhupesh.sha...@freescale.com Cc: Marc Zyngier marc.zyng...@arm.com --- arch/arm/cpu/armv7/virt-dt.c |7 ++- arch/arm/lib/bootm-fdt.c | 11 --- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/arm/cpu/armv7/virt-dt.c b/arch/arm/cpu/armv7/virt-dt.c index 0b0d6a7..3fbec39 100644 --- a/arch/arm/cpu/armv7/virt-dt.c +++ b/arch/arm/cpu/armv7/virt-dt.c @@ -88,7 +88,7 @@ static int fdt_psci(void *fdt) return 0; } -int armv7_update_dt(void *fdt) +static int armv7_update_dt(void *fdt) { #ifndef CONFIG_ARMV7_SECURE_BASE /* secure code lives in RAM, keep it alive */ @@ -98,3 +98,8 @@ int armv7_update_dt(void *fdt) return fdt_psci(fdt); } + +int cpu_update_dt(void *fdt) +{ + return armv7_update_dt(fdt); +} diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c index d4f1578..daabc03 100644 --- a/arch/arm/lib/bootm-fdt.c +++ b/arch/arm/lib/bootm-fdt.c @@ -21,6 +21,11 @@ DECLARE_GLOBAL_DATA_PTR; +__weak int cpu_update_dt(void *fdt) +{ + return 0; +} + int arch_fixup_fdt(void *blob) { bd_t *bd = gd-bd; @@ -34,11 +39,11 @@ int arch_fixup_fdt(void *blob) } ret = fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS); -#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT) + if (ret) return ret; - ret = armv7_update_dt(blob); -#endif + ret = cpu_update_dt(blob); + return ret; } -- 1.7.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] tools/env: change stripping strategy to allow no-stripping
On Wed, Aug 27, 2014 at 8:29 PM, Thomas Petazzoni thomas.petazz...@free-electrons.com wrote: When building the U-Boot tools for non-ELF platforms (such as Blackfin FLAT), since commit 79fc0c5f498c3982aa4740c273ab1a9255063d9c (tools/env: cross-compile fw_printenv without setting HOSTCC), the build fails because it tries to strip a FLAT binary, which does not make sense. This commit solves this by changing the stripping logic in tools/env/Makefile to be similar to the one in tools/Makefile. This logic continues to apply strip to the final binary, but does not abort the build if it fails, and does the stripping in place on the final binary. This allows the logic to work fine if stripping doesn't work, as it leaves the final binary untouched. Signed-off-by: Thomas Petazzoni thomas.petazz...@free-electrons.com Cc: Masahiro Yamada yamad...@jp.panasonic.com Cc: Sonic Zhang sonic.zh...@analog.com --- An improved solution would be to be able to override STRIP completely by setting it to /bin/true, but the main Makefile enforces STRIP = $(CROSS_COMPILE)strip. Signed-off-by: Thomas Petazzoni thomas.petazz...@free-electrons.com --- tools/env/Makefile | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/env/Makefile b/tools/env/Makefile index 4927489..40164f7 100644 --- a/tools/env/Makefile +++ b/tools/env/Makefile @@ -21,14 +21,16 @@ HOST_EXTRACFLAGS += -DMTD_OLD endif always := fw_printenv -hostprogs-y := fw_printenv_unstripped +hostprogs-y := fw_printenv -fw_printenv_unstripped-objs := fw_env.o fw_env_main.o \ +fw_printenv-objs := fw_env.o fw_env_main.o \ crc32.o ctype.o linux_string.o \ env_attr.o env_flags.o aes.o -quiet_cmd_strip = STRIP $@ - cmd_strip = $(STRIP) -o $@ $ +quiet_cmd_crosstools_strip = STRIP $^ + cmd_crosstools_strip = $(STRIP) $^; touch $@ -$(obj)/fw_printenv: $(obj)/fw_printenv_unstripped FORCE - $(call if_changed,strip) +$(obj)/.strip: $(obj)/fw_printenv + $(call cmd,crosstools_strip) + +always += .strip -- 2.0.0 Reviewed-by: Sonic Zhang sonic.zh...@analog.com Regards, Sonic ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 01/40] vsprintf: Add modifier for phys_addr_t
On Wed, Aug 27, 2014 at 11:41:55AM -0600, Stephen Warren wrote: On 08/27/2014 01:01 AM, Thierry Reding wrote: On Tue, Aug 26, 2014 at 11:04:56AM -0600, Stephen Warren wrote: On 08/26/2014 09:33 AM, Thierry Reding wrote: From: Thierry Reding tred...@nvidia.com Provide a new modifier to vsprintf() to print phys_addr_t variables to avoid having to cast or #ifdef when printing them out. The %pa modifier is used for this purpose, so phys_addr_t variables need to be passed by reference, like so: phys_addr_t start = 0; printf(start: %pa\n, start); Depending on the size of phys_addr_t this will print out the address with 8 or 16 hexadecimal digits following a 0x prefix. The series, Tested-by: Stephen Warren swar...@nvidia.com Note that I did see the following printed a couple of times when I executed run bootcmd_pxe: pci_hose_bus_to_phys: invalid physical address ... but everything worked perfectly, so I guess we can track that down later. Yes, it should definitely be tracked down. I don't see that message on my setup. I've seen it for example when noncached_alloc() fails and returns 0, but in that case everything shouldn't be working perfectly. It looks like it happens when dhcp or pxe get attempt to download a file that doesn't exist on the server. It would be helpful if that message showed what physical address was considered invalid. The address is 0. I think this is because rtl_recv() is being called after rtl_halt(). rtl_halt() NULLs out all tpc-RxBufferRing[] entries, so calling rtl_recv() after that tries to convert address 0 to a PCI address. I haven't fully tracked this down, but it seems like a bug in the U-Boot networking or TFTP core, rather than anything to do with drivers for R8169 or the Tegra PCIe controller. I'm not planning on tracking this down any further at the moment. The attached patch fixes this issue for me. Cc'ing Joe to help figure out if that's the right approach. Thierry From 89f5c6e725cbce1fa7ff4f69c3c8efae89b629de Mon Sep 17 00:00:00 2001 From: Thierry Reding tred...@nvidia.com Date: Thu, 28 Aug 2014 12:26:58 +0200 Subject: [PATCH] rtl8169: Defer network packet processing When network protocol errors occur (such as a file not being found on a TFTP server), the processing done by the NetReceive() function will end up calling the driver's .halt() implementation. However, after that the device no longer has access to the memory buffers and will cause errors such as this in the rtl_recv() function when trying to hand descriptors back to the device: pci_hose_bus_to_phys: invalid physical address This can be fixed by deferring processing of network packets until the descriptors have been handed back. That way rtl_halt() tearing down network buffers is not going to prevent access to the buffers. Reported-by: Stephen Warren swar...@nvidia.com Signed-off-by: Thierry Reding tred...@nvidia.com --- drivers/net/rtl8169.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index 8183df39e77a..a722fcf9c752 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169.c @@ -527,7 +527,6 @@ static int rtl_recv(struct eth_device *dev) rtl_inval_buffer(tpc-RxBufferRing[cur_rx], length); memcpy(rxdata, tpc-RxBufferRing[cur_rx], length); - NetReceive(rxdata, length); if (cur_rx == NUM_RX_DESC - 1) tpc-RxDescArray[cur_rx].status = @@ -538,6 +537,8 @@ static int rtl_recv(struct eth_device *dev) tpc-RxDescArray[cur_rx].buf_addr = cpu_to_le32(bus_to_phys(tpc-RxBufferRing[cur_rx])); rtl_flush_rx_desc(tpc-RxDescArray[cur_rx]); + + NetReceive(rxdata, length); } else { puts(Error Rx); } -- 2.0.4 pgpALg8Cyolel.pgp Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/8] ARM: PSCI: Alow arch specific DT patching
Hi Mark On 08/28/2014 03:40 PM, Mark Rutland wrote: Hi Arnab, On Wed, Aug 27, 2014 at 09:29:55PM +0100, Arnab Basu wrote: Both ARMv7 and ARMv8 need to patch the device tree but the kind of patching done is different. This creates a function that can be defined by each architecture to handle the differences I have no problem with the patch, but what is it that we need to do differently for ARMv7 and ARMv8? In ARMv7 there does not seem to be any code around to set enable-method to spin-table. I guess it is assumed that DTs already come with this set. For ARMv8 we would like to assume that enable-method is missing from the cpu node and will be set either to spin-table or psci by the boot loader. So the difference is, for ARMv7 the enable-method is only modified in case of PSCI, whereas for ARMv8 it is always modified. Thanks Arnab Mark. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: zynq: Add compile time boot mode override
Ping! On Wed, Aug 20, 2014 at 10:14 PM, Peter Crosthwaite crosthwaitepe...@gmail.com wrote: To better enable debug of u-boot itself (in particular SPL). To debug u-boot you want to put your board in JTAG boot mode for quick recompile and elf downloads via the JTAG debugger. Yet you may still want to boot from a persistent storage media (SD or QSPI). Allow override of the boot mode pins to facilitate this. Signed-off-by: Peter Crosthwaite crosthwaite.pe...@gmail.com --- arch/arm/cpu/armv7/zynq/slcr.c | 4 doc/README.zynq| 6 ++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/cpu/armv7/zynq/slcr.c b/arch/arm/cpu/armv7/zynq/slcr.c index 934ccc3..26e02b8 100644 --- a/arch/arm/cpu/armv7/zynq/slcr.c +++ b/arch/arm/cpu/armv7/zynq/slcr.c @@ -155,8 +155,12 @@ void zynq_slcr_devcfg_enable(void) u32 zynq_slcr_get_boot_mode(void) { +#ifdef CONFIG_ZYNQ_BM_FORCE + return CONFIG_ZYNQ_BM_FORCE; +#else /* Get the bootmode register value */ return readl(slcr_base-boot_mode); +#endif } u32 zynq_slcr_get_idcode(void) diff --git a/doc/README.zynq b/doc/README.zynq index 043c970..70be7ae 100644 --- a/doc/README.zynq +++ b/doc/README.zynq @@ -52,6 +52,12 @@ board_late_init() will read the bootmode values using slcr bootmode register at runtime and assign the modeboot variable to specific bootmode string which is intern used in autoboot. +This value can be overridden at compile time with the define +CONFIG_ZYNQ_BM_FORCE. This is useful for debugging a u-boot elf downloaded +over JTAG. E.g. The board will be jumpered for ZYNQ_BM_JTAG, but you can +force u-boot to attempt an SD or QSPI boot should that be what you want to +debug. + SLCR bootmode register Bit[3:0] values #define ZYNQ_BM_NOR0x02 #define ZYNQ_BM_SD 0x05 -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: atmel: sama5d3: add timings register
On 08/01/2014 10:37 AM, Bo Shen wrote: Signed-off-by: Bo Shen voice.s...@atmel.com Reviewed-by: Andreas Bießmann andreas.de...@googlemail.com --- arch/arm/include/asm/arch-at91/sama5d3_smc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/arch-at91/sama5d3_smc.h b/arch/arm/include/asm/arch-at91/sama5d3_smc.h index 6caa9b6..a859b6d 100644 --- a/arch/arm/include/asm/arch-at91/sama5d3_smc.h +++ b/arch/arm/include/asm/arch-at91/sama5d3_smc.h @@ -14,7 +14,8 @@ #define AT91_ASM_SMC_SETUP0 (ATMEL_BASE_SMC + 0x600) #define AT91_ASM_SMC_PULSE0 (ATMEL_BASE_SMC + 0x604) #define AT91_ASM_SMC_CYCLE0 (ATMEL_BASE_SMC + 0x608) -#define AT91_ASM_SMC_MODE0 (ATMEL_BASE_SMC + 0x60C) +#define AT91_ASM_SMC_TIMINGS0(ATMEL_BASE_SMC + 0x60c) +#define AT91_ASM_SMC_MODE0 (ATMEL_BASE_SMC + 0x610) #else struct at91_cs { u32 setup; /* 0x600 SMC Setup Register */ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mtd: atmel-nand: use pmecc_readl(b)/pmecc_writel to access the pmecc register
On 06/24/2014 12:18 PM, Josh Wu wrote: We defined the macro pmecc_readl(b)/pmecc_writel for pmecc register access. But in the driver we also use the readl(b)/writel. To keep consistent, this patch make all use pmecc_readl(b)/pmecc_writel. Signed-off-by: Josh Wu josh...@atmel.com Reviewed-by: Andreas Bießmann andreas.de...@googlemail.com --- drivers/mtd/nand/atmel_nand.c | 21 +++-- drivers/mtd/nand/atmel_nand_ecc.h |3 +++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index e73834d..ccc4dc0 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -164,7 +164,7 @@ static void pmecc_gen_syndrome(struct mtd_info *mtd, int sector) /* Fill odd syndromes */ for (i = 0; i host-pmecc_corr_cap; i++) { - value = readl(host-pmecc-rem_port[sector].rem[i / 2]); + value = pmecc_readl(host-pmecc, rem_port[sector].rem[i / 2]); if (i 1) value = 16; value = 0x; @@ -392,10 +392,11 @@ static int pmecc_err_location(struct mtd_info *mtd) int16_t *smu = host-pmecc_smu; int timeout = PMECC_MAX_TIMEOUT_US; - writel(PMERRLOC_DISABLE, host-pmerrloc-eldis); + pmecc_writel(host-pmerrloc, eldis, PMERRLOC_DISABLE); for (i = 0; i = host-pmecc_lmu[cap + 1] 1; i++) { - writel(smu[(cap + 1) * num + i], host-pmerrloc-sigma[i]); + pmecc_writel(host-pmerrloc, sigma[i], + smu[(cap + 1) * num + i]); err_nbr++; } @@ -403,12 +404,12 @@ static int pmecc_err_location(struct mtd_info *mtd) if (sector_size == 1024) val |= PMERRLOC_ELCFG_SECTOR_1024; - writel(val, host-pmerrloc-elcfg); - writel(sector_size * 8 + host-pmecc_degree * cap, - host-pmerrloc-elen); + pmecc_writel(host-pmerrloc, elcfg, val); + pmecc_writel(host-pmerrloc, elen, + sector_size * 8 + host-pmecc_degree * cap); while (--timeout) { - if (readl(host-pmerrloc-elisr) PMERRLOC_CALC_DONE) + if (pmecc_readl(host-pmerrloc, elisr) PMERRLOC_CALC_DONE) break; WATCHDOG_RESET(); udelay(1); @@ -419,7 +420,7 @@ static int pmecc_err_location(struct mtd_info *mtd) return -1; } - roots_nbr = (readl(host-pmerrloc-elisr) PMERRLOC_ERR_NUM_MASK) + roots_nbr = (pmecc_readl(host-pmerrloc, elisr) PMERRLOC_ERR_NUM_MASK) 8; /* Number of roots == degree of smu hence = cap */ if (roots_nbr == host-pmecc_lmu[cap + 1] 1) @@ -443,7 +444,7 @@ static void pmecc_correct_data(struct mtd_info *mtd, uint8_t *buf, uint8_t *ecc, sector_size = host-pmecc_sector_size; while (err_nbr) { - tmp = readl(host-pmerrloc-el[i]) - 1; + tmp = pmecc_readl(host-pmerrloc, el[i]) - 1; byte_pos = tmp / 8; bit_pos = tmp % 8; @@ -597,7 +598,7 @@ static int atmel_nand_pmecc_write_page(struct mtd_info *mtd, pos = i * host-pmecc_bytes_per_sector + j; chip-oob_poi[eccpos[pos]] = - readb(host-pmecc-ecc_port[i].ecc[j]); + pmecc_readb(host-pmecc, ecc_port[i].ecc[j]); } } chip-write_buf(mtd, chip-oob_poi, mtd-oobsize); diff --git a/drivers/mtd/nand/atmel_nand_ecc.h b/drivers/mtd/nand/atmel_nand_ecc.h index 55d7711..92d4ec5 100644 --- a/drivers/mtd/nand/atmel_nand_ecc.h +++ b/drivers/mtd/nand/atmel_nand_ecc.h @@ -34,6 +34,9 @@ #define pmecc_readl(addr, reg) \ readl(addr-reg) +#define pmecc_readb(addr, reg) \ + readb(addr-reg) + #define pmecc_writel(addr, reg, value) \ writel((value), addr-reg) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/3] arm: dts: zynq: Add digilent ZYBO board dts
It's a Zynq board similar in design to the currently supported ones. 512MB of RAM and UART1 is used. Signed-off-by: Peter Crosthwaite crosthwaite.pe...@gmail.com --- arch/arm/dts/Makefile | 1 + arch/arm/dts/zynq-zybo.dts | 23 +++ 2 files changed, 24 insertions(+) create mode 100644 arch/arm/dts/zynq-zybo.dts diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 6e2e313..6da68ac 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -28,6 +28,7 @@ dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ dtb-$(CONFIG_ZYNQ) += zynq-zc702.dtb \ zynq-zc706.dtb \ zynq-zed.dtb \ + zynq-zybo.dtb \ zynq-microzed.dtb \ zynq-zc770-xm010.dtb \ zynq-zc770-xm012.dtb \ diff --git a/arch/arm/dts/zynq-zybo.dts b/arch/arm/dts/zynq-zybo.dts new file mode 100644 index 000..20e0386 --- /dev/null +++ b/arch/arm/dts/zynq-zybo.dts @@ -0,0 +1,23 @@ +/* + * Digilent ZYBO board DTS + * + * Copyright (C) 2013 Xilinx, Inc. + * + * SPDX-License-Identifier:GPL-2.0+ + */ +/dts-v1/; +#include zynq-7000.dtsi + +/ { + model = Zynq ZYBO Board; + compatible = xlnx,zynq-zybo, xlnx,zynq-7000; + + aliases { + serial0 = uart1; + }; + + memory { + device_type = memory; + reg = 0 0x2000; + }; +}; -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/3] ARM: Zynq: Add ZYBO board
Hi Michal, Steven, This series adds the ZYBO board to u-boot. Some components were originally contributed to the digilent u-boot tree (P2). Thanks to Steven Wang. The original code had a custom u-boot env specific for Zybo but I have dropped that. I have added DTS support - which in general seems to have appeared in u-boot since the original digilent work (P1). The new configury is P3. Regards, Peter Peter Crosthwaite (2): arm: dts: zynq: Add digilent ZYBO board dts kconfig: zynq: Add ZYBO board Tinghui Wang (1): configs: zynq: Add config support for ZYBO arch/arm/Kconfig| 3 +++ arch/arm/dts/Makefile | 1 + arch/arm/dts/zynq-zybo.dts | 23 +++ board/xilinx/zynq/Kconfig | 24 configs/zynq_zybo_defconfig | 3 +++ include/configs/zynq_zybo.h | 31 +++ 6 files changed, 85 insertions(+) create mode 100644 arch/arm/dts/zynq-zybo.dts create mode 100644 configs/zynq_zybo_defconfig create mode 100644 include/configs/zynq_zybo.h -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/3] configs: zynq: Add config support for ZYBO
From: Tinghui Wang steven.w...@digilentinc.com This patch adds config support needed for ZYBO target and has been tested on Rev. B ZYBO hardware. Signed-off-by: Tinghui Wang steven.w...@digilentinc.com [PC changes: * Dropped boards.cfg change (rebase conflict) * Dropped custom u-boot env * Added DTS * Misc forward-porting changes ] Signed-off-by: Peter Crosthwiate crosthwaite.pe...@gmail.com --- I have dropped the custom u-boot env from the original patch, as I'm not sure what the purpose was and I didn't need it for ZYBO SPL. --- include/configs/zynq_zybo.h | 31 +++ 1 file changed, 31 insertions(+) create mode 100644 include/configs/zynq_zybo.h diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h new file mode 100644 index 000..c167207 --- /dev/null +++ b/include/configs/zynq_zybo.h @@ -0,0 +1,31 @@ +/* + * (C) Copyright 2012 Xilinx + * (C) Copyright 2014 Digilent Inc. + * + * Configuration for Zynq Development Board - ZYBO + * See zynq_common.h for Zynq common configs + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#ifndef __CONFIG_ZYNQ_ZYBO_H +#define __CONFIG_ZYNQ_ZYBO_H + +#define CONFIG_SYS_SDRAM_SIZE (512 * 1024 * 1024) + +#define CONFIG_ZYNQ_SERIAL_UART1 +#define CONFIG_ZYNQ_GEM0 +#define CONFIG_ZYNQ_GEM_PHY_ADDR0 0 + +#define CONFIG_SYS_NO_FLASH + +#define CONFIG_ZYNQ_SDHCI0 +#define CONFIG_ZYNQ_BOOT_FREEBSD +#define CONFIG_DEFAULT_DEVICE_TREE zynq-zybo + +/* Define ZYBO PS Clock Frequency to 50MHz */ +#define CONFIG_ZYNQ_PS_CLK_FREQ5000UL + +#include configs/zynq-common.h + +#endif /* __CONFIG_ZYNQ_ZYBO_H */ -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/3] kconfig: zynq: Add ZYBO board
Add a defconfig and Kconfigury for the Digilent ZYBO board. Signed-off-by: Peter Crosthwaite crosthwaite.pe...@gmail.com --- arch/arm/Kconfig| 3 +++ board/xilinx/zynq/Kconfig | 24 configs/zynq_zybo_defconfig | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 configs/zynq_zybo_defconfig diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e385eda..e04a2b9 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -671,6 +671,9 @@ config TARGET_ZYNQ_ZC770 config TARGET_ZYNQ_ZED bool Support zynq_zed +config TARGET_ZYNQ_ZYBO + bool Support zynq_zybo + config TARGET_MEDCOM_WIDE bool Support medcom-wide diff --git a/board/xilinx/zynq/Kconfig b/board/xilinx/zynq/Kconfig index 3b72a5f..151279c 100644 --- a/board/xilinx/zynq/Kconfig +++ b/board/xilinx/zynq/Kconfig @@ -93,3 +93,27 @@ config SYS_CONFIG_NAME default zynq_zed endif + +if TARGET_ZYNQ_ZYBO + +config SYS_CPU + string + default armv7 + +config SYS_BOARD + string + default zynq + +config SYS_VENDOR + string + default xilinx + +config SYS_SOC + string + default zynq + +config SYS_CONFIG_NAME + string + default zynq_zybo + +endif diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig new file mode 100644 index 000..973ebc1 --- /dev/null +++ b/configs/zynq_zybo_defconfig @@ -0,0 +1,3 @@ +CONFIG_SPL=y ++S:CONFIG_ARM=y ++S:CONFIG_TARGET_ZYNQ_ZYBO=y -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 12/25] dm: spi: Add documentation on how to convert over SPI drivers
On 15 July 2014 06:26, Simon Glass s...@chromium.org wrote: This README is intended to help maintainers move their SPI drivers over to driver model. It works through the required steps with an example. Signed-off-by: Simon Glass s...@chromium.org --- doc/driver-model/spi-howto.txt | 570 + 1 file changed, 570 insertions(+) create mode 100644 doc/driver-model/spi-howto.txt diff --git a/doc/driver-model/spi-howto.txt b/doc/driver-model/spi-howto.txt new file mode 100644 index 000..bb64735 --- /dev/null +++ b/doc/driver-model/spi-howto.txt @@ -0,0 +1,570 @@ +How to port a SPI driver to driver model + + +Here is a rough step-by-step guide. It is based around converting the +exynos SPI driver to driver model (DM) and the example code is based +around U-Boot v2014.04 (commit dda0dbf). + +It is quite long since it includes actual code examples. + +Before driver model, SPI drivers have their own private structure which +contains 'struct spi_slave'. With driver model, 'struct spi_slave' still +exists, but now it is 'per-child data' for the SPI bus. Each child of the +SPI bus is a SPI slave. The information that was stored in the +driver-specific slave structure can now be put in private data for the +SPI bus. Do you think spi_slave still require, I guess It's needed as some slave members to cs, bus are used to control the driver. But any specific reason for removing spi_slave from exynos_spi.c? + +For example, struct tegra_spi_slave looks like this: + +struct tegra_spi_slave { + struct spi_slave slave; + struct tegra_spi_ctrl *ctrl; +}; + +In this case 'slave' will be in per-child data, and 'ctrl' will be in the +SPI bus' private data. + + +0. How long does this take? + +Around 2.5 hours, including some allowance for figuring out the driver +model bits. + + +1. Enable driver mode for SPI and SPI flash + +Add these to your board config: + +#define CONFIG_DM_SPI +#define CONFIG_DM_SPI_FLASH + + +2. Add the skeleton + +Put this code at the bottom of your existing driver file: + +struct spi_slave *spi_setup_slave(unsigned int busnum, unsigned int cs, + unsigned int max_hz, unsigned int mode) +{ + return NULL; +} + +struct spi_slave *spi_setup_slave_fdt(const void *blob, int slave_node, + int spi_node) +{ + return NULL; +} + +static int exynos_spi_ofdata_to_platdata(struct udevice *dev) +{ + return -ENODEV; +} + +static int exynos_spi_probe(struct udevice *dev) +{ + return -ENODEV; +} + +static int exynos_spi_remove(struct udevice *dev) +{ + return -ENODEV; +} + +static int exynos_spi_claim_bus(struct udevice *dev) +{ + + return -ENODEV; +} + +static int exynos_spi_release_bus(struct udevice *dev) +{ + + return -ENODEV; +} + +static int exynos_spi_xfer(struct udevice *dev, unsigned int bitlen, + const void *dout, void *din, unsigned long flags) +{ + + return -ENODEV; +} + +static int exynos_spi_set_speed(struct udevice *dev, uint speed) +{ + return -ENODEV; +} + +static int exynos_spi_set_mode(struct udevice *dev, uint mode) +{ + return -ENODEV; +} + +static const struct dm_spi_ops exynos_spi_ops = { + .claim_bus = exynos_spi_claim_bus, + .release_bus= exynos_spi_release_bus, + .xfer = exynos_spi_xfer, + .set_speed = exynos_spi_set_speed, + .set_mode = exynos_spi_set_mode, +}; + +static const struct udevice_id exynos_spi_ids[] = { + { .compatible = samsung,exynos-spi }, + { } +}; + +U_BOOT_DRIVER(exynos_spi) = { + .name = exynos_spi, + .id = UCLASS_SPI, + .of_match = exynos_spi_ids, + .ops= exynos_spi_ops, + .ofdata_to_platdata = exynos_spi_ofdata_to_platdata, + .probe = exynos_spi_probe, + .remove = exynos_spi_remove comma missing - remove is necessary? +}; + + +3. Replace 'exynos' in the above code with your driver name + + +4. #ifdef out all of the code in your driver except for the above + +This will allow you to get it building, which means you can work +incrementally. Since all the methods return an error initially, there is +less chance that you will accidentally leave something in. + +Also, even though your conversion is basically a rewrite, it might help +reviewers if you leave functions in the same place in the file, +particularly for large drivers. + + +5. Add some includes + +Add these includes to your driver: + +#include dm.h +#include errno.h + + +6. Build + +At this point you should be able to build U-Boot for your board with the +empty SPI driver. You still have empty methods in yur driver, but we will typo your instead of yur +write these one by one. + +If you have
Re: [U-Boot] [PATCH] samsung: s5p_goni: fix: Add missing definitions for G_DNL_UMS gadget
On 25/08/14 16:26, Lukasz Majewski wrote: Hi Tom, On 08/22/2014 09:12 AM, Lukasz Majewski wrote: The commit (SHA1: 8fc171318e352) reintroduced correct values for vendor and product IDs required for UMS gadget to work properly either at Windows or Linux. This data was missing for GONI target, so this commit corrects this mistake. Signed-off-by: Lukasz Majewski l.majew...@samsung.com --- include/configs/s5p_goni.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 6e795bf..a51215d 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -91,6 +91,8 @@ #define CONFIG_G_DNL_PRODUCT_NUM 0x6601 #define CONFIG_G_DNL_THOR_VENDOR_NUM CONFIG_G_DNL_VENDOR_NUM #define CONFIG_G_DNL_THOR_PRODUCT_NUM 0x685D +#define CONFIG_G_DNL_UMS_VENDOR_NUM 0x0525 +#define CONFIG_G_DNL_UMS_PRODUCT_NUM 0xA4A5 #define CONFIG_G_DNL_MANUFACTURER Samsung /* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */ Acked-by: Robert Baldyga r.bald...@samsung.com Tom, since Robert - the maintainer of the GONI board has acked the patch and the patch itself adds only missing defines, could you pull this patch to mainline ASAP? It fixes build breaks caused by the GONI board :-) If Tom will merge it to mainline then, Acked-by: Minkyu Kang mk7.k...@samsung.com Thanks, Minkyu Kang. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/8] ARMv8: PCSI: Add generic ARMv8 PSCI code
Hi Arnab, On Wed, Aug 27, 2014 at 09:29:58PM +0100, Arnab Basu wrote: Implement core support for PSCI. As this is generic code, it doesn't implement anything really useful (all the functions are returning Not Implemented). This is really nice to see! Thanks for working on this. Some functions which return NOT_IMPLEMENTED below are requried to be implemented per the PSCI 0.2 spec. I hope that the plan is to implement all the required functions before we turn this on? Otherwise, comments below. This is largely ported from the similar code that exists for ARMv7 Signed-off-by: Arnab Basu arnab.b...@freescale.com Reviewed-by: Bhupesh Sharma bhupesh.sha...@freescale.com Cc: Marc Zyngier marc.zyng...@arm.com --- arch/arm/cpu/armv8/Makefile |1 + arch/arm/cpu/armv8/psci.S | 171 +++ 2 files changed, 172 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/armv8/psci.S diff --git a/arch/arm/cpu/armv8/Makefile b/arch/arm/cpu/armv8/Makefile index 4f0ea87..8f6988d 100644 --- a/arch/arm/cpu/armv8/Makefile +++ b/arch/arm/cpu/armv8/Makefile @@ -15,3 +15,4 @@ obj-y += cache.o obj-y+= tlb.o obj-y+= transition.o obj-y+= cpu-dt.o +obj-$(CONFIG_ARMV8_PSCI) += psci.o diff --git a/arch/arm/cpu/armv8/psci.S b/arch/arm/cpu/armv8/psci.S new file mode 100644 index 000..5f4e3b2 --- /dev/null +++ b/arch/arm/cpu/armv8/psci.S @@ -0,0 +1,171 @@ +/* + * (C) Copyright 2014 + * Arnab Basu arnab.b...@freescale.com + * + * Based on arch/arm/cpu/armv7/psci.S + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include linux/linkage.h +#include asm/psci.h + +.pushsection ._secure.text, ax + +ENTRY(psci_0_2_cpu_suspend_64) +ENTRY(psci_0_2_cpu_on_64) +ENTRY(psci_0_2_affinity_info_64) +ENTRY(psci_0_2_migrate_64) +ENTRY(psci_0_2_migrate_info_up_cpu_64) + mov x0, #ARM_PSCI_RET_NI/* Return -1 (Not Implemented) */ + ret +ENDPROC(psci_0_2_cpu_suspend_64) +ENDPROC(psci_0_2_cpu_on_64) +ENDPROC(psci_0_2_affinity_info_64) +ENDPROC(psci_0_2_migrate_64) +ENDPROC(psci_0_2_migrate_info_up_cpu_64) +.weak psci_0_2_cpu_suspend_64 +.weak psci_0_2_cpu_on_64 +.weak psci_0_2_affinity_info_64 +.weak psci_0_2_migrate_64 +.weak psci_0_2_migrate_info_up_cpu_64 + +ENTRY(psci_0_2_psci_version) + mov x0, #2 /* Return Major = 0, Minor = 2*/ + ret +ENDPROC(psci_0_2_psci_version) + +.align 4 +_psci_0_2_table: + .quad PSCI_0_2_FN_PSCI_VERSION + .quad psci_0_2_psci_version + .quad PSCI_0_2_FN64_CPU_SUSPEND + .quad psci_0_2_cpu_suspend_64 + .quad PSCI_0_2_FN64_CPU_ON + .quad psci_0_2_cpu_on_64 + .quad PSCI_0_2_FN64_AFFINITY_INFO + .quad psci_0_2_affinity_info_64 + .quad PSCI_0_2_FN64_MIGRATE + .quad psci_0_2_migrate_64 + .quad PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU + .quad psci_0_2_migrate_info_up_cpu_64 + .quad 0 + .quad 0 It would be nice if we could reorganise this something like: .quad PSCI_0_2_FN_PSCI_VERSION, psci_0_2_psci_version .quad PSCI_0_2_FN64_CPU_SUSPEND,psci_0_2_cpu_suspend_64 .quad PSCI_0_2_FN64_CPU_ON, psci_0_2_cpu_on_64 .quad PSCI_0_2_FN64_AFFINITY_INFO, psci_0_2_affinity_info_64 .quad PSCI_0_2_FN64_MIGRATE,psci_0_2_migrate_64 .quad PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU, psci_0_2_migrate_info_up_cpu_64 .quad 0,0 As that would make the relationship between IDs and functions clearer (at least to me). Maybe a macro could make this less painful. +.macro psci_enter + stp x29, x30, [sp, #-16]! + stp x27, x28, [sp, #-16]! + stp x25, x26, [sp, #-16]! + stp x23, x24, [sp, #-16]! + stp x21, x22, [sp, #-16]! + stp x19, x20, [sp, #-16]! + stp x17, x18, [sp, #-16]! + stp x15, x16, [sp, #-16]! + stp x13, x14, [sp, #-16]! + stp x11, x12, [sp, #-16]! + stp x9, x10, [sp, #-16]! + stp x7, x8, [sp, #-16]! + stp x5, x6, [sp, #-16]! + mrs x5, elr_el3 + stp x5, x4, [sp, #-16]! + + /* EL0 and El1 will execute in secure */ I think this would be better as: /* U-Boot will run on the secure side */ + mrs x4, scr_el3 + bic x4, x4, #1 + msr scr_el3, x4 +.endm + +.macro psci_return + /* EL0 and El1 will execute in non-secure */ Similarly: /* The OS will run on the non-secure side */ + mrs x4, scr_el3 + orr x4, x4, #1 + msr scr_el3, x4 + + ldp x5, x4, [sp], #16 + msr elr_el3, x5 + ldp x5, x6, [sp], #16 + ldp x7, x8, [sp], #16 + ldp x9, x10, [sp], #16 + ldp x11, x12, [sp], #16 + ldp x13, x14, [sp], #16 + ldp x15, x16, [sp], #16 + ldp
Re: [U-Boot] [PATCH 2/3] configs: zynq: Add config support for ZYBO
On 28 August 2014 16:46, Peter Crosthwaite crosthwaitepe...@gmail.com wrote: From: Tinghui Wang steven.w...@digilentinc.com This patch adds config support needed for ZYBO target and has been tested on Rev. B ZYBO hardware. Signed-off-by: Tinghui Wang steven.w...@digilentinc.com [PC changes: * Dropped boards.cfg change (rebase conflict) * Dropped custom u-boot env * Added DTS * Misc forward-porting changes ] Signed-off-by: Peter Crosthwiate crosthwaite.pe...@gmail.com --- I have dropped the custom u-boot env from the original patch, as I'm not sure what the purpose was and I didn't need it for ZYBO SPL. --- include/configs/zynq_zybo.h | 31 +++ 1 file changed, 31 insertions(+) create mode 100644 include/configs/zynq_zybo.h diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h new file mode 100644 index 000..c167207 --- /dev/null +++ b/include/configs/zynq_zybo.h @@ -0,0 +1,31 @@ +/* + * (C) Copyright 2012 Xilinx + * (C) Copyright 2014 Digilent Inc. + * + * Configuration for Zynq Development Board - ZYBO + * See zynq_common.h for Zynq common configs typo - it's zynq-common.h + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#ifndef __CONFIG_ZYNQ_ZYBO_H +#define __CONFIG_ZYNQ_ZYBO_H + +#define CONFIG_SYS_SDRAM_SIZE (512 * 1024 * 1024) + +#define CONFIG_ZYNQ_SERIAL_UART1 +#define CONFIG_ZYNQ_GEM0 +#define CONFIG_ZYNQ_GEM_PHY_ADDR0 0 + +#define CONFIG_SYS_NO_FLASH + +#define CONFIG_ZYNQ_SDHCI0 +#define CONFIG_ZYNQ_BOOT_FREEBSD +#define CONFIG_DEFAULT_DEVICE_TREE zynq-zybo + +/* Define ZYBO PS Clock Frequency to 50MHz */ +#define CONFIG_ZYNQ_PS_CLK_FREQ5000UL + +#include configs/zynq-common.h + +#endif /* __CONFIG_ZYNQ_ZYBO_H */ -- 1.9.1 thanks! -- Jagan. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/2] ARM: atmel: sama5d3xek: add nor flash init function
On 07/18/2014 10:43 AM, Bo Shen wrote: Add NOR flash hardware init function, including SMC and PIO configuration. Signed-off-by: Bo Shen voice.s...@atmel.com Reviewed-by: Andreas Bießmann andreas.de...@googlemail.com --- Changes in v2: None board/atmel/sama5d3xek/sama5d3xek.c | 58 + 1 file changed, 58 insertions(+) diff --git a/board/atmel/sama5d3xek/sama5d3xek.c b/board/atmel/sama5d3xek/sama5d3xek.c index c835c12..f53754b 100644 --- a/board/atmel/sama5d3xek/sama5d3xek.c +++ b/board/atmel/sama5d3xek/sama5d3xek.c @@ -67,6 +67,61 @@ void sama5d3xek_nand_hw_init(void) } #endif +#ifndef CONFIG_SYS_NO_FLASH +static void sama5d3xek_nor_hw_init(void) +{ + struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC; + + at91_periph_clk_enable(ATMEL_ID_SMC); + + /* Configure SMC CS0 for NOR flash */ + writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) | +AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(0), +smc-cs[0].setup); + writel(AT91_SMC_PULSE_NWE(10) | AT91_SMC_PULSE_NCS_WR(11) | +AT91_SMC_PULSE_NRD(10) | AT91_SMC_PULSE_NCS_RD(11), +smc-cs[0].pulse); + writel(AT91_SMC_CYCLE_NWE(11) | AT91_SMC_CYCLE_NRD(14), +smc-cs[0].cycle); + writel(AT91_SMC_TIMINGS_TCLR(0) | AT91_SMC_TIMINGS_TADL(0) | +AT91_SMC_TIMINGS_TAR(0) | AT91_SMC_TIMINGS_TRR(0) | +AT91_SMC_TIMINGS_TWB(0) | AT91_SMC_TIMINGS_RBNSEL(0)| +AT91_SMC_TIMINGS_NFSEL(0), smc-cs[0].timings); + writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE | +AT91_SMC_MODE_EXNW_DISABLE | +AT91_SMC_MODE_DBW_16 | +AT91_SMC_MODE_TDF_CYCLE(1), +smc-cs[0].mode); + + /* Address pin (A1 ~ A23) configuration */ + at91_set_a_periph(AT91_PIO_PORTE, 1, 0); + at91_set_a_periph(AT91_PIO_PORTE, 2, 0); + at91_set_a_periph(AT91_PIO_PORTE, 3, 0); + at91_set_a_periph(AT91_PIO_PORTE, 4, 0); + at91_set_a_periph(AT91_PIO_PORTE, 5, 0); + at91_set_a_periph(AT91_PIO_PORTE, 6, 0); + at91_set_a_periph(AT91_PIO_PORTE, 7, 0); + at91_set_a_periph(AT91_PIO_PORTE, 8, 0); + at91_set_a_periph(AT91_PIO_PORTE, 9, 0); + at91_set_a_periph(AT91_PIO_PORTE, 10, 0); + at91_set_a_periph(AT91_PIO_PORTE, 11, 0); + at91_set_a_periph(AT91_PIO_PORTE, 12, 0); + at91_set_a_periph(AT91_PIO_PORTE, 13, 0); + at91_set_a_periph(AT91_PIO_PORTE, 14, 0); + at91_set_a_periph(AT91_PIO_PORTE, 15, 0); + at91_set_a_periph(AT91_PIO_PORTE, 16, 0); + at91_set_a_periph(AT91_PIO_PORTE, 17, 0); + at91_set_a_periph(AT91_PIO_PORTE, 18, 0); + at91_set_a_periph(AT91_PIO_PORTE, 19, 0); + at91_set_a_periph(AT91_PIO_PORTE, 20, 0); + at91_set_a_periph(AT91_PIO_PORTE, 21, 0); + at91_set_a_periph(AT91_PIO_PORTE, 22, 0); + at91_set_a_periph(AT91_PIO_PORTE, 23, 0); + /* CS0 pin configuration */ + at91_set_a_periph(AT91_PIO_PORTE, 26, 0); +} +#endif + #ifdef CONFIG_CMD_USB static void sama5d3xek_usb_hw_init(void) { @@ -181,6 +236,9 @@ int board_init(void) #ifdef CONFIG_NAND_ATMEL sama5d3xek_nand_hw_init(); #endif +#ifndef CONFIG_SYS_NO_FLASH + sama5d3xek_nor_hw_init(); +#endif #ifdef CONFIG_CMD_USB sama5d3xek_usb_hw_init(); #endif ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] arm: dts: zynq: Add digilent ZYBO board dts
On 28 August 2014 16:46, Peter Crosthwaite crosthwaitepe...@gmail.com wrote: It's a Zynq board similar in design to the currently supported ones. 512MB of RAM and UART1 is used. Signed-off-by: Peter Crosthwaite crosthwaite.pe...@gmail.com --- arch/arm/dts/Makefile | 1 + arch/arm/dts/zynq-zybo.dts | 23 +++ 2 files changed, 24 insertions(+) create mode 100644 arch/arm/dts/zynq-zybo.dts Acked-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 6e2e313..6da68ac 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -28,6 +28,7 @@ dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ dtb-$(CONFIG_ZYNQ) += zynq-zc702.dtb \ zynq-zc706.dtb \ zynq-zed.dtb \ + zynq-zybo.dtb \ zynq-microzed.dtb \ zynq-zc770-xm010.dtb \ zynq-zc770-xm012.dtb \ diff --git a/arch/arm/dts/zynq-zybo.dts b/arch/arm/dts/zynq-zybo.dts new file mode 100644 index 000..20e0386 --- /dev/null +++ b/arch/arm/dts/zynq-zybo.dts @@ -0,0 +1,23 @@ +/* + * Digilent ZYBO board DTS + * + * Copyright (C) 2013 Xilinx, Inc. + * + * SPDX-License-Identifier:GPL-2.0+ + */ +/dts-v1/; +#include zynq-7000.dtsi + +/ { + model = Zynq ZYBO Board; + compatible = xlnx,zynq-zybo, xlnx,zynq-7000; + + aliases { + serial0 = uart1; + }; + + memory { + device_type = memory; + reg = 0 0x2000; + }; +}; -- 1.9.1 thanks! -- Jagan. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] kconfig: zynq: Add ZYBO board
On 28 August 2014 16:46, Peter Crosthwaite crosthwaitepe...@gmail.com wrote: Add a defconfig and Kconfigury for the Digilent ZYBO board. Signed-off-by: Peter Crosthwaite crosthwaite.pe...@gmail.com --- arch/arm/Kconfig| 3 +++ board/xilinx/zynq/Kconfig | 24 configs/zynq_zybo_defconfig | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 configs/zynq_zybo_defconfig Acked-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e385eda..e04a2b9 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -671,6 +671,9 @@ config TARGET_ZYNQ_ZC770 config TARGET_ZYNQ_ZED bool Support zynq_zed +config TARGET_ZYNQ_ZYBO + bool Support zynq_zybo + config TARGET_MEDCOM_WIDE bool Support medcom-wide diff --git a/board/xilinx/zynq/Kconfig b/board/xilinx/zynq/Kconfig index 3b72a5f..151279c 100644 --- a/board/xilinx/zynq/Kconfig +++ b/board/xilinx/zynq/Kconfig @@ -93,3 +93,27 @@ config SYS_CONFIG_NAME default zynq_zed endif + +if TARGET_ZYNQ_ZYBO + +config SYS_CPU + string + default armv7 + +config SYS_BOARD + string + default zynq + +config SYS_VENDOR + string + default xilinx + +config SYS_SOC + string + default zynq + +config SYS_CONFIG_NAME + string + default zynq_zybo + +endif diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig new file mode 100644 index 000..973ebc1 --- /dev/null +++ b/configs/zynq_zybo_defconfig @@ -0,0 +1,3 @@ +CONFIG_SPL=y ++S:CONFIG_ARM=y ++S:CONFIG_TARGET_ZYNQ_ZYBO=y -- thanks! -- Jagan. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: zynq: Add compile time boot mode override
On 08/28/2014 01:02 PM, Peter Crosthwaite wrote: Ping! On Wed, Aug 20, 2014 at 10:14 PM, Peter Crosthwaite crosthwaitepe...@gmail.com wrote: To better enable debug of u-boot itself (in particular SPL). To debug u-boot you want to put your board in JTAG boot mode for quick recompile and elf downloads via the JTAG debugger. Yet you may still want to boot from a persistent storage media (SD or QSPI). Allow override of the boot mode pins to facilitate this. Signed-off-by: Peter Crosthwaite crosthwaite.pe...@gmail.com --- arch/arm/cpu/armv7/zynq/slcr.c | 4 doc/README.zynq| 6 ++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/cpu/armv7/zynq/slcr.c b/arch/arm/cpu/armv7/zynq/slcr.c index 934ccc3..26e02b8 100644 --- a/arch/arm/cpu/armv7/zynq/slcr.c +++ b/arch/arm/cpu/armv7/zynq/slcr.c @@ -155,8 +155,12 @@ void zynq_slcr_devcfg_enable(void) u32 zynq_slcr_get_boot_mode(void) { +#ifdef CONFIG_ZYNQ_BM_FORCE + return CONFIG_ZYNQ_BM_FORCE; +#else /* Get the bootmode register value */ return readl(slcr_base-boot_mode); +#endif } u32 zynq_slcr_get_idcode(void) diff --git a/doc/README.zynq b/doc/README.zynq index 043c970..70be7ae 100644 --- a/doc/README.zynq +++ b/doc/README.zynq @@ -52,6 +52,12 @@ board_late_init() will read the bootmode values using slcr bootmode register at runtime and assign the modeboot variable to specific bootmode string which is intern used in autoboot. +This value can be overridden at compile time with the define +CONFIG_ZYNQ_BM_FORCE. This is useful for debugging a u-boot elf downloaded +over JTAG. E.g. The board will be jumpered for ZYNQ_BM_JTAG, but you can +force u-boot to attempt an SD or QSPI boot should that be what you want to +debug. + I understand the purpose of this patch but I don't think it is useful to add and support this option. Someone else could come with reading GPIO for this purpose, etc which is just the same case. I am happy to add the patch which shows bootmode register content or any ? : logic around in debug() print but adding new CONFIG_ option is just too much. (Also every new config option should be properly documented). The second option is to setup spl_boot_device in arch zynq as weak function and overwrite it. Then you can setup whatever you like in your board file. Thanks, Michal signature.asc Description: OpenPGP digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: zynq: Add compile time boot mode override
On 28 August 2014 17:28, Michal Simek michal.si...@xilinx.com wrote: On 08/28/2014 01:02 PM, Peter Crosthwaite wrote: Ping! On Wed, Aug 20, 2014 at 10:14 PM, Peter Crosthwaite crosthwaitepe...@gmail.com wrote: To better enable debug of u-boot itself (in particular SPL). To debug u-boot you want to put your board in JTAG boot mode for quick recompile and elf downloads via the JTAG debugger. Yet you may still want to boot from a persistent storage media (SD or QSPI). Allow override of the boot mode pins to facilitate this. Signed-off-by: Peter Crosthwaite crosthwaite.pe...@gmail.com --- arch/arm/cpu/armv7/zynq/slcr.c | 4 doc/README.zynq| 6 ++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/cpu/armv7/zynq/slcr.c b/arch/arm/cpu/armv7/zynq/slcr.c index 934ccc3..26e02b8 100644 --- a/arch/arm/cpu/armv7/zynq/slcr.c +++ b/arch/arm/cpu/armv7/zynq/slcr.c @@ -155,8 +155,12 @@ void zynq_slcr_devcfg_enable(void) u32 zynq_slcr_get_boot_mode(void) { +#ifdef CONFIG_ZYNQ_BM_FORCE + return CONFIG_ZYNQ_BM_FORCE; +#else /* Get the bootmode register value */ return readl(slcr_base-boot_mode); +#endif } u32 zynq_slcr_get_idcode(void) diff --git a/doc/README.zynq b/doc/README.zynq index 043c970..70be7ae 100644 --- a/doc/README.zynq +++ b/doc/README.zynq @@ -52,6 +52,12 @@ board_late_init() will read the bootmode values using slcr bootmode register at runtime and assign the modeboot variable to specific bootmode string which is intern used in autoboot. +This value can be overridden at compile time with the define +CONFIG_ZYNQ_BM_FORCE. This is useful for debugging a u-boot elf downloaded +over JTAG. E.g. The board will be jumpered for ZYNQ_BM_JTAG, but you can +force u-boot to attempt an SD or QSPI boot should that be what you want to +debug. + I understand the purpose of this patch but I don't think it is useful to add and support this option. Someone else could come with reading GPIO for this purpose, etc which is just the same case. I am happy to add the patch which shows bootmode register content or any ? : logic around in debug() print but adding new CONFIG_ option is just too much. (Also every new config option should be properly documented). The second option is to setup spl_boot_device in arch zynq as weak function and overwrite it. Then you can setup whatever you like in your board file. Agreed with Michal, this looks hack to macro, where u can get different elf for with and without that macro. May be we can add one env like zynq_bm_force on ENV_SETTINGS of our board file for selecting the respective bootmode at runtime. thanks! -- Jagan. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] common: fix compiler warning on wrong printf format
On Wed, Aug 27, 2014 at 10:27:19AM +1200, Chris Packham wrote: On Wed, Aug 27, 2014 at 2:02 AM, Alexey Brodkin alexey.brod...@synopsys.com wrote: bounce_buffer-len_aligned is of type size_t, but on some arches/compilers size_t might be an alias to whether int, long or their signed/unsigned flavors. So to make compiler happy we explicitly cast to int which is expected in printf for %d format. this fixes following warning: -- common/bouncebuf.c: In function ‘addr_aligned’: common/bouncebuf.c:26:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ [-Wformat=] debug(Unaligned buffer length %d\n, /*(int)*/state-len); ^ -- Signed-off-by: Alexey Brodkin abrod...@synopsys.com Cc: Vasili Galka vvv...@gmail.com Cc: Tom Rini tr...@ti.com --- common/bouncebuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/bouncebuf.c b/common/bouncebuf.c index 9eece6d..0828d4b 100644 --- a/common/bouncebuf.c +++ b/common/bouncebuf.c @@ -23,7 +23,7 @@ static int addr_aligned(struct bounce_buffer *state) /* Check if length is aligned */ if (state-len != state-len_aligned) { - debug(Unaligned buffer length %d\n, state-len); + debug(Unaligned buffer length %d\n, (int)state-len); Another way of fixing this would be to use %zu or %zd instead of %d. Although that is a C99 addition so I'm not sure how much people care about really old compilers. And %zd has other usages in the codebase so please use that, thanks. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 6/8] ARMv8: PSCI: Fixup the device tree for PSCI v0.2
Hi, On Wed, Aug 27, 2014 at 09:29:59PM +0100, Arnab Basu wrote: Set the enable-method in the cpu node to psci, create the psci device tree node and also add a reserve section for the psci code that lives in in normal RAM, so that the kernel leaves it alone Signed-off-by: Arnab Basu arnab.b...@freescale.com Reviewed-by: Bhupesh Sharma bhupesh.sha...@freescale.com Cc: Marc Zyngier marc.zyng...@arm.com --- arch/arm/cpu/armv8/cpu-dt.c | 67 + arch/arm/include/asm/system.h |4 ++ 2 files changed, 71 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv8/cpu-dt.c b/arch/arm/cpu/armv8/cpu-dt.c index 9792bc0..c2c8fe7 100644 --- a/arch/arm/cpu/armv8/cpu-dt.c +++ b/arch/arm/cpu/armv8/cpu-dt.c @@ -9,7 +9,69 @@ #include fdt_support.h #ifdef CONFIG_MP +#ifdef CONFIG_ARMV8_PSCI +static void psci_reserve_mem(void *fdt) +{ +#ifndef CONFIG_ARMV8_SECURE_BASE + /* secure code lives in RAM, keep it alive */ + fdt_add_mem_rsv(fdt, (unsigned long)__secure_start, + __secure_end - __secure_start); +#endif +} With PSCI I'd be worried about telling the OS about this memory at all. If the OS maps the memory we could encounter issues with mismatched aliases and/or unexpected hits in the D-cache, which can result in a loss of ordering and/or visbility guarantees, which could break the PSCI implementation. With the KVM or trusted firmware PSCI implementations the (guest) OS cannot map the implementation's memory, preventing such problems. The arm64 Linux boot-wrapper is dodgy in this regard currently. +static int cpu_update_dt_psci(void *fdt) +{ + int nodeoff; + int tmp; + + psci_reserve_mem(fdt); + + nodeoff = fdt_path_offset(fdt, /cpus); + if (nodeoff 0) { + printf(couldn't find /cpus\n); + return nodeoff; + } + + /* add 'enable-method = psci' to each cpu node */ + for (tmp = fdt_first_subnode(fdt, nodeoff); + tmp = 0; + tmp = fdt_next_subnode(fdt, tmp)) { + const struct fdt_property *prop; + int len; + + prop = fdt_get_property(fdt, tmp, device_type, len); + if (!prop) + continue; + if (len 4) + continue; + if (strcmp(prop-data, cpu)) + continue; + + fdt_setprop_string(fdt, tmp, enable-method, psci); Do we need to check the return code here, as we do when setting up the psci node? + } + + nodeoff = fdt_path_offset(fdt, /psci); We might need to search by compatible string. All psci nodes so far have been called /psci, but that's not guaranteed. Linux looks for nodes compatible with arm,psci and/or arm,psci-0.2. + if (nodeoff 0) { + nodeoff = fdt_path_offset(fdt, /); + if (nodeoff 0) + return nodeoff; + + nodeoff = fdt_add_subnode(fdt, nodeoff, psci); + if (nodeoff 0) + return nodeoff; + } + + tmp = fdt_setprop_string(fdt, nodeoff, compatible, arm,psci-0.2); + if (tmp) + return tmp; + tmp = fdt_setprop_string(fdt, nodeoff, method, smc); + if (tmp) + return tmp; + + return 0; +} Otherwise this looks fine. Mark. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/8] ARM: PSCI: Alow arch specific DT patching
On Thu, Aug 28, 2014 at 11:51:08AM +0100, Arnab Basu wrote: Hi Mark On 08/28/2014 03:40 PM, Mark Rutland wrote: Hi Arnab, On Wed, Aug 27, 2014 at 09:29:55PM +0100, Arnab Basu wrote: Both ARMv7 and ARMv8 need to patch the device tree but the kind of patching done is different. This creates a function that can be defined by each architecture to handle the differences I have no problem with the patch, but what is it that we need to do differently for ARMv7 and ARMv8? In ARMv7 there does not seem to be any code around to set enable-method to spin-table. I guess it is assumed that DTs already come with this set. That'll be a consequence of partial conversion frmo board file on the 32-bit side. For most platforms the SMP boot mechanism is still implicit. For ARMv8 we would like to assume that enable-method is missing from the cpu node and will be set either to spin-table or psci by the boot loader. Sounds good to me. So the difference is, for ARMv7 the enable-method is only modified in case of PSCI, whereas for ARMv8 it is always modified. Ok. Thanks for the description. :) Mark. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v9 0/14] Add some missing buildman features and deprecate MAKEALL
On Tue, Aug 26, 2014 at 08:54:03PM -0600, Simon Glass wrote: Hi Tom, On 25 August 2014 14:21, Tom Rini tr...@ti.com wrote: On Mon, Aug 25, 2014 at 01:00:05PM -0600, Simon Glass wrote: Hi Tom, On 25 August 2014 12:54, Tom Rini tr...@ti.com wrote: On Mon, Aug 25, 2014 at 09:58:21AM -0600, Simon Glass wrote: Buildman has been around for a little over a year and is used by a fair number of U-Boot developers. However quite a few people still use MAKEALL. Buildman was intended to replace MAKEALL, so perhaps now is a good time to start that process. The reasons to deprecate MAKEALL are: - We don't want to maintain two build systems - Buildman is typically faster - Buildman has a lot more features This series adds a few features to buildman to fill some gaps, adds some information into the README on how to migrate from MAKEALL, and adds a deprecation message to MAKEALL. I'm testing this out again in the Ubuntu 10.04 / LSF environment I have access to but so far I'm still finding that test for --no-decorate isn't working and I have to manually set it to False. Oh dear. I wrote a test for this in the second series. So if you apply that series, do the tests pass? It is in func_test.py and is called testGitSetup(). With my local kludge removed yes, all tests pass. It's quite mysterious. I installed Ubuntu 10.04 and it runs python 2.6.5. The --no-decorate patch does work, although it does print an error. I could suppress that easily enough, just adding another arg 'capture_stderr=True' to the RunPipe() call in gitutil.py.Setup(). I see a problem with timedelta not having total_seconds. After that the threading dies. So I'm quite impressed you can get buildman to run at all. Are you using one of the later 10.04 releases? *shakes fist at corporate IT* The box I use to launch jobs is Ubuntu 10.04.4. The boxes the jobs run on are actually Ubuntu 12.04.1 (I had assumed it was all the same for some reason. They also have git 1.7.9.5. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v9 11/14] buildman: Add an option to show which boards caused which errors
On Tue, Aug 26, 2014 at 08:59:52PM -0600, Simon Glass wrote: Hi Tom, On 25 August 2014 13:14, Tom Rini tr...@ti.com wrote: On Mon, Aug 25, 2014 at 09:58:32AM -0600, Simon Glass wrote: Add a -l option to display a list of offending boards against each error/warning line. The information will be shown in brackets as below: 02: wip sandbox: + sandbox arm: + seaboard +(sandbox) arch/sandbox/cpu/cpu.c: In function 'timer_get_us': +(sandbox) arch/sandbox/cpu/cpu.c:40:9: warning: unused variable 'i' [-Wunused-variable] +(seaboard) board/nvidia/seaboard/seaboard.c: In function 'pin_mux_mmc': +(seaboard) board/nvidia/seaboard/seaboard.c:36:9: warning: unused variable 'fred' [-Wunused-variable] +(seaboard) int fred; +(seaboard) ^ Signed-off-by: Simon Glass s...@chromium.org Doing buildman ... ; buildman ... -svl (since I want to spit out the summary at once due to how LSF mangles output to file), I don't see What is -s? summary. anything for what caused powerpc failures say (where there's lot of things complaining about generic board). So something isn't right, is this something you can reproduce locally? I'm going to make sure that -e really is implied like the doc says. Thanks! ./tools/buildman/buildman -vl sandbox Building current source for 1 boards (1 thread, 4 jobs per thread) sandbox: + sandbox +(sandbox) arch/sandbox/cpu/cpu.c: In function ‘__udelay’: +(sandbox) arch/sandbox/cpu/cpu.c:36:5: error: unknown type name ‘oijew’ +(sandbox) arch/sandbox/cpu/cpu.c:37:2: error: conflicting types for ‘os_usleep’ +(sandbox) include/os.h:155:6: note: previous declaration of ‘os_usleep’ was here +(sandbox) make[2]: *** [arch/sandbox/cpu/cpu.o] Error 1 +(sandbox) make[1]: *** [arch/sandbox/cpu] Error 2 +(sandbox) make: *** [sub-make] Error 2 w+(sandbox) arch/sandbox/cpu/cpu.c: In function ‘do_reset’: w+(sandbox) arch/sandbox/cpu/cpu.c:27:13: warning: unused variable ‘i’ [-Wunused-variable] w+(sandbox) arch/sandbox/cpu/cpu.c:37:2: warning: parameter names (without types) in function declaration [enabled by default] 001 /1 sandbox This shows warnings and errors, and -e is implied (but note you should test with both series - I pushed 'buildman5' to u-boot-x86.git just in case you only have one). I might be able to repeat your problem, except for the LSF part. What command line are you using? I do: ./tools/buildman/buildman -b master -c 1 -T 1 -j 24 \ -o /tmp/trini/eldk521 -G ~/.buildman.eldk521 'arm|powerpc' ./tools/buildman/buildman -b master -c 1 -T 1 -j 24 \ -o /tmp/trini/eldk521 -G ~/.buildman.eldk521 'arm|powerpc' -svel Doing '-svl' would omit the information I expected, adding in -e worked. I do it this way since LSF only lets me log raw stdout to a file so doing a build then a summary pass gives me more easily readable output. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: zynq: Add compile time boot mode override
On Thu, Aug 28, 2014 at 10:05 PM, Jagan Teki jagannadh.t...@gmail.com wrote: On 28 August 2014 17:28, Michal Simek michal.si...@xilinx.com wrote: On 08/28/2014 01:02 PM, Peter Crosthwaite wrote: Ping! On Wed, Aug 20, 2014 at 10:14 PM, Peter Crosthwaite crosthwaitepe...@gmail.com wrote: To better enable debug of u-boot itself (in particular SPL). To debug u-boot you want to put your board in JTAG boot mode for quick recompile and elf downloads via the JTAG debugger. Yet you may still want to boot from a persistent storage media (SD or QSPI). Allow override of the boot mode pins to facilitate this. Signed-off-by: Peter Crosthwaite crosthwaite.pe...@gmail.com --- arch/arm/cpu/armv7/zynq/slcr.c | 4 doc/README.zynq| 6 ++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/cpu/armv7/zynq/slcr.c b/arch/arm/cpu/armv7/zynq/slcr.c index 934ccc3..26e02b8 100644 --- a/arch/arm/cpu/armv7/zynq/slcr.c +++ b/arch/arm/cpu/armv7/zynq/slcr.c @@ -155,8 +155,12 @@ void zynq_slcr_devcfg_enable(void) u32 zynq_slcr_get_boot_mode(void) { +#ifdef CONFIG_ZYNQ_BM_FORCE + return CONFIG_ZYNQ_BM_FORCE; +#else /* Get the bootmode register value */ return readl(slcr_base-boot_mode); +#endif } u32 zynq_slcr_get_idcode(void) diff --git a/doc/README.zynq b/doc/README.zynq index 043c970..70be7ae 100644 --- a/doc/README.zynq +++ b/doc/README.zynq @@ -52,6 +52,12 @@ board_late_init() will read the bootmode values using slcr bootmode register at runtime and assign the modeboot variable to specific bootmode string which is intern used in autoboot. +This value can be overridden at compile time with the define +CONFIG_ZYNQ_BM_FORCE. This is useful for debugging a u-boot elf downloaded +over JTAG. E.g. The board will be jumpered for ZYNQ_BM_JTAG, but you can +force u-boot to attempt an SD or QSPI boot should that be what you want to +debug. + I understand the purpose of this patch but I don't think it is useful to add and support this option. Someone else could come with reading GPIO for this purpose, etc which is just the same case. I am happy to add the patch which shows bootmode register content or any ? : logic around in debug() print but adding new CONFIG_ option is just too much. (Also every new config option should be properly documented). The second option is to setup spl_boot_device in arch zynq as weak function and overwrite it. Then you can setup whatever you like in your board file. Agreed with Michal, this looks hack to macro, where u can get different elf for with and without that macro. May be we can add one env like zynq_bm_force on ENV_SETTINGS of our board file for selecting the respective bootmode at runtime. That might help for the fuller versions of u-boot but im trying for a super lightweight SPL (less than 64k for all sections, hopefully 32k) so the goal was to have all env parsing code paths removed. Regards, Peter thanks! -- Jagan. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: zynq: Add compile time boot mode override
On Thu, Aug 28, 2014 at 9:58 PM, Michal Simek michal.si...@xilinx.com wrote: On 08/28/2014 01:02 PM, Peter Crosthwaite wrote: Ping! On Wed, Aug 20, 2014 at 10:14 PM, Peter Crosthwaite crosthwaitepe...@gmail.com wrote: To better enable debug of u-boot itself (in particular SPL). To debug u-boot you want to put your board in JTAG boot mode for quick recompile and elf downloads via the JTAG debugger. Yet you may still want to boot from a persistent storage media (SD or QSPI). Allow override of the boot mode pins to facilitate this. Signed-off-by: Peter Crosthwaite crosthwaite.pe...@gmail.com --- arch/arm/cpu/armv7/zynq/slcr.c | 4 doc/README.zynq| 6 ++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/cpu/armv7/zynq/slcr.c b/arch/arm/cpu/armv7/zynq/slcr.c index 934ccc3..26e02b8 100644 --- a/arch/arm/cpu/armv7/zynq/slcr.c +++ b/arch/arm/cpu/armv7/zynq/slcr.c @@ -155,8 +155,12 @@ void zynq_slcr_devcfg_enable(void) u32 zynq_slcr_get_boot_mode(void) { +#ifdef CONFIG_ZYNQ_BM_FORCE + return CONFIG_ZYNQ_BM_FORCE; +#else /* Get the bootmode register value */ return readl(slcr_base-boot_mode); +#endif } u32 zynq_slcr_get_idcode(void) diff --git a/doc/README.zynq b/doc/README.zynq index 043c970..70be7ae 100644 --- a/doc/README.zynq +++ b/doc/README.zynq @@ -52,6 +52,12 @@ board_late_init() will read the bootmode values using slcr bootmode register at runtime and assign the modeboot variable to specific bootmode string which is intern used in autoboot. +This value can be overridden at compile time with the define +CONFIG_ZYNQ_BM_FORCE. This is useful for debugging a u-boot elf downloaded +over JTAG. E.g. The board will be jumpered for ZYNQ_BM_JTAG, but you can +force u-boot to attempt an SD or QSPI boot should that be what you want to +debug. + I understand the purpose of this patch but I don't think it is useful to add and support this option. Someone else could come with reading GPIO for this purpose, etc which is just the same case. I am happy to add the patch which shows bootmode register content or any ? : logic around in debug() print but adding new CONFIG_ option is just too much. (Also every new config option should be properly documented). I'm not sure what this adds? Where does the debug print get involved? The second option is to setup spl_boot_device in arch zynq as weak function and overwrite it. Then you can setup whatever you like in your board file. Sounds like the winning compromise. Regards, Peter Thanks, Michal ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: zynq: Add compile time boot mode override
On 08/28/2014 02:51 PM, Peter Crosthwaite wrote: On Thu, Aug 28, 2014 at 9:58 PM, Michal Simek michal.si...@xilinx.com wrote: On 08/28/2014 01:02 PM, Peter Crosthwaite wrote: Ping! On Wed, Aug 20, 2014 at 10:14 PM, Peter Crosthwaite crosthwaitepe...@gmail.com wrote: To better enable debug of u-boot itself (in particular SPL). To debug u-boot you want to put your board in JTAG boot mode for quick recompile and elf downloads via the JTAG debugger. Yet you may still want to boot from a persistent storage media (SD or QSPI). Allow override of the boot mode pins to facilitate this. Signed-off-by: Peter Crosthwaite crosthwaite.pe...@gmail.com --- arch/arm/cpu/armv7/zynq/slcr.c | 4 doc/README.zynq| 6 ++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/cpu/armv7/zynq/slcr.c b/arch/arm/cpu/armv7/zynq/slcr.c index 934ccc3..26e02b8 100644 --- a/arch/arm/cpu/armv7/zynq/slcr.c +++ b/arch/arm/cpu/armv7/zynq/slcr.c @@ -155,8 +155,12 @@ void zynq_slcr_devcfg_enable(void) u32 zynq_slcr_get_boot_mode(void) { +#ifdef CONFIG_ZYNQ_BM_FORCE + return CONFIG_ZYNQ_BM_FORCE; +#else /* Get the bootmode register value */ return readl(slcr_base-boot_mode); +#endif } u32 zynq_slcr_get_idcode(void) diff --git a/doc/README.zynq b/doc/README.zynq index 043c970..70be7ae 100644 --- a/doc/README.zynq +++ b/doc/README.zynq @@ -52,6 +52,12 @@ board_late_init() will read the bootmode values using slcr bootmode register at runtime and assign the modeboot variable to specific bootmode string which is intern used in autoboot. +This value can be overridden at compile time with the define +CONFIG_ZYNQ_BM_FORCE. This is useful for debugging a u-boot elf downloaded +over JTAG. E.g. The board will be jumpered for ZYNQ_BM_JTAG, but you can +force u-boot to attempt an SD or QSPI boot should that be what you want to +debug. + I understand the purpose of this patch but I don't think it is useful to add and support this option. Someone else could come with reading GPIO for this purpose, etc which is just the same case. I am happy to add the patch which shows bootmode register content or any ? : logic around in debug() print but adding new CONFIG_ option is just too much. (Also every new config option should be properly documented). I'm not sure what this adds? Where does the debug print get involved? I expect when you start to debug things the first thing you do is #define DEBUG which convert all debug() to printf() and you can see more verbose logs. From that logs you will see what SPL does and having one log about choosing boot mode can be helpful. The second option is to setup spl_boot_device in arch zynq as weak function and overwrite it. Then you can setup whatever you like in your board file. Sounds like the winning compromise. Great. Please send the patch for it. Thanks, Michal signature.asc Description: OpenPGP digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [U-boot] [Patch] keystone2: use readl/writel functions instead of redefinition
There is no reason to redefine pure readl/writel functions. So remove this redundancy. Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com Acked-by: Vitaly Andrianov vita...@ti.com --- Based on [U-boot] [Patch] ARM: keystone: clock: use correct BWADJ field mask for PASSPLLCTL0 http://lists.denx.de/pipermail/u-boot/2014-August/186008.html arch/arm/cpu/armv7/keystone/psc.c | 44 +++--- arch/arm/include/asm/arch-keystone/emac_defs.h | 7 ++-- drivers/net/keystone_net.c | 35 +--- 3 files changed, 36 insertions(+), 50 deletions(-) diff --git a/arch/arm/cpu/armv7/keystone/psc.c b/arch/arm/cpu/armv7/keystone/psc.c index fa5422f..237e776 100644 --- a/arch/arm/cpu/armv7/keystone/psc.c +++ b/arch/arm/cpu/armv7/keystone/psc.c @@ -13,9 +13,6 @@ #include asm/processor.h #include asm/arch/psc_defs.h -#define DEVICE_REG32_R(addr) __raw_readl((u32 *)(addr)) -#define DEVICE_REG32_W(addr, val) __raw_writel(val, (u32 *)(addr)) - int psc_delay(void) { udelay(10); @@ -51,7 +48,7 @@ int psc_wait(u32 domain_num) retry = 0; do { - ptstat = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_PSTAT); + ptstat = __raw_readl(KS2_PSC_BASE + PSC_REG_PSTAT); ptstat = ptstat (1 domain_num); } while ((ptstat != 0) ((retry += psc_delay()) PSC_PTSTAT_TIMEOUT_LIMIT)); @@ -67,8 +64,7 @@ u32 psc_get_domain_num(u32 mod_num) u32 domain_num; /* Get the power domain associated with the module number */ - domain_num = DEVICE_REG32_R(KS2_PSC_BASE + - PSC_REG_MDCFG(mod_num)); + domain_num = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCFG(mod_num)); domain_num = PSC_REG_MDCFG_GET_PD(domain_num); return domain_num; @@ -102,7 +98,7 @@ int psc_set_state(u32 mod_num, u32 state) * Get the power domain associated with the module number, and reset * isolation functionality */ - v = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_MDCFG(mod_num)); + v = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCFG(mod_num)); domain_num = PSC_REG_MDCFG_GET_PD(v); reset_iso = PSC_REG_MDCFG_GET_RESET_ISO(v); @@ -119,24 +115,22 @@ int psc_set_state(u32 mod_num, u32 state) * change is made if the new state is power down. */ if (state == PSC_REG_VAL_MDCTL_NEXT_ON) { - pdctl = DEVICE_REG32_R(KS2_PSC_BASE + - PSC_REG_PDCTL(domain_num)); + pdctl = __raw_readl(KS2_PSC_BASE + PSC_REG_PDCTL(domain_num)); pdctl = PSC_REG_PDCTL_SET_NEXT(pdctl, PSC_REG_VAL_PDCTL_NEXT_ON); - DEVICE_REG32_W(KS2_PSC_BASE + PSC_REG_PDCTL(domain_num), - pdctl); + __raw_writel(pdctl, KS2_PSC_BASE + PSC_REG_PDCTL(domain_num)); } /* Set the next state for the module to enabled/disabled */ - mdctl = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num)); + mdctl = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num)); mdctl = PSC_REG_MDCTL_SET_NEXT(mdctl, state); mdctl = PSC_REG_MDCTL_SET_RESET_ISO(mdctl, reset_iso); - DEVICE_REG32_W(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num), mdctl); + __raw_writel(mdctl, KS2_PSC_BASE + PSC_REG_MDCTL(mod_num)); /* Trigger the enable */ - ptcmd = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_PTCMD); + ptcmd = __raw_readl(KS2_PSC_BASE + PSC_REG_PTCMD); ptcmd |= (u32)(1domain_num); - DEVICE_REG32_W(KS2_PSC_BASE + PSC_REG_PTCMD, ptcmd); + __raw_writel(ptcmd, KS2_PSC_BASE + PSC_REG_PTCMD); /* Wait on the complete */ return psc_wait(domain_num); @@ -157,7 +151,7 @@ int psc_enable_module(u32 mod_num) u32 mdctl; /* Set the bit to apply reset */ - mdctl = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num)); + mdctl = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num)); if ((mdctl 0x3f) == PSC_REG_VAL_MDSTAT_STATE_ON) return 0; @@ -176,11 +170,11 @@ int psc_disable_module(u32 mod_num) u32 mdctl; /* Set the bit to apply reset */ - mdctl = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num)); + mdctl = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num)); if ((mdctl 0x3f) == 0) return 0; mdctl = PSC_REG_MDCTL_SET_LRSTZ(mdctl, 0); - DEVICE_REG32_W(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num), mdctl); + __raw_writel(mdctl, KS2_PSC_BASE + PSC_REG_MDCTL(mod_num)); return psc_set_state(mod_num, PSC_REG_VAL_MDCTL_NEXT_SWRSTDISABLE); } @@ -199,11 +193,11 @@ int psc_set_reset_iso(u32 mod_num) u32 mdctl; /* Set the reset isolation bit */ - mdctl = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num)); + mdctl =
[U-Boot] [PATCH v2] common: fix compiler warning on wrong printf format
From: Alexey Brodkin alexey.brod...@synopsys.com bounce_buffer-len_aligned is of type size_t so use %zd. this fixes following warning: -- common/bouncebuf.c: In function addr_aligned: common/bouncebuf.c:26:3: warning: format %d expects argument of type int, but argument 2 has type size_t [-Wformat=] debug(Unaligned buffer length %d\n, /*(int)*/state-len); ^ -- Signed-off-by: Alexey Brodkin abrod...@synopsys.com Cc: Vasili Galka vvv...@gmail.com Cc: Tom Rini tr...@ti.com cc: Chris Packham judge.pack...@gmail.com --- Compared to v1 proper format (%zd) is used in string instead of type casting. --- common/bouncebuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/bouncebuf.c b/common/bouncebuf.c index 9eece6d..8dde8fd 100644 --- a/common/bouncebuf.c +++ b/common/bouncebuf.c @@ -23,7 +23,7 @@ static int addr_aligned(struct bounce_buffer *state) /* Check if length is aligned */ if (state-len != state-len_aligned) { - debug(Unaligned buffer length %d\n, state-len); + debug(Unaligned buffer length %zd\n, state-len); return 0; } -- 1.9.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Added support for comments in input to mkenvimage.
From 4877c78a6b11ebf90fe25376f1362b12d233797a Mon Sep 17 00:00:00 2001 From: Dominik Muth dominik.m...@bkvibro.com Date: Thu, 28 Aug 2014 12:25:27 +0200 Subject: [PATCH] Added support for comments in input to mkenvimage. This patch adds support for comments in the input to mkenvimage, i.e. in the environment source: All lines starting with a # in the firs column will be ignored. Additionally empty lines will also be ignored. Signed-off-by: Dominik Muth dominik.m...@bkvibro.com --- tools/mkenvimage.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c index bbd3041..4f75338 100644 --- a/tools/mkenvimage.c +++ b/tools/mkenvimage.c @@ -37,6 +37,8 @@ static void usage(const char *exec_name) \t\tkey1=value1\n \t\tkey2=value2\n \t\t...\n + \tEmpty lines are skipped, and lines with a # in the first\n + \tcolumn are treated as comments (also skipped).\n \t-r : the environment has multiple copies in flash\n \t-b : the target is big endian (default is little endian)\n \t-p byte : fill the image with byte bytes instead of 0xff bytes\n @@ -221,10 +223,9 @@ int main(int argc, char **argv) /* Replace newlines separating variables with \0 */ for (fp = 0, ep = 0 ; fp filesize ; fp++) { if (filebuf[fp] == '\n') { - if (ep == 0) { + if (fp == 0 || filebuf[fp-1] == '\n') { /* -* Newlines at the beginning of the file ? -* Ignore them. +* Skip empty lines. */ continue; } else if (filebuf[fp-1] == '\\') { @@ -240,6 +241,10 @@ int main(int argc, char **argv) /* End of a variable */ envptr[ep++] = '\0'; } + } else if ((fp == 0 || filebuf[fp-1] == '\n') filebuf[fp] == '#') { + /* Comment, skip the line. */ + while (++fp filesize filebuf[fp] != '\n') + continue; } else { envptr[ep++] = filebuf[fp]; } -- 1.7.9.5 Sitz der Gesellschaft / Registered Office: Darmstadt Handelsregister Darmstadt / Darmstadt Commercial Register No.: HRB 6803 Geschaeftsfuehrung / Managing Director: Torben Ekvall The Royal Bank of Scotland N.V., Frankfurt a.M., 1654012009 (BLZ 502 304 00) SWIFT-BIC: ABNADEFF FRA IBAN: DE21 5023 0400 1654 0120 09 UST-ID Nr. / UST-ID No.: DE 812 272 970 WEEE-Reg.-Nr. / WEEE-Reg.-No.: DE 69572330 Registered Office: Naerum Naerum Commercial Register No.: 15 38 05 94 Managing Director: Torben Ekvall Danske Bank, Account no.: 3001 3345212949 SWIFT Address: DABADKKK IBAN No.: DK94 3000 3345 2129 49 Der Inhalt dieser E-Mail ist ausschliesslich fuer den/die bezeichneten Empfaenger bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein sollen, so beachten Sie bitte, dass jede Form der Kenntnisnahme, Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieser E-Mail unzulaessig ist. Wir bitten Sie, sich in diesem Fall mit dem Absender der E-Mail oder telefonisch unter +49 (0) 6151 428-1100 in Verbindung zu setzen. This e-mail is confidential and may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +49 (0) 6151 428-1100. Please then delete the e-mail and do not disclose its contents to any person. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v5 0/4] Implement fastboot flash for eMMC
On Wed, Aug 27, 2014 at 09:04:09AM +0200, Lukasz Majewski wrote: Hi Steve, On 14-08-26 02:14 AM, Lukasz Majewski wrote: Hi Steve, On 14-08-25 07:57 AM, Lukasz Majewski wrote: Hi Steve, This series implements the fastboot flash command for eMMC devices. It supports both raw and sparse images. NOTES: - the support for the fastboot flash command is enabled with CONFIG_FASTBOOT_FLASH - the support for eMMC is enabled with CONFIG_FASTBOOT_FLASH_MMC_DEV - (future) the support for NAND would be enabled with CONFIG_FASTBOOT_FLASH_NAND(???) This has been tested on ARMv7. This series depends on: http://patchwork.ozlabs.org/patch/379438/ This patch is already applied. Correct (But it wasn't when I was preparing this) http://patchwork.ozlabs.org/patch/382443/ (to 382446) Could you resend the above patch series one more time? From the links it seems that in PATCH 1/4 you add the ./common/aboot.c file and at PATCH 2/4 you remove it. Is this done on purpose? yes: done on purpose (in order to see the history of the changes to the file) -- see the comments in the cover letter to that patch-series!!! Ok, Now it is clear. Is fair as I know bsd-3L-clause license is compatible with GPL. However, to be 100% sure I'd like to ask Tom (as he has much more legal experience than me) to confirm that this code can be added to u-boot. OK -- note that this bsd-3L-clause clause is almost identical to the existing bsd-3-clause Tom, could you give your opinion on this? So, upstream made a slight (and likely unintentional) change to the normal BSD 3 clause license and changed the last clause from the copyright holders to The Linux Foundation. I've poked our legal dept about this but I suspect the best answer is to go back up to Android folks and ask them to fix this quite likely unintentional change. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] common: fix compiler warning on wrong printf format
On Thu, Aug 28, 2014 at 4:15 PM, Alexey Brodkin alexey.brod...@synopsys.com wrote: From: Alexey Brodkin alexey.brod...@synopsys.com bounce_buffer-len_aligned is of type size_t so use %zd. this fixes following warning: -- common/bouncebuf.c: In function addr_aligned: common/bouncebuf.c:26:3: warning: format %d expects argument of type int, but argument 2 has type size_t [-Wformat=] debug(Unaligned buffer length %d\n, /*(int)*/state-len); ^ -- Signed-off-by: Alexey Brodkin abrod...@synopsys.com Cc: Vasili Galka vvv...@gmail.com Cc: Tom Rini tr...@ti.com cc: Chris Packham judge.pack...@gmail.com --- Compared to v1 proper format (%zd) is used in string instead of type casting. --- common/bouncebuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/bouncebuf.c b/common/bouncebuf.c index 9eece6d..8dde8fd 100644 --- a/common/bouncebuf.c +++ b/common/bouncebuf.c @@ -23,7 +23,7 @@ static int addr_aligned(struct bounce_buffer *state) /* Check if length is aligned */ if (state-len != state-len_aligned) { - debug(Unaligned buffer length %d\n, state-len); + debug(Unaligned buffer length %zd\n, state-len); return 0; } -- 1.9.3 Hmm, why not just use my original patch which included exactly this? http://patchwork.ozlabs.org/patch/383041/ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] common: fix compiler warning on wrong printf format
Hi Vasili, On Thu, 2014-08-28 at 17:17 +0300, Vasili Galka wrote: On Thu, Aug 28, 2014 at 4:15 PM, Alexey Brodkin alexey.brod...@synopsys.com wrote: From: Alexey Brodkin alexey.brod...@synopsys.com bounce_buffer-len_aligned is of type size_t so use %zd. this fixes following warning: -- common/bouncebuf.c: In function addr_aligned: common/bouncebuf.c:26:3: warning: format %d expects argument of type int, but argument 2 has type size_t [-Wformat=] debug(Unaligned buffer length %d\n, /*(int)*/state-len); ^ -- Hmm, why not just use my original patch which included exactly this? http://patchwork.ozlabs.org/patch/383041/ Well, I'm not following all the messages sent to this mailing list so didn't know about your patch. So as soon as I observed a problem I created a patch and sent it. I see your patch fixes more things so definitely it should be applied instead. Sorry for noise. -Alexey ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] buildman: suspect issue with patman tags
Hi Steve, On 27 August 2014 15:22, Steve Rae s...@broadcom.com wrote: Another issue may be related to the combined issue below) Five consecutive builds (with no changes between builds) (1)does not always generate the u-boot.bin file You need to use the -k option to keep the build outputs. Also the .bm-work directory is a temporary directory used by each thread for building. You shouldn't need to look in there. See this bit of the README: It is possible to get the build output there also. Use the -k option for this. In that case you will also see some output files, like: System.map toolchain u-boot u-boot.bin u-boot.map autoconf.mk (also SPL versions u-boot-spl and u-boot-spl.bin if available) (2)random error messages ?!?!? Do you mean the 'checkarmreloc'? Is there actually anything wrong with the binary produced? The comment in the Makefile says: # ARM relocations should all be R_ARM_RELATIVE (32-bit) or # R_AARCH64_RELATIVE (64-bit). Is anyone else seeing these issues? (please don't delete MAKEALL yet ) Don't worry, if everything is applied it will only have a deprecation message. We need to make sure all the issues are resolve first. Thanks, Steve srae@host1:~/work/to_denx$ tools/buildman/buildman bcm28155_ap No section: 'make-flags' Could not find ./boards.cfg Generating boards.cfg ... (jobs: 8) 1171/1171 [===] Building current source for 2 boards (2 threads, 4 jobs per thread) 002 /2 0:00:06 : bcm28155_ap srae@host1:~/work/to_denx$ find .. -name u-boot.[mb]* -exec ls -l {} \; -rw-r--r-- 1 srae srae 239004 Aug 26 15:34 ../current/.bm-work/00/build/u-boot.map -rw-r--r-- 1 srae srae 245242 Aug 26 15:34 ../current/.bm-work/01/build/u-boot.map -rw-r--r-- 1 srae srae 190100 Aug 26 15:34 ../current/.bm-work/01/build/u-boot.bin srae@host1:~/work/to_denx$ tools/buildman/buildman bcm28155_ap No section: 'make-flags' Building current source for 2 boards (2 threads, 4 jobs per thread) 002 /2 0:00:06 : bcm28155_w1d srae@host1:~/work/to_denx$ find .. -name u-boot.[mb]* -exec ls -l {} \; -rw-r--r-- 1 srae srae 239004 Aug 26 15:36 ../current/.bm-work/00/build/u-boot.map -rw-r--r-- 1 srae srae 245242 Aug 26 15:36 ../current/.bm-work/01/build/u-boot.map srae@host1:~/work/to_denx$ tools/buildman/buildman bcm28155_ap No section: 'make-flags' Building current source for 2 boards (2 threads, 4 jobs per thread) arm: + bcm28155_w1d +make[1]: *** [checkarmreloc] Error 1 +make: *** [sub-make] Error 2 002 /2 0:00:06 : bcm28155_ap srae@host1:~/work/to_denx$ find .. -name u-boot.[mb]* -exec ls -l {} \; -rw-r--r-- 1 srae srae 239004 Aug 26 15:37 ../current/.bm-work/00/build/u-boot.map -rw-r--r-- 1 srae srae 189744 Aug 26 15:37 ../current/.bm-work/00/build/u-boot.bin -rw-r--r-- 1 srae srae 245242 Aug 26 15:37 ../current/.bm-work/01/build/u-boot.map -rw-r--r-- 1 srae srae 190100 Aug 26 15:37 ../current/.bm-work/01/build/u-boot.bin srae@host1:~/work/to_denx$ tools/buildman/buildman bcm28155_ap No section: 'make-flags' Building current source for 2 boards (2 threads, 4 jobs per thread) arm: + bcm28155_w1d +make[1]: *** [checkarmreloc] Error 1 +make: *** [sub-make] Error 2 002 /2 0:00:06 : bcm28155_ap srae@host1:~/work/to_denx$ find .. -name u-boot.[mb]* -exec ls -l {} \; -rw-r--r-- 1 srae srae 239004 Aug 26 15:37 ../current/.bm-work/00/build/u-boot.map -rw-r--r-- 1 srae srae 245242 Aug 26 15:37 ../current/.bm-work/01/build/u-boot.map -rw-r--r-- 1 srae srae 190100 Aug 26 15:37 ../current/.bm-work/01/build/u-boot.bin srae@host1:~/work/to_denx$ tools/buildman/buildman bcm28155_ap No section: 'make-flags' Building current source for 2 boards (2 threads, 4 jobs per thread) arm: + bcm28155_w1d +make[1]: *** [checkarmreloc] Error 1 +make: *** [sub-make] Error 2 002 /2 0:00:05 : bcm28155_w1d srae@host1:~/work/to_denx$ find .. -name u-boot.[mb]* -exec ls -l {} \; -rw-r--r-- 1 srae srae 239004 Aug 26 15:39 ../current/.bm-work/00/build/u-boot.map -rw-r--r-- 1 srae srae 245242 Aug 26 15:39 ../current/.bm-work/01/build/u-boot.map srae@host1:~/work/to_denx$ *From:*Steve Rae *Sent:* Monday, August 25, 2014 09:06 *To:* Simon Glass *Subject:* buildman: issue with patman tags Simon, When I combine multiple patch-series, each with their own patman tags in the commit messages, into a single branch... Then: $ tools/buildman/buildman -b combined bcm28155_ap No section: 'make-flags' Traceback (most recent call last): File tools/buildman/buildman, line 139, in module control.DoBuildman(options, args) File /home/srae/work/to_denx/tools/buildman/control.py, line 161, in DoBuildman options.git_dir, count) File /home/srae/work/to_denx/tools/buildman/../patman/patchstream.py, line 387, in GetMetaDataForList
Re: [U-Boot] [PATCH v2] common: fix compiler warning on wrong printf format
On Thu, Aug 28, 2014 at 5:33 PM, Alexey Brodkin alexey.brod...@synopsys.com wrote: Hi Vasili, On Thu, 2014-08-28 at 17:17 +0300, Vasili Galka wrote: On Thu, Aug 28, 2014 at 4:15 PM, Alexey Brodkin alexey.brod...@synopsys.com wrote: From: Alexey Brodkin alexey.brod...@synopsys.com bounce_buffer-len_aligned is of type size_t so use %zd. this fixes following warning: -- common/bouncebuf.c: In function addr_aligned: common/bouncebuf.c:26:3: warning: format %d expects argument of type int, but argument 2 has type size_t [-Wformat=] debug(Unaligned buffer length %d\n, /*(int)*/state-len); ^ -- Hmm, why not just use my original patch which included exactly this? http://patchwork.ozlabs.org/patch/383041/ Well, I'm not following all the messages sent to this mailing list so didn't know about your patch. So as soon as I observed a problem I created a patch and sent it. I see your patch fixes more things so definitely it should be applied instead. Sorry for noise. -Alexey Oh, I thought you Cc'ed me because you seen it but decided to fix it in alternative way. Never mind, MY applogies for the noise :-) Best, Vasili ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] buildman: selection question
Hi Steve, On 27 August 2014 15:23, Steve Rae s...@broadcom.com wrote: question: Two of the boards that I support are almost the same: Active arm armv7 bcm281xxbroadcom bcm28155_ap bcm28155_ap - Active arm armv7 bcm281xxbroadcom bcm28155_ap bcm28155_w1d bcm28155_ap:BCM_SF2_ETH,BCM_SF2_ETH_GMAC Using buildman how can I build the first one (without always building the second one too?) What command are you using? Are you trying to build bcm28155_ap? Maybe the only option is to use -x bcm28155_w1d to exclude it. You will need the latest series though: http://patchwork.ozlabs.org/patch/382769/ (or see u-boot-x86.git branch 'buildman5') Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Please pull u-boot-x86.git branch patman
Hi Tom, This is just for one commit which fixes patman, so it should be applied before we get to the other stuff. (branch 'patman') The following changes since commit 7bee1c91a94db19bd26f92cc67be35d3592c6429: Merge branch 'ag...@denx.de' of git://git.denx.de/u-boot-staging (2014-08-25 08:34:39 -0400) are available in the git repository at: http://git.denx.de/u-boot-x86.git for you to fetch changes up to 042a732cf50568e77a20c540341fccf28ba62bcf: patman: Support the 'reverse' option for 'git log' (2014-08-28 07:56:19 -0700) Simon Glass (1): patman: Support the 'reverse' option for 'git log' tools/patman/gitutil.py | 2 ++ 1 file changed, 2 insertions(+) Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v5, 2/5] lib, list_sort: add list_sort from linux 3.14
On Tue, Jun 24, 2014 at 10:10:01AM +0200, Heiko Schocher wrote: from linux 3.14: commit 455c6fdbd219161bd09b1165f11699d6d73de11c Author: Linus Torvalds torva...@linux-foundation.org Date: Sun Mar 30 20:40:15 2014 -0700 Linux 3.14 Needed for the MTD/UBI/UBIFS resync Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v5, 4/5] lib, linux: move linux specific defines to linux/compat.h
On Tue, Jun 24, 2014 at 10:10:03AM +0200, Heiko Schocher wrote: - move linux specific defines from usb and video code into linux/compat.h - move common linux specific defines from include/ubi_uboot.h to linux/compat.h - add for new mtd/ubi/ubifs sync new needed linux specific defines to linux/compat.h Signed-off-by: Heiko Schocher h...@denx.de Cc: Tom Rini tr...@ti.com Cc: Marek Vasut ma...@denx.de Cc: Anatolij Gustschin ag...@denx.de Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v5,1/5] lib, rbtree: resync with Linux-3.14
On Tue, Jun 24, 2014 at 10:10:00AM +0200, Heiko Schocher wrote: resync with linux: commit 455c6fdbd219161bd09b1165f11699d6d73de11c Author: Linus Torvalds torva...@linux-foundation.org Date: Sun Mar 30 20:40:15 2014 -0700 Linux 3.14 Needed for the MTD/UBI/UBIFS resync Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v5,3/5] linux include: add ERR_CAST
On Tue, Jun 24, 2014 at 10:10:02AM +0200, Heiko Schocher wrote: add missing ERR_CAST to linux/err.h as it is needed for ubi/ubifs support Signed-off-by: Heiko Schocher h...@denx.de Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 1/2] mtd, ubi, ubifs: update for the sync with linux v3.14
On Tue, Jul 15, 2014 at 04:08:42PM +0200, Heiko Schocher wrote: while playing with the new mtd/ubi/ubifs sync, found some small updates for it: - add del_mtd_partition() to include/linux/mtd/mtd - mtd: add a debug_printf - remove some not used functions Signed-off-by: Heiko Schocher h...@denx.de Cc: Scott Wood scottw...@freescale.com Cc: Tom Rini tr...@ti.com Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH] USB: get rid of warning when compile with debug enabled
On Wed, Aug 27, 2014 at 11:36:05PM +0200, Marek Vasut wrote: On Wednesday, August 27, 2014 at 11:20:45 PM, Tom Rini wrote: [...] This is about to be complicated / fixed by the NAND patches that I'm merging and pushing shortly, so hold on please! Can you please point out the exact patches ? Also, this is USB stuff, how can this be affected by any MTD stuff (unless there is a problem with patch separation) ? It's linux compat fun, http://patchwork.ozlabs.org/patch/36/ OK, please update this thread when you merge that patch . And Bo, can you please verify after that update if this issue was resolved please ? OK, Heiko's patch applied now. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v5, 5/5] mtd, ubi, ubifs: resync with Linux-3.14
On Tue, Jun 24, 2014 at 10:10:04AM +0200, Heiko Schocher wrote: resync ubi subsystem with linux: commit 455c6fdbd219161bd09b1165f11699d6d73de11c Author: Linus Torvalds torva...@linux-foundation.org Date: Sun Mar 30 20:40:15 2014 -0700 Linux 3.14 A nice side effect of this, is we introduce UBI Fastmap support to U-Boot. Signed-off-by: Heiko Schocher h...@denx.de Signed-off-by: Tom Rini tr...@ti.com Cc: Marek Vasut ma...@denx.de Cc: Sergey Lapin sla...@ossfans.org Cc: Scott Wood scottw...@freescale.com Cc: Joerg Krause jkra...@posteo.de Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Should ARM custodian tree pull-reqs still go through the ARM tree ?
On Tue, Aug 26, 2014 at 03:47:34PM +0200, Hans de Goede wrote: Hi All, Albert lately seems quite busy, and has a somewhat largish turn around time for things like pull-reqs. This mail is in no way intended as a complaint against Albert, we all have personal lives, and we all have periods were we are more busy then other periods in our lives. Agreed. But now that we've Kconfig, and thus no longer have the big bad conflict causing boards.cfg to deal with, I wonder if there is any added value in all ARM pull-reqs going through Albert's u-boot-arm tree ? I can understand that if some new ARM arch needs core changes that those then need to go through Albert's tree and that any dependent changes then need to be merged either after Albert's tree has been merged, or through Albert's tree. But for a lot of SoC specific work, e.g. stuff only touching files under arch/arm/cpu/armv7/sunxi and under board/sunxi, I really see no benefit in going through u-boot-arm, and I wonder if it would need be better to instead send pull-reqs for merging directly into u-boot/master. So, I don't take this lightly (I'd reached out to Albert a few days before this was sent out as well). For the moment at least, I'd like to take ARM sub-trees into master directly. And I ask that custodians run time test as much of their code as they can and be very clear if they're touching code that's not strictly within their domain. And I'll put on my I work at an ARM producing semiconductor vendor, I should be able to get some ARM questions answered if I can't figure it out and take some forms of more core ARM patches, depending on their need/complexity/etc. With that said, I'm going to take u-boot-arm/master and put it through some tests locally for build / run-time, and then start picking up patches. I'm thinking I'll extend my informal approach of posting public patchwork bundle links in #u-boot to posting the URL on the ML for a day or so as well. Thanks all! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v1,2/2] mtd,ubi,ubifs: sync with linux v3.15
On Tue, Jul 15, 2014 at 04:08:43PM +0200, Heiko Schocher wrote: snyc with linux v3.15: commit 1860e379875dfe7271c649058aeddffe5afd9d0d Author: Linus Torvalds torva...@linux-foundation.org Date: Sun Jun 8 11:19:54 2014 -0700 Linux 3.15 Signed-off-by: Heiko Schocher h...@denx.de Cc: Scott Wood scottw...@freescale.com Cc: Tom Rini tr...@ti.com Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v10 01/14] patman: Support the 'reverse' option for 'git log'
This option is currently not supported, but needs to be, for buildman to operate as expected. Reported-by: York Sun york...@freescale.com Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: - Add new patch to fix the 'reverse' bug Changes in v6: None Changes in v5: None tools/patman/gitutil.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index 735c8dd..e2b4959 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -38,6 +38,8 @@ def LogCmd(commit_range, git_dir=None, oneline=False, reverse=False, cmd.append('--oneline') if use_no_decorate: cmd.append('--no-decorate') +if reverse: +cmd.append('--reverse') if count is not None: cmd.append('-n%d' % count) if commit_range: -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v10 0/14] Add some missing buildman features and deprecate MAKEALL
Buildman has been around for a little over a year and is used by a fair number of U-Boot developers. However quite a few people still use MAKEALL. Buildman was intended to replace MAKEALL, so perhaps now is a good time to start that process. The reasons to deprecate MAKEALL are: - We don't want to maintain two build systems - Buildman is typically faster - Buildman has a lot more features This series adds a few features to buildman to fill some gaps, adds some information into the README on how to migrate from MAKEALL, and adds a deprecation message to MAKEALL. Changes in v10: - Remove the directory prefix more aggressively - Track prefixes and postfixes for warnings/errors Changes in v9: - Add new patch to avoid changing the order of tags - Add new patch to set the return code to indicate build result - Add new patch to allow make-flags variables to include '-' and '_' - Add new patch to implement --exclude option - Add new patch to remove the directory prefix from each error line - Add new patch to support showing which boards caused which errors - Add new patch to separate out display of warnings and errors - Add new patch to fix detection of git version Changes in v8: - Add new patch to disable the pager in git Changes in v7: - Add new patch to fix the 'reverse' bug - Remove already-applied patches from the series - Add the deprecation message at the end of the build also - Drop the 'colour' patch sadly Changes in v6: - Add new patch to fix indentation in teminal.py - Add new patch to fix patman unit tests - Add new patch to remove patman's -a option Changes in v5: - Drop patch to search for *cc instead of *gcc for the compiler Simon Glass (14): patman: Support the 'reverse' option for 'git log' patman: Fix indentation in terminal.py patman: Correct unit tests to run correctly patman: Remove the -a option patman: Use --no-pager' to stop git from forking a pager patman: Avoid changing the order of tags buildman: Set the return code to indicate build result buildman: Allow make-flags variables to include '-' and '_' buildman: Implement an option to exclude boards from the build buildman: Remove the directory prefix from each error line buildman: Add an option to show which boards caused which errors buildman: Separate out display of warnings and errors patman: Fix detection of git version RFC: Deprecate MAKEALL MAKEALL | 10 +++ tools/buildman/README | 27 ++-- tools/buildman/board.py | 31 +++-- tools/buildman/builder.py | 139 ++-- tools/buildman/builderthread.py | 4 +- tools/buildman/buildman.py | 8 ++- tools/buildman/control.py | 20 -- tools/buildman/toolchain.py | 2 +- tools/patman/gitutil.py | 102 +++-- tools/patman/patchstream.py | 21 ++ tools/patman/patman.py | 7 -- tools/patman/terminal.py| 112 +--- tools/patman/test.py| 13 ++-- 13 files changed, 286 insertions(+), 210 deletions(-) -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v10 04/14] patman: Remove the -a option
It seems that this is no longer needed, since checkpatch.pl will catch whitespace problems in patches. Also the option is not widely used, so it seems safe to just remove it. Suggested-by: Masahiro Yamada yamad...@jp.panasonic.com Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: - Add new patch to remove patman's -a option Changes in v5: None tools/patman/gitutil.py | 88 - tools/patman/patman.py | 7 2 files changed, 95 deletions(-) diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index 29e6fdd..45276e6 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -215,94 +215,6 @@ def CreatePatches(start, count, series): else: return None, files -def ApplyPatch(verbose, fname): -Apply a patch with git am to test it - -TODO: Convert these to use command, with stderr option - -Args: -fname: filename of patch file to apply - -col = terminal.Color() -cmd = ['git', 'am', fname] -pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, -stderr=subprocess.PIPE) -stdout, stderr = pipe.communicate() -re_error = re.compile('^error: patch failed: (.+):(\d+)') -for line in stderr.splitlines(): -if verbose: -print line -match = re_error.match(line) -if match: -print checkpatch.GetWarningMsg(col, 'warning', match.group(1), - int(match.group(2)), 'Patch failed') -return pipe.returncode == 0, stdout - -def ApplyPatches(verbose, args, start_point): -Apply the patches with git am to make sure all is well - -Args: -verbose: Print out 'git am' output verbatim -args: List of patch files to apply -start_point: Number of commits back from HEAD to start applying. -Normally this is len(args), but it can be larger if a start -offset was given. - -error_count = 0 -col = terminal.Color() - -# Figure out our current position -cmd = ['git', 'name-rev', 'HEAD', '--name-only'] -pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE) -stdout, stderr = pipe.communicate() -if pipe.returncode: -str = 'Could not find current commit name' -print col.Color(col.RED, str) -print stdout -return False -old_head = stdout.splitlines()[0] -if old_head == 'undefined': -str = Invalid HEAD '%s' % stdout.strip() -print col.Color(col.RED, str) -return False - -# Checkout the required start point -cmd = ['git', 'checkout', 'HEAD~%d' % start_point] -pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, -stderr=subprocess.PIPE) -stdout, stderr = pipe.communicate() -if pipe.returncode: -str = 'Could not move to commit before patch series' -print col.Color(col.RED, str) -print stdout, stderr -return False - -# Apply all the patches -for fname in args: -ok, stdout = ApplyPatch(verbose, fname) -if not ok: -print col.Color(col.RED, 'git am returned errors for %s: will ' -'skip this patch' % fname) -if verbose: -print stdout -error_count += 1 -cmd = ['git', 'am', '--skip'] -pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE) -stdout, stderr = pipe.communicate() -if pipe.returncode != 0: -print col.Color(col.RED, 'Unable to skip patch! Aborting...') -print stdout -break - -# Return to our previous position -cmd = ['git', 'checkout', old_head] -pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) -stdout, stderr = pipe.communicate() -if pipe.returncode: -print col.Color(col.RED, 'Could not move back to head commit') -print stdout, stderr -return error_count == 0 - def BuildEmailList(in_list, tag=None, alias=None, raise_on_error=True): Build a list of email addresses based on an input list. diff --git a/tools/patman/patman.py b/tools/patman/patman.py index ca34cb9..5ab74fa 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -25,9 +25,6 @@ import test parser = OptionParser() -parser.add_option('-a', '--no-apply', action='store_false', - dest='apply_patches', default=True, - help=Don't test-apply patches with git am) parser.add_option('-H', '--full-help', action='store_true', dest='full_help', default=False, help='Display the README file') parser.add_option('-c', '--count', dest='count', type='int', @@ -143,10 +140,6 @@ else: ok = checkpatch.CheckPatches(options.verbose, args) else: ok = True -if options.apply_patches: -if not
[U-Boot] [PATCH v10 11/14] buildman: Add an option to show which boards caused which errors
Add a -l option to display a list of offending boards against each error/warning line. The information will be shown in brackets as below: 02: wip sandbox: + sandbox arm: + seaboard +(sandbox) arch/sandbox/cpu/cpu.c: In function 'timer_get_us': +(sandbox) arch/sandbox/cpu/cpu.c:40:9: warning: unused variable 'i' [-Wunused-variable] +(seaboard) board/nvidia/seaboard/seaboard.c: In function 'pin_mux_mmc': +(seaboard) board/nvidia/seaboard/seaboard.c:36:9: warning: unused variable 'fred' [-Wunused-variable] +(seaboard) int fred; +(seaboard) ^ Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: - Add new patch to support showing which boards caused which errors Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None tools/buildman/README | 7 --- tools/buildman/builder.py | 51 ++ tools/buildman/buildman.py | 2 ++ tools/buildman/control.py | 3 ++- 4 files changed, 50 insertions(+), 13 deletions(-) diff --git a/tools/buildman/README b/tools/buildman/README index b8c2bd6..fbc8449 100644 --- a/tools/buildman/README +++ b/tools/buildman/README @@ -442,7 +442,8 @@ is fixed, but there is a new one at line 126. This is probably only because we added some code and moved the broken line father down the file. If many boards have the same error, then -e will display the error only -once. This makes the output as concise as possible. +once. This makes the output as concise as possible. To see which boards have +each error, use -l. The full build output in this case is available in: @@ -745,10 +746,10 @@ followed by (afterwards, or perhaps concurrently in another terminal): to see the results of the build. Rather than showing you all the output, buildman just shows a summary, with red indicating that a commit introduced an error and green indicating that a commit fixed an error. Use the -e -flag to see the full errors. +flag to see the full errors and -l to see which boards caused which errors. If you really want to see build results as they happen, use -v when doing a -build (and -e if you want to see errors as well). +build (-e will be enabled automatically). You don't need to stick around on that branch while buildman is running. It checks out its own copy of the source code, so you can change branches, diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 106fde0..b90d7e1 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -237,18 +237,21 @@ class Builder: del t def SetDisplayOptions(self, show_errors=False, show_sizes=False, - show_detail=False, show_bloat=False): + show_detail=False, show_bloat=False, + list_error_boards=False): Setup display options for the builder. show_errors: True to show summarised error/warning info show_sizes: Show size deltas show_detail: Show detail for each board show_bloat: Show detail for each function +list_error_boards: Show the boards which caused each error/warning self._show_errors = show_errors self._show_sizes = show_sizes self._show_detail = show_detail self._show_bloat = show_bloat +self._list_error_boards = list_error_boards def _AddTimestamp(self): Add a new timestamp to the list and record the build period. @@ -570,18 +573,26 @@ class Builder: Dict containing boards which passed building this commit. keyed by board.target List containing a summary of error/warning lines +Dict keyed by error line, containing a list of the Board +objects with that error board_dict = {} err_lines_summary = [] +err_lines_boards = {} for board in boards_selected.itervalues(): outcome = self.GetBuildOutcome(commit_upto, board.target, read_func_sizes) board_dict[board.target] = outcome for err in outcome.err_lines: -if err and not err.rstrip() in err_lines_summary: -err_lines_summary.append(err.rstrip()) -return board_dict, err_lines_summary +if err: +err = err.rstrip() +if err in err_lines_boards: +err_lines_boards[err].append(board) +else: +err_lines_boards[err] = [board] +err_lines_summary.append(err.rstrip()) +return board_dict, err_lines_summary, err_lines_boards def AddOutcome(self, board_dict, arch_list, changes, char, color): Add an output to our list of outcomes for each architecture @@ -828,7 +839,8 @@ class Builder: def
[U-Boot] [PATCH v10 10/14] buildman: Remove the directory prefix from each error line
The full path is long and also includes buildman private directories. Clean this up, so that only a relative U-Boot path is shown. This will change warnings like these: /home/sjg/c/src/third_party/u-boot/buildman5/.bm-work/00/arch/sandbox/cpu/cpu.c: In function 'timer_get_us': /home/sjg/c/src/third_party/u-boot/buildman5/.bm-work/00/arch/sandbox/cpu/cpu.c:40:9: warning: unused variable 'i' [-Wunused-variable] /home/sjg/c/src/third_party/u-boot/files/arch/sandbox/cpu/cpu.c: In function 'timer_get_us': /home/sjg/c/src/third_party/u-boot/files/arch/sandbox/cpu/cpu.c:40:9: warning: unused variable 'i' [-Wunused-variable] to: arch/sandbox/cpu/cpu.c: In function 'timer_get_us': arch/sandbox/cpu/cpu.c:40:9: warning: unused variable 'i' [-Wunused-variable] Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: - Remove the directory prefix more aggressively Changes in v9: - Add new patch to remove the directory prefix from each error line Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None tools/buildman/builderthread.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 8214662..0246375 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -177,6 +177,7 @@ class BuilderThread(threading.Thread): Mkdir(out_dir) args = [] cwd = work_dir +src_dir = os.path.realpath(work_dir) if not self.builder.in_tree: if commit_upto is None: # In this case we are building in the original source @@ -189,6 +190,7 @@ class BuilderThread(threading.Thread): work_dir = os.path.realpath(work_dir) args.append('O=%s/build' % work_dir) cwd = None +src_dir = os.getcwd() else: args.append('O=build') args.append('-s') @@ -209,7 +211,7 @@ class BuilderThread(threading.Thread): if result.return_code == 0: result = self.Make(commit, brd, 'build', cwd, *args, env=env) -result.stdout = config_out + result.stdout +result.stderr = result.stderr.replace(src_dir + '/', '') else: result.return_code = 1 result.stderr = 'No tool chain for %s\n' % brd.arch -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Please pull u-boot-x86.git branch patman
On Thu, Aug 28, 2014 at 09:00:32AM -0600, Simon Glass wrote: Hi Tom, This is just for one commit which fixes patman, so it should be applied before we get to the other stuff. (branch 'patman') The following changes since commit 7bee1c91a94db19bd26f92cc67be35d3592c6429: Merge branch 'ag...@denx.de' of git://git.denx.de/u-boot-staging (2014-08-25 08:34:39 -0400) are available in the git repository at: http://git.denx.de/u-boot-x86.git for you to fetch changes up to 042a732cf50568e77a20c540341fccf28ba62bcf: patman: Support the 'reverse' option for 'git log' (2014-08-28 07:56:19 -0700) Simon Glass (1): patman: Support the 'reverse' option for 'git log' tools/patman/gitutil.py | 2 ++ 1 file changed, 2 insertions(+) Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 0/16] buildman: Expand test coverage
Buildman's test coverage is inadequate, particularly in the area of the core builder threads and logic. As a result it is harder to make changes than it should be, since verifying correctness manually is tedious. The existing output test relies on the user to verify that things look OK. This is getting harder with more output options available, so this series turns it into a unit test. A new functional test is provided which tests buildman from the parser options down to the logic that issues git and make commands. This runs in a few seconds and provides coverage of the builder logic and threads, plus most build-related options. Output formatting is already tested in test.py, and there is also a test there which checks that errors and warnings are correctly detected by the build system and reported in the summary. So overall, with this series, test coverage is now considerably better. Changes in v2: - Add a function to print out the terminal output recorded - Add a comment to _HandleCommandGit - Make sure the test temporary directory is removed - Add patch to expand output test to cover directory prefixes Simon Glass (16): patman: Add a way of recording terminal output for testing buildman: Send builder output through a function for testing buildman: Enhance basic test to check summary output patman: RunPipe() should not pipe stdout/stderr unless asked buildman: Move the command line code into its own file buildman: Move full help code into the control module patman: Provide a way to intercept commands for testing buildman: Add a functional test buildman: Set up bsettings outside the control module buildman: Avoid looking at config file or toolchains in tests buildman: Allow tests to have their own boards buildman: Correct counting of build failures on retry buildman: Provide an internal option to clean the outpur dir patman: Start with a clean series when needed buildman: Add additional functional tests buildman: Expand output test to cover directory prefixes tools/buildman/bsettings.py | 15 +- tools/buildman/builder.py | 58 ++--- tools/buildman/builderthread.py | 15 +- tools/buildman/buildman.py | 98 +--- tools/buildman/cmdline.py | 85 +++ tools/buildman/control.py | 60 +++-- tools/buildman/func_test.py | 507 tools/buildman/test.py | 153 +++- tools/buildman/toolchain.py | 4 +- tools/patman/command.py | 22 ++ tools/patman/patchstream.py | 4 +- tools/patman/terminal.py| 72 ++ 12 files changed, 935 insertions(+), 158 deletions(-) create mode 100644 tools/buildman/cmdline.py create mode 100644 tools/buildman/func_test.py -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v10 03/14] patman: Correct unit tests to run correctly
It seems that doctest behaves differently now, and some of the unit tests do not run. Adjust the tests to work correctly. ./tools/patman/patman --test unittest.result.TestResult run=10 errors=0 failures=0 Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: - Add new patch to fix patman unit tests Changes in v5: None tools/patman/gitutil.py | 8 tools/patman/patchstream.py | 7 +-- tools/patman/terminal.py| 8 ++-- tools/patman/test.py| 13 +++-- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index e2b4959..29e6fdd 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -478,13 +478,13 @@ def LookupEmail(lookup_name, alias=None, raise_on_error=True, level=0): ... OSError: Recursive email alias at 'other' LookupEmail('odd', alias, raise_on_error=False) -\033[1;31mAlias 'odd' not found\033[0m +Alias 'odd' not found [] # In this case the loop part will effectively be ignored. LookupEmail('loop', alias, raise_on_error=False) -\033[1;31mRecursive email alias at 'other'\033[0m -\033[1;31mRecursive email alias at 'john'\033[0m -\033[1;31mRecursive email alias at 'mary'\033[0m +Recursive email alias at 'other' +Recursive email alias at 'john' +Recursive email alias at 'mary' ['j.blo...@napier.co.nz', 'm.popp...@cloud.net'] if not alias: diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 0040468..322374c 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -275,7 +275,7 @@ class PatchStream: # Suppress duplicate signoffs elif signoff_match: -if (self.is_log or +if (self.is_log or not self.commit or self.commit.CheckDuplicateSignoff(signoff_match.group(1))): out = [line] @@ -312,7 +312,10 @@ class PatchStream: out = [] log = self.series.MakeChangeLog(self.commit) out += self.FormatTags(self.tags) -out += [line] + self.commit.notes + [''] + log +out += [line] +if self.commit: +out += self.commit.notes +out += [''] + log elif self.found_test: if not re_allowed_after_test.match(line): self.lines_after_test += 1 diff --git a/tools/patman/terminal.py b/tools/patman/terminal.py index 11f80d8..963f2f8 100644 --- a/tools/patman/terminal.py +++ b/tools/patman/terminal.py @@ -30,8 +30,12 @@ class Color(object): enabled: True if color output should be enabled. If False then this class will not add color codes at all. -self._enabled = (colored == COLOR_ALWAYS or -(colored == COLOR_IF_TERMINAL and os.isatty(sys.stdout.fileno( +try: +self._enabled = (colored == COLOR_ALWAYS or +(colored == COLOR_IF_TERMINAL and + os.isatty(sys.stdout.fileno( +except: +self._enabled = False def Start(self, color, bright=True): Returns a start color code. diff --git a/tools/patman/test.py b/tools/patman/test.py index 8fcfe53..e8f7472 100644 --- a/tools/patman/test.py +++ b/tools/patman/test.py @@ -55,6 +55,7 @@ This adds functions to enable/disable clocks and reset to on-chip peripherals. Signed-off-by: Simon Glass s...@chromium.org --- + arch/arm/cpu/armv7/tegra2/Makefile |2 +- arch/arm/cpu/armv7/tegra2/ap20.c | 57 ++ arch/arm/cpu/armv7/tegra2/clock.c | 163 + @@ -200,7 +201,7 @@ index 000..2234c87 self.assertEqual(result.errors, 0) self.assertEqual(result.warnings, 0) self.assertEqual(result.checks, 0) -self.assertEqual(result.lines, 67) +self.assertEqual(result.lines, 56) os.remove(inf) def testNoSignoff(self): @@ -211,18 +212,18 @@ index 000..2234c87 self.assertEqual(result.errors, 1) self.assertEqual(result.warnings, 0) self.assertEqual(result.checks, 0) -self.assertEqual(result.lines, 67) +self.assertEqual(result.lines, 56) os.remove(inf) def testSpaces(self): inf = self.SetupData('spaces') result = checkpatch.CheckPatch(inf) self.assertEqual(result.ok, False) -self.assertEqual(len(result.problems), 1) +self.assertEqual(len(result.problems), 2) self.assertEqual(result.errors, 0) -self.assertEqual(result.warnings, 1) +self.assertEqual(result.warnings, 2) self.assertEqual(result.checks, 0) -self.assertEqual(result.lines, 67) +self.assertEqual(result.lines, 56) os.remove(inf) def
[U-Boot] [PATCH v10 05/14] patman: Use --no-pager' to stop git from forking a pager
In a headless environment the pager can apparently hang. We don't want a pager anyway so let's request that none be used. Reported-by: Tom Rini tr...@ti.com Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: None Changes in v8: - Add new patch to disable the pager in git Changes in v7: None Changes in v6: None Changes in v5: None tools/patman/gitutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index 45276e6..fbd170f 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -33,7 +33,7 @@ def LogCmd(commit_range, git_dir=None, oneline=False, reverse=False, cmd = ['git'] if git_dir: cmd += ['--git-dir', git_dir] -cmd += ['log', '--no-color'] +cmd += ['--no-pager', 'log', '--no-color'] if oneline: cmd.append('--oneline') if use_no_decorate: -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v10 06/14] patman: Avoid changing the order of tags
patman collects tags that it sees in the commit and places them nicely sorted at the end of the patch. However, this is not really necessary and in fact is apparently not desirable. Suggested-by: Masahiro Yamada yamad...@jp.panasonic.com Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: - Add new patch to avoid changing the order of tags Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None tools/patman/patchstream.py | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 322374c..b0b8153 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -72,7 +72,6 @@ class PatchStream: self.in_change = 0 # Non-zero if we are in a change list self.blank_count = 0 # Number of blank lines stored up self.state = STATE_MSG_HEADER# What state are we in? -self.tags = [] # Tags collected, like Tested-by... self.signoff = []# Contents of signoff line self.commit = None # Current commit @@ -113,16 +112,6 @@ class PatchStream: self.series.AddCommit(self.commit) self.commit = None -def FormatTags(self, tags): -out_list = [] -for tag in sorted(tags): -if tag.startswith('Cc:'): -tag_list = tag[4:].split(',') -out_list += gitutil.BuildEmailList(tag_list, 'Cc:') -else: -out_list.append(tag) -return out_list - def ProcessLine(self, line): Process a single line of a patch file or commit log @@ -271,7 +260,7 @@ class PatchStream: elif tag_match.group(1) == 'Patch-cc': self.commit.AddCc(tag_match.group(2).split(',')) else: -self.tags.append(line); +out = [line] # Suppress duplicate signoffs elif signoff_match: @@ -311,7 +300,6 @@ class PatchStream: # Output the tags (signeoff first), then change list out = [] log = self.series.MakeChangeLog(self.commit) -out += self.FormatTags(self.tags) out += [line] if self.commit: out += self.commit.notes -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v10 12/14] buildman: Separate out display of warnings and errors
Some boards unfortunately build with warnings and it is useful to be able to easily distinguish the warnings from the errors. Use a simple pattern match to categorise gcc output into warnings and errors, and display each separately. New warnings are shown in magenta (with a w+ prefix) and fixed warnings are shown in yellow with a w- prefix. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: - Track prefixes and postfixes for warnings/errors Changes in v9: - Add new patch to separate out display of warnings and errors Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None tools/buildman/README | 3 ++ tools/buildman/builder.py | 111 -- 2 files changed, 91 insertions(+), 23 deletions(-) diff --git a/tools/buildman/README b/tools/buildman/README index fbc8449..8ba19ec 100644 --- a/tools/buildman/README +++ b/tools/buildman/README @@ -445,6 +445,9 @@ If many boards have the same error, then -e will display the error only once. This makes the output as concise as possible. To see which boards have each error, use -l. +Buildman tries to distinguish warnings from errors, and shows warning lines +separately with a 'w' prefix. + The full build output in this case is available in: ../lcd9b/12_of_18_gd92aff7_lcd--Add-support-for/lubbock/ diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index b90d7e1..324239a 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -140,6 +140,7 @@ class Builder: Private members: _base_board_dict: Last-summarised Dict of boards _base_err_lines: Last-summarised list of errors +_base_warn_lines: Last-summarised list of warnings _build_period_us: Time taken for a single build (float object). _complete_delay: Expected delay until completion (timedelta) _next_delay_update: Next time we plan to display a progress update @@ -214,6 +215,11 @@ class Builder: self.col = terminal.Color() +self._re_function = re.compile('(.*): In function.*') +self._re_files = re.compile('In file included from.*') +self._re_warning = re.compile('(.*):(\d*):(\d*): warning: .*') +self._re_note = re.compile('(.*):(\d*):(\d*): note: this is the location of the previous.*') + self.queue = Queue.Queue() self.out_queue = Queue.Queue() for i in range(self.num_threads): @@ -572,27 +578,57 @@ class Builder: Tuple: Dict containing boards which passed building this commit. keyed by board.target -List containing a summary of error/warning lines +List containing a summary of error lines Dict keyed by error line, containing a list of the Board objects with that error +List containing a summary of warning lines +Dict keyed by error line, containing a list of the Board +objects with that warning +def AddLine(lines_summary, lines_boards, line, board): +line = line.rstrip() +if line in lines_boards: +lines_boards[line].append(board) +else: +lines_boards[line] = [board] +lines_summary.append(line) + board_dict = {} err_lines_summary = [] err_lines_boards = {} +warn_lines_summary = [] +warn_lines_boards = {} for board in boards_selected.itervalues(): outcome = self.GetBuildOutcome(commit_upto, board.target, read_func_sizes) board_dict[board.target] = outcome -for err in outcome.err_lines: -if err: -err = err.rstrip() -if err in err_lines_boards: -err_lines_boards[err].append(board) +last_func = None +last_was_warning = False +for line in outcome.err_lines: +if line: +if (self._re_function.match(line) or +self._re_files.match(line)): +last_func = line else: -err_lines_boards[err] = [board] -err_lines_summary.append(err.rstrip()) -return board_dict, err_lines_summary, err_lines_boards +is_warning = self._re_warning.match(line) +is_note = self._re_note.match(line) +if is_warning or (last_was_warning and is_note): +if last_func: +AddLine(warn_lines_summary, warn_lines_boards, +last_func, board) +AddLine(warn_lines_summary, warn_lines_boards, +line, board) +
[U-Boot] [PATCH v10 13/14] patman: Fix detection of git version
A missing 'global' declaration means that this feature does not currently work. Fix it. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: - Add new patch to fix detection of git version Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None tools/patman/gitutil.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index fbd170f..80edc7c 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -481,6 +481,8 @@ def GetDefaultUserEmail(): def Setup(): Set up git utils, by reading the alias files. # Check for a git alias file also +global use_no_decorate + alias_fname = GetAliasFile() if alias_fname: settings.ReadGitAliases(alias_fname) -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v10 09/14] buildman: Implement an option to exclude boards from the build
Some boards are known to be broken and it is convenient to be able to exclude them from the build. Add an --exclude option to specific boards to exclude. This uses the same matching rules as the normal 'include' arguments, and is a comma- separated list of regular expressions. Suggested-by: York Sun york...@freescale.com Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: - Add new patch to implement --exclude option Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None tools/buildman/README | 7 +++ tools/buildman/board.py| 31 --- tools/buildman/buildman.py | 3 +++ tools/buildman/control.py | 8 +++- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/tools/buildman/README b/tools/buildman/README index 68465b4..b8c2bd6 100644 --- a/tools/buildman/README +++ b/tools/buildman/README @@ -114,6 +114,13 @@ the '' operator to limit the selection: * 'freescale arm sandbox' All Freescale boards with ARM architecture, plus sandbox +You can also use -x to specifically exclude some boards. For example: + + buildmand arm -x nvidia,freescale,.*ball$ + +means to build all arm boards except nvidia, freescale and anything ending +with 'ball'. + It is convenient to use the -n option to see whaat will be built based on the subset given. diff --git a/tools/buildman/board.py b/tools/buildman/board.py index a333287..5d536d5 100644 --- a/tools/buildman/board.py +++ b/tools/buildman/board.py @@ -239,13 +239,14 @@ class Boards: terms.append(term) return terms -def SelectBoards(self, args): +def SelectBoards(self, args, exclude=[]): Mark boards selected based on args Args: -List of strings specifying boards to include, either named, or -by their target, architecture, cpu, vendor or soc. If empty, all -boards are selected. +args: List of strings specifying boards to include, either named, + or by their target, architecture, cpu, vendor or soc. If + empty, all boards are selected. +exclude: List of boards to exclude, regardless of 'args' Returns: Dictionary which holds the number of boards which were selected @@ -258,17 +259,33 @@ class Boards: for term in terms: result[str(term)] = 0 +exclude_list = [] +for expr in exclude: +exclude_list.append(Expr(expr)) + for board in self._boards: +matching_term = None +build_it = False if terms: match = False for term in terms: if term.Matches(board.props): -board.build_it = True -result[str(term)] += 1 -result['all'] += 1 +matching_term = str(term) +build_it = True break else: +build_it = True + +# Check that it is not specifically excluded +for expr in exclude_list: +if expr.Matches(board.props): +build_it = False +break + +if build_it: board.build_it = True +if matching_term: +result[matching_term] += 1 result['all'] += 1 return result diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py index fbd3125..53592e5 100755 --- a/tools/buildman/buildman.py +++ b/tools/buildman/buildman.py @@ -117,6 +117,9 @@ parser.add_option('-u', '--show_unknown', action='store_true', default=False, help='Show boards with unknown build result') parser.add_option('-v', '--verbose', action='store_true', default=False, help='Show build results while the build progresses') +parser.add_option('-x', '--exclude', dest='exclude', + type='string', action='append', + help='Specify a list of boards to exclude, separated by comma') parser.usage += diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 239c423..7991c74 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -129,7 +129,13 @@ def DoBuildman(options, args): boards = board.Boards() boards.ReadBoards(os.path.join(options.git, 'boards.cfg')) -why_selected = boards.SelectBoards(args) + +exclude = [] +if options.exclude: +for arg in options.exclude: +exclude += arg.split(',') + +why_selected = boards.SelectBoards(args, exclude) selected = boards.GetSelected() if not len(selected): sys.exit(col.Color(col.RED, 'No matching boards found')) -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de
[U-Boot] [PATCH v10 14/14] RFC: Deprecate MAKEALL
Since buildman now includes most of the features of MAKEALL it is probably time to talk about deprecating MAKEALL. Comments welcome. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: - Remove already-applied patches from the series - Add the deprecation message at the end of the build also - Drop the 'colour' patch sadly Changes in v6: None Changes in v5: - Drop patch to search for *cc instead of *gcc for the compiler MAKEALL | 10 ++ 1 file changed, 10 insertions(+) diff --git a/MAKEALL b/MAKEALL index 392ea8d..2321df0 100755 --- a/MAKEALL +++ b/MAKEALL @@ -60,6 +60,14 @@ usage() exit ${ret} } +deprecation() { + echo ** Note: MAKEALL is deprecated - please use buildman instead + echo ** See tools/buildman/README for details + echo +} + +deprecation + SHORT_OPTS=ha:c:v:s:b:lmMCnr LONG_OPTS=help,arch:,cpu:,vendor:,soc:,board:,list,maintainers,mails,check,continue,rebuild-errors @@ -849,6 +857,8 @@ print_stats() { kill_children fi + deprecation + exit $RC } -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v10 07/14] buildman: Set the return code to indicate build result
When buildman finds errors/warnings when building, set the return code to indicate this. Suggested-by: York Sun york...@freescale.com Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: - Add new patch to set the return code to indicate build result Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None tools/buildman/README | 6 ++ tools/buildman/builder.py | 5 + tools/buildman/buildman.py | 3 ++- tools/buildman/control.py | 9 +++-- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/tools/buildman/README b/tools/buildman/README index d4e8404..d20508f 100644 --- a/tools/buildman/README +++ b/tools/buildman/README @@ -690,6 +690,12 @@ Other options Buildman has various other command line options. Try --help to see them. +When doing builds, Buildman's return code will reflect the overall result: + +0 (success) No errors or warnings found +128 Errors found +129 Warnings found + How to change from MAKEALL == diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index a555bd8..106fde0 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1031,6 +1031,10 @@ class Builder: value is Board object keep_outputs: True to save build output files verbose: Display build results as they are completed +Returns: +Tuple containing: +- number of boards that failed to build +- number of boards that issued warnings self.commit_count = len(commits) if commits else 1 self.commits = commits @@ -1060,3 +1064,4 @@ class Builder: self.out_queue.join() print self.ClearLine(0) +return (self.fail, self.warned) diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py index e18859b..fbd3125 100755 --- a/tools/buildman/buildman.py +++ b/tools/buildman/buildman.py @@ -136,4 +136,5 @@ elif options.full_help: # Build selected commits for selected boards else: -control.DoBuildman(options, args) +ret_code = control.DoBuildman(options, args) +sys.exit(ret_code) diff --git a/tools/buildman/control.py b/tools/buildman/control.py index d98e50a..239c423 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -94,7 +94,7 @@ def DoBuildman(options, args): if options.list_tool_chains: toolchains.List() print -return +return 0 # Work out how many commits to build. We want to build everything on the # branch. We also build the upstream commit as a control so we can see @@ -219,5 +219,10 @@ def DoBuildman(options, args): options.show_detail = True builder.ShowSummary(commits, board_selected) else: -builder.BuildBoards(commits, board_selected, +fail, warned = builder.BuildBoards(commits, board_selected, options.keep_outputs, options.verbose) +if fail: +return 128 +elif warned: +return 129 +return 0 -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v10 08/14] buildman: Allow make-flags variables to include '-' and '_'
These characters are commonly used in variables, so permit them. Also document the permitted characters. Reported-by: Tom Rini tr...@ti.com Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: - Add new patch to allow make-flags variables to include '-' and '_' Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None tools/buildman/README | 4 +++- tools/buildman/toolchain.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/buildman/README b/tools/buildman/README index d20508f..68465b4 100644 --- a/tools/buildman/README +++ b/tools/buildman/README @@ -670,7 +670,9 @@ snapper9g45=${at91-boards} BUILD_TAG=443 This will use 'make ENABLE_AT91_TEST=1 BUILD_TAG=442' for snapper9260 and 'make ENABLE_AT91_TEST=1 BUILD_TAG=443' for snapper9g45. A special variable ${target} is available to access the target name (snapper9260 and -snapper9g20 in this case). Variables are resolved recursively. +snapper9g20 in this case). Variables are resolved recursively. Note that +variables can only contain the characters A-Z, a-z, 0-9, hyphen (-) and +underscore (_). It is expected that any variables added are dealt with in U-Boot's config.mk file and documented in the README. diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index 1b9771f..0e91294 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -198,7 +198,7 @@ class Toolchains: tcs.ResolveReferences(var_dict, 'this=${oblique}_set${first}nd') 'this=OBLIQUE_setfi2ndrstnd' -re_var = re.compile('(\$\{[a-z0-9A-Z]{1,}\})') +re_var = re.compile('(\$\{[-_a-z0-9A-Z]{1,}\})') while True: m = re_var.search(args) -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v10 02/14] patman: Fix indentation in terminal.py
This code came from a different project with 2-character indentation. Fix it for U-Boot. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: - Add new patch to fix indentation in teminal.py Changes in v5: None tools/patman/terminal.py | 108 --- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/tools/patman/terminal.py b/tools/patman/terminal.py index 597d526..11f80d8 100644 --- a/tools/patman/terminal.py +++ b/tools/patman/terminal.py @@ -15,66 +15,68 @@ import sys COLOR_IF_TERMINAL, COLOR_ALWAYS, COLOR_NEVER = range(3) class Color(object): - Conditionally wraps text in ANSI color escape sequences. - BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) - BOLD = -1 - BRIGHT_START = '\033[1;%dm' - NORMAL_START = '\033[22;%dm' - BOLD_START = '\033[1m' - RESET = '\033[0m' +Conditionally wraps text in ANSI color escape sequences. +BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) +BOLD = -1 +BRIGHT_START = '\033[1;%dm' +NORMAL_START = '\033[22;%dm' +BOLD_START = '\033[1m' +RESET = '\033[0m' - def __init__(self, colored=COLOR_IF_TERMINAL): -Create a new Color object, optionally disabling color output. +def __init__(self, colored=COLOR_IF_TERMINAL): +Create a new Color object, optionally disabling color output. -Args: - enabled: True if color output should be enabled. If False then this -class will not add color codes at all. - -self._enabled = (colored == COLOR_ALWAYS or -(colored == COLOR_IF_TERMINAL and os.isatty(sys.stdout.fileno( +Args: + enabled: True if color output should be enabled. If False then this +class will not add color codes at all. + +self._enabled = (colored == COLOR_ALWAYS or +(colored == COLOR_IF_TERMINAL and os.isatty(sys.stdout.fileno( - def Start(self, color, bright=True): -Returns a start color code. +def Start(self, color, bright=True): +Returns a start color code. -Args: - color: Color to use, .e.g BLACK, RED, etc. +Args: + color: Color to use, .e.g BLACK, RED, etc. -Returns: - If color is enabled, returns an ANSI sequence to start the given color, - otherwise returns empty string - -if self._enabled: -base = self.BRIGHT_START if bright else self.NORMAL_START -return base % (color + 30) -return '' +Returns: + If color is enabled, returns an ANSI sequence to start the given + color, otherwise returns empty string + +if self._enabled: +base = self.BRIGHT_START if bright else self.NORMAL_START +return base % (color + 30) +return '' - def Stop(self): -Retruns a stop color code. +def Stop(self): +Retruns a stop color code. -Returns: - If color is enabled, returns an ANSI color reset sequence, otherwise - returns empty string - -if self._enabled: -return self.RESET -return '' +Returns: + If color is enabled, returns an ANSI color reset sequence, + otherwise returns empty string + +if self._enabled: +return self.RESET +return '' - def Color(self, color, text, bright=True): -Returns text with conditionally added color escape sequences. +def Color(self, color, text, bright=True): +Returns text with conditionally added color escape sequences. -Keyword arguments: - color: Text color -- one of the color constants defined in this class. - text: The text to color. +Keyword arguments: + color: Text color -- one of the color constants defined in this + class. + text: The text to color. -Returns: - If self._enabled is False, returns the original text. If it's True, - returns text with color escape sequences based on the value of color. - -if not self._enabled: -return text -if color == self.BOLD: -start = self.BOLD_START -else: -base = self.BRIGHT_START if bright else self.NORMAL_START -start = base % (color + 30) -return start + text + self.RESET +Returns: + If self._enabled is False, returns the original text. If it's True, + returns text with color escape sequences based on the value of + color. + +if not self._enabled: +return text +if color == self.BOLD: +start = self.BOLD_START +else: +base = self.BRIGHT_START if bright else self.NORMAL_START +start = base % (color + 30) +return start + text + self.RESET -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de
Re: [U-Boot] [PATCH v2] README.kconfig: document backward compatibility make *_config
On 08/27/2014 07:56 PM, Masahiro Yamada wrote: Commit 3ff291f371fa9858426774f3732924bacb61ed1c (kconfig: convert Kconfig helper script into a shell script) restored board_config target for backward compatibility. It should be documented. Reviewed-by: Stephen Warren swar...@nvidia.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 06/16] buildman: Move full help code into the control module
There is no good reason to keep this code separate. Move it into control.py so it is easier to test. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: None tools/buildman/buildman.py | 6 -- tools/buildman/control.py | 8 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py index c4de857..70c2142 100755 --- a/tools/buildman/buildman.py +++ b/tools/buildman/buildman.py @@ -63,12 +63,6 @@ options, args = cmdline.ParseArgs() # Run our meagre tests if options.test: RunTests() -elif options.full_help: -pager = os.getenv('PAGER') -if not pager: -pager = 'more' -fname = os.path.join(os.path.dirname(sys.argv[0]), 'README') -command.Run(pager, fname) # Build selected commits for selected boards else: diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 0785840..245d370 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -84,6 +84,14 @@ def DoBuildman(options, args): options: Command line options object args: Command line arguments (list of strings) +if options.full_help: +pager = os.getenv('PAGER') +if not pager: +pager = 'more' +fname = os.path.join(os.path.dirname(sys.argv[0]), 'README') +command.Run(pager, fname) +return 0 + gitutil.Setup() bsettings.Setup(options.config_file) -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 16/16] buildman: Expand output test to cover directory prefixes
Now that buildman supports removing the build directory prefix from output, add a test for it. Also ensure that output directories are removed when the test completes. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Add patch to expand output test to cover directory prefixes tools/buildman/test.py | 54 ++ 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/tools/buildman/test.py b/tools/buildman/test.py index f0c4d0e..a2a85ac 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -46,6 +46,20 @@ powerpc-linux-ld: u-boot: section .reloc lma 0xa400 overlaps previous sectio powerpc-linux-ld: u-boot: section .data lma 0xcd38 overlaps previous sections powerpc-linux-ld: u-boot: section .u_boot_cmd lma 0xeb40 overlaps previous sections powerpc-linux-ld: u-boot: section .bootpg lma 0xf198 overlaps previous sections +''', + '''In file included from %(basedir)sarch/sandbox/cpu/cpu.c:9:0: +%(basedir)sarch/sandbox/include/asm/state.h:44:0: warning: redefined [enabled by default] +%(basedir)sarch/sandbox/include/asm/state.h:43:0: note: this is the location of the previous definition +%(basedir)sarch/sandbox/cpu/cpu.c: In function 'do_reset': +%(basedir)sarch/sandbox/cpu/cpu.c:27:1: error: unknown type name 'blah' +%(basedir)sarch/sandbox/cpu/cpu.c:28:12: error: expected declaration specifiers or '...' before numeric constant +make[2]: *** [arch/sandbox/cpu/cpu.o] Error 1 +make[1]: *** [arch/sandbox/cpu] Error 2 +make[1]: *** Waiting for unfinished jobs +In file included from %(basedir)scommon/board_f.c:55:0: +%(basedir)sarch/sandbox/include/asm/state.h:44:0: warning: redefined [enabled by default] +%(basedir)sarch/sandbox/include/asm/state.h:43:0: note: this is the location of the previous definition +make: *** [sub-make] Error 2 ''' ] @@ -57,7 +71,8 @@ commits = [ ['9012', 'Third commit, error', 1, errors[0:2]], ['3456', 'Fourth commit, warning', 0, [errors[0], errors[2]]], ['7890', 'Fifth commit, link errors', 1, [errors[0], errors[3]]], -['abcd', 'Sixth commit, fixes all errors', 0, []] +['abcd', 'Sixth commit, fixes all errors', 0, []], +['ef01', 'Seventh commit, check directory suppression', 1, [errors[4]]], ] boards = [ @@ -109,15 +124,19 @@ class TestBuild(unittest.TestCase): self._col = terminal.Color() def Make(self, commit, brd, stage, *args, **kwargs): +global base_dir + result = command.CommandResult() boardnum = int(brd.target[-1]) result.return_code = 0 result.stderr = '' result.stdout = ('This is the test output for board %s, commit %s' % (brd.target, commit.hash)) -if boardnum = 1 and boardnum = commit.sequence: +if ((boardnum = 1 and boardnum = commit.sequence) or +boardnum == 4 and commit.sequence == 6): result.return_code = commit.return_code -result.stderr = ''.join(commit.error_list) +result.stderr = (''.join(commit.error_list) +% {'basedir' : base_dir + '/.bm-work/00/'}) if stage == 'build': target_dir = None for arg in args: @@ -146,10 +165,12 @@ class TestBuild(unittest.TestCase): This does a line-by-line verification of the summary output. -output_dir = tempfile.mkdtemp() -if not os.path.isdir(output_dir): -os.mkdir(output_dir) -build = builder.Builder(self.toolchains, output_dir, None, 1, 2, +global base_dir + +base_dir = tempfile.mkdtemp() +if not os.path.isdir(base_dir): +os.mkdir(base_dir) +build = builder.Builder(self.toolchains, base_dir, None, 1, 2, checkout=False, show_unknown=False) build.do_make = self.Make board_selected = self.boards.GetSelectedDict() @@ -167,6 +188,7 @@ class TestBuild(unittest.TestCase): self.assertEqual(count, len(commits) * len(boards) + 1) build.SetDisplayOptions(show_errors=True); build.ShowSummary(self.commits, board_selected) +#terminal.EchoPrintTestLines() lines = terminal.GetPrintTestLines() self.assertEqual(lines[0].text, '01: %s' % commits[0][1]) self.assertEqual(lines[1].text, '02: %s' % commits[1][1]) @@ -230,7 +252,22 @@ class TestBuild(unittest.TestCase): self.assertEqual(lines[24].text, 'w-%s' % errors[0].rstrip().replace('\n', '\nw-')) -self.assertEqual(len(lines), 25) +self.assertEqual(lines[25].text, '07: %s' % commits[6][1]) +self.assertSummary(lines[26].text, 'sandbox', '+', ['board4']) + +# Pick out the correct error lines +expect_str = errors[4].rstrip().replace('%(basedir)s', '').split('\n') +expect = expect_str[3:8] + [expect_str[-1]] +self.assertEqual(lines[27].text, '+%s'
[U-Boot] [PATCH v2 08/16] buildman: Add a functional test
Buildman currently lacks testing in many areas, including its use of git, make and many command-line flags. Add a functional test which covers some of these areas. So far it does a fake 'build' of all boards for the current source tree. This version reads the real ~/.buildman and boards.cfg files. Future work will improve this. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Add a comment to _HandleCommandGit - Make sure the test temporary directory is removed tools/buildman/buildman.py | 17 ++--- tools/buildman/control.py | 21 +++-- tools/buildman/func_test.py | 182 tools/buildman/toolchain.py | 4 +- 4 files changed, 206 insertions(+), 18 deletions(-) create mode 100644 tools/buildman/func_test.py diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py index 70c2142..6771c86 100755 --- a/tools/buildman/buildman.py +++ b/tools/buildman/buildman.py @@ -30,27 +30,20 @@ import terminal import toolchain def RunTests(): +import func_test import test import doctest result = unittest.TestResult() -for module in ['toolchain']: +for module in ['toolchain', 'gitutil']: suite = doctest.DocTestSuite(module) suite.run(result) -# TODO: Surely we can just 'print' result? -print result -for test, err in result.errors: -print err -for test, err in result.failures: -print err - sys.argv = [sys.argv[0]] -suite = unittest.TestLoader().loadTestsFromTestCase(test.TestBuild) -result = unittest.TestResult() -suite.run(result) +for module in (test.TestBuild, func_test.TestFunctional): +suite = unittest.TestLoader().loadTestsFromTestCase(module) +suite.run(result) -# TODO: Surely we can just 'print' result? print result for test, err in result.errors: print err diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 245d370..b35eb41 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -13,6 +13,7 @@ from builder import Builder import gitutil import patchstream import terminal +from terminal import Print import toolchain import command import subprocess @@ -77,12 +78,18 @@ def ShowActions(series, why_selected, boards_selected, builder, options): print ('Total boards to build for each commit: %d\n' % why_selected['all']) -def DoBuildman(options, args): +def DoBuildman(options, args, toolchains=None, make_func=None): The main control code for buildman Args: options: Command line options object args: Command line arguments (list of strings) +toolchains: Toolchains to use - this should be a Toolchains() +object. If None, then it will be created and scanned +make_func: Make function to use for the builder. This is called +to execute 'make'. If this is None, the normal function +will be used, which calls the 'make' tool with suitable +arguments. This setting is useful for tests. if options.full_help: pager = os.getenv('PAGER') @@ -97,8 +104,10 @@ def DoBuildman(options, args): bsettings.Setup(options.config_file) options.git_dir = os.path.join(options.git, '.git') -toolchains = toolchain.Toolchains() -toolchains.Scan(options.list_tool_chains) +if not toolchains: +toolchains = toolchain.Toolchains() +toolchains.GetSettings() +toolchains.Scan(options.list_tool_chains) if options.list_tool_chains: toolchains.List() print @@ -204,6 +213,8 @@ def DoBuildman(options, args): options.threads, options.jobs, gnu_make=gnu_make, checkout=True, show_unknown=options.show_unknown, step=options.step) builder.force_config_on_failure = not options.quick +if make_func: +builder.do_make = make_func # For a dry run, just show our actions as a sanity check if options.dry_run: @@ -222,8 +233,8 @@ def DoBuildman(options, args): else: commits = None -print GetActionSummary(options.summary, commits, board_selected, - options) +Print(GetActionSummary(options.summary, commits, board_selected, +options)) builder.SetDisplayOptions(options.show_errors, options.show_sizes, options.show_detail, options.show_bloat, diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py new file mode 100644 index 000..8711f9c --- /dev/null +++ b/tools/buildman/func_test.py @@ -0,0 +1,182 @@ +# +# Copyright (c) 2014 Google, Inc +# +# SPDX-License-Identifier: GPL-2.0+ +# + +import os +import shutil +import sys +import tempfile +import unittest + +import cmdline +import command +import control +import gitutil +import terminal +import toolchain + +class
[U-Boot] [PATCH v2 10/16] buildman: Avoid looking at config file or toolchains in tests
These files may not exist in the environment, or may not be suitable for testing. Provide our own config file and our own toolchains when running tests. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: None tools/buildman/bsettings.py | 15 ++- tools/buildman/func_test.py | 19 +++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/tools/buildman/bsettings.py b/tools/buildman/bsettings.py index 9164798..fdd875b 100644 --- a/tools/buildman/bsettings.py +++ b/tools/buildman/bsettings.py @@ -5,6 +5,7 @@ import ConfigParser import os +import StringIO def Setup(fname=''): @@ -17,11 +18,15 @@ def Setup(fname=''): global config_fname settings = ConfigParser.SafeConfigParser() -config_fname = fname -if config_fname == '': -config_fname = '%s/.buildman' % os.getenv('HOME') -if config_fname: -settings.read(config_fname) +if fname is not None: +config_fname = fname +if config_fname == '': +config_fname = '%s/.buildman' % os.getenv('HOME') +if config_fname: +settings.read(config_fname) + +def AddFile(data): +settings.readfp(StringIO.StringIO(data)) def GetItems(section): Get the items from a section of the config. diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 8711f9c..b92cde3 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -10,6 +10,7 @@ import sys import tempfile import unittest +import bsettings import cmdline import command import control @@ -17,6 +18,22 @@ import gitutil import terminal import toolchain +settings_data = ''' +# Buildman settings file + +[toolchain] + +[toolchain-alias] + +[make-flags] +src=/home/sjg/c/src +chroot=/home/sjg/c/chroot +vboot=USE_STDINT=1 VBOOT_DEBUG=1 MAKEFLAGS_VBOOT=DEBUG=1 CFLAGS_EXTRA_VBOOT=-DUNROLL_LOOPS VBOOT_SOURCE=${src}/platform/vboot_reference +chromeos_coreboot=VBOOT=${chroot}/build/link/usr ${vboot} +chromeos_daisy=VBOOT=${chroot}/build/daisy/usr ${vboot} +chromeos_peach=VBOOT=${chroot}/build/peach_pit/usr ${vboot} +''' + class TestFunctional(unittest.TestCase): Functional test for buildman. @@ -36,6 +53,8 @@ class TestFunctional(unittest.TestCase): command.test_result = self._HandleCommand self._toolchains = toolchain.Toolchains() self._toolchains.Add('gcc', test=False) +bsettings.Setup(None) +bsettings.AddFile(settings_data) def tearDown(self): shutil.rmtree(self._base_dir) -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 09/16] buildman: Set up bsettings outside the control module
Move the bsettings code back to the main buildman.py file, so we can do something different when testing. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: None tools/buildman/buildman.py | 2 ++ tools/buildman/control.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py index 6771c86..d0afeda 100755 --- a/tools/buildman/buildman.py +++ b/tools/buildman/buildman.py @@ -19,6 +19,7 @@ sys.path.append(os.path.join(our_path, '../patman')) # Our modules import board +import bsettings import builder import checkpatch import cmdline @@ -59,5 +60,6 @@ if options.test: # Build selected commits for selected boards else: +bsettings.Setup(options.config_file) ret_code = control.DoBuildman(options, args) sys.exit(ret_code) diff --git a/tools/buildman/control.py b/tools/buildman/control.py index b35eb41..a27f7db 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -101,7 +101,6 @@ def DoBuildman(options, args, toolchains=None, make_func=None): gitutil.Setup() -bsettings.Setup(options.config_file) options.git_dir = os.path.join(options.git, '.git') if not toolchains: -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 02/16] buildman: Send builder output through a function for testing
To allow us to verify the builder's console output, send it through a function which can collect it when running in test mode. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: None tools/buildman/builder.py | 58 --- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 324239a..1b6517b 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -20,6 +20,7 @@ import builderthread import command import gitutil import terminal +from terminal import Print import toolchain @@ -299,8 +300,8 @@ class Builder: length: Length of new line, in characters if length self.last_line_len: -print ' ' * (self.last_line_len - length), -print '\r', +Print(' ' * (self.last_line_len - length), newline=False) +Print('\r', newline=False) self.last_line_len = length sys.stdout.flush() @@ -351,7 +352,7 @@ class Builder: if result.already_done: self.already_done += 1 if self._verbose: -print '\r', +Print('\r', newline=False) self.ClearLine(0) boards_selected = {target : result.brd} self.ResetResultSummary(boards_selected) @@ -379,7 +380,7 @@ class Builder: self.commit_count) name += target -print line + name, +Print(line + name, newline=False) length = 14 + len(name) self.ClearLine(length) @@ -495,7 +496,7 @@ class Builder: try: size, type, name = line[:-1].split() except: -print Invalid line in file '%s': '%s' % (fname, line[:-1]) +Print(Invalid line in file '%s': '%s' % (fname, line[:-1])) continue if type in 'tTdDbB': # function names begin with '.' on 64-bit powerpc @@ -723,16 +724,16 @@ class Builder: return args = [self.ColourNum(x) for x in args] indent = ' ' * 15 -print ('%s%s: add: %s/%s, grow: %s/%s bytes: %s/%s (%s)' % - tuple([indent, self.col.Color(self.col.YELLOW, fname)] + args)) -print '%s %-38s %7s %7s %+7s' % (indent, 'function', 'old', 'new', -'delta') +Print('%s%s: add: %s/%s, grow: %s/%s bytes: %s/%s (%s)' % + tuple([indent, self.col.Color(self.col.YELLOW, fname)] + args)) +Print('%s %-38s %7s %7s %+7s' % (indent, 'function', 'old', 'new', + 'delta')) for diff, name in delta: if diff: color = self.col.RED if diff 0 else self.col.GREEN msg = '%s %-38s %7s %7s %+7d' % (indent, name, old.get(name, '-'), new.get(name,'-'), diff) -print self.col.Color(color, msg) +Print(msg, colour=color) def PrintSizeDetail(self, target_list, show_bloat): @@ -757,11 +758,12 @@ class Builder: color = self.col.RED if diff 0 else self.col.GREEN msg = ' %s %+d' % (name, diff) if not printed_target: -print '%10s %-15s:' % ('', result['_target']), +Print('%10s %-15s:' % ('', result['_target']), + newline=False) printed_target = True -print self.col.Color(color, msg), +Print(msg, colour=color, newline=False) if printed_target: -print +Print() if show_bloat: target = result['_target'] outcome = result['_outcome'] @@ -866,13 +868,13 @@ class Builder: color = self.col.RED if avg_diff 0 else self.col.GREEN msg = ' %s %+1.1f' % (name, avg_diff) if not printed_arch: -print '%10s: (for %d/%d boards)' % (arch, count, -arch_count[arch]), +Print('%10s: (for %d/%d boards)' % (arch, count, + arch_count[arch]), newline=False) printed_arch = True -print self.col.Color(color, msg), +Print(msg, colour=color, newline=False) if printed_arch: -print +Print() if show_detail: self.PrintSizeDetail(target_list, show_bloat) @@ -977,19 +979,19 @@ class Builder: self.AddOutcome(board_selected, arch_list, unknown, '?', self.col.MAGENTA) for arch, target_list in arch_list.iteritems(): -print '%10s: %s' % (arch, target_list) +
[U-Boot] [PATCH v2 04/16] patman: RunPipe() should not pipe stdout/stderr unless asked
RunPipe() currently pipes the output of stdout and stderr to a pty, but this is not the intended behaviour. Fix it. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: None tools/patman/command.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/patman/command.py b/tools/patman/command.py index 449d3d0..7212fdf 100644 --- a/tools/patman/command.py +++ b/tools/patman/command.py @@ -48,6 +48,8 @@ def RunPipe(pipe_list, infile=None, outfile=None, last_pipe = None pipeline = list(pipe_list) user_pipestr = '|'.join([' '.join(pipe) for pipe in pipe_list]) +kwargs['stdout'] = None +kwargs['stderr'] = None while pipeline: cmd = pipeline.pop(0) if last_pipe is not None: -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 11/16] buildman: Allow tests to have their own boards
Rather than reading boards.cfg, which may take time to generate and is not necessarily suitable for running tests, create our own list of boards. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: None tools/buildman/control.py | 25 ++--- tools/buildman/func_test.py | 20 +++- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/tools/buildman/control.py b/tools/buildman/control.py index a27f7db..3f3cce8 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -78,7 +78,7 @@ def ShowActions(series, why_selected, boards_selected, builder, options): print ('Total boards to build for each commit: %d\n' % why_selected['all']) -def DoBuildman(options, args, toolchains=None, make_func=None): +def DoBuildman(options, args, toolchains=None, make_func=None, boards=None): The main control code for buildman Args: @@ -90,6 +90,8 @@ def DoBuildman(options, args, toolchains=None, make_func=None): to execute 'make'. If this is None, the normal function will be used, which calls the 'make' tool with suitable arguments. This setting is useful for tests. +board: Boards() object to use, containing a list of available +boards. If this is None it will be created and scanned. if options.full_help: pager = os.getenv('PAGER') @@ -135,16 +137,17 @@ def DoBuildman(options, args, toolchains=None, make_func=None): sys.exit(col.Color(col.RED, str)) # Work out what subset of the boards we are building -board_file = os.path.join(options.git, 'boards.cfg') -if not os.path.exists(board_file): -print 'Could not find %s' % board_file -status = subprocess.call([os.path.join(options.git, - 'tools/genboardscfg.py')]) -if status != 0: -sys.exit(Failed to generate boards.cfg) - -boards = board.Boards() -boards.ReadBoards(os.path.join(options.git, 'boards.cfg')) +if not boards: + board_file = os.path.join(options.git, 'boards.cfg') + if not os.path.exists(board_file): + print 'Could not find %s' % board_file + status = subprocess.call([os.path.join(options.git, +'tools/genboardscfg.py')]) + if status != 0: + sys.exit(Failed to generate boards.cfg) + + boards = board.Boards() + boards.ReadBoards(os.path.join(options.git, 'boards.cfg')) exclude = [] if options.exclude: diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index b92cde3..237a80b 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -10,6 +10,7 @@ import sys import tempfile import unittest +import board import bsettings import cmdline import command @@ -34,6 +35,14 @@ chromeos_daisy=VBOOT=${chroot}/build/daisy/usr ${vboot} chromeos_peach=VBOOT=${chroot}/build/peach_pit/usr ${vboot} ''' +boards = [ +['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 1', 'board0', ''], +['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 2', 'board1', ''], +['Active', 'powerpc', 'powerpc', '', 'Tester', 'PowerPC board 1', 'board2', ''], +['Active', 'powerpc', 'mpc5xx', '', 'Tester', 'PowerPC board 2', 'board3', ''], +['Active', 'sandbox', 'sandbox', '', 'Tester', 'Sandbox board', 'board4', ''], +] + class TestFunctional(unittest.TestCase): Functional test for buildman. @@ -55,6 +64,9 @@ class TestFunctional(unittest.TestCase): self._toolchains.Add('gcc', test=False) bsettings.Setup(None) bsettings.AddFile(settings_data) +self._boards = board.Boards() +for brd in boards: +self._boards.AddBoard(board.Board(*brd)) def tearDown(self): shutil.rmtree(self._base_dir) @@ -67,7 +79,7 @@ class TestFunctional(unittest.TestCase): sys.argv = [sys.argv[0]] + list(args) options, args = cmdline.ParseArgs() return control.DoBuildman(options, args, toolchains=self._toolchains, -make_func=self._HandleMake) +make_func=self._HandleMake, boards=self._boards) def testFullHelp(self): command.test_result = None @@ -194,6 +206,12 @@ class TestFunctional(unittest.TestCase): print 'make', stage sys.exit(1) +def testNoBoards(self): +Test that buildman aborts when there are no boards +self._boards = board.Boards() +with self.assertRaises(SystemExit): +self._RunControl() + def testCurrentSource(self): Very simple test to invoke buildman on the current source self._RunControl() -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 03/16] buildman: Enhance basic test to check summary output
Adjust the basic test so that it checks all console output. This will help to ensure that the builder is behaving correctly with printing summary information. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: None tools/buildman/test.py | 101 ++--- 1 file changed, 96 insertions(+), 5 deletions(-) diff --git a/tools/buildman/test.py b/tools/buildman/test.py index a51c942..f0c4d0e 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -21,20 +21,21 @@ import builder import control import command import commit +import terminal import toolchain errors = [ '''main.c: In function 'main_loop': main.c:260:6: warning: unused variable 'joe' [-Wunused-variable] ''', -'''main.c: In function 'main_loop': +'''main.c: In function 'main_loop2': main.c:295:2: error: 'fred' undeclared (first use in this function) main.c:295:2: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [main.o] Error 1 make: *** [common/libcommon.o] Error 2 Make failed ''', -'''main.c: In function 'main_loop': +'''main.c: In function 'main_loop3': main.c:280:6: warning: unused variable 'mary' [-Wunused-variable] ''', '''powerpc-linux-ld: warning: dot moved backwards before `.bss' @@ -103,6 +104,10 @@ class TestBuild(unittest.TestCase): self.toolchains.Add('powerpc-linux-gcc', test=False) self.toolchains.Add('gcc', test=False) +# Avoid sending any output +terminal.SetPrintTestMode() +self._col = terminal.Color() + def Make(self, commit, brd, stage, *args, **kwargs): result = command.CommandResult() boardnum = int(brd.target[-1]) @@ -121,13 +126,26 @@ class TestBuild(unittest.TestCase): if not os.path.isdir(target_dir): os.mkdir(target_dir) -#time.sleep(.2 + boardnum * .2) result.combined = result.stdout + result.stderr return result -def testBasic(self): -Test basic builder operation +def assertSummary(self, text, arch, plus, boards, ok=False): +col = self._col +expected_colour = col.GREEN if ok else col.RED +expect = '%10s: ' % arch +# TODO(s...@chromium.org): If plus is '', we shouldn't need this +expect += col.Color(expected_colour, plus) +expect += ' ' +for board in boards: +expect += col.Color(expected_colour, ' %s' % board) +self.assertEqual(text, expect) + +def testOutput(self): +Test basic builder operation and output + +This does a line-by-line verification of the summary output. + output_dir = tempfile.mkdtemp() if not os.path.isdir(output_dir): os.mkdir(output_dir) @@ -138,8 +156,81 @@ class TestBuild(unittest.TestCase): build.BuildBoards(self.commits, board_selected, keep_outputs=False, verbose=False) +lines = terminal.GetPrintTestLines() +count = 0 +for line in lines: +if line.text.strip(): +count += 1 + +# We should get one starting message, then an update for every commit +# built. +self.assertEqual(count, len(commits) * len(boards) + 1) build.SetDisplayOptions(show_errors=True); build.ShowSummary(self.commits, board_selected) +lines = terminal.GetPrintTestLines() +self.assertEqual(lines[0].text, '01: %s' % commits[0][1]) +self.assertEqual(lines[1].text, '02: %s' % commits[1][1]) + +# We expect all archs to fail +col = terminal.Color() +self.assertSummary(lines[2].text, 'sandbox', '+', ['board4']) +self.assertSummary(lines[3].text, 'arm', '+', ['board1']) +self.assertSummary(lines[4].text, 'powerpc', '+', ['board2', 'board3']) + +# Now we should have the compiler warning +self.assertEqual(lines[5].text, 'w+%s' % +errors[0].rstrip().replace('\n', '\nw+')) +self.assertEqual(lines[5].colour, col.MAGENTA) + +self.assertEqual(lines[6].text, '03: %s' % commits[2][1]) +self.assertSummary(lines[7].text, 'sandbox', '+', ['board4']) +self.assertSummary(lines[8].text, 'arm', '', ['board1'], ok=True) +self.assertSummary(lines[9].text, 'powerpc', '+', ['board2', 'board3']) + +# Compiler error +self.assertEqual(lines[10].text, '+%s' % +errors[1].rstrip().replace('\n', '\n+')) + +self.assertEqual(lines[11].text, '04: %s' % commits[3][1]) +self.assertSummary(lines[12].text, 'sandbox', '', ['board4'], ok=True) +self.assertSummary(lines[13].text, 'powerpc', '', ['board2', 'board3'], +ok=True) + +# Compile error fixed +self.assertEqual(lines[14].text, '-%s' % +errors[1].rstrip().replace('\n', '\n-')) +
[U-Boot] [PATCH v2 07/16] patman: Provide a way to intercept commands for testing
Add a test point for the command module. This allows tests to emulate the execution of commands. This provides more control (since we can make the fake 'commands' do whatever we like), makes it faster to write tests since we don't need to set up as much environment, and speeds up test execution. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: None tools/patman/command.py | 20 1 file changed, 20 insertions(+) diff --git a/tools/patman/command.py b/tools/patman/command.py index 7212fdf..d586f11 100644 --- a/tools/patman/command.py +++ b/tools/patman/command.py @@ -20,9 +20,25 @@ class CommandResult: def __init__(self): self.stdout = None self.stderr = None +self.combined = None self.return_code = None self.exception = None +def __init__(self, stdout='', stderr='', combined='', return_code=0, + exception=None): +self.stdout = stdout +self.stderr = stderr +self.combined = combined +self.return_code = return_code +self.exception = exception + + +# This permits interception of RunPipe for test purposes. If it is set to +# a function, then that function is called with the pipe list being +# executed. Otherwise, it is assumed to be a CommandResult object, and is +# returned as the result for every RunPipe() call. +# When this value is None, commands are executed as normal. +test_result = None def RunPipe(pipe_list, infile=None, outfile=None, capture=False, capture_stderr=False, oneline=False, @@ -44,6 +60,10 @@ def RunPipe(pipe_list, infile=None, outfile=None, Returns: CommandResult object +if test_result: +if hasattr(test_result, '__call__'): +return test_result(pipe_list=pipe_list) +return test_result result = CommandResult() last_pipe = None pipeline = list(pipe_list) -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 14/16] patman: Start with a clean series when needed
For reasons that are not well-understood, GetMetaDataForList() can end up adding to an existing series even when it appears that it should be starting a new one. Change from using a default constructor parameter to an explicit one, to work around this problem. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: None tools/patman/patchstream.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index b0b8153..b3e66c3 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -355,7 +355,7 @@ class PatchStream: def GetMetaDataForList(commit_range, git_dir=None, count=None, - series = Series()): + series = None): Reads out patch series metadata from the commits This does a 'git log' on the relevant commits and pulls out the tags we @@ -370,6 +370,8 @@ def GetMetaDataForList(commit_range, git_dir=None, count=None, Returns: A Series object containing information about the commits. +if not series: +series = Series() params = gitutil.LogCmd(commit_range,reverse=True, count=count, git_dir=git_dir) stdout = command.RunPipe([params], capture=True).stdout -- 2.1.0.rc2.206.gedb03e5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Please pull u-boot-arm/master
Hi me, The following changes since commit e76b933e02e1b38e48754c435e9dba1c0deeb3c6: Prepare v2014.10-rc1 (2014-08-06 09:12:58 -0400) are available in the git repository at: git://git.denx.de/u-boot-arm next for you to fetch changes up to 1899fac925eda817e12234aef3d01d354788662e: Merge branch 'u-boot-sunxi/master' into 'u-boot-arm/master' (2014-08-09 16:48:34 +0200) Albert ARIBAUD (1): Merge branch 'u-boot-sunxi/master' into 'u-boot-arm/master' Hans de Goede (8): sun4i: add USB EHCI settings sun5i: add USB EHCI settings sunxi: Enable EHCI on various sunxi boards sunxi: Add CONFIG_MACPWR option sun4i: Add support for a number of new sun4i boards sun5i: Add support for a number of new sun5i boards sun7i: Add support for a number of new sun7i boards sun7i: Add bananapi board Ian Campbell (2): ahci: provide sunxi SATA driver using AHCI platform framework cubieboard2: Enable AXP209 power controller Marc Zyngier (2): sunxi: HYP/non-sec: add sun7i PSCI backend sunxi: HYP/non-sec: configure CNTFRQ on all CPUs Roman Byshko (5): sunxi: add defines to control USB Host clocks/resets sunxi: add USB EHCI driver sunxi: add general USB settings sun7i: add USB EHCI settings sun7i: cubietruck: enable USB EHCI arch/arm/cpu/armv7/sunxi/Makefile |3 + arch/arm/cpu/armv7/sunxi/board.c |5 + arch/arm/cpu/armv7/sunxi/clock_sun4i.c|4 + arch/arm/cpu/armv7/sunxi/psci.S | 162 arch/arm/include/asm/arch-sunxi/clock_sun4i.h | 15 +- board/sunxi/MAINTAINERS | 19 ++- board/sunxi/Makefile | 16 ++ board/sunxi/ahci.c| 84 +++ board/sunxi/dram_a10_olinuxino_l.c| 31 board/sunxi/dram_a10s_olinuxino_m.c | 31 board/sunxi/dram_a13_olinuxino.c | 31 board/sunxi/dram_bananapi.c | 31 board/sunxi/dram_linksprite_pcduino3.c| 31 board/sunxi/dram_sun4i_360_1024_iow16.c | 31 board/sunxi/dram_sun4i_360_1024_iow8.c| 31 board/sunxi/dram_sun4i_360_512.c | 31 board/sunxi/dram_sun4i_384_1024_iow8.c| 31 board/sunxi/dram_sun7i_384_1024_iow16.c | 31 board/sunxi/dram_sun7i_384_512_busw16_iow16.c | 31 configs/A10-OLinuXino-Lime_defconfig |4 + configs/A10s-OLinuXino-M_defconfig|4 + configs/A13-OLinuXinoM_defconfig |2 +- configs/A13-OLinuXino_defconfig |4 + configs/A20-OLinuXino_MICRO_defconfig |4 + configs/Auxtek-T004_defconfig |4 + configs/Bananapi_defconfig|4 + configs/Cubieboard2_FEL_defconfig |2 +- configs/Cubieboard2_defconfig |2 +- configs/Cubieboard_defconfig |2 +- configs/Cubietruck_FEL_defconfig |2 +- configs/Cubietruck_defconfig |2 +- configs/Linksprite_pcDuino3_defconfig |4 + configs/Mele_A1000G_defconfig |4 + configs/Mele_A1000_defconfig |4 + configs/Mini-X-1Gb_defconfig |4 + configs/Mini-X_defconfig |4 + configs/ba10_tv_box_defconfig |4 + configs/i12-tvbox_defconfig |4 + configs/qt840a_defconfig |4 + configs/r7-tv-dongle_defconfig|2 +- drivers/block/ahci.c | 16 ++ drivers/usb/host/Makefile |1 + drivers/usb/host/ehci-sunxi.c | 201 + include/ahci.h|4 + include/configs/sun4i.h | 12 ++ include/configs/sun5i.h |5 + include/configs/sun7i.h | 19 +++ include/configs/sunxi-common.h| 18 +++ 48 files changed, 982 insertions(+), 13 deletions(-) create mode 100644 arch/arm/cpu/armv7/sunxi/psci.S create mode 100644 board/sunxi/ahci.c create mode 100644 board/sunxi/dram_a10_olinuxino_l.c create mode 100644 board/sunxi/dram_a10s_olinuxino_m.c create mode 100644 board/sunxi/dram_a13_olinuxino.c create mode 100644 board/sunxi/dram_bananapi.c create mode 100644 board/sunxi/dram_linksprite_pcduino3.c create mode 100644 board/sunxi/dram_sun4i_360_1024_iow16.c create mode 100644 board/sunxi/dram_sun4i_360_1024_iow8.c create mode 100644 board/sunxi/dram_sun4i_360_512.c create mode 100644 board/sunxi/dram_sun4i_384_1024_iow8.c create mode 100644 board/sunxi/dram_sun7i_384_1024_iow16.c create mode 100644 board/sunxi/dram_sun7i_384_512_busw16_iow16.c create mode 100644
Re: [U-Boot] [PATCH v5 0/4] Implement fastboot flash for eMMC
On 14-08-28 06:24 AM, Tom Rini wrote: On Wed, Aug 27, 2014 at 09:04:09AM +0200, Lukasz Majewski wrote: Hi Steve, On 14-08-26 02:14 AM, Lukasz Majewski wrote: Hi Steve, On 14-08-25 07:57 AM, Lukasz Majewski wrote: [.. snip ...] Is fair as I know bsd-3L-clause license is compatible with GPL. However, to be 100% sure I'd like to ask Tom (as he has much more legal experience than me) to confirm that this code can be added to u-boot. OK -- note that this bsd-3L-clause clause is almost identical to the existing bsd-3-clause Tom, could you give your opinion on this? So, upstream made a slight (and likely unintentional) change to the normal BSD 3 clause license and changed the last clause from the copyright holders to The Linux Foundation. I've poked our legal dept about this but I suspect the best answer is to go back up to Android folks and ask them to fix this quite likely unintentional change. Actually, there are three diffs, and I am thinking that they were intentional (especially the last one!): $ diff bsd-3-clause.txt bsd-3L-clause.txt 5,6c5 notice, this list of conditions, and the following disclaimer, without modification. --- notice, this list of conditions and the following disclaimer. 10,12c9,12 3. The names of the above-listed copyright holders may not be used to endorse or promote products derived from this software without specific prior written permission. --- 3. Neither the name of The Linux Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 16,17c16,17 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR --- THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR So, would U-Boot accept this BSD-3L-Clause, or should I contact Colin Cross to attempt to get a BSD-3-Clause version, or Thanks, Steve ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] buildman: selection question
Ahhh -- that would work! Thanks, Steve On 14-08-28 07:54 AM, Simon Glass wrote: Hi Steve, On 27 August 2014 15:23, Steve Rae s...@broadcom.com wrote: question: Two of the boards that I support are almost the same: Active arm armv7 bcm281xxbroadcom bcm28155_ap bcm28155_ap - Active arm armv7 bcm281xxbroadcom bcm28155_ap bcm28155_w1d bcm28155_ap:BCM_SF2_ETH,BCM_SF2_ETH_GMAC Using buildman how can I build the first one (without always building the second one too?) What command are you using? Are you trying to build bcm28155_ap? Maybe the only option is to use -x bcm28155_w1d to exclude it. You will need the latest series though: http://patchwork.ozlabs.org/patch/382769/ (or see u-boot-x86.git branch 'buildman5') Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 3/4] cleanup code which handles the Android sparse image format
On Sat, Aug 23, 2014 at 10:39:02AM -0700, Steve Rae wrote: - update license format - port dprintf() to debug() - update formatting Signed-off-by: Steve Rae s...@broadcom.com --- Licenses/bsd-3L-clause.txt | 24 + common/aboot.c | 120 + 2 files changed, 79 insertions(+), 65 deletions(-) create mode 100644 Licenses/bsd-3L-clause.txt diff --git a/Licenses/bsd-3L-clause.txt b/Licenses/bsd-3L-clause.txt new file mode 100644 index 000..3a08ce4 --- /dev/null +++ b/Licenses/bsd-3L-clause.txt @@ -0,0 +1,24 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of The Linux Foundation nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS +IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/common/aboot.c b/common/aboot.c index a302c92..f38fc95 100644 --- a/common/aboot.c +++ b/common/aboot.c @@ -3,31 +3,9 @@ * All rights reserved. * * Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. + * Portions Copyright 2014 Broadcom Corporation. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of The Linux Foundation nor - * the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * SPDX-License-Identifier: BSD-3L-Clause */ OK, so I asked around in the legal dept here and the answer was we can just call it BSD-3-Clause in the SPDX-License-Identifier and be OK, so lets do that. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] buildman: suspect issue with patman tags
On 14-08-28 07:45 AM, Simon Glass wrote: Hi Steve, On 27 August 2014 15:22, Steve Rae s...@broadcom.com wrote: [... snip ...] *From:*Steve Rae *Sent:* Monday, August 25, 2014 09:06 *To:* Simon Glass *Subject:* buildman: issue with patman tags Simon, When I combine multiple patch-series, each with their own patman tags in the commit messages, into a single branch... Then: $ tools/buildman/buildman -b combined bcm28155_ap No section: 'make-flags' Traceback (most recent call last): File tools/buildman/buildman, line 139, in module control.DoBuildman(options, args) File /home/srae/work/to_denx/tools/buildman/control.py, line 161, in DoBuildman options.git_dir, count) File /home/srae/work/to_denx/tools/buildman/../patman/patchstream.py, line 387, in GetMetaDataForList ps.ProcessLine(line) File /home/srae/work/to_denx/tools/buildman/../patman/patchstream.py, line 248, in ProcessLine self.AddToSeries(line, name, value) File /home/srae/work/to_denx/tools/buildman/../patman/patchstream.py, line 94, in AddToSeries self.series.AddTag(self.commit, line, name, value) File /home/srae/work/to_denx/tools/buildman/../patman/series.py, line 67, in AddTag (commit.hash, line, values, self[name])) ValueError: In 442a87cd: line 'Series-version: 1': Cannot add another value '['1']' to series '4' $ Note: each patch-series individually build successfully with buildman, it is only after I combine that there are issues This is because buildman doesn't need these tags. For patman you need to work with one series at a time. If you have multiple series, then some might be at one version and some at another, and it wouldn't know what version to put on the patch. Also there might be multiple cover letters, etc. If you want to keep several series in a branch, you need to use -s and -c to control what portion of the branch represents each series. Yes, I am successfully using these flags in patman; but I want to be able to build all the combined patches... I have thought about adding support for multiple series in a branch - e.g. a marker on the bottom commit, giving each series a name. But I haven't convinced myself it is desirable. That might be too complicated... Maybe just add a flag (in buildman) to simply ignore all of the commit messages (or ignore the patman tags in the commit messages) just so that the build would execute. Actually, the only think that I really need is to be able to build the last one (but I think that --step=0 is close enough) Thanks, Steve Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 3/4] cleanup code which handles the Android sparse image format
OK - AWESOME! Can you just update the one line, ( and drop the bsd-3l-clause.txt ) Or would you like me to submit a v2 ? Thanks, Steve On 14-08-28 10:11 AM, Tom Rini wrote: On Sat, Aug 23, 2014 at 10:39:02AM -0700, Steve Rae wrote: - update license format - port dprintf() to debug() - update formatting Signed-off-by: Steve Rae s...@broadcom.com --- Licenses/bsd-3L-clause.txt | 24 + common/aboot.c | 120 + 2 files changed, 79 insertions(+), 65 deletions(-) create mode 100644 Licenses/bsd-3L-clause.txt diff --git a/Licenses/bsd-3L-clause.txt b/Licenses/bsd-3L-clause.txt new file mode 100644 index 000..3a08ce4 --- /dev/null +++ b/Licenses/bsd-3L-clause.txt @@ -0,0 +1,24 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of The Linux Foundation nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS +IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/common/aboot.c b/common/aboot.c index a302c92..f38fc95 100644 --- a/common/aboot.c +++ b/common/aboot.c @@ -3,31 +3,9 @@ * All rights reserved. * * Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. + * Portions Copyright 2014 Broadcom Corporation. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of The Linux Foundation nor - * the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * SPDX-License-Identifier:BSD-3L-Clause */ OK, so I asked around in the legal dept here and the answer was we can just call it BSD-3-Clause in the SPDX-License-Identifier and be OK, so lets do that. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 3/4] cleanup code which handles the Android sparse image format
On Thu, Aug 28, 2014 at 10:24:32AM -0700, Steve Rae wrote: OK - AWESOME! Can you just update the one line, ( and drop the bsd-3l-clause.txt ) Or would you like me to submit a v2 ? Lets just do a v2 for clarity. Thanks, Steve On 14-08-28 10:11 AM, Tom Rini wrote: On Sat, Aug 23, 2014 at 10:39:02AM -0700, Steve Rae wrote: - update license format - port dprintf() to debug() - update formatting Signed-off-by: Steve Rae s...@broadcom.com --- Licenses/bsd-3L-clause.txt | 24 + common/aboot.c | 120 + 2 files changed, 79 insertions(+), 65 deletions(-) create mode 100644 Licenses/bsd-3L-clause.txt diff --git a/Licenses/bsd-3L-clause.txt b/Licenses/bsd-3L-clause.txt new file mode 100644 index 000..3a08ce4 --- /dev/null +++ b/Licenses/bsd-3L-clause.txt @@ -0,0 +1,24 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of The Linux Foundation nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS +IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/common/aboot.c b/common/aboot.c index a302c92..f38fc95 100644 --- a/common/aboot.c +++ b/common/aboot.c @@ -3,31 +3,9 @@ * All rights reserved. * * Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. + * Portions Copyright 2014 Broadcom Corporation. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of The Linux Foundation nor - * the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * SPDX-License-Identifier:BSD-3L-Clause */ OK, so I asked around in the legal dept here and the answer was we can just call it BSD-3-Clause in the SPDX-License-Identifier and be OK, so lets do that. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/4] update code which handles Android sparse image format
- remove unnecessary functions Signed-off-by: Steve Rae s...@broadcom.com --- Changes in v2: None common/aboot.c | 2438 1 file changed, 2438 deletions(-) diff --git a/common/aboot.c b/common/aboot.c index 3b5092d..a302c92 100644 --- a/common/aboot.c +++ b/common/aboot.c @@ -30,1819 +30,6 @@ * */ -#include app.h -#include debug.h -#include arch/arm.h -#include string.h -#include stdlib.h -#include limits.h -#include kernel/thread.h -#include arch/ops.h - -#include dev/flash.h -#include lib/ptable.h -#include dev/keys.h -#include dev/fbcon.h -#include baseband.h -#include target.h -#include mmc.h -#include partition_parser.h -#include platform.h -#include crypto_hash.h -#include malloc.h -#include boot_stats.h -#include sha.h -#include platform/iomap.h -#include boot_device.h - -#if DEVICE_TREE -#include libfdt.h -#include dev_tree.h -#endif - -#include image_verify.h -#include recovery.h -#include bootimg.h -#include fastboot.h -#include sparse_format.h -#include mmc.h -#include devinfo.h -#include board.h -#include scm.h - -extern bool target_use_signed_kernel(void); -extern void platform_uninit(void); -extern void target_uninit(void); -extern int get_target_boot_params(const char *cmdline, const char *part, - char *buf, int buflen); - -void write_device_info_mmc(device_info *dev); -void write_device_info_flash(device_info *dev); - -#define EXPAND(NAME) #NAME -#define TARGET(NAME) EXPAND(NAME) - -#ifdef MEMBASE -#define EMMC_BOOT_IMG_HEADER_ADDR (0xFF000+(MEMBASE)) -#else -#define EMMC_BOOT_IMG_HEADER_ADDR 0xFF000 -#endif - -#ifndef MEMSIZE -#define MEMSIZE 1024*1024 -#endif - -#define MAX_TAGS_SIZE 1024 - -#define RECOVERY_MODE 0x77665502 -#define FASTBOOT_MODE 0x77665500 - -/* make 4096 as default size to ensure EFS,EXT4's erasing */ -#define DEFAULT_ERASE_SIZE 4096 -#define MAX_PANEL_BUF_SIZE 128 - -#define UBI_MAGIC UBI# -#define DISPLAY_DEFAULT_PREFIX mdss_mdp -#define UBI_MAGIC_SIZE 0x04 -#define BOOT_DEV_MAX_LEN 64 - -#define IS_ARM64(ptr) (ptr-magic_64 == KERNEL64_HDR_MAGIC) ? true : false - -#define ADD_OF(a, b) (UINT_MAX - b a) ? (a + b) : UINT_MAX - -#if UFS_SUPPORT -static const char *emmc_cmdline = androidboot.bootdevice=; -#else -static const char *emmc_cmdline = androidboot.emmc=true; -#endif -static const char *usb_sn_cmdline = androidboot.serialno=; -static const char *androidboot_mode = androidboot.mode=; -static const char *loglevel = quiet; -static const char *battchg_pause = androidboot.mode=charger; -static const char *auth_kernel = androidboot.authorized_kernel=true; -static const char *secondary_gpt_enable = gpt; - -static const char *baseband_apq = androidboot.baseband=apq; -static const char *baseband_msm = androidboot.baseband=msm; -static const char *baseband_csfb= androidboot.baseband=csfb; -static const char *baseband_svlte2a = androidboot.baseband=svlte2a; -static const char *baseband_mdm = androidboot.baseband=mdm; -static const char *baseband_mdm2= androidboot.baseband=mdm2; -static const char *baseband_sglte = androidboot.baseband=sglte; -static const char *baseband_dsda= androidboot.baseband=dsda; -static const char *baseband_dsda2 = androidboot.baseband=dsda2; -static const char *baseband_sglte2 = androidboot.baseband=sglte2; -static const char *warmboot_cmdline = qpnp-power-on.warm_boot=1; - -static unsigned page_size = 0; -static unsigned page_mask = 0; -static char ffbm_mode_string[FFBM_MODE_BUF_SIZE]; -static bool boot_into_ffbm; -static char target_boot_params[64]; - -/* Assuming unauthorized kernel image by default */ -static int auth_kernel_img = 0; - -static device_info device = {DEVICE_MAGIC, 0, 0, 0, 0}; - -struct atag_ptbl_entry -{ - char name[16]; - unsigned offset; - unsigned size; - unsigned flags; -}; - -/* - * Partition info, required to be published - * for fastboot - */ -struct getvar_partition_info { - const char part_name[MAX_GPT_NAME_SIZE]; /* Partition name */ - char getvar_size[MAX_GET_VAR_NAME_SIZE]; /* fastboot get var name for size */ - char getvar_type[MAX_GET_VAR_NAME_SIZE]; /* fastboot get var name for type */ - char size_response[MAX_RSP_SIZE];/* fastboot response for size */ - char type_response[MAX_RSP_SIZE];/* fastboot response for type */ -}; - -/* - * Right now, we are publishing the info for only - * three partitions - */ -struct getvar_partition_info part_info[] = -{ - { system , partition-size:, partition-type:, , ext4 }, - { userdata, partition-size:, partition-type:, , ext4 }, - { cache , partition-size:, partition-type:, , ext4 }, -}; - -char max_download_size[MAX_RSP_SIZE]; -char charger_screen_enabled[MAX_RSP_SIZE]; -char sn_buf[13]; -char display_panel_buf[MAX_PANEL_BUF_SIZE]; -char panel_display_mode[MAX_RSP_SIZE]; - -extern int emmc_recovery_init(void); - -#if
[U-Boot] [PATCH v2 3/4] cleanup code which handles the Android sparse image format
- update license format - port dprintf() to debug() - update formatting Signed-off-by: Steve Rae s...@broadcom.com --- Changes in v2: - use BSD-3-Clause common/aboot.c | 120 ++--- 1 file changed, 55 insertions(+), 65 deletions(-) diff --git a/common/aboot.c b/common/aboot.c index a302c92..351199e 100644 --- a/common/aboot.c +++ b/common/aboot.c @@ -3,31 +3,9 @@ * All rights reserved. * * Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. + * Portions Copyright 2014 Broadcom Corporation. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of The Linux Foundation nor - * the names of its contributors may be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * SPDX-License-Identifier:BSD-3-Clause */ void cmd_flash_mmc_sparse_img(const char *arg, void *data, unsigned sz) @@ -70,23 +48,24 @@ void cmd_flash_mmc_sparse_img(const char *arg, void *data, unsigned sz) } data += sparse_header-file_hdr_sz; - if(sparse_header-file_hdr_sz sizeof(sparse_header_t)) + if (sparse_header-file_hdr_sz sizeof(sparse_header_t)) { - /* Skip the remaining bytes in a header that is longer than + /* +* Skip the remaining bytes in a header that is longer than * we expected. */ data += (sparse_header-file_hdr_sz - sizeof(sparse_header_t)); } - dprintf (SPEW, === Sparse Image Header ===\n); - dprintf (SPEW, magic: 0x%x\n, sparse_header-magic); - dprintf (SPEW, major_version: 0x%x\n, sparse_header-major_version); - dprintf (SPEW, minor_version: 0x%x\n, sparse_header-minor_version); - dprintf (SPEW, file_hdr_sz: %d\n, sparse_header-file_hdr_sz); - dprintf (SPEW, chunk_hdr_sz: %d\n, sparse_header-chunk_hdr_sz); - dprintf (SPEW, blk_sz: %d\n, sparse_header-blk_sz); - dprintf (SPEW, total_blks: %d\n, sparse_header-total_blks); - dprintf (SPEW, total_chunks: %d\n, sparse_header-total_chunks); + debug(=== Sparse Image Header ===\n); + debug(magic: 0x%x\n, sparse_header-magic); + debug(major_version: 0x%x\n, sparse_header-major_version); + debug(minor_version: 0x%x\n, sparse_header-minor_version); + debug(file_hdr_sz: %d\n, sparse_header-file_hdr_sz); + debug(chunk_hdr_sz: %d\n, sparse_header-chunk_hdr_sz); + debug(blk_sz: %d\n, sparse_header-blk_sz); + debug(total_blks: %d\n, sparse_header-total_blks); + debug(total_chunks: %d\n, sparse_header-total_chunks); /* Start processing chunks */ for (chunk=0; chunksparse_header-total_chunks; chunk++) @@ -95,33 +74,37 @@ void cmd_flash_mmc_sparse_img(const char *arg, void *data, unsigned sz) chunk_header = (chunk_header_t *) data; data += sizeof(chunk_header_t); - dprintf (SPEW, === Chunk Header ===\n); - dprintf (SPEW, chunk_type: 0x%x\n, chunk_header-chunk_type); - dprintf (SPEW, chunk_data_sz: 0x%x\n, chunk_header-chunk_sz); - dprintf (SPEW, total_size: 0x%x\n, chunk_header-total_sz); + debug(=== Chunk Header ===\n); + debug(chunk_type: 0x%x\n, chunk_header-chunk_type); + debug(chunk_data_sz: 0x%x\n, chunk_header-chunk_sz); + debug(total_size: 0x%x\n, chunk_header-total_sz); - if(sparse_header-chunk_hdr_sz sizeof(chunk_header_t)) + if (sparse_header-chunk_hdr_sz
[U-Boot] [PATCH v2 0/4] Implement sparse format for fastboot
This series implements the sparse format file handling for fastboot. - [1/4] brings in the pristine file aboot.c - [2/4] deletes all unnecessary functions in aboot.c - [3/4] is a simple cleanup of aboot.c - [4/4] provides the implementation of aboot.c suitable for U-Boot Changes in v2: - use BSD-3-Clause Steve Rae (4): add code to handle Android sparse image format update code which handles Android sparse image format cleanup code which handles the Android sparse image format implement the Android sparse image format common/aboot.c| 217 ++ include/aboot.h | 28 +++ include/sparse_defs.h | 7 ++ 3 files changed, 252 insertions(+) create mode 100644 common/aboot.c create mode 100644 include/aboot.h create mode 100644 include/sparse_defs.h -- 1.8.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 4/4] implement the Android sparse image format
update to provide usable implementation to U-Boot Signed-off-by: Steve Rae s...@broadcom.com --- Changes in v2: None common/aboot.c| 128 +- include/aboot.h | 28 +++ include/sparse_defs.h | 7 +++ 3 files changed, 110 insertions(+), 53 deletions(-) create mode 100644 include/aboot.h create mode 100644 include/sparse_defs.h diff --git a/common/aboot.c b/common/aboot.c index 351199e..efeeece 100644 --- a/common/aboot.c +++ b/common/aboot.c @@ -8,44 +8,32 @@ * SPDX-License-Identifier:BSD-3-Clause */ -void cmd_flash_mmc_sparse_img(const char *arg, void *data, unsigned sz) +#include config.h +#include common.h +#include aboot.h +#include malloc.h +#include part.h +#include sparse_format.h + +void write_sparse_image(block_dev_desc_t *dev_desc, + disk_partition_t *info, const char *part_name, + void *data, unsigned sz) { + lbaint_t blk; + lbaint_t blkcnt; + lbaint_t blks; + uint32_t bytes_written = 0; unsigned int chunk; unsigned int chunk_data_sz; uint32_t *fill_buf = NULL; uint32_t fill_val; - uint32_t chunk_blk_cnt = 0; sparse_header_t *sparse_header; chunk_header_t *chunk_header; uint32_t total_blocks = 0; - unsigned long long ptn = 0; - unsigned long long size = 0; - int index = INVALID_PTN; int i; - uint8_t lun = 0; - - index = partition_get_index(arg); - ptn = partition_get_offset(index); - if(ptn == 0) { - fastboot_fail(partition table doesn't exist); - return; - } - - size = partition_get_size(index); - if (ROUND_TO_PAGE(sz,511) size) { - fastboot_fail(size too large); - return; - } - - lun = partition_get_lun(index); - mmc_set_lun(lun); /* Read and skip over sparse image header */ sparse_header = (sparse_header_t *) data; - if ((sparse_header-total_blks * sparse_header-blk_sz) size) { - fastboot_fail(size too large); - return; - } data += sparse_header-file_hdr_sz; if (sparse_header-file_hdr_sz sizeof(sparse_header_t)) @@ -67,17 +55,31 @@ void cmd_flash_mmc_sparse_img(const char *arg, void *data, unsigned sz) debug(total_blks: %d\n, sparse_header-total_blks); debug(total_chunks: %d\n, sparse_header-total_chunks); + /* verify sparse_header-blk_sz is an exact multiple of info-blksz */ + if (sparse_header-blk_sz != + (sparse_header-blk_sz ~(info-blksz - 1))) { + printf(%s: Sparse image block size issue [%u]\n, + __func__, sparse_header-blk_sz); + fastboot_fail(sparse image block size issue); + return; + } + + puts(Flashing Sparse Image\n); + /* Start processing chunks */ + blk = info-start; for (chunk=0; chunksparse_header-total_chunks; chunk++) { /* Read and skip over chunk header */ chunk_header = (chunk_header_t *) data; data += sizeof(chunk_header_t); - debug(=== Chunk Header ===\n); - debug(chunk_type: 0x%x\n, chunk_header-chunk_type); - debug(chunk_data_sz: 0x%x\n, chunk_header-chunk_sz); - debug(total_size: 0x%x\n, chunk_header-total_sz); + if (chunk_header-chunk_type != CHUNK_TYPE_RAW) { + debug(=== Chunk Header ===\n); + debug(chunk_type: 0x%x\n, chunk_header-chunk_type); + debug(chunk_data_sz: 0x%x\n, chunk_header-chunk_sz); + debug(total_size: 0x%x\n, chunk_header-total_sz); + } if (sparse_header-chunk_hdr_sz sizeof(chunk_header_t)) { @@ -90,6 +92,7 @@ void cmd_flash_mmc_sparse_img(const char *arg, void *data, unsigned sz) } chunk_data_sz = sparse_header-blk_sz * chunk_header-chunk_sz; + blkcnt = chunk_data_sz / info-blksz; switch (chunk_header-chunk_type) { case CHUNK_TYPE_RAW: @@ -101,14 +104,25 @@ void cmd_flash_mmc_sparse_img(const char *arg, void *data, unsigned sz) return; } - if (mmc_write(ptn + - ((uint64_t)total_blocks * -sparse_header-blk_sz), - chunk_data_sz, (unsigned int *)data)) - { + if (blk + blkcnt info-start + info-size) { + printf( + %s: Request would exceed partition size!\n, + __func__); +
[U-Boot] [PATCH v2 1/4] add code to handle Android sparse image format
Add original file (pristine) from : https://www.codeaurora.org/cgit/quic/la/kernel/lk/plain/app/aboot/aboot.c?h=master [3b5092d20bd15a7a2879c13e9f64acc48d04af2d] Signed-off-by: Steve Rae s...@broadcom.com --- Changes in v2: None common/aboot.c | 2643 1 file changed, 2643 insertions(+) create mode 100644 common/aboot.c diff --git a/common/aboot.c b/common/aboot.c new file mode 100644 index 000..3b5092d --- /dev/null +++ b/common/aboot.c @@ -0,0 +1,2643 @@ +/* + * Copyright (c) 2009, Google Inc. + * All rights reserved. + * + * Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Linux Foundation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include app.h +#include debug.h +#include arch/arm.h +#include string.h +#include stdlib.h +#include limits.h +#include kernel/thread.h +#include arch/ops.h + +#include dev/flash.h +#include lib/ptable.h +#include dev/keys.h +#include dev/fbcon.h +#include baseband.h +#include target.h +#include mmc.h +#include partition_parser.h +#include platform.h +#include crypto_hash.h +#include malloc.h +#include boot_stats.h +#include sha.h +#include platform/iomap.h +#include boot_device.h + +#if DEVICE_TREE +#include libfdt.h +#include dev_tree.h +#endif + +#include image_verify.h +#include recovery.h +#include bootimg.h +#include fastboot.h +#include sparse_format.h +#include mmc.h +#include devinfo.h +#include board.h +#include scm.h + +extern bool target_use_signed_kernel(void); +extern void platform_uninit(void); +extern void target_uninit(void); +extern int get_target_boot_params(const char *cmdline, const char *part, + char *buf, int buflen); + +void write_device_info_mmc(device_info *dev); +void write_device_info_flash(device_info *dev); + +#define EXPAND(NAME) #NAME +#define TARGET(NAME) EXPAND(NAME) + +#ifdef MEMBASE +#define EMMC_BOOT_IMG_HEADER_ADDR (0xFF000+(MEMBASE)) +#else +#define EMMC_BOOT_IMG_HEADER_ADDR 0xFF000 +#endif + +#ifndef MEMSIZE +#define MEMSIZE 1024*1024 +#endif + +#define MAX_TAGS_SIZE 1024 + +#define RECOVERY_MODE 0x77665502 +#define FASTBOOT_MODE 0x77665500 + +/* make 4096 as default size to ensure EFS,EXT4's erasing */ +#define DEFAULT_ERASE_SIZE 4096 +#define MAX_PANEL_BUF_SIZE 128 + +#define UBI_MAGIC UBI# +#define DISPLAY_DEFAULT_PREFIX mdss_mdp +#define UBI_MAGIC_SIZE 0x04 +#define BOOT_DEV_MAX_LEN 64 + +#define IS_ARM64(ptr) (ptr-magic_64 == KERNEL64_HDR_MAGIC) ? true : false + +#define ADD_OF(a, b) (UINT_MAX - b a) ? (a + b) : UINT_MAX + +#if UFS_SUPPORT +static const char *emmc_cmdline = androidboot.bootdevice=; +#else +static const char *emmc_cmdline = androidboot.emmc=true; +#endif +static const char *usb_sn_cmdline = androidboot.serialno=; +static const char *androidboot_mode = androidboot.mode=; +static const char *loglevel = quiet; +static const char *battchg_pause = androidboot.mode=charger; +static const char *auth_kernel = androidboot.authorized_kernel=true; +static const char *secondary_gpt_enable = gpt; + +static const char *baseband_apq = androidboot.baseband=apq; +static const char *baseband_msm = androidboot.baseband=msm; +static const char *baseband_csfb= androidboot.baseband=csfb; +static const char *baseband_svlte2a = androidboot.baseband=svlte2a; +static const char *baseband_mdm = androidboot.baseband=mdm; +static const char *baseband_mdm2=
Re: [U-Boot] [PATCH v3 0/5] Introducing the Broadcom Cygnus and NSP boards.
On 14-08-11 01:58 PM, Steve Rae wrote: This series adds the bcm958300k and the bcm958622hr boards which share the iproc architecture code. Changes in v3: - remove boards.cfg - improve error checking of configs - add required files for Kconfig Changes in v2: - remove unused include file - reformat multi-line comment(s) - remove deprecated SZ_ definitions - remove misc_init_r() - update CONFIG_ENV_SIZE Scott Branden (4): arm: iproc: Initial commit of iproc architecture code arm: bcmcygnus: Add bcmcygnus u-architecture arm: bcmnsp: Add bcmnsp u-architecture arm: add Cygnus and NSP boards Steve Rae (1): arm: convert Cygnus and NSP boards to Kconfig arch/arm/Kconfig| 8 ++ arch/arm/cpu/armv7/Makefile | 1 + arch/arm/cpu/armv7/bcmcygnus/Makefile | 7 + arch/arm/cpu/armv7/bcmcygnus/reset.c| 20 +++ arch/arm/cpu/armv7/bcmnsp/Makefile | 7 + arch/arm/cpu/armv7/bcmnsp/reset.c | 19 +++ arch/arm/cpu/armv7/iproc-common/Makefile| 9 ++ arch/arm/cpu/armv7/iproc-common/armpll.c| 170 arch/arm/cpu/armv7/iproc-common/hwinit-common.c | 15 +++ arch/arm/cpu/armv7/iproc-common/timer.c | 130 ++ arch/arm/include/asm/arch-bcmcygnus/configs.h | 25 arch/arm/include/asm/arch-bcmnsp/configs.h | 22 +++ arch/arm/include/asm/iproc-common/armpll.h | 14 ++ arch/arm/include/asm/iproc-common/configs.h | 20 +++ arch/arm/include/asm/iproc-common/sysmap.h | 47 +++ arch/arm/include/asm/iproc-common/timer.h | 37 ++ board/broadcom/bcm958300k/Kconfig | 23 board/broadcom/bcm958300k/MAINTAINERS | 6 + board/broadcom/bcm958622hr/Kconfig | 23 board/broadcom/bcm958622hr/MAINTAINERS | 6 + board/broadcom/bcm_ep/Makefile | 7 + board/broadcom/bcm_ep/board.c | 55 configs/bcm958300k_defconfig| 3 + configs/bcm958622hr_defconfig | 3 + include/configs/bcm_ep_board.h | 115 25 files changed, 792 insertions(+) create mode 100644 arch/arm/cpu/armv7/bcmcygnus/Makefile create mode 100644 arch/arm/cpu/armv7/bcmcygnus/reset.c create mode 100644 arch/arm/cpu/armv7/bcmnsp/Makefile create mode 100644 arch/arm/cpu/armv7/bcmnsp/reset.c create mode 100644 arch/arm/cpu/armv7/iproc-common/Makefile create mode 100644 arch/arm/cpu/armv7/iproc-common/armpll.c create mode 100644 arch/arm/cpu/armv7/iproc-common/hwinit-common.c create mode 100644 arch/arm/cpu/armv7/iproc-common/timer.c create mode 100644 arch/arm/include/asm/arch-bcmcygnus/configs.h create mode 100644 arch/arm/include/asm/arch-bcmnsp/configs.h create mode 100644 arch/arm/include/asm/iproc-common/armpll.h create mode 100644 arch/arm/include/asm/iproc-common/configs.h create mode 100644 arch/arm/include/asm/iproc-common/sysmap.h create mode 100644 arch/arm/include/asm/iproc-common/timer.h create mode 100644 board/broadcom/bcm958300k/Kconfig create mode 100644 board/broadcom/bcm958300k/MAINTAINERS create mode 100644 board/broadcom/bcm958622hr/Kconfig create mode 100644 board/broadcom/bcm958622hr/MAINTAINERS create mode 100644 board/broadcom/bcm_ep/Makefile create mode 100644 board/broadcom/bcm_ep/board.c create mode 100644 configs/bcm958300k_defconfig create mode 100644 configs/bcm958622hr_defconfig create mode 100644 include/configs/bcm_ep_board.h Any chance of getting this in soon? ( we have an upcoming release ) Thanks, Steve ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/3] arm: bcm281xx: Add Ethernet Clock support
On 14-08-01 08:37 PM, Steve Rae wrote: From: Jiandong Zheng jdzh...@broadcom.com Enable Ethernet clock when Broadcom StarFighter2 Ethernet block (CONFIG_BCM_SF2_ETH) is enabled. Signed-off-by: Jiandong Zheng jdzh...@broadcom.com Signed-off-by: Steve Rae s...@broadcom.com --- - with the changes to boards.cfg, the board with this feature will be added separately Changes in v2: - removed 'boards.cfg' from this commit - (no other changes) arch/arm/cpu/armv7/bcm281xx/Makefile| 1 + arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c | 34 +++ arch/arm/cpu/armv7/bcm281xx/clk-eth.c | 143 arch/arm/include/asm/arch-bcm281xx/sysmap.h | 3 + 4 files changed, 181 insertions(+) create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-eth.c diff --git a/arch/arm/cpu/armv7/bcm281xx/Makefile b/arch/arm/cpu/armv7/bcm281xx/Makefile index 98f5aa5..bd867a2 100644 --- a/arch/arm/cpu/armv7/bcm281xx/Makefile +++ b/arch/arm/cpu/armv7/bcm281xx/Makefile @@ -9,3 +9,4 @@ obj-y += clk-core.o obj-y += clk-bcm281xx.o obj-y += clk-sdio.o obj-y += clk-bsc.o +obj-$(CONFIG_BCM_SF2_ETH) += clk-eth.o diff --git a/arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c b/arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c index bc8a170..d16b99f 100644 --- a/arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c +++ b/arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c @@ -118,6 +118,16 @@ unsigned long slave_apb_freq_tbl[8] = { 78 * CLOCK_1M }; +unsigned long esub_freq_tbl[8] = { + 78 * CLOCK_1M, + 156 * CLOCK_1M, + 156 * CLOCK_1M, + 156 * CLOCK_1M, + 208 * CLOCK_1M, + 208 * CLOCK_1M, + 208 * CLOCK_1M +}; + static struct bus_clk_data bsc1_apb_data = { .gate = HW_SW_GATE_AUTO(0x0458, 16, 0, 1), }; @@ -295,6 +305,27 @@ static struct ccu_clock kps_ccu_clk = { .freq_tbl = slave_axi_freq_tbl, }; +#ifdef CONFIG_BCM_SF2_ETH +static struct ccu_clock esub_ccu_clk = { + .clk = { + .name = esub_ccu_clk, + .ops = ccu_clk_ops, + .ccu_clk_mgr_base = ESUB_CLK_BASE_ADDR, + }, + .num_policy_masks = 1, + .policy_freq_offset = 0x0008, + .freq_bit_shift = 8, + .policy_ctl_offset = 0x000c, + .policy0_mask_offset = 0x0010, + .policy1_mask_offset = 0x0014, + .policy2_mask_offset = 0x0018, + .policy3_mask_offset = 0x001c, + .lvm_en_offset = 0x0034, + .freq_id = 2, + .freq_tbl = esub_freq_tbl, +}; +#endif + /* * Bus clocks */ @@ -517,6 +548,9 @@ struct clk_lookup arch_clk_tbl[] = { CLK_LK(bsc1_apb), CLK_LK(bsc2_apb), CLK_LK(bsc3_apb), +#ifdef CONFIG_BCM_SF2_ETH + CLK_LK(esub_ccu), +#endif }; /* public array size */ diff --git a/arch/arm/cpu/armv7/bcm281xx/clk-eth.c b/arch/arm/cpu/armv7/bcm281xx/clk-eth.c new file mode 100644 index 000..b0b92b9 --- /dev/null +++ b/arch/arm/cpu/armv7/bcm281xx/clk-eth.c @@ -0,0 +1,143 @@ +/* + * Copyright 2014 Broadcom Corporation. + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include asm/io.h +#include asm/errno.h +#include asm/arch/sysmap.h +#include asm/kona-common/clk.h +#include clk-core.h + +#define WR_ACCESS_ADDR ESUB_CLK_BASE_ADDR +#define WR_ACCESS_PASSWORD 0xA5A500 + +#define PLLE_POST_RESETB_ADDR (ESUB_CLK_BASE_ADDR + 0x0C00) + +#define PLLE_RESETB_ADDR (ESUB_CLK_BASE_ADDR + 0x0C58) +#define PLLE_RESETB_I_PLL_RESETB_PLLE_MASK 0x0001 +#define PLLE_POST_RESETB_I_POST_RESETB_PLLE_MASK 0x0001 + +#define PLL_LOCK_ADDR (ESUB_CLK_BASE_ADDR + 0x0C38) +#define PLL_LOCK_PLL_LOCK_PLLE_MASK0x0001 + +#define ESW_SYS_DIV_ADDR (ESUB_CLK_BASE_ADDR + 0x0A04) +#define ESW_SYS_DIV_PLL_SELECT_MASK0x0300 +#define ESW_SYS_DIV_DIV_MASK 0x001C +#define ESW_SYS_DIV_PLL_VAR_208M_CLK_SELECT0x0100 +#define ESW_SYS_DIV_DIV_SELECT 0x4 +#define ESW_SYS_DIV_TRIGGER_MASK 0x0001 + +#define ESUB_AXI_DIV_DEBUG_ADDR(ESUB_CLK_BASE_ADDR + 0x0E04) +#define ESUB_AXI_DIV_DEBUG_PLL_SELECT_MASK 0x001C +#define ESUB_AXI_DIV_DEBUG_PLL_SELECT_OVERRIDE_MASK0x0040 +#define ESUB_AXI_DIV_DEBUG_PLL_VAR_208M_CLK_SELECT 0x0 +#define ESUB_AXI_DIV_DEBUG_TRIGGER_MASK0x0001 + +#define PLL_MAX_RETRY 100 + +/* Enable appropriate clocks for Ethernet */ +int clk_eth_enable(void) +{ + int rc = -1; + int retry_count = 0; + rc = clk_get_and_enable(esub_ccu_clk); + + /* Enable Access to CCU registers */ + writel((1 | WR_ACCESS_PASSWORD), WR_ACCESS_ADDR); + + writel(readl(PLLE_POST_RESETB_ADDR) + ~PLLE_POST_RESETB_I_POST_RESETB_PLLE_MASK, +
[U-Boot] [U-boot] [Patch 2/4] keystone2: keystone_nav: don't use hard addresses in netcp_pktdma
Use definitions in netcp_pktdma instead direct addresses. The definitions can be set specifically for SoC, so there is no reason to check SoC type while initialization. Acked-by: Vitaly Andrianov vita...@ti.com Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com --- arch/arm/cpu/armv7/keystone/keystone_nav.c | 39 -- arch/arm/include/asm/arch-keystone/hardware-k2hk.h | 13 arch/arm/include/asm/arch-keystone/keystone_nav.h | 4 --- 3 files changed, 27 insertions(+), 29 deletions(-) diff --git a/arch/arm/cpu/armv7/keystone/keystone_nav.c b/arch/arm/cpu/armv7/keystone/keystone_nav.c index 5219f84..46483b1 100644 --- a/arch/arm/cpu/armv7/keystone/keystone_nav.c +++ b/arch/arm/cpu/armv7/keystone/keystone_nav.c @@ -10,11 +10,6 @@ #include asm/io.h #include asm/arch/keystone_nav.h -static int soc_type = -#ifdef CONFIG_SOC_K2HK - k2hk; -#endif - struct qm_config qm_memmap = { .stat_cfg = KS2_QM_QUEUE_STATUS_BASE, .queue = (void *)KS2_QM_MANAGER_QUEUES_BASE, @@ -158,22 +153,21 @@ void queue_close(u32 qnum) ; } -/* +/** * DMA API */ - -struct pktdma_cfg k2hk_netcp_pktdma = { - .global = (struct global_ctl_regs *)0x02004000, - .tx_ch = (struct tx_chan_regs *)0x02004400, - .tx_ch_num = 9, - .rx_ch = (struct rx_chan_regs *)0x02004800, - .rx_ch_num = 26, - .tx_sched = (u32 *)0x02004c00, - .rx_flows = (struct rx_flow_regs *)0x02005000, - .rx_flow_num= 32, - .rx_free_q = 4001, - .rx_rcv_q = 4002, - .tx_snd_q = 648, +struct pktdma_cfg netcp_pktdma = { + .global = (void *)KS2_NETCP_PDMA_CTRL_BASE, + .tx_ch = (void *)KS2_NETCP_PDMA_TX_BASE, + .tx_ch_num = KS2_NETCP_PDMA_TX_CH_NUM, + .rx_ch = (void *)KS2_NETCP_PDMA_RX_BASE, + .rx_ch_num = KS2_NETCP_PDMA_RX_CH_NUM, + .tx_sched = (u32 *)KS2_NETCP_PDMA_SCHED_BASE, + .rx_flows = (void *)KS2_NETCP_PDMA_RX_FLOW_BASE, + .rx_flow_num= KS2_NETCP_PDMA_RX_FLOW_NUM, + .rx_free_q = KS2_NETCP_PDMA_RX_FREE_QUEUE, + .rx_rcv_q = KS2_NETCP_PDMA_RX_RCV_QUEUE, + .tx_snd_q = KS2_NETCP_PDMA_TX_SND_QUEUE, }; struct pktdma_cfg *netcp; @@ -300,12 +294,7 @@ static int _netcp_init(struct pktdma_cfg *netcp_cfg, int netcp_init(struct rx_buff_desc *rx_buffers) { - switch (soc_type) { - case k2hk: - _netcp_init(k2hk_netcp_pktdma, rx_buffers); - return QM_OK; - } - return QM_ERR; + return _netcp_init(netcp_pktdma, rx_buffers); } int netcp_close(void) diff --git a/arch/arm/include/asm/arch-keystone/hardware-k2hk.h b/arch/arm/include/asm/arch-keystone/hardware-k2hk.h index eb132f7..43c2c42 100644 --- a/arch/arm/include/asm/arch-keystone/hardware-k2hk.h +++ b/arch/arm/include/asm/arch-keystone/hardware-k2hk.h @@ -84,4 +84,17 @@ /* Number of DSP cores */ #define KS2_NUM_DSPS 8 +/* NETCP pktdma */ +#define KS2_NETCP_PDMA_CTRL_BASE 0x02004000 +#define KS2_NETCP_PDMA_TX_BASE 0x02004400 +#define KS2_NETCP_PDMA_TX_CH_NUM 9 +#define KS2_NETCP_PDMA_RX_BASE 0x02004800 +#define KS2_NETCP_PDMA_RX_CH_NUM 26 +#define KS2_NETCP_PDMA_SCHED_BASE 0x02004c00 +#define KS2_NETCP_PDMA_RX_FLOW_BASE0x02005000 +#define KS2_NETCP_PDMA_RX_FLOW_NUM 32 +#define KS2_NETCP_PDMA_RX_FREE_QUEUE 4001 +#define KS2_NETCP_PDMA_RX_RCV_QUEUE4002 +#define KS2_NETCP_PDMA_TX_SND_QUEUE648 + #endif /* __ASM_ARCH_HARDWARE_H */ diff --git a/arch/arm/include/asm/arch-keystone/keystone_nav.h b/arch/arm/include/asm/arch-keystone/keystone_nav.h index ab81eaf..646c2f3 100644 --- a/arch/arm/include/asm/arch-keystone/keystone_nav.h +++ b/arch/arm/include/asm/arch-keystone/keystone_nav.h @@ -13,10 +13,6 @@ #include asm/arch/hardware.h #include asm/io.h -enum soc_type_t { - k2hk -}; - #define QM_OK0 #define QM_ERR -1 #define QM_DESC_TYPE_HOST0 -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [U-boot] [Patch 1/4] keystone2: keystone_nav: don't use hard addresses in qm_config
Use definitions in qm_config. The definitions can be set specifically for SoC, so there is no reason to check SoC type while initialization. Acked-by: Vitaly Andrianov vita...@ti.com Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com --- arch/arm/cpu/armv7/keystone/keystone_nav.c| 49 +++ arch/arm/include/asm/arch-keystone/hardware.h | 13 +-- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/arch/arm/cpu/armv7/keystone/keystone_nav.c b/arch/arm/cpu/armv7/keystone/keystone_nav.c index 39d6f99..5219f84 100644 --- a/arch/arm/cpu/armv7/keystone/keystone_nav.c +++ b/arch/arm/cpu/armv7/keystone/keystone_nav.c @@ -15,21 +15,21 @@ static int soc_type = k2hk; #endif -struct qm_config k2hk_qm_memmap = { - .stat_cfg = 0x02a4, - .queue = (struct qm_reg_queue *)0x02a8, - .mngr_vbusm = 0x23a8, - .i_lram = 0x0010, - .proxy = (struct qm_reg_queue *)0x02ac, - .status_ram = 0x02a06000, - .mngr_cfg = (struct qm_cfg_reg *)0x02a02000, - .intd_cfg = 0x02a0c000, - .desc_mem = (struct descr_mem_setup_reg *)0x02a03000, - .region_num = 64, - .pdsp_cmd = 0x02a2, - .pdsp_ctl = 0x02a0f000, - .pdsp_iram = 0x02a1, - .qpool_num = 4000, +struct qm_config qm_memmap = { + .stat_cfg = KS2_QM_QUEUE_STATUS_BASE, + .queue = (void *)KS2_QM_MANAGER_QUEUES_BASE, + .mngr_vbusm = KS2_QM_BASE_ADDRESS, + .i_lram = KS2_QM_LINK_RAM_BASE, + .proxy = (void *)KS2_QM_MANAGER_Q_PROXY_BASE, + .status_ram = KS2_QM_STATUS_RAM_BASE, + .mngr_cfg = (void *)KS2_QM_CONF_BASE, + .intd_cfg = KS2_QM_INTD_CONF_BASE, + .desc_mem = (void *)KS2_QM_DESC_SETUP_BASE, + .region_num = KS2_QM_REGION_NUM, + .pdsp_cmd = KS2_QM_PDSP1_CMD_BASE, + .pdsp_ctl = KS2_QM_PDSP1_CTRL_BASE, + .pdsp_iram = KS2_QM_PDSP1_IRAM_BASE, + .qpool_num = KS2_QM_QPOOL_NUM, }; /* @@ -52,12 +52,9 @@ inline int num_of_desc_to_reg(int num_descr) return 15; } -static int _qm_init(struct qm_config *cfg) +int _qm_init(struct qm_config *cfg) { - u32 j; - - if (cfg == NULL) - return QM_ERR; + u32 j; qm_cfg = cfg; @@ -82,12 +79,7 @@ static int _qm_init(struct qm_config *cfg) int qm_init(void) { - switch (soc_type) { - case k2hk: - return _qm_init(k2hk_qm_memmap); - } - - return QM_ERR; + return _qm_init(qm_memmap); } void qm_close(void) @@ -294,11 +286,8 @@ static int _netcp_init(struct pktdma_cfg *netcp_cfg, /* Disable loopback in the tx direction */ writel(0, netcp-global-emulation_control); -/* TODO: make it dependend on a soc type variable */ -#ifdef CONFIG_SOC_K2HK /* Set QM base address, only for K2x devices */ - writel(0x23a8, netcp-global-qm_base_addr[0]); -#endif + writel(KS2_QM_BASE_ADDRESS, netcp-global-qm_base_addr[0]); /* Enable all channels. The current state isn't important */ for (j = 0; j netcp-tx_ch_num; j++) { diff --git a/arch/arm/include/asm/arch-keystone/hardware.h b/arch/arm/include/asm/arch-keystone/hardware.h index d6726a1..c3f0f46 100644 --- a/arch/arm/include/asm/arch-keystone/hardware.h +++ b/arch/arm/include/asm/arch-keystone/hardware.h @@ -143,11 +143,20 @@ typedef volatile unsigned int *dv_reg_p; #define KS2_EFUSE_BOOTROM (KS2_DEVICE_STATE_CTRL_BASE + 0xc90) /* Queue manager */ -#define KS2_QM_MANAGER_BASE0x02a02000 +#define KS2_QM_BASE_ADDRESS0x23a8 +#define KS2_QM_CONF_BASE 0x02a02000 #define KS2_QM_DESC_SETUP_BASE 0x02a03000 -#define KS2_QM_MANAGER_QUEUES_BASEi0x02a8 +#define KS2_QM_STATUS_RAM_BASE 0x02a06000 +#define KS2_QM_INTD_CONF_BASE 0x02a0c000 +#define KS2_QM_PDSP1_CMD_BASE 0x02a2 +#define KS2_QM_PDSP1_CTRL_BASE 0x02a0f000 +#define KS2_QM_PDSP1_IRAM_BASE 0x02a1 +#define KS2_QM_MANAGER_QUEUES_BASE 0x02a8 #define KS2_QM_MANAGER_Q_PROXY_BASE0x02ac #define KS2_QM_QUEUE_STATUS_BASE 0x02a4 +#define KS2_QM_LINK_RAM_BASE 0x0010 +#define KS2_QM_REGION_NUM 64 +#define KS2_QM_QPOOL_NUM 4000 /* MSMC control */ #define KS2_MSMC_CTRL_BASE 0x0bc0 -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [U-boot] [Patch 3/4] dma: keystone_nav: move keystone_nav driver to driver/dma/
The keystone_nav is used by drivers/net/keystone_net.c driver to send and receive packets, but currently it's placed at keystone arch sources. So it should be in the drivers directory also. It's separate driver that can be used for sending and receiving pktdma packets by others drivers also. This patch just move this driver to appropriate directory and doesn't add any functional changes. Acked-by: Murali Karicheri m-kariche...@ti.com Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com --- arch/arm/cpu/armv7/keystone/Makefile | 1 - .../{arch-keystone = ti-common}/keystone_nav.h| 0 drivers/dma/Makefile | 1 + .../armv7/keystone = drivers/dma}/keystone_nav.c | 54 +++--- drivers/net/keystone_net.c | 2 +- include/configs/k2hk_evm.h | 1 + include/configs/ks2_evm.h | 29 7 files changed, 59 insertions(+), 29 deletions(-) rename arch/arm/include/asm/{arch-keystone = ti-common}/keystone_nav.h (100%) rename {arch/arm/cpu/armv7/keystone = drivers/dma}/keystone_nav.c (83%) diff --git a/arch/arm/cpu/armv7/keystone/Makefile b/arch/arm/cpu/armv7/keystone/Makefile index f8519c0..3d8fb70 100644 --- a/arch/arm/cpu/armv7/keystone/Makefile +++ b/arch/arm/cpu/armv7/keystone/Makefile @@ -12,7 +12,6 @@ obj-$(CONFIG_SOC_K2HK) += clock-k2hk.o obj-$(CONFIG_SOC_K2E) += clock-k2e.o obj-y += cmd_clock.o obj-y += cmd_mon.o -obj-$(CONFIG_DRIVER_TI_KEYSTONE_NET) += keystone_nav.o obj-y += msmc.o obj-$(CONFIG_SPL_BUILD)+= spl.o obj-y += ddr3.o diff --git a/arch/arm/include/asm/arch-keystone/keystone_nav.h b/arch/arm/include/asm/ti-common/keystone_nav.h similarity index 100% rename from arch/arm/include/asm/arch-keystone/keystone_nav.h rename to arch/arm/include/asm/ti-common/keystone_nav.h diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile index 8b2821b..d31c70e 100644 --- a/drivers/dma/Makefile +++ b/drivers/dma/Makefile @@ -9,3 +9,4 @@ obj-$(CONFIG_FSLDMAFEC) += MCD_tasksInit.o MCD_dmaApi.o MCD_tasks.o obj-$(CONFIG_APBH_DMA) += apbh_dma.o obj-$(CONFIG_FSL_DMA) += fsl_dma.o obj-$(CONFIG_OMAP3_DMA) += omap3_dma.o +obj-$(CONFIG_TI_KSNAV) += keystone_nav.o diff --git a/arch/arm/cpu/armv7/keystone/keystone_nav.c b/drivers/dma/keystone_nav.c similarity index 83% rename from arch/arm/cpu/armv7/keystone/keystone_nav.c rename to drivers/dma/keystone_nav.c index 46483b1..d960fbb 100644 --- a/arch/arm/cpu/armv7/keystone/keystone_nav.c +++ b/drivers/dma/keystone_nav.c @@ -8,23 +8,23 @@ */ #include common.h #include asm/io.h -#include asm/arch/keystone_nav.h +#include asm/ti-common/keystone_nav.h struct qm_config qm_memmap = { - .stat_cfg = KS2_QM_QUEUE_STATUS_BASE, - .queue = (void *)KS2_QM_MANAGER_QUEUES_BASE, - .mngr_vbusm = KS2_QM_BASE_ADDRESS, - .i_lram = KS2_QM_LINK_RAM_BASE, - .proxy = (void *)KS2_QM_MANAGER_Q_PROXY_BASE, - .status_ram = KS2_QM_STATUS_RAM_BASE, - .mngr_cfg = (void *)KS2_QM_CONF_BASE, - .intd_cfg = KS2_QM_INTD_CONF_BASE, - .desc_mem = (void *)KS2_QM_DESC_SETUP_BASE, - .region_num = KS2_QM_REGION_NUM, - .pdsp_cmd = KS2_QM_PDSP1_CMD_BASE, - .pdsp_ctl = KS2_QM_PDSP1_CTRL_BASE, - .pdsp_iram = KS2_QM_PDSP1_IRAM_BASE, - .qpool_num = KS2_QM_QPOOL_NUM, + .stat_cfg = CONFIG_KSNAV_QM_QUEUE_STATUS_BASE, + .queue = (void *)CONFIG_KSNAV_QM_MANAGER_QUEUES_BASE, + .mngr_vbusm = CONFIG_KSNAV_QM_BASE_ADDRESS, + .i_lram = CONFIG_KSNAV_QM_LINK_RAM_BASE, + .proxy = (void *)CONFIG_KSNAV_QM_MANAGER_Q_PROXY_BASE, + .status_ram = CONFIG_KSNAV_QM_STATUS_RAM_BASE, + .mngr_cfg = (void *)CONFIG_KSNAV_QM_CONF_BASE, + .intd_cfg = CONFIG_KSNAV_QM_INTD_CONF_BASE, + .desc_mem = (void *)CONFIG_KSNAV_QM_DESC_SETUP_BASE, + .region_num = CONFIG_KSNAV_QM_REGION_NUM, + .pdsp_cmd = CONFIG_KSNAV_QM_PDSP1_CMD_BASE, + .pdsp_ctl = CONFIG_KSNAV_QM_PDSP1_CTRL_BASE, + .pdsp_iram = CONFIG_KSNAV_QM_PDSP1_IRAM_BASE, + .qpool_num = CONFIG_KSNAV_QM_QPOOL_NUM, }; /* @@ -157,17 +157,17 @@ void queue_close(u32 qnum) * DMA API */ struct pktdma_cfg netcp_pktdma = { - .global = (void *)KS2_NETCP_PDMA_CTRL_BASE, - .tx_ch = (void *)KS2_NETCP_PDMA_TX_BASE, - .tx_ch_num = KS2_NETCP_PDMA_TX_CH_NUM, - .rx_ch = (void *)KS2_NETCP_PDMA_RX_BASE, - .rx_ch_num = KS2_NETCP_PDMA_RX_CH_NUM, - .tx_sched = (u32 *)KS2_NETCP_PDMA_SCHED_BASE, - .rx_flows = (void *)KS2_NETCP_PDMA_RX_FLOW_BASE, - .rx_flow_num= KS2_NETCP_PDMA_RX_FLOW_NUM, - .rx_free_q = KS2_NETCP_PDMA_RX_FREE_QUEUE, - .rx_rcv_q = KS2_NETCP_PDMA_RX_RCV_QUEUE, - .tx_snd_q
[U-Boot] [U-boot] [Patch 0/4] keystone2: generalize navigator driver usage
This series generalize keystone_nav driver usage in order to add keystone2 K2E/K2L SoCs support. Based on [U-boot] [Patch] keystone2: use readl/writel functions instead of redefinition http://patchwork.ozlabs.org/patch/383829 Ivan Khoronzhuk (4): keystone2: keystone_nav: don't use hard addresses in qm_config keystone2: keystone_nav: don't use hard addresses in netcp_pktdma dma: keystone_nav: move keystone_nav driver to driver/dma/ dma: keystone_nav: generalize driver usage arch/arm/cpu/armv7/keystone/Makefile | 1 - arch/arm/include/asm/arch-keystone/hardware-k2hk.h | 13 ++ arch/arm/include/asm/arch-keystone/hardware.h | 13 +- .../{arch-keystone = ti-common}/keystone_nav.h| 16 +- drivers/dma/Makefile | 1 + .../armv7/keystone = drivers/dma}/keystone_nav.c | 196 - drivers/dma/keystone_nav_cfg.c | 27 +++ drivers/net/keystone_net.c | 15 +- include/configs/k2hk_evm.h | 2 + include/configs/ks2_evm.h | 29 +++ 10 files changed, 174 insertions(+), 139 deletions(-) rename arch/arm/include/asm/{arch-keystone = ti-common}/keystone_nav.h (91%) rename {arch/arm/cpu/armv7/keystone = drivers/dma}/keystone_nav.c (53%) create mode 100644 drivers/dma/keystone_nav_cfg.c -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot