From 0f6b5f03d9e11ec896b0d86d2027471c12a655eb Mon Sep 17 00:00:00 2001 From: Tobias Diedrich Date: Tue, 18 May 2010 16:23:11 +0000 Subject: Enable/disable second pll dynamically on usb plugin/remove. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26145 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/system-as3525.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'firmware/target/arm/as3525/system-as3525.c') diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index dbbe1a1905..ae7c71d939 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c @@ -320,16 +320,16 @@ void system_init(void) "mcr p15, 0, r0, c1, c0 \n" : : : "r0" ); - CGU_COUNTA = 0xff; + CGU_COUNTA = CGU_LOCK_CNT; CGU_PLLA = AS3525_PLLA_SETTING; - CGU_PLLASUP = 0; /* enable PLLA */ - while(!(CGU_INTCTRL & (1<<0))); /* wait until PLLA is locked */ - -#if (defined(USE_ROCKBOX_USB) && CONFIG_CPU==AS3525) || (AS3525_MCLK_SEL == AS3525_CLK_PLLB) - CGU_COUNTB = 0xff; + CGU_PLLASUP = 0; /* enable PLLA */ + while(!(CGU_INTCTRL & CGU_PLLA_LOCK)); /* wait until PLLA is locked */ + +#if AS3525_MCLK_SEL == AS3525_CLK_PLLB + CGU_COUNTB = CGU_LOCK_CNT; CGU_PLLB = AS3525_PLLB_SETTING; - CGU_PLLBSUP = 0; /* enable PLLB */ - while(!(CGU_INTCTRL & (1<<1))); /* wait until PLLB is locked */ + CGU_PLLBSUP = 0; /* enable PLLB */ + while(!(CGU_INTCTRL & CGU_PLLB_LOCK)); /* wait until PLLB is locked */ #endif /* Set FCLK frequency */ -- cgit v1.2.3