Re: [U-Boot] [PATCH v5 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE
Hi Rajeshwari, On Fri, 14 Feb 2014 12:58:58 +0530, Rajeshwari Birje rajeshwari.bi...@gmail.com wrote: Hi All, For exynos5250 board we use CONFIG_SKIP_LOWLEVEL_INIT, hence change in board/samsung/smdk5250/lowlevel_init.S should not effect. Infact I feel that file can be removed. If so then please post a separate patch for this removal, which is logically unrelated to removing symbol offsets. Regards, Rajeshwari Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Exynos5250: Remove lowlevelinit
From: Rajeshwari S Shinde rajeshwar...@samsung.com Since we use CONFIG_SKIP_LOWLEVEL_INIT for Exynos baords, we dont need to a lowlevel_init.S file. Signed-off-by: Rajeshwari S Shinde rajeshwar...@samsung.com --- board/samsung/smdk5250/lowlevel_init.S | 82 -- 1 file changed, 82 deletions(-) delete mode 100644 board/samsung/smdk5250/lowlevel_init.S diff --git a/board/samsung/smdk5250/lowlevel_init.S b/board/samsung/smdk5250/lowlevel_init.S deleted file mode 100644 index 9003e2d..000 --- a/board/samsung/smdk5250/lowlevel_init.S +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Lowlevel setup for SMDK5250 board based on S5PC520 - * - * Copyright (C) 2012 Samsung Electronics - * - * SPDX-License-Identifier:GPL-2.0+ - */ - -#include config.h -#include version.h -#include asm/arch/cpu.h - -_TEXT_BASE: - .word CONFIG_SYS_TEXT_BASE - - .globl lowlevel_init -lowlevel_init: - - /* use iRAM stack in bl2 */ - ldr sp, =CONFIG_IRAM_STACK - stmdb r13!, {ip,lr} - - /* check reset status */ - ldr r0, =(EXYNOS5_POWER_BASE + INFORM1_OFFSET) - ldr r1, [r0] - - /* AFTR wakeup reset */ - ldr r2, =S5P_CHECK_DIDLE - cmp r1, r2 - beq exit_wakeup - - /* LPA wakeup reset */ - ldr r2, =S5P_CHECK_LPA - cmp r1, r2 - beq exit_wakeup - - /* Sleep wakeup reset */ - ldr r2, =S5P_CHECK_SLEEP - cmp r1, r2 - beq wakeup_reset - - /* -* If U-boot is already running in RAM, no need to relocate U-Boot. -* Memory controller must be configured before relocating U-Boot -* in ram. -*/ - ldr r0, =0x0ff /* r0 - Mask Bits*/ - bic r1, pc, r0 /* pc - current addr of code */ - /* r1 - unmasked bits of pc */ - ldr r2, _TEXT_BASE /* r2 - original base addr in ram */ - bic r2, r2, r0 /* r2 - unmasked bits of r2*/ - cmp r1, r2 /* compare r1, r2 */ - beq 1f /* r0 == r1 then skip sdram init */ - - /* init system clock */ - bl system_clock_init - - /* Memory initialize */ - bl mem_ctrl_init - -1: - bl arch_cpu_init - bl tzpc_init - ldmia r13!, {ip,pc} - -wakeup_reset: - bl system_clock_init - bl mem_ctrl_init - bl arch_cpu_init - bl tzpc_init - -exit_wakeup: - /* Load return address and jump to kernel */ - ldr r0, =(EXYNOS5_POWER_BASE + INFORM0_OFFSET) - - /* r1 = physical address of exynos5_cpu_resume function*/ - ldr r1, [r0] - - /* Jump to kernel */ - mov pc, r1 - nop - nop -- 1.7.12.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v5 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE
Hi Albert, On Fri, Feb 14, 2014 at 1:38 PM, Albert ARIBAUD albert.u.b...@aribaud.net wrote: Hi Rajeshwari, On Fri, 14 Feb 2014 12:58:58 +0530, Rajeshwari Birje rajeshwari.bi...@gmail.com wrote: Hi All, For exynos5250 board we use CONFIG_SKIP_LOWLEVEL_INIT, hence change in board/samsung/smdk5250/lowlevel_init.S should not effect. Infact I feel that file can be removed. If so then please post a separate patch for this removal, which is logically unrelated to removing symbol offsets. Yes will do that. -- Regards, Rajeshwari Shinde Regards, Rajeshwari Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] arm: omap3: Fix tao3530/omap3_ha SPL boot hangup (GPIO clocks not enabled)
Patch f33b9bd3 [arm: omap3: Enable clocks for peripherals only if they are used] breaks SPL booting on tao3530. Since some gpio input's are read to detect the board revision. But with this patch above, the clocks to the GPIO subsystems are not enabled per default any more. The GPIO banks need to be configured specifically now. Signed-off-by: Stefan Roese s...@denx.de Cc: Tom Rini tr...@ti.com Cc: Michael Trimarchi mich...@amarulasolutions.com --- include/configs/tao3530.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/configs/tao3530.h b/include/configs/tao3530.h index 9abfe82..9c04c23 100644 --- a/include/configs/tao3530.h +++ b/include/configs/tao3530.h @@ -83,6 +83,13 @@ #define CONFIG_OMAP_HSMMC #define CONFIG_DOS_PARTITION +/* GPIO banks */ +#define CONFIG_OMAP3_GPIO_2/* GPIO32 ..63 is in GPIO bank 2 */ +#define CONFIG_OMAP3_GPIO_3/* GPIO64 ..95 is in GPIO bank 3 */ +#define CONFIG_OMAP3_GPIO_4/* GPIO96 ..127 is in GPIO bank 4 */ +#define CONFIG_OMAP3_GPIO_5/* GPIO128..159 is in GPIO bank 5 */ +#define CONFIG_OMAP3_GPIO_6/* GPIO160..191 is in GPIO bank 6 */ + /* commands to include */ #include config_cmd_default.h -- 1.8.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 10/12] board:universal: Enable device tree on Universal
Hello Piotr, On 02/13/2014 03:10 PM, Piotr Wilczek wrote: This patch enables to run Universal board on device tree. Signed-off-by: Piotr Wilczek p.wilc...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com Cc: Przemyslaw Marczak p.marc...@samsung.com Cc: Minkyu Kang mk7.k...@samsung.com --- Acked-by: Przemyslaw Marczak p.marc...@samsung.com -- 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] usb: create common header virtual root hub descriptors
On Friday, February 14, 2014 at 05:16:58 AM, Stephen Warren wrote: On 02/13/2014 01:44 PM, Marek Vasut wrote: On Thursday, February 13, 2014 at 06:42:18 AM, Stephen Warren wrote: Many USB host controller drivers contain almost identical copies of the same virtual root hub descriptors. Put these into a common file to avoid duplication. Note that there were some very minor differences between the descriptors in the various files, such as: - USB 1.0 vs. USB 1.1 - Manufacturer/Device ID - Max packet size - String content I assume these aren't relevant. Please CC the driver authors so we can be sure. OK, I've done so. It's pretty unclear who the relevant driver authors or maintainers are for most of the files, so I cast a wide net from git log, doc/git-mailrc, and (c) messages in the file. I don't expect the message to make it to the list because of the Cc count. I doubt many people will respond. I hoped this would be the kind of call you could make yourself as the USB stack maintainer. Sorry, I cannot. I have no clue about _all_ the hardware out there. That's why I want opinion of the hardware maintainers. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Exynos5250: Remove lowlevelinit
Hi Rajeshwari, On Fri, 14 Feb 2014 13:52:48 +0530, Rajeshwari Shinde rajeshwar...@samsung.com wrote: From: Rajeshwari S Shinde rajeshwar...@samsung.com Since we use CONFIG_SKIP_LOWLEVEL_INIT for Exynos baords, we dont need to a lowlevel_init.S file. Signed-off-by: Rajeshwari S Shinde rajeshwar...@samsung.com --- Builds fine on my side, and as it just removes dead code, I've assigned this patch to myself and will include it in my next PR. Thanks! Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 05/12] board:samsung:common: remove unused max77686 init function
Hi Rajeshwari, -Original Message- From: Rajeshwari Birje [mailto:rajeshwari.bi...@gmail.com] Sent: Friday, February 14, 2014 6:32 AM To: Piotr Wilczek Cc: u-boot@lists.denx.de; Jaehoon Chung; Kyungmin Park; Rajeshwari S Shinde Subject: Re: [U-Boot] [PATCH V2 05/12] board:samsung:common: remove unused max77686 init function Hi Piotr, On Thu, Feb 13, 2014 at 7:40 PM, Piotr Wilczek p.wilc...@samsung.com wrote: This patch removes currently unused max77686_init function. Despite being not used, it's implementation is board specific. MAX77686 is required for 5250, but missed it somehow when adding 5420 support and making a common config file for both. It is my mistake will correct the same You can refer: [U-Boot] [PATCH V5 0/6] SMDK5420: Add S2MPS11 pmic support to SMDK5420 by Leela Krishna Amudala It adds a generic way for PMIC support. http://lists.denx.de/pipermail/u-boot/2014-January/171113.html MAX77686 is also used at Trats2 so max77686_init must be either generic based on DT or moved to the board file. Best regards, Piotr Regards, Rajeshwari Signed-off-by: Piotr Wilczek p.wilc...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com Cc: Rajeshwari S Shinde rajeshwar...@samsung.com Cc: Minkyu Kang mk7.k...@samsung.com --- Changes for v2: - new patch board/samsung/common/board.c | 120 -- 1 file changed, 120 deletions(-) diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index cd873bc..3ac8005 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -22,7 +22,6 @@ #include asm/arch/power.h #include power/pmic.h #include asm/arch/sromc.h -#include power/max77686_pmic.h DECLARE_GLOBAL_DATA_PTR; @@ -160,133 +159,14 @@ static int board_init_cros_ec_devices(const void *blob) } #endif -#if defined(CONFIG_POWER) -#ifdef CONFIG_POWER_MAX77686 -static int pmic_reg_update(struct pmic *p, int reg, uint regval) -{ - u32 val; - int ret = 0; - - ret = pmic_reg_read(p, reg, val); - if (ret) { - debug(%s: PMIC %d register read failed\n, __func__, reg); - return -1; - } - val |= regval; - ret = pmic_reg_write(p, reg, val); - if (ret) { - debug(%s: PMIC %d register write failed\n, __func__, reg); - return -1; - } - return 0; -} - -static int max77686_init(void) -{ - struct pmic *p; - - if (pmic_init(I2C_PMIC)) - return -1; - - p = pmic_get(MAX77686_PMIC); - if (!p) - return -ENODEV; - - if (pmic_probe(p)) - return -1; - - if (pmic_reg_update(p, MAX77686_REG_PMIC_32KHZ, MAX77686_32KHCP_EN)) - return -1; - - if (pmic_reg_update(p, MAX77686_REG_PMIC_BBAT, - MAX77686_BBCHOSTEN | MAX77686_BBCVS_3_5V)) - return -1; - - /* VDD_MIF */ - if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK1OUT, - MAX77686_BUCK1OUT_1V)) { - debug(%s: PMIC %d register write failed\n, __func__, - MAX77686_REG_PMIC_BUCK1OUT); - return -1; - } - - if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK1CRTL, - MAX77686_BUCK1CTRL_EN)) - return -1; - - /* VDD_ARM */ - if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK2DVS1, - MAX77686_BUCK2DVS1_1_3V)) { - debug(%s: PMIC %d register write failed\n, __func__, - MAX77686_REG_PMIC_BUCK2DVS1); - return -1; - } - - if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK2CTRL1, - MAX77686_BUCK2CTRL_ON)) - return -1; - - /* VDD_INT */ - if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK3DVS1, - MAX77686_BUCK3DVS1_1_0125V)) { - debug(%s: PMIC %d register write failed\n, __func__, - MAX77686_REG_PMIC_BUCK3DVS1); - return -1; - } - - if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK3CTRL, - MAX77686_BUCK3CTRL_ON)) - return -1; - - /* VDD_G3D */ - if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK4DVS1, - MAX77686_BUCK4DVS1_1_2V)) { - debug(%s: PMIC %d register write failed\n, __func__, - MAX77686_REG_PMIC_BUCK4DVS1); - return -1; - } - - if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK4CTRL1, - MAX77686_BUCK3CTRL_ON)) - return -1; - - /* VDD_LDO2 */ - if (pmic_reg_update(p,
[U-Boot] net: tsec: Pending patches
Hello, Would you please consider applying these two net tree patches? http://patchwork.ozlabs.org/patch/299620/ (net: Merge asm/fsl_enet.h into fsl_mdio.h) http://patchwork.ozlabs.org/patch/299447/ (net: tsec: Fix NULL access in case init_phy() fails) Thanks, Claudiu ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] T1040 booting from NOR Flash
2014-02-13 1:56 GMT+01:00 Rommel G Custodio sessyargc+u-b...@gmail.com: Dear Franck Jullien, Franck Jullien franck.jullien at gmail.com writes: Hi, I'd like to know if I have understood it correctly. When first time booting from NOR, the RCW and PBI must be written using the JTAG. The last instruction of the PBI must be a jump (0x13_8080) to the user's code (uboot here). You should not need to bring out the JTAG. The build process for other FSL boards that require RCW (i.e. P5040) can create a single binary that includes RCW, PBI, and u-boot. BUT the T1040 right now does not have a build target that creates this binary! It seems FSL hasn't gotten about to creating it yet (not in mailine, not in patchworks, none in the FSL SDK). Am I right ? Best regards, Franck. All the best, Rommel ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot I did see other platforms generates PBL images with RCW and PBI built-in. However, this is always with CONFIG_RAMBOOT_PBL set (SPI, NAND or SD-CARD boot). This is the memory map described in the t104xrdb/README file: NOR Flash memory Map - 163 Start End Definition Size 164 0xEFF4 0xEFFF u-boot (current bank)768KB 177 0xE800 0xE801 RCW (current bank) 128KB For me, it means the RCW will not be included in the u-boot binary. Franck. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] U-Boot XML support
Hi folks, In future i have the need to fetch some settings (display timings, mac-addresses) from an XML file stored in some flash. This is necessary for having only one configuration space for the bootloader and the OS. The OS is VxWorks which uses this information too. So my question, is there any support for reading XML in u-boot ? Best regards, Hannes ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] U-Boot XML support
Hi Hannes, On Fri, 14 Feb 2014 10:25:00 - (UTC), Hannes Petermaier han...@petermaier.org wrote: Hi folks, In future i have the need to fetch some settings (display timings, mac-addresses) from an XML file stored in some flash. This is necessary for having only one configuration space for the bootloader and the OS. The OS is VxWorks which uses this information too. So my question, is there any support for reading XML in u-boot ? No, there isn't, as a 'git grep -i xml' shows: XML is only mentioned in the doc/DocBook and tools/kernel-doc directories. But since you'll need to provision the file onto the target anyway, you just need to pass it through script which will convert it into U-Boot environment variables. Best regards, Hannes Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] usb: tegra: Fix PHY configuration for Tegra 3
On Fri, 2014-02-14 at 03:21 +0800, Stefan Agner wrote: On Tegra 3, the PTS (parallel transceiver select) and STS (serial transceiver select) are part of the HOSTPC1_DEVLC_0 register rather than PORTSC1_0 register. Since the reset configuration usually matches the configured registers, this error did not show up on Tegra 3 devices. Also clear the forced powerdown bit in the UTMIP_PLL_CFG2_0 register which brings USB2 in UTMI mode to work. This was clearly missing since the forced powerdown bit is set in reset by default for all USB ports. Signed-off-by: Stefan Agner ste...@agner.ch --- drivers/usb/host/ehci-tegra.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 0b42aa5..fdd56c9 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -461,6 +461,9 @@ static int init_utmi_usb_controller(struct fdt_usb *config) if (config-periph_id == PERIPH_ID_USBD) clrbits_le32(clkrst-crc_utmip_pll_cfg2, UTMIP_FORCE_PD_SAMP_A_POWERDOWN); + if (config-periph_id == PERIPH_ID_USB2) + clrbits_le32(clkrst-crc_utmip_pll_cfg2, + UTMIP_FORCE_PD_SAMP_B_POWERDOWN); if (config-periph_id == PERIPH_ID_USB3) clrbits_le32(clkrst-crc_utmip_pll_cfg2, UTMIP_FORCE_PD_SAMP_C_POWERDOWN); @@ -483,9 +486,15 @@ static int init_utmi_usb_controller(struct fdt_usb *config) clrbits_le32(usbctlr-icusb_ctrl, IC_ENB1); /* Select UTMI parallel interface */ - clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, - PTS_UTMI PTS_SHIFT); - clrbits_le32(usbctlr-port_sc1, STS); + if (!controller-has_hostpc) { + clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, + PTS_UTMI PTS_SHIFT); + clrbits_le32(usbctlr-port_sc1, STS); + } else { + clrsetbits_le32(usbctlr-hostpc1_devlc, PTS_MASK, + PTS_UTMI PTS_SHIFT); + clrbits_le32(usbctlr-hostpc1_devlc, STS); + } Could you help to change above code like this? Thanks. + if (!controller-has_hostpc) { + if (config-periph_id == PERIPH_ID_USBD) { + clrsetbits_le32(usbctlr-port_sc1, PTS1_MASK, + PTS_UTMI PTS1_SHIFT); + clrbits_le32(usbctlr-port_sc1, STS1); + } else { + clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, + PTS_UTMI PTS_SHIFT); + clrbits_le32(usbctlr-port_sc1, STS); + } + } else { + clrsetbits_le32(usbctlr-hostpc1_devlc, PTS_MASK, + PTS_UTMI PTS_SHIFT); + clrbits_le32(usbctlr-hostpc1_devlc, STS); + } Others look good. --nvpublic ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: omap3: Fix tao3530/omap3_ha SPL boot hangup (GPIO clocks not enabled)
Hi Stefan, On 14/02/2014 09:47, Stefan Roese wrote: Patch f33b9bd3 [arm: omap3: Enable clocks for peripherals only if they are used] breaks SPL booting on tao3530. Since some gpio input's are read to detect the board revision. But with this patch above, the clocks to the GPIO subsystems are not enabled per default any more. The GPIO banks need to be configured specifically now. Signed-off-by: Stefan Roese s...@denx.de Cc: Tom Rini tr...@ti.com Cc: Michael Trimarchi mich...@amarulasolutions.com --- include/configs/tao3530.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/configs/tao3530.h b/include/configs/tao3530.h index 9abfe82..9c04c23 100644 --- a/include/configs/tao3530.h +++ b/include/configs/tao3530.h @@ -83,6 +83,13 @@ #define CONFIG_OMAP_HSMMC #define CONFIG_DOS_PARTITION +/* GPIO banks */ +#define CONFIG_OMAP3_GPIO_2 /* GPIO32 ..63 is in GPIO bank 2 */ +#define CONFIG_OMAP3_GPIO_3 /* GPIO64 ..95 is in GPIO bank 3 */ +#define CONFIG_OMAP3_GPIO_4 /* GPIO96 ..127 is in GPIO bank 4 */ +#define CONFIG_OMAP3_GPIO_5 /* GPIO128..159 is in GPIO bank 5 */ +#define CONFIG_OMAP3_GPIO_6 /* GPIO160..191 is in GPIO bank 6 */ + /* commands to include */ #include config_cmd_default.h I confirm the issue, I will send a similar patch for the mcx board. Reviewed-by: Stefano Babic sba...@denx.de Best regards, Stefano Babic -- = DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 05/12] board:samsung:common: remove unused max77686 init function
Hi Piotr, On Fri, Feb 14, 2014 at 3:18 PM, Piotr Wilczek p.wilc...@samsung.com wrote: Hi Rajeshwari, -Original Message- From: Rajeshwari Birje [mailto:rajeshwari.bi...@gmail.com] Sent: Friday, February 14, 2014 6:32 AM To: Piotr Wilczek Cc: u-boot@lists.denx.de; Jaehoon Chung; Kyungmin Park; Rajeshwari S Shinde Subject: Re: [U-Boot] [PATCH V2 05/12] board:samsung:common: remove unused max77686 init function Hi Piotr, On Thu, Feb 13, 2014 at 7:40 PM, Piotr Wilczek p.wilc...@samsung.com wrote: This patch removes currently unused max77686_init function. Despite being not used, it's implementation is board specific. MAX77686 is required for 5250, but missed it somehow when adding 5420 support and making a common config file for both. It is my mistake will correct the same You can refer: [U-Boot] [PATCH V5 0/6] SMDK5420: Add S2MPS11 pmic support to SMDK5420 by Leela Krishna Amudala It adds a generic way for PMIC support. http://lists.denx.de/pipermail/u-boot/2014-January/171113.html MAX77686 is also used at Trats2 so max77686_init must be either generic based on DT or moved to the board file. Generic in the sense you want all registers to be set and there values have to come from DT file? Which ever you feel OK is fine with me. Regards, Rajeshwari Best regards, Piotr Regards, Rajeshwari Signed-off-by: Piotr Wilczek p.wilc...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com Cc: Rajeshwari S Shinde rajeshwar...@samsung.com Cc: Minkyu Kang mk7.k...@samsung.com --- Changes for v2: - new patch board/samsung/common/board.c | 120 -- 1 file changed, 120 deletions(-) diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index cd873bc..3ac8005 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -22,7 +22,6 @@ #include asm/arch/power.h #include power/pmic.h #include asm/arch/sromc.h -#include power/max77686_pmic.h DECLARE_GLOBAL_DATA_PTR; @@ -160,133 +159,14 @@ static int board_init_cros_ec_devices(const void *blob) } #endif -#if defined(CONFIG_POWER) -#ifdef CONFIG_POWER_MAX77686 -static int pmic_reg_update(struct pmic *p, int reg, uint regval) -{ - u32 val; - int ret = 0; - - ret = pmic_reg_read(p, reg, val); - if (ret) { - debug(%s: PMIC %d register read failed\n, __func__, reg); - return -1; - } - val |= regval; - ret = pmic_reg_write(p, reg, val); - if (ret) { - debug(%s: PMIC %d register write failed\n, __func__, reg); - return -1; - } - return 0; -} - -static int max77686_init(void) -{ - struct pmic *p; - - if (pmic_init(I2C_PMIC)) - return -1; - - p = pmic_get(MAX77686_PMIC); - if (!p) - return -ENODEV; - - if (pmic_probe(p)) - return -1; - - if (pmic_reg_update(p, MAX77686_REG_PMIC_32KHZ, MAX77686_32KHCP_EN)) - return -1; - - if (pmic_reg_update(p, MAX77686_REG_PMIC_BBAT, - MAX77686_BBCHOSTEN | MAX77686_BBCVS_3_5V)) - return -1; - - /* VDD_MIF */ - if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK1OUT, - MAX77686_BUCK1OUT_1V)) { - debug(%s: PMIC %d register write failed\n, __func__, - MAX77686_REG_PMIC_BUCK1OUT); - return -1; - } - - if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK1CRTL, - MAX77686_BUCK1CTRL_EN)) - return -1; - - /* VDD_ARM */ - if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK2DVS1, - MAX77686_BUCK2DVS1_1_3V)) { - debug(%s: PMIC %d register write failed\n, __func__, - MAX77686_REG_PMIC_BUCK2DVS1); - return -1; - } - - if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK2CTRL1, - MAX77686_BUCK2CTRL_ON)) - return -1; - - /* VDD_INT */ - if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK3DVS1, - MAX77686_BUCK3DVS1_1_0125V)) { - debug(%s: PMIC %d register write failed\n, __func__, - MAX77686_REG_PMIC_BUCK3DVS1); - return -1; - } - - if (pmic_reg_update(p, MAX77686_REG_PMIC_BUCK3CTRL, - MAX77686_BUCK3CTRL_ON)) - return -1; - - /* VDD_G3D */ - if (pmic_reg_write(p, MAX77686_REG_PMIC_BUCK4DVS1, - MAX77686_BUCK4DVS1_1_2V)) { - debug(%s: PMIC %d register write failed\n, __func__, - MAX77686_REG_PMIC_BUCK4DVS1); -
[U-Boot] [PATCH v1 3/3] OMAP3: fix default environment for mcx board
Patch allows to load a script at the startup from MMC. Signed-off-by: Stefano Babic sba...@denx.de --- include/configs/mcx.h |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/configs/mcx.h b/include/configs/mcx.h index 209c2bb..7c5c2f4 100644 --- a/include/configs/mcx.h +++ b/include/configs/mcx.h @@ -264,10 +264,9 @@ ${mtdparts} \ vram=6M omapfb.vram=1:2M,2:2M,3:2M\ omapdss.def_disp=lcd; \ - bootm 0x8200 0x8400\0 - -#define CONFIG_BOOTCOMMAND \ - run nandboot + bootm 0x8200 0x8400\0 \ + bootcmd=mmc rescan;if fatload mmc 0 8200 loadbootscr.scr; \ + then source 8200;else run nandboot;fi\0 #define CONFIG_AUTO_COMPLETE #define CONFIG_CMDLINE_EDITING -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v1 2/3] omap3: fix pinmux for mcx board
New hardware version cannot recognize the SD-Card because the SYS_NRESWARM, set as GPIO, does not guarantee the required reset time. Change the pin function back to enable the SYS_NRESWARM signal driven by the SOC. Signed-off-by: Stefano Babic sba...@denx.de --- board/htkw/mcx/mcx.h |2 -- 1 file changed, 2 deletions(-) diff --git a/board/htkw/mcx/mcx.h b/board/htkw/mcx/mcx.h index 703dbec..17c122c 100644 --- a/board/htkw/mcx/mcx.h +++ b/board/htkw/mcx/mcx.h @@ -325,8 +325,6 @@ const omap3_sysinfo sysinfo = { MUX_VAL(CP(SYS_32K),(IEN | PTD | EN | M4)) \ MUX_VAL(CP(SYS_CLKREQ), (IEN | PTD | DIS | M0)) \ MUX_VAL(CP(SYS_NIRQ), (IEN | PTD | EN | M4)) \ - MUX_VAL(CP(SYS_NRESWARM), (IEN | PTU | DIS | M4)) \ - /* SYS_nRESWARM */\ MUX_VAL(CP(SYS_BOOT0), (IEN | PTD | DIS | M4)) \ MUX_VAL(CP(SYS_BOOT1), (IEN | PTD | DIS | M4)) \ MUX_VAL(CP(SYS_BOOT2), (IEN | PTD | DIS | M4)) \ -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v1 1/3] OMAP3: add missing gpio clock init and fix NAND SPL for mcx board
Patch contains the same fixes as commit 4b9b2c300a23ca4a85811918dc92e822a9571a87 (missing CONFIG_OMAP3_GPIO_2) and commit f9095aac793aa8917ab9b915c5d449e6dc8d3d30 (missing CONFIG_SPL_NAND_SOFTECC). Same issues are relevant for the mcx board, too. Signed-off-by: Stefano Babic sba...@denx.de --- include/configs/mcx.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include/configs/mcx.h b/include/configs/mcx.h index dcd29ce..209c2bb 100644 --- a/include/configs/mcx.h +++ b/include/configs/mcx.h @@ -98,6 +98,7 @@ /* EHCI */ #define CONFIG_USB_STORAGE +#define CONFIG_OMAP3_GPIO_2 #define CONFIG_OMAP3_GPIO_5 #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_OMAP @@ -395,6 +396,7 @@ #define CONFIG_SYS_NAND_ECCSIZE256 #define CONFIG_SYS_NAND_ECCBYTES 3 #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_SW +#define CONFIG_SPL_NAND_SOFTECC #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Exynos5250: Remove lowlevelinit
Hi Albert, On Fri, Feb 14, 2014 at 3:11 PM, Albert ARIBAUD albert.u.b...@aribaud.net wrote: Hi Rajeshwari, On Fri, 14 Feb 2014 13:52:48 +0530, Rajeshwari Shinde rajeshwar...@samsung.com wrote: From: Rajeshwari S Shinde rajeshwar...@samsung.com Since we use CONFIG_SKIP_LOWLEVEL_INIT for Exynos baords, we dont need to a lowlevel_init.S file. Signed-off-by: Rajeshwari S Shinde rajeshwar...@samsung.com --- Builds fine on my side, and as it just removes dead code, I've assigned this patch to myself and will include it in my next PR. Thanks! Sure Thanx -- Regards, Rajeshwari Shinde Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 5/9] fdt_support: refactor fdt_fixup_stdout() function
- Do not use a deep indentation. We have only 80-character on each line and 1 indentation consumes 8 spaces. Before the code moves far to the right, you should consider to fix your code. See Linux Documentation/CodingStyle. - Add CONFIG_OF_STDOUT_VIA_ALIAS and OF_STDOUT_PATH macros only to their definition. Do not add them to both callee and caller. This is a tip to avoid using #ifdef everywhere. - OF_STDOUT_PATH and CONFIG_OF_STDOUT_VIA_ALIAS are exclusive. If both are defined, the former takes precedence. Do not try to fix-up linux,stdout-path property twice. Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com --- common/fdt_support.c | 85 ++-- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index c714ffa..f641e68 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -123,9 +123,14 @@ static int fdt_find_or_add_subnode(void *fdt, int parentoffset, return offset; } -#ifdef CONFIG_OF_STDOUT_VIA_ALIAS - -#ifdef CONFIG_CONS_INDEX +/* rename to CONFIG_OF_STDOUT_PATH ? */ +#if defined(OF_STDOUT_PATH) +static int fdt_fixup_stdout(void *fdt, int chosenoff) +{ + return fdt_setprop(fdt, chosenoff, linux,stdout-path, + OF_STDOUT_PATH, strlen(OF_STDOUT_PATH) + 1); +} +#elif defined(CONFIG_OF_STDOUT_VIA_ALIAS) defined(CONFIG_CONS_INDEX) static void fdt_fill_multisername(char *sername, size_t maxlen) { const char *outname = stdio_devices[stdout]-name; @@ -137,44 +142,48 @@ static void fdt_fill_multisername(char *sername, size_t maxlen) if (strcmp(outname + 1, serial) 0) strncpy(sername, outname + 1, maxlen); } -#endif static int fdt_fixup_stdout(void *fdt, int chosenoff) { - int err = 0; -#ifdef CONFIG_CONS_INDEX - int node; + int err; + int aliasoff; char sername[9] = { 0 }; - const char *path; + const void *path; + int len; + char tmp[256]; /* long enough */ fdt_fill_multisername(sername, sizeof(sername) - 1); if (!sername[0]) sprintf(sername, serial%d, CONFIG_CONS_INDEX - 1); - err = node = fdt_path_offset(fdt, /aliases); - if (node = 0) { - int len; - path = fdt_getprop(fdt, node, sername, len); - if (path) { - char *p = malloc(len); - err = -FDT_ERR_NOSPACE; - if (p) { - memcpy(p, path, len); - err = fdt_setprop(fdt, chosenoff, - linux,stdout-path, p, len); - free(p); - } - } else { - err = len; - } + aliasoff = fdt_path_offset(fdt, /aliases); + if (aliasoff 0) { + err = aliasoff; + goto error; } -#endif + + path = fdt_getprop(fdt, aliasoff, sername, len); + if (!path) { + err = len; + goto error; + } + + /* fdt_setprop may break path so we copy it to tmp buffer */ + memcpy(tmp, path, len); + + err = fdt_setprop(fdt, chosenoff, linux,stdout-path, tmp, len); +error: if (err 0) printf(WARNING: could not set linux,stdout-path %s.\n, - fdt_strerror(err)); + fdt_strerror(err)); return err; } +#else +static int fdt_fixup_stdout(void *fdt, int chosenoff) +{ + return 0; +} #endif int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end) @@ -254,27 +263,17 @@ int fdt_chosen(void *fdt) return nodeoffset; str = getenv(bootargs); - if (str != NULL) { - err = fdt_setprop(fdt, nodeoffset, - bootargs, str, strlen(str)+1); - if (err 0) + if (str) { + err = fdt_setprop(fdt, nodeoffset, bootargs, str, + strlen(str) + 1); + if (err 0) { printf(WARNING: could not set bootargs %s.\n, fdt_strerror(err)); + return err; + } } -#ifdef CONFIG_OF_STDOUT_VIA_ALIAS - err = fdt_fixup_stdout(fdt, nodeoffset); -#endif - -#ifdef OF_STDOUT_PATH - err = fdt_setprop(fdt, nodeoffset, linux,stdout-path, - OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1); - if (err 0) - printf(WARNING: could not set linux,stdout-path %s.\n, - fdt_strerror(err)); -#endif - - return err; + return fdt_fixup_stdout(fdt, nodeoffset); } void do_fixup_by_path(void *fdt, const char *path, const char *prop, -- 1.8.3.2 ___ U-Boot
[U-Boot] [PATCH 6/9] fdt_support: add 'const' qualifier for unchanged argument.
In the next commit, I will add a new function, fdt_pack_reg() which uses get_cells_len(). Beforehand, this commit adds 'const' qualifier to get_cells_len(). Otherwise, a warning message will appear: warning: passing argument 1 of 'get_cells_len' discards 'const' qualifier from pointer target type [enabled by default] Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com --- common/fdt_support.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index f641e68..bdc5ce1 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -21,11 +21,11 @@ * if #-cells property is 2 then len is 8 * otherwise len is 4 */ -static int get_cells_len(void *blob, char *nr_cells_name) +static int get_cells_len(const void *fdt, const char *nr_cells_name) { const fdt32_t *cell; - cell = fdt_getprop(blob, 0, nr_cells_name, NULL); + cell = fdt_getprop(fdt, 0, nr_cells_name, NULL); if (cell fdt32_to_cpu(*cell) == 2) return 8; -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 7/9] fdt_support: fix an endian bug of fdt_fixup_memory_banks
Data written to DTB must be converted to big endian order. It is usually done by using cpu_to_fdt32(), cpu_to_fdt64(), etc. fdt_fixup_memory_banks() invoked write_cell(), which always swaps byte order. It means the function only worked on little endian architectures. This commit adds and uses a new helper function, fdt_pack_reg(), which works on both big endian and little endian architrectures. Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com --- common/fdt_support.c | 42 ++ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index bdc5ce1..58d1ef7 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -354,6 +354,34 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat, do_fixup_by_compat(fdt, compat, prop, tmp, 4, create); } +/* + * fdt_pack_reg - pack address and size array into the reg-suitable stream + */ +static int fdt_pack_reg(const void *fdt, void *buf, uint64_t *address, + uint64_t *size, int n) +{ + int i; + int address_len = get_cells_len(fdt, #address-cells); + int size_len = get_cells_len(fdt, #size-cells); + char *p = buf; + + for (i = 0; i n; i++) { + if (address_len == 8) + *(fdt64_t *)p = cpu_to_fdt64(address[i]); + else + *(fdt32_t *)p = cpu_to_fdt32(address[i]); + p += address_len; + + if (size_len == 8) + *(fdt64_t *)p = cpu_to_fdt64(size[i]); + else + *(fdt32_t *)p = cpu_to_fdt32(size[i]); + p += size_len; + } + + return p - (char *)buf; +} + #ifdef CONFIG_NR_DRAM_BANKS #define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS #else @@ -362,9 +390,8 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat, int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks) { int err, nodeoffset; - int addr_cell_len, size_cell_len, len; + int len; u8 tmp[MEMORY_BANKS_MAX * 16]; /* Up to 64-bit address + 64-bit size */ - int bank; if (banks MEMORY_BANKS_MAX) { printf(%s: num banks %d exceeds hardcoded limit %d. @@ -392,16 +419,7 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks) return err; } - addr_cell_len = get_cells_len(blob, #address-cells); - size_cell_len = get_cells_len(blob, #size-cells); - - for (bank = 0, len = 0; bank banks; bank++) { - write_cell(tmp + len, start[bank], addr_cell_len); - len += addr_cell_len; - - write_cell(tmp + len, size[bank], size_cell_len); - len += size_cell_len; - } + len = fdt_pack_reg(blob, tmp, start, size, banks); err = fdt_setprop(blob, nodeoffset, reg, tmp, len); if (err 0) { -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/9] fdt_support: refactor with fdt_find_or_add_subnode helper func
Some functions in fdt_support.c do the same routine: search a node with a given name (chosen, memory, etc.) or newly create it if it does not exist. So this commit makes that routine to a helper function. Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com --- common/fdt_support.c | 71 ++-- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 2464847..849bdc8 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -98,6 +98,31 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop, return fdt_setprop(fdt, nodeoff, prop, val, len); } +/** + * fdt_find_or_add_subnode - find or possibly add a subnode of a given node + * @fdt: pointer to the device tree blob + * @parentoffset: structure block offset of a node + * @name: name of the subnode to locate + * + * fdt_subnode_offset() finds a subnode of the node with a given name. + * If the subnode does not exist, it will be created. + */ +static int fdt_find_or_add_subnode(void *fdt, int parentoffset, + const char *name) +{ + int offset; + + offset = fdt_subnode_offset(fdt, parentoffset, name); + + if (offset == -FDT_ERR_NOTFOUND) + offset = fdt_add_subnode(fdt, parentoffset, name); + + if (offset 0) + printf(%s: %s: %s\n, __func__, name, fdt_strerror(offset)); + + return offset; +} + #ifdef CONFIG_OF_STDOUT_VIA_ALIAS #ifdef CONFIG_CONS_INDEX @@ -160,14 +185,10 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) const char *path; uint64_t addr, size; - /* Find the chosen node. */ - nodeoffset = fdt_path_offset (fdt, /chosen); - - /* If there is no chosen node in the blob return */ - if (nodeoffset 0) { - printf(fdt_initrd: %s\n, fdt_strerror(nodeoffset)); + /* find or create /chosen node. */ + nodeoffset = fdt_find_or_add_subnode(fdt, 0, chosen); + if (nodeoffset 0) return nodeoffset; - } /* just return if initrd_start/end aren't valid */ if ((initrd_start == 0) || (initrd_end == 0)) @@ -233,25 +254,10 @@ int fdt_chosen(void *fdt, int force) return err; } - /* -* Find the chosen node. -*/ - nodeoffset = fdt_path_offset (fdt, /chosen); - - /* -* If there is no chosen node in the blob, create it. -*/ - if (nodeoffset 0) { - /* -* Create a new node /chosen (offset 0 is root level) -*/ - nodeoffset = fdt_add_subnode(fdt, 0, chosen); - if (nodeoffset 0) { - printf(WARNING: could not create /chosen %s.\n, - fdt_strerror(nodeoffset)); - return nodeoffset; - } - } + /* find or create /chosen node. */ + nodeoffset = fdt_find_or_add_subnode(fdt, 0, chosen); + if (nodeoffset 0) + return nodeoffset; /* * Create /chosen properites that don't exist in the fdt. @@ -393,16 +399,11 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks) return err; } - /* update, or add and update /memory node */ - nodeoffset = fdt_path_offset(blob, /memory); - if (nodeoffset 0) { - nodeoffset = fdt_add_subnode(blob, 0, memory); - if (nodeoffset 0) { - printf(WARNING: could not create /memory: %s.\n, - fdt_strerror(nodeoffset)); + /* find or create /memory node. */ + nodeoffset = fdt_find_or_add_subnode(blob, 0, memory); + if (nodeoffset 0) return nodeoffset; - } - } + err = fdt_setprop(blob, nodeoffset, device_type, memory, sizeof(memory)); if (err 0) { -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/9] fdt_support: delete force argument of fdt_initrd()
After all, we have realized force argument is completely useless. fdt_initrd() was always called with force = 1. We should always want to do the same thing (set appropriate value to the property) even if the property already exists. Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com --- arch/microblaze/lib/bootm.c | 2 +- common/cmd_fdt.c| 2 +- common/fdt_support.c| 35 +++ common/image-fdt.c | 2 +- include/fdt_support.h | 2 +- 5 files changed, 19 insertions(+), 24 deletions(-) diff --git a/arch/microblaze/lib/bootm.c b/arch/microblaze/lib/bootm.c index d60b307..6977dd6 100644 --- a/arch/microblaze/lib/bootm.c +++ b/arch/microblaze/lib/bootm.c @@ -58,7 +58,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], /* fixup the initrd now that we know where it should be */ if (images-rd_start images-rd_end of_flat_tree) ret = fdt_initrd(of_flat_tree, images-rd_start, -images-rd_end, 1); +images-rd_end); if (ret) return 1; diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 3a9edd6..71ea367 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -582,7 +582,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } fdt_chosen(working_fdt, 1); - fdt_initrd(working_fdt, initrd_start, initrd_end, 1); + fdt_initrd(working_fdt, initrd_start, initrd_end); } /* resize the fdt */ else if (strncmp(argv[1], re, 2) == 0) { diff --git a/common/fdt_support.c b/common/fdt_support.c index 849bdc8..3e16e8a 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -177,12 +177,11 @@ static int fdt_fixup_stdout(void *fdt, int chosenoff) } #endif -int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) +int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end) { int nodeoffset, addr_cell_len; int err, j, total; fdt64_t tmp; - const char *path; uint64_t addr, size; /* find or create /chosen node. */ @@ -216,26 +215,22 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) addr_cell_len = get_cells_len(fdt, #address-cells); - path = fdt_getprop(fdt, nodeoffset, linux,initrd-start, NULL); - if ((path == NULL) || force) { - write_cell((u8 *)tmp, initrd_start, addr_cell_len); - err = fdt_setprop(fdt, nodeoffset, - linux,initrd-start, tmp, addr_cell_len); - if (err 0) { - printf(WARNING: - could not set linux,initrd-start %s.\n, - fdt_strerror(err)); - return err; - } - write_cell((u8 *)tmp, initrd_end, addr_cell_len); - err = fdt_setprop(fdt, nodeoffset, + write_cell((u8 *)tmp, initrd_start, addr_cell_len); + err = fdt_setprop(fdt, nodeoffset, + linux,initrd-start, tmp, addr_cell_len); + if (err 0) { + printf(WARNING: could not set linux,initrd-start %s.\n, + fdt_strerror(err)); + return err; + } + write_cell((u8 *)tmp, initrd_end, addr_cell_len); + err = fdt_setprop(fdt, nodeoffset, linux,initrd-end, tmp, addr_cell_len); - if (err 0) { - printf(WARNING: could not set linux,initrd-end %s.\n, - fdt_strerror(err)); + if (err 0) { + printf(WARNING: could not set linux,initrd-end %s.\n, + fdt_strerror(err)); - return err; - } + return err; } return 0; diff --git a/common/image-fdt.c b/common/image-fdt.c index a54a919..a632c84 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -483,7 +483,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, /* Create a new LMB reservation */ lmb_reserve(lmb, (ulong)blob, of_size); - fdt_initrd(blob, *initrd_start, *initrd_end, 1); + fdt_initrd(blob, *initrd_start, *initrd_end); if (!ft_verify_fdt(blob)) return -1; diff --git a/include/fdt_support.h b/include/fdt_support.h index 9871e2f..786e797 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -15,7 +15,7 @@ u32 fdt_getprop_u32_default(const void *fdt, const char *path, const char *prop, const u32 dflt); int fdt_chosen(void *fdt, int force); -int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force); +int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end); void do_fixup_by_path(void *fdt, const char *path, const
[U-Boot] [PATCH 9/9] fdt_support: correct the return condition of fdt_initrd()
Before this commit, fdt_initrd() just returned if initrd start address is zero. But it is possible if the RAM is located at address 0. This commit makes the return condition more reasonable: Just return if the size of initrd is zero. Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com --- common/fdt_support.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 5631f16..89119be 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -191,15 +191,15 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end) int is_u64; uint64_t addr, size; + /* just return if the size of initrd is zero */ + if (initrd_start == initrd_end) + return 0; + /* find or create /chosen node. */ nodeoffset = fdt_find_or_add_subnode(fdt, 0, chosen); if (nodeoffset 0) return nodeoffset; - /* just return if initrd_start/end aren't valid */ - if ((initrd_start == 0) || (initrd_end == 0)) - return 0; - total = fdt_num_mem_rsv(fdt); /* -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/9] Refactoring and Endian bug fixes of fdt_support
Masahiro Yamada (9): fdt_support: delete unnecessary DECLARE_GLOBAL_DATA_PTR fdt_support: refactor with fdt_find_or_add_subnode helper func fdt_support: delete force argument of fdt_initrd() fdt_support: delete force argument of fdt_chosen() fdt_support: refactor fdt_fixup_stdout() function fdt_support: add 'const' qualifier for unchanged argument. fdt_support: fix an endian bug of fdt_fixup_memory_banks fdt_support: fix an endian bug of fdt_initrd() fdt_support: correct the return condition of fdt_initrd() arch/microblaze/lib/bootm.c | 2 +- common/cmd_fdt.c| 4 +- common/fdt_support.c| 295 +--- common/image-fdt.c | 4 +- include/fdt_support.h | 4 +- 5 files changed, 151 insertions(+), 158 deletions(-) -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 8/9] fdt_support: fix an endian bug of fdt_initrd()
Data written to DTB must be converted to big endian order. It is usually done by using cpu_to_fdt32(), cpu_to_fdt64(), etc. fdt_initrd() invoked write_cell(), which always swaps byte order. It means the function only worked on little endian architectures. (On big endian architectures, the byte order should be kept as it is) This commit uses cpu_to_fdt32() and cpu_to_fdt64() and deletes write_cell(). Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com --- common/fdt_support.c | 41 - 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 58d1ef7..5631f16 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -32,18 +32,6 @@ static int get_cells_len(const void *fdt, const char *nr_cells_name) return 4; } -/* - * Write a 4 or 8 byte big endian cell - */ -static void write_cell(u8 *addr, u64 val, int size) -{ - int shift = (size - 1) * 8; - while (size-- 0) { - *addr++ = (val shift) 0xff; - shift -= 8; - } -} - /** * fdt_getprop_u32_default - Find a node and return it's property or a default * @@ -186,11 +174,21 @@ static int fdt_fixup_stdout(void *fdt, int chosenoff) } #endif +static inline int fdt_setprop_uxx(void *fdt, int nodeoffset, const char *name, + uint64_t val, int is_u64) +{ + if (is_u64) + return fdt_setprop_u64(fdt, nodeoffset, name, val); + else + return fdt_setprop_u32(fdt, nodeoffset, name, (uint32_t)val); +} + + int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end) { - int nodeoffset, addr_cell_len; + int nodeoffset; int err, j, total; - fdt64_t tmp; + int is_u64; uint64_t addr, size; /* find or create /chosen node. */ @@ -222,19 +220,20 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end) return err; } - addr_cell_len = get_cells_len(fdt, #address-cells); + is_u64 = (get_cells_len(fdt, #address-cells) == 8); + + err = fdt_setprop_uxx(fdt, nodeoffset, linux,initrd-start, + (uint64_t)initrd_start, is_u64); - write_cell((u8 *)tmp, initrd_start, addr_cell_len); - err = fdt_setprop(fdt, nodeoffset, - linux,initrd-start, tmp, addr_cell_len); if (err 0) { printf(WARNING: could not set linux,initrd-start %s.\n, fdt_strerror(err)); return err; } - write_cell((u8 *)tmp, initrd_end, addr_cell_len); - err = fdt_setprop(fdt, nodeoffset, - linux,initrd-end, tmp, addr_cell_len); + + err = fdt_setprop_uxx(fdt, nodeoffset, linux,initrd-end, + (uint64_t)initrd_end, is_u64); + if (err 0) { printf(WARNING: could not set linux,initrd-end %s.\n, fdt_strerror(err)); -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/9] fdt_support: delete force argument of fdt_chosen()
After all, we have realized force argument is completely useless. fdt_chosen() was always called with force = 1. We should always want to do the same thing (set appropriate value to the property) even if the property already exists. Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com --- common/cmd_fdt.c | 2 +- common/fdt_support.c | 38 -- common/image-fdt.c| 2 +- include/fdt_support.h | 2 +- 4 files changed, 15 insertions(+), 29 deletions(-) diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 71ea367..fbe688f 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -581,7 +581,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) initrd_end = simple_strtoul(argv[3], NULL, 16); } - fdt_chosen(working_fdt, 1); + fdt_chosen(working_fdt); fdt_initrd(working_fdt, initrd_start, initrd_end); } /* resize the fdt */ diff --git a/common/fdt_support.c b/common/fdt_support.c index 3e16e8a..c714ffa 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -236,12 +236,11 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end) return 0; } -int fdt_chosen(void *fdt, int force) +int fdt_chosen(void *fdt) { int nodeoffset; int err; char *str; /* used to set string properties */ - const char *path; err = fdt_check_header(fdt); if (err 0) { @@ -254,38 +253,25 @@ int fdt_chosen(void *fdt, int force) if (nodeoffset 0) return nodeoffset; - /* -* Create /chosen properites that don't exist in the fdt. -* If the property exists, update it only if the force parameter -* is true. -*/ str = getenv(bootargs); if (str != NULL) { - path = fdt_getprop(fdt, nodeoffset, bootargs, NULL); - if ((path == NULL) || force) { - err = fdt_setprop(fdt, nodeoffset, - bootargs, str, strlen(str)+1); - if (err 0) - printf(WARNING: could not set bootargs %s.\n, - fdt_strerror(err)); - } + err = fdt_setprop(fdt, nodeoffset, + bootargs, str, strlen(str)+1); + if (err 0) + printf(WARNING: could not set bootargs %s.\n, + fdt_strerror(err)); } #ifdef CONFIG_OF_STDOUT_VIA_ALIAS - path = fdt_getprop(fdt, nodeoffset, linux,stdout-path, NULL); - if ((path == NULL) || force) - err = fdt_fixup_stdout(fdt, nodeoffset); + err = fdt_fixup_stdout(fdt, nodeoffset); #endif #ifdef OF_STDOUT_PATH - path = fdt_getprop(fdt, nodeoffset, linux,stdout-path, NULL); - if ((path == NULL) || force) { - err = fdt_setprop(fdt, nodeoffset, - linux,stdout-path, OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1); - if (err 0) - printf(WARNING: could not set linux,stdout-path %s.\n, - fdt_strerror(err)); - } + err = fdt_setprop(fdt, nodeoffset, linux,stdout-path, + OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1); + if (err 0) + printf(WARNING: could not set linux,stdout-path %s.\n, + fdt_strerror(err)); #endif return err; diff --git a/common/image-fdt.c b/common/image-fdt.c index a632c84..781ab8e 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -457,7 +457,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, ulong *initrd_end = images-initrd_end; int ret; - if (fdt_chosen(blob, 1) 0) { + if (fdt_chosen(blob) 0) { puts(ERROR: /chosen node create failed); puts( - must RESET the board to recover.\n); return -1; diff --git a/include/fdt_support.h b/include/fdt_support.h index 786e797..fc50484 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -14,7 +14,7 @@ u32 fdt_getprop_u32_default(const void *fdt, const char *path, const char *prop, const u32 dflt); -int fdt_chosen(void *fdt, int force); +int fdt_chosen(void *fdt); int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end); void do_fixup_by_path(void *fdt, const char *path, const char *prop, const void *val, int len, int create); -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/9] fdt_support: delete unnecessary DECLARE_GLOBAL_DATA_PTR
gd-bd is not used in fdt_support.c. Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com --- common/fdt_support.c | 5 - 1 file changed, 5 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index f9f358e..2464847 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -17,11 +17,6 @@ #include exports.h /* - * Global data (for the gd-bd) - */ -DECLARE_GLOBAL_DATA_PTR; - -/* * Get cells len in bytes * if #-cells property is 2 then len is 8 * otherwise len is 4 -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Fix build of sx151x gpio driver
Signed-off-by: Viktar Palstsiuk viktar.palsts...@promwad.com --- drivers/gpio/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index b903c45..1d365dd 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -30,4 +30,4 @@ obj-$(CONFIG_S3C2440_GPIO)+= s3c2440_gpio.o obj-$(CONFIG_XILINX_GPIO) += xilinx_gpio.o obj-$(CONFIG_ADI_GPIO2)+= adi_gpio2.o obj-$(CONFIG_TCA642X) += tca642x.o -oby-$(CONFIG_SX151X) += sx151x.o +obj-$(CONFIG_SX151X) += sx151x.o -- 1.8.5.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RFC] try to merge different i.MX environment
Signed-off-by: Stefano Babic sba...@denx.de CC: Fabio Estevam fabio.este...@freescale.com CC: Otavio Salvador ota...@ossystems.com.br CC: Marek Vasut ma...@denx.de CC: Leo Sartre lsar...@adeneo-embedded.com CC: Jon Nettleton jon.nettle...@gmail.com CC: Eric Nelson eric.nel...@boundarydevices.com CC: b18...@freescale.com Hi everybody, the current built-in environment in most i.MX boards is very similar. Even if I always thought that the default environemt is something that the user want always customize, I see from all you submitters the not hidden desire to have such a common default environment for all boards. At least, for i.MX boards. Checking in the board configuration files, I see at least the following boards that hase quite the same built-in environment: mx23evk mx23_olinuxino mx28evk mx51evk mx53evk mx53loco mx53smd mx6qarm2 mx6slevk mx6qsabre* (all of them) wandboard cgtqmx6eval hummingbird udoo and I am sure, I have missed some of them. The default environment is quite the same, and CONFIG_EXTRA_ENV_SETTINGS is more or less a cutpaste from another board. There are inconsistency and each fix must be repeated for all boards. I will try to address this issue. Maybe can we find a common built-in environment, that all other boards can simply include instead of redefining ? I want to try to find some useful blocks, that we can reuse for each board (mmc, nand, net,..). Then each board could simply define something like: +#include configs/default_env.h #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_BOARD_EXTRA_ENV_SETTINGS \ CONFIG_COMMON_SCRIPTS \ CONFIG_BOOTCOMMAND Where CONFIG_BOARD_EXTRA_ENV_SETTINGS still contains extra defines specific for the board This patch is only a proposal: it is not complete and it want not to be. It is for me only a way to start the discussion: how can we make order in the big mess of built-in environment ? Comments ? Best regards, Stefano Babic --- include/configs/cgtqmx6eval.h | 62 + include/configs/default_env.h | 133 + include/configs/hummingboard.h| 80 +- include/configs/mx23_olinuxino.h | 90 + include/configs/mx6sabre_common.h | 119 - include/configs/sandbox.h | 30 - include/configs/wandboard.h | 97 --- 7 files changed, 221 insertions(+), 390 deletions(-) create mode 100644 include/configs/default_env.h diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h index b189bf1..4fe8a58 100644 --- a/include/configs/cgtqmx6eval.h +++ b/include/configs/cgtqmx6eval.h @@ -73,58 +73,26 @@ #define CONFIG_DEFAULT_FDT_FILE imx6q-congatec.dtb -#define CONFIG_EXTRA_ENV_SETTINGS \ - script=boot.scr\0 \ - image=zImage\0 \ - fdt_file= CONFIG_DEFAULT_FDT_FILE \0 \ - boot_dir=/boot\0 \ - console=ttymxc1\0 \ +#define CONFIG_PREFIX_IMAGE z +#define CONFIG_MMCROOT /dev/mmcblk0p1 +#define CONFIG_CONSOLE_DEV ttymxc1 + +#define CONFIG_BOARD_EXTRA_ENV_SETTINGS \ fdt_high=0x\0 \ initrd_high=0x\0 \ fdt_addr=0x1800\0 \ boot_fdt=try\0 \ mmcdev=1\0 \ - mmcpart=1\0 \ - mmcroot=/dev/mmcblk0p1 rootwait rw\0 \ - mmcargs=setenv bootargs console=${console},${baudrate} \ - root=${mmcroot}\0 \ - loadbootscript= \ - ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0 \ - bootscript=echo Running bootscript from mmc ...; \ - source\0 \ - loadimage=ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} \ - ${boot_dir}/${image}\0 \ - loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdt_addr} \ - ${boot_dir}/${fdt_file}\0 \ - mmcboot=echo Booting from mmc ...; \ - run mmcargs; \ - if test ${boot_fdt} = yes || test ${boot_fdt} = try; then \ - if run loadfdt; then \ - bootz ${loadaddr} - ${fdt_addr}; \ - else \ - if test ${boot_fdt} = try; then \ - bootz; \ - else \ - echo WARN: Cannot load the DT; \ - fi; \ - fi; \ - else \ - bootz; \ - fi;\0 - -#define CONFIG_BOOTCOMMAND \ - mmc dev ${mmcdev}; \ - mmc dev ${mmcdev}; if mmc rescan; then \ - if run loadbootscript; then \ - run bootscript; \ - else \ - if run loadimage; then \ - run mmcboot; \ -
Re: [U-Boot] [RFC] try to merge different i.MX environment
Hello Stefano, before anything I'd like to thank you for this as it does need to be improved and it needs to be shared to avoid same fix to be done everywhere. On Fri, Feb 14, 2014 at 1:06 PM, Stefano Babic sba...@denx.de wrote: Signed-off-by: Stefano Babic sba...@denx.de CC: Fabio Estevam fabio.este...@freescale.com CC: Otavio Salvador ota...@ossystems.com.br CC: Marek Vasut ma...@denx.de CC: Leo Sartre lsar...@adeneo-embedded.com CC: Jon Nettleton jon.nettle...@gmail.com CC: Eric Nelson eric.nel...@boundarydevices.com CC: b18...@freescale.com Hi everybody, the current built-in environment in most i.MX boards is very similar. Even if I always thought that the default environemt is something that the user want always customize, I see from all you submitters the not hidden desire to have such a common default environment for all boards. At least, for i.MX boards. Checking in the board configuration files, I see at least the following boards that hase quite the same built-in environment: ... Fully agreed. This is especially important with the common distro environment in mind. ... diff --git a/include/configs/default_env.h b/include/configs/default_env.h new file mode 100644 index 000..b898156 --- /dev/null +++ b/include/configs/default_env.h I'd prefer this to be named default_env_imx.h @@ -0,0 +1,133 @@ + +#ifndef _DEFAULT_ENV_H +#define _DEFAULT_ENV_H + +#ifdef CONFIG_PREFIX_IMAGE +#define CONFIG_BOOT_SUFFIX z +#define CONFIG_DEFIMAGEzimage zImage +#else +#define CONFIG_BOOT_SUFFIX +#define CONFIG_DEFIMAGEuImage +#endif + +#ifndef MMC_SCRIPT_FILESYSTEM +#define MMC_SCRIPT_FILESYSTEM fat +#endif We could move to generic filesystem and avoid this. +#ifndef CONFIG_DEFAULT_FDT_FILE +#define CONFIG_DEFAULT_FDT_FILE +#endif + +#ifndef MMC_WRITE_OFFSET +#define MMC_WRITE_OFFSET 0x2 +#endif + +#ifdef CONFIG_SUPPORT_EMMC_BOOT +#define EMMC_ENV \ + update_emmc_firmware= \ + if test ${ip_dyn} = yes; then \ + setenv get_cmd dhcp; \ + else \ + setenv get_cmd tftp; \ + fi; \ + if ${get_cmd} ${update_sd_firmware_filename}; then \ + if mmc dev ${emmcdev} \ + mmc open ${emmcdev} 1; then \ This must to be adapter with Tom's work in emmc; I think this just fails now... + setexpr fw_sz ${filesize} / 0x200; \ + setexpr fw_sz ${fw_sz} + 1; \ + mmc write ${loadaddr} __stringify(MMC_WRITE_OFFSET) ${fw_sz}; \ + mmc close ${emmcdev} 1; \ + fi; \ + fi\0 +#else +#define EMMC_ENV +#endif + +#define CONFIG_COMMON_SCRIPTS \ + bootscript=echo Running bootscript from mmc ...; \ + source\0 \ + script=boot.scr\0 \ + image= CONFIG_DEFIMAGE \0 \ + fdt_file= CONFIG_DEFAULT_FDT_FILE \0 \ + fdt_addr=0x1800\0 \ This must to be set by SoC type; so we don't need to re-define it in every board. This also need to be overridable in case we have a board with reduced memory. + console= CONFIG_CONSOLE_DEV \0 \ + fdt_high=0x\0 \ + initrd_high=0x\0 \ + ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0 \ + mmcdev= __stringify(CONFIG_SYS_MMC_ENV_DEV) \0 \ + mmcroot= CONFIG_MMCROOT rootwait rw\0 \ + update_sd_firmware= \ + if test ${ip_dyn} = yes; then \ + setenv get_cmd dhcp; \ + else \ + setenv get_cmd tftp; \ + fi; \ + if mmc dev ${mmcdev}; then\ + if ${get_cmd} ${update_sd_firmware_filename}; then \ + setexpr fw_sz ${filesize} / 0x200; \ + setexpr fw_sz ${fw_sz} + 1; \ + mmc write ${loadaddr} __stringify(MMC_WRITE_OFFSET) ${fw_sz}; \ + fi; \ + fi\0 \ + mmcargs=setenv bootargs console=${console},${baudrate} \ + root=${mmcroot}\0 \ + loadbootscript= \ + __stringify(MMC_SCRIPT_FILESYSTEM)load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0 \ + loadimage= \ + __stringify(MMC_SCRIPT_FILESYSTEM)load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0 \ + loadfdt= \ + __stringify(MMC_SCRIPT_FILESYSTEM) load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0 \ + mmcboot=echo Booting from mmc ...; \ + run mmcargs; \ + if test ${boot_fdt} = yes || test ${boot_fdt} = try; then \ + if run loadfdt; then \ + boot CONFIG_BOOT_SUFFIX ${loadaddr} -
Re: [U-Boot] [RFC] try to merge different i.MX environment
On Fri, 14 Feb 2014 16:06:55 +0100 Stefano Babic sba...@denx.de wrote: Signed-off-by: Stefano Babic sba...@denx.de CC: Fabio Estevam fabio.este...@freescale.com CC: Otavio Salvador ota...@ossystems.com.br CC: Marek Vasut ma...@denx.de CC: Leo Sartre lsar...@adeneo-embedded.com CC: Jon Nettleton jon.nettle...@gmail.com CC: Eric Nelson eric.nel...@boundarydevices.com CC: b18...@freescale.com Hi everybody, the current built-in environment in most i.MX boards is very similar. Even if I always thought that the default environemt is something that the user want always customize, I see from all you submitters the not hidden desire to have such a common default environment for all boards. At least, for i.MX boards. Checking in the board configuration files, I see at least the following boards that hase quite the same built-in environment: I'm working on building a common set environment based on the work by Stephen Warren for tegra, that would provide for a very usable experience. Its the next step forward from the distro config options. Id rather us get a solution that works across the board than something different per soc family. looking at how tegra is being done should provide a solid guide. Dennis ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/8] fdt: add fdt checksign command
On 8 February 2014 22:34, Heiko Schocher h...@denx.de wrote: check if a fdt is correct signed pass an optional addr value. Contains the addr of the key blob Signed-off-by: Heiko Schocher h...@denx.de Cc: Simon Glass s...@chromium.org Acked-by: Simon Glass s...@chromium.org ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Exynos5250: Remove lowlevelinit
On 14 February 2014 01:22, Rajeshwari Shinde rajeshwar...@samsung.com wrote: From: Rajeshwari S Shinde rajeshwar...@samsung.com Since we use CONFIG_SKIP_LOWLEVEL_INIT for Exynos baords, we dont need to a lowlevel_init.S file. Signed-off-by: Rajeshwari S Shinde rajeshwar...@samsung.com Acked-by: Simon Glass s...@chromium.org ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] MIPS: keep all sections in u-boot ELF binary.
The current MIPS linker script discards all unneeded sections in the link stage. For diagnostic tools like readelf it is better to keep all sections in the ELF binary and only remove them when creating the final binary. Move all unneeded sections after _end to avoid allocating space in the final binary. Also remove .deadcode section which is now obsolete. Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com --- This patch is inspired by a similar one for ARM [1]. This patch is queued at u-boot-mips/testing together with a test patch. This test patch adds a script for testing for the wrong __rel_dyn_end offset bug, which could occur without the .deadcode section. [1] http://patchwork.ozlabs.org/patch/289329/ --- arch/mips/config.mk | 3 ++- arch/mips/cpu/u-boot.lds | 56 ++-- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/arch/mips/config.mk b/arch/mips/config.mk index c3f81b5..ce438c2 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -50,4 +50,5 @@ PLATFORM_CPPFLAGS += -msoft-float PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib $(ENDIANNESS) PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections LDFLAGS_FINAL += --gc-sections -pie -OBJCFLAGS += --remove-section=.dynsym +OBJCFLAGS += -j .text -j .rodata -j .data -j .got +OBJCFLAGS += -j .u_boot_list -j .rel.dyn diff --git a/arch/mips/cpu/u-boot.lds b/arch/mips/cpu/u-boot.lds index 16a9d6a..4c9edf8 100644 --- a/arch/mips/cpu/u-boot.lds +++ b/arch/mips/cpu/u-boot.lds @@ -60,27 +60,7 @@ SECTIONS __rel_dyn_end = .; } - .deadcode : { - /* -* Workaround for a binutils feature (or bug?). -* -* The GNU ld from binutils puts the dynamic relocation -* entries into the .rel.dyn section. Sometimes it -* allocates more dynamic relocation entries than it needs -* and the unused slots are set to R_MIPS_NONE entries. -* -* However the size of the .rel.dyn section in the ELF -* section header does not cover the unused entries, so -* objcopy removes those during stripping. -* -* Create a small section here to avoid that. -*/ - LONG(0x); - } - - .dynsym : { - *(.dynsym) - } + _end = .; .bss __rel_dyn_start (OVERLAY) : { __bss_start = .; @@ -91,15 +71,39 @@ SECTIONS __bss_end = .; } - /DISCARD/ : { + .dynsym _end : { + *(.dynsym) + } + + .dynbss : { *(.dynbss) + } + + .dynstr : { *(.dynstr) + } + + .dynamic : { *(.dynamic) + } + + .plt : { + *(.plt) + } + + .interp : { *(.interp) + } + + .gnu : { + *(.gnu*) + } + + .MIPS.stubs : { + *(.MIPS.stubs) + } + + .hash : { *(.hash) - *(.gnu.*) - *(.plt) - *(.got.plt) - *(.rel.plt) } } -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC] try to merge different i.MX environment
Dear Stefano Babic, In message 1392390415-25620-1-git-send-email-sba...@denx.de you wrote: +#define CONFIG_PREFIX_IMAGE z +#define CONFIG_MMCROOT /dev/mmcblk0p1 +#define CONFIG_CONSOLE_DEV ttymxc1 + +#define CONFIG_BOARD_EXTRA_ENV_SETTINGS \ Please keep in mind that all new CONFIG_ setting must be properly documented in the README. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de The optimum committee has no members. - Norman Augustine ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 3/3] mtd: nand: omap: fix ecclayout to be in sync with u-boot NAND driver
Fixes: commit a919e51161b58ed7e6e663daba99ab7d558808f3 mtd: nand: omap2: clean-up BCHx_HW and BCHx_SW ECC configurations in device_probe Fixes ecclayout mismatch introduced in above commit for following ecc-schemes: - OMAP_ECC_BCH4_CODE_HW_DETECTION_SW - OMAP_ECC_BCH8_CODE_HW_DETECTION_SW However, this patch also touches other ecc-schemes as the fix required refactoring common code, into ecc-scheme specific code. This patch aligns ecc-layout for below ecc-schemes as per reference [1],[2],[3] +---++-++-+-+ |OOB|BCH8_CODE_HW|BCH8_CODE_HW_||HAM1_CODE_HW |HAM1_CODE_HW | |pos|| DETECTION_SW||(x8 device) |(x16 device) | +---++-++-+-+ | 0 |BADBLK_MARK | BADBLK_MARK || BADBLK_MARK | BADBLK_MARK | | 1 |BADBLK_MARK | BADBLK_MARK || eccpos[0] | BADBLK_MARK | | 2 | eccpos[0] | eccpos[0] || eccpos[1] | eccpos[0] | | 3 | eccpos[1] | eccpos[1] || eccpos[2] | eccpos[1] | | 4 | eccpos[2] | eccpos[2] || eccpos[3] | eccpos[2] | | 5 | eccpos[3] | eccpos[3] || eccpos[4] | eccpos[3] | | 6 | eccpos[4] | eccpos[4] || eccpos[5] | eccpos[4] | | 7 | eccpos[5] | eccpos[5] || eccpos[6] | eccpos[5] | | 8 | eccpos[6] | eccpos[6] || eccpos[7] | eccpos[6] | | 9 | eccpos[7] | eccpos[7] || eccpos[8] | eccpos[7] | |10 | eccpos[8] | eccpos[8] || eccpos[9] | eccpos[8] | |11 | eccpos[9] | eccpos[9] || eccpos[10] | eccpos[9] | |12 | eccpos[10] | eccpos[10] || eccpos[11] | eccpos[10] | |13 | eccpos[11] | eccpos[11] || oobfree[0] | eccpos[11] | |14 | eccpos[12] | eccpos[12] || oobfree[1] | oobfree[0] | |15 | eccpos[13] | reserved || oobfree[2] | oobfree[1] | +---++-++-+-+ |16 | eccpos[14] | eccpos[13] || oobfree[3] | oobfree[2] | |...| [...] | [...] || [...] | [...] | |56 | eccpos[54] | eccpos[51] || oobfree[43] | oobfree[42] | |57 | eccpos[55] | reserved || oobfree[44] | oobfree[43] | +===++=+==+=+ |58 | oobfree[0] | oobfree[0] || oobfree[45] | oobfree[44] | |59 | oobfree[1] | oobfree[1] || oobfree[46] | oobfree[45] | |60 | oobfree[2] | oobfree[2] || oobfree[47] | oobfree[46] | |61 | oobfree[3] | oobfree[3] || oobfree[48] | oobfree[47] | |62 | oobfree[4] | oobfree[4] || oobfree[49] | oobfree[48] | |63 | oobfree[5] | oobfree[5] || oobfree[50] | oobfree[49] | +---++-+--+-+ [1] ecc-layout expected by ROM code, as specified in SoC TRM under: Chapter=Initialization Section=Device Initialization by ROM code Sub-Section=Memory Booting Heading=NAND Figure=ECC Locations in NAND Spare Areas [2] ecc-layout updates in u-boot http://lists.denx.de/pipermail/u-boot/2013-November/167551.html [3] u-boot configurations to match above ecc-layout are documented at https://processors.wiki.ti.com/index.php/Linux_Core_NAND_User%27s_Guide Reported-by: Enric Balletbo Serra eballe...@iseebcn.com Tested-by: Enric Balletbo i Serra eballe...@gmail.com Tested-by: Stefan Roese s...@denx.de Signed-off-by: Pekon Gupta pe...@ti.com --- drivers/mtd/nand/omap2.c | 31 +++ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 433e58a..bf642ce 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1633,6 +1633,7 @@ static int omap_nand_probe(struct platform_device *pdev) int i; dma_cap_mask_t mask; unsignedsig; + unsignedoob_index; struct resource *res; struct mtd_part_parser_data ppdata = {}; @@ -1826,9 +1827,11 @@ static int omap_nand_probe(struct platform_device *pdev) (mtd-writesize / nand_chip-ecc.size); if (nand_chip-options NAND_BUSWIDTH_16) - ecclayout-eccpos[0]= BADBLOCK_MARKER_LENGTH; + oob_index = BADBLOCK_MARKER_LENGTH; else - ecclayout-eccpos[0]= 1; + oob_index = 1; + for (i = 0; i ecclayout-eccbytes; i++, oob_index++) + ecclayout-eccpos[i]= oob_index; /* no reserved-marker in ecclayout for this ecc-scheme */ ecclayout-oobfree-offset = ecclayout-eccpos[ecclayout-eccbytes - 1] + 1; @@ -1848,7 +1851,12 @@ static int omap_nand_probe(struct platform_device *pdev) ecclayout-eccbytes = nand_chip-ecc.bytes *
[U-Boot] [PATCH v2 2/3] mtd: nand: omap: fix ecclayout-oobfree-length
ECC layout of some ecc-schemes expect a 'reserve-marker' as specific byte-position in OOB. But current calculation of oobfree-length does not consider that for all ecc-schemes. But in general, for all ecc-schems, OOB bytes from oobfree-offset till end of OOB region are unused. So this patch fixes oobfree-length calculation. Signed-off-by: Pekon Gupta pe...@ti.com --- drivers/mtd/nand/omap2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 874fd9d..433e58a 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1977,9 +1977,8 @@ static int omap_nand_probe(struct platform_device *pdev) goto return_error; } - /* populate remaining ECC layout data */ - ecclayout-oobfree-length = mtd-oobsize - (BADBLOCK_MARKER_LENGTH + - ecclayout-eccbytes); + /* all OOB bytes from oobfree-offset till end off OOB are free */ + ecclayout-oobfree-length = mtd-oobsize - ecclayout-oobfree-offset; for (i = 1; i ecclayout-eccbytes; i++) ecclayout-eccpos[i] = ecclayout-eccpos[0] + i; /* check if NAND device's OOB is enough to store ECC signatures */ -- 1.8.5.1.163.gd7aced9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 0/3] mtd: nand: omap: fix ecc-layout
*changes v1 - v2* [PATCH 1/3] fix oobfree-offset calculation + adjust for reserved-marker of last sector [PATCH 2/3] new patch [PATCH 3/3] refactor code as suggested by Brian Norris computersforpe...@gmail.com *original v1* [PATCH 1/2] http://lists.infradead.org/pipermail/linux-mtd/2013-December/050946.html [PATCH 2/2] http://lists.infradead.org/pipermail/linux-mtd/2013-December/050945.html This patch-set is tested on AM335x-EVM using following end-to-end boot sequence with appropriate u-boot configs [1] (BCH8_HW) (BCH8_SW) (BCH8_SW) (BCH8_SW) (UBIFS) ROM - SPL - U-Boot - Kernel - File-System (BCH8_HW) (BCH8_HW) (BCH8_HW) (BCH8_HW) (UBIFS) ROM - SPL - U-Boot - Kernel - File-System Test1: flash ubi image from u-boot and boot the kernel u-boot mw 0x8200 0xff u-boot.img size aligned to NAND block boundary u-boot fatload mmc 0 0x8200 u-boot.img u-boot nand erase u-boot_offset u-boot.img size u-boot nand write 0x8200 u-boot_offset u-boot.img size u-boot setenv bootargs 'console=ttyO0,115200n8 noinitrd mem=256M \ root=ubi0 rw rootfstype=ubifs ubi.mtd=mtdpart-of-rootfs,\ page-size ip=off init=/init' u-boot bootm kernel_offset Test2: update u-boot.img from kernel and re-boot kernel flash_erase /dev/mtdpart-of-u-boot 0 0 kernel nandwrite -s 0 /dev/mtdpart-of-u-boot u-boot.img kernel reboot [1] u-boot configurations to match above ecc-layout are documented at https://processors.wiki.ti.com/index.php/Linux_Core_NAND_User%27s_Guide Pekon Gupta (3): mtd: nand: omap: fix ecclayout-oobfree-offset mtd: nand: omap: fix ecclayout-oobfree-length mtd: nand: omap: fix ecclayout to be in sync with u-boot NAND driver drivers/mtd/nand/omap2.c | 61 +++- 1 file changed, 40 insertions(+), 21 deletions(-) -- 1.8.5.1.163.gd7aced9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/3] mtd: nand: omap: fix ecclayout-oobfree-offset
1) In current implementation, ecclayout-oobfree-offset is calculated with respect to ecclayout-eccpos[0] which is incorrect because ECC bytes may not be stored contiguously in OOB. So, this patch calculates ecclayout-oobfree-offset with respect to last ECC byte-position 'eccpos[ecclayout-eccbytes-1]'. 2) ECC layout of some ecc-schemes expects reserved-markers at specific eccpos[] which should not be over-written by any file-system metadata. So this patch aligns oobfree-offset taking into account of such markers. Tested-by: Enric Balletbo i Serra eballe...@gmail.com Tested-by: Stefan Roese s...@denx.de Signed-off-by: Pekon Gupta pe...@ti.com --- drivers/mtd/nand/omap2.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index ef4190a..874fd9d 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1829,8 +1829,9 @@ static int omap_nand_probe(struct platform_device *pdev) ecclayout-eccpos[0]= BADBLOCK_MARKER_LENGTH; else ecclayout-eccpos[0]= 1; - ecclayout-oobfree-offset = ecclayout-eccpos[0] + - ecclayout-eccbytes; + /* no reserved-marker in ecclayout for this ecc-scheme */ + ecclayout-oobfree-offset = + ecclayout-eccpos[ecclayout-eccbytes - 1] + 1; break; case OMAP_ECC_BCH4_CODE_HW_DETECTION_SW: @@ -1848,8 +1849,9 @@ static int omap_nand_probe(struct platform_device *pdev) (mtd-writesize / nand_chip-ecc.size); ecclayout-eccpos[0]= BADBLOCK_MARKER_LENGTH; - ecclayout-oobfree-offset = ecclayout-eccpos[0] + - ecclayout-eccbytes; + /* include reserved-marker in ecclayout-oobfree calculation */ + ecclayout-oobfree-offset = 1 + + ecclayout-eccpos[ecclayout-eccbytes - 1] + 1; /* software bch library is used for locating errors */ nand_chip-ecc.priv = nand_bch_init(mtd, nand_chip-ecc.size, @@ -1884,8 +1886,9 @@ static int omap_nand_probe(struct platform_device *pdev) (mtd-writesize / nand_chip-ecc.size); ecclayout-eccpos[0]= BADBLOCK_MARKER_LENGTH; - ecclayout-oobfree-offset = ecclayout-eccpos[0] + - ecclayout-eccbytes; + /* reserved marker already included in ecclayout-eccbytes */ + ecclayout-oobfree-offset = + ecclayout-eccpos[ecclayout-eccbytes - 1] + 1; /* This ECC scheme requires ELM H/W block */ if (is_elm_present(info, pdata-elm_of_node, BCH4_ECC) 0) { pr_err(nand: error: could not initialize ELM\n); @@ -1914,8 +1917,9 @@ static int omap_nand_probe(struct platform_device *pdev) (mtd-writesize / nand_chip-ecc.size); ecclayout-eccpos[0]= BADBLOCK_MARKER_LENGTH; - ecclayout-oobfree-offset = ecclayout-eccpos[0] + - ecclayout-eccbytes; + /* include reserved-marker in ecclayout-oobfree calculation */ + ecclayout-oobfree-offset = 1 + + ecclayout-eccpos[ecclayout-eccbytes - 1] + 1; /* software bch library is used for locating errors */ nand_chip-ecc.priv = nand_bch_init(mtd, nand_chip-ecc.size, @@ -1957,8 +1961,9 @@ static int omap_nand_probe(struct platform_device *pdev) (mtd-writesize / nand_chip-ecc.size); ecclayout-eccpos[0]= BADBLOCK_MARKER_LENGTH; - ecclayout-oobfree-offset = ecclayout-eccpos[0] + - ecclayout-eccbytes; + /* reserved marker already included in ecclayout-eccbytes */ + ecclayout-oobfree-offset = + ecclayout-eccpos[ecclayout-eccbytes - 1] + 1; break; #else pr_err(nand: error: CONFIG_MTD_NAND_OMAP_BCH not enabled\n); -- 1.8.5.1.163.gd7aced9
Re: [U-Boot] [PATCH] pxe: prepend fdtdir to DTB name irrespective of source
On Wed, 12 Feb 2014 14:30:04 -0700 Stephen Warren swar...@wwwdotorg.org wrote: From: Stephen Warren swar...@nvidia.com The directory name from an fdtdir directive in a PXE config file should always be pre-pended to the DTB filename; it shouldn't matter whether the DTB filename came from the $fdtfile environment variable, or whether it was constructed dynamically from ${soc}-${board}.dtb. Fix the code to always prepend the directory name. Reviewed-by: Dennis Gilmore den...@ausil.us Tested-by: Dennis Gilmore den...@ausil.us Thanks for the fix ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/3] mtd: nand: omap: fix ecclayout-oobfree-offset
Hi Pekon, On Fri, Feb 14, 2014 at 10:31:46PM +0530, Pekon Gupta wrote: 1) In current implementation, ecclayout-oobfree-offset is calculated with respect to ecclayout-eccpos[0] which is incorrect because ECC bytes may not be stored contiguously in OOB. So, this patch calculates ecclayout-oobfree-offset with respect to last ECC byte-position 'eccpos[ecclayout-eccbytes-1]'. 2) ECC layout of some ecc-schemes expects reserved-markers at specific eccpos[] which should not be over-written by any file-system metadata. So this patch aligns oobfree-offset taking into account of such markers. This is a much better description, and this series is looking a lot more straightforward now. Thanks. A quick comment below, and I'll spend some more time looking later. (BTW, can you mark these for -stable, version 3.13+ if/when you resend? Or else I'll mark it myself, I think.) Tested-by: Enric Balletbo i Serra eballe...@gmail.com Tested-by: Stefan Roese s...@denx.de Signed-off-by: Pekon Gupta pe...@ti.com --- drivers/mtd/nand/omap2.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index ef4190a..874fd9d 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1829,8 +1829,9 @@ static int omap_nand_probe(struct platform_device *pdev) ecclayout-eccpos[0]= BADBLOCK_MARKER_LENGTH; else ecclayout-eccpos[0]= 1; - ecclayout-oobfree-offset = ecclayout-eccpos[0] + - ecclayout-eccbytes; + /* no reserved-marker in ecclayout for this ecc-scheme */ + ecclayout-oobfree-offset = + ecclayout-eccpos[ecclayout-eccbytes - 1] + 1; Thanks for adjusting for 'eccbytes - 1'. This diff *would* be correct, except that you're only initializing eccpos[1 .. eccbytes-1] in a for loop after the switch-case block. It seems like this first patch actually depends on patch 3, where you move the initialization of the entire eccpos[] array into each 'case' block. e.g.: @@ -1826,9 +1827,11 @@ static int omap_nand_probe(struct platform_device *pdev) (mtd-writesize / nand_chip-ecc.size); if (nand_chip-options NAND_BUSWIDTH_16) - ecclayout-eccpos[0]= BADBLOCK_MARKER_LENGTH; + oob_index = BADBLOCK_MARKER_LENGTH; else - ecclayout-eccpos[0]= 1; + oob_index = 1; + for (i = 0; i ecclayout-eccbytes; i++, oob_index++) + ecclayout-eccpos[i]= oob_index; So, can you rearrange this series so patch 3 comes first? @@ -1848,8 +1849,9 @@ static int omap_nand_probe(struct platform_device *pdev) (mtd-writesize / nand_chip-ecc.size); ecclayout-eccpos[0]= BADBLOCK_MARKER_LENGTH; - ecclayout-oobfree-offset = ecclayout-eccpos[0] + - ecclayout-eccbytes; + /* include reserved-marker in ecclayout-oobfree calculation */ + ecclayout-oobfree-offset = 1 + + ecclayout-eccpos[ecclayout-eccbytes - 1] + 1; /* software bch library is used for locating errors */ nand_chip-ecc.priv = nand_bch_init(mtd, nand_chip-ecc.size, @@ -1884,8 +1886,9 @@ static int omap_nand_probe(struct platform_device *pdev) (mtd-writesize / nand_chip-ecc.size); ecclayout-eccpos[0]= BADBLOCK_MARKER_LENGTH; - ecclayout-oobfree-offset = ecclayout-eccpos[0] + - ecclayout-eccbytes; + /* reserved marker already included in ecclayout-eccbytes */ + ecclayout-oobfree-offset = + ecclayout-eccpos[ecclayout-eccbytes - 1] + 1; /* This ECC scheme requires ELM H/W block */ if (is_elm_present(info, pdata-elm_of_node, BCH4_ECC) 0) { pr_err(nand: error: could not initialize ELM\n); @@ -1914,8 +1917,9 @@ static int omap_nand_probe(struct platform_device *pdev) (mtd-writesize / nand_chip-ecc.size); ecclayout-eccpos[0]= BADBLOCK_MARKER_LENGTH; -
Re: [U-Boot] [U-Boot, 2/3] mpc85xx: Add deep sleep framework support
On Thu, 2014-02-13 at 01:05 -0600, Tang Yuantian-B29983 wrote: Thanks for your review. Please see the reply inline. Thanks, Yuantian -Original Message- From: Wood Scott-B07421 Sent: 2014年2月13日 星期四 8:44 To: Tang Yuantian-B29983 Cc: Sun York-R58495; Wood Scott-B07421; Li Yang-Leo-R58472; t...@theia.denx.de; u-boot@lists.denx.de; Kushwaha Prabhakar-B32579; Jin Zhengxiong-R64188 Subject: Re: [U-Boot,2/3] mpc85xx: Add deep sleep framework support On Sun, Jan 26, 2014 at 02:00:40PM +0800, tang yuantian wrote: From: Tang Yuantian yuantian.t...@freescale.com When system wakes up from warm reset, control is passed to the primary core that starts executing uboot. After re-initialized some IP blocks, like DDRC, kernel will take responsibility to continue to restore environment it leaves before. Signed-off-by: Tang Yuantian yuantian.t...@freescale.com Is this for some specific mpc85xx chip (e.g. T1040)? I'm pretty sure this isn't necessary for deep sleep on mpc8536, for example. Currently, it is used by t1040. But we want it to be more general so that It can be used by later new chips. But the mechanism is not the same for all mpc85xx derivatives. You'll need a more specific name. +#ifdef CONFIG_DEEP_SLEEP CONFIG symbols need to be documented in README... Where should I add this README? Under 85xx CPU Options in the top-level README. + /* disable the console if boot from warm reset */ + if (in_be32(gur-scrtsr[0]) (1 3)) + gd-flags |= + GD_FLG_SILENT | GD_FLG_WARM_BOOT | GD_FLG_DISABLE_CONSOLE; #endif ...and it should probably be a more specific CONFIG_SYS symbol that indicates the presence of this guts bit. diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c index 33bc900..b3b9250 100644 --- a/arch/powerpc/cpu/mpc85xx/fdt.c +++ b/arch/powerpc/cpu/mpc85xx/fdt.c @@ -24,6 +24,9 @@ DECLARE_GLOBAL_DATA_PTR; extern void ft_qe_setup(void *blob); extern void ft_fixup_num_cores(void *blob); extern void ft_srio_setup(void *blob); +#ifdef CONFIG_DEEP_SLEEP +extern ulong __bss_end; +#endif Don't ifdef declarations. #ifdef CONFIG_MP #include mp.h @@ -35,6 +38,9 @@ void ft_fixup_cpu(void *blob, u64 memory_limit) u32 bootpg = determine_mp_bootpg(NULL); u32 id = get_my_id(); const char *enable_method; +#ifdef CONFIG_DEEP_SLEEP + ulong len; +#endif off = fdt_node_offset_by_prop_value(blob, -1, device_type, cpu, 4); while (off != -FDT_ERR_NOTFOUND) { @@ -77,6 +83,25 @@ void ft_fixup_cpu(void *blob, u64 memory_limit) device_type, cpu, 4); } +#ifdef CONFIG_DEEP_SLEEP + /* + * reserve the memory space for warm reset. + * This space will be re-used next time when boot from deep sleep. + * The space includes bd_t, gd_t, stack and uboot image. + * Reserve 1K for stack. + */ + len = sizeof(bd_t) + sizeof(gd_t) + (1 10); + /* round up to 4K */ + len = (len + (4096 - 1)) ~(4096 - 1); + + off = fdt_add_mem_rsv(blob, gd-relocaddr - len, + len + ((ulong)__bss_end - gd-relocaddr)); + if (off 0) + printf(Failed to reserve memory for warm reset: %s\n, + fdt_strerror(off)); + +#endif Why do you need to reserve memory for this? We didn't need to for deep sleep on MPC8313ERDB, which also goes through U-Boot on wake. On MPC8313ERDB we transfer control to the kernel before relocating, so U- Boot never touches DDR. bd_t, gd_t, and the stack should be in locked L1 cache, and the u-boot image should be in flash (or locked CPC if this is not a NOR flash boot). In deep sleep many IP blocks are powered off like DDRC, LIODN, cpu. These IPs are re-initialized after relocating. So, we must jump to kernel after relocating. The DDR controller is initialized before relocating -- and of course the CPU is powered off on MPC8313ERDB deep sleep as well. LIODNs are a new concern for deep sleep, but that doesn't mean we should go through a bunch of unrelated code to get there. Refactor the LIODN code to be usable before relocation, and not be tied to fdt fixups. +#ifndef CONFIG_DEEP_SLEEP /* Reserve spin table page */ if (spin_tbl_addr memory_limit) { off = fdt_add_mem_rsv(blob, @@ -108,6 +134,7 @@ void ft_fixup_cpu(void *blob, u64 memory_limit) printf(Failed to reserve memory for spin table: %s\n, fdt_strerror(off)); } +#endif Explain. Spin_tbl_addr has been reserved already. Where, and why is it different for non-CONFIG_DEEP_SLEEP? #if (CONFIG_SYS_NUM_FMAN == 2) - set_liodn(fman2_liodn_tbl, fman2_liodn_tbl_sz); - setup_fman_liodn_base(FSL_HW_PORTAL_FMAN2, fman2_liodn_tbl, - fman2_liodn_tbl_sz); +#ifdef
[U-Boot] [PATCH v2] usb: tegra: Fix PHY configuration for Tegra 3
On Tegra 3, the PTS (parallel transceiver select) and STS (serial transceiver select) are part of the HOSTPC1_DEVLC_0 register rather than PORTSC1_0 register. Since the reset configuration usually matches the configured registers, this error did not show up on Tegra 3 devices. Also clear the forced powerdown bit in the UTMIP_PLL_CFG2_0 register which brings USB2 in UTMI mode to work. This was clearly missing since the forced powerdown bit is set in reset by default for all USB ports. Also use the slightly different bit fields of first USB, (USBD) on Tegra 2. Signed-off-by: Stefan Agner ste...@agner.ch --- drivers/usb/host/ehci-tegra.c | 28 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 0b42aa5..bd99bce 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -461,6 +461,9 @@ static int init_utmi_usb_controller(struct fdt_usb *config) if (config-periph_id == PERIPH_ID_USBD) clrbits_le32(clkrst-crc_utmip_pll_cfg2, UTMIP_FORCE_PD_SAMP_A_POWERDOWN); + if (config-periph_id == PERIPH_ID_USB2) + clrbits_le32(clkrst-crc_utmip_pll_cfg2, +UTMIP_FORCE_PD_SAMP_B_POWERDOWN); if (config-periph_id == PERIPH_ID_USB3) clrbits_le32(clkrst-crc_utmip_pll_cfg2, UTMIP_FORCE_PD_SAMP_C_POWERDOWN); @@ -483,9 +486,21 @@ static int init_utmi_usb_controller(struct fdt_usb *config) clrbits_le32(usbctlr-icusb_ctrl, IC_ENB1); /* Select UTMI parallel interface */ - clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, - PTS_UTMI PTS_SHIFT); - clrbits_le32(usbctlr-port_sc1, STS); + if (!controller-has_hostpc) { + if (config-periph_id == PERIPH_ID_USBD) { + clrsetbits_le32(usbctlr-port_sc1, PTS1_MASK, + PTS_UTMI PTS1_SHIFT); + clrbits_le32(usbctlr-port_sc1, STS1); + } else { + clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, + PTS_UTMI PTS_SHIFT); + clrbits_le32(usbctlr-port_sc1, STS); + } + } else { + clrsetbits_le32(usbctlr-hostpc1_devlc, PTS_MASK, + PTS_UTMI PTS_SHIFT); + clrbits_le32(usbctlr-hostpc1_devlc, STS); + } /* Deassert power down state */ clrbits_le32(usbctlr-utmip_xcvr_cfg0, UTMIP_FORCE_PD_POWERDOWN | @@ -543,7 +558,12 @@ static int init_ulpi_usb_controller(struct fdt_usb *config) ULPI_CLKOUT_PINMUX_BYP | ULPI_OUTPUT_PINMUX_BYP); /* Select ULPI parallel interface */ - clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, PTS_ULPI PTS_SHIFT); + if (!controller-has_hostpc) { + clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, + PTS_ULPI PTS_SHIFT); + else + clrsetbits_le32(usbctlr-hostpc1_devlc, PTS_MASK, + PTS_ULPI PTS_SHIFT); /* enable ULPI transceiver */ setbits_le32(usbctlr-susp_ctrl, ULPI_PHY_ENB); -- 1.8.5.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] usb: tegra: Fix PHY configuration for Tegra 3
Am 2014-02-14 23:45, schrieb Stefan Agner: /* Select ULPI parallel interface */ - clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, PTS_ULPI PTS_SHIFT); + if (!controller-has_hostpc) { + clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, + PTS_ULPI PTS_SHIFT); + else + clrsetbits_le32(usbctlr-hostpc1_devlc, PTS_MASK, + PTS_ULPI PTS_SHIFT); /* enable ULPI transceiver */ setbits_le32(usbctlr-susp_ctrl, ULPI_PHY_ENB); Ok, just noticed that we need to address the different USBD register layout on Tegra 2 here too. Furthermore, the code does not compile with Tegra 2 header file since the hostpc1_devlc field is missing there. The function ehci_get_port_speed uses a define and some calculation to work around this issue. Another solution would be to create a dummy field in the Tegra 2 USB register header file... Any thoughts on that? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 2/3] mpc85xx: Add deep sleep framework support
On Thu, 2014-02-13 at 02:12 -0600, Tang Yuantian-B29983 wrote: Use an I/O accessor. In_be64?? No such function. Why do you need in_be64() rather than two in_be32()s? -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] SATA Port Multiplier and AHCI Support
Hi all, I am wondering if anyone has tried to deal with SATA port multipliers inside U-Boot? I am in the process of merging a lot of libata and port multiplier support from the Linux kernel back into U-Boot since one of our chips is targeted at NAS devices and our boards use SATA port multipliers. This has ended up being a fairly large project. In addition I am needing to make a lot of changes to the AHCI driver. The first thing I did was switch it from being SCSI to SATA but there are a significant number of additional changes required as well since the 1:1 mapping of port to drives no longer applies. -Aaron -- Aaron Williams Software Engineer Cavium, Inc. (408) 943-7198 (510) 789-8988 (cell) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] usb: tegra: Fix PHY configuration for Tegra 3
寄件者: Stefan Agner [ste...@agner.ch] 寄件日期: 2014年2月15日 上午 06:52 收件者: u-boot@lists.denx.de; Jim Lin; Tom Warren; swar...@wwwdotorg.org; s...@chromium.org; d...@lynxeye.de 主旨: Re: [PATCH v2] usb: tegra: Fix PHY configuration for Tegra 3 Am 2014-02-14 23:45, schrieb Stefan Agner: /* Select ULPI parallel interface */ - clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, PTS_ULPI PTS_SHIFT); + if (!controller-has_hostpc) { + clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, + PTS_ULPI PTS_SHIFT); + else + clrsetbits_le32(usbctlr-hostpc1_devlc, PTS_MASK, + PTS_ULPI PTS_SHIFT); /* enable ULPI transceiver */ setbits_le32(usbctlr-susp_ctrl, ULPI_PHY_ENB); Ok, just noticed that we need to address the different USBD register layout on Tegra 2 here too. Furthermore, the code does not compile with Tegra 2 header file since the hostpc1_devlc field is missing there. The function ehci_get_port_speed uses a define and some calculation to work around this issue. Another solution would be to create a dummy field in the Tegra 2 USB register header file... Any thoughts on that? [Jim} Try use usbctlr-usb_cmd + HOSTPC1_DEVLC instead of usbctlr-hostpc1_devlc --nvpublic ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] usb: tegra: Fix PHY configuration for Tegra 3
On 02/14/2014 09:47 PM, Jim Lin wrote: 寄件者: Stefan Agner [ste...@agner.ch] 寄件日期: 2014年2月15日 上午 06:52 收件者: u-boot@lists.denx.de; Jim Lin; Tom Warren; swar...@wwwdotorg.org; s...@chromium.org; d...@lynxeye.de 主旨: Re: [PATCH v2] usb: tegra: Fix PHY configuration for Tegra 3 Am 2014-02-14 23:45, schrieb Stefan Agner: /* Select ULPI parallel interface */ - clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, PTS_ULPI PTS_SHIFT); + if (!controller-has_hostpc) { + clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, + PTS_ULPI PTS_SHIFT); + else + clrsetbits_le32(usbctlr-hostpc1_devlc, PTS_MASK, + PTS_ULPI PTS_SHIFT); /* enable ULPI transceiver */ setbits_le32(usbctlr-susp_ctrl, ULPI_PHY_ENB); Ok, just noticed that we need to address the different USBD register layout on Tegra 2 here too. Furthermore, the code does not compile with Tegra 2 header file since the hostpc1_devlc field is missing there. The function ehci_get_port_speed uses a define and some calculation to work around this issue. Another solution would be to create a dummy field in the Tegra 2 USB register header file... Any thoughts on that? [Jim} Try use usbctlr-usb_cmd + HOSTPC1_DEVLC instead of usbctlr-hostpc1_devlc I don't think we should mix register access styles. Either ifdef the driver so that only fields appropriate for the SoC being compiled for are accessed, or if the newer SoCs are just supersets of the earlier ones, mere the USB headers together so we don't need to split it up per SoC (and probably add comments indicating which fields are relevant for which SoCs). Actually, you could probably merge the headers even if you go down the ifdef route, to avoid duplicating 99% of the header for each SoC. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot