Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
f3a186f
Documentation
arch
alpha
arc
arm
boot
common
configs
crypto
firmware
include
kernel
kvm
lib
mach-alpine
mach-artpec
mach-asm9260
mach-at91
mach-axxia
mach-bcm
mach-berlin
mach-clps711x
mach-cns3xxx
mach-davinci
mach-digicolor
mach-dove
mach-ebsa110
mach-efm32
mach-ep93xx
mach-exynos
mach-footbridge
mach-gemini
mach-highbank
mach-hisi
mach-imx
devices
3ds_debugboard.c
3ds_debugboard.h
Kconfig
Makefile
Makefile.boot
anatop.c
avic.c
board-mx31lilly.h
board-mx31lite.h
board-mx31moboard.h
common.h
cpu-imx25.c
cpu-imx27.c
cpu-imx31.c
cpu-imx35.c
cpu-imx5.c
cpu.c
cpuidle-imx5.c
cpuidle-imx6q.c
cpuidle-imx6sl.c
cpuidle-imx6sx.c
cpuidle.h
crmregs-imx3.h
devices-imx1.h
devices-imx21.h
devices-imx27.h
devices-imx31.h
devices-imx35.h
ehci-imx27.c
ehci-imx31.c
ehci-imx35.c
ehci.h
epit.c
eukrea-baseboards.h
gpc.c
hardware.h
headsmp.S
hotplug.c
iim.h
imx1-dt.c
imx27-dt.c
imx31-dt.c
imx35-dt.c
iomux-imx31.c
iomux-mx1.h
iomux-mx21.h
iomux-mx27.h
iomux-mx2x.h
iomux-mx3.h
iomux-mx35.h
iomux-v1.c
iomux-v1.h
iomux-v3.c
iomux-v3.h
irq-common.c
irq-common.h
mach-apf9328.c
mach-armadillo5x0.c
mach-bug.c
mach-imx25.c
mach-imx27_visstrim_m10.c
mach-imx50.c
mach-imx51.c
mach-imx53.c
mach-imx6q.c
mach-imx6sl.c
mach-imx6sx.c
mach-imx6ul.c
mach-imx7d.c
mach-kzm_arm11_01.c
mach-ls1021a.c
mach-mx21ads.c
mach-mx27_3ds.c
mach-mx27ads.c
mach-mx31_3ds.c
mach-mx31ads.c
mach-mx31lilly.c
mach-mx31lite.c
mach-mx31moboard.c
mach-mx35_3ds.c
mach-pca100.c
mach-pcm037.c
mach-pcm037_eet.c
mach-pcm043.c
mach-qong.c
mach-scb9328.c
mach-vf610.c
mach-vpr200.c
mm-imx1.c
mm-imx21.c
mm-imx27.c
mm-imx3.c
mmdc.c
mx1.h
mx21.h
mx27.h
mx2x.h
mx31.h
mx31lilly-db.c
mx31lite-db.c
mx31moboard-devboard.c
mx31moboard-marxbot.c
mx31moboard-smartbot.c
mx35.h
mx3x.h
mxc.h
pcm037.h
platsmp.c
pm-imx25.c
pm-imx27.c
pm-imx3.c
pm-imx5.c
pm-imx6.c
src.c
ssi-fiq-ksym.c
ssi-fiq.S
suspend-imx53.S
suspend-imx6.S
system.c
tzic.c
ulpi.h
mach-integrator
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx
mach-keystone
mach-ks8695
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson
mach-mmp
mach-moxart
mach-mv78xx0
mach-mvebu
mach-mxs
mach-netx
mach-nomadik
mach-nspire
mach-omap1
mach-omap2
mach-orion5x
mach-picoxcell
mach-prima2
mach-pxa
mach-qcom
mach-realview
mach-rockchip
mach-rpc
mach-s3c24xx
mach-s3c64xx
mach-s5pv210
mach-sa1100
mach-shmobile
mach-socfpga
mach-spear
mach-sti
mach-stm32
mach-sunxi
mach-tango
mach-tegra
mach-u300
mach-uniphier
mach-ux500
mach-versatile
mach-vexpress
mach-vt8500
mach-w90x900
mach-zx
mach-zynq
mm
net
nwfpe
oprofile
plat-iop
plat-omap
plat-orion
plat-pxa
plat-samsung
plat-versatile
probes
tools
vdso
vfp
xen
Kconfig
Kconfig-nommu
Kconfig.debug
Makefile
arm64
avr32
blackfin
c6x
cris
frv
h8300
hexagon
ia64
m32r
m68k
metag
microblaze
mips
mn10300
nios2
openrisc
parisc
powerpc
s390
score
sh
sparc
tile
um
unicore32
x86
xtensa
.gitignore
Kconfig
block
certs
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.get_maintainer.ignore
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
arch
/
arm
/
mach-imx
/
cpu.c
Blame
Blame
Latest commit
History
History
161 lines (141 loc) · 3.24 KB
Breadcrumbs
linux
/
arch
/
arm
/
mach-imx
/
cpu.c
Top
File metadata and controls
Code
Blame
161 lines (141 loc) · 3.24 KB
Raw
#include <linux/err.h> #include <linux/module.h> #include <linux/io.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/slab.h> #include <linux/sys_soc.h> #include "hardware.h" #include "common.h" unsigned int __mxc_cpu_type; EXPORT_SYMBOL(__mxc_cpu_type); static unsigned int imx_soc_revision; void mxc_set_cpu_type(unsigned int type) { __mxc_cpu_type = type; } void imx_set_soc_revision(unsigned int rev) { imx_soc_revision = rev; } unsigned int imx_get_soc_revision(void) { return imx_soc_revision; } void imx_print_silicon_rev(const char *cpu, int srev) { if (srev == IMX_CHIP_REVISION_UNKNOWN) pr_info("CPU identified as %s, unknown revision\n", cpu); else pr_info("CPU identified as %s, silicon rev %d.%d\n", cpu, (srev >> 4) & 0xf, srev & 0xf); } void __init imx_set_aips(void __iomem *base) { unsigned int reg; /* * Set all MPROTx to be non-bufferable, trusted for R/W, * not forced to user-mode. */ imx_writel(0x77777777, base + 0x0); imx_writel(0x77777777, base + 0x4); /* * Set all OPACRx to be non-bufferable, to not require * supervisor privilege level for access, allow for * write access and untrusted master access. */ imx_writel(0x0, base + 0x40); imx_writel(0x0, base + 0x44); imx_writel(0x0, base + 0x48); imx_writel(0x0, base + 0x4C); reg = imx_readl(base + 0x50) & 0x00FFFFFF; imx_writel(reg, base + 0x50); } void __init imx_aips_allow_unprivileged_access( const char *compat) { void __iomem *aips_base_addr; struct device_node *np; for_each_compatible_node(np, NULL, compat) { aips_base_addr = of_iomap(np, 0); imx_set_aips(aips_base_addr); } } struct device * __init imx_soc_device_init(void) { struct soc_device_attribute *soc_dev_attr; struct soc_device *soc_dev; struct device_node *root; const char *soc_id; int ret; soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); if (!soc_dev_attr) return NULL; soc_dev_attr->family = "Freescale i.MX"; root = of_find_node_by_path("/"); ret = of_property_read_string(root, "model", &soc_dev_attr->machine); of_node_put(root); if (ret) goto free_soc; switch (__mxc_cpu_type) { case MXC_CPU_MX1: soc_id = "i.MX1"; break; case MXC_CPU_MX21: soc_id = "i.MX21"; break; case MXC_CPU_MX25: soc_id = "i.MX25"; break; case MXC_CPU_MX27: soc_id = "i.MX27"; break; case MXC_CPU_MX31: soc_id = "i.MX31"; break; case MXC_CPU_MX35: soc_id = "i.MX35"; break; case MXC_CPU_MX51: soc_id = "i.MX51"; break; case MXC_CPU_MX53: soc_id = "i.MX53"; break; case MXC_CPU_IMX6SL: soc_id = "i.MX6SL"; break; case MXC_CPU_IMX6DL: soc_id = "i.MX6DL"; break; case MXC_CPU_IMX6SX: soc_id = "i.MX6SX"; break; case MXC_CPU_IMX6Q: soc_id = "i.MX6Q"; break; case MXC_CPU_IMX6UL: soc_id = "i.MX6UL"; break; case MXC_CPU_IMX7D: soc_id = "i.MX7D"; break; default: soc_id = "Unknown"; } soc_dev_attr->soc_id = soc_id; soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d.%d", (imx_soc_revision >> 4) & 0xf, imx_soc_revision & 0xf); if (!soc_dev_attr->revision) goto free_soc; soc_dev = soc_device_register(soc_dev_attr); if (IS_ERR(soc_dev)) goto free_rev; return soc_device_to_device(soc_dev); free_rev: kfree(soc_dev_attr->revision); free_soc: kfree(soc_dev_attr); return NULL; }
1
2
3
4
5
6
7
8
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
You can’t perform that action at this time.