分享

44b0x-p板Linux下ide硬盘成功挂接

 Archangel 2007-08-17
44b0x-p板Linux下ide硬盘成功挂接

Uncompressing Linux................................................................... done, booting the kernel.
Linux version 2.4.24-uc0 (root@czj) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http:///coldf6
Processor: Samsung S3C44B0X revision 0
Architecture: S3C44B0X
On node 0 totalpages: 2048
zone(0): 0 pages.
zone(1): 2048 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0 init=/linuxrc
uClinux Start time: 6- 1-21 13:26:23
Console: colour dummy device 80x30
Calibrating delay loop... 31.84 BogoMIPS
Memory: 8MB = 8MB total
Memory: 5880KB available (1892K code, 216K data, 64K init)
Dentry cache hash table entries: 1024 (order: 1, 8192 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 2048 (order: 1, 8192 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
ttyS0 at I/O 0x1d00000 (irq = 3) is a S3C44B0
ttyS1 at I/O 0x1d04000 (irq = 2) is a S3C44B0
LCD buffer : 0c260000
ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com)
Last modified Nov 1, 2000 by Paul Gortmaker
NE*000 ethercard probe at 0x8000000: 52 54 ab 12 34 56
eth0: NE1000 found at 0x8000000, using IRQ 22
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: C121CB0-C1F10AF [VIRTUAL C121CB0-C1F10AF] (RO)
RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
ide_init_hwif_ports
ide_init_default_hwifs
ide_init_hwif_ports
ide_init_hwif_ports
hda: SUNDOM V3.0S 512MMB, ATA DISK drive
ide0 at 0x4000002-0x4000009,0x400001c on irq 24
hda: attached ide-disk driver.
hda: task_no_data_intr: status=0x51 { DriveReady SeekComplete Error }
hda: task_no_data_intr: error=0x04 { DriveStatusError }
hda: 1000944 sectors (512 MB) w/2KiB Cache, CHS=993/16/63
Partition check:
hda: hda1
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
FAT: bogus logical sector size 26320
FAT: bogus logical sector size 26320
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 64K
hostname: not found
Welcome to
____ _ _
/ __| ||_|
_ _| | | | _ ____ _ _ _ _
| | | | | | || | _ \| | | |\ \/ /
| |_| | |__| || | | | | |_| |/ \
| ___\____|_||_|_| |_|\____|\_/\_/
| |
|_|


For further information check:
http://www./


# mount -t msdos /dev/hda1 /tmp
# cd /tmp
# ls -l
-rwxr-xr-x 1 0 0 0 Jan 20 18:12 bootlog.txt
-rwxr-xr-x 1 0 0 94292 Feb 18 2005 command.com
-r-xr-xr-x 1 0 0 224150 Feb 18 2005 io.sys
-r-xr-xr-x 1 0 0 9 Feb 18 2005 msdos.sys
#

1.确定IDE寄存器地址填充:
根据硬件设计有以下对应:
CS0 CS1 DA2 DA1 DA0
ADDR2 ADDR1 ADDR3 ADDR4 ADDR5 地址 功能 对应定义


1 0 1 0 1 0x0400001c Alternate status IDE_CTRL
0 1 0 0 0 0x04000002 Data IDE_DATA_OFFSET
0 1 0 1 0 0x04000022 Error IDE_ERROR_OFFSET
0 1 0 0 1 0x04000012 Sector Count IDE_NSECTOR_OFFSET
0 1 0 1 1 0x04000032 Sector Number IDE_SECTOR_OFFSET
0 1 1 0 0 0x0400000A Cylinder Low IDE_LCYL_OFFSET
0 1 1 1 0 0x0400002A Cylinder High IDE_HCYL_OFFSET
0 1 1 0 1 0x0400001A Device/Head IDE_SELECT_OFFSET
0 1 1 1 1 0x0400003A Status IDE_STATUS_OFFSET

p板IDE中断为EINT1.

2. 修改ide.h


//-----------------------ide.h---------------------?óè?μ?include/asm-armnommu/??????
/*
* linux/include/asm-arm/ide.h
*
* Copyright (C) 1994-1996 Linus Torvalds & authors
*/
/*
* This file contains the i386 architecture specific IDE code.
*/
#ifndef __ASMARMNOMMU_IDE_H
#define __ASMARMNOMMU_IDE_H
#ifdef __KERNEL__
#ifndef MAX_HWIFS
#define MAX_HWIFS 1
#endif
#define ide__sti() __sti()
#include <asm/arch/hardware.h>//ìá1?S3C44B0X?????÷μ??·
#include <asm/arch/irqs.h> //ìá1??D??o???
#include <linux/ide.h> //ìá1?1?óúó2?ìμ?ò?D?êy?Y?á11??ò?
#define IDE_BASE 0x04000000//ó2?ì?????÷?aê?μ??·
#define IDE_CTRL 0x0400001c//
#define IDE_IRQ S3C44B0X_INTERRUPT_EINT1 //ê1ó?μ?ía2??D??o?


//μ??·????,?a???ú??μ?ó2?tóD1??μ,óDμ???????ê?1,?òμ?ó2?té?ê?2
#define IDE_DATA_OFFSET (0)
#define IDE_ERROR_OFFSET (1)
#define IDE_NSECTOR_OFFSET (2)
#define IDE_SECTOR_OFFSET (3)
#define IDE_LCYL_OFFSET (4)
#define IDE_HCYL_OFFSET (5)
#define IDE_SELECT_OFFSET (6)
#define IDE_STATUS_OFFSET (7)
#define IDE_CONTROL_OFFSET (8)


/*----------------------------------------------------------*/
static __inline__ int ide_default_irq(ide_ioreg_t base)
{
return IDE_IRQ;
}
static __inline__ ide_ioreg_t ide_default_io_base(int index)
{
return IDE_BASE;
}
/*----------------------------------------------------------*/
/*
* 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,
ide_ioreg_t data_port,
ide_ioreg_t ctrl_port,
int *irq)
{
ide_ioreg_t reg = data_port;
printk("ide_init_hwif_ports\n");//??μ?ìáê?£?è??ò???aμàuClinuxμ?è·?üμ??aà?á?
hw->io_ports[IDE_DATA_OFFSET] = 0x04000002;
hw->io_ports[IDE_ERROR_OFFSET] = 0x04000022;
hw->io_ports[IDE_NSECTOR_OFFSET] = 0x04000012;
hw->io_ports[IDE_SECTOR_OFFSET] = 0x04000032;
hw->io_ports[IDE_LCYL_OFFSET] = 0x0400000A;
hw->io_ports[IDE_HCYL_OFFSET] = 0x0400002A;
hw->io_ports[IDE_SELECT_OFFSET] = 0x0400001A;
hw->io_ports[IDE_STATUS_OFFSET] = 0x0400003A;
hw->io_ports[IDE_CONTROL_OFFSET] = 0x0400001c;
}
/*----------------------------------------------------------*/
/*
* This registers the standard ports for this architecture with the IDE
* driver.
*/
static __inline__ void ide_init_default_hwifs(void)
{
hw_regs_t hw;
printk("ide_init_default_hwifs\n");
//--------------------------------------------------------
//(*(volatile unsigned short *)0x0A200000)|=0x0040; // Set IDE Reset to High


outl( inl(S3C44B0X_PCONG)|0x0c, S3C44B0X_PCONG);
outl( inl(S3C44B0X_PUPG) &0xfd, S3C44B0X_PUPG);
outl((inl(S3C44B0X_EXTINT) &0xffffff8f) | 0x00000040, S3C44B0X_EXTINT);
outl(inl(S3C44B0X_INTMSK) &( ~( 1 << 24 ) ),S3C44B0X_INTMSK );


//--------------------------------------------------------
ide_init_hwif_ports(&hw,IDE_BASE,IDE_CTRL, NULL);
hw.irq = IDE_IRQ;
ide_register_hw(&hw, NULL);
}
/*----------------------------------------------------------*/


#define __ide_mm_insw(port,addr,count) do { } while(0)
#define __ide_mm_insl(port,addr,count) do { } while(0)
#define __ide_mm_outsw(port,addr,count) do { } while(0)
#define __ide_mm_outsl(port,addr,count) do { } while(0)
#endif /* __KERNEL__ */
#endif /* __ASMARM_IDE_H */
//-------------------------end of ide.h-----------------------------------


3.移植.
在make menuconfig 后选择IDE相关选项:
A.选择IDE硬盘驱动
ATA/IDE/MFM/RLL support
Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
Include IDE/ATA-2 DISK support //选择支持IDE硬盘
B.选择文件系统支持
File systems
DOS FAT fssupport
MSDOS fs support
VFAT(Windows-95)fs support
C.选择分区支持
File systems
Partition Types
Advanced partition selection
PC BIOS (MSDOS partition tables) support
D.定义设备文件
改动 uClinux/vendors/Samsung/44b0x/下的makefile 文件内容,加入:
\
hda,b,3,0 hdb,b,3,64 \
hda1,b,3,1 hda2,b,3,2 hda3,b,3,3 hda4,b,3,4\
hda5,b,3,5 hda6,b,3,6 hda7,b,3,7 hda8,b,3,8\
hdb1,b,3,65 hdb2,b,3,66 hdb3,b,3,67 hdb4,b,3,68\
hdb5,b,3,69 hdb6,b,3,70 hdb7,b,3,71 hdb8,b,3,72\
\
然后编译即可.


附记:我挂接的是512M电子盘,2.5寸,44针接口.超过此大小的存贮介质在uClinux系统解压时就有问题,估计是要修改p板的BIOS文件.

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多