From 6d3bc9b8cfd5d60708f95ded007cda7bc29ac089 Mon Sep 17 00:00:00 2001 From: Marian Balakowicz Date: Fri, 18 Aug 2006 19:14:46 +0200 Subject: Add support for WTK FO300 board (TQM5200 based). --- board/tqm5200/tqm5200.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) (limited to 'board/tqm5200/tqm5200.c') diff --git a/board/tqm5200/tqm5200.c b/board/tqm5200/tqm5200.c index d6f7737d5..0026e086c 100644 --- a/board/tqm5200/tqm5200.c +++ b/board/tqm5200/tqm5200.c @@ -290,6 +290,8 @@ int checkboard (void) # define CARRIER_NAME "TB5200" #elif defined(CONFIG_CAM5200) # define CARRIER_NAME "Cam5200" +#elif defined(CONFIG_FO300) +# define CARRIER_NAME "FO300" #else # error "Unknown carrier board" #endif @@ -541,7 +543,11 @@ int last_stage_init (void) #ifdef CONFIG_VIDEO_SM501 +#ifdef CONFIG_FO300 +#define DISPLAY_WIDTH 800 +#else #define DISPLAY_WIDTH 640 +#endif #define DISPLAY_HEIGHT 480 #ifdef CONFIG_VIDEO_SM501_8BPP @@ -571,6 +577,28 @@ static const SMI_REGS init_regs [] = {0x80218, 0x000201e9}, {0x80200, 0x00013306}, #else /* panel + CRT */ +#ifdef CONFIG_FO300 + {0x00004, 0x0}, + {0x00048, 0x00021807}, + {0x0004C, 0x301a0a01}, + {0x00054, 0x1}, + {0x00040, 0x00021807}, + {0x00044, 0x091a0a01}, + {0x00054, 0x0}, + {0x80000, 0x0f013106}, + {0x80004, 0xc428bb17}, + {0x8000C, 0x00000000}, + {0x80010, 0x0C800C80}, + {0x80014, 0x03200000}, + {0x80018, 0x01e00000}, + {0x8001C, 0x00000000}, + {0x80020, 0x01e00320}, + {0x80024, 0x042a031f}, + {0x80028, 0x0086034a}, + {0x8002C, 0x020c01df}, + {0x80030, 0x000201ea}, + {0x80200, 0x00010000}, +#else {0x00004, 0x0}, {0x00048, 0x00021807}, {0x0004C, 0x091a0a01}, @@ -591,6 +619,7 @@ static const SMI_REGS init_regs [] = {0x8002C, 0x020c01df}, {0x80030, 0x000201e9}, {0x80200, 0x00010000}, +#endif /* #ifdef CONFIG_FO300 */ #endif {0, 0} }; @@ -604,7 +633,7 @@ void video_get_info_str (int line_number, char *info) { if (line_number == 1) { strcpy (info, " Board: TQM5200 (TQ-Components GmbH)"); -#if defined (CONFIG_STK52XX) || defined (CONFIG_TB5200) +#if defined (CONFIG_STK52XX) || defined (CONFIG_TB5200) || defined(CONFIG_FO300) } else if (line_number == 2) { #if defined (CONFIG_STK52XX) strcpy (info, " on a STK52xx carrier board"); @@ -612,6 +641,9 @@ void video_get_info_str (int line_number, char *info) #if defined (CONFIG_TB5200) strcpy (info, " on a TB5200 carrier board"); #endif +#if defined (CONFIG_FO300) + strcpy (info, " on a FO300 carrier board"); +#endif #endif } else { @@ -697,3 +729,33 @@ int board_get_height (void) } #endif /* CONFIG_VIDEO_SM501 */ + + +#ifdef CONFIG_BOARD_EARLY_INIT_F +#ifdef CONFIG_FO300 +int board_early_init_f (void) +{ + vu_long timer3_status; + DECLARE_GLOBAL_DATA_PTR; + + /* Configure GPT3 as GPIO input */ + *(vu_long *)MPC5XXX_GPT3_ENABLE = 0x00000004; + + /* Read in TIMER_3 pin status */ + timer3_status = *(vu_long *)MPC5XXX_GPT3_STATUS; + +#ifdef FO300_SILENT_CONSOLE_WHEN_S1_CLOSED + /* Force silent console mode if S1 switch + * is in closed position (TIMER_3 pin status is LOW). */ + if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 0) +#else + /* Force silent console mode if S1 switch + * is in open position (TIMER_3 pin status is HIGH). */ + if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 1) +#endif + gd->flags |= GD_FLG_SILENT; + + return 0; +} +#endif +#endif -- cgit v1.2.3-70-g09d2 From 5196a7a03bc436435787e1ad7044af94d93a5448 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Fri, 18 Aug 2006 23:27:33 +0200 Subject: Minor cleanup --- MAKEALL | 10 +++++----- Makefile | 26 +++++++++++++------------- board/tqm5200/tqm5200.c | 2 +- include/configs/TQM5200.h | 4 ++-- 4 files changed, 21 insertions(+), 21 deletions(-) (limited to 'board/tqm5200/tqm5200.c') diff --git a/MAKEALL b/MAKEALL index 48eeaaacf..720ab03bd 100755 --- a/MAKEALL +++ b/MAKEALL @@ -25,11 +25,11 @@ LIST_5xx=" \ ######################################################################### LIST_5xxx=" \ - BC3450 cpci5200 EVAL5200 icecube_5100 \ - icecube_5200 lite5200b mcc200 o2dnt \ - pf5200 PM520 TB5200 Total5100 \ - Total5200 Total5200_Rev2 TQM5200 TQM5200_B \ - TQM5200S fo300 \ + BC3450 cpci5200 EVAL5200 fo300 \ + icecube_5100 icecube_5200 lite5200b mcc200 \ + o2dnt pf5200 PM520 TB5200 \ + Total5100 Total5200 Total5200_Rev2 TQM5200 \ + TQM5200_B TQM5200S \ " ######################################################################### diff --git a/Makefile b/Makefile index 4cc7a48ba..a78f35b62 100644 --- a/Makefile +++ b/Makefile @@ -417,16 +417,22 @@ Total5200_Rev2_lowboot_config: unconfig } @./mkconfig -a Total5200 ppc mpc5xxx total5200 -TQM5200_config \ -TQM5200_B_config \ -TQM5200_B_HIGHBOOT_config \ -TQM5200S_config \ -TQM5200S_HIGHBOOT_config \ -TQM5200_STK100_config \ cam5200_config \ +fo300_config \ MiniFAP_config \ -fo300_config: unconfig +TQM5200S_config \ +TQM5200S_HIGHBOOT_config \ +TQM5200_B_config \ +TQM5200_B_HIGHBOOT_config \ +TQM5200_config \ +TQM5200_STK100_config: unconfig @ >include/config.h + @[ -z "$(findstring cam5200,$@)" ] || \ + { echo "#define CONFIG_CAM5200" >>include/config.h ; \ + echo "#define CONFIG_TQM5200S" >>include/config.h ; \ + echo "#define CONFIG_TQM5200_B" >>include/config.h ; \ + echo "... TQM5200S on Cam5200" ; \ + } @[ -z "$(findstring fo300,$@)" ] || \ { echo "#define CONFIG_FO300" >>include/config.h ; \ echo "... TQM5200 on FO300" ; \ @@ -435,12 +441,6 @@ fo300_config: unconfig { echo "#define CONFIG_MINIFAP" >>include/config.h ; \ echo "... TQM5200_AC on MiniFAP" ; \ } - @[ -z "$(findstring cam5200,$@)" ] || \ - { echo "#define CONFIG_CAM5200" >>include/config.h ; \ - echo "#define CONFIG_TQM5200S" >>include/config.h ; \ - echo "#define CONFIG_TQM5200_B" >>include/config.h ; \ - echo "... TQM5200S on Cam5200" ; \ - } @[ -z "$(findstring STK100,$@)" ] || \ { echo "#define CONFIG_STK52XX_REV100" >>include/config.h ; \ echo "... on a STK52XX.100 base board" ; \ diff --git a/board/tqm5200/tqm5200.c b/board/tqm5200/tqm5200.c index 0026e086c..c8350ab3b 100644 --- a/board/tqm5200/tqm5200.c +++ b/board/tqm5200/tqm5200.c @@ -293,7 +293,7 @@ int checkboard (void) #elif defined(CONFIG_FO300) # define CARRIER_NAME "FO300" #else -# error "Unknown carrier board" +# error "UNKNOWN" #endif puts ( "Board: " MODULE_NAME " (TQ-Components GmbH)\n" diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h index f157d42fc..31e3eed68 100644 --- a/include/configs/TQM5200.h +++ b/include/configs/TQM5200.h @@ -37,7 +37,7 @@ #define CONFIG_TQM5200 1 /* ... on TQM5200 module */ #undef CONFIG_TQM5200_REV100 /* define for revision 100 modules */ -/* On a Cameron board or on a FO300 board or ... */ +/* On a Cameron or on a FO300 board or ... */ #if !defined(CONFIG_CAM5200) && !defined(CONFIG_FO300) #define CONFIG_STK52XX 1 /* ... on a STK52XX board */ #endif @@ -71,7 +71,7 @@ #undef FO300_SILENT_CONSOLE_WHEN_S1_CLOSED /* silent console on PSC1 when S1 */ /* switch is open */ -#endif +#endif /* CONFIG_FO300 */ #ifdef CONFIG_STK52XX #define CONFIG_PS2KBD /* AT-PS/2 Keyboard */ -- cgit v1.2.3-70-g09d2 From 16850919ff8666f20d047cb83b4ee77581336515 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sun, 27 Aug 2006 18:10:01 +0200 Subject: Code cleanup --- CHANGELOG | 2 ++ board/amcc/common/flash.c | 60 +++++++++++++++++++++++------------------------ board/cpu87/cpu87.c | 8 +++---- board/mcc200/mcc200.c | 4 ++-- board/tqm5200/tqm5200.c | 6 ++--- cpu/i386/sc520.c | 2 +- cpu/i386/sc520_asm.S | 12 +++++----- cpu/ppc4xx/440spe_pcie.c | 2 +- include/configs/CPU87.h | 2 +- 9 files changed, 50 insertions(+), 48 deletions(-) (limited to 'board/tqm5200/tqm5200.c') diff --git a/CHANGELOG b/CHANGELOG index af180eed1..e32678237 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,8 @@ Changes since U-Boot 1.1.4: ====================================================================== +* Code cleanup + * Update for MCC200 / PRS200 boards: - auto-adjust console device for Linux. - fix typos. diff --git a/board/amcc/common/flash.c b/board/amcc/common/flash.c index a0acbba70..e6429ecd1 100644 --- a/board/amcc/common/flash.c +++ b/board/amcc/common/flash.c @@ -35,7 +35,7 @@ #include #include -flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */ +flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */ /*----------------------------------------------------------------------- * Functions @@ -76,7 +76,7 @@ void flash_print_info(flash_info_t * info) case FLASH_MAN_SST: printf("SST "); break; - case FLASH_MAN_MX: + case FLASH_MAN_MX: printf ("MACRONIX "); break; default: @@ -223,75 +223,75 @@ static ulong flash_get_size(vu_long * addr, flash_info_t * info) return (0); /* no or unknown flash */ } - value = addr2[1]; /* device ID */ + value = addr2[1]; /* device ID */ DEBUGF("\nFLASH DEVICEID: %x\n", value); switch (value) { case (CFG_FLASH_WORD_SIZE) AMD_ID_LV040B: info->flash_id += FLASH_AM040; info->sector_count = 8; - info->size = 0x0080000; /* => 512 ko */ + info->size = 0x0080000; /* => 512 KiB */ break; case (CFG_FLASH_WORD_SIZE) AMD_ID_F040B: info->flash_id += FLASH_AM040; info->sector_count = 8; - info->size = 0x0080000; /* => 512 ko */ + info->size = 0x0080000; /* => 512 KiB */ break; case (CFG_FLASH_WORD_SIZE) STM_ID_M29W040B: info->flash_id += FLASH_AM040; info->sector_count = 8; - info->size = 0x0080000; /* => 512 ko */ + info->size = 0x0080000; /* => 512 KiB */ break; case (CFG_FLASH_WORD_SIZE) AMD_ID_F016D: info->flash_id += FLASH_AMD016; info->sector_count = 32; - info->size = 0x00200000; - break; /* => 2 MB */ + info->size = 0x00200000; /* => 2 MiB */ + break; case (CFG_FLASH_WORD_SIZE) AMD_ID_LV033C: info->flash_id += FLASH_AMDLV033C; info->sector_count = 64; - info->size = 0x00400000; - break; /* => 4 MB */ + info->size = 0x00400000; /* => 4 MiB */ + break; case (CFG_FLASH_WORD_SIZE) AMD_ID_LV400T: info->flash_id += FLASH_AM400T; info->sector_count = 11; - info->size = 0x00080000; - break; /* => 0.5 MB */ + info->size = 0x00080000; /* => 512 KiB */ + break; case (CFG_FLASH_WORD_SIZE) AMD_ID_LV400B: info->flash_id += FLASH_AM400B; info->sector_count = 11; - info->size = 0x00080000; - break; /* => 0.5 MB */ + info->size = 0x00080000; /* => 512 KiB */ + break; case (CFG_FLASH_WORD_SIZE) AMD_ID_LV800T: info->flash_id += FLASH_AM800T; info->sector_count = 19; - info->size = 0x00100000; - break; /* => 1 MB */ + info->size = 0x00100000; /* => 1 MiB */ + break; case (CFG_FLASH_WORD_SIZE) AMD_ID_LV800B: info->flash_id += FLASH_AM800B; info->sector_count = 19; - info->size = 0x00100000; - break; /* => 1 MB */ + info->size = 0x00100000; /* => 1 MiB */ + break; case (CFG_FLASH_WORD_SIZE) AMD_ID_LV160T: info->flash_id += FLASH_AM160T; info->sector_count = 35; - info->size = 0x00200000; - break; /* => 2 MB */ + info->size = 0x00200000; /* => 2 MiB */ + break; case (CFG_FLASH_WORD_SIZE) AMD_ID_LV160B: info->flash_id += FLASH_AM160B; info->sector_count = 35; - info->size = 0x00200000; - break; /* => 2 MB */ + info->size = 0x00200000; /* => 2 MiB */ + break; default: info->flash_id = FLASH_UNKNOWN; @@ -306,7 +306,7 @@ static ulong flash_get_size(vu_long * addr, flash_info_t * info) info->start[i] = base + (i * 0x00010000); } else { if (info->flash_id & FLASH_BTYPE) { - /* set sector offsets for bottom boot block type */ + /* set sector offsets for bottom boot block type */ info->start[0] = base + 0x00000000; info->start[1] = base + 0x00004000; info->start[2] = base + 0x00006000; @@ -316,7 +316,7 @@ static ulong flash_get_size(vu_long * addr, flash_info_t * info) base + (i * 0x00010000) - 0x00030000; } } else { - /* set sector offsets for top boot block type */ + /* set sector offsets for top boot block type */ i = info->sector_count - 1; info->start[i--] = base + info->size - 0x00004000; info->start[i--] = base + info->size - 0x00006000; @@ -666,7 +666,7 @@ static ulong flash_get_size_2(vu_long * addr, flash_info_t * info) return (0); /* no or unknown flash */ } - value = addr2[1]; /* device ID */ + value = addr2[1]; /* device ID */ DEBUGF("\nFLASH DEVICEID: %x\n", value); @@ -675,17 +675,17 @@ static ulong flash_get_size_2(vu_long * addr, flash_info_t * info) case (CFG_FLASH_WORD_SIZE)AMD_ID_LV320T: info->flash_id += FLASH_AM320T; info->sector_count = 71; - info->size = 0x00400000; break; /* => 4 MB */ + info->size = 0x00400000; break; /* => 4 MiB */ case (CFG_FLASH_WORD_SIZE)AMD_ID_LV320B: info->flash_id += FLASH_AM320B; info->sector_count = 71; - info->size = 0x00400000; break; /* => 4 MB */ + info->size = 0x00400000; break; /* => 4 MiB */ case (CFG_FLASH_WORD_SIZE)STM_ID_29W320DT: info->flash_id += FLASH_STMW320DT; info->sector_count = 67; - info->size = 0x00400000; break; /* => 4 MB */ + info->size = 0x00400000; break; /* => 4 MiB */ case (CFG_FLASH_WORD_SIZE)MX_ID_LV320T: info->flash_id += FLASH_MXLV320T; @@ -743,7 +743,7 @@ static ulong flash_get_size_2(vu_long * addr, flash_info_t * info) info->start[i] = base + i * 0x00010000; } else { if (info->flash_id & FLASH_BTYPE) { - /* set sector offsets for bottom boot block type */ + /* set sector offsets for bottom boot block type */ info->start[0] = base + 0x00000000; info->start[1] = base + 0x00004000; info->start[2] = base + 0x00006000; @@ -753,7 +753,7 @@ static ulong flash_get_size_2(vu_long * addr, flash_info_t * info) base + (i * 0x00010000) - 0x00030000; } } else { - /* set sector offsets for top boot block type */ + /* set sector offsets for top boot block type */ i = info->sector_count - 1; info->start[i--] = base + info->size - 0x00004000; info->start[i--] = base + info->size - 0x00006000; diff --git a/board/cpu87/cpu87.c b/board/cpu87/cpu87.c index e8c2614eb..9fecdd0df 100644 --- a/board/cpu87/cpu87.c +++ b/board/cpu87/cpu87.c @@ -294,15 +294,15 @@ long int initdram (int board_type) */ size8 = try_init (memctl, CFG_PSDMR_8COL, CFG_OR2_8COL, (uchar *) CFG_SDRAM_BASE); - + size9 = try_init (memctl, CFG_PSDMR_9COL, CFG_OR2_9COL, (uchar *) CFG_SDRAM_BASE); - + size10 = try_init (memctl, CFG_PSDMR_10COL, CFG_OR2_10COL, (uchar *) CFG_SDRAM_BASE); - + psize = max(size8,max(size9,size10)); - + if (psize == size8) { psize = try_init (memctl, CFG_PSDMR_8COL, CFG_OR2_8COL, (uchar *) CFG_SDRAM_BASE); diff --git a/board/mcc200/mcc200.c b/board/mcc200/mcc200.c index 9c5780998..71a691b5d 100644 --- a/board/mcc200/mcc200.c +++ b/board/mcc200/mcc200.c @@ -265,8 +265,8 @@ int misc_init_r (void) *(volatile int*)MPC5XXX_CS0_CFG &= ~(1 << 6); printf ("Warning: Only 32 of 64 MB of Flash are accessible from U-Boot\n"); flash_info[0].size = 32 << 20; - for (snum = 0, flash_sup_end = gd->bd->bi_flashstart + (32<<20); - flash_info[0].start[snum] < flash_sup_end; + for (snum = 0, flash_sup_end = gd->bd->bi_flashstart + (32<<20); + flash_info[0].start[snum] < flash_sup_end; snum++); flash_info[0].sector_count = snum; } diff --git a/board/tqm5200/tqm5200.c b/board/tqm5200/tqm5200.c index c8350ab3b..2a0d542ef 100644 --- a/board/tqm5200/tqm5200.c +++ b/board/tqm5200/tqm5200.c @@ -743,7 +743,7 @@ int board_early_init_f (void) /* Read in TIMER_3 pin status */ timer3_status = *(vu_long *)MPC5XXX_GPT3_STATUS; - + #ifdef FO300_SILENT_CONSOLE_WHEN_S1_CLOSED /* Force silent console mode if S1 switch * is in closed position (TIMER_3 pin status is LOW). */ @@ -757,5 +757,5 @@ int board_early_init_f (void) return 0; } -#endif -#endif +#endif /* CONFIG_FO300 */ +#endif /* CONFIG_BOARD_EARLY_INIT_F */ diff --git a/cpu/i386/sc520.c b/cpu/i386/sc520.c index 1c4370b08..d0a734188 100644 --- a/cpu/i386/sc520.c +++ b/cpu/i386/sc520.c @@ -149,7 +149,7 @@ unsigned long init_sc520_dram(void) /* these memory control registers are set up in the assember part, * in sc520_asm.S, during 'mem_init'. If we muck with them here, * after we are running a stack in RAM, we have troubles. Besides, - * these refresh and delay values are better ? simply specified + * these refresh and delay values are better ? simply specified * outright in the include/configs/{cfg} file since the HW designer * simply dictates it. */ diff --git a/cpu/i386/sc520_asm.S b/cpu/i386/sc520_asm.S index e1fa37a4a..8fc713d93 100644 --- a/cpu/i386/sc520_asm.S +++ b/cpu/i386/sc520_asm.S @@ -462,7 +462,7 @@ emptybank: #if defined CFG_SDRAM_DRCTMCTL /* just have your hardware desinger _GIVE_ you what you need here! */ - movl $DRCTMCTL, %edi + movl $DRCTMCTL, %edi movb $CFG_SDRAM_DRCTMCTL,%al movb (%edi), %al #else @@ -477,7 +477,7 @@ emptybank: #ifdef CFG_SDRAM_CAS_LATENCY_3T orb $0x10, %al #endif - movb %al, (%edi) + movb %al, (%edi) #endif #endif movl $DRCCTL, %edi /* DRAM Control register */ @@ -537,7 +537,7 @@ bank0: movl (%edi), %eax movl %eax, %ebx -done: +done: movl %ebx, %eax #if CFG_SDRAM_ECC_ENABLE @@ -547,7 +547,7 @@ done: movl $0x1, %edi memtest0: movb $0xa5, (%edi) - cmpb $0xa5, (%edi) + cmpb $0xa5, (%edi) jne out shrl $1, %ecx andl %ecx,%ecx @@ -571,11 +571,11 @@ set_ecc: /* enable NMI mapping for ECC */ movl $ECCINT, %edi mov $0x10, %al - movb %al, (%edi) + movb %al, (%edi) /* Turn on ECC */ movl $ECCCTL, %edi mov $0x05, %al - movb %al, (%edi) + movb %al, (%edi) #endif out: movl %ebx, %eax diff --git a/cpu/ppc4xx/440spe_pcie.c b/cpu/ppc4xx/440spe_pcie.c index 2e920aadf..b2621c2ec 100644 --- a/cpu/ppc4xx/440spe_pcie.c +++ b/cpu/ppc4xx/440spe_pcie.c @@ -169,7 +169,7 @@ static void ppc440spe_setup_utl(u32 port) { break; } utl_base = (unsigned int *)(CFG_PCIE_BASE + 0x1000 * port); - + /* * Set buffer allocations and then assert VRB and TXE. */ diff --git a/include/configs/CPU87.h b/include/configs/CPU87.h index 7a1dada2d..ce969ecdd 100644 --- a/include/configs/CPU87.h +++ b/include/configs/CPU87.h @@ -527,7 +527,7 @@ PSDMR_LDOTOPRE_1C |\ PSDMR_WRC_1C |\ PSDMR_CL_2) - + /* * Init Memory Controller: * -- cgit v1.2.3-70-g09d2 From aeec782b020930732eab075af97212c3f03afcae Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Wed, 13 Sep 2006 10:47:05 +0200 Subject: Disable autoboot abort for FO300 when silent mode is enabled (according to S1 switch setting). Patch by Marian Balakowicz, 12 Sep 2006 --- CHANGELOG | 3 ++ board/tqm5200/tqm5200.c | 74 +++++++++++++++++++++++++++++-------------------- 2 files changed, 47 insertions(+), 30 deletions(-) (limited to 'board/tqm5200/tqm5200.c') diff --git a/CHANGELOG b/CHANGELOG index a25134fa7..a896e253a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,9 @@ Changes since U-Boot 1.1.4: ====================================================================== +* Disable autoboot abort for FO300 when silent mode is enabled + (according to S1 switch setting). + * Cleanup examples binaries * Add NAND environment support for PPC440EPx Sequoia NAND boot config diff --git a/board/tqm5200/tqm5200.c b/board/tqm5200/tqm5200.c index 2a0d542ef..b76579cb4 100644 --- a/board/tqm5200/tqm5200.c +++ b/board/tqm5200/tqm5200.c @@ -446,6 +446,43 @@ int board_early_init_r (void) #endif #endif /* CONFIG_PS2MULT */ +#ifdef CONFIG_FO300 +int silent_boot (void) +{ + vu_long timer3_status; + + /* Configure GPT3 as GPIO input */ + *(vu_long *)MPC5XXX_GPT3_ENABLE = 0x00000004; + + /* Read in TIMER_3 pin status */ + timer3_status = *(vu_long *)MPC5XXX_GPT3_STATUS; + +#ifdef FO300_SILENT_CONSOLE_WHEN_S1_CLOSED + /* Force silent console mode if S1 switch + * is in closed position (TIMER_3 pin status is LOW). */ + if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 0) + return 1; +#else + /* Force silent console mode if S1 switch + * is in open position (TIMER_3 pin status is HIGH). */ + if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 1) + return 1; +#endif + + return 0; +} + +int board_early_init_f (void) +{ + DECLARE_GLOBAL_DATA_PTR; + + if (silent_boot()) + gd->flags |= GD_FLG_SILENT; + + return 0; +} +#endif /* CONFIG_FO300 */ + int last_stage_init (void) { /* @@ -538,6 +575,13 @@ int last_stage_init (void) __asm__ volatile ("sync"); } +#ifdef CONFIG_FO300 + if (silent_boot()) { + setenv("bootdelay", "0"); + disable_ctrlc(1); + } +#endif + return 0; } @@ -729,33 +773,3 @@ int board_get_height (void) } #endif /* CONFIG_VIDEO_SM501 */ - - -#ifdef CONFIG_BOARD_EARLY_INIT_F -#ifdef CONFIG_FO300 -int board_early_init_f (void) -{ - vu_long timer3_status; - DECLARE_GLOBAL_DATA_PTR; - - /* Configure GPT3 as GPIO input */ - *(vu_long *)MPC5XXX_GPT3_ENABLE = 0x00000004; - - /* Read in TIMER_3 pin status */ - timer3_status = *(vu_long *)MPC5XXX_GPT3_STATUS; - -#ifdef FO300_SILENT_CONSOLE_WHEN_S1_CLOSED - /* Force silent console mode if S1 switch - * is in closed position (TIMER_3 pin status is LOW). */ - if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 0) -#else - /* Force silent console mode if S1 switch - * is in open position (TIMER_3 pin status is HIGH). */ - if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 1) -#endif - gd->flags |= GD_FLG_SILENT; - - return 0; -} -#endif /* CONFIG_FO300 */ -#endif /* CONFIG_BOARD_EARLY_INIT_F */ -- cgit v1.2.3-70-g09d2