Beispiel #1
0
void Isr_Init(void)
{
	int i = 0;
	intregs = S3C24X0_GetBase_INTERRUPT();

	for (i = 0; i < sizeof(isr_handle_array) / sizeof(isr_handle_array[0]); i++ )
	{
		isr_handle_array[i] = Dummy_isr;
	}

	intregs->INTMOD=0x0;				// All=IRQ mode
	intregs->INTMSK=BIT_ALLMSK;			// All interrupt is masked.

	//pISR_URXD0=(unsigned)Uart0_RxInt;
	//rINTMSK=~(BIT_URXD0);				//enable UART0 RX Default value=0xffffffff

	isr_handle_array[ISR_TIMER4_OFT] = IsrTimer4;
	isr_handle_array[ISR_WDT_OFT]  = IsrWatchdog;

#ifdef CONFIG_USB_DEVICE
	isr_handle_array[ISR_USBD_OFT] = IsrUsbd;
	isr_handle_array[ISR_DMA2_OFT] = IsrDma2;
	ClearPending(BIT_DMA2);
	ClearPending(BIT_USBD);
#endif
}
Beispiel #2
0
void usb_init_slave(void)
{
	char *mode;
	int i;
	U8 key;
	U32 mpll_val, upll_val, divn_upll=0;
	extern int bBootFrmNORFlash(void);

	/* start add by ll ,replace the Port_Init() */
	gpioregs = S3C24X0_GetBase_GPIO();
	gpioregs->GPGCON = 0xfd95ffba;	/* thisway.diy, GPG12-->OUTPUT, GPG9-->OUTPUT for FS2410, as USB Device enable */
	gpioregs->GPGUP  = 0xffff;	// The pull up function is disabled GPG[15:0]
	gpioregs->GPGDAT &= ~(1<<12);	/* disable USB Device, enable later, thisway.diy */
	/* end ll */

	clk_powerregs = S3C24X0_GetBase_CLOCK_POWER();

	usbdevregs = S3C24X0_GetBase_USB_DEVICE();
	dmaregs = S3C24X0_GetBase_DMAS();

	udelay(100000);
#if 0
	// USB device detection control
	rGPGCON &= ~(3<<24);
	rGPGCON |=  (1<<24); // output
	rGPGUP  |=  (1<<12); // pullup disable
	rGPGDAT |=  (1<<12); // output
#endif

	//ChangeUPllValue(60,4,2);		// 48MHz
	//for(i=0; i<7; i++);
	//ChangeClockDivider(13,12);
	//ChangeMPllValue(97,1,2);		//296Mhz

	Isr_Init();


	gpioregs->MISCCR=gpioregs->MISCCR&~(1<<3); // USBD is selected instead of USBH1
	gpioregs->MISCCR=gpioregs->MISCCR&~(1<<13); // USB port 1 is enabled.

//
//  USBD should be initialized first of all.
//
	isUsbdSetConfiguration=0;

#if 0
	UsbdMain();
	MMU_Init(); //MMU should be reconfigured or turned off for the debugger,
	//After downloading, MMU should be turned off for the MMU based program,such as WinCE.
#else
//thisway.diy	MMU_EnableICache();
	UsbdMain();
	udelay(100000);
	gpioregs->GPGDAT |= ((1<<9) | (1<<12));  /* enable USB Device, thisway.diy */
	gpioregs->GPBDAT |= (1<<9);   /* enable USB Device, thisway.diy */
	gpioregs->GPCDAT |= (1<<5);   /* enable USB Device, thisway.diy */
#endif

#if USBDMA
	mode="DMA";
#else
	mode="Int";
#endif

	// CLKOUT0/1 select.
	//printf("CLKOUT0:MPLL in, CLKOUT1:RTC clock.\n");
	//Clk0_Enable(0);	// 0:MPLLin, 1:UPLL, 2:FCLK, 3:HCLK, 4:PCLK, 5:DCLK0
	//Clk1_Enable(2);	// 0:MPLLout, 1:UPLL, 2:RTC, 3:HCLK, 4:PCLK, 5:DCLK1
//	Clk0_Disable();
//	Clk1_Disable();

	mpll_val = clk_powerregs->MPLLCON;
	upll_val = clk_powerregs->UPLLCON;


	if (0) //(!bBootFrmNORFlash())
	{
		S3C24X0_INTERRUPT * intregs;
		intregs = S3C24X0_GetBase_INTERRUPT();
		printf("UPLLVal [M:%xh,P:%xh,S:%xh]\n", (upll_val&(0xff<<12))>>12,(upll_val&(0x3f<<4))>>4,(upll_val&0x3));
		printf("MPLLVal [M:%xh,P:%xh,S:%xh]\n", (mpll_val&(0xff<<12))>>12,(mpll_val&(0x3f<<4))>>4,(mpll_val&0x3));
		printf("CLKDIVN:%xh\n", clk_powerregs->CLKDIVN);

			intregs->INTSUBMSK = 0x3ff;
			gpioregs->GPBDAT = 0x740;
			gpioregs->GPCDAT = 0x20;
			gpioregs->GPGDAT = 0xba2c;

		printf("\nINTMOD = %x\n", intregs->INTMOD);
		printf("INTMSK = %x\n", intregs->INTMSK);
		printf("INTSUBMSK = %x\n", intregs->INTSUBMSK);

		printf("\nGPBCON = %x\n", gpioregs->GPBCON);
		printf("GPBDAT = %x\n", gpioregs->GPBDAT);
		printf("GPCCON = %x\n", gpioregs->GPCCON);
		printf("GPCDAT = %x\n", gpioregs->GPCDAT);
		printf("GPGCON = %x\n", gpioregs->GPGCON);
		printf("GPGDAT = %x\n", gpioregs->GPGDAT);
/*
		printf("\n\n");
		printf("+---------------------------------------------+\n");
		printf("| S3C2440A USB Downloader ver R0.03 2004 Jan  |\n");
		printf("+---------------------------------------------+\n");
	//	printf("FCLK=%4.1fMHz,%s mode\n",FCLK/1000000.,mode);
		printf("USB: IN_ENDPOINT:1 OUT_ENDPOINT:3\n");
		printf("FORMAT: <ADDR(DATA):4>+<SIZE(n+10):4>+<DATA:n>+<CS:2>\n");
		printf("NOTE: Power off/on or press the reset button for 1 sec\n");
		printf("	  in order to get a valid USB device address.\n");
		printf("\n");
*/
	}
void s3c2410_irq(void)
{
	S3C24X0_INTERRUPT * irq = S3C24X0_GetBase_INTERRUPT();
	u_int32_t intpnd = irq->INTPND;

}
void do_irq (struct pt_regs *pt_regs)
{
    S3C24X0_INTERRUPT * irq = S3C24X0_GetBase_INTERRUPT();
    u_int32_t intpnd = irq->INTPND;

}
Beispiel #5
0
void maskintr()
{
	S3C24X0_INTERRUPT *const intr = S3C24X0_GetBase_INTERRUPT();
	intr->INTMSK = 0xffffffff;
	intr->INTSUBMSK = 0xffff;
}