-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.html
353 lines (255 loc) · 7.68 KB
/
README.html
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>
ABOUT miZy\_spi\_image\_builder
</title>
</head>
<style>
html, body {
padding: 0px;
margin: 0px;
margin-left: auto;
margin-right: auto;
width: auto;
max-width: 1024px;
min-width: 320px;
height:100%;
font-family: arial;
font-size: 24px;
color: #000000;
background: #666666;
}
table {
font-family: arial;
font-size: 16px;
color: #000000;
}
pro {
font-family: arial;
font-size: 16px;
color: #000000;
}
label{
font-family: arial;
font-size: 18px;
border: 0px solid red;
display: inline-block;
width: 100%;
}
h1,h2,h3 {
font-size: 120%;
color: #666666;
}
p {
padding-bottom: 10px;
}
h2 {
font-size: 150%;
}
h1 {
font-size: 200%;
}
.main img {
padding: 20px;
}
a{
color: #4186be;
text-decoration: none;
}
a:hover {
color: #E86402;
;
}
h2 b{
color: #E86402;
}
.date{
background: #eee;
display: block;
padding: 10px;
width: 100px;
float: left;
margin-right: 20px;
color: #aaa;
font-size: 100%;
text-align: center;
}
.pro{
font-size: 120%;
}
.main{
border: solid 1px #fff;
background: #fff;
margin: 0px;
padding: 0px;
padding-top: 20px;
padding-left: 40px;
padding-right: 40px;
height:auto !important; /* real browsers */
height:100%; /* IE6: treaded as min-height*/
min-height:100%; /* real browsers */
}
.cmd {
padding-left: 10px;
list-style: none;
font-family: monospace;
font-size: 80%;
}
.cmd li{
}
.cmd li:before {
content: "# ";
color: #aaffff;
}
pre {
padding: 0px;
white-space: pre;
margin: 0px;
font-size: 85%;
}
code {
display: block;
padding-left: 10px;
font-family: monospace;
white-space: pre-line;
border-left: solid #bebebe 4px;
color: #666666;
}
.bottom {
display: block;
border-top: solid #bebebe 1px;
color: #666666;
padding: 20px;
}
</style>
<body>
<div class="main">
<h1>ABOUT miZy_spi_image_builder</h1>
<p>SPI-flash miZy firmware image builder (for sunxi Orange Pi Zero, another sunxi boards maybe work too )
also Hybrid-image generate for SD card (spi emulate on sd card)</p>
<p>Its just a part or miZy project, and same as other our parts can standalone used</p>
<p>This perl script no need any libs or another deps</p>
<h1>Get Source</h1>
<pre><code>mkdir /tmp/zero_builder
cd /tmp/zero_builder
git clone [https://github.com/hyphop/miZy-spi-image-builder.git](https://github.com/hyphop/miZy-spi-image-builder.git)
cd miZy-spi-image-builder
</code></pre>
<h1>USAGE</h1>
<p>help</p>
<pre><code>./miZy_spi_image_builder --help
</code></pre>
<p>common usage for 8M image, output to firmwares/orange_pi_zero_hyphop_mizy_spi_flash_demo-8M.bin</p>
<pre><code>./miZy_spi_image_builder
</code></pre>
<p>custom config</p>
<pre><code>./miZy_spi_image_builder miZy-spi_image_builder_custom.conf
</code></pre>
<p>set 16M image size</p>
<pre><code>img_size=16M ./miZy_spi_image_builder
</code></pre>
<p>not padded by flash size, save only used space</p>
<pre><code>img_size=0 ./miZy_spi_image_builder
</code></pre>
<p>override image out name</p>
<pre><code>img_name=out/my_image_name%s.bin ./miZy_spi_image_builder
</code></pre>
<p>check build status in shell </p>
<pre><code>./miZy_spi_image_builder && echo "build ok"
./miZy_spi_image_builder || echo "build fail"
</code></pre>
<h1>BUILD EXAMPLES</h1>
<p><a href="https://github.com/hyphop/miZy-spi-image-builder/tree/master/examples">https://github.com/hyphop/miZy-spi-image-builder/tree/master/examples</a></p>
<h1>write image to SPI from host to working device</h1>
<p>easy way for upgrade / rewrite system</p>
<pre><code>scp firmwares/*.bin root@zeru:/tmp
dd bs=65536 of=/dev/mtdblock5 < /tmp/*.bin
163+1 records in
163+1 records out
10743872 bytes (10.2MB) copied, 61.941887 seconds, 169.4KB/s
</code></pre>
<h1>Hybrid image</h1>
<p>by default miZy_spi_image_builder generate hybrid image its simple raw image,
which can used for SPI and same for SD/MMC. this image equal spi-flash rom and
ready for direct write to SPI flash, but we can write this image to SD/MMC
for test work on device, and next copy this image to SPI from booted SD/MMC, </p>
<p>write hybrid image to SD/MMC</p>
<pre><code>dd seek=16 bs=512 of=/dev/mmcblk0 < firmwares/mizy_spi_flash_demo-8M.bin
</code></pre>
<p>write hybrid image direct to SPI ( /dev/mtdblock5 - full size spi-flash mtd block dev)</p>
<pre><code>dd bs=65536 of=/dev/mtdblock5 < /tmp/mizy_spi_flash_demo-8M.bin
</code></pre>
<p>write hybrid image direct to SPI via mtd</p>
<pre><code>mtd write /tmp/mizy_spi_flash_demo-8M.bin full
</code></pre>
<p>write hybrid image to SPI via sunxi-tooll FEL mode from host machine</p>
<pre><code>sunxi-fel -p spiflash-write 0 firmwares/mizy_spi_flash_demo-8M.bin
</code></pre>
<h1>generate MMC image</h1>
<p>output raw mmc image (this image usable for mmc, not for SPI )</p>
<pre><code>MMC=1 img_name=firmwares/mizy_mmc_image.bin ./miZy_spi_image_builder
</code></pre>
<p>add one partiotion and write some readme info there</p>
<pre><code>./miZy_mmc_add_partitions firmwares/mizy_mmc_image.bin 8x8
</code></pre>
<h2><a name='write_mmc_image_to_sd_mmc'></a>write mmc image to SD/MMC</h2>
<pre><code>dd of=/dev/mmcblk0 < firmwares/mizy_mmc_image.bin
</code></pre>
<h1>copy from booted MMC image to SPI, directly from working device</h1>
<pre><code>mmc_copy_to_spi
mmc_copy_to_spi yes
## <a name='found_mizy_hybrid_image_info'></a>FOUND mizy hybrid image info:
8388608
mizy_mmc_image.bin
miZy_spi_image_builder Thu Apr 6 16:17:17 2017 ## <a name='hyphop'></a>hyphop ##
## <a name='write_image_cmd'></a>WRITE IMAGE CMD:
> dd if=/dev/mmcblk0 skip=1 bs=8192 count=1024 of=/dev/mtdblock5
1024+0 records in
1024+0 records out
8388608 bytes (8.0MB) copied, 45.987770 seconds, 178.1KB/s
</code></pre>
<p>ok system is ready for full loading from spi
now u can remove sd card, and reboot system from spi already!</p>
<h1>CONFIG FILE</h1>
<p>default config</p>
<pre><code>miZy-spi_image_builder.conf
</code></pre>
<p>config file its a same pure perl code!</p>
<h1>PATHS</h1>
<p>put your files (uboot scripts env fex/dtc kernel squashfs initramfs userdata) in @SCAN_PATH dirs
by default are</p>
<pre><code>.
./bin
./bin.local
</code></pre>
<h1>TOOLS</h1>
<h1>miZy</h1>
<p>tiny fast embedded linux, for sunxi Orange Pi Zero (and maybe other boards) and mods.
Now under active development, but is usable already )</p>
<h1>write image to device in FEL mode</h1>
<p>in FEL mode via sunxi-fel tools</p>
<p>check spi flash size</p>
<pre><code>./tools/fel_spi_info
Manufacturer: Winbond (EFh), model: 40h, size: 16777216 bytes.
</code></pre>
<p>ok! write image - u can write any image size <= flash size</p>
<pre><code>./tools/fel_spi_write firmwares/orange_pi_zero_hyphop_mizy_spi_flash_demo-8M.bin
</code></pre>
<h1>LINKS</h1>
<ul>
<li><a href="https://github.com/hyphop/miZy-spi-image-builder">https://github.com/hyphop/miZy-spi-image-builder</a></li>
<li><a href="https://hyphop.github.io/mizy/">https://hyphop.github.io/mizy/</a></li>
<li><a href="https://github.com/hyphop/miZy-uboot">https://github.com/hyphop/miZy-uboot</a></li>
<li><a href="https://github.com/hyphop/miZy-linux-kernel">https://github.com/hyphop/miZy-linux-kernel</a></li>
</ul>
<script>
ss=document.getElementById("stopspam");
ss.innerHTML=ss.innerHTML.replace(/\(at\)/, '@').replace(/\(dot\)/, '.');
</script>
<div class="bottom">
</div>
<div>
</body>
</html>