2 * (C) Copyright 2011-2012
3 * Pali Rohár <pali.rohar@gmail.com>
6 * marcel@mesa.nl, Mesa Consulting B.V.
8 * (C) Copyright 2004-2005
11 * SPDX-License-Identifier: GPL-2.0+
16 * Code copied from maemo kernel 2.6.28 file
17 * arch/arm/plat-omap/include/mach/board.h
19 * Information structures for board-specific data
21 * Copyright (C) 2004 Nokia Corporation
22 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
25 /* Different peripheral ids */
26 #define OMAP_TAG_CLOCK 0x4f01
27 #define OMAP_TAG_SERIAL_CONSOLE 0x4f03
28 #define OMAP_TAG_USB 0x4f04
29 #define OMAP_TAG_LCD 0x4f05
30 #define OMAP_TAG_GPIO_SWITCH 0x4f06
31 #define OMAP_TAG_UART 0x4f07
32 #define OMAP_TAG_FBMEM 0x4f08
33 #define OMAP_TAG_STI_CONSOLE 0x4f09
34 #define OMAP_TAG_CAMERA_SENSOR 0x4f0a
35 #define OMAP_TAG_PARTITION 0x4f0b
36 #define OMAP_TAG_TEA5761 0x4f10
37 #define OMAP_TAG_TMP105 0x4f11
39 #define OMAP_TAG_BOOT_REASON 0x4f80
40 #define OMAP_TAG_FLASH_PART_STR 0x4f81
41 #define OMAP_TAG_VERSION_STR 0x4f82
43 #define OMAP_TAG_NOKIA_BT 0x4e01
44 #define OMAP_TAG_WLAN_CX3110X 0x4e02
45 #define OMAP_TAG_CBUS 0x4e03
46 #define OMAP_TAG_EM_ASIC_BB5 0x4e04
49 struct omap_clock_config {
50 /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
54 struct omap_serial_console_config {
59 struct omap_sti_console_config {
64 struct omap_usb_config {
65 /* Configure drivers according to the connectors on your board:
66 * - "A" connector (rectagular)
67 * ... for host/OHCI use, set "register_host".
68 * - "B" connector (squarish) or "Mini-B"
69 * ... for device/gadget use, set "register_dev".
70 * - "Mini-AB" connector (very similar to Mini-B)
71 * ... for OTG use as device OR host, initialize "otg"
73 unsigned register_host:1;
74 unsigned register_dev:1;
75 u8 otg; /* port number, 1-based: usb1 == 2 */
79 /* implicitly true if otg: host supports remote wakeup? */
82 /* signaling pins used to talk to transceiver on usbN:
84 * 2 == usb0-only, using internal transceiver
85 * 3 == 3 wire bidirectional
86 * 4 == 4 wire bidirectional
87 * 6 == 6 wire unidirectional (or TLL)
92 struct omap_lcd_config {
99 struct omap_fbmem_config {
104 struct omap_gpio_switch_config {
109 unsigned int key_code:24; /* Linux key code */
112 struct omap_uart_config {
113 /* Bit field of UARTs present; bit 0 --> UART1 */
114 unsigned int enabled_uarts;
117 struct omap_tea5761_config {
121 struct omap_partition_config {
125 /* same as in include/linux/mtd/partitions.h */
126 unsigned int mask_flags;
129 struct omap_flash_part_str_config {
133 struct omap_boot_reason_config {
137 struct omap_version_config {
143 * Code copied from maemo kernel 2.6.28 file
144 * arch/arm/plat-omap/include/mach/board-nokia.h
146 * Information structures for Nokia-specific board config data
148 * Copyright (C) 2005 Nokia Corporation
151 struct omap_bluetooth_config {
161 struct omap_wlan_cx3110x_config {
169 struct omap_cbus_config {
175 struct omap_em_asic_bb5_config {
183 * processing omap tag structures
185 * Copyright (C) 2011 marcel@mesa.nl, Mesa Consulting B.V.
186 * Copyright (C) 2012 Pali Rohár <pali.rohar@gmail.com>
189 /* TI OMAP specific information */
190 #define ATAG_BOARD 0x414f4d50
192 struct tag_omap_header {
198 struct tag_omap_header hdr;
200 struct omap_clock_config clock;
201 struct omap_serial_console_config serial_console;
202 struct omap_sti_console_config sti_console;
203 struct omap_usb_config usb;
204 struct omap_lcd_config lcd;
205 struct omap_fbmem_config fbmem;
206 struct omap_gpio_switch_config gpio_switch;
207 struct omap_uart_config uart;
208 struct omap_tea5761_config tea5761;
209 struct omap_partition_config partition;
210 struct omap_flash_part_str_config flash_part_str;
211 struct omap_boot_reason_config boot_reason;
212 struct omap_version_config version;
213 struct omap_bluetooth_config bluetooth;
214 struct omap_wlan_cx3110x_config wlan_cx3110x;
215 struct omap_cbus_config cbus;
216 struct omap_em_asic_bb5_config em_asic_bb5;
220 #define tag_omap_next(t) ((struct tag_omap *)((u8 *)(t) + \
221 (t)->hdr.size + sizeof(struct tag_omap_header)))
223 #define OMAP_TAG_HEADER_CONFIG(config, type) \
225 .hdr.size = sizeof(struct type)
227 #define OMAP_TAG_UART_CONFIG(p1) \
229 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_UART, omap_uart_config), \
230 .u.uart.enabled_uarts = p1, \
233 #define OMAP_TAG_SERIAL_CONSOLE_CONFIG(p1, p2) \
235 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_SERIAL_CONSOLE, \
236 omap_serial_console_config), \
237 .u.serial_console.console_uart = p1, \
238 .u.serial_console.console_speed = p2, \
241 #define OMAP_TAG_LCD_CONFIG(p1, p2, p3, p4) \
243 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_LCD, omap_lcd_config), \
244 .u.lcd.panel_name = p1, \
245 .u.lcd.ctrl_name = p2, \
246 .u.lcd.nreset_gpio = p3, \
247 .u.lcd.data_lines = p4, \
250 #define OMAP_TAG_GPIO_SWITCH_CONFIG(p1, p2, p3, p4, p5) \
252 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_GPIO_SWITCH, \
253 omap_gpio_switch_config), \
254 .u.gpio_switch.name = p1, \
255 .u.gpio_switch.gpio = p2, \
256 .u.gpio_switch.flags = p3, \
257 .u.gpio_switch.type = p4, \
258 .u.gpio_switch.key_code = p5, \
261 #define OMAP_TAG_WLAN_CX3110X_CONFIG(p1, p2, p3, p4, p5) \
263 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_WLAN_CX3110X, \
264 omap_wlan_cx3110x_config), \
265 .u.wlan_cx3110x.chip_type = p1, \
266 .u.wlan_cx3110x.reserverd = p2, \
267 .u.wlan_cx3110x.power_gpio = p3, \
268 .u.wlan_cx3110x.irq_gpio = p4, \
269 .u.wlan_cx3110x.spi_cs_gpio = p5, \
272 #define OMAP_TAG_PARTITION_CONFIG(p1, p2, p3, p4) \
274 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_PARTITION, \
275 omap_partition_config), \
276 .u.partition.name = p1, \
277 .u.partition.size = p2, \
278 .u.partition.offset = p3, \
279 .u.partition.mask_flags = p4, \
282 #define OMAP_TAG_BOOT_REASON_CONFIG(p1) \
284 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_BOOT_REASON, \
285 omap_boot_reason_config), \
286 .u.boot_reason.reason_str = p1, \
289 #define OMAP_TAG_VERSION_STR_CONFIG(p1, p2) \
291 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_VERSION_STR, \
292 omap_version_config), \
293 .u.version.component = p1, \
294 .u.version.version = p2, \