Changeset 34543


Ignore:
Timestamp:
2012-12-06T23:39:08+01:00 (5 years ago)
Author:
florian
Message:

[adm8668] move setup-related functions to their own file

Signed-off-by: Florian Fainelli <florian@…>

Location:
trunk/target/linux/adm8668/files/arch/mips/adm8668
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/adm8668/files/arch/mips/adm8668/Makefile

    r23900 r34543  
    33# 
    44 
    5 obj-y           := irq.o pci.o prom.o platform.o serial.o proc.o net_core.o net_intr.o 
     5obj-y           := irq.o pci.o prom.o platform.o serial.o proc.o \ 
     6                   setup.o \ 
     7                   net_core.o net_intr.o 
  • trunk/target/linux/adm8668/files/arch/mips/adm8668/platform.c

    r30786 r34543  
    7878}; 
    7979 
    80 static void adm8668_restart(char *cmd) 
    81 { 
    82         int i; 
    83  
    84         /* stop eth0 and eth1 */ 
    85         ADM8668_LAN_REG(NETCSR6) = (1 << 13) | (1 << 1); 
    86         ADM8668_LAN_REG(NETCSR7) = 0; 
    87         ADM8668_WAN_REG(NETCSR6) = (1 << 13) | (1 << 1); 
    88         ADM8668_WAN_REG(NETCSR7) = 0; 
    89  
    90         /* reset PHY */ 
    91         ADM8668_WAN_REG(NETCSR37) = 0x20; 
    92         for (i = 0; i < 10000; i++) 
    93                 ; 
    94         ADM8668_WAN_REG(NETCSR37) = 0; 
    95         for (i = 0; i < 10000; i++) 
    96                 ; 
    97  
    98         *(volatile unsigned int *)0xB1600000 = 1;       /* reset eth0 mac */ 
    99         *(volatile unsigned int *)0xB1A00000 = 1;       /* reset eth1 mac */ 
    100         *(volatile unsigned int *)0xB1800000 = 1;       /* reset wlan0 mac */ 
    101  
    102         /* the real deal */ 
    103         for (i = 0; i < 1000; i++) 
    104                 ; 
    105         ADM8668_CONFIG_REG(ADM8668_CR1) = 1; 
    106 } 
    107  
    10880int __devinit adm8668_devs_register(void) 
    10981{ 
    110         _machine_restart = adm8668_restart; 
    11182        platform_device_register(&adm8668_uart_device); 
    11283        platform_device_register(&adm8668_eth0_device); 
     
    12798} 
    12899 
    129 void __init plat_mem_setup(void) 
    130 { 
    131         /* prom_init seemed like easier place for this. it's tooo simple */ 
    132 } 
    133  
    134 const char *get_system_type(void) 
    135 { 
    136         unsigned long chipid = ADM8668_CONFIG_REG(ADM8668_CR0); 
    137         int adj = (ADM8668_CONFIG_REG(ADM8668_CR3) >> 11) & 0xf; 
    138         int product, revision, mhz; 
    139         static char ret[32]; 
    140  
    141         product = chipid >> 16; 
    142         revision = chipid & 0xffff; 
    143         mhz = (SYS_CLOCK/1000000) + (adj * 5); 
    144  
    145         /* i getting fancy :\ */ 
    146         snprintf(ret, sizeof(ret), "ADM%xr%x %dMHz", product, revision, mhz); 
    147  
    148         return ret; 
    149 } 
    150  
    151100arch_initcall(adm8668_devs_register); 
Note: See TracChangeset for help on using the changeset viewer.