1.. zephyr:board:: mec1501modular_assy6885
2
3Overview
4********
5
6The MEC1501 Modular card ASSY6885 is a development board to evaluate the Microchip
7MEC152X series microcontrollers. This board can work standalone or be mated with
8any platform that complies with MECC specification.
9
10Hardware
11********
12
13- MEC1521HA0SZ ARM Cortex-M4 Processor
14- 256 KB RAM and 64 KB boot ROM
15- GPIO headers
16- UART1 using microUSB
17- PECI interface 3.0
18- 10 SMBUS instances
19- FAN, PMW and TACHO pins
20- VCI interface
21- Independent Hardware Driven PS/2 Ports
22
23At difference from MEC15xx evaluation board, modular MEC1521 exposes the pins
24in 2 different ways:
25
261) Standalone mode via headers
27
28   - GPIOs
29   - PWM5
30   - JTAG/SWD, ETM and MCHP Trace ports
31   - eSPI bus
32   - SMB0
33
342) Mated mode with another platform that has a high density MECC connector.
35
36   - FAN0, PWM0, SMB0, SMB1, SMB4 and SMB5
37   - eSPI bus
38   - Breathing/Blinking LEDs
39
40The board is powered through the +5V USB Micro A connector or from the MECC connector.
41
42
43For more information about the SOC please see the `MEC152x Reference Manual`_
44
45Supported Features
46==================
47
48The mec1501modular_assy6885 board configuration supports the following hardware
49features:
50
51+-----------+------------+-------------------------------------+
52| Interface | Controller | Driver/Component                    |
53+===========+============+=====================================+
54| NVIC      | on-chip    | nested vector interrupt controller  |
55+-----------+------------+-------------------------------------+
56| SYSTICK   | on-chip    | systick                             |
57+-----------+------------+-------------------------------------+
58| UART      | on-chip    | serial port                         |
59+-----------+------------+-------------------------------------+
60| GPIO      | on-chip    | gpio                                |
61+-----------+------------+-------------------------------------+
62| ESPI      | on-chip    | espi                                |
63+-----------+------------+-------------------------------------+
64| I2C       | on-chip    | i2c                                 |
65+-----------+------------+-------------------------------------+
66| PINMUX    | on-chip    | pinmux                              |
67+-----------+------------+-------------------------------------+
68| RTOS      | on-chip    | timer                               |
69+-----------+------------+-------------------------------------+
70| TIMER     | on-chip    | counter                             |
71+-----------+------------+-------------------------------------+
72| PWM       | on-chip    | pwm                                 |
73+-----------+------------+-------------------------------------+
74| ADC       | on-chip    | adc                                 |
75+-----------+------------+-------------------------------------+
76| WATCHDOG  | on-chip    | watchdog                            |
77+-----------+------------+-------------------------------------+
78| PS2       | on-chip    | ps2                                 |
79+-----------+------------+-------------------------------------+
80
81Other hardware features are not currently supported by Zephyr (at the moment)
82
83The default configuration can be found in the
84:zephyr_file:`boards/microchip/mec1501modular_assy6885/mec1501modular_assy6885_defconfig`
85Kconfig file.
86
87Connections and IOs
88===================
89
90This evaluation board kit is comprised of the following HW blocks:
91
92- MEC1501 Modular Card ASSY 6885 Rev A0 `MEC1501 Modular EC Card - Assy_6885 Rev A0p1`_
93
94System Clock
95============
96
97The MEC1501 MCU is configured to use the 48Mhz internal oscillator with the
98on-chip PLL to generate a resulting EC clock rate of 12 MHz. See Processor clock
99control register in chapter 4 "4.0 POWER, CLOCKS, and RESETS" of the data sheet in
100the references at the end of this document.
101
102Serial Port
103===========
104UART1 is configured for serial logs.
105
106Jumper settings
107***************
108
109Please follow the jumper settings below to properly demo this
110board. Advanced users may deviate from this recommendation.
111
112Jumper setting for MEC1501 Modular Assy 6885 Rev A1p0
113=====================================================
114
115Power-related jumpers
116---------------------
117
118If you wish to power from type A/B connector ``P10`` set the jumper ``JP35 1-2``.
119
120If you wish to power through MECC connector ``P1`` and mate to external platform,
121set the jumper to ``JP35 3-4``.
122
123.. note:: A single jumper is required in JP35.
124
125+------+---------+---------+------+------+------+----------+
126| JP30 | JP31    | JP32    | JP33 | JP34 | JP40 | JP21     |
127| VTR3 | VTR_PLL | VTR_REG | VTR1 | VTR2 | 3.3V | VREF_ADC |
128+======+=========+=========+======+======+======+==========+
129| 1-2  |   1-2   |   1-2   | 1-2  |  1-2 | 1-2  |   1-2    |
130+------+---------+---------+------+------+------+----------+
131
132
133+------+------------+------+----------+
134| JP6  | JP36       | JP27 | JP4      |
135| VBAT | VTR_ANALOG | PECI | VREF_VTT |
136+======+============+======+==========+
137| 2-3  |    1-2     | 2-3  |   open   |
138+------+------------+------+----------+
139
140These jumpers configure nRESETI and JTAG_STRAP respectively.
141
142+-----------+---------------+
143| JP22      | JP29          |
144| (nRESETI) | (JTAG_STRAP)  |
145+===========+===============+
146| 11-12     | 1-2           |
147+-----------+---------------+
148
149Boot-ROM Straps
150---------------
151
152These jumpers configure MEC1501 Boot-ROM straps.
153
154+-------------+------------+--------------+-------------+
155| JP37        | J6         | JP41         | JP23        |
156| (CMP_STRAP) | (CR_STRAP) | (VTR2_STRAP) | (BSS_STRAP) |
157+=============+============+==============+=============+
158| 1-2         | 1-2        | 1-2          | 3-4         |
159+-------------+------------+--------------+-------------+
160
161
162``JP23 3-4`` pulls SHD SPI CS0# up to VTR2. MEC1501 Boot-ROM samples
163SHD SPI CS0# and if high, it loads code from SHD SPI.
164This is the recommended setup.
165
166+-------------+------------+----------------------------+
167|  CR_STRAP   | BSS_STRAP  |         SOURCE             |
168+-------------+------------+----------------------------+
169|      0      |     X      |   Use 3.3V Private SPI     |
170+-------------+------------+----------------------------+
171|      1      |     0      |  Use eSPI Flash channel    |
172+-------------+------------+----------------------------+
173|             |     1      |  Use 3.3V Shared channel(R)|
174+-------------+------------+----------------------------+
175
176Power management
177----------------
178``JP20 2-3`` is required so all GPIOs powered by VTR3 rail worked at 1.8V.
179
180.. note:: External 1.8V needs to be connected to JP13.1
181
182+-------------------+-----------------+
183| JP20              | JP13            |
184| (VTR3 selection)  | (1.8V source)   |
185+===================+=================+
186|   2-3             | 1.8V to pin 1   |
187+-------------------+-----------------+
188
189
190Jumper location map
191-------------------
192
193.. code-block:: none
194
195   +--------------------------------------------------------------------------------------+
196   |                  |------------|                     +----------+ J10              || |
197   |  [BT1]       +   +------------+ J50                                      ++   ++  || |
198   |              |                                           JP38 JP43       ++   ||  || |
199   |              +         +      +       +-+ JP4              +    +       JP26  ||  || |
200   |             JP6        +      +                  +      +  + +  + +           ||  || |
201   |    JP31 ++            JP32   JP36     +-+ JP27   +      +    +    +           J6  || |
202   |                                                 JP18  JP37 JP41 JP42              ++ |
203   |         ++                  +   +    +--------+                                  J48 |
204   |         ||  JP21            +   +    +--------+ JP22    +----------+                 |
205   |      J2 ||   +            JP34 JP30                         J11              ++      |
206   |         ++   +                                                  J44          ||      |
207   |                            ++                         +----------------+     ||      |
208   |       +---------------+    ||  +        JP24          |----------------|     ++      |
209   |       |---------------|    ++  +    +----------+      +----------------+    J47      |
210   | JP20  +---------------+  JP23  JP40 +----------+                                  ++ |
211   |                                                     +           ++ JP29           || |
212   |                             +  +    +----------+    +                             || |
213   |    J52+---------------+     +  +    +----------+   J5   +-------------+           ++ |
214   |    J45+---------------+  JP33 TP57      JP25            +-------------+ J4       J49 |
215   |                                                                                      |
216   | ++                                           TP4   +----------+   ++                 |
217   | ++     +    +      +    +    +       +  TP61         +----------+   ++               |
218   | JP28   +    +      +    +    +  TP65 +  TP60            J51        JP35              |
219   |      TP58 JP16   JP11 JP13 JP15     JP10                                             |
220   | TP5                                                                                  |
221   | TP6                                        TP1                                       |
222   +--------------------------------------------------------------------------------------+
223
224
225Programming and Debugging
226*************************
227
228Setup
229=====
230
231#. Clone the `MEC152x SPI Image Gen`_ repository or download the files within
232   that directory. For the pre-production MEC150x use the `MEC150x SPI Image Gen`_
233   repository.
234
235#. Make the image generation available for Zephyr, by making the tool
236   searchable by path, or by setting an environment variable
237   ``EVERGLADES_SPI_GEN``, for example:
238
239   .. code-block:: console
240
241      export EVERGLADES_SPI_GEN=<path to tool>/everglades_spi_gen_RomE
242
243   Note that the tools for Linux and Windows have different file names.
244   For the pre-production MEC1501 SOC use everglades_spi_gen_lin64.
245
246#. If needed, a custom SPI image configuration file can be specified
247   to override the default one.
248
249   .. code-block:: console
250
251      export EVERGLADES_SPI_CFG=custom_spi_cfg.txt
252
253
254Building
255==========
256#. Build :zephyr:code-sample:`hello_world` application as you would normally do.
257
258#. Once you have ``zephyr.bin``, use the `MEC152x SPI Image Gen`_ microchip tool
259   to create the final binary. You need the output from this tool to flash
260   in the SHD SPI memory.
261
262Flashing
263========
264
265#. Connect Dediprog into header ``J2``.
266
267#. Flash the SPI NOR ``U3`` at offset 0x0 using Dediprog SF100
268   or a similar tool for flashing SPI chips.
269
270#. Run your favorite terminal program to listen for output. Under Linux the
271   terminal should be :code:`/dev/ttyACM0`. For example:
272
273   .. code-block:: console
274
275      $ minicom -D /dev/ttyACM0 -o
276
277   The -o option tells minicom not to send the modem initialization
278   string. Connection should be configured as follows:
279
280   - Speed: 115200
281   - Data: 8 bits
282   - Parity: None
283   - Stop bits: 1
284
285#. Connect the MEC1501MODULAR_ASSY6885 board to your host computer using the
286   UART1 port and apply power.
287
288   You should see ``"Hello World! mec1501modular_assy6885"`` in your terminal.
289
290Debugging
291=========
292This board comes with a Cortex ETM port which facilitates tracing and debugging
293using a single physical connection.  In addition, it comes with sockets for
294JTAG only sessions.
295
296HW Issues
297=========
298In case you don't see your application running, please make sure ``LED1`` is lit.
299If is off, then check the power related jumpers again.
300
301References
302**********
303.. target-notes::
304
305.. _MEC152x Preliminary Data Sheet:
306    https://github.com/MicrochipTech/CPGZephyrDocs/blob/master/MEC152x/MEC152x_Datasheet.pdf
307.. _MEC152x Reference Manual:
308    https://github.com/MicrochipTech/CPGZephyrDocs/blob/master/MEC152x/MEC152x_Datasheet.pdf
309.. _MEC1501 Modular EC Card - Assy_6885 Rev A0p1:
310    https://github.com/MicrochipTech/CPGZephyrDocs/blob/master/MEC1501/MEC1501%20Modular%20EC%20Card%20-%20Assy_6885%20Rev%20A0p1%20-%20SCH.pdf
311.. _MEC152x SPI Image Gen:
312    https://github.com/MicrochipTech/CPGZephyrDocs/tree/master/MEC152x/SPI_image_gen
313.. _MEC150x SPI Image Gen:
314    https://github.com/MicrochipTech/CPGZephyrDocs/tree/master/MEC1501/SPI_image_gen
315