1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2011-2012
4 * Pali Rohár <pali.rohar@gmail.com>
7 * marcel@mesa.nl, Mesa Consulting B.V.
9 * (C) Copyright 2004-2005
15 * Code copied from maemo kernel 2.6.28 file
16 * arch/arm/plat-omap/include/mach/board.h
18 * Information structures for board-specific data
20 * Copyright (C) 2004 Nokia Corporation
21 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
24 /* Different peripheral ids */
25 #define OMAP_TAG_CLOCK 0x4f01
26 #define OMAP_TAG_SERIAL_CONSOLE 0x4f03
27 #define OMAP_TAG_USB 0x4f04
28 #define OMAP_TAG_LCD 0x4f05
29 #define OMAP_TAG_GPIO_SWITCH 0x4f06
30 #define OMAP_TAG_UART 0x4f07
31 #define OMAP_TAG_FBMEM 0x4f08
32 #define OMAP_TAG_STI_CONSOLE 0x4f09
33 #define OMAP_TAG_CAMERA_SENSOR 0x4f0a
34 #define OMAP_TAG_PARTITION 0x4f0b
35 #define OMAP_TAG_TEA5761 0x4f10
36 #define OMAP_TAG_TMP105 0x4f11
38 #define OMAP_TAG_BOOT_REASON 0x4f80
39 #define OMAP_TAG_FLASH_PART_STR 0x4f81
40 #define OMAP_TAG_VERSION_STR 0x4f82
42 #define OMAP_TAG_NOKIA_BT 0x4e01
43 #define OMAP_TAG_WLAN_CX3110X 0x4e02
44 #define OMAP_TAG_CBUS 0x4e03
45 #define OMAP_TAG_EM_ASIC_BB5 0x4e04
48 struct omap_clock_config {
49 /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
53 struct omap_serial_console_config {
58 struct omap_sti_console_config {
63 struct omap_usb_config {
64 /* Configure drivers according to the connectors on your board:
65 * - "A" connector (rectagular)
66 * ... for host/OHCI use, set "register_host".
67 * - "B" connector (squarish) or "Mini-B"
68 * ... for device/gadget use, set "register_dev".
69 * - "Mini-AB" connector (very similar to Mini-B)
70 * ... for OTG use as device OR host, initialize "otg"
72 unsigned register_host:1;
73 unsigned register_dev:1;
74 u8 otg; /* port number, 1-based: usb1 == 2 */
78 /* implicitly true if otg: host supports remote wakeup? */
81 /* signaling pins used to talk to transceiver on usbN:
83 * 2 == usb0-only, using internal transceiver
84 * 3 == 3 wire bidirectional
85 * 4 == 4 wire bidirectional
86 * 6 == 6 wire unidirectional (or TLL)
91 struct omap_lcd_config {
98 struct omap_fbmem_config {
103 struct omap_gpio_switch_config {
108 unsigned int key_code:24; /* Linux key code */
111 struct omap_uart_config {
112 /* Bit field of UARTs present; bit 0 --> UART1 */
113 unsigned int enabled_uarts;
116 struct omap_tea5761_config {
120 struct omap_partition_config {
124 /* same as in include/linux/mtd/partitions.h */
125 unsigned int mask_flags;
128 struct omap_flash_part_str_config {
132 struct omap_boot_reason_config {
136 struct omap_version_config {
142 * Code copied from maemo kernel 2.6.28 file
143 * arch/arm/plat-omap/include/mach/board-nokia.h
145 * Information structures for Nokia-specific board config data
147 * Copyright (C) 2005 Nokia Corporation
150 struct omap_bluetooth_config {
160 struct omap_wlan_cx3110x_config {
168 struct omap_cbus_config {
174 struct omap_em_asic_bb5_config {
182 * processing omap tag structures
184 * Copyright (C) 2011 marcel@mesa.nl, Mesa Consulting B.V.
185 * Copyright (C) 2012 Pali Rohár <pali.rohar@gmail.com>
188 /* TI OMAP specific information */
189 #define ATAG_BOARD 0x414f4d50
191 struct tag_omap_header {
197 struct tag_omap_header hdr;
199 struct omap_clock_config clock;
200 struct omap_serial_console_config serial_console;
201 struct omap_sti_console_config sti_console;
202 struct omap_usb_config usb;
203 struct omap_lcd_config lcd;
204 struct omap_fbmem_config fbmem;
205 struct omap_gpio_switch_config gpio_switch;
206 struct omap_uart_config uart;
207 struct omap_tea5761_config tea5761;
208 struct omap_partition_config partition;
209 struct omap_flash_part_str_config flash_part_str;
210 struct omap_boot_reason_config boot_reason;
211 struct omap_version_config version;
212 struct omap_bluetooth_config bluetooth;
213 struct omap_wlan_cx3110x_config wlan_cx3110x;
214 struct omap_cbus_config cbus;
215 struct omap_em_asic_bb5_config em_asic_bb5;
219 #define tag_omap_next(t) ((struct tag_omap *)((u8 *)(t) + \
220 (t)->hdr.size + sizeof(struct tag_omap_header)))
222 #define OMAP_TAG_HEADER_CONFIG(config, type) \
224 .hdr.size = sizeof(struct type)
226 #define OMAP_TAG_UART_CONFIG(p1) \
228 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_UART, omap_uart_config), \
229 .u.uart.enabled_uarts = p1, \
232 #define OMAP_TAG_SERIAL_CONSOLE_CONFIG(p1, p2) \
234 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_SERIAL_CONSOLE, \
235 omap_serial_console_config), \
236 .u.serial_console.console_uart = p1, \
237 .u.serial_console.console_speed = p2, \
240 #define OMAP_TAG_LCD_CONFIG(p1, p2, p3, p4) \
242 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_LCD, omap_lcd_config), \
243 .u.lcd.panel_name = p1, \
244 .u.lcd.ctrl_name = p2, \
245 .u.lcd.nreset_gpio = p3, \
246 .u.lcd.data_lines = p4, \
249 #define OMAP_TAG_GPIO_SWITCH_CONFIG(p1, p2, p3, p4, p5) \
251 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_GPIO_SWITCH, \
252 omap_gpio_switch_config), \
253 .u.gpio_switch.name = p1, \
254 .u.gpio_switch.gpio = p2, \
255 .u.gpio_switch.flags = p3, \
256 .u.gpio_switch.type = p4, \
257 .u.gpio_switch.key_code = p5, \
260 #define OMAP_TAG_WLAN_CX3110X_CONFIG(p1, p2, p3, p4, p5) \
262 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_WLAN_CX3110X, \
263 omap_wlan_cx3110x_config), \
264 .u.wlan_cx3110x.chip_type = p1, \
265 .u.wlan_cx3110x.reserverd = p2, \
266 .u.wlan_cx3110x.power_gpio = p3, \
267 .u.wlan_cx3110x.irq_gpio = p4, \
268 .u.wlan_cx3110x.spi_cs_gpio = p5, \
271 #define OMAP_TAG_PARTITION_CONFIG(p1, p2, p3, p4) \
273 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_PARTITION, \
274 omap_partition_config), \
275 .u.partition.name = p1, \
276 .u.partition.size = p2, \
277 .u.partition.offset = p3, \
278 .u.partition.mask_flags = p4, \
281 #define OMAP_TAG_BOOT_REASON_CONFIG(p1) \
283 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_BOOT_REASON, \
284 omap_boot_reason_config), \
285 .u.boot_reason.reason_str = p1, \
288 #define OMAP_TAG_VERSION_STR_CONFIG(p1, p2) \
290 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_VERSION_STR, \
291 omap_version_config), \
292 .u.version.component = p1, \
293 .u.version.version = p2, \