Nuno's Photo Blog
by Nuno
포토로그
카테고리
IXDP425 Port


IXDP425 Linux Porting

 


이 문서는 IXDP425보드에 RedBoot가 올라가 있다는 가정하에 시작한다.

1        RedBoot 사용

===============================================================
How to load redboot & linux image & ramdisk to IXP425 Board
==============================================================

1.1 load redboot.bin
- Use Flash Programmer
- Choose device: Intel E28F128J3A
- Put the chip in the burner and activate
- Load file redboot.bin
- Enable "Byte swap" via button
- Start program

1.2 load zImage & rramdisk
- Connect IXDP425 to your PC via 1:1 mapping RS232 cable
- On your PC run minicom(Linux) or hyperterminal(M$ windows) and choose 115200,8N1,NoFlow
- Power On IXDP425
- Redboot> fis init -f
- Redboot> fconfig -i /* setup local and server ip for tftp download */
- Redboot> reset
- RedBoot> load -r -v -b 0x01600000 -m ymodem


- activate ymodem of minicom or hyperterminal to download zImage
- RedBoot> fis create kernel -f 0x50040000 -l 0x100000 -b 0x01600000 -r 0x01600000   
- RedBoot> load -r -v -b 0x00800000 -m ymodem


- activate ymodem of minicom or hyperterminal to download ramdisk.gz
- RedBoot> fis create ramdisk -f 0x50140000 -l 0x300000 -b 0x00800000 -r 0x00800000
- RedBoot> fis list
  Name              FLASH addr  Mem addr    Length      Entry point
  RedBoot           0x50000000  0x50000000  0x00040000  0x00000000
  RedBoot config    0x507C0000  0x507C0000  0x00001000  0x00000000
  FIS directory     0x507E0000  0x507E0000  0x00020000  0x00000000
  kernel            0x50040000  0x01600000  0x00100000  0x00000000
  ramdisk           0x50140000  0x00800000  0x00300000  0x00000000

- RedBoot> fconfig /* Setup auto booup linux & ramdisk */

  Run script at boot: true
  Boot script:
  Enter script, terminate with empty line
  >> fis load kernel
  >> fis load ramdisk
  >> go 0x01600000
  >>
  Boot script timeout (10ms resolution): 1
  .
  .
  .
  Update RedBoot non-volatile configuration - are you sure (y/n)? y

Boot script timeout (10ms resolution): 1

- RedBoot> reset

2. Source , Compiler Toolchain download

① 다음과 같이 명령어를 사용하여 다운로드 받은 파일을 저장할 디렉토리를 생성해준다.

$ mkdir -p archive

위에서 생성한 archive 디렉토리에 필요한 모든 파일을 다운로드 받는다.
② SnapGear에서 최신 Arm Big-endian tool chain 을  다운로드한다.

arm-linux-tools-20031127.tar.gz

③ Intel IXP400 Access Library v1.4를 다운로드한다.

http://www.intel.com/design/network/products/npfamily/ixp425swr1.htm


-         다운로드를 위해 유저등록을 한다. IXDP425 serial number는 필요없다.

-         NPE를 지원하기위한 ixp400AccessLibrary-1_4.zip을 받는다.
-         NPE Crypto 를 지원하기 위한

( install directory에 두가지 다 존재할경우 install script는 WithCrypto를 지원할것이다.)

④ SnapGear에서 Snapgear v3.1.1 배포판을 다운로드한다.
http://ftp.snapgear.org/pub/snapgear/src/snapgear-3.1.1.tar.gz

⑤ sourceforge로부터 ixp425를 지원하는 install script와 patch를 지원하는 tar 파일을 다운로드한다.

snapgear-3.1.x-ixp400-v1.4.2-support.tar.gz

3. Compiler Tool Chain 설치

image를 생성하기위해 Kernel, library, application 을 컴파일 하기전에 캄파일러와 toolchain을 설치하여야 한다. 위에서 다운로드한 arm-linux toolchain을 install 하기위해 root로 로그인하고 toolchain 압축을 푼다.

$ su -
password:
# cd /
# tar xzvf ~/archive/arm-linux-tools-20030927.tar.gz
# exit
$

/usr/local 에 toolchain이 압축이 풀리며 설치된다. 실행파일이 /usr/local/bin 에 설치 되므로 /et/bashrc 에 PATH를 /usr/local/bin을 추가 해주고 source해준다.

4        리눅스 배포판 소스 설치
다음과 같이 소스의 압축을 푼다.

$ tar zxvf archive/snapgear-3.1.1.tar.gz

snapgear라는 서브 디렉토리가 생성된다.

5.ixp400AccessLibrary 지원 파일 설치

snapger 디렉토리로 옮겨서 지원 압축파일을 풀고 ixp400AccessLibrary-1_4.zip을 snapgear의 vendor 디렉토리에 복사한다. 그리고 설치 스크립트를 실행시킨다.

$ cd snapgear
$ tar xzvf ../archive/snagear-3.1.x-ixp400-v1.4.2-support.tar.gz
$ cp ../archive/ixp425AccessLibrary-1_4.zip  vendors/Intel/IXDP425 /ixp400-1.4-uclinux
$ vendors/Intel/IXDP425/ixp400-1.4-uclinux/install

6. Linux Kernel 및 파일시스템 이미지 생성

kernel 과 ramdisk 이미지를 생성하는 것은 아주 쉽다. 다음 단계를 따라하기만 하면 된다.

가)      다음 명령으로 시작한다.

$ make menuconfig

설정 스크립트가 읽히고 Main Menu 설정 화면이 디스플레이 될것이다.


나)      “Vendor / Product Selection” 을 선택하고 Vendor는 Intel 로  Products 는 IXDP425 로 설정한다.
다)      “Kernel/Library/Defaults” 를 선택하고 Kernel Version은 linux-2.4.x를 Libc Version은 glibc로 선택하고 Default all settings를 체크한다.
라)      저장하고 빠져 나와서

$ make dep; make

7. IXDP425에서의 실행

컴파일이 끝나면 다음과 같이 redboot을 이용해 이미지를 올리라는 메시지가 출력된다.

+----------------------------------------------------
| Build Complete
|
| Images are in /home/dub/SmapGear/snapgear/images
|
| As root, copy the images to /tftpboot
|  Load the images using the RedBoot v1.92  commands:
|
|    load -r -v -b 0x01600000 zImage
|    load -r -v -b 0x00800000 ramdisk.gz
|    exec 0x01600000
|
+----------------------------------------------------

redboot을  이용해 램이나 혹은 flash에 이미지들을 올리고 보드를 부트시킨다.

8. 테스트
rc script를 보면 부트시 ethernet 설정에 대해 나오므로 적당히 수정하여 사용한다.
부트시 boa 서버나 telnet 서버가 올라가 있으므로 테스트해본다.





참조 :

   http://ixp4xx-osdg.sourceforge.net/

   http://sourceforge.net/projects/ixp4xx-osdg/

   http://sourceforge.net/projects/gatewaymaker/





커널의 메모리 맵 ~/arch/arm/mach-ixp425/mm.c 를 다음과 같이 수정해준다.

/* Queue Manager - Required for Intel CSR and NPE access */
{
IXP425_QMGR_BASE_VIRT,
IXP425_QMGR_BASE_PHYS,
IXP425_QMGR_REGION_SIZE,
DOMAIN_IO, 1, 1, 0, 0
/* r  w  c  b */
},
/* Map exp. bus chip 1 (16Mb) */
{
IXP425_EXP_BUS_CS1_BASE_VIRT,
IXP425_EXP_BUS_CS1_BASE_PHYS,
IXP425_EXP_BUS_CSX_REGION_SIZE,
DOMAIN_IO, 1, 1, 0, 0, 0
/* r  w  c  b  x */
},
/* Map exp. bus chip 4 (16Mb) */
{
IXP425_EXP_BUS_CS4_BASE_VIRT,
IXP425_EXP_BUS_CS4_BASE_PHYS,
IXP425_EXP_BUS_CSX_REGION_SIZE,
DOMAIN_IO, 1, 1, 0, 0, 0
/* r  w  c  b  x */
},
LAST_DESC



그리고 다시 컴파일

# make dep; make

 

#insmod dm642.o

Using dm642.o

dm642 driver upload !!

Extend address phase by 2

Extend setup phase by 2

Extend strobe phase by 9

Extend hold phase by 2

Extend reverse phase by 9

configured exp for HPI

address space of 2^24

byte access disabled

HPI HRDY polarity low true

multiplexed address / data on data bus

AHB split transfers disabled

Writes to CS region are enabled

Expansion bus use 16bit wide data bus

dm642 emif init


 

        NFS 사용

가)     Host

나)     Target

       Kernel Option :

File Systems-> Network File Systems  --->

<*> NFS file system support

[*]   Provide NFSv3 client support

        USB

가)     Storage

       Kernel Option Check:

USB support  --->

<*> Support for USB                                                            

     [ ]   USB verbose debug messages                                               

     --- Miscellaneous USB options                                                  

     [*]   Preliminary USB device filesystem                                        

     [ ]   Enforce USB bandwidth allocation (EXPERIMENTAL)                          

     --- USB Host Controller Drivers                                                

     <*>   EHCI HCD (USB 2.0) support (EXPERIMENTAL)                                

     <*>   UHCI (Intel PIIX4, VIA, ...) support                                     

     <*>   OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support                        

     < >   SL811HS Alternate (x86, StrongARM, isosynchronous mode)                  

     < >   SL811HS (x86, StrongARM) support, old driver                             

     --- USB Device Class drivers                                                   

     < >   USB Bluetooth support (EXPERIMENTAL)                                     

     <*>   USB Mass Storage support

File Systems->

[*] /dev file system support (EXPERIMENTAL)

Partition Types  --->

[*] Advanced partition selection

[*]   PC BIOS (MSDOS partition tables) support

 

         32M flash 사용

부트로더 먼저 바꿔주고

~/snapear/linux-2.4.x/drivers/mtd/maps/ixp425.c

 26 #define WINDOW_SIZE     0x01000000    //0x02000000 -> 0x01000000

...


 *IXP425_EXP_CS0 &= ~IXP425_FLASH_WRITABLE;   // CS1 주석처리

// *IXP425_EXP_CS1 &= ~IXP425_FLASH_WRITABLE;

 *IXP425_EXP_CS0 |= IXP425_FLASH_WRITABLE;

// *IXP425_EXP_CS01 |= IXP425_FLASH_WRITABLE;

 

         Double 연산 에러 수정

 diff -urN linux-2.6.9.orig/arch/arm/nwfpe/double_cpdo.c linux-2.6.9/arch/arm/nwfpe/double_cpdo.c
--- linux-2.6.9.orig/arch/arm/nwfpe/double_cpdo.c        2004-10-18 23:53:06.000000000 +0200
+++ linux-2.6.9/arch/arm/nwfpe/double_cpdo.c        2004-10-28 23:04:35.471372456 +0200
@@ -75,7 +75,11 @@
        union float64_components u;

        u.f64 = rFm;
+#ifdef __ARMEB__
+        u.i[0] ^= 0x80000000;
+#else
        u.i[1] ^= 0x80000000;
+#endif

        return u.f64;
}
@@ -85,7 +89,11 @@
        union float64_components u;

        u.f64 = rFm;
+#ifdef __ARMEB__
+        u.i[0] &= 0x7fffffff;
+#else
        u.i[1] &= 0x7fffffff;
+#endif
        return u.f64;
}

         IPtables 사용하여 IP공유기 만들기

가)      커널설정

        Network Option

<*> Packet socket                                                         

                 [ ]   Packet socket: mmapped IO                                            

                 < > Netlink device emulation                                              

                 [*] Network packet filtering (replaces ipchains)                          

                 [ ]   Network packet filtering debugging                                  

                 [ ] Socket Filtering                                                      

                 <*> Unix domain sockets                                                   

                 [*] TCP/IP networking                                                     

                 [ ]   IP: multicasting                                                    

                 [ ]   IP: advanced router                                                 

                 [ ]   IP: kernel level autoconfiguration                                  

                 [ ] ARP MAC Limiting                                                      

                 < >   IP: tunneling                                                        

                 < >   IP: GRE tunnels over IP                                             

                 [ ]   IP: ARP daemon support (EXPERIMENTAL)                               

                 [ ]   IP: TCP Explicit Congestion Notification support                    

                 [*]   IP: TCP syncookie support (disabled per default)                    

                   IP: Netfilter Configuration  --->                                       

                   IP: Virtual Server Configuration  --->                                  

                 < >   The IPv6 protocol (EXPERIMENTAL)                                    

… 모두 체크 안함

        IP: Netfilter Configuration

<*> Connection tracking (required for masq/NAT)                            

                 <*>   FTP protocol support                                                

                 [ ]   Connection mark tracking support                                    

                 < >   H.323 (netmeeting) support                                           

                 < >   Amanda protocol support                                             

                 < >   TFTP protocol support                                               

                 < >   IRC protocol support                                                

                 < >   GRE protocol support                                                

                 < > Userspace queueing via NETLINK (EXPERIMENTAL)                         

                 <*> IP tables support (required for filtering/masq/NAT)                   

                 <*>   limit match support                                                 

                 < >   IP range match support                                               

                 <*>   MAC address match support                                           

                 < >   Packet type match support                                           

                 <*>   netfilter MARK match support                                         

                 < >   Multiple port match support                                         

                 <*>   TOS match support                                                   

                 < >   TIME match support (EXPERIMENTAL)                                   

                 < >   recent match support                                                

                 < >   ECN match support                                                   

                 < >   DSCP match support                                                  

                 < >   AH/ESP match support                                                

                 < >   LENGTH match support                                                 

                 < >   TTL match support                                                   

                 <*>   tcpmss match support                                                

                 < >   Helper match support                                                 

                 <*>   Connection state match support                                      

                 < >   Connection tracking match support                                   

                 <*>   Unclean match support (EXPERIMENTAL)                                

                 < >   String match support (EXPERIMENTAL)                                 

                 <*>   Owner match support (EXPERIMENTAL)                                  

                 <*>   Packet filtering                                                    

                 <*>     REJECT target support                                             

                 <*>     MIRROR target support (EXPERIMENTAL)                               

                 <*>   Full NAT                                                            

                 <*>     MASQUERADE target support                                         

                 <*>     REDIRECT target support                                            

                 < >     NETMAP target support                                             

                 [ ]     NAT of local connections (READ HELP)                              

                 < >     Basic SNMP-ALG support (EXPERIMENTAL)                             

                 < >   Packet mangling                                                     

                 <*>   LOG target support                                                  

                 < >   ULOG target support                                                 

                 <*>   TCPMSS target support                                               

                 < > ARP tables support

 

나)      IPTABLES 컴파일 사용

Network Application 에서 Iptables 추가해 주고 다음 스크립트를 실행해 준다.

# ifconfig ixp1 192.168.0.1 netmask 255.255.255.0 up

# iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE

# echo 1 > /proc/sys/net/ipv4/ip_forward

 

다)      테스트

각 클라이언트 기기에서 192.168.0.2~24 사이의 번호로 세팅하고 default gateway를 192.168.0.1 로 세팅해주고 테스트.

DOMAIN NAME으로 접속이 안될경우 /etc/resolv.conf를 다음과 같이 세팅해준다.

search

nameserver 218.36.109.1

nameserver 218.36.108.2

 

         DHCPCD , DHCPD 사용하여 동적 IP사용하기

가)      커널설정

 DHCPD를 사용하기 위해서 커널에서 CONFIG_PACKET 와 CONFIG_FILTER 을 정의해 주어야하므로 커널 옵션설정에서 Packet socket과 Socket Filtering을 체크해준다.

나)      Network Application 에서 dhcpd(full)와 dhcpcd를 추가해주고 다음 스크립트를 실행시킨다.

# dhcpd ixp1 -q &  (DHCP서버행)

# dhcpcd ixp0 &    (DHCP클라이언트실행)

!) DHCP클라이언트실행시 “ixp425_eth: ixp0: unable to signal thread”와 같은 메시지가 출력되면 같은 라우터내에 DHCP서버가 동작되고 있지 않기 때문이다.




PCI HDD driver 올리기

PCI HDD Controller 는 PROMISE PDC20265를 사용했다.



1.       커널 옵션 설정

A.        General Setup -> [*] PCI device name database

B.       ATA/ATAPI/MFM/RLL support -> <*> ATA/ATAPI/MFM/RLL support -> IDE, ATA and ATAPI Block devices -a

<*> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support

<*>   Include IDE/ATA-2 DISK support

[*]   PCI IDE chipset support

[*]     Generic PCI IDE Chipset Support

[*]     Generic PCI bus-master DMA support

[*]     Boot off-board chipsets first support

[*]       Use PCI DMA by default when available

<*>     PROMISE PDC202{46|62|65|67} support



C.       File systems

<*> Ext3 journalling file system support

<*> Second extended fs support

Partition Types -> [*] Advanced partition selection

[*]   PC BIOS (MSDOS partition tables) support



2.       PCI 인터럽트 수정

처음에는 위와 같은 옵션에서 부트시 커널에서는 PROMISE HDD Controller만 detect되고 HDD는 제대로 인식하지 못했다.

이리저리 고민끝에 하드웨어 엔지니어가 저항값을 조금 바꿔주자 HDD를 인식하기 시작했다.

그러나 기쁨도 잠시뿐 계속 lost interrupt! 라는 메시지만 계속 출력되다가 램디스크를 로딩하면서 interpreter error가 출력되면 커널이 죽었다.

보드에 연결된 인터럽트와 실제 커널에서 지정된 인터럽트 번호가 다른 것이다. 보드 설계시 이런점을 염두해두지 않고 디자인되어 결국 커널의 PCI드라이버에서 인터럽트 번호를 수정해주어야 했다.



~linux/include/asm-arm/arch-ixp425/irqs.h 파일을 다음과 같이 수정해준다.



/** IXDP425 Board IRQs*/

#define IRQ_IXDP425_PCI_INTA    IRQ_IXP425_GPIO9   //IDE INT

#define IRQ_IXDP425_PCI_INTB    IRQ_IXP425_GPIO10  //USB INT

#define IRQ_IXDP425_PCI_INTC    IRQ_IXP425_GPIO8   //DSP INT

#define IRQ_IXDP425_PCI_INTD    IRQ_IXP425_GPIO11  // NONE



그리고 make dep, make linux,make image



HDD test



fdisk로 확인

mke2fs 로 포맷

e2fsck 로 파일시스템 체크



mount 시킨후 dd if=/dev/zero of=test bs=1M count=1024 로 테스트



흠... 포맷 도중에 dma 에러가 발생하여 속도를 낮추었다.

~/drivers/ide/pci/pdc202xx_old.c 수정



    pci_read_config_byte(dev, (drive_pci), &AP);
    pci_read_config_byte(dev, (drive_pci)|0x01, &BP);
    pci_read_config_byte(dev, (drive_pci)|0x02, &CP);

    speed = XFER_UDMA_1; // 다음을 추가하여 속도를 낮추었다.
    printk("HDD SPEED = %xn",speed);

    switch(speed) {
            case XFER_UDMA_6:       speed = XFER_UDMA_5;
            case XFER_UDMA_5:
            case XFER_UDMA_4:       TB = 0x20; TC = 0x01; break;
            case XFER_UDMA_2:       TB = 0x20; TC = 0x01; break;
            case XFER_UDMA_3:
            case XFER_UDMA_1:       TB = 0x40; TC = 0x02; break;
            case XFER_UDMA_0:



Ram 용량수정시는 커널의 command string 에서 RAM부분을 수정한다
 


I2C 사용
Kernel Option Menu 에서
Character devices  ---> I2C support  --->
<*> I2C support
<*> I2C bit-banging interfaces
        ...

<*> IXP425 GPIO-based I2C adapter
        ...

<*> I2C device interface
        ...

혹 커널옵션에 메뉴가 없으면 ~linux-2.4.x/drivers/i2c/Config.in에 다음과 같이 추가해준다.


  dep_tristate '  NatSemi SCx200 I2C using GPIO pins' CONFIG_SCx200_I2C $CONFIG_SCx200 $CONFIG_I2C_ALGOBIT
  if [ "$CONFIG_SCx200_I2C" != "n" ]; then
     int  '    GPIO pin used for SCL' CONFIG_SCx200_I2C_SCL 12
     int  '    GPIO pin used for SDA' CONFIG_SCx200_I2C_SDA 13
  fi
  dep_tristate '  NatSemi SCx200 ACCESS.bus' CONFIG_SCx200_ACB $CONFIG_I2C
  if [ "$CONFIG_ARCH_IXP425" = "y" ]; then
  dep_tristate '  IXP425 GPIO-based I2C adapter' CONFIG_I2C_IXP425 $CONFIG_I2C_ALGOBIT
  fi



혹 커널 컴파일시 I2C_HW_B_IXP425 가 define되어 있지 않다고 나오면
~linux-2.4.x/include/linux/i2c-id.h 다음과 같이 추가

#define I2C_HW_B_IOC    0x11    /* IOC bit-wiggling                     */
#define I2C_HW_B_TSUNA  0x12    /* DEC Tsunami chipset                  */
#define I2C_HW_B_COLDF  0x13    /* Motorola Coldfire GPIO I2C           */
#define I2C_HW_B_IXP425 0x17    /* IXP425-style  GPIO I2C               */

 
 
 
by Nuno | 2005/12/04 14:20 | BRAIN | 트랙백(1) | 덧글(4)
트랙백 주소 : http://nunorock.egloos.com/tb/997611
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
Tracked from chaffery nwy.. at 2006/10/22 21:36

제목 : chaffery nwython
chaffery nwython...more

Commented by Robert at 2007/04/06 01:30
nice
Commented by Robert at 2007/04/06 01:31
nice
Commented by Naomi at 2007/04/06 01:46
hello
Commented by Naomi at 2007/04/06 01:50
hello

:         :

:

비공개 덧글



<< 이전 페이지 다음 페이지 >>


이글루 파인더
메모장
이글루 링크
최근 등록된 덧글
<a href=http://www.you..
by Buy Generi at 07/20
<a href=http://pipes.y..
by Porn Clip at 07/16
<a href=http://pipes.y..
by Gay porn v at 07/15
<a href=http://www.goo..
by Order cial at 06/04
good
by yanghui at 05/24
hello
by Naomi at 04/06
hello
by Naomi at 04/06
hello
by Naomi at 04/06
hello
by Naomi at 04/06
hello
by Naomi at 04/06
메뉴릿


rss

skin by 이글루스