Changeset 25127


Ignore:
Timestamp:
2011-01-26T21:48:46+01:00 (5 years ago)
Author:
juhosg
Message:

ramips: add watchdog device for RT305x

Location:
trunk/target/linux/ramips/files/arch/mips
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h

    r20596 r25127  
    6363#define SYSTEM_CONFIG_CPUCLK_320        0x0 
    6464#define SYSTEM_CONFIG_CPUCLK_384        0x1 
     65#define SYSTEM_CONFIG_SRAM_CS0_MODE_SHIFT       2 
     66#define SYSTEM_CONFIG_SRAM_CS0_MODE_MASK        0x3 
     67#define SYSTEM_CONFIG_SRAM_CS0_MODE_NORMAL      0 
     68#define SYSTEM_CONFIG_SRAM_CS0_MODE_WDT         1 
     69#define SYSTEM_CONFIG_SRAM_CS0_MODE_BTCOEX      2 
    6570 
    6671#define RT305X_GPIO_MODE_I2C            BIT(0) 
  • trunk/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c

    r25124 r25127  
    190190        platform_device_register(&rt305x_wifi_device); 
    191191} 
     192 
     193static struct resource rt305x_wdt_resources[] = { 
     194        { 
     195                .start  = RT305X_TIMER_BASE, 
     196                .end    = RT305X_TIMER_BASE + RT305X_TIMER_SIZE - 1, 
     197                .flags  = IORESOURCE_MEM, 
     198        }, 
     199}; 
     200 
     201static struct platform_device rt305x_wdt_device = { 
     202        .name           = "ramips-wdt", 
     203        .id             = -1, 
     204        .resource       = rt305x_wdt_resources, 
     205        .num_resources  = ARRAY_SIZE(rt305x_wdt_resources), 
     206}; 
     207 
     208void __init rt305x_register_wdt(void) 
     209{ 
     210        u32 t; 
     211 
     212        /* enable WDT reset output on pin SRAM_CS_N */ 
     213        t = rt305x_sysc_rr(SYSC_REG_SYSTEM_CONFIG); 
     214        t |= SYSTEM_CONFIG_SRAM_CS0_MODE_WDT << 
     215             SYSTEM_CONFIG_SRAM_CS0_MODE_SHIFT; 
     216        rt305x_sysc_wr(t, SYSC_REG_SYSTEM_CONFIG); 
     217 
     218        platform_device_register(&rt305x_wdt_device); 
     219} 
  • trunk/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.h

    r25123 r25127  
    2121void rt305x_register_ethernet(void); 
    2222void rt305x_register_wifi(void); 
     23void rt305x_register_wdt(void); 
    2324 
    2425#endif  /* __RT305X_DEVICES_H */ 
Note: See TracChangeset for help on using the changeset viewer.