~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/u-boot/arch/nios2/lib/time.c

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * (C) Copyright 2003, Psyent Corporation <www.psyent.com>
 
3
 * Scott McNutt <smcnutt@psyent.com>
 
4
 *
 
5
 * SPDX-License-Identifier:     GPL-2.0+
 
6
 */
 
7
 
 
8
#include <common.h>
 
9
#include <watchdog.h>
 
10
 
 
11
 
 
12
extern void dly_clks( unsigned long ticks );
 
13
 
 
14
void __udelay(unsigned long usec)
 
15
{
 
16
        /* The Nios core doesn't have a timebase, so we do our
 
17
         * best for now and call a low-level loop that counts
 
18
         * cpu clocks.
 
19
         */
 
20
        unsigned long cnt = (CONFIG_SYS_CLK_FREQ/1000000) * usec;
 
21
        dly_clks (cnt);
 
22
}