Chinaunix首页 | 论坛 | 博客
  • 博客访问: 677493
  • 博文数量: 516
  • 博客积分: 4119
  • 博客等级: 上校
  • 技术积分: 4288
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-30 17:29
文章分类

全部博文(516)

文章存档

2014年(4)

2013年(160)

2012年(352)

分类:

2013-01-04 17:19:26

原文地址:Linux 2.6.28 作者:chenxibing008

遇到的问题和解决办法:

    问题1,机器ID不对:

U-Boot$ tftp 30008000 zImage
TFTP from server 192.168.7.110; our IP address is 192.168.7.236
Filename 'zImage'.
Load address: 0x30008000
Loading: T #################################################################
         ########################################################
done
Bytes transferred = 1772672 (1b0c80 hex)
U-Boot$ go 30008000
## Starting application at 0x30008000 ...
Uncompressing Linux.................................................................................................................. done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x33f61cc4).

Available machine support:

ID (hex)        NAME
0000016a        SMDK2440

Please check your kernel config and/or bootloader.

    解决:

已经查看了U-Boot的参数,是0x16A,没传错啊:
U-Boot$ bdinfo
arch_number = 0x0000016A
env_t       = 0x00000000
boot_params = 0x30000100
DRAM bank   = 0x00000000
-> start    = 0x30000000
-> size     = 0x04000000
ethaddr     = 00:14:97:0F:AB:AB
ip_addr     = 192.168.7.236
baudrate    = 115200 bps

修改,增加ID代码:
"arch/arm/kernel/head.S"

ENTRY(stext)
   /********* ABING add here *********/
   mov    r0, #0
   @mov    r1, #0x16A
   mov    r1, #0x160
   add    r1, r1, #0x0A
   ldr    r2, =0x30000100
   /********* end add *********/

        msr     cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode

    问题2:zImage出现乱码

      解决:修改系统时钟为12M解决。

    问题3:uImage出现复位死机

TFTP from server 192.168.7.110; our IP address is 192.168.7.236
Filename 'uImage'.
Load address: 0x30008000
Loading: T #################################################################
         ##############################################
done
Bytes transferred = 1617072 (18acb0 hex)
## Booting kernel from Legacy Image at 30008000 ...
   Image Name:   Linux-2.6.28
   Created:      2009-03-04  22:56:35 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1617008 Bytes =  1.5 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   XIP Kernel Image ... OK
OK

Starting kernel ...

data abort
pc : [<3000800c>]          lr : [<33fa434c>]
sp : 33f4fca4  ip : 33f4fcb4     fp : 33fbdf70
r10: 0000016a  r9 : fff302c1     r8 : 33f4ffdc
r7 : 33f4ffb8  r6 : 33fd3200     r5 : 33f51a6d  r4 : 00000000
r3 : 30008000  r2 : 30000100     r1 : 0000016a  r0 : ea000012
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

tftp 31000000 uImage; bootm"
U-Boot$ saveenv
Saving Environment to Flash...
Un-Protected 1 sectors

是tftp加载命令的问题,不能加载在0x30008000处,改为0x31000000就可以了。
setenv bootcmd "tftp 31000000 uImage; bootm"


S3C2440头文件位置:

和以前的有很大变化了,已经移到arch/arm/mach-s3c2410/include/mach/目录下了,
在程序中包含改为:#include
即可。


S3C2440GPIO操作范例:

GPIO操作函数实现的文件:
arch/arm/plat-s3c24xx/gpio.c

void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function)

unsigned int s3c2410_gpio_getcfg(unsigned int pin)

void s3c2410_gpio_pullup(unsigned int pin, unsigned int to)

int s3c2410_gpio_getpull(unsigned int pin)

void s3c2410_gpio_setpin(unsigned int pin, unsigned int to)

unsigned int s3c2410_gpio_getpin(unsigned int pin)

unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change)

int s3c2410_gpio_getirq(unsigned int pin)

int s3c2410_gpio_irq2pin(unsigned int irq)



./arch/arm/mach-s3c2440/mach-nexcoder.c:        s3c2410_gpio_setpin(S3C2410_GPF2, 0);
./arch/arm/mach-s3c2440/mach-nexcoder.c:        s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); // CAM_GPIO6 => CAM_PWRDN
./arch/arm/mach-s3c2440/mach-osiris.c:  s3c2410_gpio_setpin(S3C2410_GPA21, 1);
./arch/arm/mach-s3c2440/mach-osiris.c:  s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_OUT);
./arch/arm/mach-s3c2440/mach-osiris.c:  s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_nRSTOUT);
./arch/arm/mach-s3c2440/mach-osiris.c:          s3c2410_gpio_setpin(S3C2410_GPA0, 1);
./arch/arm/mach-s3c2442/Kconfig:        select S3C2410_GPIO
./arch/arm/plat-s3c24xx/common-smdk.c:  .gpio           = S3C2410_GPF4,
./arch/arm/plat-s3c24xx/common-smdk.c:  .gpio           = S3C2410_GPF5,
./arch/arm/plat-s3c24xx/common-smdk.c:  .gpio           = S3C2410_GPF6,
./arch/arm/plat-s3c24xx/common-smdk.c:  .gpio           = S3C2410_GPF7,
./arch/arm/plat-s3c24xx/common-smdk.c:  s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP);
./arch/arm/plat-s3c24xx/common-smdk.c:  s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
./arch/arm/plat-s3c24xx/common-smdk.c:  s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP);
./arch/arm/plat-s3c24xx/common-smdk.c:  s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP);
./arch/arm/plat-s3c24xx/common-smdk.c:  s3c2410_gpio_setpin(S3C2410_GPF4, 1);
./arch/arm/plat-s3c24xx/common-smdk.c:  s3c2410_gpio_setpin(S3C2410_GPF5, 1);
./arch/arm/plat-s3c24xx/common-smdk.c:  s3c2410_gpio_setpin(S3C2410_GPF6, 1);
./arch/arm/plat-s3c24xx/common-smdk.c:  s3c2410_gpio_setpin(S3C2410_GPF7, 1);


中断设置变化

#include


        set_irq_handler(IRQ_EINT0, handle_edge_irq);  /* NET_INT*/
        set_irq_type(IRQ_EINT0, IRQ_TYPE_EDGE_FALLING);    /* NET_INT, AX88796B,LOW */

AX88796B网卡驱动

经过复杂的修改之后,能够注册并且能够使用IP-Config进行配置了,NFS提示正确信息。但是无法NFS挂载,而且无法ping通开发板。ping的时候没有进入中断,后来怀疑是中断设置的问题,于是在ax_init函数中增加了中断设置:
        writeb (0x20, ax_base + EN0_BTCR); //Low level INT , pull-up

然后就可以了。



YAFFS2文件系统

[root@localhost yaffs2]# ./patch-ker.sh c ../linux-2.6.28
Updating ../linux-2.6.28/fs/Kconfig
Updating ../linux-2.6.28/fs/Makefile
[root@localhost yaffs2]#


kill_proc
./drivers/staging/slicoss/slicoss.c:                    status = kill_proc(card->dump_task_id->pid, SIGKILL, 1);


OProfile支持

如果希望使用oprofile等工具对应用程序进行分析,需要在内核中使能oprofile选项,一般在gerneral设置栏中。
阅读(526) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~