aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/base-files/lib/preinit
Commit message (Expand)AuthorAgeFilesLines
* ramips: Basic support for the AsiaRF RT5350 based AWM002 module and evaluatio...John Crispin2013-07-241-0/+1
* ramips: move ESW reset to preinit on RT305x/RT5350John Crispin2013-06-241-11/+4
* base-files: input/button drivers get loaded before preinit by procdJohn Crispin2013-06-211-12/+0
* ramips: add HAME MPR-A2 supportJohn Crispin2013-06-102-0/+13
* ramips: introduce DTS for ALL5003John Crispin2013-04-251-0/+1
* ramips: set preinit interface to eth0 by default.John Crispin2013-04-251-0/+12
* ramips: Add Alpha ASL-26555 support.John Crispin2013-04-251-0/+1
* ramips: Add support of D-link DIR-620D1John Crispin2013-04-251-0/+1
* Add Netgear WNCE2001 (OF version)John Crispin2013-04-092-0/+44
* add profile for tenda w150m boardJohn Crispin2013-04-031-0/+1
* add Huawei D105John Crispin2013-04-031-0/+1
* add profile for the Edimax 3g-6200NL boardJohn Crispin2013-04-031-0/+1
* ramips: enhance user-space board detectionGabor Juhos2013-03-031-0/+2
* ramips: use the new macaddr_* helpers instead of maccalcGabor Juhos2013-02-161-2/+2
* ramips: use the mtd_get_mac_* helpersGabor Juhos2013-02-161-8/+9
* ramips: add user-space support for the Omnima EMB HPM boardGabor Juhos2013-02-021-0/+1
* ramips: add user-space support for the Tenda 3G300MGabor Juhos2013-01-191-0/+1
* ramips: add user-space support for the Planex MZK-W300NH2 RouterGabor Juhos2012-12-291-0/+1
* ramips: fix ASUS WL-330N3G MAC addressGabor Juhos2012-12-241-3/+3
* add support for Hauppauge BroadwayJohn Crispin2012-12-101-0/+1
* ramips: rt305x: add user-space support for the Asus RT-N13UGabor Juhos2012-11-291-0/+1
* ramips: add user-space support for TEW-691GRGabor Juhos2012-10-181-0/+1
* ramips: add user-space support for the TEW-692GR boardGabor Juhos2012-10-181-0/+1
* ramips: add user space support for the DIR-645Gabor Juhos2012-10-181-0/+5
* ramips: Add support for 8devices Carambola dev board.Gabor Juhos2012-08-291-0/+1
* ramips: add board alias for the ALL0239-3GGabor Juhos2012-08-171-0/+1
* ramips: add support for D-Link DIR-615 H1Gabor Juhos2012-08-171-1/+2
* ramips: add D-Link DIR-620 A1 supportGabor Juhos2012-08-121-0/+1
* D-Link DAP-1350 initial supportJohn Crispin2012-07-241-0/+4
* add ALL5002 userspace supportJohn Crispin2012-07-241-0/+1
* ramips: rt305x: add support for Edimax 3G-6200NGabor Juhos2012-07-121-0/+4
* ramips: mac address detection for Fonera 2.0nVasilis Tsiligiannis2012-06-231-0/+1
* ramips: rt305x: add support for the Petatel PSR-680W Wireless CDMA RouterGabor Juhos2012-06-191-0/+1
* ramips: rt305x: add support for the Asus WL-330N3G boardGabor Juhos2012-04-231-0/+1
* ramips: rt305x: add initial support for Tenda W306R V2.0Gabor Juhos2012-04-211-0/+1
* ramips: add support for the ARC FreeStation5 board, also fix WCR-150GN networ...Jo-Philipp Wich2012-03-291-0/+1
* ramips: rt305x: add add support for the Asus WL-330N boardGabor Juhos2012-03-271-0/+1
* ramips: add support for unbranded XDX-RN502J boardGabor Juhos2012-03-041-1/+2
* ramips: board support for Asus RT-N10+Gabor Juhos2012-03-041-0/+4
* ramips: rt305x: add support for the Skyline SL-R7205 Wireless 3G routerGabor Juhos2012-02-191-1/+2
* ramips: add preliminary support for the Asus RT-N56U boardGabor Juhos2012-02-131-0/+1
* ramips: load gpio-polled keys moduleGabor Juhos2012-02-111-1/+1
* ramips: rt305x: add support for Accton WR6202 / SMCWBR11S-3GNGabor Juhos2012-02-111-1/+2
* ramips: add support for Sitecom WL-341v3 and other Sercomm IP1006RRv2 boardsGabor Juhos2012-01-261-0/+4
* ramips: add user-space support for ALL0256NGabor Juhos2012-01-241-1/+4
* ramips: rt305x: add support for the ALFA Networks W502U (R36) boardGabor Juhos2011-12-281-1/+2
* ramips: add support for the Senao/EnGenius ESR-9753 boardGabor Juhos2011-12-231-1/+1
* ramips: add support for Omnima MiniEMBWiFi boardGabor Juhos2011-12-141-1/+2
* ramips: fix mac addresses on the DIR-300/600 boardsGabor Juhos2011-12-061-0/+6
* ramips: set mac addresses for the NBG-419NGabor Juhos2011-12-051-1/+2
"mul %5 ; " "add %4,%%eax ; " "xor %5,%5 ; " "adc %5,%%edx ; " : "=A" (product), "=r" (tmp1), "=r" (tmp2) : "a" ((uint32_t)delta), "1" ((uint32_t)(delta >> 32)), "2" (mul_frac) ); #else __asm__ ( "mul %%rdx ; shrd $32,%%rdx,%%rax" : "=a" (product) : "0" (delta), "d" ((uint64_t)mul_frac) ); #endif return product; } static unsigned long get_nsec_offset(void) { uint64_t now, delta; rdtscll(now); delta = now - shadow.tsc_timestamp; return scale_delta(delta, shadow.tsc_to_nsec_mul, shadow.tsc_shift); } static void get_time_values_from_xen(void) { struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time; do { shadow.version = src->version; rmb(); shadow.tsc_timestamp = src->tsc_timestamp; shadow.system_timestamp = src->system_time; shadow.tsc_to_nsec_mul = src->tsc_to_system_mul; shadow.tsc_shift = src->tsc_shift; rmb(); } while ((src->version & 1) | (shadow.version ^ src->version)); shadow.tsc_to_usec_mul = shadow.tsc_to_nsec_mul / 1000; } /* monotonic_clock(): returns # of nanoseconds passed since time_init() * Note: This function is required to return accurate * time even in the absence of multiple timer ticks. */ uint64_t monotonic_clock(void) { uint64_t time; uint32_t local_time_version; do { local_time_version = shadow.version; rmb(); time = shadow.system_timestamp + get_nsec_offset(); if (!time_values_up_to_date()) get_time_values_from_xen(); rmb(); } while (local_time_version != shadow.version); return time; } static void update_wallclock(void) { shared_info_t *s = HYPERVISOR_shared_info; do { shadow_ts_version = s->wc_version; rmb(); shadow_ts.tv_sec = s->wc_sec; shadow_ts.tv_nsec = s->wc_nsec; rmb(); } while ((s->wc_version & 1) | (shadow_ts_version ^ s->wc_version)); } int gettimeofday(struct timeval *tv, void *tz) { uint64_t nsec = monotonic_clock(); nsec += shadow_ts.tv_nsec; tv->tv_sec = shadow_ts.tv_sec; tv->tv_sec += NSEC_TO_SEC(nsec); tv->tv_usec = NSEC_TO_USEC(nsec % 1000000000UL); return 0; } void block_domain(s_time_t until) { struct timeval tv; gettimeofday(&tv, NULL); ASSERT(irqs_disabled()); if(monotonic_clock() < until) { HYPERVISOR_set_timer_op(until); HYPERVISOR_sched_op(SCHEDOP_block, 0); local_irq_disable(); } } /* * Just a dummy */ static void timer_handler(evtchn_port_t ev, struct pt_regs *regs, void *ign) { get_time_values_from_xen(); update_wallclock(); } static evtchn_port_t port; void init_time(void) { printk("Initialising timer interface\n"); port = bind_virq(VIRQ_TIMER, &timer_handler, NULL); unmask_evtchn(port); } void fini_time(void) { /* Clear any pending timer */ HYPERVISOR_set_timer_op(0); unbind_evtchn(port); }