Porting mt7620a+mt7610e driver to OpenWrt trunk (Linux Kernel 3.14.18) (continued: mt7620a)

Source: Internet
Author: User
Tags goto

In accordance with the content of the previous revision of the file will not be error after the compilation, but burned into the flash after the run, there is a problem, as follows:

[16.840000] Mt7620:module License'Unspecified'taints kernel. [   16.840000] DisablingLockdebugging due to kernel taint[16.870000] Mt7620:unknown symbol RA_MTD_WRITE_NM (err0)[   16.880000] Mt7620:unknown symbol RA_MTD_READ_NM (err0)[   16.880000] Mt7620:unknown symbol Procregdir (err0)[   17.290000] Mt7610:unknown symbol RA_MTD_WRITE_NM (err0)[   17.290000] Mt7610:unknown symbol RA_MTD_READ_NM (err0)[   17.290000] Mt7610:unknown symbol Procregdir (err0)[   17.290000] Mt7620:unknown symbol RA_MTD_WRITE_NM (err0)[   17.290000] Mt7620:unknown symbol RA_MTD_READ_NM (err0)[   17.290000] Mt7620:unknown symbol Procregdir (err0)[   17.290000] Ip_tables: (C) --2006netfilter Core team[17.290000] Mt7610:unknown symbol RA_MTD_WRITE_NM (err0)[   17.620000] Mt7610:unknown symbol RA_MTD_READ_NM (err0)[   17.620000] Mt7610:unknown symbol Procregdir (err0)[   17.670000] Mt7620:unknown symbol RA_MTD_WRITE_NM (err0)[   17.690000] Mt7620:unknown symbol RA_MTD_READ_NM (err0)[   17.690000] Mt7620:unknown symbol Procregdir (err0)[   17.700000] Nf_conntrack version0.5.0(1979Buckets7916max) [   17.740000] Xt_time:kernel TimeZone is-0000[   17.780000] Mt7610:unknown symbol RA_MTD_WRITE_NM (err0)[   17.800000] Mt7610:unknown symbol RA_MTD_READ_NM (err0)[   17.800000] Mt7610:unknown symbol Procregdir (err0)[   17.860000] Mt7620:unknown symbol RA_MTD_WRITE_NM (err0)[   17.880000] Mt7620:unknown symbol RA_MTD_READ_NM (err0)[   17.880000] Mt7620:unknown symbol Procregdir (err0)[   17.900000] PPP Generic driver version2.4.2[   17.900000] Net:registered Protocol Family -[   17.940000] Mt7610:unknown symbol RA_MTD_WRITE_NM (err0)[   17.960000] Mt7610:unknown symbol RA_MTD_READ_NM (err0)[   17.960000] Mt7610:unknown symbol Procregdir (err0)[   18.020000] Mt7620:unknown symbol RA_MTD_WRITE_NM (err0)[   18.020000] Mt7620:unknown symbol RA_MTD_READ_NM (err0)[   18.040000] Mt7620:unknown symbol Procregdir (err0)[   18.080000] Mt7610:unknown symbol RA_MTD_WRITE_NM (err0)[   18.090000] Mt7610:unknown symbol RA_MTD_READ_NM (err0)[   18.100000] Mt7610:unknown symbol Procregdir (err0)[   18.160000] Mt7620:unknown symbol RA_MTD_WRITE_NM (err0)[   18.160000] Mt7620:unknown symbol RA_MTD_READ_NM (err0)[   18.180000] Mt7620:unknown symbol Procregdir (err0)[   28.440000] Device eth0.1Entered promiscuous mode

Workaround:

Porting 7620

1. Add OS/LINUX/RT_FLASH.C content as:

#include <linux/module.h>#include<linux/types.h>#include<linux/init.h>#include<linux/kernel.h>#include<linux/version.h>#include<linux/err.h>#include<linux/slab.h>#include<linux/delay.h>#include<linux/sched.h>#include<linux/backing-dev.h>#include<linux/compat.h>#include<linux/mount.h>#include<linux/mtd/mtd.h>#include<linux/mtd/map.h>#include<linux/mtd/concat.h>#include<linux/mtd/partitions.h>structProc_dir_entry *Procregdir;/** Flash api:ra_mtd_read, Ra_mtd_write * Arguments: *-Num:specific The MTD number *-to/from:the offset to R  EAD from or written to *-len:length *-Buf:data to be read/written * Returns: *-Return-errno if failed *- Return the number of bytes Read/written if successed*/intRA_MTD_WRITE_NM (Char*name, loff_t to, size_t Len,ConstU_char *buf) {    intRET =-1;    size_t Rdlen, Wrlen; structMtd_info *MTD; structerase_info ei; U_char*bak =NULL; MTD=get_mtd_device_nm (name); if(Is_err (MTD)) {ret= (int) MTD; Goto  out; }    if(Len > mtd->erasesize)        {Put_mtd_device (MTD); RET= -E2big; Goto  out; } Bak= Kzalloc (mtd->erasesize, Gfp_kernel); if(Bak = =NULL)        {Put_mtd_device (MTD); RET= -Enomem; Goto  out; }#ifLinux_version_code >= kernel_version (3,3,0)ret= Mtd_read (MTD,0, Mtd->erasesize, &Rdlen, bak);#elseret= Mtd->read (MTD,0, Mtd->erasesize, &Rdlen, bak);#endif    if(ret) {Gotofree_out; }    if(Rdlen! = mtd->erasesize) PRINTK ("Warning:ra_mtd_write_nm:rdlen isn't equal to erasesize\n"); memcpy (Bak+to, buf, Len); EI.MTD=MTD; Ei.callback=NULL; Ei.addr=0; Ei.len= mtd->erasesize; Ei.priv=0;#ifLinux_version_code >= kernel_version (3,3,0)ret= Mtd_erase (MTD, &ei);#elseret= Mtd->erase (MTD, &ei);#endif    if(Ret! =0)        Gotofree_out;#ifLinux_version_code >= kernel_version (3,3,0)ret= Mtd_write (MTD,0, Mtd->erasesize, &Wrlen, bak);#elseret= Mtd->write (MTD,0, Mtd->erasesize, &Wrlen, bak);#endifUdelay (Ten);/*add delay after write*/free_out:if(MTD) Put_mtd_device (MTD); if(BAK) kfree (bak); out:    returnret;}intRA_MTD_READ_NM (Char*name, loff_t from, size_t Len, U_char *buf) {    intret; size_t Rdlen=0; structMtd_info *MTD; MTD=get_mtd_device_nm (name); if(Is_err (MTD))return(int) MTD;#ifLinux_version_code >= kernel_version (3,3,0)ret= Mtd_read (MTD, from, Len, &Rdlen, buf);#elseret= Mtd->read (MTD, from, Len, &Rdlen, buf);#endif    if(Rdlen! =len) PRINTK ("Warning:ra_mtd_read_nm:rdlen isn't equal to len\n");    Put_mtd_device (MTD); returnret;} Export_symbol (RA_MTD_WRITE_NM); Export_symbol (RA_MTD_READ_NM); Export_symbol (Procregdir); Module_author ("Steven Liu <[email protected]>"); Module_description ("Ralink Apsoc Flash Map"); Module_license ("GPL");

2. Modify OS/LINUX/RT_PROC.C

Will

struct proc_dir_entry *procregdir

Switch

struct proc_dir_entry *procregdir2860v2

and change all calls to Procregdir in the file to: procregdir2860v2

3. Add in Makefile

Rt2860v2_ap-objs + =. /rt2860v2/os/linux/rt_flash.o


4. Modify Include/chip/rt2880.h
Will:

Switch

" Rt_mmap.h " // Fix

5. Modify Include/iface/rtmp_rbs.h

Will:

#define Rtmp_mac_irq_num    4

Switch

#define Rtmp_mac_irq_num    6

6. Modify Include/video.h

Add to

VOID Videoturbinedynamictune (in Prtmp_adapter pAd);

Porting mt7620a+mt7610e driver to OpenWrt trunk (Linux Kernel 3.14.18) (continued: mt7620a)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.