/*1* Precise Delay Loops for ETRAX FS2*3* Copyright (C) 2006 Axis Communications AB.4*5*/67#include <hwregs/reg_map.h>8#include <hwregs/reg_rdwr.h>9#include <hwregs/timer_defs.h>10#include <linux/types.h>11#include <linux/delay.h>12#include <linux/module.h>1314/*15* On ETRAX FS, we can check the free-running read-only 100MHz timer16* getting 32-bit 10ns precision, theoretically good for 42.9496729517* seconds. Unsigned arithmetic and careful expression handles18* wrapping.19*/2021void cris_delay10ns(u32 n10ns)22{23u32 t0 = REG_RD(timer, regi_timer0, r_time);24while (REG_RD(timer, regi_timer0, r_time) - t0 < n10ns)25;26}27EXPORT_SYMBOL(cris_delay10ns);282930