📄 ide.h
字号:
/* * linux/include/asm-arm/arch-sa1100/ide.h * * Copyright (c) 1998 Hugo Fiennes & Nicolas Pitre * * 18-aug-2000: Cleanup by Erik Mouw (J.A.K.Mouw@its.tudelft.nl) * Get rid of the special ide_init_hwif_ports() functions * and make a generalised function that can be used by all * architectures. */#include <linux/config.h>#include <asm/irq.h>#include <asm/hardware.h>#include <asm/mach-types.h>#ifdef CONFIG_ARCH_FS_PXA255_V30 #define PXA255_IDE_BASE 0x04000020 #define PXA255_IDE_CTL_BASE 0x04000010#else #define PXA255_IDE_BASE 0x04e00000 #define PXA255_IDE_CTL_BASE 0x04d00000#endif/* * Set up a hw structure for a specified data port, control port and IRQ. * This should follow whatever the default interface uses. */static inline void ide_spc_init_ports(hw_regs_t *hw, unsigned long data_port, unsigned long ctrl_port, int *irq){ unsigned long reg = data_port; int i; int regincr = 1 << 1; memset(hw, 0, sizeof(*hw)); for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { hw->io_ports[i] = reg; reg += regincr; } hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; if (irq) *irq = 0;}/* * This registers the standard ports for this architecture with the IDE * driver. */static __inline__ voidide_init_default_hwifs(void){ if (machine_is_lubbock()) { hw_regs_t hw; unsigned long ide_base, ide_ctl_base; int reg_ret; /* Enable GPIO as interrupt line */ set_irq_type(IRQ_GPIO(32), IRQT_RISING); ide_base = (unsigned long)ioremap(PXA255_IDE_BASE, 0x00100000); if(!ide_base) { printk(KERN_ERR "fail to remap base address for ide!\n"); return; } ide_ctl_base = (unsigned long)ioremap(PXA255_IDE_CTL_BASE, 0x00100000); if(!ide_ctl_base) { printk(KERN_ERR "fail to remap control base address for ide!\n"); iounmap((void *)ide_base); return; } /* init the interface */ ide_spc_init_ports(&hw, ide_base, ide_base+0x0c, NULL); hw.irq = IRQ_GPIO(32); reg_ret = ide_register_hw(&hw, NULL);// printk("ide_register_hw = %d\n", reg_ret); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -