[U-Boot] [PATCH 1/1] Changes for fixing the timer to 1 msec and
Wolfgang Denk
wd at denx.de
Tue Mar 10 19:55:05 CET 2009
Dear Manikandan Pillai,
In message <1236674178-15624-1-git-send-email-mani.pillai at ti.com> you wrote:
> The cmd_misc.c was changed to fix sleep.
> nand_base.c was fixed to fix the wait.
>
> Signed-off-by: Manikandan Pillai <mani.pillai at ti.com>
> ---
> common/cmd_misc.c | 1 +
> cpu/arm_cortexa8/omap3/interrupts.c | 13 ++++---------
> drivers/mtd/nand/nand_base.c | 2 ++
> include/configs/omap3_evm.h | 2 +-
> 4 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/common/cmd_misc.c b/common/cmd_misc.c
> index 024299a..e3e64c0 100644
> --- a/common/cmd_misc.c
> +++ b/common/cmd_misc.c
> @@ -38,6 +38,7 @@ int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> }
>
> delay = simple_strtoul(argv[1], NULL, 10) * CONFIG_SYS_HZ;
> + delay += get_timer(0);
This makes no sense to me. There are no problems known for this code
(at least not on correctly working ports of U-Boot).
> while (get_timer(start) < delay) {
> if (ctrlc ()) {
> diff --git a/cpu/arm_cortexa8/omap3/interrupts.c b/cpu/arm_cortexa8/omap3/interrupts.c
> index 9e9817d..5bfe6fc 100644
> --- a/cpu/arm_cortexa8/omap3/interrupts.c
> +++ b/cpu/arm_cortexa8/omap3/interrupts.c
> @@ -193,7 +193,7 @@ void reset_timer(void)
>
> ulong get_timer(ulong base)
> {
> - return get_timer_masked() - base;
> + return get_timer_masked();
This patch is definitely wrong.
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index d33fee2..283b456 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -509,6 +509,7 @@ void nand_wait_ready(struct mtd_info *mtd)
> struct nand_chip *chip = mtd->priv;
> u32 timeo = (CONFIG_SYS_HZ * 20) / 1000;
>
> + timeo += get_timer(0);
> reset_timer();
This makes no sense to me. There are no problems known for this code
(at least not on correctly working ports of U-Boot).
> /* wait until command is processed or timeout occures */
> @@ -854,6 +855,7 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *this)
> else
> timeo = (CONFIG_SYS_HZ * 20) / 1000;
>
> + timeo += get_timer(0);
Ditto.
NAK.
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: wd at denx.de
The only perfect science is hind-sight.
More information about the U-Boot
mailing list