关于AM335x来讲,TI保护的USB驱动现已十分完善了,本文称之为移植,实际上仅仅是装备内核选项使能USB HOST/OTG功用。废话少说,直接着手敞开AM335x的USB驱动装备项。
Step1. 装备内核支撑USB
默许的装备项没有装备USB相关的选项,可是DTS现已装备好了,咱们不需求对DTS作任何修正,具体的内核装备项如下:
- DeviceDrivers—>
- [*]USBsupport—>
- [*]OTGsupport
- <*>EHCIHCD(USB2.0)support
- [*]ImprovedTransactionTranslatorscheduling(NEW)
- <*>EHCIsupportforOMAP3andlaterchips(NEW)
- <*>OHCIHCD(USB1.1)support
- <*>OHCIsupportforOMAP3andlaterchips(NEW)
- <*>InventraHighspeedDualRoleController(TI,ADI,…)
- MUSBModeSelection(DualRolemode)—>
- <*>PlatformGlueLayer(TIDSPSplatforms)—>
- MUSBDMAmode(DisableDMA(alwaysusePIO))—>
Step2. 编译内核
编译内核的指令如下:
- makeARCH=armCROSS_COMPILE=arm-linux-gnueabi–j8
Step3.测验
用新编译好的内核发动开发板,能够看到如下Log:
- Startingkernel…
- [0.000000]BootingLinuxonphysicalCPU0x0
- [0.000000]Linuxversion3.17.2(lilianrong@smarter)(gccversion4.7.3(Ubuntu/Linaro4.7.3-12ubuntu1))#96SMPFriDec2622:28:21CST2014
- [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:483980K/523264Kavailable(6184Kkernelcode,668Krwdata,2468Krodata,410Kinit,8215Kbss,39284Kreserved,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-0xc087b564(8654kB)
- [0.000000].init:0xc087c000-0xc08e2800(410kB)
- [0.000000].data:0xc08e4000-0xc098b330(669kB)
- [0.000000].bss:0xc098b330-0xc1190f60(8216kB)
- [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.000014]sched_clock:32bitsat24MHz,resolution41ns,wrapsevery178956969942ns
- [0.000064]OMAPclocksource:timer1at24000000Hz
- [0.000795]Console:colourdummydevice80x30
- [0.000845]Lockdependencyvalidator:Copyright(c)2006RedHat,Inc.,IngoMolnar
- [0.000853]…MAX_LOCKDEP_SUBCLASSES:8
- [0.000861]…MAX_LOCK_DEPTH:48
- [0.000869]…MAX_LOCKDEP_KEYS:8191
- [0.000876]…CLASSHASH_SIZE:4096
- [0.000884]…MAX_LOCKDEP_ENTRIES:32768
- [0.000890]…MAX_LOCKDEP_CHAINS:65536
- [0.000898]…CHAINHASH_SIZE:32768
- [0.000905]memoryusedbylockdependencyinfo:5167kB
- [0.000913]pertask-structmemoryfootprint:1152bytes
- [0.000956]Calibratingdelayloop…996.14BogoMIPS(lpj=4980736)
- [0.079037]pid_max:default:32768minimum:301
- [0.079443]SecurityFrameworkinitialized
- [0.079567]Mount-cachehashtableentries:1024(order:0,4096bytes)
- [0.079580]Mountpoint-cachehashtableentries:1024(order:0,4096bytes)
- [0.081764]CPU:Testingwritebuffercoherency:ok
- [0.082949]CPU0:thread-1,cpu0,socket-1,mpidr0
- [0.083077]Settingupstaticidentitymapfor0x805dbb70-0x805dbbe0
- [0.086307]Broughtup1CPUs
- [0.086326]SMP:Totalof1processorsactivated.
- [0.086336]CPU:AllCPU(s)startedinSVCmode.
- [0.088948]devtmpfs:initialized
- [0.097822]VFPsupportv0.3:implementor41architecture3part30variantcrev3
- [0.133146]omap_hwmod:tptc0usingbrokendtdatafromedma
- [0.133495]omap_hwmod:tptc1usingbrokendtdatafromedma
- [0.133823]omap_hwmod:tptc2usingbrokendtdatafromedma
- [0.141643]omap_hwmod:debugss:_wait_target_disablefailed
- [0.199665]pinctrlcore:initializedpinctrlsubsystem
- [0.202194]regulator-dummy:noparameters
- [0.232293]NET:Registeredprotocolfamily16
- [0.240857]DMA:preallocated256KiBpoolforatomiccoherentallocations
- [0.243121]cpuidle:usinggovernorladder
- [0.243149]cpuidle:usinggovernormenu
- [0.255109]OMAPGPIOhardwareversion0.1
- [0.270370]omap-gpmc50000000.gpmc:couldnotfindpctldevfornode/pinmux@44e10800/nandflash_pins_s0,deferringprobe
- [0.270413]platform50000000.gpmc:Driveromap-gpmcrequestsprobedeferral
- [0.274914]hw-breakpoint:debugarchitecture0x4unsupported.
- [0.320324]edma-dma-engineedma-dma-engine.0:TIEDMADMAenginedriver
- [0.321686]vbat:5000mV
- [0.322450]lis3_reg:noparameters
- [0.325863]SCSIsubsysteminitialized
- [0.326622]usbcore:registerednewinterfacedriverusbfs
- [0.326782]usbcore:registerednewinterfacedriverhub
- [0.330704]usbcore:registerednewdevicedriverusb
- [0.331558]omap_i2c44e0b000.i2c:couldnotfindpctldevfornode/pinmux@44e10800/pinmux_i2c0_pins,deferringprobe
- [0.331597]platform44e0b000.i2c:Driveromap_i2crequestsprobedeferral
- [0.331654]omap_i2c4802a000.i2c:couldnotfindpctldevfornode/pinmux@44e10800/pinmux_i2c1_pins,deferringprobe
- [0.331677]platform4802a000.i2c:Driveromap_i2crequestsprobedeferral
- [0.332863]AdvancedLinuxSoundArchitectureDriverInitialized.
- [0.336272]Switchedtoclocksourcetimer1
- [0.489380]NET:Registeredprotocolfamily2
- [0.491239]TCPestablishedhashtableentries:4096(order:2,16384bytes)
- [0.491422]TCPbindhashtableentries:4096(order:5,147456bytes)
- [0.492785]TCP:Hashtablesconfigured(established4096bind4096)
- [0.492955]TCP:renoregistered
- [0.492981]UDPhashtableentries:256(order:2,20480bytes)
- [0.493170]UDP-Litehashtableentries:256(order:2,20480bytes)
- [0.494207]NET:Registeredprotocolfamily1
- [0.496281]RPC:RegisterednamedUNIXsockettransportmodule.
- [0.496304]RPC:Registeredudptransportmodule.
- [0.496314]RPC:Registeredtcptransportmodule.
- [0.496323]RPC:RegisteredtcpNFSv4.1backchanneltransportmodule.
- [0.498147]hwperfevents:enabledwitharmv7_cortex_a8PMUdriver,5countersavailable
- [0.502301]futexhashtableentries:256(order:2,16384bytes)
- [0.507875]VFS:Diskquotasdquot_6.5.2
- [0.508024]Dquot-cachehashtableentries:1024(order0,4096bytes)
- [0.510137]NFS:Registeringtheid_resolverkeytype
- [0.510482]Keytypeid_resolverregistered
- [0.510497]Keytypeid_legacyregistered
- [0.510654]jffs2:version2.2.(NAND)(SUMMARY)漏2001-2006RedHat,Inc.
- [0.511074]msgmnihasbeensetto977
- [0.516250]ioschedulernoopregistered
- [0.516287]ioschedulerdeadlineregistered
- [0.516358]ioschedulercfqregistered(default)
- [0.518591]pinctrl-single44e10800.pinmux:142pinsatpaf9e10800size568
- [0.523698]backlightsupplypowernotfound,usingdummyregulator
- [0.527040]Serial:8250/16550driver,4ports,IRQsharingenabled
- [0.533191]omap_uart44e09000.serial:nowakeirqforuart0
- [0.533803]44e09000.serial:ttyO0atMMIO0x44e09000(irq=88,base_baud=3000000)isaOMAPUART0
- [1.234091]console[ttyO0]enabled
- [1.243201]omap_rng48310000.rng:OMAPRandomNumberGeneratorver.20
- [1.250887][drm]Initializeddrm1.1.020060810
- [1.264563][drm]SupportsvblanktimestampcachingRev2(21.10.2013).
- [1.271671][drm]Nodriversupportforvblanktimestampquery.
- [1.331494]Console:switchingtocolourframebufferdevice100x30
- [1.342552]tilcdc4830e000.lcdc:fb0:framebufferdevice
- [1.348442]tilcdc4830e000.lcdc:registeredpanicnotifier
- [1.354341][drm]Initializedtilcdc1.0.020121205onminor0
- [1.390556]brd:moduleloaded
- [1.408704]loop:moduleloaded
- [1.414966]mtdoops:mtddevice(mtddev=name/number)mustbesupplied
- [1.425658]usbcore:registerednewinterfacedriverasix
- [1.431555]usbcore:registerednewinterfacedriverax88179_178a
- [1.438078]usbcore:registerednewinterfacedrivercdc_ether
- [1.444343]usbcore:registerednewinterfacedriversmsc95xx
- [1.450493]usbcore:registerednewinterfacedrivernet1080
- [1.456543]usbcore:registerednewinterfacedrivercdc_subset
- [1.462850]usbcore:registerednewinterfacedriverzaurus
- [1.468911]usbcore:registerednewinterfacedrivercdc_ncm
- [1.475931]ehci_hcd:USB2.0EnhancedHostController(EHCI)Driver
- [1.482939]ehci-omap:OMAP-EHCIHostControllerdriver
- [1.488833]ohci_hcd:USB1.1OpenHostController(OHCI)Driver
- [1.495347]ohci-omap3:OHCIOMAP3driver
- [1.500021]usbcore:registerednewinterfacedrivercdc_wdm
- [1.506178]usbcore:registerednewinterfacedriverusb-storage
- [1.512631]usbcore:registerednewinterfacedriverusbtest
- [1.521522]47401300.usb-physupplyvccnotfound,usingdummyregulator
- [1.533165]musb-hdrcmusb-hdrc.0.auto:MUSBHDRChostdriver
- [1.543455]musb-hdrcmusb-hdrc.0.auto:newUSBbusregistered,assignedbusnumber1
- [1.562104]usbusb1:NewUSBdevicefound,idVendor=1d6b,idProduct=0002
- [1.569359]usbusb1:NewUSBdevicestrings:Mfr=3,Product=2,SerialNumber=1
- [1.576955]usbusb1:Product:MUSBHDRChostdriver
- [1.582140]usbusb1:Manufacturer:Linux3.17.2musb-hcd
- [1.587820]usbusb1:SerialNumber:musb-hdrc.0.auto
- [1.599603]hub1-0:1.0:USBhubfound
- [1.605078]hub1-0:1.0:1portdetected
- [1.622178]47401b00.usb-physupplyvccnotfound,usingdummyregulator
- [1.632793]musb-hdrcmusb-hdrc.1.auto:MUSBHDRChostdriver
- [1.640700]musb-hdrcmusb-hdrc.1.auto:newUSBbusregistered,assignedbusnumber2
- [1.651379]usbusb2:NewUSBdevicefound,idVendor=1d6b,idProduct=0002
- [1.658617]usbusb2:NewUSBdevicestrings:Mfr=3,Product=2,SerialNumber=1
- [1.666213]usbusb2:Product:MUSBHDRChostdriver
- [1.671397]usbusb2:Manufacturer:Linux3.17.2musb-hcd
- [1.677083]usbusb2:SerialNumber:musb-hdrc.1.auto
- [1.686595]hub2-0:1.0:USBhubfound
- [1.690986]hub2-0:1.0:1portdetected
- [1.701609]mousedev:PS/2mousedevicecommonforallmice
- [1.711782]omap_rtc44e3e000.rtc:rtccore:registered44e3e000.rtcasrtc0
- [1.720055]i2c/deventriesdriver
- [1.723788]Driverfor1-wireDallasnetworkprotocol.
- [1.736318]omap_wdt:OMAPWatchdogTimerRev0x01:initialtimeout60sec
- [1.755078]omap_hsmmc48060000.mmc:unabletogetvmmcregulator-517
- [1.762557]platform48060000.mmc:Driveromap_hsmmcrequestsprobedeferral
- [1.772215]ledtrig-cpu:registeredtoindicateactivityonCPUs
- [1.779192]usbcore:registerednewinterfacedriverusbhid
- [1.785014]usbhid:USBHIDcoredriver
- [1.795167]davinci_evmsound:ASoC:CODEC(null)notregistered
- [1.801977]davinci_evmsound:snd_soc_register_cardfailed(-517)
- [1.808594]platformsound:Driverdavinci_evmrequestsprobedeferral
- [1.816440]oprofile:usingarm/armv7
- [1.821115]TCP:cubicregistered
- [1.824592]InitializingXFRMnetlinksocket
- [1.829340]NET:Registeredprotocolfamily17
- [1.834075]NET:Registeredprotocolfamily15
- [1.839198]Keytypedns_resolverregistered
- [1.843920]omap_voltage_late_init:Voltagedriversupportnotadded
- [1.850660]sr_dev_init:Novoltagedomainspecifiedforsmartreflex0.Cannotinitialize
- [1.859152]sr_dev_init:Novoltagedomainspecifiedforsmartreflex1.Cannotinitialize
- [1.868786]ThumbEECPUextensionsupported.
- [1.873392]RegisteringSWP/SWPBemulationhandler
- [1.878502]SmartReflexClass3initialized
- [1.891065]omap-gpmc50000000.gpmc:GPMCrevision6.0
- [1.898216]nand:devicefound,ManufacturerID:0xec,ChipID:0xd3
- [1.904865]nand:SamsungNAND1GiB3,3V8-bit
- [1.909588]nand:1024MiB,SLC,pagesize:2048,OOBsize:64
- [1.915591]nand:usingOMAP_ECC_BCH8_CODE_HWECCscheme
- [1.921433]10ofpartpartitionsfoundonMTDdeviceomap2-nand.0
- [1.927825]Creating10MTDpartitionson”omap2-nand.0″:
- [1.933473]0x000000000000-0x000000020000:”NAND.SPL”
- [1.947581]0x000000020000-0x000000040000:”NAND.SPL.backup1″
- [1.958288]0x000000040000-0x000000060000:”NAND.SPL.backup2″
- [1.967696]0x000000060000-0x000000080000:”NAND.SPL.backup3″
- [1.978978]0x000000080000-0x0000000c0000:”NAND.u-boot-spl”
- [1.989074]0x0000000c0000-0x0000001c0000:”NAND.u-boot”
- [2.000439]0x0000001c0000-0x0000001e0000:”NAND.u-boot-env”
- [2.010926]0x0000001e0000-0x000000200000:”NAND.u-boot-env.backup1″
- [2.022841]0x000000200000-0x000000a00000:”NAND.kernel”
- [2.038984]0x000000a00000-0x000010000000:”NAND.file-system”
- [2.332279]tps659100-002d:Nointerruptsupport,nocoreIRQ
- [2.349898]vrtc:1800mV
- [2.353264]vrtc:suppliedbyvbat
- [2.360422]vio:at1500mV
- [2.363696]vio:suppliedbyvbat
- [2.370657]vdd_mpu:912<-->1312mVat1325mV
- [2.375794]vdd_mpu:suppliedbyvbat
- [2.384999]vdd_core:912<-->1150mVat1137mV
- [2.390404]vdd_core:suppliedbyvbat
- [2.397288]vdd3:5000mV
- [2.402667]vdig1:at1800mV
- [2.406225]vdig1:suppliedbyvbat
- [2.412538]vdig2:at1800mV
- [2.415945]vdig2:suppliedbyvbat
- [2.422351]vpll:at1800mV
- [2.425662]vpll:suppliedbyvbat
- [2.432822]vdac:at1800mV
- [2.436335]vdac:suppliedbyvbat
- [2.443361]vaux1:at1800mV
- [2.446899]vaux1:suppliedbyvbat
- [2.453342]vaux2:at3300mV
- [2.456846]vaux2:suppliedbyvbat
- [2.463190]vaux33:at3300mV
- [2.466775]vaux33:suppliedbyvbat
- [2.473172]vmmc:1800<-->3300mVat3300mV
- [2.478237]vmmc:suppliedbyvbat
- [2.484283]vbb:at3000mV
- [2.487872]vbb:suppliedbyvbat
- [2.495458]omap_i2c44e0b000.i2c:bus0rev0.11at400kHz
- [2.503173]usb2-1:newhigh-speedUSBdevicenumber2usingmusb-hdrc
- [2.517638]omap_i2c4802a000.i2c:bus1rev0.11at100kHz
- [2.568304]wm89600-001a:Noplatformdatasupplied
- [2.644805]mmc0:hostdoesnotsupportreadingread-onlyswitch.assumingwrite-enable.
- [2.654108]usb2-1:NewUSBdevicefound,idVendor=1a40,idProduct=0101
- [2.661182]usb2-1:NewUSBdevicestrings:Mfr=0,Product=1,SerialNumber=0
- [2.668663]usb2-1:Product:USB2.0Hub
- [2.675544]hub2-1:1.0:USBhubfound
- [2.681178]hub2-1:1.0:4portsdetected
- [2.690227]mmc0:newhighspeedSDHCcardataddressaaaa
- [2.699372]mmcblk0:mmc0:aaaaSL16G14.8GiB
- [2.710574]mmcblk0:p1p2
- [2.723345]davinci_evmsound:wm8960-hifi<->4803c000.mcaspmappingok
- [2.806163]davinci_mdio4a101000.mdio:davincimdiorevision1.6
- [2.812552]davinci_mdio4a101000.mdio:detectedphymaskffffffde
- [2.825370]libphy:4a101000.mdio:probed
- [2.829704]davinci_mdio4a101000.mdio:phy[0]:device4a101000.mdio:00,driverunknown
- [2.838093]davinci_mdio4a101000.mdio:phy[5]:device4a101000.mdio:05,driverunknown
- [2.847649]cpsw4a100000.ethernet:DetectedMACID=c4:ed:ba:88:b5:e4
- [2.859600]input:gpio_keyad@0as/devices/gpio_keyad@0/input/input0
- [2.869505]omap_rtc44e3e000.rtc:settingsystemclockto2000-01-0100:00:00UTC(946684800)
- [2.878657]sr_init:NoPMIChooktoinitsmartreflex
- [2.884274]sr_init:platformdriverregisterfailedforSR
- [2.907467]lis3_reg:disabling
- [2.910975]ALSAdevicelist:
- [2.914075]#0:AM335x-EVM
- [3.008783]kjournaldstarting.Commitinterval5seconds
- [3.017395]EXT3-fs(mmcblk0p2):usinginternaljournal
- [3.025475]EXT3-fs(mmcblk0p2):recoverycomplete
- [3.030554]EXT3-fs(mmcblk0p2):mountedfilesystemwithordereddatamode
- [3.037888]VFS:Mountedroot(ext3filesystem)ondevice179:2.
- [3.047778]devtmpfs:mounted
- [3.051614]Freeingunusedkernelmemory:408K(c087c000-c08e2000)
- ———-mountall……….
- ———-Startingmdev……
- PleasepressEntertoactivatethisconsole.
- @tq335x#[11.296192]usb2-1.2:newhigh-speedUSBdevicenumber3usingmusb-hdrc
- [11.419745]usb2-1.2:devicev0951p1665isnotsupported
- [11.425483]usb2-1.2:NewUSBdevicefound,idVendor=0951,idProduct=1665
- [11.432693]usb2-1.2:NewUSBdevicestrings:Mfr=1,Product=2,SerialNumber=3
- [11.440342]usb2-1.2:Product:DataTraveler2.0
- [11.445163]usb2-1.2:Manufacturer:Kingston
- [11.449729]usb2-1.2:SerialNumber:50E549C20268FE41491C17E1
- [11.458198]usb-storage2-1.2:1.0:USBMassStoragedevicedetected
- [11.476650]scsihost0:usb-storage2-1.2:1.0
- [12.768968]scsi0:0:0:0:Direct-AccessKingstonDataTraveler2.01.00PQ:0ANSI:4
- [12.785085]sd0:0:0:0:[sda]30233588512-bytelogicalblocks:(15.4GB/14.4GiB)
- [12.806457]sd0:0:0:0:[sda]WriteProtectisoff
- [12.817312]sd0:0:0:0:[sda]Writecache:disabled,readcache:enabled,doesntsupportDPOorFUA
- [12.840718]sda:sda4
- [12.850713]sd0:0:0:0:[sda]AttachedSCSIremovabledisk
- [13.265222]usb2-1.2:USBdisconnect,devicenumber3
结尾是拔插U盘的效果。
Step4. 装备其它USB设备驱动
假如需求装备其它USB设备驱动能够持续在menuconfig装备列表中进行装备,这儿就不逐个介绍了。
注:
不知道是我的开发板硬件问题仍是其它问题,我自己移植的Linux-3.17.2只要中心的一个USB端口可用,别的两个USB端口没有任何效果。运用官方供给的内核镜像也存在这样的问题,下周一跟天嵌售后承认下此问题。假如看到本文的朋友手头上也有TQ3358开发板,请帮助测验下,多谢。