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 * See file CREDITS for list of people who contributed to this
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 * Code copied from maemo kernel 2.6.28 file
33 * arch/arm/plat-omap/include/mach/board.h
35 * Information structures for board-specific data
37 * Copyright (C) 2004 Nokia Corporation
38 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
41 /* Different peripheral ids */
42 #define OMAP_TAG_CLOCK 0x4f01
43 #define OMAP_TAG_SERIAL_CONSOLE 0x4f03
44 #define OMAP_TAG_USB 0x4f04
45 #define OMAP_TAG_LCD 0x4f05
46 #define OMAP_TAG_GPIO_SWITCH 0x4f06
47 #define OMAP_TAG_UART 0x4f07
48 #define OMAP_TAG_FBMEM 0x4f08
49 #define OMAP_TAG_STI_CONSOLE 0x4f09
50 #define OMAP_TAG_CAMERA_SENSOR 0x4f0a
51 #define OMAP_TAG_PARTITION 0x4f0b
52 #define OMAP_TAG_TEA5761 0x4f10
53 #define OMAP_TAG_TMP105 0x4f11
55 #define OMAP_TAG_BOOT_REASON 0x4f80
56 #define OMAP_TAG_FLASH_PART_STR 0x4f81
57 #define OMAP_TAG_VERSION_STR 0x4f82
59 #define OMAP_TAG_NOKIA_BT 0x4e01
60 #define OMAP_TAG_WLAN_CX3110X 0x4e02
61 #define OMAP_TAG_CBUS 0x4e03
62 #define OMAP_TAG_EM_ASIC_BB5 0x4e04
65 struct omap_clock_config {
66 /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
70 struct omap_serial_console_config {
75 struct omap_sti_console_config {
80 struct omap_usb_config {
81 /* Configure drivers according to the connectors on your board:
82 * - "A" connector (rectagular)
83 * ... for host/OHCI use, set "register_host".
84 * - "B" connector (squarish) or "Mini-B"
85 * ... for device/gadget use, set "register_dev".
86 * - "Mini-AB" connector (very similar to Mini-B)
87 * ... for OTG use as device OR host, initialize "otg"
89 unsigned register_host:1;
90 unsigned register_dev:1;
91 u8 otg; /* port number, 1-based: usb1 == 2 */
95 /* implicitly true if otg: host supports remote wakeup? */
98 /* signaling pins used to talk to transceiver on usbN:
100 * 2 == usb0-only, using internal transceiver
101 * 3 == 3 wire bidirectional
102 * 4 == 4 wire bidirectional
103 * 6 == 6 wire unidirectional (or TLL)
108 struct omap_lcd_config {
115 struct omap_fbmem_config {
120 struct omap_gpio_switch_config {
125 unsigned int key_code:24; /* Linux key code */
128 struct omap_uart_config {
129 /* Bit field of UARTs present; bit 0 --> UART1 */
130 unsigned int enabled_uarts;
133 struct omap_tea5761_config {
137 struct omap_partition_config {
141 /* same as in include/linux/mtd/partitions.h */
142 unsigned int mask_flags;
145 struct omap_flash_part_str_config {
149 struct omap_boot_reason_config {
153 struct omap_version_config {
159 * Code copied from maemo kernel 2.6.28 file
160 * arch/arm/plat-omap/include/mach/board-nokia.h
162 * Information structures for Nokia-specific board config data
164 * Copyright (C) 2005 Nokia Corporation
167 struct omap_bluetooth_config {
177 struct omap_wlan_cx3110x_config {
185 struct omap_cbus_config {
191 struct omap_em_asic_bb5_config {
199 * processing omap tag structures
201 * Copyright (C) 2011 marcel@mesa.nl, Mesa Consulting B.V.
202 * Copyright (C) 2012 Pali Rohár <pali.rohar@gmail.com>
205 /* TI OMAP specific information */
206 #define ATAG_BOARD 0x414f4d50
208 struct tag_omap_header {
214 struct tag_omap_header hdr;
216 struct omap_clock_config clock;
217 struct omap_serial_console_config serial_console;
218 struct omap_sti_console_config sti_console;
219 struct omap_usb_config usb;
220 struct omap_lcd_config lcd;
221 struct omap_fbmem_config fbmem;
222 struct omap_gpio_switch_config gpio_switch;
223 struct omap_uart_config uart;
224 struct omap_tea5761_config tea5761;
225 struct omap_partition_config partition;
226 struct omap_flash_part_str_config flash_part_str;
227 struct omap_boot_reason_config boot_reason;
228 struct omap_version_config version;
229 struct omap_bluetooth_config bluetooth;
230 struct omap_wlan_cx3110x_config wlan_cx3110x;
231 struct omap_cbus_config cbus;
232 struct omap_em_asic_bb5_config em_asic_bb5;
236 #define tag_omap_next(t) ((struct tag_omap *)((u8 *)(t) + \
237 (t)->hdr.size + sizeof(struct tag_omap_header)))
239 #define OMAP_TAG_HEADER_CONFIG(config, type) \
241 .hdr.size = sizeof(struct type)
243 #define OMAP_TAG_UART_CONFIG(p1) \
245 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_UART, omap_uart_config), \
246 .u.uart.enabled_uarts = p1, \
249 #define OMAP_TAG_SERIAL_CONSOLE_CONFIG(p1, p2) \
251 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_SERIAL_CONSOLE, \
252 omap_serial_console_config), \
253 .u.serial_console.console_uart = p1, \
254 .u.serial_console.console_speed = p2, \
257 #define OMAP_TAG_LCD_CONFIG(p1, p2, p3, p4) \
259 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_LCD, omap_lcd_config), \
260 .u.lcd.panel_name = p1, \
261 .u.lcd.ctrl_name = p2, \
262 .u.lcd.nreset_gpio = p3, \
263 .u.lcd.data_lines = p4, \
266 #define OMAP_TAG_GPIO_SWITCH_CONFIG(p1, p2, p3, p4, p5) \
268 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_GPIO_SWITCH, \
269 omap_gpio_switch_config), \
270 .u.gpio_switch.name = p1, \
271 .u.gpio_switch.gpio = p2, \
272 .u.gpio_switch.flags = p3, \
273 .u.gpio_switch.type = p4, \
274 .u.gpio_switch.key_code = p5, \
277 #define OMAP_TAG_WLAN_CX3110X_CONFIG(p1, p2, p3, p4, p5) \
279 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_WLAN_CX3110X, \
280 omap_wlan_cx3110x_config), \
281 .u.wlan_cx3110x.chip_type = p1, \
282 .u.wlan_cx3110x.reserverd = p2, \
283 .u.wlan_cx3110x.power_gpio = p3, \
284 .u.wlan_cx3110x.irq_gpio = p4, \
285 .u.wlan_cx3110x.spi_cs_gpio = p5, \
288 #define OMAP_TAG_PARTITION_CONFIG(p1, p2, p3, p4) \
290 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_PARTITION, \
291 omap_partition_config), \
292 .u.partition.name = p1, \
293 .u.partition.size = p2, \
294 .u.partition.offset = p3, \
295 .u.partition.mask_flags = p4, \
298 #define OMAP_TAG_BOOT_REASON_CONFIG(p1) \
300 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_BOOT_REASON, \
301 omap_boot_reason_config), \
302 .u.boot_reason.reason_str = p1, \
305 #define OMAP_TAG_VERSION_STR_CONFIG(p1, p2) \
307 OMAP_TAG_HEADER_CONFIG(OMAP_TAG_VERSION_STR, \
308 omap_version_config), \
309 .u.version.component = p1, \
310 .u.version.version = p2, \