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#include <common.h>
31#include <mpc5xxx.h>
32#include <pci.h>
33#include <asm/processor.h>
34#include <libfdt.h>
35#include <netdev.h>
36
37#ifdef CONFIG_VIDEO_SM501
38#include <sm501.h>
39#endif
40
41#if defined(CONFIG_MPC5200_DDR)
42#include "mt46v16m16-75.h"
43#else
44#include "mt48lc16m16a2-75.h"
45#endif
46
47#ifdef CONFIG_OF_LIBFDT
48#include <fdt_support.h>
49#endif
50
51DECLARE_GLOBAL_DATA_PTR;
52
53#ifdef CONFIG_PS2MULT
54void ps2mult_early_init(void);
55#endif
56
57#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) && \
58 defined(CONFIG_VIDEO)
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79static unsigned char edid_buf[128] = {
80 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
81 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
82 0x01, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00,
83 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
84 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x01, 0x01,
85 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
86 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x64, 0x00,
87 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
88 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
89 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
90 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
91 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
92 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
93 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
94 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
95 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17,
96};
97#endif
98
99#ifndef CONFIG_SYS_RAMBOOT
100static void sdram_start (int hi_addr)
101{
102 long hi_addr_bit = hi_addr ? 0x01000000 : 0;
103
104
105 *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 |
106 hi_addr_bit;
107 __asm__ volatile ("sync");
108
109
110 *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 |
111 hi_addr_bit;
112 __asm__ volatile ("sync");
113
114#if SDRAM_DDR
115
116 *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_EMODE;
117 __asm__ volatile ("sync");
118
119
120 *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE | 0x04000000;
121 __asm__ volatile ("sync");
122#endif
123
124
125 *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 |
126 hi_addr_bit;
127 __asm__ volatile ("sync");
128
129
130 *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 |
131 hi_addr_bit;
132 __asm__ volatile ("sync");
133
134
135 *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE;
136 __asm__ volatile ("sync");
137
138
139 *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_addr_bit;
140 __asm__ volatile ("sync");
141}
142#endif
143
144
145
146
147
148
149
150phys_size_t initdram (int board_type)
151{
152 ulong dramsize = 0;
153 ulong dramsize2 = 0;
154 uint svr, pvr;
155
156#ifndef CONFIG_SYS_RAMBOOT
157 ulong test1, test2;
158
159
160 *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001c;
161 *(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x40000000;
162 __asm__ volatile ("sync");
163
164
165 *(vu_long *)MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1;
166 *(vu_long *)MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2;
167 __asm__ volatile ("sync");
168
169#if SDRAM_DDR
170
171 *(vu_long *)MPC5XXX_CDM_PORCFG = SDRAM_TAPDELAY;
172 __asm__ volatile ("sync");
173#endif
174
175
176 sdram_start(0);
177 test1 = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, 0x20000000);
178 sdram_start(1);
179 test2 = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, 0x20000000);
180 if (test1 > test2) {
181 sdram_start(0);
182 dramsize = test1;
183 } else {
184 dramsize = test2;
185 }
186
187
188 if (dramsize < (1 << 20)) {
189 dramsize = 0;
190 }
191
192
193 if (dramsize > 0) {
194 *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 +
195 __builtin_ffs(dramsize >> 20) - 1;
196 } else {
197 *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0;
198 }
199
200
201 *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize + 0x0000001c;
202
203
204 if (!dramsize)
205 sdram_start(0);
206 test2 = test1 = get_ram_size((long *)(CONFIG_SYS_SDRAM_BASE + dramsize), 0x20000000);
207 if (!dramsize) {
208 sdram_start(1);
209 test2 = get_ram_size((long *)(CONFIG_SYS_SDRAM_BASE + dramsize), 0x20000000);
210 }
211 if (test1 > test2) {
212 sdram_start(0);
213 dramsize2 = test1;
214 } else {
215 dramsize2 = test2;
216 }
217
218
219 if (dramsize2 < (1 << 20)) {
220 dramsize2 = 0;
221 }
222
223
224 if (dramsize2 > 0) {
225 *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize
226 | (0x13 + __builtin_ffs(dramsize2 >> 20) - 1);
227 } else {
228 *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize;
229 }
230
231#else
232
233
234 dramsize = *(vu_long *)MPC5XXX_SDRAM_CS0CFG & 0xFF;
235 if (dramsize >= 0x13) {
236 dramsize = (1 << (dramsize - 0x13)) << 20;
237 } else {
238 dramsize = 0;
239 }
240
241
242 dramsize2 = *(vu_long *)MPC5XXX_SDRAM_CS1CFG & 0xFF;
243 if (dramsize2 >= 0x13) {
244 dramsize2 = (1 << (dramsize2 - 0x13)) << 20;
245 } else {
246 dramsize2 = 0;
247 }
248#endif
249
250
251
252
253
254
255
256
257
258
259 svr = get_svr();
260 pvr = get_pvr();
261 if ((SVR_MJREV(svr) >= 2) &&
262 (PVR_MAJ(pvr) == 1) && (PVR_MIN(pvr) == 4)) {
263
264 *(vu_long *)MPC5XXX_SDRAM_SDELAY = 0x04;
265 __asm__ volatile ("sync");
266 }
267
268#if defined(CONFIG_TQM5200_B)
269 return dramsize + dramsize2;
270#else
271 return dramsize;
272#endif
273}
274
275int checkboard (void)
276{
277#if defined(CONFIG_AEVFIFO)
278 puts ("Board: AEVFIFO\n");
279 return 0;
280#endif
281
282#if defined(CONFIG_TQM5200S)
283# define MODULE_NAME "TQM5200S"
284#else
285# define MODULE_NAME "TQM5200"
286#endif
287
288#if defined(CONFIG_STK52XX)
289# define CARRIER_NAME "STK52xx"
290#elif defined(CONFIG_TB5200)
291# define CARRIER_NAME "TB5200"
292#elif defined(CONFIG_CAM5200)
293# define CARRIER_NAME "CAM5200"
294#elif defined(CONFIG_FO300)
295# define CARRIER_NAME "FO300"
296#elif defined(CONFIG_CHARON)
297# define CARRIER_NAME "CHARON"
298#else
299# error "UNKNOWN"
300#endif
301
302 puts ( "Board: " MODULE_NAME " (TQ-Components GmbH)\n"
303 " on a " CARRIER_NAME " carrier board\n");
304
305 return 0;
306}
307
308#undef MODULE_NAME
309#undef CARRIER_NAME
310
311void flash_preinit(void)
312{
313
314
315
316
317
318
319 *(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1;
320}
321
322
323#ifdef CONFIG_PCI
324static struct pci_controller hose;
325
326extern void pci_mpc5xxx_init(struct pci_controller *);
327
328void pci_init_board(void)
329{
330 pci_mpc5xxx_init(&hose);
331}
332#endif
333
334#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_RESET)
335
336#if defined (CONFIG_MINIFAP)
337#define SM501_POWER_MODE0_GATE 0x00000040UL
338#define SM501_POWER_MODE1_GATE 0x00000048UL
339#define POWER_MODE_GATE_GPIO_PWM_I2C 0x00000040UL
340#define SM501_GPIO_DATA_DIR_HIGH 0x0001000CUL
341#define SM501_GPIO_DATA_HIGH 0x00010004UL
342#define SM501_GPIO_51 0x00080000UL
343#endif
344
345void init_ide_reset (void)
346{
347 debug ("init_ide_reset\n");
348
349#if defined (CONFIG_MINIFAP)
350
351
352
353 *(vu_long *) (SM501_MMIO_BASE+SM501_POWER_MODE0_GATE) |=
354 POWER_MODE_GATE_GPIO_PWM_I2C;
355 *(vu_long *) (SM501_MMIO_BASE+SM501_POWER_MODE1_GATE) |=
356 POWER_MODE_GATE_GPIO_PWM_I2C;
357
358 *(vu_long *) (SM501_MMIO_BASE+SM501_GPIO_DATA_DIR_HIGH) |=
359 SM501_GPIO_51;
360#else
361
362 *(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
363 *(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_PSC1_4;
364
365
366 *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_PSC1_4;
367#endif
368}
369
370void ide_set_reset (int idereset)
371{
372 debug ("ide_reset(%d)\n", idereset);
373
374#if defined (CONFIG_MINIFAP)
375 if (idereset) {
376 *(vu_long *) (SM501_MMIO_BASE+SM501_GPIO_DATA_HIGH) &=
377 ~SM501_GPIO_51;
378 } else {
379 *(vu_long *) (SM501_MMIO_BASE+SM501_GPIO_DATA_HIGH) |=
380 SM501_GPIO_51;
381 }
382#else
383 if (idereset) {
384 *(vu_long *) MPC5XXX_WU_GPIO_DATA_O &= ~GPIO_PSC1_4;
385 } else {
386 *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_PSC1_4;
387 }
388#endif
389}
390#endif
391
392#ifdef CONFIG_POST
393
394
395
396
397int post_hotkeys_pressed(void)
398{
399#ifdef CONFIG_STK52XX
400 struct mpc5xxx_gpio *gpio;
401
402 gpio = (struct mpc5xxx_gpio*) MPC5XXX_GPIO;
403
404
405
406
407 gpio->port_config &= ~(0x00700000);
408
409
410 gpio->simple_gpioe |= 0x20000000;
411
412
413 gpio->simple_ddr &= ~(0x20000000);
414
415 return ((gpio->simple_ival & 0x20000000) ? 0 : 1);
416#else
417 return 0;
418#endif
419}
420#endif
421
422#ifdef CONFIG_BOARD_EARLY_INIT_R
423int board_early_init_r (void)
424{
425
426 extern int usb_cpu_init(void);
427
428#ifdef CONFIG_PS2MULT
429 ps2mult_early_init();
430#endif
431
432#if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT)
433
434 usb_cpu_init();
435#endif
436
437 return (0);
438}
439#endif
440
441#ifdef CONFIG_FO300
442int silent_boot (void)
443{
444 vu_long timer3_status;
445
446
447 *(vu_long *)MPC5XXX_GPT3_ENABLE = 0x00000004;
448
449
450 timer3_status = *(vu_long *)MPC5XXX_GPT3_STATUS;
451
452#ifdef FO300_SILENT_CONSOLE_WHEN_S1_CLOSED
453
454
455 if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 0)
456 return 1;
457#else
458
459
460 if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 1)
461 return 1;
462#endif
463
464 return 0;
465}
466
467int board_early_init_f (void)
468{
469 if (silent_boot())
470 gd->flags |= GD_FLG_SILENT;
471
472 return 0;
473}
474#endif
475
476#if defined(CONFIG_CHARON)
477#include <i2c.h>
478#include <asm/io.h>
479
480
481#define TFP410_REG_VEN_ID_L 0x00
482#define TFP410_REG_VEN_ID_H 0x01
483#define TFP410_REG_DEV_ID_L 0x02
484#define TFP410_REG_DEV_ID_H 0x03
485#define TFP410_REG_REV_ID 0x04
486
487#define TFP410_REG_CTL_1_MODE 0x08
488#define TFP410_REG_CTL_2_MODE 0x09
489#define TFP410_REG_CTL_3_MODE 0x0A
490
491#define TFP410_REG_CFG 0x0B
492
493#define TFP410_REG_DE_DLY 0x32
494#define TFP410_REG_DE_CTL 0x33
495#define TFP410_REG_DE_TOP 0x34
496#define TFP410_REG_DE_CNT_L 0x36
497#define TFP410_REG_DE_CNT_H 0x37
498#define TFP410_REG_DE_LIN_L 0x38
499#define TFP410_REG_DE_LIN_H 0x39
500
501#define TFP410_REG_H_RES_L 0x3A
502#define TFP410_REG_H_RES_H 0x3B
503#define TFP410_REG_V_RES_L 0x3C
504#define TFP410_REG_V_RES_H 0x3D
505
506static int tfp410_read_reg(int reg, uchar *buf)
507{
508 if (i2c_read(CONFIG_SYS_TFP410_ADDR, reg, 1, buf, 1) != 0) {
509 puts ("Error reading the chip.\n");
510 return 1;
511 }
512 return 0;
513}
514
515static int tfp410_write_reg(int reg, uchar buf)
516{
517 if (i2c_write(CONFIG_SYS_TFP410_ADDR, reg, 1, &buf, 1) != 0) {
518 puts ("Error writing the chip.\n");
519 return 1;
520 }
521 return 0;
522}
523
524typedef struct _tfp410_config {
525 int reg;
526 uchar val;
527}TFP410_CONFIG;
528
529static TFP410_CONFIG tfp410_configtbl[] = {
530 {TFP410_REG_CTL_1_MODE, 0x37},
531 {TFP410_REG_CTL_2_MODE, 0x20},
532 {TFP410_REG_CTL_3_MODE, 0x80},
533 {TFP410_REG_DE_DLY, 0x90},
534 {TFP410_REG_DE_CTL, 0x00},
535 {TFP410_REG_DE_TOP, 0x23},
536 {TFP410_REG_DE_CNT_H, 0x02},
537 {TFP410_REG_DE_CNT_L, 0x80},
538 {TFP410_REG_DE_LIN_H, 0x01},
539 {TFP410_REG_DE_LIN_L, 0xe0},
540 {-1, 0},
541};
542
543static int charon_last_stage_init(void)
544{
545 volatile struct mpc5xxx_lpb *lpb =
546 (struct mpc5xxx_lpb *) MPC5XXX_LPB;
547 int oldbus = i2c_get_bus_num();
548 uchar buf;
549 int i = 0;
550
551 i2c_set_bus_num(CONFIG_SYS_TFP410_BUS);
552
553
554 if (tfp410_read_reg(TFP410_REG_DEV_ID_H, &buf) != 0)
555 return -1;
556 if (!(buf & 0x04))
557 return -1;
558 if (tfp410_read_reg(TFP410_REG_DEV_ID_L, &buf) != 0)
559 return -1;
560 if (!(buf & 0x10))
561 return -1;
562
563 while (tfp410_configtbl[i].reg != -1) {
564 int ret;
565
566 ret = tfp410_write_reg(tfp410_configtbl[i].reg,
567 tfp410_configtbl[i].val);
568 if (ret != 0)
569 return -1;
570 i++;
571 }
572 printf("TFP410 initialized.\n");
573 i2c_set_bus_num(oldbus);
574
575
576 setbits_be32(&lpb->cs_deadcycle, 0xffffcfff);
577 return 0;
578}
579#endif
580
581int last_stage_init (void)
582{
583
584
585
586
587 u16 save, tmp;
588 int restore;
589
590
591
592
593
594
595 save = *(volatile u16 *)CONFIG_SYS_CS2_START;
596 restore = 1;
597
598
599 *(volatile u16 *)CONFIG_SYS_CS2_START = 0xA5A5;
600 __asm__ volatile ("sync");
601
602
603
604
605 tmp = *(volatile u16 *)CONFIG_SYS_FLASH_BASE;
606 if (tmp == 0xA5A5)
607 puts ("!! possible error in SRAM detection\n");
608
609 if (*(volatile u16 *)CONFIG_SYS_CS2_START != 0xA5A5) {
610
611 *(vu_long *)MPC5XXX_ADDECR &= ~(1 << 18);
612 *(vu_long *)MPC5XXX_CS2_START = 0x0000FFFF;
613 *(vu_long *)MPC5XXX_CS2_STOP = 0x0000FFFF;
614 restore = 0;
615 __asm__ volatile ("sync");
616 } else if (*(volatile u16 *)(CONFIG_SYS_CS2_START + (1<<19)) == 0xA5A5) {
617
618 *(volatile u16 *)CONFIG_SYS_CS2_START = 0x1111;
619 __asm__ volatile ("sync");
620 if (*(volatile u16 *)(CONFIG_SYS_CS2_START + (1<<19)) == 0x1111) {
621
622 *(vu_long *)MPC5XXX_CS2_STOP = STOP_REG(CONFIG_SYS_CS2_START,
623 0x80000);
624 __asm__ volatile ("sync");
625 puts ("SRAM: 512 kB\n");
626 }
627 else
628 puts ("!! possible error in SRAM detection\n");
629 } else {
630 puts ("SRAM: 1 MB\n");
631 }
632
633 if (restore) {
634 *(volatile u16 *)CONFIG_SYS_CS2_START = save;
635 __asm__ volatile ("sync");
636 }
637
638#ifndef CONFIG_TQM5200S
639
640
641
642
643
644 save = *(volatile u16 *)CONFIG_SYS_CS1_START;
645 restore = 1;
646
647
648 *(volatile u16 *)CONFIG_SYS_CS1_START = 0xA5A5;
649 __asm__ volatile ("sync");
650
651
652
653
654 tmp = *(volatile u16 *)CONFIG_SYS_FLASH_BASE;
655 if (tmp == 0xA5A5)
656 puts ("!! possible error in grafic controller detection\n");
657
658 if (*(volatile u16 *)CONFIG_SYS_CS1_START != 0xA5A5) {
659
660 *(vu_long *)MPC5XXX_ADDECR &= ~(1 << 17);
661 *(vu_long *)MPC5XXX_CS1_START = 0x0000FFFF;
662 *(vu_long *)MPC5XXX_CS1_STOP = 0x0000FFFF;
663 restore = 0;
664 __asm__ volatile ("sync");
665 } else {
666 puts ("VGA: SMI501 (Voyager) with 8 MB\n");
667 }
668
669 if (restore) {
670 *(volatile u16 *)CONFIG_SYS_CS1_START = save;
671 __asm__ volatile ("sync");
672 }
673
674#ifdef CONFIG_FO300
675 if (silent_boot()) {
676 setenv("bootdelay", "0");
677 disable_ctrlc(1);
678 }
679#endif
680#endif
681
682#if defined(CONFIG_CHARON)
683 charon_last_stage_init();
684#endif
685 return 0;
686}
687
688#ifdef CONFIG_VIDEO_SM501
689
690#ifdef CONFIG_FO300
691#define DISPLAY_WIDTH 800
692#else
693#define DISPLAY_WIDTH 640
694#endif
695#define DISPLAY_HEIGHT 480
696
697#ifdef CONFIG_VIDEO_SM501_8BPP
698#error CONFIG_VIDEO_SM501_8BPP not supported.
699#endif
700
701#ifdef CONFIG_VIDEO_SM501_16BPP
702#error CONFIG_VIDEO_SM501_16BPP not supported.
703#endif
704#ifdef CONFIG_VIDEO_SM501_32BPP
705static const SMI_REGS init_regs [] =
706{
707#if 0
708 {0x00004, 0x0},
709 {0x00048, 0x00021807},
710 {0x0004C, 0x10090a01},
711 {0x00054, 0x1},
712 {0x00040, 0x00021807},
713 {0x00044, 0x10090a01},
714 {0x00054, 0x0},
715 {0x80200, 0x00010000},
716 {0x80204, 0x0},
717 {0x80208, 0x0A000A00},
718 {0x8020C, 0x02fa027f},
719 {0x80210, 0x004a028b},
720 {0x80214, 0x020c01df},
721 {0x80218, 0x000201e9},
722 {0x80200, 0x00013306},
723#else
724#ifdef CONFIG_FO300
725 {0x00004, 0x0},
726 {0x00048, 0x00021807},
727 {0x0004C, 0x301a0a01},
728 {0x00054, 0x1},
729 {0x00040, 0x00021807},
730 {0x00044, 0x091a0a01},
731 {0x00054, 0x0},
732 {0x80000, 0x0f013106},
733 {0x80004, 0xc428bb17},
734 {0x8000C, 0x00000000},
735 {0x80010, 0x0C800C80},
736 {0x80014, 0x03200000},
737 {0x80018, 0x01e00000},
738 {0x8001C, 0x00000000},
739 {0x80020, 0x01e00320},
740 {0x80024, 0x042a031f},
741 {0x80028, 0x0086034a},
742 {0x8002C, 0x020c01df},
743 {0x80030, 0x000201ea},
744 {0x80200, 0x00010000},
745#else
746 {0x00004, 0x0},
747 {0x00048, 0x00021807},
748 {0x0004C, 0x091a0a01},
749 {0x00054, 0x1},
750 {0x00040, 0x00021807},
751 {0x00044, 0x091a0a01},
752 {0x00054, 0x0},
753 {0x80000, 0x0f013106},
754 {0x80004, 0xc428bb17},
755 {0x8000C, 0x00000000},
756 {0x80010, 0x0a000a00},
757 {0x80014, 0x02800000},
758 {0x80018, 0x01e00000},
759 {0x8001C, 0x00000000},
760 {0x80020, 0x01e00280},
761 {0x80024, 0x02fa027f},
762 {0x80028, 0x004a028b},
763 {0x8002C, 0x020c01df},
764 {0x80030, 0x000201e9},
765 {0x80200, 0x00010000},
766#endif
767#endif
768 {0, 0}
769};
770#endif
771
772#ifdef CONFIG_CONSOLE_EXTRA_INFO
773
774
775
776void video_get_info_str (int line_number, char *info)
777{
778 if (line_number == 1) {
779 strcpy (info, " Board: TQM5200 (TQ-Components GmbH)");
780#if defined (CONFIG_CHARON) || defined (CONFIG_FO300) || \
781 defined(CONFIG_STK52XX) || defined(CONFIG_TB5200)
782 } else if (line_number == 2) {
783#if defined (CONFIG_CHARON)
784 strcpy (info, " on a CHARON carrier board");
785#endif
786#if defined (CONFIG_STK52XX)
787 strcpy (info, " on a STK52xx carrier board");
788#endif
789#if defined (CONFIG_TB5200)
790 strcpy (info, " on a TB5200 carrier board");
791#endif
792#if defined (CONFIG_FO300)
793 strcpy (info, " on a FO300 carrier board");
794#endif
795#endif
796 }
797 else {
798 info [0] = '\0';
799 }
800}
801#endif
802
803
804
805
806
807unsigned int board_video_init (void)
808{
809 u16 save, tmp;
810 int restore, ret;
811
812
813
814
815
816
817 save = *(volatile u16 *)CONFIG_SYS_CS1_START;
818 restore = 1;
819
820
821 *(volatile u16 *)CONFIG_SYS_CS1_START = 0xA5A5;
822 __asm__ volatile ("sync");
823
824
825
826
827 tmp = *(volatile u16 *)CONFIG_SYS_FLASH_BASE;
828 if (tmp == 0xA5A5)
829 puts ("!! possible error in grafic controller detection\n");
830
831 if (*(volatile u16 *)CONFIG_SYS_CS1_START != 0xA5A5) {
832
833 restore = 0;
834 ret = 0;
835 } else {
836 ret = SM501_MMIO_BASE;
837 }
838
839 if (restore) {
840 *(volatile u16 *)CONFIG_SYS_CS1_START = save;
841 __asm__ volatile ("sync");
842 }
843 return ret;
844}
845
846
847
848
849unsigned int board_video_get_fb (void)
850{
851 return SM501_FB_BASE;
852}
853
854
855
856
857void board_validate_screen (unsigned int base)
858{
859}
860
861
862
863
864const SMI_REGS *board_get_regs (void)
865{
866 return init_regs;
867}
868
869int board_get_width (void)
870{
871 return DISPLAY_WIDTH;
872}
873
874int board_get_height (void)
875{
876 return DISPLAY_HEIGHT;
877}
878
879#endif
880
881#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
882void ft_board_setup(void *blob, bd_t *bd)
883{
884 ft_cpu_setup(blob, bd);
885#if defined(CONFIG_VIDEO)
886 fdt_add_edid(blob, "smi,sm501", edid_buf);
887#endif
888}
889#endif
890
891#if defined(CONFIG_RESET_PHY_R)
892#include <miiphy.h>
893
894void reset_phy(void)
895{
896
897 miiphy_write("FEC", CONFIG_PHY_ADDR, 0x01, 0x09);
898}
899#endif
900
901int board_eth_init(bd_t *bis)
902{
903 cpu_eth_init(bis);
904 return pci_eth_init(bis);
905}
906