H5 User Manual
H5 User Manual
Revision 1.0
May.20,2016
Declaration
THIS DOCUMENTATION IS THE ORIGINAL WORK AND COPYRIGHTED PROPERTY OF ALLWINNER TECHNOLOGY
(ALLWINNER). REPRODUCTION IN WHOLE OR IN PART MUST OBTAIN THE WRITTEN APPROVAL OF ALLWINNER AND
GIVE CLEAR ACKNOWLEDGEMENT TO THE COPYRIGHT OWNER.
THE INFORMATION FURNISHED BY ALLWINNER IS BELIEVED TO BE ACCURATE AND RELIABLE. ALLWINNER RESERVES
THE RIGHT TO MAKE CHANGES IN CIRCUIT DESIGN AND/OR SPECIFICATIONS AT ANY TIME WITHOUT NOTICE.
ALLWINNER DOES NOT ASSUME ANY RESPONSIBILITY AND LIABILITY FOR ITS USE. NOR FOR ANY INFRINGEMENTS OF
PATENTS OR OTHER RIGHTS OF THE THIRD PARTIES WHICH MAY RESULT FROM ITS USE. NO LICENSE IS GRANTED BY
IMPLICATION OR OTHERWISE UNDER ANY PATENT OR PATENT RIGHTS OF ALLWINNER. THIS DOCUMENTATION
NEITHER STATES NOR IMPLIES WARRANTY OF ANY KIND, INCLUDING FITNESS FOR ANY PARTICULAR APPLICATION.
THIRD PARTY LICENCES MAY BE REQUIRED TO IMPLEMENT THE SOLUTION/PRODUCT. CUSTOMERS SHALL BE SOLELY
RESPONSIBLE TO OBTAIN ALL APPROPRIATELY REQUIRED THIRD PARTY LICENCES. ALLWINNER SHALL NOT BE LIABLE FOR
ANY LICENCE FEE OR ROYALTY DUE IN RESPECT OF ANY REQUIRED THIRD PARTY LICENCE. ALLWINNER SHALL HAVE NO
WARRANTY, INDEMNITY OR OTHER OBLIGATIONS WITH RESPECT TO MATTERS COVERED UNDER ANY REQUIRED THIRD
PARTY LICENCE.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 2
Revision History
Revision History
Revision Date Description
1.0 May. 20,2016 Initial Release Version
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 3
Table of Contents
Table of Contents
Declaration ............................................................................................................................................................................ 2
Revision History..................................................................................................................................................................... 3
Table of Contents .................................................................................................................................................................. 4
Figures ................................................................................................................................................................................. 31
Tables .................................................................................................................................................................................. 34
Chapter 1 About This Documentation ............................................................................................................................. 36
1.1. Purpose ................................................................................................................................................................ 36
1.2. Acronyms and Abbreviations ............................................................................................................................... 36
Chapter 2 Overview ......................................................................................................................................................... 39
2.1. Processor Overview .............................................................................................................................................. 40
2.2. Processor Features ............................................................................................................................................... 41
2.2.1. CPU Architecture ....................................................................................................................................... 41
2.2.2. GPU Architecture....................................................................................................................................... 41
2.2.3. Memory Subsystem................................................................................................................................... 41
2.2.3.1. Boot ROM ....................................................................................................................................... 41
2.2.3.2. SDRAM ........................................................................................................................................... 42
2.2.3.3. NAND Flash..................................................................................................................................... 42
2.2.3.4. SMHC .............................................................................................................................................. 42
2.2.4. System Peripheral...................................................................................................................................... 42
2.2.4.1. Timer .............................................................................................................................................. 42
2.2.4.2. High Speed Timer ........................................................................................................................... 43
2.2.4.3. RTC ................................................................................................................................................. 43
2.2.4.4. GIC .................................................................................................................................................. 43
2.2.4.5. DMA ............................................................................................................................................... 43
2.2.4.6. CCU ................................................................................................................................................. 43
2.2.4.7. PWM............................................................................................................................................... 43
2.2.4.8. Thermal Sensor .............................................................................................................................. 44
2.2.4.9. KEYADC ........................................................................................................................................... 44
2.2.4.10. Message Box................................................................................................................................. 44
2.2.4.11. Spinlock ........................................................................................................................................ 44
2.2.4.12. Crypto Engine(CE) ........................................................................................................................ 44
2.2.4.13. Security ID(SID) ............................................................................................................................ 45
2.2.4.14. CPU Configuration ........................................................................................................................ 45
2.2.5. Display Subsystem ..................................................................................................................................... 45
2.2.5.1. DE2.0 .............................................................................................................................................. 45
2.2.5.2. Display Output................................................................................................................................ 45
2.2.6. Video Engine ............................................................................................................................................. 46
2.2.6.1. Video Decoder ............................................................................................................................... 46
2.2.6.2. Video Encoder ................................................................................................................................ 46
2.2.7. Image Subsystem....................................................................................................................................... 47
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 4
Table of Contents
2.2.7.1. CSI................................................................................................................................................... 47
2.2.8. Audio Subsystem ....................................................................................................................................... 47
2.2.8.1. Audio Codec ................................................................................................................................... 47
2.2.8.2. I2S/PCM.......................................................................................................................................... 47
2.2.8.3. One Wire Audio(OWA) ................................................................................................................... 48
2.2.9. External Peripherals .................................................................................................................................. 48
2.2.9.1. USB ................................................................................................................................................. 48
2.2.9.2. Ethernet ......................................................................................................................................... 48
2.2.9.3. CIR .................................................................................................................................................. 48
2.2.9.4. UART ............................................................................................................................................... 49
2.2.9.5. SPI................................................................................................................................................... 49
2.2.9.6. TWI ................................................................................................................................................. 49
2.2.9.7. TSC.................................................................................................................................................. 49
2.2.9.8. SCR ................................................................................................................................................. 50
2.2.10. Package ................................................................................................................................................... 50
2.3. System Block Diagram .......................................................................................................................................... 51
Chapter 3 Pin Description ................................................................................................................................................ 52
3.1. Pin Characteristics ................................................................................................................................................ 53
3.2. Signal Descriptions ............................................................................................................................................... 72
Chapter 4 System ............................................................................................................................................................. 79
4.1. Memory Mapping ................................................................................................................................................ 80
4.2. Boot System ......................................................................................................................................................... 82
4.2.1. Overview ................................................................................................................................................... 82
4.2.2. Boot Diagram ............................................................................................................................................ 82
4.2.2.1. Normal Mode ................................................................................................................................. 82
4.2.2.2. Security Mode ................................................................................................................................ 84
4.2.2.3. CPU-0+ Boot Process ...................................................................................................................... 84
4.2.2.4. CPU Hot Plug Process ..................................................................................................................... 85
4.2.2.5. Super Standby Wakeup Process ..................................................................................................... 86
4.2.2.6. Mandatory Upgrade Process .......................................................................................................... 87
4.2.2.7. Fast Boot Normal Process .............................................................................................................. 88
4.2.2.8. Fast Boot Security Process.............................................................................................................. 88
4.3. CCU....................................................................................................................................................................... 90
4.3.1. Overview ................................................................................................................................................... 90
4.3.2. Operations and Functional Descriptions ................................................................................................... 90
4.3.2.1. System Bus ..................................................................................................................................... 90
4.3.2.2. Bus Clock Tree ................................................................................................................................ 92
4.3.2.3. Typical Applications ........................................................................................................................ 92
4.3.2.4. PLL .................................................................................................................................................. 93
4.3.2.5. BUS ................................................................................................................................................. 93
4.3.2.6. Clock Switch ................................................................................................................................... 93
4.3.2.7. Gating and Reset ............................................................................................................................ 93
4.3.3. Register List ............................................................................................................................................... 93
4.3.4. Register Description .................................................................................................................................. 95
4.3.4.1. PLL_CPUX Control Register (Default Value: 0x0000_1000) ............................................................ 95
4.3.4.2. PLL_AUDIO Control Register (Default Value: 0x0003_5514) .......................................................... 97
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 5
Table of Contents
4.3.4.49. PLL Stable Time Register0 (Default Value: 0x0000_00FF) .......................................................... 133
4.3.4.50. PLL Stable Time Register1 (Default Value: 0x0000_00FF) .......................................................... 133
4.3.4.51. PLL_CPUX Bias Register (Default Value: 0x0810_0200) ............................................................. 133
4.3.4.52. PLL_AUDIO Bias Register (Default Value: 0x1010_0000) ........................................................... 134
4.3.4.53. PLL_VIDEO Bias Register (Default Value: 0x1010_0000) ............................................................ 134
4.3.4.54. PLL_VE Bias Register (Default Value: 0x1010_0000) .................................................................. 134
4.3.4.55. PLL_DDR Bias Register (Default Value: 0x8110_4000) ............................................................... 135
4.3.4.56. PLL_PERIPH0 Bias Register (Default Value: 0x1010_0010) ........................................................ 135
4.3.4.57. PLL_GPU Bias Register (Default Value: 0x1010_0000) ............................................................... 136
4.3.4.58. PLL_PERIPH1 Bias Register (Default Value: 0x1010_0010) ........................................................ 136
4.3.4.59. PLL_DE Bias Register (Default Value: 0x1010_0000) .................................................................. 136
4.3.4.60. PLL_CPUX Tuning Register (Default Value: 0x0A10_1000) ......................................................... 137
4.3.4.61. PLL_DDR Tuning Register (Default Value: 0x1488_0000) ........................................................... 137
4.3.4.62. PLL_CPUX Pattern Control Register (Default Value: 0x0000_0000) ........................................... 138
4.3.4.63. PLL_AUDIO Pattern Control Register (Default Value: 0x0000_0000) ......................................... 139
4.3.4.64. PLL_VIDEO Pattern Control Register (Default Value: 0x0000_0000) .......................................... 139
4.3.4.65. PLL_VE Pattern Control Register (Default Value: 0x0000_0000) ................................................ 140
4.3.4.66. PLL_DDR Pattern Control Register (Default Value: 0x0000_0000) ............................................. 140
4.3.4.67. PLL_GPU Pattern Control Register (Default Value: 0x0000_0000) ............................................. 141
4.3.4.68. PLL_PERIPH1 Pattern Control Register (Default Value: 0x0000_0000) ...................................... 141
4.3.4.69. PLL_DE Pattern Control Register (Default Value: 0x0000_0000)................................................ 142
4.3.4.70. Bus Software Reset Register 0 (Default Value: 0x0000_0000) ................................................... 143
4.3.4.71. Bus Software Reset Register 1 (Default Value: 0x0000_0000) ................................................... 145
4.3.4.72. Bus Software Reset Register 2 (Default Value: 0x0000_0000) ................................................... 147
4.3.4.73. Bus Software Reset Register 3 (Default Value: 0x0000_0000) ................................................... 147
4.3.4.74. Bus Software Reset Register 4 (Default Value: 0x0000_0000) ................................................... 148
4.3.4.75. CCU Security Switch Register (Default Value: 0x0000_0000) ..................................................... 149
4.3.4.76. PS Control Register (Default Value: 0x0000_0000) .................................................................... 150
4.3.4.77. PS Counter Register (Default Value: 0x0000_0000) ................................................................... 151
4.4. CPU Configuration .............................................................................................................................................. 152
4.4.1. Overview ................................................................................................................................................. 152
4.4.2. Block Diagram ......................................................................................................................................... 152
4.4.3. Operations and Functional Descriptions ................................................................................................. 153
4.4.3.1. Signal Description ......................................................................................................................... 153
4.4.3.2. L2 Idle Mode ................................................................................................................................ 153
4.4.3.3. CPU Reset System......................................................................................................................... 153
4.4.3.4. Operation Principle ...................................................................................................................... 153
4.4.4. Register List ............................................................................................................................................. 153
4.4.5. Register Description ................................................................................................................................ 154
4.4.5.1. Cluster Control Register0 (Default Value: 0x8000_0000) ............................................................. 154
4.4.5.2. Cluster Control Register1 (Default Value: 0x0000_0000) ............................................................. 155
4.4.5.3. Cache Parameter Control Register0 (Default Value: 0x2222_2222)............................................. 155
4.4.5.4. Cache Parameter Control Register1 (Default Value: 0x0202_2020) ............................................. 156
4.4.5.5. General Control Register0 (Default Value: 0x0000_0010) ........................................................... 156
4.4.5.6. Cluster CPU Status Register (Default Value: 0x000E_0000) ......................................................... 157
4.4.5.7. L2 Status Register (Default Value: 0x0000_0000) ........................................................................ 157
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 7
Table of Contents
4.20.6.3. KEYADC Interrupt Status Register (Default Value: 0x0000_0000) .............................................. 289
4.20.6.4. KEYADC Data Register (Default Value: 0x0000_0000) ................................................................ 290
4.21. Port Controller(CPUx-PORT) ............................................................................................................................. 291
4.21.1. Overview ............................................................................................................................................... 291
4.21.2. Register List ........................................................................................................................................... 291
4.21.3. Register Description .............................................................................................................................. 292
4.21.3.1. PA Configure Register 0 (Default Value: 0x7777_7777) ............................................................. 292
4.21.3.2. PA Configure Register 1 (Default Value: 0x7777_7777) ............................................................. 293
4.21.3.3. PA Configure Register 2 (Default Value: 0x0077_7777) ............................................................. 295
4.21.3.4. PA Configure Register 3 (Default Value: 0x0000_0000) ............................................................. 296
4.21.3.5. PA Data Register (Default Value: 0x0000_0000) ........................................................................ 296
4.21.3.6. PA Multi-Driving Register 0 (Default Value: 0x5555_5555) ........................................................ 296
4.21.3.7. PA Multi-Driving Register 1 (Default Value: 0x0000_0555) ........................................................ 296
4.21.3.8. PA PULL Register 0 (Default Value: 0x0000_0000) ..................................................................... 297
4.21.3.9. PA PULL Register 1 (Default Value: 0x0000_0000) ..................................................................... 297
4.21.3.10. PC Configure Register 0 (Default Value: 0x7777_7777) ........................................................... 297
4.21.3.11. PC Configure Register 1 (Default Value: 0x7777_7777) ........................................................... 299
4.21.3.12. PC Configure Register 2 (Default Value: 0x0000_0777) ........................................................... 300
4.21.3.13. PC Configure Register 3 (Default Value: 0x0000_0000) ........................................................... 300
4.21.3.14. PC Data Register (Default Value: 0x0000_0000) ...................................................................... 301
4.21.3.15. PC Multi-Driving Register 0 (Default Value: 0x5555_5555) ...................................................... 301
4.21.3.16. PC Multi-Driving Register 1 (Default Value: 0x0000_0015)...................................................... 301
4.21.3.17. PC PULL Register 0 (Default Value: 0x0000_5140) ................................................................... 301
4.21.3.18. PC PULL Register 1 (Default Value: 0x0000_0014) ................................................................... 302
4.21.3.19. PD Configure Register 0 (Default Value: 0x7777_7777)........................................................... 302
4.21.3.20. PD Configure Register 1 (Default Value: 0x7777_7777) ........................................................... 303
4.21.3.21. PD Configure Register 2 (Default Value: 0x0000_0077) ........................................................... 305
4.21.3.22. PD Configure Register 3 (Default Value: 0x0000_0000) ........................................................... 305
4.21.3.23. PD Data Register (Default Value: 0x0000_0000) ...................................................................... 305
4.21.3.24. PD Multi-Driving Register 0 (Default Value: 0x5555_5555) ..................................................... 306
4.21.3.25. PD Multi-Driving Register 1 (Default Value: 0x0000_0005) ..................................................... 306
4.21.3.26. PD PULL Register 0 (Default Value: 0x0000_0000)................................................................... 306
4.21.3.27. PD PULL Register 1 (Default Value: 0x0000_0000) ................................................................... 306
4.21.3.28. PE Configure Register 0 (Default Value: 0x7777_7777) ........................................................... 307
4.21.3.29. PE Configure Register 1 (Default Value: 0x7777_7777) ........................................................... 308
4.21.3.30. PE Configure Register 2 (Default Value: 0x0000_0000) ........................................................... 309
4.21.3.31. PE Configure Register 3 (Default Value: 0x0000_0000) ........................................................... 309
4.21.3.32. PE Data Register (Default Value: 0x0000_0000) ...................................................................... 310
4.21.3.33. PE Multi-Driving Register 0 (Default Value: 0x5555_5555) ...................................................... 310
4.21.3.34. PE Multi-Driving Register 1 (Default Value: 0x0000_0000) ...................................................... 310
4.21.3.35. PE PULL Register 0 (Default Value: 0x0000_0000) ................................................................... 310
4.21.3.36. PE PULL Register 1 (Default Value: 0x0000_0000) ................................................................... 310
4.21.3.37. PF Configure Register 0 (Default Value: 0x0777_7777) ........................................................... 311
4.21.3.38. PF Configure Register 1 (Default Value: 0x0000_0000) ........................................................... 312
4.21.3.39. PF Configure Register 2 (Default Value: 0x0000_0000) ........................................................... 312
4.21.3.40. PF Configure Register 3 (Default Value: 0x0000_0000) ........................................................... 312
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 14
Table of Contents
5.2.5.25. NDFC Read Data Status Register 0 (Default Value: 0x0000_0000) ............................................. 364
5.2.5.26. NDFC Read Data Status Register 1 (Default Value: 0x0000_0000) ............................................. 364
5.2.5.27. NDFC MBUS DMA Address Register (Default Value: 0x0000_0000) .......................................... 365
5.2.5.28. NDFC MBUS DMA Byte Counter Register (Default Value: 0x0000_0000) .................................. 365
5.2.5.29. NDFC Normal DMA Mode Control Register (Default Value: 0x0000_00A5) .............................. 365
5.2.5.30. NDFC IO Data Register (Default Value: 0x0000_0000) ............................................................... 365
5.3. SD/MMC Host Controller(SMHC) ....................................................................................................................... 366
5.3.1. Overview ................................................................................................................................................. 366
5.3.2. Block Diagram ......................................................................................................................................... 366
5.3.3. Operations and Functional Descriptions ................................................................................................. 367
5.3.3.1. External Signals ............................................................................................................................ 367
5.3.3.2. Clock Sources................................................................................................................................ 367
5.3.3.3. SMHC Timing Diagram ................................................................................................................. 367
5.3.3.4. Internal DMA Controller Description ........................................................................................... 368
5.3.3.5. Calibrate Delay Chain ................................................................................................................... 370
5.3.4. Register List ............................................................................................................................................. 370
5.3.5. Register Description ................................................................................................................................ 372
5.3.5.1. SMHC Global Control Register (Default Value: 0x0000_0100) ..................................................... 372
5.3.5.2. SMHC Clock Control Register (Default Value: 0x0000_0000) ....................................................... 373
5.3.5.3. SMHC Timeout Register (Default Value: 0xFFFF_FF40)................................................................ 374
5.3.5.4. SMHC Bus Width Register (Default Value: 0x0000_0000) ........................................................... 374
5.3.5.5. SMHC Block Size Register (Default Value: 0x0000_0200) ............................................................ 374
5.3.5.6. SMHC Block Count Register (Default Value: 0x0000_0200) ......................................................... 374
5.3.5.7. SMHC Command Register (Default Value: 0x0000_0000)............................................................ 375
5.3.5.8. SMHC Command Argument Register (Default Value: 0x0000_0000) .......................................... 377
5.3.5.9. SMHC Response 0 Register (Default Value: 0x0000_0000) .......................................................... 377
5.3.5.10. SMHC Response 1 Register (Default Value: 0x0000_0000) ........................................................ 377
5.3.5.11. SMHC Response 2 Register (Default Value: 0x0000_0000) ........................................................ 377
5.3.5.12. SMHC Response 3 Register (Default Value: 0x0000_0000) ........................................................ 378
5.3.5.13. SMHC Interrupt Mask Register (Default Value: 0x0000_0000) .................................................. 378
5.3.5.14. SMHC Masked Interrupt Status Register (Default Value: 0x0000_0000) ................................... 379
5.3.5.15. SMHC Raw Interrupt Status Register (Default Value: 0x0000_0000) ......................................... 380
5.3.5.16. SMHC Status Register (Default Value: 0x0000_0006) ................................................................ 382
5.3.5.17. SMHC FIFO Water Level Register (Default Value: 0x000F_0000) ............................................... 383
5.3.5.18. SMHC Function Select Register (Default Value: 0x0000_0000) ................................................. 384
5.3.5.19. SMHC Transferred Byte Count Register0 (Default Value: 0x0000_0000) ................................... 385
5.3.5.20. SMHC Transferred Byte Count Register1 (Default Value: 0x0000_0000) ................................... 385
5.3.5.21. SMHC Auto Command 12 Argument Register (Default Value: 0x0000_FFFF)............................ 386
5.3.5.22. SMHC New Timing Set Register (Default Value: 0x8171_0000) ................................................. 386
5.3.5.23. SMHC Hardware Reset Register (Default Value: 0x0000_0001)................................................. 387
5.3.5.24. SMHC DMAC Control Register (Default Value: 0x0000_0000) ................................................... 387
5.3.5.25. SMHC Descriptor List Base Address Register (Default Value: 0x0000_0000) ............................. 388
5.3.5.26. SMHC DMAC Status Register (Default Value: 0x0000_0000) ..................................................... 389
5.3.5.27. SMHC DMAC Interrupt Enable Register (Default Value: 0x0000_0000) ..................................... 390
5.3.5.28. SMHC Current Host Descriptor Address Register (Default Value: 0x0000_0000) ...................... 391
5.3.5.29. SMHC Current Buffer Descriptor Address Register (Default Value: 0x0000_0000) .................... 391
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 17
Table of Contents
5.3.5.30. SMHC Card Threshold Control Register (Default Value: 0x0000_0000) ..................................... 392
5.3.5.31. SMHC eMMC4.5 DDR Start Bit Detection Control Register (Default Value: 0x0000_0000) ....... 392
5.3.5.32. SMHC Response CRC Register (Default Value: 0x0000_0000) ................................................... 393
5.3.5.33. SMHC Data7 CRC Register (Default Value: 0x0000_0000) ......................................................... 393
5.3.5.34. SMHC Data6 CRC Register (Default Value: 0x0000_0000) ......................................................... 394
5.3.5.35. SMHC Data5 CRC Register (Default Value: 0x0000_0000) ......................................................... 394
5.3.5.36. SMHC Data4 CRC Register (Default Value: 0x0000_0000) ......................................................... 394
5.3.5.37. SMHC Data3 CRC Register (Default Value: 0x0000_0000) ......................................................... 395
5.3.5.38. SMHC Data2 CRC Register (Default Value: 0x0000_0000) ......................................................... 395
5.3.5.39. SMHC Data1 CRC Register (Default Value: 0x0000_0000) ......................................................... 395
5.3.5.40. SMHC Data0 CRC Register (Default Value: 0x0000_0000) ......................................................... 396
5.3.5.41. SMHC CRC Status Register (Default Value: 0x0000_0000) ......................................................... 396
5.3.5.42. SMHC Drive Delay Control Register (Default Value: 0x0001_0000) ........................................... 396
5.3.5.43. SMHC Sample Delay Control Register (Default Value: 0x0000_2000)........................................ 397
5.3.5.44. SMHC Data Strobe Delay Control Register (Default Value: 0x0000_2000) ................................ 397
5.3.5.45. SMHC FIFO Register (Default Value: 0x0000_0000) ................................................................... 398
Chapter 6 Image............................................................................................................................................................. 399
6.1. CSI....................................................................................................................................................................... 400
6.1.1. Overview ................................................................................................................................................. 400
6.1.2. Block Diagram ......................................................................................................................................... 401
6.1.3. Operations and Functional Descriptions ................................................................................................. 402
6.1.3.1. CSI FIFO Distribution .................................................................................................................... 402
6.1.3.2. CSI Timing..................................................................................................................................... 402
6.1.3.3. Bit Definition ................................................................................................................................ 403
6.1.4. Register list .............................................................................................................................................. 403
6.1.5. Register Description ................................................................................................................................ 404
6.1.5.1. CSI Enable Register (Default Value: 0x0000_0000) ...................................................................... 404
6.1.5.2. CSI Interface Configuration Register (Default Value: 0x0005_0000) ............................................ 405
6.1.5.3. CSI Capture Register (Default Value: 0x0000_0000) .................................................................... 407
6.1.5.4. CSI Synchronization Counter Register (Default Value: 0x0000_0000) ......................................... 407
6.1.5.5. CSI FIFO Threshold Register (Default Value: 0x040F_0400) ......................................................... 408
6.1.5.6. CSI Pattern Generation Length Register (Default Value: 0x0000_0000) ...................................... 408
6.1.5.7. CSI Pattern Generation Address Register (Default Value: 0x0000_0000) .................................... 408
6.1.5.8. CSI Version Register (Default Value: 0x0000_0000) ..................................................................... 408
6.1.5.9. CSI Channel_0 Configuration Register (Default Value: 0x0030_0200) ......................................... 409
6.1.5.10. CSI Channel_0 Scale Register (Default Value: 0x0000_0000) ..................................................... 411
6.1.5.11. CSI Channel_0 FIFO 0 Output Buffer-A Address Register (Default Value: 0x0000_0000) .......... 411
6.1.5.12. CSI Channel_0 FIFO 1 Output Buffer-A Address Register (Default Value: 0x0000_0000) .......... 411
6.1.5.13. CSI Channel_0 FIFO 2 Output Buffer-A Address Register (Default Value: 0x0000_0000) .......... 412
6.1.5.14. CSI Channel_0 Status Register (Default Value: 0x0000_0000) ................................................... 412
6.1.5.15. CSI Channel_0 Interrupt Enable Register (Default Value: 0x0000_0000)................................... 412
6.1.5.16. CSI Channel_0 Interrupt Status Register (Default Value: 0x0000_0000) ................................... 413
6.1.5.17. CSI Channel_0 Horizontal Size Register (Default Value: 0x0500_0000) ..................................... 414
6.1.5.18. CSI Channel_0 Vertical Size Register (Default Value: 0x01E0_0000) .......................................... 414
6.1.5.19. CSI Channel_0 Buffer Length Register (Default Value: 0x0140_0280) ....................................... 414
6.1.5.20. CSI Channel_0 Flip Size Register (Default Value: 0x01E0_0280) ................................................ 415
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 18
Table of Contents
6.1.5.21. CSI Channel_0 Frame Clock Counter Register (Default Value: 0x0000_0000) ........................... 415
6.1.5.22. CSI Channel_0 accumulated and internal clock counter Register (Default Value: 0x0000_0000)
................................................................................................................................................................... 415
6.1.5.23. CSI Channel_0 FIFO Statistic Register (Default Value: 0x0000_0000) ........................................ 415
6.1.5.24. CSI Channel_0 PCLK Statistic Register (Default Value: 0x0000_7FFF) ........................................ 416
6.1.5.25. CCI Control Register (Default Value: 0x0000_0000) ................................................................... 416
6.1.5.26. CCI Transmission Configuration Register (Default Value: 0x1000_0000) ................................... 418
6.1.5.27. CCI Packet Format Register (Default Value: 0x0011_0001) ........................................................ 418
6.1.5.28. CCI Bus Control Register (Default Value: 0x0000_2500) ............................................................ 419
6.1.5.29. CCI Interrupt Control Register (Default Value: 0x0000_0000) ................................................... 420
6.1.5.30. CCI Line Counter Trigger Control Register (Default Value: 0x0000_0000) ................................. 420
6.1.5.31. CCI FIFO Access Register (Default Value: 0x0000_0000) ............................................................ 420
Chapter 7 Display ........................................................................................................................................................... 421
7.1. DE2.0 .................................................................................................................................................................. 422
7.1.1. Overview ................................................................................................................................................. 422
7.2. TCON .................................................................................................................................................................. 423
7.2.1. Overview ................................................................................................................................................. 423
7.2.2. Block Diagram ......................................................................................................................................... 423
7.2.3. Operations and Functional Descriptions ................................................................................................. 423
7.2.3.1. RGB Gamma Correction ............................................................................................................... 423
7.2.3.2. CEU Module ................................................................................................................................. 424
7.2.4. TCON0 Module Register List ................................................................................................................... 424
7.2.5. TCON0 Module Register Description ...................................................................................................... 425
7.2.5.1. TCON Global Control Register (Default Value: 0x0000_0000)...................................................... 425
7.2.5.2. TCON Global Interrupt Register0 (Default Value: 0x0000_0000) ................................................. 425
7.2.5.3. TCON Global Interrupt Register1 (Default Value: 0x0000_0000) ................................................. 426
7.2.5.4. TCON1 Control Register (Default Value: 0x0000_0000) ............................................................... 426
7.2.5.5. TCON1 Basic Timing Register0 (Default Value: 0x0000_0000)..................................................... 426
7.2.5.6. TCON1 Basic Timing Register1 (Default Value: 0x0000_0000)..................................................... 427
7.2.5.7. TCON1 Basic Timing Register2 (Default Value: 0x0000_0000)..................................................... 427
7.2.5.8. TCON1 Basic Timing Register3 (Default Value: 0x0000_0000)..................................................... 427
7.2.5.9. TCON1 Basic Timing Register4 (Default Value: 0x0000_0000)..................................................... 428
7.2.5.10. TCON1 Basic Timing Register5 (Default Value: 0x0000_0000)................................................... 428
7.2.5.11. TCON1 SYNC Register (Default Value: 0x0000_0000) ................................................................ 428
7.2.5.12. TCON1 IO Polarity Register (Default Value: 0x0000_0000) ........................................................ 428
7.2.5.13. TCON1 IO Trigger Register (Default Value: 0x0FFF_FFFF)........................................................... 429
7.2.5.14. TCON ECC FIFO Register (Default Value: UDF)............................................................................ 430
7.2.5.15. TCON CEU Control Register (Default Value: 0x0000_0000) ....................................................... 430
7.2.5.16. TCON CEU Coefficient MUL Register (Default Value: 0x0000_0000) ......................................... 430
7.2.5.17. TCON CEU Coefficient Add Register (Default Value: 0x0000_0000)........................................... 431
7.2.5.18. TCON CEU Coefficient Range Register (Default Value: 0x0000_0000) ....................................... 431
7.2.5.19. TCON Safe Period Register (Default Value: 0x0000_0000) ......................................................... 431
7.2.5.20. TCON1 Fill Control Register (Default Value: 0x0000_0000) ....................................................... 432
7.2.5.21. TCON1 Fill Begin Register (Default Value: 0x0000_0000) .......................................................... 432
7.2.5.22. TCON1 Fill End Register (Default Value: 0x0000_0000) ............................................................. 432
7.2.5.23. TCON1 Fill Data Register (Default Value: 0x0000_0000) ............................................................ 432
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 19
Table of Contents
8.1.5.11. 0x4C ADC Debug Register (Default Value: 0x0000_0000) .......................................................... 458
8.1.5.12. 0x60 DAC DAP Control Register (Default Value: 0x0000_0000) ................................................. 459
8.1.5.13. 0x70 ADC DAP Control Register (Default Value: 0x0000_0000) ................................................. 459
8.1.5.14. 0x74 ADC DAP Left Control Register (Default Value: 0x001F_7000) .......................................... 461
8.1.5.15. 0x78 ADC DAP Right Control Register (Default Value: 0x001F_7000) ........................................ 462
8.1.5.16. 0x7C ADC DAP Parameter Register (Default Value: 0x2C2C_2828) ............................................ 463
8.1.5.17. 0x80 ADC DAP Left Average Coef Register (Default Value: 0x0005_1EB8) ................................ 464
8.1.5.18. 0x84 ADC DAP Left Decay & Attack Time Register (Default Value: 0x0000_001F) .................... 464
8.1.5.19. 0x88 ADC DAP Right Average Coef Register (Default Value: 0x0005_1EB8) .............................. 465
8.1.5.20. 0x8C ADC DAP Right Decay & Attack Time Register (Default Value: 0x0000_001F) .................. 465
8.1.5.21. 0x90 ADC DAP HPF Coef Register (Default Value: 0x00FF_FAC1)............................................... 466
8.1.5.22. 0x94 ADC DAP Left Input Signal Low Average Coef Register (Default Value: 0x0005_1EB8) ..... 466
8.1.5.23. 0x98 ADC DAP Right Input Signal Low Average Coef Register (Default Value: 0x0005_1EB8) ... 466
8.1.5.24. 0x9C ADC DAP Optimum Register (Default Value: 0x0000_0000) ............................................. 466
8.1.5.25. 0x100 DAC DRC High HPF Coef Register (Default Value: 0x0000_00FF) .................................... 467
8.1.5.26. 0x104 DAC DRC Low HPF Coef Register(Default Value: 0x0000_FAC1) ...................................... 467
8.1.5.27. 0x108 DAC DRC Control Register(Default Value: 0x0000_0080) ................................................ 468
8.1.5.28. 0x10C DAC DRC Left Peak Filter High Attack Time Coef Register (Default Value: 0x0000_000B)
................................................................................................................................................................... 469
8.1.5.29. 0x110 DAC DRC Left Peak Filter Low Attack Time Coef Register (Default Value: 0x0000_77BF)
................................................................................................................................................................... 469
8.1.5.30. 0x114 DAC DRC Right Peak Filter High Attack Time Coef Register (Default Value: 0x0000_000B)
................................................................................................................................................................... 470
8.1.5.31. 0x118 DAC DRC Peak Filter Low Attack Time Coef Register (Default Value: 0x0000_77BF) ...... 470
8.1.5.32. 0x11C DAC DRC Left Peak Filter High Release Time Coef Register (Default Value: 0x0000_00FF)
................................................................................................................................................................... 470
8.1.5.33. 0x120 DAC DRC Left Peak Filter Low Release Time Coef Register (Default Value: 0x0000_E1F8)
................................................................................................................................................................... 470
8.1.5.34. 0x124 DAC DRC Right Peak filter High Release Time Coef Register (Default Value: 0x0000_00FF)
................................................................................................................................................................... 470
8.1.5.35. 0x128 DAC DRC Right Peak filter Low Release Time Coef Register (Default Value: 0x0000_E1F8)
................................................................................................................................................................... 471
8.1.5.36. 0x12C DAC DRC Left RMS Filter High Coef Register (Default Value: 0x0000_0001) .................. 471
8.1.5.37. 0x130 DAC DRC Left RMS Filter Low Coef Register (Default Value: 0x0000_2BAF) ................... 471
8.1.5.38. 0x134 DAC DRC Right RMS Filter High Coef Register (Default Value: 0x0000_0001) ................ 471
8.1.5.39. 0x138 DAC DRC Right RMS Filter Low Coef Register (Default Value: 0x0000_2BAF) ................. 471
8.1.5.40. 0x13C DAC DRC Compressor Threshold High Setting Register (Default Value: 0x0000_06A4) .. 472
8.1.5.41. 0x140 DAC DRC Compressor Threshold Low Setting Register (Default Value: 0x0000_D3C0) .. 472
8.1.5.42. 0x144 DAC DRC Compressor Slope High Setting Register (Default Value: 0x0000_0080) ......... 472
8.1.5.43. 0x148 DAC DRC Compressor Slope Low Setting Register (Default Value: 0x0000_0000) .......... 472
8.1.5.44. 0x14C DAC DRC Compressor High Output at Compressor Threshold Register (Default Value:
0x0000_F95B)............................................................................................................................................ 473
8.1.5.45. 0x150 DAC DRC Compressor Low Output at Compressor Threshold Register (Default Value:
0x0000_2C3F)............................................................................................................................................ 473
8.1.5.46. 0x154 DAC DRC Limiter Theshold High Setting Register (Default Value: 0x0000_01A9) ........... 473
8.1.5.47. 0x158 DAC DRC Limiter Theshold Low Setting Register (Default Value: 0x0000_34F0)............. 473
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 21
Table of Contents
8.1.5.48. 0x15C DAC DRC Limiter Slope High Setting Register (Default Value: 0x0000_0005) ................. 473
8.1.5.49. 0x160 DAC DRC Limiter Slope Low Setting Register (Default Value: 0x0000_1EB8) .................. 474
8.1.5.50. 0x164 DAC DRC Limiter High Output at Limiter Threshold (Default Value: 0x0000_FBD8) ....... 474
8.1.5.51. 0x168 DAC DRC Limiter Low Output at Limiter Threshold (Default Value: 0x0000_FBA7) ........ 474
8.1.5.52. 0x16C DAC DRC Expander Theshold High Setting Register (Default Value: 0x0000_0BA0) ....... 474
8.1.5.53. 0x170 DAC DRC Expander Theshold Low Setting Register (Default Value: 0x0000_7291) ......... 474
8.1.5.54. 0x174 DAC DRC Expander Slope High Setting Register (Default Value: 0x0000_0500) .............. 475
8.1.5.55. 0x178 DAC DRC Expander Slope Low Setting Register (Default Value: 0x0000_0000) .............. 475
8.1.5.56. 0x17C DAC DRC Expander High Output at Expander Threshold (Default Value: 0x0000_F45F) 475
8.1.5.57. 0x180 DAC DRC Expander Low Output at Expander Threshold (Default Value: 0x0000_8D6E) 475
8.1.5.58. 0x184 DAC DRC Linear Slope High Setting Register (Default Value: 0x0000_0100) ................... 475
8.1.5.59. 0x188 DAC DRC Linear Slope Low Setting Register (Default Value: 0x0000_0000).................... 476
8.1.5.60. 0x18C DAC DRC Smooth Filter Gain High Attack Time Coef Register (Default Value:
0x0000_0002)............................................................................................................................................ 476
8.1.5.61. 0x190 DAC DRC Smooth Filter Gain Low Attack Time Coef Register (Default Value: 0x0000_5600)
................................................................................................................................................................... 476
8.1.5.62. 0x194 DAC DRC Smooth filter Gain High Release Time Coef Register (Default Value:
0x0000_0000) ........................................................................................................................................... 476
8.1.5.63. 0x198 DAC DRC Smooth filter Gain Low Release Time Coef Register (Default Value:
0x0000_0F04)............................................................................................................................................ 476
8.1.5.64. 0x19C DAC DRC MAX Gain High Setting Register (Default Value: 0x0000_FE56)....................... 477
8.1.5.65. 0x1A0 DAC DRC MAX Gain Low Setting Register (Default Value: 0x0000_CB0F) ....................... 477
8.1.5.66. 0x1A4 DAC DRC MIN Gain High Setting Register (Default Value: 0x0000_F95B) ....................... 477
8.1.5.67. 0x1A8 DAC DRC MIN Gain Low Setting Register (Default Value: 0x0000_2C3F) ........................ 477
8.1.5.68. 0x1AC DAC DRC Expander Smooth Time High Coef Register (Default Value: 0x0000_0000) .... 477
8.1.5.69. 0x1B0 DAC DRC Expander Smooth Time Low Coef Register(Default Value: 0x0000_640C) ...... 478
8.1.5.70. 0x1B8 DAC DRC HPF Gain High Coef Register(Default Value: 0x0000_0100) ............................ 478
8.1.5.71. 0x1BC DAC DRC HPF Gain Low Coef Register(Default Value: 0x0000_0000) ............................. 478
8.1.5.72. 0x200 ADC DRC High HPF Coef Register (Default Value: 0x0000_00FF) .................................... 478
8.1.5.73. 0x204 ADC DRC Low HPF Coef Register (Default Value: 0x0000_FAC1) ..................................... 479
8.1.5.74. 0x208 ADC DRC Control Register (Default Value: 0x0000_0080) ............................................... 479
8.1.5.75. 0x20C ADC DRC Left Peak Filter High Attack Time Coef Register (Default Value: 0x0000_000B)
................................................................................................................................................................... 480
8.1.5.76. 0x210 ADC DRC Left Peak Filter Low Attack Time Coef Register (Default Value: 0x0000_77BF)
................................................................................................................................................................... 481
8.1.5.77. 0x214 ADC DRC Right Peak Filter High Attack Time Coef Register (Default Value: 0x0000_000B)
................................................................................................................................................................... 481
8.1.5.78. 0x218 ADC DRC Peak Filter Low Attack Time Coef Register (Default Value: 0x0000_77BF) ...... 481
8.1.5.79. 0x21C ADC DRC Left Peak Filter High Release Time Coef Register (Default Value: 0x0000_00FF)
................................................................................................................................................................... 481
8.1.5.80. 0x220 ADC DRC Left Peak Filter Low Release Time Coef Register (Default Value: 0x0000_E1F8)
................................................................................................................................................................... 481
8.1.5.81. 0x224 ADC DRC Right Peak filter High Release Time Coef Register (Default Value: 0x0000_00FF)
................................................................................................................................................................... 482
8.1.5.82. 0x228 ADC DRC Right Peak filter Low Release Time Coef Register (Default Value: 0x0000_E1F8)
................................................................................................................................................................... 482
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 22
Table of Contents
8.1.5.83. 0x22C ADC DRC Left RMS Filter High Coef Register (Default Value: 0x0000_0001) .................. 482
8.1.5.84. 0x230 ADC DRC Left RMS Filter Low Coef Register (Default Value: 0x0000_2BAF) ................... 482
8.1.5.85. 0x234 ADC DRC Right RMS Filter High Coef Register (Default Value: 0x0000_0001) ................ 482
8.1.5.86. 0x238 ADC DRC Right RMS Filter Low Coef Register (Default Value: 0x0000_2BAF) ................. 483
8.1.5.87. 0x23C ADC DRC Compressor Theshold High Setting Register (Default Value: 0x0000_06A4) ... 483
8.1.5.88. 0x240 ADC DRC Compressor Theshold Low Setting Register (Default Value: 0x0000_D3C0) .... 483
8.1.5.89. 0x244 ADC DRC Compressor Slope High Setting Register (Default Value: 0x0000_0080) ......... 483
8.1.5.90. 0x248 ADC DRC Compressor Slope Low Setting Register (Default Value: 0x0000_0000) .......... 483
8.1.5.91. 0x24C ADC DRC Compressor High Output at Compressor Threshold Register (Default Value:
0x0000_F95B)............................................................................................................................................ 484
8.1.5.92. 0x250 ADC DRC Compressor Low Output at Compressor Threshold Register (Default Value:
0x0000_2C3F)............................................................................................................................................ 484
8.1.5.93. 0x254 ADC DRC Limiter Theshold High Setting Register (Default Value: 0x0000_01A9) ........... 484
8.1.5.94. 0x258 ADC DRC Limiter Theshold Low Setting Register (Default Value: 0x0000_34F0) ............ 484
8.1.5.95. 0x25C ADC DRC Limiter Slope High Setting Register (Default Value: 0x0000_0005) ................. 484
8.1.5.96. 0x260 ADC DRC Limiter Slope Low Setting Register (Default Value: 0x0000_1EB8) .................. 485
8.1.5.97. 0x264 ADC DRC Limiter High Output at Limiter Threshold Register (Default Value: 0x0000_FBD8)
................................................................................................................................................................... 485
8.1.5.98. 0x268 ADC DRC Limiter Low Output at Limiter Threshold Register (Default Value: 0x0000_FBA7)
................................................................................................................................................................... 485
8.1.5.99. 0x26C ADC DRC Expander Theshold High Setting Register (Default Value: 0x0000_0BA0) ....... 485
8.1.5.100. 0x270 ADC DRC Expander Theshold Low Setting Register (Default Value: 0x0000_7291) ....... 486
8.1.5.101. 0x274 ADC DRC Expander Slope High Setting Register (Default Value: 0x0000_0500)............ 486
8.1.5.102. 0x278 ADC DRC Expander Slope Low Setting Register (Default Value: 0x0000_0000) ............ 486
8.1.5.103. 0x27C ADC DRC Expander High Output at Expander Threshold (Default Value: 0x0000_F45F)
................................................................................................................................................................... 486
8.1.5.104. 0x280 ADC DRC Expander Low Output at Expander Threshold (Default Value: 0x0000_8D6E)
................................................................................................................................................................... 486
8.1.5.105. 0x284 ADC DRC Linear Slope High Setting Register (Default Value: 0x0000_0100) ................. 487
8.1.5.106. 0x288 ADC DRC Linear Slope Low Setting Register (Default Value: 0x0000_0000) ................. 487
8.1.5.107. 0x28C ADC DRC Smooth Filter Gain High Attack Time Coef Register (Default Value:
0x0000_0002)............................................................................................................................................ 487
8.1.5.108. 0x290 ADC DRC Smooth Filter Gain Low Attack Time Coef Register (Default Value:
0x0000_5600) ........................................................................................................................................... 487
8.1.5.109. 0x294 ADC DRC Smooth filter Gain High Release Time Coef Register (Default Value:
0x0000_0000) ........................................................................................................................................... 487
8.1.5.110. 0x298 ADC DRC Smooth filter Gain Low Release Time Coef Register (Default Value:
0x0000_0F04)............................................................................................................................................ 488
8.1.5.111. 0x29C ADC DRC MAX Gain High Setting Register (Default Value: 0x0000_FE56) .................... 488
8.1.5.112. 0x2A0 ADC DRC MAX Gain Low Setting Register (Default Value: 0x0000_CB0F) ..................... 488
8.1.5.113. 0x2A4 ADC DRC MIN Gain High Setting Register (Default Value: 0x0000_F95B) ..................... 488
8.1.5.114. 0x2A8 ADC DRC MIN Gain Low Setting Register (Default Value: 0x0000_2C3F)...................... 488
8.1.5.115. 0x2AC ADC DRC Expander Smooth Time High Coef Register (Default Value: 0x0000_0000) .. 489
8.1.5.116. 0x2B0 ADC DRC Expander Smooth Time Low Coef Register (Default Value: 0x0000_640C) ... 489
8.1.5.117. 0x2B8 ADC DRC HPF Gain High Coef Register (Default Value: 0x0000_0100) ......................... 489
8.1.5.118. 0x2BC ADC DRC HPF Gain Low Coef Register (Default Value: 0x0000_0000) .......................... 489
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 23
Table of Contents
9.6.5.8. Smart Card Reader Line Time Register(Default Value: 0x0000_0000) ......................................... 636
9.6.5.9. Smart Card Reader Character Time Register(Default Value: 0x0000_0000) ................................ 637
9.6.5.10. Smart Card Reader Line Control Register(Default Value: 0x0000_0000) ................................... 637
9.6.5.11. Smart Card Reader FIFO Data Register(Default Value: 0x0000_0000) ....................................... 638
9.7. EMAC .................................................................................................................................................................. 639
9.7.1. Overview ................................................................................................................................................. 639
9.7.2. Block Diagram ......................................................................................................................................... 639
9.7.3. Operations and Functional Descriptions ................................................................................................. 640
9.7.3.1. External Signals ............................................................................................................................ 640
9.7.3.2. EMAC RX/TX Descriptor ............................................................................................................... 641
9.7.3.3. Transmit Descriptor ...................................................................................................................... 641
9.7.3.4. Receive Descriptor........................................................................................................................ 643
9.7.4. Register List ............................................................................................................................................. 644
9.7.5. Register Description ................................................................................................................................ 645
9.7.5.1. Basic Control 0 Register(Default Value: 0x0000_0000) ................................................................ 645
9.7.5.2. Basic Control 1 Register(Default Value: 0x0800_0000) ................................................................ 646
9.7.5.3. Interrupt Status Register(Default Value: 0x0000_0000) .............................................................. 646
9.7.5.4. Interrupt Enable Register(Default Value: 0x0000_0000) ............................................................. 647
9.7.5.5. Transmit Control 0 Register(Default Value: 0x0000_0000) .......................................................... 648
9.7.5.6. Transmit Control 1 Register(Default Value: 0x0000_0000) .......................................................... 649
9.7.5.7. Transmit Flow Control Register(Default Value: 0x0000_0000) .................................................... 650
9.7.5.8. Transmit DMA Descriptor List Address Register(Default Value: 0x0000_0000) ........................... 650
9.7.5.9. Receive Control 0 Register(Default Value: 0x0000_0000)............................................................ 650
9.7.5.10. Receive Control 1 Register(Default Value: 0x0000_0000).......................................................... 651
9.7.5.11. Receive DMA Descriptor List Address Register(Default Value: 0x0000_0000)........................... 653
9.7.5.12. Receive Frame Filter Register(Default Value: 0x0000_0000) ..................................................... 653
9.7.5.13. Receive Hash Table 0 Register(Default Value: 0x0000_0000) .................................................... 654
9.7.5.14. Receive Hash Table 1 Register(Default Value: 0x0000_0000) .................................................... 654
9.7.5.15. MII Command Register(Default Value: 0x0000_0000) ............................................................... 655
9.7.5.16. MII Data Register(Default Value: 0x0000_0000) ........................................................................ 655
9.7.5.17. MAC Address 0 High Register(Default Value: 0x0000_FFFF) ...................................................... 656
9.7.5.18. MAC Address 0 Low Register(Default Value: 0xFFFF_FFFF) ....................................................... 656
9.7.5.19. MAC Address N High Register(Default Value: 0x0000FFFF) ....................................................... 656
9.7.5.20. MAC Address N Low Register(Default Value: 0xFFFF_FFFF) ....................................................... 656
9.7.5.21. Transmit DMA Status Register(Default Value: 0x0000_0000) .................................................... 657
9.7.5.22. Transmit DMA Current Descriptor Register(Default Value: 0x0000_0000) ................................ 657
9.7.5.23. Transmit DMA Current Buffer Address Register(Default Value: 0x0000_0000) ......................... 657
9.7.5.24. Receive DMA Status Register(Default Value: 0x0000_0000) ..................................................... 657
9.7.5.25. Receive DMA Current Descriptor Register(Default Value: 0x0000_0000).................................. 658
9.7.5.26. Receive DMA Current Buffer Address Register(Default Value: 0x0000_0000)........................... 658
9.7.5.27. RGMII Status Register(Default Value: 0x0000_0000) ................................................................. 658
9.8. TSC...................................................................................................................................................................... 659
9.8.1. Overview ................................................................................................................................................. 659
9.8.2. Block Diagram ......................................................................................................................................... 659
9.8.3. Operations and Functional Descriptions ................................................................................................. 660
9.8.3.1. External Signals ............................................................................................................................ 660
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 28
Table of Contents
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 30
Figures
Figures
Figure 2-1. H5 Block Diagram .............................................................................................................................................. 51
Figure 4-1. Normal Mode Boot Process .............................................................................................................................. 83
Figure 4-2. Security Mode Boot Process ............................................................................................................................. 84
Figure 4-3. CPU-0+ Boot Process......................................................................................................................................... 85
Figure 4-4. CPU Hot Plug Process ........................................................................................................................................ 86
Figure 4-5. Super Standby Wakeup Process ....................................................................................................................... 86
Figure 4-6. Mandatory Upgrade Process ............................................................................................................................ 87
Figure 4-7. Fast Boot Normal Process ................................................................................................................................. 88
Figure 4-8. Fast Boot Security Process ................................................................................................................................ 89
Figure 4-9. System Bus Tree ................................................................................................................................................ 91
Figure 4-10. Bus Clock Tree ................................................................................................................................................. 92
Figure 4-11. CPU CFG Block Diagram ................................................................................................................................ 152
Figure 4-12. Timer Block Diagram ..................................................................................................................................... 165
Figure 4-13. TWD Block Diagram ...................................................................................................................................... 176
Figure 4-14. HSTimer Function Structure and Work Flow ................................................................................................ 195
Figure 4-15. PWM Block Diagram ..................................................................................................................................... 200
Figure 4-16. DMA Block Diagram ...................................................................................................................................... 205
Figure 4-17. Message Box Block Diagram ......................................................................................................................... 231
Figure 4-18. Message Box Typical Application Chart ........................................................................................................ 232
Figure 4-19. Spinlock Typical Application Flow Chart ....................................................................................................... 243
Figure 4-20. Spinlock Lock Register State Diagram ........................................................................................................... 243
Figure 4-21. CE Block Diagram .......................................................................................................................................... 248
Figure 4-22. Crypto Engine Task Chaining......................................................................................................................... 249
Figure 4-23. DRM Block Diagram ...................................................................................................................................... 259
Figure 4-24. Thermal Sensor Block Diagram ..................................................................................................................... 276
Figure 4-25. Thermal Conversion Phase ........................................................................................................................... 277
Figure 4-26. KEYADC Block Diagram ................................................................................................................................. 284
Figure 4-27. KEYADC Converted Data Diagram................................................................................................................. 285
Figure 5-1. NDFC Block Diagram ....................................................................................................................................... 334
Figure 5-2. Conventional Serial Access Cycle Diagram (SAM0)......................................................................................... 336
Figure 5-3. EDO Type Serial Access after Read Cycle (SAM1) ........................................................................................... 336
Figure 5-4. Extending EDO Type Serial Access Mode (SAM2) ........................................................................................... 337
Figure 5-5. Command Latch Cycle..................................................................................................................................... 337
Figure 5-6. Address Latch Cycle ........................................................................................................................................ 338
Figure 5-7. Write Data to Flash Cycle ................................................................................................................................ 338
Figure 5-8. Waiting R/B# Ready Diagram.......................................................................................................................... 339
Figure 5-9. WE# High to RE# Low Timing Diagram ........................................................................................................... 339
Figure 5-10. RE# High to WE# Low Timing Diagram ......................................................................................................... 340
Figure 5-11. Address to Data Loading Timing Diagram..................................................................................................... 340
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 31
Figures
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 33
Tables
Tables
Table 3-1. Pin Characteristics .............................................................................................................................................. 54
Table 4-1. PLLs Typical Applications.................................................................................................................................... 92
Table 4-2. DMA DRQ Table ............................................................................................................................................... 205
Table 4-3. Master and Master ID ...................................................................................................................................... 259
Table 4-4. Region Size ....................................................................................................................................................... 260
Table 4-5. Region Security Permissions when Security Inversion Disabled ...................................................................... 260
Table 4-6. Region Security Permissions when Security Inversion Enabled ....................................................................... 261
Table 4-7. SPC Configuration Table ................................................................................................................................... 271
Table 4-8. KEYADC External Signals................................................................................................................................... 285
Table 4-9. KEYADC Clock Sources...................................................................................................................................... 285
Table 5-1. NDFC External Signals ...................................................................................................................................... 334
Table 5-2. NDFC Clock Sources ......................................................................................................................................... 335
Table 5-3. SMHC External Signals...................................................................................................................................... 367
Table 5-4. SMHC Clock Sources......................................................................................................................................... 367
Table 6-1. CSI FIFO Distribution ........................................................................................................................................ 402
Table 8-1. Audio Codec External Signals ........................................................................................................................... 444
Table 8-2. I2S/PCM External Signals ................................................................................................................................. 502
Table 8-3. I2S/PCM Clock Sources..................................................................................................................................... 503
Table 8-4. OWA External Signals ....................................................................................................................................... 523
Table 8-5. OWA Clock Sources .......................................................................................................................................... 523
Table 9-1. TWI External Signals ......................................................................................................................................... 534
Table 9-2. TWI Clock Sources ............................................................................................................................................ 535
Table 9-3. SPI External Signals .......................................................................................................................................... 544
Table 9-4. SPI Clock Sources.............................................................................................................................................. 544
Table 9-5. SPI Transmit Format ......................................................................................................................................... 545
Table 9-6. SPI Sample Mode and Run Clock...................................................................................................................... 547
Table 9-7. UART External Signals ...................................................................................................................................... 563
Table 9-8. UART Clock Sources.......................................................................................................................................... 564
Table 9-9. SCR External Signals ......................................................................................................................................... 627
Table 9-10. EMAC External Signals.................................................................................................................................... 640
Table 9-11. TSC External Signals ....................................................................................................................................... 660
Table 9-12. TSC Clock Sources........................................................................................................................................... 661
Table 10-1. Absolute Maximum Ratings ........................................................................................................................... 682
Table 10-2. Recommended Operating Conditions ............................................................................................................ 683
Table 10-3. DC Electrical Characteristics ........................................................................................................................... 683
Table 10-4. KEYADC Electrical Characteristics .................................................................................................................. 684
Table 10-5. 24MHz Crystal Characteristics ....................................................................................................................... 684
Table 10-6. 32768Hz Crystal Characteristics ..................................................................................................................... 685
Table 10-7. Maximum Current Consumption ................................................................................................................... 685
Table 10-8. NAND Timing Constants ................................................................................................................................. 690
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 34
Tables
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 35
About This Documentation
1.1. Purpose
This documentation provides an overall description of the Allwinners H5 application processor, which describes the
overview, features, logical structures ,functions and register listings of each module. The documentation also describes
pin/signal characteristics, operating modes, current consumption, the interface timing and package. The documentation
is intended to be used by board-level product designers and product hardware/software developers. This
documentation assumes that the reader has a background in computer engineering and/or hardware designing and/or
software engineering.
The table below contains acronyms and abbreviations used in this documentation.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 36
About This Documentation
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 38
Overview
Chapter 2 Overview
This part describes the overview for H5 processor.
Processor Overview
Processor Features
System Block Diagram
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 39
Overview
The Allwinner H5 is a highly cost-efficient quad-core OTT Box processor, which is a part of growing home entertainment
products that offer high-performance processing with a high degree of functional integration.
CPU: Quad-core ARM CortexTM-A53 Processor, a power-efficient ARM v8 architecture, it has 64 and 32bit execution
states for scalable high performance ,which includes a NEON multimedia processing engine.
Graphics: The hexa-core ARM Mali450 GPU including dual Geometry Processors(GP) and quad Pixel
Processors(PP), provides users with superior experience in video playback and mainstream game; OpenGL ES2.0 and
OpenVG1.1 standards are supported.
Video Engine: H5 provides multi-format high-definition video encoder/decoder with dedicated hardware,
including H.265 decoder by 4K@30fps , H.264 decoder by 4K@30fps, MPEG1/2/4 decoder by 1080p@60fps, VP8/AVS
jizhun decoder by 1080p@60fps, VC1 decoder by 1080p@30fps, H.264 encoder by 1080p@60fps.
Display Subsystem: Supports DE2.0 for excellent display experience, and two display interfaces for HDMI1.4 and
CVBS display.
Memory Controller: The processor supports many types of external memory devices, including DDR3/DDR3L,
NAND Flash(MLC,SLC,TLC,EF),Nor Flash, SD/SDIO/MMC including eMMC up to rev5.1.
Security System: The processor delivers hardware security features that enable trustzone security system, Digital
Rights Management(DRM) , information encryption/decryption, secure boot, secure JTAG and secure efuse.
Interfaces: The processor has a broad range of hardware interfaces such as parallel CMOS sensor interface,
10/100/1000Mbps EMAC with FE PHY, USB OTG v2.0 operating at high speed(480Mbps) with PHY, USB Host with PHY
and a variety of other popular interfaces(SPI,UART,CIR,TSC,TWI,SCR).
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 40
Overview
On chip ROM
Supports secure and non-secure access boot
Supports system boot from the following devices:
- NAND Flash
- SD/TF card
- eMMC
- Nor Flash
Supports system code download through USB OTG
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 41
Overview
2.2.3.2. SDRAM
2.2.3.4. SMHC
2.2.4.1. Timer
2.2.4.3. RTC
Time,calendar
Counters second,minutes,hours,day,week,month and year with leap year generator
Alarm:general alarm and weekly alarm
One 32KHz fanout
2.2.4.4. GIC
Supports 16 Software Generated Interrupts(SGIs), 16 Private Peripheral Interrupts(PPIs) and 125 Shared Peripheral
Interrupts(SPIs)
2.2.4.5. DMA
Up to 12-channel DMA
Interrupt generated for each DMA channel
Transfers data width of 8/16/32/64-bit
Supports linear and IO address modes
Programs the DMA burst size
Supports data transfer types with memory-to-memory, memory-to-peripheral, peripheral-to-memory
2.2.4.6. CCU
9 PLLs
Supports an external 24MHz crystal oscillator and an on-chip 16MHz RC oscillator
Supports clock configuration and clock generated for corresponding modules
Supports software-controlled clock gating and software-controlled reset for corresponding modules
2.2.4.7. PWM
Supports outputting two kinds of waveform: continuous waveform and pulse waveform
0% to 100% adjustable duty cycle
Up to 24MHz output frequency
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 43
Overview
2.2.4.9. KEYADC
2.2.4.11. Spinlock
32 spinlocks
Two kinds of status of lock register: TAKEN and NOT TAKEN
Configure related CPU parameters, including power on, reset, cache, debug, and check the status of CPU
One 64-bit common counter
2.2.5.1. DE2.0
1280 x 720p@50/60Hz
720 x 480p@60Hz
720 x 576p@50Hz
3D Frame Packing 1920 x 1080p@24Hz
- Supports L-PCM audio format
Up to 192KHz IEC-60958 audio sampling rate
Maximum 24bit, 8 channel
- Supports IEC-61937 compressed audio format
Supports TV CVBS output
- Standard NTSC-M and PAL-B,D,G,H,I output
- Plug status auto detecting
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 46
Overview
2.2.7.1. CSI
2.2.8.2. I2S/PCM
2 I2S/PCM controllers
Compliant with standard Inter-IC sound(I2S) bus specification
Compliant with left-justified, right-justified, PCM mode, and TDM(Time Division Multiplexing) format
Supports 8-channel in TDM mode
Full-duplex synchronous work mode
Mater and slave mode configured
Clock up to 100 MHz
Adjustable audio sample resolution from 8-bit to 32-bit
Sample rate from 8 KHz to 192 KHz
Supports 8-bit u-law and 8-bit A-law companded sample
Supports programmable PCM frame width:1 BCLK width(short frame) and 2 BCLKs width(long frame)
One 128 depth x 32-bit width FIFO for data transmit, one 64 depth x 32-bit width FIFO for data receive
Programmable FIFO thresholds
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 47
Overview
2.2.9.1. USB
2.2.9.2. Ethernet
2.2.9.3. CIR
2.2.9.4. UART
Up to 5 UART controllers, one UART for CPUx debug, one UART for CPUs debug, others for UART applications
UART0: 2-wire; UART1/2/3: 4-wire; S_UART: 2-wire
Compliant with industry-standard 16450 and 16550 UARTs
Supports word length from 5 to 8 bits, an optional parity bit and 1,1.5 or 2 stop bits
Programmable parity(even, odd and no parity)
64-byte Transmit and receive data FIFOs for all UART
2.2.9.5. SPI
Up to 2 SPI controllers
Full-duplex synchronous serial interface
Master/Slave configurable
Mode0~3 are supported for both transmit and receive operations
Two 64-byte FIFO for SPI-TX and SPI-RX operation
DMA-based or interrupt-based operation supported
Polarity and phase of the chip select(SPI_SS) and SPI_Clock(SPI_SCLK) are configurable
The maximum frequency is 100MHz
Supports single and dual read mode
2.2.9.6. TWI
2.2.9.7. TSC
2.2.9.8. SCR
2.2.10. Package
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 50
Overview
TSC x4
DE2.0 Video Engine Hexa-core SDIO3.0
Decoder ARM Mali450 GPU
HDMI 1.4 H.265 4K@30fps SCR x2
4K@30fps
Encoder
System
CVBS output TWI x4
H.264 1080p@60fps CCU
PAL/NTSC mode
CIR Rx
External Memory GIC
Audio Thermal Sensor SPI x2
DDR3/DDR3L
Audio Codec 32-bit bus Timer UART x5
8-bit NDFC DMA
I2S/PCM x 2
with 64-bit ECC
PWM
Security System
SD3.0/eMMC5.1 TrustZone
OWA output KEYADC
1/4/8-bit bus
Security Boot
Ethernet Crypto Engine
10/100/1000M EMAC 10/100M FE PHY
SID
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 51
Pin Description
Pin Characteristics
Signal Descriptions
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 52
Pin Description
Table 3-1 lists the characteristics of H5 Pins from seven aspects: BALL#, Pin Name, Default Function, Type, Reset State,
Default Pull Up/Down, and Buffer Strength.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 53
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
DRAM
T17 SA0 SA0 NA NA O Z NA NA VCC-DRAM
U18 SA1 SA1 NA NA O Z NA NA VCC-DRAM
V19 SA2 SA2 NA NA O Z NA NA VCC-DRAM
V20 SA3 SA3 NA NA O Z NA NA VCC-DRAM
V21 SA4 SA4 NA NA O Z NA NA VCC-DRAM
Y19 SA5 SA5 NA NA O Z NA NA VCC-DRAM
Y20 SA6 SA6 NA NA O Z NA NA VCC-DRAM
V15 SA7 SA7 NA NA O Z NA NA VCC-DRAM
W18 SA8 SA8 NA NA O Z NA NA VCC-DRAM
Y18 SA9 SA9 NA NA O Z NA NA VCC-DRAM
P19 SA10 SA10 NA NA O Z NA NA VCC-DRAM
N19 SA11 SA11 NA NA O Z NA NA VCC-DRAM
R18 SA12 SA12 NA NA O Z NA NA VCC-DRAM
V12 SA13 SA13 NA NA O Z NA NA VCC-DRAM
N17 SA14 SA14 NA NA O Z NA NA VCC-DRAM
R17 SA15 SA15 NA NA O Z NA NA VCC-DRAM
W17 SBA0 SBA0 NA NA O Z NA NA VCC-DRAM
T18 SBA1 SBA1 NA NA O Z NA NA VCC-DRAM
V17 SBA2 SBA2 NA NA O Z NA NA VCC-DRAM
U15 SCAS SCAS NA NA O Z NA NA VCC-DRAM
AA19 SCK SCK NA NA O Z NA NA VCC-DRAM
AA20 SCKB SCKB NA NA O Z NA NA VCC-DRAM
AA21 SCKE0 SCKE0 NA NA O Z NA NA VCC-DRAM
Y21 SCKE1 SCKE1 NA NA O Z NA NA VCC-DRAM
W20 SCS0 SCS0 NA NA O Z NA NA VCC-DRAM
W21 SCS1 SCS1 NA NA O Z NA NA VCC-DRAM
W11 SODT0 SODT0 NA NA O Z NA NA VCC-DRAM
V11 SODT1 SODT1 NA NA O Z NA NA VCC-DRAM
N20 SDQ0 SDQ0 NA NA I/O Z NA NA VCC-DRAM
P21 SDQ1 SDQ1 NA NA I/O Z NA NA VCC-DRAM
P20 SDQ2 SDQ2 NA NA I/O Z NA NA VCC-DRAM
U21 SDQ3 SDQ3 NA NA I/O Z NA NA VCC-DRAM
R19 SDQ4 SDQ4 NA NA I/O Z NA NA VCC-DRAM
T20 SDQ5 SDQ5 NA NA I/O Z NA NA VCC-DRAM
U19 SDQ6 SDQ6 NA NA I/O Z NA NA VCC-DRAM
U20 SDQ7 SDQ7 NA NA I/O Z NA NA VCC-DRAM
J19 SDQ8 SDQ8 NA NA I/O Z NA NA VCC-DRAM
H20 SDQ9 SDQ9 NA NA I/O Z NA NA VCC-DRAM
H21 SDQ10 SDQ10 NA NA I/O Z NA NA VCC-DRAM
J21 SDQ11 SDQ11 NA NA I/O Z NA NA VCC-DRAM
L20 SDQ12 SDQ12 NA NA I/O Z NA NA VCC-DRAM
L21 SDQ13 SDQ13 NA NA I/O Z NA NA VCC-DRAM
M21 SDQ14 SDQ14 NA NA I/O Z NA NA VCC-DRAM
M19 SDQ15 SDQ15 NA NA I/O Z NA NA VCC-DRAM
Y17 SDQ16 SDQ16 NA NA I/O Z NA NA VCC-DRAM
AA17 SDQ17 SDQ17 NA NA I/O Z NA NA VCC-DRAM
Y16 SDQ18 SDQ18 NA NA I/O Z NA NA VCC-DRAM
W15 SDQ19 SDQ19 NA NA I/O Z NA NA VCC-DRAM
Y14 SDQ20 SDQ20 NA NA I/O Z NA NA VCC-DRAM
AA14 SDQ21 SDQ21 NA NA I/O Z NA NA VCC-DRAM
Y13 SDQ22 SDQ22 NA NA I/O Z NA NA VCC-DRAM
Y12 SDQ23 SDQ23 NA NA I/O Z NA NA VCC-DRAM
W12 SDQ24 SDQ24 NA NA I/O Z NA NA VCC-DRAM
AA11 SDQ25 SDQ25 NA NA I/O Z NA NA VCC-DRAM
Y11 SDQ26 SDQ26 NA NA I/O Z NA NA VCC-DRAM
Y10 SDQ27 SDQ27 NA NA I/O Z NA NA VCC-DRAM
W9 SDQ28 SDQ28 NA NA I/O Z NA NA VCC-DRAM
AA8 SDQ29 SDQ29 NA NA I/O Z NA NA VCC-DRAM
Y8 SDQ30 SDQ30 NA NA I/O Z NA NA VCC-DRAM
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 54
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
Output 1 O
UART0_RX 2 I
PWM0 3 O
Reserved 4 NA
Reserved 5 NA
PA_EINT5 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SIM0_PWREN 2 O
PCM0_MCLK 3 O
E14 PA6 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT6 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SIM0_CLK 2 O
Reserved 3 NA
D8 PA7 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT7 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SIM0_DATA 2 I/O
Reserved 3 NA
F13 PA8 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT8 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SIM0_RST 2 O
Reserved 3 NA
D13 PA9 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT9 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SIM0_DET 2 I
Reserved 3 NA
E11 PA10 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT10 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
TWI0_SCK 2 I/O
DI_TX 3 O
F11 PA11 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT11 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
TWI0_SDA 2 I/O
C13 PA12 DI_RX 3 Function7 I Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT12 6 I
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 56
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
IO Disable 7 OFF
Input 0 I
Output 1 O
SPI1_CS 2 I/O
UART3_TX 3 O
E15 PA13 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT13 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SPI1_CLK 2 I/O
UART3_RX 3 I
G12 PA14 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT14 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SPI1_MOSI 2 I/O
UART3_RTS 3 O
F14 PA15 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT15 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SPI1_MISO 2 I/O
UART3_CTS 3 I
D15 PA16 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT16 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
OWA_OUT 2 O
Reserved 3 NA
C14 PA17 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT17 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
PCM0_SYNC 2 I/O
TWI1_SCK 3 I/O
B13 PA18 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT18 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
PCM0_CLK 2 I/O
TWI1_SDA 3 I/O
B14 PA19 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT19 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
A13 PA20 PCM0_DOUT 2 Function7 O Z PU/PD 20 VCC-IO
SIM0_VPPEN 3 O
Reserved 4 NA
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 57
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
Reserved 5 NA
PA_EINT20 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
PCM0_DIN 2 I
SIM0_VPPPP 3 O
A14 PA21 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PA_EINT21 6 I
IO Disable 7 OFF
GPIOC
Input 0 I
Output 1 O
NAND_WE 2 O
SPI0_MOSI 3 I/O
C15 PC0 Function7 Z PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_ALE 2 O
SPI0_MISO 3 I/O
C16 PC1 Function7 Z PU/PD 20 VCC-PC
SDC2_DS 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_CLE 2 O
SPI0_CLK 3 I/O
B16 PC2 Function7 Z PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_CE1 2 O
SPI0_CS 3 NA
B15 PC3 Function7 PU PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_CE0 2 O
Reserved 3 NA
F16 PC4 Function7 PU PU/PD 20 VCC-PC
SPI0_MISO 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_RE 2 O
SDC2_CLK 3 I/O
A17 PC5 Function7 Z PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
E16 PC6 Function7 PU PU/PD 20 VCC-PC
Output 1 O
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 58
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
NAND_RB0 2 I
SDC2_CMD 3 I/O
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_RB1 2 I
Reserved 3 NA
A16 PC7 Function7 PU PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_DQ0 2 I/O
SDC2_D0 3 I/O
B18 PC8 Function7 Z PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_DQ1 2 I/O
Function7
SDC2_D1 3 I/O
C17 PC9 Z PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_DQ2 2 I/O
SDC2_D2 3 I/O
D17 PC10 Function7 Z PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_DQ3 2 I/O
SDC2_D3 3 I/O
C18 PC11 Function7 Z PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_DQ4 2 I/O
SDC2_D4 3 I/O
B17 PC12 Function7 Z PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_DQ5 2 I/O
SDC2_D5 3 I/O
B19 PC13 Function7 Z PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 59
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
Input 0 I
Output 1 O
NAND_DQ6 2 I/O
SDC2_D6 3 I/O
F17 PC14 Function7 Z PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_DQ7 2 I/O
SDC2_D7 3 I/O
C19 PC15 Function7 Z PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
NAND_DQS 2 O
SDC2_RST 3 O
H16 PC16 Function7 PD PU/PD 20 VCC-PC
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
G15 VCC-PC VCC-PC NA NA P NA NA NA NA
GPIOD
Input 0 I
Output 1 O
RGMII_RXD3/
MII_RXD3/ 2 I
RMII_NULL
C21 PD0 Function7 Z PU/PD 20 VCC-PD
DI_TX 3 O
TS2_CLK 4 I
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_RXD2/
MII_RXD2/ 2 I
RMII_NULL
H17 PD1 Function7 Z PU/PD 20 VCC-PD
DI_RX 3 I
TS2_ERR 4 I
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_RXD1/
MII_RXD1/ 2 I
RMII_RXD1
B20 PD2 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
TS2_SYNC 4 I
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_RXD0/
H18 PD3 MII_RXD0/ 2 Function7 I Z PU/PD 20 VCC-PD
RMII_RXD0
Reserved 3 NA
TS2_DVLD 4 I
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 60
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_RXCK/
MII_RXCK/ 2 I
RMII_NULL
A20 PD4 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
TS2_D0 4 I
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_RXCTL/
MII_RXDV/ 2 I
RMII_CRS_DV
F19 PD5 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
TS2_D1 4 I
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_NULL/
MII_RXERR/ 2 I
RMII_RXER
B21 PD6 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
TS2_D2 4 I
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_TXD3/
MII_TXD3/ 2 O
RMII_NULL
E18 PD7 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
TS2_D3 4 I
TS3_CLK 5 I
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_TXD2/
MII_TXD2/ 2 O
RMII_NULL
E20 PD8 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
TS2_D4 4 I
TS3_ERR 5 I
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_TXD1/
MII_TXD1/ 2 O
RMII_TXD1
F21 PD9 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
TS2_D5 4 I
TS3_SYNC 5 i
Reserved 6 NA
IO Disable 7 OFF
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 61
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
Input 0 I
Output 1 O
RGMII_TXD0/
MII_TXD0/ 2 O
RMII_TXD0
H19 PD10 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
TS2_D6 4 I
TS3_DVLD 5 I
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_NULL/
MII_CRS/ 2 I
RMII_NULL
F20 PD11 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
TS2_D7 4 I
TS3_D0 5 I
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_TXCK/
MII_TXCK/ 2 I/O
RMII_TXCK
E19 PD12 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
SIM1_PWREN 4 O
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_TXCTL/
MII_TXEN/ 2 I/O
RMII_TXEN
K17 PD13 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
SIM1_CLK 4 O
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_NULL/
MII_TXERR/ 2 O
RMII_NULL
L17 PD14 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
SIM1_DATA 4 I/O
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
RGMII_CLKIN/
MII_COL/ 2 I
RMII_NULL
K18 PD15 Function7 Z PU/PD 20 VCC-PD
Reserved 3 NA
SIM1_RST 4 O
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
L18 PD16 Output 1 Function7 O Z PU/PD 20 VCC-PD
MDC 2 O
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 62
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
Reserved 3 NA
SIM1_DET 4 I
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
MDIO 2 I/O
Reserved 3 NA
L19 PD17 Function7 Z PU/PD 20 VCC-PD
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
J15 VCC-PD VCC-PD NA NA P NA NA NA NA
GPIOE
Input 0 I
Output 1 O
CSI_PCLK 2 I
TS0_CLK 3 I
B10 PE0 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_MCLK 2 O
TS0_ERR 3 O
A10 PE1 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_HSYNC 2 I
TS0_SYNC 3 I
B11 PE2 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_VSYNC 2 I
TS0_DVLD 3 I
C10 PE3 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_D0 2 I
TS0_D0 3 I
C9 PE4 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_D1 2 I
E10 PE5 TS0_D1 3 Function7 I Z PU/PD 20 VCC-IO
Reserved 4 O
Reserved 5 NA
Reserved 6 NA
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 63
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_D2 2 I
TS0_D2 3 I
D10 PE6 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_D3 2 I
TS0_D3 3 I
C8 PE7 Function7 Z PU/PD 20 VCC-IO
TS1_CLK 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_D4 2 I
TS0_D4 3 I
C11 PE8 Function7 Z PU/PD 20 VCC-IO
TS1_ERR 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_D5 2 I
TS0_D5 3 I
C12 PE9 Function7 Z PU/PD 20 VCC-IO
TS1_SYNC 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_D6 2 I
TS0_D6 3 I
E8 PE10 Function7 Z PU/PD 20 VCC-IO
TS1_DVLD 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_D7 2 I
TS0_D7 3 I
A11 PE11 Function7 Z PU/PD 20 VCC-IO
TS1_D0 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
CSI_SCK 2 I/O
TWI2_SCK 3 I/O
B12 PE12 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
C7 PE13 CSI_SDA 2 Function7 I/O Z PU/PD 20 VCC-IO
TWI2_SDA 3 I/O
Reserved 4 NA
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 64
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
Reserved 2 NA
SIM1_VPPEN 3 O
C6 PE14 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
Input 0 I
Output 1 O
Reserved 2 NA
SIM1_VPPPP 3 O
C5 PE15 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
Reserved 6 NA
IO Disable 7 OFF
GPIOF
Input 0 I
Output 1 O
SDC0_D1 2 I/O
JTAG_MS 3 I
D19 PF0 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PF_EINT0 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SDC0_D0 2 I/O
JTAG_DI 3 I
A19 PF1 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PF_EINT1 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SDC0_CLK 2 O
UART0_TX 3 O
D20 PF2 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PF_EINT2 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SDC0_CMD 2 I/O
JTAG_DO 3 O
F18 PF3 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PF_EINT3 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SDC0_D3 2 I/O
UART0_RX 3 I
E21 PF4 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PF_EINT4 6 I
IO Disable 7 OFF
Input 0 I
C20 PF5 Function7 Z PU/PD 20 VCC-IO
Output 1 O
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 65
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
SDC0_D2 2 I/O
JTAG_CK 3 I
Reserved 4 NA
Reserved 5 NA
PF_EINT5 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
Reserved 2 NA
Reserved 3 NA
G18 PF6 Function7 Z PU/PD 20 VCC-IO
Reserved 4 NA
Reserved 5 NA
PF_EINT6 6 I
IO Disable 7 OFF
GPIOG
Input 0 I
Output 1 O
SDC1_CLK 2 O
Reserved 3 NA
J3 PG0 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT0 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SDC1_CMD 2 I/O
Reserved 3 NA
L2 PG1 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT1 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SDC1_D0 2 I/O
Reserved 3 NA
H4 PG2 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT2 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SDC1_D1 2 I/O
Reserved 3 NA
F3 PG3 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT3 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SDC1_D2 2 I/O
Reserved 3 NA
C2 PG4 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT4 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
SDC1_D3 2 I/O
C1 PG5 Reserved 3 Function7 NA Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT5 6 I
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 66
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
IO Disable 7 OFF
Input 0 I
Output 1 O
UART1_TX 2 O
Reserved 3 NA
G4 PG6 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT6 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
UART1_RX 2 I
Reserved 3 NA
D3 PG7 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT7 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
UART1_RTS 2 O
Reserved 3 NA
C3 PG8 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT8 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
UART1_CTS 2 I
Reserved 3 NA
E3 PG9 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT9 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
PCM1_SYNC 2 I/O
Reserved 3 NA
M3 PG10 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT10 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
PCM1_CLK 2 I/O
Reserved 3 NA
D2 PG11 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT11 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
PCM1_DOUT 2 O
Reserved 3 NA
D1 PG12 Function7 Z PU/PD 20 VCC-PG
Reserved 4 NA
Reserved 5 NA
PG_EINT12 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
B1 PG13 PCM1_DIN 2 Function7 I Z PU/PD 20 VCC-PG
Reserved 3 NA
Reserved 4 NA
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 67
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
Reserved 5 NA
PG_EINT13 6 I
IO Disable 7 OFF
H7 VCC-PG VCC-PG NA NA P NA NA NA NA
GPIO L
Input 0 I
Output 1 O
S_TWI_SCK 2 I/O
Reserved 3 NA
N1 PL0 Function7 PU PU/PD 20 VCC-RTC
Reserved 4 NA
Reserved 5 NA
S_PL_EINT0 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
S_TWI_SDA 2 I/O
Reserved 3 NA
M1 PL1 Function7 PU PU/PD 20 VCC-RTC
Reserved 4 NA
Reserved 5 NA
S_PL_EINT1 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
S_UART_TX 2 O
Reserved 3 NA
P2 PL2 Function7 Z PU/PD 20 VCC-RTC
Reserved 4 NA
Reserved 5 NA
S_PL_EINT2 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
S_UART_RX 2 I
Reserved 3 NA
R1 PL3 Function7 Z PU/PD 20 VCC-RTC
Reserved 4 NA
Reserved 5 NA
S_PL_EINT3 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
S_JTAG_MS 2 I
Reserved 3 NA
N2 PL4 Function7 Z PU/PD 20 VCC-RTC
Reserved 4 NA
Reserved 5 NA
S_PL_EINT4 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
S_JTAG_CK 2 I
Reserved 3 NA
R2 PL5 Function7 Z PU/PD 20 VCC-RTC
Reserved 4 NA
Reserved 5 NA
S_PL_EINT5 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
S_JTAG_DO 2 O
Reserved 3 NA
T4 PL6 Function7 Z PU/PD 20 VCC-RTC
Reserved 4 NA
Reserved 5 NA
S_PL_EINT6 6 I
IO Disable 7 OFF
T3 PL7 Input 0 Function7 I Z PU/PD 20 VCC-RTC
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 68
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
Output 1 O
S_JTAG_DI 2 I
Reserved 3 NA
Reserved 4 NA
Reserved 5 NA
S_PL_EINT7 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
Reserved 2 NA
Reserved 3 NA
T2 PL8 Function7 Z PU/PD 20 VCC-RTC
Reserved 4 NA
Reserved 5 NA
S_PL_EINT8 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
Reserved 2 NA
Reserved 3 NA
M6 PL9 Function7 Z PU/PD 20 VCC-RTC
Reserved 4 NA
Reserved 5 NA
S_PL_EINT9 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
S_PWM 2 O
Reserved 3 NA
V2 PL10 Function7 Z PU/PD 20 VCC-RTC
Reserved 4 NA
Reserved 5 NA
S_PL_EINT10 6 I
IO Disable 7 OFF
Input 0 I
Output 1 O
S_CIR_RX 2 I
Reserved 3 NA
U2 PL11 Function7 Z PU/PD 20 VCC-RTC
Reserved 4 NA
Reserved 5 NA
S_PL_EINT11 6 I
IO Disable 7 OFF
System
AA6 NMI NMI NA NA I Z PU/PD NA VCC-RTC
V6 RESET RESET NA NA I/O Z PU/PD NA VCC-RTC
T5 TEST TEST NA NA I PD PU/PD NA VCC-RTC
W6 UBOOT UBOOT NA NA I PU PU/PD NA VCC-RTC
A1 JTAG-SEL0 JTAG-SEL0 NA NA I PU PU/PD NA VCC-IO
B2 JTAG-SEL1 JTAG-SEL1 NA NA I PU PU/PD NA VCC-IO
ADC
AA5 KEYADC KEYADC NA NA AI NA NA NA AVCC
TV-OUT
F10 TVOUT TVOUT NA NA AO NA NA NA V33-TV
G9 V33-TV V33-TV NA NA P NA NA NA NA
EPHY
A2 EPHY-LINK-LED EPHY-LINK-LED NA NA O NA NA NA EPHY-VCC
F7 EPHY-SPD-LED EPHY-SPD-LED NA NA O NA NA NA EPHY-VCC
F6 EPHY-RTX EPHY-RTX NA NA AI NA NA NA EPHY-VCC
A4 EPHY-RXN EPHY-RXN NA NA A I/O NA NA NA EPHY-VCC
B4 EPHY-RXP EPHY-RXP NA NA A I/O NA NA NA EPHY-VCC
A3 EPHY-TXN EPHY-TXN NA NA A I/O NA NA NA EPHY-VCC
B3 EPHY-TXP EPHY-TXP NA NA A I/O NA NA NA EPHY-VCC
G7 EPHY-VCC EPHY-VCC NA NA P NA NA NA NA
F8 EPHY-VDD EPHY-VDD NA NA P NA NA NA NA
HDMI
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 69
Pin Description
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
Ball# Pin Name Signal Name Function Ball Reset Rel. Function Type Ball Reset State Pull Up/Down Buffer Strength (mA) Power Supply
Ground
A21,AA1,G8,H12,
H15,H8,J13,J16,J9
,K13,K14,K15,K16
,K7,K8,K9,L15,L8,
L9,M10,M11,M12
,M13,M14,M15,
M5,M7,M8,M9, GND GND NA NA G NA NA NA NA
N10,N11,N12,
N13,N14,N15,N7,
N9,P10,P11,P12,
P13,P14,P15,R10,
R11,R12,R13,R14,
R9,T11,T9
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 71
Pin Description
H5 contains many peripheral interfaces. Many of the interfaces can multiplex up to eight functions. Pin-multiplexing
configuration can refer to Table 3-1. Table 3-2 shows the detailed function description of every signal based on the
different interface.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 72
Pin Description
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 73
Pin Description
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 74
Pin Description
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 76
Pin Description
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 77
Pin Description
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 78
System
Chapter 4 System
The chapter describes the H5 system from following sections:
Memory Mapping
Boot System
CCU
CPU Configuration
System Control
Timer
Trusted Watchdog
RTC
High-speed Timer
PWM
DMA
GIC
Message Box
Spinlock
Crypto Engine
Security ID
Secure Memory Controller
Secure Peripherals Controller
Thermal Sensor Controller
KEYADC
Port Controller(CPUx-PORT)
Port Controller(CPUs-PORT)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 79
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 80
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 81
System
4.2.1. Overview
The system will boot in different ways based on whether its security features are enabled
Supports CPU-0 boot process and CPU-0+ boot process
Supports super standby wakeup process
Supports mandatory upgrade process through USB OTG
Supports fast boot process from Raw NAND, eMMC, SD/TF card ,and SPI NOR Flash
The system will boot in normal mode or security mode based on whether its security feature are enabled.
Normal mode: The system boot will start from CPU-0 or CPU-0+, and the boot process is illustrated below.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 82
System
CPU Hot Plug process: refer to 4.2.2.4. CPU Hot Plug Process
Fast Boot process: refer to 4.2.2.6. Fast Boot Normal Process and 4.2.2.7.Fast Boot Security Process
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 83
System
In Security Boot mode, after the fast boot process finishes, the system will go to run Security BROM software.
When the system boots from CPU-0+, BROM will jump to multi-core system firmware address according to the CPU-0+
Boot pointer, and run CPU-0+ boot code.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 84
System
CPU-0+ Boot
starts
Read CPU_ID
NO
CPU_ID > 0? Run cpu0 code
YES
Read 0x01F01C00+0x1A4
register
Get soft_entry_address
Jump to
The soft_entry_address
The Hot Plug bit determines whether the system will do hot plug boot.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 85
System
Read 0x01f01c00+0x1AC
register get the value
Yes
Read 0x01f01c00+0x1A4
The value==0xFA50392F?
Get hot_plug_entry_address
No
Jump to
Run CPU0 code
The hot_plug_entry_address
Super Standby(SS) wakeup will be started by CPU-S, and will be carried on by CPU-0 after the release of CPU-0.
DRAM exit
Self refresh
(optional)
Release CPU-0
reset
CPU-0 boot
When the system chooses to whether enter mandatory upgrade processor, if the UBOOT_SEL(UBOOT signal) is detected
to pull low, then the system will jump to mandatory upgrade process. The mandatory upgrade process is illustrated
below.
Mandatory
Upgrade starts
USB Fel
Mandatory
Upgrade finish
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 87
System
When the system chooses to whether enter mandatory upgrade process, if the UBOOT_SEL(UBOOT signal) is detected
to pull high, then the system will jump to fast boot process. The fast boot normal process is illustrated below.
Pass
SDC0
Boot Operation
Not Pass
Pass
EMMC2
Boot Operation
Not Pass
Pass
SDC2
Boot Operation
Not Pass
Pass
NAND
Boot Operation
Not Pass
Pass
SPI_NOR
Boot Operation
Not Pass
Mandatory Upgrade
Run Boot0 CODE
Process
When the system chooses to whether enter mandatory MP process, if the UBOOT_SEL(UBOOT signal) is detected to
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 88
System
pulled to high level, then the system will jump to fast boot process. The fast boot process is illustrated below.
Pass
SDC0
Boot Operation
Not Pass
Pass
EMMC2
Boot Operation
Not Pass
Pass
SDC2
Boot Operation
Not Pass
Pass
NAND
Boot Operation
Not Pass
Pass
SPI_NOR
Boot Operation
Not Pass
Read
Security Brom
Software in TOC
Wrong
Check
right
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 89
System
4.3. CCU
4.3.1. Overview
The CCU controls the PLLs configuration and most of the clock generation, division, distribution, synchronization and
gating. CCU input signals include the external clock for the reference frequency (24MHz). The outputs from CCU are
mostly clocks to other blocks in the system.
Features:
9 PLLs, independent PLL for CPUX
Bus Source and Divisions
PLLs Bias Control
PLLs Tuning Control
PLLs Pattern Control
Configuring Modules Clock
Bus Clock Gating
Bus Software Reset
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 90
System
CPUS
AHB0 BUS
Cache, GIC
X2H DRAM
R_TIMER R_INTC R_WDOG
GPU SD/MMC CE R_PRCM RTC R_PWM
TSC USB OTG VE R_TWI R_UART R_GPIO
DE USB HOST CPUS DMA
R_CPUCFG R_CIR_RX
CSI NAND De-interlacer
AHB
AHB AHB
Arbiter
AHB1 BUS
APB2 BUS
APB1 BUS
UART TWI
AHB2 BUS
SCR CCU TIMER I2S/PCM
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 91
System
ExternalOSC
X
LOSC
MUX
L2 Cache /1
AXI_CLK_DIV_RATIO
AXI (1/(1~4))
OSC24M
AHB1_CLK_DIV_RATIO
MUX
(/1 /2 /4 /8) AHB1
X
AHB1_PRE_DIV
1/(1~4)
PLL_PERIPH0(1X)
MUX AHB2
/2
APB1_CLK_RATIO
(/2 /2 /4 /8) APB1
CLK_RAT_N CLK_RAT_M
MUX
(/1 /2 /4 /8) 1/(1~32) APB2
PLL Applications: use the available clock sources to generate clock roots to various parts of the chip. In practical
application, other PLLs do not support dynamic frequency scaling except for PLL_CPUX.
Note: All module clocks do not support DFS unless other noted. Because when switching module clock source or
adjusting division-ratio, the burr or transient instability may be generated, which will hang dead the module.
4.3.2.4. PLL
(1) In practical application, other PLLs do not support dynamic frequency scaling except for PLL_CPUX.
(2) After the PLL_DDR frequency changed, the 20-bit of PLL_DDR_CTRL_REG should be written 1 to make it valid.
4.3.2.5. BUS
(1) When setting the BUS clock , you should set the division factor firstly, and after the division factor becomes valid,
switch the clock source. The clock source will be switched after at least three clock cycles.
(2) The BUS clock should not be dynamically changed in most applications.
Make sure that the clock source output is valid before the clock source switch, and then set a proper divide ratio; after
the division factor becomes valid, switch the clock source.
Make sure that the reset signal has been released before the release of module clock gating.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 93
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 94
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 95
System
1: Enable
28 R 0x0
0: Unlocked
1: Locked (It indicates that the PLL is stable.)
27:25 / / /
CPUX_SDM_EN.
24 R/W 0x0
0: Disable
1: Enable
23:18 / / /
PLL_OUT_EXT_DIVP
PLL Output external divider P
00: /1
01: /2
17:16 R/W 0x0
10: /4
11: /
The P factor only uses in the condition that PLL output is less than 288
MHz.
15:13 / / /
PLL_FACTOR_N
PLL Factor N.
Factor=0, N=1
12:8 R/W 0x10 Factor=1, N=2
Factor=2, N=3
Factor=31, N=32
7:6 / / /
PLL_FACTOR_K.
5:4 R/W 0x0 PLL Factor K.(K=Factor + 1 )
The range is from 1 to 4.
3:2 / / /
PLL_FACTOR_M.
1:0 R/W 0x0 PLL Factor M. (M=Factor + 1)
The range is from 1 to 4.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 96
System
0: Disable
1: Enable.
28 R 0x0
0: Unlocked
1: Locked (It indicates that the PLL is stable.)
27:25 / / /
PLL_SDM_EN.
0: Disable
24 R/W 0x0 1: Enable
In this case, only the low 4 bits of PLL_FACTOR_N are valid (N: The range is
from 1 to 16).
23:20 / / /
PLL_POSTDIV_P.
19:16 R/W 0x3 Post-div factor P (P= Factor+1)
The range is from 1 to 16.
15 / / /
PLL_FACTOR_N.
PLL Factor N.
Factor=0, N=1
14:8 R/W 0x55
Factor=1, N=2
Factor=127, N=128
7:5 / / /
PLL_PREDIV_M.
4:0 R/W 0x14 PLL Pre-div Factor M (M = Factor+1).
The range is from 1 to 32.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 97
System
0: Disable
1: Enable
31 R/W 0x0
In the integer mode, the PLL Output = (24MHz*N)/M.
In the fractional mode, the PLL Output is selected by FRAC_CLK_OUT.
In the Clock Control Module, PLL(1X) Output = PLL, PLL(2X) Output = PLL * 2.
The PLL output clock must be in the range of 30MHz~600MHz.
Its default value is 297MHz.
PLL_MODE.
30 R/W 0x0
0: Manual Mode
1: Auto Mode (Controlled by DE)
29 / / /
LOCK.
28 R 0x0
0: Unlocked
1: Locked (It indicates that the PLL is stable.)
27:26 / / /
FRAC_CLK_OUT.
PLL clock output when PLL_MODE_SEL =0(PLL_PREDIV_M factor must be set
to 0). No meaning when PLL_MODE_SEL =1.
25 R/W 0x1
0: Fractional Mode
24 R/W 0x1
1: Integer Mode
20 R/W 0x0
0: Disable
1: Enable
19:15 / / /
PLL_FACTOR_N.
14:8 R/W 0x62 PLL Factor N.
Factor=0, N=1
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 98
System
Factor=1, N=2
Factor=2, N=3
Factor=127, N=128
7:4 / / /
PLL_PREDIV_M.
3:0 R/W 0x7 PLL Pre-div Factor M (M = Factor+1).
The range is from 1 to 16.
0: Disable
1: Enable
31 R/W 0x0
In the integer mode, The PLL Output = (24MHz*N)/M.
In the fractional mode, the PLL Output is selected by FRAC_CLK_OUT.
The PLL output clock must be in the range of 30MHz~600MHz.
Its default value is 297MHz.
30:29 / / /
LOCK
28 R 0x0
0: Unlocked
1: Locked (It indicates that the PLL is stable.)
27:26 / / /
FRAC_CLK_OUT.
PLL clock output when PLL_MODE_SEL =0(PLL_PREDIV_M factor must be set
to 0). No meaning when PLL_MODE_SEL =1.
25 R/W 0x1
0: Fractional Mode
24 R/W 0x1
1: Integer Mode
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 99
System
1: Enable
19:15 / / /
PLL_FACTOR_N.
PLL Factor N.
Factor=0, N=1
Factor=1, N=2
14:8 R/W 0x62 Factor=2, N=3
Factor=31, N=32
Factor=127, N=128
7:4 / / /
PLL_PREDIV_M.
3:0 R/W 0x7 PLL Pre Divider M (M = Factor+1).
The range is from 1 to 16.
0: Disable
1: Enable
31 R/W 0x0
Set PLL_DDR_CFG_UPDATE to validate the PLL after this bit is set to 1.
The PLL Output = (24MHz*N*K)/M.
The PLL output clock must be in the range of 200MHz~2.6GHz.
Its default value is 408MHz.
30:29 / / /
LOCK
28 R 0x0
0: Unlocked
1: Locked (It indicates that the PLL is stable.)
27:25 / / /
PLL_SDM_EN.
24 R/W 0x0
0: Disable
1: Enable
23:21 / / /
PLL_DDR_CFG_UPDATE.
PLL_DDR Configuration Update.
20 R/W 0x0
0: No effect
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 100
System
When PLL_DDR changed, this bit should be set to 1 to validate the PLL,
otherwise the change would be invalid. And this bit would be cleared
automatically after the PLL change is valid.
19:13 / / /
PLL_FACTOR_N.
PLL Factor N.
Factor=0, N=1
12:8 R/W 0x10 Factor=1, N=2
Factor=2, N=3
Factor=31, N=32
7:6 / / /
PLL_FACTOR_K.
5:4 R/W 0x0 PLL Factor K.(K = Factor + 1 )
The range is from 1 to 4.
3:2 / / /
PLL_FACTOR_M.
1:0 R/W 0x0 PLL Factor M.(M = Factor + 1 )
The range is from 1 to 4.
0: Disable
1: Enable
28 R 0x0
0: Unlocked
1: Locked (It indicates that the PLL is stable.)
27:26 / / /
25 R/W 0x0 PLL_BYPASS_EN.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 101
System
0: Disable
1: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 102
System
PLL_ENABLE.
0: Disable
1: Enable
31 R/W 0x0
In the integer mode, The PLL_GPU Output= (24MHz*N)/M.
In the fractional mode, the PLL_GPU Output is selected by FRAC_CLK_OUT.
The PLL output clock must be in the range of 30MHz~600MHz.
Its default value is 297MHz.
30:29 / / /
LOCK.
28 R 0x0
0: Unlocked
1: Locked (It indicates that the PLL is stable.)
27:26 / / /
FRAC_CLK_OUT.
PLL clock output when PLL_MODE_SEL =0(PLL_PRE_DIV_M factor must be
set to 0). No meaning when PLL_MODE_SEL =1.
25 R/W 0x1
0: Fractional Mode.
24 R/W 0x1
1: Integer Mode
20 R/W 0x0
0: Disable
1: Enable
19:15 / / /
PLL_FACTOR_N
PLL Factor N.
Factor=0, N=1
14:8 R/W 0x62 Factor=1, N=2
Factor=2, N=3
Factor=127, N=128
7:4 / / /
PLL_PRE_DIV_M.
3:0 R/W 0x7 PLL Pre Divider M (M = Factor+1).
The range is from 1 to 16.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 103
System
0: Disable
1: Enable
28 R 0x0
0: Unlocked
1: Locked (It indicates that the PLL is stable.)
27:26 / / /
PLL_BYPASS_EN.
PLL Output Bypass Enable.
20 R/W 0x0
0: Disable
1: Enable
19 / / /
PLL_24M_OUT_EN.
PLL 24MHz Output Enable.
18 R/W 0x1
0: Disable
1: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 104
System
0: Disable
1: Enable
31 R/W 0x0
28 R 0x0
0: Unlocked
1: Locked (It indicates that the PLL is stable.)
27:26 / / /
FRAC_CLK_OUT.
PLL clock output when PLL_MODE_SEL =0(PLL_PRE_DIV_M factor must be
25 R/W 0x1
set to 0). No meaning when PLL_MODE_SEL =1.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 105
System
0: PLL Output=270MHz
1: PLL Output =297MHz
PLL_MODE_SEL.
0: Fractional Mode
24 R/W 0x1
1: Integer Mode
20 R/W 0x0
0: Disable
1: Enable
19:15 / / /
PLL_FACTOR_N
PLL Factor N.
Factor=0, N=1
14:8 R/W 0x62 Factor=1, N=2
Factor=2, N=3
Factor=0x7F, N=128
7:4 / / /
PLL_PRE_DIV_M.
3:0 R/W 0x7 PLL Per Divider M (M = Factor+1).
The range is from 1 to 16.
If the clock source is changed, wait for at most 8 present running clock cycles.
15:10 / / /
CPU_APB_CLK_DIV.
9:8 R/W 0x0
00: /1
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 106
System
01: /2
1X: /4
00: LOSC
13:12 R/W 0x1
01: OSC24M
10: AXI
11: PLL_PERIPH0(1X)/AHB1_PRE_DIV
11:10 / / /
APB1_CLK_RATIO.
APB1 Clock Divide Ratio.
APB1 clock source is AHB1 clock.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 107
System
00: /1
01: /2
10: /4
11: /8
3:0 / / /
00: LOSC
25:24 R/W 0x1 01: OSC24M
1X: PLL_PERIPH0(1X)
This clock is used for some special module apbclk(UARTTWI). Because these
modules need special clock rate even if the apb1clk changed.
23:18 / / /
CLK_RAT_N
Clock Pre Divide Ratio (n)
The select clock source is pre-divided by 2^n.
1X: /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 109
System
0: Mask
1: Pass
USB OTG_Device_GATING.
Gating Clock for USB OTG_Device
23 R/W 0x0
0: Mask
1: Pass
22 / / /
SPI1_GATING.
Gating Clock for SPI1
21 R/W 0x0
0: Mask
1: Pass
SPI0_GATING.
Gating Clock for SPI0
20 R/W 0x0
0: Mask
1: Pass
HSTMR_GATING.
Gating Clock for High Speed Timer
19 R/W 0x0
0: Mask
1: Pass
TSC_GATING.
Gating Clock for TSC
18 R/W 0x0
0: Mask
1: Pass
EMAC_GATING.
Gating Clock for EMAC
17 R/W 0x0
0: Mask
1: Pass
16:15 / / /
DRAM_GATING.
Gating Clock for DRAM
14 R/W 0x0
0: Mask
1: Pass
NAND_GATING.
Gating Clock for NAND
13 R/W 0x0
0: Mask
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 110
System
1: Pass
12:11 / / /
MMC2_GATING.
Gating Clock for SMHC2
10 R/W 0x0
0: Mask
1: Pass
MMC1_GATING.
Gating Clock for SMHC1
9 R/W 0x0
0: Mask
1: Pass
MMC0_GATING.
Gating Clock for SMHC0
8 R/W 0x0
0: Mask
1: Pass
7 / / /
DMA_GATING.
Gating Clock for DMA
6 R/W 0x0
0: Mask
1: Pass
CE_GATING.
Gating Clock for CE.
5 R/W 0x0
0: Mask
1: Pass
4:0 / / /
0: Mask
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 111
System
1: Pass.
GPU_GATING.
Gating Clock for GPU
20 R/W 0x0
0: Mask
1: Pass.
19:13 / / /
DE_GATING.
Gating Clock for DE
12 R/W 0x0
0: Mask
1: Pass.
HDMI_GATING.
Gating Clock for HDMI
11 R/W 0x0
0: Mask
1: Pass.
10 / / /
TVE_GATING.
Gating Clock for TVE
9 R/W 0x0
0: Mask
1: Pass.
CSI_GATING.
Gating Clock for CSI
8 R/W 0x0
0: Mask
1: Pass.
7:6 / / /
DEINTERLACE_GATING.
Gating Clock for DEINTERLACE
5 R/W 0x0
0: Mask
1: Pass
TCON1_GATING.
Gating Clock for TCON1
4 R/W 0x0
0: Mask
1: Pass.
TCON0_GATING.
Gating Clock for TCON0
3 R/W 0x0
0: Mask
1: Pass.
2:1 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 112
System
VE_GATING.
Gating Clock for VE
0 R/W 0x0
0: Mask
1: Pass.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 113
System
AC_DIG_GATING.
Gating Clock for Audio Codec Digital Part
0 R/W 0x0
0: Mask
1: Pass
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 114
System
0: Mask
1: Pass.
TWI1_GATING.
Gating Clock for TWI1
1 R/W 0x0
0: Mask
1: Pass.
TWI0_GATING.
Gating Clock for TWI0
0 R/W 0x0
0: Mask
1: Pass.
THS_CLK_SRC_SEL.
Clock Source Select
SCLK = CLK_SRC_SEL/CLK_DIV_RATIO_N/CLK_DIV_RATIO_M.
30:26 / / /
CLK_SRC_SEL.
Clock Source Select
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 116
System
CLK_DIV_RATIO_M
3:0 R/W 0x0 Clock Divide Ratio (m)
The pre-divided clock is divided by (m+1). The divider M is from 1 to 16.
SCLK = CLK_SRC_SEL/CLK_DIV_RATIO_N/CLK_DIV_RATIO_M.
30:26 / / /
CLK_SRC_SEL.
Clock Source Select
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 117
System
0: Clock is OFF
1: Clock is ON.
SCLK = CLK_SRC_SEL/CLK_DIV_RATIO_N/CLK_DIV_RATIO_M.
30:26 / / /
CLK_SRC_SEL.
Clock Source Select
SCLK = CLK_SRC_SEL/CLK_DIV_RATIO_N/CLK_DIV_RATIO_M.
30:26 / / /
CLK_SRC_SEL.
Clock Source Select
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 118
System
23:18 / / /
CLK_DIV_RATIO_N.
Clock Pre Divide Ratio (n)
SCLK = CLK_SRC_SEL/CLK_DIV_RATIO_N/CLK_DIV_RATIO_M.
30:28 / / /
CLK_SRC_SEL.
Clock Source Select
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 119
System
SCLK = CLK_SRC_SEL/CLK_DIV_RATIO_N/CLK_DIV_RATIO_M.
30:26 / / /
CLK_SRC_SEL.
Clock Source Select
31 R/W 0x0
0: Clock is OFF
1: Clock is ON.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 120
System
SCLK = CLK_SRC_SEL/CLK_DIV_RATIO_N/CLK_DIV_RATIO_M.
30:26 / / /
CLK_SRC_SEL.
Clock Source Select
SCLK= CLK_SRC_SEL/CLK_DIV_RATIO_N/CLK_DIV_RATIO_M.
30:26 / / /
CLK_SRC_SEL.
Clock Source Select
00: /1
01: /2
10: /4
11: /8.
15:4 / / /
CLK_DIV_RATIO_M.
3:0 R/W 0x0 Clock Divide Ratio (m)
The pre-divided clock is divided by (m+1). The divider M is from 1 to 16.
00: PLL_AUDIO(8X)
17:16 R/W 0x0
01: PLL_AUDIO(8X)/2
10: PLL_AUDIO(8X)/4
11: PLL_AUDIO
15:0 / / /
11: PLL_AUDIO
15:0 / / /
00: PLL_AUDIO(8X)
17:16 R/W 0x0
01: PLL_AUDIO(8X)/2
10: PLL_AUDIO(8X)/4
11: PLL_AUDIO
15:0 / / /
SCLK_GATING_OHCI3.
Gating Special Clock for OHCI3
19 R/W 0x0
0: Clock is OFF
1: Clock is ON
SCLK_GATING_OHCI2.
Gating Special Clock for OHCI2
18 R/W 0x0
0: Clock is OFF
1: Clock is ON
SCLK_GATING_OHCI1.
Gating Special Clock for OHCI1
17 R/W 0x0
0: Clock is OFF
1: Clock is ON
SCLK_GATING_OTG_OHCI0.
Gating Special Clock for USB OTG_OHCI0
16 R/W 0x0
0: Clock is OFF
1: Clock is ON
15:12 / / /
SCLK_GATING_USBPHY3.
Gating Special Clock for USB PHY3
11 R/W 0x0
0: Clock is OFF
1: Clock is ON
SCLK_GATING_USBPHY2.
Gating Special Clock for USB PHY2
10 R/W 0x0
0: Clock is OFF
1: Clock is ON
SCLK_GATING_USBPHY1.
Gating Special Clock for USB PHY1
9 R/W 0x0
0: Clock is OFF
1: Clock is ON
SCLK_GATING_USBPHY0.
Gating Special Clock for USB PHY0
8 R/W 0x0
0: Clock is OFF
1: Clock is ON
7:4 / / /
USBPHY3_RST.
3 R/W 0x0 USB PHY3 Reset Control
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 124
System
0: Assert
1: De-assert
USBPHY2_RST.
USB PHY2 Reset Control
2 R/W 0x0
0: Assert
1: De-assert.
USBPHY1_RST.
USB PHY1 Reset Control
1 R/W 0x0
0: Assert
1: De-assert
USBPHY0_RST.
USB PHY0 Reset Control
0 R/W 0x0
0: Assert
1: De-assert
SCLK = CLK_SRC_SEL/DRAM_DIV_M
30:22
CLK_SRC_SEL.
0: Invalid
16 R/W 0x0
1: Valid.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 125
System
31 R/W 0x1
0: Reset Mbus Domain
1: Assert Mbus Domain.
30:0 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 126
System
31 R/W 0x0
0: Clock is OFF
1: Clock is ON
This special clock = CLK_SRC_SEL/CLK_DIV_RATIO_M.
30:27 / / /
CLK_SRC_SEL.
Clock Source Select
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 127
System
31 R/W 0x0
0: Clock is OFF
1: Clock is ON
SCLK= CLK_SRC_SEL/CLK_DIV_RATIO_M.
30:27 / / /
CLK_SRC_SEL.
Clock Source Select
SCLK = CLK_SRC_SEL/CLK_DIV_RATIO_M
30:27 / / /
CLK_SRC_SEL.
Clock Source Select
0: Clock is OFF
31 R/W 0x0
1: Clock is ON.
SCLK= SCLK_SRC_SEL/CSI_SCLK_DIV_M.
30:27 / / /
SCLK_SRC_SEL.
Special Clock Source Select
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 129
System
MCLK_SRC_SEL.
Master Clock Source Select
SCLK = PLL_VE/CLK_DIV_RATIO_N.
30:19 / / /.
CLK_DIV_RATIO_N.
18:16 R/W 0x0 Clock Pre Divide Ratio (N)
The select clock source is pre-divided by (n+1). The divider N is from 1 to 8.
15:0 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 130
System
SCLK= OSC24M.
30:0 / / /
SCLK= SCLK_SEL/CLK_DIV_RATIO_M.
30:26 / / /
SCLK_SEL.
Special Clock Source Select
25:24 R/W 0x0
00: PLL_VIDEO
Others: /
23:4 / / /
CLK_DIV_RATIO_M.
3:0 R/W 0x0 Clock Divide Ratio (m)
The pre-divided clock is divided by (m+1). The divider M is from 1 to 16.
31 R/W 0x0
0: Clock is OFF
1: Clock is ON.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 131
System
SCLK = OSC24M.
30:0 / / /
MBUS_CLOCK = MBUS_SCLK_SRC/MBUS_SCLK_RATIO_M
30:26 / / /
MBUS_SCLK_SRC
Clock Source Select
0: Clock is OFF
31 R/W 0x0
1: Clock is ON.
SCLK= PLL_GPU/CLK_DIV_RATIO_N.
30:3 / / /.
CLK_DIV_RATIO_N.
2:0 R/W 0x0 Clock Pre Divide Ratio (N)
The select clock source is pre-divided by ( n+1). The divider N is from 1 to 8.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 132
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 134
System
PLL_DAMP_FACTOR_CTRL.
1:0 R/W 0x0
PLL Damping Factor Control[1:0].
PLL_VCO_BIAS_CTRL.
28:24 R/W 0x10
PLL VCO Bias Control[4:0].
23:21 / / /
PLL_BIAS_CTRL.
20:16 R/W 0x10
PLL Bias Control[4:0].
15:3 / / /
PLL_DAMP_FACTOR_CTRL.
2:0 R/W 0x0
PLL Damping Factor Control[2:0].
0: Disable
1: Enable
27 / / /
PLL_LTIME_CTRL.
26:24 R/W 0x4
PLL Lock Time Control[2:0].
VCO_RST.
23 R/W 0x1
VCO Reset In.
PLL_INIT_FREQ_CTRL.
22:16 R/W 0x08
PLL Initial Frequency Control[6:0].
OD1.
15 R/W 0x0
Reg-Od1 for Verify.
B_IN.
14:8 R/W 0x0
B-In[6:0] for Verify.
OD.
7 R/W 0x0
Reg-Od for Verify.
B_OUT.
6:0 R 0x0
B-Out[6:0] for Verify.
00: 31.5KHz
01: 32KHz
10: 32.5KHz
11: 33KHz
WAVE_BOT.
16:0 R/W 0x0
Wave Bottom.
00: DC=0
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 140
System
01: DC=1
1X: Triangular
WAVE_STEP.
28:20 R/W 0x0
Wave step.
19 / / /
FREQ.
Frequency.
WAVE_BOT.
16:0 R/W 0x0
Wave Bottom.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 143
System
0: Assert
1: De-assert
USB OTG_Device_RST.
USB OTG_Device Reset Control
23 R/W 0x0
0: Assert
1: De-assert
22 / / /
SPI1_RST.
SPI1 Reset.
21 R/W 0x0
0: Assert
1: De-assert
SPI0_RST.
SPI0 Reset.
20 R/W 0x0
0: Assert
1: De-assert
HSTMR_RST.
HSTMR Reset.
19 R/W 0x0
0: Assert
1: De-assert
TSC_RST.
TSC Reset.
18 R/W 0x0
0: Assert
1: De-assert
EMAC_RST.
EMAC Reset.
17 R/W 0x0
0: Assert
1: De-assert
16:15 / / /
SDRAM_RST.
SDRAM AHB Reset.
14 R/W 0x0
0: Assert
1: De-assert
NAND_RST.
NAND Reset.
13 R/W 0x0
0: Assert
1: De-assert
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 144
System
12:11 / / /
SMHC2_RST.
SD/MMC2 Reset.
10 R/W 0x0
0: Assert
1: De-assert
SMHC1_RST.
SD/MMC1 Reset.
9 R/W 0x0
0: Assert
1: De-assert
SMHC0_RST.
SD/MMC0 Reset.
8 R/W 0x0
0: Assert
1: De-assert
7 / / /
DMA_RST.
DMA Reset.
6 R/W 0x0
0: Assert
1: De-assert
CE_RST.
CE Reset.
5 R/W 0x0
0: Assert
1: De-assert
4:0 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 145
System
MSGBOX_RST.
MSGBOX Reset.
21 R/W 0x0
0: Assert
1: De-assert.
GPU_RST.
GPU Reset.
20 R/W 0x0
0: Assert
1: De-assert.
19:13 / / /
DE_RST.
DE Reset.
12 R/W 0x0
0: Assert
1: De-assert.
HDMI1_RST.
HDMI1 Reset.
11 R/W 0x0
0: Assert
1: De-assert.
HDMI0_RST.
HDMI0 Reset.
10 R/W 0x0
0: Assert
1: De-assert.
TVE_RST.
TVE Reset.
9 R/W 0x0
0: Assert
1: De-assert
CSI_RST.
CSI Reset.
8 R/W 0x0
0: Assert
1: De-assert.
7:6 / /
DEINTERLACE_RST.
DEINTERLACE Reset.
5 R/W 0x0
0: Assert
1:De-assert
TCON1_RST.
4 R/W 0x0 TCON1 Reset.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 146
System
0: Assert
1: De-assert.
TCON0_RST.
TCON0 Reset.
3 R/W 0x0
0: Assert
1: De-assert.
2:1 / / /
VE_RST.
VE Reset.
0 R/W 0x0
0: Assert
1: De-assert.
0: Assert
1: De-assert.
11:9 / / /
THS_RST.
THS Reset.
8 R/W 0x0
0: Assert
1: De-assert
7:2 / / /
OWA_RST.
OWA Reset.
1 R/W 0x0
0: Assert
1: De-assert
AC_RST.
Audio Codec Reset.
0 R/W 0x0
0: Assert
1: De-assert
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 148
System
0: Assert
1: De-assert.
UART1_RST.
UART1 Reset.
17 R/W 0x0
0: Assert
1: De-assert.
UART0_RST.
UART0 Reset.
16 R/W 0x0
0: Assert
1: De-assert.
15:3 / / /
TWI2_RST.
TWI2 Reset.
2 R/W 0x0
0: Assert
1: De-assert.
TWI1_RST.
TWI1 Reset.
1 R/W 0x0
0: Assert
1: De-assert.
TWI0_RST.
TWI0 Reset.
0 R/W 0x0
0: Assert
1: De-assert.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 149
System
0: Secure
1: Non-secure
0: Secure
1: Non-secure
0 R/W 0x0
Including PLL_CPUX Control Register,PLL_AUDIO Control Register,PLL_VIDEO
Control Register,PLL_VE Control Register,PLL_DDR Control Register,
PLL_PEPIPH0 Control Register,PLL_GPU Control Register,PLL_PERIPH1 Control
Register,PLL_DE Control Register and offset from 0x200 to 0x2A8 relevant
registers.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 150
System
TIME_DET.
Time Detect.
000: 0.5/4 us
3:1 R/W 0x0 001: 0.5/2 us
010: 0.5/1 us
011: 0.5*2us
.................
111:0.5*2^5us
MOD_EN.
Module Enable.
0 R/W 0x0
0: Disable
1: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 151
System
4.4.1. Overview
CPU Configuration(CPU CFG) module is used to configure related CPU parameters, including power on, reset, cache,
debug, and check the status of CPU. It will be used when you want to disable/enable the CPU, cluster switch, CPU status
check, and debug, etc.
Features:
The figure above lists the power domains at CPU reset status. All power switch of CPU core are default to be closed.
Since each CPU core and its appended circuits have the same power domain, the processor and related L1 cache, neon
and vfp should be taken as a whole core.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 152
System
For the detail of CPU signal, please refer to ARM Cortex-A53 TRM.
When the L2 of Cluster needs to enter WFI mode, firstly make sure the CPU0/1/2/3 of Cluster enter WFI mode, which can
be checked through Cluster CPU Status Register, and then pull high the ACINACTM of Cluster by writing related register
bit to 1, and then check whether L2 enters idle status by checking whether the STANDBYWFIL2 is high. Remember to
set the ACINACTM to low when exiting the L2 idle mode.
The CPU reset includes core reset, power-on reset and H_Reset. And their scopes rank: core reset < power-on Reset <
H_Reset.
The CPU-related operation needs proper configuration of CPUCFG related register, as well as related system control
resource including BUS, clock ,reset and power control.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 153
System
31 R/W 0x1 0: Barriers are broadcast onto system bus, this requires an AMBA4
interconnect.
1: Barriers are not broadcast onto the system bus. This is compatible with an
AXI3 interconnect.
BROADCAST_INNER.
Enable broadcasting of Inner Shareable transactions
30 R/W 0x0
0: Inner shareable transactions are not broadcasted externally.
1: Inner shareable transactions are broadcasted externally.
BROADCAST_OUTER.
Enable broadcasting of outer shareable transactions
29 R/W 0x0
0: Outer Shareable transactions are not broadcasted externally.
1: Outer Shareable transactions are broadcasted externally.
BROADCAST_CACHE_MAINT
Enable broadcasting of cache maintenance operations to downstream caches
28 R/W 0x0
0: Cache maintenance operations are not broadcasted to downstream
caches.
1: Cache maintenance operations are broadcasted to downstream caches.
AA64nAA32
Register width state. Determines which execution state the processor boots
into after a cold reset.
27:24 R/W 0x0
0: AArch32
1: AArch64
23:10 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 154
System
CP15S_DISABLE.
11:8 R/W 0x0
Disable write access to some secure CP15 register.
7:5 / / /
L2_RST_DISABLE.
Disable automatic L2 cache invalidate at reset
4 R/W 0x0
0: L2 cache is reset by hardware.
1: L2 cache is not reset by hardware.
3:0 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 155
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 156
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 157
System
0: Assert
1: De-assert.
23:21 R/W 0x0
MBIST_RST
CPUBIST Reset.
The reset signal for test.
20 R/W 0x1
0: Assert
1: De-assert
19:16 R/W 0x0 /
15:13 / / /
HRESET.
Cluster H_Reset.
Reset all the Cluster Logic and Cluster Interface Logic.
12 R/W 0x1
0: Assert
1: De-assert
11:9 / / /
L2_RST.
Cluster L2 Cache Reset
8 R/W 0x1
0: Assert
1: De-assert
7:4 / / /
CORE_RESET.
Control a Core Reset Assert.
3:0 R/W 0x1
0: Assert
1: De-assert
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 158
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 160
System
4.5.1. Overview
Area Size(Bytes)
SRAM A1 32K
SRAM A2 64K
SRAM C 112K
CPUX I-Cache 32K (X=0,1,2,3)
CPUX D-Cache 32K (X=0,1,2,3)
CPU L2 Cache 512K
Total 976K
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 161
System
27 R/W 0x0
0: Internal SMI and MII
1: External SMI and MII
EPHY_MODE
Operation Mode Selection
19 R/W 0x0
0: BIST clk disable
1: BIST clk enable
CLK_SEL
18 R/W 0x1
0: 25MHz
1: 24MHz
LED_POL
17 R/W 0x0
0: High active
1: Low active
SHUTDOWN
16 R/W 0x1
0: Power up
1: Shutdown
PHY_SELECT.
15 R/W 0x1
0: External PHY
1: Internal PHY
14 / / /
RMII_EN
When this bit assert, MII or RGMII interface is disabled( This means bit13 is
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 162
System
prior to bit2)
ETXDC.
12:10 R/W 0x0
Configure EMAC Transmit Clock Delay Chain.
ERXDC.
9:5 R/W 0x0
Configure EMAC Receive Clock Delay Chain.
ERXIE
Enable EMAC Receive Clock Invertor.
4 R/W 0x0
0: Disable
1: Enable
ETXIE
Enable EMAC Transmit Clock Invertor.
3 R/W 0x0
0: Disable
1: Enable
EPIT
EMAC PHY Interface Type
2 R/W 0x0
0: MII
1: RGMII
ETCS.
EMAC Transmit Clock Source
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 163
System
4.6. Timer
4.6.1. Overview
Timer 0/1 can take their inputs from Internal OSC(INOSC) or OSC24M. They provide the operating systems scheduler
interrupt. It is designed to offer maximum accuracy and efficient management, even for systems with long or short
response time. They provide 24-bit programmable overflow counter and work in auto-reload mode or no-reload mode.
When the current value in Timer 0 Current Value Register or Timer 1 Current Value Register is counting down to zero,
the timer will generate interrupt if the interrupt enable bit is set.
The watchdog is used to resume the controller operation when it is disturbed by malfunctions such as noise and system
errors. It features a down counter that allows a watchdog period of up to 16 seconds (512000 cycles). It can generate a
general reset or interrupt request.
Features:
The Timer clock comes from one of the two clock sources that could be pre-scaled up to 128 division. In single mode,
when Current Value counts down to 0 , the enable bit is cleared automatically and Timer stops working. But in
continuous mode, Interval Value will be auto-reloaded into Timer 0 Current Value Register/Timer 1 Current Value
Register and counter counts from the new interval value again when current value is counted down to 0. Every time
current value is counted down to 0, a Pending will be generated. Pending could be sent to GIC only if IRQ Enable bit is
set.
Generally watchdog could not count down to 0 because it would be restart inside Interval Value. Otherwise the
malfunction makes the watchdog counts down to 0, and pending will be generated, which causes a reset for the whole
system or an interrupt (see Watchdog Configuration Register).
AVS has two up-counted counters. The clock source of the counter comes from 24MHz/Divisor_N (Divisor_N is set in
AVS Counter Divisor Register). AVS counter can disable or enable at any time, the Interval Value set in AVS Counter 0
Register or AVS Counter 1 Register and Divisor Value set in AVS Counter Divisor Register. When you enable the AVS
counter, it counts up from Interval Value until you pause it. It doesn't generate any pending.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 164
System
/1
Timer 0
/2
IRQ EN
/4
/8 Single
24M yes
/ 16 Interval Value Enable IV=0? Pending IRQ
INOSC/512 / 32
Continuous
/ 64
Timer1
/ 128
16 k cycles
32 k cycles yes
64 k cycles
Reset Whole System Enable Time out? Pending Reset
96 k cycles
192 k cycles
others cycles
yes
Interrupt Enable Time out? Pending IRQ
Restart
Generally the operation of setting both reload bit and enable bit and writing them into Timer 0 Control Register/Timer
1 Control Register moreover could cause a risk. It had better to enable Timer after Interval Value is loaded into Timer 0
Current Value Register/Timer 1 Current Value Register. Only in timer pause time, when you hope that counter starts
working from a new interval value, the reload bit and enable bit should be set 1 and wrote into TMR0_CTRL_REG/
TMR1_CTRL_REG at the same time.
For reload and enable operation of Timer, it is necessary to wait some cycles between the same continuous operations.
It has to wait for 2 cycles at least from pause state to start or from start state to pause. To reload operation, it could not
be implemented immediately again until the reload bit is cleared automatically the last operation.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 165
System
Watchdog restart function should be enabled inside Interval Value. Make a restart by writing 1 to Watchdog Restart and
0xA57 to Watchdog Key Field at the same time .
(1) Timer
Take making a Timer0 1ms delay for an example, 24M clock source, single mode and 2 pre-scale will be selected in the
instance.
In the following instance making configurations for Watchdog: configurate clock source as 24M/750, configurate Interval
value as 1s and configurate watchdog Configuration as To whole system. This instance indicates that reset system after
1s.
In the following instance making configurations for Watchdog: configurate clock source as 24M/750, configurate Interval
Value as 1s and configurate Watchdog Configuration as To whole system. In the following instance, if the time of other
codes is larger than 1s, watchdog will reset the whole system. If the sentence of restart watchdog is implemented inside
1s, watchdog will be restarted.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 166
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 167
System
0: No effect.
1: Pending, timer 1 interval value is reached.
TMR0_IRQ_PEND.
Timer 0 IRQ Pending.
Setting 1 to the bit will clear it.
0 R/W1C 0x0
0: No effect.
1: Pending, timer 0 interval value is reached.
7 R/W 0x0 0: Continuous mode. When interval value reached, the timer will not disable
automatically.
1: Single mode. When interval value reached, the timer will disable
automatically.
TMR0_CLK_PRES.
Select the pre-scale of timer 0 clock source.
000: /1
001: /2
6:4 R/W 0x0 010: /4
011: /8
100: /16
101: /32
110: /64
111: /128
TMR0_CLK_SRC.
3:2 R/W 0x1 Timer 0 Clock Source.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 168
System
0: No effect
1 R/W1S 0x0
1: Reload timer 0 Interval value.
After the bit is set, it can not be written again before it is cleared
automatically.
TMR0_EN.
Timer 0 Enable.
0: Stop/Pause
1: Start.
When the timer is started, it will reload the interval value to internal
0 R/W 0x0 register, and the current counter will count from interval value to 0.
If the current counter does not reach the zero, the TMR0_EN bit is set to
0, the current value counter will pause. At least wait for 2 cycles, the
TMR0_EN bit can be set to 1.
In timer pause state,Timer 0 Interval Value Register can be modified. If the
timer is started again, and the software hope Timer 0 Current Value
Register to down-count from the new interval value, the Timer 0 Reload bit
and the Timer 0 Enable bit should be set to 1 at the same time.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 169
System
7 R/W 0x0 0: Continuous mode. When interval value reached, the timer will not disable
automatically.
1: Single mode. When interval value reached, the timer will disable
automatically.
TMR1_CLK_PRES.
Select the pre-scale of timer 1 clock source.
000: /1
001: /2
6:4 R/W 0x0 010: /4
011: /8
100: /16
101: /32
110: /64
111: /128
TMR1_CLK_SRC.
0: No effect
1 R/W1S 0x0
1: Reload timer 1 Interval value.
After the bit is set, it can not be written again before its cleared
automatically.
TMR1_EN.
0 R/W 0x0
Timer 1 Enable.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 170
System
0: Stop/Pause
1: Start.
If the timer is started, it will reload the interval value to internal register, and
the current counter will count from interval value to 0.
If the current counter does not reach the zero, the TMR1_EN bit is set to 0,
the current value counter will pause. At least wait for 2 cycles, the TMR1_EN
bit can be set to 1.
In timer pause state, Timer 1 Interval Value Register can be modified. If the
timer is started again, and the software hope Timer 1 Current Value Register
to down-count from the new interval value, the Timer 1 Reload bit and the
Timer 1 Enable bit should be set to 1 at the same time.
0: Not pause
1: Pause Counter 0.
7:2 / / /
AVS_CNT1_EN.
Audio/Video Sync Counter 1 Enable/ Disable.
The counter source is OSC24M.
1 R/W 0x0
0: Disable
1: Enable.
AVS_CNT0_EN.
Audio/Video Sync Counter 1 Enable/ Disable.
The counter source is OSC24M.
0 R/W 0x0
0: Disable
1: Enable.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 172
System
27:16 R/W 0x5DB The number N is from 1 to 0x7ff. The zero value is reserved.
The internal 33 bits counter engine will maintain another 12 bits counter. The
12 bits counter is used for counting the cycle number of one 24MHz clock.
When the 12 bits counter reaches (>= N) the divisor value, the internal 33 bits
counter register will increase 1 and the 12 bits counter will reset to zero and
restart again.
15:12 / / /
AVS_CNT0_D.
Divisor N for AVS Counter 0
AVS CN0 CLK=24MHz/Divisor_N0.
Divisor N0 = Bit [11:0] + 1
11:0 R/W 0x5DB The number N is from 1 to 0x7ff. The zero value is reserved.
The internal 33 bits counter engine will maintain another 12 bits counter. The
12 bits counter is used for counting the cycle number of one 24MHz clock.
When the 12 bits counter reaches (>= N) the divisor value, the internal 33 bits
counter register will increase 1 and the 12 bits counter will reset to zero and
restart again.
Note: AVS_CNT1_D and AVS_CNT0_D can be configured by software at any time.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 173
System
0: No effect.
1: Pending. Watchdog0 interval value is reached.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 174
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 175
System
4.7.1. Overview
The trusted watchdog(TWD) is primarily used to protect the trusted world operations from denial of service when
secure services are dependent to the RichOS scheduler. For example, if the trusted world is not entered after a defined
time limit, the SoC is re-started to perform an authentication of the system.
The trusted watchdog can also be used to mask the real cause of a security error thanks to the delayed warm reset it
generates.
Restart
Counter Value and Interval Value are
Clear Enable Interval Value
Cleared
The trusted watchdog timer must always run when the SoC wakes up from cold reset and can be refreshed, suspended,
or reset only by secure accesses. And a clock of at least 32 KHz is used when the device is not a power saving cycles.
The trusted watchdog timer is able to generate a SoC warm reset after a duration programmed into the timer or set by
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 176
System
default in hardware. And the flag indicating the occurrence of a watchdog triggered warm reset has occurred since the
last cold reset.
Clock sources driving the watchdog timer must be controlled or managed by a trusted entity. This means that
non-trusted world accesses are not permitted to turn on, turn off or modify the characteristics of clock source. The
Clear Enable will reset relevant bits in the watchdog registers, except the reset flag.
4.7.3.2. NV-Counter
After a firmware image is validated, the image revision number taken from the certificate extension field, for example,
Trusted Firmware NV-Counter is compared with the corresponding NV-Counter stored in hardware. If the value is:
The 2^32 monotonic counter does not need to be e-Fuses, but it does need to be fully secure. Using the SoC embedded
NVM, or external secure element, or a trusted register, which is always on power.
The Secure Storage NV-Counter Register is used for protecting the trusted world Secure Storage (SST) file from replay
attacks, since SST contains subsidiary relay attacks protection counters for each Trusted Application.
Four 32-bit counters are used for counting 2^32 states for synchronizing data stores against replay attacks. These
counters are optionally required since they can be handled by a Trusted OS service using the secure storage at boot
time or using eMMC Replay Protected Memory Block (RPMB).
0: No effect.
1: Pending.
0: Resume rolling-over.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 178
System
1: Stop rolling-over.
TWD_CLR_EN.
TWD clear enable.
0 R/W 0x0
0: No effect.
1: To clear relevant registers, it will change to zero after the registers are
cleared.
0: No effect.
1: Restart enable.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 180
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 181
System
4.8. RTC
4.8.1. Overview
The real time clock (RTC) is for calendar usage. It is built around a 30-bit counter and used to count elapsed time in
YY-MM-DD and HH-MM-SS. The unit can be operated by the backup battery while the system power is off. It has a
built-in leap year generator and an independent power pin (RTC-VIO).
The alarm generates an alarm signal at a specified time in the power-off mode or normal operation mode. In normal
operation mode, both the alarm interrupt and the power management wakeup are activated. In power-off mode, the
power management wakeup signal is activated. In this section, there are two kinds of alarm. Alarm 0 is a general alarm,
its counter is based on second. Alarm 1 is a weekly alarm, its counter is based on the real time.
The 32768Hz oscillator is used only to provide a low power, accurate reference for the RTC.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 182
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 183
System
00: Low
01: /
10: /
11 High
1 / / /
LOSC_SRC_SEL.
LOSC Clock source Select. N is the value of Internal OSC Clock Prescalar
Register.
0 R/W 0x0
0: InternalOSC /32/ N
1: External 32.768kHz OSC.
(InternalOSC = 16MHz)
Note: If the bit[9:7] of LOSC_CTRL_REG is set, the corresponding of Alarm 1 Week HH-MM-SS Register, RTC HH-MM-SS
Register, RTC YY-MM-DD Register cant be written.
0 R 0x0
0: InternalOSC /32/ N
1: External 32.768KHz OSC
(InternalOSC = 16MHz)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 184
System
0x000: 1
0x001: 2
0x002: 3
............
0x1F: 32
This bit can not set by hardware. It should be set or cleared by software.
YEAR.
21:16 R/W UDF Year.
Range from 0~63.
15:12 / / /
MONTH.
11:8 R/W UDF Month.
Range from 1~12.
7:5 / / /
DAY.
4:0 R/W UDF Day.
Range from 1~31.
Note: If the written value is not from 1 to 31 in Day Area, it turns into 31 automatically. Month Area and Year Area are
similar to Day Area.
The number of days in different month may be different.
000: Monday
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 185
System
001: Tuesday
010: Wednesday
011: Thursday
100: Friday
101: Saturday
110: Sunday
111: /
28:21 / / /
HOUR.
20:16 R/W UDF
Range from 0~23
15:14 / / /
MINUTE.
13:8 R/W UDF
Range from 0~59
7:6 / / /
SECOND.
5:0 R/W UDF
Range from 0~59
Note: If the written value is not from 0 to 59 in Second Area, it turns into 59 automatically. Minute Area and Hour Area
are similar to Second Area.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 186
System
31:1 / / /
ALM_0_EN
Alarm 0 Enable.
If this bit is set to 1, the valid bits of Alarm 0 Counter Register will down
0 R/W 0x0 count to zero, and the alarm pending bit will be set to 1.
0: Disable
1: Enable
0: No effect
0 R/W1C 0x0
1: Pending, alarm 0 counter value is reached
If alarm 0 irq enable is set to 1, the pending bit will be sent to the interrupt
controller.
MINUTE.
13:8 R/W UDF
Range from 0~59.
7:6 / / /
SECOND.
5:0 R/W UDF
Range from 0~59.
Note: If the written value is not from 0 to 59 in Second Area, it turns into 59 automatically. Minute Area and Hour Area
are similar to Second Area.
0: Disable
1: Enable
6 R/W 0x0
If this bit is set to 1, only when the valid bits of Alarm 1 Week HH-MM-SS
Register is equal to the bit[20:0] of RTC HH-MM-SS Register and the
bit[31:29] of RTC HH-MM-SS Register is 6, the week 6 alarm irq pending bit
will be set to 1.
WK5_ALM1_EN.
Week 5 (Saturday) Alarm 1 Enable.
0: Disable
1: Enable
5 R/W 0x0
If this bit is set to 1, only when the valid bits of Alarm 1 Week HH-MM-SS
Register is equal to the bit[20:0] of RTC HH-MM-SS Register and the
bit[31:29] of RTC HH-MM-SS Register is 5, the week 5 alarm irq pending bit
will be set to 1.
WK4_ALM1_EN.
Week 4 (Friday) Alarm 1 Enable.
0: Disable
1: Enable
4 R/W 0x0
If this bit is set to 1, only when the valid bits of Alarm 1 Week HH-MM-SS
Register is equal to the bit[20:0] of RTC HH-MM-SS Register and the register
bit[31:29] of RTC HH-MM-SS Register is 4, the week 4 alarm irq pending bit
will be set to 1.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 188
System
WK3_ALM1_EN.
Week 3 (Thursday) Alarm 1 Enable.
0: Disable
1: Enable
3 R/W 0x0
If this bit is set to 1, only when the valid bits of Alarm 1 Week HH-MM-SS
Register is equal to the bit[20:0] of RTC HH-MM-SS Register and the
bit[31:29] of RTC HH-MM-SS Register is 3, the week 3 alarm irq pending bit
will be set to 1.
WK2_ALM1_EN.
Week 2 (Wednesday) Alarm 1 Enable.
0: Disable
1: Enable
2 R/W 0x0
If this bit is set to 1, only when the valid bits of Alarm 1 Week HH-MM-SS
Register is equal to the bit[20:0] of RTC HH-MM-SS Register and the
bit[31:29] of RTC HH-MM-SS Register is 2, the week 2 alarm irq pending bit
will be set to 1.
WK1_ALM1_EN.
Week 1 (Tuesday) Alarm 1 Enable.
0: Disable
1: Enable
1 R/W 0x0
If this bit is set to 1, only when the valid bits of Alarm 1 Week HH-MM-SS
Register is equal to the bit[20:0] of RTC HH-MM-SS Register and the
bit[31:29] of RTC HH-MM-SS Register is 1, the week 1 alarm irq pending bit
will be set to 1.
WK0_ALM1_EN.
Week 0 (Monday) Alarm 1 Enable.
0: Disable
1: Enable
0 R/W 0x0
If this bit is set to 1, only when the valid bits of Alarm 1 Week HH-MM-SS
Register is equal to the bit[20:0] of RTC HH-MM-SS Register and the
bit[31:29] of RTC HH-MM-SS Register is 0, the week 0 alarm irq pending bit
will be set to 1.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 189
System
0: No effect
0 R/W1C 0x0
1: Pending, week counter value is reached
If alarm 1 week irq enable is set to 1, the pending bit will be sent to the
interrupt controller.
0: Hold disable
1: Hold enable
GPL10_HOLD_OUTPUT.
Hold the output of GPIOL10 when the power of system is changing. The
output must be low level (0) or high level (1) or High-Z; any other outputs
10 R/W 0x0 may not hold on.
0: Hold disable
1: Hold enable
GPL9_HOLD_OUTPUT.
Hold the output of GPIOL9 when the power of system is changing. The
output must be low level (0) or high level (1) or High-Z; any other outputs
9 R/W 0x0 may not hold on.
0: Hold disable
1: Hold enable
GPL8_HOLD_OUTPUT.
Hold the output of GPIOL8 when the power of system is changing. The
output must be low level (0) or high level (1) or High-Z; any other outputs
8 R/W 0x0
may not hold on.
0: Hold disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 191
System
1: Hold enable
GPL7_HOLD_OUTPUT.
Hold the output of GPIOL7 when the power of system is changing. The
output must be low level (0) or high level (1) or High-Z; any other outputs
7 R/W 0x0 may not hold on.
0: Hold disable
1: Hold enable
GPL6_HOLD_OUTPUT.
Hold the output of GPIOL6 when the power of system is changing. The
output must be low level (0) or high level (1) or High-Z; any other outputs
6 R/W 0x0 may not hold on.
0: Hold disable
1: Hold enable
GPL5_HOLD_OUTPUT.
Hold the output of GPIOL5 when the power of system is changing. The
output must be low level (0) or high level (1) or High-Z; any other outputs
5 R/W 0x0 may not hold on.
0: Hold disable
1: Hold enable
GPL4_HOLD_OUTPUT.
Hold the output of GPIOL4 when the power of system is changing. The
output must be low level (0) or high level (1) or High-Z; any other output
4 R/W 0x0 may not hold on.
0: Hold disable
1: Hold enable
GPL3_HOLD_OUTPUT.
Hold the output of GPIOL3 when the power of system is changing. The
output must be low level (0) or high level (1) or High-Z; any other outputs
3 R/W 0x0 may not hold on.
0: Hold disable
1: Hold enable
GPL2_HOLD_OUTPUT.
Hold the output of GPIOL2 when the power of system is changing. The
output must be low level (0) or high level (1) or High-Z; any other outputs
2 R/W 0x0 may not hold on.
0: Hold disable
1: Hold enable
GPL1_HOLD_OUTPUT.
1 R/W 0x0
Hold the output of GPIOL1 when the power of system is changing. The
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 192
System
output must be low level (0) or high level (1) or High-Z; any other outputs
may not hold on.
0: Hold disable
1: Hold enable
GPL0_HOLD_OUTPUT.
Hold the output of GPIOL0 when the power of system is changing. The
output must be low level (0) or high level (1) or High-Z; any other outputs
0 R/W 0x0 may not hold on.
0: Hold disable
1: Hold enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 193
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 194
System
4.9.1. Overview
The clock sources of High Speed Timer(HSTimer) are fixed to AHBCLK, which is much higher than OSC24M. Compared
with other timers, the clock source of HSTimer is synchronized with AHB clock, and when the bit[31] in the HSTimer
Control Register is set 1, timer goes into the test mode, which is used to system simulation. When the current value in
both HSTimer Current Value Lo Register and HSTimer Current Value Hi Register are counting down to zero, the timer
will generate interrupt if the HS_TMR_INT_EN bit is set.
Features:
Single IRQ EN
n_mode
mode
Yes
AHBCLK HSTimer Interval Value Enable IV=0? Pending IRQ
Continuous
Test mode mode
HSTimer has two work modes. n_mode is used for normal counting and Test mode is used in system simulation. Each
work mode has the two count modes: Single mode and Continuous mode. When Current Value counts down to 0,
HSTimer will be disabled in Single mode , but HSTimer will not be disabled and counts from Interval value again in
Continuous mode. About HSTimer 56-bit counter, it is combined with a low 24-bit counter(HSTimer Current Value Lo
Register) and a high 32-bit counter(HSTimer Current Value Hi Register).
By default the clock gating of HSTimer is mask. When it is necessary to use HSTimer, its clock gating should be opened
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 195
System
in the Bus Clock Gating Register0 and then de-assert the software reset in the Bus Software Reset Register 0 on CCU
module. If it is no need to use HSTimer, both the gating bit and software reset bit should be set 0.
Differing from the reloading of Timer, when the interval value is reloaded into the current value register, the reload bit
would not turn to 0 automatically until you clear it. If software hopes the current value register to down-count from the
new interval value in pause status, the reload bit and the enable bit should be written 1 at the same time.
Take making a 1us delay using HSTimer for an instance as follow, AHB1CLK will be configurated as 100MHz and n_mode,
Single mode and 2 pre-scale will be selected in this instance.
writel(0x0, HS_TMR_INTV_VALUE_HI); //Set interval value Hi 0x0
writel(0x32, HS_TMR_INTV_VALUE_LO); //Set interval value Lo 0x32
writel(0x90, HS_TMR_CTRL_REG); //Select n_mode,2 pre-scale,single mode
writel(readl(HS_TMR_CTRL_REG)|(1<<1), HS_TMR_CTRL_REG); //Set Reload bit
writel(readl(HS_TMR_CTRL_REG)|(1<<0), HS_TMR_CTRL_REG); //Enable HSTimer
While(!(readl(HS_TMR_IRQ_STAS_REG)&1)); //Wait for HSTimer to generate pending
Writel(1,HS_TMR_IRQ_STAS_REG); //Clear HSTimer pending
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 196
System
0: Normal mode
1: Test mode.
30:8 / / /
HS_TMR_MODE.
High Speed Timer mode.
7 R/W 0x0 0: Continuous mode. When interval value reached, the timer will not disable
automatically.
1: Single mode. When interval value reached, the timer will disable
automatically.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 197
System
HS_TMR_CLK
Select the pre-scale of the High Speed Timer clock sources.
000: /1
001: /2
6:4 R/W 0x0 010: /4
011: /8
100: /16
101: /
110: /
111: /
3:2 / / /
HS_TMR_RELOAD.
High Speed Timer reload.
1 R/W1S 0x0
0: No effect
1: Reload High Speed Timer Interval Value.
HS_TMR_EN.
High Speed Timer enable.
0: Stop/Pause
1: Start.
If the timer is started, it will reload the interval value to internal register, and
0 R/W 0x0 the current counter will count from interval value to 0.
If the current counter does not reach the zero, the timer enable bit is set to
0, the current value counter will pause. At least wait for 2 cycles, the start
bit can be set to 1.
In timer pause state, the interval value register can be modified. If the timer
is started again, and the software hope the current value register to
down-count from the new interval value, the reload bit and the enable bit
should be set to 1 at the same time.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 198
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 199
System
4.10. PWM
4.10.1. Overview
The output of the PWM is a toggling signal whose frequency and duty cycle can be modulated by its programmable
registers. Each channel has a dedicated internal 16-bit up counter. If the counter reaches the value stored in the PWM
Channel Period Register, PWM resets. At the beginning of a count period cycle, the PWM is set to active state and
count from 0x0000.The PWM divider divides the clock(24MHz) by 1~4096 according to the pre-scalar bits in the PWM
Control Register.
In PWM cycle mode, the output will be a square waveform, the frequency is set in the PWM Channel Period Register.
In PWM pulse mode, the output will be a positive pulse or a negative pulse.
Entire cycles
Cycle Mode
Active low
Active cycles
Active high
Active cycles
Pulse Mode
The PWM divider divides the clock (24MHz) by 1-64 according to the pre-scalar bits in the PWM control register. The
PWM output frequency can be divided by 65536 at most. In PWM cycle mode, the output will be a square waveform;
the frequency is set to the period register. In PWM pulse mode, the output will be a positive pulse or a negative pulse.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 200
System
0: Disable
1: Enable
PWM_CH0_PUL_START.
PWM Channel 0 Pulse Output Start.
0: No effect
8 R/W 0x0 1: Output 1 pulse.
The pulse width should be set by the bit[15:0] of PWM Channel Period
Register,and the pulse state should be set by PWM Channel 0 Active State.
After the pulse is finished, the bit will be cleared automatically.
PWM_CHANNEL0_MODE.
7 R/W 0x0
0: Cycle mode
1: Pulse mode.
SCLK_CH0_GATING.
Gating the Special Clock for PWM0
6 R/W 0x0
0: Mask
1: Pass
5 R/W 0x0 PWM_CH0_ACT_STA.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 201
System
0: Low Level
1: High Level.
PWM_CH0_EN.
PWM Channel 0 Enable.
4 R/W 0x0
0: Disable
1: Enable.
PWM_CH0_PRESCAL.
PWM Channel 0 Prescalar.
These bits should be set before the PWM Channel 0 clock gate on.
0000: /120
0001: /180
0010: /240
0011: /360
0100: /480
0101: /
3:0 R/W 0x0
0110: /
0111: /
1000: /12k
1001: /24k
1010: /36k
1011: /48k
1100: /72k
1101: /
1110: /
1111: /1
0 = 1 cycle
1 = 2 cycles
31:16 R/W UDF
N = N+1 cycles
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 202
System
PWM_CH0_ENTIRE_ACT_CYS
Number of the active cycles in the PWM clock.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 203
System
4.11. DMA
4.11.1. Overview
The DMA enables data transfers between peripheral I/O devices and memories without using the CPU .This avoids the
CPU intervention and helps maximize system performance by off-loading the CPU. There are 12 DMA channels in the H5
processor. Each DMA channel can generate interrupts. According to different pending status, the referenced DMA
channel generates corresponding interrupt. And the configuration information of every DMA channel stores in the DDR
or SRAM. When start a DMA transfer, the DMA Channel Descriptor Address Register contains the address information
in the DDR or SRAM, where has the relevance configuration information of the DMA transfers.
Features:
DMA transfer supports in either direction between memory and peripheral, between peripheral and memory, or
between memory and memory.
Transfers data width of 8/16/32/64-bit
12 DMA channels
Programs the DMA burst size
Flexible data source and destination address generation
Supports linear and IO address modes
Interrupt generated for each DMA channel
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 204
System
DMA
Request DMA
After transferring a half data of a pkg, the pkg half pending bit would set up
Configuration After transferring all data of pkg, the pkg end pending bit would set up No
Source After finishing a transmission, the queue end pending bit would set up Any
Address Idle?
Link is used to storing next descriptor address or transmission end flag (0xfffff800)
Destination
Half-pend
Half-pend
Half-pend
Half-pend
End-pend
Pkg-pend
Pkg-pend
Pkg-pend
Pkf-pend
Address
Prepare Descriptor Data
Byte Counter
Commity
Parameter
Write Descriptor
1 2 3 4 Address and Start DMA
Link Link Link Link 0xfffff 800
Half-pend
Transferring Package
Pkg-pend
Resume
Pause? Yes
No
Transmission Finish
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 205
System
When started a DMA transmission, the module data are transferred as packages, which has the link data information.
And, by reading the DMA Status Register, the status of a DMA channel could be known. Reading back the DMA
Channel Descriptor Address Register, the value is the link data in the transferring package. If only the value is equal to
0xfffff800, then it can be regarded as NULL, which means the package is the last package in this DMA transmission.
Otherwise, the value means the start address of the next package. And, the DMA Channel Descriptor Address Register
can be changed during a package transferring.
When transferring the half of a package, the relevant pending bit will be set up automatically, and if the corresponding
interrupt is enabled, DMA generates an interrupt to the system. The similar thing would occur when transferring a
package completely. Meanwhile, if DMA has transferred the last package in the data, the relevant pending bit would be
set up, and generates an interrupt if the corresponding interrupt is enabled. The flow-process diagram is shown in DMA
Block Diagram.
During a DMA transmission, the configuration could be obtained by the DMA Channel Configuration Register. And
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 206
System
behind the address of the configuration register in DDR or SRAM, there are some registers including other information
of a DMA transmission. The structure chart is shown in DMA Block Diagram. Also, other information of a transferring
data can be obtained by reading the DMA Channel Current Source Address Register , DMA Channel Current
Destination Address Register and DMA Channel Byte Counter Left Register. The configuration must be word-aligning.
The transferring data would be paused when setting up the DMA Channel Pause Register, if coming up emergency. And
the pausing data could be presumable when setting 0 to the same bit in the DMA Channel Pause Register.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 207
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 208
System
0: Disable
1: Enable
DMA5_PKG_IRQ_EN
DMA 5 Package End Transfer Interrupt Enable.
21 R/W 0x0
0: Disable
1: Enable
DMA5_HLAF_IRQ_EN
DMA 5 Half package Transfer Interrupt Enable.
20 R/W 0x0
0: Disable
1: Enable
19 / / /
DMA4_QUEUE_IRQ_EN
DMA 4 Queue End Transfer Interrupt Enable.
18 R/W 0x0
0: Disable
1: Enable
DMA4_PKG_IRQ_EN
DMA 4 Package End Transfer Interrupt Enable.
17 R/W 0x0
0: Disable
1: Enable
DMA4_HLAF_IRQ_EN
DMA 4 Half Package Transfer Interrupt Enable.
16 R/W 0x0
0: Disable
1: Enable
15 / / /
DMA3_QUEUE_IRQ_EN
DMA 3 Queue End Transfer Interrupt Enable.
14 R/W 0x0
0: Disable
1: Enable
DMA3_PKG_IRQ_EN
DMA 3 Package End Transfer Interrupt Enable.
13 R/W 0x0
0: Disable
1: Enable
DMA3_HLAF_IRQ_EN
DMA 3 Half Package Transfer Interrupt Enable.
12 R/W 0x0
0: Disable
1: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 209
System
11 / / /
DMA2_QUEUE_IRQ_EN
DMA 2 Queue End Transfer Interrupt Enable.
10 R/W 0x0
0: Disable
1: Enable
DMA2_PKG_IRQ_EN
DMA 2 Package End Transfer Interrupt Enable.
9 R/W 0x0
0: Disable
1: Enable
DMA2_HLAF_IRQ_EN
DMA 2 Half Package Transfer Interrupt Enable.
8 R/W 0x0
0: Disable
1: Enable
7 / / /
DMA1_QUEUE_IRQ_EN
DMA 1 Queue End Transfer Interrupt Enable.
6 R/W 0x0
0: Disable
1: Enable
DMA1_PKG_IRQ_EN
DMA 1 Package End Transfer Interrupt Enable.
5 R/W 0x0
0: Disable
1: Enable
DMA1_HLAF_IRQ_EN
DMA 1 Half Package Transfer Interrupt Enable.
4 R/W 0x0
0: Disable
1: Enable.
3 / / /
DMA0_QUEUE_IRQ_EN
DMA 0 Queue End Transfer Interrupt Enable.
2 R/W 0x0
0: Disable
1: Enable
DMA0_PKG_IRQ_EN
DMA 0 Package End Transfer Interrupt Enable.
1 R/W 0x0
0: Disable
1: Enable
DMA0_HLAF_IRQ_EN
0 R/W 0x0 DMA 0 Half Package Transfer Interrupt Enable.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 210
System
0: Disable
1: Enable
0: Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 211
System
1: Enable
DMA9_PKG_IRQ_EN
DMA 9 Package End Transfer Interrupt Enable.
5 R/W 0x0
0: Disable
1: Enable
DMA9_HLAF_IRQ_EN
DMA 9 Half package Transfer Interrupt Enable.
4 R/W 0x0
0: Disable
1: Enable
3 / / /
DMA8_QUEUE_IRQ_EN
DMA 8 Queue End Transfer Interrupt Enable.
2 R/W 0x0
0: Disable
1: Enable
DMA8_PKG_IRQ_EN
DMA 8 Package End Transfer Interrupt Enable.
1 R/W 0x0
0: Disable
1: Enable
DMA8_HLAF_IRQ_EN
DMA 8 Half Package Transfer Interrupt Enable.
0 R/W 0x0
0: Disable
1: Enable
0: No effect
1: Pending.
DMA7_PKG_IRQ_ PEND
DMA 7 Package End Transfer Interrupt Pending.
29 R/W1C 0x0 Setting 1 to the bit will clear it.
0: No effect
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 212
System
1: Pending.
DMA7_HLAF_IRQ_PEND.
DMA 7 Half Package Transfer Interrupt Pending.
28 R/W1C 0x0 Setting 1 to the bit will clear it.
0: No effect
1: Pending.
27 / / /
DMA6_QUEUE_IRQ_PEND.
DMA 6 Queue End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
26 R/W1C 0x0
0: No effect
1: Pending.
DMA6_PKG_IRQ_ PEND
DMA 6 Package End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
25 R/W1C 0x0
0: No effect
1: Pending.
DMA6_HLAF_IRQ_PEND.
DMA 6 Half Package Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
24 R/W1C 0x0
0: No effect
1: Pending.
23 / / /
DMA5_QUEUE_IRQ_PEND.
DMA 5 Queue End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
22 R/W1C 0x0
0: No effect
1: Pending.
DMA5_PKG_IRQ_ PEND
DMA 5 Package End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
21 R/W1C 0x0
0: No effect
1: Pending.
DMA5_HLAF_IRQ_PEND.
DMA 5 Half Package Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
20 R/W1C 0x0
0: No effect
1: Pending.
19 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 213
System
DMA4_QUEUE_IRQ_PEND.
DMA 4 Queue End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
18 R/W1C 0x0
0: No effect
1: Pending.
DMA4_PKG_IRQ_ PEND
DMA 4 Package End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
17 R/W1C 0x0
0: No effect
1: Pending.
DMA4_HLAF_IRQ_PEND.
DMA 4 Half Package Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
16 R/W1C 0x0
0: No effect
1: Pending.
15 / / /
DMA3_QUEUE_IRQ_PEND.
DMA 3 Queue End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
14 R/W1C 0x0
0: No effect
1: Pending.
DMA3_PKG_IRQ_ PEND
DMA 3 Package End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
13 R/W1C 0x0
0: No effect
1: Pending.
DMA3_HLAF_IRQ_PEND.
DMA 3 Half Package Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
12 R/W1C 0x0
0: No effect
1: Pending.
11 / / /
DMA2_QUEUE_IRQ_PEND.
DMA 2 Queue End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
10 R/W1C 0x0
0: No effect
1: Pending.
9 R/W1C 0x0 DMA2_PKG_IRQ_ PEND
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 214
System
0: No effect
1: Pending.
DMA2_HLAF_IRQ_PEND.
DMA 2 Half Package Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
8 R/W1C 0x0
0: No effect
1: Pending.
7 / / /
DMA1_QUEUE_IRQ_PEND.
DMA 1 Queue End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
6 R/W1C 0x0
0: No effect
1: Pending.
DMA1_PKG_IRQ_ PEND
DMA 1 Package End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
5 R/W1C 0x0
0: No effect
1: Pending.
DMA1_HLAF_IRQ_PEND.
DMA 1 Half Package Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
4 R/W1C 0x0
0: No effect
1: Pending.
3 / / /
DMA0_QUEUE_IRQ_PEND.
DMA 0 Queue End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
2 R/W1C 0x0
0: No effect
1: Pending.
DMA0_PKG_IRQ_ PEND
DMA 0 Package End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
1 R/W1C 0x0
0: No effect
1: Pending.
DMA0_HLAF_IRQ_PEND.
0 R/W1C 0x0
DMA 0 Half Package Transfer Interrupt Pending.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 215
System
0: No effect
1: Pending.
0: No effect
1: Pending
DMA11_PKG_IRQ_PEND
DMA 11 Package End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
13 R/W1C 0x0
0: No effect
1: Pending
DMA11_HLAF_IRQ_PEND.
DMA 11 Half Package Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
12 R/W1C 0x0
0: No effect
1: Pending
11 / / /
DMA10_QUEUE_IRQ_PEND.
DMA 10 Queue End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
10 R/W1C 0x0
0: No effect
1: Pending
DMA10_PKG_IRQ_ PEND
DMA 10 Package End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
9 R/W1C 0x0
0: No effect
1: Pending
DMA10_HLAF_IRQ_PEND.
8 R/W1C 0x0 DMA 10 Half Package Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 216
System
0: No effect
1: Pending
7 / / /
DMA9_QUEUE_IRQ_PEND.
DMA 9 Queue End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
6 R/W1C 0x0
0: No effect
1: Pending
DMA9_PKG_IRQ_ PEND
DMA 9 Package End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
5 R/W1C 0x0
0: No effect
1: Pending
DMA9_HLAF_IRQ_PEND.
DMA 9 Half Package Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
4 R/W1C 0x0
0: No effect
1: Pending
3 / / /
DMA8_QUEUE_IRQ_PEND.
DMA 8 Queue End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
2 R/W1C 0x0
0: No effect
1: Pending
DMA8_PKG_IRQ_ PEND
DMA 8 Package End Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
1 R/W1C 0x0
0: No effect
1: Pending
DMA8_HLAF_IRQ_PEND.
DMA 8 Half Package Transfer Interrupt Pending.
Setting 1 to the bit will clear it.
0 R/W1C 0x0
0: No effect
1: Pending
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 217
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 218
System
DMA3_SECURE.
DMA Channel 3 Security.
3 R/W 0x0
0: Secure
1: Non-secure
DMA2_SECURE.
DMA Channel 2 Security.
2 R/W 0x0
0: Secure
1: Non-secure
DMA1_SECURE.
DMA Channel 1 Security.
1 R/W 0x0
0: Secure
1: Non-secure
DMA0_SECURE.
DMA Channel 0 Security.
0 R/W 0x0
0: Secure
1: Non-secure
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 219
System
30 R 0x0
0:Empty
1:Not Empty
29:12 / / /
DMA11_STATUS
DMA Channel 11 Status.
11 R 0x0
0: Idle
1: Busy
DMA10_STATUS
DMA Channel 10 Status.
10 R 0x0
0: Idle
1: Busy
DMA9_STATUS
DMA Channel 9 Status.
9 R 0x0
0: Idle
1: Busy
DMA8_STATUS
DMA Channel 8 Status.
8 R 0x0
0: Idle
1: Busy
DMA7_STATUS
DMA Channel 7 Status.
7 R 0x0
0: Idle
1: Busy
DMA6_STATUS
DMA Channel 6 Status.
6 R 0x0
0: Idle
1: Busy
DMA5_STATUS
DMA Channel 5 Status.
5 R 0x0
0: Idle
1: Busy
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 220
System
DMA4_STATUS
DMA Channel 4 Status.
4 R 0x0
0: Idle
1: Busy.
DMA3_STATUS
DMA Channel 3 Status.
3 R 0x0
0: Idle
1: Busy.
DMA2_STATUS
DMA Channel 2 Status.
2 R 0x0
0: Idle,
1: Busy.
DMA1_STATUS
DMA Channel 1 Status.
1 R 0x0
0: Idle,
1: Busy.
DMA0_STATUS
DMA Channel 0 Status.
0 R 0x0
0: Idle,
1: Busy.
Offset: 0x0100+0x0004+N*0x0040
Register Name: DMA_PAU_REG
(N=0~11)
Bit Read/Write Default/Hex Description
31:1 / / /
0 R/W 0x0 DMA_PAUSE.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 221
System
0: Resume Transferring,
1: Pause Transferring.
Offset: 0x0100+0x0008+N*0x0040
Register Name: DMA_DESC_ADDR_REG
(N=0~11)
Bit Read/Write Default/Hex Description
DMA_DESC_ADDR
31:0 R/W 0x0 DMA Channel Descriptor Address.
The Descriptor Address must be word-aligned.
Offset: 0x0100+0x000C+N*0x0040
Register Name: DMA_CFG_REG
(N=0~11)
Bit Read/Write Default/Hex Description
31:27 / / /
DMA_DEST_DATA_WIDTH.
DMA Destination Data Width.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 222
System
15:11 / / /
DMA_SRC_DATA_WIDTH.
DMA Source Data Width.
4.11.5.12. DMA Channel Current Source Address Register (Default Value: 0x0000_0000)
Offset: 0x0100+0x0010+N*0x0040
Register Name: DMA_CUR_SRC_REG
(N=0~11)
Bit Read/Write Default/Hex Description
DMA_CUR_SRC.
31:0 R 0x0
DMA Channel Current Source Address, read only.
4.11.5.13. DMA Channel Current Destination Address Register (Default Value: 0x0000_0000)
Offset: 0x0100+0x0014+N*0x0040
Register Name: DMA_CUR_DEST_REG
(N=0~11)
Bit Read/Write Default/Hex Description
DMA_CUR_DEST.
31:0 R 0x0
DMA Channel Current Destination Address, read only.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 223
System
4.11.5.14. DMA Channel Byte Counter Left Register (Default Value: 0x0000_0000)
Offset: 0x0100+0x0018+N*0x0040
Register Name: DMA_BCNT_LEFT_REG
(N=0~11)
Bit Read/Write Default/Hex Description
31:25 / / /
DMA_BCNT_LEFT.
24:0 R 0x0
DMA Channel Byte Counter Left, read only.
Offset: 0x0100+0x001C+N*0x0040
Register Name: DMA_PARA_REG
(N=0~11)
Bit Read/Write Default/Hex Description
31:8 / / /
WAIT_CYC.
7:0 R 0x0
Wait Clock Cycles n.
Offset: 0x0100+0x0028+N*0x0040
Register Name: DMA_MODE_REG
(N=0~11)
Bit Read/Write Default/Hex Description
31:4 / / /
DMA_DST_MODE.
3 R/W 0x0
0: Wait mode.
1: Handshake mode.
DMA_SRC_MODE.
2 R/W 0x0
0: Wait mode.
1: Handshake mode.
1:0 / / /
Offset: 0x0100+0x002C+N*0x0040
Register Name: DMA_FDESC_ADDR_REG
(N=0~11)
Bit Read/Write Default/Hex Description
DMA_FDESC_ADDR.
31:0 R 0x0 This register is used to store the former value of DMA Channel Descriptor
Address Register.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 224
System
Offset: 0x0100+0x0030+N*0x0040
Register Name: DMA_PKG_NUM_REG
(N=0~11)
Bit Read/Write Default/Hex Description
DMA_PKG_NUM.
31:0 R 0x0 This register will record the number of packages which has been completed
in one transmission.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 225
System
4.12. GIC
36 / 0x0090 /
37 / 0x0094 /
38 TWI 0 0x0098 TWI 0 interrupt
39 TWI 1 0x009C TWI 1 interrupt
40 TWI 2 0x00A0 TWI 2 interrupt
41 / 0x00A4 /
42 / 0x00A8 /
43 PA_EINT 0x00AC PA interrupt
44 OWA 0x00B0 OWA interrupt
45 I2S/PCM-0 0x00B4 I2S/PCM-0 interrupt
46 I2S/PCM-1 0x00B8 I2S/PCM-1 interrupt
47 I2S/PCM-2 0x00BC I2S/PCM-2 interrupt
48 / 0x00C0 /
49 PF_EINT 0x00C4 PF_EINT interrupt
50 Timer 0 0x00C8 Timer 0 interrupt
51 Timer 1 0x00CC Timer 1 interrupt
52 / 0x00D0 /
53 / 0x00D4 /
54 / 0x00D8 /
55 PG_EINT 0x00DC PG_EINT interrupt
56 / 0x00E0 /
57 Watchdog 0x00E4 Watchdog interrupt
58 / 0x00E8 /
59 / 0x00EC /
60 / 0x00F0 /
61 Audio Codec 0x00F4 Audio Codec interrupt
62 KEYADC 0x00F8 KEYADC interrupt
63 THS 0x00FC Thermal Sensor interrupt
64 External NMI 0x0100 External Non-Mask Interrupt
65 R_timer 0 0x0104 R_timer 0 interrupt
66 R_timer 1 0x0108 R_timer 1 interrupt
67 / 0x010C /
68 R_watchdog 0x0110 R_watchdog interrupt
69 R_CIR-RX 0x0114 R_CIR-RX interrupt
70 R_UART 0x0118 R_UART interrupt
71 / 0x011C /
72 R_Alarm 0 0x0120 R_Alarm 0 interrupt
73 R_Alarm 1 0x0124 R_Alarm 1 interrupt
74 R_Timer 2 0x0128 R_timer 2 interrupt
75 R_Timer 3 0x012C R_timer 3 interrupt
76 R_TWI 0x0130 R_TWI interrupt
77 R_PL_EINT 0x0134 R_PL_EINT interrupt
78 R_TWD 0x0138 R_TWD interrupt
79 / 0x013C /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 227
System
80 / 0x0140 /
81 M-box 0x0144 Message-box interrupt
82 DMA 0x0148 DMA channel interrupt
83 HS Timer 0x014C HS Timer interrupt
84 / 0x0150 /
85 / 0x0154 /
86 / 0x0158 /
87 / 0x015C /
88 SMC 0x0160 SMC interrupt
89 / 0x0164 /
90 VE 0x0168 VE interrupt
91 / 0x016C /
92 SMHC 0 0x0170 SD/MMC Host Controller 0 interrupt
93 SMHC 1 0x0174 SD/MMC Host Controller 1 interrupt
94 SMHC 2 0x0178 SD/MMC Host Controller 2 interrupt
95 / 0x017C /
96 / 0x0180 /
97 SPI 0 0x0184 SPI 0 interrupt
98 SPI 1 0x0188 SPI 1 interrupt
99 / 0x018C /
100 / 0x0190 /
101 DRAM_MDFS 0x0194 DRAM_MDFS interrupt
102 NDFC 0x0198 NAND Flash Controller interrupt
103 USB-OTG_Device 0x019C USB-OTG_Device interrupt
104 USB-OTG_EHCI0 0x01A0 USB-OTG_EHCI0 interrupt
105 USB-OTG_OHCI0 0x01A4 USB-OTG_OHCI0 interrupt
106 USB-EHCI1 0x01A8 USB-EHCI1 interrupt
107 USB-OHCI1 0x01AC USB-OHCI1 interrupt
108 USB-EHCI2 0x01B0 USB-EHCI2 interrupt
109 USB-OHCI2 0x01B4 USB-OHCI2 interrupt
110 USB-EHCI3 0x01B8 USB-EHCI3 interrupt
111 USB-OHCI3 0x01BC USB-OHCI3 interrupt
112 CE_S 0x01C0 CE_S interrupt
113 TSC 0x01C4 TSC interrupt
114 EMAC 0x01C8 EMAC interrupt
115 SCR0 0x01CC SCR0 interrupt
116 CSI 0x01D0 CSI interrupt
117 CSI_CCI 0x01D4 CSI_CCI interrupt
118 TCON0 0x01D8 TCON0 Controller interrupt
119 TCON1 0x01DC TCON1 Controller interrupt
120 HDMI 0x01E0 HDMI interrupt
121 SCR1 0x01E4 SCR1 interrupt
122 / 0x01E8 /
123 / 0x01EC /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 228
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 229
System
4.13.1. Overview
The MSGBox-interrupt mechanism allows the software to establish a communication channel between the two users
through a set of registers and associated interrupt signals by sending or receiving messages.
Features:
Two users for Message Box instance(User0 for CPUS and User1 for CPU0/CPU1)
Eight Message Queues for the MSGBox instance
Each of Queues could be configured as transmitter or receiver for user
Two interrupts (one per user ) for the MSGBox instance
Register polling for the MSGBox instance
32-bit message width
Four-message FIFO depth for each message queue
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 230
System
MSGBox
MSGBOX_CTRL_REG0
MSGBOX_CTRL_REG1
For user0
MSGBOX_IRQ_EN_REG_0
MSGBOX_IRQ_STATUS_REG_0
For user1
MSGBOX_IRQ_EN_REG_1
USER0
MSGBOX_IRQ_STATUS_REG_1 USER1
MSGBOX_MSG_STATUS_REG_M
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 231
System
START
As a transmitter As a receiver
Enable the
RECEPTION IRQ
Y
N
Read the MSG REG
to fetch the message
FINISH FINISH
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 232
System
To transmit messages from a user to the other user through any Message Queue, set the corresponding bit in the
MSGBOX_CTRL_REG0/MSGBOX_CTRL_REG1 register.
When a 32-bit message is written to the MSGBOXN_MSG_REG register (N is the message queue number, N=0~7), the
message is appended into the FIFO queue. This queue holds 4 messages. If the queue is full, the message is discarded.
The receiver user could read the MSGBOXN_MSG_REG register to retrieve a message from the corresponding Message
Queue FIFO.
The transmit interrupt might be used when the initial MSGBox status indicates that the Message Queue is full. In this
case, the sender can enable the corresponding MSGBOXU_IRQ_EN_REG interrupt for the user. This allows the user to
be notified by interrupt when the message queue is not full.
An interrupt request allows the user of the MSGBox to be notified when a new message is received or when the
message queue is not full.
An event can generate an interrupt request when enable the corresponding bit in the MSGBOXU_IRQ_EN_REG (U is the
user number, U=0~1) register. Events are reported in the appropriate MSGBOXU_IRQ_STATUS_REG register.
An event stops generating interrupt requests when disable the corresponding bit in the MSGBOXU_IRQ_EN_REG
register.
In case of the MSGBOXU_IRQ_STATUS_REG register, the event is reported in the corresponding bit even if the interrupt
request generation is disabled for this event.
0x0040+N*0x0020
MSGBOXU_IRQ_EN_REG (N=0,1) IRQ Enable for User U
0x0050+N*0x0020
MSGBOXU_IRQ_STATUS_REG (N=0,1) IRQ Status for User U
0x0100+N*0x0004
MSGBOXN_FIFO_STATUS_REG (N = 0~7) FIFO Status for Message Queue N
0x0140+N*0x0004
MSGBOXN_MSG_STATUS_REG (N = 0~7) Message Status for Message Queue N
0x0180+N*0x0004
MSGBOXN_MSG_REG (N = 0~7) Message Register for Message Queue N
0: user0
1: user1
11:9 / / /
RECEPTION_MQ1.
Message Queue 1 is a receiver of user u.
8 R/W 0x0
0: user0
1: user1
7:5 / / /
TRANSMIT_MQ0.
Message Queue 0 is a transmitter of user u.
4 R/W 0x1
0: user0
1: user1
3:1 / / /
RECEPTION_MQ0.
Message Queue 0 is a receiver of user u.
0 R/W 0x0
0: user0
1: user1
0: user0
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 235
System
1: user1
19:17 / / /
RECEPTION_MQ6.
Message Queue 6 is a receiver of user u.
16 R/W 0x0
0: user0
1: user1
15:13 / / /
TRANSMIT_MQ5
Message Queue 5 is a transmitter of user u.
12 R/W 0x1
0: user0
1: user1
11:9 / / /
RECEPTION_MQ5.
Message Queue 5 is a receiver of user u.
8 R/W 0x0
0: user0
1: user1
7:5 / / /
TRANSMIT_MQ4.
Message Queue 4 is a transmitter of user u.
4 R/W 0x1
0: user0
1: user1
3:1 / / /
RECEPTION_MQ4.
Message Queue 4 is a receiver of user u.
0 R/W 0x0
0: user0
1: user1
15 R/W 0x0
0: Disable
1: Enable (It will notify user u by interrupt when Message Queue 7 is not full.)
RECEPTION_MQ7_IRQ_EN.
14 R/W 0x0
0: Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 236
System
1: Enable (It will notify user u by interrupt when Message Queue 7 has
received a new message.)
TRANSMIT_MQ6_IRQ_EN.
13 R/W 0x0
0: Disable
1: Enable (It will notify user u by interrupt when Message Queue 6 is not full.)
RECEPTION_MQ6_IRQ_EN.
11 R/W 0x0
0: Disable
1: Enable (It will notify user u by interrupt when Message Queue 5 is not full.)
RECEPTION_MQ5_IRQ_EN.
9 R/W 0x0
0: Disable
1: Enable (It will notify user u by interrupt when Message Queue 4 is not full.)
RECEPTION_MQ4_IRQ_EN.
7 R/W 0x0
0: Disable
1: Enable (It will notify user u by interrupt when Message Queue 3 is not full.)
RECEPTION_MQ3_IRQ_EN.
5 R/W 0x0
0: Disable
1: Enable (It will notify user u by interrupt when Message Queue 2 is not full.)
RECEPTION_MQ2_IRQ_EN.
4 R/W 0x0
0: Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 237
System
1: Enable (It will notify user u by interrupt when Message Queue 2 has
received a new message.)
TRANSMIT_MQ1_IRQ_EN.
3 R/W 0x0
0: Disable
1: Enable (It will notify user u by interrupt when Message Queue 1 is not full.)
RECEPTION_MQ1_IRQ_EN.
1 R/W 0x0
0: Disable
1: Enable (It will notify user u by interrupt when Message Queue 0 is not full.)
RECEPTION_MQ0_IRQ_EN.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 238
System
1: Pending. This bit will be pending for user u when Message Queue 6 has
received a new message. Setting 1 to this bit will clear it.
TRANSMIT_MQ5_IRQ_PEND.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 239
System
1: Pending. This bit will be pending for user u when Message Queue 1 is not
full. Setting 1 to this bit will clear it.
RECEPTION_MQ1_IRQ_PEND.
This FIFO status register has the status related to the message queue.
2:0 R 0x0
000: There is no message in the message FIFO queue.
001: There is 1 message in the message FIFO queue.
010: There are 2 messages in the message FIFO queue.
011: There are 3 messages in the message FIFO queue.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 240
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 241
System
4.14. Spinlock
4.14.1. Overview
Spinlock provides hardware assistance for synchronizing the processes running on multiple processors in the device.
The SpinLock implements thirty-two 32-bit spinlocks (or hardware semaphores), which provides an efficient way to
perform a lock operation of a device resource using a single read access, and avoid the need for a read-modify-write
bus transfer that not all the programmable cores are capable of.
Spinlocks are present to solve the need for synchronization and mutual exclusion between heterogeneous processors
and those not operating under a single, shared operating system. There is no alternative mechanism to accomplish
these operations between processors in separate subsystems. However, Spinlocks do not solve all system
synchronization issues. They have limited applicability and should be used with care to implement higher level
synchronization protocols.
A spinlock is appropriate for mutual exclusion for access to a shared data structure. It should be used only when:
1) The time to hold the lock is predictable and small (for example, a maximum hold time of less than 200 CPU cycles
may be acceptable).
2) The locking task can not be preempted, suspended, or interrupted while holding the lock (this would make the
hold time large and unpredictable).
3) The lock is lightly contended, that is the chance of any other process (or processor) trying to acquire the lock while
it is held is small.
If the conditions are not met, then a spinlock is not a good candidate. One alternative is to use a spinlock for critical
section control (engineered to meet the conditions) to implement a higher level semaphore that can support
preemption, notification, timeout or other higher level properties.
Features:
Spinlock module includes 32 spinlocks
Two kinds of status of lock register: TAKEN and NOT TAKEN
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 242
System
Start
N Take a Lock
Free a Lock
SPINLOCK_LOCK_REG_i[0]=0
End
Read: 0
Write 1
Reset
Every lock register has two kinds of states: TAKEN(locked) or NOT TAKEN(Unlocked). Only read-0-access and
write-0-access could change the state of lock register and the other accesses have no effect. Just 32-bit read and write
are supported to access all lock registers.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 243
System
Spinlock clock gating should be open before using it. Setting the bit[22] of Bus Clock Gating Register1 to 1 could
activate Spinlock and then de-asserting its software reset. Setting the bit[22] of Bus Software Reset Register 1 to 1
could de-assert the software reset of Spinlock. If it is no need to use spinlock, both the gating bit and software reset bit
should be set 0.
Checking out Spinlock Register Status is necessary when a processor would like to take a spinlock. This register stores
the status of all 32 lock registers: TAKEN or NOT TAKEN(free).
In order to request to take a spinlock, a processor has to do a read-access to the corresponding lock register. If lock
register returns 0, the processor takes this spinlock. And if lock register returns 1, the processor must retry.
Writing 0 to a lock register frees the corresponding spinlock. If the lock register is not taken, write-access has no effect.
For a taken spinlock, every processor has the privilege to free this spinlock. But it is suggested that the processor which
has taken the spinlock free it for strictness.
Take CPU0's synchronization with CPUS with Spinlock0 for an example, CPU0 takes the spinlock0 firstly in the instance
CPU0
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 244
System
CPUS
Step 1: CPU0 has taken spinlock0, CPUS waits for CPU0 freeing spinlock0
while(readl(SPINLOCK_STATUS_REG) == 1); // CPUS waits for CPU0 freeing spinlock0
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 245
System
Read 0x0: The lock was previously Not Taken (free).The requester is
0 R/W 0x0 granted the lock.
Write 0x0: Set the lock to Not Taken (free).
Read 0x1: The lock was previously Taken. The requester is not granted
the lock and must retry.
Write 0x1: No update to the lock value.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 246
System
4.15.1. Overview
The Crypto Engine(CE) is one encrypt/decrypt function accelerator. It is suitable for a variety of applications. It can
support encryption ,decryption and calculate the hash value. Several algorithm modes are supported by the Crypto
Engine. The Crypto Engine has a special internal DMA(IDMA) controller to transfer data .
The Crypto Engine can encrypt or decrypt a large amount of data. And it can encrypt and decrypt one or more blocks at
one time.
Features:
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 247
System
AHB
cr
task
DMA
MBUS
Crypto Engine task deccriptor is 44*4 Byte memory. Software make request through task descriptor, providing algorithm
type, mode, key address, source/destination address and size, etc. The task descriptor is as follows.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 248
System
src adr7 src adr7
src len7 src len7
dst adr0 dst adr0
dst len0 dst len0
dst adr7 dst adr7
dst len7 dst len7
next descriptor(task1) next descriptor(task2)
reserved[3] reserved[3]
Bit Description
INTERRUPT_ENABLE
Interrupt enable for current task
31
0: Disable interrupt
1: Enable interrupt
30:17 /
IV_MODE
IV mode for SHA-1/SHA-224/SHA-256 /MD5 or constants
16
0: Use initial constants defined in FIPS-180
1: Use input iv
HMAC_PLAINTEXT_LAST_FLAG
15
0: Not the last HMAC plaintext package
1: The last HMAC plaintext package
14:9 /
OP_DIR
Algorithm Operation Direction
8
0: Encryption
1: Decryption
7 /
6:0 ALGORITHM_TYPE
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 249
System
0: AES
1: DES
2: Triple DES (3DES)
3~15: Reserved
16: MD5
17: SHA-1
18: SHA-224
19: SHA-256
20: Reserved
21: Reserved
22: HMAC-SHA1
23: HMAC-SHA256
24~31: Reserved
32: RSA
33~47: Reserved
48: TRNG
49: PRNG
50~62: Reserved
Bit Description
31:24 /
23:20 KEY_SELECT
key select for AES
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 250
System
00: 128-bit
01: 192-bit
10: 256-bit
11: Reserved
Bit Description
31 /
RSA_WIDTH
RSA Pubic Modulus Width
Basically, there are 4 steps for one task handling from software. Firstly, software should configure task descriptor in
memory, including all fields in descriptor. Channel id corresponds to one channel in CE, from 0 to 3 for secure and non
secure world respectively. According to algorithm type, software should set the fields in common control, symmetric
control, asymmetric control, then provide key/iv/ctr address and the data length of this task. Source and destination sg
address and size are set based on upper application. If there is another task concatenating after this task, then set its
descriptor address at next descriptor field. Secondly, software should set registers, including task descriptor address,
interrupt control. Thirdly, software read load register to ensure that the bit0 is zero, then starts request by pulled up the
bit0 of the load register. Lastly, wait interrupt status.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 251
System
Data length field in task descriptor has different meaning for different algorithms. For AES-CTS algorithms mode data
length field indicates valid source data byte number, for others indicate source data words number. For PRNG, data
length should be 5 words aligned, For TRNG should be 8 words aligned. Data size in source and destination sg is as
words, whose value should corresponds with data length field, or else CE will report error and stop execution.
When CPU issues request to CE module, CE module will register CPUs secure mode state. When executing this request,
this state bit works as access flag for inner and system resource. For HUK/RSSK/SSK from SID, only secure mode can
access, or else these keys will be used as 0. For access to SID and keysram module through AHB bus, only secure mode
can success, or else will read 0 or can not write. When issuing MBUS read and write requests, CE will use this secure
state bit as mprot signal, so certain secure state accesses corresponding memory space, namely secure request can
access secure and non secure space, but non secure request only can access non secure space.
CE module includes error detection for task configuration, data computing error, and authentication invalid. When
algorithm type in task description is read into module, CE will check if this type is supported through checking algorithm
type field in common ctrl. If type value is out of support scope, CE will issue interrupt signal and set error state. Each
type has certain input and output data size. After getting task descriptor, input size and output size configuration will be
checked to avoid size error. If size configuration is wrong, CE will issue interrupt signal and set error state. To protect
keys would be put into keysram from disclose, if request using RSSK is for AES decryption and destination address is not
in keysram space, CE would not execute this task. It will issue interrupt signal and set error state.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 252
System
CE_NS 0x01C15000
CE_S 0x01C15800
4.15.5.1. Crypto Engine Task Descriptor Address Register (Default Value: 0x0000_0000)
0: Not finished
3:0 R/W1C 0x0
1: Finished
1:0 R 0x0
00: Task channel0
01: Task channel1
10: Task channel2
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 254
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 255
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 256
System
4.16. Security ID
4.16.1. Overview
There is one 2Kbits on chip EFUSE, which provides 128-bit, 64-bit and one 32-bit electrical fuses for security application.
The users can use them as root key, security JTAG key and other applications.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 257
System
4.17.1. Overview
You can configure the SMC to provide the optimum security address region control functions required for your intended
application.
Features:
Enables you to program security access permissions each address region.
Permits the transfer of data between master and slave only if the security status of the AXI transaction matches
the security settings of the memory region it addresses.
By default, the SMC performs read or write speculative that means it forwards an AXI transaction address to a slave,
before it verifies that the AXI transaction is permitted to read address or write address respectively.
The SMC only permits the transfer of data between its AXI bus interfaces, after verified that the read or write access is
permitted respectively. If the verification fails, then it prevents the transfer of data between the master and slave as
denied AXI transactions.
When the speculative accesses are disabled, the SMC verifies the permissions of the access before it forwards the
access to the salve. If the SMC:
Permits the access, it commences an AXI transaction to the slave, and it adds one clock latency.
Denies the access, it prevents the transfer of data between the master and slave. In this situation, the slave is
unaware when the SMC prevents the master from accessing the slave.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 258
System
Non-secure G.NS.M only can read data from NSZ and write data into NSZ
Zone
D.NS.M can read data from NSZ and DRM, but only can write data into DRM
DRM Secure Zone
S.M can read data from the whole DRAM SPACE
DRAM SPACE
SZ SZ SZ
ID Master ID Master
0 CPU 13 CSI
1 GPU0 14 NDFC
2 CPUS 15 Crypto Engine
3 ATH (test interface for AHB) 16 DE_RT-MIXER0
4 USB0 17 DE_RT-MIXER1
5 MSTG0 (SD/eMMC0) 18 DE_RT-WB
6 MSTG1 (SD/eMMC1) 19
7 MSTG2 (SD/eMMC2) 20 USB3
8 USB1 21 TSC
9 USB2 22 DE Interlace
10 EMAC 23
11 DMA 24
12 VE 25 GPU1
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 259
System
SPN Field Secure Read Secure Write Non-secure Read Non-secure Write
4b0000 No No No No
4b0100 No Yes No No
4b0001, 4b0101 No Yes No Yes
4b1000 Yes No No No
4b0010, 4b1010 Yes No Yes No
4b1100 Yes Yes No No
4b1001, 4b1101 Yes Yes No Yes
4b0110, 4b1110 Yes Yes Yes No
4b0011-4b1111 Yes Yes Yes Yes
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 260
System
If you enable security inversion, the SMC permits you to program any combination of security permissions as Table 4-6
shows.
SPN Field Secure Read Secure Write Non-secure Read Non-secure Write
4b0000 No No No No
4b0001 No No No Yes
4b0010 No No Yes No
4b0011 No No Yes Yes
4b0100 No Yes No No
4b0101 No Yes No Yes
4b0110 No Yes Yes No
4b0111 No Yes Yes Yes
4b1000 Yes No No No
4b1001 Yes No No Yes
4b1010 Yes No Yes No
4b1011 Yes No Yes Yes
4b1100 Yes Yes No No
4b1101 Yes Yes No Yes
4b1110 Yes Yes Yes No
4b1111 Yes Yes Yes Yes
13:8 R 0x1F
000000~011110 : Reserved.
011111: 32-bit
111111: 64-bit
7:4 / / /
REGIONS_RTN.
Returns the number of the regions that the SMC provides.
SMC_INT_RESP.
Control how the SMC uses the bresps[1:0], rresps[1:0], and smc_int signals
when a region permission fails:
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 263
System
0: Bypass Disable
1: Bypass Enable.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 264
System
0: Secure
1: Non-secure.
0: Read access
1: Write access.
23:22 / / /
NON_SECURE.
21 R 0x0
After cleared the interrupt status, this bit indicates whether the first access
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 265
System
0: Secure access
1: Non-secure access
PRIVILEGED.
After clearing the interrupt status, this bit indicates whether the first access
to fail a region permission check was privileged. Read as:
20 R 0x0
0: Unprivileged access.
1: Privileged access
19:0 / / /
23:16 R 0x0
00000000: 1 word length
00001111: 16 words length
15:8 / / /
FAIL_MASTER_ID.
Fail Master ID.
7:0 R 0x0
The value stands for master id, see the Master and Master ID in Table 4-3 for
detail.
address 0x0, the only valid settings for this field are:
17b00100000000000000
17b01000000000000000
17b01100000000000000
17b10000000000000000
17b10100000000000000
17b11000000000000000
17b11100000000000000
14:0 / / /
Note: For region 0, this field is Read Only (RO). The SMC sets the base address of region 0 to 0x0.
The base address should be equal to the DRAM absolute address.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 269
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 270
System
4.18.1. Overview
The Secure Peripherals Controller(SPC) provides a software interface to the protection bits in a secure system of a
TrustZone design. It provides system flexibility that enables to configure different areas of memory as secure or
non-secure.
Features:
It has protection bits to program some areas of memory as secure or nonsecure.
The SPC provides a software interface to set up memory areas as secure or non-secure. There are two ways:
Programmable protection bits that can be allocated to areas of memory as determined by an external decoder
Programmable region size value for use by an AXI TrustZone Memory Adapter.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 271
System
There is one bit of the register for each protection output (See the SPC
Configuration Table in Table 4-7 for detail).
0: No effect
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 272
System
There is one bit of the register for each protection output (See the SPC
Configuration Table in Table 4-7 for detail).
0: No effect
7:0 W 0x0
1: Set decode region to secure.
There is one bit of the register for each protection output (See the SPC
Configuration Table in Table 4-7 for detail).
There is one bit of the register for each protection output (See the SPC
Configuration Table in Table 4-7 for detail).
0: No effect
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 273
System
There is one bit of the register for each protection output (See the SPC
Configuration Table in Table 4-7 for detail).
0: No effect
7:0 W 0x0
1: Set decode region to secure.
There is one bit of the register for each protection output (See the SPC
Configuration Table in Table 4-7 for detail).
There is one bit of the register for each protection output (See the SPC
Configuration Table in Table 4-7 for detail).
0: No effect
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 274
System
There is one bit of the register for each protection output (See the SPC
Configuration Table in Table 4-7 for detail).
0: No effect
7:0 W 0x0
1: Set decode region to secure.
There is one bit of the register for each protection output (See the SPC
Configuration Table in Table 4-7 for detail).
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 275
System
4.19.1. Overview
Thermal sensors have become common elements in wide range of modern system on chip (SOC) platform. Thermal
sensors are used to constantly monitor the temperature on the chip.
The Thermal Sensor Controller embeds two thermal sensors, sensor0 for CPU,sensor1 for GPU .Thermal sensors can
generate interrupt to SW to lower temperature via DVFS, on reaching a certain thermal threshold.
Features:
Supports APB 32-bit bus width
Temperature Accuracy : 3 from 0 to +100, 5 from -20 to +125
Power supply voltage:3.3V
Low power dissipation
Periodic temperature measurement
Averaging filter for thermal sensor reading
Supports over-temperature protection interrupt and over-temperature alarm interrupt
Vref
Sensor0 M
Comp
Sensor1
U
X
G DAC
12bit
SAR Logic
12bit
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 276
System
1) Timing must be like this: THERMAL_PER > ACQ1 + ACQ0 + Conversion Time
2) Configure the THS Interrupt Control Register to set the THERMAL_PER and IRQ
3) Configure the Alarm Threshold Control Register and Shutdown Threshold Control Register to set the
ALARM0_T_HOT and SHUT0_T_HOT
4) Configure the THS Control Register0 to set the SENSOR_ACQ0 and enable the sensor
5) THS temperature formula:
When temperature is lower than 70 (THS0_DATA or THS1_DATA is higher than 0x500) , then
When temperature is higher than 70 (THS0_DATA or THS1_DATA is lower than 0x500) , then
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 277
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 278
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 279
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 280
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 282
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 283
System
4.20. KEYADC
4.20.1. Overview
KEYADC is 6-bit resolution ADC for key application. The KEYADC can work up to 250Hz conversion rate.
Features:
Up to 6-bit resolution
Sample rate up to 250Hz
Supports APB 32-bit bus width,reference voltage is 2.2V
Supports interrupt
Supports general key, hold key and already hold key
Supports normal, single and continue work mode
Voltage input range between 0V to 2.2V
KEYADC_IN
Comp
DAC
6bit
SAR Logic
6bit
Table 4-8 describes the external signals of KEYADC. KEYADC pin is the analog input signal.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 284
System
KEYADC has one clock source. Table 4-9 describes the clock source for KEYADC.
(1).Normal Mode
ADC gathers 8 samples,the average of the 8 samples is updated in data register,and the data interrupt sign is enabled.It
is sampled repeatedly according to this mode until ADC stop.
(2).Continue Mode
ADC gathers 8 samples every other 8*(N+1) sample cycle. The average of every 8 samples is updated in the data register,
and the data interrupt sign is enabled. (N is defined in the bit[19:16] of KEYADC_CTRL_REG).
(3).Single Mode
ADC gathers 8 samples, the average of the 8 samples is updated in data register, and the data interrupt sign is enabled,
since then ADC stops sample.
Level A
ADC_IN KEY_DOWN_IRQ
Control HOLD_KEY_IRQ
Level B Logic
ALREADY_HOLD_IRQ
Level A: 2.0V
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 285
System
When ADC_IN signal is less than Level A and Level B, the key down interrupt will generate. When ADC_IN signal is only
less than Level A, the hold key interrupt will generate. When ADC_IN signal is only less than Level B, the already hold
key interrupt will generate.
If ADC_IN signal is less than Level A, and in a certain time range (configurable by LEVEL_A_B_CNT) ADC_IN signal is not
less than Level B, the hold key interrupt will generate. If ADC_IN signal is less than Level A , and in a certain time range
(configurable by LEVEL_A_B_CNT) ADC_IN signal is less than Level B, the key down interrupt will generate . If ADC_IN
signal is less than Level B, and ADC_IN signal is not less than Level A, the already hold key interrupt will generate.
The KEYADC have three modes, Normal ModeSingle Mode and Continue Mode. Normal Mode is that the KEYADC will
report the converted result data all the time when the key is down. Single Mode is that the KEYADC will only report the
first converted result data when the key is down. Continue Mode is that the KEYADC will report the converted result
data every other 8*(N+1) sample when key is down.
The KEYADC supports four sample rate such as 250 Hz125 Hz62.5 Hz and 32.25 Hz, you can configure the value of
KEYADC_SAMPLE_RATE to select the fit sample rate.
(1).The input voltage need be controlled in the range from 0 to LEVELB_VOL (LEVELB_VOL is defined in the bit[5:4] of
KEYADC_CTRL_REG).
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 286
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 287
System
00: 250 Hz
01: 125 Hz
10: 62.5 Hz
11: 32.25 Hz
1 / / /
KEYADC_EN.
KEYADC Enable
0 R/W 0x0
0: Disable
1: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 288
System
Writing 1 to the bit will clear it and its corresponding interrupt if the
interrupt is enabled.
ADC_ALRDY_HOLD_PENDING.
ADC Already Hold Pending Bit
When hold key is in the pull-down state, at this time the general key is pulled
down, then the ADC_ALRDY_HOLD_PENDING bit is set 1 by hardware if the
ADC_ALRDY_HOLD_IRQ_EN bit is enabled.
3 R/W1C 0x0
0: No IRQ
1: IRQ Pending
Writing 1 to the bit will clear it and its corresponding interrupt if the
interrupt is enabled.
ADC_HOLDKEY_PENDING.
ADC Hold Key Pending Bit
When Hold key pull down, the status bit is set and the interrupt line is set if
the corresponding interrupt is enabled.
2 R/W1C 0x0
0: NO IRQ
1: IRQ Pending
Writing 1 to the bit will clear it and its corresponding interrupt if the
interrupt is enabled.
ADC_KEYDOWN_PENDING.
ADC Key Down IRQ Pending Bit
When General key pull down, the status bit is set and the interrupt line is set
if the corresponding interrupt is enabled.
1 R/W1C 0x0
0: No IRQ
1: IRQ Pending
Writing 1 to the bit will clear it and its corresponding interrupt if the
interrupt is enabled.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 289
System
ADC_DATA_PENDING.
ADC Data IRQ Pending Bit
0: No IRQ
0 R/W1C 0x0
1: IRQ Pending
Writing 1 to the bit will clear it and its corresponding interrupt if the
interrupt is enabled.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 290
System
4.21.1. Overview
The chip has 7 ports for multi-functional input/out pins. They are shown below:
Port A(PA): 22 input/output port
Port C(PC): 17 input/output port
Port D(PD): 18 input/output port
Port E(PE) : 16 input/output port
Port F(PF) : 7 input/output port
Port G(PG) : 14 input/output port
Port L(PL) : 12 input/output port
For various system configurations, these ports can be easily configured by software. All these ports can be configured as
GPIO if multiplexed functions are not used. The total 3 group external PIO interrupt sources are supported and interrupt
mode can be configured by software.
000:Input 001:Output
30:28 R/W 0x7
010:SIM0_CLK 011:Reserved
100:Reserved 101:Reserved
110:PA_EINT7 111:IO Disable
27 / / /
PA6_SELECT
000:Input 001:Output
26:24 R/W 0x7
010:SIM0_PWREN 011:PCM0_MCLK
100:Reserved 101:Reserved
110:PA_EINT6 111:IO Disable
23 / / /
PA5_SELECT
000:Input 001:Output
22:20 R/W 0x7
010:UART0_RX 011:PWM0
100:Reserved 101:Reserved
110:PA_EINT5 111:IO Disable
19 / / /
18:16 R/W 0x7 PA4_SELECT
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 292
System
000:Input 001:Output
010:UART0_TX 011:Reserved
100:Reserved 101:Reserved
110:PA_EINT4 111:IO Disable
15 / / /
PA3_SELECT
000:Input 001:Output
14:12 R/W 0x7
010:UART2_CTS 011:JTAG_DI
100:Reserved 101:Reserved
110:PA_EINT3 111:IO Disable
11 / / /
PA2_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:UART2_RTS 011:JTAG_DO
100:Reserved 101:Reserved
110:PA_EINT2 111:IO Disable
7 / / /
PA1_SELECT
000:Input 001:Output
6:4 R/W 0x7
010:UART2_RX 011:JTAG_CK
100:Reserved 101:Reserved
110:PA_EINT1 111:IO Disable
3 / / /
PA0_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:UART2_TX 011:JTAG_MS
100:Reserved 101:Reserved
110:PA_EINT0 111:IO Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 293
System
000:Input 001:Output
22:20 R/W 0x7
010:SPI1_CS 011:UART3_TX
100:Reserved 101:Reserved
110:PA_EINT13 111:IO Disable
19 / /
PA12_SELECT
000:Input 001:Output
18:16 R/W 0x7
010:TWI0_SDA 011:DI_RX
100:Reserved 101:Reserved
110:PA_EINT12 111:IO Disable
15 / /
PA11_SELECT
000:Input 001:Output
14:12 R/W 0x7
010:TWI0_SCK 011:DI_TX
100:Reserved 101:Reserved
110:PA_EINT11 111:IO Disable
11 / / /
PA10_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:SIM0_DET 011:Reserved
100:Reserved 101:Reserved
110:PA_EINT10 111:IO Disable
7 / /
PA9_SELECT
000:Input 001:Output
6:4 R/W 0x7
010:SIM0_RST 011:Reserved
100:Reserved 101:Reserved
110:PA_EINT9 111:IO Disable
3 / /
PA8_SELECT
2:0 R/W 0x7
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 294
System
000:Input 001:Output
010:SIM0_DATA 011:Reserved
100:Reserved 101:Reserved
110:PA_EINT8 111:IO Disable
000:Input 001:Output
22:20 R/W 0x7
010:PCM0_DIN 011:SIM0_VPPPP
100:Reserved 101:Reserved
110:PA_EINT21 111:IO Disable
19 / /
PA20_SELECT
000:Input 001:Output
18:16 R/W 0x7
010:PCM0_DOUT 011:SIM0_VPPEN
100:Reserved 101:Reserved
110:PA_EINT20 111:IO Disable
15 / /
PA19_SELECT
000:Input 001:Output
14:12 R/W 0x7
010:PCM0_CLK 011:TWI1_SDA
100:Reserved 101:Reserved
110:PA_EINT19 111:IO Disable
11 / / /
PA18_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:PCM0_SYNC 011:TWI1_SCK
100:Reserved 101:Reserved
110:PA_EINT18 111:IO Disable
7 / /
PA17_SELECT
000:Input 001:Output
6:4 R/W 0x7
010:OWA_OUT 011:Reserved
100:Reserved 101:Reserved
110:PA_EINT17 111:IO Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 295
System
3 / /
PA16_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:SPI1_MISO 011:UART3_CTS
100:Reserved 101:Reserved
110:PA_EINT16 111:IO Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 297
System
000:Input 001:Output
010:NAND_RB0 011:SDC2_CMD
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
23 / / /
PC5_SELECT
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 298
System
PC0_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:NAND_WE 011:SPI0_MOSI
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
000:Input 001:Output
30:28 R/W 0x7
010:NAND_DQ7 011:SDC2_D7
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
27 / / /
PC14_SELECT
000:Input 001:Output
26:24 R/W 0x7
010:NAND_DQ6 011:SDC2_D6
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
23 / / /
PC13_SELECT
000:Input 001:Output
22:20 R/W 0x7
010:NAND_DQ5 011:SDC2_D5
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
19 / / /
PC12_SELECT
000:Input 001:Output
18:16 R/W 0x7
010:NAND_DQ4 011:SDC2_D4
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
15 / / /
PC11_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:NAND_DQ2 011:SDC2_D2
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
7 / / /
PC9_SELECT
000:Input 001:Output
6:4 R/W 0x7
010:NAND_DQ1 011:SDC2_D1
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
3 / / /
PC8_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:NAND_DQ0 011:SDC2_D0
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
000:Input 001:Output
2:0 R/W 0x7
010:NAND_DQS 011:SDC2_RST
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 300
System
31:0 / / /
000:Input 001:Output
30:28 R/W 0x7
010:RGMII_TXD3/MII_TXD3/RMII_NULL 011:Reserved
100:TS2_D3 101:TS3_CLK
110:Reserved 111:IO Disable
27 / / Reserved
PD6_SELECT
000:Input 001:Output
26:24 R/W 0x7
010:RGMII_NULL/MII_RXERR/RMII_RXER 011:Reserved
100:TS2_D2 101:Reserved
110:Reserved 111:IO Disable
23 / / /
PD5_SELECT
000:Input 001:Output
22:20 R/W 0x7
010:RGMII_RXCTL/MII_RXDV/RMII_CRS_DV 011:Reserved
100:TS2_D1 101:Reserved
110:Reserved 111:IO Disable
19 / / /
PD4_SELECT
18:16 R/W 0x7
000:Input 001:Output
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 302
System
010:RGMII_RXCK/MII_RXCK/RMII_NULL 011:Reserved
100:TS2_D0 101:Reserved
110:Reserved 111:IO Disable
15 / / /
PD3_SELECT
000:Input 001:Output
14:12 R/W 0x7
010:RGMII_RXD0/MII_RXD0/RMII_RXD0 011:Reserved
100:TS2_DVLD 101:Reserved
110:Reserved 111:IO Disable
11 / / /
PD2_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:RGMII_RXD1/MII_RXD1/RMII_RXD1 011:Reserved
100:TS2_SYNC 101:Reserved
110:Reserved 111:IO Disable
7 / / /
PD1_SELECT
000:Input 001:Output
6:4 R/W 0x7
010:RGMII_RXD2/MII_RXD2/RMII_NULL 011:DI_RX
100:TS2_ERR 101:Reserved
110:Reserved 111:IO Disable
3 / / /
PD0_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:RGMII_RXD3/MII_RXD3/RMII_NULL 011:DI_TX
100:TS2_CLK 101:Reserved
110:Reserved 111:IO Disable
000:Input 001:Output
30:28 R/W 0x7
010:RGMII_CLKIN/MII_COL/RMII_NULL 011:Reserved
100:SIM1_RST 101:Reserved
110:Reserved 111:IO Disable
27 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 303
System
PD14_SELECT
000:Input 001:Output
26:24 R/W 0x7
010:RGMII_NULL/MII_TXERR/RMII_NULL 011:Reserved
100:SIM1_DATA 101:Reserved
110:Reserved 111:IO Disable
23 / / /
PD13_SELECT
000:Input 001:Output
22:20 R/W 0x7
010:RGMII_TXCTL/MII_TXEN/RMII_TXEN 011:Reserved
100:SIM1_CLK 101:Reserved
110:Reserved 111:IO Disable
19 / / /
PD12_SELECT
000:Input 001:Output
18:16 R/W 0x7
010:RGMII_TXCK/MII_TXCK/RMII_TXCK 011:Reserved
100:SIM1_PWREN 101:Reserved
110:Reserved 111:IO Disable
15 / / /
PD11_SELECT
000:Input 001:Output
14:12 R/W 0x7
010:RGMII_NULL/MII_CRS/RMII_NULL 011:Reserved
100:TS2_D7 101:TS3_D0
110:Reserved 111:IO Disable
11 / / /
PD10_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:RGMII_TXD0/MII_TXD0/RMII_TXD0 011:Reserved
100:TS2_D6 101:TS3_DVLD
110:Reserved 111:IO Disable
7 / / /
PD9_SELECT
000:Input 001:Output
6:4 R/W 0x7
010:RGMII_TXD1/MII_TXD1/RMII_TXD1 011:Reserved
100:TS2_D5 101:TS3_SYNC
110:Reserved 111:IO Disable
3 / / /
PD8_SELECT
100:TS2_D4 101:TS3_ERR
110:Reserved 111:IO Disable
000:Input 001:Output
6:4 R/W 0x7
010:MDIO 011:Reserved
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
3 / / /
PD16_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:MDC 011:Reserved
100:SIM1_DET 101:Reserved
110:Reserved 111:IO Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 305
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 306
System
000:Input 001:Output
30:28 R/W 0x7
010:CSI_D3 011:TS0_D3
100:TS1_CLK 101:Reserved
110:Reserved 111:IO Disable
27 / / /
PE6_SELECT
000:Input 001:Output
26:24 R/W 0x7
010:CSI_D2 011:TS0_D2
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
23 / / /
PE5_SELECT
000:Input 001:Output
22:20 R/W 0x7
010:CSI_D1 011:TS0_D1
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
19 / / /
PE4_SELECT
000:Input 001:Output
18:16 R/W 0x7
010:CSI_D0 011:TS0_D0
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
15 / / /
PE3_SELECT
000:Input 001:Output
14:12 R/W 0x7
010:CSI_VSYNC 011:TS0_DVLD
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
11 / / /
PE2_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:CSI_HSYNC 011:TS0_SYNC
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 307
System
7 / / /
PE1_SELECT
000:Input 001:Output
6:4 R/W 0x7
010:CSI_MCLK 011:TS0_ERR
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
3 / / /
PE0_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:CSI_PCLK 011:TS0_CLK
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
000:Input 001:Output
30:28 R/W 0x7
010:Reserved 011:SIM1_VPPPP
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
27 / / /
PE14_SELECT
000:Input 001:Output
26:24 R/W 0x7
010:Reserved 011:SIM1_VPPEN
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
23 / / /
PE13_SELECT
000:Input 001:Output
22:20 R/W 0x7
010:CSI_SDA 011:TWI2_SDA
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
19 / / /
PE12_SELECT
100:Reserved 101:Reserved
110:Reserved 111:IO Disable
15 / / /
PE11_SELECT
000:Input 001:Output
14:12 R/W 0x7
010:CSI_D7 011:TS0_D7
100:TS1_D0 101:Reserved
110:Reserved 111:IO Disable
11 / / /
PE10_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:CSI_D6 011:TS0_D6
100:TS1_DVLD 101:Reserved
110:Reserved 111:IO Disable
7 / / /
PE9_SELECT
000:Input 001:Output
6:4 R/W 0x7
010:CSI_D5 011:TS0_D5
100:TS1_SYNC 101:Reserved
110:Reserved 111:IO Disable
3 / / /
PE8_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:CSI_D4 011:TS0_D4
100:TS1_ERR 101:Reserved
110:Reserved 111:IO Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 309
System
31:0 / / /
000:Input 001:Output
26:24 R/W 0x7
010:Reserved 011:Reserved
100:Reserved 101:Reserved
110:PF_EINT6 111:IO Disable
23
PF5_SELECT
000:Input 001:Output
22:20 R/W 0x7
010:SDC0_D2 011:JTAG_CK
100:Reserved 101:Reserved
110:PF_EINT5 111:IO Disable
19 / / /
PF4_SELECT
000:Input 001:Output
18:16 R/W 0x7
010:SDC0_D3 011:UART0_RX
100:Reserved 101:Reserved
110:PF_EINT4 111:IO Disable
15 / / /
PF3_SELECT
000:Input 001:Output
14:12 R/W 0x7
010:SDC0_CMD 011:JTAG_DO
100:Reserved 101:Reserved
110:PF_EINT3 111:IO Disable
11 / / /
PF2_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:SDC0_CLK 011:UART0_TX
100:Reserved 101:Reserved
110:PF_EINT2 111:IO Disable
7 / / /
PF1_SELECT
6:4 R/W 0x7
000:Input 001:Output
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 311
System
010:SDC0_D0 011:JTAG_DI
100:Reserved 101:Reserved
110:PF_EINT1 111:IO Disable
3 / / /
PF0_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:SDC0_D1 011:JTAG_MS
100:Reserved 101:Reserved
110:PF_EINT0 111:IO Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 312
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 313
System
000:Input 001:Output
010:UART1_RX 011: Reserved
100:Reserved 101:Reserved
110:PG_EINT7 111:IO Disable
27 / / /
PG6_SELECT
000:Input 001:Output
26:24 R/W 0x7
010:UART1_TX 011: Reserved
100:Reserved 101:Reserved
110:PG_EINT6 111:IO Disable
23 / / /
PG5_SELECT
000:Input 001:Output
22:20 R/W 0x7
010:SDC1_D3 011:Reserved
100:Reserved 101:Reserved
110:PG_EINT5 111:IO Disable
19 / / /
PG4_SELECT
000:Input 001:Output
18:16 R/W 0x7
010:SDC1_D2 011:Reserved
100:Reserved 101:Reserved
110:PG_EINT4 111:IO Disable
15 / / /
PG3_SELECT
000:Input 001:Output
14:12 R/W 0x7
010:SDC1_D1 011:Reserved
100:Reserved 101:Reserved
110:PG_EINT3 111:IO Disable
11 / / /
PG2_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:SDC1_D0 011:Reserved
100:Reserved 101:Reserved
110:PG_EINT2 111:IO Disable
7 / / /
PG1_SELECT
000:Input 001:Output
6:4 R/W 0x7
010:SDC1_CMD 011:Reserved
100:Reserved 101:Reserved
110:PG_EINT1 111:IO Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 314
System
3 / / /
PG0_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:SDC1_CLK 011:Reserved
100:Reserved 101:Reserved
110:PG_EINT0 111:IO Disable
000:Input 001:Output
22:20 R/W 0x7
010: PCM1_DIN 011: Reserved
100:Reserved 101:Reserved
110:PG_EINT13 111:IO Disable
19 / / /
PG12_SELECT
000:Input 001:Output
18:16 R/W 0x7
010: PCM1_DOUT 011: Reserved
100:Reserved 101:Reserved
110:PG_EINT12 111:IO Disable
15 / / /
PG11_SELECT
000:Input 001:Output
14:12 R/W 0x7
010: PCM1_CLK 011: Reserved
100:Reserved 101:Reserved
110:PG_EINT11 111:IO Disable
11 / / /
PG10_SELECT
000:Input 001:Output
10:8 R/W 0x7
010: PCM1_SYNC 011: Reserved
100:Reserved 101:Reserved
110:PG_EINT10 111:IO Disable
7 / / /
PG9_SELECT
100:Reserved 101:Reserved
110:PG_EINT9 111:IO Disable
3 / / /
PG8_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:UART1_RTS 011: Reserved
100:Reserved 101:Reserved
110:PG_EINT8 111:IO Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 316
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 317
System
0: Disable
1: Enable
[n]
R/W1C 0x0 0: No IRQ pending
(n=0~21)
1: IRQ pending
0: No IRQ pending
1: IRQ pending
Write 1 to clear it
Write 1 to clear it
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 323
System
4.22.1. Overview
The chip has 1 port for multi-functional input/out pins. They are shown below:
Port L(PL):12 input/output port
For various system configurations, these ports can be easily configured by software. All these ports can be configured as
GPIO if multiplexed functions not used. The external PIO interrupt sources are supported and interrupt mode can be
configured by software.
000:Input 001:Output
30:28 R/W 0x7
010:S_JTAG_DI 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT7 111:IO Disable
27 / / /
PL6_SELECT
000:Input 001:Output
26:24 R/W 0x7
010:S_JTAG_DO 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT6 111:IO Disable
23 / / /
PL5_SELECT
000:Input 001:Output
22:20 R/W 0x7
010:S_JTAG_CK 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT5 111:IO Disable
19 / / /
PL4_SELECT
000:Input 001:Output
18:16 R/W 0x7
010:S_JTAG_MS 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT4 111:IO Disable
15 / / /
PL3_SELECT
000:Input 001:Output
14:12 R/W 0x7
010:S_UART_RX 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT3 111:IO Disable
11 / / /
PL2_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:S_UART_TX 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT2 111:IO Disable
7 / / /
PL1_SELECT
6:4 R/W 0x7
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 325
System
000:Input 001:Output
010:S_TWI_SDA 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT1 111:IO Disable
3 / / /
PL0_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:S_TWI_SCK 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT0 111:IO Disable
000:Input 001:Output
14:12 R/W 0x7
010:S_CIR_RX 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT11 111:IO Disable
11 / / /
PL10_SELECT
000:Input 001:Output
10:8 R/W 0x7
010:S_PWM 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT10 111:IO Disable
7 / / /
PL9_SELECT
000:Input 001:Output
6:4 R/W 0x7
010:Reserved 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT9 111:IO Disable
3 / / /
PL8_SELECT
000:Input 001:Output
2:0 R/W 0x7
010:Reserved 011:Reserved
100:Reserved 101:Reserved
110:S_PL_EINT8 111:IO Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 326
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 327
System
[n]
R/W 0x0 0: No IRQ pending
(n=0~11)
1: IRQ pending
Write 1 to clear
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 329
System
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 330
Memory
Chapter 5 Memory
This section describes the H5 memory from three aspects:
DRAMC
NDFC
SMHC
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 331
Memory
5.1.1. Overview
The SDRAM Controller (DRAMC) provides a simple, flexible, burst-optimized interface to the industy-standard
DDR3/DDR3L SDRAM. It supports up to a 24G bits memory address space.
The DRAMC automatically handles memory management, initialization, and refresh operations. It gives the host CPU a
simple command interface, hiding details of the required address, page, and burst handling procedures. All memory
parameters are runtime-configurable, including timing, memory setting, SDRAM type, and Extended-Mode-Register
settings.
Features:
32-bit bus width
Supports 2 chip selects
Supports DDR3/DDR3L SDRAM
Supports power voltage of 1.5V and 1.35V
Supports clock frequency up to 667 MHz(DDR3-1333)
Supports memory capacity up to 24G bits (3G bytes)
Supports 16 address lines and 3 bank address lines
Automatically generates initialization and refresh sequences
Runtime-configurable parameters setting for application flexibility
Priority of transferring through multiple ports is programmable
Random read or write operation is supported
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 332
Memory
5.2.1. Overview
The NAND Flash Controller(NDFC) supports all NAND flash memory available in the market. New type flash can be
supported by software re-configuration.
The On-the-fly error correction code (ECC) is built-in NDFC for enhancing reliability. BCH is implemented and it can
detect and correct up to 64 bits error per 512 or 1024 bytes data. The on chip ECC and parity checking circuitry of NDFC
frees CPU for other tasks. The ECC function can be disabled by software.
The data can be transferred by DMA or by CPU memory-mapped IO method. The NDFC provides automatic timing
control for reading or writing external Flash. The NDFC maintains the proper relativity for CLE, CE# and ALE control
signal lines. Three modes are supported for serial read access. Mode 0 is for the conventional serial access and mode 1
is for EDO type and mode 2 for extension EDO type. NDFC can monitor the status of R/B# signal line.
Features:
Supports all SLC/MLC/TLC flash and EF-NAND memory available in the market
Software configure seed for randomize engine
Software configure method for adaptability to a variety of system and memory types
Supports 8-bit data bus width
Supports 1024, 2048, 4096, 8192, 16384 bytes size per page
Supports conventional and EDO serial access method for serial reading Flash
On-the-fly BCH error correction code which correcting up to 64 bits per 512 or 1024 bytes
Corrected error bits number information report
ECC automatic disable function for all 0xff data
NDFC status information is reported by its registers
One Command FIFO
Embedded DMA to do data transfer
External DMA is supported for transferring data
Two 256x32-bit RAM for Pipeline Procession
Support SDR, ONFI DDR and Toggle DDR NAND
Support selfdebug for NDFC debug
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 333
Memory
AHB
Slave I/F
FIFO FIFO
User Data
RAM0 RAM1
ahb_clk (8x32)
(256x32) (256x32)
domain
Sync
nfc_clk
domain
Normal Spare Batch
Command Command Command
FSM FSM FSM
ECC
Control
Table 5-1 describes the external signals of NDFC.DQ0~DQ7 and DQS are bidirectional I/O.WE,ALE,CLE,CE,RE are output
pin, RB is input pin. The RB pin in the NAND device is an open-drain driver, which must need a pull-up resistor.
NDFC gets three different clocks. Users can select one of them to make NDFC clock source. Table 5-2 describles the
clock sources of NDFC. Users can see CCU for clock setting, configuration and gating information.
Typically, there are two kinds of serial access methods. One method is conventional method which fetching data at the
rise edge of NDFC_RE# signal line. Another one is EDO type which fetching data at the next fall edge of NDFC_RE# signal
line.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 335
Memory
NDFC_CLE
t3 t4
NDFC_CE#
NDFC_WE# t14
t12 sample 0 sample n-1
NDFC_RE#
t13
NDFC_ALE
t10
NDFC_RB#
NDFC_IOx D(0) D(n-1)
NDFC_CLE
t3 t4
NDFC_CE#
NDFC_WE# t14
t12 sample 0
NDFC_RE#
t13
NDFC_ALE
t10
NDFC_RB#
NDFC_IOx D(0) D(n-1)
Figure 5-3. EDO Type Serial Access after Read Cycle (SAM1)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 336
Memory
NDFC_CLE
t3
NDFC_CE#
NDFC_WE# t14
sample 0
t12
NDFC_RE#
t13
NDFC_ALE
t10
NDFC_RB#
NDFC_IOx D(0) D(n-1)
t1 t2
NDFC_CLE
t3 t4
NDFC_CE#
t5
NDFC_WE#
NDFC_RE#
t7 t11
NDFC_ALE
t8 t9
NDFC_IOx COMMAND
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 337
Memory
NDFC_CLE t1
NDFC_CE# t3 t4
t15
NDFC_WE# t6
NDFC_RE# t5
t7 t11
NDFC_ALE
t8 t9
NDFC_IOx Addr(0) Addr(n-1)
NDFC_CLE t1
NDFC_CE# t3 t4
t15
NDFC_WE# t6
NDFC_RE# t5
t7 t11
NDFC_ALE
t8 t9
NDFC_IOx D(0) D(n-1)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 338
Memory
NDFC_CLE
NDFC_CE#
NDFC_WE# t14
t12 t13
NDFC_RE
NDFC_ALE
t16
NDFC_RB#
NDFC_CLE
NDFC_CE#
NDFC_WE#
t17
NDFC_RE
NDFC_ALE
NDFC_RB#
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 339
Memory
NDFC_CLE
NDFC_CE#
NDFC_WE#
t18
NDFC_RE
NDFC_ALE
NDFC_RB#
NDFC_CLE
NDFC_CE#
t19
NDFC_WE#
NDFC_RE
NDFC_ALE
NDFC_RB#
NDFC_CLE
NDFC_CE#
NDFC_WE#
NDFC_RE
Page Command
cmdio[31:30]=2
NDFC_ALE
NDFC_RB#
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 341
Memory
NDFC_CLE
NDFC_CE#
NDFC_WE#
NDFC_ALE
NDFC_RB#
NDFC_CLE
NDFC_CE#
NDFC_WE#
NDFC_RE
Page Command
cmdio[31:30]=2
NDFC_ALE
NDFC_RB#
NDFC_IOx 00h col0 col1 row0row1row2 30h 70h d(0) 00h Data output
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 342
Memory
NDFC_CLE
NDFC_CE#
NDFC_WE#
NDFC_RE
Page Command
cmdio[31:30]=2
NDFC_ALE
NDFC_IOx 00h col0 col1 row0row1row2 30h Data output 05h col0 col1 E0h Data output
0: High active
1: Low active
NDFC_ALE_POL
NDFC Address Latch Enable (ALE) Signal Polarity Select
16 R/W 0x0
0: High active
1: Low active
NDFC_DMA_TYPE
15 R/W 0x0
0: Dedicated DMA
1: Normal DMA
NDFC_RAM_METHOD
Access internal RAM method
14 R/W 0x0
0: Access internal RAM by AHB bus
1: Access internal RAM by DMA bus
13:12 / / /
NDFC_PAGE_SIZE
6 R/W 0x0 0: De-active chip select signal NDFC_CE# during data loading, serial access
and other no operation stage for power consumption. NDFC automatically
controls chip select signals.
1: Chip select signal NDFC_CE# is always active after NDFC is enabled.
5 / / /
NDFC_RB_SEL
NDFC external R/B signal select
4:3 R/W 0x0
The value 0-3 selects the external R/B signal. The same R/B signal can be
used for multiple chip select flash.
NDFC_BUS_WIDTH
2 R/W 0x0
0: 8-bit bus
1: 16-bit bus
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 345
Memory
NDFC_RESET
1 R/W 0x0 NDFC Reset
Write 1 to reset NDFC and clear to 0 after reset
NDFC_EN
NDFC Enable Control
0 R/W 0x0
0: Disable NDFC
1: Enable NDFC
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 346
Memory
Since there is only one 32-bit FIFO for command. When NDFC latches one
command, command FIFO is free and can accept another new command.
NDFC_DMA_INT_FLAG
When it is 1, it means that a pending DMA is completed. It will be cleared
2 R/W1C 0x0
after writing 1 to this bit or it will be automatically clear before FSM
processing an new command.
NDFC_CMD_INT_FLAG
When it is 1, it means that NDFC has finished one Normal Command Mode
1 R/W1C 0x0
or one Batch Command Work Mode. It will be cleared after writing 1 to this
bit or it will be automatically clear before FSM processing an new command.
NDFC_RB_B2R
0 R/W1C 0x0 When it is 1, it means that NDFC_R/B# signal is transferred from BUSY state
to READY state. It will be cleared after writing 1 to this bit.
5.2.5.3. NDFC Interrupt and DMA Enable Register (Default Value: 0x0000_0000)
0: Disable
1: Enable
NDFC_B2R_INT_ENABLE
Enable or disable interrupt when NDFC_RB# signal is transferring from BUSY
state to READY state.
0 R/W 0x0
0: Disable
1: Enable
In SDR mode:
0000: Normal
0001: EDO
11:8 R/W 0x0 0010: E-EDO
Other : Reserved
In DDR mode:
0001~1111 is valid.(These bits configure the number of clock when data is
valid after RE#s falling edge)
7:6 / / /
NDFC_DC_CTL
NDFC Delay Chain Control.
5:0 R/W 0x0
These bits are only valid in DDR data interface, and configure the relative
phase between DQS and DQ[07]
00: 1*2T
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 348
Memory
01: 2*2T
10: 3*2T
11: 4*2T
T_CCS
Change Column Setup Time
000: 4*2T
001: 8*2T
10:8 R/W 0x0
010: 12*2T
011: 16*2T
100: 24*2T
101: 32*2T
110/111: 64*2T
T_RHW
RE# High to WE# Low Cycle Number
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 349
Memory
11: 20*2T
T_WHR
WE# High to RE# Low Cycle Number
00000: no data
00001: 1 data blocks
5:0 R/W 0x0
000010: 2 data blocks
10000: 16 data blocks
Others: Reserved
0: No action
1: DMA transfer automatically
26 R/W 0x0
It only is active when NDFC_DATA_METHOD is 1.
If this bit is set to 1, NDFC should setup DRQ to fetch data before output to
Flash, or NDFC should setup DRQ to send out to system memory after
fetching data from Flash.
If this bit is set to 0, NDFC outputs the data to internal RAM or do nothing
after fetching data from Flash.
NDFC_SEQ
User data & BCH check word position.
It only is active for page command, dont care about this bit for other two
25 R/W 0x0 commands.
24 R/W 0x0
0: Dont send the second set command
1: Send it on the external memorys bus
NDFC_WAIT_FLAG
23 R/W 0x0
0: NDFC can transfer data regardless of the internal NDFC_RB wire
1: NDFC can transfer data when the internal NDFC_RB wire is READY;
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 352
Memory
22 R/W 0x0
0: Dont send the first set command
1: Send it on the external memorys bus
NDFC_DATA_TRANS
21 R/W 0x0
0: No data transfer on external memory bus
1: Data transfer and direction is decided by the field NDFC_ACCESS_DIR.
NDFC_ACCESS_DIR
20 R/W 0x0
0: Read NAND Flash
1: Write NAND Flash
NDFC_SEND_ADR
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 353
Memory
11 R/W 0x0
0: ECC block size
1: Page size
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 354
Memory
NDFC_RANDOM_DIRECTION
10 R/W 0x0
0: LSB first
1: MSB first
NDFC_RANDOM_EN
9 R/W 0x0
0: Disable Data Randomize
1: Enable Data Randomize
8:6 / / /
NDFC_ECC_BLOCK_SIZE
5 R/W 0x0
0: 1024 bytes of one ECC data block
1: 512 bytes of one ECC data block
NDFC_ECC_EXCEPTION
0: Normal ECC
1: For ECC, there is an exception. If all data is 0xff or 0x00 for the block.
4 R/W 0x0
When reading this page, ECC assumes that it is right. For this case, no error
information is reported.
0 R/W 0x0
0: ECC is OFF
1: ECC is ON
0: No Found
31:16 R 0x0
1: Special pattern is found
When this field is 1, this means that the special data is found for reading
external NAND flash. The NDFC_PAT_ID register indicates which pattern is
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 355
Memory
found.
NDFC_ECC_ERR
Error information bit of 16 Data Blocks
Note: The LSB of this register is corresponding the 1st ECC data block. 1 ECC
Data Block = 512 or 1024 bytes.
Note: When this bit is 0, WP signal line is low level and external NAND flash
is on protected state.
7 / / /
NDFC_ECC_DEBUG
For the purpose of debugging ECC engine, the special bits error are inserted
before writing external Flash Memory.
6:0 R/W 0x0
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 357
Memory
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 358
Memory
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 359
Memory
Others: Reserved
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 360
Memory
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 361
Memory
29:28 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[13]
27:26 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[12]
25:24 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[11]
23:22 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[10]
21:20 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[9]
19:18 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[8]
17:16 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 362
Memory
PAT_ID
Special Pattern ID for ECC data block[7]
15:14 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[6]
13:12 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[5]
11:10 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[4]
9:8 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[3]
7:6 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[2]
5:4 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
Special Pattern ID for ECC data block[1]
3:2 R 0x0
0: All 0x00 is found
1: All 0xFF is found
Others: Reserved
PAT_ID
1:0 R 0x0 Special Pattern ID for ECC data block[0]
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 363
Memory
5.2.5.24. NDFC Read Data Status Control Register (Default Value: 0x0100_0000)
0: Disable to count the number of bit 1 and bit 0 during current read
operation.
24 R/W 0x1 1: Enable to count the number of bit 1 and bit 0 during current read
operation.
The number of bit 1 and bit 0 during current read operation can be used to
check whether a page is blank or bad.
23:18 / / /
NDFC_RDATA_STA_TH
The threshold value to generate data status.
If the number of bit 1 during current read operation is less than or equal to
17:0 R/W 0x0
threshold value, the NDFC_RDATA_STA_0 bit will be set.
If the number of bit 0 during current read operation is less than or equal to
threshold value, the NDFC_RDATA_STA_1 bit will be set.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 364
Memory
5.2.5.28. NDFC MBUS DMA Byte Counter Register (Default Value: 0x0000_0000)
5.2.5.29. NDFC Normal DMA Mode Control Register (Default Value: 0x0000_00A5)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 365
Memory
5.3.1. Overview
The SD/MMC Host Controller(SMHC) provides three controllers including SD card,MMC and SDIO device. SMHC
controls the read/write operations on the secure digital(SD) card ,multimedia card(MMC), and supports extended Wi-Fi
devices based on the secure digital input/output(SDIO) protocol.
Features:
SMHC0 controls the devices that comply with the Secure Digital Memory(SD2.0) protocol
SMHC1 controls the devices that comply with the following protocols:
- Secure Digital Memory (SD3.0)
- Secure Digital Input/Output (SDIO 3.0)
SMHC2 controls the devices that comply with the following protocols:
- Secure Digital Memory (SD3.0)
- Multimedia Card (eMMC 5.0/5.1)
Supports hardware CRC generation and error detection
Supports host pull-up control
Supports block size of 1 to 65535 bytes
Supports descriptor-based internal DMA controller
Internal 1024 bytes FIFO for data transfer
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 366
Memory
Each SMHC gets three different clocks. User can select one of them to make SMHC clock source. Table 5-4 describes the
clock sources of SMHC. Users can see CCU for clock setting, configuration and gating information.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 367
Memory
SD/MMC controller has an internal DMA controller (IDMAC) to transfer data between host memory and SDMMC port.
With a descriptor, IDMAC can efficiently move data from source to destination by automatically loading next DMA
transfer arguments, which need less CPU intervention. Before transfer data in IDMAC, host driver should construct a
descriptor list, configure arguments of every DMA transfer, then launch the descriptor and start the DMA. IDMAC has an
interrupt controller, when enabled, it can interrupt the HOST CPU in situations such as data transmission completed or
some errors happened.
The IDMAC uses a descriptor with a chain structure, and each descriptor points to a unique buffer and the next
descriptor.
This figure illustrates the internal formats of a descriptor. The descriptor address must be aligned to the bus width used
for 32-bit buses. Each descriptor contains 16 bytes of control and status information.
DES0 is a notation used to denote the [31:0] bits, DES1 to denote [63:32] bits, DES2 to denote [95:64] bits, and DES3 to
denote [127:96] bits in a descriptor.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 368
Memory
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 369
Memory
The sample clock delay chain and Data Strobe delay chain(only in SMHC2) are used to generate delay to make proper
timing between sample clock/Data Strobe and data signals. Each delay chain is made up with 64 delay cells. The delay
time of one delay cell can be estimated through delay chain calibration.
Step1: Enable SMHC. In order to calibrate delay chain by operation registers in SMHC, SMHC must be enabled through
Bus Software Reset Register 0 and Bus Clock Gating Register0.
Step2: Configure a proper clock for SMHC. Calibration delay chain is based on the clock for SMHC from Clock Control
Unit(CCU). Calibration delay chain a internal function in SMHC and dont need device. So, it is unnecessary to open
clock signal for device. The recommended clock frequency is 200MHz.
Step3: Set proper initial delay value. Writing 0xA0 to delay control register enables Delay Software Enable (bit[7]) and
sets initial delay value 0x20 to Delay chain(bit[5:0]). Then write 0x0 to delay control register to clear the value.
Step4: Write 0x8000 to delay control register to start calibrate delay chain.
Step5: Wait until the flag(Bit14 in delay control register) of calibration done is set. The number of delay cells is shown
at Bit8~Bit13 in delay control register. The delay time generated by these delay cells is equal to the cycle of SMHCs
clock nearly. This value is the result of calibration.
Step6: Calculate the delay time of one delay cell according to the cycle of SMHCs clock and the result of calibration.
Note: In the above descriptions,delay control register contains SMHC Sample Delay Control Register and SMHC Data
Strobe Delay Control Register.Delay Software Enable contains Sample Delay Software Enable and Data Strobe Delay
Software Enable. Delay chain contains Sample Delay Software and Data Strobe Delay Software.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 370
Memory
SMHC2 0x01C11000
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 371
Memory
31 R/W 0x0
0: Do not mask data0 when update clock
1: Mask data0 when update clock
30:18 / / /
CCLK_CTRL
Card Clock Output Control
17 R/W 0x0
0: Card clock always on
1: Turn off card clock when FSM in IDLE state
CCLK_ENB
Card Clock Enable
16 R/W 0x0
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 373
Memory
1: Card Clock on
15:8 / / /
CCLK_DIV
7:0 R/W 0x0 Card Clock Divider
n: Source clock is divided by 2*n.(n=0~255)
21 R/W 0x0
0: Normal command
1: Change Card Clock. When this bit is set, the controller will change clock
domain and clock output. No command will be sent.
20:16 / / /
15 R/W 0x0 SEND_INIT_SEQ
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 375
Memory
Send Initialization
14 R/W 0x0
0: Normal command sending
1: Send Stop or abort command to stop current data transfer in
progress.(CMD12, CMD52 for writing I/O Abort in SDIO CCCR)
WAIT_PRE_OVER
Wait Data Transfer Over
13 R/W 0x0
0: Send command at once, do not care of data transferring
1: Wait for data transfer completion before sending current command
STOP_CMD_FLAG
Send Stop CMD Automatically (CMD12)
12 R/W 0x0
0: Do not send stop command at end of data transfer
1: Send stop command automatically at end of data transfer
TRANS_MODE
Transfer Mode
11 R/W 0x0
0: Block data transfer command
1: Stream data transfer command
TRANS_DIR
Transfer Direction
10 R/W 0x0
0: Read operation
1: Write operation
DATA_TRANS
Data Transfer
9 R/W 0x0
0: Without data transfer
1: With data transfer
CHK_RESP_CRC
Check Response CRC
8 R/W 0x0
0: Do not check response CRC
1: Check response CRC
LONG_RESP
Response Type
7 R/W 0x0
0: Short Response (48-bit)
1: Long Response (136-bit)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 376
Memory
RESP_RCV
Response Receive
6 R/W 0x0
0: Command without Response
1: Command with Response
CMD_IDX
5:0 R/W 0x0 CMD Index
Command index value
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 377
Memory
When set during receiving data, it means that the received data have data
CRC error.
When set during transmitting data, it means that the received CRC status
taken is negative.
M_RCE_INT
6 R/W 0x0
Response CRC Error
M_DRR_INT
5 R/W 0x0 Data Receive Request
When set, it means that there are enough data in FIFO during receiving data.
M_DTR_INT
Data Transmit Request
4 R/W 0x0
When set, it means that there is enough space in FIFO during transmitting
data.
M_DTC_INT
3 R/W 0x0
Data Transfer Complete
M_CC_INT
2 R/W 0x0
Command Complete
M_RE_INT
1 R/W 0x0 Response Error (no response or response CRC error)
When set, Transmit Bit error or End Bit error or CMD Index error may occur.
0 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 381
Memory
000: 1 transfers
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 383
Memory
001: 4
010: 8
011: 16 (only SMHC2 support)
Others: Reserved
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 384
Memory
0: Ignored
1: After suspend command is issued during read-transfer, software polls card
to find when suspend happened. Once suspend occurs, software sets the bit
to reset data state-machine, which is waiting for next block of data.
0: Ignored
1: Send auto IRQ response
0 R/W 0x0
When host is waiting MMC card interrupt response, setting this bit will make
controller cancel wait state and return to idle state, at which time, controller
will receive IRQ response sent by itself.
This bit is auto-cleared after response is sent.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 385
Memory
31 R/W 0x1
0: Old mode of Sample/Output Timing
1: New mode of Sample/Output Timing
30:25 / / /
CMD_DAT_RX_PHASE_CLR
During update clock , command and data RX phase clear
24 R/W 0x1
0: Disable
1: Enable
23 / / /
DAT_CRC_STATUS_RX_PHASE_CLR
Before receive CRC status, data RX phase clear
22 R/W 0x1
0: Disable
1: Enable
DAT_TRANS_RX_PHASE_CLR
Before transfer data , data RX phase clear
21 R/W 0x1
0: Disable
1: Enable
DAT_RECV_RX_PHASE_CLR
Before receive data , data RX phase clear
20 R/W 0x1
0: Disable
1: Enable
19:17 / / /
CMD_SEND_RX_PHASE_CLR
16 R/W 0x1
Before send command, command RX phase clear
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 386
Memory
0: Disable
1: Enable
15:10 / / /
DAT_SAMPLE_TIMING_PHASE(RX)
00: Sample timing phase offset 90
9:8 R/W 0x0
01: Sample timing phase offset 180
10: Sample timing phase offset 270
11: Ignore
7:6 / / /
CMD_SAMPLE_TIMING_PHASE(RX)
00: Sample timing phase offset 90
5:4 R/W 0x0
01: Sample timing phase offset 180
10: Sample timing phase offset 270
11: Ignore
3:0 / / /
Note: This register is for SMHC0 ,SMHC1 only.
0: Reset
0 R/W 0x1 1: Active mode
These bits cause the cards to enter pre-idle state, which requires them to be
re-initialized.
000: 1 transfers
001: 4 transfers
010: 8 transfers
011: 16 transfers
5.3.5.25. SMHC Descriptor List Base Address Register (Default Value: 0x0000_0000)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 388
Memory
0000: DMA_IDLE
0001: DMA_SUSPEND
0010: DESC_RD
16:13 R 0x0
0011: DESC_CHK
0100: DMA_RD_REQ_WAIT
0101: DMA_WR_REQ_WAIT
0110: DMA_RD
0111: DMA_WR
1000: DESC_CLOSE
DMAC_ERR_STA
Error Bits.
Indicates the type of error that caused a Bus Error. Valid only with Fatal Bus
Error bit (FATAL_BERR_INT) set. This field does not generate an interrupt.
12:10 R 0x0
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 389
Memory
ERR_FLAG_SUM
Card Error Summary.
Indicates the status of the transaction to/from the card; also present in
RINTSTS.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 390
Memory
5.3.5.28. SMHC Current Host Descriptor Address Register (Default Value: 0x0000_0000)
5.3.5.29. SMHC Current Buffer Descriptor Address Register (Default Value: 0x0000_0000)
Host controller initiates write transfer only if card threshold amount of data
is available in transmit FIFO.
BCIG (only for SMHC2)
Busy Clear Interrupt Generation
The application can disable this feature if it does not want to wait for a Busy
Clear Interrupt.
CARD_RD_THLD_ENB
Card Read Threshold Enable
5.3.5.31. SMHC eMMC4.5 DDR Start Bit Detection Control Register (Default Value: 0x0000_0000)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 392
Memory
0: Disable
31 R/W 0x0
1: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 393
Memory
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 394
Memory
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 395
Memory
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 396
Memory
5.3.5.44. SMHC Data Strobe Delay Control Register (Default Value: 0x0000_2000)
When set, it means that sample delay chain calibration is done and the result
of calibration is shown in DS_DL.
DS_DL
Data Strobe Delay
It indicates the number of delay cells corresponding to current card clock.
13:8 R 0x20
The delay time generated by these delay cells is equal to the cycle of SMHCs
clock nearly.
This bit is valid only when SAMP_DL_CAL_DONE is set.
DS_DL_SW_EN
7 RW 0x0
Sample Delay Software Enable
6 / / /
DS_DL_SW
5:0 RW 0x0
Data Strobe Delay Software
Note: This register is for SMHC2 only.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 398
Image
Chapter 6 Image
This section describes the image input of H5:
CSI
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 399
Image
6.1. CSI
6.1.1. Overview
CSI
CCI
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 400
Image
CSI
MUX
CS Vsync IF CCIR656 IF
FIFO 0 Formatter
CS Data Converter
Channel 0 CS Field
Pattern
Generater
DMA
PAD
CTL
FMT CTL
DLY CNT
CSI0/1 1st HREF
CSI0/1 last HREF CSI TRIG
CSI0/1 Line counter TRIG
SEL
REGISTER IMMEDIATELY
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 401
Image
HSYNC
HSYNC
DATA[7/9/11:0]
PCLK
PCLK
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 402
Image
Data Bit First Word(0xFF) Second Word(0x00) Third Word(0x00) Fourth Word
CS D[9] (MSB) 1 0 0 1
CS D[8] 1 0 0 F
CS D[7] 1 0 0 V
CS D[6] 1 0 0 H
CS D[5] 1 0 0 P3
CS D[4] 1 0 0 P2
CS D[3] 1 0 0 P1
CS D[2] 1 0 0 P0
CS D[1] x x x x
CS D[0] x x x x
Note: For compatibility with 8-bit interface, CS D[1] and CS D[0] are not defined.
Decode F V H P3 P2 P1 P0
Field 1 start of active video (SAV) 0 0 0 0 0 0 0
Field 1 end of active video (EAV) 0 0 1 1 1 0 1
Field 1 SAV (digital blanking) 0 1 0 1 0 1 1
Field 1 EAV (digital blanking) 0 1 1 0 1 1 0
Field 2 SAV 1 0 0 0 1 1 1
Field 2 EAV 1 0 1 1 0 1 0
Field 2 SAV (digital blanking) 1 1 0 1 1 0 0
Field 2 EAV (digital blanking) 1 1 1 0 0 0 1
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 404
Image
0: SRAM in normal
1: SRAM in power down
7:5 / / /
PTN_START
CSI Pattern Generating Start
0: Finish
4 R/W 0x0
1: Start
Software writes this bit to1 to start pattern generating from DRAM. When
finished, the hardware will clear this bit to 0 automatically. Generating
cycles depends on PTN_CYCLE.
CLK_CNT_SPL
Sampling time for CLK counter per frame
3 R/W 0x0
0: Sampling clock counter every frame done
1: Sampling clock counter every vsync
CLK_CNT_EN
2 R/W 0x0
CLK count per frame enable
PTN_GEN_EN
1 R/W 0x0
Pattern Generation Enable
CSI_EN
Enable
0 R/W 0x0
0: Reset and disable the CSI module
1: Enable the CSI module
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 405
Image
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 406
Image
CCIR656:
00100: YUYV422 Interleaved or RAW (All data in one data bus)
Others: Reserved
The CSI starts capturing image data at the start of the next frame.
CH0_SCAP_ON
Still capture control: capture a single still image frame on channel 0.
The CSI module starts capturing image data at the start of the next frame.
The CSI module captures only one frame of image data. This bit is self
cleared and always reads as a 0.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 407
Image
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 408
Image
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 409
Image
0:Disable
1:Enable
HFLIP_EN
Horizontal flip enable
When enabled, the received data will be arranged in horizontal flip.
12 R/W 0x0
0:Disable
1:Enable
FIELD_SEL
Field selection.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 410
Image
Input data sequence, only valid for YUV422 and YUV420 input format.
1:0 R/W 0x0 0: 256 bytes (if hflip is enabled, always select 256 bytes)
1: 512 bytes
2: 1K bytes
3: 2K bytes
6.1.5.11. CSI Channel_0 FIFO 0 Output Buffer-A Address Register (Default Value: 0x0000_0000)
6.1.5.12. CSI Channel_0 FIFO 1 Output Buffer-A Address Register (Default Value: 0x0000_0000)
6.1.5.13. CSI Channel_0 FIFO 2 Output Buffer-A Address Register (Default Value: 0x0000_0000)
HB_OF_INT_EN
6 R/W 0x0 Hblank FIFO overflow
The bit is set when 3 FIFOs still overflow after the hblank.
MUL_ERR_INT_EN
5 R/W 0x0 Multi-channel writing error
Indicates error has been detected for writing data to a wrong channel.
FIFO2_OF_INT_EN
4 R/W 0x0 FIFO 2 overflow
The bit is set when the FIFO 2 become overflow.
FIFO1_OF_INT_EN
3 R/W 0x0 FIFO 1 overflow
The bit is set when the FIFO 1 become overflow.
FIFO0_OF_INT_EN
2 R/W 0x0 FIFO 0 overflow
The bit is set when the FIFO 0 become overflow.
FD_INT_EN
Frame done
1 R/W 0x0 Indicates the CSI has finished capturing an image frame. Applies to video
capture mode. The bit is set after each completed frame capturing data is
written to buffer as long as video capture remains enabled.
CD_INT_EN
Capture done
Indicates the CSI has completed capturing the image data.
For still capture, the bit is set when one frame data is written to buffer.
0 R/W 0x0
For video capture, the bit is set when the last frame is written to buffer after
video capture has been disabled.
For CCIR656 interface, if the output format is frame planar YCbCr 420 mode,
the frame end means the field2 end, the other frame end means field end.
FIFO0_OF_PD
2 R/W 0x0
FIFO 0 overflow
FD_PD
1 R/W 0x0
Frame done
CD_PD
0 R/W 0x0
Capture done
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 414
Image
6.1.5.21. CSI Channel_0 Frame Clock Counter Register (Default Value: 0x0000_0000)
6.1.5.22. CSI Channel_0 accumulated and internal clock counter Register (Default Value: 0x0000_0000)
0: Transmission idle
1: Start single transmission
0: Transmission idle
1: Repeated transmission
30 R/W 0x0
When this bit is set to 1, transmission repeats when trigger signal (such as
VSYNC/ VCAP done ) repeats.
If changing this bit from 1 to 0 during transmission, the current
transmission will be guaranteed then stop.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 416
Image
RESTART_MODE
0: RESTART
29 R/W 0x0
1: STOP+START
0: Send slave_id+W
28 R/W 0x0 1: Do not send slave_id+W
Note: Setting this bit to 1 if reading from a slave which register width is
equal to 0.
TRAN_RESULT
1 R/W 0x0
0: Normal
1: Reset
CCI_EN
0 R/W 0x0
0: Module disable
1: Module enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 417
Image
0: Compact mode
15 R/W 0x0 1: Complete mode
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 418
Image
1: read
ADDR_BYTE
23:20 R/W 0x1 How many bytes be sent as address
0~15
DATA_BYTE
How many bytes be sent/received as data
1~15
19:16 R/W 0x1
Normally use ADDR_DATA with 0_2, 1_1, 1_2, 2_1, 2_2 access mode. If DATA
byte is 0, transmission will not start. In complete mode, the ADDR_BYTE and
DATA_BYTE are defined in the high/low 4bit of a byte.
PACKET_CNT
15:0 R/W 0x1 FIFO data is transmitted as PACKET_CNT packets in current format.
Total bytes must not exceed 32bytes.
15 R/W 0x0
0: Disable
1: Execute transmission after internal counter delay when triggered
CLK_N
14:12 R/W 0x2
CCI bus sampling clock F0=24MHz/2^CLK_N
CLK_M
11:8 R/W 0x5
CCI output SCL frequency is FSCL=F1/10=(F0/(CLK_M+1))/10
SCL_STA
7 R /
SCL current status
SDA_STA
6 R /
SDA current status
SCL_PEN
5 R/W 0x0
SCL PAD enable
SDA_PEN
4 R/W 0x0
SDA PAD enable
SCL_MOV
3 R/W 0x0
SCL manual output value
SDA_MOV
2 R/W 0x0
SDA manual output value
SCL_MOE
1 R/W 0x0
SCL manual output en
0 R/W 0x0 SDA_MOE
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 419
Image
6.1.5.30. CCI Line Counter Trigger Control Register (Default Value: 0x0000_0000)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 420
Display
Chapter 7 Display
This chapter describes the H5 display system from following perspectives:
DE2.0
TCON
DE2.0
MUX
RT-Mixer
Core 1 TCON1 HDMI
M
B
U
S
Write-Back
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 421
Display
7.1. DE2.0
7.1.1. Overview
The Display Engine 2.0(DE2.0) is a hardware composer to transfer image layers from a local bus or a video buffer to the
LCD interface. The DE2.0 supports four overlay windows to blend, and supports image post-processing in the video
channel.
Features:
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 422
Display
7.2. TCON
7.2.1. Overview
The TCON0 module is used for LCD, and TCON1 module is used for TV.
Supports HDMI interface, up to 1080p
Supports TV interface, up to 480p/576p
2 interrupts for programmer single TCON output
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 423
Display
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 424
Display
0: Disable
31 R/W 0x0
1: Enable
30 R/W 0x0
0: Disable
1: Enable
29:0 / / /
30 R/W 0x0
0: Disable
1: Enable
29 / / /
TCON1_LINE_INT_EN
28 R/W 0x0
0: Disable
1: Enable
27:15 / / /
14 R/W 0x0 TCON1_VB_INT_FLAG
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 425
Display
31 R/W 0x0
0: Disable
1: Enable
30:9 / / /
START_DELAY
8:4 R/W 0x0
This is for DE1 and DE2
3:2 / / /
TCON1_SRC_SEL
1 R/W 0x0
0: Reserved
1: BLUE data(FIFO2 disable, RGB=0000FF)
0 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 427
Display
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 428
Display
0: Not invert
1: Invert
IO2_INV
26 R/W 0x0
0: Not invert
1: Invert
IO1_INV
25 R/W 0x0
0: Not invert
1: Invert
IO0_INV
24 R/W 0x0
0: Not invert
1: Invert
DATA_INV
TCON output port D[23:0] polarity control, with independent bit control
23:0 R/W 0x0
0s: Normal polarity
1s: Invert the specify output
27 R/W 0x1
0: Enable
1: Disable
IO2_OUTPUT_TRI_EN
26 R/W 0x1
0: Enable
1: Disable
IO1_OUTPUT_TRI_EN
25 R/W 0x1
0: Enable
1: Disable
IO0_OUTPUT_TRI_EN
24 R/W 0x1
0: Enable
1: Disable
DATA_OUTPUT_TRI_EN
23:0 R/W 0xFFFFFF TCON output port D[23:0] output enable,with independent bit control.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 429
Display
0s: Enable
1s: Disable
31 R/W UDF
0: Disable
1: Enable
30 R/W UDF ECC_FIFO_ERR_FLAG
29:24 / / /
23:16 R/W UDF ECC_FIFO_ERR_BITS
15:9 / / /
ECC_FIFO_BLANK_EN
31 R/W 0x0
0: Bypass
1: Enable
30:0 / / /
Offset: 0x0110+N*0x04
Register Name: TCON_CEU_COEF_REG
(N=0,1,2,4,5,6,8,9,10)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 430
Display
15:2 / / /
SAFE_PERIOD_MODE
00: Unsafe
1:0 R/W 0x0
01: Safe
10: Safe at ECC_FIFO_CUR_NUM > SAFE_PERIOD_FIFO_NUM
11: Safe at 2 and safe at sync active
31 R/W 0x0
0: Bypass
1: Enable
30:0 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 432
Display
31 R/W 0x0
0: Disable
1: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 433
Display
30 R/W 0x0
0: Disable
1: Enable
29:0 / / /
30 R/W 0x0
0: Disable
1: Enable
29 / / /
TCON1_LINE_INT_EN
28 R/W 0x0
0: Disable
1: Enable
27:15 / / /
TCON1_VB_INT_FLAG
14 R/W 0x0 Asserted during vertical no-display period every frame.
Write 0 to clear it.
13 / / /
TCON1_LINE_INT_FLAG
12 R/W 0x0 Trigger when SY1 match the current TCON1 scan line.
Write 0 to clear it.
11:0 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 434
Display
31 R/W 0x0
0: Disable
1: Enable
30:9 / / /
START_DELAY
8:4 R/W 0x0
This is for DE1 and DE2
3:2 / / /
TCON1_SRC_SEL
1 R/W 0x0
0: Reserved
1: BLUE data(FIFO2 disable,RGB = 0000FF)
0 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 435
Display
HSPW
Horizontal Sync Pulse Width (in dclk)
25:16 R/W 0x0
Thspw = (HSPW+1) * Tdclk
Note: HT> (HSPW+1)
15:10 / / /
VSPW
Vertical Sync Pulse Width (in lines)
9:0 R/W 0x0
Tvspw = (VSPW+1) * Th
Note: VT/2 > (VSPW+1)
27 R/W 0x0
0: Not invert
1: Invert
IO2_INV
26 R/W 0x0
0: Not invert
1: Invert
IO1_INV
25 R/W 0x0
0: Not invert
1: Invert
IO0_INV
24 R/W 0x0
0: Not invert
1: Invert
DATA_INV
TCON output port D[23:0] polarity control,with independent bit control
23:0 R/W 0x0
0s: Normal polarity
1s: Invert the specify output
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 437
Display
27 R/W 0x1
0: Enable
1: Disable
IO2_OUTPUT_TRI_EN
26 R/W 0x1
0: Enable
1: Disable
IO1_OUTPUT_TRI_EN
25 R/W 0x1
0: Enable
1: Disable
IO0_OUTPUT_TRI_EN
24 R/W 0x1
0: Enable
1: Disable
DATA_OUTPUT_TRI_EN
TCON output port D[23:0] output enable,with independent bit control.
23:0 R/W 0xFFFFFF
0s: Enable
1s: Disable
31 R/W UDF
0: Disable
1: Enable
30 R/W UDF ECC_FIFO_ERR_FLAG
29:24 / / /
23:16 R/W UDF ECC_FIFO_ERR_BITS
15:9 / / /
ECC_FIFO_BLANK_EN
8 R/W UDF
0: Disable ECC function in blanking
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 438
Display
31 R/W 0x0
0: Bypass
1: Enable
30:0 / / /
Offset: 0x0110+N*0x04
Register Name: TCON_CEU_COEF_MUL_REG
(N=0,1,2,4,5,6,8,9,10)
Bit Read/Write Default/Hex Description
31:13 / / /
CEU_COEF_MUL_VALUE
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 439
Display
00: Unsafe
1:0 R/W 0x0
01: Safe
10: Safe at ECC_FIFO_CUR_NUM > SAFE_PERIOD_FIFO_NUM
11: Safe at 2 and safe at sync active
31 R/W 0x0
0: Bypass
1: Enable
30:0 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 440
Display
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 441
Audio
Chapter 8 Audio
This chapter describes the H5 audio, including:
Audio Codec
I2S/PCM
OWA
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 442
Audio
8.1.1. Overview
The embedded Audio Codec is a high-quality stereo audio codec designed for embed device. It provides a stereo DAC
for playback, and a stereo ADC for recording.
Features:
Two audio digital-to-analog(DAC) channels
- 1003dB SNR@A-weight
- Supports DAC sample rate from 8KHz to 192KHz
Two audio analog-to-digital(ADC) channels
- 933dB SNR@A-weight
- Supports ADC sample rate from 8KHz to 48KHz
Supports analog/digital volume control
Supports Dynamic Range Controller(DRC) adjusting the DAC playback output
Supports Dynamic Range Control(DRC) adjusting the ADC recording output
Three audio inputs:
- Two differential microphone inputs
- Stereo line-in L/R channel input
One audio output:
- Stereo line-out L/R channel output
Interrupt and DMA support
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 443
Audio
AReg0B[3:0] AReg0C[6:0]
MICIN1P +
M DReg010[28]
- AReg0F[6]
MICIN1N AReg0F[2:0]
M
APB
AReg0A[7:4]
M + G L_ADC
M
MICIN2P + M DReg010[28]
MICIN2N -
AReg0D[6:0]
LINEINL M AReg0F[2:0]
AReg0F[7]
M APB
LINEINR M + G R_ADC
AReg05[6:4]
AReg05[6:4]
AReg06[6:4]
AReg06[2:0]
M
M
G G G G AReg0A[1]
AReg03[4]
AReg01[6:0]
M
DReg000[31] AReg0A[1] AReg09[7:3]
AReg03[6]
M
APB
M + M G
AReg07[7]
AReg0A[0] LINEOUTL
DAC_L M M
M AReg09[7:3] M
-1
AReg03[5]
U LINEOUTR
AReg02[6:0] G X
M
M
DReg000[31]
AReg03[7] M +
M
APB DAC_R M
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 444
Audio
Figure 8-2 describes the clock sources for Audio Codec. Users can see Chapter 4.3 CCU for clock setting, configuration
and gating information.
Figure 8-3 describes the Audio Codec analog part reset system, and Figure 8-4 describes the Audio Codec digital part
reset system.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 445
Audio
Audio Codec system needs three powers, AVCCVDD-SYS and VDD-CPUS, is shown in Figure 8-5. The AVCC provides
power for ADC/DAC and other analog part. VDD-SYS provides power for ADC/DAC digital control register, digital part
and audio codec register. VDD-CPUS provides power for ADC/DAC analog control register .
APB BUS
MICIN1P
MICIN1N
MICIN2P Boost
ADC_L DAC_L
MICIN2N
Input
LINEINL Mixer DAP
LINEINR
ADC_R DAC_R
LINEOUTL
Output
AVCC Mixer
LINEOUTR
MBIAS MICBIAS Lineout
G
AGND G
All power supplies are turned on in normal application, such as music play, record.
AVCC and VDD-CPUS are turned on in super standby mode and AA path mode.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 446
Audio
AC_DAC_DRC_RPFHRT 0x0124 DAC DRC Right Peak filter High Release Time Coef Register
AC_DAC_DRC_RPFLRT 0x0128 DAC DRC Right Peak filter Low Release Time Coef Register
AC_DAC_DRC_LRMSHAT 0x012C DAC DRC Left RMS Filter High Coef Register
AC_DAC_DRC_LRMSLAT 0x0130 DAC DRC Left RMS Filter Low Coef Register
AC_DAC_DRC_RRMSHAT 0x0134 DAC DRC Right RMS Filter High Coef Register
AC_DAC_DRC_RRMSLAT 0x0138 DAC DRC Right RMS Filter Low Coef Register
AC_DAC_DRC_HCT 0x013C DAC DRC Compressor Theshold High Setting Register
AC_DAC_DRC_LCT 0x0140 DAC DRC Compressor Slope High Setting Register
AC_DAC_DRC_HKC 0x0144 DAC DRC Compressor Slope High Setting Register
AC_DAC_DRC_LKC 0x0148 DAC DRC Compressor Slope Low Setting Register
DAC DRC Compressor High Output at Compressor Threshold
AC_DAC_DRC_HOPC 0x014C Register
DAC DRC Compressor Low Output at Compressor Threshold
AC_DAC_DRC_LOPC 0x0150 Register
AC_DAC_DRC_HLT 0x0154 DAC DRC Limiter Theshold High Setting Register
AC_DAC_DRC_LLT 0x0158 DAC DRC Limiter Theshold Low Setting Register
AC_DAC_DRC_HKl 0x015C DAC DRC Limiter Slope High Setting Register
AC_DAC_DRC_LKl 0x0160 DAC DRC Limiter Slope Low Setting Register
AC_DAC_DRC_HOPL 0x0164 DAC DRC Limiter High Output at Limiter Threshold
AC_DAC_DRC_LOPL 0x0168 DAC DRC Limiter Low Output at Limiter Threshold
AC_DAC_DRC_HET 0x016C DAC DRC Expander Theshold High Setting Register
AC_DAC_DRC_LET 0x0170 DAC DRC Expander Theshold Low Setting Register
AC_DAC_DRC_HKE 0x0174 DAC DRC Expander Slope High Setting Register
AC_DAC_DRC_LKE 0x0178 DAC DRC Expander Slope Low Setting Register
AC_DAC_DRC_HOPE 0x017C DAC DRC Expander High Output at Expander Threshold
AC_DAC_DRC_LOPE 0x0180 DAC DRC Expander Low Output at Expander Threshold
AC_DAC_DRC_HKN 0x0184 DAC DRC Linear Slope High Setting Register
AC_DAC_DRC_LKN 0x0188 DAC DRC Linear Slope Low Setting Register
AC_DAC_DRC_SFHAT 0x018C DAC DRC Smooth Filter Gain High Attack Time Coef Register
AC_DAC_DRC_SFLAT 0x0190 DAC DRC Smooth Filter Gain Low Attack Time Coef Register
AC_DAC_DRC_SFHRT 0x0194 DAC DRC Smooth Filter Gain High Release Time Coef Register
AC_DAC_DRC_SFLRT 0x0198 DAC DRC Smooth Filter Gain Low Release Time Coef Register
AC_DAC_DRC_MXGHS 0x019C DAC DRC MAX Gain High Setting Register
AC_DAC_DRC_MXGLS 0x01A0 DAC DRC MAX Gain Low Setting Register
AC_DAC_DRC_MNGHS 0x01A4 DAC DRC MIN Gain High Setting Register
AC_DAC_DRC_MNGLS 0x01A8 DAC DRC MIN Gain Low Setting Register
AC_DAC_DRC_EPSHC 0x01AC DAC DRC Expander Smooth Time High Coef Register
AC_DAC_DRC_EPSLC 0x01B0 DAC DRC Expander Smooth Time Low Coef Register
AC_DAC_DRC_HPFHGAIN 0x01B8 DAC DRC HPF Gain High Coef Register
AC_DAC_DRC_HPFLGAIN 0x01BC DAC DRC HPF Gain Low Coef Register
/ 0x01C0~0x01FC Reserved
AC_ADC_DRC_HHPFC 0x0200 ADC DRC High HPF Coef Register
AC_ADC_DRC_LHPFC 0x0204 ADC DRC Low HPF Coef Register
AC_ADC_DRC_CTRL 0x0208 ADC DRC Control Register
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 448
Audio
AC_ADC_DRC_LPFHAT 0x020C ADC DRC Left Peak Filter High Attack Time Coef Register
AC_ADC_DRC_LPFLAT 0x0210 ADC DRC Left Peak Filter Low Attack Time Coef Register
AC_ADC_DRC_RPFHAT 0x0214 ADC DRC Right Peak Filter High Attack Time Coef Register
AC_ADC_DRC_RPFLAT 0x0218 ADC DRC Peak Filter Low Attack Time Coef Register
AC_ADC_DRC_LPFHRT 0x021C ADC DRC Left Peak Filter High Release Time Coef Register
AC_ADC_DRC_LPFLRT 0x0220 ADC DRC Left Peak Filter Low Release Time Coef Register
AC_ADC_DRC_RPFHRT 0x0224 ADC DRC Right Peak filter High Release Time Coef Register
AC_ADC_DRC_RPFLRT 0x0228 ADC DRC Right Peak filter Low Release Time Coef Register
AC_ADC_DRC_LRMSHAT 0x022C ADC DRC Left RMS Filter High Coef Register
AC_ADC_DRC_LRMSLAT 0x0230 ADC DRC Left RMS Filter Low Coef Register
AC_ADC_DRC_RRMSHAT 0x0234 ADC DRC Right RMS Filter High Coef Register
AC_ADC_DRC_RRMSLAT 0x0238 ADC DRC Right RMS Filter Low Coef Register
AC_ADC_DRC_HCT 0x023C ADC DRC Compressor Theshold High Setting Register
AC_ADC_DRC_LCT 0x0240 ADC DRC Compressor Slope High Setting Register
AC_ADC_DRC_HKC 0x0244 ADC DRC Compressor Slope High Setting Register
AC_ADC_DRC_LKC 0x0248 ADC DRC Compressor Slope Low Setting Register
ADC DRC Compressor High Output at Compressor Threshold
AC_ADC_DRC_HOPC 0x024C Register
ADC DRC Compressor Low Output at Compressor Threshold
AC_ADC_DRC_LOPC 0x0250 Register
AC_ADC_DRC_HLT 0x0254 ADC DRC Limiter Theshold High Setting Register
AC_ADC_DRC_LLT 0x0258 ADC DRC Limiter Theshold Low Setting Register
AC_ADC_DRC_HKl 0x025C ADC DRC Limiter Slope High Setting Register
AC_ADC_DRC_LKl 0x0260 ADC DRC Limiter Slope Low Setting Register
AC_ADC_DRC_HOPL 0x0264 ADC DRC Limiter High Output at Limiter Threshold
AC_ADC_DRC_LOPL 0x0268 ADC DRC Limiter Low Output at Limiter Threshold
AC_ADC_DRC_HET 0x026C ADC DRC Expander Theshold High Setting Register
AC_ADC_DRC_LET 0x0270 ADC DRC Expander Theshold Low Setting Register
AC_ADC_DRC_HKE 0x0274 ADC DRC Expander Slope High Setting Register
AC_ADC_DRC_LKE 0x0278 ADC DRC Expander Slope Low Setting Register
AC_ADC_DRC_HOPE 0x027C ADC DRC Expander High Output at Expander Threshold
AC_ADC_DRC_LOPE 0x0280 ADC DRC Expander Low Output at Expander Threshold
AC_ADC_DRC_HKN 0x0284 ADC DRC Linear Slope High Setting Register
AC_ADC_DRC_LKN 0x0288 ADC DRC Linear Slope Low Setting Register
AC_ADC_DRC_SFHAT 0x028C ADC DRC Smooth filter Gain High Attack Time Coef Register
AC_ADC_DRC_SFLAT 0x0290 ADC DRC Smooth filter Gain Low Attack Time Coef Register
AC_ADC_DRC_SFHRT 0x0294 ADC DRC Smooth filter Gain High Release Time Coef Register
AC_ADC_DRC_SFLRT 0x0298 ADC DRC Smooth filter Gain Low Release Time Coef Register
AC_ADC_DRC_MXGHS 0x029C ADC DRC MAX Gain High Setting Register
AC_ADC_DRC_MXGLS 0x02A0 ADC DRC MAX Gain Low Setting Register
AC_ADC_DRC_MNGLS 0x02A4 ADC DRC MIN Gain High Setting Register
AC_ADC_DRC_MXGLS 0x02A8 ADC DRC MIN Gain Low Setting Register
AC_ADC_DRC_EPSHC 0x02AC ADC DRC Expander Smooth Time High Coef Register
AC_ADC_DRC_EPSLC 0x02B0 ADC DRC Expander Smooth Time Low Coef Register
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 449
Audio
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 450
Audio
Levels=[7*(21+MODQU[3:0])]/128
Default levels=7*21/128=1.15
24:19 / / /
HPF_EN
High Pass Filter Enable
18 R/W 0x0
0: Disable
1: Enable
DVOL
17:12 R/W 0x0 Digital volume control: DVC, ATT=DVC[5:0]*(-1.16Db)
64 steps, -1.16Db/step
11:1 / / /
HUB_EN
Audio Hub Enable
0 R/W 0x0
0: Disable
1: Enable
000: 48KHz
010: 24KHz
100: 12KHz
31:29 R/W 0x0 110: 192KHz
001: 32KHz
011: 16KHz
101: 8KHz
111: 96KHz
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 451
Audio
0: Sending zero
1: Sending last audio sample
FIFO_MODE
Note:
(1). WLEVEL represents the number of valid samples in the TX FIFO
(2). Only TXTL[6:0] valid when TXMODE = 0
ADDA_LOOP_EN
ADDA Loop Enable
7 R/W 0x0
0: Disable
1: Enable
DAC_MONO_EN
DAC Mono Enable
6 R/W 0x0 0: Stereo, 64 Levels FIFO
1: Mono, 128 Levels FIFO
When Enabled, L & R Channel Send Same Data
TX_SAMPLE_BITS
Transmitting Audio Sample Resolution
5 R/W 0x0
0: 16 bits
1: 24 bits
4 R/W 0x0 DAC_DRQ_EN
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 452
Audio
0: Disable
1: Enable
DAC_IRQ_EN
DAC FIFO Empty IRQ Enable
3 R/W 0x0
0: Disable
1: Enable
FIFO_UNDERRUN_IRQ_EN
DAC FIFO Underrun IRQ Enable
2 R/W 0x0
0: Disable
1: Enable
FIFO_OVERRUN_IRQ_EN
DAC FIFO Overrun IRQ Enable
1 R/W 0x0
0: Disable
1: Enable
FIFO_FLUSH
0 R/W1C 0x0 DAC FIFO Flush
Write 1 to flush TX FIFO, Self clear to 0
0: No Pending IRQ
3 R/W1C 0x1
1: FIFO Empty Pending Interrupt
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 453
Audio
TXU_INT
TX FIFO Underrun Pending Interrupt
000: 48KHz
010: 24KHz
100: 12KHz
31:29 R/W 0x0 110: Reserved
001: 32KHz
011: 16KHz
101: 8KHz
111: Reserved
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 454
Audio
0: Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 455
Audio
1: Enable
ADC_IRQ_EN
ADC FIFO Data Available IRQ Enable
3 R/W 0x0
0: Disable
1: Enable
2 / /
ADC_OVERRUN_IRQ_EN
ADC FIFO Overrun IRQ Enable
1 R/W 0x0
0: Disable
1: Enable
ADC_FIFO_FLUSH
0 R/W 0x0 ADC FIFO Flush
Write 1 to flush TX FIFO, self clear to 0
0: No Pending IRQ
3 R/W1C 0x0
1: Data Available Pending IRQ
0: Disable
1: Enable
23:0 / / /
ENADC_DRC
DRC for ADC Enable
26 R/W 0x0
0: Bypass
1: Enable
ADC_DRC_EN
25 R/W 0x0
ADC DRC Function Enable
ADC_DRC_HPF_EN
24 R/W 0x0
ADC DRC HPF Function Enable
23:22 / / /
ADAP_LSATU_FLAG.
Left Channel AGC Saturation Flag
21 R 0x0
0: No saturation
1: Saturation
ADAP_LNOI_FLAG.
Left Channel AGC Noise-Threshold Flag
20 R 0x0
0: No noise-threshold
1: Noise-threshold
ADAP_LCHAN_GAIN
Left Channel Gain Applied by AGC
(7.1format 2s component(-20dB 40dB), 0.5dB/ step)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 460
Audio
---------------
0x00 : 00dB
0xFF : -0.5dB
8.1.5.14. 0x74 ADC DAP Left Control Register (Default Value: 0x001F_7000)
0x00 : -24dB
0x01 : -26dB
23:16 R/W 0x1F
0x02 : -28dB
----------------------
0x1D: -82dB
0x1E: -84dB
0x1F: -86dB
15 / / /
AAGC_LCHAN_EN.
Left AGC Function Enable
14 R/W 0x1
0: Disable
1: Enable
ADAP_LHPF_EN.
Left HPF Enable
13 R/W 0x1
0: Disable
1: Enable
ADAP_RNOI_DET.
Left Noise Detect Enable
12 R/W 0x1
0: Disable
1:Enable
11:10 / / /
ADAP_LCHAN_HYS.
Left Hysteresis Setting
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 461
Audio
0000:0/fs
0001:4/fs
0010:8/fs
------------
1111 :16*4096/fs
0000:0/fs
0001:4/fs
3:0 R/W 0x0
0010:8/fs
------------
1111 :16*4096/fs
8.1.5.15. 0x78 ADC DAP Right Control Register (Default Value: 0x001F_7000)
0x00 : -24dB
0x01 : -26dB
20:16 R/W 0x1F
0x02 : -28dB
----------------------
0x1D: -82dB
0x1E: -84dB
0x1F: -86dB
15 / / /
AAGC_RCHAN_EN.
Right AGC Enable
14 R/W 0x1
0: Disable
1: Enable
ADAP_RHPF_EN.
13 R/W 0x1 Right HPF Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 462
Audio
0: Disable
1: Enable
ADAP_RNOI_DET.
Right Noise Detect Enable
12 R/W 0x1
0: Disable
1: Enable
11:10 / / /
ADAP_RCHAN_HYS.
Right Hysteresis Setting
0000:0/fs
0001:4/fs
7:4 R/W 0x0
0010:8/fs
------------
111116*4096/fs
0000:0/fs
0001:4/fs
3:0 R/W 0x0
0010:8/fs
------------
111116*4096/fs
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 463
Audio
ADAP_RTARG_SET.
21:16 R/W 0x2C
Right Channel Target Level Setting (-1dB ~ -30dB). (6.0format 2s component)
ADAP_LGAIN_MAX.
15:8 R/W 0x28
Left Channel Max Gain Setting (0dB ~ 40dB). (7.1format 2s component)
ADAP_RGAIN_MAX.
7:0 R/W 0x28
Right Channel Max Gain Setting (0dB ~ 40dB). (7.1format 2s component)
8.1.5.17. 0x80 ADC DAP Left Average Coef Register (Default Value: 0x0005_1EB8)
8.1.5.18. 0x84 ADC DAP Left Decay & Attack Time Register (Default Value: 0x0000_001F)
000000000000000: 1x32/fs
000000000000001: 2x32/fs
30:16 R/W 0x0000 ------------------------
111111111111111: 215 x32/fs
T=(n+1)*32*fs
When the gain decreases, the actual gain will decrease 0.5dB at every attack
time.
15 / / /
ADAP_LDEC_SET
Left Decay Time Coefficient Setting
000000000000000: 1x32/fs
000000000000001: 2x32/fs
14:0 R/W 0x001F ------------------------
000000000011111: 32x32/fs
------------------------
111111111111111: 215 x32/fs
T=(n+1)*32/fs
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 464
Audio
When the gain increases, the actual gain will increase 0.5dB at every decay
time.
8.1.5.19. 0x88 ADC DAP Right Average Coef Register (Default Value: 0x0005_1EB8)
8.1.5.20. 0x8C ADC DAP Right Decay & Attack Time Register (Default Value: 0x0000_001F)
000000000000000: 1x32/fs
000000000000001: 2x32/fs
30:16 R/W 0x0000 ------------------------
111111111111111: 215 x32/fs
T=(n+1)*32/fs
When the gain decreases, the actual gain will decrease 0.5dB at every attack
time.
15 / / /
ADAP_RDEC_SET
Right Decay Time Coefficient Setting
000000000000000: 1x32/fs
000000000000001: 2x32/fs
------------------------
14:0 R/W 0x001F 000000000011111: 32x32/fs
------------------------
111111111111111: 215 x32/fs
T=(n+1)*32/fs
When the gain increases, the actual gain will increase 0.5dB at every decay
time.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 465
Audio
8.1.5.21. 0x90 ADC DAP HPF Coef Register (Default Value: 0x00FF_FAC1)
8.1.5.22. 0x94 ADC DAP Left Input Signal Low Average Coef Register (Default Value: 0x0005_1EB8)
8.1.5.23. 0x98 ADC DAP Right Input Signal Low Average Coef Register (Default Value: 0x0005_1EB8)
10 R/W 0x0
0: Min
1: Max
Left Channel Gain Hystersis Setting.
The different between target level and the signal level must larger than the
9:8 R/W 0x0 hystersis when the gain changed.
00: 0.4375dB
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 466
Audio
01: 0.9375dB
10: 1.9375dB
11: 3dB
7:6 / / /
Input Signal Average Filter Coefficient Setting
5 R/W 0x0
0: The reg94/reg98
1: The reg80/reg88
AGC Output when the Channel in Noise State
4 R/W 0x0
0: Output is zero
1: Output is the input data
3 / / /
Right Energy Default Value Setting(include the input and output)
2 R/W 0x0
0 : Min
1 : Max
Right Channel Gain Hysteresis Setting.
The different between target level and the signal level must larger than the
hysteresis when the gain changed.
8.1.5.25. 0x100 DAC DRC High HPF Coef Register (Default Value: 0x0000_00FF)
8.1.5.26. 0x104 DAC DRC Low HPF Coef Register(Default Value: 0x0000_FAC1)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 467
Audio
0 : Not complete
1 : Complete
14:10 / / /
Signal Delay Time Setting
000000 : (8x1)fs
000001 : (8x2)fs
000010 : (8x3)fs
----------------------------------------
13:8 R/W 0x0
101110 : (8*47)fs
101111 : (8*48)fs
110000 ~ 111111 : (8*48)fs
6 R/W 0x0
0 : Disable
1 : Enable
DRC Gain Min Limit Enable.
When this function enable, it will overwrite the noise detect function.
5 R/W 0x0
0 : Disable
1 : Enable
Control DRC to Detect Noise when ET Enable
4 R/W 0x0
0 : Disable
1 : Enable
Signal Function Select
3 R/W 0x0
0 : RMS filter
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 468
Audio
1 : Peak filter
When Signal function Select Peak filter, the RMS parameter is unused.
(AC_DRC_LRMSHAT/AC_DRC_LRMSLAT/AC_DRC_LRMSHAT/AC_DRC_LRMSLAT)
When Signal function Select RMS filter, the Peak filter parameter is
unused.(AC_DRC_LPFHAT/AC_DRC_LPFLAT/AC_DRC_RPFHAT/AC_DRC_RPFLAT
/ AC_DRC_LPFHRT / AC_DRC_LPFLRT / AC_DRC_RPFHRT / AC_DRC_RPFLRT)
Delay Function Enable
0 : Disable
2 R/W 0x0 1 : Enable
When the Delay function enable bit is disabled, the Signal delay time is unused.
DRC LT Enable
0 : Disable
1 R/W 0x0
1 : Enable
When the DRC LT enable bit is disabled, Kl and OPL parameter is unused.
DRC ET Enable
0 : Disable
0 R/W 0x0
1 : Enable
When the DRC ET enable bit is disabled, Ke and OPE parameter is unused.
8.1.5.28. 0x10C DAC DRC Left Peak Filter High Attack Time Coef Register (Default Value: 0x0000_000B)
8.1.5.29. 0x110 DAC DRC Left Peak Filter Low Attack Time Coef Register (Default Value: 0x0000_77BF)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 469
Audio
8.1.5.30. 0x114 DAC DRC Right Peak Filter High Attack Time Coef Register (Default Value: 0x0000_000B)
8.1.5.31. 0x118 DAC DRC Peak Filter Low Attack Time Coef Register (Default Value: 0x0000_77BF)
8.1.5.32. 0x11C DAC DRC Left Peak Filter High Release Time Coef Register (Default Value: 0x0000_00FF)
8.1.5.33. 0x120 DAC DRC Left Peak Filter Low Release Time Coef Register (Default Value: 0x0000_E1F8)
8.1.5.34. 0x124 DAC DRC Right Peak filter High Release Time Coef Register (Default Value: 0x0000_00FF)
8.1.5.35. 0x128 DAC DRC Right Peak filter Low Release Time Coef Register (Default Value: 0x0000_E1F8)
8.1.5.36. 0x12C DAC DRC Left RMS Filter High Coef Register (Default Value: 0x0000_0001)
8.1.5.37. 0x130 DAC DRC Left RMS Filter Low Coef Register (Default Value: 0x0000_2BAF)
8.1.5.38. 0x134 DAC DRC Right RMS Filter High Coef Register (Default Value: 0x0000_0001)
8.1.5.39. 0x138 DAC DRC Right RMS Filter Low Coef Register (Default Value: 0x0000_2BAF)
31:16 / / /
The right RMS filter average time parameter setting, which is determined by
15:0 R/W 0x2BAF
the equation that AT = 1-exp(-2.2Ts/tav). The format is 3.24. (10ms)
8.1.5.40. 0x13C DAC DRC Compressor Threshold High Setting Register (Default Value: 0x0000_06A4)
8.1.5.41. 0x140 DAC DRC Compressor Threshold Low Setting Register (Default Value: 0x0000_D3C0)
8.1.5.42. 0x144 DAC DRC Compressor Slope High Setting Register (Default Value: 0x0000_0080)
8.1.5.43. 0x148 DAC DRC Compressor Slope Low Setting Register (Default Value: 0x0000_0000)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 472
Audio
8.1.5.44. 0x14C DAC DRC Compressor High Output at Compressor Threshold Register (Default Value: 0x0000_F95B)
8.1.5.45. 0x150 DAC DRC Compressor Low Output at Compressor Threshold Register (Default Value: 0x0000_2C3F)
8.1.5.46. 0x154 DAC DRC Limiter Theshold High Setting Register (Default Value: 0x0000_01A9)
8.1.5.47. 0x158 DAC DRC Limiter Theshold Low Setting Register (Default Value: 0x0000_34F0)
8.1.5.48. 0x15C DAC DRC Limiter Slope High Setting Register (Default Value: 0x0000_0005)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 473
Audio
8.1.5.49. 0x160 DAC DRC Limiter Slope Low Setting Register (Default Value: 0x0000_1EB8)
8.1.5.50. 0x164 DAC DRC Limiter High Output at Limiter Threshold (Default Value: 0x0000_FBD8)
8.1.5.51. 0x168 DAC DRC Limiter Low Output at Limiter Threshold (Default Value: 0x0000_FBA7)
8.1.5.52. 0x16C DAC DRC Expander Theshold High Setting Register (Default Value: 0x0000_0BA0)
8.1.5.53. 0x170 DAC DRC Expander Theshold Low Setting Register (Default Value: 0x0000_7291)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 474
Audio
8.1.5.54. 0x174 DAC DRC Expander Slope High Setting Register (Default Value: 0x0000_0500)
8.1.5.55. 0x178 DAC DRC Expander Slope Low Setting Register (Default Value: 0x0000_0000)
8.1.5.56. 0x17C DAC DRC Expander High Output at Expander Threshold (Default Value: 0x0000_F45F)
8.1.5.57. 0x180 DAC DRC Expander Low Output at Expander Threshold (Default Value: 0x0000_8D6E)
8.1.5.58. 0x184 DAC DRC Linear Slope High Setting Register (Default Value: 0x0000_0100)
The slope of the linear is determined by the equation that Kn = 1/R, R is the
13:0 R/W 0x0100
ratio of the linear, which always is interger . The format is 6.24. (1:1)
8.1.5.59. 0x188 DAC DRC Linear Slope Low Setting Register (Default Value: 0x0000_0000)
8.1.5.60. 0x18C DAC DRC Smooth Filter Gain High Attack Time Coef Register (Default Value: 0x0000_0002)
8.1.5.61. 0x190 DAC DRC Smooth Filter Gain Low Attack Time Coef Register (Default Value: 0x0000_5600)
8.1.5.62. 0x194 DAC DRC Smooth filter Gain High Release Time Coef Register (Default Value: 0x0000_0000)
8.1.5.63. 0x198 DAC DRC Smooth filter Gain Low Release Time Coef Register (Default Value: 0x0000_0F04)
8.1.5.64. 0x19C DAC DRC MAX Gain High Setting Register (Default Value: 0x0000_FE56)
8.1.5.65. 0x1A0 DAC DRC MAX Gain Low Setting Register (Default Value: 0x0000_CB0F)
8.1.5.66. 0x1A4 DAC DRC MIN Gain High Setting Register (Default Value: 0x0000_F95B)
8.1.5.67. 0x1A8 DAC DRC MIN Gain Low Setting Register (Default Value: 0x0000_2C3F)
8.1.5.68. 0x1AC DAC DRC Expander Smooth Time High Coef Register (Default Value: 0x0000_0000)
8.1.5.69. 0x1B0 DAC DRC Expander Smooth Time Low Coef Register(Default Value: 0x0000_640C)
8.1.5.70. 0x1B8 DAC DRC HPF Gain High Coef Register(Default Value: 0x0000_0100)
8.1.5.71. 0x1BC DAC DRC HPF Gain Low Coef Register(Default Value: 0x0000_0000)
8.1.5.72. 0x200 ADC DRC High HPF Coef Register (Default Value: 0x0000_00FF)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 478
Audio
8.1.5.73. 0x204 ADC DRC Low HPF Coef Register (Default Value: 0x0000_FAC1)
0 : Not complete
1 : Complete
14:10 / / /
Signal Delay Time Setting
000000 : (8x1)fs
000001 : (8x2)fs
000010 : (8x3)fs
----------------------------------------
13:8 R/W 0x0
101110 : (8*47)fs
101111 : (8*48)fs
110000 ~ 111111 : (8*48)fs
6 R/W 0x0
0 : Disable
1 : Enable
DRC Gain Min Limit Enable.
5 R/W 0x0
When this function enable, it will overwrite the noise detect function.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 479
Audio
0 : Disable
1 : Enable
Control the DRC to Detect Noise when ET Enable
4 R/W 0x0
0 : Disable
1 : Enable
Signal Function Select
0 : RMS filter
1 : Peak filter
3 R/W 0x0
When Signal function selects Peak filter, the RMS parameter is unused.
(AC_DRC_LRMSHAT/AC_DRC_LRMSLAT/AC_DRC_LRMSHAT/AC_DRC_LRMSLAT)
When Signal function selects RMS filter, the Peak filter parameter is
unused.(AC_DRC_LPFHAT/AC_DRC_LPFLAT/AC_DRC_RPFHAT/ AC_DRC_RPFLAT
/ AC_DRC_LPFHRT / AC_DRC_LPFLRT / AC_DRC_RPFHRT / AC_DRC_RPFLRT)
Delay Function Enable
0 : Disable
2 R/W 0x0
1 : Enable
When the Delay function is disabled, the Signal delay time is unused.
DRC LT Enable
0 : Disable
1 R/W 0x0
1 : Enable
When the DRC LT disables the LT, then Kl and OPL parameter is unused.
DRC ET Enable
8.1.5.75. 0x20C ADC DRC Left Peak Filter High Attack Time Coef Register (Default Value: 0x0000_000B)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 480
Audio
8.1.5.76. 0x210 ADC DRC Left Peak Filter Low Attack Time Coef Register (Default Value: 0x0000_77BF)
8.1.5.77. 0x214 ADC DRC Right Peak Filter High Attack Time Coef Register (Default Value: 0x0000_000B)
8.1.5.78. 0x218 ADC DRC Peak Filter Low Attack Time Coef Register (Default Value: 0x0000_77BF)
8.1.5.79. 0x21C ADC DRC Left Peak Filter High Release Time Coef Register (Default Value: 0x0000_00FF)
8.1.5.80. 0x220 ADC DRC Left Peak Filter Low Release Time Coef Register (Default Value: 0x0000_E1F8)
8.1.5.81. 0x224 ADC DRC Right Peak filter High Release Time Coef Register (Default Value: 0x0000_00FF)
8.1.5.82. 0x228 ADC DRC Right Peak filter Low Release Time Coef Register (Default Value: 0x0000_E1F8)
8.1.5.83. 0x22C ADC DRC Left RMS Filter High Coef Register (Default Value: 0x0000_0001)
8.1.5.84. 0x230 ADC DRC Left RMS Filter Low Coef Register (Default Value: 0x0000_2BAF)
8.1.5.85. 0x234 ADC DRC Right RMS Filter High Coef Register (Default Value: 0x0000_0001)
15:11 / / /
The right RMS filter average time parameter setting, which is determined by
10:0 R/W 0x0001
the equation that AT = 1-exp(-2.2Ts/tav). The format is 3.24. (10ms)
8.1.5.86. 0x238 ADC DRC Right RMS Filter Low Coef Register (Default Value: 0x0000_2BAF)
8.1.5.87. 0x23C ADC DRC Compressor Theshold High Setting Register (Default Value: 0x0000_06A4)
8.1.5.88. 0x240 ADC DRC Compressor Theshold Low Setting Register (Default Value: 0x0000_D3C0)
8.1.5.89. 0x244 ADC DRC Compressor Slope High Setting Register (Default Value: 0x0000_0080)
8.1.5.90. 0x248 ADC DRC Compressor Slope Low Setting Register (Default Value: 0x0000_0000)
8.1.5.91. 0x24C ADC DRC Compressor High Output at Compressor Threshold Register (Default Value: 0x0000_F95B)
8.1.5.92. 0x250 ADC DRC Compressor Low Output at Compressor Threshold Register (Default Value: 0x0000_2C3F)
8.1.5.93. 0x254 ADC DRC Limiter Theshold High Setting Register (Default Value: 0x0000_01A9)
8.1.5.94. 0x258 ADC DRC Limiter Theshold Low Setting Register (Default Value: 0x0000_34F0)
8.1.5.95. 0x25C ADC DRC Limiter Slope High Setting Register (Default Value: 0x0000_0005)
8.1.5.96. 0x260 ADC DRC Limiter Slope Low Setting Register (Default Value: 0x0000_1EB8)
8.1.5.97. 0x264 ADC DRC Limiter High Output at Limiter Threshold Register (Default Value: 0x0000_FBD8)
8.1.5.98. 0x268 ADC DRC Limiter Low Output at Limiter Threshold Register (Default Value: 0x0000_FBA7)
8.1.5.99. 0x26C ADC DRC Expander Theshold High Setting Register (Default Value: 0x0000_0BA0)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 485
Audio
8.1.5.100. 0x270 ADC DRC Expander Theshold Low Setting Register (Default Value: 0x0000_7291)
8.1.5.101. 0x274 ADC DRC Expander Slope High Setting Register (Default Value: 0x0000_0500)
8.1.5.102. 0x278 ADC DRC Expander Slope Low Setting Register (Default Value: 0x0000_0000)
8.1.5.103. 0x27C ADC DRC Expander High Output at Expander Threshold (Default Value: 0x0000_F45F)
8.1.5.104. 0x280 ADC DRC Expander Low Output at Expander Threshold (Default Value: 0x0000_8D6E)
is 8.24. (-70dB)
8.1.5.105. 0x284 ADC DRC Linear Slope High Setting Register (Default Value: 0x0000_0100)
8.1.5.106. 0x288 ADC DRC Linear Slope Low Setting Register (Default Value: 0x0000_0000)
8.1.5.107. 0x28C ADC DRC Smooth Filter Gain High Attack Time Coef Register (Default Value: 0x0000_0002)
8.1.5.108. 0x290 ADC DRC Smooth Filter Gain Low Attack Time Coef Register (Default Value: 0x0000_5600)
8.1.5.109. 0x294 ADC DRC Smooth filter Gain High Release Time Coef Register (Default Value: 0x0000_0000)
31:16 / / /
15:11 / / /
The gain smooth filter release time parameter setting, which is determined by
10:0 R/W 0x0000
the equation that RT = 1-exp(-2.2Ts/tr). The format is 3.24. (200ms)
8.1.5.110. 0x298 ADC DRC Smooth filter Gain Low Release Time Coef Register (Default Value: 0x0000_0F04)
8.1.5.111. 0x29C ADC DRC MAX Gain High Setting Register (Default Value: 0x0000_FE56)
8.1.5.112. 0x2A0 ADC DRC MAX Gain Low Setting Register (Default Value: 0x0000_CB0F)
8.1.5.113. 0x2A4 ADC DRC MIN Gain High Setting Register (Default Value: 0x0000_F95B)
8.1.5.114. 0x2A8 ADC DRC MIN Gain Low Setting Register (Default Value: 0x0000_2C3F)
8.1.5.115. 0x2AC ADC DRC Expander Smooth Time High Coef Register (Default Value: 0x0000_0000)
8.1.5.116. 0x2B0 ADC DRC Expander Smooth Time Low Coef Register (Default Value: 0x0000_640C)
8.1.5.117. 0x2B8 ADC DRC HPF Gain High Coef Register (Default Value: 0x0000_0100)
8.1.5.118. 0x2BC ADC DRC HPF Gain Low Coef Register (Default Value: 0x0000_0000)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 489
Audio
Reset
APB0 W/R
Addr[4:0]
25 8-bit
CPUS 0x01F015C0 Data_in[7:0] registers
Data_out[7:0]
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 490
Audio
0: Not gating
1: Gating
6:0 / / /
8.1.6.3. 0x01 Left Output Mixer Source Select Control Register (Default Value: 0x00)
0:Mute
1:Not Mute
8.1.6.4. 0x02 Right Output Mixer Source Select Control Register (Default Value: 0x00)
0: Mute
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 491
Audio
1: Not Mute
8.1.6.5. 0x03 DAC Analog Enable and PA Source Control Register (Default Value: 0x00)
8.1.6.6. 0x05 Linein and Gain Control Register (Default Value: 0x30)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 492
Audio
8.1.6.7. 0x06 MIC1 And MIC2 Gain Control Register (Default Value: 0x33)
8.1.6.8. 0x07 PA Enable and LINEOUT Control Register (Default Value: 0x04)
2:0 / / /
8.1.6.10. 0x0A Mic2 Boost and Lineout Enable Control Register (Default Value: 0x40)
3 R/W 0x0
0: Not select
1: Select
Line-out Right Select
2 R/W 0x0
0: Not select
1: Select
Left Line-out Source Select
1 R/W 0x0
0: Left output mixer
1: Left output mixer + right output mixer
Right Line-out Source Select
0 R/W 0x0
0: Right output mixer
1: Left line-out, for differential output
8.1.6.11. 0x0B MIC1 Boost and MICBIAS Control Register (Default Value: 0x04)
0: Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 494
Audio
1: Enable
5:4 / / /
MIC1AMPEN
MIC1 Boost AMP Enable
3 R/W 0x0
0: Disable
1: Enable
MIC1BOOST
MIC1 Boost AMP Gain Control
8.1.6.12. 0x0C Left ADC Mixer Source Control Register (Default Value: 0x00)
0: Mute
1: Not Mute
8.1.6.13. 0x0D Right ADC Mixer Source Control Register (Default Value: 0x00)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 495
Audio
000: 131ms
001: 262ms
2:0 R/W 0x4 010: 393ms
011: 524ms
100: 655ms
101: 786ms
110: 917ms
111: 1048ms
8.1.6.15. 0x0F ADC Analog Part Enable Register (Default Value: 0x03)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 496
Audio
ADCLEN
ADC Left Channel Enable
6 R/W 0x0
0: Disable
1: Enable
5:3 / / /
ADCG
ADC Input Gain Control
2:0 R/W 0x3
From -4.5dB to 6dB, 1.5dB/step .
The default is 0dB
8.1.6.16. 0x10 ADDA Analog Performance Turning 0 Register (Default Value: 0x55)
8.1.6.17. 0x11 ADDA Analog Performance Turning 1 Register (Default Value: 0x45)
8.1.6.18. 0x12 ADDA Analog Performance Turning 2 Register (Default Value: 0x42)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 497
Audio
0: Disable
1: Enable
Timeout control for master volume change at zero cross over
6 R/W 0x1
0: 32ms
1: 64ms
PTDBS
HPCOM protect de-bounce time setting
00: 2-3ms
01: 4-6ms
5:4 R/W 0x0
10: 8-12ms
11: 16-24ms
At the same time, bit 17 is used to control the AVCCPORFLAG, writing 1 to this
bit, the flag will be cleared, and the calibration is done again.
PA_SLOPE_SELECT
PA slope select cosine or ramp
3 R/W 0x0
0: Select cosine
1: Select ramp
USB_BIAS_CUR.
2:0 R/W 0x2 USB bias current tuning
From 23uA to 30uA, the default value is 25uA
8.1.6.19. 0x13 Bias & DA16 Calibration Control Register0 (Default Value: 0xD6)
7 R/W 0x1
0: Disable
1: Enable
MMIC BIAS Chopper Clock Select
00: 250KHz
6:5 R/W 0x2
01: 500KHz
10: 1MHz
11: 2MHz
DITHER
ADC Dither on/off Control
4 R/W 0x1
0: Dither off
1: Dither on
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 498
Audio
DITHER_CLK_SELECT
ADC Dither Clock Select
3:2 R/W 0x1 00: ADC FS * (8/9), about 43KHz when FS=48KHz
01: ADC FS * (16/15), about 51KHz when FS=48KHz
10: ADC FS * (4/3), about 64KHz when FS=48KHz
11: ADC FS * (16/9), about 85KHz when FS=48KHz
BIHE_CTRL
BIHE Control
8.1.6.20. 0x14 Bias & DA16 Calibration Control Register1 (Default Value: 0x00)
4 R/W 0x0
0: 1KHz
1: 500Hz
BIAS Calibration Mode Select
3 R/W 0x0
0: Average
1: Single
BIAS and DA16 Calibration Control
2 R/W 0x0 Write 1 to this bit, the calibration will be done again. Then this bit will reset to
zero automatically
BIASCALIVERIFY
1 R/W 0x0 Bias Calibration Verify
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 499
Audio
0: Calibration
1: Register setting
DA16CALIVERIFY
DA16 Calibration Verify
0 R/W 0x0
0: Calibration
1: Register setting
8.1.6.22. 0x16 DA16 Register Setting Data Register (Default Value: 0x80)
8.1.6.24. 0x18 Bias Register Setting Data Register (Default Value: 0x20)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 500
Audio
8.2. I2S/PCM
8.2.1. Overview
The I2S/PCM Controller has been designed to transfer streaming audio-data between the system memory and the
codec chip. The controller supports standard I2S format, Left-justified Mode format, Right-justified Mode format, PCM
Mode format and TDM Mode format. The I2S/PCM provides a serial bus interface for stereo and multichannel audio
data. This interface is most commonly used by consumer audio market, including compact disc, digital audio tape,
digital sound processors, and digital TV-sound.
Features:
Compliant with standard Inter-IC sound(I2S) bus specification
Compliant with Left-justified, Right-justified, PCM mode and TDM(Time Division Multiplexing) format
Supports 8-channel in TDM mode
Supports full-duplex synchronous work mode
Supports Master/Slave mode
Supports adjustable interface voltage
Supports clock up to 100MHz
Supports adjustable audio sample rate from 8-bit to 32-bit.
Supports up to 8 slots which has adjustable width from 8-bit to 32-bit.
Supports sample rate from 8KHz to 192KHz
Supports 8-bit u-law and 8-bit A-law companded sample
One 128 x 32-bit width FIFO for data transmit, one 64 x 32-bit width FIFO for data receive
Supports programmable PCM frame width: 1 BCLK width (short frame) and 2 BCLKs width (long frame)
Programmable FIFO thresholds
Interrupt and DMA Support
Supports loopback mode for test
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 501
Audio
TX_DRQ
RX_DRQ
DA_INT
PLL_AUDIO
BCLK
Clock
Register
Divide
APB
MCLK
I2S
64x32-bits BCLK(CLK)
Engine
RX FIFO
S
M LRCK(SYNC)
Y
U
N
X
128x32- C DOUT
bits PCM PCM
TX FIFO Codec Engine DIN
Table 8-2 describes the external signals of I2S/PCM interface. SYNC and CLK are bidirectional I/O, when I2S/PCM
interface is configured as Master device, SYNC and CLK is output pin; when I2S/PCM interface is configured as slave
device, SYNC and CLK is input pin. MCLK is an output pin for external device. DOUT is always the serial data output pin,
and DIN is the serial data input. For information about General Purpose I/O port, see Port Controller.
Table 8-3 describes the clock sources for I2S/PCM. Users can see Chapter 4.3.CCU for clock setting, configuration and
gating information.
1 / fs
LRCK Left Channel Right Channel
BCLK
DOUT/DIN 8 slot 0 2 4 6 1 3 5 7
[TDM-I2S mode]
DOUT/DIN 4 slot 0 2 1 3
[TDM-I2S mode]
DOUT/DIN 2 slot 0 1
[I2S mode]
m slot m=0~7
n-1n-2 1 0 sample
MSB LSB
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 503
Audio
1 / fs
LRCK Left Channel Right Channel
BCLK
8 slot 0 2 4 6 1 3 5 7
[TDM-Left mode]
4 slot 0 2 1 3
[TDM-Left mode]
2 slot 0 1
[Left-Justified mode]
m slot m=0~7
n-1n-2 1 0 sample
MSB LSB
1 / fs
LRCK Left Channel Right Channel
BCLK
8 slot 0 2 4 6 1 3 5 7
[TDM-Right mode]
4 slot 0 2 1 3
[TDM-Right mode]
2 slot 0 1
[Right-Justified mode]
m slot m=0~7
n-1n-2 1 0 sample
MSB LSB
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 504
Audio
1 / fs
LRCK
BCLK
8 slot 0 1 2 3 4 5 6 7
[TDM-DSP_A mode]
4 slot 0 1 2 3
[TDM-DSP_A mode]
2 slot
[DSP_A stereo] 0 1
1 slot
[DSP_A mono] 0
8 slot
[TDM-DSP_B mode] 0 1 2 3 4 5 6 7
4 slot
[TDM-DSP_B mode] 0 1 2 3
2 slot
[DSP_B stereo] 0 1
1 slot
[DSP_B mono] 0
m slot m=0~7
n-1n-2 1 0 sample
MSB LSB
The software operation of the I2S/PCM is divided into five steps: system setup, I2S/PCM initialization, the channel setup,
DMA setup and Enable/Disable module. These five steps are described in detail in the following sections.
The first step in the system setup is properly programming the GPIO. Because the I2S/PCM port is a multiplex pin. You
can find the function in Port Controller(CPUx-PORT). The clock source for the I2S/PCM should be followed. At first you
must reset the audio PLL though the PLL_ENABLE bit of PLL_AUDIO_CTRL_REG in the Chapter 4.3.CCU. The second step,
you must setup the frequency of the audio PLL in the PLL_AUDIO_CTRL_REG. After that, you must open the I2S/PCM
gating though the I2S/PCM0_CLK_REG/I2S/PCM1_CLK_REG when you checkout that the LOCK bit of
PLL_AUDIO_CTRL_REG becomes to 1. At last, you must reset the I2S/PCM by the bit[13:12] of BUS_SOFT_RST_REG3
and open the I2S/PCM bus gating by the bit[13:12] of BUS_CLK_GATING_REG2.
After the system setup, the register of I2S/PCM can be setup. At first, you should initialization the I2S/PCM. You should
close the Globe Enable bit(I2S/PCM_CTL[0]) , Transmitter Block Enable bit(I2S/PCM_CTL[2]) and Receiver Block Enable
bit(I2S/PCM_CTL[1]) by writing 0 to it. After that, you must clear the TX/RX FIFO by writing 0 to the bit[25:24] of
I2S/PCM_FCTL. At last, you can clear the TX FIFO and RX FIFO counter by writing 0 to I2S/PCM_TXCNT and
I2S/PCM_RXCNT.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 505
Audio
Before the usage and control of I2S/PCM, you must configure the I2C. The configuration of I2C will not describe in this
chapter. But you can only configure I2S/PCM of master and slave through the I2C. The configuration can be referred to
the protocol of I2S/PCM. Then, you can set the translation mode, the sample precision, the wide of slot, the frame
mode and the trigger level.
The I2S/PCM supports three methods to transfer the data. The most common way is DMA, the set of DMA can be found
in the DMA. In this module, you just enable the DRQ.
To enable the function, you can enable TX/RX by writing the bit[2:1] of I2S/PCM_CTL. After that, you must enable
I2S/PCM by writing the Globe Enable bit to 1. Writing the Globe Enable bit to 0 to disable I2S/PCM.
18 R/W 0x1
0: Input
1: Output
LRCK_OUT
17 R/W 0x1
0: Input
1: Output
LRCKR_OUT
16 R/W 0x0
0: Input
1: Output
15:9 / / /
DOUT_EN
8 R/W 0x0
0: Disable, Hi-Z state
1: Enable
7 / / /
OUT_MUTE
6 R/W 0x0
0: Normal transfer
1: Force DOUT to output 0
MODE_SEL
Mode Selection
5:4 R/W 0x0 00: PCM mode (offset 0: DSP_B; offset 1: DSP_A)
01: Left mode (offset 0: LJ mode; offset 1: I2S mode)
10: Right-Justified mode
11: Reserved
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 507
Audio
LOOP
Loop Back Test
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 508
Audio
18 / / /
LRCK_PERIOD
It is used to program the number of BCLKs per channel of sample frame.
This value is interpreted as follow:
PCM mode: Number of BCLKs within (Left + Right) channel width
I2S/Left-Justified/Right-Justified mode: Number of BCLKs within each
individual channel width (Left or Right)
17:8 R/W 0x0
N+1
For example:
n = 7: 8 BCLK width
n = 1023: 1024 BCLKs width
BCLK_POLARITY
7 R/W 0x0
0: Normal mode, DOUT drive data at negative edge
1: Invert mode, DOUT drive data at positive edge
SR
Sample Resolution
000: Reserved
001: 8-bit
6:4 R/W 0x3 010: 12-bit
011: 16-bit
100: 20-bit
101: 24-bit
110: 28-bit
111: 32-bit
EDGE_TRANSFER
0: DOUT drive data and DIN sample data at the different BCLK edge
1: DOUT drive data and DIN sample data at the same BCLK edge
000: Reserved
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 509
Audio
001: 8-bit
010: 12-bit
011: 16-bit
100: 20-bit
101: 24-bit
110: 28-bit
111: 32-bit
5:4 R/W 0x3 00: Zeros or audio gain padding at LSB position
01: Sign extension at MSB position
10: Reserved
11: Transfer 0 after each sample in each slot
RX_PDM
PCM Data Mode
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 510
Audio
0: No Pending IRQ
4 R/W1C 0x1 1: FIFO Empty Pending Interrupt when data in TXFIFO are less than TX
trigger level
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 511
Audio
RXA_INT
RXFIFO Data Available Pending Interrupt
0: No Pending IRQ
0 R/W1C 0x0 1: Data Available Pending IRQ when data in RXFIFO are more than RX trigger
level
3 / / /
TXIM
TXFIFO Input Mode (Mode 0, 1)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 513
Audio
0: Disable
5 R/W 0x0
1: Enable
When set to 1, an interrupt happens when writing new audio data if TXFIFO
is full.
TXEI_EN
TXFIFO Empty Interrupt Enable
4 R/W 0x0
0: Disable
1: Enable
RX_DRQ
RXFIFO Data Available DRQ Enable
0: Disable
3 R/W 0x0
1: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 514
Audio
0: Disable
1: Enable
RXOI_EN
RXFIFO Overrun Interrupt Enable
1 R/W 0x0
0: Disable
1: Enable
RXAI_EN
RXFIFO Data Available Interrupt Enable
0 R/W 0x0
0: Disable
1: Enable
Note: Whether in slave or master mode, when this bit is set to 1, MCLK should
output.
BCLKDIV
BCLK Divide Ratio from PLL_AUDIO
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 515
Audio
0100: Divide by 6
0101: Divide by 8
0110: Divide by 12
0111: Divide by 16
1000: Divide by 24
1001: Divide by 32
1010: Divide by 48
1011: Divide by 64
1100: Divide by 96
1101: Divide by 128
1110: Divide by 176
1111: Divide by 192
MCLKDIV
MCLK Divide Ratio from PLL_AUDIO
0000: Reserved
0001: Divide by 1
0010: Divide by 2
0011: Divide by 4
0100: Divide by 6
0101: Divide by 8
3:0 R/W 0x0 0110: Divide by 12
0111: Divide by 16
1000: Divide by 24
1001: Divide by 32
1010: Divide by 48
1011: Divide by 64
1100: Divide by 96
1101: Divide by 128
1110: Divide by 176
1111: Divide by 192
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 516
Audio
9 R/W 0x0
0: Normal mode for the last half cycle of BCLK in the slot
1: Turn to hi-z state for the last half cycle of BCLK in the slot
TX_STATE
8 R/W 0x0
0: Transfer level 0 when not transferring slot
1: Turn to hi-z state when not transferring slot
7 / / /
RX_SLOT_NUM
RX Channel/Slot Number between CPU/DMA and FIFO
0: Disable
1: Enable
3 / / /
TX_CHSEL
TX Channel (slot) number select for each output
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 518
Audio
RX_OFFSET
RX offset tune, RX data offset to LRCK
111: 8th sample
15 / / /
RX_CH3_MAP
RX Channel3 Mapping
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 521
Audio
8.3. OWA
8.3.1. Overview
The OWA(One Wire Audio) provides a serial bus interface for audio data between system. This interface is widely used
for consumer audio.
Features:
IEC-60958 transmitter functionality
Compliance with S/PDIF Interface
Support channel status insertion for the transmitter
Hardware parity generation on the transmitter
One 3224bits FIFO (TX) for audio data transfer
Programmable FIFO thresholds
Interrupt and DMA support
APB
I/F
Channel status
& user data OWA_OUT
buffers Transmitter
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 522
Audio
Table 8-5 describes the clock sources for OWA. Users can see Chapter 4.3.CCU for clock setting, configuration and gating
information.
The OWA supports the transfer of digital audio data. And it supports full-duplex synchronous work mode.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 523
Audio
The software operation of the OWA is divided into five steps: system setup, OWA initialization, the channel setup, DMA
setup and enable/disable module. These five steps are described in detail in the following sections.
The first step in the OWA initialization is properly programming the GPIO. Because the OWA port is a multiplex pin. You
can find the function in the Port Controller. The clock source for the OWA should be followed. At first you must reset
the audio PLL in the CCU. The second step, you must setup the frequency of the Audio PLL. After that, you must open
the OWA gating. At last, you must open the OWA bus gating.
After the system setup, the register of OWA can be setup. At first, you should reset the OWA by writing 1 to OWA_CTL[0]
and clear the TX FIFO by writing 1 to OWA_FCTL[17:16]. After that you should enable the globe enable bit by writing 1
to OWA_CTL[1] and clear the interrupt and TX counter by the OWA_ISTA and OWA_TX_CNT.
The OWA support three methods to transfer the data. The most common way is DMA, the configuration of DMA can be
found in the DMA. In this module, you just enable the DRQ.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 524
Audio
To enable the function, you can enable TX by writing the OWA_TX_CFIG[31]. After that, you must enable OWA by
writing the GEN bit to 1 in the OWA_CTL register. Writing the GEN bit to 0 disable process.
0: Disable
1: Enable
RST
Reset
0 R/W 0x0
0: Normal
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 525
Audio
1: Reset
Self clear to 0.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 526
Audio
1: Enabled
0: No Pending IRQ
4 R/W 0x1
1: FIFO Empty Pending Interrupt
16:13 / / /
TXTL
TX FIFO Empty Trigger Level
12:8 R/W 0x10
Interrupt and DMA request trigger level for TX FIFO normal condition
Trigger Level = TXTL
7:3 R/W 0x0F /
TXIM
TX FIFO Input Mode(Mode0, 1)
0: Disable
1: Enable
TXOI_EN
TX FIFO Overrun Interrupt Enable
5 R/W 0x0
0: Disable
1: Enable
TXEI_EN
TX FIFO Empty Interrupt Enable
4 R/W 0x0
0: Disable
1: Enable
3:0 / / /
00: Level 2
01: Level 1
10: Level 3
11: Not matched
FREQ
Sampling Frequency
0000: 44.1kHz
0001: Not indicated
0010: 48kHz
0011: 32kHz
0100: 22.05kHz
0101: Reserved
27:24 R/W 0x0 0110: 24kHz
0111: Reserved
1000: Reserved
1001: 768kHz
1010: 96kHz
1011: Reserved
1100:176.4kHz
1101: Reserved
1110: 192kHz
1111: Reserved
CN
23:20 R/W 0x0
Channel Number
SN
19:16 R/W 0x0
Source Number
CC
Category Code
15:8 R/W 0x0
Indicates the kind of equipment that generates the digital audio interface
signal.
MODE
Mode
7:6 R/W 0x0
00: Default Mode
01~11: Reserved
EMP
Emphasis
Additional format information
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 530
Audio
0 R/W 0x0
0: Consumer Application
1: Professional Application
This bit must be fixed to 0
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 531
Audio
0111: 88.2kHz
1000: 16kHz
1001: 24kHz
1010: 11.025kHz
1011: 22.05kHz
1100: 32kHz
1101: 48kHz
1110: Reserved
1111: 44.1kHz
WL
Sample Word Length
For bit 0 = 0:
000: Not indicated
001: 16 bits
010: 18 bits
100: 19 bits
101: 20 bits
110: 17 bits
3:1 R/W 0x0
111: Reserved
For bit 0 = 1:
000: Not indicated
001: 20 bits
010: 22 bits
100: 23 bits
101: 24 bits
110: 21 bits
111: Reserved
MWL
Max Word Length
0 R/W 0x0
0: Maximum audio sample word length is 20 bits
1: Maximum audio sample word length is 24 bits
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 532
Interfaces
Chapter 9 Interfaces
TWI
SPI
UART
CIR Receiver
USB
SCR
EMAC
TSC
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 533
Interfaces
9.1. TWI
9.1.1. Overview
This TWI controller is designed to be used as an interface between CPU host and the serial 2-wire bus. It can support all
the standard 2-wire transfer, including slave and master. The communication of the 2-wire bus is carried out by a
byte-wise mode based on interrupt or polled handshaking. This TWI controller can be operated in standard mode (100
Kbit/s) or fast-mode, supporting data rate up to 400 Kbit/s. Multi-masters and 10-bit addressing mode are supported for
this specified application. General Call Addressing is also supported in slave mode.
Features:
Software-programmable for slave or master
Supports repeated START signal
Multi-master systems supported
Allows 10-bit addressing with TWI bus
Performs arbitration and clock synchronization
Own address and General Call address detection
Interrupt on address detection
Supports speed up to 400 Kbit/s (fast mode)
Allows operation from a wide range of input clock frequencies
H5 has 3 TWIs in CPUx and 1 TWI in CPUs. Table 9-1 describes the external signals of TWI. TWI_SCK and TWI_SDA are
bidirectional I/O, When TWI is configured as Master device, TWI_SCK is output pin; when TWI is configurable as Slave
device, TWI_SCK is input pin. The unused TWI ports are used as General Purpose I/O ports. For information about
General Purpose I/O ports, see Port Controller(CPUx-PORT) and Port Controller (CPUs-PORT) in chapter4.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 534
Interfaces
The clock source of each TWI controller is APB2 bus clock. Users can see CCU in chapter4 for clock setting,
configuration and gating information.
Data transferred are always in a unit of 8-bit (1 byte), followed by an acknowledge bit. The number of bytes that can be
transmitted is unrestricted. Data is transferred in serial with the MSB first. Between each byte of data transfer, a
receiver device will hold the clock line SCL low to force the transmitter into a wait state while waiting the response from
microprocessor.
The clock line is driven by the master all the time, including the acknowledge-related clock cycle, except for the SCL
holding between each byte. After sending each byte, the transmitter releases the SDA line to allow the receiver to pull
down the SDA line and send an acknowledge signal (or pull it high to send a "not acknowledge") to the transmitter.
When a slave receiver does not acknowledge the slave address (unable to receive because of no resource available), the
data line must be pulled high by the slave so that the master can generate a STOP condition to stop the transfer. When
the acknowledge signal is pulled high, slave receiver no longer sends more data. And the master should generate the
STOP condition to stop the transfer.
Figure 9-1 provides an illustration the relation of SDA signal line and SCL signal line on the TWI serial bus.
SDA
There are four communication operation modes for the TWI bus, including Master Transmit, Master Receive, Slave
Transmit and Slave Receive. In general, CPU host controls TWI by writing commands and data to its registers. TWI
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 535
Interfaces
transmits an interrupt to CPU when each time a byte transfer is done or a START/STOP conditions is detected. The CPU
host can also poll the status register for current status if the interrupt mechanism is not disabled by the CPU host.
When the CPU host wants to start a bus transfer, it initiates a bus START to enter the master mode by setting IM_STA bit
in the 2WIRE_CNTR register to high (before it must be low). The TWI will assert INT line and INT_FLAG to indicate a
completion for the START condition and each consequent byte transfer. At each interrupt, the micro-processor needs to
check the 2WIRE_STAT register for current status. A transfer has to be concluded with STOP condition by setting M_STP
bit to high.
In Slave mode, the TWI also constantly samples the bus and looks for its own slave address during addressing cycles.
Once a match is found, it is addressed and interrupted the CPU host with the corresponding status. Upon request, the
CPU host should read the status, read/write 2WIRE_DATA data register, and set the 2WIRE_CNTR control register. After
each byte transfer, a slave device always halt the operation of remote master by holding the next low pulse on SCL line
until the microprocessor responds to the status of previous byte transfer or START condition.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 536
Interfaces
SLA
Slave address
7:1 R/W 0x0 7-bit addressing
SLA6, SLA5, SLA4, SLA3, SLA2, SLA1, SLA0
10-bit addressing
1, 1, 1, 1, 0, SLAX[9:8]
GCE
General call address enable
0 R/W 0x0
0: Disable
1: Enable
Note:
SLA6 SLA0 is the 7-bit address of the TWI when in slave mode. When the TWI receives this address after a START
condition, it will generate an interrupt and enter slave mode (SLA6 corresponds to the first bit received from the TWI
bus.). If GCE is set to 1, the TWI will also recognize the general call address (00h).
When the address received starts with 11110b, the TWI recognizes this as the first part of a 10-bit address and if the
next two bits match TWI_ADDR[2:1] (i.e. SLAX9 and SLAX8 of the devices extended address), it sends an ACK (The
device does not generate an interrupt at this point.). If the next byte of the address matches the TWI_XADDR register
(SLAX7 SLAX0), the TWI generates an interrupt and goes into slave mode.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 537
Interfaces
0: The TWI bus inputs ISDA/ISCL are ignored and the TWI controller will not
6 R/W 0x0 respond to any address on the bus
1: The TWI will respond to call to its slave address and to the general call
address if the GCE bit in the TWI_ADDR register is set.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 538
Interfaces
states is entered (see TWI_STAT below). INT_FLAG can not be set when
TWI code state is F8h.
If the INT_EN bit is set, the interrupt line goes high when INT_FLAG is set to
1.
If the TWI is operating in slave mode, data transfer is suspended when
INT_FLAG is set and the low period of the TWI bus clock line (SCL) is
stretched until 1 is written to INT_FLAG. The TWI clock line is then released
and the interrupt line goes low.
A_ACK
Assert Acknowledge
When A_ACK is set to 1, an Acknowledge (low level on SDA) will be sent
during the acknowledge clock pulse on the TWI bus if:
(1). Either the whole of a matching 7-bit slave address or the first or the
second byte of a matching 10-bit slave address has been received.
(2). The general call address has been received and the GCE bit in the
TWI_ADDR register is set to 1.
2 R/W 0x0 (3). A data byte has been received in master or slave mode.
When A_ACK is 0, a Not Acknowledge (high level on SDA) will be sent when
a data byte is received in master or slave mode.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 539
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 540
Interfaces
1:0 R/W 0x0 00: No Data Byte to be written after read command
01: Only 1 byte data to be written after read command
10: 2 bytes data can be written after read command
11: 3 bytes data can be written after read command
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 542
Interfaces
9.2. SPI
9.2.1. Overview
The SPI is the Serial Peripheral Interface which allows rapid data communication with fewer software interrupts. It can
interface with up to four slave external devices or one single external master. The SPI module contains one 64x8
receiver buffer (RXFIFO) and one 64x8 transmit buffer (TXFIFO). It can work at two modes: Master mode and Slave
mode.
Features:
Full-duplex synchronous serial interface
Master/Slave configurable
8-bit wide by 64-entry FIFO for both transmit and receive date
Polarity and phase of the Chip Select (SPI_SS) and SPI Clock (SPI_SCLK) are configurable
Mode0~3 are supported for both transmit and receive operations
The maximum frequency is 100MHz
Interrupt or DMA supported
Support single and dual read mode
spi_top
spi_mosi_oen
spi_mosi_out
spi_tx
tbuf txfifo
spi_miso_oen
spi_miso_out
sckt
AHB spi_ss_oen
spi_ss_out
spi_ss_in
TX DMA spi_rf spi_cmu spi_sck_oen
spi_sck_out
spi_sck_in
RX DMA
sckr
spi_mosi_in
rbuf rxfifo spi_rx
INTC spi_miso_in
hclk sclk
domain domain
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 543
Interfaces
Table 9-3 describes the external signals of SPI. MOSI and MISO are bidirectional I/O, when SPI is configured as Master
device, CLK and CS is output pin; when SPI is configurable as Slave device, CLK and CS is input pin. The unused SPI ports
are used as General Purpose I/O ports.
Each SPI controller get three different clocks, users can select one of them to make SPI Clock Source. Table 9-4
describes the clock sources for SPI.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 544
Interfaces
The SPI supports 4 different formats for data transfer. Software can select one of the four modes in which the SPI
works by setting the bit1(Polarity) and bit0(Phase) of SPI Transfer Control Register. The SPI controller master uses the
SPI_SCLK signal to transfer data in and out of the shift register. Data is clocked using any one of four programmable
clock phase and polarity combinations.
During Phase 0, Polarity 0 and Phase 1, Polarity 1 operations, output data changes on the falling clock edge and input
data is shifted in on the rising edge.
During Phase 1, Polarity 0 and Phase 0, Polarity 1 operations, output data changes on the rising edges of the clock and
is shifted in on falling edges.
The POL defines the signal polarity when SPI_SCLK is in idle state. The SPI_SCLK is high level when POL is 1 and it is low
level when POL is 0. The PHA decides whether the leading edge of SPI_SCLK is used for setup or sample data. The
leading edge is used for setup data when PHA is 1 and for sample data when PHA is 0. The four modes are listed in
Table 9-5.
Figure 9-3 and Figure 9-4 describe four waveforms for SPI_SCLK.
SPI_SCLK (Mode 0)
SPI_SCLK (Mode 2)
SPI_MOSI
SPI_MISO
SPI_SS
Phase 0
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 545
Interfaces
SPI_SCLK (Mode 1)
SPI_SCLK (Mode 3)
SPI_MOSI
SPI_MISO
SPI_SS
Phase 1
The SPI controller can be configured to a Master or Slave device. Master mode is selected by setting the MODE bit in
the SPI Global Control Register;Slave mode is selected by clearing the MODE bit in the SPI Global Control Register.
In Master mode, SPI_CLK is generated and transmitted to external device, and data from the TX FIFO is transmitted on
the MOSI pin, the data from slave is received on the MISO pin and sent to RX FIFO. Chip Select(SPI_SS) is active low
signal. SPI_SS must be set low before data are transmitted or received. SPI_SS can be selected SPI auto control or
software manual control. When using auto control,SS_OWNER (the bit 6 in the SPI Transfer Control Register) must be
cleared(default value is 0);when using manual control, SS_OWNER must be set, chip Select level is controlled by
SS_LEVEL bit(the bit 7 in the SPI Transfer Control Register).
In Slave mode, after software selects the MODE bit to '0',it waits for master initiate a transaction. When the Master
assert SPI_SS and SPI_CLK is transmitted to the Slave ,the Slave data is transmitted from TX FIFO on MISO pin and data
from MOSI pin is received in RX FIFO.
The Dual read mode(SPI x2) is selected when the DRM(bit28) is set in the SPI Master Burst Control Counter
Register.Using the dual mode allows data to be transferred to or from the device at two times the rate of standard
single mode SPI devices, data can be read at fast speed using two data bits(MOSI and MISO) at a time.
In SPI Master mode, the transmit and receive burst(byte in unit) are configured before the SPI transfers serial data
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 546
Interfaces
between the processor and external device. The transmit burst write in MWTC(bit[23:0]) of SPI Master Transmit
Counter Register. The transmit burst in single mode before automatically sending dummy burst write in STC(bit[23:0])
of SPI Master Burst Control Counter Register.For dummy data, SPI controller can automatically sent before receive by
writing DBC(bit[27:24]) in SPI Master Burst Control Counter Register.If users do not use SPI controller to sent
automatically dummy, then dummy burst are used as the transmit counters to write together in MWTC(bit[23:0]) of
SPI Master Transmit Counter Register.In Master mode, the total burst numbers write in MBC(bit[23:0]) of SPI Master
Burst Counter Register.When all master transmit burst and receive burst are transferred, SPI controller will send a
completed interrupt, at the same time, SPI controller will clear DBC, MWTC and MBC.
The SPI Controller runs at 3KHz~100MHz at its interface to external SPI devices. The internal SPI Clock should run at the
same frequency as the outgoing clock in master mode. The SPI clock is selected different clock sources, SPI must
configure different work mode. There are three work mode: normal sample mode, delay half cycle sample mode, delay
one cycle sample mode. Delay half cycle sample mode is the default mode of SPI controller. When SPI runs at 48MHz or
below 48MHz, SPI can work at normal sample mode or delay half cycle sample mode. When SPI runs over 48MHz,Set
the SDC bit in SPI Transfer Control Register to 1 to make the internal read sample point with a half cycle delay of
SPI_CLK, which is used in high speed read operation to reduce the error caused by the time delay of SPI_CLK
propagating between master and slave. The different configuration of SPI sample mode shows in Table 9-6.
/ 0x0028 Reserved
/ 0x002C Reserved
SPI_MBC 0x0030 SPI Burst Counter Register
SPI_MTC 0x0034 SPI Transmit Counter Register
SPI_BCC 0x0038 SPI Burst Control Register
SPI_NDMA_CTL 0x0088 SPI Normal DMA Control Register
SPI_TXD 0x0200 SPI TX Data Register
SPI_RXD 0x0300 SPI RX Data Register
0: Idle
1: Initiates exchange.
31 R/WAC 0x0
Write 1 to this bit will start the SPI burst, and will automatically clear after
finishing the bursts transfer specified by BC. Write 1 to SRST will also clear
this bit. Writing 0 to this bit has no effect.
0: Normal sending
14 R/W 0x0
1: Delay sending
Set the bit to 0 to make the data send with a delay of half cycle of SPI_CLK
in dual IO mode for SPI mode0.
SDM
Master Sample Data Mode
In Normal Sample Mode, SPI master samples the data at the correct edge for
each SPI mode.
In Delay Sample Mode, SPI master samples data at the edge that is half cycle
delayed by the correct edge defined in respective SPI mode.
FBS
First Transmit Bit Select
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 549
Interfaces
10 R/W 0x0
0: Normal write mode
1: Rapids write mode
7 R/W 0x1
0: Set SS to low
1: Set SS to high
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 550
Interfaces
0: SPI controller
1: Software
3 R/W 0x0
0: SPI_SSx remains asserted between SPI bursts
1: Negate SPI_SSx between SPI bursts
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 551
Interfaces
0: Disable
1: Enable
TC_INT_EN
Transfer Completed Interrupt Enable
12 R/W 0x0
0: Disable
1: Enable
TF_UDR_INT_EN
TXFIFO Underrun Interrupt Enable
11 R/W 0x0
0: Disable
1: Enable
TF_OVF_INT_EN
TX FIFO Overflow Interrupt Enable
10 R/W 0x0
0: Disable
1: Enable
RF_UDR_INT_EN
RXFIFO Underrun Interrupt Enable
9 R/W 0x0
0: Disable
1: Enable
RF_OVF_INT_EN
RX FIFO Overflow Interrupt Enable
8 R/W 0x0
0: Disable
1: Enable
7 / / /
TF_FUL_INT_EN
TX FIFO Full Interrupt Enable
6 R/W 0x0
0: Disable
1: Enable
5 R/W 0x0 TX_EMP_INT_EN
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 552
Interfaces
0: Disable
1: Enable
TX_ERQ_INT_EN
TX FIFO Empty Request Interrupt Enable
4 R/W 0x0
0: Disable
1: Enable
3 / / /
RF_FUL_INT_EN
RX FIFO Full Interrupt Enable
2 R/W 0x0
0: Disable
1: Enable
RX_EMP_INT_EN
RX FIFO Empty Interrupt Enable
1 R/W 0x0
0: Disable
1: Enable
RF_RDY_INT_EN
RX FIFO Ready Request Interrupt Enable
0 R/W 0x0
0: Disable
1: Enable
0: Busy
1: Transfer Completed
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 553
Interfaces
TF_UDF
TXFIFO Underrun
This bit is set when if the TXFIFO is underrun. Writing 1 to this bit clears it.
11 R/W1C 0x0
4 R/W1C 0x1
0: TX_WL > TX_TRIG_LEVEL
1: TX_WL <= TX_TRIG_LEVEL
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 554
Interfaces
This bit is set any time if TX_WL <= TX_TRIG_LEVEL. Writing 1 to this bit
clears it. Where TX_WL is the water level of RXFIFO.
3 / / Reserved
RX_FULL
RXFIFO Full
This bit is set when the RXFIFO is full . Writing 1 to this bit clears it.
2 R/W1C 0x0
0: Not Full
1: Full
RX_EMP
RXFIFO Empty
This bit is set when the RXFIFO is empty . Writing 1 to this bit clears it.
1 R/W1C 0x1
0: Not empty
1: empty
RX_RDY
RXFIFO Ready
This bit is set any time if RX_WL >= RX_TRIG_LEVEL. Writing 1 to this bit
clears it. Where RX_WL is the water level of RXFIFO.
0: Disable
1: Enable
30 R/W 0x0
Note: In normal mode, TX FIFO can only be read by SPI controller, writing 1
to this bit will switch TX FIFO read and write function to AHB bus. This bit is
used to test the TX FIFO. RF_TEST and TF_TEST can not be set at the same
time.
29:26 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 555
Interfaces
25 / / /
TF_ DRQ_EN
TX FIFO DMA Request Enable
24 R/W 0x0
0: Disable
1: Enable
TX_TRIG_LEVEL
23:16 R/W 0x40
TX FIFO Empty Request Trigger Level
RF_RST
RXFIFO Reset
15 R/WAC 0x0 Writing 1 to this bit will reset the control portion of the receiver FIFO, and
automatically clear to 0 when completing reset operation, write 0 to this
bit has no effect.
RF_TEST
RX Test Mode Enable
0: Disable
1: Enable
14 R/W 0x0
Note: In normal mode, RX FIFO can only be written by SPI controller, writing
1 to this bit will switch RX FIFO read and write function to AHB bus. This bit
is used to test the RX FIFO. RF_TEST and TF_TEST can not be set at the same
time.
13:9 / / /
RF_ DRQ_EN
RX FIFO DMA Request Enable
8 R/W 0x0
0: Disable
1: Enable
RX_TRIG_LEVEL
7:0 R/W 0x1
RX FIFO Ready Request Trigger Level
Note: These bits control the number of wait states to be inserted before start
dual data transfer in dual SPI mode. The SPI module counts SPI_SCLK by SWC
for delaying next word data transfer.
These bits can not be written when XCH=1.
WCC
Wait Clock Counter (In Master mode)
These bits control the number of wait states to be inserted in data transfers.
15:0 R/W 0x0
The SPI module counts SPI_SCLK by WCC for delaying next word data
transfer.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 557
Interfaces
0: 0 burst
1: 1 burst
N: N bursts
0: 0 burst
1: 1 burst
N: N bursts
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 559
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 560
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 561
Interfaces
9.3. UART
9.3.1. Overview
The Universal Asynchronous Receiver and Transmitter(UART) is used for serial communication with a peripheral,
modem (data carrier equipment, DCE) or data set. Data is written from a master (CPU) over the APB bus to the UART
and it is converted to serial form and transmitted to the destination device. Serial data is also received by the UART and
stored for the master (CPU) to read back.
H5 has five UARTs named UART0,UART1,UART2,UART3 and R_UART. Each UART performs serial-to -parallel conversion
on data characters received from a peripheral device or a modem and parallel-to-serial conversion on data characters
received from the master(CPU).
The interface is fully programmable through 8-bit CPU interface. The registers are 32-bit word aligned. The UARTs can
control the character length, baud rate, parity generation/checking, and interrupt generation. It supports word lengths
from 5 to 8bits,an optional parity bit, and 1,1.5 or 2 stop bits. If enabled, parity can be odd, even, or no parity.
Interrupts can be generated for a range of TX Buffer/FIFO, RX Buffer/FIFO, Modem Status and Line Status conditions.
The UARTs support both 16450 and 16550 compatible modes. In 16550 mode, transmit and receive operations are both
buffered by FIFOs. In 16450 mode, these FIFOs are disabled. It also includes a 16-bit programmable baud rate generator
and an 8-bit scratch register, together with separate transmit and receive FIFOs. Eight modem control lines and a
diagnostic loop-back mode are provided.
Features:
Compatible with industry-standard 16550 UARTs
Supports for word length from 5 to 8 bits, an optional parity bit, and 1,1.5 or 2 stop bits
Programmable parity(even, odd and no parity)
64 bytes transmit and receive data FIFOs
DMA controller interface
Software/Hardware flow control
Programmable Transmit Holding Register Empty Interrupt
Interrupt support for FIFOs, Status Change
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 562
Interfaces
SCLK RX Block
PCLK Control
Clock Divisor BCLK
RX FIFO
INTREQ Pad
Status
I/F
TX Block
Control
Register
Controller TX FIFO
System
Bus
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 563
Interfaces
This active low signal is an input signal when modem is ready to accept data.
UART3_TX 1 O UART Serial Bit Output
UART3_RX 1 I UART Serial Bit Input
UART Request To Send
UART3_RTS 1 O This active low output signal informs modem that the UART is ready to send
data.
UART Clear To End
UART3_CTS 1 I
This active low signal is an input signal when modem is ready to accept data.
S_UART_TX 1 O UART Serial Bit Output
S_UART_RX 1 I UART Serial Bit Input
Table 9-8 describes the clock sources of UART. UART is on APB2 Bus. The clock of APB2 Bus has three sources:
LOSC,OSC24M,PLL_PERIPH0(1X).
One Character
Bit Time
TX/RX Serial Data S Data bits 5-8 P S 1,1.5,2
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 565
Interfaces
THR
Transmit Holding Register
Data to be transmitted on the serial output port (sout) in UART mode or the
serial infrared output (sir_out_n) in infrared mode. Data should only be
written to THR when the THRE bit is set.
7:0 W 0x0
If in FIFO mode and FIFOs are enabled (FIFOE = 1) and THRE is set, 16
number of characters of data may be written to the THR before the FIFO is
full. Any write data operations when the FIFO is full causes the write data
loss.
Lower 8 bits of a 16-bit, read/write, Divisor Latch register contains the baud
rate divisor for the UART. This register may only be accessed when the DLAB
bit (LCR[7]) is set and the UART is not busy (UART Busy = 0).
The output baud rate is equal to the serial clock (sclk) frequency divided by
7:0 R/W 0x0
sixteen times the value of the baud rate divisor, as follows:
baud rate = (serial clock freq) / (16 * divisor)
Note that with the Divisor Latch Registers (DLL and DLH) set to zero, the
baud clock is disabled and no serial communications occur. Also, once the
DLL is set, at least 8 clock cycles of the slowest UART clock should be allowed
to pass before transmitting or receiving data.
7:0 R/W 0x0 Upper 8 bits of a 16-bit, read/write, Divisor Latch register contains the baud
rate divisor for the UART. This register may only be accessed when the DLAB
bit (LCR[7]) is set and the UART is not busy (UART Busy = 0).
The output baud rate is equal to the serial clock (sclk) frequency divided by
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 566
Interfaces
Note that with the Divisor Latch Registers (DLL and DLH) set to zero, the
baud clock is disabled and no serial communications occur. Also, once the
DLH is set, at least 8 clock cycles of the slowest UART clock should be allowed
to pass before transmitting or receiving data.
0: Disable
1: Enable
6:4 / / /
EDSSI
Enable Modem Status Interrupt
This is used to enable/disable the generation of Modem Status Interrupt.
3 R/W 0x0 This is the fourth highest priority interrupt.
0: Disable
1: Enable
ELSI
Enable Receiver Line Status Interrupt
This is used to enable/disable the generation of Receiver Line Status
2 R/W 0x0 Interrupt. This is the highest priority interrupt.
0: Disable
1: Enable
ETBEI
Enable Transmit Holding Register Empty Interrupt
This is used to enable/disable the generation of Transmitter Holding Register
1 R/W 0x0 Empty Interrupt. This is the third highest priority interrupt.
0: Disable
1: Enable
ERBFI
0 R/W 0x0 Enable Received Data Available Interrupt
This is used to enable/disable the generation of Received Data Available
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 567
Interfaces
Interrupt and the Character Timeout Interrupt (if in FIFO mode and FIFOs
enabled). These are the second highest priority interrupts.
0: Disable
1: Enable
00: Disable
11: Enable
5:4 / / /
IID
Interrupt ID
This indicates the highest priority pending interrupt which can be one of the
following types:
Bit 3 indicates an interrupt can only occur when the FIFOs are enabled and
used to distinguish a Character Timeout condition interrupt.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 568
Interfaces
FIFOs enabled)
1100 Second Character No characters in or out of the Reading the receiver buffer register
timeout RCVR FIFO during the last 4
indication character times and there is at
least 1character in it during
This time
0010 Third Transmit Transmitter holding register Reading the IIR register (if source of
holding register empty (Program THRE Mode interrupt); or, writing into THR (FIFOs or
empty disabled) or XMIT FIFO at or THRE Mode not selected or disabled) or
below threshold (Program XMIT FIFO above threshold (FIFOs and
THRE Mode enabled) THRE Mode selected and enabled).
0000 Fourth Modem status Clear to send or data set ready Reading the Modem status Register
or ring indicator or data carrier
detect. Note that if auto flow
control mode is enabled, a
change in CTS (that is, DCTS
set) does not cause an
interrupt.
0111 Fifth Busy detect UART_16550_COMPATIBLE = Reading the UART status register
indication NO and master has tried to
write to the Line Control
Register while the UART is busy
(USR[0] is set to one).
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 569
Interfaces
when the mode is active. It also determines when the dma_tx_req_n signal
is asserted when in certain modes of operation.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 570
Interfaces
Register (UART_DLH)
BC
Break Control Bit
This is used to cause a break condition to be transmitted to the receiving
device. If set to one the serial output is forced to the spacing (logic 0) state.
6 R/W 0x0 When not in Loop Back Mode, as determined by UART_MCR[4], the sout
line is forced low until the Break bit is cleared. If SIR_MODE = Enabled and
active (UART_MCR[6] is set to 1) the sir_out_n line is continuously pulsed.
When in Loop Back Mode, the break condition is internally looped back to
the receiver and the sir_out_n line is forced low.
EPS
Even Parity Select
It is writable only when UART is not busy (UART Busy = 0) .This is used to
select even and odd parity when parity is enabled (PEN is set to one). Setting
5:4 R/W 0x0 the bit5 is to reverse the bit4.
0: Parity disabled
1: Parity enabled
STOP
Number of stop bits
It is writable only when UART is not busy (UART Busy = 0) and always
readable. This is used to select the number of stop bits per character that the
peripheral transmits and receives. If the bit is set to zero, one stop bit is
transmitted in the serial data. If the bit is set to one and the Data Length
2 R/W 0x0
are set to 5 bits (DLS =0) one and a half stop bits is transmitted. Otherwise,
two stop bits are transmitted. Note that regardless of the number of stop
bits selected, the receiver checks only the first stop bit.
0: 1 stop bit
1: 1.5 stop bits when DLS is zero, else 2 stop bit
DLS
Data Length Select
It is writable only when UART is not busy (UART Busy = 0) and always
1:0 R/W 0x0
readable. This is used to select the number of data bits per character that the
peripheral transmits and receives. The number of bit that may be selected is
as follows:
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 571
Interfaces
00: 5 bits
01: 6 bits
10: 7 bits
11: 8 bits
0: Normal Mode
1: Loop Back Mode
This is used to put the UART into a diagnostic mode for test purposes. If
operating in UART mode (SIR_MODE != Enabled or not active, UART_MCR[6]
4 R/W 0x0
is set to zero), data on the sout line is held high, while serial data output is
looped back to the sin line, internally. In this mode all the interrupts are fully
functional. Also, in Loop Back Mode, the modem control inputs (dsr_n,
cts_n, ri_n, dcd_n) are disconnected and the modem control outputs (dtr_n,
rts_n, out1_n, out2_n) are looped back to the inputs, internally. If operating
in infrared mode (SIR_MODE == Enabled AND active, UART_MCR[6] set to 1),
data on the sir_out_n line is held low, while serial data output is inverted and
looped back to the sir_in line.
3:2 / / /
RTS
Request to Send
1 R/W 0x0
This is used to directly control the Request to Send (rts_n) output. The
Request To Send (rts_n) output is used to inform the modem or data set that
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 572
Interfaces
the UART is ready to exchange data. When Auto RTS Flow Control is not
enabled (AFCE = 0), the rts_n signal is set low by programming RTS to a
high.In Auto Flow Control, AFCE_MODE == Enabled and active (AFCE = 1) and
FIFOs enable (FIFOE =1), the rts_n output is controlled in the same way, but
is also gated with the receiver FIFO threshold trigger (rts_n is inactive high
when above the threshold). The rts_n signal is de-asserted when RTS is set
low.
Note that in Loopback mode (LOOP =1), the rts_n output is held inactive high
while the value of this location is internally looped back to an input.
DTR
Data Terminal Ready
This is used to directly control the DTR (dtr_n) output. The value written to
this location is inverted and driven out on dtr_n.
The Data Terminal Ready output is used to inform the modem or data set
that the UART is ready to establish communications.
Note that in Loopback mode (LOOP =1), the dtr_n output is held inactive
high while the value of this location is internally looped back to an input.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 573
Interfaces
0: No framing error
1: Framing error
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 574
Interfaces
0: No parity error
1: Parity error
0: No overrun error
1: Overrun error
0 R 0x0
0: No data ready
1: Data ready
This bit is cleared when the Receiver Buffer Register is read in non-FIFO
mode, or when the receiver FIFO is empty, in FIFO mode.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 575
Interfaces
RI
Line State of Ring Indicator
This is used to indicate the current state of the modem control line ri_n. This
bit is the complement of ri_n. When the Ring Indicator input (ri_n) is
6 R 0x0 asserted it is an indication that a telephone ringing signal has been received
by the modem or data set.
In Loop Back Mode (MCR[4] set to one), DSR is the same as MCR[0] (DTR).
CTS
Line State of Clear To Send
This is used to indicate the current state of the modem control line cts_n.
This bit is the complement of cts_n. When the Clear To Send input (cts_n) is
asserted it is an indication that the modem or data set is ready to exchange
4 R 0x0 data with UART.
In Loop Back Mode (MCR[4] = 1), CTS is the same as MCR[1] (RTS).
DDCD
Delta Data Carrier Detect
This is used to indicate that the modem control line dcd_n has changed since
the last time the MSR was read.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 576
Interfaces
This is used to indicate that a change on the input ri_n (from an active-low to
an inactive-high state) has occurred since the last time the MSR was read.
Reading the MSR clears the DDSR bit. In Loop Back Mode (MCR[4] = 1),
DDSR reflects changes on MCR[0] (DTR).
Note: If the DDSR bit is not set and the dsr_n signal is asserted (low) and a
reset occurs (software or otherwise), then the DDSR bit is set when the reset
is removed if the dsr_n signal remains asserted.
DCTS
Delta Clear to Send
This is used to indicate that the modem control line cts_n has changed since
the last time the MSR was read.
Reading the MSR clears the DCTS bit. In Loop Back Mode (MCR[4] = 1), DCTS
reflects changes on MCR[1] (RTS).
Note: If the DCTS bit is not set and the cts_n signal is asserted (low) and a
reset occurs (software or otherwise), then the DCTS bit is set when the reset
is removed if the cts_n signal remains asserted.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 577
Interfaces
4 R 0x0
0: Receive FIFO not full
1: Receive FIFO Full
3 R 0x0
0: Receive FIFO is empty
1: Receive FIFO is not empty
2 R 0x1
0: Transmit FIFO is not empty
1: Transmit FIFO is empty
1 R 0x1
0: Transmit FIFO is full
1: Transmit FIFO is not full
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 578
Interfaces
This is an enable bit for the user to change UART_LCR register configuration
(except for the DLAB bit) and baud rate register (DLL and DLH) when the
UART is busy.
0 R/W 0x0
0 : Halt TX disabled
1 : Halt TX enabled
Note: If FIFOs are not enabled, the setting of the halt TX register has no
effect on operation.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 580
Interfaces
9.4.1. Overview
The CIR (Consumer infrared) Receiver module receives data over the IR interface.
Features:
For saving CPU resource, CIR receiver is implemented in hardware. The CIR receiver samples the input signal on the
programmable frequency and records these samples into RX FIFO when one CIR signal is found on the air. The CIR
receiver uses Run-Length Code (RLC) to encode pulse width. The encoded data is buffered in a 64 levels and 8-bit width
RX FIFO; the MSB bit is used to record the polarity of the receiving CIR signal. The high level is represented as 1 and the
low level is represented as 0. The rest 7 bits are used for the length of RLC. The maximum length is 128. If the duration
of one level (high or low level) is more than 128, another byte is used.
In the air, there is always some noise. One threshold can be set to filter the noise to reduce system loading and improve
the system stability.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 581
Interfaces
0: Disable
1: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 582
Interfaces
0: Disable
5 R/W 0x0
1: Enable
When set to 1, the Receiver FIFO DRQ is asserted if reaching RAL. The DRQ
is de-asserted when condition fails.
RAI_EN
RX FIFO Available Interrupt Enable
0: Disable
4 R/W 0x0
1: Enable
When set to 1, the Receiver FIFO IRQ is asserted if reaching RAL. The IRQ is
de-asserted when condition fails.
3:2 / / /
RPEI_EN
Receiver Packet End Interrupt Enable
1 R/W 0x0
0: Disable
1: Enable
ROI_EN
Receiver FIFO Overrun Interrupt Enable
0 R/W 0x0
0: Disable
1: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 583
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 584
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 585
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 586
Interfaces
9.5. USB
9.5.1.1. Overview
The USB OTG is a Dual-Role Device controller, which supports both device and host functions which can also be
configured as a Host-only or Device-only controller, fully compliant with the USB 2.0 Specification. It can support
high-speed (HS, 480-Mbps), full-speed (FS, 12-Mbps), and low-speed (LS, 1.5-Mbps) transfers in Host mode. It can
support high-speed (HS, 480-Mbps), and full-speed (FS, 12-Mbps) in Device mode. Standard USB transceiver can be
used through its UTMI+PHY Level3 interface. The UTMI+PHY interface is bidirectional with 8-bit data bus. For saving
CPU bandwidth, USB-OTG DMA interface can support external DMA controller to take care of the data transfer between
the memory and USB-OTG FIFO. The USB-OTG core also supports USB power saving functions.
Features:
Complies with USB 2.0 Specification
Supports Device or Host operation at a time
Supports High-Speed (HS, 480-Mbps), Full-Speed (FS, 12-Mbps), and Low-Speed (LS, 1.5-Mbps) in host mode
Complies with Enhanced Host Controller Interface (EHCI) Specification, Version 1.0, and the Open Host Controller
Interface (OHCI) Specification, Version 1.0a for host mode
Supports High-Speed (HS, 480-Mbps), Full-Speed (FS, 12-Mbps) in device mode
Supports bi-directional endpoint0 for Control transfer in device mode
Supports up to 8 User-Configurable Endpoints for Bulk,Isochronousl and Interrupt bi-directional transfers (Endpoint1,
Endpoint2, Endpoint3, Endpoint4) in device mode
Supports up to (4KB+64B) FIFO for EPs (Excluding EP0) in device mode
Supports the UTMI+ Level 3 interface . The 8-bit bidirectional data buses are used
Supports point-to-point and point-to-multipoint transfer in both Host and Peripheral mode
Power Optimization and Power Management capabilities
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 587
Interfaces
9.5.2.1. Overview
USB Host Controller is fully compliant with the USB 2.0 specification, Enhanced Host Controller Interface (EHCI)
Specification, Revision 1.0, and the Open Host Controller Interface (OHCI) Specification Release 1.0a. The
controller supports high-speed, 480-Mbps transfers (40 times faster than USB 1.1 full-speed mode) using an
EHCI Host Controller, as well as full and low speeds through one or more integrated OHCI Host Controllers.
Features:
Supports industry-standard AMBA High-Performance Bus (AHB) and it is fully compliant with the AMBA Specification,
Revision 2.0.
Supports 32-bit Little Endian AMBA AHB Slave Bus for Register Access.
Supports 32-bit Little Endian AMBA AHB Master Bus for Memory Access.
Including an internal DMA Controller for data transfer with memory.
Complies with Enhanced Host Controller Interface (EHCI) Specification, Version 1.0, and the Open Host Controller
Interface (OHCI) Specification, Version 1.0a.
Supports High-Speed (HS, 480-Mbps), Full-Speed (FS, 12-Mbps), and Low-Speed (LS, 1.5-Mbps) Device.
Supports the UTMI+ Level 3 interface . The 8-bit bidirectional data buses are used.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 588
Interfaces
Supports only 1 USB Root Port shared between EHCI and OHCI.
Figure 9-8 shows the USB Host Controller system-level block diagram.
Please refer USB2.0 Specification, Enhanced Host Controller Interface (EHCI) Specification, Version 1.0, and the Open
Host Controller Interface (OHCI) Specification, Version 1.0a.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 589
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 590
Interfaces
9.5.2.5.3. EHCI Host Control Structural Parameter Register(Default Value: Implementation Dependent)
9.5.2.5.4. EHCI Host Control Capability Parameter Register(Default Value: Implementation Dependent)
Reserved
3 R 0x0
These bits are reserved and should be set to zero.
Asynchronous Schedule Park Capability
If this bit is set to a one, then the host controller supports the park feature
for high-speed queue heads in the Asynchronous Schedule. The feature can
2 R 0x0
be disabled or enabled and set to a specific level by using the Asynchronous
Schedule Park Mode Enable and Asynchronous Schedule Park Mode Count
fields in the USBCMD register.
Programmable Frame List Flag
If this bit is set to a zero, then system software must use a frame list length
of 1024 elements with this host controller.The USBCMD register
Frame List Size field is a read-only register and should be set to zero.
1 R 0x0
If set to 1,then system software can specify and use the frame list in the
USBCMD register Frame List Size field to cofigure the host controller.
The frame list must always aligned on a 4K page boundary.This requirement
ensures that the frame list is always physically contiguous.
Reserved
0 R 0x0 These bits are reserved for future use and should return a value of zero when
read.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 593
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 594
Interfaces
default values and the CF bit setting should not go to zero (retaining port
ownership relationships).
A host software read of this bit as zero indicates the Light Host Controller
Reset has completed and it si safe for software to re-initialize the host
controller. A host software read of this bit as a one indicates the Light Host
Interrupt on Async Advance Doorbell
This bit is used as a doorbell by software to tell the host controller to issue
an interrupt the next time it advances asynchronous schedule. Soft-
Ware must write a 1 to this bit to ring the doorbell.
When the host controller has evicted all appropriate cached schedule state,
it sets the Interrupt on Async Advance status bit in the USBSTS. if the
6 R/W 0x0
Interrupt on Async Advance Enable bit in the USBINTR register is a one then
the host controller will assert an interrupt at the next interrupt threshold.
The host controller sets this bit to a zero after it has set the Interrupt on
Async Advance status bit in the USBSTS register to a one.
Software should not write a one to this bit when the asynchronous schedule
is disabled. Doing so will yield undefined results.
Asynchronous Schedule Enable
This bit controls whether the host controller skips processing the
Asynchronous Schedule. Values mean:
Bit Value Meaning
5 R/W 0x0
0 Do not process the Asynchronous Schedule.
Use the ASYNLISTADDR register to access the
1 Asynchronous Schedule.
The default value of this field is 0b.
Periodic Schedule Enable
This bit controls whether the host controller skips processing the Periodic
Schedule. Values mean:
Bit Value Meaning
4 R/W 0x0
0 Do not process the Periodic Schedule.
Use the PERIODICLISTBASE register to access the
1 Periodic Schedule.
The default value of this field is 0b.
Frame List Size
This field is R/W only if Programmable Frame List Flag in the HCCPARAMS
registers is set to a one. This field specifies the size of the
Frame list. The size the frame list controls which bits in the Frame Index
Register should be used for the Frame List Current index. Values mean:
3:2 R/W or R 0x0 Bits Meaning
00b 1024 elements(4096bytes)Default
01b 512 elements(2048byts)
10b 256 elements(1024bytes)For resource-constrained condition
11b reserved
The default value is 00b.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 595
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 597
Interfaces
The Host Controller sets this bit to 1 when completion of USB transaction
results in an error condition(e.g. error counter underflow).If the TD on which
the error interrupt occurred also had its IOC bit set, both.
This bit and USBINT bit are set.
USB Interrupt(USBINT)
The Host Controller sets this bit to a one on the completion of a USB
transaction, which results in the retirement of a Transfer Descriptor that had
0 R/WC 0x0 its IOC bit set.
The Host Controller also sets this bit to 1 when a short packet is detected
(actual number of bytes received was less than the expected number of
bytes)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 598
Interfaces
9.5.2.5.10. EHCI Periodic Frame List Base Address Register (Default Value: UDF)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 599
Interfaces
9.5.2.5.11. EHCI Current Asynchronous List Address Register (Default Value: UDF)
9.5.2.5.13. EHCI Port Status and Control Register(Default Value: 0x0000_2000(w/PPC set to one))
read.
Wake on Disconnect Enable(WKDSCNNT_E)
Writing this bit to a one enables the port to be sensitive to device
21 R/W 0x0 disconnects as wake-up events.
This field is zero if Port Power is zero.
The default value in this field is 0.
Wake on Connect Enable(WKCNNT_E)
Writing this bit to a one enable the port to be sensitive to device connects as
20 R/W 0x0 wake-up events.
This field is zero if Port Power is zero.
The default value in this field is 0.
Port Test Control
The value in this field specifies the test mode of the port. The encoding of
the test mode bits are as follow:
Bits Test Mode
0000b The port is NOT operating in a test mode.
0001b Test J_STATE
19:16 R/W 0x0 0010b Test K_STATE
0011b Test SE0_NAK
0100b Test Packet
0101b Test FORCE_ENABLE
0110b-
1111b Reserved
The default value in this field is 0000b.
Reserved
15:14 R/W 0x0 These bits are reserved for future use and should return a value of zero when
read.
Port Owner
This bit unconditionally goes to a 0b when the Configured bit in the
CONFIGFLAG register makes a 0b to 1b transition. This bit unconditionally
goes to 1b whenever the Configured bit is zero.
System software uses this field to release ownership of the port to selected
13 R/W 0x1
host controller (in the event that the attached device is not a high-speed
device).Software writes a one to this bit when the attached device is not a
high-speed device. A one in this bit means that a companion host controller
owns and controls the port.
Default Value = 1b.
Reserved
12 / 0x0 These bits are reserved for future use and should return a value of zero when
read.
Line Status
These bits reflect the current logical levels of the D+ (bit11) and D-(bit10)
11:10 R 0x0 signal lines. These bits are used for detection of low-speed USB devices prior
to port reset and enable sequence. This read only field is valid only when the
port enable bit is zero and the current connect status bit is set to a one.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 601
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 603
Interfaces
For the root hub, this bit gets set to a one only when a port is disabled due to
the appropriate conditions existing at the EOF2 point (See Chapter 11 of the
USB Specification for the definition of a Port Error). Software clears this bit
by writing a 1 to it.
This field is zero if Port Power is zero.
Port Enabled/Disabled
1=Enable, 0=Disable. Ports can only be enabled by the host controller as a
part of the reset and enable. Software cannot enable a port by writing a one
to this field. The host controller will only set this bit to a one when the reset
sequence determines that the attached device is a high-speed device.
Ports can be disabled by either a fault condition(disconnect event or other
2 R/W 0x0 fault condition) or by host software. Note that the bit status does not change
until the port state actually changes. There may be a delay in disabling or
enabling a port due to other host controller and bus events.
When the port is disabled, downstream propagation of data is blocked on
this port except for reset.
The default value of this field is 0.
This field is zero if Port Power is zero.
Connect Status Change
1=Change in Current Connect Status, 0=No change, Default=0.
Indicates a change has occurred in the ports Current Connect Status. The
host controller sets this bit for all changes to the port device connect status,
1 R/WC 0x0 even if system software has not cleared an existing connect status change.
For example, the insertion status changes twice before system software has
cleared the changed condition, hub hardware will be setting an already-set
bit. Software sets this bit to 0 by writing a 1 to it.
This field is zero if Port Power is zero.
Current Connect Status
Device is present on port when the value of this field is a one, and no device
is present on port when the value of this field is a zero. This value reflects the
0 R 0x0
current state of the port, and may not correspond directly to the event that
caused the Connect Status Change(Bit 1) to be set.
This field is zero if Port Power zero.
Note: This register is only reset by hardware or in response to a host controller reset.
Revision
This read-only field contains the BCD representation of the version of the
7:0 R R 0x10 HCI specification that is implemented by this HC. For example, a value of
0x11 corresponds to version 1.1. All of the HC implementations that are
compliant with this specification will have a value of 0x10.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 605
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 608
Interfaces
PCED[31:4]
This is used by HC to point to the head of one of the Periodec list which
will be processed in the current Frame. The content of this register is
31:4 R R/W 0x0
updated by HC after a periodic ED has been processed. HCD may read the
content in determining which ED is currently being processed at the time
of reading.
PCED[3:0]
Because the general TD length is 16 bytes, the memory structure for the
3:0 R R 0x0
TD must be aligned to a 16-byte boundary. So the lower bits in the PCED,
through bit 0 to bit 3 must be zero in this field.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 611
Interfaces
CCED[3:0]
Because the general TD length is 16 bytes, the memory structure for the
3:0 R R 0x0
TD must be aligned to a 16-byte boundary. So the lower bits in the PCED,
through bit 0 to bit 3 must be zero in this field.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 612
Interfaces
HCD HC
FrameRemaining Toggle
This bit is loaded from the FrameIntervalToggle field of HcFmInterval
31 R R/W 0x0
whenever FrameRemaining reaches 0. This bit is used by HCD for the
synchronization between FrameInterval and FrameRemaining.
30:14 / / 0x0 Reserved
FramRemaining
This counter is decremented at each bit time. When it reaches zero, it is
reset by loading the FrameInterval value specified in HcFmInterval at the
13:0 R RW 0x0
next bit time boundary. When entering the USBOPERATIONAL state, HC
re-loads the content with the FrameInterval of HcFmInterval and uses the
updated value from the next SOF.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 614
Interfaces
NoPowerSwithcing
These bits are used to specify whether power switching is supported or
ports are always powered. It is implementation-specific. When this bit is
8 R/W R 0x0
cleared, the PowerSwitchingMode specifies global or per-port switching.
0 Ports are power switched.
1 Ports are always powered on when the HC is powered on.
NumberDownstreamPorts
These bits specify the number of downstream ports supported by the
7:0 R R 0x01
Root Hub. It is implementation-specific. The minimum number of ports is
1. The maximum number of ports supported.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 616
Interfaces
Bit0 Reserved
Bit1 Device attached to Port #1.
Bit2 Device attached to Port #2.
(write)SetRemoteWakeupEnable
Writing a 1 sets DeviceRemoveWakeupEnable. Writing a 0 has no
effect.
14:2 Reserved
OverCurrentIndicator
This bit reports overcurrent conditions when the global reporting is
1 R R/W 0x0 implemented. When set, an overcurrent condition exists. When cleared,
all power operations are normal.
If per-port overcurrent protection is implemented this bit is always 0
0 R/W R 0x0 (Read)LocalPowerStatus
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 617
Interfaces
When read, this bit returns the LocalPowerStatus of the Root Hub. The
Root Hub does not support the local power status feature; thus, this bit is
always read as 0.
(Write)ClearGlobalPower
When write, this bit is operated as the ClearGlobalPower. In global power
mode (PowerSwitchingMode=0), This bit is written to 1 to turn off
power to all ports (clear PortPowerStatus). In per-port power mode, it
clears PortPowerStatus only on ports whose PortPowerControlMask bit is
not set. Writing a 0 has no effect.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 618
Interfaces
(write)ClearPortPower
The HCD clears the PortPowerStatus bit by writing a 1 to this bit. Writing
a 0 has no effect.
(read)PortPowerStatus
This bit reflects the ports power status, regardless of the type of power
switching implemented. This bit is cleared if an overcurrent condition is
detected. HCD sets this bit by writing SetPortPower or SetGlobalPower.
HCD clears this bit by writing ClearPortPower or ClearGlobalPower. Which
power control switches are enabled is determined by
PowerSwitchingMode and
PortPortControlMask[NumberDownstreamPort]. In global switching
mode(PowerSwitchingMode=0), only Set/ClearGlobalPower controls
this bit. In per-port power switching (PowerSwitchingMode=1), if the
PortPowerControlMask[NDP] bit for the port is set, only
8 R/W R/W 0x1 Set/ClearPortPower commands are enabled. If the mask is not set, only
Set/ClearGlobalPower commands are enabled. When port power is
disabled, CurrentConnectStatus, PortEnableStatus, PortSuspendStatus,
and PortResetStatus should be reset.
0 port power is off
1 port power is on
(write)SetPortPower
The HCD writes a 1 to set the PortPowerStatus bit. Writing a 0 has no
effect.
(write)SetPortReset
The HCD sets the port reset signaling by writing a 1 to this bit. Writing a
0 has no effect. If CurrentConnectStatus is cleared, this write does not
set PortResetStatus, but instead sets ConnectStatusChange. This informs
the driver that it attempted to reset a disconnected port.
(read)PortOverCurrentIndicator
This bit is only valid when the Root Hub is configured in such a way that
overcurrent conditions are reported on a per-port basis. If per-port
overcurrent reporting is not supported, this bit is set to 0. If cleared, all
power operations are normal for this port. If set, an overcurrent condition
exists on this port. This bit always reflects the overcurrent input signal.
3 R/W R/W 0x0
0 no overcurrent condition.
1 overcurrent condition detected.
(write)ClearSuspendStatus
The HCD writes a 1 to initiate a resume. Writing a 0 has no effect. A
resume is initiated only if PortSuspendStatus is set.
(read)PortSuspendStatus
This bit indicates the port is suspended or in the resume sequence. It is
set by a SetSuspendState write and cleared when
PortSuspendStatusChange is set at the end of the resume interval. This bit
cannot be set if CurrentConnectStatus is cleared. This bit is also cleared
when PortResetStatusChange is set at the end of the port reset or when
the HC is placed in the USBRESUME state. If an upstream resume is in
progress, it should propagate to the HC.
2 R/W R/W 0x0
0 port is not suspended
1 port is suspended
(write)SetPortSuspend
The HCD sets the PortSuspendStatus bit by writing a 1 to this bit. Writing
a 0 has no effect. If CurrentConnectStatus is cleared, this write does not
set PortSuspendStatus; instead it sets ConnectStatusChange. This informs
the driver that it attempted to suspend a disconnected port.
(read)PortEnableStatus
1 R/W R/W 0x0 This bit indicates whether the port is enabled or disabled. The Root Hub
may clear this bit when an overcurrent condition, disconnect event,
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 620
Interfaces
(write)SetPortEnable
The HCD sets PortEnableStatus by writing a 1. Writing a 0 has no effect.
If CurrentConnectStatus is cleared, this write does not set
PortEnableStatus, but instead sets ConnectStatusChange. This informs the
driver that it attempted to enable a disconnected Port.
(read)CurrentConnectStatus
This bit reflects the current state of the downstream port.
0 No device connected
1 Device connected
0 R/W R/W 0x0 (write)ClearPortEnable
The HCD writes a 1 to clear the PortEnableStatus bit. Writing 0 has no
effect. The CurrentConnectStatus is not affected by any write.
Note: This bit is always read 1 when the attached device is
nonremovalble(DviceRemoveable[NumberDownstreamPort]).
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 621
Interfaces
12 / / /
AHB Master interface INCR16 enable
10 R/W 0x0
1: Use INCR8 when appropriate
0: do not use INCR8,use other enabled INCRX or unspecified length burst INCR
AHB Master interface burst type INCR4 enable
9 R/W 0x0
1: Use INCR4 when appropriate
0: do not use INCR4,use other enabled INCRX or unspecified length burst INCR
AHB Master interface INCRX align enable
0 R/W 0x0 1: Enable UTMI interface, disable ULPI interface(SP used utmi
interface)
0: Enable ULPI interface, disable UTMI interface
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 622
Interfaces
Name Description
HCLK System clock (provided by AHB bus clock). This clock needs to be >30MHz.
CLK60M Clock from PHY for HS SIE, is constant to be 60MHz.
CLK48M Clock from PLL for FS/LS SIE, is constant to be 48MHz.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 623
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 624
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 625
Interfaces
9.6. SCR
9.6.1. Overview
The Smart Card Reader (SCR) is a communication controller that transmits data between the system and Smart Card.
The controller can perform a complete smart card session, including card activation, card deactivation. cold/warm reset,
Answer to Reset (ATR) response reception, data transfers, etc.
Features:
Supports APB slave interface for easy integration with AMBA-based host systems
Supports the ISO/IEC 7816-3:1997(E) and EMV2000 (4.0) Specifications
Performs functions needed for complete smart card sessions, including:
- Card activation and deactivation
- Cold/warm reset
- Answer to Reset (ATR) response reception
- Data transfers to and from the card
Supports adjustable clock rate and bit rate
Configurable automatic byte repetition
Supports commonly used communication protocols:
- T=0 for asynchronous half-duplex character transmission
- T=1 for asynchronous half-duplex block transmission
Supports FIFOs for receive and transmit buffers (up to 128 characters) with threshold
Supports configurable timing functions:
- Smart card activation time
- Smart card reset time
- Guard time
- Timeout timers
Supports synchronous and any other non-ISO 7816 and non-EMV cards
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 626
Interfaces
SCR SCR_Clk
SCR Clock
Registers Generator SCR SCR_Rst
Interface
SCR_IO
SCR
APB Controller
TX FIFO SCR_Vppen
SCR_Vpppp
RX FIFO SCR_Det
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 627
Interfaces
The Clock Generator generates the SCR clock signal and the Baud Clock Impulse signal, used in the timing of SCR.
The SCR clock signal is used as the main clock for the Smart Card. Its frequency can be adjusted using the Smart Card
Clock Divisor (SCCDIV). This value is used to divide the system clock. The SCCLK frequency is given by the following
equation:
f s y s c lk
f s c c lk
2 * ( S C C D IV 1)
The Baud Clock Impulse signal is used to transmit and receive serial between the SCR and the Smart Card. The baud rate
can be modified using the Baud Clock Divisor (BAUDDIV). The value is used to divide the system clock. The BUAD rate is
given by the following equation:
f s y s c lk
BAUD
2 * ( B A U D D IV 1)
BAUD -- Baud rate of the data stream between Smart Card and Reader.
The duration of one bit, Elementary Time Unit (ETU), is defined in the ISO/IEC 7816-3 specification. During the first
answer to reset response after the cold reset, the initial ETU must be equal to 372 Smart Card Clock Cycles.
1 372
ETU
BAUD f s c c lk
3 7 2 * f s y s c lk
B A U D D IV 1 3 7 2 * ( S C C D I V 1) 1 .
2 * f s c c lk
After the ATR is completed, the ETU can be changed according to Smart Card abilities.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 628
Interfaces
1 F 1
ETU *
BAUD D f s c c lk
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 629
Interfaces
9.6.5.1. Smart Card Reader Control and Status Register (Default Value: 0x0000_0000)
0: Low Active
1: High Active
Protocol Selection (PTLSEL)
00: T=0.
23:22 R/W 0x0 01: T=1, no character repeating and no guard time is used when T=1
protocol is selected.
10: Reserved
11: Reserved
ATRSTFLUSH
21 R/W 0x0 ATR Start Flush FIFO
When enabled, both FIFOs are flushed before the ATR is started.
TSRXE
TS Receive Enable
20 R/W 0x0
When set to 1, the TS character (the first ATR character) will be stored in
RXFIFO during card session.
CLKSTPPOL
19 R/W 0x0 Clock Stop Polarity
The value of the scclk output during the clock stop state.
PECRXE
18 R/W 0x0 Parity Error Character Receive Enable
Enables storage of the characters received with wrong parity in RX FIFO.
MSBF
17 R/W 0x0 MSB First
When high, inverse bit ordering convention (msb to lsb) is used.
DATAPOL
16 R/W 0x0 Data Plorarity
When high, inverse level convention is used (A=1, Z=0).
15:12 / / /
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 630
Interfaces
DEACT
Deactivation.
11 R/W 0x0
Setting of this bit initializes the deactivation sequence. When the
deactivation is finished, the DEACT bit is automatically cleared.
ACT
Activation.
10 R/W 0x0
Setting of this bit initializes the activation sequence. When the activation is
finished, the ACT bit is automatically cleared.
WARMRST
Warm Reset Command.
9 R/W 0x0
Writing 1 to this bit initializes Warm Reset of the Smart Card. This bit is
always read as 0.
CLKSTOP
Clock Stop.
When this bit is asserted and the Smart Card I/O line is in Z state, the SCR
core stops driving of the Smart Card clock signal after the CLKSTOPDELAY
8 R/W 0x0
time expires. The Smart Card clock is restarted immediately after the
CLKSTOP signal is deasserted. New character transmission can be started
after CLKSTARTDELAY time. The expiration of both times is signaled by the
CLKSTOPRUN bit in the interrupt registers.
7:3 / / Reserved
GINTEN
2 R/W 0x0 Global Interrupt Enable.
When high, IRQ output assertion is enabled.
RXEN
Receiving Enable.
1 R/W 0x0 When enabled the characters sent by the Smart Card are received by the
UART and stored in RX FIFO. Receiving is internally disabled while a
transmission is in progress.
TXEN
Transmission Enable.
0 R/W 0x0
When enabled the characters are read from TX FIFO and transmitted
through UART to the Smart Card.
9.6.5.2. Smart Card Reader Interrupt Enable Register (Default Value: 0x0000_0000)
When enabled, this interrupt is asserted after the Smart Card activation
sequence completed.
SCINS
21 R/W 0x0 Smart Card Inserted Interrupt.
When enabled, this interrupt is asserted after the Smart Card inserted.
SCREM
20 R/W 0x0 Smart Card Removed Interrupt.
When enabled, this interrupt is asserted after the Smart Card removed.
ATRDONE
ATR Done Interrupt.
19 R/W 0x0
When enabled, this interrupt is asserted after the ATR sequence
successfully completed.
ATRFAIL
18 R/W 0x0 ATR Fail Interrupt.
When enabled, this interrupt is asserted if the ATR sequence fails.
C2CFULL
Two Consecutive Characters Limit Interrupt.
When enabled, this interrupt is asserted if the time between two
consecutive characters, transmitted between the Smart Card and the
17 R/W 0x0
Reader in both directions, is equal the Two Characters Delay Limit described
below. The C2CFULL interrupt is internally enabled from the ATR start to
the deactivation or ATR restart initialization. It is recommended to use this
counter to detect unresponsive Smart Cards.
CLKSTOPRUN
Smart Card Clock Stop/Run Interrupt.
When enabled, this interrupt is asserted in two cases:
16 R/W 0x0 When the Smart Card clock is stopped.
When the new character can be started after the clock restart.
To distinguish between the two interrupt cases, we recommend reading the
CLKSTOP bit in SCR_CSR register.
15:13 / / /
RXPERR
RX Parity Error Interrupt.
12 R/W 0x0 When enabled, this interrupt is asserted after the character with wrong
parity was received when the number of repeated receptions exceeds
RXREPEAT value or T=1 protocol is used.
RXDONE
RX Done Interrupt.
11 R/W 0x0
When enabled, this interrupt is asserted after a character was received
from the Smart Card.
RXFIFOTHD
RX FIFO Threshold Interrupt.
10 R/W 0x0
When enabled, this interrupt is asserted if the number of bytes in RX FIFO is
equal or exceeds the RX FIFO threshold.
9 R/W 0x0 RXFIFOFULL
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 633
Interfaces
9.6.5.4. Smart Card Reader FIFO Control and Status Register(Default Value: 0x0000_0000)
TX FIFO Empty.
BAUDDIV
Baud Clock Divisor.
This 16-bit register defines the divisor value used to generate the Baud
31:16 R/W 0x0 Clock impulses from the system clock.
f s y s c lk
BAUD
2 * ( B A U D D IV 1)
SCCDIV
Smart Card Clock Divisor.
This 16-bit register defines the divisor value used to generate the Smart
Card Clock from the system clock.
f s y s c lk
15:0 R/W 0x0 f s c c lk
2 * ( S C C D IV 1)
f s c c lk
is the frequency of Smart Card Clock Signal.
f s y s c lk
is the frequency of APB Clock.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 636
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 638
Interfaces
9.7. EMAC
9.7.1. Overview
The Ethernet MAC(EMAC) controller enables a host to transmit and receive data over Ethernet in compliance with the
IEEE 802.3-2002 standard. It supports 10M/100M/1000M external PHY with MII/ RGMII interface in both full and half
duplex mode. The Ethernet MAC-DMA is designed for packet-oriented data transfers based on a linked list of descriptors.
4K Byte TXFIFO and 16K Byte RXFIFO are provided to keep continuous transmission and reception. Flow Control, CRC
Pad & Stripping, and address filtering are also supported in this module.
Features:
Supports 10/100/1000Mbps data transfer rates
Supports MII/RGMII PHY interface
Supports both full-duplex and half-duplex operation
Programmable frame length to support Standard or Jumbo Ethernet frames with sizes up to 16 KB
Supports a variety of flexible address filtering modes
Separate 32-bit status returned for transmission and reception packets
Optimization for packet-oriented DMA transfers with frame delimiters
Supports linked-list (chained) descriptor chaining
Descriptor architecture, allowing large blocks of data transfer with minimum CPU intervention; each descriptor can
transfer up to 4 KB of data
Comprehensive status reporting for normal operation and transfers with errors
4KB TXFIFO for transmission packets and 16KB RXFIFO for reception packets
Programmable interrupt options for different operational conditions
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 639
Interfaces
TXFIFO RXFIFO
PHY
RMII Interface
AHB
Master
MAC CSR
DMA CSR OMR Register
RGMII
AHB Slave
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 640
Interfaces
RGMII_TXD3/MII_TXD3/
RGMII/MII Transmit Data O
RMII_NULL
RGMII_TXD2/MII_TXD2/
RGMII/MII Transmit Data O
RMII_NULL
RGMII_TXD1/MII_TXD1/
RGMII/MII/RMII Transmit Data O
RMII_TXD1
RGMII_TXD0/MII_TXD0/
RGMII/MII/RMII Transmit Data O
RMII_TXD0
RGMII_NULL/MII_CRS/
MII Carrier Sense I
RMII_NULL
RGMII_TXCK/MII_TXCK/ RGMII/MII/RMII Transmit Clock: Output Pin for RGMII, Input
I/O
RMII_TXCK Pin for MII/RMII
RGMII_TXCTL/MII_TXEN/ RGMII Transmit Control/MII Transmit Enable/RMII Transmit
I/O
RMII_TXEN Enable: Output Pin for RGMII/RMII, Input Pin for MII
RGMII_NULL/MII_TXERR/
MII Transmit Error O
RMII_NULL
RGMII_CLKIN/MII_COL/
RGMII Transmit Clock from External/MII Collision Detect I
RMII_NULL
MDC RGMII/MII/RMII Management Data Clock O
MDIO RGMII/MII/RMII Management Data Input and Output I/O
The internal DMA of EMAC transfers data between host memory and internal RX/TX FIFO with a linked list of descriptors.
Each descriptor is consisted of four words, and contains some necessary information to transfer TX and RX frames. The
descriptor list structure is shown in figure 9-12. The address of each descriptor must be 32-bit aligned.
2nd: Buffer Size 2nd: Buffer Size 2nd: Buffer Size 2nd: Buffer Size
2rd: Buffer Addr 2rd: Buffer Addr 2rd: Buffer Addr 2rd: Buffer Addr
4th: Next Desc 4th: Next Desc 4th: Next Desc 4th: Next Desc
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 641
Interfaces
Bits Description
TX_DESC_CTL
31 When set, current descriptor can be used by DMA. This bit is cleared by DMA when the whole frame is transmitted
or all data in current descriptors buffer are transmitted.
30:17 Reserved
TX_HEADER_ERR
16
When set, the checksum of transmitted frames header is wrong.
15 Reserved
TX_LENGHT_ERR
14
When set, the length of transmitted frame is wrong.
13 Reserved
TX_PAYLOAD_ERR
12
When set, the checksum of transmitted frames payload is wrong.
11 Reserved
TX_CRS_ERR
10
When set, carrier is lost during transmission.
TX_COL_ERR_0
9
When set, the frame is aborted because of collision after contention period.
TX_COL_ERR_1
8
When set, the frame is aborted because of too many collisions.
7 Reserved.
TX_COL_CNT
6:3
The number of collisions before transmission.
TX_DEFER_ERR
2
When set, the frame is aborted because of too much deferral.
TX_UNDERFLOW_ERR
1
When set, the frame is aborted because of TX FIFO underflow error.
TX_DEFER
0
When set in Half-Duplex mode, the EMAC defers the frame transmission.
Bits Description
TX_INT_CTL
31
When set and the current frame have been transmitted, the TX_INT in Interrupt Status Register will be set.
LAST_DESC
30
When set, current descriptor is the last one for current frame.
FIR_DESC
29
When set, current descriptor is the first one for current frame.
CHECKSUM_CTL
28:27
These bits control to insert checksums in transmit frame.
CRC_CTL
26
When set, CRC field is not transmitted.
25:11 Reserved
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 642
Interfaces
BUF_SIZE
10:0
The size of buffer specified by current descriptor.
Bits Description
BUF_ADDR
31:0
The address of buffer specified by current descriptor.
Bits Description
NEXT_DESC_ADDR
31:0
The address of next descriptor. It must be 32-bit aligned.
Bits Description
RX_DESC_CTL
31 When set, current descriptor can be used by DMA. This bit is cleared by DMA when complete frame is received or
current descriptors buffer is full.
RX_DAF_FAIL
30
When set, current frame dont pass DA filter.
RX_FRM_LEN
When LAST_DESC is not set and no error bit is set, this field is the length of received data for current frame.
29:16
When LAST_DESC is set, RX_OVERFLOW_ERR and RX_NO_ENOUGH_BUF_ERR are not set, this field is the length of
receive frame.
15 Reserved
RX_NO_ENOUGH_BUF_ERR
14
When set, current frame is clipped because of no enough buffer.
RX_SAF_FAIL
13
When set, current fame dont pass SA filter.
12 Reserved.
RX_OVERFLOW_ERR
11
When set, a buffer overflow error occurred and current frame is wrong.
10 Reserved
FIR_DESC
9
When set, current descriptor is the first descriptor for current frame.
LAST_DESC
8
When set, current descriptor is the last descriptor for current frame.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 643
Interfaces
RX_HEADER_ERR
7
When set, the checksum of frames header is wrong.
RX_COL_ERR
6
When set, there is a late collision during reception in half-duplex mode.
5 Reserved.
RX_LENGTH_ERR
4
When set, the length of current frame is wrong.
RX_PHY_ERR
3
When set, the receive error signal from PHY is asserted during reception.
2 Reserved.
RX_CRC_ERR
1
When set, the CRC filed of received frame is wrong.
RX_PAYLOAD_ERR
0
When set, the checksum or length of received frames payload is wrong.
Bits Description
RX_INT_CTL
31
When set and a frame have been received, the RX_INT will not be set.
30:11 Reserved
BUF_SIZE
10:0
The size of buffer specified by current descriptor.
Bits Description
BUF_ADDR
31:0
The address of buffer specified by current descriptor.
Bits Description
NEXT_DESC_ADDR
31:0
The address of next descriptor. This field must be 32-bit aligned.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 644
Interfaces
00: 1000Mbps
3:2 R/W 0x0
11: 100Mbps
10: 10Mbps
01: Reserved
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 645
Interfaces
LOOPBACK
1 R/W 0x0
0: Disable
1: Enable
DUPLEX
0 R/W 0x0
0: Half-duplex
1: Full-duplex
1 R/W 0x0
0: RX DMA and TX DMA have same priority
1: RX DMA has priority over TX DMA
SOFT_RST
When this bit is set, soft reset all registers and logic. All clock inputs must be
0 R/W 0x0
valid before soft rest. This bit is cleared internally when the reset operation
is completed fully. Before write any register, this bit should read a 0.
13 R/W 0x0
0: Disable early receive interrupt enable
1: Enable early receive interrupt enable
RX_OVERFLOW_INT_EN
12 R/W 0x0
0: Disable overflow interrupt
1: Enable overflow interrupt
RX_TIMEOUT_INT_EN
11 R/W 0x0
0: Disable receive timeout interrupt
1: Enable receive timeout interrupt
10 R/W 0x0 RX_DMA_STOPPED_INT_EN
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 647
Interfaces
9 R/W 0x0
0: Disable receive buffer unavailable interrupt
1: Enable receive buffer unavailable interrupt
RX_INT_EN
8 R/W 0x0
0: Disable receive interrupt
1: Enable receive interrupt
7:6
TX_EARLY_INT_EN
5 R/W 0x0
0: Disable early transmit interrupt
1: Enable early transmit interrupt
TX_UNDERFLOW_INT_EN
4 R/W 0x0
0: Disable underflow interrupt
1: Enable underflow interrupt
TX_TIMEOUT_INT_EN
3 R/W 0x0
0: Disable transmit timeout interrupt
1: Enable transmit timeout interrupt
TX_BUF_UA_INT_EN
2 R/W 0x0
0: Disable transmit buffer available interrupt
1: Enable transmit buffer available interrupt
TX_DMA_STOPPED_INT_EN
1 R/W 0x0
0: Disable transmit DMA FSM stopped interrupt
1: Enable transmit DMA FSM stopped interrupt
TX_INT_EN
0 R/W 0x0
0: Disable transmit interrupt
1: Enable transmit interrupt
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 648
Interfaces
30 R/W 0x0 0: Allow to transmit frames no more than 2,048 bytes (10,240 if
JUMBO_FRM_EN is set) and cut off any bytes after that
1: Allow to transmit frames of up to 16,384 bytes
29:0 / / /
30 R/W 0x0
0: Stop TX DMA after the completion of current frame transmission.
1: Start and run TX DMA.
29:11 / / /
TX_TH
The threshold value of TX DMA FIFO. When TX_MD is 0, transmission starts
when the size of frame in TX DMA FIFO is greater than the threshold. In
addition, full frames with a length less than the threshold are transferred
automatically.
10:8 R/W 0x0
000: 64
001: 128
010: 192
011: 256
Others: Reserved
7:2 / / /
TX_MD
1 R/W 0x0 0: Transmission starts after the number of data in TX DAM FIFO is greater
than TX_TH
1: Transmission starts after a full frame located in TX DMA FIFO
FLUSH_TX_FIFO
The functionality that flush the data in the TX FIFO.
0 R/W 0x0
0: Enable
1: Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 649
Interfaces
0: Disable
1: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 650
Interfaces
30 R/W 0x0 0: Allow to receive frames less than or equal to 2,048 bytes (10,240 if
JUMBO_FRM_EN is set) and cuts off any bytes received after that
1: Allow to receive frames of up to 16,384 bytes
JUMBO_FRM_EN
29 R/W 0x0 When set, allows Jumbo frames of 9,018 bytes without reporting a giant
frame error in the receive frame status.
STRIP_FCS
28 R/W 0x0 When set, strip the Pad/FCS field on received frames only when the lengths
field value is less than or equal to 1,500 bytes.
CHECK_CRC
27 R/W 0x0
When set, calculate CRC and check the IPv4 Header Checksum.
26:18 / / /
RX_PAUSE_FRM_MD
30 R/W 0x0
0: Stop RX DMA after finish receiving current frame
1: Start and run RX DMA
29:25 / / /
RX_FIFO_FLOW_CTL
RX_FLOW_CTL_TH_DEACT
The threshold for deactivating flow control in both half-duplex mode and
full-duplex mode.
00: 64
01: 32
10: 96
11: 128
RX_ERR_FRM
3 R/W 0x0
0: RX DMA drops frames with error
1: RX DMA forwards frames with error
RX_RUNT_FRM
2 R/W 0x0 When set, forward undersized frames with no error and length less than
64bytes.
RX_MD
0: RX DMA reads data from RX DMA FIFO to host memory after the number
1 R/W 0x0
of data in RX DAM FIFO is greater than RX_TH
1: RX DMA reads data from RX DMA FIFO to host memory after a complete
frame has been written to RX DMA FIFO
FLUSH_RX_FRM
The functionality that flush the frames when receive descriptors/buffers is
0 R/W 0x0 unavailable.
0: Enable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 652
Interfaces
1: Disable
31 R/W 0x0
0: Enable address filter
1: Disable address filter
30:18 / / /
DIS_BROADCAST
17 R/W 0x0
0: Receive all broadcast frames
1: Drop all broadcast frames
RX_ALL_MULTICAST
16 R/W 0x0
0: Filter multicast frame according to HASH_MULTICAST
1: Receive all multicast frames
15:14 / /
CTL_FRM_FILTER
9 R/W 0x0 0: Filter multicast frames by comparing the DA field with the values in DA
MAC address registers
1: Filter multicast frames according to the hash table
HASH_UNICAST
8 R/W 0x0 0: Filter unicast frames by comparing the DA field with the values in DA MAC
address registers
1: Filter unicast frames according to the hash table
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 653
Interfaces
7 / / /
SA_FILTER_EN
0 R/W 0x0 0: Receive the frames that pass the SA/DA address filter
1: Receive all frames and update the result of address filter(pass or fail) in
the receive status word
000: 16
22:20 R/W 0x0
001: 32
010: 64
011: 128
Others: Reserved
19:17 / / /
PHY_ADDR
16:12 R/W 0x0
Select a PHY device from 32 possible candidates.
11:9 / / /
PHY_REG_ADDR
8:4 R/W 0x0
Select register in the selected PHY device
3:2 / / /
MII_WR
1 R/W 0x0
0: Read register in selected PHY and return data in EMAC_GMII_DATA
1: Write register in selected PHY using data in EMAC_GMII_DATA
MII_BUSY
This bit indicates that a read or write operation is in progress. When
prepared the data and register address for a write operation or the register
0 R/W 0x0
address for a read operation, set this bit and start to access register in PHY.
When this bit is cleared automatically, the read or write operation is over
and the data in EMAC_GMII_DATA is valid for a read operation.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 655
Interfaces
31 R/W 0x0 0: MAC address N(N: 1~7) is not valid, and it will be ignored by the address
filter
1: MAC address N(N:1~7) is valid
MAC_ADDR_TYPE
1: MAC address N(N:1~7) is used to compare with the source address of the
30 R/W 0x0
received frame
0: MAC address n(N:1~7) is used to compare with the destination address of
the received frame
MAC_ADDR_BYTE_CTL
MAC address byte control mask.
29:24 R/W 0x0
The lower bit of mask controls the lower byte of in MAC address N(N:1~7).
When the bit of mask is 1, do not compare the corresponding byte.
23:16 / / /
MAC_ADDR_N_HIGH
15:0 R/W 0xFFFF
The upper 16bits of the MAC address N(N:1~7).
MAC_ADDR_N_LOW
31:0 R/W 0xFFFFFFFF
The lower 32bits of MAC address N(N:1~7).
2:1 R 0x0
00: 2.5 MHz
01: 25 MHz
10: 125 MHz
RGMII_LINK_MD
The link Mode of RGMII interface
0 R 0x0
0: Half-Duplex
1: Full-Duplex
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 658
Interfaces
9.8. TSC
9.8.1. Overview
The transport stream controller(TSC) is responsible for de-multiplexing and pre-processing the inputting multimedia
data defined in ISO/IEC 13818-1.
The transport stream controller receives multimedia data stream from SSI (Synchronous Serial Port)/SPI (Synchronous
Parallel Port) inputs and de-multiplexing the data into Packets by PID (Packet Identify). Before the Packet to be store to
memory by DMA, it can be pre-processing by the Transport Stream Descrambler.
The transport stream controller can be used for almost all multi-media application cases, example: DVB Set top Box,
IPTV, Streaming-media Box, multi-media players and so on.
Features:
Supports industry-standard AMBA Host Bus (AHB) and it is fully compliant with the AMBA Specification, Revision
2.0. Supports 32-bit Little Endian bus.
Supports AHB 32-bit bus width
One external Synchronous Parallel Interface (SPI) or one external Synchronous Serial Interface (SSI)
32 channels PID filter for TSF
Multiple transport stream packet (188, 192, 204) format support
SPI and SSI timing parameters are configurable
Hardware packet synchronous byte error detecting
Hardware PCR packet detecting
Configurable SPI transport stream generator for streams in DRAM memory
DMA is supported for transferring data
Interrupt is supported
Supports DVB-CSA V1.1 Descrambler
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 659
Interfaces
To AHB
Register
TSC Control
TSG
SPI/S
TSD0
PORT0
PORT0 SI MUX TSF0
To Memory
SSI TSD1
PORT1 MUX TSF1
Internal
SPI/S TSD2
MUX TSF2 DMA
PORT2 SI
SSI TSD3
PORT3 MUX TSF3
TSD4
MUX TSF4
Note:
TSC TS Controller
TSF TS Filter
TSD TS Descrambler
TSG TS Generator
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 661
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 662
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 663
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 664
Interfaces
Bit Definition
7:5 Reserved
SSI data order
4 0: MSB first for one byte data
1: LSB first for one byte data
CLOCK signal polarity
3 0: Rise edge capturing
31:24 R/W 0x0 1: Fall edge capturing
ERROR signal polarity
2 0: High level active
1: Low level active
DVALID signal polarity
1 0: High level active
1: Low level active
PSYNC signal polarity
0 0: High level active
1: Low level active
TSInPort2Par
TS Input Port2 Parameters
Bit Definition
7:5 Reserved
SSI data order
4 0: MSB first for one byte data
1: LSB first for one byte data
CLOCK signal polarity
3 0: Rise edge capturing
23:16 R/W 0x0
1: Fall edge capturing
ERROR signal polarity
2 0: High level active
1: Low level active
DVALID signal polarity
1 0: High level active
1: Low level active
PSYNC signal polarity
0 0: High level active
1: Low level active
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 665
Interfaces
TSInPort1Par
TS Input Port1 Parameters
Bit Definition
7:5 Reserved
SSI data order
4 0: MSB first for one byte data
1: LSB first for one byte data
CLOCK signal polarity
3 0: Rise edge capturing
15:8 R/W 0x0 1: Fall edge capturing
ERROR signal polarity
2 0: High level active
1: Low level active
DVALID signal polarity
1 0: High level active
1: Low level active
PSYNC signal polarity
0 0: High level active
1: Low level active
TSInPort0Par
TS Input Port0 Parameters
Bit Definition
7:5 Reserved
SSI data order
4 0: MSB first for one byte data
1: LSB first for one byte data
CLOCK signal polarity
3 0: Rise edge capturing
7:0 R/W 0x0 1: Fall edge capturing
ERROR signal polarity
2 0: High level active
1: Low level active
DVALID signal polarity
1 0: High level active
1: Low level active
PSYNC signal polarity
0 0: High level active
1: Low level active
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 666
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 667
Interfaces
0: Disable
8 R/W 0x0
1: Enable
If enable check SYNC byte and an error SYNC byte is receiver, TS Generator
would come into PAUSE state. If the correspond interrupt is enable, the
interrupt would happen.
7:3 / / /
TSGPauseBit
Pause Bit for TS Generator
2 R/W 0x0 Write 1 to pause TS Generator. TS Generator would stop fetch new data
from DRAM. After finishing this operation, this bit will clear to zero by
hardware. In PAUSE state, write 1 to resume this state.
TSGStopBit
Stop Bit for TS Generator
1 R/W 0x0 Write 1 to stop TS Generator. TS Generator would stop fetch new data
from DRAM. The data already in its FIFO should be sent to TS filter. After
finishing this operation, this bit will clear to zero by hardware.
TSGStartBit
Start Bit for TS Generator
0 R/W 0x0 Write 1 to start TS Generator. TS Generator would fetch data from DRAM
and generate SPI stream to TS filter. This bit will clear to zero by hardware
after TS Generator is running.
Note: This bit is only used for 192 bytes packet size.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 669
Interfaces
6:2 / / /
PktSize
Packet Size
Byte Size for one TS packet
1:0 R/W 0x0
0: 188 bytes
Others: Reserved
0: Disable
19 R/W 0x0
1: Enable
If set this bit, the interrupt would assert to CPU when all data in external
DRAM are sent to TS PID filter.
TSGFFIE
TS Generator (TSG) Full Finish Interrupt Enable
18 R/W 0x0
0: Disable
1: Enable
TSGHFIE
TS Generator (TSG) Half Finish Interrupt Enable
17 R/W 0x0
0: Disable
1: Enable
TSGErrSyncByteIE
TS Generator (TSG) Error Sync Byte Interrupt Enable
16 R/W 0x0
0: Disable
1: Enable
15:4 / / /
TSGEndSts
3 R/W 0x0 TS Generator (TSG) End Status
Write 1 to clear it.
TSGFFSts
2 R/W 0x0 TS Generator (TSG) Full Finish Status
Write 1 to clear it.
1 R/W 0x0 TSGHFSts
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 670
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 671
Interfaces
2 R/W 0x0
0: Disable TSF Input
1: Enable TSF Input
1 / / /
TSFGSR
TSF Global Soft Reset
0 R/W 0x0 Writing 1 by software will reset all status and state machine of TSF. And it
is cleared by hardware after reset.
Writing 0 by software has no effect.
Note: This bit is only used for 192 bytes packet size.
6:2 / / /
PktSize
Packet Size
Byte Size for one TS packet
0: Disable
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 673
Interfaces
1: Enable
15:4 / / /
TSFFOIS
3 R/W 0x0 TS PID Filter (TSF) Internal FIFO Overrun Status
Write 1 to clear it.
TSFPPDIS
2 R/W 0x0 TS PCR Packet Found Status
When it is 1, one TS PCR Packet is found. Write 1 to clear it.
TSFCOIS
TS PID Filter (TSF) Channel Overlap Status
1 R 0x0
It is global status for 32 channel. It would clear to zero after all channels
status bits are cleared.
TSFCDIS
TS PID Filter (TSF) Channel DMA status
0 R 0x0
It is global status for 32 channel. It would clear to zero after all channels
status bits are cleared.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 675
Interfaces
0: Disable
31:0 R/W 0x0
1: Enable
These bits should not be changed during the corresponding channel enable.
These bits should not be changed during the corresponding channel enable.
CHIND
Channel Index
4:0 R/W 0x0 This value is the channel index for channel private registers access.
Range is from 0x00 to 0x1f.
Address range of channel private registers is 0x40~0x7f.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 677
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 679
Interfaces
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 680
Electrical Characteristics
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 681
Electrical Characteristics
Absolute Maximum Ratings are those values beyond which damage to the device may occur. Table 10-1 specifies the
absolute maximum ratings over the operating junction temperature range of commercial and extended temperature
devices. Functional operation of the device at these or any other conditions beyond those indicated in the operational
sections of this standard may damage to the device.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 682
Electrical Characteristics
All H5 modules are used under the operating Conditions contained in Table 10-2.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 683
Electrical Characteristics
KEYADC is an analog-to-digital(ADC) converter for key application. Table 10-4 lists KEYADC electrical characteristics.
H5 contains two external input clocks:X24MIN and X32KIN, two output clocks:X24MOUT and X32KOUT.The 24.000MHz
frequency is used to generate the main source clock for PLL and the main digital blocks, the clock is provided through
X24MIN.Table 10-5 lists the 24MHz crystal specifications.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 684
Electrical Characteristics
The 32768Hz frequency is used for low frequency operation. It supplies the wake-up domain for operation in lowest
power mode. The clock is provided through X32KIN. Table 10-6 lists the 32768Hz crystal specifications.
Parameter Sub Parameter Power Supply Condition Min Typ Max Unit
Internal Core CPU VDD-CPUX @1.1V - - TBD mA
Power SYS VDD-SYS @1.2V - - TBD mA
VCC-IO,
@3.3V
VCC-PC,
@2.5V - - TBD mA
VCC-PD,
@1.8V
GPIO Power VCC-PG
Memory I/O Power VCC-DRAM @1.5V - - TBD mA
Oscillator VCC-PLL @3.3V - - TBD mA
USB 3.0V Power of PHY VCC-USB @3.3V - - TBD mA
HDMI HVCC @3.3V - - TBD mA
RTC Power VCC-RTC @3.3V - - TBD mA
ADC Analog Power AVCC @3.3V - - TBD mA
DAC Analog Power AVCC @3.3V - - TBD mA
PLL Power VCC-PLL @3.3V - - TBD mA
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 685
Electrical Characteristics
Figure 10-2. EDO Type Serial Access after Read Cycle Timing (SAM1)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 686
Electrical Characteristics
Figure 10-3. Extending EDO Type Serial Access Mode Timing (SAM2)
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 687
Electrical Characteristics
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 688
Electrical Characteristics
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 689
Electrical Characteristics
tCK
tOSKEW
tODLY
CLK
CMD, DATA
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 690
Electrical Characteristics
tCK
tISKEW
tIDLY
CLK
CMD, DATA
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 691
Electrical Characteristics
tVT
tVBP
tVSPW
Vsync
Hsync
Vertical invalid data period DH1 DH2 DHy Vertical invalid data period
LD[23..0]
Odd/Even field
tVT
tVSPW
Vsync
tVBP
1//2H
Hsync
LD[23..0] Vertical invalid data period DH1 DH2 DHy Vertical invalid data period
Even field
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 692
Electrical Characteristics
tHT
tHBP
tHSPW
Hsync
tDCLK
DCLK
LDE
tHT
tHBP
tHSPW
Hsync
tDCLK
DCLK
One Pixel
LDE
tperiod
thigh-level
PCLK
tdst tdhd
DATA
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 694
Electrical Characteristics
Tch Tcl
TX_CLK
Ts Th
TXD[3:0]
TX_EN
Tch Tcl
RX_CLK
Td
RXD[3:0]
RX_DV Valid Data
RX_ER
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 695
Electrical Characteristics
IR_NEC
Tlh Tll Tp T1 T0
Tf
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 696
Electrical Characteristics
Register Setting:
Data length(DLS in LCR[1:0]) = 3 (8bit)
Stop bit length(STOP in LCR[2]) = 1 (2bit)
Parity enable(PEN in LCR[3]) = 1
RX FIFO
vaild data
DATA
tRXSF
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 697
Electrical Characteristics
nCTS
tDCTS tACTS
Register Setting:
RTS Trigger level(RT in FCR[7:6]) = 3 (De-asserted nRTS when FIFO valid data number reach FIFO depth-2)
RX FIFO (1)
FD -3 FD-2 0
DATA NUM
nRTS
tDRTS tARTS
SCL
tDH tDS
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 698
Electrical Characteristics
Data
T1
Clock
T2
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 699
Electrical Characteristics
T1 T2 T3
VCC
tb
RST
ta
CLK
tc
I/O
VCC
te
RST
CLK
tf
I/O
td
Card Answer
Undefined
(6). ta: The card shall set I/O to state H within 200 clock cycles (delay ta) after the clock signal is applied to CLK (at time
T1+ta).
(7). tb: The cold reset results from maintaining RST at state L for at least 400 clock cycles (delay tb) after the clock signal
is applied to CLK (at time T1+tb).
(8). tc: The answer on I/O shall begin between 400 and 40000 clock cycles (delay tc) after the rising edge of the signal
on RST (at time T2+tc).
(9). td: The card shall set I/O to state H within 200 clock cycles (delay td) after state L is applied to RST (at time T4+td).
(10). te: The controller initiates a warm reset (at time T4) by putting RST to state L for at least 400 clock cycles (delay te)
while VCC remains powered and CLK provided with a suitable and stabled clock signal.
(11). tf: The card answer on I/O shall begin between 400 and 40000 clock cycles (delay tf) after the rising edge of the
signal on RST (at time T5+tf).
(12). f is the frequency of clock.
The following figure shows an example of the power-up sequence for H5 device. During the entire power-up sequence,
the RESET pin must be held on low until all power domains are stable. The other power domains not in Figure 10-29 can
be turned on upon the software request.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 701
Electrical Characteristics
For reliability and operability concerns, the absolute maximum junction temperature of H5 has to be below 125C.The
testing PCB is based on 4 layers. The following thermal resistance characteristics in Table 10-20 is based on JEDEC
JESD51 standard, because the system design and temperature could be different with JEDEC JESD51 , the simulating
result data is a reference only, please prevail in the actual application condition test.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 702
Electrical Characteristics
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 703
Appendix
Appendix
Pin Map
The following figure shows the pin maps of the 347-pin FBGA package of H5 processor.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 704
Appendix
Package Dimension
The following diagram shows the package dimension of H5 processor, includes the top, bottom, side views and details of the 14mmx14mm package.
H5 Datasheet(Revision 1.0) Copyright 2016 Allwinner Technology Co.,Ltd. All Rights Reserved. Page 705