AM335x(TQ335x)學(xué)習(xí)筆記——Nand&&網(wǎng)卡驅(qū)動(dòng)移植
1. Nand驅(qū)動(dòng)移植
本文引用地址:http://m.butianyuan.cn/article/201611/322824.htm閱讀TQ335x的原理圖可知,TQ335x的Nand連接到了GPMC上,且與DTS中默認(rèn)的配置吻合,此處不做任何修改,詳情如下:
- nandflash_pins_s0:nandflash_pins_s0{
- pinctrl-single,pins=<
- 0x0(PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad0.gpmc_ad0*/
- 0x4(PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad1.gpmc_ad1*/
- 0x8(PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad2.gpmc_ad2*/
- 0xc(PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad3.gpmc_ad3*/
- 0x10(PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad4.gpmc_ad4*/
- 0x14(PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad5.gpmc_ad5*/
- 0x18(PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad6.gpmc_ad6*/
- 0x1c(PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_ad7.gpmc_ad7*/
- 0x70(PIN_INPUT_PULLUP|MUX_MODE0)/*gpmc_wait0.gpmc_wait0*/
- 0x74(PIN_INPUT_PULLUP|MUX_MODE7)/*gpmc_wpn.gpio0_30*/
- 0x7c(PIN_OUTPUT|MUX_MODE0)/*gpmc_csn0.gpmc_csn0*/
- 0x90(PIN_OUTPUT|MUX_MODE0)/*gpmc_advn_ale.gpmc_advn_ale*/
- 0x94(PIN_OUTPUT|MUX_MODE0)/*gpmc_oen_ren.gpmc_oen_ren*/
- 0x98(PIN_OUTPUT|MUX_MODE0)/*gpmc_wen.gpmc_wen*/
- 0x9c(PIN_OUTPUT|MUX_MODE0)/*gpmc_be0n_cle.gpmc_be0n_cle*/
- >;
- };
直接編譯內(nèi)核,并放到開發(fā)板上運(yùn)行。這時(shí)我們會(huì)發(fā)現(xiàn)內(nèi)核可以識(shí)別Nand,但是因?yàn)闆]有開啟OMAP的BCH功能會(huì)報(bào)一處錯(cuò)誤。開啟該配置項(xiàng)的方法如下:
- DeviceDrivers--->
- <*>MemoryTechnologyDevice(MTD)support--->
- <*>NANDDeviceSupport--->
- <*>SupporthardwarebasedBCHerrorcorrection
2. 網(wǎng)卡驅(qū)動(dòng)移植
進(jìn)行網(wǎng)卡驅(qū)動(dòng)移植的方法與進(jìn)行Nand驅(qū)動(dòng)移植的方法相同,邏輯上講,先應(yīng)該去確認(rèn)下網(wǎng)卡的引腳連接并在DTS中進(jìn)行相應(yīng)的pinmux設(shè)置,但是,移植完Nand后查看內(nèi)核的啟動(dòng)Log可知,網(wǎng)卡已經(jīng)正常識(shí)別了,因此,可以直接執(zhí)行指令:
- udhcpc
- udhcpc
會(huì)發(fā)現(xiàn)開發(fā)板可以正常獲取到IP和DNS,但是仍有一處錯(cuò)誤,詳細(xì)如下:
- @tq335x#udhcpc
- udhcpc(v1.22.1)started
- SettingIPaddress0.0.0.0oneth0
- [11.489311]neteth0:initializingcpswversion1.12(0)
- [11.576237]neteth0:phyfound:idis:0x1cc915
- [11.581418]libphy:PHY4a101000.mdio:01notfound
- [11.586480]neteth0:phy4a101000.mdio:01notfoundonslave1
- Sendingdiscover...
- [13.576458]cpsw4a100000.etherneteth0:LinkisUp-100Mbps/Full-flowcontrolrx/tx
- Sendingdiscover...
- Sendingselectfor192.168.0.103...
- Leaseof192.168.0.103obtained,leasetime86400
- SettingIPaddress192.168.0.103oneth0
- Deletingrouters
- route:SIOCDELRT:Nosuchprocess
- Addingrouter192.168.0.1
- Recreating/etc/resolv.conf
- AddingDNSserver10.0.0.1
- &mac{
- slaves=<1>;
- pinctrl-names="default","sleep";
- pinctrl-0=<&cpsw_default>;
- pinctrl-1=<&cpsw_sleep>;
- status="okay";
- };
- &cpsw_emac1{
- phy_id=<&davinci_mdio>,<1>;
- phy-mode="rgmii-txid";
- };
- makeARCH=armCROSS_COMPILE=arm-linux-gnueabi-tq335x.dtb
- loadmmc0:10x88000000/boot/tq335x.dtb
- loadmmc0:10x82000000/boot/zImage
- bootz0x82000000-0x88000000
- udhcpc
- ping8.8.8.8
3. 啟動(dòng)Log
完整的啟動(dòng)Log如下:
- Startingkernel...
- [0.000000]BootingLinuxonphysicalCPU0x0
- [0.000000]Linuxversion3.17.2(lilianrong@smarter)(gccversion4.7.3(Ubuntu/Linaro4.7.3-12ubuntu1))#73SMPTueDec2322:06:01CST2014
- [0.000000]CPU:ARMv7Processor[413fc082]revision2(ARMv7),cr=10c5387d
- [0.000000]CPU:PIPT/VIPTnonaliasingdatacache,VIPTaliasinginstructioncache
- [0.000000]Machinemodel:TIAM335xEVM
- [0.000000]cma:Reserved16MiBat9e800000
- [0.000000]Memorypolicy:Datacachewriteback
- [0.000000]HighMemzone:1048574pagesexceedsfreesize0
- [0.000000]CPU:AllCPU(s)startedinSVCmode.
- [0.000000]AM335XES2.1(sgxneon)
- [0.000000]PERCPU:Embedded9pages/cpu@dfa99000s14336r8192d14336u36864
- [0.000000]Built1zonelistsinZoneorder,mobilitygroupingon.Totalpages:129792
- [0.000000]Kernelcommandline:console=ttyO0,115200n8root=/dev/mmcblk0p2rwrootfstype=ext3rootwait
- [0.000000]PIDhashtableentries:2048(order:1,8192bytes)
- [0.000000]Dentrycachehashtableentries:65536(order:6,262144bytes)
- [0.000000]Inode-cachehashtableentries:32768(order:5,131072bytes)
- [0.000000]Memory:484108K/523264Kavailable(6082Kkernelcode,667Krwdata,2448Krodata,410Kinit,8214Kbss,39156Kreserved,0Khighmem)
- [0.000000]Virtualkernelmemorylayout:
- [0.000000]vector:0xffff0000-0xffff1000(4kB)
- [0.000000]fixmap:0xffc00000-0xffe00000(2048kB)
- [0.000000]vmalloc:0xe0800000-0xff000000(488MB)
- [0.000000]lowmem:0xc0000000-0xe0000000(512MB)
- [0.000000]pkmap:0xbfe00000-0xc0000000(2MB)
- [0.000000]modules:0xbf000000-0xbfe00000(14MB)
- [0.000000].text:0xc0008000-0xc085cc80(8532kB)
- [0.000000].init:0xc085d000-0xc08c3800(410kB)
- [0.000000].data:0xc08c4000-0xc096ac10(668kB)
- [0.000000].bss:0xc096ac10-0xc11707a0(8215kB)
- [0.000000]HierarchicalRCUimplementation.
- [0.000000]RCUrestrictingCPUsfromNR_CPUS=2tonr_cpu_ids=1.
- [0.000000]RCU:Adjustinggeometryforrcu_fanout_leaf=16,nr_cpu_ids=1
- [0.000000]NR_IRQS:16nr_irqs:1616
- [0.000000]IRQ:FoundanINTCat0xfa200000(revision5.0)with128interrupts
- [0.000000]Totalof128interruptson1activecontroller
- [0.000000]OMAPclockeventsource:timer2at24000000Hz
- [0.000013]sched_clock:32bitsat24MHz,resolution41ns,wrapsevery178956969942ns
- [0.000062]OMAPclocksource:timer1at24000000Hz
- [0.000794]Console:colourdummydevice80x30
- [0.000846]Lockdependencyvalidator:Copyright(c)2006RedHat,Inc.,IngoMolnar
- [0.000855]...MAX_LOCKDEP_SUBCLASSES:8
- [0.000863]...MAX_LOCK_DEPTH:48
- [0.000870]...MAX_LOCKDEP_KEYS:8191
- [0.000877]...CLASSHASH_SIZE:4096
- [0.000884]...MAX_LOCKDEP_ENTRIES:32768
- [0.000891]...MAX_LOCKDEP_CHAINS:65536
- [0.000898]...CHAINHASH_SIZE:32768
- [0.000906]memoryusedbylockdependencyinfo:5167kB
- [0.000914]pertask-structmemoryfootprint:1152bytes
- [0.000956]Calibratingdelayloop...996.14BogoMIPS(lpj=4980736)
- [0.079052]pid_max:default:32768minimum:301
- [0.079452]SecurityFrameworkinitialized
- [0.079577]Mount-cachehashtableentries:1024(order:0,4096bytes)
- [0.079589]Mountpoint-cachehashtableentries:1024(order:0,4096bytes)
- [0.081767]CPU:Testingwritebuffercoherency:ok
- [0.082936]CPU0:thread-1,cpu0,socket-1,mpidr0
- [0.083055]Settingupstaticidentitymapfor0x805c3270-0x805c32e0
- [0.086292]Broughtup1CPUs
- [0.086313]SMP:Totalof1processorsactivated.
- [0.086323]CPU:AllCPU(s)startedinSVCmode.
- [0.088953]devtmpfs:initialized
- [0.097712]VFPsupportv0.3:implementor41architecture3part30variantcrev3
- [0.133428]omap_hwmod:tptc0usingbrokendtdatafromedma
- [0.133784]omap_hwmod:tptc1usingbrokendtdatafromedma
- [0.134117]omap_hwmod:tptc2usingbrokendtdatafromedma
- [0.141998]omap_hwmod:debugss:_wait_target_disablefailed
- [0.199949]pinctrlcore:initializedpinctrlsubsystem
- [0.202465]regulator-dummy:noparameters
- [0.232121]NET:Registeredprotocolfamily16
- [0.240699]DMA:preallocated256KiBpoolforatomiccoherentallocations
- [0.242951]cpuidle:usinggovernorladder
- [0.242981]cpuidle:usinggovernormenu
- [0.254980]OMAPGPIOhardwareversion0.1
- [0.270240]omap-gpmc50000000.gpmc:couldnotfindpctldevfornode/pinmux@44e10800/nandflash_pins_s0,deferringprobe
- [0.270283]platform50000000.gpmc:Driveromap-gpmcrequestsprobedeferral
- [0.274806]hw-breakpoint:debugarchitecture0x4unsupported.
- [0.319718]edma-dma-engineedma-dma-engine.0:TIEDMADMAenginedriver
- [0.321050]vbat:5000mV
- [0.321878]lis3_reg:noparameters
- [0.325259]SCSIsubsysteminitialized
- [0.326052]usbcore:registerednewinterfacedriverusbfs
- [0.326223]usbcore:registerednewinterfacedriverhub
- [0.330168]usbcore:registerednewdevicedriverusb
- [0.330998]omap_i2c44e0b000.i2c:couldnotfindpctldevfornode/pinmux@44e10800/pinmux_i2c0_pins,deferringprobe
- [0.331037]platform44e0b000.i2c:Driveromap_i2crequestsprobedeferral
- [0.331092]omap_i2c4802a000.i2c:couldnotfindpctldevfornode/pinmux@44e10800/pinmux_i2c1_pins,deferringprobe
- [0.331116]platform4802a000.i2c:Driveromap_i2crequestsprobedeferral
- [0.332291]AdvancedLinuxSoundArchitectureDriverInitialized.
- [0.335642]Switchedtoclocksourcetimer1
- [0.487189]NET:Registeredprotocolfamily2
- [0.489058]TCPestablishedhashtableentries:4096(order:2,16384bytes)
- [0.489243]TCPbindhashtableentries:4096(order:5,147456bytes)
- [0.490606]TCP:Hashtablesconfigured(established4096bind4096)
- [0.490797]TCP:renoregistered
- [0.490823]UDPhashtableentries:256(order:2,20480bytes)
- [0.491013]UDP-Litehashtableentries:256(order:2,20480bytes)
- [0.492039]NET:Registeredprotocolfamily1
- [0.493915]RPC:RegisterednamedUNIXsockettransportmodule.
- [0.493936]RPC:Registeredudptransportmodule.
- [0.493946]RPC:Registeredtcptransportmodule.
- [0.493955]RPC:RegisteredtcpNFSv4.1backchanneltransportmodule.
- [0.495229]hwperfevents:enabledwitharmv7_cortex_a8PMUdriver,5countersavailable
- [0.499735]futexhashtableentries:256(order:2,16384bytes)
- [0.504791]VFS:Diskquotasdquot_6.5.2
- [0.504950]Dquot-cachehashtableentries:1024(order0,4096bytes)
- [0.507753]NFS:Registeringtheid_resolverkeytype
- [0.508115]Keytypeid_resolverregistered
- [0.508132]Keytypeid_legacyregistered
- [0.508279]jffs2:version2.2.(NAND)(SUMMARY)漏2001-2006RedHat,Inc.
- [0.508729]msgmnihasbeensetto977
- [0.513651]ioschedulernoopregistered
- [0.513685]ioschedulerdeadlineregistered
- [0.513753]ioschedulercfqregistered(default)
- [0.516150]pinctrl-single44e10800.pinmux:142pinsatpaf9e10800size568
- [0.521255]backlightsupplypowernotfound,usingdummyregulator
- [0.524492]Serial:8250/16550driver,4ports,IRQsharingenabled
- [0.530892]omap_uart44e09000.serial:nowakeirqforuart0
- [0.531504]44e09000.serial:ttyO0atMMIO0x44e09000(irq=88,base_baud=3000000)isaOMAPUART0
- [1.232153]console[ttyO0]enabled
- [1.241558]omap_rng48310000.rng:OMAPRandomNumberGeneratorver.20
- [1.249198][drm]Initializeddrm1.1.020060810
- [1.261409][drm]SupportsvblanktimestampcachingRev2(21.10.2013).
- [1.268521][drm]Nodriversupportforvblanktimestampquery.
- [1.331152]Console:switchingtocolourframebufferdevice100x30
- [1.342247]tilcdc4830e000.lcdc:fb0:framebufferdevice
- [1.348135]tilcdc4830e000.lcdc:registeredpanicnotifier
- [1.354036][drm]Initializedtilcdc1.0.020121205onminor0
- [1.389964]brd:moduleloaded
- [1.408309]loop:moduleloaded
- [1.414443]mtdoops:mtddevice(mtddev=name/number)mustbesupplied
- [1.425081]usbcore:registerednewinterfacedriverasix
- [1.430985]usbcore:registerednewinterfacedriverax88179_178a
- [1.437512]usbcore:registerednewinterfacedrivercdc_ether
- [1.443772]usbcore:registerednewinterfacedriversmsc95xx
- [1.449928]usbcore:registerednewinterfacedrivernet1080
- [1.455981]usbcore:registerednewinterfacedrivercdc_subset
- [1.462281]usbcore:registerednewinterfacedriverzaurus
- [1.468354]usbcore:registerednewinterfacedrivercdc_ncm
- [1.476438]usbcore:registerednewinterfacedrivercdc_wdm
- [1.482554]usbcore:registerednewinterfacedriverusb-storage
- [1.489102]usbcore:registerednewinterfacedriverusbtest
- [1.497261]mousedev:PS/2mousedevicecommonforallmice
- [1.508204]omap_rtc44e3e000.rtc:rtccore:registered44e3e000.rtcasrtc0
- [1.516418]i2c/deventriesdriver
- [1.520156]Driverfor1-wireDallasnetworkprotocol.
- [1.533123]omap_wdt:OMAPWatchdogTimerRev0x01:initialtimeout60sec
- [1.543243]omap_hsmmc48060000.mmc:unabletogetvmmcregulator-517
- [1.550707]platform48060000.mmc:Driveromap_hsmmcrequestsprobedeferral
- [1.560219]ledtrig-cpu:registeredtoindicateactivityonCPUs
- [1.567132]usbcore:registerednewinterfacedriverusbhid
- [1.572953]usbhid:USBHIDcoredriver
- [1.584275]davinci_evmsound:ASoC:CODEC(null)notregistered
- [1.591095]davinci_evmsound:snd_soc_register_cardfailed(-517)
- [1.597727]platformsound:Driverdavinci_evmrequestsprobedeferral
- [1.605542]oprofile:usingarm/armv7
- [1.610156]TCP:cubicregistered
- [1.613633]InitializingXFRMnetlinksocket
- [1.618345]NET:Registeredprotocolfamily17
- [1.623080]NET:Registeredprotocolfamily15
- [1.628155]Keytypedns_resolverregistered
- [1.632833]omap_voltage_late_init:Voltagedriversupportnotadded
- [1.639539]sr_dev_init:Novoltagedomainspecifiedforsmartreflex0.Cannotinitialize
- [1.648011]sr_dev_init:Novoltagedomainspecifiedforsmartreflex1.Cannotinitialize
- [1.657602]ThumbEECPUextensionsupported.
- [1.662123]RegisteringSWP/SWPBemulationhandler
- [1.667204]SmartReflexClass3initialized
- [1.679204]omap-gpmc50000000.gpmc:GPMCrevision6.0
- [1.686359]nand:devicefound,ManufacturerID:0xec,ChipID:0xd3
- [1.693006]nand:SamsungNAND1GiB3,3V8-bit
- [1.697702]nand:1024MiB,SLC,pagesize:2048,OOBsize:64
- [1.703702]nand:usingOMAP_ECC_BCH8_CODE_HWECCscheme
- [1.709544]10ofpartpartitionsfoundonMTDdeviceomap2-nand.0
- [1.715935]Creating10MTDpartitionson"omap2-nand.0":
- [1.721581]0x000000000000-0x000000020000:"NAND.SPL"
- [1.738760]0x000000020000-0x000000040000:"NAND.SPL.backup1"
- [1.750072]0x000000040000-0x000000060000:"NAND.SPL.backup2"
- [1.759540]0x000000060000-0x000000080000:"NAND.SPL.backup3"
- [1.770709]0x000000080000-0x0000000c0000:"NAND.u-boot-spl"
- [1.780999]0x0000000c0000-0x0000001c0000:"NAND.u-boot"
- [1.794193]0x0000001c0000-0x0000001e0000:"NAND.u-boot-env"
- [1.803810]0x0000001e0000-0x000000200000:"NAND.u-boot-env.backup1"
- [1.815705]0x000000200000-0x000000a00000:"NAND.kernel"
- [1.831741]0x000000a00000-0x000010000000:"NAND.file-system"
- [2.128744]tps659100-002d:Nointerruptsupport,nocoreIRQ
- [2.145804]vrtc:1800mV
- [2.149201]vrtc:suppliedbyvbat
- [2.156403]vio:at1500mV
- [2.159674]vio:suppliedbyvbat
- [2.166535]vdd_mpu:912<-->1312mVat1325mV
- [2.171674]vdd_mpu:suppliedbyvbat
- [2.178847]vdd_core:912<-->1150mVat1137mV
- [2.184071]vdd_core:suppliedbyvbat
- [2.190808]vdd3:5000mV
- [2.196352]vdig1:at1800mV
- [2.199763]vdig1:suppliedbyvbat
- [2.206242]vdig2:at1800mV
- [2.209646]vdig2:suppliedbyvbat
- [2.216312]vpll:at1800mV
- [2.219632]vpll:suppliedbyvbat
- [2.226021]vdac:at1800mV
- [2.229339]vdac:suppliedbyvbat
- [2.235593]vaux1:at1800mV
- [2.238998]vaux1:suppliedbyvbat
- [2.245289]vaux2:at3300mV
- [2.248809]vaux2:suppliedbyvbat
- [2.255223]vaux33:at3300mV
- [2.258804]vaux33:suppliedbyvbat
- [2.265220]vmmc:1800<-->3300mVat3300mV
- [2.270279]vmmc:suppliedbyvbat
- [2.276822]vbb:at3000mV
- [2.280309]vbb:suppliedbyvbat
- [2.288030]omap_i2c44e0b000.i2c:bus0rev0.11at400kHz
- [2.301649]omap_i2c4802a000.i2c:bus1rev0.11at100kHz
- [2.347377]wm89600-001a:Noplatformdatasupplied
- [2.424716]mmc0:hostdoesnotsupportreadingread-onlyswitch.assumingwrite-enable.
- [2.436373]mmc0:newhighspeedSDHCcardataddressaaaa
- [2.444716]mmcblk0:mmc0:aaaaSL16G14.8GiB
- [2.456727]mmcblk0:p1p2
- [2.471831]davinci_evmsound:wm8960-hifi<->4803c000.mcaspmappingok
- [2.555784]davinci_mdio4a101000.mdio:davincimdiorevision1.6
- [2.562174]davinci_mdio4a101000.mdio:detectedphymaskffffffde
- [2.572385]libphy:4a101000.mdio:probed
- [2.576709]davinci_mdio4a101000.mdio:phy[0]:device4a101000.mdio:00,driverunknown
- [2.585071]davinci_mdio4a101000.mdio:phy[5]:device4a101000.mdio:05,driverunknown
- [2.594702]cpsw4a100000.ethernet:DetectedMACID=c4:ed:ba:88:b5:e4
- [2.606568]input:gpio_keyad@0as/devices/gpio_keyad@0/input/input0
- [2.616308]omap_rtc44e3e000.rtc:settingsystemclockto2000-01-0100:00:00UTC(946684800)
- [2.625329]sr_init:NoPMIChooktoinitsmartreflex
- [2.630961]sr_init:platformdriverregisterfailedforSR
- [2.653937]lis3_reg:disabling
- [2.657604]ALSAdevicelist:
- [2.660710]#0:AM335x-EVM
- [2.779242]kjournaldstarting.Commitinterval5seconds
- [2.787736]EXT3-fs(mmcblk0p2):usinginternaljournal
- [2.795710]EXT3-fs(mmcblk0p2):recoverycomplete
- [2.800726]EXT3-fs(mmcblk0p2):mountedfilesystemwithordereddatamode
- [2.808089]VFS:Mountedroot(ext3filesystem)ondevice179:2.
- [2.818461]devtmpfs:mounted
- [2.822292]Freeingunusedkernelmemory:408K(c085d000-c08c3000)
- ----------mountall..........
- ----------Startingmdev......
- PleasepressEntertoactivatethisconsole.
- @tq335x#
- @tq335x#udhcpc
- udhcpc(v1.22.1)started
- SettingIPaddress0.0.0.0oneth0
- [11.489311]neteth0:initializingcpswversion1.12(0)
- [11.576237]neteth0:phyfound:idis:0x1cc915
- [11.581418]libphy:PHY4a101000.mdio:01notfound
- [11.586480]neteth0:phy4a101000.mdio:01notfoundonslave1
- Sendingdiscover...
- [13.576458]cpsw4a100000.etherneteth0:LinkisUp-100Mbps/Full-flowcontrolrx/tx
- Sendingdiscover...
- Sendingselectfor192.168.0.103...
- Leaseof192.168.0.103obtained,leasetime86400
- SettingIPaddress192.168.0.103oneth0
- Deletingrouters
- route:SIOCDELRT:Nosuchprocess
- Addingrouter192.168.0.1
- Recreating/etc/resolv.conf
- AddingDNSserver10.0.0.1
- @tq335x#ping8.8.8.8
- PING8.8.8.8(8.8.8.8):56databytes
- 64bytesfrom8.8.8.8:seq=0ttl=38time=471.858ms
- 64bytesfrom8.8.8.8:seq=1ttl=38time=479.178ms
- 64bytesfrom8.8.8.8:seq=3ttl=38time=574.362ms
- 64bytesfrom8.8.8.8:seq=4ttl=38time=476.201ms
- ^C
- ---8.8.8.8pingstatistics---
- 5packetstransmitted,4packetsreceived,20%packetloss
- round-tripmin/avg/max=471.858/500.399/574.362ms
- @tq335x#
評(píng)論