2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
6 * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
9 #include <linux/export.h>
10 #include <linux/clk.h>
11 #include <asm/bootinfo.h>
14 #include <lantiq_soc.h>
18 #define SOC_DANUBE "Danube"
19 #define SOC_TWINPASS "Twinpass"
20 #define SOC_AMAZON_SE "Amazon_SE"
25 #define COMP_DANUBE "lantiq,danube"
26 #define COMP_TWINPASS "lantiq,twinpass"
27 #define COMP_AMAZON_SE "lantiq,ase"
28 #define COMP_AR9 "lantiq,ar9"
29 #define COMP_GR9 "lantiq,gr9"
30 #define COMP_VR9 "lantiq,vr9"
33 #define PART_MASK 0x0FFFFFFF
35 #define REV_MASK 0xF0000000
37 void __init
ltq_soc_detect(struct ltq_soc_info
*i
)
39 i
->partnum
= (ltq_r32(LTQ_MPS_CHIPID
) & PART_MASK
) >> PART_SHIFT
;
40 i
->rev
= (ltq_r32(LTQ_MPS_CHIPID
) & REV_MASK
) >> REV_SHIFT
;
41 sprintf(i
->rev_type
, "1.%d", i
->rev
);
46 i
->type
= SOC_TYPE_DANUBE
;
47 i
->compatible
= COMP_DANUBE
;
51 i
->name
= SOC_TWINPASS
;
52 i
->type
= SOC_TYPE_DANUBE
;
53 i
->compatible
= COMP_TWINPASS
;
61 i
->type
= SOC_TYPE_AR9
;
62 i
->compatible
= COMP_AR9
;
68 i
->type
= SOC_TYPE_AR9
;
69 i
->compatible
= COMP_GR9
;
72 case SOC_ID_AMAZON_SE_1
:
73 case SOC_ID_AMAZON_SE_2
:
75 panic("ase is only supported for non pci kernels");
77 i
->name
= SOC_AMAZON_SE
;
78 i
->type
= SOC_TYPE_AMAZON_SE
;
79 i
->compatible
= COMP_AMAZON_SE
;
86 i
->type
= SOC_TYPE_VR9
;
87 i
->compatible
= COMP_VR9
;
93 i
->type
= SOC_TYPE_VR9
;
94 i
->compatible
= COMP_GR9
;
100 i
->type
= SOC_TYPE_VR9_2
;
101 i
->compatible
= COMP_VR9
;
104 case SOC_ID_GRX282_2
:
105 case SOC_ID_GRX288_2
:
107 i
->type
= SOC_TYPE_VR9_2
;
108 i
->compatible
= COMP_GR9
;