Changeset 11102


Ignore:
Timestamp:
2008-05-10T02:20:36+02:00 (10 years ago)
Author:
blogic
Message:

fixes timer issues

Location:
trunk/target/linux/ifxmips
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ifxmips/files/arch/mips/ifxmips/setup.c

    r11071 r11102  
    9797EXPORT_SYMBOL(ifxmips_get_cpu_ver); 
    9898 
    99 void 
    100 ifxmips_time_init (void) 
     99static __inline__ u32 get_counter_resolution(void) 
    101100{ 
    102         mips_hpt_frequency = ifxmips_get_cpu_hz() / 2; 
    103         r4k_offset = mips_hpt_frequency / HZ; 
    104         printk("mips_hpt_frequency:%d\n", mips_hpt_frequency); 
    105         printk("r4k_offset: %08x(%d)\n", r4k_offset, r4k_offset); 
     101        u32 res; 
     102        __asm__ __volatile__( 
     103                ".set   push\n" 
     104                ".set   mips32r2\n" 
     105                ".set   noreorder\n" 
     106                "rdhwr  %0, $3\n" 
     107                "ehb\n" 
     108                ".set pop\n" 
     109                : "=&r" (res) 
     110                : /* no input */ 
     111                : "memory"); 
     112                instruction_hazard(); 
     113                return res; 
    106114} 
    107115 
     
    118126plat_time_init (void) 
    119127{ 
     128        mips_hpt_frequency = ifxmips_get_cpu_hz()/get_counter_resolution(); 
    120129        r4k_cur = (read_c0_count() + r4k_offset); 
    121130        write_c0_compare(r4k_cur); 
    122  
    123131        ifxmips_pmu_enable(IFXMIPS_PMU_PWDCR_GPT | IFXMIPS_PMU_PWDCR_FPI); 
    124132 
     
    131139extern const char* get_system_type (void); 
    132140 
    133 void (*board_time_init)(void); 
     141//void (*board_time_init)(void); 
    134142void __init 
    135143plat_mem_setup (void) 
     
    145153 
    146154        ifxmips_reboot_setup(); 
    147         board_time_init = ifxmips_time_init; 
     155//      board_time_init = ifxmips_time_init; 
    148156        board_be_handler = &ifxmips_be_handler; 
    149157 
  • trunk/target/linux/ifxmips/patches/100-board.patch

    r11071 r11102  
    1 Index: linux-2.6.25/arch/mips/Kconfig 
     1Index: linux-2.6.25.1/arch/mips/Kconfig 
    22=================================================================== 
    3 --- linux-2.6.25.orig/arch/mips/Kconfig 2008-05-05 08:35:34.000000000 +0100 
    4 +++ linux-2.6.25/arch/mips/Kconfig      2008-05-05 08:35:46.000000000 +0100 
    5 @@ -78,6 +78,17 @@ 
     3--- linux-2.6.25.1.orig/arch/mips/Kconfig       2008-05-10 01:03:55.000000000 +0100 
     4+++ linux-2.6.25.1/arch/mips/Kconfig    2008-05-10 01:09:11.000000000 +0100 
     5@@ -78,6 +78,19 @@ 
    66        select SYS_SUPPORTS_LITTLE_ENDIAN 
    77        select GENERIC_HARDIRQS_NO__DO_IRQ 
     
    1111+       select DMA_NONCOHERENT 
    1212+       select IRQ_CPU 
     13+       select CEVT_R4K 
     14+       select CSRC_R4K 
    1315+       select SYS_HAS_CPU_MIPS32_R1 
    1416+       select HAVE_STD_PC_SERIAL_PORT 
     
    2123        bool "DECstations" 
    2224        select BOOT_ELF32 
    23 Index: linux-2.6.25/arch/mips/Makefile 
     25Index: linux-2.6.25.1/arch/mips/Makefile 
    2426=================================================================== 
    25 --- linux-2.6.25.orig/arch/mips/Makefile        2008-05-05 08:35:35.000000000 +0100 
    26 +++ linux-2.6.25/arch/mips/Makefile     2008-05-05 08:35:46.000000000 +0100 
     27--- linux-2.6.25.1.orig/arch/mips/Makefile      2008-05-10 01:04:02.000000000 +0100 
     28+++ linux-2.6.25.1/arch/mips/Makefile   2008-05-10 01:04:03.000000000 +0100 
    2729@@ -282,6 +282,13 @@ 
    2830 cflags-$(CONFIG_MIPS_COBALT)   += -Iinclude/asm-mips/mach-cobalt 
     
    3941 # DECstation family 
    4042 # 
    41 Index: linux-2.6.25/include/asm-mips/bootinfo.h 
     43Index: linux-2.6.25.1/include/asm-mips/bootinfo.h 
    4244=================================================================== 
    43 --- linux-2.6.25.orig/include/asm-mips/bootinfo.h       2008-05-05 08:35:35.000000000 +0100 
    44 +++ linux-2.6.25/include/asm-mips/bootinfo.h    2008-05-05 08:35:46.000000000 +0100 
     45--- linux-2.6.25.1.orig/include/asm-mips/bootinfo.h     2008-05-10 01:03:55.000000000 +0100 
     46+++ linux-2.6.25.1/include/asm-mips/bootinfo.h  2008-05-10 01:04:03.000000000 +0100 
    4547@@ -94,6 +94,12 @@ 
    4648 #define MACH_MSP7120_FPGA       5      /* PMC-Sierra MSP7120 Emulation */ 
     
    5658  
    5759 extern char *system_type; 
     60Index: linux-2.6.25.1/arch/mips/kernel/traps.c 
     61=================================================================== 
     62--- linux-2.6.25.1.orig/arch/mips/kernel/traps.c        2008-05-10 01:09:32.000000000 +0100 
     63+++ linux-2.6.25.1/arch/mips/kernel/traps.c     2008-05-10 01:10:07.000000000 +0100 
     64@@ -1379,6 +1379,7 @@ 
     65         */ 
     66        if (cpu_has_mips_r2) { 
     67                cp0_compare_irq = (read_c0_intctl() >> 29) & 7; 
     68+               cp0_compare_irq = CP0_LEGACY_COMPARE_IRQ; 
     69                cp0_perfcount_irq = (read_c0_intctl() >> 26) & 7; 
     70                if (cp0_perfcount_irq == cp0_compare_irq) 
     71                        cp0_perfcount_irq = -1; 
Note: See TracChangeset for help on using the changeset viewer.