1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (C) 2010 John Crispin <john@phrozen.org>
5 * Copyright (C) 2013-2015 Lantiq Beteiligungs-GmbH & Co.KG
8 #include <linux/export.h>
10 #include <asm/bootinfo.h>
13 #include <lantiq_soc.h>
17 #define SOC_DANUBE "Danube"
18 #define SOC_TWINPASS "Twinpass"
19 #define SOC_AMAZON_SE "Amazon_SE"
21 #define SOC_GR9 "GRX200"
22 #define SOC_VR9 "xRX200"
23 #define SOC_VRX220 "xRX220"
24 #define SOC_AR10 "xRX300"
25 #define SOC_GRX390 "xRX330"
27 #define COMP_DANUBE "lantiq,danube"
28 #define COMP_TWINPASS "lantiq,twinpass"
29 #define COMP_AMAZON_SE "lantiq,ase"
30 #define COMP_AR9 "lantiq,ar9"
31 #define COMP_GR9 "lantiq,gr9"
32 #define COMP_VR9 "lantiq,vr9"
33 #define COMP_AR10 "lantiq,ar10"
34 #define COMP_GRX390 "lantiq,grx390"
37 #define PART_MASK 0x0FFFFFFF
39 #define REV_MASK 0xF0000000
41 void __init
ltq_soc_detect(struct ltq_soc_info
*i
)
43 i
->partnum
= (ltq_r32(LTQ_MPS_CHIPID
) & PART_MASK
) >> PART_SHIFT
;
44 i
->rev
= (ltq_r32(LTQ_MPS_CHIPID
) & REV_MASK
) >> REV_SHIFT
;
45 sprintf(i
->rev_type
, "1.%d", i
->rev
);
50 i
->type
= SOC_TYPE_DANUBE
;
51 i
->compatible
= COMP_DANUBE
;
55 i
->name
= SOC_TWINPASS
;
56 i
->type
= SOC_TYPE_DANUBE
;
57 i
->compatible
= COMP_TWINPASS
;
65 i
->type
= SOC_TYPE_AR9
;
66 i
->compatible
= COMP_AR9
;
72 i
->type
= SOC_TYPE_AR9
;
73 i
->compatible
= COMP_GR9
;
76 case SOC_ID_AMAZON_SE_1
:
77 case SOC_ID_AMAZON_SE_2
:
79 panic("ase is only supported for non pci kernels");
81 i
->name
= SOC_AMAZON_SE
;
82 i
->type
= SOC_TYPE_AMAZON_SE
;
83 i
->compatible
= COMP_AMAZON_SE
;
90 i
->type
= SOC_TYPE_VR9
;
91 i
->compatible
= COMP_VR9
;
97 i
->type
= SOC_TYPE_VR9
;
98 i
->compatible
= COMP_GR9
;
101 case SOC_ID_VRX268_2
:
102 case SOC_ID_VRX288_2
:
104 i
->type
= SOC_TYPE_VR9_2
;
105 i
->compatible
= COMP_VR9
;
109 i
->name
= SOC_VRX220
;
110 i
->type
= SOC_TYPE_VRX220
;
111 i
->compatible
= COMP_VR9
;
114 case SOC_ID_GRX282_2
:
115 case SOC_ID_GRX288_2
:
117 i
->type
= SOC_TYPE_VR9_2
;
118 i
->compatible
= COMP_GR9
;
127 i
->type
= SOC_TYPE_AR10
;
128 i
->compatible
= COMP_AR10
;
135 i
->name
= SOC_GRX390
;
136 i
->type
= SOC_TYPE_GRX390
;
137 i
->compatible
= COMP_GRX390
;