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 <john@phrozen.org>
7 * Copyright (C) 2013-2015 Lantiq Beteiligungs-GmbH & Co.KG
10 #include <linux/export.h>
11 #include <linux/clk.h>
12 #include <asm/bootinfo.h>
15 #include <lantiq_soc.h>
19 #define SOC_DANUBE "Danube"
20 #define SOC_TWINPASS "Twinpass"
21 #define SOC_AMAZON_SE "Amazon_SE"
23 #define SOC_GR9 "GRX200"
24 #define SOC_VR9 "xRX200"
25 #define SOC_VRX220 "xRX220"
26 #define SOC_AR10 "xRX300"
27 #define SOC_GRX390 "xRX330"
29 #define COMP_DANUBE "lantiq,danube"
30 #define COMP_TWINPASS "lantiq,twinpass"
31 #define COMP_AMAZON_SE "lantiq,ase"
32 #define COMP_AR9 "lantiq,ar9"
33 #define COMP_GR9 "lantiq,gr9"
34 #define COMP_VR9 "lantiq,vr9"
35 #define COMP_AR10 "lantiq,ar10"
36 #define COMP_GRX390 "lantiq,grx390"
39 #define PART_MASK 0x0FFFFFFF
41 #define REV_MASK 0xF0000000
43 void __init
ltq_soc_detect(struct ltq_soc_info
*i
)
45 i
->partnum
= (ltq_r32(LTQ_MPS_CHIPID
) & PART_MASK
) >> PART_SHIFT
;
46 i
->rev
= (ltq_r32(LTQ_MPS_CHIPID
) & REV_MASK
) >> REV_SHIFT
;
47 sprintf(i
->rev_type
, "1.%d", i
->rev
);
52 i
->type
= SOC_TYPE_DANUBE
;
53 i
->compatible
= COMP_DANUBE
;
57 i
->name
= SOC_TWINPASS
;
58 i
->type
= SOC_TYPE_DANUBE
;
59 i
->compatible
= COMP_TWINPASS
;
67 i
->type
= SOC_TYPE_AR9
;
68 i
->compatible
= COMP_AR9
;
74 i
->type
= SOC_TYPE_AR9
;
75 i
->compatible
= COMP_GR9
;
78 case SOC_ID_AMAZON_SE_1
:
79 case SOC_ID_AMAZON_SE_2
:
81 panic("ase is only supported for non pci kernels");
83 i
->name
= SOC_AMAZON_SE
;
84 i
->type
= SOC_TYPE_AMAZON_SE
;
85 i
->compatible
= COMP_AMAZON_SE
;
92 i
->type
= SOC_TYPE_VR9
;
93 i
->compatible
= COMP_VR9
;
99 i
->type
= SOC_TYPE_VR9
;
100 i
->compatible
= COMP_GR9
;
103 case SOC_ID_VRX268_2
:
104 case SOC_ID_VRX288_2
:
106 i
->type
= SOC_TYPE_VR9_2
;
107 i
->compatible
= COMP_VR9
;
111 i
->name
= SOC_VRX220
;
112 i
->type
= SOC_TYPE_VRX220
;
113 i
->compatible
= COMP_VR9
;
116 case SOC_ID_GRX282_2
:
117 case SOC_ID_GRX288_2
:
119 i
->type
= SOC_TYPE_VR9_2
;
120 i
->compatible
= COMP_GR9
;
129 i
->type
= SOC_TYPE_AR10
;
130 i
->compatible
= COMP_AR10
;
137 i
->name
= SOC_GRX390
;
138 i
->type
= SOC_TYPE_GRX390
;
139 i
->compatible
= COMP_GRX390
;