Commit 6d3bc9b8cfd5d60708f95ded007cda7bc29ac089
1 parent
c5185470fe
Exists in
master
and in
55 other branches
Add support for WTK FO300 board (TQM5200 based).
Showing 7 changed files with 154 additions and 13 deletions Side-by-side Diff
CHANGELOG
MAKEALL
Makefile
... | ... | @@ -424,8 +424,13 @@ |
424 | 424 | TQM5200S_HIGHBOOT_config \ |
425 | 425 | TQM5200_STK100_config \ |
426 | 426 | cam5200_config \ |
427 | -MiniFAP_config: unconfig | |
427 | +MiniFAP_config \ | |
428 | +fo300_config: unconfig | |
428 | 429 | @ >include/config.h |
430 | + @[ -z "$(findstring fo300,$@)" ] || \ | |
431 | + { echo "#define CONFIG_FO300" >>include/config.h ; \ | |
432 | + echo "... TQM5200 on FO300" ; \ | |
433 | + } | |
429 | 434 | @[ -z "$(findstring MiniFAP,$@)" ] || \ |
430 | 435 | { echo "#define CONFIG_MINIFAP" >>include/config.h ; \ |
431 | 436 | echo "... TQM5200_AC on MiniFAP" ; \ |
board/tqm5200/cmd_stk52xx.c
... | ... | @@ -30,8 +30,8 @@ |
30 | 30 | #include <command.h> |
31 | 31 | |
32 | 32 | #if (CONFIG_COMMANDS & CFG_CMD_BSP) |
33 | -#if defined (CONFIG_STK52XX) | |
34 | 33 | |
34 | +#if defined(CONFIG_STK52XX) || defined(CONFIG_FO300) | |
35 | 35 | #define DEFAULT_VOL 45 |
36 | 36 | #define DEFAULT_FREQ 500 |
37 | 37 | #define DEFAULT_DURATION 200 |
38 | 38 | |
... | ... | @@ -537,7 +537,9 @@ |
537 | 537 | |
538 | 538 | return rcode; |
539 | 539 | } |
540 | +#endif | |
540 | 541 | |
542 | +#if defined(CONFIG_STK52XX) | |
541 | 543 | void led_init(void) |
542 | 544 | { |
543 | 545 | struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO; |
544 | 546 | |
... | ... | @@ -736,7 +738,9 @@ |
736 | 738 | |
737 | 739 | return 0; |
738 | 740 | } |
741 | +#endif | |
739 | 742 | |
743 | +#if defined(CONFIG_STK52XX) || defined(CONFIG_FO300) | |
740 | 744 | /* |
741 | 745 | * return 1 on CAN initialization failure |
742 | 746 | * return 0 if no failure |
... | ... | @@ -1106,6 +1110,7 @@ |
1106 | 1110 | return error_status; |
1107 | 1111 | } |
1108 | 1112 | |
1113 | +#ifndef CONFIG_FO300 | |
1109 | 1114 | static void sm501_backlight (unsigned int state) |
1110 | 1115 | { |
1111 | 1116 | if (state == BL_ON) { |
... | ... | @@ -1115,6 +1120,7 @@ |
1115 | 1120 | *(vu_long *)(SM501_MMIO_BASE+SM501_PANEL_DISPLAY_CONTROL) &= |
1116 | 1121 | ~((1 << 26) | (1 << 27)); |
1117 | 1122 | } |
1123 | +#endif | |
1118 | 1124 | |
1119 | 1125 | int cmd_fkt(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) |
1120 | 1126 | { |
1121 | 1127 | |
... | ... | @@ -1124,7 +1130,9 @@ |
1124 | 1130 | printf ("Revision 100 of STK52XX not supported!\n"); |
1125 | 1131 | return 1; |
1126 | 1132 | #endif |
1133 | +#if defined(CONFIG_STK52XX) | |
1127 | 1134 | led_init(); |
1135 | +#endif | |
1128 | 1136 | can_init(); |
1129 | 1137 | |
1130 | 1138 | switch (argc) { |
... | ... | @@ -1152,6 +1160,7 @@ |
1152 | 1160 | else |
1153 | 1161 | printf ("Error\n"); |
1154 | 1162 | return rcode; |
1163 | +#ifndef CONFIG_FO300 | |
1155 | 1164 | } else if (strncmp (argv[1], "backlight", 4) == 0) { |
1156 | 1165 | if (strncmp (argv[2], "on", 2) == 0) { |
1157 | 1166 | sm501_backlight (BL_ON); |
1158 | 1167 | |
1159 | 1168 | |
... | ... | @@ -1161,14 +1170,17 @@ |
1161 | 1170 | sm501_backlight (BL_OFF); |
1162 | 1171 | return 0; |
1163 | 1172 | } |
1173 | +#endif | |
1164 | 1174 | } |
1165 | 1175 | break; |
1166 | 1176 | |
1177 | +#if defined(CONFIG_STK52XX) | |
1167 | 1178 | case 4: |
1168 | 1179 | if (strcmp (argv[1], "led") == 0) { |
1169 | 1180 | return (do_led (argv)); |
1170 | 1181 | } |
1171 | 1182 | break; |
1183 | +#endif | |
1172 | 1184 | |
1173 | 1185 | default: |
1174 | 1186 | break; |
1175 | 1187 | |
... | ... | @@ -1204,7 +1216,9 @@ |
1204 | 1216 | "[channel]\n" |
1205 | 1217 | " - play short beep on \"l\"eft or \"r\"ight channel\n" |
1206 | 1218 | ); |
1219 | +#endif /* CONFIG_STK52XX || CONFIG_FO300 */ | |
1207 | 1220 | |
1221 | +#if defined(CONFIG_STK52XX) | |
1208 | 1222 | U_BOOT_CMD( |
1209 | 1223 | fkt , 4, 1, cmd_fkt, |
1210 | 1224 | "fkt - Function test routines\n", |
... | ... | @@ -1217,6 +1231,15 @@ |
1217 | 1231 | "fkt backlight on/off\n" |
1218 | 1232 | " - switch backlight on or off\n" |
1219 | 1233 | ); |
1220 | -#endif /* CONFIG_STK52XX */ | |
1234 | +#elif defined(CONFIG_FO300) | |
1235 | +U_BOOT_CMD( | |
1236 | + fkt , 3, 1, cmd_fkt, | |
1237 | + "fkt - Function test routines\n", | |
1238 | + "fkt can\n" | |
1239 | + " - loopback plug for X16/X29 required\n" | |
1240 | + "fkt rs232 number\n" | |
1241 | + " - loopback plug(s) for X21/X22 required\n" | |
1242 | +); | |
1243 | +#endif | |
1221 | 1244 | #endif /* CFG_CMD_BSP */ |
board/tqm5200/tqm5200.c
... | ... | @@ -290,6 +290,8 @@ |
290 | 290 | # define CARRIER_NAME "TB5200" |
291 | 291 | #elif defined(CONFIG_CAM5200) |
292 | 292 | # define CARRIER_NAME "Cam5200" |
293 | +#elif defined(CONFIG_FO300) | |
294 | +# define CARRIER_NAME "FO300" | |
293 | 295 | #else |
294 | 296 | # error "Unknown carrier board" |
295 | 297 | #endif |
296 | 298 | |
... | ... | @@ -541,7 +543,11 @@ |
541 | 543 | |
542 | 544 | #ifdef CONFIG_VIDEO_SM501 |
543 | 545 | |
546 | +#ifdef CONFIG_FO300 | |
547 | +#define DISPLAY_WIDTH 800 | |
548 | +#else | |
544 | 549 | #define DISPLAY_WIDTH 640 |
550 | +#endif | |
545 | 551 | #define DISPLAY_HEIGHT 480 |
546 | 552 | |
547 | 553 | #ifdef CONFIG_VIDEO_SM501_8BPP |
548 | 554 | |
... | ... | @@ -571,8 +577,30 @@ |
571 | 577 | {0x80218, 0x000201e9}, |
572 | 578 | {0x80200, 0x00013306}, |
573 | 579 | #else /* panel + CRT */ |
580 | +#ifdef CONFIG_FO300 | |
574 | 581 | {0x00004, 0x0}, |
575 | 582 | {0x00048, 0x00021807}, |
583 | + {0x0004C, 0x301a0a01}, | |
584 | + {0x00054, 0x1}, | |
585 | + {0x00040, 0x00021807}, | |
586 | + {0x00044, 0x091a0a01}, | |
587 | + {0x00054, 0x0}, | |
588 | + {0x80000, 0x0f013106}, | |
589 | + {0x80004, 0xc428bb17}, | |
590 | + {0x8000C, 0x00000000}, | |
591 | + {0x80010, 0x0C800C80}, | |
592 | + {0x80014, 0x03200000}, | |
593 | + {0x80018, 0x01e00000}, | |
594 | + {0x8001C, 0x00000000}, | |
595 | + {0x80020, 0x01e00320}, | |
596 | + {0x80024, 0x042a031f}, | |
597 | + {0x80028, 0x0086034a}, | |
598 | + {0x8002C, 0x020c01df}, | |
599 | + {0x80030, 0x000201ea}, | |
600 | + {0x80200, 0x00010000}, | |
601 | +#else | |
602 | + {0x00004, 0x0}, | |
603 | + {0x00048, 0x00021807}, | |
576 | 604 | {0x0004C, 0x091a0a01}, |
577 | 605 | {0x00054, 0x1}, |
578 | 606 | {0x00040, 0x00021807}, |
... | ... | @@ -591,6 +619,7 @@ |
591 | 619 | {0x8002C, 0x020c01df}, |
592 | 620 | {0x80030, 0x000201e9}, |
593 | 621 | {0x80200, 0x00010000}, |
622 | +#endif /* #ifdef CONFIG_FO300 */ | |
594 | 623 | #endif |
595 | 624 | {0, 0} |
596 | 625 | }; |
... | ... | @@ -604,7 +633,7 @@ |
604 | 633 | { |
605 | 634 | if (line_number == 1) { |
606 | 635 | strcpy (info, " Board: TQM5200 (TQ-Components GmbH)"); |
607 | -#if defined (CONFIG_STK52XX) || defined (CONFIG_TB5200) | |
636 | +#if defined (CONFIG_STK52XX) || defined (CONFIG_TB5200) || defined(CONFIG_FO300) | |
608 | 637 | } else if (line_number == 2) { |
609 | 638 | #if defined (CONFIG_STK52XX) |
610 | 639 | strcpy (info, " on a STK52xx carrier board"); |
611 | 640 | |
... | ... | @@ -612,7 +641,10 @@ |
612 | 641 | #if defined (CONFIG_TB5200) |
613 | 642 | strcpy (info, " on a TB5200 carrier board"); |
614 | 643 | #endif |
644 | +#if defined (CONFIG_FO300) | |
645 | + strcpy (info, " on a FO300 carrier board"); | |
615 | 646 | #endif |
647 | +#endif | |
616 | 648 | } |
617 | 649 | else { |
618 | 650 | info [0] = '\0'; |
... | ... | @@ -697,4 +729,34 @@ |
697 | 729 | } |
698 | 730 | |
699 | 731 | #endif /* CONFIG_VIDEO_SM501 */ |
732 | + | |
733 | + | |
734 | +#ifdef CONFIG_BOARD_EARLY_INIT_F | |
735 | +#ifdef CONFIG_FO300 | |
736 | +int board_early_init_f (void) | |
737 | +{ | |
738 | + vu_long timer3_status; | |
739 | + DECLARE_GLOBAL_DATA_PTR; | |
740 | + | |
741 | + /* Configure GPT3 as GPIO input */ | |
742 | + *(vu_long *)MPC5XXX_GPT3_ENABLE = 0x00000004; | |
743 | + | |
744 | + /* Read in TIMER_3 pin status */ | |
745 | + timer3_status = *(vu_long *)MPC5XXX_GPT3_STATUS; | |
746 | + | |
747 | +#ifdef FO300_SILENT_CONSOLE_WHEN_S1_CLOSED | |
748 | + /* Force silent console mode if S1 switch | |
749 | + * is in closed position (TIMER_3 pin status is LOW). */ | |
750 | + if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 0) | |
751 | +#else | |
752 | + /* Force silent console mode if S1 switch | |
753 | + * is in open position (TIMER_3 pin status is HIGH). */ | |
754 | + if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 1) | |
755 | +#endif | |
756 | + gd->flags |= GD_FLG_SILENT; | |
757 | + | |
758 | + return 0; | |
759 | +} | |
760 | +#endif | |
761 | +#endif |
include/configs/TQM5200.h
... | ... | @@ -37,7 +37,8 @@ |
37 | 37 | #define CONFIG_TQM5200 1 /* ... on TQM5200 module */ |
38 | 38 | #undef CONFIG_TQM5200_REV100 /* define for revision 100 modules */ |
39 | 39 | |
40 | -#ifndef CONFIG_CAM5200 /* On a Cameron board or ... */ | |
40 | +/* On a Cameron board or on a FO300 board or ... */ | |
41 | +#if !defined(CONFIG_CAM5200) && !defined(CONFIG_FO300) | |
41 | 42 | #define CONFIG_STK52XX 1 /* ... on a STK52XX board */ |
42 | 43 | #endif |
43 | 44 | |
... | ... | @@ -58,6 +59,20 @@ |
58 | 59 | #define CONFIG_BAUDRATE 115200 /* ... at 115200 bps */ |
59 | 60 | #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } |
60 | 61 | |
62 | +#ifdef CONFIG_FO300 | |
63 | +#define CFG_DEVICE_NULLDEV 1 /* enable null device */ | |
64 | +#define CONFIG_SILENT_CONSOLE 1 /* enable silent startup */ | |
65 | +#define CONFIG_BOARD_EARLY_INIT_F 1 /* used to detect S1 switch position */ | |
66 | + | |
67 | +#if 0 | |
68 | +#define FO300_SILENT_CONSOLE_WHEN_S1_CLOSED 1 /* silent console on PSC1 when S1 */ | |
69 | + /* switch is closed */ | |
70 | +#endif | |
71 | + | |
72 | +#undef FO300_SILENT_CONSOLE_WHEN_S1_CLOSED /* silent console on PSC1 when S1 */ | |
73 | + /* switch is open */ | |
74 | +#endif | |
75 | + | |
61 | 76 | #ifdef CONFIG_STK52XX |
62 | 77 | #define CONFIG_PS2KBD /* AT-PS/2 Keyboard */ |
63 | 78 | #define CONFIG_PS2MULT /* .. on PS/2 Multiplexer */ |
64 | 79 | |
65 | 80 | |
... | ... | @@ -105,12 +120,18 @@ |
105 | 120 | #define CONFIG_VIDEO_SM501_32BPP |
106 | 121 | #define CONFIG_CFB_CONSOLE |
107 | 122 | #define CONFIG_VIDEO_LOGO |
108 | -#define CONFIG_VGA_AS_SINGLE_DEVICE | |
123 | + | |
124 | +#ifndef CONFIG_FO300 | |
109 | 125 | #define CONFIG_CONSOLE_EXTRA_INFO |
126 | +#else | |
127 | +#define CONFIG_VIDEO_BMP_LOGO | |
128 | +#endif | |
129 | + | |
130 | +#define CONFIG_VGA_AS_SINGLE_DEVICE | |
110 | 131 | #define CONFIG_VIDEO_SW_CURSOR |
111 | 132 | #define CONFIG_SPLASH_SCREEN |
112 | 133 | #define CFG_CONSOLE_IS_IN_ENV |
113 | -#endif | |
134 | +#endif /* #ifndef CONFIG_TQM5200S */ | |
114 | 135 | |
115 | 136 | #ifdef CONFIG_VIDEO |
116 | 137 | #define ADD_BMP_CMD CFG_CMD_BMP |
... | ... | @@ -124,7 +145,7 @@ |
124 | 145 | #define CONFIG_ISO_PARTITION |
125 | 146 | |
126 | 147 | /* USB */ |
127 | -#ifdef CONFIG_STK52XX | |
148 | +#if defined(CONFIG_STK52XX) || defined(CONFIG_FO300) | |
128 | 149 | #define CONFIG_USB_OHCI |
129 | 150 | #define ADD_USB_CMD CFG_CMD_USB | CFG_CMD_FAT |
130 | 151 | #define CONFIG_USB_STORAGE |
... | ... | @@ -148,7 +169,7 @@ |
148 | 169 | #endif |
149 | 170 | |
150 | 171 | /* IDE */ |
151 | -#if defined (CONFIG_MINIFAP) || defined (CONFIG_STK52XX) | |
172 | +#if defined (CONFIG_MINIFAP) || defined (CONFIG_STK52XX) || defined(CONFIG_FO300) | |
152 | 173 | #define ADD_IDE_CMD (CFG_CMD_IDE | CFG_CMD_FAT | CFG_CMD_EXT2) |
153 | 174 | #else |
154 | 175 | #define ADD_IDE_CMD 0 |
... | ... | @@ -224,6 +245,12 @@ |
224 | 245 | "erase FC000000 FC03FFFF;" \ |
225 | 246 | "cp.b 200000 FC000000 ${filesize};" \ |
226 | 247 | "protect on FC000000 FC03FFFF\0" |
248 | +#elif defined (CONFIG_FO300) | |
249 | +# define ENV_UPDT \ | |
250 | + "update=protect off FC000000 FC05FFFF;" \ | |
251 | + "erase FC000000 FC05FFFF;" \ | |
252 | + "cp.b 200000 FC000000 ${filesize};" \ | |
253 | + "protect on FC000000 FC05FFFF\0" | |
227 | 254 | #else |
228 | 255 | # error "Unknown Carrier Board" |
229 | 256 | #endif /* CONFIG_STK52XX */ |
... | ... | @@ -378,6 +405,13 @@ |
378 | 405 | "2m(initrd)," \ |
379 | 406 | "8m(misc)," \ |
380 | 407 | "16m(big-fs)" |
408 | +#elif defined (CONFIG_FO300) | |
409 | +# define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:640k(firmware)," \ | |
410 | + "1408k(kernel)," \ | |
411 | + "2m(initrd)," \ | |
412 | + "4m(small-fs)," \ | |
413 | + "8m(misc)," \ | |
414 | + "16m(big-fs)" | |
381 | 415 | #else |
382 | 416 | # error "Unknown Carrier Board" |
383 | 417 | #endif /* CONFIG_STK52XX */ |
384 | 418 | |
385 | 419 | |
... | ... | @@ -450,15 +484,18 @@ |
450 | 484 | * use ALT CAN position: Bits 2-3 (mask: 0x30000000): |
451 | 485 | * 00 -> No Alternatives, CAN1/2 on PSC2 according to PSC2 setting. |
452 | 486 | * 01 -> CAN1 on I2C1, CAN2 on Tmr0/1. |
453 | - * Use for REV200 STK52XX boards. Do not use with REV100 modules | |
454 | - * (because, there I2C1 is used as I2C bus) | |
487 | + * Use for REV200 STK52XX boards and FO300 boards. Do not use | |
488 | + * with REV100 modules (because, there I2C1 is used as I2C bus) | |
455 | 489 | * use PSC1 as UART: Bits 28-31 (mask: 0x00000007): 0100 |
456 | 490 | * use PSC2 as CAN: Bits 25:27 (mask: 0x00000030) |
457 | 491 | * 000 -> All PSC2 pins are GIOPs |
458 | 492 | * 001 -> CAN1/2 on PSC2 pins |
459 | 493 | * Use for REV100 STK52xx boards |
494 | + * 01x -> Use AC97 | |
495 | + * use PSC3: Bits 20-23 (mask: 0x00000f00) | |
496 | + * 1100 -> UART/SPI (on FO300 board) | |
460 | 497 | * use PSC6: |
461 | - * on STK52xx: | |
498 | + * on STK52xx and FO300: | |
462 | 499 | * use as UART. Pins PSC6_0 to PSC6_3 are used. |
463 | 500 | * Bits 9:11 (mask: 0x00700000): |
464 | 501 | * 101 -> PSC6 : Extended POST test is not available |
... | ... | @@ -480,6 +517,8 @@ |
480 | 517 | # define CFG_GPS_PORT_CONFIG 0x91500004 |
481 | 518 | # endif |
482 | 519 | # endif |
520 | +#elif defined (CONFIG_FO300) | |
521 | +# define CFG_GPS_PORT_CONFIG 0x91502c24 | |
483 | 522 | #else /* TMQ5200 Inbetriebnahme-Board */ |
484 | 523 | # define CFG_GPS_PORT_CONFIG 0x81000004 |
485 | 524 | #endif |
include/mpc5xxx.h
... | ... | @@ -235,20 +235,30 @@ |
235 | 235 | /* General Purpose Timers registers */ |
236 | 236 | #define MPC5XXX_GPT0_ENABLE (MPC5XXX_GPT + 0x0) |
237 | 237 | #define MPC5XXX_GPT0_COUNTER (MPC5XXX_GPT + 0x4) |
238 | +#define MPC5XXX_GPT0_STATUS (MPC5XXX_GPT + 0x0C) | |
238 | 239 | #define MPC5XXX_GPT1_ENABLE (MPC5XXX_GPT + 0x10) |
239 | 240 | #define MPC5XXX_GPT1_COUNTER (MPC5XXX_GPT + 0x14) |
241 | +#define MPC5XXX_GPT1_STATUS (MPC5XXX_GPT + 0x1C) | |
240 | 242 | #define MPC5XXX_GPT2_ENABLE (MPC5XXX_GPT + 0x20) |
241 | 243 | #define MPC5XXX_GPT2_COUNTER (MPC5XXX_GPT + 0x24) |
244 | +#define MPC5XXX_GPT2_STATUS (MPC5XXX_GPT + 0x2C) | |
242 | 245 | #define MPC5XXX_GPT3_ENABLE (MPC5XXX_GPT + 0x30) |
243 | 246 | #define MPC5XXX_GPT3_COUNTER (MPC5XXX_GPT + 0x34) |
247 | +#define MPC5XXX_GPT3_STATUS (MPC5XXX_GPT + 0x3C) | |
244 | 248 | #define MPC5XXX_GPT4_ENABLE (MPC5XXX_GPT + 0x40) |
245 | 249 | #define MPC5XXX_GPT4_COUNTER (MPC5XXX_GPT + 0x44) |
250 | +#define MPC5XXX_GPT4_STATUS (MPC5XXX_GPT + 0x4C) | |
246 | 251 | #define MPC5XXX_GPT5_ENABLE (MPC5XXX_GPT + 0x50) |
252 | +#define MPC5XXX_GPT5_STATUS (MPC5XXX_GPT + 0x5C) | |
247 | 253 | #define MPC5XXX_GPT5_COUNTER (MPC5XXX_GPT + 0x54) |
248 | 254 | #define MPC5XXX_GPT6_ENABLE (MPC5XXX_GPT + 0x60) |
249 | 255 | #define MPC5XXX_GPT6_COUNTER (MPC5XXX_GPT + 0x64) |
256 | +#define MPC5XXX_GPT6_STATUS (MPC5XXX_GPT + 0x6C) | |
250 | 257 | #define MPC5XXX_GPT7_ENABLE (MPC5XXX_GPT + 0x70) |
251 | 258 | #define MPC5XXX_GPT7_COUNTER (MPC5XXX_GPT + 0x74) |
259 | +#define MPC5XXX_GPT7_STATUS (MPC5XXX_GPT + 0x7C) | |
260 | + | |
261 | +#define MPC5XXX_GPT_GPIO_PIN(status) ((0x00000100 & (status)) >> 8) | |
252 | 262 | |
253 | 263 | #define MPC5XXX_GPT7_PWMCFG (MPC5XXX_GPT + 0x78) |
254 | 264 |