Blame view

arch/mips/lantiq/xway/prom-ase.c 877 Bytes
8ec6d9350   John Crispin   MIPS: Lantiq: add...
1
2
3
4
5
6
7
  /*
   *  This program is free software; you can redistribute it and/or modify it
   *  under the terms of the GNU General Public License version 2 as published
   *  by the Free Software Foundation.
   *
   *  Copyright (C) 2010 John Crispin <blogic@openwrt.org>
   */
4af92e7a6   John Crispin   MIPS: lantiq: use...
8
  #include <linux/export.h>
8ec6d9350   John Crispin   MIPS: Lantiq: add...
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  #include <linux/clk.h>
  #include <asm/bootinfo.h>
  #include <asm/time.h>
  
  #include <lantiq_soc.h>
  
  #include "../prom.h"
  
  #define SOC_AMAZON_SE	"Amazon_SE"
  
  #define PART_SHIFT	12
  #define PART_MASK	0x0FFFFFFF
  #define REV_SHIFT	28
  #define REV_MASK	0xF0000000
  
  void __init ltq_soc_detect(struct ltq_soc_info *i)
  {
  	i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
  	i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
  	switch (i->partnum) {
  	case SOC_ID_AMAZON_SE:
  		i->name = SOC_AMAZON_SE;
  		i->type = SOC_TYPE_AMAZON_SE;
  		break;
  
  	default:
  		unreachable();
  		break;
  	}
  }