Translation

Click here to load reader

description

 

Transcript of Translation

  • 1. PW2440

2. PW2440 1.1 PW2440 1.2 PW2440 1.3 PW2440 1.4 PW2440 1.5 PW2440PW2440 2.1 PW2440 2.2 PW2440 2.3 PW24402.4 BootloaderATBOOT 2.4.1 JTAG 2.4.2 SJF2440 2.4.3 SJF2440.EXE 2.4.4 2.4.5 SJF2440ATBOOT2.5 PW2440BootloaderATBOOT 2.5.1 ATBOOT 2.5.2 DNW 2.5.3 DNW USB 2.5.4 ATBOOT 2.5.5 ATBOOT 2.5.6 2.6 PW2440WindowsCE5.0Linux2.6 2.6.1 WinCENK.bin 2.6.2 NK.BIN 2.6.3 WinCEWinCE5.0 3.1 Platform Builder 5.0 PB 3.2 3.3 PBPW2440WinCE BSP 4.1 BSP 4.2 4.3 BSP 5.1 BSP 5.2 5.3 5.4 USB WIFI 5.5 5.6 SDK WinCE5.0 PW2440 3. 6.1 MP4 6.2 USB 6.3 Camera 6.4 SD 6.5 6.5 USB HOST 6.6 6.7 6.8 6.9 90 6.10 GPS 6.11 USB 6.12 6.13 6.14 LOGO 6.15 6.16 6.17 6.18 6.19 GPRS 6.20 FLASH VS2005/2008 7.1 7.2 Hello World 7.3 7.4 7.5 SDK WinCE 8.1 WinCE image 8.2 HIVE 8.3 8.4 8.5 8.6 8.7 WinCE 8.8 WINCE 8.9 WinCE 8.10 WinCE 8.11 WinCE 8.12 WinCE 8.13 WinCE 8.14 WinCE 8.15 WinCE NK.nb0 8.16 WinCE NK.nb0 8.17 WinCE 8.18 TCP/MP 8.19 WinCE (suspend/wakeup) 8.20 WinCE EVC PW2440Linux2.6.18.2 9.1 Linux2.6 4. 9.2 Linux2.6.18.2 9.3 ATBOOT Linux2.6.18.2 9.4 Linux2.6.18.2 640*480 800*480 9.5 Linux (NFS) 9.6 Busybox 9.7 Linux 9.8 u-boot.bin 9.9 UBOOT 9.10 Linux2.6.18.2 PW2440Linux2.6.18.2 10.1 u-bootUBOOT1.3 10.1.1 uboot 10.1.2 uboot 10.1.3 uboot 10.1.4 uboot 10.1.5 uboot 10.1.6UBOOTPW2440IboardIIcommoncmd_jffs2.cIIIcpu IV 1. 2.USB V VIlib_arm VII/ VIII Xrtc XIu-bootMakefile XII10.2SJFF2 1 2 3 4 5PW2440 10.3 QT 1. QT 2. QT110.4 AT2440 010.4.1 USB 110.4.2 SD CARD 210.4.3 UART 310.4.4 LCD 410.4.5 510.4.6 AT2440 610.4.7 IOLED 710.4.8 Hello, World 5. 2 ASCII Banyan-U ARMUSB2.0 :Linux PW24401.1 PW2440 PW2440115x108mm CPUS3C2440A-40 400MHz SDRAM64M or 128M64MK4S561632 FLASH64M or 256M or 512M or 1GB64M NAND FLASH Etherne100/10M DM9000AEP USB HOSTUSB HOST 1.1 USB DEVUSB DEV CAMERACAMOV9650,OV9620 130WinCE5.0 COMDB9COM1 SD CARDSD CARD4G SD CARD RESET 20 JTAG LCD54PIN FPCLQ035NC111 IO2.034IO 3V GPSGPSTTLGPS DC 5V0.4A 115*108MM 64M128M 6. PW2440 LQ035NC111320*240 AT056TN52640*480 1.2 PW2440 7. PW2440 PW2440 220V5VDC 5V 4.5~7V0.4A2APOW 15USBWinXP PC1.3 PW24401.3.1 100MPC PW244 WinCELinux1.3.2 USB HOSTUSB HOSTUSB1.1U8GUSBUSBUSB HUBUSB USBPW2440USB HOSTUSB1.3.3 USB DeviceUSB DeviceUSB1.1WinCEPCPC ActivesyncPCUBS1.3.4 IIS 1.3.5 SDSD4GSD1.3.6 333DB93 102.0mm 3DB9COM1GPSCOM0TTLGPS1.3.7 LCD 8. 1.3.7 LCD LCD PW2440 LCD STN TFT 4 1.3.8 WinCE130OV9650WINCE5.0 CAMTEST.EXE1.3.9 GPIO 9. 26 GPIOGPIOI/OGPIOI/O1.3.10 LCD 3.5LCDJP3-Q JP2-Q5.6LCDJP1 JP4Q3IC1.3.11 JTAG28 JTAG JTAGJTAGNandFlashJTAG bootloaderADS 10. JTAGUSBJTAGARM ADS u-boot.binATBoot.binJTAG6PINJ11 JTAG JTAGJ3 1.3.12 29OM0OM1OM[1:0] 00 Nand bootNandFlash01 Halfword16-bit NorFlash10 Word32-bit11 Test ModeNADN_WPNandFlashNand_CONNandFlashU5 NAND FLASHSW2U5 ON OFFK9F1208U 64M 124 3 11. K9F2G08U 256M12 34K9F4G08U 512M12 34K9K8G08U 1GB 12 34ATBOOTFLASH ATBOOT UBOOT256M NAND FLASH,FLASH ATBOOTBootloaderUBOOTK9F1208 64M NAND FLASH. 2.2.131.04PINFPC2.2.14 64M128M 128M 32MSDRAM ICR84,R85 64MSDRAM ICR83,R8612.2.15 20WINCE S11S22 S33 S4 S5 S64S75 S86 S9 S10 S11 7S12 8 S13 9 S14 S15 S16 S17 0 S18 S19 *S20 HOME Linux 1.4 PW24401 Linux2.6.18.2 QT:2.3.10Wince5.0 (5.0) 2 LCD 1.4.1 WINCE5.0 1 3.5TFT LCD5.6TFT LCD2 USB USB 200 DEMO 12. 3 COM0 GPS /GPRS USB 4 IP PC ResidentFlash 5 ATBOOT.bin USB 6 BSP LOGO LOGO7 8 USB HOST USB9 USB DEV USB 10 OV9650 13011 10/100M MAC12 SD 4G13 14 2015 FLASH16 17 MP3/MP418 GPS19 GPRS 1.4.2 Linux2.6.18.2 1 ATBOOT USB LINUX2.6 Nand flash FLASH2 3 USB HOST USB HUB 4 USB DEV USB 5 10/100M MAC6 SD 7 208 GPS/GPRS9 Mplayer10 11 1.5 PW2440 DVDDVD1PW2440DVD2VS2005,PBDVD1DVD2ATBOOTWINCE5.0LCD VS2005linux2.6 ADS1.2 13. uboot1.3 GPSUSBWinCE5 PW24402.1 PW2440 U11,U12ICU1110845V3.3VU12 10853.3V1.35VCPU TP1:5V TP2:3.3V TP3:1.35V TP15V TP23.3VTP1U11 TP31.35VTP1,TP2U12CPU CPU CPU1.2V 1.35V FLASH 2.2 PW2440 2.2.1 PW24402,3 2RX3(TX)5(GND) PCPW2440COM1 DB9PW2440115200COM Port PCPW2440PCCOM1 USB TO COM 14. 2.2.2 USB PW2440USBPCUSBT USBPCUSBTPW2440USB DEV DNW 2.3 PW2440 USBDNW.EXE DNW 2.4 BootloaderATBOOT 2.4.1 JTAG JTAGBOOTLOADERFLASH 25PC J16PW2440 JTAG J34 BOOTLOADERPW2440 J2J3PW2440JTAG 20PIN6PIN 15. 2.4.2 SJF2440 SJF2440 GIVEIOSJF2440.exe WindowsNT/2000/XP IO , GIVEIO.SYS, WindowsXP :2.4.2.1 administrator 2.4.2.2 giveio.sys C:WINDOWSsystem32drivers2.4.2.3"", "/" " /" 2.4.2.4 16. 2.4.2.5 2.4.2.6 17. 2.4.2.7 2.4.2.8 COM LPT 18. 2.4.2.9 H GIVEIO.inf 2.4.2.10 '...', GIVEIO.inf 19. 2.4.2.11 2.4.2.12 20. 2.4.2.13 2.4.2.14 giveio(COMx),x2.4.3 SJF2440.EXE BootloaderATBOOT.BINUBOOT.BIN Sjf2440 /f:atboot.bin atboot.binatboot-35.bin /f:Fc: or d: 1 sjf2440.exe64M sjf2440.exe2G08/4G08FLASH K9F2G08/K9F4G08/K9K8G08FLASH2 21. 2.4.4 U5 NAND FLASHSW2 U5(Nand Flash) ONOFF K9F1208U 64M124 3 K9F2G08U 256M 12 34 K9F4G08U 512M 12 34 K9K8G08U 1GB12 34ATBOOTFLASH ATBOOT UBOOT256M NAND FLASH,FLASH ATBOOTBootloaderUBOOTK9F1208 64M NAND FLASH. FLASHSW22.4.5 SJF2440ATBOOT PCwindowXP PC JTAG JTAG J1 6PIN 6PIN JTAG 1 sjf2440.exe (//) Atboot.bin (/boot/ ) PCPW2440 cmd 22. 2.4.5.1 PW2440ATBOOT.BIN 2.4.5.2 sjf2440 /f:atboot-35.bin1 23. 2.4.5.3 2CPUIDCPUJTAG 6PINPOW2.4.5.4 NAND FLASH 64M FLASHK9F12080K9S12083 FLASH2:K9F2G08/4G08/8G08 prog, 256M,512M,1GBNAND FLASH2.4.5.5 0 0ATBOOTNAND FLASH 24. 2FLASHFLASHID FLASH2.4.5.6 40ATBOOT.BINFLASH0 2.4.5.7 22:Exit ATBOOT.BINPW2440 SW2ATBOOT.BIN FLASHSW22.5 PW2440BootloaderATBOOT 2.5.1 ATBOOT ATBOOTAvantechBootloader EBOOT.ATBOOTUSB DEV ATBOOT FLASH BootloaderATBOOT WINCELINUX BIOSBootloader2.5.2 DNW DNW.EXE DNW.EXE ConfigurationOptions PW2440115200PC Serial PortConnectPCPW2440 25. USB PortTransmit 2.5.3 DNW USB 2.5.3.1USB PC USB hostPW2440 USB Device ATBOOTDNWPC 26. USBPC 2.5.3.2 DNW USB USB DNW USB DNW USB /secbulk.sys windows/system32/driver 2.5.3.2 T 27. 2.5.3.4 2.5.3.5 DNW USB 28. 2.5.3.6 secbulk.inf 2.5.3.7 29. 2.5.3.8 secbulk.sys 2.5.3.9 30. 2.5.3.10 secbulk.sys DNW USB 2.5.3.11 DNW USB >>secbulk.sys 31. 2.5.3.12 USB [USB:OK] USB PW2440 DNW USB 32. A ATBOOT USB host is not connected yet. USB PC B WINCE5.0,LINUX2.6 DNW USB windows/system32/driver secbulk.sys secbulk.sys USB USB 2.5.4 ATBOOT PW2440ATBOOTDNW DNW1 1ATBOOT PW2440ATBOOT 3 33. ATBOOT USB host is not connected yet.32.5.5 ATBOOT LINUX USB NAND FLASH SDRAM 34. 2.5.5.1 ###### Select Menu ###### [0] Download & run to SDRAM WinCE5.0 // NK.BIN SDRAM [1] Download Only // NK.BIN[2] Write File to NAND Flash // NK.BIN NAND FLASH [3] Erase NAND Flash Partition // NAND FLASH ATBOOT [4] Auto Flash WinCE5.0 // NK.BIN [5] MemoryTest// [6] Config parameters // [7] Start OS// [8] Auto Flash Linux2.6// Linux2.6 2.5.5.2 [0] Download & run to SDRAM WinCE5.0 // NK.BIN SDRAM [4] Auto Flash WinCE5.0 // NK.BIN [8] Auto Flash Linux2.6 // Linux2.6 1 0[0] Download & run to SDRAM WinCE5.0 NK.BIN FLASH FLASH 0Download&Run is selected. USB host is connected. Waiting a download. DNW USB Port NK.BIN WINCE5.0 LINUX2.6 2 4[4] Auto Flash WinCE5.0 35. 0 : offset 0x0 , size 0x60000 [ATBOOT] // USB ATBOOT.BIN 1 : offset 0x60000 , size 0x2300000 [WINCE] // NK.BIN 2 : offset 0x2360000 , size 0x1ca0000 [USER] // SMFLASH 3 8[8] Auto Flash Linux2.6 0 : offset 0x0 , size 0x60000 [ATBOOT] // USB ATBOOT.BIN 4 1 : offset 0x60000 , size 0x1a0000 [KERNEL] // zimage 2 : offset 0x200000 , size 0x3500000 [ROOTFS] // rootfs.img 2.5.5.3 [6] Config parameters 0LinuxCE 1cpu 2 3atbootX 4 5Linux 6 7 8Linux 9ce 10 11 12devfs 13 14linux 15 36. 2.5.6 CE ATBOOT 0~0x60000 WINCE 0x60000~0x02300000 USER 0x02360000~ 0x1ca0000 0x30200000LINUX ATBOOT 0~0x60000 KERNEL 0x60000 ~ 0x1a0000 ROOTFS 0x200000~0x35000002.5.7 USBATBOOT JTAG ATBOOT ATBOOT.BIN USB ATBOOT.BIN 4[4] Auto Flash 0 0 : offset 0x0, size 0x60000 [ATBOOT] Y USB ATBOOT.BIN 4 8 0 : offset 0x0 , size 0x60000 [ATBOOT] 4[4] Auto Flash WinCE 0 0 : offset 0x0, size 0x60000 [ATBOOT] Are you sure to erase nand flash from page 0x0, block count 0x10 ? [y/n] Y NK.BIN USB Port ATBOOT.BIN USB host is connected. Waiting a download. 1,2,3 USB PortTransmit 37. ATBOOT.BIN USBDNW 38. 1 21 3NAND FLASHID 4 39. JTAG ATBOOT.BIN 2.6 PW2440WindowsCE5.0 2.6.1 WinCENK.bin Nand Flash 2.6.1.1 PW2440 * ATBOOT WINCE5.0 LINUX2.6 ATBOOT ATBOOT 2.6.1.2 410 ATBOOT JTAG 1 WINCE5.0 NK 2 BSP 5 CE WINDOWS 2.6.1.3 1NK.BIN22.6.1.4 Y 2.6.1.5 NK.BIN 40. 2.6.1.6 USB PortTransmit 2.6.1.7 NK.BIN 41. NK-2C,-3C-2CCOM1COM0,COM2 COM1 -3CCOM1 2.6.1.8 ATBOOTFLASH PW2440 2.6.1.9 ATBOOTCELINUX 3 42. 2.6.1.10 NK.BIN1 2.6.1.11 NKFLASH 43. FLASH 2.6.1.12 DNW 44. 2ATBOOT34FLASH PW2440NAND FLASH 45. FMD_OEMIoControl: unrecognized IOCTL (0x71c24). 64MFLASH 256M FLASH5512M FLASH151GB FLASH30 FLASHIIC,DM9000()Camera OV9650 18 2.6.2 NK.BIN ATBOOT v3.02 NK.bin SDRAM NK NAND Flash NAND Flash SDRAM SDRAM 46. 2.6.2.1 ATBOOT.BIN 0 2.6.2.2 USB Port>>Transmit NK.bin 2.6.2.3 v4.02 WINCE LINUX 47. 2.6.2.4 NK.BIN FLASHNAND FLASH2.6.2.5 WinCE5.0 2.6.1.12 2.6.2.6 -3CCOM1 1 48. 2.6.3 WinCE 2.6.3.1 USB 301 200 PC BSP USB WindowsTestzc030x Testzc030x 1 OK DLL 2.6.3.2 Camera WinCE 130 OV9650/ov9620 PW2440 WINCE OV7660 WINDOWS/CameraTEST.exe DEMO DEMO 2.6.3.3 SD WINCE5.0 SD SD WindowsStorage CardSD 4G 2.6.3.4 WindowsResidentFlash, Windows BSP 49. 2.6.3.5 USB HOST USB USB U USB 1.1 USB2.0 2.6.3.6 DM9CE1 IP 10/100M DNS DNS 202.96.128.166. WINCE5.0 ADSL USB 2.6.3.7 Windowsregedit My DeviceHKEY_LOCAL_MACHINEHARDWAREDEVICEMAP-- TOUCH,CalibrationData Data PB WorkspaceParameterViewplatform.reg Make Rum-Time Image. [HKEY_LOCAL_MACHINEHARDWAREDEVICEMAPTOUCH]"MaxCalError"=dword:500 ;800*480"CalibrationData"="486,293 151,529 811,530 803,61 140,58 " 2.6.3.8 Windowsrecorder MIC recorder 2.6.3.9 2.6.4 Linux 2.6.5 Linux WinCE5.0 3.1 Platform Builder 5.0 PB DVDwince5.0dotnetfxMicrosoft Windows CE 5.0.msiwince5.0CDDVD wince5.0 120 50. Custom(Tools and OS) ARMV4IPW2440BSP3.2 PBwince5.0 WinCEPB50-071231-Product-Update-Rollup-Armv4I.msi.NET Compact Framework 2.0 SD4GBBSP3.3 PB 3.3.1 PB PB 51. Catalog3.3.2 Catalog3.3.3 Build OS Build and Sysgen:BSP 30 Sysgen: 5 Clean Before Building:BSPBSP OBJOBJ Make Run-Time Image:NK FileView 52. 3.3.4 PlatfromSetting SDK PW2440WinCE BSP4.1 BSP Board Support PackageBSPPW2440BSP BSP 53. WinCE5.0 BSP 4.1.1 SMDK2440A WINCE500PLATFORM SMDK2440A SMDK2440A-2CSMDK2440A 4.1.2 Platform Builder smdk2440a.cec File Manage Catalog Items4.1.3 Import4.1.4 SMDK2440A smdk2440a.cec 54. 4.1.5. File New Platform 4.1.6.Next 55. 4.1.7.Next 4.1.8.SAMSUNG SMDK2440A:ARMV4INext 56. 4.1.9.Mobile HandheldNext 4.1.10 NextQuarter VGA Resources-Portrait Mode NK 32M USB WINCE ActiveSync USB USB wordExcel WinCEPB50-071231-Product-Update-Rollup-Armv4I.msiSTEP5 .NET Compact Framework 1.0 57. 4.1.11 Next 4.1.12 Next 58. 4.1.13. Finish 4.2 4.2.1 Platform Settings 59. 4.2.2 Build Options PW2440BSP 60. 4G SDEnvironmentNewIMGSDBUS2=1 SD 61. 4.2.3 LocalesDefault language OK NK 62. 4.3 4.3.1 BSP BSP CatelogDevice DriversSDIOSD Memory 63. 4.3.2 CatelogDevice DriversSDIOSD HostSDIO Standard Host Controller 64. 4.3.3CatelogDevice DriversUSB FunctionUSB Function ClientsMass Storage 65. 4.3.4CatelogDevice DriversUSB FunctionUSB Function ClientsSerial 4.3.5 CatelogDevice DriversUSB HostUSB Host ControllersOHCI 66. 4.3.6 USB CatalogCore OSWindows CE devicesCore OS ServicesUSB Host Support USB Human Input Device Class DriverUSB HID Keyboard and Mouse4.3.7CatalogCore OSWindows CE devicesCore OS ServicesUSB Host SupportUSB Storage Class Driver 4.3.8 CatalogCore OSWindows CE devicesApplications and Services Development 67. Microsoft Foundation Classes (MFC)4.3.9 CatalogCore OSWindows CE devicesApplications and Services Development Standard SDK for Windows CE 4.3.10 CatalogCore OSWindows CE devices File Systems and Data Store 68. Registry Storage (Choose 1) Hive-based Registry4.3.11 FAT CatalogCore OSWindows CE devices File Systems and Data Store Storage Manager FAT File System4.3.12 CatalogCore OSWindows CE devices File Systems and Data Store Storage Manager Partition Driver4.3.13 CatalogCore OSWindows CE devices File Systems and Data Store Storage 69. Manager Storage Manager Control Panel Applet4.3.14CatalogThird PartyBSPsSamsung SMDK2440A:ARMV4IStorage DriversSmartMedia NAND Flash Driver (SMFLASH) 70. 4.3.15 MS NK 4.3.16 Windows Media Play 71. 4.3.17 .NET Compact Framework 2.0.NET Compact Framework 2.0 .NET Compact Framework 2.0OS Dependencies for .NET Compact Framework 2.0 4.3.18 Core OS/Windows CE devices/International/SimSun & NSimSun (Subset 2_50) 5MNK.BIN27M NK.BIN33M 72. 4.3.19 RAS/PPPGPRSCore OS/Networking - Wide Area Network (WAN)/Dial Up Networking (RAS/PPP)4.3.20 Core OS/Networking - Wide Area Network (WAN)/ Telephony API (TAPI 2.0) 73. 4.3.21 XML Core OS/Windows CE devices/Applications and Services Development/XML/XML Core Services and Document Object Model (DOM) XML Minimal Parser 4.3.22 IP BSP 4.3.23 Build OSBuild and Sysgen Clean Before BuildingSysgen 74. Sysgen 4.3.24 NK.nb0 NK.bin WINCE500PBWorkspaces () RelDirsmdk2440a_ARMV4I_Release USB EBOOT BSP5.1 BSP 5.1.1 BSPSMDK2440A Files: Src: 75. Bootloader:EBOOTATBOOT Common:FLASH Drivers:SDUSB Inc:LCDs3c2440a_lcd.h Kernel:Oalinit.cdebug.c dirs DIRS=ceddkkeybdpwrbuttonpccard serial usbnleddrvrBattdrvrBacklightDisplaycamera IICSDHC touchwavedevkeyboard platform.regplatform.bib 5.1.2 OBJ OBJ OBJOBJ 5.2 5.2.1 SrcDriverskeyboardkeyboard.c void SetDefaultConfig() 76. {KEYVALUE[0] = 0x31;KEYVALUE[1] = 0x32;KEYVALUE[2] = 0x33;KEYVALUE[3] = VK_LEFT;KEYVALUE[4] = VK_RIGHT;KEYVALUE[5] = 0x34;KEYVALUE[6] = 0x35;KEYVALUE[7] = 0x36;KEYVALUE[8] = VK_UP;KEYVALUE[9] = VK_DOWN;KEYVALUE[10] = 0x37;KEYVALUE[11] = 0x38;KEYVALUE[12] = 0x39;KEYVALUE[13] = VK_SUBTRACT;KEYVALUE[14] = VK_ADD;KEYVALUE[15] = VK_HOME;KEYVALUE[16] = 0x30;KEYVALUE[17] = VK_RETURN;KEYVALUE[18] = VK_MULTIPLY;KEYVALUE[19] = VK_MENU;}2016 ASCII16Ox31163115.2.2 USB HOSTUSB SrcDriversDisplay s3c2440disp.cpp //volatile S3C2440A_IOPORT_REG *s2440IOP = NULL; s2440IOP->GPFCON = (s2440IOP->GPFCON & ~(0x3 GPFUP | (0x1 GPFDAT = (s2440IOP->GPFDAT &~ (0x1 GPFCON = (s2440IOP->GPFCON & ~(0x3 GPFUP & ~(0x1 DNS) > EAP*99***1# 107. *99***1# C 1. GPRS192009600+CGDCONT=1,ip,CMNE WinCEATATAT 2.COM*99***1#", CTS,RTS @@EAP@ CHAP 3. G 108. 6.19 FLASH RichPlayer.exewindowsFLASH VS2005/20087.1 7.1.1vs2008 VS2008Microsoft Visual Studio 2008 VS2005VS20087.1.2.NET Compact Framework 2.0 WINCE5.0.NET Framework2.007 Armv4Ihttp://download.microsoft.com/download/4/e/7/4e725c54- b97e-4751-9648-cd53c8365e81/WinCEPB50-071231-Product-Update-Rollup- Armv4I.msi pb2.0 New Platform Wizard Step 5.NET Compact Framework.NET Compact Framework1.0 2.0.NET Compact Framework 109. .NET Compact Framework 2.0WINCE5.007 7.2 Hello World VS2008HelloWorldSmart Device Project Device Application.net Frammework 2.0 NK.bin2.0 110. OK,HelloWord 7.3 USBPCMicrosoft ActiveSync ToolsOption WINCEIP ->Windows CE PB5.0SDKSDKwindows CE 111. SDKWindows CE OK ToolsConnect to Device Connect 112. CloseVS2008Device 7.4 DebugStart debug 113. HelloWorldWindows CE DeviceDeploy VS2008Deploy succeeded 114. SmartDevice ResidentFlash WinCE 8.1 WinCE image 3 image CEPC PB EVC remote file viewer image build release project.bib make image image image windows test.txt image release release _FLATRELEASEDIR _FLATRELEASEDIR = %_WINCEROOT%PBWorkspaces%_TGTPROJ%RelDir%_TGTPLAT%%_TGTCPUFAMILY %_Release realease _TGTPLAT _TGTCPUFAMILY CPU shellTest E:WINCE500PBWorkspacesShellTestRelDirMyCEPC_x86_Release project.bibtest.txt $(_FLATRELEASEDIR)test.txt NK S 115. release test.txt image bib WinCE project.bib pb bulid make image CEPC PB5 build sysgen and build test.txt image build image output clean up release release sysgen and build test.txt Release release Release 1. pb platform setting2. Configuration 3 Custom Build Actions Build step Pre-Make Image (Pre- Sysgen Post-Sysgen Pre-Make Image Post-Make Image ) New Custom Build Action copy%_FLATRELEASEDIR% test.txt e copy E:test.txt %_FLATRELEASEDIR%test.txt 8.2 HIVE To use the hive-based registry 1. Add the Hive-based Registry Catalog item to your OS design. 2. Verify the following registry settings in the Platform.reg file for your OS design.[HKEY_LOCAL_MACHINEinitBootVars] "SystemHive"="" "Start DevMgr"=dword: For more information about configuring the registry to support the hive-based registry, see Hive-based Registry Setup. 3. Set the following registry value in the Platform.reg file for your OS design to determine the default hive to load. 116. [HKEY_LOCAL_MACHINEinitBootVars] "DefaultUser"=""4.Verify that all registry entries necessary for starting drivers in the first boot phase are wrapped in the comments.The following code example shows typical comments. ; HIVE BOOT SECTION ; END HIVE BOOT SECTION These tags are commands that tell the ROM registry builder to add the entries to the boot hive.5.Set the following flag bit on each driver that is loaded during the first boot phase. [HKEY_LOCAL_MACHINEDrivers...] "Flags"=dword:1000The flags are a bitmask to OR with any existing settings. This flag tells the Device Manager to load your driver in the first boot phase with the boot registry, and not to load it a second time in the second boot phase with the system registry. It prevents the driver from being started twice. 6. Set the MountFlags registry value equal to DWORD:2.Set this value on the Storage Manager profile of the file system driver for the medium that contains the registry. This indicates that the file system contains the following registry key. [HKEY_LOCAL_MACHINESystemStorageManagerProfiles] "MountFlags"=dword:27. Decide whether a registry flushing mechanism is necessary.Outstanding registry data will be flushed on a suspend or resume cycle and any time the system goes through a software shutdown. However, data may be lost if power is suddenly removed. If a software shutdown is not an option, you may need to create a thread that periodically flushes data. To ensure that data is not lost, call RegFlushKey. This will flush any unsaved changes in the hive to the persistent file. It will not damage anything to call RegFlushKey when no data has changed; in that case, the file will not be touched. RegFlushKey should be called on both the system hive HKEY_LOCAL_MACHINE and the user hive HKEY_CURRENT_USER. Clean Before BuildingBuild and Sysgen 8.3 WinCE Programming element Description RegCloseKey This function releases the handle of the specified key. RegCreateKeyEx This function creates the specified key. If the key already exists in the registry, the function opens it. RegDeleteKey This function deletes a named subkey from the specified registry key. RegDeleteValue This function removes a named value from the specified registry key. RegEnumKeyEx This function enumerates subkeys of the specified open registry key. RegEnumValue This function enumerates the values for the specified open registry key. RegFlushKey This function writes all the attributes of the specified open registry key into the registry. RegNotifyChangeKeyValue This function notifies the caller about changes to the attributes or contents of a specified registry key. RegOpenKeyEx This function opens the specified key. RegQueryInfoKey This function retrieves information about a specified registry key. RegQueryValueEx This function retrieves the type and data for a specified value name associated with an open 117. registry key. RegSetValueEx This function stores data in the value field of an open registry key. RegOpenKeyExRegSetValueExRegQueryValueEx RegCloseKey RegOpenKeyEx RegSetValueExRegQueryValueEx RegCloseKey void RegSwitch(LPCWSTR ImKey, LPCWSTR ImIconKey, WCHAR * Im240X320, WCHAR * Im320X240, WCHAR * ImIcon) { LONG lret; HKEY hKEY; if(GetSystemMetrics(SM_CYSCREEN) > 240) { lret = RegOpenKeyEx(RESKEY,ImKey,0,KEY_READ,&hKEY); if(lret==ERROR_SUCCESS) {RegSetValueEx(hKEY,VALUENAME,0,REG_SZ, (LPBYTE)Im240X320, sizeof(WCHAR)*(wcslen(Im240X320)+1)); lret = RegOpenKeyEx(RESKEY,ImIconKey,0,KEY_READ,&hKEY); if(lret==ERROR_SUCCESS) { RegSetValueEx(hKEY,VALUENAME,0,REG_SZ,(LPBYTE)ImIcon, sizeof(WCHAR)*(wcslen(ImIcon)+1)); } } RegCloseKey(hKEY); } else{lret = RegOpenKeyEx(RESKEY,ImKey,0,KEY_READ,&hKEY);if(lret==ERROR_SUCCESS){ RegSetValueEx(hKEY,VALUENAME,0,REG_SZ,(LPBYTE)Im320X240,sizeof(WCHAR)*(wcslen(Im320X240)+1)); lret = RegOpenKeyEx(RESKEY,ImIconKey,0,KEY_READ,&hKEY);if(lret==ERROR_SUCCESS){RegSetValueEx(hKEY,VALUENAME,0,REG_SZ, (LPBYTE)ImIcon,sizeof(WCHAR)*(wcslen(ImIcon)+1));}}RegCloseKey(hKEY);} }#include "stdafx.h" #include "windows.h" 118. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, intnCmdShow) { DEVMODE devMode; LONG lret; LONG regStatus;HKEY hKEY; INT keyValue;LPCWSTR subKey = L"SystemGDIRotation";LPCWSTR valueName = L"Angle";DWORD pRegType,pRegKey,pRegKeySize; lret = RegOpenKeyEx(HKEY_LOCAL_MACHINE,subKey,0,KEY_READ,&hKEY); if(lret==ERROR_SUCCESS) { regStatus RegQueryValueEx(hKEY,valueName,0,&pRegType,(LPBYTE)&pRegKey,&pRegKeySize); if(regStatus == ERROR_SUCCESS && pRegType == REG_DWORD) {memset(&devMode,0x00,sizeof(devMode));devMode.dmSize = sizeof(devMode);devMode.dmFields = DM_DISPLAYORIENTATION;ChangeDisplaySettingsEx(NULL,&devMode,NULL,CDS_TEST,NULL);keyValue = (INT)pRegKey;switch(keyValue){ case 90:devMode.dmDisplayOrientation = DMDO_90;break; case 180:devMode.dmDisplayOrientation = DMDO_180;break; case 270:devMode.dmDisplayOrientation = DMDO_270;break; default: devMode.dmDisplayOrientation = DMDO_0;break;}devMode.dmFields = DM_DISPLAYORIENTATION;if (DISP_CHANGE_SUCCESSFUL == ChangeDisplaySettingsEx(NULL, &devMode, NULL, CDS_RESET, NULL)) {RETAILMSG(1, (L"ChangeDisplaySettingsEx changed rotation angle to %d", keyValue)); } else {RETAILMSG(1, (L"ChangeDisplaySettingsEx failed to change the rotation angle to %d", keyValue)); } } RegCloseKey(hKEY); } return 0; } 119. PB 8.4 1 PB : CatalogCore OSDisplay based devicesInternationalLocale Specific SupportChinese(Simplofied)Input Method Editor .... add to platform DLL platform.bib project.bib englishim.dll $(_TARGETPLATROOT)FilesCustomhwimeenglishim.dll NK SH [HKEY_CLASSES_ROOTCLSID{7DD4CC5E-4EB7-4f86-AA8F-D74C5F8360DA}] @="English" ;"KBMode"=dword:0 [HKEY_CLASSES_ROOTCLSID{7DD4CC5E-4EB7-4f86-AA8F-D74C5F8360DA}InprocServer32] @="windowsenglishim.dll" [HKEY_CLASSES_ROOTCLSID{7DD4CC5E-4EB7-4f86-AA8F-D74C5F8360DA}IsSIPInputMethod] @="1" [HKEY_CLASSES_ROOTCLSID{7DD4CC5E-4EB7-4f86-AA8F-D74C5F8360DA}DefaultIcon] @="windowsenglishim.dll,0"[HKEY_CURRENT_USERControlPanelSip] "DefaultIm"="{7DD4CC5E-4EB7-4f86-AA8F-D74C5F8360DA}"2 SIPSELECT=1 Platform->Setting Environment 8.5 platform.reg project.reg -[-HKEY_CLASSES_ROOTCLSID{42429667-ae04-11d0-a4f8-00aa00a749b9}] HKEY_CLASSES_ROOTCLSID{42429667-ae04-11d0-a4f8-00aa00a749b9} 8.6 [HKEY_CURRENT_USERControlPanelDesktop]"Wallpaper"="Windowsavant.bmp""Tile"=dword:0WindowsWall.bmp avant.bmpFilesplatform.bib avant.bmp$(_FLATRELEASEDIR)avant.bmp NK U 120. 8.7 WinCE 1 Platform->Setting Custom Build Actions Pre-Make Image 2 New createmui XXXX XXXX createmui 0409,0804,0404 0409 0804 0404 , 3 platform.bib #include $(_FLATRELEASEDIR)MultiUI.bib 4Build and Sysgen Current BSP 8.8 WINCE PLATFORM.REG [HKEY_LOCAL_MACHINESOFTWAREMicrosoftShellAutoHide]"Default"=dword:18.9 WinCE 1 StartUp 2 WinceSHELL[HKEY_LOCAL_MACHINEinit] "Launch50"="explorer.exe" "Depend50"=hex:14,00, 1e,00explorer.exeMyApp.exe3 [HKEY_LOCAL_MACHINEinit] "Launch80"="MyApp.exe" "Depend80"=hex:1E,00NK SD "Launch80"="MyApp.exe""Launch80"="STDCardMyApp.exe"( STDCardSD) Launch80SDMyApp.exe SD ShellExe.exeStartUpShellExeShellExeSD 1 eVC int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTRlpCmdLine, int nCmdShow) { WIN32_FIND_DATA fd; HANDLE hd=INVALID_HANDLE_VALUE; int iCount = 20; while(iCount--) { hd=::FindFirstFile(lpCmdLine,&fd); Sleep(500); 121. if(INVALID_HANDLE_VALUE!=hd) break;}if(0==iCount) return 0;FindClose(hd);SHELLEXECUTEINFO ShExeInfo={0};ShExeInfo.cbSize=sizeof(SHELLEXECUTEINFO);ShExeInfo.fMask=SEE_MASK_NOCLOSEPROCESS;ShExeInfo.hwnd=NULL;ShExeInfo.lpVerb=NULL; ShExeInfo.lpFile=lpCmdLine;ShExeInfo.lpParameters=L"";ShExeInfo.lpDirectory=NULL;ShExeInfo.nShow=SW_SHOW;ShExeInfo.hInstApp=NULL; ShellExecuteEx(&ShExeInfo);return 0; }ShellExe.exe SD while(iCount--) { hd=::FindFirstFile(lpCmdLine,&fd); Sleep(500); if(INVALID_HANDLE_VALUE!=hd) break; } ShExeInfo.lpFile=lpCmdLine; 2 Autorun.lnk 21#windowsshellexe.exe stdcardMyApp.exe stdcardMyApp.exe3 MyApp.exeAutorun.lnkNKproject.bib ShellExe.exe f:WINCE420PBWORKSPACESLioetEnTerRelDirShellExe.exe NK S Autorun.lnk f:WINCE420PBWORKSPACESLioetEnTerRelDirAutorun.lnk NK S ShellExe.exeH.4 project.dat Directory("WindowsStartup"):-File("Autorun.lnk","WindowsAutorun.lnk") 5 Make ImageBuildFLASH SDMyApp.exeShellExe.exe Autorun.lnkFlashUSD 122. 8.10 WinCE platform.bib project.bib SHU s3c2440a_lcd.dll $(_FLATRELEASEDIR)s3c2440a_lcd.dllNK SH TouchCalibrate.exe $(_TARGETPLATROOT)FilesTouchCalibrate.exe NK U 8.11 I2CCEI2CCE I2C I2C I2C createfile,writefile,readfile,DeviceIoControl CPUI2C I2C I2CI2CI2CCE I2C I2C hT2C = CreateFile(TEXT("I2C1:"), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hT2C == INVALID_HANDLE_VALUE) { if (GetLastError() == ERROR_DEV_NOT_EXIST){//register I2C device driverhDriver = RegisterDevice(TEXT("I2C"), 1, TEXT("I2C.DLL"), 0);if (!hDriver){RETAILMSG(1, (TEXT("Failed to register I2C device driver.rn")));}hT2C = CreateFile(TEXT("I2C1:"), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);} if (hT2C == INVALID_HANDLE_VALUE){ dwErrorCode = GetLastError();return dwErrorCode ; 123. } } //set mode: masterdwIoControlCode = I2C_MASTER_MODE;//CPU DeviceIoControl(hT2C, IOCTL_I2C_SET_MODE, (PVOID)&dwIoControlCode, sizeof(DWORD), NULL, 0, &dwRet, NULL);//set baudrate:DeviceIoControl(hT2C, IOCTL_I2C_SET_BAUDRATE,//dwData CPU(PVOID)&dwData, sizeof(DWORD), NULL, 0, &dwRet, NULL);//set buffer mode: singledwIoControlCode = I2C_SINGLE_STAGE; DeviceIoControl(hT2C, IOCTL_I2C_SET_BUFFER_MODE,//dwIoControlCode CPU (PVOID)&dwIoControlCode, sizeof(DWORD), NULL, 0, &dwRet, NULL); I2C // WriteFile ( hT2C, BUFFER, writesize, &wRetSize, NULL);// if (!wRetSize) { dwErrorCode = GetLastError(); CloseHandle( hT2C ); return 1; } writefile5NULLCEwritefileBOOL writefilewritefile 8.12 WinCE 1. $(PBWORKSPACEROOT) D:WINCE500PBWorkSpacesGSLPDA 2. $(_TARGETPLATROOT) D:WINCE500PLATFORMGSL2440A 3. $(_FLATRELEASEDIR) nk.nb0 D:WINCE500PBWorkSpacesPOS35RelDirGSL2440A_ARMV4I_Release 4. $(_WINCEROOT) WinCE D:WINCE500 8.13 WinCE 1. project.reg [HKEY_LOCAL_MACHINESOFTWAREMicrosoftFontPath] 124. [HKEY_LOCAL_MACHINESOFTWAREMicrosoftFontLinkSystemLink] [HKEY_LOCAL_MACHINESOFTWAREMicrosoftFontPath] "FontPath"="Boot Disk" [HKEY_LOCAL_MACHINESOFTWAREMicrosoftFontLinkSystemLink]"Tahoma"="Boot Disksimsun.ttc,NSimSun" "Courier New"="Boot Disksimsun.ttc,NSimSun" "Arial"="Boot Disksimsun.ttc,NSimSun" "Times New Roman"="Boot Disksimsun.ttc,NSimSun""Symbol"=Boot Disksimsun.ttc,NSimSun Boot Disk 2. D:WINCE500PUBLICCOMMONOAKFILES simsun.ttc Boot Disk; "Tahoma"="Boot Disk Windowssimsun.ttc,NSimSun; Boot Disk Windowsmingliu.ttc,PMingLiU"8.14 WinCE #include "$(PBWORKSPACEROOT)Fileshwimeime.reg" ime.reg $(PBWORKSPACEROOT)Fileshwime 8.15 WinCE NK.nb0 config.bib ROMSIZE ROMSTART = 80000000 ROMWIDTH = 32 ROMSIZE = 001800000 nk.nb0 24M8.16 WinCE NK.nb0 NK.NBx config.bib$ (WINCEROOT)PLATFORMSMDK2440AFiles config.bib ROMSIZE ROMSIZE02000000 NK.NB0 32M Image 32M NK.NB1NK.NB2 config.bib ROMSTART = 80000000 ROMWIDTH = 32 ROMSIZE = 0018000008.17 WinCE Windows CE Windows CE Windows CE PC PocketPC SIM SIM Smartphone CPU PC 125. DWORD GetSystemPowerStatusEx2 (PSYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx2, DWORD dwLen, BOOL fUpdate); SYSTEM_POWER_ STATUS_EX2 5 FALSE SYSTEM_POWER_STATUS_EX2 typedef struct _SYSTEM_POWER_STATUS_EX2 { BYTE ACLineStatus; BYTE BatteryFlag; BYTE BatteryLifePercent; BYTE Reserved1; DWORD BatteryLifeTime; DWORD BatteryFullLifeTime; BYTE Reserved2; BYTE BackupBatteryFlag; BYTE BackupBatteryLifePercent; BYTE Reserved3; DWORD BackupBatteryLifeTime; DWORD BackupBatteryFullLifeTime; WORD BatteryVoltage; DWORD BatteryCurrent; DWORD BatteryAverageCurrent; DWORD BatteryAverageInterval; DWORD BatterymAHourConsumed; DWORD BatteryTemperature; DWORD BackupBatteryVoltage; BYTE BatteryChemistry; } SYSTEM_POWER_STATUS_EX2; Windows CE AC GetSystemPowerStatusEx2 ACLineStatus AC AC_LINE_OFFLINE AC AC_LINE_ONLINE AC AC_LINE_BACKUP_POWER AC_LINE_UNKNOWNBatteryFlag BATTERY_FLAG_HIGHBATTERY_FLAG_LOWBATTERY_FLAG_CRITICAL 126. BATTERY_FLAG_CHARGINGBATTERY_FLAG_NO_BATTERYBATTERY_FLAG_UNKNOWNBatteryLifePercent 0 100 255BatteryLifeTime BATTERY_LIFE_UNKNOWNBatteryFullLifeTime BATTERY_LIFE_UNKNOWN OEM BATTERY_LIFE_UNKNOWN unknown unknownBatteryChemistry BATTERY_CHEMISTRY_ALKALINEBATTERY_CHEMISTRY_NICD BATTERY_CHEMISTRY_NIMH BATTERY_CHEMISTRY_LION BATTERY_CHEMISTRY_LIPOLY BATTERY_CHEMISTRY_UNKNOWN Windows CE.NET Windows CE Windows CE.NET GwesPowerOffSystem Windows CE SDK void GwesPowerOffSystem(void); GwesPowerOffSystem keybd_event keybd_event (VK_OFF, 0, KEYEVENTF_SILENT, 0); keybd_event (VK_OFF, 0, KEYEVENTF_SILENT KEYEVENTF_KEYUP, 0); keybd_event VK_OFF GWES 127. keybd_event Sleep GWES CPU Windows CE 3.0 Windows CE .NET 4.0 ExtEscape Windows CE Ext Escape WindowsCE escape codes Platform Builder SETPOWERMANAGEMENT QUERYESCSUPPORT SETPOWERMANAGEMENT // // Defines and structures taken from pwingdi.h in the Platform Builder // #define QUERYESCSUPPORT8 #define SETPOWERMANAGEMENT6147 #define GETPOWERMANAGEMENT 6148typedef enum _VIDEO_POWER_STATE {VideoPowerOn = 1, VideoPowerStandBy, VideoPowerSuspend,VideoPowerOff } VIDEO_POWER_STATE, *PVIDEO_POWER_STATE;typedef struct _VIDEO_POWER_MANAGEMENT {ULONG Length;ULONG DPMSVersion;ULONG PowerState; } VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT; //---------------------------------------------------------------------- // SetVideoPower - Turns on or off the display // int SetVideoPower (BOOL fOn) {VIDEO_POWER_MANAGEMENT vpm;int rc, fQueryEsc; HDC hdc; // Get the display dc.hdc = GetDC (NULL);// See if supported.fQueryEsc = SETPOWERMANAGEMENT; 128. rc = ExtEscape (hdc, QUERYESCSUPPORT, sizeof (fQueryEsc),(LPSTR)&fQueryEsc, 0, 0); if (rc == 0) { // No support, fail. ReleaseDC (NULL, hdc); return -1; } // Fill in the power management structure. vpm.Length = sizeof (vpm); vpm.DPMSVersion = 1; if (fOn) vpm.PowerState = VideoPowerOn; else vpm.PowerState = VideoPowerOff;// Tell the driver to turn on or off the display.rc = ExtEscape (hdc, SETPOWERMANAGEMENT, sizeof (vpm), (LPSTR)&vpm, 0, 0);// Always release what you get.ReleaseDC (NULL, hdc); return 0; } ExtEscape QUERYESCSUPPORT SETPOWERMANAGEMENT VIDEO_POWER_MANAGEMENT ExtEscape Windows CE OEM ExtEscape 11 APINotification APIOEM synchronization cradleWindows CE void WINAPI SystemIdleTimerReset (void); Windows CE SystemIdleTimerReset SystemParametersInfo SystemParametersInfo SPI_GETBATTERYIDLETIMEOUTSPI_GETEXTERNALIDLETIMEOUT AC 129. SPI_GETWAKEUPIDLETIMEOUT SystemIdleTimerReset 0 Windows CE .NET 4.0 GWES D0D1D2 D3 OEM On IdleSuspend ScreenOff, InCradle, OnBattery SDK PWRMGR_REG_KEY HKEY_LOCAL_MACHINESystemCurrentControlSetControlPower KeyState RequestPowerNotifications RequestPowerNotifications HANDLE RequestPowerNotifications (HANDLE hMsgQ, DWORD Flags);case 1: PBT_TRANSITION printf("10M half duplex "); break; On Suspend case 2: printf("10M full duplex "); PBT_RESUME break;case 4: resume printf("100M half duplex "); break; PBT_POWERSTATUSCHANGE case 8: printf("100M full duplex "); AC break;default: PBT_POWERINFOCHANGE printf("unknown: %d ", lnk); break; }printf("moden"); POWER_NOTIFY_ALL #endif . void RequestPowerNotifications NULL eth_halt(void) 130. WaitForSingleObject 10 signaled POWER_BROADCAST {DM9000_DBG("eth_haltn"); typedef struct _POWER_BROADCAST { DWORD Message; /* RESET devie */ DWORD Flags; phy_write(0, 0x8000); /* PHY RESET */ DWORD Length; DM9000_iow(DM9000_GPR, 0x01); /* Power-Down PHY */ WCHAR SystemPowerState[1]; DM9000_iow(DM9000_IMR, 0x80); /* Disable all interrupt */ } POWER_BROADCAST, *PPOWER_BROADCAST;SystemPowerState WCHARs PBT_ Flags POWER_STATE_ON on POWER_STATE_OFF off POWER_STATE_CRITICAL off POWER_STATE_BOOT printf("operating at "); switch (lnk) {POWER_STATE_IDLE idle POWER_STATE_SUSPENDPOWER_STATE_RESETLength SystemPowerState SystemPowerState PBT_TRANSITION SystemPowerState 0 Length Length Uncode Length TCHAR size PBT_POWERINFOCHANGE SystemPowerState PPOWER_BROADCAST_POWER_INFO typedef struct _POWER_BROADCAST_POWER_INFO {DWORDdwNumLevels;DWORDdwBatteryLifeTime;DWORDdwBatteryFullLifeTime; DWORDdwBackupBatteryLifeTime; DWORDdwBackupBatteryFullLifeTime;BYTEbACLineStatus;BYTEbBatteryFlag;BYTEbBatteryLifePercent; BYTE bBackupBatteryFlag; BYTE bBackupBatteryLifePercent; } POWER_BROADCAST_POWER_INFO, *PPOWER_BROADCAST_POWER_INFO; SYSTEM_POWER_STATUS_EX2 SetSystemPowerState DWORD SetSystemPowerState (LPCWSTR psState, DWORD StateFlags, 131. DWORD Options); psState NULL StateFlags POWER_STATE_ON POWER_STATE_RESET POWER_BROADCAST POWER_STATE_RESET SetSystemPowerState IOCTL_HAL_REBOOT KernelIoControl SetSystemPowerState SetSystemPowerState SetPowerRequirementSetSystemPowerState SetPowerRequirement SetPowerRequirement SetPowerRequirement HANDLE SetPowerRequirement (PVOID pvDevice, CEDEVICE_POWER_STATE DeviceState, ULONG DeviceFlags, PVOID pvSystemState, ULONG StateFlags); DeviceState CEDEVICE_POWER_STATE D0 D4 D0 D4 OEM D1 LCD D2 DeviceFlags POWER_NAMEPOWER_FORCE pvSystemState NULL pvSystemState ReleasePowerRequirement DWORD ReleasePowerRequirement (HANDLE hPowerReq); SetPowerRequirement 8.18 TCP/MP TCP/MP ,, core player. . rm,rmvb . http://picard.exceed.hu/tcpmp/ . 0.72RC1 .. !, arm9+wince . evc4.2 ,,. .1. http://picard.exceed.hu/tcpmp/. 0.72RC1. 132. 2.. evc4.2+standard sdk+Win32(WCE ARMV4) Release. evc . x86 . nasm . readme.txt .nasm http://nasm.sourceforge.net/.., readme.txt .3. 2 AMR . AMR 26104 26204 . ,readme.txt http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-610.zip http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-600.zip4. player_ce3 set as active project. player_ce3.exe . . project .5. rebuild all . evc FileView project .player_ce2, sample_ce3 2 project .( player_ce3. .). asap flac . 2.6. asap .,.. asap , : asap files -->settings-->c/c++-->Category-->Preprocessor. Additional include directories: , ".,asap,atari800/src". . Preprocessor definitions:",ASAP". . 2.,asap files project .7. flac . 6, flac settings . Additional include directories: "flac/include,flac/src/libFLAC/include", . , Preprocessor definitions:"FLAC__NO_DLL"._declspec(dllexport) c2491 .,flac project . 8. player_ce3 , Additional include directories "../asap/asap,../asap,../ asap/atari800/src,flac/include,flac/src/libFLAC/include". Preprocessor difinitions: ASAP., player_ce3.exe9. player_ce3.exe .!. 10.lang ., lang_std.txt lang_en.txt,lang_chs.txt,lang_ca.def ..TCP/MP .(,. .,.) wmv . !8.19 WinCE (suspend/wakeup), OEMPowerOff().OEMPowerOff() OEM , power.c off.c .OEMPowerOff() OEM , ,. : 1.,, AD,usb . 2.() 3. io, kitl 4. OALCPUPowerOff(). 133. OALCPUPowerOff() startup.s , 5. r4-r12,lr 6. wakeup ,MMU , sp lr RAM , config.bib .? reset ,. poweroff . 7. GSTATUS3 .(GSTATUS3 GSTATUS4 ,) 8.. 9. cache 10., 0,1,2, RTC 11. sdram , cpu power off : cpu power off ,, power off reset .reset 3 ,1., reset reset.2. reset.3.power off rtc reset. reset GSTATUS2 power off ., reset, bootloader , bootloader .: 1. rtc cpu bootloader 2.bootloader sdram ,. bootloader , ram , ram . bootloader ., bootloader ,. 3. checksum, sdram , poweroff sdram , checksum . 4. RAM ,, MMU sp lr. 5. mmu 6.. 7. sp lr. 8. r4-r12,lr 9. lr, OALCPUPowerOff(), OEMPowerOff(). 10. kitl,,. .,, . 8.20 WinCE EVC1 HINSTANCE HMODULE hModule = ::GetModuleHandle(NULL); HINSTANCE hInst = hModule;2 GetModuleFileName() NULL WM_CREAT 3 CreateStatusIcon CreateIconIndirect 16x16 4 CreateMsgQueue(); OpenMsgQueue(); GetMsgQueueInfo(); 134. ReadMsgQueue(); WriteMsgQueue(); CloseMsgQueue(); RequestDeviceNotifications();5. taskbar 5.1 Findwindow HHTASKBAR movewindow 5.2 taskbar Findwindow showwindow taskbar.cpppublic/shell/oak/hpc/explorer/taskbar/) CTaskBar::Register true5.3 platform.reg HKEY_LOCAL_MACHINESoftwareMicrosoftShellAutoHide("default"=dword:1)HKEY_LOCAL_MACHINESoftwareMicrosoftShellOnTop("default"=dword:0) HKEY_LOCAL_MACHINESoftwareMicrosoftShellSlideTaskBar("default"=dword:0)6. SipGetInfo(&si) SipSetInfo(&si) SipShowIM(SIPF_ON)7. stmenu.cpppublic/shell/oak/hpc/explorer/taskbar) stmenuData 8. index prefix 3 index createfile prefix index 9.EVC SHELLEXECUTEINFO ShExecInfo = {0}; ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; ShExecInfo.hwnd = NULL; ShExecInfo.lpVerb= NULL; ShExecInfo.lpFile = TEXT("http://www.163.com"); ShExecInfo.lpParameters =NULL; ShExecInfo.lpDirectory = NULL; ShExecInfo.nShow = SW_SHOWNORMAL; ShellExecuteEx(&ShExecInfo);10. OEM : TCHAR wszMachineName[128]; SystemParametersInfo(SPI_GETOEMINFO, sizeof(wszMachineName),&wszMachineName, 0); : TCHAR wszVersion[256];SystemParametersInfo(SPI_GETPLATFORMTYPE, sizeof(wszVersion),&wszVersion, 0); 135. 11.wince Windows CE 4.0 DEVMODE dmDisplayOrientation DMDO_0 DMDO_90 90 DMDO_180 180 DMDO_270 270 ChangeDisplaySettingsEx DEVMODE devmode = {0}; devmode.dmSize = sizeof(DEVMODE); devmode.dmDisplayOrientation = DMDO_90; // devmode.dmFields = DM_DISPLAYORIENTATION; ChangeDisplaySettingsEx(NULL, &devmode, NULL, 0, NULL); DEVMODE devmode = {0}; devmode.dmSize = sizeof(DEVMODE); devmode.dmFields = DM_DISPLAYORIENTATION; ChangeDisplaySettingsEx(NULL, &devmode, 0, CDS_TEST, NULL); devmode.dmDisplayOrientation HKEY_LOCAL_MACHINESystemGDIRotation Angle - DWORD (0, 90, 180, 270) LandscapeMode - DWORD (0,1)12. bmp void SaveDCToBMP(HDC hDC,int nStartX,int nStartY, int nWidth,int nHeight,LPCTSTR szFileName) {// int iPixel = 32; // LPBITMAPINFO lpbmih = new BITMAPINFO;lpbmih->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); lpbmih->bmiHeader.biWidth = nWidth; lpbmih->bmiHeader.biHeight = nHeight; lpbmih->bmiHeader.biPlanes = 1;lpbmih->bmiHeader.biBitCount = iPixel; lpbmih->bmiHeader.biCompression = BI_RGB;lpbmih->bmiHeader.biSizeImage = 0; lpbmih->bmiHeader.biXPelsPerMeter = 0; lpbmih->bmiHeader.biYPelsPerMeter = 0; lpbmih->bmiHeader.biClrUsed = 0; lpbmih->bmiHeader.biClrImportant = 0;//HDC hdcMem; HBITMAP hBitMap = NULL; CBitmap *pBitMap = NULL; CDC *pMemDC = NULL;BYTE *pBits;hdcMem = CreateCompatibleDC(hDC); 136. hBitMap = CreateDIBSection(hdcMem,lpbmih,DIB_PAL_COLORS,(void **)&pBits,NULL,0);pBitMap = new CBitmap; pBitMap->Attach(hBitMap);pMemDC = new CDC; pMemDC->Attach(hdcMem); pMemDC->SelectObject(pBitMap);pMemDC->BitBlt(0,0,nWidth,nHeight,CDC::FromHandle(hDC),nStartX,nStartY,SRCCOPY); BITMAPFILEHEADER bmfh;// ZeroMemory(&bmfh,sizeof(BITMAPFILEHEADER));*((char *)&bmfh.bfType) = 'B';*(((char *)&bmfh.bfType) + 1) = 'M';bmfh.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);bmfh.bfSize = bmfh.bfOffBits + (nWidth * nHeight) * iPixel / 8;int iBMPBytes = nWidth * nHeight * iPixel / 8; CFile file; if(file.Open(szFileName,CFile::modeWrite | CFile::modeCreate)) {file.Write(&bmfh,sizeof(BITMAPFILEHEADER));file.Write(&(lpbmih->bmiHeader),sizeof(BITMAPINFOHEADER));file.Write(pBits,iBMPBytes);file.Close(); } DeleteObject(hBitMap);DeleteObject(hDC);pMemDC->DeleteDC(); delete pMemDC; pMemDC = NULL; delete pBitMap; pBitMap = NULL; delete lpbmih; lpbmih = NULL; } 13. 0409 // Enaglish US 0404 // 0804 // GetSystemDefaultLangID()) GetUserDefaultLangID() switch(GetSystemDefaultLangID()/*GetUserDefaultLangID()*/) { case 0x0804: break; case 0x0404: break; case 0x0409: break; } 8.21 Win CE CECEBuilt-in 137. 31 CC++ lDllEntry(HINSTANCE DllInstance, INT Reason, LPVOID Reserved ) LoadLibraryUnloadLibrary DllInstanceDLLEXEDLL Reason: DLL_PROCESS_ATTACHDLL_PROCESS_DETACHReason Reason lDWORD XXX_Init( LPCTSTR pContext, LPCVOID lpvBusContext); DllEntry, DllEntryxxx_Init () DWORD XXX_Open0 XXX CreateFileXXX_Open pContext lpvBusContext DWORD XXX_Init( DWORD pContext ) pContextLPCTSTR l DWORD XXX_Open(DWORD hDeviceContext,DWORD dwAccess, DWORD dwShareMode); CreateFile XXX_Open hDeviceContext XXX_Init XXX_Init dwAccess 0 dwShareMode 0 hDeviceContext 0 CreateFile lDWORD XXX_Close( DWORD hDeviceContext ); CloseHandle hDeviceContext XXX_Open XXX_Open XXX_Open l DWORD XXX_Deinit( DWORD hDeviceContext ); XXX_Init hDeviceContext XXX_Init lvoid XXX_PowerUp( DWORD hDeviceContext ); lvoid XXX_PowerDown(DWORD hDeviceContext ); PowerUpPowerDown PowerDownPower DownPower Down/On Power OnIO IOPower Down IO l BOOL XXX_IOControl(DWORD 138. hDeviceContext,DWORD dwCode,PBYTE pBufIn, DWORD dwLenIn,PBYTE pBufOut,DWORD dwLenOut, PDWORD pdwActualOut ); CEIO IO IO hDeviceContext XXX_Open dwCodeIOCE pBufIn Buffer,IOBuffer dwLenIn pBufIn pBufOutdwLenOutBuffer pdwActualOut pBufOut NULL0 pdwActualOut 3.2 l(Platform.reg)[HKEY_LOCAL_MACHINEDriversBuiltInSampleDev]"Prefix"="XXX""Dll"="MyDev.Dll""Order"=dword:1l BIBBIN(Platform.bib)MyDev.dll $(_FLATRELEASEDIR)MyDev.dll NK SHlSampleDev.XXXPrefix3.3 platform/BSP/drivers driversdirs C sources, makefile, mydev.def makefile: !INCLUDE $(_MAKEENVROOT)makefile.defmydriver.defLIBRARYMyDev() EXPORTS XXX_Init XXX_Deinit XXX_Open XXX_Close XXX_PowerOff XXX_Power_Down XXX_IOControlSources: TARGETNAME= MyDevTARGETTYPE=DYNLINKTARGETLIBS=$(_COMMONSDKROOT)lib$(_CPUINDPATH)coredll.libSOURCELIBS= $(_COMMONOAKROOT)lib$(_CPUINDPATH)ceddk.libDEFFILE=MyDev.def (def) DLLENTRY=DllEntry SOURCES=3.4Project CE5.0Project ProjectDLL Project 3.5 DEBUG 139. RETAILMSGDEBUGMSDEBUG RELEASEDEBUGDebug Zone DEBUGMSG 1DllEntryCE image 2Init PrefixInitdefInit 8.22 Windows CE 1. Windows CE.NETE:ProjectMyWinCEBuild Windows CE.NETMyApp.exe 2. MyApp.exe E:PROJECTSMyWinCERelDirCEPC_X86Release 3. MyWinCEproject.bib FILES Section MyApp.exe $(_FLATRELEASEDIR)MyApp.exe NK H 4. MyApp.lnk 10#WindowsMyApp.exe MyApp.lnk E:PROJECTSMyWinCERelDirCEPC_X86Release 5. MyWinCEproject.bib FILES Section MyApp.lnk $(_FLATRELEASEDIR)MyApp.lnk NK H 6. MyWinCEproject.dat Directory("WindowsStartup"):- File("MyApp.lnk","WindowsMyApp.lnk") 7. MyWinCEplatform.bibFILES Section MyApp.exe $(_FLATRELEASEDIR)MyApp.exe NK H MyApp.lnk $ (_FLATRELEASEDIR)MyApp.lnk NK H 8. Platform Builder IDEBuildMake Image -> BuildRebuild 9. NK.binNK.nb0MyApp.exe MyApp.lnkMyApp Windows CE.NET startup 1) 2) 3) shell.reg [HKEY_LOCAL_MACHINEinit] "Launch50"="explorer.exe" "Depend50"=hex:14,00, 1e,00 explorer.exeMyApp.exe 4) Platform Builder IDEBuild- > Make ImageBuildRebuild 5) NK.binNK.nb0 MyApp.exeMyApp.lnkMyApp 140. PW2440Linux2.6.18.2 9.1 Linux2.6 Linux Linux 2.6 I/O () () Linux 2.6 Linux 2.6 2.6 Linux 2.6 Linux 2.6 Linux Linux 2.6 2.4 RTOS Linux 2.6 Linux 2.6 2.6 1 2 2.4.1 2.6 141. P 1.0GHz 310 5 LynuxWorks 1 2 2.6 142. 2.6 Linux Linux 2.6 FUSM(Fast User-Space Mutex) Linux 2.6 NUMA(Non Uniform Memory Access) 2.6 POSIX POSIX POSIX Linux 2.6 NPTL(Native POSIX Thread Library) POSIX 2.6 POSIX POSIX POSIX Linux Unix POSIX POSIX POSIX Unix POSIX 143. IRQ Linux 2.6 I/O Linux 2.6 ALSA Advanced Linux Sound Architecture USB MIDI ALSA Video4Linux 2.6 Linux 2.6 USB 2.0 USB 40 USB 2.0 Linux 64 2.6 Linux 64 Intel 64 Linux AMD64 AMD Opteron PowerPC PPC64 Linux Linux 2.6 Linux Linux Linux uClinux 2.6 uClinux Linux 2.6 m68k Dragonball ColdFire H8/300NEC v850 Axis ETRAX 32 Intel 32 Intel PAE() 32 64GB PAELinux 2.6 x86 Linux2.6 PAE 9.2 Linux2.6.18.2 144. 1busybox-1.6.1.tar.gz 2linux-2.6.18.2.tar.gz 3root.tar QT4root_no_qt.tar.gz QT5opie.tar QT OPIE 6autoflash 7mkfs.jffs2.config 8tools FTP9 10 USB 11 9.3 ATBOOT Linux2.6.18.2 ATBOOT ATBOOT Linux2.6 USB9.3.1 ATBOOT-35.bin DNW ATBOOT ATBOOT LINUX2.6 145. 9.3.2 8 9.3.3 1 zImage 146. 9.3.4 Y nand flash 9.3.5 USB PortTransmit zImage zImage35 3.5LCD zImage56 5.6 LCD 147. 9.3.6 All Files(*.*) zImage LCD zImage 9.3.7 FILE SIZE 148. 9.3.8 9.3.9 rootfs.img 8 149. 9.3.10 2 Y NAND FLASH 9.3.11 150. 9.3.12 rootfs.img 9.3.13 USB PortTransmit rootfs.img LCD 151. 9.3.14 FILE SIZE 9.3.15 nand flash 152. 9.3.16 FLASH 9.3.17 RESET 153. 9.3.18 9.3.19 QT QT-OPIE QT [root@avantech /]# echo "./etc/init.d/opie start" >> /mnt/etc/init.d/rcS 154. 9.3.20 [root@avantech /]# mnt/etc/init.d/rcS 9.3.21 OPIE 3.5LCD 7 8LCD 155. DNW 9.4 LINUX2.6.18.2 640*480 800*480 320*240 640*480 800*480 9.4.1. Please press Enter to activate this console.9.4.2. BusyBox v1.4.1 (2007-03-25 03:24:25 CST) Built-in shell (ash) Enter 'help' for a list of built-in commands.[root@avantech /]# ls ls arm etc linuxrc optsysvar bin home lost+foundproctmp dev lib mntsbin usr [root@avantech /]# cd etc ETC cd etc [root@avantech /etc]# ls pointercal ls familiar-version inetd.confpointercaltmp fstabinit.dprofile var group inittabprotocols hostsissueresolv.conf hosts.allow passwdservices [root@avantech /etc]# rm pointercal pointercal rm pointercal 156. [root@avantech /etc]# cd /mnt/etc mnt/etc cd /mnt/etc [root@avantech etc]# ls pointercal ls familiar-version inetd.conf pointercaltmp fstab init.dprofilevar groupinittab protocols hosts issue resolv.conf hosts.allow passwdservices [root@avantech etc]# rm pointercal pointercal rm pointercal RESET SHARP 8'LCD OK Finish OK etc mnt/etc [root@avantech /]# ls etc pointercal ls etc familiar-version inetd.conf pointercal tmp fstab init.dprofilevar group inittabprotocols hosts issue resolv.conf hosts.allow passwdservices [root@avantech /]# cp /etc/pointercal /mnt/etc pointercal mnt/etc cp /etc/pointercal /mnt/etc [root@avantech /]# ls /mnt/etc pointercal ls /mnt/etc familiar-version inetd.conf pointercal tmp fstabinit.dprofilevar group inittab protocols hostsissueresolv.conf hosts.allow passwd services [root@avantech /]# 9.5 Linux (NFS) 157. 9.5.1 /rootfs, root_no_qt.tar.gz mkdir /rootfs tar zxf root_no_qt.tar.gz -C /rootfs 9.5.2 . nfs /etc/exports ip cat > /mnt/etc/init.d/rcS [root@avantech /]# mnt/etc/init.d/rcS 179. LCD OPIE LINUX2.6 240*320 640*480800*480 240*320 9.10 Linux2.6.18.2 Linux2.6 1OPIE 180. opie qt/embedded opie/qt-2.3.10 tmake qt-x11 qt/embedded opie qtopia-2 opie x-windows source opie_env ./qvfb-qt2 & ./bin/qpe x86 2 telnet windows telnet ip 99 avantech login: root BusyBox v1.4.1 (2007-03-25 03:24:25 CST) Built-in shell (ash) Enter 'help' for a list of built-in commands.[root@avantech /]# Linux opie 3.5 [root@avantech /]# /etc/init.d/opie start [root@avantech /]# echo /etc/init.d/opie start >> /mnt/etc/init.d/rcS 64M nand flash flash halt 3 mp3 /opt/madplay /opt/happy.mp34SD SD U Mount /dev/mmcblk0p1 /mnt Ls /mntU mount /dev/sda1 /mnt umount /mnt 5 Qt Qt shell ifconfig eth0 192.168.1.100 # ip route add default gw 192.168.1.1 # ip/linuxrc /etc/init.d/rcS echo "ifconfig eth0 192.168.1.100 # ip " >> /etc/init.d/rcS echo "route add default gw 192.168.1.1 # ip" >> /etc/init.d/rcS flash /mnt/etc /etc linuxrc /etc/init.d/rcS /mnt/etc/init.d/rcS 181. cp /etc/init.d/rcS /mnt/etc/init.d/rcS NAND FLASH SDRAM mnt/etc.6usb usb 1. U-BOOT set bootargs_b $(bootargs) 2. set bootargs $(bootargs) console=tty0 3. saveenv;reset LCD usb shell7 spcaserv insmod usbcam.ko ,./spcaserv -d /dev/video0 -s 320x240 -w 192.168.1.11:7070play play.bat ip spcaview -w 192.168.1.11:7070 -s 320x240192.168.1.11 ip thttpd web thttpd-php php ./thttpd-php -C thttpd.conf thttpd.conf dir=/ web /tmpindex.cgi shell cgi / http://192.168.1.11/index.cgi usbcam.rar pc 9sqlite test.c c sqlite 10tslib auto.sh export TSLIB_ROOT=/opt/tslib tslib ./auto.sh tslib/bin ts_calibrate ( te_test ts_test ad.ko ts.ko ad 11vntwusb.ko USB insmod vntwusb.ko , ifconfig wetctl USB ./wetctl .. 12adc ad ./ad 182. 13.SD new_mmc.patch Linux-2.6.18.2 patch p1 < new_mmc.patch make clean && make uImage SD s3c2410-sdi s3c2410-sdi: powered down. s3c2410-sdi s3c2410-sdi: initialisation done. SD 1G SD [root@avantech /]# mmcblk0: mmc0:0d50 SD01G 1006080KiBmmcblk0: p1/dev mmcblk0p1 mmcblk0 [root@avantech /]# ls /dev console mmcblk0p1 ptmxshm mmcblk0 null pts tty0mmcblk0p1 SD SD mount /dev/mmcblk0p1 /mnt SD /mnt [root@avantech /]# cd /mnt [root@avantech /mnt]# ls etc [root@avantech /mnt]# mount /dev/mmcblk0p1 /mnt/ [root@avantech /mnt]# cd /mnt/ [root@avantech /mnt]# ls happy.mp3 [root@avantech /mnt]# rm happy.mp3 [root@avantech /mnt]# ls [root@avantech /mnt]# cp /opt/happy.mp3 ./ [root@avantech /mnt]# ls happy.mp3 [root@avantech /mnt]# cd .. [root@avantech /]# umount /mnt/ [root@avantech /]# ls mnt/ etc [root@avantech /]# Linux SD /dev mmcblk0p1 mmcblk0 mdev s 14 date -s 0120113509 hwclock -w ls /dev/rtc* ln -s /dev/rtc0 /dev/rtc15FLASH df h16TFTP tftpget -r - hostip1716key.rar 16key.ko PW2440 insmod 16key.ko 183. 16keyMakefile KERNELBUILD := /Sunny/linux-2.6.18.2 18 sd SDmount /dev/mmcblk0p1 /mnt SDcd /mntcp libmad.so.0 /lib/ /etc/init.d/opie stop export SDL_NOMOUSE=1 ./mplayer xxx.avi -nosound mplayer xxx.avi -ac mad ctrl+c19GSM COM0,115200 demo.txt #send sms 184. ./sms --Type O --Model mc75 --Serial /dev/ttyACM0 --Number 13631205545 --Content "sdfsdsdfsd" -- Coding PDU#receive sms ./sms --Type I --Model mc75 --Serial /dev/ttyACM0 --Timeout 5 --Number 1381111111120GPRS 1.windowsgsm.raru,Ugsmcom12.U mount /dev/sda /mntMODEM. [root@avantech /mnt]# ./atgprs /dev/s3c2410_serial0 -s 115200 Connected. at OK ctrl+]3. cd /mnt ./gsmsetup.sh pppd call gsm ifconfig ppp ping www.g.cn4. wget http://www.google.com/index.html google ping www.google.com Linux2.6.18 Linux2.6/ 1U-BOOTuboot1.3 11 boardSDRAMFLASH exampleX86 common Cpucpu.cinterrupt.cstart.S Driver Doc Include includeconfigs fs Net 185. Toolu-bootbin Diskdisk Post lib_xxxlib_ppclib_armPowerPCARM dtt 12 11 CPU1.Cache2.RAM3.4.C 12 C 1. 2. 3.FlashRAM 4. 5.13 arm-linux-gcc3.4.1 11. arm-linux-gcc-3.4.1.tar.bz2PClinux 22. 33. export PATH=/usr/local/arm/3.4.1/bin:$PATH 14 u-boot-1.3.0-rc3 11 make distclean 22 make smdk2440_config 33 make u-boot.binu-boot15 U-BOOT01 12 23 CPU34 45 56 67 186. 16 UBOOTAT2440u-boot-1.3.0smdk2410 Iboard 1.board/smdk2440board/smdk2410 2.udc.cboard/smdk2440 3.board/smdk2440smdk2410.csmdk2440.c 4.board/smdk2410/makefile COBJS := smdk2410.o flash.o COBJS := smdk2440.o flash.o udc.o 5.boardsmdk2440u-boot.lds.text :{cpu/arm920t/start.o (.text)*(.text)} .text :{cpu/arm920t/start.o (.text)cpu/arm920t/s3c24x0/nand_read.o (.text)*(.text)} 6.boardsmdk2440flash.c 187. #include #ifndef CFG_NO_FLASH 7. boardsmdk2440flash.c#endif /* CFG_NO_FLASH */8.boardsmdk2440smdk2440.c #include #include #define M_MDIV 0xA1#define M_MDIV 0x6e #define U_M_MDIV 0x48 #define U_M_PDIV 0x3 #define U_M_MDIV 0x3c #define U_M_PDIV 0x49.boardsmdk2440smdk2440.c int board_init (void) {S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();/* to reduce PLL lock time, adjust the LOCKTIME register */ clk_power->LOCKTIME = 0xFFFFFF;/* configure MPLL */ clk_power->MPLLCON = ((M_MDIV GPBUP = 0x000007FF; gpio->GPCCON = 0xAAAAAAAA; gpio->GPCUP = 0x0000FFFF; gpio->GPDCON = 0xAAAAAAAA; gpio->GPDUP = 0x0000FFFF; gpio->GPECON = 0xAAAAAAAA; gpio->GPEUP = 0x0000FFFF; gpio->GPFCON = 0x000055AA; gpio->GPFUP = 0x000000FF; gpio->GPGCON = 0xFF95FFBA; gpio->GPGUP = 0x0000FFFF; gpio->GPHCON = 0x002AFAAA; gpio->GPHUP = 0x000007FF;/* arch number of SMDK2410-Board */ gd->bd->bi_arch_number = MACH_TYPE_SMDK2410;/* adress of boot parameters */ gd->bd->bi_boot_params = 0x30000100; 188. icache_enable(); dcache_enable(); return 0; } int board_init (void) {S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); /* to reduce PLL lock time, adjust the LOCKTIME register */ // clk_power->LOCKTIME = 0xFFFFFF; /* configure MPLL */ // clk_power->MPLLCON = ((M_MDIV GPBUP = 0x000007FF;gpio->GPCCON = 0xAAAAAAAA;gpio->GPCUP = 0x0000FFFF;gpio->GPDCON = 0xAAAAAAAA;gpio->GPDUP = 0x0000FFFF;gpio->GPECON = 0xAAAAAAAA;gpio->GPEUP = 0x0000FFFF;gpio->GPFCON = 0x000055AA;gpio->GPFUP = 0x000000FF;gpio->GPGCON = 0xFD95FFBA;gpio->GPGUP = 0x0000FFFF; #ifdef CONFIG_SERIAL3gpio->GPHCON = 0x002AAAAA; #elsegpio->GPHCON = 0x002AFAAA; #endifgpio->GPHUP = 0x000007FF;gpio->GPJCON = 0x2AAAAAA;#if 0/* USB Device Part *//*GPGCON is reset for USB Device */gpio->GPGCON = (gpio->GPGCON & ~(3 GPGUP | ( 1 GPGDAT |= ( 1 GPGDAT &= ~( 1 GPGDAT |= ( 1 bd->bi_arch_number = MACH_TYPE_S3C2440;/* adress of boot parameters */ gd->bd->bi_boot_params = 0x30000100;icache_enable(); dcache_enable(); return 0; } IIcommoncmd_jffs2.c int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) {char *fsname;char *filename;int size;struct part_info *part;ulong offset = load_addr;/* pre-set Boot file name */ if ((filename = getenv("bootfile")) == NULL) {filename = "uImage"; }if (argc == 2) {filename = argv[1]; } if (argc == 3) {offset = simple_strtoul(argv[1], NULL, 16);load_addr = offset;filename = argv[2]; }/* make sure we are in sync with env variables */ if (mtdparts_init() !=0)return 1;if ((part = jffs2_part_info(current_dev, current_partnum))){ /* check partition type for cramfs */fsname = (cramfs_check(part) ? "CRAMFS" : "JFFS2");printf("### %s loading '%s' to 0x%lxn", fsname, filename, offset); if (cramfs_check(part)) { size = cramfs_load ((char *) offset, part, filename);} else { /* if this is not cramfs assume jffs2 */ size = jffs2_1pass_load((char *)offset, part, filename);} if (size > 0) { char buf[10]; printf("### %s load complete: %d bytes loaded to 0x%lxn",fsname, size, offset); sprintf(buf, "%x", size); 190. setenv("filesize", buf);} else { printf("### %s LOAD ERROR for %s!n", fsname, size, filename);}return !(size > 0);}return 1; } #ifndef CFG_NO_FLASH int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) {char *fsname;char *filename;int size;struct part_info *part;ulong offset = load_addr;/* pre-set Boot file name */ if ((filename = getenv("bootfile")) == NULL) {filename = "uImage"; }if (argc == 2) {filename = argv[1]; } if (argc == 3) {offset = simple_strtoul(argv[1], NULL, 16);load_addr = offset;filename = argv[2]; }/* make sure we are in sync with env variables */ if (mtdparts_init() !=0)return 1;if ((part = jffs2_part_info(current_dev, current_partnum))){ /* check partition type for cramfs */fsname = (cramfs_check(part) ? "CRAMFS" : "JFFS2");printf("### %s loading '%s' to 0x%lxn", fsname, filename, offset); if (cramfs_check(part)) { size = cramfs_load ((char *) offset, part, filename);} else { /* if this is not cramfs assume jffs2 */ size = jffs2_1pass_load((char *)offset, part, filename);} if (size > 0) { char buf[10]; printf("### %s load complete: %d bytes loaded to 0x%lxn",fsname, size, offset); sprintf(buf, "%x", size); setenv("filesize", buf);} else { printf("### %s LOAD ERROR for %s!n", fsname, size, filename);} 191. return !(size > 0);}return 1; } #endifIIIcpu 1.cpu/arm920t/s3c24x0/speed.c . #if defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined (CONFIG_TRAB) #if defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined (CONFIG_S3C2440) || defined (CONFIG_TRAB). #if defined(CONFIG_S3C2400) #include #elif defined(CONFIG_S3C2410) #include #endif #if defined(CONFIG_S3C2400) #include #elif defined(CONFIG_S3C2410) #include #elif defined(CONFIG_S3C2440) #include #endif. static ulong get_PLLCLK(int pllreg) return((CONFIG_SYS_CLK_FREQ * m) / (p CAMDIVN & 0x200) ? get_FCLK()/8 : get_FCLK()/4;case 0x6: return (clk_power->CAMDIVN & 0x100) ? get_FCLK()/6 : get_FCLK()/3;}return 0; #else #error "get_HCLK not implemented for CPU type" #endif }2.cpuarm920ts3c24x0usb.c #if defined(CONFIG_USB_OHCI_NEW) && defined(CFG_USB_OHCI_CPU_INIT) # if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410)#if defined(CONFIG_S3C2400) # include #elif defined(CONFIG_S3C2410) # include #endif #if defined(CONFIG_USB_OHCI_NEW) && defined(CFG_USB_OHCI_CPU_INIT) # if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)#if defined(CONFIG_S3C2400) # include #elif defined(CONFIG_S3C2410) # include #elif defined(CONFIG_S3C2440) # include #endif3.cpuarm920ts3c24x0usb_ohci.c #if defined(CONFIG_S3C2400) #include #elif defined(CONFIG_S3C2410) #include #endif #if defined(CONFIG_S3C2400) #include #elif defined(CONFIG_S3C2410) #include #elif defined(CONFIG_S3C2440) #include #endif 4.cpuarm920tstart.S 193. . #include #include #include #include #include #if defined(CONFIG_S3C2410) #include #elif defined(CONFIG_S3C2440) #include #endif #include . bl coloured_LED_init bl red_LED_on. #if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410)/* turn off the watchdog */# if defined(CONFIG_S3C2400) # define pWTCON 0x15300000 # define INTMSK 0x14400008 /* Interupt-Controller base addresses */ # define CLKDIVN 0x14800014 /* clock divisor register */ #else # define pWTCON 0x53000000 # define INTMSK 0x4A000008 /* Interupt-Controller base addresses */ # define INTSUBMSK 0x4A00001C # define CLKDIVN 0x4C000014 /* clock divisor register */ # endif #if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)/* turn off the watchdog */# if defined(CONFIG_S3C2400) # define pWTCON 0x15300000 # define INTMSK 0x14400008 /* Interupt-Controller base addresses */ # define CLKDIVN 0x14800014 /* clock divisor register */ #elif defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440) # define pWTCON 0x53000000 # define INTMSK 0x4A000008 /* Interupt-Controller base addresses */ # define INTSUBMSK 0x4A00001C # define LOCKTIME 0x4c000000 # define MPLLCON 0x4c000004 # define UPLLCON 0x4c000008 # define CLKDIVN 0x4C000014 /* clock divisor register */ # endif#if defined(CONFIG_S3C2410) # define INTSUBMSK_val 0x7ff # define MPLLCON_val((0x90 GPEDAT & 0x8000) >> 15; #endif #ifdef CONFIG_S3C2400return (gpio->PGDAT & 0x0020) >> 5; #endif } static void SetI2CSCL(int x) {S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();#ifdef CONFIG_S3C2410gpio->GPEDAT = (gpio->GPEDAT & ~0x4000) | (x&1) PGDAT = (gpio->PGDAT & ~0x0040) | (x&1) GPEDAT = (gpio->GPEDAT & ~0x4000) | (x&1) PGDAT = (gpio->PGDAT & ~0x0040) | (x&1) GPECON; #endif #ifdef CONFIG_S3C2400 ulong old_gpecon = gpio->PGCON; #endif /* bus still busy probably by (most) previously interrupted transfer */#ifdef CONFIG_S3C2410/* set I2CSDA and I2CSCL (GPE15, GPE14) to GPIO */gpio->GPECON = (gpio->GPECON & ~0xF0000000) | 0x10000000; #endif #ifdef CONFIG_S3C2400/* set I2CSDA and I2CSCL (PG5, PG6) to GPIO */gpio->PGCON = (gpio->PGCON & ~0x00003c00) | 0x00001000; #endif 202. if ((status & I2CSTAT_BSY) || GetI2CSDA () == 0) { #if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440) ulong old_gpecon = gpio->GPECON; #endif #ifdef CONFIG_S3C2400 ulong old_gpecon = gpio->PGCON; #endif /* bus still busy probably by (most) previously interrupted transfer */#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)/* set I2CSDA and I2CSCL (GPE15, GPE14) to GPIO */gpio->GPECON = (gpio->GPECON & ~0xF0000000) | 0x10000000; #endif #ifdef CONFIG_S3C2400/* set I2CSDA and I2CSCL (PG5, PG6) to GPIO */gpio->PGCON = (gpio->PGCON & ~0x00003c00) | 0x00001000; #endif/* restore pin functions */ #ifdef CONFIG_S3C2410gpio->GPECON = old_gpecon; #endif #ifdef CONFIG_S3C2400gpio->PGCON = old_gpecon; #endif /* restore pin functions */ #if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)gpio->GPECON = old_gpecon; #endif #ifdef CONFIG_S3C2400gpio->PGCON = old_gpecon; #endif8.cpuarm920ts3c24x0serial.c #include #if defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined (CONFIG_TRAB)#if defined(CONFIG_S3C2400) || defined(CONFIG_TRAB) #include #elif defined(CONFIG_S3C2410) #include #endif #include #if defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined(CONFIG_S3C2440) || defined (CONFIG_TRAB)#if defined(CONFIG_S3C2400) || defined(CONFIG_TRAB) #include #elif defined(CONFIG_S3C2410) #include #elif defined(CONFIG_S3C2440) #include #endif9.cpuarm920ts3c24x0Makefile COBJS = i2c.o interrupts.o serial.o speed.o 203. usb.o COBJS = i2c.o interrupts.o serial.o speed.o usb.o nand_read.o nand.o mmc.o cmd_s3c24xx.oIV 1driversdm9000x.c int eth_init(bd_t * bd)i = 0;while (!(phy_read(1) & 0x20)) { /* autonegation complete bit */ udelay(1000); i++; if (i == 10000) {printf("could not establish linkn");return 0; }} /* see what we've got */lnk = phy_read(17) >> 12;printf("operating at ");switch (lnk) {case 1: printf("10M half duplex "); break;case 2: printf("10M full duplex "); break;case 4: printf("100M half duplex "); break;case 8: printf("100M full duplex "); break;default: printf("unknown: %d ", lnk); break;}printf("moden"); #if 0i = 0;while (!(phy_read(1) & 0x20)) { /* autonegation complete bit */ udelay(1000); i++; if (i == 10000) {printf("could not establish linkn");return 0; }} /* see what we've got */lnk = phy_read(17) >> 12;DM9000_iow(DM9000_RCR, 0x00); /* Disable RX */ } 204. void eth_halt(void) { #if 0 //weibingDM9000_DBG("eth_haltn"); /* RESET devie */phy_write(0, 0x8000); /* PHY RESET */DM9000_iow(DM9000_GPR, 0x01); /* Power-Down PHY */DM9000_iow(DM9000_IMR, 0x80); /* Disable all interrupt */DM9000_iow(DM9000_RCR, 0x00); /* Disable RX */ #endif }. int eth_rx(void) DM9000_ior(DM9000_MRCMDX); /* Dummy read */rxbyte = DM9000_inb(DM9000_DATA); /* Got most updated data */ DM9000_ior(DM9000_MRRH);DM9000_ior(DM9000_MRRL);DM9000_ior(DM9000_MRCMDX); /* Dummy read */rxbyte = DM9000_inb(DM9000_DATA); /* Got most updated data */2USB .usbdcore_s3c2410.cusbdcore_s3c2410.hdrivers.driversMakefileusbdcore.o usbdcore_ep0.o usbdcore_mpc8xx.o usbdcore_omap1510.ousbdcore.o usbdcore_ep0.o usbdcore_mpc8xx.o usbdcore_omap1510.o usbdcore_s3c2410.o .driversusb_ohci.c #if defined(CONFIG_ARM920T) || defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) || defined(CONFIG_440EP) || defined(CONFIG_PCI_OHCI) || defined(CONFIG_MPC5200) # define OHCI_USE_NPS /* force NoPowerSwitching mode */ #endif #if defined(CONFIG_ARM920T) || defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440) || defined(CONFIG_440EP) || defined(CONFIG_PCI_OHCI) || defined(CONFIG_MPC5200) # define OHCI_USE_NPS /* force NoPowerSwitching mode */ #endif.driversusbdcore_ep0.c static int ep0_get_descriptor (struct usb_device_instance *device, 205. struct urb *urb, int max, int descriptor_type,int index) {int port = 0; /* XXX compound device */char *cp;/*dbg_ep0(3, "max: %x type: %x index: %x", max, descriptor_type, index); */if (!urb || !urb->buffer || !urb->buffer_length|| (urb->buffer_length < 255)) {dbg_ep0 (2, "invalid urb %p", urb);return -1L; }/* setup tx urb */ urb->actual_length = 0; cp = (char*)urb->buffer;dbg_ep0 (2, "%s", USBD_DEVICE_DESCRIPTORS (descriptor_type));switch (descriptor_type) { case USB_DESCRIPTOR_TYPE_DEVICE:{ struct usb_device_descriptor *device_descriptor; if (!(device_descriptor = usbd_device_device_descriptor (device, port))) {return -1; } /* copy descriptor for this device */ copy_config (urb, device_descriptor,sizeof (struct usb_device_descriptor),max); /* correct the correct control endpoint 0 max packet size into the descriptor */device_descriptor = (struct usb_device_descriptor *) urb->buffer; }dbg_ep0(3, "copied device configuration, actual_length: 0x%x", urb->actual_length);break;case USB_DESCRIPTOR_TYPE_CONFIGURATION:{ struct usb_configuration_descriptor*configuration_descriptor; struct usb_device_descriptor *device_descriptor; if (! (device_descriptor =usbd_device_device_descriptor (device, port))) {return -1; } /*dbg_ep0(2, "%d %d", index, device_descriptor->bNumConfigurations); */ if (index > device_descriptor->bNumConfigurations) {dbg_ep0 (0, "index too large: %d > %d", index,device_descriptor->bNumConfigurations);return -1; } 206. if (!(configuration_descriptor = usbd_device_configuration_descriptor (device, port, index))) { dbg_ep0 (0, "usbd_device_configuration_descriptor failed: %d", index); return -1;}dbg_ep0(0, "attempt to copy %d bytes to urbn",cpu_to_le16(configuration_descriptor->wTotalLength));copy_config (urb, configuration_descriptor, cpu_to_le16(configuration_descriptor->wTotalLength),max);} break; case USB_DESCRIPTOR_TYPE_STRING: {struct usb_string_descriptor *string_descriptor;if (!(string_descriptor = usbd_get_string (index))) { serial_printf("Invalid string index %dn", index); return -1;}dbg_ep0(3, "string_descriptor: %p length %d", string_descriptor, string_descriptor->bLength);copy_config (urb, string_descriptor, string_descriptor->bLength, max); } break;case USB_DESCRIPTOR_TYPE_INTERFACE:serial_printf("USB_DESCRIPTOR_TYPE_INTERFACE - error not implementedn"); return -1;case USB_DESCRIPTOR_TYPE_ENDPOINT: serial_printf("USB_DESCRIPTOR_TYPE_ENDPOINT - error not implementedn"); return -1;case USB_DESCRIPTOR_TYPE_HID: {serial_printf("USB_DESCRIPTOR_TYPE_HID - error not implementedn");return -1; /* unsupported at this time */ #if 0int bNumInterface = le16_to_cpu (urb->device_request.wIndex);int bAlternateSetting = 0;int class = 0;struct usb_class_descriptor *class_descriptor; if (!(class_descriptor =usbd_device_class_descriptor_index (device, port, 0, bNumInterface, bAlternateSetting, class))|| class_descriptor->descriptor.hid.bDescriptorType != USB_DT_HID) { dbg_ep0 (3, "[%d] interface is not HID", bNumInterface); return -1;} 207. /* copy descriptor for this class */copy_config (urb, class_descriptor,class_descriptor->descriptor.hid.bLength,max); #endif } break;case USB_DESCRIPTOR_TYPE_REPORT: {serial_printf("USB_DESCRIPTOR_TYPE_REPORT - error not implementedn");return -1; /* unsupported at this time */ #if 0int bNumInterface = le16_to_cpu (urb->device_request.wIndex);int bAlternateSetting = 0;int class = 0;struct usb_class_report_descriptor *report_descriptor; if (!(report_descriptor =usbd_device_class_report_descriptor_index(device, port, 0, bNumInterface, bAlternateSetting, class))|| report_descriptor->bDescriptorType !=USB_DT_REPORT) { dbg_ep0 (3, "[%d] descriptor is not REPORT", bNumInterface); return -1;}/* copy report descriptor for this class *//*copy_config(urb, &report_descriptor->bData[0], report_descriptor->wLength, max); */if (max - urb->actual_length > 0) { int length =MIN (report_descriptor->wLength, max - urb->actual_length); memcpy (urb->buffer + urb->actual_length,&report_descriptor->bData[0], length); urb->actual_length += length;} #endif } break;case USB_DESCRIPTOR_TYPE_DEVICE_QUALIFIER: {/* If a USB device supports both a full speed and low speed operation * we must send a Device_Qualifier descriptor here */return -1; }default: return -1;}dbg_ep0 (1, "urb: buffer: %p buffer_length: %2d actual_length: %2d tx_packetSize: %2d", urb->buffer, urb->buffer_length, urb->actual_length, device->bus->endpoint_array[0].tx_packetSize); /*if ((urb->actual_length < max) && !(urb->actual_length % device->bus->endpoint_array[0].tx_packetSize)) { 208. dbg_ep0(0, "adding null byte");urb->buffer[urb->actual_length++] = 0;dbg_ep0(0, "urb: buffer_length: %2d actual_length: %2d packet size: %2d", urb->buffer_length, urb->actual_length device->bus->endpoint_array[0].tx_packetSize);} */return 0;} static int ep0_get_descriptor (struct usb_device_instance *device, struct urb *urb, int max, int descriptor_type, int index) {int port = 0; /* XXX compound device */char *cp;/*dbg_ep0(3, "max: %x type: %x index: %x", max, descriptor_type, index); */if (!urb || !urb->buffer || !urb->buffer_length|| (urb->buffer_length < 255)) {dbg_ep0 (2, "invalid urb %p", urb);serial_printf("invalid urb %p", urb);return -1L; }/* re-initialize the ep0 buffer pointer */ urb->buffer = (u8 *) urb->buffer_data;/* setup tx urb */ urb->actual_length = 0; cp = (char*)urb->buffer;dbg_ep0 (2, "%s", USBD_DEVICE_DESCRIPTORS (descriptor_type));switch (descriptor_type) { case USB_DESCRIPTOR_TYPE_DEVICE:{ struct usb_device_descriptor *device_descriptor; if (!(device_descriptor = usbd_device_device_descriptor (device, port))) {return -1; } urb->buffer = device_descriptor; urb->actual_length = MIN(sizeof(*device_descriptor), max);}dbg_ep0(3, "copied device configuration, actual_length: 0x%x", urb->actual_length);break;case USB_DESCRIPTOR_TYPE_CONFIGURATION:{ struct usb_configuration_descriptor*configuration_descriptor; struct usb_device_descriptor *device_descriptor; if (!(device_descriptor = usbd_device_device_descriptor (device, port))) {return -1; 209. }/*dbg_ep0(2, "%d %d", index, device_descriptor->bNumConfigurations); */if (index > device_descriptor->bNumConfigurations) { dbg_ep0 (0, "index too large: %d > %d", index, device_descriptor-> bNumConfigurations); return -1;}if (! (configuration_descriptor =usbd_device_configuration_descriptor (device,port,index))) {dbg_ep0 (0,"usbd_device_configuration_descriptor failed: %d",index);return -1; } urb->buffer = configuration_descriptor; urb->actual_length =MIN(le16_to_cpu(configuration_descriptor->wTotalLength), max);} break; case USB_DESCRIPTOR_TYPE_STRING: {struct usb_string_descriptor *string_descriptor;if (!(string_descriptor = usbd_get_string (index))) { serial_printf("Invalid string index %dn", index); return -1;}dbg_ep0(3, "string_descriptor: %p length %d", string_descriptor, string_descriptor->bLength);copy_config (urb, string_descriptor, string_descriptor->bLength, max); } break;case USB_DESCRIPTOR_TYPE_INTERFACE:serial_printf("USB_DESCRIPTOR_TYPE_INTERFACE - error not implementedn"); return -1;case USB_DESCRIPTOR_TYPE_ENDPOINT: serial_printf("USB_DESCRIPTOR_TYPE_ENDPOINT - error not implementedn"); return -1;case USB_DESCRIPTOR_TYPE_HID: {serial_printf("USB_DESCRIPTOR_TYPE_HID - error not implementedn");return -1; /* unsupported at this time */ #if 0int bNumInterface = le16_to_cpu (urb->device_request.wIndex);int bAlternateSetting = 0;int class = 0;struct usb_class_descriptor *class_descriptor; if (!(class_descriptor = usbd_device_class_descriptor_index (device,port, 0,bNumInterface,bAlternateSetting, 210. class))|| class_descriptor->descriptor.hid.bDescriptorType != USB_DT_HID) { dbg_ep0 (3, "[%d] interface is not HID", bNumInterface); return -1;}/* copy descriptor for this class */copy_config (urb, class_descriptor,class_descriptor->descriptor.hid.bLength,max); #endif } break;case USB_DESCRIPTOR_TYPE_REPORT: {serial_printf("USB_DESCRIPTOR_TYPE_REPORT - error not implementedn");return -1; /* unsupported at this time */ #if 0int bNumInterface = le16_to_cpu (urb->device_request.wIndex);int bAlternateSetting = 0;int class = 0;struct usb_class_report_descriptor *report_descriptor; if (!(report_descriptor =usbd_device_class_report_descriptor_index(device, port, 0, bNumInterface, bAlternateSetting, class))|| report_descriptor->bDescriptorType !=USB_DT_REPORT) { dbg_ep0 (3, "[%d] descriptor is not REPORT", bNumInterface); return -1;}/* copy report descriptor for this class *//*copy_config(urb, &report_descriptor->bData[0], report_descriptor->wLength, max); */if (max - urb->actual_length > 0) { int length =MIN (report_descriptor->wLength, max - urb->actual_length); memcpy (urb->buffer + urb->actual_length,&report_descriptor->bData[0], length); urb->actual_length += length;} #endif } break;case USB_DESCRIPTOR_TYPE_DEVICE_QUALIFIER: {/* If a USB device supports both a full speed and low speed operation * we must send a Device_Qualifier descriptor here */return -1; }default: return -1;} 211. dbg_ep0 (1, "urb: buffer: %p buffer_length: %2d actual_length: %2d tx_packetSize: %2d",urb->buffer, urb->buffer_length, urb->actual_length,device->bus->endpoint_array[0].tx_packetSize); /*if ((urb->actual_length < max) && !(urb->actual_length % device->bus->endpoint_array[0].tx_packetSize)) {dbg_ep0(0, "adding null byte");urb->buffer[urb->actual_length++] = 0;dbg_ep0(0, "urb: buffer_length: %2d actual_length: %2d packet size: %2d", urb->buffer_length, urb->actual_length device->bus->endpoint_array[0].tx_packetSize);} */return 0;}.driversusbtty.h #if defined(CONFIG_PPC) #include "usbdcore_mpc8xx.h" #elif defined(CONFIG_ARM) #include "usbdcore_omap1510.h" #endif #if defined(CONFIG_PPC) #include "usbdcore_mpc8xx.h" #elif defined(CONFIG_ARM) #include "usbdcore_omap1510.h" #elif defined(CONFIG_S3C2410) #include "usbdcore_s3c2410.h" #endifV fscramfscramfs.c #if defined(CONFIG_CMD_JFFS2) //#if defined(CONFIG_CMD_JFFS2) #if defined(CFG_FS_CRAMFS)VIlib_arm lib_arm_udivsi3.S bl __div0(PLT) bl __div0 // (PLT)lib_arm_umodsi3.S bl __div0(PLT) bl __div0 // (PLT)lib_armboard.c void inline __coloured_LED_init (void) {} void inline coloured_LED_init (void) __attribute__((weak, alias("__coloured_LED_init"))); void inline __red_LED_on (void) {} void inline red_LED_on (void) __attribute__((weak, alias("__red_LED_on"))); void inline __red_LED_off(void) {} void inline red_LED_off(void) __attribute__((weak, alias("__red_LED_off"))); void inline __green_LED_on(void) {} void inline green_LED_on(void) __attribute__((weak, alias("__green_LED_on"))); 212. void inline __green_LED_off(void) {} void inline green_LED_off(void)__attribute__((weak, alias("__green_LED_off"))); void inline __yellow_LED_on(void) {} void inline yellow_LED_on(void)__attribute__((weak, alias("__yellow_LED_on"))); void inline __yellow_LED_off(void) {} void inline yellow_LED_off(void)__attribute__((weak, alias("__yellow_LED_off"))); #include void inline __coloured_LED_init (void) {} void inline coloured_LED_init (void) __attribute__((weak, alias("__coloured_LED_init"))); void inline __red_LED_on (void) {S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();gpio->GPJDAT &= ~(1