lpc32xx: ea-lpc3250devkitv2: enable i2c (DM)
[platform/kernel/u-boot.git] / board / ea / ea-lpc3250devkitv2 / README.rst
1 .. SPDX-License-Identifier: GPL-2.0+
2
3 ToC:
4 - Introduction
5 - Booting
6 - Debugging
7 - i2c
8
9
10 Introduction
11 ============
12 The Embedded Artists LPC3250 Developer's Kit v2 features the LPC3250 SoC
13 which is based on the ARM926EJ-S CPU. The kit features a base board and
14 a removable OEM board which features the SoC. Details, schematics, and
15 documentation are available from the Embedded Artists product website:
16
17         https://www.embeddedartists.com/products/lpc3250-developers-kit-v2/
18
19 The base board includes::
20 - 200 pos, 0.6mm pitch SODIMM connector for OEM Board
21 - LCD expansion connector with control signals for touch screen interface
22 - Expansion connector with all OEM Board signals
23 - Ethernet connector (RJ45)
24 - CAN interface & connector (provision for second CAN interface, but not mounted)
25 - MMC/SD interface & connector
26 - USB1: OTG or Host interface & connector
27 - USB2: Device or Host interface & connector
28 - Provision for NXP JN5148 RF module (former Jennic) interface (RF module not included)
29 - Full modem RS232 (cannot be fully used on 32-bit databus OEM boards)
30 - RS422/485 interface & connector
31 - Provision for IrDA transceiver interface (transceiver not mounted)
32 - I2S audio codec (mic in, line in, line out, headphone out)
33 - SWD/JTAG connector
34 - Trace connector and pads for ETM connector
35 - Serial Expansion Connector, 14-pos connector with UART/I2C/SPI/GPIO pins
36 - Power supply, either via USB or external 5V DC
37 - Optional coin cell battery for RTC and LED on ALARM output (coin cell not included)
38 - OEM Board current measuring
39 - Parallel NOR flash on external memory bus
40 - 16-bit register and LEDs on external memory bus
41 - 5-key joystick
42 - LM75 temperature sensor (I2C connected)
43 - 5 push-button keys (four via I2C and one on ISP-ENABLE)
44 - 9 LEDs (8 via I2C and one on ISP-ENABLE)
45 - Trimming potentiometer to analog input
46 - USB-to-serial bridge on UART #0 (FT232R) and ISP functionality
47 - Reset push-button and LED
48 - Speaker output on analog output from OEM Board, or from I2S audio codec
49 - 160x150 mm in size
50
51 The OEM board::
52 - ARMv5 ARM926EJ-S @ 266 MHz with hard-float VFPv2
53 - 256 KByte IRAM, 64 MByte SDRAM
54 - 128 MByte NAND flash
55 - 4 MByte NOR Flash
56 - Graphics Output: Parallel RGB
57 - Hardware 2D/3D Graphic: No
58 - Hardware Video: SW only
59 - Graphics input: No
60 - Audio: I2S
61 - Ethernet: 10/100 Mbps
62 - USB: 1x FS USB 2.0 OTG
63 - Wi-Fi: No
64 - FlexIO: No
65 - Serial: 2x I2C, 2x SPI, 7x UART
66 - ADC/PWM: 3 ch (10-bit) / 2 ch
67 - SD: MCI
68 - PCIe: No
69 - Serial ATA: No
70 - Size: 68 x 48 mm
71 - Connector: 200 pos SODIMM
72
73
74 Booting
75 =======
76 The processor will start its code execution from an internal ROM,
77 containing the boot code. This boot loader can load code from one of four
78 external sources to internal RAM (IRAM) at address 0x0::
79 - UART5
80 - SSP0 (in SPI mode)
81 - EMC Static CS0 memory
82 - NAND FLASH
83
84 The ROM boot loader loads code as a single contiguous block at a maximum
85 size of 56 kByte. Programs larger than this size must be loaded in more
86 steps, for example, by a secondary boot loader.
87
88 Kickstart Loader
89 ----------------
90 By default the Embedded Artists LPC3250 OEM Board is programmed with the
91 kickstart loader in block 0 of the NAND flash. The responsibility of this
92 loader is to load an application stored in block 1 and onwards of the NAND
93 flash. The kickstart loader will load the application into internal RAM
94 (IRAM) at address 0x0.
95
96 Stage 1 Loader (s1l)
97 --------------------
98 By default the Embedded Artists LPC3250 OEM Board is programmed with the
99 stage 1 loader (s1l) in block 1 of the NAND flash. This application will be
100 loaded by the kickstart loader when the LPC3250 OEM Board powers up. The
101 S1L loader will initialize the board, such as clocks and external memory
102 and then start a console where you can give input commands to the loader.
103 S1L offers the following booting options::
104 - MMC/SD card
105 - UART5
106 - NAND Flash
107
108 U-Boot with kickstart+s1l
109 -------------------------
110 Out of the box, the easiest way to get U-Boot running on the EA LPC3250
111 DevKit v2 board is to build the ea-lpc3250devkitv2_defconfig, copy the
112 resulting u-boot.bin to a vfat-formatted MMC/SD card, insert the MMC/SD card
113 into the MMC/SD card slot on the board, reset the board (SW1), and::
114
115         Embedded Artist 3250 Board (S1L 2.0)
116         Build date: Oct 31 2016 13:00:37
117
118         EA3250>load blk u-boot.bin raw 0x83000000
119         File loaded successfully
120
121         EA3250>exec 0x83000000
122
123
124 Debugging
125 =========
126 JTAG debugging of the Embedded Artists LPC3250 Developer's Kit v2 board is
127 easy thanks to the included/populated 20-pin JTAG port on the main board (J8).
128 openocd 0.11 has been used with this board along with the ARM-USB-OCD-H JTAG
129 dongle from Olimex successfully as follows:
130
131         # openocd \
132                 -f interface/ftdi/olimex-arm-usb-ocd-h.cfg \
133                 -f board/phytec_lpc3250.cfg
134
135
136 i2c
137 ===
138 Some of the LEDs on the board are connected via an I/O Expander (PCA9532) that
139 is attached to the i2c1 bus. Here is a sample session of toggling some of
140 these LEDs via i2c in U-Boot:
141
142 show the existing i2c busses:
143         EA-LPC3250v2=> i2c bus
144         Bus 0:  i2c@300
145         Bus 1:  i2c@400a0000
146         Bus 2:  i2c@400a8000
147
148 set i2c1 as the current bus:
149         EA-LPC3250v2=> i2c dev 1
150         Setting bus to 1
151
152 see what potential devices are found with rudimentary probing on i2c1:
153         EA-LPC3250v2=> i2c probe
154         Valid chip addresses: 1A 1D 48 50 57 60 66 6E
155
156 According to the schematics the i2c slave address of the PCA9532 is 0x60.
157
158 dump all of the 10 registers from the I/O Expander; NOTE that the 0x10 in the
159 command specifies the self-incrementing mode of the PCA9532; also NOTE that
160 the values repeat themseves to fill out a full 16 bytes:
161         EA-LPC3250v2=> i2c md 0x60 0x10 10
162         0010: 00 ff 00 80 00 80 00 00 00 00 4f ff 00 80 00 80    ..........O.....
163
164 turn on LEDs 23, 25, 27, and 29 (green):
165         EA-LPC3250v2=> i2c mw 0x60 9 0x55
166
167 turn on LEDs 22, 24, 26, and 28 (red):
168         EA-LPC3250v2=> i2c mw 0x60 8 0x55
169
170 dim the green LEDs (23, 25, 27, 29):
171         EA-LPC3250v2=> i2c mw 0x60 3 0x20
172         EA-LPC3250v2=> i2c mw 0x60 9 0xaa
173
174 turn off all LEDs (23-29):
175         EA-LPC3250v2=> i2c mw 0x60 8 0
176         EA-LPC3250v2=> i2c mw 0x60 9 0
177
178 read value of switches (input):
179         EA-LPC3250v2=> i2c md 0x60 0 1
180         0000: 4f    O
181 [none are pressed]
182
183 press and hold SW2 while running the following:
184         EA-LPC3250v2=> i2c md 0x60 0 1
185         0000: 4e    N
186 [SW2 is pressed]