04 _openWRT环境kernel分析

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/Tree_in_sea/article/details/100574670

/*****************************************************************************************************************

  

                                                       Document Author : ELvins Fu

                                           Digtal technology park, A3 -06 , shenzhen, China   

                                                                             

      *************************************************************************************************************

      Module : Unversion Gateway Application 

      Software Version : 6.1.1

      Date : 2015-2016

      Description: the document include the kernel modilfied by special needs.

                      

********************************************************************************************************************/  

 

 

驱动环境kernel说明

                                                

Version :0.1

 

 

简 介

本文档适用于Lantiq’s CPE 软件软件组件Universal Gateway(UGW)Release 6.1.1 版本的kernel的分析,对于其他类似环境有这参考的价值,对于其他环境也可以参照本环境进行分析。

本文档既对kernel进行小量地分析,又根据大麦盒子的硬件需求,介绍了demo版默认的uboot从NAND Flash启动方式转变为SPI Flash启动的配置更改,当然,对以后的需求,如从Nor Flash也具有重要的参考意义。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

篇 二

篇二介绍的是在nand flash转spi flash的过程中的uboot启动之加载内核的配置和更改的情况。

 

1、内核挂载分区的情况

 

[    2.850000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

 

假设你有ramdisk,那么检查该ramdisk的启动地址,格式等等。再有这些没错误的话,建议检查下你的内核大小,解压后的地址是否覆盖了ramdisk的地址,如果是这样,在linux启动的时候,会在最开始报一个地址重叠的警告,虽然不会影响内核后续的启动,但是会影响到后来ramdisk及filesystem的加载。

 

2、修改linux-3.10.12/drivers/spi$ sudo vi ltq_sflash.c

 

1)spi flash的分区个数(根据uboot的分区个数)

 

 

2)spi flash的分区(根据uboot的分区)

 

 

 

 

 

 

  1. spi flash的芯片支持 (芯片的型号,id等,在winbond.c中有这一款芯片的定义)

 

 

  1. 打开调试信息

Pr_dbg改为pr_err输出信息

 

 

 

 

在这个过程中会发现rootfs的大小给定的大小,解决方案如下

 

Make menuconfig

 

Uboot的mtdparts分区参数改为:

 

mtdparts=ltq_sflash:256k(uboot),64k(gphyfirmware),9792k(rootfs),4096k(data),2096k(kernel),64k(sysconfig),4k(ubootconfig),4k(dectconfig),8k(wlanconfig)

 

ltq_sflash:256k(uboot),64k(gphyfirmware),11840k(rootfs),2048k(data),2096k(kernel),64k(sysconfig),4k(ubootconfig),4k(dectconfig),8k(wlanconfig)

 

 

 

 

 

 

 

4)加完之后,追踪Linux ltq_sflash.c  与Makefile和内核的.Config的联系,发现有选项未打开。

Makefile

 

Config

 

make kernel_menuconfig中选择

 

Device Drivers------->

          SPI supportt ------>

            

 

  1. 编译内核 make target/linux/install V=s 成功之后tftp下载内核

 

 

 

 

 

 

 

  1. 打开SPI flash的读写[   55.740000] ifx_spi_flash_read: (from = 0x00756e00, len = 512)

 

 

关闭这些打印信息,之后编译make

 

 

 

1. 配置gphy firmware

 

-> Device Drivers

    -> Network device support (NETDEVICES [=y])

        [*]PPA Acceleration Package

 

-> Device Drivers

    -> Network device support (NETDEVICES [=y])

         PPA Platform Selection

            (X) xRX200 

 

-> Device Drivers

    -> Network device support (NETDEVICES [=y]

         [*]PPA Acceleration Package - Kernel APIs

 

-> Device Drivers

    -> Network device support (NETDEVICES [=y])

         [*]Proc Filesystem Support for PPA API

 

-> Device Drivers

    -> Network device support (NETDEVICES [=y])

       [*]PPA Acceleration Package - Data Path Driver

    -> Package Selection

       [*]PPA D5 Package <MII0/1>

 

-> Device Drivers

    -> Network device support (NETDEVICES [=y])

        [*]LTQ_PPA_API_SW_FASTPATH

    

    配置完后,可以在/lib/firmware下查看到有以下几个内核模块文件

    ppa_api.ko

ppa_api_proc.ko

ppa_api_sw_acel_mod.ko

ppa_datapath_xrx200_d5.ko

ppa_hal_xrx200_d5.ko

 

移植udhcp server & client

    make menuconfig

    Base system 

        -> busybox

            -> Configuration

                -> Networking Utilities

                    -> udhcp client

                    -> udhcp server

 

 

 

 

DAS 2047

In insmod_main: can't insert ifx_timer_driver File exists at line:668!

root@192:~# [ifx_cleanup_hosts_tr69_instances:4727]

 In Function [ifx_get_mgmt_server] : Error--> Failed to get URL !!

[ifx_cleanup_traceroute_tr69_instances:4438]

 In Function [ifx_get_tr69_misc] : Error--> Failed to get AuthACS !!

 In Function [ifx_get_tr69_misc] : Error--> Failed to get AuthACS !!

 In Function [ifx_get_tr69_misc] : Error--> Failed to get AuthACS !!

The device /dev/mtd1 could not be opened

IFX_CWMP_AppInit:1421 [-15] Unable to get obj for Inform. rc.conf Corrupted!!

 In Function [ifx_get_tr69_misc] : Error--> Failed to get AuthACS !!

 In Function [ifx_get_tr69_auth] : Error--> Failed to get Realm !!

 In Function [ifx_get_mgmt_server] : Error--> Failed to get URL !!

The device /dev/mtd1 could not be opened

 In Function [ifx_get_tr69_misc] : Error--> Failed to get AuthACS !!

wait() Unblocked tPID=2047 PIDChld=2047 iStatus=2816 errno=2

PSD

  PID USER       VSZ STAT COMMAND

    1 root      1660 S    init

    2 root         0 SW   [kthreadd]

    3 root         0 SW   [ksoftirqd/0]

    4 root         0 SW   [kworker/0:0]

    5 root         0 SW<  [kworker/0:0H]

    6 root         0 SW   [kworker/u2:0]

    7 root         0 SW<  [khelper]

    8 root         0 SW   [kworker/u2:1]

  152 root         0 SW<  [writeback]

  154 root         0 SW<  [bioset]

  156 root         0 SW<  [kblockd]

  162 root         0 SW<  [ata_sff]

  172 root         0 SW   [khubd]

  190 root         0 SW<  [rpciod]

  191 root         0 SW   [kworker/0:1]

  205 root         0 SW   [kswapd0]

  206 root         0 SW   [fsnotify_mark]

  207 root         0 SW<  [nfsiod]

  208 root         0 SW<  [crypto]

  360 root         0 SW<  [deferwq]

  363 root         0 SW   [kworker/0:2]

  365 root         0 SW<  [kworker/0:1H]

  392 root         0 SWN  [jffs2_gcd_mtd3]

  418 root      1120 S    -sh

  424 root       856 S    swreset

  476 root       872 S    /usr/sbin/ppasessmgmtd

  493 root       856 S    /usr/bin/cgroup_notifier

  495 root       872 S    /usr/bin/cgroup_daemon

  559 root         0 SW   [el_handler]

  597 root      1316 S    syslog-ng -f /tmp/syslog-ng.conf

 1093 root      1312 S    /usr/sbin/devm 1

 1241 root       880 S    /usr/sbin/dwatch

 1248 root      9068 S    /usr/sbin/mini_httpd -C /etc/mini_httpd.conf -D

 1401 root         0 SW   [TAPIkpi_in]

 1403 root         0 SW<  [TAPIevents]

 1421 root         0 SW   [VMMCsysclk]

 1522 root         0 SW   [kworker/u2:2]

 1765 root         0 SW<  [pmcu_wq]

 1781 root      1172 S    /sbin/mountd

 1873 root      3024 S    stunnel

 2120 root      1108 S    /bin/sh -c  ps -ef

 2121 root      1660 R    ps -ef

DAS 2122

 

 

把less关闭掉

 

*** {build_dir/linux-lantiq_xrx200_grx288_gw_he_ethwan_lte_sample/base-files/ipkg-lantiq/base-files/etc/rc.conf}

 

 

 

 

Make kernel_menuconfig

 

 Machine selection  --->

关闭了

 [ ]PCIE Support

打开了                                                                               

 [*]XRX200 PHY firmware loader                                                                                                    [*] Extra check fields on PHY firmware header

 

 

猜你喜欢

转载自blog.csdn.net/Tree_in_sea/article/details/100574670
04