[U-Boot] usage of OTP (one time programmable) flash ?

2010-01-12 Thread Arno Steffen
The flash (MT29F1G) on my omap board supports OTP. Is there any support by
u-boot to have access (write/read) to that OPT area?
What's to do to get it working and how to use?
I've been searching a lot in the net, but hasn't been succesful with that.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] start a second kernel/filesystem if first one is corrupted

2010-01-13 Thread Arno Steffen
To make a more stable system I want to put a second reduced linux
(kernel/rootfs) onto flash memory.
This should be boot automatically, if #1 fails for any reason.
I tried to add this in bootcmd, but execution will be interuppted if the
first bootm failes.
Is there any chance to do so?
(maybe it is even possible to compile this into bootloader, in case uboot
environment gets corrupted/misconfigured)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] start a second kernel/filesystem if first one is corrupted

2010-01-14 Thread Arno Steffen
@ Wolfgang W.

I am using a OMAP board with a Cortex A8

Ok, it normaly executes commands after each other. But in case the rootfs is
invalid in boots kernel and ends up with kernel panic which causes a reboot.
In this way the second command will not be executed
bootcmd=run boot_fs1; run boot_fs2

Bootcount is a great idea, but don't know right now how to do this. Also it
will stress the flash, as it has to change the environment every time it
boots.

@Wolfgang D.

Although I add hush to my config file
#define CONFIG_HUSH_PARSER1 /* use "hush" command parser */

and it compiles hush.c to hush.o I get

Unknown command 'if'
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] start a second kernel/filesystem if first one is corrupted

2010-01-14 Thread Arno Steffen
2010/1/14 Wolfgang Denk 

> Dear Arno Steffen,
>
> In message <804f0d21001140104o3543921cx2b4422fbc8a9...@mail.gmail.com> you
> wrote:
> >
> > Ok, it normaly executes commands after each other. But in case the rootfs
> is
> > invalid in boots kernel and ends up with kernel panic which causes a
> reboot.
> > In this way the second command will not be executed
> > bootcmd=run boot_fs1; run boot_fs2
>
> Right, this method can only detect when the boot command fails, for
> example because of corrupted images. It cannot handle situations where
> the kernel crashes, or where the application does not start up
> successfully.  To handle such situations you have to use the bootcount
> feature, usually combined with a hardware watchdog which will reset
> your board in cases where it just hangs.
>
> > Bootcount is a great idea, but don't know right now how to do this. Also
> it
>
> Hire an expert, then.
>
> > will stress the flash, as it has to change the environment every time it
> > boots.
>
> No, this is wrong. Nothing neds to get written to flash when booting.
> The boot counter is NOT stored in the environment, but in some
> hardware register or other storage that is known not to change it's
> value during a reset.
>
> > Although I add hush to my config file
> > #define CONFIG_HUSH_PARSER1 /* use "hush" command parser */
> >
> > and it compiles hush.c to hush.o I get
> >
> > Unknown command 'if'
>
> Can you please provide the full log, including all your input and all
> output?  Please include the same (full input and output) for running
> this command:
>
> => echo foo || echo bar
>
> 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
> After Goliath's defeat, giants ceased to command respect.
> - Freeman Dyson
>

Thanks for answer.
My uboot is a 2008.10 (Mistral/TI EVM board)

OMAP3 # echo foo || echo bar
foo || echo bar
OMAP3 # setenv check 'if imi $addr; then echo Image OK; else echo Image
corrupted!!; fi'
OMAP3 # run check
Unknown command 'if' - try 'help'
Unknown command 'then' - try 'help'
Unknown command 'else' - try 'help'
Unknown command 'fi' - try 'help'
OMAP3 #

The line:

#define CONFIG_HUSH_PARSER1 /* use "hush" command parser */
I put into /include/configs/omap3_evm.h

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] start a second kernel/filesystem if first one is corrupted

2010-01-14 Thread Arno Steffen
2010/1/14 Wolfgang Denk 
>
> Dear Arno Steffen,
>
> please keep the mailing list on Cc:
>
> In message <804f0d21001140252v164b7df0p1d1e94f3d316...@mail.gmail.com> you 
> wrote:
> >
> > > > Although I add hush to my config file
> > > > #define CONFIG_HUSH_PARSER    1 /* use "hush" command parser */
> > > >
> > > > and it compiles hush.c to hush.o I get
> > > >
> > > > Unknown command 'if'
> ...
> > OMAP3 # echo foo || echo bar
> > foo || echo bar
>
> This means you do NOT have hush support in your image. Check your
> config file again, make sure you really rebuild the U-Boot image (run
> "make mrproper" first), and make sure you are really booting the new
> image.
>
> > My uboot is a 2008.10 (Mistral/TI EVM board)
> ...
> > The line:
> > #define CONFIG_HUSH_PARSER    1 /* use "hush" command parser */
> > I put into /include/configs/omap3_evm.h
>
> Are you sure omap3_evm.h is the right config file for your board?
>
>
> > --0016e6d99ace5450a2047d1dafbe
> > Content-Type: text/html; charset=ISO-8859-1
> > Content-Transfer-Encoding: quoted-printable
>
> Please never post HTML!!!
>
> Best regards,
>
> Wolfgang Denk

Sorry. I have to get used to googlemail first. My former mail doesn't
handle replys in  a proper way.

I recompiled after clean everything. I could see hash.o is inside libcommon.a.
I just add the make lines of hush and libcommon (see below)
I also checked the compile date of the flashed uboot.
So I have no idea what is missed to get it working.
Best regards
Arno

arm-none-linux-gnueabi-gcc -g  -Os   -fno-strict-aliasing -fno-common
-ffixed-r8 -msoft-float   -fno-strict-aliasing -fno-common -ffixed-r8
-msoft-float   -D__KERNEL__ -DTEXT_BASE=0x80e8
-I/opt/src/uboot-02.01.02.09/include -fno-builtin -ffreestanding
-nostdinc -isystem
/opt/cs/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -pipe
-DCONFIG_ARM -D__ARM__ -march=armv7a  -mno-thumb-interwork
-march=armv7-a  -mno-thumb-interwork -Wall -Wstrict-prototypes
-fno-stack-protector -c -o hush.o hush.c
...
arm-none-linux-gnueabi-gcc -g  -Os   -fno-strict-aliasing -fno-common
-ffixed-r8 -msoft-float   -fno-strict-aliasing -fno-common -ffixed-r8
-msoft-float   -D__KERNEL__ -DTEXT_BASE=0x80e8
-I/opt/src/uboot-02.01.02.09/include -fno-builtin -ffreestanding
-nostdinc -isystem
/opt/cs/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -pipe
-DCONFIG_ARM -D__ARM__ -march=armv7a  -mno-thumb-interwork
-march=armv7-a  -mno-thumb-interwork -Wall -Wstrict-prototypes
-fno-stack-protector -c -o xyzModem.o xyzModem.c
arm-none-linux-gnueabi-ar crv libcommon.a circbuf.o cmd_autoscript.o
cmd_bdinfo.o cmd_boot.o cmd_bootm.o cmd_console.o cmd_i2c.o
cmd_itest.o cmd_jffs2.o cmd_load.o cmd_mem.o cmd_misc.o cmd_nand.o
cmd_net.o cmd_nvedit.o cmd_onenand.o cmd_pcmcia.o command.o console.o
devices.o dlmalloc.o env_common.o env_embedded.o env_nand.o
env_onenand.o exports.o flash.o hush.o image.o kgdb.o main.o memsize.o
s_record.o serial.o xyzModem.o
...
make[1]: Leaving directory `/opt/src/uboot-02.01.02.09/board/omap3/spv'
UNDEF_SYM=`arm-none-linux-gnueabi-objdump -x board/omap3/spv/libspv.a
lib_generic/libgeneric.a lib_generic/lzma/liblzma.a
cpu/arm_cortexa8/libarm_cortexa8.a cpu/arm_cortexa8/omap3/libomap3.a
lib_arm/libarm.a fs/cramfs/libcramfs.a fs/fat/libfat.a
fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a
fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a net/libnet.a disk/libdisk.a
drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a
drivers/dma/libdma.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a
drivers/input/libinput.a drivers/misc/libmisc.a drivers/mmc/libmmc.a
drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a
drivers/mtd/nand_legacy/libnand_legacy.a
drivers/mtd/onenand/libonenand.a drivers/mtd/ubi/libubi.a
drivers/mtd/spi/libspi_flash.a drivers/net/libnet.a
drivers/net/phy/libphy.a drivers/net/sk98lin/libsk98lin.a
drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/spi/libspi.a
drivers/rtc/librtc.a drivers/serial/libserial.a drivers/usb/libusb.a
drivers/video/libvideo.a common/libcommon.a libfdt/libfdt.a
api/libapi.a post/libpost.a | \
sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
cd /opt/src/uboot-02.01.02.09 && arm-none-linux-gnueabi-ld 
-Bstatic
-T /opt/src/uboot-02.01.02.09/board/omap3/spv/u-boot.lds  -Ttext
0x80e8 $UNDEF_SYM cpu/arm_cortexa8/start.o \
--start-group lib_generic/libgeneric.a 
lib_generic/lzma/liblzma.a
cpu/arm_cortexa8/libarm_cortexa8.a cpu/arm_cortexa8/omap3/libomap3.a
lib_arm/libarm.a fs/cramfs/libcramfs.a fs/fat/libfat.a
fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a
fs/ext2/libext2fs.a fs/yaffs2/libyaffs2.a net/libnet.a disk/libdisk.a
driver

[U-Boot] OMAP3 EVM board nand support missed

2010-01-18 Thread Arno Steffen
Testing the latest release (2009-08) I missed the NAND support (there
is just ONENAND).
Adding the line in config
#define CONFIG_CMD_NAND /* NAND support */
cause a error in building uboot:
...drivers/mtd/nand/libnand.a(nand.o): In function `nand_init_chip':
/opt/src/ub/u-boot-ti-git-2009-08/drivers/mtd/nand/nand.c:53:
undefined reference to `board_nand_init'
make: *** [u-boot] Fehler 1

Is this intentionally not supported anymore? What's to do to get nand
support for my board?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Linux Kernel without Ethernet (missed MAC)

2010-01-19 Thread Arno Steffen
Changing my OMAP EVM board to newest uboot 2009-11 I do have a problem
with ethernet.
Although the kernel could be loaded via tftp perfectly, the upcoming
kernel complains about invalid MAC.

Kernel command line: mem=128M console=ttyS0,115200n8
root=/dev/mtdblock8 rw rootfstype=jffs2 ip=dhcp
...
loop: module loaded
eth0: LAN9115 (rev 2) at 0x2c00 IRQ 336
eth0: Invalid ethernet MAC address. Please set using ifconfig
i2c /dev entries driver
...
IP-Config: Failed to open eth0
IP-Config: No network devices available.
...
After Linux has booted, I don't have an /dev/ethX device

I already checked this:
http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux
but I am not expert enough to see wether the kernel has a bug.
In /driver/net/smc911x.c the devinit smc911x_probe will generate the first
message that something goes wrong

   if (!is_valid_ether_addr(dev->dev_addr)) {
   printk("%s: Invalid ethernet MAC address. Please "
   "set using ifconfig\n", dev->name);

/driver/net/smc911x.c checks in smc911x_open() the validity of MAC,
which seems to fail.
/driver/net/smc911x.c calls SMC_GET_MAC_ADDR which is a macro in
/driver/net/smc91x.h


In uboot-env the Mac has been configured.
"Warning: smc911x-0 MAC addresses don't match:
Address in SROM is ff:ff:ff:ff:ff:ff
Address in environment is  00:19:66:cc:44:ee"

Loading via TFTP works
OMAP3_EVM # tftpboot 0x8000 evm/uImage
smc911x: detected LAN9115 controller
smc911x: phy initialized
smc911x: MAC 00:19:66:cc:44:ee
Using smc911x-0 device
TFTP from server 192.168.90.230; our IP address is 192.168.90.200
Filename 'evm/uImage'.
Load address: 0x8000
Loading: #
 #
 #
done

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Linux Kernel without Ethernet (missed MAC)

2010-01-19 Thread Arno Steffen
I think this is a uboot bug.

If this is a kernel bug - where does the kernel gets the mac address from?
Is it reading a device register? So it must be set by u-boot. But obviously
it isn't there  (kernel boot log):
"eth0: LAN9115 (rev 2) at 0x2c00 IRQ 336
eth0: Invalid ethernet MAC address. Please set using ifconfig"

The problem occures in any boot sequence (nand, network) - so although
the uboot initializes the ethernet chip, linux kernel doesn't find the
mac-address. So your advice doesn't help.

I am not expert enough to know how it should be. In an older uboot
(2008.10) I could solve the problem with any ethernet access in uboot
(as you suggested) - then I get ethernet in kernel boot as well.

In 2009.11 it is different - no way to get it working - same kernel.
Looks like uboot either doesn't set mac or deletes mac.

Best regards
Arno

2010/1/19 Prafulla Wadaskar :
>
>
>> -Original Message-
>> From: u-boot-boun...@lists.denx.de
>> [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Arno Steffen
>> Sent: Tuesday, January 19, 2010 3:14 PM
>> To: u-boot@lists.denx.de
>> Subject: [U-Boot] Linux Kernel without Ethernet (missed MAC)
>>
>> Changing my OMAP EVM board to newest uboot 2009-11 I do have a problem
>> with ethernet.
>> Although the kernel could be loaded via tftp perfectly, the upcoming
>> kernel complains about invalid MAC.
>>
>> Kernel command line: mem=128M console=ttyS0,115200n8
>> root=/dev/mtdblock8 rw rootfstype=jffs2 ip=dhcp
>
> Hi Arno
>
> I hope, when you are booting the kernel from media (i.e. NAND/Flash/Sata and 
> not Ethernet) you are getting this problem.
> u-boot does not perform peripheral h/w initialization by default, u-boot as 
> well as kernel assumes h/w is doing this.
>
> May be in your case, smc91x h/w does not do it on Power on by default.
> When you do any network activity prior to kernel boot, device_init is invoked 
> and the MAC address is set and your system works.
>
> Possible Solution: add dummy network command like (ping x.x.x.x) in your auto 
> boot sequence.
>
> Regards..
> Prafulla . .
>
>> ...
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Linux Kernel without Ethernet (missed MAC)

2010-01-19 Thread Arno Steffen
2010/1/19 Wolfgang Denk :
> Dear Arno Steffen,
>
> In message <804f0d21001190554r13f582abl3dbbc80b50df3...@mail.gmail.com> you 
> wrote:
>> I think this is a uboot bug.
>
> You sound as is you were really sure about this.

I can't be sure, as I don't know how MAC is transfered into kernel (no
eprom) - that's what I ask for.
An older versions of uboot it works with the same kernel - so what
should I think about it?
At least things have been changed ...

>
> But maybe you did not even read the FAQ, for example
> http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux ?

In my first mail
(http://lists.denx.de/pipermail/u-boot/2010-January/066703.html)
I wrote that I have checked this and wrote down what I found out.
Probably it is due to my limited experience in this, that's why I
asked for help.
A "ifconfig" after boot will not help, as I don't have an eth-device.

> And you also did not bother to search the archives, or did you

Call me stupid, I just know this access : http://lists.denx.de/pipermail/u-boot/
This doesn't allow a practial search (at least I don't know how) - sorry.
I am working puzzling more than a day with this - so I am not lazy with that.
I try my best.

> Wolfgang Denk

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Linux Kernel without Ethernet (missed MAC)

2010-01-19 Thread Arno Steffen
2010/1/19 Daniel Gorsulowski :
> On ARM, I solved that problem as follows:
>
> 1. Add "ethaddr=$(ethaddr)" to your kernel command line. e.g.:
>   mem=128M console=ttyS0,115200n8 ethaddr=$(ethaddr)
>
> 2. Apply this patch on linux kernel (approved on v2.6.31):
>

Thanks for this idea. I checked the kernel and set in
file smsc911x.c in function smc911x_reset()
dev->dev_addr[0] = 0
to get valid (but not my mac address).

Nevertheless I would prefer to patch the uboot instead of kernel.
What I don't understand is: MAC (that is set in uboot - at least if I
do a tftp) will disapear.
Is it cleaned up by uboot? Somehow it has worked before ...

Or the other way around: What is the current valid and recommended way
to pass mac from uboot to kernel? It should work without patches.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Linux Kernel without Ethernet (missed MAC)

2010-01-20 Thread Arno Steffen
I did a small mod in uboot now. After each ethernet-access the
interface chip seems to get a soft reset, which deletes the mac
address in its registers.

So in smc911x.h () in function smc911x_reset I commented the line

//  smc911x_reg_write(dev, HW_CFG, HW_CFG_SRST);

It is somehow pitty that kernel (even latest) and uboot doesn't match anymore.
As I coudn't find out how does the kernel usually know the mac from, I
don't know what part is responsible.
Thanks all of you for your help.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] environment in NAND

2011-09-06 Thread Arno Steffen
NAND is sufferered from Bad blocks and bit errors. Thats why usually
exists a bad block handling and an ECC. Am I wrong, that I miss both
on uboot  for it's environment?
Or is my uboot just to old (2010.06) and newer versions handle this?
Is there a special setting necessary to handle this?
I see that environment is CRC protected but this make things even
worse, if not an important bit is toogled.
Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] environment in NAND

2011-09-06 Thread Arno Steffen
2011/9/6 Marek Vasut :
> On Tuesday, September 06, 2011 04:16:59 PM Arno Steffen wrote:
>> NAND is sufferered from Bad blocks and bit errors. Thats why usually
>> exists a bad block handling and an ECC. Am I wrong, that I miss both
>> on uboot  for it's environment?
>> Or is my uboot just to old (2010.06) and newer versions handle this?
>> Is there a special setting necessary to handle this?
>> I see that environment is CRC protected but this make things even
>> worse, if not an important bit is toogled.
>> Best regards
>> Arno
>
> Hi,
>
> the mtd subsystem in uboot is based on the one from linux. The ECC handling is
> there, no problem. The problem you might experience is in case you have a
> wrongly implemented NAND driver, which ignores ECC.
>
> What board/cpu do you use? Also, why so old uboot, use mainline?
>
> Cheers
>
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>

Hi Marek and Wolfgang, Thanks for your answers.
I kept already one sector space for bad blocks, so 1st environment is
at c., 2nd at 10.. Blocksize is 2. (so 1 block left).
Maybe I have to announce uboot, that there is one block more
available. But how, in wich defininition? I can declare size (which is
just 8k) and blocksize (128k), but not block number ?!?
I found that this below more or less relates to environment: Maybe I
miss something here? Some look redundant to me. I adopted this from
another board included in uboot, just changed size,location and
redundancy.

#define CONFIG_ENV_SIZE (8 << 10)   /* 8 KiB */
#define CONFIG_SYS_MALLOC_LEN   (CONFIG_ENV_SIZE + (128 << 10))
#define CONFIG_SYS_GBL_DATA_SIZE128 /* bytes reserved for */

#define SMNAND_ENV_OFFSET   0x0C /* environment starts here */

#define CONFIG_SYS_ENV_SECT_SIZEboot_flash_sec
#define CONFIG_ENV_OFFSET   boot_flash_off
#define CONFIG_ENV_ADDR boot_flash_env_addr

#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
#define CONFIG_ENV_OFFSET_REDUND0x10
#define CONFIG_ENV_SIZE_REDUND  (CONFIG_ENV_SIZE)

Regarding the version:
I use an ARM Cortex-A8 / OMAP3, and this uboot is the SDK of TI.
(source is http://arago-project.org/git/projects/?p=u-boot-omap3.git;a=summary)

about ECC: The envrionment  is written with ECC, but my impression is
- it is not working or CRC check is done BEFORE correction is done. So
from time to time I've got a flash from supplier which gives me a CRC
error, and if I check the content, there is just one bit wrong.

@ Wolfgang: I would recommend to downsize the environment size to what
you need. It happens here that a bit is toggling, and than I get CRC
error - although this toggled bit is somewhere in 128k. If the size is
smaller, chances are better that the toggling bit in sector doesn't
hurt you, as it is outside the size.

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] environment in NAND

2011-09-07 Thread Arno Steffen
2011/9/7 Wolfgang Wegner :
> Hi Arno,
>
> On Wed, Sep 07, 2011 at 08:20:22AM +0200, Arno Steffen wrote:
>> Hi Marek and Wolfgang, Thanks for your answers.
>> I kept already one sector space for bad blocks, so 1st environment is
>> at c., 2nd at 10.. Blocksize is 2. (so 1 block left).
>> Maybe I have to announce uboot, that there is one block more
>> available. But how, in wich defininition? I can declare size (which is
>> just 8k) and blocksize (128k), but not block number ?!?
>> I found that this below more or less relates to environment: Maybe I
>> miss something here? Some look redundant to me. I adopted this from
>> another board included in uboot, just changed size,location and
>> redundancy.
>>
>> #define CONFIG_ENV_SIZE                       (8 << 10)       /* 8 KiB */
>> #define CONFIG_SYS_MALLOC_LEN         (CONFIG_ENV_SIZE + (128 << 10))
>> #define CONFIG_SYS_GBL_DATA_SIZE      128     /* bytes reserved for */
>>
>> #define SMNAND_ENV_OFFSET             0x0C /* environment starts here */
>>
>> #define CONFIG_SYS_ENV_SECT_SIZE      boot_flash_sec
>> #define CONFIG_ENV_OFFSET             boot_flash_off
>> #define CONFIG_ENV_ADDR                       boot_flash_env_addr
>>
>> #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
>> #define CONFIG_ENV_OFFSET_REDUND      0x10
>> #define CONFIG_ENV_SIZE_REDUND                (CONFIG_ENV_SIZE)
>
> this is my adapted openrd configuration:
> #define CONFIG_ENV_IS_IN_NAND           1
> #define CONFIG_ENV_SECT_SIZE            0x2 /* 128K */
>
> #define CONFIG_ENV_SIZE                 0x2 /* 128k */
> #define CONFIG_ENV_ADDR                 0x6
> #define CONFIG_ENV_OFFSET               0x6 /* env starts here */
> #define CONFIG_ENV_RANGE                (6 * CONFIG_ENV_SIZE)
> #define CONFIG_ENV_OFFSET_REDUND        (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
>
> It is too long ago I made this modification, so I am not sure (but of
> course hope so) that CONFIG_ENV_SIZE_REDUND does not have to be
> explicitly specified.
>
> Concerning your hint about making CONFIG_ENV_SIZE smaller: there
> is a comment in the original openrd_base.h config file
> /*
>  * max 4k env size is enough, but in case of nand
>  * it has to be rounded to sector size
>  */
> and I simply adhered to it. It is not clear to me if this is really
> a requirement or just made for convenience (having overview over the
> flash usage layout).
>
> Up to now, I did not have any problems with this setup on something
> like 100+ boards.
>
> Best regards,
> Wolfgang
>
>

You are right:
./include/environment.h:# if defined(CONFIG_ENV_ADDR_REDUND) &&
!defined(CONFIG_ENV_SIZE_REDUND)
./include/environment.h:#  define CONFIG_ENV_SIZE_REDUNDCONFIG_ENV_SIZE
If it is not defined it assumes the size is same.

It is not necessary to round up. I see a message from uboot, that env
size is smaller than a sector and a the complete sector will be
erased.
See log below. (From my understanding every change is a complete erase
and rewrite, as it all happens in just one sector).

But again, how did you managed this with bad blocks?

"# save
Saving Environment to NAND...
Erasing Nand...
Warning: Erase size 0x2000 smaller than one erase block 0x0002
 Erasing 0x0002 instead
Skipping bad block at  0x000c

Writing to Nand... FAILED!"

So from what I observe is, that neither e (next block) is erased
nor written.

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] environment in NAND

2011-09-07 Thread Arno Steffen
2011/9/7 Wolfgang Wegner :
> Hi,
>
> sorry, not sure about it right now, but could it be you simply need
> to define CONFIG_ENV_RANGE to some multiple of the sector size?
>
> At least is what I seem to remember...
>
> Wolfgang
>
>

You are my hero - thats what I'm looking for ! Out of all boards
included in uboot only 2 use this setting. That's why I didn't found
this setting.
So - bad block handling works !!!

There is a question left for redundancy, which is imho a bug (or maybe
I don't get the design concept of redundancy):
 If I have an empty environment (both standard and redund - env1 and
env2 ) and boot, it recognizes CRC error (which is ok).
A "save" write it to redundand environment (0x10.). This is
probably as it recognice an CRCerror in env1 and doesn't check this
for env2

If I add some settings ("set test true") and do "save" a second time -
it writes ONLY to default env (0xc.) ?!?
What happens, that it will change location? Or shouldn't it write to
both locations ?

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Uboot-Environment at bad block

2011-06-19 Thread Arno Steffen
In one of my devices, uboot-environment is located at a bad block.
"save
Saving Environment to NAND...
Erasing Nand...
Skipping bad block at  0x000c

Writing to Nand... FAILED!"

In my memory mapping I have already reseverd 2blocks.
How can I setup uboot in a way, that it will look at c or (in case
of bad block) at the next block e?

In my configs file I found somewhat like:
#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
#define SMNAND_ENV_OFFSET   0xC /* environment starts here */
#define CONFIG_SYS_ENV_SECT_SIZEboot_flash_sec

in mem.c of my processor I found:
f_sec = (128 << 10);/* 128 KiB */
/* env setup */
boot_flash_base = base;
boot_flash_off = f_off;
boot_flash_sec = f_sec;

uboot is based on 2010.03 release.

Maybe someone can give me an advice?
Thanks
- Arno

PS:
Move the base address of environment is not an option, as in next
device the bad block might be on exact this location.
Environment itself is just 2kB, but a block is 128k.  Can I decrease
the environment to that size and still use access from linux (via
fw_printenv)?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Nand: Uboot-Environment at bad block

2011-06-20 Thread Arno Steffen
In one of my devices, uboot-environment is located at a bad block.
"save
Saving Environment to NAND...
Erasing Nand...
Skipping bad block at  0x000c

Writing to Nand... FAILED!"

In my memory mapping I have already reseverd 2blocks.
How can I setup uboot in a way, that it will look at c or (in case
of bad block) at the next block e?

In my configs file I found somewhat like:
#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
#define SMNAND_ENV_OFFSET   0xC /* environment starts here */
#define CONFIG_SYS_ENV_SECT_SIZEboot_flash_sec

in mem.c of my processor I found:
   f_sec = (128 << 10);/* 128 KiB */
   /* env setup */
   boot_flash_base = base;
   boot_flash_off = f_off;
   boot_flash_sec = f_sec;

uboot is based on 2010.03 release.

Maybe someone can give me an advice?
Thanks
- Arno

PS:
Move the base address of environment is not an option, as in next
device the bad block might be on exact this location.
Environment itself is just 2kB, but a block is 128k.  Can I decrease
the environment to that size and still use access from linux (via
fw_printenv)?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Nand: Uboot-Environment at bad block

2011-06-20 Thread Arno Steffen
I am very sorry, apologize me! My fault.
I haven't seen my mail in the mailing archive, so I thought it was
just saved as draft or forget to write [uboot] in subject.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [u-boot] CRC / ECC protection of environment

2011-09-20 Thread Arno Steffen
Assumed Uboot and environment are located in NAND flash.
Just a short question: Is the ECC done before the CRC check, or is the
CRC check done first?
>From my observation I would assume that first CRC is checked. But if
so - imho in my case (environment in NAND, which is handled with ECC)
this wouldn't make sense.
Am I right, that in this situation I should configure uboot to NOT use
CRC protection?
Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [u-boot] CRC / ECC protection of environment

2011-09-21 Thread Arno Steffen
2011/9/20 Wolfgang Denk :
> Dear Arno Steffen,
>
> In message 
>  you 
> wrote:
>> Assumed Uboot and environment are located in NAND flash.
>> Just a short question: Is the ECC done before the CRC check, or is the
>> CRC check done first?
>> From my observation I would assume that first CRC is checked. But if
>
> Your observations are wrong.
>
>> so - imho in my case (environment in NAND, which is handled with ECC)
>> this wouldn't make sense.
>> Am I right, that in this situation I should configure uboot to NOT use
>> CRC protection?
>
> No, you should not meddle with the CRC checking.
>
> 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
> Star Trek Lives!
>

Thank you for clarification. Although I am estonished, that after some
time of running 2 devices come up with CRC errors (with just read
access to environment!!).
Unfortunatly I don't know a way just to change 1 bit in flash without
changing the OOB data to simulate a toogling bit.

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [u-boot] CRC / ECC protection of environment

2011-09-22 Thread Arno Steffen
2011/9/21 Scott Wood :
> On 09/21/2011 04:59 AM, Arno Steffen wrote:
>> Thank you for clarification. Although I am estonished, that after some
>> time of running 2 devices come up with CRC errors (with just read
>> access to environment!!).
>> Unfortunatly I don't know a way just to change 1 bit in flash without
>> changing the OOB data to simulate a toogling bit.
>
> http://patchwork.ozlabs.org/patch/114262/ provides the ability to do a
> raw write.  Copy out the good data (including OOB), erase the block,
> flip a bit in the RAM copy, and raw-write it all back at once.
>
> What board and nand driver are you using?
>
> -Scott

This is a good advice - I will check this next. Thanks, Scott!
I use an OMAP3 (simular to EVM 3530 board) with uboot-2010.03.
My assumption of not using ECC (or doing CRC first) is derived from,
that I had several devices with CRC error in environment but not even
a single board ever complains about the kernel, which is 12x bigger!
(It is from what I know also CRC protected, but in another way). From
my knowledge about statistics this behaviour is very unlikely.
- Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [u-boot] CRC / ECC protection of environment

2011-09-23 Thread Arno Steffen
2011/9/22 Wolfgang Denk :
> Dear Arno Steffen,
>
> In message 
>  you 
> wrote:
>>
>> This is a good advice - I will check this next. Thanks, Scott!
>> I use an OMAP3 (simular to EVM 3530 board) with uboot-2010.03.
>> My assumption of not using ECC (or doing CRC first) is derived from,
>> that I had several devices with CRC error in environment but not even
>> a single board ever complains about the kernel, which is 12x bigger!
>> (It is from what I know also CRC protected, but in another way). From
>> my knowledge about statistics this behaviour is very unlikely.
>
> Eventually the ernel got written a lot less frequently than the
> environment blocks - I would not be surprised if you are just
> experiencing the "normal" wear of NAND blocks.
>
> [And keep in mind that NAND also develops erros when you only read
> it.]
>
> 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
> I'm frequently appalled by the low regard you Earthmen have for life.
>        -- Spock, "The Galileo Seven", stardate 2822.3
>

I think I have the proof, that ECC is not working on my OMAP.
This might be a configuration problem or whatever - so I don't blame
it on the uboot itselft, but what?

I have here 2 failing devices:

uboot gives me a CRC error or bad NAND. While nanddump (running from
linux) gives me
nanddump -p /dev/mtd2 -f /tmp/env_crc_dump.txt
ECC failed: 0
ECC corrected: 2
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x and ending at 0x0004...
ECC: 1 corrected bitflip(s) at offset 0x00012800

There is one strange issue: It gives 0 errors and 2 corrections, but
only reports 1 corrected bitflip.

While dumping this with and without ECC I could indeed identify a bit:
-0x00012e60: 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00
+0x00012e60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


Another device gives me
anddump -p -f /tmp/crc_env.txt /dev/mtd2
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x and ending at 0x0004...
ECC: 1 corrected bitflip(s) at offset 0xa800

While dumping this with and without ECC I could indeed identify a bit:
-0xa8d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0xa8d0: 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] OMAP3 NAND ECC bug report

2011-10-20 Thread Arno Steffen
I did tests with OMAP3 uboot. The SW-ECC (testet 1 bit, 4 bit BCH)
doesn't correct errors in environment (during power-up).
Compiling uboot for default HW-ECC - correction works fine.
Testet with TI's PSP 4.02.00.07 (almost like arago latest version).

I modified single bits by adding a patch (thanks Scott Wood) to uboot,
that allows write in raw mode to flash. Single bit error can corrected
with HW-ECC, not with SW-ECC.
This report is only about uboot environment, which is read in startup.
I didn't test it, but from my experience the correction works fine,
beside the initial reading of the environment, as for reading and
starting the kernel.

Imho this is very critical, as reliability is suffered if a device
isn't booting.

Best regards
Arno

PS:
The link below refers to a previous discussion.
http://lists.denx.de/pipermail/u-boot/2011-September/100486.html

in omap_gpmc.c I used this in board_nand_init()

...
nand->chip_delay = 100;
nand->ecc.mode = NAND_ECC_4BIT_SOFT;
nand_curr_device = 0;
omap_nand_switch_ecc(NAND_ECC_4BIT_SOFT, 1);
return 0;
}
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] OMAP3 NAND ECC bug report

2011-10-21 Thread Arno Steffen
I think reason that SW_ECC is not working, is in omap_gpmc.c:

omap_nand_switch_ecc():

  case NAND_ECC_SOFT:
nand->ecc.mode = NAND_ECC_SOFT;
/* Use mtd default settings */
nand->ecc.layout = NULL;
printf("SW ECC selected\n");

The ecc struct is not setup?!? Someone has an idea?

@TI stuff: if you are not the right person to address this, can you
please forward?
Thanks

 - Arno



2011/10/20 Arno Steffen :
> I did tests with OMAP3 uboot. The SW-ECC (testet 1 bit, 4 bit BCH)
> doesn't correct errors in environment (during power-up).
> Compiling uboot for default HW-ECC - correction works fine.
> Testet with TI's PSP 4.02.00.07 (almost like arago latest version).
>
> I modified single bits by adding a patch (thanks Scott Wood) to uboot,
> that allows write in raw mode to flash. Single bit error can corrected
> with HW-ECC, not with SW-ECC.
> This report is only about uboot environment, which is read in startup.
> I didn't test it, but from my experience the correction works fine,
> beside the initial reading of the environment, as for reading and
> starting the kernel.
>
> Imho this is very critical, as reliability is suffered if a device
> isn't booting.
>
> Best regards
> Arno
>
> PS:
> The link below refers to a previous discussion.
> http://lists.denx.de/pipermail/u-boot/2011-September/100486.html
>
> in omap_gpmc.c I used this in board_nand_init()
>
> ...
>        nand->chip_delay = 100;
>        nand->ecc.mode = NAND_ECC_4BIT_SOFT;
>        nand_curr_device = 0;
>        omap_nand_switch_ecc(NAND_ECC_4BIT_SOFT, 1);
>        return 0;
> }
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] OMAP3 NAND ECC bug report

2011-10-25 Thread Arno Steffen
I am feeling to spam the board but found finally the reason for this behaviour.

nand_read returns with -EUCLEAN in case of correcting errors, and this
will later on reported as BAD NAND, although this error is corrected.

Correct me if I am wrong. What I did is chaning env_nand.c:
while (amount_loaded < CONFIG_ENV_SIZE && offset < end) {
if (nand_block_isbad(&nand_info[0], offset)) {
offset += blocksize;
} else {
char_ptr = &buf[amount_loaded];
-   if (nand_read(&nand_info[0], offset, &len, char_ptr)) {
-   return 1;
+   err = nand_read(&nand_info[0], offset, &len, char_ptr);
+   if (err) {
+   if (err != -EUCLEAN) {   // Bad NAND has been 
corrected, so no problem
+   return 1;
+   }
}
offset += blocksize;
amount_loaded += len;
}


Correct me if I am wrong, but it seems that all platform are suffered,
not just OMAP.
There will be compared a corrected bits before and after correction,
and it send an error message, if bits are corrected (instead of only
if it can not be corrected).

Best regards
Arno


2011/10/21 Arno Steffen :
> I think reason that SW_ECC is not working, is in omap_gpmc.c:
>
> omap_nand_switch_ecc():
>
>          case NAND_ECC_SOFT:
>                nand->ecc.mode = NAND_ECC_SOFT;
>                /* Use mtd default settings */
>                nand->ecc.layout = NULL;
>                printf("SW ECC selected\n");
>
> The ecc struct is not setup?!? Someone has an idea?
>
> @TI stuff: if you are not the right person to address this, can you
> please forward?
> Thanks
>
>  - Arno
>
>
>
> 2011/10/20 Arno Steffen :
>> I did tests with OMAP3 uboot. The SW-ECC (testet 1 bit, 4 bit BCH)
>> doesn't correct errors in environment (during power-up).
>> Compiling uboot for default HW-ECC - correction works fine.
>> Testet with TI's PSP 4.02.00.07 (almost like arago latest version).
>>
>> I modified single bits by adding a patch (thanks Scott Wood) to uboot,
>> that allows write in raw mode to flash. Single bit error can corrected
>> with HW-ECC, not with SW-ECC.
>> This report is only about uboot environment, which is read in startup.
>> I didn't test it, but from my experience the correction works fine,
>> beside the initial reading of the environment, as for reading and
>> starting the kernel.
>>
>> Imho this is very critical, as reliability is suffered if a device
>> isn't booting.
>>
>> Best regards
>> Arno
>>
>> PS:
>> The link below refers to a previous discussion.
>> http://lists.denx.de/pipermail/u-boot/2011-September/100486.html
>>
>> in omap_gpmc.c I used this in board_nand_init()
>>
>> ...
>>        nand->chip_delay = 100;
>>        nand->ecc.mode = NAND_ECC_4BIT_SOFT;
>>        nand_curr_device = 0;
>>        omap_nand_switch_ecc(NAND_ECC_4BIT_SOFT, 1);
>>        return 0;
>> }
>>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] OMAP3 NAND ECC bug report

2011-10-27 Thread Arno Steffen
I have been used u-boot supportet (or better say not suppported) by TI
in their latest PSP/SDK (Juli 2011).
Base is 2010.06. But this issue was also inside older versions.

- Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] OMAP3 NAND ECC bug report

2011-10-31 Thread Arno Steffen
Sure, Scott, not blame on you. Just frustating, doing bughunting for
issues that have been fixed long time ago. I would expect a bit more
from TI in this case. My fault obviously.
Ok, finally I got it, that's what matters.
- Arno


2011/10/28 Scott Wood :
> On 10/28/2011 01:10 AM, Arno Steffen wrote:
>> I have been used u-boot supportet (or better say not suppported) by TI
>> in their latest PSP/SDK (Juli 2011).
>> Base is 2010.06. But this issue was also inside older versions.
>
> It's not older versions I'm concerned about, but newer ones.  This bug
> has been fixed in mainline U-Boot, about a year ago.  We don't have a
> time machine to put the bug fix in older versions. :-)
>
> -Scott
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] howto deal with nested $() in bootenv?

2010-03-04 Thread Arno Steffen
To set my uboot environment (2008-10) I upload a script to uboot

set serverip192.168.90.230
a) set bootargs_nfsmem=128M console=ttyS2,115200n8 noinitrd rw
root=/dev/nfs nfsroot=$(serverip):/opt/rootfs, nolock
b) set bootargs_nfsmem=128M console=ttyS2,115200n8 noinitrd rw
root=/dev/nfs nfsroot=\$(serverip):/opt/rootfs, nolock
set boot_nfstftpboot 0x8000 spv/uImage\; set bootargs
\$(bootargs_nfs)\; run addip\; bootm 0x8000

I case a) the serverip while loading will inserted fix in bootargs_nfs
In case b) the serverip will not replaced so that the kernel get a
$(serverip) part of command line.

How to change this above, so that I can later change serverip without
changing anything else?

Regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] howto deal with nested $() in bootenv?

2010-03-04 Thread Arno Steffen
Dear Wolfgang,

I read that chapter and changed to
set bootargs_nfs'setenv bootargs mem=128M console=ttyS2,115200n8
noinitrd rw root=/dev/nfs nfsroot=${serverip}:/opt/rootfs, nolock'
set boot_nfs'run bootargs_nfs addip; printenv bootargs; tftpboot
0x8000 uImage;  bootm 0x8000'
set bootcmd run boot_nfs

The result keeps the same. For some strange reason I can see the
result of printenv command, that I inserted for debug purposes. The
serverip is not replaced.
What is working is executing to type

"run bootargs_nfs addip" as a single command line
"print bootargs" than returns the correct:
bootargs=mem=128M console=ttyS2,115200n8 noinitrd rw root=/dev/nfs nfsroot=192.1
68.90.230:/opt/rootfs, nolock ip=192.168.90.202:192.168.90.230:192.168.90.1:255.
255.255.0::eth0:on

This single line seems to be executed in a different way?!

Best regards
Arno



2010/3/4 Wolfgang Denk :
> Dear Arno Steffen,
>
> In message <804f0d21003040708h672d4814m6e1c4d5f32ea9...@mail.gmail.com> you 
> wrote:
>> To set my uboot environment (2008-10) I upload a script to uboot
> ...
>> I case a) the serverip while loading will inserted fix in bootargs_nfs
>> In case b) the serverip will not replaced so that the kernel get a
>> $(serverip) part of command line.
>>
>> How to change this above, so that I can later change serverip without
>> changing anything else?
>
> Please RTFM, thsi specific use case is explaind in detaiul there. See
> especially section "7.4. Boot Arguments Unleashed" at
> http://www.denx.de/wiki/view/DULG/LinuxBootArgs
>
> 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
> I have often regretted my speech, never my silence.
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] OMAP3 EVM board (no NAND support, does not compile)

2010-03-23 Thread Arno Steffen
I just checked the 2010-03 rc2.
Unfortunatly no NAND support in config file.
I added

#define CONFIG_CMD_NAND /* NAND support */

#define CONFIG_ENV_IS_IN_NAND  1

but get some errors:

lib_arm/libarm.a(board.o): In function `init_func_i2c':
/opt/src/ub/uboot2010-03-rc2/u-boot/lib_arm/board.c:195: undefined
reference to `i2c_init'
lib_arm/libarm.a(board.o): In function `start_armboot':
/opt/src/ub/uboot2010-03-rc2/u-boot/lib_arm/board.c:338: undefined
reference to `nand_init'
/opt/src/ub/uboot2010-03-rc2/u-boot/lib_arm/board.c:414: undefined
reference to `copy_filename'
/opt/src/ub/uboot2010-03-rc2/u-boot/lib_arm/board.c:434: undefined
reference to `eth_initialize'
/opt/src/ub/uboot2010-03-rc2/u-boot/lib_arm/board.c:442: undefined
reference to `BootFile'
...
/opt/src/ub/uboot2010-03-rc2/u-boot/common/stdio.c:252: undefined
reference to `serial_tstc'
board/ti/evm/libevm.a(evm.o): In function `board_eth_init':
/opt/src/ub/uboot2010-03-rc2/u-boot/board/ti/evm/evm.c:130: undefined
reference to `smc911x_initialize'
board/ti/evm/libevm.a(evm.o): In function `misc_init_r':
/opt/src/ub/uboot2010-03-rc2/u-boot/board/ti/evm/evm.c:65: undefined
reference to `i2c_init'
make: *** [u-boot] Fehler 1
[u...@localhost u-boot]$
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] OMAP3 EVM board (no NAND support, does not compile)

2010-03-23 Thread Arno Steffen
With adding this lines it is working:

#if defined(CONFIG_CMD_NAND)
#define CONFIG_NAND_OMAP_GPMC
#define GPMC_NAND_ECC_LP_x16_LAYOUT1
#define CONFIG_ENV_IS_IN_NAND  1
#elif defined(CONFIG_CMD_ONENAND)
#define CONFIG_ENV_IS_IN_ONENAND1
#endif

It would be nice to add this to config file, for those who use the EVM
board with nand flash instead of onenand.
Thanks.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot



[U-Boot] TI branch of git - no tags / releases since 2009.08 ???

2010-10-13 Thread Arno Steffen
Checking the TI ARM U-Boot Custodian Tree
(http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-ti.git) I see
the latest release is 2009.08.
Am I in the wrong tree or what might be the reason?

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] TI branch of git - no tags / releases since 2009.08 ???

2010-10-14 Thread Arno Steffen
2010/10/13 John Rigby :
> On Wed, Oct 13, 2010 at 5:58 AM, Arno Steffen
>  wrote:
>> Checking the TI ARM U-Boot Custodian Tree
>> (http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-ti.git) I see
>> the latest release is 2009.08.
>> Am I in the wrong tree or what might be the reason?
>>
>> Best regards
>> Arno
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>
> Looks like his tree is uptodate but he never updates tags.
>

So what version I should use to have something stable and referable?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Rescue /alternative boot

2010-06-08 Thread Arno Steffen
I would like to have some rescue boot, if flashing of
uboot-environment, kernel or filesystem fails.
My idea is to check a certain port (eth) for some time and if I
receive a defined string not to continue the ususal boot process but
execute some into uboot compiled bootcmds.
Looking into the code doesn't give me an idea howto do this. Does
someone have tried something simular and would share his experience?
Thanks
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Rescue /alternative boot

2010-06-09 Thread Arno Steffen
Dear Wolfgang Denk,

thanks for your mail.

2010/6/8 Wolfgang Denk :
> Why should "flashing of uboot-environment" fail? If you configure for
> redundant environment, you should always at least have the previous
> copy of the settings).

Right, but what happens if user is doing something stupid?
I don't have any connection to uboot at all, as in my final system
there is no serial interface to change it back.
If linux is not booting anymore I am lost, as this is my only known
way to reflash uboot env, kernel, filesystem.

> updates from TFTP server etc. - Have a look at the manual for details.

I would see tftpboot as a chance - but there are a few questions to me:
- howto call this (and where?) in uboot code? It must be executed
before reading the uboot-environment, as this can misconfigured. So it
cannot be part of environment.
- howto handle boot/kernel parameters? I only know the way via
environment variables
- the timeout has to set to be very small (as this otherwise in 99%
slow down the boot process to much)

This tftpboot look smart - if I could manage this (see above).

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Rescue /alternative boot

2010-06-09 Thread Arno Steffen
Dear Wolfgang Denk,

> Well, you can provide measures for a reset to a sane state, then.

This sounds even more complicated to me. In fact - I don't have any
clue, what and howto measure and reset the environment. This system
doesn't even had a reset buttom... so it is always a cold boot.

>> I don't have any connection to uboot at all, as in my final system
>> there is no serial interface to change it back.
>
> You could eventually use netconsole.

Netconsole requires (afaik) a linux kernel, that is working.

> If just the environment is hosed, it would be sufficient to provide
> some means to perform a "manufacturer reset" and restore the
> environment to a known good state. You could - for example - act on
> certain key presses / key combinations when the board is
> reset/powered on. Several boards do that.

I would do so, in fact that was my first idea. But I just have
network, nothing else.
But here I am at the beginning. How to listen on a network port ( I
know what to don in linux, but in uboot?) and howto make this change
in uboot environment to a certain state. (this can boot a system via
tftp then instead of a flash file system)

Best regards
Steffen
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Rescue /alternative boot

2010-06-09 Thread Arno Steffen
Dear Albert,

2010/6/9 Albert ARIBAUD :
> If the user is able to do something stupid then you should avoid it, e.g.
> not give the user the ability to alter the u-boot environment by making it

In fact, the normal user doesn't have access to change it. But even I
can make faults.

> You should consider accessibility to the bootloader prompt as a critical
> requirement before considering resiliency -- actually, access to U-boot is a
> last-resort, but good, response to the resiliency requirement.

I am not free to change this anymore. So I have to find another way via network.

> Why can you not trust the u-boot environment? Maybe hardening the system
> against user-induced environment changes would help avoid the condition in
> the first place.

The system must be ready for updates - and they might go wrong, even by a typo.

>> - howto handle boot/kernel parameters? I only know the way via
>> environment variables
>
> As Wolfgang pointed out, read the manual: passing parameters does not depend
> on how you got the image in the first place, and works the same whether you
> use TFTP, flash or hard disks.

In manual I just can see how to set commandline parameters. Everything
( I understand until now) is controled via environment.
I have to put some code (before the environment is read) into uboot
source to force a tftpboot with in-compiled parameters. And I don't
have a clue howto and where to do this.
It is not enough to set some default environment, as this becomes
active only if CRC is failed. This will not help against a typo in the
setting.

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] handling of bad blocks in nand

2010-06-23 Thread Arno Steffen
A short question to handling of bad blocks:
My nand shows a few bad blocks (example 10)

What is happen when I write / read from that block via nand write / read.
Is content than ok (by mapping good blocks do that address)?

Other way around - if I have commands like

"get_kn=nand read.i 0x8000 c 20"

do I have to care for bad blocks in that range ?
Di I have to make the part bigger to have some extra blocks, if one is
skipped while write/read as it is bad?

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] handling of bad blocks in nand

2010-06-23 Thread Arno Steffen
2010/6/23 Scott Wood :
> On Wed, Jun 23, 2010 at 02:40:51PM +0200, Arno Steffen wrote:
>> A short question to handling of bad blocks:
>> My nand shows a few bad blocks (example 10)
>>
>> What is happen when I write / read from that block via nand write / read.
>> Is content than ok (by mapping good blocks do that address)?
>
> Bad blocks are skipped, and all subsequent blocks are shifted out by one.
>
>> Other way around - if I have commands like
>>
>> "get_kn=nand read.i 0x8000 c 20"
>>
>> do I have to care for bad blocks in that range ?
>> Di I have to make the part bigger to have some extra blocks, if one is
>> skipped while write/read as it is bad?
>
> The partition must be at least as large as the number of real data blocks
> you want to write, plus the number of bad blocks within that range.
>
> -Scott
>

Thanks Scott,
does it mean in other words - I don't have to care for the bad block,
can write on the bad block address as it would be ok?

The only thing I have to care is, that I have leave enough space
between the partitions. As for instance : I need 10 blocks for a
certain filesystem, give it 12 ? So it could correct 2 bad blocks in
this range.

Best regards
Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] handling of bad blocks in nand

2010-06-25 Thread Arno Steffen
2010/6/24 Scott Wood :
> On 06/24/2010 01:28 AM, Arno Steffen wrote:
>>
>> does it mean in other words - I don't have to care for the bad block,
>> can write on the bad block address as it would be ok?
>
> You can't write directly to that block, but it can be included in a range of
> blocks as long as the range is large enough to hold the data blocks plus the
> bad blocks.

Mhh. Think we misunderstood each other.
Lets asume block with 0x10. is bad.

I would guess from what you told me before that I could read/write to 0x10..
Of course this is than internally redirected, but from uboot point of
view I hope to
can do

nand write 0x8000. 0x10. 1000

>
>> The only thing I have to care is, that I have leave enough space
>> between the partitions. As for instance : I need 10 blocks for a
>> certain filesystem, give it 12 ? So it could correct 2 bad blocks in
>> this range.
>
> Right.
>
> -Scott
>

@ Wolfgang:
Ubi is probably better, but I can't start everything from beginning
again. And this is a completly new topic for me.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] handling of bad blocks in nand

2010-06-28 Thread Arno Steffen
2010/6/25 Scott Wood :
> On 06/25/2010 05:18 AM, Arno Steffen wrote:
>>
>> 2010/6/24 Scott Wood:
>>>
>>> On 06/24/2010 01:28 AM, Arno Steffen wrote:
>>>>
>>>> does it mean in other words - I don't have to care for the bad block,
>>>> can write on the bad block address as it would be ok?
>>>
>>> You can't write directly to that block, but it can be included in a range
>>> of
>>> blocks as long as the range is large enough to hold the data blocks plus
>>> the
>>> bad blocks.
>>
>> Mhh. Think we misunderstood each other.
>> Lets asume block with 0x10. is bad.
>>
>> I would guess from what you told me before that I could read/write to
>> 0x10..
>> Of course this is than internally redirected, but from uboot point of
>> view I hope to
>> can do
>>
>> nand write 0x8000. 0x10. 1000
>
> It is "redirected" to the next good block after the one you're trying to
> write to.  But it is not fully transparent.  Suppose the block at 0x10
> is bad, and the next block at 0x12 is good.
>
> If you do the above command, it will skip the bad block and write to
> 0x12.  But if you then do "nand write 8000 12 1000", you will
> overwrite what you previously wrote.
>
> -Scott
>

Ok, understood it now. Thanks a  lot.
-Arno
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] transfer enviroment per file (problems with TAB) ?

2010-07-01 Thread Arno Steffen
I am using Teraterm to transfer the uboot environment to the system.

I do get strange effects that not all commands are executed properly.
It is looking like this:


while the tranfer file contains:

set boot_nfs_nand  'set bootargs ${bootargs_fs}; run addip;
tftpboot 0x8000 spv/uImage; bootm 0x8000'
set bootcmd  'run boot_fs'
echo "Environment downloaded"

I get:

OMAP3 # set boot_nfs_nand 'set bootargs ${bootargs_fs}; run
addip; tftpboot 0x8000 spv/uImage; bootm 0x8000'
OMAP3 # set bootcmd
  bootcmd bootcmd
OMAP3r # set bootcmd
  bootcmd bootcmd
OMAP3 # set bootcmd
  bootcmd bootcmd
OMAP3 # set bootcmd'run boot_fs'
OMAP3 # echo "Environment downloaded"

One reason could be the line delay, but I set it up to 500ms - quite a
long time (usually I use 100ms)
The other reason might be that I have some default environment and
bootcmd build in in uboot (which is active when no environment is
available).
Some commands I could rename but of course not the bootcmd.
For some reason it works if I set bootcmd manually. Finally I could
find, that the TAB is causing the trouble - but only in this command.
set bootcmd'run boot_fs'.
I don't have a explaination, but maybe this is an usful info for others...
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] handling of bad blocks in nand

2010-07-09 Thread Arno Steffen
Sorry another question to that.

As for instance I want to have 10MB for root partion and keep 2 blocks
extra as reserve for some bad blocks.
I will erase the hole 10MB+2block, write 10MB. That's what I do in uboot.

But in Kernel I have some partition table like this:

{
.name   = "root(1)",
.offset = MTDPART_OFS_APPEND,
.size   = 82*(64*2048),/*10MB + 256k*/
.mask_flags = MTD_WRITEABLE /* force read-only */
},

There are right now the 2 extra blocks inside (but they haven't been
written or formatted).
That is wrong, isn't it? The kernel might now write beyond the 10MB.

I think I have to set size to 80*(62*2048) and append the 2 extra
blocks to the offset in the next Partition to leave this 2 block free.

But I am not sure. So thanks for a quick look and an advice.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot