Exemplo n.º 1
0
asmlinkage void __init sysinit(void)
{
	sys_clk_khz = clock_pll(0, 0);
	sys_clk_mhz = sys_clk_khz/1000;
	
	wtm_init();
	scm_init();
	gpio_init();
	fbcs_init();
	sdramc_init();
}
void __initialize_hardware(void)
{
	/*******************************************************
	*	Out of reset, the low-level assembly code calls this 
	*	routine to initialize the MCF52233 modules for the  
	*	M52233DEMO board. 
	********************************************************/

	asm 
	{
	    /* Initialize IPSBAR */
	    move.l  #__IPSBAR,d0
	       andi.l  #0xC0000000,d0 // need to mask
	    add.l   #0x1,d0
	    move.l  d0,0x40000000

	    

	    /* Initialize FLASHBAR */
	    move.l  #__FLASHBAR,d0
	       andi.l  #0xFFF80000,d0 // need to mask
	    add.l   #0x61,d0
	    movec   d0,FLASHBAR

	}


	/* 
	* Allow interrupts from ABORT, SW1, SW2, and SW3 (IRQ[1,4,7,11]) 
	*/

	/* Enable IRQ signals on the port */
	MCF_GPIO_PNQPAR = 0
	  | MCF_GPIO_PNQPAR_IRQ1_IRQ1
	  | MCF_GPIO_PNQPAR_IRQ4_IRQ4
	  | MCF_GPIO_PNQPAR_IRQ7_IRQ7;

	MCF_GPIO_PGPPAR = 0
	  | MCF_GPIO_PGPPAR_IRQ11_IRQ11;

	/* Set EPORT to look for rising edges */
	MCF_EPORT0_EPPAR = 0
	  | MCF_EPORT_EPPAR_EPPA1_RISING
	  | MCF_EPORT_EPPAR_EPPA4_RISING
	  | MCF_EPORT_EPPAR_EPPA7_RISING;
	  
	MCF_EPORT1_EPPAR = 0
	  | MCF_EPORT_EPPAR_EPPA11_RISING;
	  
	/* Clear any currently triggered events on the EPORT  */
	MCF_EPORT0_EPIER = 0
	  | MCF_EPORT_EPIER_EPIE1
	  | MCF_EPORT_EPIER_EPIE4
	  | MCF_EPORT_EPIER_EPIE7;
	 
	MCF_EPORT1_EPIER = 0
	  | MCF_EPORT_EPIER_EPIE11;
	 
	/* Enable interrupts in the interrupt controller */
	MCF_INTC0_IMRL &= ~(0
	  | MCF_INTC_IMRL_INT_MASK1 
	  | MCF_INTC_IMRL_INT_MASK4 
	  | MCF_INTC_IMRL_INT_MASK7 
	  | MCF_INTC_IMRL_MASKALL);

	MCF_INTC1_IMRH &= ~(0
	  | MCF_INTC_IMRH_INT_MASK35);
	    
	MCF_INTC1_ICR35 = MCF_INTC_ICR_IL(4);

	MCF_GPIO_PDDPAR = 0x0F;
	
	/* Set real time clock freq */

	MCF_CLOCK_RTCDR = 25000000;

	/* Set GPIO for UART0 */
    MCF_GPIO_PUAPAR = 0
        | MCF_GPIO_PUAPAR_URXD0_URXD0
        | MCF_GPIO_PUAPAR_UTXD0_UTXD0;

	
	wtm_init();
	pll_init();
	scm_init();
	
	initialize_exceptions();
}