1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
|
/*
* (C) Copyright 2014
* Paul Kocialkowski <contact@paulk.fr>
*
* Based on the OMAP3 Pandora code:
* (C) Copyright 2008
* Grazvydas Ignotas <notasas@gmail.com>
*
* Derived from Beagle Board, 3430 SDP, and OMAP3EVM code by
* Richard Woodruff <r-woodruff2@ti.com>
* Syed Mohammed Khasim <khasim@ti.com>
* Sunil Kumar <sunilsaini05@gmail.com>
* Shashi Ranjan <shashiranjanmca05@gmail.com>
*
* (C) Copyright 2004-2008
* Texas Instruments, <www.ti.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <config.h>
#include <common.h>
#ifdef CONFIG_SPL_BUILD
#include <spl.h>
#endif
#include <twl4030.h>
#include <lp8720.h>
#include <asm/io.h>
#include <asm/gpio.h>
#include <asm/arch/mmc_host_def.h>
#include <asm/arch/mux.h>
#include <asm/arch/mem.h>
#include <asm/arch/gpio.h>
#include <asm/arch/sys_proto.h>
#include <asm/arch/dss.h>
#include <asm/mach-types.h>
#include <asm/omap_musb.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb/musb.h>
#include "sniper.h"
DECLARE_GLOBAL_DATA_PTR;
const omap3_sysinfo sysinfo = {
DDR_STACKED,
"Sniper",
"MMC",
};
/*
* Cleanup rules: copyright headers, no useless descriptions, ifdef when not ||
*/
/*
* Routine: board_init
* Description: Early hardware init.
*/
int board_init(void)
{
gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
/* board id for Linux */
gd->bd->bi_arch_number = 3000;
/* boot param addr */
gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
return 0;
}
#if defined(CONFIG_SPL_BUILD)
#if 0
void board_init_f(ulong dummy)
{
unsigned char value;
/* Clear the BSS. */
memset(__bss_start, 0, __bss_end - __bss_start);
/* TODO: Remove settings of the global data pointer here */
gd = &gdata;
/* DP3T UART switch: OMAP enable, IFX disable */
gpio_request(SNIPER_GPIO_OMAP_UART_SW, "omap_uart_sw");
gpio_direction_output(SNIPER_GPIO_OMAP_UART_SW, 1);
gpio_request(SNIPER_GPIO_IFX_UART_SW, "ifx_uart_sw");
gpio_direction_output(SNIPER_GPIO_IFX_UART_SW, 0);
/* MAX14526 MUIC: mux to UART */
/* FIXME: proper functions for all this, shoudl detect ID resistor too */
/* TODO: don't forget to mux to USB if not to UART */
// i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
/*
i2c_set_bus_num(1);
value = 0x09;
i2c_write(0x44, 0x03, 1, &value, 1);
i2c_set_bus_num(0);
*/
board_init_r(NULL, 0);
}
#endif
/*
* Routine: get_board_mem_timings
* Description: If we use SPL then there is no x-loader nor config header
* so we have to setup the DDR timings ourself on both banks.
*/
void get_board_mem_timings(struct board_sdrc_timings *timings)
{
timings->mcfg = HYNIX_V_MCFG_200(256 << 20);
timings->ctrla = HYNIX_V_ACTIMA_200;
timings->ctrlb = HYNIX_V_ACTIMB_200;
timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
timings->mr = MICRON_V_MR_165;
}
#endif
#ifdef CONFIG_USB_MUSB_OMAP2PLUS
static struct musb_hdrc_config musb_config = {
.multipoint = 1,
.dyn_fifo = 1,
.num_eps = 16,
.ram_bits = 12,
};
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
};
static struct musb_hdrc_platform_data musb_plat = {
.mode = MUSB_PERIPHERAL,
.config = &musb_config,
.power = 100,
.platform_ops = &omap2430_ops,
.board_data = &musb_board_data,
};
#endif
#define LDO_AB_LEVEL_REG 0x24
#define LDO_CD_LEVEL_REG 0x25
#define LDO_ABCD_EN_REG 0x26
static int aat2862_write_reg(unsigned char addr, unsigned char data)
{
return i2c_write(0x60, (uint)addr, 1, &data, 1);
}
#if 0
/*
#define PANEL_TIMING_H(bp, fp, sw) (DSS_HBP(bp) | DSS_HFP(fp) | DSS_HSW(sw))
#define PANEL_TIMING_V(bp, fp, sw) (DSS_VBP(bp) | DSS_VFP(fp) | DSS_VSW(sw))
#define PANEL_LCD_SIZE(xres, yres) ((yres - 1) << 16 | (xres - 1))
*/
.pixel_clock = LCD_PIXEL_CLOCK,
.hfp = 1, //right_margin - 1
.hsw = 1, //hsync_len - 1
.hbp = 1, //left_margin - 1
.vfp = 0, //lower_margin
.vsw = 1, //vsync_len - 1
.vbp = 0, //upper_margin
/*
static int hub_acbi = 0;
static int hub_acb = 0;
static u32 hub_config = (OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |OMAP_DSS_LCD_IHS);
#define DSS_IVS (1 << 12)
#define DSS_IHS (1 << 13)
#define DSS_IPC (1 << 14)
#define DSS_IEO (1 << 15)
#define DSS_ONOFF (1 << 17)
l |= FLD_VAL(ihs, 13, 13);
l |= FLD_VAL(ivs, 12, 12);
l |= FLD_VAL(acbi, 11, 8);
l |= FLD_VAL(acb, 7, 0);
_dispc_set_pol_freq((config & OMAP_DSS_LCD_ONOFF) != 0,
(config & OMAP_DSS_LCD_RF) != 0,
(config & OMAP_DSS_LCD_IEO) != 0,
(config & OMAP_DSS_LCD_IPC) != 0,
(config & OMAP_DSS_LCD_IHS) != 0,
(config & OMAP_DSS_LCD_IVS) != 0,
acbi, acb);
dispc_write_reg(DISPC_DIVISOR,
FLD_VAL(lck_div, 23, 16) | FLD_VAL(pck_div, 7, 0)
dpi_set_dsi_clk -> dispc_set_lcd_divisor
(hub_dsi) dsi_pll_init −> dispc_set_clock_div -> dispc_set_lcd_divisor
r = dispc_calc_clock_div(1, 48 * 1000 * 1000, &cinfo);
*/
#endif
static struct panel_config lcd_cfg = {
.timing_h = PANEL_TIMING_H(1, 1, 1),
.timing_v = PANEL_TIMING_V(0, 0, 1),
.pol_freq = DSS_IVS | DSS_IHS, /* Pol Freq */
// .divisor = 0x0001000E,
.divisor = 0x10003,
// .divisor = 0x00010033, /* 9 Mhz Pixel Clock */ /* FIXME NOT FROM ANYWHERE */
.lcd_size = PANEL_LCD_SIZE(480, 800),
.panel_type = ACTIVE_DISPLAY, /* TFT */
.data_lines = LCD_INTERFACE_24_BIT, /* 24 Bit RGB */
.load_mode = 0x02, /* Frame Mode */
.panel_color = 0x00FF8000, // orange, why not?
.gfx_format = GFXFORMAT_RGB24_UNPACKED,
};
#if defined(CONFIG_VIDEO) && !defined(CONFIG_SPL_BUILD)
int board_video_init(void)
{
dispc_init();
dsi_init();
printf("Trying to contact AAT2870\n");
gpio_request(SNIPER_GPIO_LCD_CP_EN, "aat2870_en");
gpio_direction_output(SNIPER_GPIO_LCD_CP_EN, 0);
gpio_set_value(SNIPER_GPIO_LCD_CP_EN, 1);
gpio_request(SNIPER_GPIO_LCD_CS, "lcd_cs");
gpio_direction_output(SNIPER_GPIO_LCD_CS, 0);
gpio_set_value(SNIPER_GPIO_LCD_CS, 1);
gpio_request(SNIPER_GPIO_LCD_RESET_N, "lcd_reset_n");
gpio_direction_output(SNIPER_GPIO_LCD_RESET_N, 0);
printf("LCD reset\n");
gpio_set_value(SNIPER_GPIO_LCD_RESET_N, 0);
i2c_set_bus_num(1);
aat2862_write_reg(LDO_AB_LEVEL_REG,0x4A); /* LDOA 1.8V_LCD_IOVCC (1010), LDOB 3.0V_LCD_VCC_VCI (1100) */
aat2862_write_reg(LDO_CD_LEVEL_REG,0x4C); /* LDOC 1.8V_TOUCH_VDD (0100), LDOD 3.0V_TOUCH_VCPIN (1100) */
aat2862_write_reg(LDO_ABCD_EN_REG,0x3); /* LDO A & B ON */
i2c_set_bus_num(0);
mdelay(50);
gpio_set_value(SNIPER_GPIO_LCD_RESET_N, 1);
mdelay(10);
/*
u8 data = 0;
hub_panel_dcs_read_1(0x0a, &data);
-> dsi_vc_dcs_read(TCH, dcs_cmd, buf, 1); // TCH = 0
if (data == 0x94)
{
return 1;
}
*/
// Send commands here
//SNIPER_GPIO_LCD_RESET_N
// lcd_cfg.frame_buffer = (void *)0x880000000;
// CONFIG_VIDEO_OMAP3
/*
omap3_dss_panel_config(&lcd_cfg);
omap3_dss_enable();
printf("DSS enable over\n");
*/
printf("AAT2862 backlight enable\n");
i2c_set_bus_num(1);
aat2862_write_reg(0x0,0xff); /* LCD channel enable */
aat2862_write_reg(0x03,0xF4); /* LED main group, LED enabled, 22.26 */
aat2862_write_reg(0x04,0x74); /* LED main group, LED enabled, 22.26 */
aat2862_write_reg(0x05,0x74); /* LED main group, LED enabled, 30 */
aat2862_write_reg(0x06,0x74); /* LED main group, LED enabled, 30 */
i2c_set_bus_num(0);
return 0;
}
#endif
void hub_load_rle565_image(unsigned char* src, unsigned int* dest, int len)
{
unsigned short* src_ptr = (unsigned short*)src;
unsigned int* dest_ptr = dest;
unsigned short size;
unsigned short value;
int length = len;
unsigned char red, green, blue;
while (length > 0) {
size = *src_ptr;
src_ptr++;
value = *src_ptr;
src_ptr++;
while(size--) {
red = ((value >> 11) & 0xFF) << 3;
green = ((value >> 5) & 0xFF) << 2;
blue = (value & 0xFF) << 3;
*dest_ptr = (0xFF << 24) | (red << 16) | (green << 8) | blue;
dest_ptr++;
length --;
}
}
}
extern unsigned int lg_boot_logo[];
extern unsigned int peace[];
#define CONFIG_FB_ADDRESS 0x9FA00000
struct led_ctrl_data {
unsigned char reg;
unsigned char val;
};
#define I2C_NO_REG 0xFF
#define BD2802_REG_CLKSETUP 0x00
#define BD2802_REG_CONTROL 0x01
#define BD2802_REG1_HOURSETUP 0x02
#define BD2802_R1_CURRENT1SETUP 0x03
#define BD2802_R1_CURRENT2SETUP 0x04
#define BD2802_R1_WAVEPATTERN 0x05
#define BD2802_G1_CURRENT1SETUP 0x06
#define BD2802_G1_CURRENT2SETUP 0x07
#define BD2802_G1_WAVEPATTERN 0x08
#define BD2802_B1_CURRENT1SETUP 0x09
#define BD2802_B1_CURRENT2SETUP 0x0A
#define BD2802_B1_WAVEPATTERN 0x0B
#define BD2802_REG2_HOURSETUP 0x0C
#define BD2802_R2_CURRENT1SETUP 0x0D
#define BD2802_R2_CURRENT2SETUP 0x0E
#define BD2802_R2_WAVEPATTERN 0x0F
#define BD2802_G2_CURRENT1SETUP 0x10
#define BD2802_G2_CURRENT2SETUP 0x11
#define BD2802_G2_WAVEPATTERN 0x12
#define BD2802_B2_CURRENT1SETUP 0x13
#define BD2802_B2_CURRENT2SETUP 0x14
#define BD2802_B2_WAVEPATTERN 0x15
#define BD2812_DCDCDRIVER 0x40
#define BD2812_PIN_FUNC_SETUP 0x41
static struct led_ctrl_data pwron_on_seq_bd2812[]=
{
{BD2802_REG_CLKSETUP,0x00},
{BD2802_REG_CONTROL,0x11},
{BD2802_REG1_HOURSETUP,0xF3},
{BD2802_REG2_HOURSETUP,0xF3},
{BD2802_R1_CURRENT1SETUP,0x32},
{BD2802_R1_CURRENT2SETUP,0x32},
{BD2802_G1_CURRENT1SETUP,0x32},
{BD2802_G1_CURRENT2SETUP,0x32},
{BD2802_B1_CURRENT1SETUP,0x00},
{BD2802_B1_CURRENT2SETUP,0x00},
{BD2802_R2_CURRENT1SETUP,0x32},
{BD2802_R2_CURRENT2SETUP,0x32},
{BD2802_G2_CURRENT1SETUP,0x32},
{BD2802_G2_CURRENT2SETUP,0x32},
{BD2802_B2_CURRENT1SETUP,0x00},
{BD2802_B2_CURRENT2SETUP,0x00},
{BD2812_DCDCDRIVER,0x00},
{BD2812_PIN_FUNC_SETUP,0x0F},
{I2C_NO_REG, 0x00} /* End of array */
};
int bd2812_setup(void)
{
int i;
gpio_request(SNIPER_GPIO_KEY_LED_RESET, "key_led_reset");
gpio_direction_output(SNIPER_GPIO_KEY_LED_RESET, 0);
gpio_set_value(SNIPER_GPIO_KEY_LED_RESET, 1);
udelay(150);
gpio_set_value(SNIPER_GPIO_KEY_LED_RESET, 0);
udelay(150);
gpio_set_value(SNIPER_GPIO_KEY_LED_RESET, 1);
udelay(150);
i2c_set_bus_num(1);
for (i = 0; pwron_on_seq_bd2812[i].reg != I2C_NO_REG; i++) {
i2c_write(0x1A, pwron_on_seq_bd2812[i].reg, 1, &pwron_on_seq_bd2812[i].val, 1);
udelay(10); //to be fixed
}
i2c_set_bus_num(0);
}
void video_init(void)
{
printf("VIDEO INIT BEGIN\n");
/* VIDEO INIT HERE */
printf("AAT2862 backlight enable\n");
gpio_request(SNIPER_GPIO_LCD_CP_EN, "aat2870_en");
gpio_direction_output(SNIPER_GPIO_LCD_CP_EN, 0);
gpio_set_value(SNIPER_GPIO_LCD_CP_EN, 1);
gpio_request(SNIPER_GPIO_LCD_CS, "lcd_cs");
gpio_direction_output(SNIPER_GPIO_LCD_CS, 0);
gpio_request(SNIPER_GPIO_LCD_RESET_N, "lcd_reset_n");
gpio_direction_output(SNIPER_GPIO_LCD_RESET_N, 0);
i2c_set_bus_num(1);
aat2862_write_reg(LDO_AB_LEVEL_REG,0x4A); /* LDOA 1.8V_LCD_IOVCC (1010), LDOB 3.0V_LCD_VCC_VCI (1100) */
aat2862_write_reg(LDO_CD_LEVEL_REG,0x4C); /* LDOC 1.8V_TOUCH_VDD (0100), LDOD 3.0V_TOUCH_VCPIN (1100) */
aat2862_write_reg(LDO_ABCD_EN_REG,0x3); /* LDO A & B ON */
i2c_set_bus_num(0);
dispc_init();
dsi_init();
printf("LCD reset\n");
gpio_set_value(SNIPER_GPIO_LCD_CS, 1);
gpio_set_value(SNIPER_GPIO_LCD_RESET_N, 0);
mdelay(50);
gpio_set_value(SNIPER_GPIO_LCD_RESET_N, 1);
mdelay(10);
hub_panel_init_lcd();
dispc_configure_image(NULL); // use fbaddress
hub_load_rle565_image(peace, CONFIG_FB_ADDRESS, 480*800);
dsi_update_screen_dispc(0,0,480,800);
i2c_set_bus_num(1);
aat2862_write_reg(0x0,0xff); /* LCD channel enable */
aat2862_write_reg(0x03,0xF4); /* LED main group, LED enabled, 22.26 */
aat2862_write_reg(0x04,0x74); /* LED main group, LED enabled, 22.26 */
aat2862_write_reg(0x05,0x74); /* LED main group, LED enabled, 30 */
aat2862_write_reg(0x06,0x74); /* LED main group, LED enabled, 30 */
i2c_set_bus_num(0);
mdelay(2000);
_dsi_reset();
_omap_dss_reset();
dispc_control_show();
printf("VIDEO INIT END\n");
}
/*
* Routine: misc_init_r
* Description: Configure board specific parts
*/
int misc_init_r(void)
{
setenv("serial#", "p970-replicant");
g_dnl_set_serialnumber("p970-replicant");
#ifdef CONFIG_USB_MUSB_OMAP2PLUS
musb_register(&musb_plat, &musb_board_data, (void *)MUSB_BASE);
#endif
u8 val;
int rev;
/* Turn on MADC clocks */
twl4030_i2c_read_u8(TWL4030_CHIP_INTBR, TWL4030_BASEADD_INTBR + 0x0c, &val);
val |= 0x80 | 0x10;
twl4030_i2c_write_u8(TWL4030_CHIP_INTBR, TWL4030_BASEADD_INTBR + 0x0c, val);
/* Turn MADC on */
twl4030_i2c_write_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC, 0x01);
/* Channel 9 SW1 trigger */
twl4030_i2c_read_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC + 0x07, &val);
val |= 0x02;
twl4030_i2c_write_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC + 0x07, val);
/* Channel 5 SW1 trigger */
twl4030_i2c_read_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC + 0x06, &val);
val |= 0x20;
twl4030_i2c_write_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC + 0x06, val);
/* Channel 2 SW1 trigger */
twl4030_i2c_read_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC + 0x06, &val);
val |= 0x04;
twl4030_i2c_write_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC + 0x06, val);
/* SW1 trigger */
twl4030_i2c_read_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC + 0x12, &val);
val |= 0x20;
twl4030_i2c_write_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC + 0x12, val);
printf("About to convert!\n");
// FIXME: timeout
do {
twl4030_i2c_read_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC + 0x12, &val);
printf("val is 0x%x\n", val);
} while ((val & 0x02 == 0) || (val & 0x01));
/* Read da result on chan 5*/
twl4030_i2c_read_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC + 0x37 + 5 * 2 + 1, &val);
rev = ((int) val) << 2;
twl4030_i2c_read_u8(TWL4030_CHIP_MADC, TWL4030_BASEADD_MADC + 0x37 + 5 * 2, &val);
rev |= ((int) (val & 0xC0)) >> 6;
printf("So apparently, rev is like %d\n", rev);
/*
for dss, look at LCD_RESET_N:
omap_set_gpio_direction(HUB_PANEL_LCD_RESET_N, 0);
mdelay(2);
omap_set_gpio_dataout(HUB_PANEL_LCD_RESET_N, 0);
aat2862_ldo_enabled(1);
mdelay(50);
omap_set_gpio_dataout(HUB_PANEL_LCD_RESET_N, 1);
mdelay(10);
*/
video_init();
bd2812_setup();
return 0;
}
u32 get_board_rev(void)
{
return 10;
}
/*
* Routine: set_muxconf_regs
* Description: Setting up the configuration Mux registers specific to the
* hardware. Many pins need to be moved from protect to primary
* mode.
*/
void set_muxconf_regs(void)
{
MUX_SNIPER();
}
#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
int board_mmc_init(bd_t *bis)
{
int ret;
ret = omap_mmc_init(0, 0, 0, -1, -1);
if (ret)
return ret;
ret = omap_mmc_init(1, 0, 0, SNIPER_GPIO_MICROSD_DET_N, -1);
if (ret)
return ret;
return 0;
}
#endif
#if defined(CONFIG_GENERIC_MMC)
void board_mmc_power_init(void)
{
/*
* In order to boot from MMC1 (microsd card), the LP8720 LDO1 (3.0V_MMC)
* regulator has to be enabled. The LP8720 is accessed through I2C3.
*
* Enabling TWL4030 VAUX2 (3.0V_MOTION) and TWL4030 VDAC
* (1.8V_MOTION_VIO) is required to power the sensors that are slaves
* on I2C3. When not powered, these sensors cause I2C3 SCK to stay low.
*/
i2c_set_bus_num(0);
/* TWL4030 VAUX2 (3.0V_MOTION) to 2.8V */
twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
TWL4030_PM_RECEIVER_VAUX2_VSEL_28,
TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
/* TWL4030 VDAC (1.8V_MOTION_VIO) to 1.8V */
twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VDAC_DEDICATED,
TWL4030_PM_RECEIVER_VDAC_VSEL_18,
TWL4030_PM_RECEIVER_VDAC_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
mdelay(100); /* ramp-up delay from Linux code */
i2c_set_bus_num(2);
lp8720_init(SNIPER_GPIO_CAM_SUBPM_EN, LP8720_CHIP_IDSEL_GND);
/* LP8720 LDO1 (3.0V_MMC) to 3.0V */
lp8720_ldo_voltage(LP8720_LDO1_SETTINGS, LP8720_LDO1235_V_30,
LP8720_DELAY_0);
lp8720_ldo_enable(LP8720_LDO1_EN);
i2c_set_bus_num(0);
/* TWL4030 VMMC2 to 3.2V */
twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VMMC2_DEDICATED,
TWL4030_PM_RECEIVER_VMMC2_VSEL_32,
TWL4030_PM_RECEIVER_VMMC2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
mdelay(100); /* ramp-up delay from Linux code */
}
#endif
#if defined(CONFIG_USB_ETHER) && defined(CONFIG_MUSB_GADGET)
int board_eth_init(bd_t *bis)
{
return usb_eth_initialize(bis);
}
#endif
|