도와주세요!!
글 수 15,339
2003.09.25 00:33:05 (*.68.65.11)
6686
EZ-M01의 IDE 강좌에서 처럼 IDE보드를 만들어서 EZ-X5에 연결했는데 잘 안되
네요.
제가 수정한 커널 소스입니다.
혹시 틀린부분이나 제가 잘못 생각하고 있는 부분이 있으면 지적해 주시면 감
사하겠습니다.
GPIO8, nCS3 사용했습니다.
커널 옵션은 설정했습니다.
*******************************************************************
BOOTING MESSAGE
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 50MHz system bus speed for PIO modes; override with
idebus=xx
*******************************************************************
linux/include/asm/arch/ide.h
#include
#include
#include
#include
/*
* 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_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int
*irq)
{
ide_ioreg_t reg;
/* for ez_x5 */
int regincr = 2;
memset(hw, 0, sizeof(*hw));
reg = (ide_ioreg_t)data_port;
hw->io_ports[IDE_DATA_OFFSET] = reg + regincr*0;
hw->io_ports[IDE_ERROR_OFFSET] = reg + regincr*1;
hw->io_ports[IDE_NSECTOR_OFFSET] = reg + regincr*2;
hw->io_ports[IDE_SECTOR_OFFSET] = reg + regincr*3;
hw->io_ports[IDE_LCYL_OFFSET] = reg + regincr*4;
hw->io_ports[IDE_HCYL_OFFSET] = reg + regincr*5;
hw->io_ports[IDE_SELECT_OFFSET] = reg + regincr*6;
hw->io_ports[IDE_STATUS_OFFSET] = reg + regincr*7;
hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
if (irq)
*irq = 0;
}
/*
* Register the standard ports for this architecture with the IDE driver.
*/
static __inline__ void
ide_init_default_hwifs(void)
{
/* Nothing to declare... */
/* for ez_x5 */
hw_regs_t hw;
#define EZ_IDE_IO_BASE 0xf3000000 //nCS3
#define EZ_IDE_IO_RANGE 0x00001000
#define EZ_IDE_GPIO_IRQ 8
#define EZ_IDE_IRQ IRQ_GPIO(EZ_IDE_GPIO_IRQ)
GPDR0 &= ~( 1<
set_GPIO_IRQ_edge ( EZ_IDE_GPIO_IRQ, GPIO_RISING_EDGE );
ide_init_hwif_ports(&hw, EZ_IDE_IO_BASE, EZ_IDE_IO_BASE+0x100+
(6<<1), NULL);
hw.irq = EZ_IDE_IRQ;
ide_register_hw(&hw, NULL);
}
네요.
제가 수정한 커널 소스입니다.
혹시 틀린부분이나 제가 잘못 생각하고 있는 부분이 있으면 지적해 주시면 감
사하겠습니다.
GPIO8, nCS3 사용했습니다.
커널 옵션은 설정했습니다.
*******************************************************************
BOOTING MESSAGE
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 50MHz system bus speed for PIO modes; override with
idebus=xx
*******************************************************************
linux/include/asm/arch/ide.h
#include
#include
#include
#include
/*
* 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_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int
*irq)
{
ide_ioreg_t reg;
/* for ez_x5 */
int regincr = 2;
memset(hw, 0, sizeof(*hw));
reg = (ide_ioreg_t)data_port;
hw->io_ports[IDE_DATA_OFFSET] = reg + regincr*0;
hw->io_ports[IDE_ERROR_OFFSET] = reg + regincr*1;
hw->io_ports[IDE_NSECTOR_OFFSET] = reg + regincr*2;
hw->io_ports[IDE_SECTOR_OFFSET] = reg + regincr*3;
hw->io_ports[IDE_LCYL_OFFSET] = reg + regincr*4;
hw->io_ports[IDE_HCYL_OFFSET] = reg + regincr*5;
hw->io_ports[IDE_SELECT_OFFSET] = reg + regincr*6;
hw->io_ports[IDE_STATUS_OFFSET] = reg + regincr*7;
hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
if (irq)
*irq = 0;
}
/*
* Register the standard ports for this architecture with the IDE driver.
*/
static __inline__ void
ide_init_default_hwifs(void)
{
/* Nothing to declare... */
/* for ez_x5 */
hw_regs_t hw;
#define EZ_IDE_IO_BASE 0xf3000000 //nCS3
#define EZ_IDE_IO_RANGE 0x00001000
#define EZ_IDE_GPIO_IRQ 8
#define EZ_IDE_IRQ IRQ_GPIO(EZ_IDE_GPIO_IRQ)
GPDR0 &= ~( 1<
ide_init_hwif_ports(&hw, EZ_IDE_IO_BASE, EZ_IDE_IO_BASE+0x100+
(6<<1), NULL);
hw.irq = EZ_IDE_IRQ;
ide_register_hw(&hw, NULL);
}