File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -859,6 +859,36 @@ static inline void bcm2708_init_led(void)
859
859
}
860
860
#endif
861
861
862
+
863
+ /* The assembly versions in delay.S don't account for core freq changing in cpufreq driver */
864
+ /* Use 1MHz system timer for busy waiting */
865
+ void __udelay (unsigned long usecs )
866
+ {
867
+ unsigned long start = readl (__io_address (ST_BASE + 0x04 ));
868
+ unsigned long now ;
869
+ do {
870
+ now = readl (__io_address (ST_BASE + 0x04 ));
871
+ } while ((long )(now - start ) <= usecs );
872
+ }
873
+
874
+
875
+ void __const_udelay (unsigned long scaled_usecs )
876
+ {
877
+ /* want /107374, this is about 3% bigger. We know usecs is less than 2000, so shouldn't overflow */
878
+ const unsigned long usecs = scaled_usecs * 10 >> 20 ;
879
+ unsigned long start = readl (__io_address (ST_BASE + 0x04 ));
880
+ unsigned long now ;
881
+ do {
882
+ now = readl (__io_address (ST_BASE + 0x04 ));
883
+ } while ((long )(now - start ) <= usecs );
884
+ }
885
+
886
+ void __delay (int loops )
887
+ {
888
+ while (-- loops > 0 )
889
+ nop ();
890
+ }
891
+
862
892
MACHINE_START (BCM2708 , "BCM2708" )
863
893
/* Maintainer: Broadcom Europe Ltd. */
864
894
.map_io = bcm2708_map_io ,.init_irq = bcm2708_init_irq ,.timer =
You can’t perform that action at this time.
0 commit comments