This did not work out. I suspect uboot cannot handle nested subroutines/functions. I will hook up serial tonight to restore it
EDIT: uboot environment settings above are OK but something is wrong with fw_printenv. It f@%$ed up CRC , and I had to restore settings from backup file in serial console. Now if I do setenv /printenv in uboot, everything is fine and the box boots OK. However fw_printenv reports a whole bunch of "unrecoverable ECC errors" together with the settings. Stock linux cannot boot anymore since BLPARAM cannot read the environment. Anyway,I do not care. It looks like it is safer to change env settings from within uboot.
I used the version of uboot-env from repository so checksums should have been handled properly theoretically.