-
Notifications
You must be signed in to change notification settings - Fork 503
/
6x_bootscript-yocto.txt
144 lines (118 loc) · 4.34 KB
/
6x_bootscript-yocto.txt
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
setenv _bscriptver "v1.07"
echo "## Gateworks Ventana Yocto Bootscript ${_bscriptver} ####################"
## First: Memory Allocations ###################################################
if test -z "${mem}" ; then
echo "Detected ${mem_mb}MB DRAM - adjusting CMA memory allocation..."
# Freescale doesn't provide a 'best practice' for choosing CMA. We determine
# it using following formula (please customize mem to your own req's):
# cma=min(((${mem_mb}/2) - round(${mem_mb}*.125))M, 384M)
if itest.s "x${mem_mb}" == "x256" ; then
setenv mem "cma=96M"
elif itest.s "x${mem_mb}" == "x512" ; then
setenv mem "cma=192M"
else
setenv mem "cma=384M"
fi
fi
if itest.s "x${mem}" == "xNA" ; then
echo "Leaving CMA alone..."
else
setenv extra "${extra}" "${mem}"
echo "Memory configuration used from env mem: $mem"
fi
## Second: Video Options #######################################################
if test -z "${video}" ; then
# locally used variables
setenv fb_num 0
setenv lvds_flag
setenv hdmi_flag
setenv cvbs_flag
setenv max_disp 3 # 0-3 displays
# Default displays to display if displays is empty
if test -z "${displays}"; then
setenv displays "${display}"
fi
# Detect HDMI if displays is empty (HDMI)
if test -z "${displays}" ; then
i2c dev 2
if hdmidet ; then # HDMI
setenv displays "HDMI"
echo "HDMI Detected"
fi
fi
echo "Display(s) to configure: ${displays}"
# Configure displays
for disp in ${displays} ; do
if itest.s "x${disp}" == "xHDMI" ; then
if test -z "${hdmi_flag}" ; then # Only allow one HDMI display
setenv hdmi_flag 1
test -n "${hdmi}" || hdmi=1080p
if itest.s "x${hdmi}" == "x1080p" ; then
setenv hdmi "1920x1080M@60"
elif itest.s "x${hdmi}" == "x720p" ; then
setenv hdmi "1280x720M@60"
elif itest.s "x${hdmi}" == "x480p" ; then
setenv hdmi "720x480M@60"
fi
setenv video "${video}" "video=mxcfb${fb_num}:dev=hdmi,${hdmi},if=RGB24,bpp=32"
echo "Setting HDMI Display to mxcfb${fb_num}"
setexpr fb_num ${fb_num} + 1
fi
# Freescale MCIMX-LVDS1 10" XGA Touchscreen Display
elif itest.s "x${disp}" == "xHannstar-XGA" ; then
if test -z "${lvds_flag}" ; then # Only allow one LVDS display
setenv lvds_flag 1
setenv video "${video}" "video=mxcfb${fb_num}:dev=ldb,bpp=32,LDB-XGA,if=RGB666"
# Configure timings
setenv display "Hannstar-XGA"
echo "Setting Hannstar-XGA Display to mxcfb${fb_num}"
setexpr fb_num ${fb_num} + 1
fi
# GW17029 DLC700JMGT4 7" WSVGA Touchscreen Display
elif itest.s "x${disp}" == "xDLC700JMGT4" ; then
if test -z "${lvds_flag}" ; then # Only allow one LVDS display
setenv lvds_flag 1
setenv video "${video}" "video=mxcfb${fb_num}:dev=ldb,bpp=32,LDB-WSVGA,if=RGB666"
# Configure timings
setenv display "DLC700JMGT4"
echo "Setting DLC700JMGT4 Display to mxcfb${fb_num}"
setexpr fb_num ${fb_num} + 1
fi
# GW17030 DLC800FIGT3 8" XGA Touchscreen Display"
elif itest.s "x${disp}" == "xDLC800FIGT3" ; then
if test -z "${lvds_flag}" ; then # Only allow one LVDS display
setenv lvds_flag 1
setenv video "${video}" "video=mxcfb${fb_num}:dev=ldb,bpp=32,LDB-XGA,if=RGB666"
# Configure timings
setenv display "DLC800FIGT3"
echo "Setting DLC800FIGT3 Display to mxcfb${fb_num}"
setexpr fb_num ${fb_num} + 1
fi
elif itest.s "x${disp}" == "xCVBS" ; then
if test -z "${cvbs_flag}" ; then # Only allow one CVBS display
setenv cvbs_flag 1
setenv video "${video}" "video=mxcfb${fb_num}:dev=adv739x,BT656-NTSC,if=BT656,fbpix=RGB565,bpp=32"
echo "Setting CVBS Display to mxcfb${fb_num}"
setexpr fb_num ${fb_num} + 1
fi
elif itest.s "x${disp}" == "xnone" ; then
# Reset fb_num to mark all displays to 'off'
setenv fb_num 0
else
echo "${disp} is an unsupported display type"
echo "Valid Displays: HDMI|Hannstar-XGA|DLC700JMGT4|DLC800FIGT3|CVBS"
fi
done
# Mark the rest of the displays to 'off'
while test "${fb_num}" -le "${max_disp}" ; do
setenv video "${video}" "video=mxcfb${fb_num}:off"
setexpr fb_num ${fb_num} + 1
done
# Set only if video is set
if test -n "${video}" ; then
setenv video "${video}"
fi
fi
setenv extra "${extra}" galcore.initgpu3DMinClock=3
echo "Video configuration used from env video: ${video}"
echo "## End Gateworks Ventana Yocto Bootscript ${_bscriptver} ################"