On Sat, Jan 19, 2002 at 09:15:56PM -0800, Tim Riker wrote:
> Update of /cvsroot/blob/blob/src/blob
> In directory usw-pr-cvs1:/tmp/cvs-serv4728/src/blob
>
> Modified Files:
> idr.c
> Log Message:
> init sa1111 and enable flash writes
>
> Index: idr.c
> ===================================================================
> RCS file: /cvsroot/blob/blob/src/blob/idr.c,v
> retrieving revision 1.4
> retrieving revision 1.5
> diff -u -d -r1.4 -r1.5
> --- idr.c 2002/01/03 16:07:17 1.4
> +++ idr.c 2002/01/20 05:15:54 1.5
> @@ -28,6 +28,8 @@
> #include <blob/flash.h>
> #include <blob/init.h>
> #include <blob/serial.h>
> +#include <blob/sa1100.h>
> +#include <blob/sa1111.h>
>
> /* flash descriptor for IDR flash */
> /* 1x Intel 28F128J3A strataflash (16MB) */
> @@ -42,6 +44,56 @@
> /* NULL block */
> },
> };
> +
> +static void sa1111_init()
> +{
> + /* switch on clock for sa1111 */
> + GAFR |= GPIO_32_768kHz;
> + GPDR |= GPIO_32_768kHz;
> + TUCR = TUCR_3_6864MHz;
> +
> + /* Now, set up the PLL and RCLK in the SA-1111: */
> + SBI_SKCR = SKCR_PLL_BYPASS | SKCR_RDYEN | SKCR_OE_EN;
> + msleep(100);
> + SBI_SKCR = SKCR_PLL_BYPASS | SKCR_RCLKEN | SKCR_RDYEN | SKCR_OE_EN;
> +
> + SerialOutputString( "SA1111 ID: " );
> + SerialOutputHex( SBI_SKID );
> + SerialOutputString( "\n" );
You're running this function at INIT_LEVEL_INITIAL_HARDWARE, so there
is no guarantee that the serial driver and the timer are already
initialised at this point. Either run at INIT_LEVEL_OTHER_HARDWARE, or
at INIT_LEVEL_INITIAL_HARDWARE + 1.
Erik
--
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty
of Information Technology and Systems, Delft University of Technology,
PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635
Fax: +31-15-2781843 Email: J.A...@it...
WWW: http://www-ict.its.tudelft.nl/~erik/
|