Changeset 7869


Ignore:
Timestamp:
2007-07-04T05:55:23+02:00 (9 years ago)
Author:
nbd
Message:

refactor atheros system code - also add support for the reset button (sends netlink messages in the same format as broadcom-diag)

Location:
trunk/target/linux/atheros-2.6/files/arch/mips/atheros
Files:
11 added
5 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/atheros-2.6/files/arch/mips/atheros/Makefile

    r6502 r7869  
    44# for more details. 
    55# 
    6 # Copyright (C) 2003 Atheros Communications, Inc.,  All Rights Reserved. 
    76# Copyright (C) 2006 FON Technology, SL. 
    87# Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org> 
     
    109# 
    1110 
    12 # Makefile for Atheros ar531x boards 
    13 # 
    14 # Note! Dependencies are done automagically by 'make dep', which also 
    15 # removes any old dependencies. DON'T put your own dependencies here 
    16 # unless it's something special (ie not a .c file). 
    17 # 
    18  
    19 obj-y += board.o prom.o irq.o 
    20 obj-$(CONFIG_ATHEROS_AR5312) += ar5312.o 
    21 obj-$(CONFIG_ATHEROS_AR5315) += ar5315.o 
    22  
     11obj-y += board.o prom.o reset.o 
     12obj-$(CONFIG_ATHEROS_AR5312) += ar5312/ 
     13obj-$(CONFIG_ATHEROS_AR5315) += ar5315/ 
  • trunk/target/linux/atheros-2.6/files/arch/mips/atheros/ar531x.h

    r7320 r7869  
    44#include <asm/cpu-info.h> 
    55#include <ar531x_platform.h> 
    6 #include "ar5312.h" 
    7 #include "ar5315.h" 
     6#include "ar5312/ar5312.h" 
     7#include "ar5315/ar5315.h" 
     8 
     9 
     10/* 
     11 * C access to CLZ instruction 
     12 * (count leading zeroes). 
     13 */ 
     14static inline int clz(unsigned long val) 
     15{ 
     16        int ret; 
     17 
     18        __asm__ volatile ( 
     19                ".set\tnoreorder\n\t" 
     20                ".set\tnoat\n\t" 
     21                ".set\tmips32\n\t" 
     22                "clz\t%0,%1\n\t" 
     23                ".set\tmips0\n\t" 
     24                ".set\tat\n\t" 
     25                ".set\treorder" 
     26                : "=r" (ret) 
     27                : "r" (val) 
     28        ); 
     29         
     30        return ret; 
     31} 
    832 
    933/*                                                                              
     
    2852#endif 
    2953 
    30 #include <irq.h> 
    31  
    32 #define AR531X_HIGH_PRIO                0x10 
    3354#define AR531X_MISC_IRQ_BASE            0x20 
    34 #define AR531X_GPIO_IRQ_BASE            0x30 
     55#define AR531X_GPIO_IRQ_BASE            0x30 
    3556 
    3657/* Software's idea of interrupts handled by "CPU Interrupt Controller" */ 
     
    4869#define AR531X_MISC_IRQ_WATCHDOG        AR531X_MISC_IRQ_BASE+7 
    4970#define AR531X_MISC_IRQ_LOCAL           AR531X_MISC_IRQ_BASE+8 
    50 #define AR531X_MISC_IRQ_COUNT           9 
     71#define AR531X_MISC_IRQ_SPI             AR531X_MISC_IRQ_BASE+9 
     72#define AR531X_MISC_IRQ_COUNT           10 
    5173 
    5274/* GPIO Interrupts [0..7], share AR531X_MISC_IRQ_GPIO */ 
     
    128150extern void ar5315_plat_setup(void); 
    129151extern asmlinkage void ar5315_irq_dispatch(void); 
     152extern void ar5315_pci_irq(int irq); 
     153static inline u32 sysRegMask(u32 phys, u32 mask, u32 value) 
     154{ 
     155        u32 reg; 
     156         
     157        reg = sysRegRead(phys); 
     158        reg &= ~mask; 
     159        reg |= value & mask; 
     160        sysRegWrite(phys, reg); 
     161        reg = sysRegRead(phys); /* flush write to the hardware */ 
     162 
     163        return reg; 
     164} 
    130165 
    131166#endif 
  • trunk/target/linux/atheros-2.6/files/arch/mips/atheros/board.c

    r6502 r7869  
    2424#include <linux/serial_core.h> 
    2525#include <asm/bootinfo.h> 
     26#include <asm/irq_cpu.h> 
    2627#include <asm/io.h> 
    2728#include "ar531x.h" 
     
    190191} 
    191192 
    192  
     193asmlinkage void plat_irq_dispatch(void) 
     194{ 
     195        DO_AR5312(ar5312_irq_dispatch();) 
     196        DO_AR5315(ar5315_irq_dispatch();) 
     197} 
     198 
     199void __init arch_init_irq(void) 
     200{ 
     201        clear_c0_status(ST0_IM); 
     202        mips_cpu_irq_init(); 
     203 
     204        /* Initialize interrupt controllers */ 
     205        DO_AR5312(ar5312_misc_intr_init(AR531X_MISC_IRQ_BASE);) 
     206        DO_AR5315(ar5315_misc_intr_init(AR531X_MISC_IRQ_BASE);) 
     207} 
Note: See TracChangeset for help on using the changeset viewer.