summaryrefslogtreecommitdiff
path: root/doc/board/galileo.rst
blob: 8274ffe77171282deb4fecfff0ddaab059fc41dc (plain)
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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
.. _galileo:

Galileo Gen1/Gen2
#################

Overview
********

Developers can use the galileo board configuration
to build a Zephyr Kernel that runs on a Galileo Development Board (Gen 1 or Gen 2).

This board configuration enables kernel support for the board's Quark SoC,
along with the following devices:

* High Precision Event Timer (HPET)

* Peripheral Component Interconnect (PCI) bus query

* Serial Ports in Polling and Interrupt Driven Modes

.. note::
   This board configuration may work with similar boards that are not officially
   supported.

Supported Boards
****************

This section provides information about the physical characteristics of boards
that the galileo board configuration supports.
Subsections contain detailed information on pin names, jumper settings, memory mappings,
and board component layout.

Pin Names
=========

For a component layout diagram showing pin names, see page 46 of the
`Intel® Quark SoC X1000 Datasheet`_.

See also the `Intel® Galileo Datasheet`_.

For the Galileo Board Connection Diagram see page 9 of the `Intel® Galileo Board User Guide`_.


Jumpers & Switches
==================

The kernel uses the Galileo default jumper settings except for the IOREF jumper,
which must be set to match the external operating voltage of either 3.3 V or 5 V.

The Galileo default switch settings are:

+--------+--------------+
| Jumper | Setting      |
+========+==============+
| IOREF  | 3.3V or 5V   |
+--------+--------------+
| VIN    | 5V  Jumpered |
+--------+--------------+

For more information, see page 14 of the
`Intel® Galileo Board User Guide`_.


Memory Mappings
===============

The galileo board configuration uses default hardware memory map
addresses and sizes.

For a list of memory mapped registers, see page 868 of the
`Intel® Quark SoC X1000 Datasheet`_.


Component Layout
================

See page 3 of the Intel® Galileo Datasheet for a component layout
diagram. Click the link to open the `Intel® Galileo Datasheet`_.


For a block diagram, see page 38 of the `Intel® Quark SoC X1000 Datasheet`_.


Supported Features
******************

The galileo board configuration supports the following hardware features:

* HPET

* PCI bus

* Advanced Programmed Interrupt Controller (APIC)

* Serial Ports in Polling and Interrupt Driven Modes

* Ethernet in Interrupt Driven Mode

+-----------+------------+-----------------------+
| Interface | Controller | Driver/Component      |
+===========+============+=======================+
| HPET      | on-chip    | system clock          |
+-----------+------------+-----------------------+
| PCI       | on-chip    | PCI library           |
+-----------+------------+-----------------------+
| APIC      | on-chip    | interrupt controller  |
+-----------+------------+-----------------------+
| UART      | on-chip    | serial port-polling;  |
|           |            | serial port-interrupt |
+-----------+------------+-----------------------+
| Ethernet  | on-chip    | Ethernet              |
+-----------+------------+-----------------------+

The kernel currently does not support other hardware features.
See the `Intel® Quark Core Hardware Reference Manual`_ for a
complete list of Galileo board hardware features, and the
`Intel® Quark Software Developer Manual for Linux`_


PCI
===

PCI drivers assume that IO regions and IRQs for devices are
preconfigured identically by the firmware on all supported devices.
This configuration is specified in the Kconfig file for the Intel
Quark X1000 SoC.  The PCI library supports dynamically enumerating PCI
devices, but that support is disabled by default.

.. note::
   The PCI library does not support 64-bit devices.
   Memory address and size storage only require 32-bit integers.

Serial Port Polling Mode Support
================================

The polling mode serial port allows debug output to be printed.

For more information, see `Intel® Quark SoC X1000 Datasheet`_,
section 18.3.3 FIFO Polled-Mode Operation


Serial Port Interrupt Mode Support
==================================

The interrupt mode serial port provides general serial communication
and external communication.

For more information, see `Intel® Quark SoC X1000 Datasheet`_, section 21.12.1.4.5 Poll Mode


Interrupt Controller
====================

The galileo board configuration uses the kernel's static
Interrupt Descriptor Table (IDT) to program the
Advanced Programmable Interrupt Controller (APIC)
interrupt redirection table.

Interrupts
----------

+-----+-------+---------+--------------------------+
| IRQ | Name  | Remarks | Used by Zephyr Kernel    |
+=====+=======+=========+==========================+
| 17  | INTB  | UART    | serial port when used in |
|     |       |         | interrupt mode           |
+-----+-------+---------+--------------------------+
| 20  | timer | HPET    | timer driver             |
+-----+-------+---------+--------------------------+

HPET System Clock Support
=========================

Galileo uses HPET timing with legacy-free timer support. The galileo platform
configuration uses HPET as a system clock timer.

Ethernet Support
================

The Ethernet driver allocates a Direct Memory Access (DMA)-accessible
pair of receive and transmit buffers and descriptors.  The driver
operates the network interface in store-and-forward mode and enables
the receive interrupt.

For more information, see `Intel® Quark SoC X1000 Datasheet`_,
section 15.0 10/100 Mbps Ethernet

Procedures
**********

Use the following procedures for booting an image on a Galileo board.

* `Creating a GRUB2 Boot Loader Image from a Linux Host`_

* `Preparing the Boot Device`_

* `Booting the Galileo Board`_


Creating a GRUB2 Boot Loader Image from a Linux Host
====================================================

If you are having problems running an application using the default GRUB
of the hardware, follow these steps to test on Galileo2 boards using a custom
GRUB.

#. Install the requirements to build GRUB on your host machine.

   On Ubuntu, type:

   .. code-block:: console

      $ sudo apt-get install bison autoconf libopts25-dev flex automake

   On Fedora, type:

   .. code-block:: console

     $ sudo dnf install gnu-efi bison m4 autoconf help2man flex \
        automake texinfo

#. Clone and build the GRUB repository using the script in Zephyr tree, type:

   .. code-block:: console

     $ cd $ZEPHYR_BASE
     $ ./scripts/build_grub.sh

#. Find the binary at :file:`$ZEPHYR_BASE/scripts/grub/bin/grub.efi`.



Preparing the Boot Device
=========================

Prepare either an SD-micro card or USB flash drive to boot the Zephyr
application image on a Galileo board. The following instructions apply to both
devices.


#. Set the board configuration to Galileo by changing the
   :command:`make` command that is executed in the app directory
   (e.g. :file:`$ZEPHYR_BASE/samples/hello_world/nanokernel`) to:

   .. code-block:: console

      $ make BOARD=galileo

   .. note::
      A stripped project image file named :file:`zephyr.strip` is
      automatically created when the project is built. This image has
      removed debug information from the :file:`zephyr.elf` file.

#. Use one of these cables for serial output:

   `<http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm>`_

#. Format a microSD as FAT

#. Create the following directories

   :file:`efi`

   :file:`efi/boot`

   :file:`kernel`

#. Copy the kernel file :file:`outdir/zephyr.strip` to the :file:`$SDCARD/kernel` folder.

#. Copy your built version of GRUB to :file:`$SDCARD/efi/boot/bootia32.efi`

#. Create :file:`$SDCARD/efi/boot/grub.cfg` containing the following:

   .. code-block:: console

      set default=0
      set timeout=10

      menuentry "Zephyr Kernel" {
         multiboot /kernel/zephyr.strip
      }

Booting the Galileo Board
=========================

Boot the Galileo board from the boot device using GRUB2
with the firmware present in the on-board flash.


Steps
-----

1. Insert the prepared boot device (micro-SD card or USB flash
   drive) into the Galileo board.

2. Connect the board to the host system using the serial cable and
   configure your host system to watch for serial data.  See
   `<https://software.intel.com/en-us/articles/intel-galileo-gen-2-board-assembly-using-eclipse-and-intel-xdk-iot-edition>`_
   for the gen. 2 board,
   `<https://software.intel.com/en-us/articles/intel-galileo-gen-1-board-assembly-using-eclipse-and-intel-xdk-iot-edition>`_
   for the gen. 1 board, or the Getting Started guide that you
   received with the board.

   .. note::
      On Windows, PuTTY has an option to set up configuration for
      serial data.  Use a baud rate of 115200 and the SCO keyboard
      mode.  The keyboard mode option is in a submenu of the Terminal
      menu on the left side of the screen.

3. Power on the Galileo board.

4. When the following output appears, press :kbd:`F7`:

   .. code-block:: console

     Press [Enter] to directly boot.
     Press [F7]    to show boot menu options.

5. From the menu that appears, select :guilabel:`UEFI Misc Device` to
   boot from a micro-SD card.  To boot from a USB flash drive, select
   the menu entry that desribes that particular type of USB flash
   drive.

   GRUB2 starts and a menu shows entries for the items you added
   to the file :file:`grub.cfg`.

6. Select the image you want to boot and press :guilabel:`Enter`.

   When the boot process completes, you have finished booting the
   Zephyr application image.

   .. note::
      If the following messages appear during boot, they can be safely
      ignored.
      .. code-block:: console
         WARNING: no console will be available to OS
         error: no suitable video mode found.

Known Problems and Limitations
******************************

At this time, the kernel does not support the following:

* Isolated Memory Regions
* Serial port in Direct Memory Access (DMA) mode
* Supervisor Mode Execution Protection (SMEP)

Bibliography
************

1. `Intel® Galileo Datasheet`_, Order Number: 329681-001US

.. _Intel® Galileo Datasheet:
   http://www.intel.com/newsroom/kits/quark/galileo/pdfs/Intel_Galileo_Datasheet.pdf

2. `Intel® Galileo Board User Guide`_.

.. _Intel® Galileo Board User Guide:
   http://download.intel.com/support/galileo/sb/galileo_boarduserguide_330237_001.pdf

3. `Intel® Quark SoC X1000 Datasheet`_, Order Number: 329676-001US

.. _Intel® Quark SoC X1000 Datasheet:
   https://communities.intel.com/servlet/JiveServlet/previewBody/
   21828-102-2-25120/329676_QuarkDatasheet.pdf

4. `Intel® Quark Core Hardware Reference Manual`_.

.. _Intel® Quark Core Hardware Reference Manual:
   http://caxapa.ru/thumbs/497461/Intel_Quark_Core_HWRefMan_001.pdf

5. `Intel® Quark Software Developer Manual for Linux`_.

.. _Intel® Quark Software Developer Manual for Linux:
   http://www.intel.com/content/dam/www/public/us/en/documents/manuals/quark-x1000-linux-sw-developers-manual.pdf