⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fft24x0-ide.c

📁 linux和2410结合开发 用他可以生成2410所需的zImage文件
💻 C
字号:
/* linux/drivers/ide/fft24x0-ide.c * * Copyright (c) 2004  kingmonkey * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Changelog: *  27-DEC-2004 Kingmonkey Created file, PIO code **/#include <linux/module.h>#include <linux/slab.h>#include <linux/blkdev.h>#include <linux/errno.h>#include <linux/ide.h>#include <linux/init.h>#include <asm/irq.h>#include <asm/io.h>#include <asm/hardware.h>#include <asm/arch/irq.h>static inline intfft24x0ide_register_channel(unsigned int base, unsigned int aux, int irq){	hw_regs_t hw;	int res;	int i;	memset(&hw, 0, sizeof(hw));	printk("fft24x0-ide: registering channel, base=%08x (%08x), irq=%d\n",	       base, aux, irq);	for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {		hw.io_ports[i] = (ide_ioreg_t)(base);#if 0		printk("hw_port[%d] = %08x (%08x)\n", i,		       hw.io_ports[i], virt_to_phys(hw.io_ports[i]));#endif		base +=2;	}	hw.io_ports[IDE_CONTROL_OFFSET] = aux +0xc;	hw.irq = irq;	i = IDE_CONTROL_OFFSET;#if 0	printk("hw_port[%d] = %08x (%08x)\n", i,	       hw.io_ports[i], virt_to_phys(hw.io_ports[i]));#endif	res = ide_register_hw(&hw, NULL);		return res;}int fft24x0ide_init(void){	printk("fft24x0: IDE driver, kingmonkey (c) 2005 FFTCHINA \n");		  BWSCON = (BWSCON & ~(BWSCON_ST1 | BWSCON_WS1 | BWSCON_DW1)) |      	( BWSCON_WS1 | BWSCON_DW(1, BWSCON_DW_16));	BANKCON1= BANKCON_Tacs4 | BANKCON_Tcos4 | BANKCON_Tacc14 |		BANKCON_Toch1 | BANKCON_Tcah1 | BANKCON_Tacp6 ;	  		set_external_irq(IRQ_IDE0, EXT_RISING_EDGE, GPIO_PULLUP_DIS);	disable_irq(IRQ_IDE0);	enable_irq(IRQ_IDE0);		fft24x0ide_register_channel(vFFT24X0IDE_BASE, vFFT24X0IDEAUX_BASE, IRQ_IDE0);	return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -