Re: [U-Boot] Saving environment variables in MMC
Hello, --- On Thu, 1/4/10, Detlev Zundel wrote: > From: Detlev Zundel > Subject: Re: [U-Boot] Saving environment variables in MMC > To: nitin...@yahoo.com > Cc: "U-Boot user list" > Date: Thursday, 1 April, 2010, 5:35 PM > Hi Nitin, > > >> It is rather common to write to the U-Boot > environment in projects > >> for example to switch to a new set of kernel+file > system after an > >> update from within linux for the next boot. > >> > > My use case is exactly same, to switch to a new set of > kernel+fs after > > an update for the next boot. > > > > I also have another usecase of updating the env > variable 'bootargs' if > > required in the field. So this use-case combined with > fw_env, what is > > your feedback? > > It is doable of course. Maybe if I did not mention it > before, I advise > using a redundant environment for such procedures so that > even a > powerloss during this upgrade will not brick the device. Can I get some pointers to some example implementation of a redundant environment. I mean how does a switching between the environments happen? Who clears or sets the obsolete flag for the redundant env? -Nitin > > > Could you give me some pointers on upgrading u-boot > itself, but I > > don't have a spare partition for that. I would have to > replace working > > copy itself? > > I would not recommend upgrading U-Boot in the field. > As it is not > possible to build in redundancy for U-Boot (on most systems > I know), > there is always the possibility to kill the device with > such an update. > > > I would wanted to have more info(in addition to what I > have > > implemented) regarding the failsafe upgrade mechanisms > for > > embedded-linux apps and kernel? Could you please point > me to right > > forums regarding this. I understand that this is not > specific to > > u-boot, but just give me some pointers. > > I'm sorry that I cannot point you to a ready to use recipe > here, as this > really depends on your strategy regarding upgrades, i.e. > will you do the > upgrade from within Linux? (judging by your questions, you > will...) Do > you have enough ressources to keep two self-contained > "program images" > (at least kernel+dtb+rootfs) so you can always update "the > other half"? > If not, you will probably want to build a non-upgradeable > fallback > system which is only capable to update "the other part". > > As you see, solving your problem really requires you to > define your > problem more rigorously first. > > In order to protoect against interrupts during the update, > you may very > well want to have a watchdog on your system and use the > "bootcount" > (grep the documentation for it) feature of U-Boot to detect > failing boot > attempts. > > I hope this is enough to get you started. > > Cheers > Detlev > > -- > Thanks so much for Emacs. What a wondrous system -- > one of the real > seven wonders of the world. Forced to choose between > Emacs and, say, > any pyramid, I'd take Emacs. > -- Robert Boyer > -- > DENX Software Engineering GmbH, MD: > Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 > Groebenzell, Germany > Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: > d...@denx.de > New Email names for you! Get the Email name you've always wanted on the new @ymail and @rocketmail. Hurry before someone else does! http://mail.promotions.yahoo.com/newdomains/aa/ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] The BUILD_BUG_ON macros moved from ubi_uboot.h to common.h
On Thursday 01 April 2010 13:16:53 Michael Zaidman wrote: > The BUILD_BUG_ON macros made availible for rest of the u-boot code > by moving it from ubi_uboot.h to common.h. In Linux kernel this > widely used macros is defined in kernel.h file. compiler.h might be a better place so that it is available to host tools too -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/3 v2] drivers/serial/serial.c: code maintainability improvments.
Signed-off-by: Michael Zaidman --- drivers/serial/serial.c | 27 +-- 1 files changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index dd5f332..ba88cb0 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -45,24 +45,27 @@ DECLARE_GLOBAL_DATA_PTR; #else #error "No console index specified." #endif /* CONFIG_SERIAL_MULTI */ -#elif (CONFIG_CONS_INDEX < 1) || (CONFIG_CONS_INDEX > 4) +#elif CONFIG_CONS_INDEX < 1 #error "Invalid console index value." #endif -#if CONFIG_CONS_INDEX == 1 && !defined(CONFIG_SYS_NS16550_COM1) -#error "Console port 1 defined but not configured." -#elif CONFIG_CONS_INDEX == 2 && !defined(CONFIG_SYS_NS16550_COM2) -#error "Console port 2 defined but not configured." -#elif CONFIG_CONS_INDEX == 3 && !defined(CONFIG_SYS_NS16550_COM3) -#error "Console port 3 defined but not configured." -#elif CONFIG_CONS_INDEX == 4 && !defined(CONFIG_SYS_NS16550_COM4) -#error "Console port 4 defined but not configured." +#define CONSOLE_PORT_SANITY_CHECK(port) \ + CONFIG_CONS_INDEX == port && !defined(CONFIG_SYS_NS16550_COM##port) + +#ifCONSOLE_PORT_SANITY_CHECK(1) +#error Console port 1 defined but not configured. +#elif CONSOLE_PORT_SANITY_CHECK(2) +#error Console port 2 defined but not configured. +#elif CONSOLE_PORT_SANITY_CHECK(3) +#error Console port 3 defined but not configured. +#elif CONSOLE_PORT_SANITY_CHECK(4) +#error Console port 4 defined but not configured. #endif /* Note: The port number specified in the functions is 1 based. * the array is 0 based. */ -static NS16550_t serial_ports[4] = { +static NS16550_t serial_ports[] = { #ifdef CONFIG_SYS_NS16550_COM1 (NS16550_t)CONFIG_SYS_NS16550_COM1, #else @@ -85,6 +88,8 @@ static NS16550_t serial_ports[4] = { #endif }; +#define MAX_SER_PORTS (sizeof(serial_ports) / sizeof(NS16550_t)) + #define PORT serial_ports[port-1] #if defined(CONFIG_CONS_INDEX) #define CONSOLE(serial_ports[CONFIG_CONS_INDEX-1]) @@ -160,6 +165,8 @@ int serial_init (void) { int clock_divisor; + BUILD_BUG_ON(CONFIG_CONS_INDEX > MAX_SER_PORTS); + #ifdef CONFIG_NS87308 initialise_ns87308(); #endif -- 1.6.3.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] drivers/serial/serial.c: code maintainability improvments.
Hi Kim, Thanks for your corrections. I fixed all of them in version #2 of the patch here: http://lists.denx.de/pipermail/u-boot/2010-April/069412.html Regards, Michael ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] The BUILD_BUG_ON macros moved from ubi_uboot.h to common.h
On Fri, Apr 2, 2010 at 11:52 AM, Mike Frysinger wrote: > On Thursday 01 April 2010 13:16:53 Michael Zaidman wrote: >> The BUILD_BUG_ON macros made availible for rest of the u-boot code >> by moving it from ubi_uboot.h to common.h. In Linux kernel this >> widely used macros is defined in kernel.h file. > > compiler.h might be a better place so that it is available to host tools too > -mike > The common.h includes image.h which includes compiler.h, so technically it should works also. I have a doubt however - what about location of similar staff such as BUG, BUG_ON, debug, error, etc. Should it also be moved into compiler.h file? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] AT91 Fix: return value of get_tbclk
* Fix: return value of get_tbclk * this fixes issue with prematurely restart/retry, if BOOT_RETRY_TIMEOUT is used Signed-off-by: Jens Scharsig --- cpu/arm926ejs/at91/timer.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/cpu/arm926ejs/at91/timer.c b/cpu/arm926ejs/at91/timer.c index d21eebf..8efc34b 100644 --- a/cpu/arm926ejs/at91/timer.c +++ b/cpu/arm926ejs/at91/timer.c @@ -138,8 +138,5 @@ ulong get_timer(ulong base) */ ulong get_tbclk(void) { - ulong tbclk; - - tbclk = CONFIG_SYS_HZ; - return tbclk; + return timer_freq; } -- 1.6.0.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] POST: Added ECC memory test for mpc83xx.
--- post/cpu/mpc83xx/Makefile | 30 + post/cpu/mpc83xx/ecc.c| 160 + 2 files changed, 190 insertions(+), 0 deletions(-) create mode 100644 post/cpu/mpc83xx/Makefile create mode 100644 post/cpu/mpc83xx/ecc.c diff --git a/post/cpu/mpc83xx/Makefile b/post/cpu/mpc83xx/Makefile new file mode 100644 index 000..86d8784 --- /dev/null +++ b/post/cpu/mpc83xx/Makefile @@ -0,0 +1,30 @@ +# +# (C) Copyright 2002-2007 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +include $(OBJTREE)/include/autoconf.mk + +LIB= libpostmpc83xx.a + +AOBJS-$(CONFIG_HAS_POST) += +COBJS-$(CONFIG_HAS_POST) += ecc.o + +include $(TOPDIR)/post/rules.mk diff --git a/post/cpu/mpc83xx/ecc.c b/post/cpu/mpc83xx/ecc.c new file mode 100644 index 000..83dfcf6 --- /dev/null +++ b/post/cpu/mpc83xx/ecc.c @@ -0,0 +1,160 @@ +/* + * (C) Copyright 2010 + * Eastman Kodak Company, + * Michael Zaidman, + * + * The code is based on the cpu/mpc83xx/ecc.c written by + * Dave Liu + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include +#include +#include + +#if CONFIG_POST & CONFIG_SYS_POST_ECC + +inline static void ecc_clear(volatile ddr83xx_t *ddr) +{ + /* clear capture registers */ + ddr->capture_address = 0; + ddr->capture_data_hi = 0; + ddr->capture_data_lo = 0; + ddr->capture_ecc = 0; + ddr->capture_attributes = 0; + + /* Clear SBEC and set SBET to 1 */ + ddr->err_sbe = (1 << ECC_ERROR_MAN_SBET_SHIFT); + + /* Clear Error Detect register */ + ddr->err_detect = (ECC_ERROR_DETECT_MME | + ECC_ERROR_DETECT_MBE | + ECC_ERROR_DETECT_SBE | + ECC_ERROR_DETECT_MSE); + + __asm__ __volatile__("sync"); + __asm__ __volatile__("isync"); +} + +int ecc_post_test(int flags) +{ + int ret = 0; + int int_state; + int errbit; + u32 pattern[2], writeback[2], retval[2]; + volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; + volatile ddr83xx_t *ddr = &immap->ddr; + volatile u64 * addr = (u64 *)CONFIG_SYS_POST_ECC_START_ADDR; + + /* The pattern is written into memory to generate error */ + pattern[0] = 0xfedcba98UL; + pattern[1] = 0x76543210UL; + + /* After injecting error, re-initialize the memory with the value */ + writeback[0] = ~pattern[0]; + writeback[1] = ~pattern[1]; + + /* Check if ECC is enabled */ + if (ddr->err_disable & ECC_ERROR_ENABLE) { + debug("DDR's ECC is not enabled, skipping the ECC POST.\n"); + return 0; + } + + int_state = disable_interrupts(); + + icache_enable(); + +#ifdef CONFIG_DDR_32BIT + /* It seems like no one really uses the CONFIG_DDR_32BIT mode */ +#error "Add the ECC POST support for CONFIG_DDR_32BIT here." +#else + for (addr = (u64 *)CONFIG_SYS_POST_ECC_START_ADDR, errbit = 0; +addr < (u64 *)CONFIG_SYS_POST_ECC_STOP_ADDR; addr++, errbit++) { + + WATCHDOG_RESET(); + + /* Test for correctable error by creating a one-bit error */ + ecc_clear(ddr); + + /* enable injects */ + ddr->ecc_err_inject |= ECC_ERR_INJECT_EIEN; + + /* Inject single bit error */ + if (errbit < 32) { + ddr->data_err_inject_lo = 1 << errbit;
[U-Boot] [PATCH] sa1100 change get_timer(base) to return time since base
similar to 274737e5eb25b2bcd3af3a96da923effd543284f This patch changes get_timer() for sa1100 to return the time since 'base' instead of the time since the counter was at zero. Symptom seen is flash timeout errors when erasing or programming a sector using the common cfi flash code. Signed-off-by: Jochen Friedrich --- cpu/sa1100/timer.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cpu/sa1100/timer.c b/cpu/sa1100/timer.c index 0207501..aea90ab 100644 --- a/cpu/sa1100/timer.c +++ b/cpu/sa1100/timer.c @@ -41,7 +41,7 @@ void reset_timer (void) ulong get_timer (ulong base) { - return get_timer_masked (); + return get_timer_masked () - base; } void set_timer (ulong t) -- 1.7.0.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] Fix compile errors for atmel_nand with hw-ecc and new SoC access
On Sun, Mar 28, 2010 at 02:42:25PM +0200, Alexander Holler wrote: > atmel_nand.c with HW-ECC doesn't compile with the new SoC access. > Using CONFIG_AT91_LEGACY to circumvent the compile errors only leaves > the driver in a state where it doesn't find the NAND. > > To use HW-ECC with atmel_nand one has to use > CONFIG_SYS_NAND_ECC_BASE AT91_ECC0_BASE (instead of AT91_ECC0) > for an AT91SAM9263 or AT91_ECC_BASE for an AT91SAM9260. > > I've removed three unused variables too. > --- > drivers/mtd/nand/atmel_nand.c |7 +++ > 1 files changed, 3 insertions(+), 4 deletions(-) Missing Signed-off-by line. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [Nios] Pull Request
Wolfgang, The following changes since commit ffa37fc98d71ef930bccd4e9eed37f6ce6b4d6af: Wolfgang Denk (1): Merge branch 'next' are available in the git repository at: git://git.denx.de/u-boot-nios.git master Scott McNutt (7): nios2: Move serial drivers to individual files in drivers/serial nios2: Add missing Ethernet initialization to board_init(). nios2: Add support for EPCS16 and EPCS64 configuration devices. nios2: Fix outx/writex parameter order in io.h nios2: Set CONFIG_SYS_HZ to 1000 all nios2 boards. nios2: Fix AMDLV065D flash write bug in altera board common tree. nios2: Reload timer count in reset_timer() Thomas Chou (5): nios2: add asm-nios2/errno.h nios2: add local_irq_enable/disable to asm-nios2/system.h nios2: use bitops from linux-2.6 asm-generic nios2: add struct stat support in linux/stat.h nios2: pass command line and initrd to linux in bootm.c board/altera/common/AMDLV065D.c | 20 +- board/altera/common/epled.c |6 +- board/psyent/common/AMDLV065D.c | 18 +- board/psyent/pk1c20/led.c |6 +- cpu/nios2/Makefile|2 +- cpu/nios2/epcs.c | 18 ++- cpu/nios2/interrupts.c| 49 +- cpu/nios2/serial.c| 309 - drivers/serial/Makefile |3 + drivers/serial/altera_jtag_uart.c | 70 drivers/serial/altera_uart.c | 94 ++ drivers/serial/opencores_yanu.c | 188 include/asm-nios2/bitops.h| 14 +- include/asm-nios2/bitops/atomic.h | 189 include/asm-nios2/bitops/ffs.h| 41 + include/asm-nios2/bitops/non-atomic.h | 108 include/asm-nios2/errno.h |1 + include/asm-nios2/io.h| 18 +- include/asm-nios2/system.h| 33 include/configs/EP1C20.h | 17 +- include/configs/EP1S10.h | 17 +- include/configs/EP1S40.h | 17 +- include/configs/PCI5441.h | 17 +- include/configs/PK1C20.h | 17 +- include/linux/stat.h |2 +- lib_nios2/board.c |7 + lib_nios2/bootm.c | 19 ++- 27 files changed, 888 insertions(+), 412 deletions(-) delete mode 100644 cpu/nios2/serial.c create mode 100644 drivers/serial/altera_jtag_uart.c create mode 100644 drivers/serial/altera_uart.c create mode 100644 drivers/serial/opencores_yanu.c create mode 100644 include/asm-nios2/bitops/atomic.h create mode 100644 include/asm-nios2/bitops/ffs.h create mode 100644 include/asm-nios2/bitops/non-atomic.h create mode 100644 include/asm-nios2/errno.h Regards, --Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] The BUILD_BUG_ON macros moved from ubi_uboot.h to common.h
On Friday 02 April 2010 06:56:41 Michael Zaidman wrote: > On Fri, Apr 2, 2010 at 11:52 AM, Mike Frysinger wrote: > > On Thursday 01 April 2010 13:16:53 Michael Zaidman wrote: > >> The BUILD_BUG_ON macros made availible for rest of the u-boot code > >> by moving it from ubi_uboot.h to common.h. In Linux kernel this > >> widely used macros is defined in kernel.h file. > > > > compiler.h might be a better place so that it is available to host tools > > too > > The common.h includes image.h which includes compiler.h, so > technically it should works also. you're looking the wrong direction. host tools include compiler.h, they dont include common.h. > I have a doubt however - what about location of similar staff such as BUG, > BUG_ON, debug, error, etc. Should it also be moved into compiler.h file? many should not. BUG_ON requires functions that only u-boot implements and are not available in host C libraries. -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] POST: Added ECC memory test for mpc83xx.
On Fri, Apr 2, 2010 at 8:49 AM, Michael Zaidman wrote: > +inline static void ecc_clear(volatile ddr83xx_t *ddr) Please use I/O accessors instead of "volatile". -- Timur Tabi Linux kernel developer at Freescale ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot