2007-06-20 Joel Sherrill <joel.sherrill@oarcorp.com>

Add Embedded Planets EP5200 which is the same as the Freescale
	5200Lite (a.k.a. IceCube) evaluation board.
	* Makefile.am: Add linkcmds.ep5200.
	Add -DMPC5200_BAPI_LIBC_HEADERS to remove some warnings in bestcomm.
	* preinstall.am: Add linkcmds.ep5200.
	* clock/clock.c: Correct math for prescaler/counter when bus speed
	is high enough to require multiple passes of loop.
	* console/console.c: Use same math for initial baud rate as when it
	is changed via ioctl.  When HAS_UBOOT is defined, initialize console
	to the same baud as it was with U-Boot.
	* include/bsp.h: Add EP5200 and console boot baud support.
	* include/mpc5200.h: Spacing.
	* startup/bspstart.c: If HAS_UBOOT and SHOW_MORE_INIT_SETTINGS are
	both defined, dump the U-Boot BD info structure.
	* vectors/vectors.S: ep5200 cannot use vectors segment.  When loading
	it, U-Boot freezes.  Besides, U-Boot can automatically start the BSP
	so we do not have to run from board reset.
	* startup/linkcmds.ep5200: New file.
This commit is contained in:
Joel Sherrill
2007-06-20 21:42:00 +00:00
parent 18481be37d
commit 7da34053e7
10 changed files with 424 additions and 16 deletions

View File

@@ -170,20 +170,19 @@ void mpc5200_init_gpt(uint32_t gpt_no)
void mpc5200_set_gpt_count(uint32_t counter_value, uint32_t gpt_no)
{
uint32_t prescaler_value = 1;
uint32_t counter = counter_value;
struct mpc5200_gpt *gpt = (struct mpc5200_gpt *)(&mpc5200.gpt[gpt_no]);
/* Calculate counter/prescaler value, e.g. IPB_Clock=33MHz -> Int. every 0,3 nsecs. - 130 secs.*/
while((counter_value >= (1 << 16)) && (prescaler_value < (1 << 16)))
while((counter >= (1 << 16)) && (prescaler_value < (1 << 16)))
{
prescaler_value++;
counter_value /= prescaler_value;
prescaler_value++;
counter = counter_value / prescaler_value;
}
counter_value = (uint16_t)counter_value;
counter = (uint16_t)counter;
gpt->count_in = (prescaler_value << 16) + counter_value;
gpt->count_in = (prescaler_value << 16) + counter;
}