设为首页收藏本站

恩山无线论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
小博无线
查看: 12697|回复: 23

移植HG255D的编译参数到openwrt的trunk中

    [复制链接]
发表于 2012-8-5 14:54 | 显示全部楼层 |阅读模式
本帖最后由 hoowa.sun 于 2012-8-5 15:03 编辑

参考了帖子:http://www.right.com.cn/forum/forum.php?mod=viewthread&tid=80205

后发现到现在trunk里也没有HG255D的支持,于是自己做移植。

一共修改了这些文件:
?       target/linux/ramips/files/arch/mips/ralink/rt305x/mach-hg255d.c
M       target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig
M       target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile
M       target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
M       target/linux/ramips/image/Makefile
?       target/linux/ramips/rt305x/profiles/hg255d.mk
M       target/linux/ramips/rt305x/config-3.3


其中marc-hg255d.c文件要做修改,因为dreambox使用的backfire版跟trunk版有一些函数接口不一样了。所以我吧led灯和button的配置一并注释掉。

然后我进行标准的编译,多余的软件一概不加。 编译万事后成功了。通过USB-TTL刷机。可以刷进去。

能看到kernel启动了。但是发现找不到根文件系统。

我跟一些朋友商量他们说是由于mtd的配置信息不正确。但是我实在是不知道怎么改mtd的配置信息,不是很了解, 不知道有没有人能帮我下?

我可以提供移植用的那几个配置文件。
现在配置文件信息已经提供了,请下载附件: hg255d_driver_0.1_openwrt_trunk.tar.gz (9.29 KB, 下载次数: 135)
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2012-8-5 15:32 | 显示全部楼层
USB-TTL下看到的信息:


U-Boot 1.1.3 (Oct 12 2011 - 17:58:01)

Board: Ralink APSoC DRAM:  32 MB
relocate_code Pointer at: 81fb0000
config usb..

The Flash ID =0000227E
flash_protect ON: from 0xBF000000 to 0xBF01D46B
protect on 0
*** Warning - bad CRC, using default environment

============================================
Ralink UBoot Version: 3.3
--------------------------------------------
ASIC 3052_MP2 (Port5<->None)
DRAM component: 128 Mbits
DRAM bus: 32 bit
Total memory: 32 MBytes
Flash component: NOR Flash
Date:Oct 12 2011  Time:17:58:01
============================================
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384

##### The CPU freq = 384 MHZ ####

SDRAM bus set to 32 bit
SDRAM size =32 Mbytes

@Start First PHY modio study cmd.

eth_register
Eth0 (10/100-M)
enetvar=ethaddr,Eth addr:00:AA:BB:CCD:10
00:AA:BB:CCD:10:

eth_current->name = Eth0 (10/100-M)


netboot_common, argc= 2
*************buf = 0x81fcd620
**********NexTxPacket = 81fe46c0

NetTxPacket = 0x81FE46C0

NetRxPackets[0] = 0x81FE4CC0

NetRxPackets[1] = 0x81FE52C0

NetRxPackets[2] = 0x81FE58C0

NetRxPackets[3] = 0x81FE5EC0

NetRxPackets[4] = 0x81FE64C0

NetRxPackets[5] = 0x81FE6AC0

NetRxPackets[6] = 0x81FE70C0

NetRxPackets[7] = 0x81FE76C0

NetRxPackets[8] = 0x81FE7CC0

NetRxPackets[9] = 0x81FE82C0

NetRxPackets[10] = 0x81FE88C0

NetRxPackets[11] = 0x81FE8EC0

NetRxPackets[12] = 0x81FE94C0

NetRxPackets[13] = 0x81FE9AC0

NetRxPackets[14] = 0x81FEA0C0

NetRxPackets[15] = 0x81FEA6C0

NetRxPackets[16] = 0x81FEACC0

NetRxPackets[17] = 0x81FEB2C0

NetRxPackets[18] = 0x81FEB8C0

NetRxPackets[19] = 0x81FEBEC0

KSEG1ADDR(NetTxPacket) = 0xA1FE46C0

NetLoop,call eth_halt !

NetLoop,call eth_init !
Trying Eth0 (10/100-M)

Waitting for RX_DMA_BUSY status Start... done

Header Payload scatter function is Disable !!

ETH_STATE_ACTIVE!!

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   9: Load Boot Loader code then write to Flash via TFTP.

## Booting image at bf020000 ...
   Image Name:   MIPS OpenWrt Linux-3.3.8
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    834183 Bytes = 814.6 kB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
  IH_COMP_LZMA Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 32

Starting kernel ...

[    0.000000] Linux version 3.3.8 ([email protected]) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Sun Aug 5 22:04:55 CST 2012
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[    0.000000] Ralink RT3052 id:1 rev:3 running at 384.00 MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] Early memory PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  board=HG255D console=ttyS1,57600 mtdparts=physmap-flash.0:256k(u-boot)ro,128k(u-boot-env)ro,128k(factory)ro,1024k(kernel),14848k(rootfs),[email protected](firmware),[email protected](fullflash) rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Writing ErrCtl register=0002f03a
[    0.000000] Readback ErrCtl register=0002f03a
[    0.000000] Memory: 29948k/32768k available (1910k kernel code, 2820k reserved, 320k data, 172k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:48
[    0.000000] console [ttyS1] enabled, bootconsole disabled
[    0.000000] console [ttyS1] enabled, bootconsole disabled
[    0.010000] Calibrating delay loop... 255.59 BogoMIPS (lpj=1277952)
[    0.090000] pid_max: default: 32768 minimum: 301
[    0.100000] Mount-cache hash table entries: 512
[    0.110000] NET: Registered protocol family 16
[    0.120000] MIPS: machine is HuaWei HG255D
[    0.130000] gpiochip_add: registered GPIOs 0 to 23 on device: RT305X-GPIO0
[    0.140000] gpiochip_add: registered GPIOs 24 to 39 on device: RT305X-GPIO1
[    0.150000] gpiochip_add: registered GPIOs 40 to 51 on device: RT305X-GPIO2
[    0.170000] bio: create slab <bio-0> at 0
[    0.180000] Switching to clocksource MIPS
[    0.190000] NET: Registered protocol family 2
[    0.200000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.210000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.230000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.240000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.250000] TCP reno registered
[    0.260000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.270000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.280000] NET: Registered protocol family 1
[    0.320000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.330000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.360000] msgmni has been set to 58
[    0.360000] io scheduler noop registered
[    0.370000] io scheduler deadline registered (default)
[    0.380000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.400000] serial8250: ttyS0 at MMIO 0x10000500 (irq = 13) is a 16550A
[    0.410000] serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A
[    0.440000] TCP cubic registered
[    0.440000] NET: Registered protocol family 17
[    0.450000] 8021q: 802.1Q VLAN Support v1.8
[    0.460000] VFS: Cannot open root device "(null)" or unknown-block(0,0)
[    0.470000] Please append a correct "root=" boot option; here are the available partitions:
[    0.490000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-8-6 07:26 | 显示全部楼层
过来学习的了。
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-8-6 17:01 | 显示全部楼层
mach-hg255d.c被拷贝到了内核目录的arch目录 自己找,要改那里的就行了 就不需要clean了
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-8-7 09:24 | 显示全部楼层
非常感谢。
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-8-8 00:45 | 显示全部楼层
已经完成基本移植了。 感谢大家提供帮助。请见附件。

OPENWRT支持HG255D移植包.zip

7.69 KB, 下载次数: 245

我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-8-8 08:28 | 显示全部楼层
hoowa 发表于 2012-8-8 00:45
已经完成基本移植了。 感谢大家提供帮助。请见附件。

非常感谢,哈哈。
这样就有新内核用了。
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-8-18 13:27 | 显示全部楼层
mtd的配置在 “target/linux/ramips/image/Makefile”下面
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-8-19 00:03 | 显示全部楼层
学习一下下
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-8-28 20:27 | 显示全部楼层
这个可顶一下,希望你能快一点出个固件,我们可以刷机了.
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-9-5 16:39 | 显示全部楼层
强帖
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-9-14 18:59 | 显示全部楼层
fireback版和trunk还有dreambox这几个词都是什么关系啊?英文官网里最新版还有Attitude Adjustment一词,让人非常迷惑啊!
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-9-15 15:33 | 显示全部楼层
高手啊,期待更完善
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-10-30 15:46 | 显示全部楼层
where is the doc about HG255D hardware? How did you know the pin defination?
我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-11-14 11:51 | 显示全部楼层
本帖最后由 ghostry 于 2012-11-22 08:05 编辑
hoowa 发表于 2012-8-8 00:45
已经完成基本移植了。 感谢大家提供帮助。请见附件。


不错
我的恩山、我的无线 The best wifi forum is right here.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|Archiver|恩山无线论坛 ( 苏ICP备05084872号-1 )  

GMT+8, 2018-10-22 07:58

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表