zqy 2 years ago
parent
commit
c3988a79ad
100 changed files with 20246 additions and 0 deletions
  1. 5 0
      device/bossay/hi3861_l0/BUILD.gn
  2. 3687 0
      device/bossay/hi3861_l0/NOTICE
  3. 127 0
      device/bossay/hi3861_l0/OAT.xml
  4. 112 0
      device/bossay/hi3861_l0/README.md
  5. 112 0
      device/bossay/hi3861_l0/README_zh.md
  6. 57 0
      device/bossay/hi3861_l0/bundle.json
  7. BIN
      device/bossay/hi3861_l0/figures/en-us_image_0000001086800826.png
  8. BIN
      device/bossay/hi3861_l0/figures/zh-cn_image_0000001086800826.png
  9. 176 0
      device/bossay/hi3861_l0/hi3861_adapter/LICENSE
  10. 23 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiaware/BUILD.gn
  11. 105 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiaware/source/hal_wifiaware.c
  12. 34 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiservice/BUILD.gn
  13. 990 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiservice/source/wifi_device.c
  14. 174 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiservice/source/wifi_device_util.c
  15. 96 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiservice/source/wifi_device_util.h
  16. 438 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiservice/source/wifi_hotspot.c
  17. 37 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/BUILD.gn
  18. 28 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_adc.c
  19. 44 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_flash.c
  20. 113 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_gpio.c
  21. 35 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_gpio_ex.c
  22. 55 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_i2c.c
  23. 23 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_i2c_ex.c
  24. 63 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_pwm.c
  25. 84 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_spi.c
  26. 68 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_uart.c
  27. 34 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_watchdog.c
  28. 28 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_lowpower.c
  29. 22 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_reset.c
  30. 23 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/update/BUILD.gn
  31. 207 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/update/hal_hota_board.c
  32. 22 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/utils/file/BUILD.gn
  33. 53 0
      device/bossay/hi3861_l0/hi3861_adapter/hals/utils/file/src/hal_file.c
  34. 37 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/BUILD.gn
  35. 43 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/BUILD.gn
  36. 201 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/LICENSE.txt
  37. 10 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/README.OpenSource
  38. 38 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/cmsis_liteos.c
  39. 1386 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/cmsis_liteos2.c
  40. 43 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/cmsis_os.h
  41. 1215 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/cmsis_os2.h
  42. 56 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/hos_cmsis_adp.h
  43. 48 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/posix/BUILD.gn
  44. 12 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/posix/include/README
  45. 46 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/posix/include/libc.h
  46. 43 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/posix/include/limits.h
  47. 49 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/posix/include/pthread.h
  48. 285 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/posix/src/file.c
  49. 50 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/posix/src/libc.c
  50. 262 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/posix/src/pthread.c
  51. 232 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/posix/src/pthread_attr.c
  52. 274 0
      device/bossay/hi3861_l0/hi3861_adapter/kal/posix/src/time.c
  53. 94 0
      device/bossay/hi3861_l0/iot_hardware_hals/include/iot_adc.h
  54. 340 0
      device/bossay/hi3861_l0/iot_hardware_hals/include/iot_gpio_ex.h
  55. 78 0
      device/bossay/hi3861_l0/iot_hardware_hals/include/iot_i2c_ex.h
  56. 368 0
      device/bossay/hi3861_l0/iot_hardware_hals/include/iot_spi.h
  57. BIN
      device/bossay/hi3861_l0/sdk_liteos/.sconsign.dblite
  58. 0 0
      device/bossay/hi3861_l0/sdk_liteos/3rd_sdk/demolink/libs/.gitignore
  59. 42 0
      device/bossay/hi3861_l0/sdk_liteos/BUILD.gn
  60. 31 0
      device/bossay/hi3861_l0/sdk_liteos/Makefile
  61. 3687 0
      device/bossay/hi3861_l0/sdk_liteos/NOTICE
  62. 179 0
      device/bossay/hi3861_l0/sdk_liteos/README.md
  63. 556 0
      device/bossay/hi3861_l0/sdk_liteos/SConstruct
  64. 49 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/Makefile
  65. 39 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/SConscript
  66. 31 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/app.json
  67. 33 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_adc.h
  68. 38 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_efuse.h
  69. 35 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_flash.h
  70. 36 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_i2c.h
  71. 53 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_i2s.h
  72. 31 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_io_gpio.h
  73. 45 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_nv.h
  74. 25 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_pwm.h
  75. 86 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_spi.h
  76. 37 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_timer_systick.h
  77. 44 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_tsensor.h
  78. 33 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_uart.h
  79. 22 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_http_client.h
  80. 28 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_io_init.h
  81. 31 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_main.h
  82. 24 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/wifi_softap.h
  83. 24 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/include/wifi_sta.h
  84. 19 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/init/SConscript
  85. 108 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/init/app_io_init.c
  86. 19 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/module_config.mk
  87. 19 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/SConscript
  88. 118 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_adc.c
  89. 257 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_efuse.c
  90. 110 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_flash.c
  91. 125 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_i2c.c
  92. 237 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_i2s.c
  93. 95 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_io_gpio.c
  94. 122 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_nv.c
  95. 73 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_pwm.c
  96. 197 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_sdio_device.c
  97. 30 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_sdio_device.h
  98. 937 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_spi.c
  99. 133 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_timer_systick.c
  100. 123 0
      device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_tsensor.c

+ 5 - 0
device/bossay/hi3861_l0/BUILD.gn

@@ -0,0 +1,5 @@
+# Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved.
+
+group("hi3861_l0") {
+
+}

+ 3687 - 0
device/bossay/hi3861_l0/NOTICE

@@ -0,0 +1,3687 @@
+OPEN SOURCE SOFTWARE NOTICE
+
+Please note we provide an open source software notice for the third party open source software along with this software and/or this software component (in the following just “this SOFTWARE”). The open source software licenses are granted by the respective right holders.
+
+Warranty Disclaimer
+THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
+
+Copyright Notice and License Texts
+
+----------------------------------------------------------------------
+Software: mbed TLS 2.16.6
+
+Copyright notice:
+Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
+Copyright (C) 2016, ARM Limited, All Rights Reserved
+Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
+Copyright (c) 2014-2017, ARM Limited, All Rights Reserved
+Copyright (c) 2016, ARM Limited, All Rights Reserved
+Copyright (c) 2018, Arm Limited, All Rights Reserved
+Copyright (c) 2018, ARM Limited, All Rights Reserved
+Copyright (c) 2015-2019, ARM Limited, All Rights Reserved
+Copyright (C) 2018, Arm Limited, All Rights Reserved
+Copyright (C) 2018, ARM Limited, All Rights Reserved
+Copyright (c) 2017, ARM Limited, All Rights Reserved
+Copyright (C) 2006-2017, ARM Limited, All Rights Reserved
+Copyright (C) 2016-2018, ARM Limited, All Rights Reserved
+Copyright (C) 2018, Arm Limited (or its affiliates), All Rights Reserved
+Copyright (C) 2019, ARM Limited, All Rights Reserved
+Copyright (c) 2012-2016, ARM Limited, All Rights Reserved
+Copyright (c) 2015-2016, ARM Limited, All Rights Reserved
+Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved.
+Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
+Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved
+Copyright (C) 2015-2018, Arm Limited (or its affiliates), All Rights Reserved
+Copyright (C) 2006-2019, Arm Limited (or its affiliates), All Rights Reserved
+Copyright (C) 2016-2019, ARM Limited, All Rights Reserved
+Copyright (C) 2006-2019, ARM Limited, All Rights Reserved
+
+License: Apache License V2.0
+Unless specifically indicated otherwise in a file, files are licensed
+under the Apache 2.0 license, as can be found in: apache-2.0.txt
+
+----------------------------------------------------------------------
+Software: musl 1.2.0
+
+Copyright notice:
+Copyright © 2005-2020 Rich Felker, et al.
+Copyright © 1993,2004 Sun Microsystems or
+Copyright © 2003-2011 David Schultz or
+Copyright © 2003-2009 Steven G. Kargl or
+Copyright © 2003-2009 Bruce D. Evans or
+Copyright © 2008 Stephen L. Moshier or
+Copyright © 2017-2018 Arm Limited
+Copyright © 1994 David Burren.
+Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
+Copyright (c) 2005 Bruce D. Evans and Steven G. Kargl
+Copyright (c) 2011 David Schultz <das@FreeBSD.ORG>
+Copyright (c) 2007 David Schultz <das@FreeBSD.ORG>
+Copyright (c) 2011 David Schultz
+Copyright (c) 1998-2012 Solar Designer
+Copyright (c) 1994 David Burren
+Copyright (c) 2000,2002,2010,2012 Solar Designer
+Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+Copyright (c) 2009-2011, Bruce D. Evans, Steven G. Kargl, David Schultz.
+Copyright (c) 2018, Arm Limited.
+Copyright (c) 2017-2018, Arm Limited.
+Copyright (c) 2005-2008 David Schultz <das@FreeBSD.ORG>
+Copyright (c) 2005-2011 David Schultz <das@FreeBSD.ORG>
+Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans.
+Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+Copyright (c) 2001-2009 Ville Laurikari <vl@iki.fi>
+Copyright (C) 2011 by Valentin Ochs
+
+License: BSD 2-Clause License
+musl as a whole is licensed under the following standard MIT license:
+
+Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Authors/contributors include:
+
+A. Wilcox
+Ada Worcester
+Alex Dowad
+Alex Suykov
+Alexander Monakov
+Andre McCurdy
+Andrew Kelley
+Anthony G. Basile
+Aric Belsito
+Arvid Picciani
+Bartosz Brachaczek
+Benjamin Peterson
+Bobby Bingham
+Boris Brezillon
+Brent Cook
+Chris Spiegel
+Clément Vasseur
+Daniel Micay
+Daniel Sabogal
+Daurnimator
+David Carlier
+David Edelsohn
+Denys Vlasenko
+Dmitry Ivanov
+Dmitry V. Levin
+Drew DeVault
+Emil Renner Berthing
+Fangrui Song
+Felix Fietkau
+Felix Janda
+Gianluca Anzolin
+Hauke Mehrtens
+He X
+Hiltjo Posthuma
+Isaac Dunham
+Jaydeep Patil
+Jens Gustedt
+Jeremy Huntwork
+Jo-Philipp Wich
+Joakim Sindholt
+John Spencer
+Julien Ramseier
+Justin Cormack
+Kaarle Ritvanen
+Khem Raj
+Kylie McClain
+Leah Neukirchen
+Luca Barbato
+Luka Perkov
+M Farkas-Dyck (Strake)
+Mahesh Bodapati
+Markus Wichmann
+Masanori Ogino
+Michael Clark
+Michael Forney
+Mikhail Kremnyov
+Natanael Copa
+Nicholas J. Kain
+orc
+Pascal Cuoq
+Patrick Oppenlander
+Petr Hosek
+Petr Skocik
+Pierre Carrier
+Reini Urban
+Rich Felker
+Richard Pennington
+Ryan Fairfax
+Samuel Holland
+Segev Finer
+Shiz
+sin
+Solar Designer
+Stefan Kristiansson
+Stefan O'Rear
+Szabolcs Nagy
+Timo Teräs
+Trutz Behn
+Valentin Ochs
+Will Dietz
+William Haddon
+William Pitcock
+
+Portions of this software are derived from third-party works licensed
+under terms compatible with the above MIT license:
+
+The TRE regular expression implementation (src/regex/reg* and
+src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
+under a 2-clause BSD license (license text in the source files). The
+included version has been heavily modified by Rich Felker in 2012, in
+the interests of size, simplicity, and namespace cleanliness.
+
+Much of the math library code (src/math/* and src/complex/*) is
+Copyright © 1993,2004 Sun Microsystems or
+Copyright © 2003-2011 David Schultz or
+Copyright © 2003-2009 Steven G. Kargl or
+Copyright © 2003-2009 Bruce D. Evans or
+Copyright © 2008 Stephen L. Moshier or
+Copyright © 2017-2018 Arm Limited
+and labelled as such in comments in the individual source files. All
+have been licensed under extremely permissive terms.
+
+The ARM memcpy code (src/string/arm/memcpy_el.S) is Copyright © 2008
+The Android Open Source Project and is licensed under a two-clause BSD
+license. It was taken from Bionic libc, used on Android.
+
+The implementation of DES for crypt (src/crypt/crypt_des.c) is
+Copyright © 1994 David Burren. It is licensed under a BSD license.
+
+The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
+originally written by Solar Designer and placed into the public
+domain. The code also comes with a fallback permissive license for use
+in jurisdictions that may not recognize the public domain.
+
+The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
+Valentin Ochs and is licensed under an MIT-style license.
+
+The x86_64 port was written by Nicholas J. Kain and is licensed under
+the standard MIT terms.
+
+The mips and microblaze ports were originally written by Richard
+Pennington for use in the ellcc project. The original code was adapted
+by Rich Felker for build system and code conventions during upstream
+integration. It is licensed under the standard MIT terms.
+
+The mips64 port was contributed by Imagination Technologies and is
+licensed under the standard MIT terms.
+
+The powerpc port was also originally written by Richard Pennington,
+and later supplemented and integrated by John Spencer. It is licensed
+under the standard MIT terms.
+
+All other files which have no copyright comments are original works
+produced specifically for use as part of this library, written either
+by Rich Felker, the main author of the library, or by one or more
+contibutors listed above. Details on authorship of individual files
+can be found in the git version control history of the project. The
+omission of copyright and license comments in each file is in the
+interest of source tree size.
+
+In addition, permission is hereby granted for all public header files
+(include/* and arch/*/bits/*) and crt files intended to be linked into
+applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
+the copyright notice and permission notice otherwise required by the
+license, and to use these files without any requirement of
+attribution. These files include substantial contributions from:
+
+Bobby Bingham
+John Spencer
+Nicholas J. Kain
+Rich Felker
+Richard Pennington
+Stefan Kristiansson
+Szabolcs Nagy
+
+all of whom have explicitly granted such permission.
+
+This file previously contained text expressing a belief that most of
+the files covered by the above exception were sufficiently trivial not
+to be subject to copyright, resulting in confusion over whether it
+negated the permissions granted in the license. In the spirit of
+permissive licensing, and of not having licensing issues being an
+obstacle to adoption, that text has been removed.
+----------------------------------------------------------------------
+Software:WPA supplicant 2.9
+
+Copyright notice:
+Copyright (c) 2002-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2000-2003 Intel Corporation
+Copyright (c) 2006-2007 Sony Corporation
+Copyright (c) 2008-2009 Atheros Communications
+Copyright (c) 2009, Jouni Malinen <j@w1.fi>
+Copyright 2008 Atheros Communications
+Copyright (c) 2009-2012, Masashi Honma <masashi.honma@gmail.com>
+Copyright (c) 2007-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2008-2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2008, Jouni Malinen <j@w1.fi>
+Copyright (c) 2008-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009-2010, Jouni Malinen <j@w1.fi>
+Copyright 2008 Atheros Communications.
+Copyright (c) 2006-2007 Sony Corporation. All Rights Reserved.
+Copyright (c) 2010, Atheros Communications, Inc.
+Copyright (c) 2006-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005, Jouni Malinen <j@w1.fi>
+Copyright (c) 2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2013, Qualcomm Atheros, Inc.
+Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2019, The Linux Foundation
+Copyright (c) 2010, Jouni Malinen <j@w1.fi>
+Copyright (c) 2010-2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2006, Jouni Malinen <j@w1.fi>
+Copyright (c) 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2012-2013, Qualcomm Atheros, Inc.
+Copyright (c) 2012-2014, Qualcomm Atheros, Inc.
+Copyright (c) 2003-2006, Jouni Malinen <j@w1.fi>
+Copyright (c) 2017, Qualcomm Atheros, Inc.
+Copyright (c) 2009-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2014-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2007, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2006, 2012, Jouni Malinen <j@w1.fi>
+Copyright 2007		Andy Green <andy@warmcat.com>
+Copyright 2009		Johannes Berg <johannes@sipsolutions.net>
+Copyright (c) 2003, 2004 David Young.  All rights reserved.
+Copyright (c) 2002-2005, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2009, 2011-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2009, 2012, 2014-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2012-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2009, 2011-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2009, 2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2016, Roshan Pius <rpius@google.com>
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+(c) The contribution was provided directly to me by some other
+person who certified (a), (b) or (c) and I have not modified
+Copyright (c) 2002-2019, Jouni Malinen <j@w1.fi> and contributors
+Copyright (c) 2013-2014, Qualcomm Atheros, Inc.
+Copyright (c) 2003-2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2005, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004, Sam Leffler <sam@errno.com>
+Copyright (c) 2004, Video54 Technologies
+Copyright (c) 2005-2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009, Atheros Communications
+Copyright (c) 2004, 2Wire, Inc
+Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
+Copyright (c) 2016, Sabrina Dubroca <sd@queasysnail.net> and Red Hat, Inc.
+Copyright (c) 2004, Gunter Burchardt <tira@isx.de>
+Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2006, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2004, Instant802 Networks, Inc.
+Copyright (c) 2005-2006, Devicescape Software, Inc.
+Copyright (c) 2007, Johannes Berg <johannes@sipsolutions.net>
+Copyright (c) 2009-2010, Atheros Communications
+Copyright (c) 2002-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2017, Jouni Malinen <j@w1.fi>
+Copyright(c) 2015 Intel Deutschland GmbH
+Copyright (c) 2008, Atheros Communications
+Copyright (c) 2013, Mark Kettenis
+Copyright (c) 2008-2012 Jouke Witteveen
+Copyright (c) 2003-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2010, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2011, Jouni Malinen <j@w1.fi>
+Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
+Copyright 2008 Michael Wu <flamingice@sourmilk.net>
+Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com>
+Copyright 2008 Michael Buesch <m@bues.ch>
+Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com>
+Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
+Copyright 2008 Colin McCabe <colin@cozybit.com>
+Copyright 2015-2017	Intel Deutschland GmbH
+Copyright (C) 2018-2019 Intel Corporation
+Copyright (c) 2010, Atheros Communications
+Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2008, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
+Copyright (c) 2013 Qualcomm Atheros, Inc.
+Copyright (c) 2010, Dan Harkins <dharkins@lounge.org>
+Copyright (c) 2004-2008, 2012-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2009, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2009, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2010-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2013 Cozybit, Inc.
+Copyright (c) 2004-2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2007 <j@w1.fi>
+Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2014-2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2015, Pali Roh��r <pali.rohar@gmail.com>
+Copyright (c) 2015-2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2018, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2014, Qualcomm Atheros, Inc.
+Copyright (c) 2012, Intel Corporation. All rights reserved.
+Copyright 2015	Intel Deutschland GmbH
+Copyright (c) 2003-2008, Jouni Malinen <j@w1.fi>
+Copyright (c) 2018-2019, The Linux Foundation
+Copyright (c) 2003-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011-2014, Qualcomm Atheros, Inc.
+Copyright (c) 2011-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011, Qualcomm Atheros
+Copyright (c) 2009, Atheros Communications, Inc.
+Copyright (c) 2011-2013, Qualcomm Atheros, Inc.
+Copyright (c) 2011-2012, Qualcomm Atheros
+Copyright (c) 2013-2014, cozybit, Inc.  All rights reserved.
+Copyright (c) 2010-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2019, Jouni Malinen <j@w1.fi> and contributors
+Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi> and contributors
+Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011, Atheros Communications, Inc.
+Copyright (c) 2011-2012, Qualcomm Atheros, Inc.
+Copyright(c) 2014, Intel Mobile Communication GmbH.
+Copyright(c) 2014, Intel Corporation. All rights reserved.
+Copyright (C) 2010 The Android Open Source Project
+Copyright (c) 2008-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2012, Intel Corporation
+Copyright (c) 2008 Bernard Gray <bernard.gray@gmail.com>
+Copyright (c) 2014-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2015, Qualcomm Atheros, Inc.
+Copyright (c) 2004-2018, Jouni Malinen <j@w1.fi>
+Copyright (c) 2014-2017, Qualcomm Atheros, Inc.
+Copyright (c) 2012-2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2008 Intel Corporation
+Copyright (c) 2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2018, Mathy Vanhoef
+Copyright (c) 2002-2018, Jouni Malinen <j@w1.fi>
+Copyright (c) 2010-2011, Atheros Communications, Inc.
+Copyright (c) 2002-2009, 2012-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011, Atheros Communications
+Copyright (c) 2018-2019, Toke H?iland-J?rgensen <toke@toke.dk>
+Copyright (c) 2006, Devicescape Software, Inc.
+Copyright (c) 2002-2003, Jouni Malinen <j@w1.fi>
+Copyright 2003-2006, Jouni Malinen <j@w1.fi>
+Copyright 2003-2004, Instant802 Networks, Inc.
+Copyright 2005-2006, Devicescape Software, Inc.
+Copyright 2003, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2004, Instant802 Networks, Inc.
+Copyright (c) 2013-2017, Qualcomm Atheros, Inc.
+Copyright (c) 2011-2017, Qualcomm Atheros, Inc.
+Copyright (c) 2011-2017, Qualcomm Atheros
+Copyright 2002-2003, Instant802 Networks, Inc.
+Copyright (c) 2008-2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2016-2017, Qualcomm Atheros, Inc.
+Copyright (c) 2019 John Crispin <john@phrozen.org>
+Copyright (c) 2007-2008, Intel Corporation
+Copyright (c) 2002-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2016, Qualcomm Atheros, Inc.
+Copyright(c) 2013 - 2016 Intel Mobile Communications GmbH.
+Copyright(c) 2011 - 2016 Intel Corporation. All rights reserved.
+Copyright (c) 2004-2008, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2016-2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2015 Google, Inc.
+Copyright 2003, Instant802 Networks, Inc.
+Copyright 2005, Devicescape Software, Inc.
+Copyright (c) 2012, Michael Braun <michael-dev@fami-braun.de>
+Copyright (c) 2011-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009, Dan Harkins <dharkins@lounge.org>
+Copyright (c) 2008-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005, Sam Leffler <sam@errno.com>
+Copyright (c) 2004-2009, 2011-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2009, 2011-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2010-2011, Atheros Communications
+Copyright (c) 2006-2018, Jouni Malinen <j@w1.fi>
+Copyright (c) 2015, Adrian Nowicki <adinowicki@gmail.com>
+Copyright (c) 2011, Kel Modderman <kel@otaku42.de>
+Copyright (c) 2005-2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
+Copyright (c) 2009, Witold Sowa <witold.sowa@gmail.com>
+Copyright (c) 2009-2010, Witold Sowa <witold.sowa@gmail.com>
+Copyright (c) 2011-2012, Intel Corporation
+Copyright (c) 2005-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2010, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2008, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2010, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2008, 2012, Jouni Malinen <j@w1.fi>
+
+License: BSD License
+Copyright (c) <YEAR>, <OWNER>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+----------------------------------------------------------------------
+Software:Das U-Boot 2019.07
+
+Copyright notice:
+Copyright (C) 2015 Sakari Ailus
+Copyright (C) 2018, STMicroelectronics - All Rights Reserved
+Copyright (c) 2017 Intel Corporation
+Copyright (C) Freescale Semiconductor, Inc. 2006-2007
+(C) Copyright 2010
+Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2015, Intel Corporation
+Copyright (C) 2015-2016 Marvell International Ltd.
+Copyright 2008 Freescale Semiconductor, Inc.
+(C) Copyright 2000
+Copyright 2008-2012 Freescale Semiconductor, Inc.
+Copyright (C) 2016 Google, Inc
+Copyright (C) 2012-2020  ASPEED Technology Inc.
+Copyright 2016 Google, Inc
+(C) Copyright 2002
+(C) Copyright 2003
+(C) Copyright 2004
+(C) Copyright 2016 Linaro
+Copyright (C) 2015-2016 Wills Wang <wills.wang@live.com>
+(C) Copyright 2013 Siemens Schweiz AG
+(C) Heiko Schocher, DENX Software Engineering, hs@denx.de.
+Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2013
+Copyright 2016-2017 Texas Instruments, Inc.
+(C) Copyright 2012
+(C) Copyright 2016-2017
+(C) Copyright 2017 Linaro Ltd.
+(C) Copyright 2008
+Copyright 2011 Linaro Limited
+Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2018
+Copyright (C) 2017 Álvaro Fernández Rojas <noltari@gmail.com>
+Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
+(C) Copyright 2019 Rockchip Electronics Co., Ltd
+(C) Copyright 2009 Magnus Lilja <lilja.magnus@gmail.com>
+(c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
+Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2014 Gateworks Corporation
+Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
+Copyright (C) 2016 Grinn
+(C) Copyright 2014
+(C) Copyright 2009 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Armadeus Systems
+(C) Copyright 2007
+(C) Copyright 2000-2003
+Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
+(C) Copyright 2004-2007, 2012 Freescale Semiconductor, Inc.
+(C) Copyright 2019
+(C) Copyright 2000-2004
+Copyright (c) 2015 Google, Inc
+Copyright (C) Freescale Semiconductor, Inc. 2006.
+Copyright (C) 2016 Stefan Roese <sr@denx.de>
+(C) Copyright 2016
+Copyright (C) 2010 Freescale Semiconductor, Inc.
+(C) Copyright 2019 NXP, Inc.
+Copyright (C) 2008,2010 Freescale Semiconductor, Inc.
+Copyright (C) 2007-2008 Freescale Semiconductor, Inc.
+Copyright (C) 2008 Freescale Semiconductor, Inc.
+Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
+Copyright (C) 2000-2005, DENX Software Engineering
+Copyright (C) Procsys. All rights reserved.
+(C) Copyright 2015 - 2016 Xilinx, Inc.
+Copyright (C) Excito Elektronik i Skåne AB, 2010.
+Copyright (C) 2015, 2019 Stefan Roese <sr@denx.de>
+Copyright (C) 2015 Google, Inc
+Copyright (C) 2011 Freescale Semiconductor, Inc.
+Copyright (C) Excito Elektronik i Skåne AB, All rights reserved.
+(C) Copyright 2007-2008
+Copyright (C) 2013 Ludovic Desroches <ludovic.desroches@atmel.com>
+Copyright (C) 2018 Álvaro Fernández Rojas <noltari@gmail.com>
+Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+Copyright 2014 Maxime Ripard
+Copyright (c) 2016 Google, Inc
+Copyright (C) 2011 The Chromium OS Authors. All rights reserved.
+Copyright (c) 2014 Google, Inc
+Copyright (C) 2000 Ronald G. Minnich
+Copyright (C) 2012 Google Inc.
+Copyright (C) 2018 Ãlvaro Fernández Rojas <noltari@gmail.com>
+(C) Copyright 2014, Cavium Inc.
+(C) Copyright 2014 - 2018 Xilinx, Inc.
+Copyright (C) 2013 The Chromium OS Authors.
+(C) Copyright 2018  Cisco Systems, Inc.
+(C) Copyright 2019  Synamedia
+Copyright 2018 NXP
+Copyright (C) 2017 Marek Behun <marek.behun@nic.cz>
+Copyright (C) 2016 Tomas Hlavacek <tomas.hlavacek@nic.cz>
+Copyright (C) 2012 Altera Corporation <www.altera.com>
+(c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
+(C) Copyright 2011
+Copyright (C) 2015 Atmel Corporation
+(C) 2006 Andrew Victor
+Copyright (C) 2007 Atmel Corporation.
+Copyright (C) SAN People
+(C) 2007 Atmel Corporation.
+Copyright (C) 2006 Atmel Corporation.
+(C) 2008 Atmel Corporation.
+Copyright (C) 2008 Atmel Corporation.
+Copyright (C) 2007 Atmel Corporation
+Copyright (C) 2012-2013 Atmel Corporation.
+Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jrosoft.com>
+Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Copyright (C) 2007 Andrew Victor
+Copyright (C) 2010
+Copyright (C) 2009 Jens Scharsig (jsatng@scharsoft.de)
+Copyright (C) 2005 Ivan Kokshaysky
+Copyright (C) 2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Copyright (C) 2018 Microchip Technology Inc.
+Copyright (C) 2013 Atmel Corporation
+Copyright (C) 2015 Atmel Corporation.
+Copyright (c) 2015 Atmel Corporation
+Copyright (C) 2005-2013 Atmel Corporation
+Copyright (C) 2005 HP Labs
+Copyright (C) 2015 Atmel
+Copyright (C) 2017 Microchip Corporation.
+(C) 2012 - 2013 Atmel Corporation.
+Copyright (C) 2012 Atmel Corporation.
+Copyright (C) 2014 Atmel
+Copyright (C) 2016 Marek Vasut <marex@denx.de>
+Copyright (C) 2013 DENX Software Engineering, hs@denx.de
+(C) Copyright 2014 DENX Software Engineering
+Copyright 2012 Freescale Semiconductor, Inc.
+Copyright 2013 Freescale Semiconductor, Inc.
+Copyright 2007-2012 Freescale Semiconductor, Inc.
+Copyright 2014 Freescale Semiconductor, Inc.
+Copyright 2009-2012 Freescale Semiconductor, Inc.
+Copyright 2011-2012 Freescale Semiconductor, Inc.
+Copyright (C) 2015-2016 Socionext Inc.
+Copyright (C) 2012-2015 Panasonic Corporation
+Copyright (C) 2014      Panasonic Corporation
+Copyright (C) 2013-2014 Panasonic Corporation
+Copyright (C) 2015-2017 Socionext Inc.
+Copyright (C) 2016 Socionext Inc.
+Copyright (C) 2016-2018 Socionext Inc.
+Copyright (C) 2011-2015 Panasonic Corporation
+Copyright (C) 2016      Socionext Inc.
+Copyright (C) 2012-2014 Panasonic Corporation
+Copyright (C) 2011-2015 Copyright (C) 2011-2015 Panasonic Corporation
+Copyright (C) 2016-2017 Socionext Inc.
+Copyright (C) 2017 Socionext Inc.
+Copyright (C) 2008-2009 Samsung Electronics
+(C) Copyright 2017
+(C) Copyright 2017, 2018
+Copyright (c) 2018, Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (C) 2006 David Gibson, IBM Corporation.
+Copyright 2012 Kim Phillips, Freescale Semiconductor.
+Copyright (C) 2014 David Gibson <david@gibson.dropbear.id.au>
+Copyright (C) 2012 David Gibson, IBM Corporation.
+Copyright (C) 2016 Free Electrons
+Copyright (C) 2016 NextThing Co.
+Copyright (c) 2017 Heinrich Schuchardt
+Copyright (C) 2007
+Copyright (C) 2014 STMicroelectronics All Rights Reserved
+Copyright (c) 2018 Microsemi Corporation
+Copyright (c) 2019 Microsemi Corporation
+Copyright 2019, Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (c) 2018 Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (c) 2018 AKASHI Takahiro, Linaro Limited
+Copyright 2006 - 2016 Unified EFI, Inc.<BR>
+Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2019 Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (c) 2018 Heinrich Schuchardt
+Copyright (C) 2018 MediaTek Inc.
+Copyright (c) 2018 Emlid Limited
+Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2013 Texas Instruments
+Copyright (c) 1999-2002 Vojtech Pavlik
+Copyright (c) 2015 Hans de Goede <hdegoede@redhat.com>
+Copyright (C) 2013 Boundary Devices
+Copyright (C) 2013, 2014 Markus Niebel <Markus.Niebel@tq-group.com>
+Copyright (C) 2012 Freescale Semiconductor, Inc.
+Copyright (C) 2013, 2014 TQ Systems (ported SabreSD to TQMa6x)
+Copyright (C) 2014 - 2015 Markus Niebel <Markus.Niebel@tq-group.com>
+Copyright (C) 2013, 2014 TQ Systems
+Copyright (C) 2015 Stefan Roese <sr@denx.de>
+Copyright (C) 2013 Suriyan Ramasami <suriyan.r@gmail.com>
+Copyright (C) 2010  Eric C. Cooper <ecc@cmu.edu>
+(C) Copyright 2009
+Copyright 2011, 2013 Freescale Semiconductor, Inc.
+Copyright (C) 2017
+Copyright 2010-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2013, Texas Instruments, Incorporated - http://www.ti.com/
+Copyright 2017 Bernecker & Rainer Industrieelektronik GmbH
+Copyright 2011 Freescale Semiconductor, Inc.
+Copyright (C) 2015 Amlogic, Inc. All rights reserved.
+Copyright (C) 2016 BayLibre, SAS. All rights reserved.
+(C) 2012 NetModule AG, David Andrey, added KSZ9031
+(C) Copyright 2017 Adaptrum, Inc.
+(C) Copyright 2009 Industrie Dial Face S.p.A.
+(C) Copyright 2001
+Copyright (c) 2016 Microsemi Corporation
+(C) Copyright 2015
+Copyright 2010-2011, 2015 Freescale Semiconductor, Inc.
+Copyright 2016 Karsten Merker <merker@debian.org>
+Copyright (c) 2006 Herbert Valerio Riedel <hvr@gnu.org>
+Copyright 2010-2014 Freescale Semiconductor, Inc.
+Copyright (C) 2015 - 2016 Xilinx, Inc.
+Copyright (C) 2018 Rosy Song <rosysong@rosinson.com>
+Copyright (C) 2017 Linaro
+JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
+Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
+(C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
+Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
+Copyright (c) 2010-2014, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
+Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
+Copyright (C) 2009 Florian Fainelli <florian@openwrt.org>
+Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2017, STMicroelectronics - All Rights Reserved
+(C) Copyright 2012 Michal Simek <monstr@monstr.eu>
+(C) Copyright 2013 - 2018 Xilinx, Inc.
+Copyright (C) 2018 Xilinx, Inc.
+Copyright 2009-2011 Freescale Semiconductor, Inc.
+Copyright 2016 Freescale Semiconductor, Inc.
+Copyright 2011-2015 Freescale Semiconductor, Inc.
+Copyright 2015 Freescale Semiconductor, Inc.
+(C) Copyright 2004-2011
+Copyright (C) 2014 STMicroelectronics
+Copyright (C) 2017 Rockchip Electronics Co., Ltd
+Copyright (c) 2016 Rockchip Electronics Co., Ltd
+Copyright (c) 2016 Andreas Färber
+(C) Copyright 2017 Rockchip Electronics Co., Ltd
+(C) Copyright 2016 Beniamino Galvani <b.galvani@gmail.com>
+Copyright (c) 2012 Michael Walle
+(C) Copyright 2011 Andes Technology Corp
+Copyright (C) 2016 BayLibre, SAS
+Copyright (c) 2011 IDS GmbH, Germany
+Copyright (c) 2017 Rockchip Electronics Co., Ltd
+Copyright (C) 2007 Free Software Foundation, Inc.
+(C) Copyright 2011-2012 Pali Rohár <pali.rohar@gmail.com>
+(C) Copyright 2008-2009
+Copyright 2010 Nicolas Palix <npalix@diku.dk>
+Copyright 2010 Julia Lawall <julia@diku.dk>
+Copyright 2010 Gilles Muller <Gilles.Muller@lip6.fr>
+Copyright (C) 2015
+(C) Copyright 2014 Red Hat Inc.
+Copyright (c) 2014-2015, NVIDIA CORPORATION.  All rights reserved.
+Copyright (C) 2015 K. Merker <merker@debian.org>
+Copyright (c) 2011 The Chromium OS Authors.
+(C) Copyright 2014 Google, Inc
+Copyright (C) 2012 Samsung Electronics
+Copyright (c) 2007
+Copyright 2010-2011 Calxeda, Inc.
+Copyright (C) 2017 NXP Semiconductors
+Copyright (C) 2017 Bin Meng <bmeng.cn@gmail.com>
+(C) Copyright 2014 Samsung Electronics
+Copyright (C) 2017, Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
+Copyright (C) 2006 Free Software Foundation, Inc.
+Copyright (C) 2015 Google. Inc
+(C) 2003 Arun Dharankar <ADharankar@ATTBI.Com>
+Copyright 2014 Broadcom Corporation.
+Copyright (c) 2007,2008
+Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
+Copyright (c) 2013 The Chromium OS Authors.
+Copyright (C) Thomas Gleixner <tglx@linutronix.de>
+Copyright (C) 2013, Miao Yan <miao.yan@windriver.com>
+Copyright (C) 2015-2018, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2014, Simon Glass <sjg@chromium.org>
+(C) Copyright 2013 Xilinx, Inc.
+Copyright (C) 2018 Synopsys, Inc. All rights reserved.
+(C) Copyright 2016 Rockchip Electronics Co., Ltd
+Copyright (c) 2016-2019 Toradex, Inc.
+Copyright (c) 2016 Toradex, Inc.
+(C) Copyright 2015 Google, Inc
+Copyright (C) 2016-2018 Toradex AG
+Copyright (C) 2015 Freescale Semiconductor, Inc.
+2015 Toradex AG
+Copyright (C) 2011 Samsung Electronics
+Copyright (C) 2017 Marek Vasut <marex@denx.de>
+(C) Copyright 2011 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Dennis Gilmore <dgilmore@redhat.com>
+(c) Copyright 2015 Xilinx, Inc. All rights reserved.
+(C) Copyright 2010-2015
+Copyright (c) 2012 The Chromium OS Authors.
+(C) Copyright 2010,2011
+Copyright (c) 2014-2016, NVIDIA CORPORATION.
+Copyright (c) 2019 NVIDIA Corporation. All rights reserved.
+(C) Copyright 2010-2014
+Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+Copyright (c) 2011, Google Inc. All rights reserved.
+Copyright (c) 2016, NVIDIA CORPORATION.
+(C) Copyright 2010-2019
+Copyright 2018 Google LLC
+Copyright 2010-2011 NVIDIA Corporation
+Copyright (c) 2011-2013, NVIDIA CORPORATION.  All rights reserved.
+(C) Copyright 2009 SAMSUNG Electronics
+Copyright (C) 2011-2012 NVIDIA Corporation
+Copyright (c) 2013 NVIDIA Corporation
+(C) Copyright 2010, 2011
+Copyright (C) 2019, STMicroelectronics - All Rights Reserved
+Copyright (C) 2007-2009 Industrie Dial Face S.p.A.
+Copyright (C) 1999-2005 Igor Pavlov
+Copyright (C) 2007-2008 Industrie Dial Face S.p.A.
+Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr>
+(C) Copyright 2004-2008
+Copyright (C) 2013 Marek Vasut <marex@denx.de>
+(C) Copyright 2009-2015
+Copyright (C) STMicroelectronics 2018 - All Rights Reserved
+Copyright (C) 2014 STMicroelectronics -- All Rights Reserved
+(C) Copyright 2012-2014
+(C) Copyright 2015 Texas Insturments
+(C) Copyright 2008 Texas Insturments
+Copyright (C) 2016 Chen-Yu Tsai
+Copyright (C) 2013 - ARM Ltd
+Copyright 2004, 2011 Freescale Semiconductor.
+(C) Copyright 2002 Scott McNutt <smcnutt@artesyncp.com>
+Copyright (C) 2017 Impinj
+Copyright (C) 2016 Glider bvba
+Copyright (C) 2016 Cogent Embedded Inc.
+Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org>
+Copyright (C) 2017 Cogent Embedded Inc.
+Copyright (C) 2018 Renesas Electronics Corp.
+Copyright (C) 2017 Glider bvba
+Copyright © 2015 Broadcom
+Copyright (c) 2015-2016, NVIDIA CORPORATION.
+Copyright (c) 2016, NVIDIA CORPORATION
+(C) Copyright 2013 Atmel Corporation
+(C) Copyright 2014 Freescale Semiconductor, Inc.
+(C) Copyright 2014 Freescale Semiconductor, Inc
+Copyright (C) 2004-2008, 2012 Freescale Semiconductor, Inc.
+Copyright © 2016 Intel Corporation
+Copyright 2015 Freescale Semiconductor
+Copyright 2017 NXP
+Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+Copyright 2016 Google Inc.
+Copyright (c) 2017-2018 Vasily Khoruzhick <anarsoul@gmail.com>
+(C) Copyright 2016  Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2018-2019 Toradex AG
+Copyright (C) 2016 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Toradex AG
+(C) Copyright 2016 Broadcom Ltd.
+Copyright (C) 2016 David Lechner <david@lechnology.com>
+Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd. <nick.thompson@gefanuc.com>
+Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
+Copyright (c) 2013 Xilinx Inc.
+Copyright (c) 2013 Xilinx, Inc.
+Copyright (c) 2015 DAVE Embedded Systems
+(c) Copyright 2016 Topic Embedded Products.
+Copyright (C) 2013,2014 Renesas Electronics Corporation
+Copyright (C) 2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C)  2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C)  2014 Renesas Electronics Corporation
+Copyright (C) 2011  Renesas Solutions Corp.
+Copyright (C) 2011  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Copyright (C) 2012 Renesas Solutions Corp.
+Copyright (C) 2016 Renesas Electronics Corporation
+Copyright (C) 2014 Renesas Electronics Corporation
+Copyright (C) 2015 Renesas Electronics Corporation
+Copyright (C) 2013, 2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C) 2013, 2014 Renesas Electronics Corporation
+Copyright (C) 2013-2017 Renesas Electronics Corporation
+Copyright (C) 2008-2009 Renesas Solutions Corp.
+Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
+Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+Copyright (C) 2018-2019 Rosy Song <rosysong@rosinson.com>
+Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2013-2017, ISEE 2007 SL - http://www.isee.biz/
+Copyright (C) 2013, ISEE 2007 SL - http://www.isee.biz/
+(C) Copyright 2011 Bluewater Systems
+Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com
+Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com
+Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com
+Copyright (c) 2003,Motorola Inc.
+Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
+Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
+(C) Copyright 2000-2006
+Copyright 2004 Freescale Semiconductor, Inc.
+Copyright 2006 Freescale Semiconductor, Inc.
+Copyright 2008-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2004-2008,2010-2011 Freescale Semiconductor, Inc.
+Copyright 2010 Freescale Semiconductor, Inc.
+Copyright 2012-2016 Freescale Semiconductor, Inc.
+Copyright 2007,2009-2012 Freescale Semiconductor, Inc.
+(C) Copyright 2002-2010
+Copyright 2004-2011 Freescale Semiconductor, Inc.
+Copyright(c) 2002,2003 Motorola Inc.
+Copyright 2004, 2011 Freescale Semiconductor
+Copyright 2009-2010 Freescale Semiconductor, Inc.
+Copyright 2010 eXMeritus, A Boeing Company
+Copyright 2008 Qstreams Networks, Inc.
+(C) Copyright 2000-2009
+(C) Copyright 2000 - 2002
+Copyright (C) 2015 Altera Corporation <www.altera.com>
+Copyright (C) 2011 Andes Technology Corporation
+Copyright (C) 2013 Renesas Electronics Corporation
+Copyright (C) 2013 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C) 2015 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Copyright (C) 2019 Marek Vasut <marek.vasut@gmail.com>
+Copyright 2008 Extreme Engineering Solutions, Inc.
+Copyright 2004, 2007 Freescale Semiconductor, Inc.
+Copyright (C) 2013
+Copyright (C) 2009
+Copyright (C) 2006
+Copyright (C) 2004, 2005
+Copyright (C) 2004 Ray Lehtiniemi
+Copyright (C) 2003 Cirrus Logic, Inc
+Copyright (C) 1999 ARM Limited.
+Copyright 2008, 2010 Freescale Semiconductor, Inc.
+Copyright 2007,2009-2010 Freescale Semiconductor, Inc.
+Copyright (c) 2013, Andreas Oetken.
+Copyright (c) 2013, Google Inc.
+(C) Copyright 2008 Semihalf
+Copyright (C) 2003-2006  Christophe Devine
+Copyright (c) 2009 Analog Devices Inc.
+Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
+Copyright (C) 2013 Soren Brinkmann <soren.brinkmann@xilinx.com>
+Copyright (C) 2013 Xilinx, Inc. All rights reserved.
+Copyright (C) 2012 Michal Simek <monstr@monstr.eu>
+Copyright (C) 2012 Xilinx, Inc. All rights reserved.
+Copyright (C) 2012 - 2013 Michal Simek <monstr@monstr.eu>
+Copyright (C) 2012 - 2017 Xilinx, Inc. All rights reserved.
+(c) Copyright 2010-2017 Xilinx, Inc. All rights reserved.
+Copyright (c) 2013 - 2017 Xilinx Inc.
+(C) Copyright 2014 - 2017 Xilinx, Inc. Michal Simek
+Copyright (C) 2017 Weidmüller Interface GmbH & Co. KG
+Copyright (C) 2011-2017 Xilinx, Inc. All rights reserved.
+(C) Copyright 2002-2004
+Copyright (C) 2015 Actions Semi Co., Ltd.
+Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
+Copyright (C) 2012 Vikram Narayananan
+(C) Copyright 2012,2015 Stephen Warren
+Copyright (c) 2018 BayLibre, SAS.
+Copyright (C) 2018 BayLibre, SAS
+(C) Copyright 2013-2014 Luc Verhaegen <libv@skynet.be>
+(C) Copyright 2014-2015 Hans de Goede <hdegoede@redhat.com>
+(C) Copyright 2017 Icenowy Zheng <icenowy@aosc.io>
+Copyright (c) 2018 Microsemi Coprporation
+Copyright (C) 1996-2002 Julian R Seward.  All rights reserved.
+Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
+(C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+(C) Copyright 2011 CompuLab, Ltd. <www.compulab.co.il>
+(C) Copyright 2012 - 2013 CompuLab, Ltd. <www.compulab.co.il>
+Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH,
+<armlinux@phytec.de>
+Copyright 2017 Google, Inc
+Copyright (C) 2006-2009 Freescale Semiconductor, Inc.
+Copyright 2007-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2014 Stefan Roese <sr@denx.de>
+Copyright (C) 1996, 99 Ralf Baechle
+Copyright (C) 2000, 2002  Maciej W. Rozycki
+Copyright (C) 1990, 1999 by Silicon Graphics, Inc.
+Copyright (C) 1995, 1996, 1997, 1999, 2001 by Ralf Baechle
+Copyright (C) 1999 by Silicon Graphics, Inc.
+Copyright (C) 2001 MIPS Technologies, Inc.
+Copyright (C) 2002  Maciej W. Rozycki
+Copyright (C) 2016 Cadence Design Systems Inc.
+Copyright (c) 1994 - 1997, 1999, 2000  Ralf Baechle (ralf@gnu.org)
+Copyright (c) 2000  Silicon Graphics, Inc.
+Copyright (C) 1996, 99, 2003 by Ralf Baechle
+Copyright (C) 1994, 1995, 1996 by Ralf Baechle
+(C) Copyright 1996, 97, 99, 2002, 03 Ralf Baechle
+(C) Copyright 1999 Silicon Graphics, Inc.
+Copyright (c) 2016 Imagination Technologies Ltd.
+Copyright 2009 Freescale Semiconductor, Inc.
+Copyright (C) 2003, 2004 Ralf Baechle
+Copyright (C) 2004  Maciej W. Rozycki
+Copyright (C) 1994, 1995 Waldorf GmbH
+Copyright (C) 1994 - 2000, 06 Ralf Baechle
+Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+Copyright (C) 2004, 2005  MIPS Technologies, Inc.  All rights reserved.
+Copyright (c) 1998 Harald Koerfgen
+Copyright (C) 2013 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2013 Imagination Technologies
+Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001 by Ralf Baechle
+Copyright (C) 2000 Silicon Graphics, Inc.
+Copyright (C) 2000, 07 MIPS Technologies, Inc.
+Copyright (C) 2003, 2004  Maciej W. Rozycki
+Copyright (C) 1994 - 2002 by Ralf Baechle
+Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc.
+Copyright (C) 1996, 1997, 1998, 2000 by Ralf Baechle
+Copyright (C) 1994 Waldorf GMBH
+Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle
+Copyright (C) 1996 Paul M. Antoine
+Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
+Copyright (C) 1997, 1999, 2001, 06 by Ralf Baechle
+Copyright (C) 1995, 1999 by Ralf Baechle
+Copyright (C) 1995, 1999 Silicon Graphics
+Copyright (C) 1985 MIPS Computer Systems, Inc.
+Copyright (C) 1994, 95, 99, 2003 by Ralf Baechle
+Copyright (C) 1990 - 1992, 1999 Silicon Graphics, Inc.
+Copyright (C) 2011 Wind River Systems,
+written by Ralf Baechle <ralf@linux-mips.org>
+Copyright (c) 2017 Imagination Technologies Ltd.
+Copyright (C) 1996, 1999, 2001 Ralf Baechle
+Copyright (C) 1999 Silicon Graphics, Inc.
+Copyright (c) 1994, 95, 96, 97, 98, 2000, 01 Ralf Baechle
+Copyright (c) 2000 by Silicon Graphics, Inc.
+Copyright (c) 2001 MIPS Technologies, Inc.
+Copyright (C) 1994 - 1999 by Ralf Baechle
+Copyright (C) 1996 by Paul M. Antoine
+Copyright (C) 2000 MIPS Technologies, Inc.
+Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
+Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
+Copyright (C) 2014 Marek Vasut <marex@denx.de>
+(C) Copyright 2018, Linaro Limited
+Copyright (c) 2018 JJ Hiblot <jjhiblot@ti.com>
+Copyright (C) Nelson Integration, LLC 2016
+Copyright (c) 2017 Google, Inc
+(C) Copyright 2000-2011
+Copyright (c) 2016 Alexander Graf
+(C) Copyright 2011-2013 Pali Rohár <pali.rohar@gmail.com>
+Copyright (c) 2012, Google Inc. All rights reserved.
+Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+Copyright (C) 2013 Xilinx, Inc.
+Copyright (C) 2017 Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright (c) 2017 Álvaro Fernández Rojas <noltari@gmail.com>
+Copyright (c) 2016 The Chromium OS Authors.
+Copyright (c) 2016 National Instruments Corp
+Copyright (c) 2013 Google, Inc
+(C) Copyright 2018 Linaro Ltd.
+Copyright 2000-2009
+(C) Copyright 2000, 2001
+Copyright (c) 2001 William L. Pitts
+(C) Copyright 2011 - 2012 Samsung Electronics
+(C) Copyright 2003 - 2004
+Copyright 2008 - 2009 Windriver, <www.windriver.com>
+(C) Copyright 2014 Linaro, Ltd.
+Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
+Copyright (C) 2014, Bachmann electronic GmbH
+(C) Copyright 2009-2013 ADVANSEE
+Copyright 2008 Silicon Turnkey Express, Inc.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+Copyright (c) 2008-2011 Analog Devices Inc.
+Copyright (c) 2012, Google Inc.
+Copyright (c) 2009, Brush Technology
+Copyright (c) 2012:
+Joe Hershberger, National Instruments, joe.hershberger@ni.com
+(C) Copyright 2005
+Copyright 2002 SYSGO Real-Time Solutions GmbH
+(C) Copyright 2007 by OpenMoko, Inc.
+(C) Copyright 2013 Patrice Bouchand <pbfwdlistgmailcom>
+Copyright 2006 Freescale Semiconductor
+(C) Copyright 2011 Freescale Semiconductor, Inc
+(C) Copyright 2007 Michal Simek
+Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
+Copyright 2008-2009 Freescale Semiconductor, Inc.
+(c) 1999 Machine Vision Holdings, Inc.
+(c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
+(C) 2010 Nanometrics, Inc.
+(C) Copyright 2006-2007 OpenMoko, Inc.
+(C) 2004 Texas Instruments
+Copyright 2010, 2012 Freescale Semiconductor
+(C) Copyright 2000-2013
+(C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+Copyright (C) 2005-2008 Samsung Electronics
+(C) 1999-2000 Magnus Damm <damm@bitsmart.com>
+Copyright (C) 2014-2015 Samsung Electronics
+Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
+(C) Copyright 2015 Miao Yan <yanmiaobest@gmail.com>
+Copyright (C) 2017 Eddie Cai <eddie.cai.linux@gmail.com>
+Copyright 2018, Google Inc.
+Copyright 2013 Wolfgang Denk <wd@denx.de>
+Copyright (C) 2008 Atmel Corporation
+Copyright 2018
+Copyright (C) 2011
+Copyright (c) 2008 Analog Devices Inc.
+(C) Copyright 2007 OpenMoko, Inc.
+Copyright (C) 2013 Lukasz Majewski <l.majewski@samsung.com>
+Coypright (c) 2013 Guntermann & Drunck GmbH
+Copyright (c) 2018 Bootlin
+(C) Copyright 2009 Reinhard Arlt, reinhard.arlt@esd-electronics.com
+(C) Copyright 2003 Stefan Roese, stefan.roese@esd-electronics.com
+Copyright (C) 2008 Samsung Electronics
+Copyright 2008-2009 Stefan Roese <sr@denx.de>, DENX Software Engineering
+Copyright (C) 2016 Toradex
+Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
+Copyright (C) 2018, Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
+Copyright (c) 2019 Michael Walle <michael@walle.cc>
+(C) Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
+Copyright 2011, Marvell Semiconductor Inc.
+Copyright (C) 2005 for Samsung Electronics
+Copyright (c) 2005, 2009 Freescale Semiconductor, Inc
+Copyright (c) 2005 MontaVista Software
+Copyright (c) 2008 Excito Elektronik i Sk=E5ne AB
+(C) Copyright 2010 Faraday Technology
+Copyright (C) 2007 Rodolfo Giometti <giometti@linux.it>
+Copyright (C) 2007 Eurotech S.p.A. <info@eurotech.it>
+Copyright (C) 2011 Jana Rapava <fermata7@gmail.com>
+Copyright (C) 2011 CompuLab, Ltd. <www.compulab.co.il>
+Copyright (C) 2010 Nokia Corporation
+(C) Copyright 2016 - 2018 Xilinx, Inc.
+Copyright 2016 - 2018 Xilinx, Inc.
+(C) Copyright 2019 Xilinx, Inc.
+Copyright 2017 Theobroma Systems Design und Consulting GmbH
+(C) Copyright 2017 Heiko Stuebner <heiko@sntech.de>
+(C) Copyright 2015 Rockchip Electronics Co., Ltd
+(C) Copyright 2016 Heiko Stuebner <heiko@sntech.de>
+(C) Copyright 2017 Rockchip Electronics Co., Ltd.
+(C) Copyright 2008-2014 Rockchip Electronics
+Copyright 2014 Rockchip Inc.
+Copyright (c) 2016 Heiko Stuebner <heiko@sntech.de>
+Copyright 2015 Google, Inc
+(C) Copyright 2012 SAMSUNG Electronics
+Copyright 2016 Rockchip Inc.
+(C) Copyright 2016 Google, Inc
+Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+Copyright (C) 2017 Rockchip Electronics Co., Ltd.
+Copyright (C) 2016-2017 Rockchip Electronics Co., Ltd
+(C) Copyright 2016 Rockchip Electronics Co.,Ltd
+(C) Copyright 2009 Stefan Roese <sr@denx.de>, DENX Software Engineering
+Copyright (C) 2006 Micronas GmbH
+(C) Copyright 2008 Stefan Roese <sr@denx.de>, DENX Software Engineering
+Copyright 2005, Seagate Technology LLC
+(C) Copyright 2014 Albert ARIBAUD <albert.u.boot@aribaud.net>
+Copyright (c) 2000 MontaVista Software, Inc (source@mvista.com)
+Copyright (c) 2003 Motorola,Inc.
+Copyright 2004,2007-2011 Freescale Semiconductor, Inc.
+(C) Copyright 2002, 2003 Motorola Inc.
+(C) Copyright 2003 Motorola Inc.
+Copyright 2009-2012 Freescale Semiconductor, Inc
+Copyright (c) 2000 MontaVista Software, Inc.   Dan Malek (dmalek@jlc.net)
+(C) Copyright 2000 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+(C) Copyright 2000-2002
+(C) Copyright 2002 (440 port)
+(C) Copyright 2003 Motorola Inc. (MPC85xx port)
+Copyright 2008,2010 Freescale Semiconductor, Inc.
+Copyright 2004 Freescale Semiconductor.
+Copyright (C) 2003 Motorola Inc.
+Copyright (C) 2006 Freescale Semiconductor, Inc.
+Copyright 2004, 2007-2011 Freescale Semiconductor, Inc.
+Copyright 2007 Freescale Semiconductor.
+Copyright (C) 2003 Motorola
+Copyright (C) 1995-1996  Gary Thomas (gdt@linuxppc.org)
+Copyright (C) 2014 NVIDIA Corporation
+(C) 2018 Theobroma Systems Design und Consulting GmbH
+Copyright (C) 2015 Samsung Electronics
+(C) Copyright 2016 Texas Instruments Incorporated, <www.ti.com>
+(C) Copyright 2017 Texas Instruments Incorporated, <www.ti.com>
+Copyright (C) 2016 Samsung Electronics
+Copyright (C) 2018
+Copyright (C) 2015 Freescale Semiconductor, Inc
+(C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
+Copyright (C) 2015 Linaro
+(C) Copyright 2014 Texas Instruments Incorporated -  http://www.ti.com
+(C) Copyright 2011-2013
+Copyright (C) EETS GmbH, 2017, Felix Brack <f.brack@eets.ch>
+Copyright (C) 2016 Toradex AG
+(C) Copyright 2015, Freescale Semiconductor, Inc.
+(C) Copyright 2013-2015, Freescale Semiconductor, Inc.
+Copyright (c) 2019 Western Digital Corporation or its affiliates.
+Copyright (C) 2016 Vladimir Zapolskiy <vz@mleia.com>
+(c) Copyright 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
+(c) Copyright 2008 Renesas Solutions Corp.
+(C) Copyright 2007-2012
+Copyright (C) 2007,2008 Nobobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Copyright (C) 2008 Renesas Solutions Corp.
+(C) Copyright 2007, 2012 Freescale Semiconductor, Inc.
+Copyright (C) 2015 ARM Limited
+Copyright (C)  2018 Texas Instruments Incorporated - http://www.ti.com/
+(C Copyright 2009
+Copyright (C) 2010-2013 Freescale Semiconductor, Inc.
+Copyright (C) 2013, Boundary Devices <info@boundarydevices.com>
+Copyright (C) 2014-2019, Toradex AG
+Copyright (C) 2014-2016, Toradex AG
+Copyright (c) 2017 Andy Yan
+Copyright (C) 2012 Boundary Devices Inc.
+Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
+Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2012-2015 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2012
+Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+(C) Copyright 2007-2013
+Copyright (C) 2017, Grinn - http://grinn-global.com/
+Copyright (C) 2016, Texas Instruments, Incorporated - http://www.ti.com/
+Copyright (C) 2013, Texas Instruments, Incorporated
+Copyright (C) 2013, Adeneo Embedded <www.adeneo-embedded.com>
+Copyright (C) 2009, Texas Instruments, Incorporated
+Copyright 2017 Texas Instruments, Inc.
+Copyright (C) 2017, Konsulko Group
+Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2015 Simon Arlott <simon@fire.lp0.eu>
+Copyright (C) 2000-2010 Broadcom Corporation
+Copyright (C) 2010 Broadcom Corporation
+Copyright (C) 2015 - 2018 Texas Instruments Incorporated <www.ti.com>
+Copyright 2004,2007,2008 Freescale Semiconductor, Inc.
+Copyright (C) 2008 by NXP Semiconductors
+Copyright (c) 2015 Tyco Fire Protection Products.
+Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Texas Instruments Incorporated <www.ti.com>
+Copyright 2015-2016 Freescale Semiconductor, Inc.
+Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2014-2016 Stefan Roese <sr@denx.de>
+Copyright (C) 2015-2016 Reinhard Pfau <reinhard.pfau@gdsys.cc>
+Copyright (C) 2015 Reinhard Pfau <reinhard.pfau@gdsys.cc>
+(C) Copyright 2008 Marvell Semiconductor
+Copyright (C) Marvell International Ltd. and its affiliates
+Copyright (c) Xilinx, Inc.
+(C) Copyright 2014 - 2015 Xilinx, Inc.
+Copyright (c) 2013-2014, NVIDIA CORPORATION.  All rights reserved.
+Copyright (c) 2016-2018, NVIDIA CORPORATION.
+Copyright (c) 2010-2019, NVIDIA CORPORATION.  All rights reserved.
+Copyright (c) 2012-2019, NVIDIA CORPORATION. All rights reserved.
+(C) Copyright 2004 Texas Insturments
+Copyright (c) 2010-2016, NVIDIA CORPORATION.
+(C) Copyright 2010,2011 NVIDIA Corporation <www.nvidia.com>
+Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2014-2019, NVIDIA CORPORATION.  All rights reserved.
+Copyright (C) 2016 samtec automotive software & electronics gmbh
+Copyright (C) 2017-2019 softing automotive electronics gmbH
+(C) Copyright 2007-2008 Semihalf
+(C) Copyright 2007-2008 Semihalf, Rafal Jaworowski <raj@semihalf.com>
+(C) Copyright 2007 Semihalf
+Copyright 2016 Timesys Corporation
+Copyright 2016 Advantech Corporation
+Copyright 2015 Timesys Corporation.
+Copyright 2015 General Electric Company
+Copyright (C) 2017 Andes Technology Corporation
+Copyright (c) 2015, Sony Mobile Communications AB.
+Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2018, Ramon Fried <ramon.fried@gmail.com>
+Copyright (c) 2018 Ramon Fried <ramon.fried@gmail.com>
+Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
+Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd
+Copyright (c) 2018, Linaro Limited
+Copyright (c) 2019, Texas Instrument
+(C) Copyright 2014-2016, Freescale Semiconductor, Inc.
+(C) Copyright 2013-2016, Freescale Semiconductor, Inc.
+Copyright (c) 2018, Google Inc. All rights reserved.
+Copyright (c) 2012, The Chromium Authors
+Copyright (c) 2013, The Chromium Authors
+(C) Copyright 2008-2011
+Copyright (C) 1991, 1992  Linus Torvalds
+(C) Copyright 2011 - 2013 CompuLab, Ltd. <www.compulab.co.il>
+Copyright (c) 2014, Steffen Trumtrar <s.trumtrar@pengutronix.de>
+Copyright (C) 2016-2018 Intel Corporation. All rights reserved
+Copyright (C) 2016 Altera Corporation. All rights reserved
+Copyright (c) 2018 Baylibre SAS.
+Copyright (c) 2016 BayLibre, SAS.
+Copyright (c) 2017 Amlogic, inc.
+Copyright (c) 2019 BayLibre, SAS.
+Copyright (c) 2016 BayLibre, SAS
+Copyright (c) 2018 Amlogic, inc.
+Copyright (C) Broadcom Corporation
+Copyright (C) 2017 Priit Laes <plaes@plaes.org>
+Copyright (C) 2016 Maxime Ripard <maxime.ripard@free-electrons.com>
+Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
+Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
+Copyright 2016 Maxime Ripard
+Copyright (C) 2016 Chen-Yu Tsai <wens@csie.org>
+Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org>
+Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.io>
+Copyright (c) 2015, NVIDIA CORPORATION.
+Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2004, Psyent Corporation <www.psyent.com>
+Copyright (C) 2004 Patrik Kluba,
+University of Szeged, Hungary
+Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
+Copyright (C) 2001 Red Hat, Inc.
+Bugfixing by Kai-Uwe Bloem <kai-uwe.bloem@auerswald.de>, (C) Mar/2003
+Copyright © 2004  Ferenc Havasi <havasi@inf.u-szeged.hu>,
+Zoltan Sogor <weth@inf.u-szeged.hu>,
+Patrik Kluba <pajko@halom.u-szeged.hu>,
+Copyright (C) 2014 Samsung Electronics
+Copyright 2013 Broadcom Corporation.
+(C) Copyright 2008 - 2013 Tensilica Inc.
+(C) Copyright 2014 Cadence Design Systems Inc.
+(C) Copyright 2014 - 2016 Cadence Design Systems Inc.
+Copyright 2019 Google LLC
+Copyright (C) 2016 Google Inc.
+Copyright (C) 2014 Google Inc.
+Copyright (C) 2016 Google, Inc.
+Copyright (C) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+(C) Copyright 2017, Fuzhou Rockchip Electronics Co., Ltd
+(C) Copyright 2011 NVIDIA Corporation www.nvidia.com
+Copyright © 2011 Parrot S.A.
+Copyright (c) 2017 Rob Clark
+Copyright (C) 1995-1998 Mark Adler
+Copyright (c) 2004 Cisco Systems, Inc.
+Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
+Copyright (C) 2003 Bernardo Innocenti <bernie@develer.com>
+Copyright (C) 1999 Hewlett-Packard Co
+Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+Copyright (c) 2014
+Copyright (C) 2010-2013 Wolfgang Denk <wd@denx.de>
+Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+Copyright (c) 2009, Google Inc.
+Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
+Copyright (C) 1992, 1997 Free Software Foundation, Inc.
+Copyright (C) 2001 Peter Bergner.
+Copyright (C) 2011-2015, Yann Collet.
+Copyright 2015 Google Inc.
+Copyright (c) 1992 Simon Glass
+Copyright 1994 - 2000 Neil Russell.
+Copyright 2000 Roland Borde
+Copyright 2000 Paolo Scaffardi
+Copyright 2000-2002 Wolfgang Denk, wd@denx.de
+Copyright 2009 Dirk Behme, dirk.behme@googlemail.com
+Copyright 2009 Benjamin Herrenschmidt, IBM Corp
+Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+(C) 1999  Andrea Arcangeli <andrea@suse.de>
+(C) 2002  David Woodhouse <dwmw2@infradead.org>
+(C) 2012  Michel Lespinasse <walken@google.com>
+Copyright (C) 2001-2003  Christophe Devine
+Copyright (c) 2004-2005 Sergey Lyubka <valenok@gmail.com>
+(C) Copyright 2002-2006
+Copyright (C) 2004,2008  Kustaa Nyholm
+Copyright 2011 Calxeda, Inc.
+Copyright (C) 2012-2016, Yann Collet.
+(C) Copyright 2013-2016, NVIDIA CORPORATION.
+Copyright 2008 Maxime Bizon <mbizon@freebox.fr>
+Copyright 2013 Florian Fainelli <florian@openwrt.org>
+Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2019 BayLibre, SAS
+Copyright (C) 2018 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+Copyright (C) 2018 Ramon Fried <ramon.fried@gmail.com>
+Copyright (C) 2019 Stefan Roese <sr@denx.de>
+Copyright (C) 2017 John Crispin <john@phrozen.org>
+Copyright (C) 2018 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2015-2017, STMicroelectronics - All Rights Reserved
+Copyright (C) 2010 Ilya Yanok, Emcraft Systems, yanok@emcraft.com
+Copyright (C) 2007 Freescale Semiconductor, Inc.
+Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
+Copyright (C) 2007 Kenati Technologies, Inc.
+Copyright (c) 2013 Imagination Technologies
+Copyright (c) 2015 Imagination Technologies
+Copyright 2009: Marvell Technology Group Ltd.
+Copyright © 2010-2015 Broadcom Corporation
+Copyright (C) 2017  Beckhoff Automation GmbH & Co. KG
+(C) Copyright 2017 CompuLab, Ltd. http://www.compulab.com
+Copyright 2018 Linaro
+Bloat-o-meter code used here Copyright 2004 Matt Mackall <mpm@selenic.com>
+Copyright (c) 2016 Xilinx, Inc
+Copyright (C) 2017 Jagan Teki <jagan@amarulasolutions.com>
+Copyright (C) 2015 Hans de Goede <hdegoede@redhat.com>
+Copyright (C) 2014 Roman Byshko <rbyshko@gmail.com>
+(C) Copyright Siemens AG
+Copyright (c) 2017 Amlogic, Inc. All rights reserved.
+Copyright (c) 2018 Amlogic, Inc. All rights reserved.
+Copyright (C) 2016 Endless Mobile, Inc.
+Copyright (C) 2015 Broadcom Corporation
+Copyright (C) 2016 Imagination Technologies
+Copyright (c) 2014 Samsung Electronics Co., Ltd.
+Copyright (c) 2015 Hisilicon Limited.
+Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+Copyright 2013 Lucas Stach, Pengutronix <l.stach@pengutronix.de>
+Copyright (C) 2014 Freescale Semiconductor, Inc.
+Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
+Copyright (C) 2014 Google, Inc
+(c) 2015 Purna Chandra Mandal <purna.mandal@microchip.com>
+Copyright (c) 2018 BayLibre, SAS
+Copyright (c) 2018 MediaTek Inc.
+Copyright (C) 2014 Renesas Solutions Corp.
+Copyright (C) 2014 Wolfram Sang, Sang Engineering <wsa@sang-engineering.com>
+Copyright 2013 Ideas On Board SPRL
+Copyright (C) 2015 Renesas Electronics Corp.
+Copyright (C) 2016 Cogent Embedded, Inc.
+Copyright (C) 2014  Renesas Electronics Corporation
+Copyright (C) 2016 Renesas Electronics Corp.
+Copyright (C) 2017 Cogent Embedded, Inc.
+Copyright (c) 2014 MundoReader S.L.
+Copyright (c) 2015 Heiko Stuebner <heiko@sntech.de>
+Copyright (c) 2016 Rockchip Electronics Co. Ltd.
+Copyright (c) 2017 Rockchip Electronics Co. Ltd.
+Copyright (C) 2017 Synopsys
+Copyright (C) 2016 STMicroelectronics
+Copyright 2015 Maxime Ripard
+Copyright (c) 2017 Icenowy Zheng <icenowy@aosc.xyz>
+Copyright (c) 2016 Icenowy Zheng <icenowy@aosc.xyz>
+Copyright (C) 2018 Jernej Skrabec <jernej.skrabec@siol.net>
+Copyright (C) 2016, Texas Instruments, Incorporated
+Copyright (C) 2010-2018 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2005 Texas Instruments.
+Copyright (C) 2011 Ilya Yanok, Emcraft Systems
+Copyright (C) 1999-2015 Tensilica Inc.
+Copyright (C) 1999-2015 Cadence Design Systems Inc.
+Copyright (C) 2012-2017 Texas Instruments Incorporated, <www.ti.com>
+Copyright (C) 2013 Hannes Schmelzer <oe5hpm@oevsv.at>
+Copyright (C) ARM Limited
+Copyright (C) 2000-2001 Deep Blue Solutions Ltd.
+Copyright (C) 2013 Samsung Electronics
+Copyright (C) 1999  Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
+Copyright 2012 Stefan Roese <sr@denx.de>
+Copyright (c) 2015 Andreas Bießmann <andreas@biessmann.org>
+(C) Copyright 2017 Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
+Copyright (C) 1995-2004 Mark Adler
+Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+Copyright (C) 1995-2010 Jean-loup Gailly
+Copyright (C) 1995-2003 Mark Adler
+Copyright (C) 1995-2005 Mark Adler
+Copyright (C) 1995-2005 Jean-loup Gailly.
+Copyright (C) 2011-2014 Panasonic Corporation
+Copyright (C) 2014 Wandboard
+Copyright (C) 2013 Freescale Semiconductor, Inc.
+Copyright (C) 2014 O.S. Systems Software LTDA.
+(C) Copyright 2007-2018 Michal Simek
+Copyright (C) 2017 DENX Software Engineering
+(C) Copyright 2010-2013
+Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
+Copyright 1992, Linus Torvalds.
+Copyright (C) 2003  John Williams <jwilliams@itee.uq.edu.au>
+Copyright (C) 2001  NEC Corporation
+Copyright (C) 2001  Miles Bader <miles@gnu.org>
+(C) Copyright 2004 Atmark Techno, Inc.
+Copyright (C) 2003     John Williams <jwilliams@itee.uq.edu.au>
+Copyright (C) 2001,02  NEC Corporation
+Copyright (C) 2001,02  Miles Bader <miles@gnu.org>
+Copyright (C) 2003       John Williams <jwilliams@itee.uq.edu.au>
+Copyright (C) 2001,2002  NEC Corporation
+Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
+Copyright (C) 2011 Michal Simek <monstr@monstr.eu>
+(C) Copyright 2013 - 2014 Xilinx, Inc
+Copyright (C) 2003	John Williams (jwilliams@itee.uq.edu.au)
+Copyright (C) 2001	NEC Corporation
+Copyright (C) 2001	Miles Bader <miles@gnu.org>
+(C) Copyright 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+(C) Copyright 2012 Renesas Solutions Corp.
+Copyright (C) 2012  Renesas Solutions Corp.
+Copyright (C) 2012  Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C) 2017 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2010 Renesas Solutions Corp.
+Copyright (C) 2010 NISHIMOTO Hiroki
+Copyright (C) 2017 National Instruments Corp
+Copyright (c) 2018 Flowbird
+Copyright (c) 2015 Free Electrons
+Copyright (c) 2015 NextThing Co
+Copyright (c) 2015 NextThing Co.
+Copyright (c) 2018 Microchip Technology, Inc.
+Copyright (C) 2012-2013 Marek Vasut <marex@denx.de>
+Copyright (C) 2012-2017 Marek Vasut <marex@denx.de>
+Copyright (C) 2014-2017 Olaf Mandel <o.mandel@menlosystems.com>
+Copyright (c) 2005-2011 Analog Devices Inc.
+Copyright (C) 1996-2005 Markus F.X.J. Oberhumer <markus@oberhumer.com>
+Copyright (C) 2018 Stefan Roese <sr@denx.de>
+Copyright (c) 2005-2008 Analog Devices Inc.
+Copyright 2017 Andes Technology, Inc.
+Copyright (C) 2012-2013 Jonas Gorski <jogo@openwrt.org>
+Copyright (C) 2009-2012 Florian Fainelli <florian@openwrt.org>
+Copyright (C) 2010 Tanguy Bouzeloc <tanguy.bouzeloc@efixo.com>
+Copyright (C) 2004-2009 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (c) 2009, Intel Corporation.
+Copyright (C) 2004-2009, 2015 Freescale Semiconductor, Inc.
+Copyright 2013-2015 Freescale Semiconductor, Inc.
+Copyright 2013-2014 Freescale Semiconductor, Inc.
+Copyright (c) 2011-12 The Chromium OS Authors.
+(C) Copyright 2014  DENX Software Engineering GmbH
+Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
+Copyright (c) 2006 Ben Warren, Qstreams Networks Inc.
+Copyright (c) 2001 Navin Boppuri / Prashant Patel
+Copyright (c) 2001 Gerd Mennchen <Gerd.Mennchen@icn.siemens.de>
+Copyright (c) 2001 Wolfgang Denk, DENX Software Engineering, <wd@denx.de>.
+Copyright (C) 2011 Sergiy <piratfm@gmail.com>
+Copyright (C) 2011-2013 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2014-2015 Felix Fietkau <nbd@nbd.name>
+Copyright (c) 2018  MediaTek, Inc.
+Copyright (C) 2015 Marvell International Ltd.
+Copyright (C) 2008, Guennadi Liakhovetski <lg@denx.de>
+Copyright (C) 2016 Jagan Teki <jteki@openedev.com>
+Copyright (C) 2010 Dirk Behme <dirk.behme@googlemail.com>
+Copyright (C) 2005, 2006 Nokia Corporation
+Copyright (c) 2015, Microchip Technology Inc.
+(C) 2019 Theobroma Systems Design und Consulting GmbH
+(C) Copyright 2008-2013 Rockchip Electronics
+Copyright (c) 2011-2013 The Chromium OS Authors.
+Copyright (C) 2011-2012 Renesas Solutions Corp.
+Copyright (C) 2011 Renesas Solutions Corp.
+Copyright (C) 2018 Exceet Electronics GmbH
+Copyright (C) 2018 Bootlin
+(C) Copyright 2017 Whitebox Systems / Northend Systems B.V.
+(C) Copyright 2017 Olimex Ltd..
+Based on linux spi driver. Original copyright follows:
+Copyright (C) 2012 - 2014 Allwinner Tech
+Copyright (C) 2014 Maxime Ripard
+Copyright (c) 2010-2013 NVIDIA Corporation
+(C) Copyright 2015 NVIDIA Corporation <www.nvidia.com>
+Copyright (c) 2015 Jagan Teki <jteki@openedev.com>
+Copyright (c) 2012 Stephan Linz <linz@li-pro.net>
+Copyright (c) 2010 Graeme Smecher <graeme.smecher@mail.mcgill.ca>
+Copyright (c) 2010 Thomas Chou <thomas@wytron.com.tw>
+(C) Copyright 2018 Xilinx
+(C) Copyright 2015 Jagan Teki <jteki@openedev.com>
+Copyright (C) 2011-2015 Vladimir Zapolskiy <vz@mleia.com>
+(C) Copyright 2015 Vladimir Zapolskiy <vz@mleia.com>
+Copyright (C) 2018 Microchip Technology, Inc.
+(C) Copyright 2013-2015
+Copyright (c) 2014-2015 NVIDIA CORPORATION. All rights reserved.
+(C) Copyright 2006
+(C) Copyright 2009, 2011 Freescale Semiconductor, Inc.
+(C) Copyright 2008, Excito Elektronik i Sk=E5ne AB
+(C) Copyright 2018 Theobroma Systems Design und Consulting GmbH
+(C) Copyright 2010-2012
+Copyright (c) 2017 General Electric Company. All rights reserved.
+Copyright (C) 2019 Rosy Song <rosysong@rosinson.com>
+Copyright (C) 2008 Altera Corporation.
+Copyright (C) 2009 BuS Elektronik GmbH & Co. KG
+(c) 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Copyright 2014-2017 Broadcom.
+(C) 2009 Ben Warren , biggerbadderben@gmail.com
+(C) 2003 Wolfgang Denk, wd@denx.de
+Copyright (C) 1999 Ben Williamson <benw@pobox.com>
+Copyright (C) 1997  Sten Wang
+(C)Copyright 1997-1998 DAVICOM Semiconductor,Inc. All Rights Reserved.
+Copyright (C) 2008 Dave S.r.l. <www.dave.eu>
+Copyright (C) 2018 Marek Vasut <marex@denx.de>
+Copyright(c) 1999 - 2002 Intel Corporation. All rights reserved.
+Copyright (C) Archway Digital Solutions.
+Copyright (C) Linux Networx.
+Copyright (C) 2010, 2009
+(C) Copyright 2002 2003
+Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
+Copyright (C) 2007-2008 Avionic Design Development GmbH
+Copyright (C) 2008-2009 Avionic Design GmbH
+(C) Copyright 2009 Ilya Yanok, Emcraft Systems Ltd <yanok@emcraft.com>
+(C) Copyright 2008,2009 Eric Jarrige <eric.jarrige@armadeus.org>
+(C) Copyright 2008 Armadeus Systems nc
+(C) Copyright 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
+(C) Copyright 2007 Pengutronix, Juergen Beisert <j.beisert@pengutronix.de>
+(C) Copyright 2008 Armadeus Systems, nc
+(C) Copyright 2008 Eric Jarrige <eric.jarrige@armadeus.org>
+(C) Copyright Motorola, Inc., 2000
+(C) Copyright 2007 Freescale Semiconductor, Inc.
+Copyright 2009-2010, 2013 Freescale Semiconductor, Inc.
+(C) Copyright 2009 Faraday Technology
+(C) Copyright 2010 Andes Technology
+Copyright (C) 2018, IBM Corporation.
+(C) Copyright 2013 Faraday Technology
+(C) Copyright 2015 Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Copyright (c) 2019, Linaro Limited
+Copyright (c) 2011 Roberto Cerati <roberto.cerati@bticino.it>
+Copyright (c) 2009 Micrel Inc.
+(c) 2011 Bticino s.p.a, Roberto Cerati <roberto.cerati@bticino.it>
+Copyright (C) 2001 Standard Microsystems Corporation (SMSC)
+Copyright (C) 1996 by Erik Stahlman (ES)
+Copyright (C) 2005-2006 Atmel Corporation
+Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
+Copyright (C) 2002 rabeeh@galileo.co.il
+Copyright (C) 2014-2015 Stefan Roese <sr@denx.de>
+Copyright (C) 2012 Marvell
+Copyright (C) 2014 Marvell
+Copyright (C) 2016-2017 Stefan Roese <sr@denx.de>
+Copyright (C) 2001 Entity Cyber, Inc.
+Written/copyright 1999-2001 by Donald Becker.
+Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+Written/copyright 1999-2002 by Donald Becker.
+(C) Copyright 2002 Wolfgang Grandegger, wg@denx.de.
+Copyright 2015 Microchip Inc.
+Copyright (C) 2015-2017  Renesas Electronics Corporation
+Copyright (c) 2018 National Instruments
+Copyright (c) 2018 Joe Hershberger <joe.hershberger@ni.com>
+Copyright (c) 2015 National Instruments
+Copyright (C) 2008, 2011 Renesas Solutions Corp.
+Copyright (c) 2008, 2011, 2014 2014 Nobuhiro Iwamatsu
+Copyright (c) 2007 Carlos Munoz <carlos@kenati.com>
+Copyright (C) 2008 - 2012 Renesas Solutions Corp.
+Copyright (c) 2008 - 2012 Nobuhiro Iwamatsu
+(C) Copyright 2002
+Copyright (C) 2001 Standard Microsystems Corporation (SMSC)
+Copyright (C) 1996 by Erik Stahlman (ES)
+Copyright 2016-2018 Socionext inc.
+(C) Copyright 2012, Stefan Roese <sr@denx.de>
+Copyright 2004-2011, 2013 Freescale Semiconductor, Inc.
+(C) Copyright 2003, Motorola, Inc.
+Copyright 2007, 2010 Freescale Semiconductor, Inc.
+Copyright 2008 Freescale Semiconductor, Inc.  This file is licensed
+Copyright 2014 - 2015 Freescale Semiconductor, Inc.
+Copyright (C) 2011 PetaLogix
+Copyright (C) 2010 Xilinx, Inc. All rights reserved.
+(C) Copyright 2007-2009 Michal Simek
+(C) Copyright 2003 Xilinx Inc.
+(C) Copyright 2011 Michal Simek
+(C) Copyright 2011 Xilinx
+Copyright (C) 2015-2017 Renesas Electronics Corporation
+Copyright (c) 2016-2018 Toradex, Inc.
+Copyright (c) 2012-2016 Toradex, Inc.
+Copyright (c) 2016, Toradex, Inc.
+(C) Copyright 2000-2010
+(C) Copyright 2002-2008
+(C) Copyright 2000-2008
+(C) Copyright 2017 Renesas Electronics Europe Ltd
+Copyright 2015 ATS Advanced Telematics Systems GmbH
+Copyright 2015 Konsulko Group, Matt Porter <mporter@konsulko.com>
+(C) Copyright 2003, Psyent Corporation <www.psyent.com>
+Copyright (C) 2015 Thomas Chou <thomas@wytron.com.tw>
+Copyright (C) 2009, Wind River Systems Inc
+Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2004,
+2005  Free Software Foundation, Inc.
+Copyright 2008-2016 Freescale Semiconductor, Inc.
+Copyright 2017-2018 NXP Semiconductor
+Copyright 2014-2016 Freescale Semiconductor, Inc.
+Copyright 2014-2015 Freescale Semiconductor, Inc.
+Copyright 2010-2016 Freescale Semiconductor, Inc.
+Copyright 2008-2014 Freescale Semiconductor, Inc.
+Copyright 2008, 2010-2016 Freescale Semiconductor, Inc.
+Copyright 2008, 2010-2011 Freescale Semiconductor, Inc.
+Copyright 2007,2009-2011 Freescale Semiconductor, Inc.
+Copyright (C) 1999-2010 Tensilica Inc.
+Copyright 2009 Lattice Semiconductor Corp.
+Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
+Copyright (C) 2017-2019 Intel Corporation <www.intel.com>
+Copyright (C) 2018 Intel Corporation <www.intel.com>
+(C) Copyright 2012-2013, Xilinx, Michal Simek
+(C) Copyright 2015 - 2016, Xilinx, Inc,
+Michal Simek <michal.simek@xilinx.com>
+Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Copyright (C) 2015 Stefan Wahren <stefan.wahren@i2se.com>
+Copyright (c) 2015 Linaro Limited.
+Copyright (C) 2018 Texas Instruments
+Copyright (C) 2009 Nokia
+Copyright (C) 2009-2010 Texas Instruments
+(C) Copyright 2018 Ramon Fried <ramon.fried@gmail.com>
+Copyright (c) 2013 MundoReader S.L.
+Copyright (C) STMicroelectronics 2017 - All Rights Reserved
+Copyright (C) 2018 SiFive, Inc.
+Copyright (C) 2013 Texas Instruments, Inc.
+Copyright (C) 2018 Lukasz Majewski <lukma@denx.de>
+(C) Copyright 2014 Hans de Goede <hdegoede@redhat.com>
+(C) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
+(C) Copyright 2016 Chen-Yu Tsai <wens@csie.org>
+(C) Copyright 2015 Vishnu Patekar <vishnuptekar0510@gmail.com>
+Copyright (c) 2012 Samsung Electronics Co., Ltd.
+Copyright (C) 2010 Andes Technology Corporation
+(C) Copyright 2012-2013
+(C) Copyright 2008-2009 Freescale Semiconductor, Inc.
+Copyright (c) 2009 Wind River Systems, Inc.
+Copyright (C) 2007-2009 Texas Instruments, Inc.
+Copyright (C) 2017 Intel Corporation <www.intel.com>
+Copyright Altera Corporation (C) 2014-2015
+Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+Copyright (C) 2017-2018 Intel Corporation <www.intel.com>
+Copyright Altera Corporation (C) 2012-2015
+Copyright (C) 2011-2012
+Copyright 2012 Calxeda, Inc.
+Copyright (C) 2016 Marvell International Ltd.
+Copyright 2009-2014 Freescale Semiconductor, Inc.
+Copyright (c) 2017 Free Electrons
+Copyright (C) 2019 Microchip Technology Inc.
+Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@gmail.com>
+Copyright (C) 2016 Atmel Corporation
+Copyright (C) 2018 Microhip / Atmel Corporation
+Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+Copyright (c) 2005 Ben Gardner <bgardner@wabtec.com>
+Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved
+Copyright (C) 2011 The ChromiumOS Authors.
+Copyright (C) 2008-2009 coresystems GmbH
+Copyright (C) 2012 The Chromium OS Authors.  All rights reserved.
+Copyright (c) 2011, Google Inc.
+Copyright (C) 2007-2008 coresystems GmbH
+Copyright (C) 2011 Google Inc.
+Copyright (C) 2012 Atmel Corporation
+Copyright 2007,2009-2014 Freescale Semiconductor, Inc.
+Copyright (C) 2013 Google, Inc
+(C) Copyright 2018 Allied Telesis
+(C) Copyright 2010, 2018
+Copyright 2018 Google, Inc
+Copyright (C) 2017 Microchip Corporation
+Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright 2018-2019 NXP
+Copyright (C) 2016 Nelson Integration, LLC
+Copyright (c) 2018, Theobroma Systems Design und Consulting GmbH
+Copyright (C) 2015 Purna Chandra Mandal <purna.mandal@microchip.com>
+Copyright (C) 2018 Arm Ltd
+Copyright (C) 2016 Xilinx, Inc.
+(C) Copyright 2015 Linaro
+(C) Copyright 2010 Freescale Semiconductor, Inc.
+(C)Copyright 2016 Rockchip Electronics Co., Ltd
+Copyright (C) 2017 Renesas Electronics
+Copyright (C) Chris Brandt
+Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
+Copyright (C) 2015-2019 Variscite Ltd.
+Copyright (C) 2019 Parthiban Nallathambi <parthitce@gmail.com>
+Copyright (C) 2013, Intel Corporation
+Copyright (C) 2015  Beckhoff Automation GmbH
+Copyright (C) 2015  Beckhoff Automation GmbH & Co. KG
+(C) Copyright 2017 Rob Clark
+Copyright (c) 2017 Leif Lindholm
+Copyright (c) 2016-2018 Alexander Graf et al.
+Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com
+(C) Copyright 2006-2010
+Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
+Copyright (C) 2003-2005 Nokia Corporation
+(C) Copyright 2004-2010
+(C) Copyright 2006-2008
+(C) Copyright 2004-2009
+(c) Copyright 2017 Opal Kelly Inc.
+Copyright (c) 2018, Bootlin
+Copyright (C) 2013 Guntermann & Drunck, GmbH
+Copyright (C) 2011 Infineon Technologies
+Copyright (C) 2016, STMicroelectronics - All Rights Reserved
+Copyright (C) 2010-2017 CS Systemes d'Information
+Author		Copyright (c) Marc A. Viredaz, 1998
+Copyright (C) 2014 Andrew Ruder <andrew.ruder@elecsyscorp.com>
+Copyright (C) 2012 Łukasz Dałek <luk0104@gmail.com>
+Copyright (C) 2018 Xilinx, Inc. - Michal Simek
+Copyright (C) 2013, Applied Micro Circuits Corporation
+(C) Copyright 2016 Cadence Design Systems Inc.
+Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+Copyright (C) 2015 Synopsys, Inc. All rights reserved.
+Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com
+(C) Copyright 2015-2016, Freescale Semiconductor, Inc.
+Copyright (C) 1993, 2003, 2004, 2005, 2006, 2007
+Copyright 2017-2018 NXP
+Copyright (C) 2019 Philippe Reynes <philippe.reynes@softathome.com>
+Copyright (C) 2008 Ronetix Ilko Iliev (www.ronetix.at)
+Copyright (C) 2009 Jean-Christopher PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+(C) Copyright 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+(C) Copyright 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+(C) Copyright 2008 Renesas Solutions Corp.
+(C) Copyright 2008, 2011 Renesas Solutions Corp.
+Copyright (C) 2007,2008 Nobuhiro Iwamatsu
+Copyright (c) 2007,2008 Nobuhiro Iwamatsu
+Copyright (c) 2008 Yusuke Goda <goda.yusuke@renesas.com>
+Copyright (C) 1996-2000 Russell King
+Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+Copyright (C)  2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C)  2012 Renesas Solutions Corp.
+(C) Dustin McIntire (dustin@sensoria.com)
+(C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+(C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
+Copyright (C) 1999, 2000  Niibe Yutaka
+Copyright (C) 1999 Niibe Yutaka
+Copyright (C) 1999, 2000  Niibe Yutaka  &  Kaz Kojima
+Copyright (C) 2002 Paul Mundt
+Copyright (C) 2010, STMicroelectronics - All Rights Reserved
+Copyright (C) 2012 Stefan Roese <sr@denx.de>
+Copyright (C) 2009, STMicroelectronics - All Rights Reserved
+Copyright (C) 2005 Silicon Graphics, Inc.
+Copyright (c) 2011, NVIDIA Corp. All rights reserved.
+(C) Copyright 2008,2009
+Copyright (C) 2011 The Chromium Authors.
+Copyright (C) 2015, Inverse Path
+Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
+Copyright 2016 IBM Corporation
+Copyright 2017 Google, Inc.
+(C) Copyright 2016 Songjun Wu <songjun.wu@atmel.com>
+(C) Copyright 2007 Sergey Kubushyn <ksi@koi8.net>
+(C) Copyright 2004-2014
+Some changes copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
+Copyright (c) 2016, Google Inc
+Copyright 2006,2009 Freescale Semiconductor, Inc.
+2012, Heiko Schocher, DENX Software Engineering, hs@denx.de.
+Copyright (C) 2015 Moritz Fischer <moritz.fischer@ettus.com>
+(C) Copyright 2015, Samsung Electronics
+Copyright (c) 2018 Arm Ltd.
+Copyright (C) 2009 Sergey Kubushyn <ksi@koi8.net>
+Copyright 2016 Freescale Semiconductors, Inc.
+(C) Copyright 2014-2015  DENX Software Engineering GmbH
+(C) Copyright 2017 - Beniamino Galvani <b.galvani@gmail.com>
+Copyright (c) 2010 Albert Aribaud.
+(C) Copyright 2003 Pengutronix e.K.
+(C) Copyright 2011 Marvell Inc.
+(c) 2011 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2005 Torsten Koschorrek <koschorrek at synertronixx.de>
+Copyright (C) 2005 Matthias Blaschke <blaschke at synertronixx.de>
+Copyright (C) 2007 RightHand Technologies, Inc.
+Copyright (C) 2008 Darius Augulis <darius.augulis at teltonika.lt>
+Copyright (c) 2004 Texas Instruments
+Copyright (c) 2003 Wolfgang Denk, wd@denx.de
+Copyright (c) 2013 Lubomir Popov <lpopov@mm-sol.com>, MM Solutions
+Copyright (c) 2014 Hannes Schmelzer <oe5hpm@oevsv.at>, B&R
+Copyright (C) 2014-15 Wolfram Sang <wsa@sang-engineering.com>
+Copyright (C) 2011-2015 Renesas Electronics Corporation
+Copyright (C) 2012-14 Renesas Solutions Corp.
+Copyright (C) 2011, 2013 Renesas Solutions Corp.
+Copyright (C) 2011, 2013 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+(C) Copyright 2001, 2002
+(C) Copyright 2017 STMicroelectronics
+Copyright (c) 2010-2011 NVIDIA Corporation
+Copyright (c) 2002-2007 Xilinx Inc.
+Copyright (c) 2009-2010 Intel Corporation
+Copyright (c) 2018 Linaro Limited
+Copyright (c) 2015-2018, Linaro Limited
+Copyright (c) 2016-2018, Linaro Limited
+Copyright 2014 Google Inc.
+Copyright (c) 2014, NVIDIA Corporation.
+Copyright (c) 2011-2013, NVIDIA Corporation.
+(c) 2011 Graf-Syteco, Matthias Weisser
+(C) Copyright 2009 DENX Software Engineering
+Copyright (C) 2008,2009 Eric Jarrige <jorasse@users.sourceforge.net>
+Copyright (C) 2009 Ilya Yanok <yanok@emcraft.com>
+Copyright (C) 2013 Seco USA Inc
+Copyright (C) 2015 ECA Sinters
+Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+generated by ppmlogo (c) 2004 by Andre Renaud from logogurnardsmall.ppm
+Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2013 Boundary Devices Inc.
+Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2014 - 2016 Freescale Semiconductor, Inc.
+Copyright (C) 2013 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2014 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2017 Armadeus Systems
+Copyright (c) 2017 Microsemi Corporation
+Copyright (C) 2017-2018 STMicroelectronics - All Rights Reserved
+Copyright 2014 Freescale Semiconductor
+Copyright (C) 2014, STMicroelectronics - All Rights Reserved
+Copyright (c) 2010-2012 NVIDIA Corporation <www.nvidia.com>
+Copyright 2011-2012 NVIDIA Corporation
+(C) Copyright 2015 Stephen Warren
+(C) Copyright 2014 Suriyan Ramasami
+(C) Copyright 2014-2015
+Copyright (C) 2015, Microchip Technology Inc.
+Copyright 2004-2012 Freescale Semiconductor, Inc.
+(C) Copyright 2002 - 2010
+Copyright (c) 2003 Josef Baumgartner <josef.baumgartner@telex.de>
+2006 Zachary P. Landau <zachary.landau@labxtechnologies.com>
+Copyright (c) 2005 Arthur Shipkowski <art@videon-central.com>
+Based on work Copyright (c) 2003 Josef Baumgartner
+(C) Copyright 2014  Angelo Dureghello <angelo@sysam.it>
+Copyright 2010-2012 Freescale Semiconductor, Inc.
+(C) Copyright 1999, Greg Ungerer (gerg@snapgear.com)
+(C) Copyright 2000, Lineo Inc. (www.lineo.com)
+(C) Copyright 2006, Lab X Technologies <zachary.landau@labxtechnologies.com>
+Copyright (C) 2003-2004, Greg Ungerer (gerg@snapgear.com)
+Copyright (C) 2004-2008 Arthur Shipkowski (art@videon-central.com)
+(C) Copyright 2000 - 2003
+Copyright (C) 2007,2010 Freescale Semiconductor, Inc.
+Copyright (C) 2015  Phil Sutter <phil@nwl.cc>
+Copyright (C) 2015 Phil Sutter <phil@nwl.cc>
+Copyright (C) ST-Ericsson SA 2010
+and hence presumably (C) 2012 Oleksandr Tymoshenko
+(C) 2012 Stephen Warren
+The Linux kernel code has the following (c) and license, which is hence
+Based on sdhci-bcm2708.c (c) 2010 Broadcom
+Copyright (C) 2015-2016 Raspberry Pi (Trading) Ltd.
+Copyright (C) 2010 Texas Instruments Incorporated
+Copyright 2007, 2010-2011 Freescale Semiconductor, Inc
+Copyright 2019 NXP Semiconductors
+Copyright 2018 Andes Technology, Inc.
+Copyright (C) 2004-2006 Atmel Corporation
+(C) Copyright 2016 Carlo Caione <carlo@caione.org>
+Copyright 2008, Freescale Semiconductor, Inc
+Copyright 2008,2010 Freescale Semiconductor, Inc
+Copyright (C) 2009 Ilya Yanok, <yanok@emcraft.com>
+Copyright (C) 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
+Copyright (C) 2006 Pavel Pisa, PiKRON <ppisa@pikron.com>
+(C) Copyright 2008-2010 Freescale Semiconductor, Inc.
+Copyright 2007, Freescale Semiconductor, Inc
+Copyright (C) 2015, Google, Inc
+Copyright (C) 2015 Microchip Technology Inc.
+Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
+(C) Copyright 2016 Fuzhou Rockchip Electronics Co., Ltd
+Copyright 2014, Staubli Faverges
+Copyright (C)  2011 Renesas Solutions Corp.
+Copyright (C) 2011,2013-2017 Renesas Electronics Corporation
+Copyright (C) 2019 Synopsys
+(C) Copyright 2013 Altera Corporation <www.altera.com>
+(C) Copyright 2007-2011
+Copyright 2011-2016 NVIDIA Corporation
+Copyright (C) 2016 Marvell, All Rights Reserved.
+(C) Copyright 2013 - 2015 Xilinx, Inc.
+Copyright 2007,2009 Wind River Systems, Inc. <www.windriver.com>
+Copyright 2007 Embedded Specialties, Inc.
+Copyright 2004, 2007 Freescale Semiconductor.
+(C) Copyright 2016 Vladimir Zapolskiy <vz@mleia.com>
+Copyright (C) 2010 Samsung Electronics
+Copyright (C) 2010 Texas Instruments
+Copyright (C) 2007,2008 Oracle.  All rights reserved.
+Copyright (C) 2017 Grinn
+Copyright (C) 2011, Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2010 Linaro
+Copyright 2016 Broadcom Corporation.
+Copyright 2016-2018 NXP
+Copyright 2015, Freescale Semiconductor
+Copyright 2014-2015, Freescale Semiconductor
+Copyright 2017-2019 NXP
+Copyright 2016 NXP Semiconductor, Inc.
+Copyright 2014-2015, Freescale Semiconductor, Inc.
+Copyright 2017 NXP Semiconductor, Inc.
+Copyright 2015-2018 NXP
+(C) Copyright 2017 Linaro
+Copyright (C) 2017 NXP
+Copyright (C) 2011 by Vladimir Zapolskiy <vz@mleia.com>
+(C) Copyright 2015  DENX Software Engineering GmbH
+Copyright (C) 2011 Vladimir Zapolskiy <vz@mleia.com>
+Copyright 2014, Freescale Semiconductor
+Copyright 2016 - AmLogic, Inc.
+Copyright 2018 - Beniamino Galvani <b.galvani@gmail.com>
+Copyright 2018 - BayLibre, SAS
+(C) Copyright 2016 - Beniamino Galvani <b.galvani@gmail.com>
+Copyright 2017 - Beniamino Galvani <b.galvani@gmail.com>
+(c) 2009 Ilya Yanok, Emcraft Systems <yanok@emcraft.com>
+Copyright (C) 2009, DENX Software Engineering
+Copyright (C) 2009 Ilya Yanok,
+Emcraft Systems <yanok@emcraft.com>
+Copyright (C) 2007 Pengutronix,
+Sascha Hauer <s.hauer@pengutronix.de>
+(C) Copyright 2013 ADVANSEE
+Copyright (C) 2009 by Lothar Wassmann <LW@KARO-electronics.de>
+Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH <armlinux@phytec.de>
+Copyright (c) 2009 Ilya Yanok <yanok@emcraft.com>
+Copyright (C) 2012 Philippe Reynes <tremyfr@yahoo.fr>
+Copyright 2004-2009 Freescale Semiconductor, Inc.
+Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com>
+Copyright (C) 2009-2012 Genesi USA, Inc.
+Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2015 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2008 Embedded Alley Solutions Inc.
+(C) Copyright 2009-2010 Freescale Semiconductor, Inc.
+Copyright (C) 2012 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2012 Robert Delien <robert@delien.nl>
+Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2012 Marek Vasut <marex@denx.de>
+Copyright (C) 2013 Andreas Wass <andreas.wass@dalelven.com>
+Copyright (c) 2010 Texas Instruments Incorporated
+(c) 2011 Comelit Group SpA, Luca Ceresoli <luca.ceresoli@comelit.it>
+Copyright (C) 2018 Amarula Solutions.
+(C) Copyright 2015 Vishnu Patekar <vishnupatekar0510@gmail.com>
+(C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+(C) Copyright 2014 Hans de Goede <hdegoede@redhat.com
+(C) Copyright 2017 Jernej Skrabec <jernej.skrabec@siol.net>
+Copyright (C) 2016 Jean-Francois Moine <moinejf@free.fr>
+Copyright (c) 2016 Allwinnertech Co., Ltd.
+(C) Copyright 2015 Roy Spliet <rspliet@ultimaker.com>
+(C) Copyright 2017  Icenowy Zheng <icenowy@aosc.io>
+(C) Copyright 2007-2015 Allwinner Technology Co.
+(C) Copyright 2015      Vishnu Patekar <vishnupatekar0510@gmail.com>
+(C) Copyright 2016  Theobroma Systems Design und Consulting GmbH
+(C) Copyright 2015      Jens Kuske <jenskuske@gmail.com>
+(C) Copyright 2016 Theobroma Systems Design und Consulting GmbH
+Copyright 2014 - Hans de Goede <hdegoede@redhat.com>
+(c) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
+(c)Copyright 2006-2013
+(C) Copyright 2016 Hans de Goede <hdegoede@redhat.com>
+(C) Copyright 2015 Chen-Yu Tsai <wens@csie.org>
+Copyright (c) 1996 Russell King.
+Copyright (C) 2016 ARM Ltd.
+Original copyright in armv7.h was:
+(C) Copyright 2010 Texas Instruments, <www.ti.com> Aneesh V <aneesh@ti.com>
+Copyright 1995, Russell King.
+(C) Copyright 2017 NVIDIA Corporation <www.nvidia.com>
+Copyright (C) 2012 ARM Ltd.
+Copyright (C) 1994-2002 Russell King
+Copyright (C) 2003-2012 ARM Ltd.
+Copyright (C) 2014 ARM Ltd.
+Copyright (C) 2006 Texas Instruments.
+Copyright (C) 2009-2010 Texas Instruments, Inc.
+Copyright (C) 1996 Russell King
+Copyright (C) 2000-2002 Russell King
+Copyright (C) 2012, Ilya Yanok <ilya.yanok@gmail.com>
+Copyright (C) 2012 ARM Limited
+Copyright (C) 2012  Linaro Limited
+Copyright (C) 1996-1998 Russell King.
+Copyright (C) 1999 Russell King.
+Copyright (C) 1996-1999 Russell King.
+Copyright (C) 1996-1999 Russell King
+Copyright (C) 1995-2002 Russell King
+(C) Copyright 2016 Alexander Graf <agraf@suse.de>
+Copyright (C) 1997-1999 Russell King
+Copyright (C) 2006-2014 Texas Instruments.
+Copyright (C) 2008 ARM Limited
+Copyright 2017 General Electric Company
+Copyright 2016 General Electric Company
+Copyright (C) 2011-2015 by Vladimir Zapolskiy <vz@mleia.com>
+Copyright (C) 2015 Compulab, Ltd.
+Copyright (C) 2016 Compulab, Ltd.
+Copyright 2008 (C) Bryan O'Donoghue
+Copyright (C) 2002-2011 Aleph One Ltd.
+Copyright (C) 2002-2007 Aleph One Ltd.
+Copyright (c) 1992, 1993
+Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
+Copyright (C) 2017 Microchip
+Copyright (C) 2015 Marek Vasut <marex@denx.de>
+Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
+Copyright (C) 2011, Stefano Babic <sbabic@denx.de>
+(C) Copyright 2011, 2012, 2013
+Copyright (C) 2016 Mario Six <mario.six@gdsys.cc>
+Copyright (C) 2009 Texas Instruments Incorporated
+Copyright (C) 2008 Lyrtech <www.lyrtech.com>
+Copyright (C) 2011 OMICRON electronics GmbH
+Copyright (C) 2011 DENX Software Engineering GmbH
+Copyright (C) 2011 Simon Guinot <sguinot@lacie.com>
+Copyright 2015 Xilinx, Inc.
+Copyright 2009 Extreme Engineering Solutions, Inc.
+Copyright 2007-2008 Freescale Semiconductor, Inc.
+Copyright 2016 - 2017 Xilinx, Inc.
+Copyright 2018 Xilinx, Inc.
+Copyright 2015 - 2016 Xilinx, Inc.
+Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright (c) 2006  SUSE Linux Products GmbH
+Copyright (c) 2006  Tejun Heo <teheo@suse.de>
+Copyright (C) 1996-2005 Paul Mackerras.
+Copyright (C) 2012, Stefano Babic <sbabic@denx.de>
+Copyright (C) 2017, Intel Corporation
+(C) Copyright 2009-2011
+Copyright (C) 2005 David Brownell
+Copyright 2019 Toradex
+Copyright 2013 Freescale Semiconductor
+Copyright (C) 2013 Jon Nettleton <jon.nettleton@gmail.com>
+IT6251 code based on code Copyright (C) 2014 Sean Cross
+Copyright (C) 2008-2013 Tensilica Inc.
+Copyright (C) 1999-2007 Tensilica Inc.
+Copyright (C) 2005 - 2013 Tensilica Inc.
+Copyright (C) 2014 - 2016 Cadence Design Systems Inc.
+Copyright (C) 2001 - 2012 Tensilica Inc.
+Copyright (C) 2001 - 2009  Tensilica Inc.
+Copyright (C) 2001 - 2007 Tensilica Inc.
+Copyright (C) 2009 Tensilica Inc.
+Copyright (C) 2006 Tensilica Inc.
+(C) Copyright 2007, Tensilica Inc.
+Copyright (C) 2001-2007 Tensilica Inc.
+(C) Copyright 2007 Tensilica, Inc.
+(C) Copyright 2008, Tensilica Inc.
+Copyright (C) 2007, Tensilica Inc.
+Copyright (C) 1997 Tensilica Inc.
+Copyright (c) 2006 Tensilica, Inc.  All Rights Reserved.
+Copyright (c) 2009 esd gmbh.
+Copyright (c) 2006 Wind River Systems, Inc.
+Copyright (c) 2008-2009 esd gmbh.
+(C) Copyright 2014-2016
+Copyright (c) 2013-2014, Stefan Agner
+(C) Copyright 2015 Inter Act B.V.
+Copyright (C) 2017 Stefano Babic <sbabic@denx.de>
+Copyright (c) 2015 Vladimir Zapolskiy <vz@mleia.com>
+(C) Copyright 2016 Stephen Warren <swarren@wwwdotorg.org>
+Copyright (c) 2015  Angelo Dureghello <angelo@sysam.it>
+Copyright (c) 2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>
+Copyright (c) 2014  Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (c) 2014  Renesas Electronics Corporation
+Copyright (c) 2018  Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2018 Jagan Teki <jagan@amarulasolutions.com>
+(C) Copyright 2010 Andreas Bießmann <andreas@biessmann.org>
+Copyright (C) 2018 Marvell International Ltd.
+(C) Copyright 2014 Pierrick Hascoet, Abilis Systems
+Copyright (C) 2007-2010 coresystems GmbH
+Copyright (C) 2007-2009 coresystems GmbH
+Copyright (C) 2011 The Chromium Authors
+Copyright (C) 2013 Ideas On Board SPRL
+Copyright (C) 2015-2017 Glider bvba
+Copyright (C) 2015 Glider bvba
+Copyright (C) 2017-2018 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2015-2016 Glider bvba
+Copyright (C) 2018 Alexander Graf <agraf@suse.de>
+Copyright (C) 2012 Bluegiga Technologies Oy
+(C) Copyright 2018 Xilinx, Inc. (Michal Simek)
+Copyright (c) 2015 Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Copyright 2013 Albert ARIBAUD <albert.u.boot@aribaud.net>
+Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
+Copyright (C) 1996-1999 SciTech Software, Inc.
+Copyright (C) 2019, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2017 Allied Telesis Labs
+Copyright (C) 2016 Amarula Solutions B.V.
+Copyright (C) 2016 Engicam S.r.l.
+Copyright (c) 2008 Eric Jarrige <eric.jarrige@armadeus.org>
+Copyright (C) 2013 Regents of the University of California
+Copyright (C) 2017 SiFive
+Copyright (C) 2015 Regents of the University of California
+Copyright (c) 2018 Western Digital Corporation or its affiliates.
+Copyright (c) 2017 Microsemi Corporation.
+Copyright (c) 2005-2007 Analog Devices Inc.
+Copyright (C) 2010 Shawn Lin (nobuhiro@andestech.com)
+Copyright (C) 2011 Macpaul Lin (macpaul@andestech.com)
+Copyright (C) 2017 Rick Chen (rick@andestech.com)
+Copyright (c) 2017 Padmarao Begari <Padmarao.Begari@microsemi.com>
+(C) Copyright 2018 Alexander Graf <agraf@suse.de>
+Copyright (C) 2019 Fraunhofer AISEC,
+Lukas Auer <lukas.auer@aisec.fraunhofer.de>
+Copyright (C) 2015-2019 Stefan Roese <sr@denx.de>
+Copyright (c) 2017 Tuomas Tynkkynen
+Copyright (C) 2017 Renesas Electronics Corporation
+(C) Copyright 2017 Vasily Khoruzhick <anarsoul@gmail.com>
+Copyright (C) 2019 Hannes Schmelzer <oe5hpm@oevsv.at>
+Copyright (C) 2017 Google, Inc
+(C) Copyright 2015, Siemens AG
+Copyright (c) International Business Machines Corp., 2006
+Copyright (c) Thomas Gleixner <tglx@linutronix.de>
+(C) 2018 Google, Inc
+Copyright (c) 2011-2012 The Chromium OS Authors.
+Copyright (C) 2017 Vasily Khoruzhick <anarsoul@gmail.com>
+Copyright (C) 2007,2008
+Copyright (C) 2013, Masahiro Yamada <yamada.m@jp.panasonic.com>
+Copyright (C) 2016, Lukasz Majewski <l.majewski@majess.pl>
+Copyright 2019 NXP
+Copyright    2002 by Kai Germaschewski  <kai.germaschewski@gmx.de>
+Copyright abandoned, Michael Chastain, <mailto:mec@shout.net>.
+Copyright (C) 2013 Bo Shen <voice.shen@atmel.com>
+Copyright (C) 2015 Wenyou Yang <wenyou.yang@atmel.com>
+Copyright (C) 2012-2013 Atmel Corporation
+(C) Copyright 2016-2017 Rockchip Inc.
+Copyright (C) 2016 Stefano Babic <sbabic@denx.de>
+(C) Copyright 2017 Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2018 Linaro Limited
+(C) Copyright 2016 Savoir-faire Linux Inc.
+Copyright 2019 NXP.
+Copyright 2014-2015 Freescale Semiconductor
+Copyright (c) 2012-2014 Birdland Audio - http://birdland.com/oem
+Copyright (c) 2012-2014, Birdland Audio - http://birdland.com/oem
+Copyright (C) 2015 Free Electrons
+copyright (c) 2013-2016, ARM Limited and Contributors. All rights
+Copyright (C) 2016 Rockchip Electronic Co.,Ltd
+Copyright (C) 2017 Theobroma Systems Design und Consulting GmbH
+Copyright (C) 2017 Theobroma Systems Design und Consulting GmH
+(C) Copyright 2016 Toradex
+Copyright (C) 2016
+Copyright (C) 2018 Marek Behun <marek.behun@nic.cz>
+Copyright (C) 2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>
+(C) Copyright 2015 General Electric Company
+(C) Copyright 2013 Samsung Electronics
+(C) Copyright 2010 Samsung Electronics
+Copyright (C) 2012 Samsung Electronics Co.Ltd
+(C) Copyright 2012 Samsung Electronics
+Copyright (C) 2009 Samsung Electronics
+Copyright (C) 2010 Samsung Electrnoics
+(C) Copyright 2009 Samsung Electronics
+Copyright (c) 2012 Samsung Electronics Co. Ltd
+Copyright (c) 2012 Samsung Electronics.
+Copyright (c) 2010 Samsung Electronics.
+Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
+Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+Copyright 2007-2014 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Synopsys
+Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. All rights reserved.
+Copyright (C) 2004, 2007-2010, 2011-2015 Synopsys, Inc. All rights reserved.
+Copyright (C) 2014 Synopsys, Inc. All rights reserved.
+Copyright (C) 2012 Andes Technology Corporation
+Copyright (C) STMicroelectronics SA 2017
+(C) 2017 Theobroma Systems Design und Consulting GmbH
+(C) Copyright 2017, Xilinx Inc.
+Copyright (C) 2008 Advanced Micro Devices, Inc.
+Copyright 2010 Maxim Integrated Products
+Copyright 2011 Maxim Integrated Products
+Copyright 2014 Rockchip Electronics Co., Ltd.
+Copyright 2018 Google, LLC
+Copyright 2013 Realtek Semiconductor Corp.
+(C) Copyright 2011-2012
+(C) Copyright 2004-2005
+Copyright (C) 2004	Nokia Corporation
+(C) Copyright 2018 Xilinx, Inc.
+(c) 2004 Sascha Hauer <sascha@saschahauer.de>
+Copyright (c) 2018 Google, Inc
+Copyright (C) 2003 Arabella Software Ltd.
+Copyright (C) 2004
+(C) 2000 Red Hat. GPL'd.
+Copyright © 2002 Robert Kaiser <rkaiser@sysgo.de>
+Copyright © 2002-2010 David Woodhouse <dwmw2@infradead.org>
+Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org>
+Copyright © 2006      Red Hat UK Limited
+Copyright © 2000 Nicolas Pitre <nico@fluxnic.net>
+Copyright © 2002 Thomas Gleixner <gleixner@linutronix.de>
+Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org>
+Copyright (C) 2016 Microchip
+Copyright (C) 2018 Robert Bosch Power Tools GmbH
+Copyright (C) 2018 Philippe Reynes <philippe.reynes@softathome.com>
+Copyright (C) 2013 Gateworks Corporation
+Copyright (C) 2009 Freescale Semiconductor, Inc.
+Copyright 2009-2010 Freescale Semiconductor.
+Copyright 2006 Freescale Semiconductor.
+Copyright 2018 NXP.
+Copyright 2010-2011 Freescale Semiconductor
+Copyright 2006,2010 Freescale Semiconductor
+Copyright 2011 Freescale Semiconductor
+Copyright 2006, 2008-2009, 2011 Freescale Semiconductor
+Copyright (C) 2007 Logic Product Development, Inc.
+Copyright (C) 2007 MontaVista Software, Inc.
+(C) Copyright 2008 - 2010
+Copyright (C) 2007-2011 Freescale Semiconductor, Inc.
+Copyright 2007 Freescale Semiconductor, Inc.
+Copyright (C) Freescale Semiconductor, Inc. 2007
+Copyright (C) 2007-2009  Freescale Semiconductor, Inc.
+Copyright (C) 2008-2009  MontaVista Software, Inc.
+Copyright 2007,2011 Freescale Semiconductor, Inc.
+Copyright (C) 2008 MontaVista Software, Inc.
+(C) Copyright 2006-2007 Freescale Semiconductor, Inc.
+Copyright (C) 2004-2006 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Allied Telesis Labs
+Copyright (c) 2014 DENX
+Copyright (C) DENX
+Original code (C) Copyright 2010
+(C) Copyright 2013 Siemens AG
+Copyright 2018 Google
+Copyright (C) 2018 Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright 2016 Rockchip Electronics Co., Ltd
+(C) Copyright 2009 Atin Malaviya (atin.malaviya@gmail.com)
+Copyright (C) 2004-2007 Texas Instruments
+Copyright (C) 2008 Nokia Corporation
+Copyright (C) David Mosberger-Tang
+Copyright (C) 1999 Egbert Eich
+Copyright (c) 2009 Samsung Electronics
+Copyright (C) 2009 Samsung Electrnoics
+Copyright 2008-2010 Freescale Semiconductor, Inc.
+Copyright (C) 2000,2001  Larry Doolittle  <larry@doolittle.boa.org>
+Copyright (C) Nalin Dahyabhai <bigfun@pobox.com>
+Copyright (c) 2009  MontaVista Software, Inc.
+Copyright (c) 2011 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Copyright (c) 2014 Google, Inc.
+Copyright (c) 2008-2009 Analog Devices Inc.
+Copyright 2009 Analog Devices Inc.
+(C) Copyright 2001-2002
+(C) Copyright 2001-2015
+Copyright (c) Orbacom Systems, Inc <www.orbacom.com>
+(C) Copyright Linus Torvalds 1999
+(C) Copyright Johannes Erdfelt 1999-2001
+(C) Copyright Andreas Gal 1999
+(C) Copyright Gregory P. Smith 1999
+(C) Copyright Deti Fliegl 1999 (new USB architecture)
+(C) Copyright Randy Dunlap 2000
+(C) Copyright David Brownell 2000 (kernel hotplug, usbdeviceid)
+(C) Copyright Yggdrasil Computing, Inc. 2000
+(C) Copyright 2001 Denis Peter, MPL AG Switzerland
+(c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
+(c) 2000 David L. Brown, Jr. (usb-storage@davidb.org)
+(c) 1999 Michael Gee (michael@linuxspecific.com)
+(c) 2000 Yggdrasil Computing, Inc.
+For BBB support (C) Copyright 2003
+Copyright (C) 2015  Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright (c) 2013 Google, Inc.
+Copyright (C) 2013-2016, Yann Collet.
+Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+Copyright (C) 2016, Yann Collet.
+Copyright (C) 2013-2015, Yann Collet.
+Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc.
+Copyright (C) 2017 PHYTEC Messtechnik GmbH
+Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2010 Reinhard Meyer, EMK Elektronik
+Copyright (C) 2013 Jagannadha Sutradharudu Teki, Xilinx Inc.
+Copyright (C) 2012-2014 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
+Copyright (C) 2005, Intec Automation Inc.
+Copyright (C) 2014, Freescale Semiconductor, Inc.
+Copyright (C) 2016 Jagan Teki <jagan@openedev.com>
+Copyright (C) 2015 Cogent Embedded, Inc.
+Copyright (c) 2006-2007 Wind River Systems, Inc.
+Copyright (C) 2018-2019 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2014 Renesas Electronics Europe Ltd
+Copyright (C) 2009 - 2011  Paul Mundt
+(C) Copyright 2002, 2003
+Copyright (C) 2013-2018 Intel Corporation. All rights reserved
+Copyright 2000 MontaVista Software Inc.
+Copyright (C) 1999, 2000, 2004  MIPS Technologies, Inc.
+Copyright (C) 1998 Gabriel Paubert.
+Copyright (C) 2003-2004 Linux Networx
+Copyright (C) 2003-2006 Ronald G. Minnich <rminnich@gmail.com>
+Copyright (C) 2004-2005 Li-Ta Lo <ollie@lanl.gov>
+Copyright (C) 2005-2006 Tyan
+Copyright (C) 2005-2009 coresystems GmbH
+Copyright 1993 -- 1997 Drew Eckhardt, Frederic Potter,
+David Mosberger-Tang
+Copyright 1997 -- 1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+Copyright (c) 2010, CompuLab, Ltd.
+Copyright (c) 2008-2009, NVIDIA Corporation.
+Copyright (c) 2013-2014, NVIDIA Corporation.
+(c) Copyright 2016 by VRT Technology
+(c) Copyright 2011 by Tigris Elektronik GmbH
+(C) Copyright 2008-2011 Freescale Semiconductor, Inc.
+(C) Copyright 2010 DENX Software Engineering
+(C) Copyright 2005-2009 Samsung Electronics
+(C) Copyright 2011-2012 Freescale Semiconductor, Inc.
+(C) Copyright 2010-2016 Freescale Semiconductor, Inc.
+(C) Copyright 2008 Atmel Corporation
+(c) Copyright 2012 by National Instruments,
+Joe Hershberger <joe.hershberger@ni.com>
+Copyright (C) 2013 Andes Technology Corporation
+Copyright (C) 2008 Andes Technology Corporation
+Copyright (C) 2013 Ken Kuo (kenkuo@andestech.com)
+Copyright (C) 2014, Barco (www.barco.com)
+Copyright (C) 2015, Miao Yan <yanmiaobest@gmail.com>
+Copyright (C) 2011 Mistral Solutions Pvt Ltd
+Copyright (C) 2008 Renaud CERRATO r.cerrato@til-technologies.fr
+Copyright (C) 2017 Paolo Pisati <p.pisati@gmail.com>
+Copyright (C) 2007 Miguel Gaio <miguel.gaio@efixo.com>
+Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
+Copyright (C) 2013 Altera Corporation <www.altera.com>
+(c) Copyright 2004 Faraday Technology Corp. (www.faraday-tech.com)
+Copyright 2017 CS Systemes d'Information
+Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2013 John Crispin <blogic@openwrt.org>
+(c) Copyright 2000 Oleg Drokin <green@crimea.edu>
+Copyright (c) 2004 Texas Instruments.
+Copyright (c) 2005 David Brownell
+Copyright (c) 2011-2018 Xilinx Inc.
+(C) Copyright 2013 Keymile AG
+(C) Copyright 2010-2011
+Copyright (C) 2015, Saket Sinha <saket.sinha89@gmail.com>
+Copyright (c) 2014 The Chromium OS Authors.
+Copyright (C) 2010 coresystems GmbH
+Copyright 2002 Andy Grover <andrew.grover@intel.com>
+Copyright (C) 2015 Bin Meng <bmeng.cn@gmail.com>
+Copyright(c) 2009 Intel Corporation. All rights reserved.
+Copyright (c) 2015 Gooogle, Inc
+2012 secunet Security Networks AG
+Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
+Copyright (C) 2015 Udoo
+Copyright (C) 2012 Ilya Yanok <ilya.yanok@gmail.com>
+(C) Copyright 2011, Ilya Yanok, Emcraft Systems
+Copyright (C) 2004-2010
+Copyright (C) 2011 The ChromiumOS Authors.  All rights reserved.
+Copyright (C) 2016, Imagination Technologies Ltd.
+(C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
+(C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+Copyright (c) 2015 Microchip Technology Inc.
+Copyright (C) Stefano Babic <sbabic@denx.de>
+Copyright (C) 2014 Soeren Moch <smoch@web.de>
+Copyright (C) 2017 Soeren Moch <smoch@web.de>
+Copyright (c) 2010, by Texas Instruments
+Copyright (c) 2008-2009, MontaVista Software, Inc. <source@mvista.com>
+Copyright 2005 Mentor Graphics Corporation
+Copyright (C) 2005-2006 by Texas Instruments
+Copyright (C) 2006-2007 Nokia Corporation
+Copyright (C) 2012, by Texas Instruments
+Copyright (C) 2009 MontaVista Software, Inc. <source@mvista.com>
+Copyright (C) 2008-2009 MontaVista Software, Inc. <source@mvista.com>
+Copyright © 2015 Hans de Goede <hdegoede@redhat.com>
+Copyright (C) 2005-2007 by Texas Instruments
+Copyright (C) 2006 Nokia Corporation
+Copyright © 2013 Jussi Kivilinna <jussi.kivilinna@iki.fi>
+Copyright 2007-2012 (C) Allwinner Technology Co., Ltd.
+Copyright (c) 2008-2009 MontaVista Software, Inc. <source@mvista.com>
+(C) Copyright 2018 Neil Armstrong <narmstrong@baylibre.com>
+(C) Copyright 2019 Julien Masson <jmasson@baylibre.com>
+(C) Copyright 2019 Neil Armstrong <narmstrong@baylibre.com>
+Copyright (C) 2013 Lothar Felten <lothar.felten@gmail.com>
+(C) Copyright 2008-2009 Stefan Roese <sr@denx.de>, DENX Software Engineering
+Copyright (C) 2014 Freescale Semiconductor
+Copyright 2013-2016 Freescale Semiconductor, Inc.
+Copyright 2013-2015 Freescale Semiconductor Inc.
+Copyright (C) 2015 Freescale Semiconductor
+(C) Copyright TechNexion 2010
+Copyright (C) 2013  Renesas Electronics Corporation
+Copyright (C) 2013  Magnus Damm
+Copyright (C) 2012  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Copyright (C) 2014-2017 Cogent Embedded, Inc.
+Copyright (C) 2013-2014 Renesas Electronics Corporation
+Copyright (C) 2016 Cogent Embedded, Inc., <source@cogentembedded.com>
+Copyright (C) 2014-2015 Renesas Electronics Corporation
+Copyright (C) 2015 Renesas Solutions Corp.
+Copyright (C) 2015-2017 Cogent Embedded, Inc. <source@cogentembedded.com>
+Copyright (C) 2016-2017 Renesas Electronics Corp.
+Copyright (C) 2015  Renesas Electronics Corporation
+Copyright (C) 2017 Cogent Embedded, Inc. <source@cogentembedded.com>
+Copyright (C) 2017 Renesas Electronics Corp.
+Copyright (C) 2008 Magnus Damm
+Copyright (C) 2009 - 2012 Paul Mundt
+Copyright (C) 2017 Marek Vasut
+Copyright (c) 2008 Magnus Damm
+Copyright (C) Jasbir Matharu
+Copyright (C) UDOO Team
+Copyright (C) 2015 Socionext Inc.
+Copyright (C) 2004-2007 ARM Limited.
+Copyright (C) 2015 - 2016 Xilinx, Inc, Michal Simek
+(C) Copyright 2004-2007 Freescale Semiconductor, Inc.
+(C) Copyright 2015  Angelo Dureghello <angelo@sysam.it>
+(C) Copyright 2018  Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
+Copyright (c) 2018 Alexander Graf <agraf@suse.de>
+(C) Copyright 2013-2016 Freescale Semiconductor, Inc.
+(c) 2007 Sascha Hauer <s.hauer@pengutronix.de>
+(c) 2015 Paul Thacker <paul.thacker@microchip.com>
+(C) Copyright 2003, 2004
+Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
+(C) Copyright 2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>
+Copyright (C) 2007,2008,2010, 2014 Nobuhiro Iwamatsu
+Copyright (C) 2002 - 2008  Paul Mundt
+Copyright (C) 2018 Anup Patel <anup@brainfault.org>
+(C) Copyright 2008 - 2015 Michal Simek <monstr@monstr.eu>
+Copyright (C) 2011-2012 Xilinx, Inc. All rights reserved.
+(C) Copyright 2005, Psyent Corporation <www.psyent.com>
+(C) Copyright 2010, Thomas Chou <thomas@wytron.com.tw>
+Copyright (C) 2016 Timesys Corporation
+Copyright (C) 2016 Advantech Corporation
+Copyright (C) 2018 sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Copyright (C) 2015 Toby Churchill Ltd - http://www.toby-churchill.com/
+Copyright (C) 2011 Mistral Solutions pvt Ltd
+Copyright (c) 2017 Toradex, Inc.
+Copyright 2013-2019 Toradex, Inc.
+Copyright (c) 2014-2016 Marcel Ziswiler
+Copyright (C) 2008-2013 Eric Jarrige <eric.jarrige@armadeus.org>
+(C) Copyright 2003 Josef Baumgartner <josef.baumgartner@telex.de>
+Copyright (C) 2010 Andreas Bießmann <biessmann.devel@googlemail.com>
+(C) Copyright 2013 Atmel Corporation.
+Copyright (C) 2013-2016 Synopsys, Inc. All rights reserved.
+(C) Copyright 2018 Michal Simek <monstr@monstr.eu>
+Copyright 2016 3ADEV <http://3adev.com>
+Copyright (C) 2013 Hannes Schmelzer <oe5hpm@oevsv.at> -
+Copyright (C) 2016 Hannes Schmelzer <oe5hpm@oevsv.at> -
+Copyright (c) 2008, 2009 esd gmbh Hannover Germany
+(c) Copyright 2016, Data61
+(C) Copyright 2013-2014
+Copyright (C) 2017 Grinn - http://grinn-global.com/
+Copyright (C) 2015 CompuLab, Ltd.
+Copyright (C) 2013, Compulab Ltd - http://compulab.co.il/
+(C) Copyright 2011 CompuLab, Ltd.
+Copyright 2018-2019 Toradex AG
+Copyright 2016-2018 Toradex AG
+Copyright (C) 2015-2016 Marcel Ziswiler <marcel@ziswiler.com>
+Copyright (C) 2012 Lucas Stach
+Copyright (c) 2013-2016 Stefan Agner
+Copyright 2015-2019 Toradex, Inc.
+Copyright (C) 2018 Renesas Electronics Corporation
+(C) Copyright 2005-2009 BuS Elektronik GmbH & Co.KG <esw@bus-elektonik.de>
+Copyright (c) 2017 Intel Corp.
+Copyright (C) 2014 Eukréa Electromatique
+Copyright 2016 Google Inc
+(C) Copyright 2011, Stefano Babic <sbabic@denx.de>
+Copyright (C) 2015 Timesys Corporation
+Copyright (C) 2015 General Electric Company
+Copyright (C) 2014 Advantech
+Copyright (C) 2017-2019 Renesas Electronics
+(C) Copyright 2009-2014
+Copyright (C) 2012 Lukasz Dalek <luk0104@gmail.com>
+Copyright (C) 2017 Synopsys, Inc. All rights reserved.
+(C) Copyright 2009-2012
+Copyright (C) 2010 Heiko Schocher <hs@denx.de>
+Copyright (C) 2018 Simone CIANNI <simone.cianni@bticino.it>
+Copyright (C) 2018 Raffaele RECALCATI <raffaele.recalcati@bticino.it>
+Copyright (C) 2017 Logic PD, Inc.
+Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+Copyright (C) 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C) 2017 Baylibre, SAS
+Copyright 2016 Freescale Semiconductor
+Copyright 2017, 2019 NXP
+Copyright (C) 2005 Videon Central, Inc.
+Copyright (C) 2016-2017
+(C) Copyright 2007-2010 Michal Simek
+Copyright (C) 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Copyright (C) 2009-2010 Freescale Semiconductor, Inc.
+Copyright (C) Freescale Semiconductor, Inc. 2006, 2010.
+Copyright (C) 2007-2010 Freescale Semiconductor, Inc.
+Copyright 2007-2009,2010-2012 Freescale Semiconductor, Inc.
+(C) Copyright 2002,2003 Motorola,Inc.
+Copyright 2007, 2010-2011 Freescale Semiconductor, Inc.
+Copyright 2004, 2007, 2010-2011 Freescale Semiconductor.
+Copyright 2004-2007, 2010-2011 Freescale Semiconductor.
+Copyright 2007-2008,2010-2011 Freescale Semiconductor, Inc.
+Copyright 2006, 2010-2011 Freescale Semiconductor.
+Copyright (C) 2013 Otavio Salvador <otavio@ossystems.com.br>
+(C) Copyright 2008 Magnus Lilja <lilja.magnus@gmail.com>
+(C) Copyright 2010, Stefano Babic <sbabic@denx.de>
+Copyright (C) 2010-2011 Freescale Semiconductor.
+Copyright (C) 2010-2018 Freescale Semiconductor, Inc.
+Copyright (C) 2014 Evgeni Dobrev <evgeni@studio-punkt.com>
+Copyright (C) DENX GmbH
+Copyright (C) 2006-2011 Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2011 Logic Product Development <www.logicpd.com>
+(C) Copyright 2008-2010
+Copyright (C) 2014 Bachmann electronic GmbH
+Copyright (c) 2013-2016, NVIDIA CORPORATION.
+Copyright (c) 2010-2012 NVIDIA CORPORATION.  All rights reserved.
+Copyright (C) 2018 Collabora Ltd.
+Copyright (C) 2015-2016 Stefan Roese <sr@denx.de>
+Copyright (C) 2013 Lemonage Software GmbH
+Copyright (C) 2018 EETS GmbH - http://www.eets.ch/
+Copyright (C) 2011 Texas Instruments Inc.
+Copyright (C) 2013 Gumstix, Inc. - http://www.gumstix.com/
+Copyright (C) 2015 Technexion Ltd.
+Copyright 2011-2014 Freescale Semiconductor, Inc.
+Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
+(C) Copyright 2012-2016 Stephen Warren
+(C) Copyright 2015-2016 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Microchip Corporation
+Copyright (C) 2017 Microchip Technology Inc.
+Copyright (C) 2012 - 2013 Atmel
+Copyright (C) 2014 Atmel Corporation
+Copyright (c) 2006, 2007 Wind River Systems, Inc.
+Copyright 2007,2009 Wind River Systems <www.windriver.com>
+Copyright 2007 Wind River Systems <www.windriver.com>
+(C) Copyright 2016 Allied Telesis <www.alliedtelesis.co.nz>
+Copyright (C) 2013 Seco S.r.l
+Copyright (C) 2015-2019 Altera Corporation <www.altera.com>
+Copyright (C) 2016 Pavel Machek <pavel@denx.de>
+(C) Copyright 2017  Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2015 Renesas Electronics Europe GmbH
+(C) Copyright 2013 Maxime Ripard <maxime.ripard@free-electrons.com>
+(C) Copyright 2014 Chen-Yu Tsai <wens@csie.org>
+(C) Copyright 2012-2012 Henrik Nordstrom <henrik@henriknordstrom.net>
+(C) Copyright 2012 Xilinx
+(C) Copyright 2017 Opal Kelly Inc.
+Copyright 2011-2013 Freescale Semiconductor, Inc.
+Copyright (C) 2009 TechNexion Ltd.
+Copyright (C) 2013 Stefan Roese <sr@denx.de>
+Copyright (C) 2011-2014 Pierrick Hascoet, Abilis Systems
+Copyright 2013-2016, NVIDIA CORPORATION.
+Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2014 Topic Embedded Products
+Copyright (C) 2013, 2014, 2017 Markus Niebel <Markus.Niebel@tq-group.com>
+Copyright (C) 2013 - 2017 Markus Niebel <Markus.Niebel@tq-group.com>
+Copyright (C) 2015, Savoir-faire Linux Inc.
+Copyright 2013-2019 Arcturus Networks, Inc.
+original copyright follows:
+Copyright Jasbir Matharu
+Copyright 2015 UDOO Team
+(C) Copyright 2013 Linaro
+(C) Copyright 2011 Linaro
+(C) Copyright 2011 ARM Limited
+Copyright (C) 2017 Amarula Solutions
+Copyright (C) 2014 Kynetics LLC.
+Copyright (C) 2014 Revolution Robotics, Inc.
+Copyright (C) 2016 NXP Semiconductors
+Copyright (C) 2012, 2015 Stefan Roese <sr@denx.de>
+(C) Copyright 2018-2019 Xilinx, Inc.
+Copyright 2004-2008 Freescale Semiconductor, Inc.
+Copyright 2010 Extreme Engineering Solutions, Inc.
+Copyright (C) 2007-2013 Tensilica, Inc.
+(C) Copyright 2013 - 2017 Xilinx.
+Copyright 2015 3ADEV <http://www.3adev.com>
+Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> et al.
+Copyright © International Business Machines Corp., 2006
+Copyright (C) 2009-2012
+Copyright (C) 2014-2015, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2011-2014 Freescale Semiconductor, Inc.
+(C) Copyright 2004-2008, 2012 Freescale Semiconductor, Inc.
+Copyright (C) 2019 Intel Corporation <www.intel.com>
+Copyright (C) 2012 TQ-Systems GmbH
+Copyright (C) 2018 Jerome Brunet  <jbrunet@baylibre.com>
+Copyright (C) 2017 Xingyu Chen <xingyu.chen@amlogic.com>
+(C) Copyright (C) 2018 Neil Armstrong <narmstrong@baylibre.com>
+Copyright (C) 2017 Jerome Brunet  <jbrunet@baylibre.com>
+(C) Copyright (C) 2019 Jerome Brunet <jbrunet@baylibre.com>
+Copyright 2008,2011 Freescale Semiconductor, Inc.
+Copyright 2008,2010-2011 Freescale Semiconductor, Inc.
+Copyright 2006, 2007, 2010-2011 Freescale Semiconductor.
+Copyright (C) 2012-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright (C) 2007 Nobuhiro Iwamatsu
+Copyright (C) ARM Ltd 2015
+Copyright (C) 2016 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+Copyright (C) 2016-2017 Micron Technology, Inc.
+Copyright (c) 2016-2017 Micron Technology, Inc.
+Copyright (c) 2018 Macronix
+Copyright (c) 2017 exceet electronics GmbH
+Copyright 2004, 2007, 2009-2011 Freescale Semiconductor, Inc.
+Copyright 2008, 2011 Freescale Semiconductor, Inc.
+Copyright (C) 2009 coresystems GmbH
+Copyright (C) 2014  Evgeni Dobrev <evgeni@studio-punkt.com>
+Copyright (C) 2015 Linaro.
+Copyright 2011,2012 Freescale Semiconductor, Inc.
+Copyright (C) 1999 Linus Torvalds
+Copyright (C) 2000-2002 Transmeta Corporation
+Copyright (C) 2003 Kai-Uwe Bloem,
+Auerswald GmbH & Co KG, <linux-development@auerswald.de>
+Copyright 2004-2009 Analog Devices Inc.
+Copyright (C) 2016 - 2018 Xilinx, Inc.
+Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
+(C) Copyright 2007 - 2013 Tensilica Inc.
+Copyright (C) 2014 - 2015 Xilinx, Inc.
+(C) Copyright 2006 ATMEL Rousset, Lacressonniere Nicolas
+(C) Copyright 2012 ATMEL, Hong Xu
+Copyright (C) 2014       Panasonic Corporation
+Copyright (C) 2013-2014, Altera Corporation <www.altera.com>
+Copyright (C) 2009-2010, Intel Corporation and its suppliers.
+Copyright (C) 2013-2014 Altera Corporation <www.altera.com>
+Copyright (C) 2014-2015  Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright (c) 2006-2008 Freescale Semiconductor
+Copyright (c) 2008 Freescale Semiconductor, Inc.
+Copyright (c) 2012 Freescale Semiconductor, Inc
+(C) Copyright 2014 3ADEV <http://3adev.com>
+(C) Copyright 2015-2018 Vladimir Zapolskiy <vz@mleia.com>
+Copyright 2004-2007 Freescale Semiconductor, Inc.
+Copyright 2008 Sascha Hauer, kernel@pengutronix.de
+Copyright 2009 Ilya Yanok, <yanok@emcraft.com>
+(c) 2009 Magnus Lilja <lilja.magnus@gmail.com>
+Copyright (C) 2008 Embedded Alley Solutions, Inc.
+Copyright (C) 2018 Toradex
+Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com)
+2002-2006 Thomas Gleixner (tglx@linutronix.de)
+Copyright © 2004 Thomas Gleixner (tglx@linutronix.de)
+Copyright © 2011 Ivan Djelic <ivan.djelic@parrot.com>
+Copyright (C) 2000-2004 Steven J. Hill (sjhill@realitydiluted.com)
+Copyright (C) 2006 Thomas Gleixner <tglx@linutronix.de>
+Copyright (C) 2002 Thomas Gleixner (tglx@linutronix.de)
+Copyright (c) 2006-2009 Analog Devices Inc.
+Copyright (C) 2014 Free Electrons
+Copyright (C) 2006 by Weiss-Electronic GmbH.
+Copyright (C) 2008 Nokia Corporation: dropffs() function by
+Artem Bityutskiy <dedekind1@gmail.com> from mtd-utils
+Copyright 2010 Freescale Semiconductor
+(C) Copyright 2010-2011 Texas Instruments, <www.ti.com>
+(C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
+Copyright © 2005 Intel Corporation
+Copyright © 2006 Marvell International Ltd.
+Copyright (C) STMicroelectronics 2019
+Copyright (C) 2013 Boris BREZILLON <b.brezillon.dev@gmail.com>
+Copyright (C) 2015 Roy Spliet <r.spliet@ultimaker.com>
+Copyright (C) 2013 Qiang Yu <yuq825@gmail.com>
+Copyright (C) 2013 Henrik Nordström <Henrik Nordström>
+Copyright (C) 2013 Dmitriy B. <rzk333@gmail.com>
+Copyright (C) 2013 Sergey Lapin <slapin@ossfans.org>
+Copyright (c) 2014-2015, Antmicro Ltd <www.antmicro.com>
+Copyright (c) 2015, AW-SOM Technologies <www.aw-som.com>
+(C) Copyright 2011 NVIDIA Corporation <www.nvidia.com>
+(C) Copyright 2006 Detlev Zundel, dzu@denx.de
+(C) Copyright 2006 DENX Software Engineering
+Copyright 2009-2015 Freescale Semiconductor, Inc. and others
+(C) Copyright 2016 Xilinx, Inc.
+Copyright (c) 2014 Rene Griessl <rgriessl@cit-ec.uni-bielefeld.de>
+Copyright (c) 2017 Microchip Technology Inc. All rights reserved.
+Copyright (c) 2013 Gerhard Sittig <gsi@denx.de>
+Copyright (c) 2015 Realtek Semiconductor Corp. All rights reserved.
+Copyright (C) 2009 NVIDIA, Corporation
+Copyright (C) 2007-2008 SMSC (Steve Glendinning)
+Copyright (C) 2013 Henrik Nordstrom <henrik@henriknordstrom.net>
+Copyright (C) 2013 Google Inc.
+Copyright (C) 2014 Sage Electronics Engineering, LLC.
+Copyright (C) 2016 Bin Meng <bmeng.cn@gmail.com>
+(C) Copyright 2015-2016 Texas Instruments Incorporated, <www.ti.com>
+Copyright (C) 2014, Gumstix, Incorporated - http://www.gumstix.com/
+Copyright (C) 2014, Gumstix, Inc. - http://www.gumstix.com/
+(C) Copyright 2007 Stanislav Galabov <sgalabov@gmail.com>
+Copyright (C) 2017 Stefan Roese <sr@denx.de>
+Copyright (C) 2017 Marvell
+(C) Copyright 2010 - 2011 NVIDIA Corporation <www.nvidia.com>
+(C) Copyright 2010 - 2011
+Copyright (C) 2008 Arthur Shipkowski (art@videon-central.com)
+Copyright (c) 2009 Freescale Semiconductor, Inc.
+(c) Copyright 2010
+Copyright (C) 2004 by Thomas Rathbone
+Copyright (C) 2005 by HP Labs
+Copyright (C) 2005 by David Brownell
+Copyright (C) 2004 by Thomas Rathbone, HP Labs
+Copyright (C) 2005 by Ivan Kokshaysky
+Copyright (C) 2006 by SAN People
+Copyright 2015 Broadcom Corporation.
+Copyright (C) 2006-2008 David Brownell
+Copyright (C) 2003 David Brownell
+Copyright (c) 2000, 2001, 2002 Lineo
+Copyright (c) 2001 Hewlett Packard
+Copyright (C) 2008 for Samsung Electronics
+Copyright (C) 2004 Herbert Poetzl <herbert@13thfloor.at>
+Copyright (C) 2009 for Samsung Electronics
+Copyright (C) 2004 David Brownell
+Copyright (C) 2003-2005,2008 David Brownell
+Copyright (C) 2003-2004 Robert Schwebel, Benedikt Spranger
+(C) 2007 by OpenMoko, Inc.
+(C) Copyright 2006 by Harald Welte <hwelte at hmw-consulting.de>
+Copyright (C) 2011-2012 Samsung Electronics
+(C) Copyright 2008 - 2009
+Copyright 2011 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Copyright 2014 Linaro, Ltd.
+Copyright (C) 2003-2008 Alan Stern
+Copyright (C) 2017 Toradex
+Copyright (C) 2002 Intrinsyc, Inc. (Frank Becker)
+Copyright (C) 2003 Robert Schwebel, Pengutronix
+Copyright (C) 2003 Benedikt Spranger, Pengutronix
+Copyright (C) 2003 Joshua Wise
+Copyright (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix
+Copyright (C) 2007 Eurotech S.p.A.  <info@eurotech.it>
+Copyright (C) 2008 Vivek Kutal      <vivek.kutal@azingo.com>
+Copyright (C) 2004 by David Brownell
+Copyeight (C) 2009 Samsung Electronics
+Copyright (C) 2016 Andes Technology Corporation
+Copyright (C) 1991-2004 SciTech Software, Inc.
+(C) Copyright 2015 Savoir-faire Linux Inc.
+(C) Copyright 2002-2013
+Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au)
+Copyright (c) 2015, Linaro Limited
+Copyright (C) 2014 Felix Fietkau <nbd@nbd.name>
+Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
+(C) Copyright 2001 Linus Torvalds
+Copyright © 2008 Keith Packard
+Copyright (C) 2002, 2003, 2004 Dell Inc.
+Copyright (C) 1998 David S. Miller (davem@redhat.com)
+Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
+Copyright 2001 Sun Microsystems (thockin@sun.com)
+Copyright 2002 Intel (eli.kupermann@intel.com,
+christopher.leech@intel.com,
+scott.feldman@intel.com)
+Copyright (C) Sun Microsystems 2008
+Copyright (c) 2006-2009, 2011 Freescale Semiconductor, Inc.
+Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
+Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
+Copyright (C) 2008 Marvell Semiconductor
+Copyright Torsten Duwe <duwe@informatik.uni-erlangen.de> 1993
+derived from Data Sheet, Copyright Motorola 1984 (!).
+Copyright 2006-2009 Solarflare Communications Inc.
+Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com)
+Copyright (C) 2014 Linaro Ltd.
+Copyright (C) 1992, 1994 by Theodore Ts'o.
+Copyright (C) 2004 Texas Instruments.
+Copyright (C) 2009 David Brownell
+Copyright (C) 2009 Nick Thompson, GE Fanuc Ltd, <nick.thompson@gefanuc.com>
+Copyright (C) 2012 Dmitry Bondar <bond@inmys.ru>
+Copyright (C) 2005-2008 Arthur Shipkowski (art@videon-central.com)
+(C) Copyright 2012 Stephen Warren
+Copyright 2015 Stephen Warren
+Copyright (C) 2018 STMicroelectronics - All Rights Reserved
+Copyright 2009-2013 Freescale Semiconductor, Inc.
+Copyright (c) 2015 Samsung Electronics
+(C) Copyright 2019 - Texas Instruments Incorporated - http://www.ti.com/
+Copyright (c) 2018, STMicroelectronics
+Copyright (C) 2018 ROHM Semiconductors
+(C) Copyright 2014 Texas Instruments Incorporated - http://www.ti.com
+Copyright (c) 2010-2014, NVIDIA CORPORATION.  All rights reserved.
+Copyright (c) 2006-2013 Ingenic Semiconductor
+Copyright (C) 2013, Lemonage Software GmbH
+Copyright (C) 2008 The Android Open Source Project
+Copyright (C) 2016-2017 Rockchip Electronic Co.,Ltd
+Copyright (C) 2014 Josh Datko, Cryptotronix, jbd@cryptotronix.com
+2016 Tomas Hlavacek, CZ.NIC, tmshlvck@gmail.com
+2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+(C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
+Copyright (C) 2017 Texas Instruments
+(C) Copyright 2005-2009
+Copyright 2014 Red Hat, Inc.
+Copyright 2012 Texas Instruments
+Copyright(c) 2009 Dialog Semiconductor Ltd.
+Copyright (C) 2006-2015 Nicolas Pitre
+Copyright (C) 2017 The Android Open Source Project
+Copyright (c) 2015 Texas Instruments Incorporated - http://www.ti.com
+Copyright 2003 Motorola,Inc.
+Copyright (c) 2018 The Chromium OS Authors. All rights reserved.
+(C) Copyright 2009-2016 CompuLab, Ltd.
+Copyright (C) 1999 VA Linux Systems
+Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
+Copyright (C) 1999, 2002-2003 Hewlett-Packard Co.
+Copyright (c) 1995, 1996, 2001, 2002
+Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com
+Copyright 2015 Free Electrons.
+(C) Copyright 2000-2005
+Copyright 2007, 2011 Freescale Semiconductor, Inc.
+Copyright (C) 2004-2007, 2015 Freescale Semiconductor, Inc.
+Copyright 2013 - 2015  Freescale Semiconductor, Inc.
+Copyright 2007-2008,2010-2011 Freescale Semiconductor, Inc
+Copyright 2009-2012, 2013 Freescale Semiconductor, Inc.
+(C) Copyright 2015 Freescale Semiconductor, Inc.
+Copyright (C) 2000, 2004, 2005  MIPS Technologies, Inc.
+Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
+Copyright (c) 2012  Samsung Electronics
+Copyright (C) 2009 - 2013 Heiko Schocher <hs@denx.de>
+(C) 2000 by Paolo Scaffardi (arsenio@tin.it)
+(C) Copyright 2002 ELTEC Elektronik AG
+Copyright (C) 1997-2001, 2004, 2007 Free Software Foundation, Inc.
+(C) Copyright 2005-2010 Freescale Semiconductor, Inc.
+Lattice Semiconductor Corp. Copyright 2009
+Copyright 2003-2004 Red Hat, Inc.  All rights reserved.
+Copyright 2003-2004 Jeff Garzik
+Copyright (C) 1996 Larry Ewing (lewing@isc.tamu.edu)
+Copyright (C) 1996,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
+Copyright (C) 2001 Peter Bergner, IBM Corp.
+Copyright (C) 2004 by FS Forth-Systeme GmbH.
+(C) Copyright 2012 Freescale Semiconductor, Inc.
+Copyright (C) 2009 Marc Kleine-Budde <mkl@pengutronix.de>
+Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Additions (C) Copyright 2009 Industrie Dial Face S.p.A.
+Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Copyright (C) 2004-2007, 2010 Freescale Semiconductor, Inc.
+Copyright(c) 2003 Motorola Inc.
+(C) 2009 by Detlev Zundel, DENX Software Engineering GmbH
+modifications (c) Rob Taylor, Flying Pig Systems. 2000.
+by Richard Danter (richard.danter@windriver.com), (C) 2005 Wind River Systems
+Copyright (C) 2005-2007 Samsung Electronics
+Copyright (C) 2008 RuggedCom, Inc.
+Copyright 2009 CJSC "NII STT", http://www.niistt.ru/
+Copyright (c) 2018 Toradex, Inc.
+Copyright (c) 2011 samsung electronics
+Copyright 2000-2002 by Hans Reiser, licensing governed by reiserfs/README
+Copyright (C) 2000, 2001  Free Software Foundation, Inc.
+(C) Copyright 2003 Sysgo Real-Time Solutions, AG <www.elinos.com>
+Copyright (c) 2013, Henrik Nordstrom <henrik@henriknordstrom.net>
+Copyright (c) 2013, Compulab Inc.
+Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+Copyright 2009, Matthias Fuchs <matthias.fuchs@esd.eu>
+Copyright (C) 2010 The Android Open Source Project
+Copyright 2013 Texas Instruments, Inc.
+Copyright (c) 2014 Texas Instruments Incorporated - http://www.ti.com
+Copyright 2004, 2007, 2009, 2011, 2013 Freescale Semiconductor, Inc.
+Copyright (C) 2006-2008 Nokia Corporation
+Copyright (C) 2011 Samsung Electrnoics
+Copyright (c) 2004, 2008 IBM Corporation
+Copyright (c) 2009 Pattrick Hueper <phueper@hueper.net>
+(C) Copyright 1997-2002 ELTEC Elektronik AG
+Generated by EasyLogo, (C) 2000 by Paolo Scaffardi
+Copyright 2013, 2015 Freescale Semiconductor, Inc.
+(C) Copyright 2015 Xilinx, Inc,
+Copyright (C) 2013 Simon Guinot <simon.guinot@sequanux.org>
+Copyright (c) 2015 Stephen Warren
+Copyright (c) 2016, Alexander Graf <agraf@suse.de>
+Copyright (c) 2017, Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2018, Xilinx Inc.
+Copyright (c) 2017 Alison Chaiken
+Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2016, Google Inc.
+Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2016, Xilinx Inc. Michal Simek
+Copyright (c) 2017, Xiphos Systems Corp. All rights reserved.
+Copyright (C) 2018, EETS GmbH, http://www.eets.ch/
+Copyright (C) 1996 David S. Miller
+Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Ralf Baechle
+Copyright (C) 1994 - 1999, 2000, 01, 06 Ralf Baechle
+Copyright (C) 1995, 1996 Paul M. Antoine
+Copyright (C) 1998 Ulf Carlsson
+Copyright (C) 2002, 2003, 2004, 2005, 2007  Maciej W. Rozycki
+Copyright (C) 2000, 2001, 2012 MIPS Technologies, Inc.  All rights reserved.
+Copyright (C) 2014, Imagination Technologies Ltd.
+Copyright (C) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org>
+(C) Copyright 2009, 2011, 2016 Freescale Semiconductor, Inc.
+Copyright (C) 2015 Alexey Brodkin <abrodkin@synopsys.com>
+Copyright (c) 2007-2008, Juniper Networks, Inc.
+Copyright (c) 2008, Excito Elektronik i Skåne AB
+Copyright (c) 2008, Michael Trimarchi <trimarchimichael@yahoo.it>
+Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
+(C) Copyright 2011 Ilya Yanok, Emcraft Systems
+Copyright (c) 2009-2015 NVIDIA Corporation
+Copyright (c) 2013 Lucas Stach
+Copyright (c) 2015 Sanchayan Maity <sanchayan.maity@toradex.com>
+Copyright (C) 2015 Toradex AG
+(C) Copyright 2014, Xilinx, Inc
+Copyright (C) 2012 Sughosh Ganu <urwithsughosh@gmail.com>
+(C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
+(C) Copyright 2000-2002 David Brownell
+(C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net>
+Copyright (C) 2008  Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+Copyright (c) 2003/06, Courage Co., Ltd.
+Copyright 2015,2016 Freescale Semiconductor, Inc.
+Copyright (C) 2008 Intel Corp.
+Copyright (C) 2013 Samsung Electronics Co.Ltd
+Copyright (c) 2015, Google, Inc
+Copyright (c) 2014, Renesas Electronics Corporation
+Copyright (c) 2016 Rockchip, Inc.
+Copyright (C) 2003  Manuel Novoa III  <mjn3@codepoet.org>
+Copyright (C) 2013-2014, 2018 Synopsys, Inc. All rights reserved.
+Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
+Copyright (C) 1989-2013 Free Software Foundation, Inc.
+Copyright (C) 2016 Synopsys, Inc. All rights reserved.
+Copyright (C) 2018 Xilinx, Inc. (Michal Simek)
+Copyright (C) 2015, Texas Instruments, Incorporated
+Copyright (C) 2018-2019 Intel Corporation <www.intel.com>
+Copyright (c) 2014 Imagination Technologies
+(C) Copyright 2010 Stefano Babic <sbabic@denx.de>
+Copyright 2017, Theobroma Systems Design und Consulting GmbH
+Copyright (C) 2013 SolidRun ltd.
+Copyright (C) 2013 Jon Nettleton <jon.nettleton@gmail.com>.
+Copyright (C) 2014, 2015 Renesas Electronics Corporation
+(C) Copyright 2002-2004 by David Brownell
+Copyright (C) 1989-2015 Free Software Foundation, Inc.
+(C) Copyright 2007 Freescale Semiconductor Inc
+Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+Copyright 2006,2009-2010 Freescale Semiconductor, Inc.
+Copyright 2004,2009-2011 Freescale Semiconductor, Inc.
+(C) Copyright 2004, 2007 Freescale Semiconductor. (MPC86xx Port)
+Copyright (C) 2015, Bachmann electronic GmbH
+Copyright (C) 2012 rockchips
+Copyright (C) 2012-2015 Samsung Electronics
+Copyright (C) 2016 Rockchip Electronics Co., Ltd
+Copyright (C) 2014 - STMicroelectronics Inc.
+Copyright (C) 2018 Samsung Electronics
+(C) Copyright 2015-2016
+(C) Copyright 2014-2015 Samsung Electronics
+(C) Copyright 2013 O.S. Systems Software LTDA.
+Copyright (C) 2011 Andreas Bießmann
+Copyright (C) 2003 Ralf Baechle
+Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
+Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
+Copyright (c) 2013 Corscience GmbH & Co.KG
+Copyright (C) 2019, Rick Chen <rick@andestech.com>
+Copyright (C) 2019 Western Digital Corporation or its affiliates.
+Copyright (c) 2016-17 Microsemi Corporation.
+Copyright (C) 2018, Anup Patel <anup@brainfault.org>
+Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org>
+Copyright (C) 1999 Hewlett-Packard Co.
+Copyright (C) 2016 The Android Open Source Project
+Copyright 1994, 1995, 2000 Neil Russell.
+Copyright 2011 Comelit Group SpA
+Copyright 2010-2011, 2013 Freescale Semiconductor, Inc.
+Copyright (C) 2012 Jonas Gorski <jonas.gorski@gmail.com>
+Copyright 2014 Steffen Trumtrar <s.trumtrar@pengutronix.de>
+Copyright 2013 Maxime Ripard
+Copyright 2017 Toradex AG
+Copyright 2014 Toradex, Inc.
+Copyright (C) 2017 Google, Inc.
+(C) Copyright 2011 DENX Software Engineering GmbH
+(C) Copyright 2002 SIXNET, dge@sixnetio.com.
+(C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
+(C) Copyright 2001, 2002, 2003
+(C) Copyright 2001-2008
+(C) Copyright 2009-2012 ADVANSEE
+Copyright 2010 Orex Computed Radiography
+Alexander Bigga <ab@mycable.de>, 2006 (c) mycable GmbH
+Copyright (C) 2008 Kim B. Heino
+Copyright (C) 2016 by NXP Semiconductors Inc.
+Copyright (C) 2004 Gary Jennejohn garyj@denx.de
+Copyright (C) 2005-06 Tower Technologies
+Copyright (c) 2017, General Electric Company
+Copyright 2004 Karen Spearel
+Copyright 2005 Alessandro Zummo
+Copyright (c) 2008 Texas Instruments
+Copyright 2008 Mentor Graphics Corporation
+Copyright (C) 2008 by Texas Instruments
+(C) Copyright 2008 Texas Instruments Incorporated.
+Copyright (c) 2009 Texas Instruments
+Copyright (c) 2010 Texas Instruments, Inc.
+Copyright (C) 2010, 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
+Copyright (C) 2009, 2010 Matthias Kaehlcke <matthias@kaehlcke.net>
+Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+Copyright (C) 2002-2003 Romain Lievin <roms@tilp.info>
+Copyright (c) 2009-2010 Wind River Systems, Inc.
+Copyright 2011 Linaro
+Copyright (C) 2008 Nir Tzachar <nir.tzachar@gmail.com?
+Copyright (C) 2015 Boris Barbulovski <bbarbulovski@gmail.com>
+Copyright (C) 2002-2005 Roman Zippel <zippel@linux-m68k.org>
+Copyright (C) 2002-2005 Sam Ravnborg <sam@ravnborg.org>
+(C) Copyright 2017 Jorge Ramirez Ortiz <jorge.ramirez-ortiz@linaro.org>
+(C) Copyright 2019 Ramon Fried <ramon.fried@gmail.com>
+(C) Copyright 2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
+(C) Copyright 2014 - 2019 Xilinx, Inc.
+(C) Copyright 2014-2018
+Copyright (c) 2014, Marcel Ziswiler
+(C) Copyright 2018 Michal Simek
+Copyright (C) 2014-2017 Altera Corporation <www.altera.com>
+Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
+Copyright (C) 2013-2017 Altera Corporation <www.altera.com>
+Copyright (C) 2016-2017 Intel Corporation
+Copyright (C) 2015-2017 Intel Corporation <www.intel.com>
+(C) Copyright 2014 Andreas Bießmann <andreas@biessmann.org>
+Copyright (C) 1993, 1996, 2001, 2002 Free Software Foundation, Inc.
+Copyright 2014 Google, Inc
+COPYRIGHT (c) 2000 BY ABATRON AG
+(C) Copyright 2013 Thomas Petazzoni
+(c) 2012 Daniel Stodden <daniel.stodden@gmail.com>
+Copyright (c) 2005-2006 Gianluigi Tiesi <sherpya@netfarm.it>
+(C) Copyright 2011 Free Electrons
+Copyright 2012-2014 Freescale Semiconductor, Inc.
+Copyright (C) 2017 Andes Technology
+(C) Copyright 2015 Google,  Inc
+Copyright (C) 2014 Charles Manning <cdhmanning@gmail.com>
+Copyright (c) 2019, Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
+Copyright © 2016 NextThing Co.
+Copyright © 2016 Free Electrons
+(C) Copyright 2016  DENX Software Engineering GmbH
+Copyright (C) 2015 Nathan Rossi <nathan@nathanrossi.com>
+Copyright (C) 2016 Michal Simek <michals@xilinx.com>
+Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
+Copyright (C) 2018 Marek Vasut <marek.vasut+renesas@gmail.com>
+Copyright 2016 Texas Instruments, Inc.
+Copyright (C) Nokia Corporation, 2007
+Copyright (C) Samsung Electronics, 2009
+Copyright(c) 2005-2008 Samsung Electronics
+Copyright (C) 2005-2009 Samsung Electronics
+(C) 2007-2008 Mike Frysinger <vapier@gentoo.org>
+Copyright (C) 2007 Advanced Micro Devices, Inc.
+Copyright (C) 2009-2010 coresystems GmbH
+Copyright (C) 2001 Ronald G. Minnich
+Copyright (C) 2005 Nick.Barker9@btinternet.com
+Copyright (C) 2001  Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
+(C) Copyright -2003
+Copyright (C) 2005 Intel Co.
+Copyright (C) 1991,1992,1993,1997,1998,2003, 2005 Free Software Foundation, Inc.
+JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
+(C) Copyright 2005-2009 Freescale Semiconductor, Inc.
+(C) Copyright 2004-2009 Freescale Semiconductor, Inc.
+(C) Copyright 2004-2010 Freescale Semiconductor, Inc.
+Copyright (C) 2012 - 2013 Atmel Corporation
+Copyright (C) 2016 George McCollister <george.mccollister@gmail.com>
+Copyright 2013-2019 Arcturus Networks Inc.
+Copyright 2013-2015 Arcturus Networks, Inc.
+Copyright 2013-2015 Arcturus Networks, Inc
+Copyright 2007-2013 Freescale Semiconductor, Inc.
+Copyright 2008-2013 Freescale Semiconductor, Inc.
+Copyright 2015 Timesys Corporation
+Copyright (C) 2013  Renesas Solutions Corp.
+(C) Copyright 2013 SAMSUNG Electronics
+Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+Copyright 2007, Embedded Specialties, Inc.
+Copyright 2007 Wind River Systems, Inc.
+Copyright 2007 Wind River Systemes, Inc. <www.windriver.com>
+(C) Copyright 2012-
+(C) Copyright 2002,2003, Motorola Inc.
+Copyright (C) 2018 Technexion Ltd.
+Copyright (C) 2014, 2015 O.S. Systems Software LTDA.
+(C) Copyright 2000 - 2013
+of logo, copyright and system information on the LCD
+(C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2007.
+(C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
+Copyright 2011 The Chromium Authors, All Rights Reserved.
+Copyright 2008 Jon Loeliger, Freescale Semiconductor, Inc.
+Copyright (C) 2016 Peng Fan <van.freenix@gmail.com>
+Copyright 2008-2013 Analog Devices Inc.
+Copyright (C) 2015  Thomas Chou <thomas@wytron.com.tw>
+Copyright (C) 2011  Missing Link Electronics
+Copyright (C) 2008-2011 Florian Fainelli <florian@openwrt.org>
+(C) Copyright 2011 Guralp Systems Ltd.
+Copyright (C) 2008,2009 STMicroelectronics
+Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
+Copyright (C) 2010 Joakim Axelsson <joakim.axelsson AT stericsson.com>
+(C) Copyright 2015 Marek Vasut <marex@denx.de>
+Copyright (C) 2009-2011 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2007 David Brownell
+Copyright (c) 2015 Microchip Technology Inc
+(C) Copyright 2010-2012,2015
+Copyright (c) 2013 - 2018 Xilinx, Michal Simek
+Copyright (C) 2015 DAVE Embedded Systems <devel@dave.eu>
+Copyright (C) 2009 - 2014 Xilinx, Inc.
+(C) Copyright 2016 Vasily Khoruzhick <anarsoul@gmail.com>
+Copyright (c) Nokia Corporation, 2007
+Copyright (c) 2012 Linutronix GmbH
+Copyright (c) 2014 sigma star gmbh
+Copyright (c) Nokia Corporation, 2006, 2007
+Copyright (c) Nokia Corporation, 2006
+Copyright 2000-2004 Wolfgang Denk, wd@denx.de
+Copyright (c) 2001 Charles Mott <cm@linktel.net>
+Copyright (c) 2008 coresystems GmbH
+Copyright (c) 2008 Pieter Voorthuijsen <pieter.voorthuijsen@prodrive.nl>
+Copyright (c) 2009 Robin Getz <rgetz@blackfin.uclinux.org>
+(C) Masami Komiya <mkomiya@sonare.it> 2005
+Copyright 2009, Robin Getz <rgetz@blackfin.uclinux.org>
+Copyright (C) 2003 by Arthur van Hoff (avh@strangeberry.com)
+Copyright (C) 2010 by Joe Hershberger
+(C) Masami Komiya <mkomiya@sonare.it> 2004
+Copyright 2000, 2001 DENX Software Engineering, Wolfgang Denk, wd@denx.de
+Copyright 2011 Comelit Group SpA,
+Luca Ceresoli <luca.ceresoli@comelit.it>
+Copyright 2018 Lothar Felten, lothar.felten@gmail.com
+Copyright (c) 2016 NextThing Co
+Copyright (c) 2016 Free Electrons
+(C) Copyright 2009 Wolfgang Denk <wd@denx.de>
+Copyright 2014 Broadcom Corporation
+(C) Copyright 2004 DENX Software Engineering, Wolfgang Denk, wd@denx.de
+Copyright (C) 2015, Kodak Alaris, Inc
+(C) Copyright 2017      Icenowy Zheng <icenowy@aosc.io>
+(C) Copyright 2015      Hans de Goede <hdegoede@redhat.com>
+(C) Copyright 2007-2015
+(C) Copyright 2006-2013
+Copyright (C) 2016 Siarhei Siamashka <siarhei.siamashka@gmail.com>
+Copyright (C) 2018 Amarula Solutions B.V.
+Copyright (C) 1999,2000,2001,2002,2003,2004
+Copyright 2004	Sun Microsystems, Inc.
+Copyright (C) 2012-2013 Texas Instruments, Inc.
+Copyright (C) 2018 DENX Software Engineering
+Original Copyright follow:
+Copyright (C) 2011 Google, Inc.
+Copyright (C) 2009 Daniel Mack <daniel@caiaq.de>
+Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch>
+Copyright (C) 2013-2018 Hannes Schmelzer <oe5hpm@oevsv.at>
+Copyright (C) 2013-2018 Hannes Schmelzer <oe5hpm@oevsv.at> -
+(C) 2015 Hans de Goede <hdegoede@redhat.com>
+Copyright (C) 2008-2009 MontaVista Software Inc.
+Copyright (C) 2008-2009 Texas Instruments Inc
+Copyright 2017 Jernej Skrabec <jernej.skrabec@siol.net>
+Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+(C) Copyright 2016-2018 ARM Ltd.
+Copyright (C) 2011-2013 Marek Vasut <marex@denx.de>
+Copyright (c) 2013 Adapted from Linux driver:
+Copyright (c) 2012 Anders Electronics plc. All Rights Reserved.
+Copyright (c) 2012 CompuLab, Ltd
+(C) 2015 Siarhei Siamashka <siarhei.siamashka@gmail.com>
+(C) Copyright 2018 Liviu Dudau <liviu@dudau.co.uk>
+Based on the Linux driver, (C) 2012 Texas Instruments
+(C) Copyright 2018 - Beniamino Galvani <b.galvani@gmail.com>
+(C) Copyright 2018 - BayLibre, SAS
+Copyright 2008-2015 Freescale Semiconductor, Inc.
+Copyright 2015 Toradex, Inc.
+Copyright (C) 2010-2015 Freescale Semiconductor, Inc.
+Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
+Copyright (C) 2004-2011 Freescale Semiconductor, Inc.
+Copyright 2013 Stefan Roese <sr@denx.de>
+Copyright (C) 2011-2012 Freescale Semiconductor, Inc.
+Copyright (C) 2006-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2006-2010 Freescale Semiconductor, Inc.
+Copyright (C) 2005,2010-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2005, 2011 Freescale Semiconductor, Inc.
+(C) Copyright 2018 Simon Goldschmidt
+Copyright (C) 2005-2011 Canonical Ltd
+Copyright © 2005 Samsung Electronics
+Copyright © 2000-2005
+Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> et al.
+Copyright © 2002      Robert Kaiser <rkaiser@sysgo.de>
+Copyright © 1999 Machine Vision Holdings, Inc.
+Copyright © 2002-2003 Greg Ungerer <gerg@snapgear.com>
+Copyright © 2002-2003 SnapGear Inc
+Copyright © 2000      Red Hat UK Limited
+Copyright 2017 - Free Electrons
+Copyright (C) 2000-2010 Steven J. Hill <sjhill@realitydiluted.com>
+Copyright (c) 2006 Thomas Gleixner <tglx@linutronix.de>
+(C) Copyright 2013 Andreas Bießmann <andreas@biessmann.org>
+(C) 2000 Nicolas Pitre <nico@fluxnic.net>
+Copyright (c) 2015-2018 National Instruments
+Copyright (c) 2015-2018 Joe Hershberger <joe.hershberger@ni.com>
+(C) Copyright 2016 Linaro Limited
+Copyright (C) 2012-2019 Altera Corporation <www.altera.com>
+Copyright 2004-2006,2010 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2006-2008 Nokia Corporation.
+Copyright (C) 2006, 2007 University of Szeged, Hungary
+Copyright (C) 2013-2015 Freescale Semiconductor, Inc.
+
+License: GNU GENERAL PUBLIC LICENSE
+GNU GENERAL PUBLIC LICENSE
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+Preamble
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+How to Apply These Terms to Your New Programs
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+one line to give the program's name and an idea of what it does.
+Copyright (C) yyyy  name of author
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+Gnomovision version 69, Copyright (C) year name of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+type `show w'.  This is free software, and you are welcome
+to redistribute it under certain conditions; type `show c'
+for details.
+The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright
+interest in the program `Gnomovision'
+(which makes passes at compilers) written
+by James Hacker.
+
+signature of Ty Coon, 1 April 1989
+Ty Coon, President of Vice
+This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
+----------------------------------------------------------------------
+Software:spiffs 0.3.7
+
+Copyright notice:
+Copyright (c) 2013-2017 Peter Andersson (pelleplutt1976<at>gmail.com)
+Copyright (c) 2013-2017 Peter Andersson (pelleplutt1976 at gmail.com)
+
+License: The MIT License
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+----------------------------------------------------------------------
+Software:7 Zip-LZMA SDK 19.00
+
+Copyright notice:
+Copyright (C) 2019 Igor Pavlov.
+
+License:Public Domain
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any means.
+----------------------------------------------------------------------
+Software:lwip 2.1.2
+
+Copyright notice:
+Copyright (c) 2016 Elias Oenal.
+Copyright (c) 2016 Elias Oenal and Dirk Ziegelmeier.
+Copyright (c) 2006 Axon Digital Design B.V., The Netherlands.
+Copyright (c) 2001-2004 Swedish Institute of Computer Science.
+Copyright (c) 2007 Dominik Spies <kontakt@dspies.de>
+Copyright (c) 2001-2004 Leon Woestenberg <leon.woestenberg@gmx.net>
+Copyright (c) 2001-2004 Axon Digital Design B.V., The Netherlands.
+Copyright (c) 2017 Simon Goldschmidt <goldsimon@gmx.de>
+uIP version Copyright (c) 2002-2003, Adam Dunkels.
+Copyright (c) 2017 Dirk Ziegelmeier.
+Copyright (c) 2015 Verisure Innovation AB
+Copyright (c) 2018 Simon Goldschmidt
+Copyright (c) 2001-2003 Swedish Institute of Computer Science.
+Copyright (c) 2018 Simon Goldschmidt <goldsimon@gmx.de>
+Copyright (c) 1994-2002 Paul Mackerras. All rights reserved.
+Copyright (c) 2003 Paul Mackerras. All rights reserved.
+Copyright (c) 1995 Eric Rosenquist.  All rights reserved.
+Copyright (c) 2001 by Sun Microsystems, Inc.
+Copyright (c) 2002 Google, Inc.
+Copyright (c) 1999 Tommi Komulainen.  All rights reserved.
+Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
+Copyright (c) 1995, 1996, 1997 Francis.Dupont@inria.fr, INRIA Rocquencourt,
+Alain.Durand@imag.fr, IMAG,
+Jean-Luc.Richier@imag.fr, IMAG-LSR.
+Copyright (c) 1998, 1999 Francis.Dupont@inria.fr, GIE DYADE,
+Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
+Copyright (c) 1998 Global Election Systems Inc.
+Copyright (c) 2008 Paul Mackerras. All rights reserved.
+portions Copyright (c) 1997 Global Election Systems Inc.
+portions Copyright (c) 1998 Global Election Systems Inc.
+portions Copyright (c) 2001 by Cognizant Pty Ltd.
+Copyright (c) 2006 by Marc Boucher, Services Informatiques (MBSI) inc.
+Copyright (c) 2002 The NetBSD Foundation, Inc.
+Copyright (c) 1989 Regents of the University of California.
+Copyright (c) Deltatee Enterprises Ltd. 2013
+Copyright (c) 1993-2002 Paul Mackerras. All rights reserved.
+Copyright (c) 2002 Google, Inc.  All rights reserved.
+Copyright (c) 1996-2002 Paul Mackerras. All rights reserved.
+Copyright (c) 1998 by Global Election Systems Inc.
+Copyright (c) 2002,2003,2004 Google, Inc.
+Copyright (c) 2000-2002 Paul Mackerras. All rights reserved.
+portions Copyright (c) 1997 by Global Election Systems Inc.
+Copyright (c) 1994 The Australian National University.
+Copyright (c) 1989 Carnegie Mellon University.
+Copyright (c) 1999-2002 Paul Mackerras. All rights reserved.
+Copyright (c) 2017 Simon Goldschmidt.
+Copyright (c) 2003-2004 Leon Woestenberg <leon.woestenberg@axon.tv>
+Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands.
+Copyright (c) 2015 Inico Technologies Ltd.
+Copyright (c) 2017 Benjamin Aigner
+Copyright (c) 2015 Inico Technologies Ltd. , Author: Ivan Delamer <delamer@inicotech.com>
+Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt
+Copyright (c) 2017 Simon Goldschmidt
+Copyright (c) 2013-2017, tinydir authors:
+- Cong Xu
+- Lautis Sun
+- Baudouin Feildel
+- Andargor <andargor@yahoo.com>
+All rights reserved.
+Copyright (c) 2014 Simon Goldschmidt
+Copyright (c) 2016 Erik Andersson <erian747@gmail.com>
+Copyright (c) 2017 Joel Cunningham, Garmin International, Inc. <joel.cunningham@garmin.com>
+Copyright (c) 2016 Erik Andersson
+Copyright (c) 2001, 2002 Leon Woestenberg <leon.woestenberg@axon.tv>
+Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands.
+Copyright (c) 2015 Dirk Ziegelmeier
+ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels.
+Copyright (c) 2010 Inico Technologies Ltd.
+Copyright (c) 2002 CITEL Technologies Ltd.
+Copyright (c) 2017 The MINIX 3 Project.
+Copyright (c) 2018 Swedish Institute of Computer Science.
+Copyright (c) 2018 Simon Goldschmidt.
+Based on XySSL: Copyright (C) 2006-2008  Christophe Devine
+Copyright (C) 2009  Paul Bakker <polarsslmaintainer at polarssl dot org>
+Copyright (c) 2001, Swedish Institute of Computer Science.
+Copyright (c) 2001, 2002 Swedish Institute of Computer Science.
+
+License:BSD 3-Clause License
+Copyright (c) <YEAR>, <OWNER>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------------------------
+Software:libcoap 4.2.1
+
+Copyright notice:
+Copyright (C) 2010-2011,2015-2016 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2011 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2012,2014-2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2011,2014 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2016 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2017 Jean-Claude Michelou <jcm@spinetix.com>
+Copyright (C) 2012-2013 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2017 Jean-Claue Michelou <jcm@spinetix.com>
+Copyright (C) 2010-2019 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2012 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2015 Carsten Schoenert <c.schoenert@t-online.de>
+Copyright (C) 2010-2011,2014-2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2013 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2014 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010,2011,2014,2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2011,2016 Olaf Bergmann <bergmann@tzi.org>
+Copyright (c) 2003-2017, Troy D. Hanson     http:troydhanson.github.com/uthash/
+Copyright (c) 2007-2017, Troy D. Hanson   http:troydhanson.github.com/uthash/
+Copyright (C) 2011,2015,2018-2019 Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (C) 2011 Olaf Bergmann <bergmann@tzi.org>
+Copyright (c) 2010--2019, Olaf Bergmann and others
+Copyright (C) 2010—2019 by Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (c) 2001-2003 Swedish Institute of Computer Science.
+Copyright (C) 2019 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2013,2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2013 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2012,2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2012 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2013,2015-2018 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2018 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2013--2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010--2019 Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (C) 2010--2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010,2011,2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2012--2013 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010,2011 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2015-2016,2019 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010--2012,2015-2019 Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (C) 2010--2012,2014--2019 Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (C) 2017 Dag Bjorklund <dag.bjorklund@comsel.fi>
+Copyright (C) 2012,2014,2016-2019 Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (C) 2012,2014 Olaf Bergmann <bergmann@tzi.org>
+2014 chrysn <chrysn@fsfe.org>
+Copyright (C) 2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2014--2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010--2019 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010--2016 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010--2012,2015-2016 Olaf Bergmann <bergmann@tzi.org>
+
+License: BSD 3-Clause License
+Copyright (c) <YEAR>, <OWNER>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+----------------------------------------------------------------------
+Software:paho.mqtt.c 1.3.1
+
+Copyright notice:
+Copyright (c) 2015 logi.cals GmbH
+Copyright (c) 2013, 2018 IBM Corp.
+Copyright (c) 2013, 2014 IBM Corp.
+Copyright (c) 2009, 2018 IBM Corp.
+Copyright (c) 2012, 2018 IBM Corp.
+Copyright (c) 2009, 2014 IBM Corp.
+Copyright (c) 2009, 2019 IBM Corp.
+Copyright (c) 2012, 2019 IBM Corp.
+Copyright (c) 2011, 2014 IBM Corp.
+Copyright (c) 2012, 2017 IBM Corp.
+Copyright (c) 2018 Wind River Systems, Inc. All Rights Reserved.
+Copyright (c) 2009, 2013 IBM Corp.
+Copyright (c) 2015, 2018 logi.cals GmbH and others
+&copy; Copyright IBM Corp. 2009, 2018
+Copyright (c) 2009, 2012 IBM Corp.
+Copyright (c) 2017, 2019 IBM Corp.
+Copyright (c) 2009, 2017 IBM Corp.
+Copyright (c) 2017, 2018 IBM Corp.
+Copyright (c) 2018 IBM Corp.
+Copyright (c) 2016, 2017 logi.cals GmbH
+Copyright (c) 2018, 2019 Wind River Systems, Inc. and others. All Rights Reserved.
+Copyright (c) 2015, 2019 logi.cals GmbH and others
+Copyright (c) 2015, 2017 logi.cals GmbH and others
+Copyright (c) 2012, 2018 IBM Corp., and others
+Copyright (c) 2012, 2019 IBM Corp., and others
+
+License: Eclipse Public License(EPL) V1.0
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT’S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+
+i)changes to the Program, and
+ii)additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor’s behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient’s responsibility to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor’s responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient’s patent(s), then such Recipient’s rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient’s rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient’s rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient’s obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+----------------------------------------------------------------------
+Software:cJSON 1.7.13
+
+Copyright notice:
+Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams
+Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
+Copyright (c) 2009-2019 Dave Gamble and cJSON contributors
+Copyright (c) 2010 James Grenning and Contributed to Unity Project
+Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
+Copyright (c) 2007 - 2017 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams
+Copyright 2014 The Authors
+Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de
+Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
+
+License: The MIT License
+The MIT License
+
+Copyright (c) <year> <copyright holders>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+----------------------------------------------------------------------
+Software:bounds_checking_function
+
+Copyright notice:
+Copyright (c) Huawei Technologies Co., Ltd. 2014-2020. All rights reserved.
+
+License: Mulan Permissive Software License,Version 2
+木兰宽松许可证, 第2版
+木兰宽松许可证, 第2版
+
+2020年1月 http://license.coscl.org.cn/MulanPSL2
+
+您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
+
+0.   定义
+
+“软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
+
+“贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
+
+“贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
+
+“法人实体” 是指提交贡献的机构及其“关联实体”。
+
+“关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
+
+1.   授予版权许可
+
+每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
+
+2.   授予专利许可
+
+每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
+
+3.   无商标许可
+
+“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
+
+4.   分发限制
+
+您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
+
+5.   免责声明与责任限制
+
+“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
+
+6.   语言
+
+“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
+
+条款结束
+
+如何将木兰宽松许可证,第2版,应用到您的软件
+
+如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
+
+1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
+
+2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
+
+3, 请将如下声明文本放入每个源文件的头部注释中。
+
+Copyright (c) [Year] [name of copyright holder]
+[Software Name] is licensed under Mulan PSL v2.
+You can use this software according to the terms and conditions of the Mulan PSL v2.
+You may obtain a copy of Mulan PSL v2 at:
+         http://license.coscl.org.cn/MulanPSL2
+THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+See the Mulan PSL v2 for more details.
+Mulan Permissive Software License,Version 2
+Mulan Permissive Software License,Version 2 (Mulan PSL v2)
+
+January 2020 http://license.coscl.org.cn/MulanPSL2
+
+Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
+
+0. Definition
+
+Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
+
+Contribution means the copyrightable work licensed by a particular Contributor under this License.
+
+Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
+
+Legal Entity means the entity making a Contribution and all its Affiliates.
+
+Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
+
+1. Grant of Copyright License
+
+Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
+
+2. Grant of Patent License
+
+Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
+
+3. No Trademark License
+
+No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4.
+
+4. Distribution Restriction
+
+You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
+
+5. Disclaimer of Warranty and Limitation of Liability
+
+THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+6. Language
+
+THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
+
+END OF THE TERMS AND CONDITIONS
+
+How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software
+
+To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
+
+Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
+Create a file named "LICENSE" which contains the whole context of this License in the first directory of your software package;
+Attach the statement to the appropriate annotated syntax at the beginning of each source file.
+Copyright (c) [Year] [name of copyright holder]
+[Software Name] is licensed under Mulan PSL v2.
+You can use this software according to the terms and conditions of the Mulan PSL v2.
+You may obtain a copy of Mulan PSL v2 at:
+         http://license.coscl.org.cn/MulanPSL2
+THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+See the Mulan PSL v2 for more details.
+

+ 127 - 0
device/bossay/hi3861_l0/OAT.xml

@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2021 Huawei Device Co., Ltd.
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+
+	 Notes:
+	 This is project config file for OpenHarmony OSS Audit Tool, if you have any questions or concerns, please email chenyaxun.
+-->
+<!-- OAT(OSS Audit Tool) configuration guide:
+basedir: Root dir, the basedir + project path is the real source file location.
+licensefile:
+1.If the project don't have "LICENSE" in root dir, please define all the license files in this project in , OAT will check license files according to this rule.
+
+tasklist(only for batch mode):
+1. task: Define oat check thread, each task will start a new thread.
+2. task name: Only an name, no practical effect.
+3. task policy: Default policy for projects under this task, this field is required and the specified policy must defined in policylist.
+4. task filter: Default filefilter for projects under this task, this field is required and the specified filefilter must defined in filefilterlist.
+5. task project: Projects to be checked, the path field define the source root dir of the project.
+
+
+policyList:
+1. policy: All policyitems will be merged to default OAT.xml rules, the name of policy doesn't affect OAT check process.
+2. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is:
+<policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/>
+3. policyitem type:
+    "compatibility" is used to check license compatibility in the specified path;
+    "license" is used to check source license header in the specified path;
+    "copyright" is used to check source copyright header in the specified path;
+    "import" is used to check source dependency in the specified path, such as import ... ,include ...
+    "filetype" is used to check file type in the specified path, supported file types: archive, binary
+    "filename" is used to check whether the specified file exists in the specified path(support projectroot in default OAT.xml), supported file names: LICENSE, README, README.OpenSource
+
+4. policyitem name: This field is used for define the license, copyright, "*" means match all, the "!" prefix means could not match this value. For example, "!GPL" means can not use GPL license.
+5. policyitem path: This field is used for define the source file scope to apply this policyitem, the "!" prefix means exclude the files. For example, "!.*/lib/.*" means files in lib dir will be exclude while process this policyitem.
+6. policyitem rule and group: These two fields are used together to merge policy results. "may" policyitems in the same group means any one in this group passed, the result will be passed.
+7. policyitem filefilter: Used to bind filefilter which define filter rules.
+8. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path.
+
+Note:If the text contains special characters, please escape them according to the following rules:
+" == &gt;
+& == &gt;
+' == &gt;
+< == &gt;
+> == &gt;
+-->
+<configuration>
+    <oatconfig>
+		<licensefile>sdk_liteos/license/LICENSE</licensefile>
+        <policylist>
+            <policy name="projectPolicy" desc="">
+				<policyitem type="copyright" name="Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED." path=".*" desc="HiSilicon copyright"/>
+				<policyitem type="copyright" name="Copyright (c) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED." path=".*" desc="HiSilicon copyright"/>
+				<policyitem type="copyright" name="Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved." path=".*" desc="HiSilicon copyright"/>
+				<policyitem type="license" name="BSD-3-Clause" path=".*" desc="HiSilicon copyright"/>
+				<policyitem type="license" name="EndUserLicenseAgreement" path=".*" desc="HiSilicon copyright"/>
+			</policy>
+        </policylist>
+		<filefilterlist>
+			<filefilter name="defaultFilter" desc="Files not to check">
+				<!--filteritem type="filename" name="*.lds|*.pod"/-->
+				<!--filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/-->
+			</filefilter>
+			<filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
+				<!--filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/-->
+				<filteritem type="filepath" name="sdk_liteos/platform/os/.*" desc="liteos"/>
+				<filteritem type="filepath" name="sdk_liteos/third_party/.*" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filepath" name="hi3861_adapter/.*" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filepath" name="sdk_liteos/components/iperf2/include/iperf.h" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.mk" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.sh" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.gni" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.xml" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.cfg" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.csv" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.S|*.gn" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.txt" desc="Temp files"/>
+			</filefilter>
+			<filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies" >
+				<filteritem type="filepath" name="sdk_liteos/platform/os/.*" desc="liteos"/>
+				<filteritem type="filepath" name="sdk_liteos/third_party/.*" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filepath" name="hi3861_adapter/.*" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filepath" name="sdk_liteos/components/iperf2/include/iperf.h" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.mk" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.sh" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.gni" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.xml" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.cfg" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.png" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.csv" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.S|*.gn" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.txt" desc="Temp files"/>
+			</filefilter>
+			<filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies" >
+				<!--filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/-->
+			</filefilter>
+			<filefilter name="readmeFileNamePolicyFilter" desc="Filters for README file policies" >
+			</filefilter>
+			<filefilter name="readmeOpenSourcefileNamePolicyFilter" desc="Filters for README.OpenSource file policies" >
+				<!--filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/-->
+			</filefilter>
+			<filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies" >
+				<filteritem type="filepath" name="sdk_liteos/build/libs/.*.a" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filepath" name="sdk_liteos/build/libs/.*.o" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filename" name="*.exe|*.bin|*.png" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filepath" name="sdk_liteos/tools/nvtool/tools/nv/cdbm" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filepath" name="sdk_liteos/tools/lzma_tool/lzma_tool" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filepath" name="sdk_liteos/build/scripts/ota_builder" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filepath" name="sdk_liteos/tools/sign_tool/sign_tool" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filepath" name="sdk_liteos/tools/nvtool/nv_builder" desc="Describe the reason for filtering scan results"/>
+				<filteritem type="filepath" name="sdk_liteos/third_party/u-boot-v2019.07/u-boot-v2019.07.tar.gz" desc="Describe the reason for filtering scan results"/>
+  			</filefilter>
+
+		</filefilterlist>
+
+    </oatconfig>
+</configuration>

+ 112 - 0
device/bossay/hi3861_l0/README.md

@@ -0,0 +1,112 @@
+# HiSpark\_pegasus<a name="EN-US_TOPIC_0000001130176841"></a>
+
+-   [Introduction](#section11660541593)
+-   [Features](#section12212842173518)
+-   [Directory Structure](#section1464106163817)
+-   [License Agreement](#section1478215290)
+-   [Repositories Involved](#section1371113476307)
+
+## Introduction<a name="section11660541593"></a>
+
+HiSpark\_pegasus \(Hi3861 V100\) is a 2 x 5 cm development board. It is a 2.4 GHz Wi-Fi SoC chip that highly integrates the IEEE 802.11b/g/n baseband and radio frequency \(RF\) circuit. The RF circuit includes modules such as the power amplifier \(PA\), low noise amplifier \(LNA\), RF Balun, antenna switch, and power management. It supports a standard bandwidth of 20 MHz and a narrow bandwidth of 5 MHz or 10 MHz, and provides a maximum rate of 72.2 Mbit/s at the physical layer. The Hi3861 V100 Wi-Fi baseband supports the orthogonal frequency division multiplexing \(OFDM\) technology and is backward compatible with the direct sequence spread spectrum \(DSSS\) and complementary code keying \(CCK\) technologies. It also supports various data rates specified in the IEEE 802.11 b/g/n protocol. Hi3861 V100 integrates the high-performance 32-bit microprocessor, hardware security engine, and various peripheral interfaces. The peripheral interfaces include the Synchronous Peripheral Interface \(SPI\), Universal Asynchronous Receiver & Transmitter \(UART\), the Inter Integrated Circuit \(I2C\), Pulse Width Modulation \(PWM\), General Purpose Input/Output \(GPIO\) interface, and multi-channel Analog to Digital Converter \(ADC\). In addition, Hi3861 V100 supports the high-speed SDIO 2.0 Device interface, with a maximum clock frequency of 50 MHz. This chip has a built-in static random access memory \(SRAM\) and flash memory, so that programs can run independently or run from a flash drive. Hi3861 V100 applies to Internet of Things \(IoT\) devices such as smart home appliances.
+
+The Hi3861 platform software shields the underlying layer from the application layer, providing application programming interfaces \(APIs\) for the application software to implement required functions. The following figure shows the typical system application architecture.
+
+**Figure  1**  System application architecture<a name="fig4460722185514"></a>  
+
+
+![](figures/en-us_image_0000001086800826.png)
+
+This framework consists of the following layers:
+
+-   APP layer: represents the application layer. The sample code provided by the SDK is stored in the  **app\\demo\\src**  directory.
+-   API layer: provides common APIs developed based on the SDK.
+-   Platform layer: provides a board support package \(BSP\) for the SoC, including the following functions:
+    -   Chip and peripheral driver
+    -   Operating system
+    -   System management
+
+-   Service layer: provides application protocol stacks such as Wi-Fi. It is used to send and receive data for upper-layer applications.
+-   Third party: provides third-party software libraries for the service layer or application layer.
+
+## Features<a name="section12212842173518"></a>
+
+**Stable and reliable communication capability**
+
+-   Reliable communication algorithms such as TPC, automatic rate, and immunity against weak interference in complex environments
+
+**Flexible networking capability**
+
+-   256-node mesh networking
+-   Standard bandwidth \(20 MHz\) and narrow bandwidth \(5 MHz or 10 MHz\) networking
+
+**Comprehensive network support**
+
+-   IPv4 and IPv6-compliant networking
+-   DHCPv4 and DHCPv6 Client and Server
+-   DNS Client
+-   mDNS
+-   Basic CoAP, MQTT, HTTP and JSON components
+
+**Advanced security engine**
+
+-   AES-128 and AES-256 encryption and decryption algorithms
+-   HASH-SHA256 and HMAC\_SHA256 algorithms
+-   RSA and ECC signature verification algorithms
+-   True random number generation, meeting the FIPS140-2 random test standard
+-   TLS and DTLS acceleration
+-   eFUSE for secure storage, boot, and upgrade
+-   Built-in MPU feature for memory isolation
+
+**Open operating system**
+
+-   Low power consumption, small memory, high stability, and high real-time performance
+-   Flexible protocol support and extension capabilities
+-   Interfaces for secondary development
+-   Multi-layer development interfaces: operating system adaptation, system diagnosis, link layer, and network layer interfaces
+
+## Directory Structure<a name="section1464106163817"></a>
+
+The root directory of the Hi3861 SDK is  **device\\bossay\\hispark\_pegasus\\sdk\_liteos**. Its directory structure is as follows:
+
+```
+device/bossay/hi3861_l0/sdk_liteos
+├── app                 # Application layer code, including the demo program
+├── boot                # Flash bootloader code
+├── build               # Library, link, and configuration files required for SDK construction
+├── BUILD.gn            # GN building script
+├── build_patch.sh      # File used for decompressing the U-Boot open-source code package and applying patches
+├── build.sh            # Building script for startup, which can be customized using the sh build.sh menuconfig command
+├── components          # Files related to the SDK platform
+├── config              # SDK system configuration files
+├── config.gni          # Configuration files supporting OpenHarmony
+├── factory.mk          # Building script of the factory-test version
+├── hm_build.sh         # Building script for adapting to OpenHarmony
+├── include             # Header files declaring APIs
+├── license             # License of the open-source SDK
+├── Makefile            # File for building using the make or make all command
+├── non_factory.mk      # Building script of the non-factory-test version
+├── platform            # Files related to the SDK platform, including the kernel image and driver modules
+├── SConstruct          # SCons build script
+├── third_party         # Open-source third-party software
+└── tools               # Tools provided by the SDK for Linux and Windows systems, including the NV making tool, signature tool, and Menuconfig
+```
+
+## License Agreement<a name="section1478215290"></a>
+
+-   The Hi3861 V100 self-developed code uses the HiSilicon copyright notice licensed under the 2.0 version of the Apache License. The license and copyright information can be viewed at the beginning of the code:
+
+```
+  / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.Licensed under the Apache License,* ... * / 
+```
+
+-   The third-party code used by Hi3861 V100 complies with the open-source license notice delivered with the software version.
+-   The generated library files are stored in  **build/libs**  in the root directory.
+-   Some open-source software components may be used in Hi3861 V100. If the licenses applicable to those open-source software components conflict with this Agreement, the former ones shall prevail.
+
+## Repositories Involved<a name="section1371113476307"></a>
+
+**device/bossay/hispark\_pegasus**
+
+vendor/bossay
+

+ 112 - 0
device/bossay/hi3861_l0/README_zh.md

@@ -0,0 +1,112 @@
+# HiSpark\_pegasus<a name="ZH-CN_TOPIC_0000001130176841"></a>
+
+-   [简介](#section11660541593)
+-   [特点](#section12212842173518)
+-   [目录](#section1464106163817)
+-   [许可协议](#section1478215290)
+-   [相关仓](#section1371113476307)
+
+## 简介<a name="section11660541593"></a>
+
+HiSpark\_pegasus(Hi3861V100)是一款高度集成的2.4GHz WiFi SoC芯片,集成IEEE 802.11b/g/n基带和RF电路,RF电路包括功率放大器PA、低 噪声放大器LNA、RF balun、天线开关以及电源管理等模块;支持20MHz标准带宽和5MHz/10MHz窄带宽,提供最大72.2Mbit/s 物理层速率。 Hi3861V100 WiFi基带支持正交频分复用(OFDM)技术,并向下兼容直接序列扩频(DSSS)和补码键控(CCK)技术,支 持IEEE 802.11 b/g/n协议的各种数据速率。 Hi3861V100芯片集成高性能32bit微处理器、硬件安全引擎以及丰富的外设接口,外设接口包括SPI、UART、I2C、PWM、 GPIO和多路ADC,同时支持高速SDIO2.0 Device接口,最高时钟可达50MHz;芯片内置SRAM和Flash,可独立运行,并支持 在Flash上运行程序。 Hi3861V100芯片适应于智能家电等物联网智能终端领域。
+
+上海海思Hi3861系列的平台软件对应用层实现了底层屏蔽,并对应用软件直接提供API\(Application Programming Interface\)接口完成相应功能。典型的系统应用架构如下:
+
+**图 1**  系统架构图<a name="fig4460722185514"></a>  
+
+
+![](figures/zh-cn_image_0000001086800826.png)
+
+该框架可以分为以下几个层次:
+
+-   APP层:即应用层。SDK提供的代码示例在SDK的代码目录:app\\demo\\src。
+-   API层:提供基于SDK开发的通用接口。
+-   Platform平台层:提供SOC系统板级支持包,包括如下功能:
+    -   芯片和外围器件驱动
+    -   操作系统
+    -   系统管理
+
+-   Service服务层:提供包含WiFi等应用协议栈。用于上层应用软件进行数据收发等操作。
+-   第三方:提供给Service服务层或提供给应用层使用的第三方软件库。
+
+## 特点<a name="section12212842173518"></a>
+
+**稳定、可靠的通信能力**
+
+-   支持复杂环境下 TPC、自动速率、弱干扰免疫等可靠性通信算法
+
+**灵活的组网能力**
+
+-   支持 256 节点 Mesh 组网
+-   支持标准 20M 带宽组网和 5M/10M 窄带组网
+
+**完善的网络支持**
+
+-   支持 IPv4/IPv6 网络功能
+-   支持 DHCPv4/DHCPv6 Client/Server
+-   支持 DNS Client 功能
+-   支持 mDNS 功能
+-   支持 CoAP/MQTT/HTTP/JSON 基础组件
+
+**强大的安全引擎**
+
+-   硬件实现 AES128/256 加解密算法
+-   硬件实现 HASH-SHA256、HMAC\_SHA256 算法
+-   硬件实现 RSA、ECC 签名校验算法
+-   硬件实现真随机数生成,满足 FIPS140-2 随机测试标准
+-   硬件支持 TLS/DTLS 加速
+-   内部集成 EFUSE,支持安全存储、安全启动、安全升级
+-   内部集成 MPU 特性,支持内存隔离特性
+
+**开放的操作系统**
+
+-   丰富的低功耗、小内存、高稳定性、高实时性机制
+-   灵活的协议支撑和扩展能力
+-   二次开发接口
+-   多层级开发接口:操作系统适配接口和系统诊断接口、 链路层接口、网络层接口
+
+## 目录<a name="section1464106163817"></a>
+
+Hi3861的SDK软件包根目录结构所在位置device\\bossay\\hispark\_pegasus\\sdk\_liteos,如下图所示:
+
+```
+device/bossay/hi3861_l0/sdk_liteos
+├── app                 # 应用层代码(其中包含demo程序为参考示例)。
+├── boot                # Flash bootloader代码。
+├── build               # SDK构建所需的库文件、链接文件、配置文件。
+├── BUILD.gn            # GN构建脚本
+├── build_patch.sh      # 用于解压uboot开源源码包和打patch。
+├── build.sh            # 启动编译脚本,同时支持“sh build.sh menuconfig”进行客制化配置。
+├── components          # SDK平台相关的组件
+├── config              # SDK系统配置文件。
+├── config.gni          # 支持OpenHarmony配置文件。
+├── factory.mk          # 厂测版本编译脚本。
+├── hm_build.sh         # 适配OpenHarmony构建脚本。
+├── include             # API头文件存放目录。
+├── license             # SDK开源license声明
+├── Makefile            # 支持make编译,使用“make”或“make all”启动编译。
+├── non_factory.mk      # 非厂测版本编译脚本。
+├── platform            # SDK平台相关的文件(包括:内核镜像、驱动模块等)
+├── SConstruct          # SCons编译脚本。
+├── third_party         # 开源第三方软件目录。
+└── tools               # SDK提供的Linux系统和Windows系统上使用的工具(包括:NV制作工具、签名工具、Menuconfig等)。
+```
+
+## 许可协议<a name="section1478215290"></a>
+
+-   Hi3861V100自研代码使用基于Apache License Version 2.0许可的hisi版权声明。许可信息和版权信息通常可以在代码开头看到:
+
+```
+  / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.Licensed under the Apache License,* ... * / 
+```
+
+-   Hi3861V100使用的第三方代码遵循软件版本自带的开源许可声明。
+-   将生成的库文件统一存放于根目录下的build/libs下。
+-   Hi3861V100可能会使用一些开源软件组件。如果这些开源软件组件所适用的许可与本协议内容冲突,则以该开源软件组件的许可为准。
+
+## 相关仓<a name="section1371113476307"></a>
+
+**device/bossay/hispark\_pegasus**
+
+vendor/bossay
+

+ 57 - 0
device/bossay/hi3861_l0/bundle.json

@@ -0,0 +1,57 @@
+{
+    "name": "@ohos/device_bearpi_bearpi_hm_nano",
+    "version": "",
+    "description": "Hi3861 chip driver software, including license files, compilation scripts, configuration files, driver implementation, and tools | Hi3861芯片驱动软件,包含LICENSE、编译脚本、配置文件、驱动实现、工具等",
+    "homePage": "https://gitee.com/openharmony",
+    "license": "Apache V2",
+    "repository": "https://gitee.com/openharmony/device_bearpi_bearpi_hm_nano",
+    "domain": "os",
+    "language": "",
+    "publishAs": "code-segment",
+    "private": false,
+    "scripts": {},
+    "tags": [
+        "device"
+    ],
+    "keywords": [
+        "device",
+        "bossay",
+        "hispark",
+        "pegasus"
+    ],
+    "envs": [],
+    "dirs": [],
+    "author": {
+        "name": "",
+        "email": "",
+        "url": ""
+    },
+    "contributors": [
+        {
+            "name": "",
+            "email": "",
+            "url": ""
+        }
+    ],
+    "segment": {
+        "destPath": "device/bossay/hi3861_l0"
+    },
+    "component": {
+        "name": "device_bossay_hi3861_l0",
+        "subsystem": "",
+        "syscap": [],
+        "features": [],
+        "adapted_system_type": [],
+        "rom": "",
+        "ram": "",
+        "deps": {
+            "components": [],
+            "third_party": []
+        },
+        "build": {
+            "sub_component": [],
+            "inner_kits": [],
+            "test": []
+        }
+    }
+}

BIN
device/bossay/hi3861_l0/figures/en-us_image_0000001086800826.png


BIN
device/bossay/hi3861_l0/figures/zh-cn_image_0000001086800826.png


+ 176 - 0
device/bossay/hi3861_l0/hi3861_adapter/LICENSE

@@ -0,0 +1,176 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS

+ 23 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiaware/BUILD.gn

@@ -0,0 +1,23 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build/lite/config/component/lite_component.gni")
+
+static_library("hal_wifiaware") {
+  sources = [ "source/hal_wifiaware.c" ]
+  include_dirs = [
+    "//device/bossay/hi3861_l0/sdk_liteos/include",
+    "//device/bossay/hi3861_l0/sdk_liteos/third_party/mbedtls-2.16.2/include",
+    "//foundation/communication/wifi_aware/interfaces/kits",
+  ]
+}

+ 105 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiaware/source/hal_wifiaware.c

@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "hi_cipher.h"
+#include "hi_wifi_api.h"
+#include "hi_wifi_sdp_api.h"
+#include "wifiaware.h"
+
+int HalWifiSdpInit(const char* ifname)
+{
+    if (hi_wifi_sdp_init(ifname) != HISI_OK) {
+        return -1;
+    }
+    return 0;
+}
+
+unsigned int HalCipherHashSha256(const char* input, unsigned int inputLen, unsigned char* hash, unsigned hashLen)
+{
+    if (hi_cipher_hash_sha256((uintptr_t)input, inputLen, hash, hashLen) != HISI_OK) {
+        return -1;
+    }
+    return 0;
+}
+
+int HalWifiSdpStartService(const char* svcName, unsigned char localHandle, RecvCallback recvCB, unsigned char role)
+{
+    if (hi_wifi_sdp_start_service(svcName, localHandle, (hi_wifi_sdp_recv_cb)recvCB, role) != HISI_OK) {
+        return -1;
+    }
+    return 0;
+}
+
+int HalWifiSdpSend(unsigned char* macAddr, unsigned char peerHandle, unsigned char localHandle,
+    unsigned char* msg, int len)
+{
+    if (hi_wifi_sdp_send(macAddr, peerHandle, localHandle, msg, len) != HISI_OK) {
+        return -1;
+    }
+    return 0;
+}
+
+int HalWifiSdpStopService(unsigned char localHandle, unsigned char role)
+{
+    if (hi_wifi_sdp_stop_service(localHandle, role) != HISI_OK) {
+        return -1;
+    }
+    return 0;
+}
+
+int HalWifiSdpDeinit(void)
+{
+    if (hi_wifi_sdp_deinit() != HISI_OK) {
+        return -1;
+    }
+    return 0;
+}
+
+int HalWifiSdpAdjustTxPower(const char *ifname, signed char power)
+{
+    if (hi_wifi_sdp_adjust_tx_power(ifname, power) != HISI_OK) {
+        return -1;
+    }
+    return 0;
+}
+
+int HalWifiSdpRestoreTxPower(const char *ifname)
+{
+    if (hi_wifi_sdp_restore_tx_power(ifname) != HISI_OK) {
+        return -1;
+    }
+    return 0;
+}
+
+int HalWifiSdpBeaconSwitch(const char *ifname, unsigned char enable)
+{
+    if (hi_wifi_sdp_beacon_switch(ifname, enable) != HISI_OK) {
+        return -1;
+    }
+    return 0;
+}
+
+int HalWifiSdpSetRetryTimes(unsigned int retries)
+{
+    if (hi_wifi_sdp_set_retry_times(retries) != HISI_OK) {
+        return -1;
+    }
+    return 0;
+}
+
+int HalWifiSdpGetSyncMode(void)
+{
+    return hi_wifi_sdp_get_sync_mode();
+}

+ 34 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiservice/BUILD.gn

@@ -0,0 +1,34 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//build/lite/ndk/ndk.gni")
+static_library("wifiservice") {
+  sources = [
+    "source/wifi_device.c",
+    "source/wifi_device_util.c",
+    "source/wifi_hotspot.c",
+  ]
+  include_dirs = [
+    "//device/bossay/hi3861_l0/sdk_liteos/include",
+    "//foundation/communication/wifi_lite/interfaces/wifiservice",
+    "//kernel/liteos_m/kal",
+    "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr",
+  ]
+}
+if (ohos_kernel_type == "liteos_m") {
+  ndk_lib("wifiservice_ndk") {
+    deps = [ ":wifiservice" ]
+
+    head_files =
+        [ "//foundation/communication/wifi_lite/interfaces/wifiservice" ]
+  }
+}

+ 990 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiservice/source/wifi_device.c

@@ -0,0 +1,990 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wifi_device.h"
+
+#include <securec.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "lwip/if_api.h"
+#include "lwip/netifapi.h"
+#include "wifi_device_util.h"
+#include "wifi_hotspot_config.h"
+#include "utils_file.h"
+
+#define WIFI_RECONN_POLICY_ENABLE        1
+#define WIFI_RECONN_POLICY_TIMEOUT       0xFFFF
+#define WIFI_RECONN_POLICY_PERIOD        100
+#define WIFI_RECONN_POLICY_MAX_TRY_COUNT 100
+#define WIFI_DISCONNECT_REASON_NO_AP     1
+#define WIFI_DEFAULT_KEY_FOR_PSK    "wifipskmode"
+#define WLAN_STA_NAME "wlan0"
+#define WIFI_FILE "/usrdata/hilink/wifi.cfg"
+#define WIFI_FILE_EXIST 1
+#define WIFI_FILE_UNEXIST 0
+
+static int g_wifiStaStatus = WIFI_STA_NOT_ACTIVE;
+static WifiDeviceConfig g_wifiConfigs[WIFI_MAX_CONFIG_SIZE] = {
+    {0}, {0}, {0}, 0, WIFI_CONFIG_INVALID, 0, 0, UNKNOWN, {0, 0, {0, 0}, 0}
+};
+static WifiEvent* g_wifiEvents[WIFI_MAX_EVENT_SIZE] = {0};
+static int g_connectState = WIFI_STATE_NOT_AVALIABLE;
+static int g_networkId = -1;
+static bool g_networkConfigReadFlag = false;
+static int g_isNetworkConfigExist = WIFI_FILE_UNEXIST;
+
+static bool IsFileExist(const char* path)
+{
+    if (path == NULL) {
+        return false;
+    }
+    int32_t fd = UtilsFileOpen(path, O_RDONLY_FS, 0);
+    if (fd < 0) {
+        return false;
+    }
+    (void)UtilsFileClose(fd);
+    return true;
+}
+
+static int WriteNetworkConfig(const unsigned char *buf, unsigned int len)
+{
+    int fd;
+
+    if (buf == 0) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    fd = UtilsFileOpen(WIFI_FILE, O_RDWR_FS | O_CREAT_FS | O_TRUNC_FS, 0);
+    if (fd < 0) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (UtilsFileWrite(fd, (const char *)buf, len) < 0) {
+        UtilsFileClose(fd);
+        return ERROR_WIFI_UNKNOWN;
+    }
+    UtilsFileClose(fd);
+
+    return WIFI_SUCCESS;
+}
+
+static int ReadNetworkConfig(unsigned char *buf, unsigned int len)
+{
+    int fd;
+    unsigned int fileLen = 0;
+    int ret;
+    bool isFileExist = false;
+
+    if (buf == NULL) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (IsFileExist(WIFI_FILE) == true) {
+        isFileExist = true;
+        g_isNetworkConfigExist = WIFI_FILE_EXIST;
+    } else {
+        g_isNetworkConfigExist = WIFI_FILE_UNEXIST;
+    }
+
+    fd = UtilsFileOpen(WIFI_FILE, O_RDWR_FS | O_CREAT_FS, 0);
+    if (fd < 0) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    ret = UtilsFileStat(WIFI_FILE, &fileLen);
+    if (ret != WIFI_SUCCESS) {
+        UtilsFileClose(fd);
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    ret = UtilsFileSeek(fd, 0, SEEK_SET_FS);
+    if (ret != WIFI_SUCCESS) {
+        UtilsFileClose(fd);
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (fileLen > len) {
+        UtilsFileClose(fd);
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (isFileExist == true) {
+        ret = UtilsFileRead(fd, (char *)buf, len);
+        if (ret < 0) {
+            UtilsFileClose(fd);
+            return ERROR_WIFI_UNKNOWN;
+        }
+    }
+    UtilsFileClose(fd);
+    return WIFI_SUCCESS;
+}
+
+static void DispatchScanStateChangeEvent(const hi_wifi_event* hisiEvent,
+    const WifiEvent* hosEvent, WifiEventState event)
+{
+    if (hosEvent->OnWifiScanStateChanged == NULL) {
+        return;
+    }
+
+    int size = 0;
+    if (event == WIFI_STATE_NOT_AVALIABLE) {
+        hosEvent->OnWifiScanStateChanged(event, size);
+        return;
+    }
+
+    if (hisiEvent->event == HI_WIFI_EVT_SCAN_DONE) {
+        size = hisiEvent->info.wifi_scan_done.bss_num;
+        hosEvent->OnWifiScanStateChanged(event, size);
+    }
+}
+
+static void StaSetLocaladdr(const struct netif *netif, int gw, int ipaddr, int netmask)
+{
+    ip4_addr_t st_gw;
+    ip4_addr_t st_ipaddr;
+    ip4_addr_t st_netmask;
+
+    if (netif == NULL) {
+        printf("hisi_reset_addr::Null param of netdev\r\n");
+        return;
+    }
+
+    ip4_addr_set_u32(&st_gw, gw);
+    ip4_addr_set_u32(&st_ipaddr, ipaddr);
+    ip4_addr_set_u32(&st_netmask, netmask);
+    netifapi_netif_set_addr(netif, &st_ipaddr, &st_netmask, &st_gw);
+    return;
+}
+
+static void StaSetDNSServer(int switcher)
+{
+    ip4_addr_t tmp_dns_ser[WIFI_MAX_DNS_NUM];
+    for (int i = 0; i < WIFI_MAX_DNS_NUM; i++) {
+        if (switcher == HI_WIFI_EVT_CONNECTED) {
+            ip4_addr_set_u32(&tmp_dns_ser[i], g_wifiConfigs[g_networkId].staticIp.dnsServers[i]);
+        } else {
+            ip4_addr_set_u32(&tmp_dns_ser[i], 0);
+        }
+        lwip_dns_setserver(i, &tmp_dns_ser[i]);
+    }
+    return;
+}
+
+static void StaSetWifiNetConfig(int switcher)
+{
+    struct netif *netif_node = netif_find(WLAN_STA_NAME);
+    if (netif_node == NULL) {
+        printf("[wifi_service]:DispatchConnectEvent netif get fail\r\n");
+        return;
+    }
+    if (switcher == HI_WIFI_EVT_CONNECTED) {
+        if (g_wifiConfigs[g_networkId].ipType == DHCP) {
+            netifapi_dhcp_start(netif_node);
+        } else if (g_wifiConfigs[g_networkId].ipType == STATIC_IP) {
+            (void)netifapi_netif_set_link_up(netif_node);
+            StaSetLocaladdr(netif_node, g_wifiConfigs[g_networkId].staticIp.gateway,
+                g_wifiConfigs[g_networkId].staticIp.ipAddress, g_wifiConfigs[g_networkId].staticIp.netmask);
+            (void)netifapi_netif_set_up(netif_node);
+            StaSetDNSServer(HI_WIFI_EVT_CONNECTED);
+        }
+    } else if (switcher == HI_WIFI_EVT_DISCONNECTED) {
+        if (g_wifiConfigs[g_networkId].ipType == DHCP) {
+            netifapi_dhcp_stop(netif_node);
+            StaSetLocaladdr(netif_node, 0, 0, 0);
+        } else if (g_wifiConfigs[g_networkId].ipType == STATIC_IP) {
+            (void)netifapi_netif_set_link_down(netif_node);
+            (void)netifapi_netif_set_down(netif_node);
+            StaSetLocaladdr(netif_node, 0, 0, 0);
+            StaSetDNSServer(HI_WIFI_EVT_DISCONNECTED);
+        }
+    }
+    return;
+}
+
+static void DispatchConnectEvent(const hi_wifi_event* hisiEvent, const WifiEvent* hosEvent)
+{
+    if (hosEvent->OnWifiConnectionChanged == NULL) {
+        return;
+    }
+
+    int cpyErr;
+    WifiLinkedInfo info = {0};
+
+    if (hisiEvent->event == HI_WIFI_EVT_CONNECTED) {
+        g_connectState = WIFI_STATE_AVALIABLE;
+        cpyErr = memcpy_s(&info.ssid, WIFI_MAX_SSID_LEN,
+            hisiEvent->info.wifi_connected.ssid, HI_WIFI_MAX_SSID_LEN + 1);
+        if (cpyErr != EOK) {
+            printf("[wifi_service]:DispatchConnectEvent memcpy failed, err = %d\n", cpyErr);
+            return;
+        }
+
+        cpyErr = memcpy_s(&info.bssid, WIFI_MAC_LEN,
+            hisiEvent->info.wifi_connected.bssid, HI_WIFI_MAC_LEN);
+        if (cpyErr != EOK) {
+            printf("[wifi_service]:DispatchConnectEvent memcpy failed, err = %d\n", cpyErr);
+            return;
+        }
+        // gdtr_TODO:
+        // StaSetWifiNetConfig(HI_WIFI_EVT_CONNECTED);
+        hosEvent->OnWifiConnectionChanged(WIFI_STATE_AVALIABLE, &info);
+        return;
+    }
+
+    if (hisiEvent->event == HI_WIFI_EVT_STA_FCON_NO_NETWORK && g_connectState == WIFI_STATE_AVALIABLE) {
+        return;
+    }
+
+    info.disconnectedReason = WIFI_DISCONNECT_REASON_NO_AP;
+
+    if (hisiEvent->event == HI_WIFI_EVT_DISCONNECTED) {
+        cpyErr = memcpy_s(&info.bssid, WIFI_MAC_LEN,
+            hisiEvent->info.wifi_disconnected.bssid, HI_WIFI_MAC_LEN);
+        if (cpyErr != EOK) {
+            printf("[wifi_service]:DispatchConnectEvent memcpy failed, err = %d\n", cpyErr);
+            return;
+        }
+        info.disconnectedReason = hisiEvent->info.wifi_disconnected.reason_code;
+    }
+    // gdtr_TODO:
+    // StaSetWifiNetConfig(HI_WIFI_EVT_DISCONNECTED);
+    hosEvent->OnWifiConnectionChanged(WIFI_STATE_NOT_AVALIABLE, &info);
+}
+
+static void DispatchStaConnectEvent(const hi_wifi_event* hisiEvent, const WifiEvent* hosEvent)
+{
+    int cpyErr;
+    StationInfo info = {0};
+    if (hisiEvent->event == HI_WIFI_EVT_STA_CONNECTED) {
+        if (hosEvent->OnHotspotStaJoin == NULL) {
+            return;
+        }
+
+        cpyErr = memcpy_s(&info.macAddress, WIFI_MAC_LEN,
+            hisiEvent->info.ap_sta_connected.addr, HI_WIFI_MAC_LEN);
+        if (cpyErr != EOK) {
+            printf("[wifi_service]:DispatchStaConnectEvent memcpy failed, err = %d\n", cpyErr);
+            return;
+        }
+
+        hosEvent->OnHotspotStaJoin(&info);
+        return;
+    }
+
+    if (hosEvent->OnHotspotStaLeave == NULL) {
+        return;
+    }
+
+    cpyErr = memcpy_s(&info.macAddress, WIFI_MAC_LEN,
+        hisiEvent->info.ap_sta_disconnected.addr, HI_WIFI_MAC_LEN);
+    if (cpyErr != EOK) {
+        printf("[wifi_service]:DispatchStaConnectEvent memcpy failed, err = %d\n", cpyErr);
+        return;
+    }
+    info.disconnectedReason = hisiEvent->info.ap_sta_disconnected.reason_code;
+    hosEvent->OnHotspotStaLeave(&info);
+}
+
+static void DispatchApStartEvent(const WifiEvent* hosEvent)
+{
+    if (hosEvent->OnHotspotStateChanged == NULL) {
+        return;
+    }
+
+    hosEvent->OnHotspotStateChanged(WIFI_STATE_AVALIABLE);
+}
+
+static void DispatchEvent(const hi_wifi_event* hisiEvent, const WifiEvent* hosEvent)
+{
+    switch (hisiEvent->event) {
+        case HI_WIFI_EVT_SCAN_DONE:
+            DispatchScanStateChangeEvent(hisiEvent, hosEvent, WIFI_STATE_AVALIABLE);
+            break;
+        case HI_WIFI_EVT_CONNECTED:
+        case HI_WIFI_EVT_DISCONNECTED:
+        case HI_WIFI_EVT_STA_FCON_NO_NETWORK:
+            DispatchConnectEvent(hisiEvent, hosEvent);
+            break;
+        case HI_WIFI_EVT_STA_CONNECTED:
+        case HI_WIFI_EVT_STA_DISCONNECTED:
+            DispatchStaConnectEvent(hisiEvent, hosEvent);
+            break;
+        case HI_WIFI_EVT_AP_START:
+            DispatchApStartEvent(hosEvent);
+            break;
+        default:
+            // event not supported in current version, do nothing
+            break;
+    }
+}
+
+static void HiWifiWpaEventCb(const hi_wifi_event *hisiEvent)
+{
+    if (hisiEvent == NULL) {
+        return;
+    }
+    if (LockWifiEventLock() != WIFI_SUCCESS) {
+        return;
+    }
+    for (int i = 0; i < WIFI_MAX_EVENT_SIZE; i++) {
+        if (g_wifiEvents[i] == NULL) {
+            continue;
+        }
+        DispatchEvent(hisiEvent, g_wifiEvents[i]);
+    }
+    if (UnlockWifiEventLock() != WIFI_SUCCESS) {
+        return;
+    }
+}
+
+static void RegisterHisiCallback(void)
+{
+    int hiRet = hi_wifi_register_event_callback(HiWifiWpaEventCb);
+    if (hiRet != HISI_OK) {
+        printf("[wifi_service]:RegisterHisiCallback register callback failed\n");
+    }
+    hiRet = hi_wifi_config_callback(1, 0, 0);
+    if (hiRet != HISI_OK) {
+        printf("[wifi_service]:ConfigHisiCallback failed\n");
+    }
+}
+
+WifiErrorCode EnableWifi(void)
+{
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (g_wifiStaStatus == WIFI_STA_ACTIVE) {
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_BUSY;
+    }
+
+    char ifName[WIFI_IFNAME_MAX_SIZE + 1] = {0};
+    int len = sizeof(ifName);
+    int hiRet;
+
+    hiRet = hi_wifi_sta_start(ifName, &len);
+    if (hiRet != HISI_OK) {
+        printf("[wifi_service]:EnableWifi sta start fail\n");
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_NOT_STARTED;
+    }
+
+    hiRet = hi_wifi_sta_set_reconnect_policy(WIFI_RECONN_POLICY_ENABLE, WIFI_RECONN_POLICY_TIMEOUT,
+        WIFI_RECONN_POLICY_PERIOD, WIFI_RECONN_POLICY_MAX_TRY_COUNT);
+    if (hiRet != HISI_OK) {
+        printf("[wifi_service]:EnableWifi set reconn policy fail\n");
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    g_wifiStaStatus = WIFI_STA_ACTIVE;
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode DisableWifi(void)
+{
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (g_wifiStaStatus == WIFI_STA_NOT_ACTIVE) {
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_NOT_STARTED;
+    }
+
+    int hiRet;
+
+    hiRet = hi_wifi_sta_stop();
+    if (hiRet != HISI_OK) {
+        printf("[wifi_service]:DisableWifi failed to stop sta\n");
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_NOT_STARTED;
+    }
+
+    g_wifiStaStatus = WIFI_STA_NOT_ACTIVE;
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    return WIFI_SUCCESS;
+}
+
+int IsWifiActive(void)
+{
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    int ret = g_wifiStaStatus;
+
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return ret;
+}
+
+WifiErrorCode Scan(void)
+{
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (g_wifiStaStatus == WIFI_STA_NOT_ACTIVE) {
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_NOT_STARTED;
+    }
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (LockWifiEventLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    for (int i = 0; i < WIFI_MAX_EVENT_SIZE; i++) {
+        if (g_wifiEvents[i] == NULL) {
+            continue;
+        }
+        DispatchScanStateChangeEvent(NULL, g_wifiEvents[i], WIFI_STATE_NOT_AVALIABLE);
+    }
+    if (UnlockWifiEventLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    int hiRet;
+
+    hiRet = hi_wifi_sta_scan();
+    if (hiRet != HISI_OK) {
+        printf("[wifi_service]:Scan failed to start sta scan\n");
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    return WIFI_SUCCESS;
+}
+
+static hi_wifi_scan_type ScanTypeSwitch(WifiScanType type)
+{
+    hi_wifi_scan_type ret = HI_WIFI_BASIC_SCAN;
+
+    switch (type) {
+        case WIFI_FREQ_SCAN:
+            ret = HI_WIFI_CHANNEL_SCAN;
+            break;
+        case WIFI_SSID_SCAN:
+            ret = HI_WIFI_SSID_SCAN;
+            break;
+        case WIFI_BSSID_SCAN:
+            ret = HI_WIFI_BSSID_SCAN;
+            break;
+        default:
+            break;
+    }
+
+    return ret;
+}
+
+WifiErrorCode AdvanceScan(WifiScanParams *params)
+{
+    if (params == NULL) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (g_wifiStaStatus == WIFI_STA_NOT_ACTIVE) {
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+            return ERROR_WIFI_NOT_STARTED;
+    }
+
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (LockWifiEventLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    for (int i = 0; i < WIFI_MAX_EVENT_SIZE; i++) {
+        if (g_wifiEvents[i] == NULL) {
+            continue;
+        }
+        DispatchScanStateChangeEvent(NULL, g_wifiEvents[i], WIFI_STATE_NOT_AVALIABLE);
+    }
+    if (UnlockWifiEventLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    int hiRet;
+    int cpyErr;
+    hi_wifi_scan_params sp = {0};
+
+    cpyErr = memcpy_s(sp.ssid, sizeof(sp.ssid), params->ssid, params->ssidLen);
+    if (cpyErr != EOK) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    cpyErr = memcpy_s(sp.bssid, sizeof(sp.bssid), params->bssid, sizeof(params->bssid));
+    if (cpyErr != EOK) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    sp.ssid_len = params->ssidLen;
+    sp.scan_type = ScanTypeSwitch(params->scanType);
+    sp.channel = FrequencyToChannel(params->freqs);
+
+    hiRet = hi_wifi_sta_advance_scan(&sp);
+    if (hiRet != HISI_OK) {
+        printf("[wifi_service]:Advance Scan failed\n");
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode GetScanInfoList(WifiScanInfo* result, unsigned int* size)
+{
+    if (result == NULL || size == NULL || *size == 0) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    unsigned int num = WIFI_SCAN_HOTSPOT_LIMIT;
+
+    hi_wifi_ap_info *pstResults = malloc(sizeof(hi_wifi_ap_info) * WIFI_SCAN_HOTSPOT_LIMIT);
+    if (pstResults == NULL) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    int hiRet = hi_wifi_sta_scan_results(pstResults, &num);
+    if (hiRet != HISI_OK) {
+        printf("[wifi_service]:GetScanInfoList hi_wifi_sta_scan_results fail\n");
+        free(pstResults);
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (*size < num) {
+        free(pstResults);
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    int cpyErr;
+    for (unsigned int i = 0; i < num; i++) {
+        cpyErr = memcpy_s(result[i].ssid, WIFI_MAX_SSID_LEN, pstResults[i].ssid, HI_WIFI_MAX_SSID_LEN + 1);
+        if (cpyErr != EOK) {
+            free(pstResults);
+            printf("[wifi_service]:GetScanInfoList memcpy failed, err = %d\n", cpyErr);
+            return ERROR_WIFI_UNKNOWN;
+        }
+
+        cpyErr = memcpy_s(result[i].bssid, WIFI_MAC_LEN, pstResults[i].bssid, HI_WIFI_MAC_LEN);
+        if (cpyErr != EOK) {
+            free(pstResults);
+            printf("[wifi_service]:GetScanInfoList memcpy failed, err = %d\n", cpyErr);
+            return ERROR_WIFI_UNKNOWN;
+        }
+
+        result[i].securityType = HiSecToHoSec(pstResults[i].auth);
+        result[i].rssi = pstResults[i].rssi;
+        result[i].frequency = ChannelToFrequency(pstResults[i].channel);
+    }
+
+    free(pstResults);
+    *size = num;
+
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode AddDeviceConfig(const WifiDeviceConfig* config, int* result)
+{
+    if (config == NULL || result == NULL) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    int netId = WIFI_CONFIG_INVALID;
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    for (int i = 0; i < WIFI_MAX_CONFIG_SIZE; i++) {
+        if (g_wifiConfigs[i].netId != i) {
+            netId = i;
+            break;
+        }
+    }
+
+    if (netId == WIFI_CONFIG_INVALID) {
+        printf("[wifi_service]:AddDeviceConfig wifi config is full, delete one first\n");
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_BUSY;
+    }
+
+    int cpyErr = memcpy_s(&g_wifiConfigs[netId], sizeof(WifiDeviceConfig), config, sizeof(WifiDeviceConfig));
+    if (cpyErr != EOK) {
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        printf("[wifi_service]:AddDeviceConfig memcpy failed, err = %d\n", cpyErr);
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    g_wifiConfigs[netId].netId = netId;
+    if (WriteNetworkConfig((unsigned char *)&g_wifiConfigs[netId], sizeof(WifiDeviceConfig)) != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    *result = netId;
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode GetDeviceConfigs(WifiDeviceConfig* result, unsigned int* size)
+{
+    if (result == NULL || size == NULL) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    unsigned int retIndex = 0;
+
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (g_networkConfigReadFlag == false) {
+        g_networkConfigReadFlag = true;
+        if (ReadNetworkConfig((unsigned char *)&g_wifiConfigs[0], sizeof(WifiDeviceConfig)) != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        if (g_isNetworkConfigExist == WIFI_FILE_UNEXIST) {
+            g_wifiConfigs[0].netId = WIFI_CONFIG_INVALID;
+        }
+    }
+
+    for (int i = 0; i < WIFI_MAX_CONFIG_SIZE; i++) {
+        if (g_wifiConfigs[i].netId != i) {
+            continue;
+        }
+
+        int cpyErr = memcpy_s(&result[retIndex], sizeof(WifiDeviceConfig), &g_wifiConfigs[i], sizeof(WifiDeviceConfig));
+        if (cpyErr != EOK) {
+            if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+                return ERROR_WIFI_UNKNOWN;
+            }
+            printf("[wifi_service]:GetDeviceConfig memcpy failed, err = %d\n", cpyErr);
+            return ERROR_WIFI_UNKNOWN;
+        }
+
+        retIndex++;
+        if (*size < retIndex) {
+            if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+                return ERROR_WIFI_UNKNOWN;
+            }
+            return ERROR_WIFI_INVALID_ARGS;
+        }
+    }
+
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (retIndex == 0) {
+        return ERROR_WIFI_NOT_AVAILABLE;
+    }
+
+    *size = retIndex;
+    return WIFI_SUCCESS;
+}
+
+static WifiErrorCode StaConnect(unsigned int chan, hi_wifi_assoc_request *assocReq, int pskType)
+{
+    int hiRet = 0;
+    int lastState = g_connectState;
+
+    g_connectState = WIFI_STATE_NOT_AVALIABLE;
+    if (chan == 0) {
+        hiRet = hi_wifi_sta_connect(assocReq);
+    } else {
+        hi_wifi_fast_assoc_request fastReq = {0};
+        fastReq.channel = chan;
+        hiRet += memcpy_s(&fastReq.req, sizeof(hi_wifi_assoc_request), assocReq, sizeof(hi_wifi_assoc_request));
+        if (pskType == WIFI_PSK_TYPE_HEX) {
+            hiRet += memcpy_s(fastReq.req.key, sizeof(fastReq.req.key),
+                WIFI_DEFAULT_KEY_FOR_PSK, sizeof(WIFI_DEFAULT_KEY_FOR_PSK));
+            hiRet += memcpy_s(fastReq.psk, sizeof(fastReq.psk), assocReq->key, HI_WIFI_STA_PSK_LEN);
+            fastReq.psk_flag = HI_WIFI_WPA_PSK_USE_OUTER;
+        }
+        if (hiRet != EOK) {
+            printf("[wifi_service]:StaConnect memcpy failed, err = %d\n", hiRet);
+            g_connectState = lastState;
+            return ERROR_WIFI_UNKNOWN;
+        }
+        hiRet = hi_wifi_sta_fast_connect(&fastReq);
+        if (memset_s(&fastReq, sizeof(hi_wifi_fast_assoc_request), 0, sizeof(hi_wifi_fast_assoc_request)) != EOK) {
+            printf("[wifi_service]:StaConnect memset failed\n");
+        }
+    }
+    if (memset_s(assocReq, sizeof(hi_wifi_assoc_request), 0, sizeof(hi_wifi_assoc_request)) != EOK) {
+        printf("[wifi_service]:StaConnect memset failed\n");
+    }
+    if (hiRet != HISI_OK) {
+        g_connectState = lastState;
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode ConnectTo(int networkId)
+{
+    if (networkId >= WIFI_MAX_CONFIG_SIZE || networkId < 0) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (g_wifiConfigs[networkId].netId != networkId) {
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_NOT_AVAILABLE;
+    }
+
+    g_networkId = networkId;
+    hi_wifi_assoc_request assocReq = {0};
+    assocReq.auth = HoSecToHiSec(g_wifiConfigs[networkId].securityType);
+
+    int cpyErr = memcpy_s(assocReq.ssid, sizeof(assocReq.ssid),
+        g_wifiConfigs[networkId].ssid, sizeof(g_wifiConfigs[networkId].ssid));
+    cpyErr += memcpy_s(assocReq.key, sizeof(assocReq.key),
+        g_wifiConfigs[networkId].preSharedKey, sizeof(g_wifiConfigs[networkId].preSharedKey));
+    cpyErr += memcpy_s(assocReq.bssid, sizeof(assocReq.bssid),
+        g_wifiConfigs[networkId].bssid, sizeof(g_wifiConfigs[networkId].bssid));
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (cpyErr != EOK) {
+        printf("[wifi_service]:ConnectTo memcpy failed, err = %d\n", cpyErr);
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    unsigned int chan = FrequencyToChannel(g_wifiConfigs[networkId].freq);
+    if (LockWifiEventLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (StaConnect(chan, &assocReq, g_wifiConfigs[networkId].wapiPskType) != WIFI_SUCCESS) {
+        if (UnlockWifiEventLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (UnlockWifiEventLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode Disconnect(void)
+{
+    int hiRet = hi_wifi_sta_disconnect();
+    if (hiRet != HISI_OK) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode RemoveDevice(int networkId)
+{
+    if (networkId >= WIFI_MAX_CONFIG_SIZE || networkId < 0) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (memset_s(&g_wifiConfigs[networkId], sizeof(WifiDeviceConfig),
+        0, sizeof(WifiDeviceConfig)) != EOK) {
+        printf("[wifi_service]:removeDevice memset failed\n");
+    }
+    g_wifiConfigs[networkId].netId = WIFI_CONFIG_INVALID;
+
+    if (WriteNetworkConfig((unsigned char *)&g_wifiConfigs[networkId], sizeof(WifiDeviceConfig)) != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return WIFI_SUCCESS;
+}
+
+static int GetLocalWifiIp(int * const ip)
+{
+    int ret;
+    struct netif *netif_node = netif_find(WLAN_STA_NAME);
+    if (netif_node == NULL) {
+        printf("GetLocalWifiIp netif get fail\r\n");
+        return HISI_FAIL;
+    }
+
+    ip4_addr_t ipAddr;
+    ip4_addr_t netMask;
+    ip4_addr_t gateWay;
+
+    ret = netifapi_netif_get_addr(netif_node, &ipAddr, &netMask, &gateWay);
+    if (ret == 0) {
+        *ip = ip4_addr_get_u32(&ipAddr);
+        return HISI_OK;
+    }
+    return HISI_FAIL;
+}
+
+WifiErrorCode GetLinkedInfo(WifiLinkedInfo* result)
+{
+    if (result == NULL) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    hi_wifi_status connectStatus = {0};
+    int hiRet = hi_wifi_sta_get_connect_info(&connectStatus);
+    if (hiRet != HISI_OK) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    int cpyErr = memcpy_s(result->ssid, WIFI_MAX_SSID_LEN, connectStatus.ssid, HI_WIFI_MAX_SSID_LEN + 1);
+    if (cpyErr != EOK) {
+        printf("[wifi_service]:GetLinkedInfo memcpy failed, err = %d\n", cpyErr);
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    cpyErr = memcpy_s(result->bssid, WIFI_MAC_LEN, connectStatus.bssid, HI_WIFI_MAC_LEN);
+    if (cpyErr != EOK) {
+        printf("[wifi_service]:GetLinkedInfo memcpy failed, err = %d\n", cpyErr);
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    if (connectStatus.status == HI_WIFI_CONNECTED) {
+        result->connState = WIFI_CONNECTED;
+        result->rssi = hi_wifi_sta_get_ap_rssi();
+    } else {
+        result->connState = WIFI_DISCONNECTED;
+    }
+
+    if (GetLocalWifiIp(&(result->ipAddress)) != EOK) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    return WIFI_SUCCESS;
+}
+
+
+WifiErrorCode RegisterWifiEvent(WifiEvent* event)
+{
+    if (event == NULL) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    int emptySlot = WIFI_CONFIG_INVALID;
+
+    if (LockWifiEventLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    for (int i = 0; i < WIFI_MAX_EVENT_SIZE; i++) {
+        if (g_wifiEvents[i] == event) {
+            if (UnlockWifiEventLock() != WIFI_SUCCESS) {
+                return ERROR_WIFI_UNKNOWN;
+            }
+            return ERROR_WIFI_INVALID_ARGS;
+        }
+
+        if (g_wifiEvents[i] != NULL) {
+            continue;
+        }
+
+        emptySlot = i;
+        break;
+    }
+
+    if (emptySlot == WIFI_CONFIG_INVALID) {
+        if (UnlockWifiEventLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_BUSY;
+    }
+
+    g_wifiEvents[emptySlot] = event;
+    if (UnlockWifiEventLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    RegisterHisiCallback();
+
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode UnRegisterWifiEvent(const WifiEvent* event)
+{
+    if (event == NULL) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    if (LockWifiEventLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    for (int i = 0; i < WIFI_MAX_EVENT_SIZE; i++) {
+        if (g_wifiEvents[i] != event) {
+            continue;
+        }
+
+        g_wifiEvents[i] = 0;
+
+        if (UnlockWifiEventLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return WIFI_SUCCESS;
+    }
+
+    if (UnlockWifiEventLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return ERROR_WIFI_UNKNOWN;
+}
+
+WifiErrorCode GetDeviceMacAddress(unsigned char* result)
+{
+    if (result == NULL) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    int hiRet = hi_wifi_get_macaddr((char*)result, WIFI_MAC_LEN);
+    if (hiRet != HISI_OK) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return WIFI_SUCCESS;
+}

+ 174 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiservice/source/wifi_device_util.c

@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wifi_device_util.h"
+
+#include <stdio.h>
+
+#include "cmsis_os.h"
+#include "common.h"
+#include "ohos_init.h"
+
+#include "wifi_hotspot_config.h"
+
+#define WIFI_WAIT_FOREVER 0xFFFFFFFF
+#define CHANNEL_80211B_ONLY 14
+#define FREQ_OF_CHANNEL_1 2412
+#define FREQ_OF_CHANNEL_80211B_ONLY 2484
+#define WIFI_MIN_CHANNEL 1
+#define WIFI_FREQ_INTERVAL 5
+
+static MutexId g_wifiGlobalLock = NULL;
+static MutexId g_wifiEventLock = NULL;
+
+WifiSecurityType HiSecToHoSec(hi_wifi_auth_mode mode)
+{
+    switch (mode) {
+        case HI_WIFI_SECURITY_OPEN:
+            return WIFI_SEC_TYPE_OPEN;
+        case HI_WIFI_SECURITY_WEP:
+            return WIFI_SEC_TYPE_WEP;
+        case HI_WIFI_SECURITY_WPAPSK_WPA2PSK_MIX:
+            return WIFI_SEC_TYPE_PSK;
+        case HI_WIFI_SECURITY_WPA3_WPA2_PSK_MIX:
+            return WIFI_SEC_TYPE_SAE;
+        default:
+            return WIFI_SEC_TYPE_INVALID;
+    }
+}
+
+hi_wifi_auth_mode HoSecToHiSec(WifiSecurityType type)
+{
+    switch (type) {
+        case WIFI_SEC_TYPE_OPEN:
+            return HI_WIFI_SECURITY_OPEN;
+        case WIFI_SEC_TYPE_WEP:
+            return HI_WIFI_SECURITY_WEP;
+        case WIFI_SEC_TYPE_PSK:
+            return HI_WIFI_SECURITY_WPAPSK_WPA2PSK_MIX;
+        case WIFI_SEC_TYPE_SAE:
+            return HI_WIFI_SECURITY_WPA3_WPA2_PSK_MIX;
+        default:
+            return HI_WIFI_SECURITY_UNKNOWN;
+    }
+}
+
+static void InitWifiGlobalLock(void)
+{
+    if (g_wifiGlobalLock == NULL) {
+        osMutexAttr_t globalMutexAttr = {
+            "WifiGloablLock",
+            osMutexRecursive | osMutexPrioInherit,
+            NULL,
+            0U
+        };
+        g_wifiGlobalLock = osMutexNew(&globalMutexAttr);
+    }
+    if (g_wifiEventLock == NULL) {
+        osMutexAttr_t eventMutexAttr = {
+            "WifiEventLock",
+            osMutexRecursive | osMutexPrioInherit,
+            NULL,
+            0U
+        };
+        g_wifiEventLock = osMutexNew(&eventMutexAttr);
+    }
+}
+
+WifiErrorCode LockWifiGlobalLock(void)
+{
+    if (g_wifiGlobalLock == NULL) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    osStatus_t ret = osMutexAcquire(g_wifiGlobalLock, WIFI_WAIT_FOREVER);
+    if (ret != osOK) {
+        printf("[wifi_service] osMutexAcquire failed \n");
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode UnlockWifiGlobalLock(void)
+{
+    if (g_wifiGlobalLock == NULL) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    osStatus_t ret = osMutexRelease(g_wifiGlobalLock);
+    if (ret != osOK) {
+        printf("[wifi_service] osMutexUnlock failed \n");
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode LockWifiEventLock(void)
+{
+    if (g_wifiEventLock == NULL) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    osStatus_t ret = osMutexAcquire(g_wifiEventLock, WIFI_WAIT_FOREVER);
+    if (ret != osOK) {
+        printf("[wifi_service] osMutexAcquire event failed \n");
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode UnlockWifiEventLock(void)
+{
+    if (g_wifiEventLock == NULL) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    osStatus_t ret = osMutexRelease(g_wifiEventLock);
+    if (ret != osOK) {
+        printf("[wifi_service] osMutexUnlock event failed \n");
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    return WIFI_SUCCESS;
+}
+
+unsigned int ChannelToFrequency(unsigned int channel)
+{
+    if (channel <= 0) {
+        return 0;
+    }
+    if (channel == CHANNEL_80211B_ONLY) {
+        return FREQ_OF_CHANNEL_80211B_ONLY;
+    }
+    return (((channel - WIFI_MIN_CHANNEL) * WIFI_FREQ_INTERVAL) + FREQ_OF_CHANNEL_1);
+}
+
+unsigned int FrequencyToChannel(unsigned int frequency)
+{
+    if (frequency == FREQ_OF_CHANNEL_80211B_ONLY) {
+        return CHANNEL_80211B_ONLY;
+    }
+
+    if (frequency < FREQ_OF_CHANNEL_1) {
+        return 0;
+    }
+
+    return (frequency - FREQ_OF_CHANNEL_1) / WIFI_FREQ_INTERVAL + WIFI_MIN_CHANNEL;
+}
+
+CORE_INIT(InitWifiGlobalLock);

+ 96 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiservice/source/wifi_device_util.h

@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _WIFI_DEVICE_UTIL_H
+#define _WIFI_DEVICE_UTIL_H
+
+#include "hi_wifi_api.h"
+
+#include "wifi_device.h"
+#include "wifi_device_config.h"
+#include "wifi_error_code.h"
+
+/**
+ * @brief convert os security type to hisi security type
+ *
+ * @param type [in] os security type.
+ *
+ * @return hisi security type.
+ */
+hi_wifi_auth_mode HoSecToHiSec(WifiSecurityType type);
+
+/**
+ * @brief convert hisi security type to os security type
+ *
+ * @param type [in] hisi security type.
+ *
+ * @return os security type.
+ */
+WifiSecurityType HiSecToHoSec(hi_wifi_auth_mode mode);
+
+/**
+ * @brief get hotspot channel
+ *
+ * @return current channel.
+ */
+int GetHotspotChannel(void);
+
+/**
+ * @brief get hotspot interface name
+ *
+ * @param result [out] hotspot interface name.
+ * @param size   [in] result buffer size, must bigger than WIFI_IFNAME_MAX_SIZE + 1.
+ *
+ * @return WifiErrorCode.
+ */
+WifiErrorCode GetHotspotInterfaceName(char* result, int size);
+
+/**
+ * @brief lock wifi global lock
+ *
+ * @return WifiErrorCode.
+ */
+WifiErrorCode LockWifiGlobalLock(void);
+
+/**
+ * @brief unlock wifi global lock
+ *
+ * @return WifiErrorCode.
+ */
+WifiErrorCode UnlockWifiGlobalLock(void);
+
+/**
+ * @brief lock wifi event lock
+ *
+ * @return WifiErrorCode.
+ */
+WifiErrorCode LockWifiEventLock(void);
+
+/**
+ * @brief unlock wifi event lock
+ *
+ * @return WifiErrorCode.
+ */
+WifiErrorCode UnlockWifiEventLock(void);
+
+/**
+ * @brief convert channel to frequency in 2G
+ *
+ * @return frequency.
+ */
+unsigned int ChannelToFrequency(unsigned int channel);
+
+unsigned int FrequencyToChannel(unsigned int frequency);
+#endif // _WIFI_DEVICE_UTIL_H

+ 438 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/communication/wifi_lite/wifiservice/source/wifi_hotspot.c

@@ -0,0 +1,438 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "wifi_hotspot.h"
+#include <securec.h>
+#include "hi_wifi_api.h"
+#include "lwip/netifapi.h"
+#include "wifi_device_util.h"
+
+#define RSSI_LEVEL_4_2_G (-65)
+#define RSSI_LEVEL_3_2_G (-75)
+#define RSSI_LEVEL_2_2_G (-82)
+#define RSSI_LEVEL_1_2_G (-88)
+
+#define RSSI_LEVEL_4_5_G (-65)
+#define RSSI_LEVEL_3_5_G (-72)
+#define RSSI_LEVEL_2_5_G (-79)
+#define RSSI_LEVEL_1_5_G (-85)
+
+#define IP_AP_ADDR0 192
+#define IP_AP_ADDR1 168
+#define IP_AP_ADDR2 5
+#define IP_AP_ADDR3 1
+#define GW_AP_ADDR0 192
+#define GW_AP_ADDR1 168
+#define GW_AP_ADDR2 5
+#define GW_AP_ADDR3 1
+#define NETMSK_ADDR0 255
+#define NETMSK_ADDR1 255
+#define NETMSK_ADDR2 255
+#define NETMSK_ADDR3 0
+
+#define WIFI_TPC_MAX_POWER 20
+#define WIFI_TPC_ID 35
+#define WIFI_TPC_LEN 2
+#define WLAN_AP_NAME "ap0"
+
+static int g_wifiApStatus = WIFI_HOTSPOT_NOT_ACTIVE;
+static HotspotConfig g_wifiApConfig = {0};
+static char g_wifiIfName[WIFI_IFNAME_MAX_SIZE + 1] = {0};
+typedef struct {
+    unsigned char id;
+    unsigned char len;
+    signed char power;
+    unsigned char margin;
+} TpcElement;
+
+static WifiErrorCode SetHotspotIpConfig(void)
+{
+    struct netif *netif = NULL;
+    netif = netif_find(WLAN_AP_NAME);
+    if (netif == NULL) {
+        printf("get netif failed\r\n");
+        return ERROR_WIFI_UNKNOWN;
+    }
+    ip4_addr_t ipAddr;
+    ip4_addr_t netMask;
+    ip4_addr_t gw;
+
+    IP4_ADDR(&ipAddr, IP_AP_ADDR0, IP_AP_ADDR1, IP_AP_ADDR2, IP_AP_ADDR3);
+    IP4_ADDR(&netMask, NETMSK_ADDR0, NETMSK_ADDR1, NETMSK_ADDR2, NETMSK_ADDR3);
+    IP4_ADDR(&gw, GW_AP_ADDR0, GW_AP_ADDR1, GW_AP_ADDR2, GW_AP_ADDR3);
+
+    netifapi_netif_set_addr(netif, &ipAddr, &netMask, &gw);
+
+    if (netifapi_dhcps_start(netif, 0, 0) != 0) {
+        printf("dhcps shell cmd excute fail!\r\n");
+        (void)hi_wifi_softap_stop();
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode EnableHotspot(void)
+{
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (g_wifiApStatus == WIFI_HOTSPOT_ACTIVE) {
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_BUSY;
+    }
+
+    hi_wifi_softap_config hapdConf = {0};
+
+    hapdConf.channel_num = HOTSPOT_DEFAULT_CHANNEL;
+    if (g_wifiApConfig.channelNum) {
+        hapdConf.channel_num = g_wifiApConfig.channelNum;
+    }
+    hapdConf.authmode = HoSecToHiSec(g_wifiApConfig.securityType);
+
+    int cpyErr = memcpy_s(hapdConf.ssid, WIFI_MAX_SSID_LEN, g_wifiApConfig.ssid, HI_WIFI_MAX_SSID_LEN + 1);
+    cpyErr += memcpy_s(hapdConf.key, WIFI_MAX_KEY_LEN, g_wifiApConfig.preSharedKey, HI_WIFI_MAX_KEY_LEN + 1);
+    if (cpyErr != EOK) {
+        printf("[wifi_service]:EnableHotspot memcpy fail, err = %d\n", cpyErr);
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    int len = sizeof(g_wifiIfName);
+    int hiRet = hi_wifi_softap_start(&hapdConf, g_wifiIfName, &len);
+    if (hiRet != HISI_OK) {
+        printf("[wifi_service]:EnableHotspot softap start fail, err = %d\n", hiRet);
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_NOT_STARTED;
+    }
+    cpyErr = memset_s(&hapdConf, sizeof(hi_wifi_softap_config), 0, sizeof(hi_wifi_softap_config));
+    if (cpyErr != EOK) {
+        printf("[wifi_service]:EnableHotspot memset fail, err = %d\n", cpyErr);
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    g_wifiApStatus = WIFI_HOTSPOT_ACTIVE;
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    // gdtr_TODO:
+    // if (SetHotspotIpConfig() != WIFI_SUCCESS) {
+    //     return ERROR_WIFI_UNKNOWN;
+    // }
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode DisableHotspot(void)
+{
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (g_wifiApStatus == WIFI_HOTSPOT_NOT_ACTIVE) {
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_NOT_STARTED;
+    }
+
+    int hiRet = hi_wifi_softap_stop();
+    if (hiRet != HISI_OK) {
+        printf("[wifi_service]:DisableHotspot failed to stop softap, err = %d\n", hiRet);
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_NOT_STARTED;
+    }
+
+    g_wifiApStatus = WIFI_HOTSPOT_NOT_ACTIVE;
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode SetHotspotConfig(const HotspotConfig* config)
+{
+    if (config == NULL) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    int cpyErr = memcpy_s(&g_wifiApConfig, sizeof(HotspotConfig), config, sizeof(HotspotConfig));
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (cpyErr != EOK) {
+        printf("[wifi_service]:SetHotspotConfig memcpy fail, err = %d\n", cpyErr);
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode GetHotspotConfig(HotspotConfig* result)
+{
+    if (result == NULL) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    int cpyErr =  memcpy_s(result, sizeof(HotspotConfig), &g_wifiApConfig, sizeof(HotspotConfig));
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (cpyErr != EOK) {
+        printf("[wifi_service]:SetHotspotConfig memcpy fail, err = %d\n", cpyErr);
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return WIFI_SUCCESS;
+}
+
+int IsHotspotActive(void)
+{
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    int ret = g_wifiApStatus;
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+
+    return ret;
+}
+
+static int GetPeerSTAWifiIp(const unsigned char *macAddress, int macLen, unsigned int * const ip)
+{
+    int ret;
+    ip4_addr_t clientIP;
+    struct netif *netif_node = netif_find(WLAN_AP_NAME);
+    if (netif_node == NULL) {
+        printf("GetPeerSTAWifiIp netif get fail\r\n");
+        return HISI_FAIL;
+    }
+
+    ret = netifapi_dhcps_get_client_ip(netif_node, macAddress, macLen, &clientIP);
+    if (ret == 0) {
+        *ip = ntohl(ip4_addr_get_u32(&clientIP));
+        return HISI_OK;
+    }
+
+    return HISI_FAIL;
+}
+
+WifiErrorCode GetStationList(StationInfo* result, unsigned int* size)
+{
+    if (result == NULL || size == NULL || *size == 0) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    hi_wifi_ap_sta_info staList[WIFI_MAX_STA_NUM] = {0};
+    unsigned int staNum = WIFI_MAX_STA_NUM;
+
+    int hiRet = hi_wifi_softap_get_connected_sta(staList, &staNum);
+    if (hiRet != HISI_OK) {
+        printf("[wifi_service]:GetStationList get connected sta failed, err = %d\r\n", hiRet);
+        return ERROR_WIFI_NOT_AVAILABLE;
+    }
+
+    if (*size < staNum) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    int cpyErr;
+    for (unsigned int i = 0; i < staNum; i++) {
+        cpyErr = memcpy_s(result[i].macAddress, WIFI_MAC_LEN, staList[i].mac, HI_WIFI_MAC_LEN);
+        if (cpyErr != EOK) {
+            printf("[wifi_service]:GetStationList memcpy fail, err = %d\r\n", cpyErr);
+            return ERROR_WIFI_UNKNOWN;
+        }
+        result[i].name = NULL;
+
+#if LWIP_NETIFAPI_DHCPS_IP
+        int ret = GetPeerSTAWifiIp(staList[i].mac, WIFI_MAC_LEN, &(result[i].ipAddress));
+        if (ret != HISI_OK) {
+            printf("[wifi_service]:GetPeerSTAWifiIp  fail, err = %d\r\n", ret);
+            return ERROR_WIFI_UNKNOWN;
+        }
+#endif
+    }
+    *size = staNum;
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode SetBand(int band)
+{
+    if (band != HOTSPOT_BAND_TYPE_2G) {
+        return ERROR_WIFI_NOT_SUPPORTED;
+    }
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    g_wifiApConfig.band = band;
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode GetBand(int* result)
+{
+    if (result == NULL) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (g_wifiApConfig.band == 0) {
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_NOT_AVAILABLE;
+    }
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    *result = HOTSPOT_BAND_TYPE_2G;
+    return WIFI_SUCCESS;
+}
+
+int GetSignalLevel(int rssi, int band)
+{
+    if (band == HOTSPOT_BAND_TYPE_2G) {
+        if (rssi >= RSSI_LEVEL_4_2_G) {
+            return RSSI_LEVEL_4;
+        }
+        if (rssi >= RSSI_LEVEL_3_2_G) {
+            return RSSI_LEVEL_3;
+        }
+        if (rssi >= RSSI_LEVEL_2_2_G) {
+            return RSSI_LEVEL_2;
+        }
+        if (rssi >= RSSI_LEVEL_1_2_G) {
+            return RSSI_LEVEL_1;
+        }
+    }
+
+    if (band == HOTSPOT_BAND_TYPE_5G) {
+        if (rssi >= RSSI_LEVEL_4_5_G) {
+            return RSSI_LEVEL_4;
+        }
+        if (rssi >= RSSI_LEVEL_3_5_G) {
+            return RSSI_LEVEL_3;
+        }
+        if (rssi >= RSSI_LEVEL_2_5_G) {
+            return RSSI_LEVEL_2;
+        }
+        if (rssi >= RSSI_LEVEL_1_5_G) {
+            return RSSI_LEVEL_1;
+        }
+    }
+
+    return ERROR_WIFI_INVALID_ARGS;
+}
+
+int GetHotspotChannel(void)
+{
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (g_wifiApStatus == WIFI_HOTSPOT_NOT_ACTIVE) {
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_NOT_STARTED;
+    }
+
+    int channel = hi_wifi_get_channel(g_wifiIfName, WIFI_IFNAME_MAX_SIZE + 1);
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (channel == HI_WIFI_INVALID_CHANNEL) {
+        return ERROR_WIFI_INVALID_ARGS;
+    }
+
+    return channel;
+}
+
+WifiErrorCode GetHotspotInterfaceName(char* result, int size)
+{
+    if (LockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (g_wifiApStatus == WIFI_HOTSPOT_NOT_ACTIVE) {
+        if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+            return ERROR_WIFI_UNKNOWN;
+        }
+        return ERROR_WIFI_NOT_STARTED;
+    }
+
+    int cpyErr = memcpy_s(result, size, g_wifiIfName, WIFI_IFNAME_MAX_SIZE + 1);
+    if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    if (cpyErr != EOK) {
+        printf("[wifi_service]:getifname memcpy fail, err = %d\n", cpyErr);
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode DisassociateSta(unsigned char* mac, int macLen)
+{
+    int ret = hi_wifi_softap_deauth_sta(mac, macLen);
+    if (ret != HISI_OK) {
+        return ERROR_WIFI_UNKNOWN;
+    }
+    return WIFI_SUCCESS;
+}
+
+WifiErrorCode AddTxPowerInfo(int power)
+{
+    TpcElement tpc = { WIFI_TPC_ID, WIFI_TPC_LEN, 0, 0 };
+    if (power > WIFI_TPC_MAX_POWER) {
+        printf("[wifi_service]:Invalid TPC Power (%d)\n", power);
+        return ERROR_WIFI_INVALID_ARGS;
+    } else {
+        tpc.power = power;
+    }
+
+    int ret = hi_wifi_add_usr_app_ie(HI_WIFI_IFTYPE_AP, HI_WIFI_FRAME_TYPE_BEACON, HI_WIFI_USR_IE_TYPE_DEFAULT,
+                                     (const unsigned char *)&tpc, sizeof(tpc));
+    if (ret != HISI_OK) {
+        printf("[wifi_service]:Wifi Add Beacon IE Fail (%d)\n", ret);
+        (void)hi_wifi_delete_usr_app_ie(HI_WIFI_IFTYPE_AP, HI_WIFI_FRAME_TYPE_BEACON, HI_WIFI_USR_IE_TYPE_DEFAULT);
+        return ret;
+    }
+
+    ret = hi_wifi_add_usr_app_ie(HI_WIFI_IFTYPE_AP, HI_WIFI_FRAME_TYPE_PROBE_RSP, HI_WIFI_USR_IE_TYPE_DEFAULT,
+                                 (const unsigned char *)&tpc, sizeof(tpc));
+    if (ret != HISI_OK) {
+        printf("Wifi Add ProbResp IE Fail (%d)\n", ret);
+        (void)hi_wifi_delete_usr_app_ie(HI_WIFI_IFTYPE_AP, HI_WIFI_FRAME_TYPE_PROBE_RSP, HI_WIFI_USR_IE_TYPE_DEFAULT);
+        return ret;
+    }
+    return WIFI_SUCCESS;
+}

+ 37 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/BUILD.gn

@@ -0,0 +1,37 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+static_library("hal_iothardware") {
+  if (board_name == "hi3861_l0") {
+    sources = [
+      "hal_iot_flash.c",
+      "hal_iot_gpio.c",
+      "hal_iot_i2c.c",
+      "hal_iot_pwm.c",
+      "hal_iot_uart.c",
+      "hal_iot_watchdog.c",
+      "hal_lowpower.c",
+      "hal_reset.c",
+      "hal_iot_gpio_ex.c",
+      "hal_iot_adc.c",
+      "hal_iot_i2c_ex.c",
+      "hal_iot_spi.c",
+    ]
+    include_dirs = [
+      "//utils/native/lite/include",
+      "//base/iot_hardware/peripheral/interfaces/kits",
+      "//device/bossay/hi3861_l0/sdk_liteos/include",
+      "//device/bossay/hi3861_l0/iot_hardware_hals/include",
+    ]
+  }
+}

+ 28 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_adc.c

@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "hi_adc.h"
+#include "iot_adc.h"
+#include "iot_errno.h"
+
+unsigned int IoTAdcRead(unsigned int channel, unsigned short *data, IotAdcEquModelSel equModel,
+                        IotAdcCurBais curBais, unsigned short rstCnt)
+{
+    if (channel > HI_ADC_CHANNEL_BUTT) {
+        return IOT_FAILURE;
+    }
+    return hi_adc_read((hi_adc_channel_index)channel, (hi_u16*)data, (hi_adc_equ_model_sel)equModel,
+                       (hi_adc_cur_bais)curBais, (hi_u16)rstCnt);
+}

+ 44 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_flash.c

@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "iot_errno.h"
+#include "iot_flash.h"
+#include "hi_flash.h"
+
+unsigned int IoTFlashRead(unsigned int flashOffset, unsigned int size, unsigned char *ramData)
+{
+    return hi_flash_read(flashOffset, size, ramData);
+}
+
+unsigned int IoTFlashWrite(unsigned int flashOffset, unsigned int size,
+                           const unsigned char *ramData, unsigned char doErase)
+{
+    return hi_flash_write(flashOffset, size, ramData, doErase);
+}
+
+unsigned int IoTFlashErase(unsigned int flashOffset, unsigned int size)
+{
+    return hi_flash_erase(flashOffset, size);
+}
+
+unsigned int IoTFlashInit(void)
+{
+    return hi_flash_init();
+}
+
+unsigned int IoTFlashDeinit(void)
+{
+    return hi_flash_deinit();
+}

+ 113 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_gpio.c

@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "iot_errno.h"
+#include "iot_gpio.h"
+#include "hi_gpio.h"
+
+
+#define GPIO_PIN_INIT    1
+#define GPIO_PIN_UNINIT  0
+
+static unsigned char g_gpioMap[HI_GPIO_IDX_MAX] = {0};
+static unsigned char g_gpioInitNum = 0;
+
+unsigned int IoTGpioInit(unsigned int id)
+{
+    if (id >= HI_GPIO_IDX_MAX) {
+        return IOT_FAILURE;
+    }
+
+    if (g_gpioInitNum == 0) {
+        (void)hi_gpio_init();
+    }
+
+    if (g_gpioMap[id] == GPIO_PIN_INIT) {
+        return IOT_FAILURE;
+    } else {
+        g_gpioMap[id] = GPIO_PIN_INIT;
+        g_gpioInitNum++;
+    }
+
+    return IOT_SUCCESS;
+}
+
+unsigned int IoTGpioSetDir(unsigned int id, IotGpioDir dir)
+{
+    return hi_gpio_set_dir((hi_gpio_idx)id, (hi_gpio_dir)dir);
+}
+
+unsigned int IoTGpioGetDir(unsigned int id, IotGpioDir *dir)
+{
+    return hi_gpio_get_dir((hi_gpio_idx)id, (hi_gpio_dir *)dir);
+}
+
+unsigned int IoTGpioSetOutputVal(unsigned int id, IotGpioValue val)
+{
+    return hi_gpio_set_ouput_val((hi_gpio_idx)id, (hi_gpio_value)val);
+}
+
+unsigned int IoTGpioGetOutputVal(unsigned int id, IotGpioValue *val)
+{
+    return hi_gpio_get_output_val((hi_gpio_idx)id, (hi_gpio_value *)val);
+}
+
+unsigned int IoTGpioGetInputVal(unsigned int id, IotGpioValue *val)
+{
+    return hi_gpio_get_input_val((hi_gpio_idx)id, (hi_gpio_value *)val);
+}
+
+unsigned int IoTGpioRegisterIsrFunc(unsigned int id, IotGpioIntType intType, IotGpioIntPolarity intPolarity,
+                                    GpioIsrCallbackFunc func, char *arg)
+{
+    return hi_gpio_register_isr_function((hi_gpio_idx)id, (hi_gpio_int_type)intType,
+                                         (hi_gpio_int_polarity)intPolarity, (gpio_isr_callback)func, arg);
+}
+
+unsigned int IoTGpioUnregisterIsrFunc(unsigned int id)
+{
+    return hi_gpio_unregister_isr_function((hi_gpio_idx)id);
+}
+
+unsigned int IoTGpioSetIsrMask(unsigned int id, unsigned char mask)
+{
+    return hi_gpio_set_isr_mask((hi_gpio_idx)id, (hi_bool)mask);
+}
+
+unsigned int IoTGpioSetIsrMode(unsigned int id, IotGpioIntType intType, IotGpioIntPolarity intPolarity)
+{
+    return hi_gpio_set_isr_mode((hi_gpio_idx)id, (hi_gpio_int_type)intType, (hi_gpio_int_polarity)intPolarity);
+}
+
+unsigned int IoTGpioDeinit(unsigned int id)
+{
+    if (id >= HI_GPIO_IDX_MAX) {
+        return IOT_FAILURE;
+    }
+
+    if (g_gpioMap[id] == GPIO_PIN_INIT) {
+        g_gpioInitNum--;
+        g_gpioMap[id] = GPIO_PIN_UNINIT;
+    } else {
+        return IOT_FAILURE;
+    }
+
+    if (g_gpioInitNum == 0) {
+        return hi_gpio_deinit();
+    } else {
+        return IOT_SUCCESS;
+    }
+}
+

+ 35 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_gpio_ex.c

@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "iot_errno.h"
+#include "iot_gpio_ex.h"
+#include "hi_gpio.h"
+#include "hi_io.h"
+
+unsigned int IoTGpioSetPull(unsigned int id, IotGpioPull val)
+{
+    if (id >= HI_GPIO_IDX_MAX) {
+        return IOT_FAILURE;
+    }
+    return hi_io_set_pull((hi_io_name)id, (hi_io_pull)val);
+}
+
+unsigned int IoTGpioSetFunc(unsigned int id, unsigned char val)
+{
+    if (id >= HI_GPIO_IDX_MAX) {
+        return IOT_FAILURE;
+    }
+    return hi_io_set_func((hi_io_name)id, val);
+}

+ 55 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_i2c.c

@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "iot_errno.h"
+#include "iot_i2c.h"
+#include "hi_i2c.h"
+
+unsigned int IoTI2cWrite(unsigned int id, unsigned short deviceAddr, const unsigned char *data, unsigned int dataLen)
+{
+    hi_i2c_data i2cData;
+    i2cData.receive_buf = NULL;
+    i2cData.receive_len = 0;
+    i2cData.send_buf = data;
+    i2cData.send_len = dataLen;
+
+    return hi_i2c_write((hi_i2c_idx)id, deviceAddr, &i2cData);
+}
+
+unsigned int IoTI2cRead(unsigned int id, unsigned short deviceAddr, unsigned char *data, unsigned int dataLen)
+{
+    hi_i2c_data i2cData;
+    i2cData.receive_buf = data;
+    i2cData.receive_len = dataLen;
+    i2cData.send_buf = NULL;
+    i2cData.send_len = 0;
+
+    return hi_i2c_read((hi_i2c_idx)id, deviceAddr, &i2cData);
+}
+
+unsigned int IoTI2cInit(unsigned int id, unsigned int baudrate)
+{
+    return hi_i2c_init((hi_i2c_idx)id, baudrate);
+}
+
+unsigned int IoTI2cDeinit(unsigned int id)
+{
+    return hi_i2c_deinit((hi_i2c_idx)id);
+}
+
+unsigned int IoTI2cSetBaudrate(unsigned int id, unsigned int baudrate)
+{
+    return hi_i2c_set_baudrate((hi_i2c_idx)id, baudrate);
+}

+ 23 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_i2c_ex.c

@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "hi_i2c.h"
+#include "iot_i2c_ex.h"
+
+
+unsigned int IoTI2cWriteread(unsigned int id, unsigned short deviceAddr, const IotI2cData *i2cData)
+{
+    return hi_i2c_writeread((hi_i2c_idx)id, deviceAddr, (const hi_i2c_data *)i2cData);
+}

+ 63 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_pwm.c

@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "iot_errno.h"
+#include "iot_pwm.h"
+#include "hi_pwm.h"
+#include "hi_errno.h"
+
+#define CLK_160M 160000000
+#define DUTY_MIN 0
+#define DUTY_MAX 100
+#define SHORT_MAX 0xFFFF
+
+unsigned int IoTPwmInit(unsigned int port)
+{
+    if (hi_pwm_set_clock(PWM_CLK_160M) != HI_ERR_SUCCESS) {
+        return IOT_FAILURE;
+    }
+    return hi_pwm_init((hi_pwm_port)port);
+}
+
+unsigned int IoTPwmDeinit(unsigned int port)
+{
+    return hi_pwm_deinit((hi_pwm_port)port);
+}
+
+unsigned int IoTPwmStart(unsigned int port, unsigned short duty, unsigned int freq)
+{
+    unsigned short hiDuty;
+    unsigned short hiFreq;
+
+    if ((freq == 0) || (duty >= DUTY_MAX) || (duty == DUTY_MIN)) {
+        return IOT_FAILURE;
+    }
+
+    if ((CLK_160M / freq) > SHORT_MAX) {
+        return IOT_FAILURE;
+    }
+
+    hiFreq = (unsigned short)(CLK_160M / freq);
+    hiDuty = (duty * hiFreq) / DUTY_MAX;
+
+    return hi_pwm_start((hi_pwm_port)port, hiDuty, hiFreq);
+}
+
+unsigned int IoTPwmStop(unsigned int port)
+{
+    return hi_pwm_stop((hi_pwm_port)port);
+}
+

+ 84 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_spi.c

@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "iot_spi.h"
+
+#include <stdio.h>
+
+#include "hi_spi.h"
+
+unsigned int IoTSpiSlaveWrite(IotSpiIdx spiId, char *writeData, unsigned int byteLen, unsigned int timeOutMs)
+{
+    return hi_spi_slave_write((hi_spi_idx)spiId, writeData, byteLen, timeOutMs);
+}
+
+unsigned int IoTSpiSlaveRead(IotSpiIdx spiId, char *readData, unsigned int byteLen, unsigned int timeOutMs)
+{
+    return hi_spi_slave_read((hi_spi_idx)spiId, readData, byteLen, timeOutMs);
+}
+
+unsigned int IoTSpiHostWrite(IotSpiIdx spiId, char *writeData, unsigned int byteLen)
+{
+    return hi_spi_host_write((hi_spi_idx)spiId, writeData, byteLen);
+}
+
+unsigned int IoTSpiHostRead(IotSpiIdx spiId, char *readData, unsigned int byteLen)
+{
+    return hi_spi_host_read((hi_spi_idx)spiId, readData, byteLen);
+}
+
+unsigned int IoTSpiHostWriteread(IotSpiIdx spiId, char *writeData, char *readData, unsigned int byteLen)
+{
+    return hi_spi_host_writeread((hi_spi_idx)spiId, writeData, readData, byteLen);
+}
+
+unsigned int IoTSpiSetBasicInfo(IotSpiIdx spiId, const IotSpiCfgBasicInfo *param)
+{
+    return hi_spi_set_basic_info((hi_spi_idx)spiId, (const hi_spi_cfg_basic_info *)param);
+}
+
+unsigned int IoTSpiInit(IotSpiIdx spiId, IotSpiCfgInitParam initParam,
+                        const IotSpiCfgBasicInfo *param)
+{
+    hi_spi_cfg_init_param hiInitParam;
+    hiInitParam.is_slave = initParam.isSlave;
+    hiInitParam.pad = initParam.pad;
+    return hi_spi_init((hi_spi_idx)spiId, hiInitParam, (const hi_spi_cfg_basic_info *)param);
+}
+
+unsigned int IoTSpiDeinit(IotSpiIdx spiId)
+{
+    return hi_spi_deinit((hi_spi_idx)spiId);
+}
+
+unsigned int IoTSpiSetIrqMode(IotSpiIdx spiId, unsigned char irqEn)
+{
+    return hi_spi_set_irq_mode((hi_spi_idx)spiId, irqEn);
+}
+
+unsigned int IoTSpiSetDmaMode(IotSpiIdx spiId, unsigned char dmaEn)
+{
+    return hi_spi_set_dma_mode((hi_spi_idx)spiId, dmaEn);
+}
+
+unsigned int IoTSpiRegisterUsrFunc(IotSpiIdx spiId, SpiIsrFunc prepareF, SpiIsrFunc restoreF)
+{
+    return hi_spi_register_usr_func((hi_spi_idx)spiId, prepareF, restoreF);
+}
+
+unsigned int IoTSpiSetLoopBackMode(IotSpiIdx spiId, unsigned char lbEn)
+{
+    return hi_spi_set_loop_back_mode((hi_spi_idx)spiId, lbEn);
+}

+ 68 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_uart.c

@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "iot_errno.h"
+#include "iot_uart.h"
+#include "hi_uart.h"
+
+unsigned int IoTUartInit(unsigned int id, const IotUartAttribute *param)
+{
+    hi_uart_attribute attr = {0};
+    hi_uart_extra_attr extraAttr = {0};
+
+    if (NULL == param) {
+        return IOT_FAILURE;
+    }
+
+    attr.baud_rate = param->baudRate;
+    attr.data_bits = param->dataBits;
+    attr.pad = param->pad;
+    attr.parity = param->parity;
+    attr.stop_bits = param->stopBits;
+
+    if (IOT_UART_BLOCK_STATE_NONE_BLOCK == param->rxBlock) {
+        extraAttr.rx_block = HI_UART_BLOCK_STATE_NONE_BLOCK;
+    } else {
+        extraAttr.rx_block = HI_UART_BLOCK_STATE_BLOCK;
+    }
+
+    if (IOT_UART_BLOCK_STATE_NONE_BLOCK == param->txBlock) {
+        extraAttr.tx_block = HI_UART_BLOCK_STATE_NONE_BLOCK;
+    } else {
+        extraAttr.tx_block = HI_UART_BLOCK_STATE_BLOCK;
+    }
+
+    return hi_uart_init((hi_uart_idx)id, &attr, &extraAttr);
+}
+
+int IoTUartRead(unsigned int id, unsigned char *data, unsigned int dataLen)
+{
+    return hi_uart_read((hi_uart_idx)id, data, dataLen);
+}
+
+int IoTUartWrite(unsigned int id, const unsigned char *data, unsigned int dataLen)
+{
+    return hi_uart_write((hi_uart_idx)id, data, dataLen);
+}
+
+unsigned int IoTUartDeinit(unsigned int id)
+{
+    return hi_uart_deinit((hi_uart_idx)id);
+}
+
+unsigned int IoTUartSetFlowCtrl(unsigned int id, IotFlowCtrl flowCtrl)
+{
+    return hi_uart_set_flow_ctrl((hi_uart_idx)id, (hi_flow_ctrl)flowCtrl);
+}

+ 34 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_iot_watchdog.c

@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "iot_errno.h"
+#include "iot_watchdog.h"
+#include "hi_watchdog.h"
+
+void IoTWatchDogEnable(void)
+{
+    return hi_watchdog_enable();
+}
+
+void IoTWatchDogKick(void)
+{
+    return hi_watchdog_feed();
+}
+
+void IoTWatchDogDisable(void)
+{
+    return hi_watchdog_disable();
+}
+

+ 28 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_lowpower.c

@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "lowpower.h"
+#include "hi_lowpower.h"
+
+unsigned int LpcInit(void)
+{
+    return hi_lpc_init();
+}
+
+unsigned int LpcSetType(LpcType type)
+{
+    return hi_lpc_set_type(type);
+}
+

+ 22 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/iot_hardware/wifiiot_lite/hal_reset.c

@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "reset.h"
+#include "hi_reset.h"
+
+void RebootDevice(unsigned int cause)
+{
+    hi_hard_reboot(cause);
+}

+ 23 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/update/BUILD.gn

@@ -0,0 +1,23 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build/lite/config/component/lite_component.gni")
+
+static_library("hal_update_static") {
+  sources = [ "hal_hota_board.c" ]
+  include_dirs = [
+    "//base/update/ota_lite/hals",
+    "//base/update/ota_lite/interfaces/kits",
+    "//device/bossay/hi3861_l0/sdk_liteos/include",
+  ]
+}

+ 207 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/update/hal_hota_board.c

@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "hal_hota_board.h"
+#include "hi_upg_api.h"
+#include "stdio.h"
+
+#define PUBKEY_LENGTH 270
+
+
+static const unsigned char g_pubKeyBuf[PUBKEY_LENGTH] = {
+    0x30, 0x82, 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0xBF, 0xAA, 0xA5, 0xB3, 0xC2, 0x78, 0x5E,
+    0x63, 0x07, 0x84, 0xCF, 0x37, 0xF0, 0x45, 0xE8, 0xB9, 0x6E, 0xEF, 0x04, 0x88, 0xD3, 0x43, 0x06,
+    0x2C, 0xFC, 0x09, 0x8C, 0x84, 0x3B, 0x43, 0x07, 0x89, 0x6B, 0x23, 0x8F, 0xA2, 0xF0, 0x9D, 0x91,
+    0xCB, 0xA8, 0x02, 0x60, 0xD8, 0x5C, 0x18, 0xD9, 0x34, 0xF0, 0x3C, 0x49, 0x10, 0x0E, 0xE3, 0xC7,
+    0x19, 0xA5, 0x51, 0x93, 0x38, 0xFD, 0xE0, 0x62, 0x64, 0xBA, 0x6D, 0x11, 0x2E, 0xE1, 0x6E, 0x60,
+    0x12, 0x16, 0x1B, 0x35, 0xA6, 0x54, 0x3F, 0x0B, 0x5D, 0x54, 0x08, 0xC9, 0x23, 0x51, 0x15, 0xA9,
+    0xE2, 0x07, 0xCC, 0xF9, 0xFD, 0x19, 0x8A, 0xB3, 0x7E, 0xCE, 0x69, 0xED, 0x26, 0x34, 0xD2, 0x02,
+    0xF3, 0xEB, 0x07, 0x13, 0x69, 0xE3, 0x03, 0x87, 0xB3, 0x6A, 0x3E, 0x91, 0x94, 0xAC, 0x2C, 0xBA,
+    0xF6, 0xEE, 0x4C, 0x41, 0x0C, 0x2E, 0xD0, 0xE7, 0x58, 0xA7, 0xE6, 0x7F, 0x1A, 0xC0, 0xB8, 0xE3,
+    0x12, 0x18, 0x97, 0x8D, 0x99, 0xAB, 0x35, 0x7B, 0xAD, 0x41, 0xA0, 0xFB, 0xCB, 0x23, 0xF6, 0x51,
+    0xE6, 0x94, 0x1F, 0xF7, 0xD8, 0x16, 0xCD, 0x15, 0x67, 0x59, 0x10, 0xA2, 0x40, 0x55, 0xD1, 0x67,
+    0xDA, 0x18, 0xCD, 0x63, 0x5B, 0x10, 0xAF, 0x22, 0x99, 0xD8, 0x9D, 0x56, 0x66, 0xCD, 0x80, 0x64,
+    0x32, 0xB5, 0xD7, 0xF5, 0xBA, 0x91, 0x4A, 0x8D, 0x97, 0x14, 0x8A, 0xB2, 0xB0, 0x42, 0x4A, 0xE6,
+    0x43, 0x22, 0x3B, 0x6E, 0xD6, 0x1E, 0x1F, 0xDA, 0xEC, 0x83, 0xCF, 0x20, 0xFA, 0x02, 0xF3, 0xFB,
+    0x6E, 0x09, 0x2A, 0x0D, 0xB7, 0x81, 0x1E, 0xD5, 0x71, 0xDF, 0x80, 0xC5, 0x33, 0x78, 0xE5, 0x41,
+    0x33, 0xDF, 0x9A, 0xBD, 0x36, 0x51, 0xAC, 0x96, 0xF4, 0xC6, 0x11, 0xC3, 0x93, 0x78, 0x26, 0x96,
+    0x9F, 0x67, 0x05, 0x1D, 0xDF, 0xB3, 0xAA, 0x26, 0x25, 0x02, 0x03, 0x01, 0x00, 0x01
+};
+typedef enum {
+    PARTITION_PASS_THROUGH = 0,
+    PARTITION_BOOTLOADER = 2,
+    PARTITION_KERNEL_A = 3,
+    PARTITION_KERNEL_B = 4,
+    PARTITION_ROOTFS = 5,
+    PARTITION_APP = 6,
+    PARTITION_DATA = 7,
+    PARTITION_OTA_TAG = 8,
+    PARTITION_OTA_CONFIG = 9,
+    PARTITION_ROOTFS_EXT4 = 10,
+    PARTITION_MAX
+} HotaPartition;
+
+static const ComponentTableInfo g_componentTable[] = {
+    { PARTITION_PASS_THROUGH, "", "/sdcard/update/ota_pkg_pass_through.bin", 0},
+    { PARTITION_INFO_COMP, "", "/sdcard/update/infocomp.bin", 0},
+    { PARTITION_BOOTLOADER, "bootloader", "/sdcard/update/u-boot.bin", 0},
+    { PARTITION_KERNEL_A, "kernel_A", "/sdcard/update/kernel.bin", 0},
+    { PARTITION_KERNEL_B, "kernel_B", "", 0},
+    { PARTITION_ROOTFS, "rootfs", "/sdcard/update/rootfs.img", 0},
+    { PARTITION_APP, "app", "", 0},
+    { PARTITION_DATA, "data", "", 0},
+    { PARTITION_OTA_TAG, "ota_tag", "/sdcard/update/OTA.tag", 0},
+    { PARTITION_OTA_CONFIG, "config", "/sdcard/update/config", 0},
+    { PARTITION_ROOTFS_EXT4, "rootfs_ext4", "/sdcard/update/rootfs_ext4.img", 0},
+    { PARTITION_MAX, NULL, NULL, 0}
+};
+int HotaHalInit(void)
+{
+    hi_u32 result = hi_upg_init();
+    if (result != HI_ERR_SUCCESS && result != HI_ERR_UPG_INITILIZATION_ALREADY) {
+        printf("hi_upg_init Failed.Result = %x.\r\n", result);
+        return OHOS_FAILURE;
+    }
+    return OHOS_SUCCESS;
+}
+
+int HotaHalGetUpdateIndex(unsigned int *index)
+{
+    if (hi_upg_get_file_index((hi_u8 *)index) != HI_ERR_SUCCESS) {
+        printf("get upgrade index error\r\n");
+        return OHOS_FAILURE;
+    }
+    return OHOS_SUCCESS;
+}
+
+int HotaHalDeInit(void)
+{
+    hi_u32 result = hi_upg_stop();
+    if (result != HI_ERR_SUCCESS) {
+        printf("hi_upg_stop Failed.Result = %x.\r\n", result);
+        return OHOS_FAILURE;
+    }
+    return OHOS_SUCCESS;
+}
+
+int HotaHalRead(int partition, unsigned int offset, unsigned int bufLen, unsigned char *buffer)
+{
+    if ((buffer == NULL) || (bufLen == 0)) {
+        return OHOS_FAILURE;
+    }
+
+    if (hi_upg_get_content(offset, buffer, bufLen) != HI_ERR_SUCCESS) {
+        printf("get ota content error! Partition: %d\r\n", partition);
+        return OHOS_FAILURE;
+    }
+
+    return OHOS_SUCCESS;
+}
+
+int HotaHalWrite(int partition, unsigned char *buffer, unsigned int offset, unsigned int buffLen)
+{
+    if (partition == PARTITION_INFO_COMP) {
+        printf("partition == PARTITION_INFO_COMP, skip it.");
+        return OHOS_SUCCESS;
+    }
+    hi_u32 result = hi_upg_transmit(offset, buffer, buffLen);
+    if (result != HI_ERR_SUCCESS) {
+        printf("hi_upg_transmit failed. retCode = %x.\r\n", result);
+        return OHOS_FAILURE;
+    }
+    return OHOS_SUCCESS;
+}
+
+int HotaHalRestart(void)
+{
+    hi_upg_finish_with_cache();
+    return OHOS_SUCCESS;
+}
+
+int HotaHalSetBootSettings(void)
+{
+    hi_u32 result = hi_upg_transmit_finish_save_cache();
+    if (result != HI_ERR_SUCCESS) {
+        printf("hi_upg_transmit_finish failed. retCode = %x.\r\n", result);
+        return OHOS_FAILURE;
+    }
+    return OHOS_SUCCESS;
+}
+
+int HotaHalRollback(void)
+{
+    return OHOS_SUCCESS;
+}
+
+const ComponentTableInfo *HotaHalGetPartitionInfo()
+{
+    return g_componentTable;
+}
+
+unsigned char *HotaHalGetPubKey(unsigned int *length)
+{
+    if (length == NULL) {
+        printf("OTA pub key is NULL.\r\n");
+        return NULL;
+    }
+
+    *length = sizeof(g_pubKeyBuf);
+    return (unsigned char *)g_pubKeyBuf;
+}
+
+
+int HotaHalGetUpdateAbility(void)
+{
+    return ABILITY_PKG_SEARCH | ABILITY_PKG_DLOAD;
+}
+
+int HotaHalGetOtaPkgPath(char *path, int len)
+{
+    int ret = strcpy_s(path, len ,"/sdcard");
+    if (ret != 0) {
+        return OHOS_FAILURE;
+    }
+    return OHOS_SUCCESS;
+}
+
+int HotaHalIsDeviceCanReboot(void)
+{
+    return 1;
+}
+
+int HotaHalGetMetaData(UpdateMetaData *metaData)
+{
+    return OHOS_SUCCESS;
+}
+
+int HotaHalSetMetaData(UpdateMetaData *metaData)
+{
+    return OHOS_SUCCESS;
+}
+
+int HotaHalRebootAndCleanUserData(void)
+{
+    return OHOS_SUCCESS;
+}
+
+int HotaHalRebootAndCleanCache(void)
+{
+    return OHOS_SUCCESS;
+}
+
+int HotaHalCheckVersionValid(const char *currentVersion, const char *pkgVersion, unsigned int pkgVersionLength)
+{
+    return (strncmp(currentVersion, pkgVersion, pkgVersionLength) == 0) ? 1 : 0;
+}

+ 22 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/utils/file/BUILD.gn

@@ -0,0 +1,22 @@
+# Copyright (c) 2020 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build/lite/config/component/lite_component.gni")
+
+static_library("hal_file_static") {
+  sources = [ "src/hal_file.c" ]
+  include_dirs = [
+    "//utils/native/lite/hals/file",
+    "//device/bossay/hi3861_l0/sdk_liteos/include",
+  ]
+}

+ 53 - 0
device/bossay/hi3861_l0/hi3861_adapter/hals/utils/file/src/hal_file.c

@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "hal_file.h"
+#include "hi_fs.h"
+
+int HalFileOpen(const char* path, int oflag, int mode)
+{
+    (void)mode;
+    return hi_open(path, oflag);
+}
+
+int HalFileClose(int fd)
+{
+    return hi_close(fd);
+}
+
+int HalFileRead(int fd, char *buf, unsigned int len)
+{
+    return hi_read(fd, buf, len);
+}
+
+int HalFileWrite(int fd, const char *buf, unsigned int len)
+{
+    return hi_write(fd, buf, len);
+}
+
+int HalFileDelete(const char *path)
+{
+    return hi_unlink(path);
+}
+
+int HalFileStat(const char *path, unsigned int *fileSize)
+{
+    return hi_stat(path, fileSize);
+}
+
+int HalFileSeek(int fd, int offset, unsigned int whence)
+{
+    return hi_lseek(fd, offset, whence);
+}

+ 37 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/BUILD.gn

@@ -0,0 +1,37 @@
+# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list of
+#    conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this list
+#    of conditions and the following disclaimer in the documentation and/or other materials
+#    provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its contributors may be used
+#    to endorse or promote products derived from this software without specific prior written
+#    permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import("//build/lite/config/component/lite_component.gni")
+
+lite_component("kal") {
+  features = [
+    "posix",
+    "cmsis",
+  ]
+}

+ 43 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/BUILD.gn

@@ -0,0 +1,43 @@
+# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list of
+#    conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this list
+#    of conditions and the following disclaimer in the documentation and/or other materials
+#    provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its contributors may be used
+#    to endorse or promote products derived from this software without specific prior written
+#    permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import("//build/lite/config/component/lite_component.gni")
+
+static_library("cmsis") {
+  sources = [ "cmsis_liteos.c" ]
+
+  include_dirs = [
+    "//device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis",
+    "//third_party/bounds_checking_function/include",
+  ]
+
+  defines = [ "LITEOS_WIFI_IOT_VERSION" ]
+
+  cflags = [ "-Wno-error" ]
+}

+ 201 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/LICENSE.txt

@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 10 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/README.OpenSource

@@ -0,0 +1,10 @@
+[
+    {
+        "Name"                  : "CMSIS",
+        "License"               : "Apache License V2.0",
+        "License File"          : "LICENSE.txt",
+        "Version Number"        : "5.7.0",
+        "Upstream URL"          : "http://www.arm.com/zh/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php",
+        "Description"           : "The Cortex Microcontroller Software Interface Standard (CMSIS) is a vendor-independent hardware abstraction layer for microcontrollers that are based on Arm® Cortex® processors"
+    }
+]

+ 38 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/cmsis_liteos.c

@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "los_config.h"
+
+#if (CMSIS_OS_VER == 1)
+#error "cmsis version 1.0 is not supported now!"
+#elif (CMSIS_OS_VER == 2)
+#include "cmsis_liteos2.c"
+#endif

+ 1386 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/cmsis_liteos2.c

@@ -0,0 +1,1386 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "cmsis_os.h"
+#include "los_typedef.h"
+#include "los_printf.h"
+
+#include "los_event.h"
+#include "los_membox.h"
+#include "los_memory.h"
+#include "los_hwi.h"
+
+#include "los_mux_pri.h"
+#include "los_queue_pri.h"
+#include "los_sem_pri.h"
+#include "los_swtmr_pri.h"
+#include "los_sys_pri.h"
+#include "los_task_pri.h"
+#include "los_tick_pri.h"
+#include "string.h"
+#include "securec.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+#endif /* __cplusplus */
+#if (CMSIS_OS_VER == 2)
+
+/* Kernel initialization state */
+static osKernelState_t g_kernelState;
+
+extern BOOL g_taskScheduled;
+
+#define LOS_PRIORITY_WIN 8
+
+const osVersion_t g_stLosVersion = { 001, 001 };
+
+#define LITEOS_VERSION_MAJOR 1
+#define LITEOS_VERSION_MINOR 0
+#define LITEOS_VERSION_BUILD 0
+
+/* Kernel version and identification string definition */
+#define KERNEL_VERSION            (((UINT32)LITEOS_VERSION_MAJOR * 10000000UL) | \
+                                   ((UINT32)LITEOS_VERSION_MINOR *    10000UL) | \
+                                   ((UINT32)LITEOS_VERSION_BUILD *        1UL))
+
+#define KERNEL_ID "HUAWEI-LiteOS"
+#define UNUSED(var) do { (void)var; } while (0)
+
+//  ==== Kernel Management Functions ====
+uint32_t osTaskStackWaterMarkGet(UINT32 taskID);
+
+
+osStatus_t osKernelInitialize(void)
+{
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    if (g_kernelState != osKernelInactive) {
+        return osError;
+    }
+
+    if (LOS_OK == LOS_KernelInit()) {
+        g_kernelState = osKernelReady;
+        return osOK;
+    } else {
+        return osError;
+    }
+}
+
+
+osStatus_t osKernelGetInfo(osVersion_t *version, char *id_buf, uint32_t id_size)
+{
+    uint32_t uwRet;
+
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    if (version != NULL) {
+        version->api = g_stLosVersion.api;
+        version->kernel = g_stLosVersion.kernel;
+    }
+
+    if ((id_buf != NULL) && (id_size != 0U)) {
+        if (id_size > sizeof(KERNEL_ID)) {
+            id_size = sizeof(KERNEL_ID);
+        }
+        uwRet = memcpy_s(id_buf, id_size, KERNEL_ID, id_size);
+        if (uwRet != EOK) {
+            PRINT_ERR("%s[%d] memcpy failed, error type = %u\n", __FUNCTION__, __LINE__, uwRet);
+            return osError;
+        }
+    }
+
+    return osOK;
+}
+
+
+osKernelState_t osKernelGetState(void)
+{
+    if (OS_INT_ACTIVE) {
+        return osKernelError;
+    }
+
+    if (!g_taskScheduled) {
+        if (g_kernelState == osKernelReady) {
+            return osKernelReady;
+        } else {
+            return osKernelInactive;
+        }
+    } else if (g_losTaskLock > 0) {
+        return osKernelLocked;
+    } else {
+        return osKernelRunning;
+    }
+}
+
+
+osStatus_t osKernelStart(void)
+{
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    if (g_kernelState == osKernelReady) {
+        if (LOS_OK == LOS_Start()) {
+            g_kernelState = osKernelRunning;
+            return osOK;
+        } else {
+            return osError;
+        }
+    } else {
+        return osError;
+    }
+}
+
+
+int32_t osKernelLock(void)
+{
+    int32_t lock;
+
+    if (OS_INT_ACTIVE) {
+        return (int32_t)osErrorISR;
+    }
+
+    if (!g_taskScheduled) {
+        return (int32_t)osError;
+    }
+
+    if (g_losTaskLock > 0) {
+        lock = 1;
+    } else {
+        LOS_TaskLock();
+        lock = 0;
+    }
+
+    return lock;
+}
+
+
+int32_t osKernelUnlock(void)
+{
+    int32_t lock;
+
+    if (OS_INT_ACTIVE) {
+        return (int32_t)osErrorISR;
+    }
+
+    if (!g_taskScheduled) {
+        return (int32_t)osError;
+    }
+
+    if (g_losTaskLock > 0) {
+        LOS_TaskUnlock();
+        if (g_losTaskLock != 0) {
+            return (int32_t)osError;
+        }
+        lock = 1;
+    } else {
+        lock = 0;
+    }
+
+    return lock;
+}
+
+
+int32_t osKernelRestoreLock(int32_t lock)
+{
+    if (OS_INT_ACTIVE) {
+        return (int32_t)osErrorISR;
+    }
+
+    if (!g_taskScheduled) {
+        return (int32_t)osError;
+    }
+
+    switch (lock) {
+        case 0:
+            LOS_TaskUnlock();
+            if (g_losTaskLock != 0) {
+                break;
+            }
+            return 0;
+        case 1:
+            LOS_TaskLock();
+            return 1;
+        default:
+            break;
+    }
+
+    return (int32_t)osError;
+}
+
+
+uint32_t osKernelGetTickCount(void)
+{
+    uint64_t ticks;
+    UINTPTR uvIntSave;
+
+    if (OS_INT_ACTIVE) {
+#ifndef LITEOS_WIFI_IOT_VERSION
+        ticks = g_ullTickCount;
+#else
+        ticks = g_tickCount;
+#endif
+    } else {
+        uvIntSave = LOS_IntLock();
+#ifndef LITEOS_WIFI_IOT_VERSION
+        ticks = g_ullTickCount;
+#else
+        ticks = g_tickCount;
+#endif
+        LOS_IntRestore(uvIntSave);
+    }
+
+    return (uint32_t)ticks;
+}
+
+uint32_t osKernelGetTickFreq(void)
+{
+    uint32_t freq;
+
+    if (OS_INT_ACTIVE) {
+        freq = 0U;
+    } else {
+        freq = LOSCFG_BASE_CORE_TICK_PER_SECOND;
+    }
+
+    return (freq);
+}
+
+extern VOID LOS_GetCpuCycle(UINT32 *puwCntHi, UINT32 *puwCntLo);
+uint32_t osKernelGetSysTimerCount(void)
+{
+    uint32_t countHigh = 0;
+    uint32_t countLow = 0;
+    if (OS_INT_ACTIVE) {
+        countLow = 0U;
+    } else {
+        LOS_GetCpuCycle((UINT32 *)&countHigh, (UINT32 *)&countLow);
+    }
+    return countLow;
+}
+
+
+uint32_t osKernelGetSysTimerFreq(void)
+{
+    return OS_SYS_CLOCK;
+}
+
+
+//  ==== Thread Management Functions ====
+
+osThreadId_t osThreadNew(osThreadFunc_t func, void *argument, const osThreadAttr_t *attr)
+{
+    UINT32 uwTid;
+    UINT32 uwRet;
+    LosTaskCB *pstTaskCB = NULL;
+    TSK_INIT_PARAM_S stTskInitParam;
+
+    if (OS_INT_ACTIVE) {
+        return NULL;
+    }
+
+    if ((attr == NULL) || (func == NULL) || (attr->priority < osPriorityLow1) ||
+        (attr->priority > osPriorityAboveNormal6)) {
+        return (osThreadId_t)NULL;
+    }
+
+    (void)memset_s(&stTskInitParam, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S));
+    stTskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)func;
+#ifndef LITEOS_WIFI_IOT_VERSION
+    stTskInitParam.uwArg = (UINT32)argument;
+#else
+    stTskInitParam.auwArgs[0] = (UINT32)argument;
+#endif
+    stTskInitParam.uwStackSize = attr->stack_size;
+    stTskInitParam.pcName = (CHAR *)attr->name;
+    stTskInitParam.usTaskPrio = OS_TASK_PRIORITY_LOWEST - ((UINT16)(attr->priority) - LOS_PRIORITY_WIN); /* 0~31 */
+
+    uwRet = LOS_TaskCreate(&uwTid, &stTskInitParam);
+
+    if (LOS_OK != uwRet) {
+        return (osThreadId_t)NULL;
+    }
+
+    pstTaskCB = OS_TCB_FROM_TID(uwTid);
+
+    return (osThreadId_t)pstTaskCB;
+}
+
+
+const char *osThreadGetName(osThreadId_t thread_id)
+{
+    LosTaskCB *pstTaskCB = NULL;
+
+    if (OS_INT_ACTIVE || thread_id == NULL) {
+        return NULL;
+    }
+
+    pstTaskCB = (LosTaskCB *)thread_id;
+
+    return pstTaskCB->taskName;
+}
+
+
+osThreadId_t osThreadGetId(void)
+{
+    if (OS_INT_ACTIVE) {
+        return NULL;
+    }
+
+    return (osThreadId_t)(g_losTask.runTask);
+}
+
+void *osThreadGetArgument(void)
+{
+    if (OS_INT_ACTIVE) {
+        return 0;
+    }
+
+    LosTaskCB *taskCb = (LosTaskCB *)osThreadGetId();
+    if (taskCb == NULL) {
+        return NULL;
+    }
+#ifndef LITEOS_WIFI_IOT_VERSION
+    return (void *)(taskCb->arg);
+#else
+    return (void *)(taskCb->args[0]);
+#endif
+}
+
+osThreadState_t osThreadGetState(osThreadId_t thread_id)
+{
+    UINT16 taskStatus;
+    osThreadState_t stState;
+    LosTaskCB *pstTaskCB = NULL;
+
+    if (OS_INT_ACTIVE || thread_id == NULL) {
+        return osThreadError;
+    }
+
+    pstTaskCB = (LosTaskCB *)thread_id;
+    taskStatus = pstTaskCB->taskStatus;
+
+    if (taskStatus & OS_TASK_STATUS_RUNNING) {
+        stState = osThreadRunning;
+    } else if (taskStatus & OS_TASK_STATUS_READY) {
+        stState = osThreadReady;
+    } else if (taskStatus &
+        (OS_TASK_STATUS_DELAY | OS_TASK_STATUS_PEND | OS_TASK_STATUS_SUSPEND | OS_TASK_STATUS_PEND_QUEUE)) {
+        stState = osThreadBlocked;
+    } else if (taskStatus & OS_TASK_STATUS_UNUSED) {
+        stState = osThreadInactive;
+    } else {
+        stState = osThreadError;
+    }
+
+    return stState;
+}
+
+
+uint32_t osThreadGetStackSize(osThreadId_t thread_id)
+{
+    LosTaskCB *pstTaskCB = NULL;
+
+    if (OS_INT_ACTIVE || thread_id == NULL) {
+        return 0U;
+    }
+
+    pstTaskCB = (LosTaskCB *)thread_id;
+
+    return pstTaskCB->stackSize;
+}
+
+
+uint32_t osTaskStackWaterMarkGet(UINT32 taskID)
+{
+    UINT32 uwCount = 0;
+    UINT32 *ptopOfStack;
+    UINTPTR uvIntSave;
+    LosTaskCB *pstTaskCB = NULL;
+
+    if (taskID > LOSCFG_BASE_CORE_TSK_LIMIT) {
+        return 0;
+    }
+
+    uvIntSave = LOS_IntLock();
+
+    pstTaskCB = OS_TCB_FROM_TID(taskID);
+    if (OS_TASK_STATUS_UNUSED & (pstTaskCB->taskStatus)) {
+        LOS_IntRestore(uvIntSave);
+        return 0;
+    }
+
+    // first 4 bytes is OS_TASK_MAGIC_WORD, skip
+    ptopOfStack = (UINT32 *)(UINTPTR)pstTaskCB->topOfStack + 1;
+
+    while (*ptopOfStack == (UINT32)OS_TASK_STACK_INIT) {
+        ++ptopOfStack;
+        ++uwCount;
+    }
+
+    uwCount *= sizeof(UINT32);
+
+    LOS_IntRestore(uvIntSave);
+    return uwCount;
+}
+
+
+uint32_t osThreadGetStackSpace(osThreadId_t thread_id)
+{
+    LosTaskCB *pstTaskCB = NULL;
+
+    if (OS_INT_ACTIVE || thread_id == NULL) {
+        return 0U;
+    }
+
+    pstTaskCB = (LosTaskCB *)thread_id;
+
+    return osTaskStackWaterMarkGet(pstTaskCB->taskID);
+}
+
+
+osStatus_t osThreadSetPriority(osThreadId_t thread_id, osPriority_t priority)
+{
+    UINT32 uwRet;
+    UINT16 usPriority;
+    LosTaskCB *pstTaskCB = NULL;
+
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    if (thread_id == NULL) {
+        return osErrorParameter;
+    }
+
+    if (priority < osPriorityLow1 || priority > osPriorityAboveNormal6) {
+        return osErrorParameter;
+    }
+
+    pstTaskCB = (LosTaskCB *)thread_id;
+    usPriority = OS_TASK_PRIORITY_LOWEST - ((UINT16)priority - LOS_PRIORITY_WIN);
+    uwRet = LOS_TaskPriSet(pstTaskCB->taskID, usPriority);
+    switch (uwRet) {
+        case LOS_ERRNO_TSK_PRIOR_ERROR:
+        case LOS_ERRNO_TSK_OPERATE_IDLE:
+        case LOS_ERRNO_TSK_ID_INVALID:
+            return osErrorParameter;
+
+        case LOS_ERRNO_TSK_NOT_CREATED:
+            return osErrorResource;
+
+        default:
+            return osOK;
+    }
+}
+
+
+osPriority_t osThreadGetPriority(osThreadId_t thread_id)
+{
+    UINT16 usRet;
+    LosTaskCB *pstTaskCB = NULL;
+
+    if (OS_INT_ACTIVE || thread_id == NULL) {
+        return osPriorityError;
+    }
+
+    pstTaskCB = (LosTaskCB *)thread_id;
+    usRet = LOS_TaskPriGet(pstTaskCB->taskID);
+
+    if (usRet == (UINT16)OS_INVALID) {
+        return osPriorityError;
+    }
+
+    return (osPriority_t)(OS_TASK_PRIORITY_LOWEST - (usRet - LOS_PRIORITY_WIN));
+}
+
+
+osStatus_t osThreadYield(void)
+{
+    UINT32 uwRet;
+
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    uwRet = LOS_TaskYield();
+
+    if (uwRet == LOS_OK) {
+        return osOK;
+    }
+
+    return osError;
+}
+
+
+osStatus_t osThreadSuspend(osThreadId_t thread_id)
+{
+    UINT32 uwRet;
+    LosTaskCB *pstTaskCB = NULL;
+
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    if (thread_id == NULL) {
+        return osErrorParameter;
+    }
+
+    pstTaskCB = (LosTaskCB *)thread_id;
+    uwRet = LOS_TaskSuspend(pstTaskCB->taskID);
+    switch (uwRet) {
+        case LOS_ERRNO_TSK_OPERATE_IDLE:
+        case LOS_ERRNO_TSK_SUSPEND_SWTMR_NOT_ALLOWED:
+        case LOS_ERRNO_TSK_ID_INVALID:
+            return osErrorParameter;
+
+        case LOS_ERRNO_TSK_NOT_CREATED:
+        case LOS_ERRNO_TSK_ALREADY_SUSPENDED:
+        case LOS_ERRNO_TSK_SUSPEND_LOCKED:
+            return osErrorResource;
+
+        default:
+            return osOK;
+    }
+}
+
+
+osStatus_t osThreadResume(osThreadId_t thread_id)
+{
+    UINT32 uwRet;
+    LosTaskCB *pstTaskCB = NULL;
+
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    if (thread_id == NULL) {
+        return osErrorParameter;
+    }
+
+    pstTaskCB = (LosTaskCB *)thread_id;
+    uwRet = LOS_TaskResume(pstTaskCB->taskID);
+
+    switch (uwRet) {
+        case LOS_ERRNO_TSK_ID_INVALID:
+            return osErrorParameter;
+
+        case LOS_ERRNO_TSK_NOT_CREATED:
+        case LOS_ERRNO_TSK_NOT_SUSPENDED:
+            return osErrorResource;
+
+        default:
+            return osOK;
+    }
+}
+
+
+osStatus_t osThreadTerminate(osThreadId_t thread_id)
+{
+    UINT32 uwRet;
+    LosTaskCB *pstTaskCB = NULL;
+
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    if (thread_id == NULL) {
+        return osErrorParameter;
+    }
+
+    pstTaskCB = (LosTaskCB *)thread_id;
+    uwRet = LOS_TaskDelete(pstTaskCB->taskID);
+
+    switch (uwRet) {
+        case LOS_ERRNO_TSK_OPERATE_IDLE:
+        case LOS_ERRNO_TSK_SUSPEND_SWTMR_NOT_ALLOWED:
+        case LOS_ERRNO_TSK_ID_INVALID:
+            return osErrorParameter;
+
+        case LOS_ERRNO_TSK_NOT_CREATED:
+            return osErrorResource;
+
+        default:
+            return osOK;
+    }
+}
+
+
+uint32_t osThreadGetCount(void)
+{
+    uint32_t uwCount = 0;
+
+    if (OS_INT_ACTIVE) {
+        return 0U;
+    }
+
+    for (uint32_t index = 0; index <= LOSCFG_BASE_CORE_TSK_LIMIT; index++) {
+        if (!((g_taskCBArray + index)->taskStatus & OS_TASK_STATUS_UNUSED)) {
+            uwCount++;
+        }
+    }
+
+    return uwCount;
+}
+
+
+//  ==== Generic Wait Functions ====
+WEAK UINT32 LOS_HalDelay(UINT32 ticks)
+{
+    UNUSED(ticks);
+    return LOS_ERRNO_TSK_DELAY_IN_INT;
+}
+
+
+osStatus_t osDelay(uint32_t ticks)
+{
+    UINT32 uwRet;
+    if (ticks == 0) {
+        return osOK;
+    }
+    if (osKernelGetState() != osKernelRunning) {
+        uwRet = LOS_HalDelay(ticks);
+    } else {
+        uwRet = LOS_TaskDelay(ticks);
+    }
+    if (uwRet == LOS_OK) {
+        return osOK;
+    } else {
+        return osError;
+    }
+}
+
+
+osStatus_t osDelayUntil(uint32_t ticks)
+{
+    UINT32 uwRet;
+    UINT32 uwTicks;
+    UINT32 tickCount = osKernelGetTickCount();
+
+    if (ticks < tickCount) {
+        return osError;
+    }
+
+    uwTicks = (UINT32)(ticks - tickCount);
+
+    uwRet = LOS_TaskDelay(uwTicks);
+    if (uwRet == LOS_OK) {
+        return osOK;
+    } else {
+        return osError;
+    }
+}
+
+//  ==== Timer Management Functions ====
+#if (LOSCFG_BASE_CORE_SWTMR == 1)
+osTimerId_t osTimerNew(osTimerFunc_t func, osTimerType_t type, void *argument, const osTimerAttr_t *attr)
+{
+    UNUSED(attr);
+    UINT16 usSwTmrID;
+    UINT8 mode;
+
+    if ((OS_INT_ACTIVE) || (NULL == func) || ((osTimerOnce != type) && (osTimerPeriodic != type))) {
+        return (osTimerId_t)NULL;
+    }
+
+    if (osTimerOnce == type) {
+        mode = LOS_SWTMR_MODE_NO_SELFDELETE;
+    } else {
+        mode = LOS_SWTMR_MODE_PERIOD;
+    }
+#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
+    if (LOS_OK != LOS_SwtmrCreate(1, mode, (SWTMR_PROC_FUNC)func, &usSwTmrID, (UINT32)(UINTPTR)argument,
+        osTimerRousesAllow, osTimerAlignIgnore)) {
+        return (osTimerId_t)NULL;
+    }
+#else
+    if (LOS_OK != LOS_SwtmrCreate(1, mode, (SWTMR_PROC_FUNC)func, &usSwTmrID, (UINT32)(UINTPTR)argument)) {
+        return (osTimerId_t)NULL;
+    }
+#endif
+
+    return (osTimerId_t)OS_SWT_FROM_SID(usSwTmrID);
+}
+
+osStatus_t osTimerStart(osTimerId_t timer_id, uint32_t ticks)
+{
+    UINT32 uwRet;
+    SWTMR_CTRL_S *pstSwtmr;
+
+    if ((0 == ticks) || (NULL == timer_id)) {
+        return osErrorParameter;
+    }
+
+    pstSwtmr = (SWTMR_CTRL_S *)timer_id;
+    pstSwtmr->uwInterval = ticks;
+    uwRet = LOS_SwtmrStart(pstSwtmr->usTimerID);
+    if (LOS_OK == uwRet) {
+        return osOK;
+    } else if (LOS_ERRNO_SWTMR_ID_INVALID == uwRet) {
+        return osErrorParameter;
+    } else {
+        return osErrorResource;
+    }
+}
+
+
+const char *osTimerGetName(osTimerId_t timer_id)
+{
+    UNUSED(timer_id);
+    return (const char *)NULL;
+}
+
+
+osStatus_t osTimerStop(osTimerId_t timer_id)
+{
+    UINT32 uwRet;
+    SWTMR_CTRL_S *pstSwtmr = (SWTMR_CTRL_S *)timer_id;
+
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    if (NULL == pstSwtmr) {
+        return osErrorParameter;
+    }
+
+    uwRet = LOS_SwtmrStop(pstSwtmr->usTimerID);
+    if (LOS_OK == uwRet) {
+        return osOK;
+    } else if (LOS_ERRNO_SWTMR_ID_INVALID == uwRet) {
+        return osErrorParameter;
+    } else {
+        return osErrorResource;
+    }
+}
+
+
+uint32_t osTimerIsRunning(osTimerId_t timer_id)
+{
+    if ((OS_INT_ACTIVE) || (NULL == timer_id)) {
+        return 0;
+    }
+
+    return (OS_SWTMR_STATUS_TICKING == ((SWTMR_CTRL_S *)timer_id)->ucState);
+}
+
+
+osStatus_t osTimerDelete(osTimerId_t timer_id)
+{
+    UINT32 uwRet;
+    SWTMR_CTRL_S *pstSwtmr = (SWTMR_CTRL_S *)timer_id;
+
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    if (NULL == pstSwtmr) {
+        return osErrorParameter;
+    }
+
+    uwRet = LOS_SwtmrDelete(pstSwtmr->usTimerID);
+    if (LOS_OK == uwRet) {
+        return osOK;
+    } else if (LOS_ERRNO_SWTMR_ID_INVALID == uwRet) {
+        return osErrorParameter;
+    } else {
+        return osErrorResource;
+    }
+}
+#endif
+
+osEventFlagsId_t osEventFlagsNew(const osEventFlagsAttr_t *attr)
+{
+    PEVENT_CB_S pstEventCB;
+    UINT32 uwRet;
+
+    UNUSED(attr);
+
+    if (OS_INT_ACTIVE) {
+        return (osEventFlagsId_t)NULL;
+    }
+
+    pstEventCB = (PEVENT_CB_S)LOS_MemAlloc(m_aucSysMem0, sizeof(EVENT_CB_S));
+    if (pstEventCB == NULL) {
+        return (osEventFlagsId_t)NULL;
+    }
+
+    uwRet = LOS_EventInit(pstEventCB);
+    if (uwRet == LOS_ERRNO_EVENT_PTR_NULL) {
+        return (osEventFlagsId_t)NULL;
+    } else {
+        return (osEventFlagsId_t)pstEventCB;
+    }
+}
+
+
+const char *osEventFlagsGetName(osEventFlagsId_t ef_id)
+{
+    UNUSED(ef_id);
+
+    if (OS_INT_ACTIVE) {
+        return (const char *)NULL;
+    }
+
+    return (const char *)NULL;
+}
+
+
+uint32_t osEventFlagsSet(osEventFlagsId_t ef_id, uint32_t flags)
+{
+    PEVENT_CB_S pstEventCB = (PEVENT_CB_S)ef_id;
+    UINT32 uwRet;
+    uint32_t rflags;
+    if (pstEventCB == NULL) {
+        return osFlagsErrorParameter;
+    }
+    uwRet = LOS_EventWrite(pstEventCB, (UINT32)flags);
+    if (uwRet != LOS_OK) {
+        return (uint32_t)osFlagsErrorParameter;
+    } else {
+        rflags = pstEventCB->uwEventID;
+        return rflags;
+    }
+}
+
+
+uint32_t osEventFlagsClear(osEventFlagsId_t ef_id, uint32_t flags)
+{
+    PEVENT_CB_S pstEventCB = (PEVENT_CB_S)ef_id;
+    UINTPTR uwIntSave;
+    uint32_t rflags;
+    UINT32 uwRet;
+
+    if (pstEventCB == NULL) {
+        return (uint32_t)osFlagsErrorParameter;
+    }
+
+    uwIntSave = LOS_IntLock();
+    rflags = pstEventCB->uwEventID;
+
+    uwRet = LOS_EventClear(pstEventCB, ~flags);
+    LOS_IntRestore(uwIntSave);
+    if (uwRet != LOS_OK) {
+        return (uint32_t)osFlagsErrorParameter;
+    } else {
+        return rflags;
+    }
+}
+
+
+uint32_t osEventFlagsGet(osEventFlagsId_t ef_id)
+{
+    PEVENT_CB_S pstEventCB = (PEVENT_CB_S)ef_id;
+    UINTPTR uwIntSave;
+    uint32_t rflags;
+
+    if (pstEventCB == NULL) {
+        return (uint32_t)osFlagsErrorParameter;
+    }
+
+    uwIntSave = LOS_IntLock();
+    rflags = pstEventCB->uwEventID;
+    LOS_IntRestore(uwIntSave);
+
+    return rflags;
+}
+
+uint32_t osEventFlagsWait(osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout)
+{
+    PEVENT_CB_S pstEventCB = (PEVENT_CB_S)ef_id;
+    UINT32 uwMode = 0;
+    UINT32 uwRet;
+    uint32_t rflags;
+
+    if (options > (osFlagsWaitAny | osFlagsWaitAll | osFlagsNoClear)) {
+        return (uint32_t)osFlagsErrorParameter;
+    }
+
+    if ((options & osFlagsWaitAll) == osFlagsWaitAll) {
+        uwMode |= LOS_WAITMODE_AND;
+    } else {
+        uwMode |= LOS_WAITMODE_OR;
+    }
+
+    if ((options & osFlagsNoClear) == osFlagsNoClear) {
+        uwMode &= ~LOS_WAITMODE_CLR;
+    } else {
+        uwMode |= LOS_WAITMODE_CLR;
+    }
+
+    uwRet = LOS_EventRead(pstEventCB, (UINT32)flags, uwMode, (UINT32)timeout);
+    switch (uwRet) {
+        case LOS_ERRNO_EVENT_PTR_NULL:
+        case LOS_ERRNO_EVENT_EVENTMASK_INVALID:
+        case LOS_ERRNO_EVENT_SETBIT_INVALID:
+            return (uint32_t)osFlagsErrorParameter;
+
+        case LOS_ERRNO_EVENT_READ_IN_INTERRUPT:
+        case LOS_ERRNO_EVENT_FLAGS_INVALID:
+        case LOS_ERRNO_EVENT_READ_IN_LOCK:
+            return (uint32_t)osFlagsErrorResource;
+
+        case LOS_ERRNO_EVENT_READ_TIMEOUT:
+            return (uint32_t)osFlagsErrorTimeout;
+
+        default:
+            rflags = (uint32_t)uwRet;
+            return rflags;
+    }
+}
+
+osStatus_t osEventFlagsDelete(osEventFlagsId_t ef_id)
+{
+    PEVENT_CB_S pstEventCB = (PEVENT_CB_S)ef_id;
+    UINTPTR uwIntSave;
+    osStatus_t uwRet;
+
+    uwIntSave = LOS_IntLock();
+    if (LOS_EventDestroy(pstEventCB) == LOS_OK) {
+        uwRet = osOK;
+    } else {
+        uwRet = osErrorParameter;
+    }
+    LOS_IntRestore(uwIntSave);
+
+    if (LOS_MemFree(m_aucSysMem0, (void *)pstEventCB) == LOS_OK) {
+        uwRet = osOK;
+    } else {
+        uwRet = osErrorParameter;
+    }
+
+    return uwRet;
+}
+
+//  ==== Mutex Management Functions ====
+#if (LOSCFG_BASE_IPC_MUX == 1)
+osMutexId_t osMutexNew(const osMutexAttr_t *attr)
+{
+    UINT32 uwRet;
+    UINT32 uwMuxId;
+
+    UNUSED(attr);
+
+    if (OS_INT_ACTIVE) {
+        return NULL;
+    }
+
+    uwRet = LOS_MuxCreate(&uwMuxId);
+    if (uwRet == LOS_OK) {
+        return (osMutexId_t)(GET_MUX(uwMuxId));
+    } else {
+        return (osMutexId_t)NULL;
+    }
+}
+
+
+osStatus_t osMutexAcquire(osMutexId_t mutex_id, uint32_t timeout)
+{
+    UINT32 uwRet;
+
+    if (mutex_id == NULL) {
+        return osErrorParameter;
+    }
+
+    if (OS_INT_ACTIVE && (timeout != LOS_NO_WAIT)) {
+        timeout = 0;
+    }
+
+    uwRet = LOS_MuxPend(((LosMuxCB *)mutex_id)->muxID, timeout);
+    if (uwRet == LOS_OK) {
+        return osOK;
+    } else if (uwRet == LOS_ERRNO_MUX_TIMEOUT) {
+        return osErrorTimeout;
+    } else if (uwRet == LOS_ERRNO_MUX_INVALID) {
+        return osErrorParameter;
+    } else {
+        return osErrorResource;
+    }
+}
+
+
+osStatus_t osMutexRelease(osMutexId_t mutex_id)
+{
+    UINT32 uwRet;
+
+    if (mutex_id == NULL) {
+        return osErrorParameter;
+    }
+
+    uwRet = LOS_MuxPost(((LosMuxCB *)mutex_id)->muxID);
+    if (uwRet == LOS_OK) {
+        return osOK;
+    } else {
+        return osErrorResource;
+    }
+}
+
+
+osThreadId_t osMutexGetOwner(osMutexId_t mutex_id)
+{
+    UINT32 uwIntSave;
+    LosTaskCB *pstTaskCB;
+
+    if (OS_INT_ACTIVE) {
+        return NULL;
+    }
+
+    if (mutex_id == NULL) {
+        return NULL;
+    }
+
+    uwIntSave = LOS_IntLock();
+    pstTaskCB = ((LosMuxCB *)mutex_id)->owner;
+    LOS_IntRestore(uwIntSave);
+
+    return (osThreadId_t)pstTaskCB;
+}
+
+
+osStatus_t osMutexDelete(osMutexId_t mutex_id)
+{
+    UINT32 uwRet;
+
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    if (mutex_id == NULL) {
+        return osErrorParameter;
+    }
+
+    uwRet = LOS_MuxDelete(((LosMuxCB *)mutex_id)->muxID);
+    if (uwRet == LOS_OK) {
+        return osOK;
+    } else if (uwRet == LOS_ERRNO_MUX_INVALID) {
+        return osErrorParameter;
+    } else {
+        return osErrorResource;
+    }
+}
+#endif
+
+//  ==== Semaphore Management Functions ====
+#if (LOSCFG_BASE_IPC_SEM == 1)
+
+osSemaphoreId_t osSemaphoreNew(uint32_t max_count, uint32_t initial_count, const osSemaphoreAttr_t *attr)
+{
+    UINT32 uwRet;
+    UINT32 uwSemId;
+
+    UNUSED(attr);
+
+    if (OS_INT_ACTIVE) {
+        return (osSemaphoreId_t)NULL;
+    }
+
+    if (1 == max_count) {
+        uwRet = LOS_BinarySemCreate((UINT16)initial_count, &uwSemId);
+    } else {
+        uwRet = LOS_SemCreate((UINT16)initial_count, &uwSemId);
+    }
+
+    if (uwRet == LOS_OK) {
+        return (osSemaphoreId_t)(GET_SEM(uwSemId));
+    } else {
+        return (osSemaphoreId_t)NULL;
+    }
+}
+
+
+osStatus_t osSemaphoreAcquire(osSemaphoreId_t semaphore_id, uint32_t timeout)
+{
+    UINT32 uwRet;
+
+    if (semaphore_id == NULL) {
+        return osErrorParameter;
+    }
+
+    if (OS_INT_ACTIVE && (timeout != LOS_NO_WAIT)) {
+        return osErrorISR;
+    }
+
+    uwRet = LOS_SemPend(((LosSemCB *)semaphore_id)->semID, timeout);
+    if (uwRet == LOS_OK) {
+        return osOK;
+    } else if (uwRet == LOS_ERRNO_SEM_TIMEOUT) {
+        return osErrorTimeout;
+    } else if (uwRet == LOS_ERRNO_SEM_INVALID) {
+        return osErrorParameter;
+    } else if (uwRet == LOS_ERRNO_SEM_PEND_INTERR) {
+        return osErrorISR;
+    } else {
+        return osErrorResource;
+    }
+}
+
+
+osStatus_t osSemaphoreRelease(osSemaphoreId_t semaphore_id)
+{
+    UINT32 uwRet;
+
+    if (semaphore_id == NULL) {
+        return osErrorParameter;
+    }
+
+    uwRet = LOS_SemPost(((LosSemCB *)semaphore_id)->semID);
+    if (uwRet == LOS_OK) {
+        return osOK;
+    } else if (uwRet == LOS_ERRNO_SEM_INVALID) {
+        return osErrorParameter;
+    } else {
+        return osErrorResource;
+    }
+}
+
+
+uint32_t osSemaphoreGetCount(osSemaphoreId_t semaphore_id)
+{
+    UINT32 uwIntSave;
+    UINT32 uwCount;
+
+    if (OS_INT_ACTIVE) {
+        return 0;
+    }
+
+    if (semaphore_id == NULL) {
+        return 0;
+    }
+
+    uwIntSave = LOS_IntLock();
+    uwCount = ((LosSemCB *)semaphore_id)->semCount;
+    LOS_IntRestore(uwIntSave);
+
+    return uwCount;
+}
+
+
+osStatus_t osSemaphoreDelete(osSemaphoreId_t semaphore_id)
+{
+    UINT32 uwRet;
+
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    if (semaphore_id == NULL) {
+        return osErrorParameter;
+    }
+
+    uwRet = LOS_SemDelete(((LosSemCB *)semaphore_id)->semID);
+    if (uwRet == LOS_OK) {
+        return osOK;
+    } else if (uwRet == LOS_ERRNO_SEM_INVALID) {
+        return osErrorParameter;
+    } else {
+        return osErrorResource;
+    }
+}
+#endif
+
+
+//  ==== Message Queue Management Functions ====
+#if (LOSCFG_BASE_IPC_QUEUE == 1)
+osMessageQueueId_t osMessageQueueNew(uint32_t msg_count, uint32_t msg_size, const osMessageQueueAttr_t *attr)
+{
+    UINT32 uwQueueID;
+    UINT32 uwRet;
+    UNUSED(attr);
+    osMessageQueueId_t handle;
+
+    if (0 == msg_count || 0 == msg_size || OS_INT_ACTIVE) {
+        return (osMessageQueueId_t)NULL;
+    }
+
+    uwRet = LOS_QueueCreate((char *)NULL, (UINT16)msg_count, &uwQueueID, 0, (UINT16)msg_size);
+    if (uwRet == LOS_OK) {
+        handle = (osMessageQueueId_t)(GET_QUEUE_HANDLE(uwQueueID));
+    } else {
+        handle = (osMessageQueueId_t)NULL;
+    }
+
+    return handle;
+}
+
+
+osStatus_t osMessageQueuePut(osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout)
+{
+    UNUSED(msg_prio);
+    UINT32 uwRet;
+    UINT32 uwBufferSize;
+    LosQueueCB *pstQueue = (LosQueueCB *)mq_id;
+
+    if (pstQueue == NULL || msg_ptr == NULL || ((OS_INT_ACTIVE) && (0 != timeout))) {
+        return osErrorParameter;
+    }
+    if (pstQueue->queueSize < sizeof(UINT32)) {
+        return osErrorParameter;
+    }
+    uwBufferSize = (UINT32)(pstQueue->queueSize - sizeof(UINT32));
+    uwRet = LOS_QueueWriteCopy((UINT32)pstQueue->queueID, (void *)msg_ptr, uwBufferSize, timeout);
+    if (uwRet == LOS_OK) {
+        return osOK;
+    } else if (uwRet == LOS_ERRNO_QUEUE_INVALID || uwRet == LOS_ERRNO_QUEUE_NOT_CREATE) {
+        return osErrorParameter;
+    } else if (uwRet == LOS_ERRNO_QUEUE_TIMEOUT) {
+        return osErrorTimeout;
+    } else {
+        return osErrorResource;
+    }
+}
+
+
+osStatus_t osMessageQueueGet(osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout)
+{
+    UNUSED(msg_prio);
+    UINT32 uwRet;
+    UINT32 uwBufferSize;
+    LosQueueCB *pstQueue = (LosQueueCB *)mq_id;
+
+    if (pstQueue == NULL || msg_ptr == NULL || ((OS_INT_ACTIVE) && (0 != timeout))) {
+        return osErrorParameter;
+    }
+
+    uwBufferSize = (UINT32)(pstQueue->queueSize - sizeof(UINT32));
+    uwRet = LOS_QueueReadCopy((UINT32)pstQueue->queueID, msg_ptr, &uwBufferSize, timeout);
+    if (uwRet == LOS_OK) {
+        return osOK;
+    } else if (uwRet == LOS_ERRNO_QUEUE_INVALID || uwRet == LOS_ERRNO_QUEUE_NOT_CREATE) {
+        return osErrorParameter;
+    } else if (uwRet == LOS_ERRNO_QUEUE_TIMEOUT) {
+        return osErrorTimeout;
+    } else {
+        return osErrorResource;
+    }
+}
+
+uint32_t osMessageQueueGetCapacity(osMessageQueueId_t mq_id)
+{
+    uint32_t capacity;
+    LosQueueCB *pstQueue = (LosQueueCB *)mq_id;
+
+    if (pstQueue == NULL) {
+        capacity = 0U;
+    } else {
+        capacity = pstQueue->queueLen;
+    }
+
+    return (capacity);
+}
+
+uint32_t osMessageQueueGetMsgSize(osMessageQueueId_t mq_id)
+{
+    uint32_t size;
+    LosQueueCB *pstQueue = (LosQueueCB *)mq_id;
+
+    if (pstQueue == NULL) {
+        size = 0U;
+    } else {
+        size = pstQueue->queueSize - sizeof(UINT32);
+    }
+
+    return (size);
+}
+
+
+uint32_t osMessageQueueGetCount(osMessageQueueId_t mq_id)
+{
+    uint32_t count;
+    UINTPTR uwIntSave;
+    LosQueueCB *pstQueue = (LosQueueCB *)mq_id;
+
+    if (pstQueue == NULL) {
+        count = 0U;
+    } else {
+        uwIntSave = LOS_IntLock();
+        count = (uint32_t)(pstQueue->readWriteableCnt[OS_QUEUE_READ]);
+        LOS_IntRestore(uwIntSave);
+    }
+    return count;
+}
+
+
+uint32_t osMessageQueueGetSpace(osMessageQueueId_t mq_id)
+{
+    uint32_t space;
+    UINTPTR uwIntSave;
+    LosQueueCB *pstQueue = (LosQueueCB *)mq_id;
+
+    if (pstQueue == NULL) {
+        space = 0U;
+    } else {
+        uwIntSave = LOS_IntLock();
+        space = (uint32_t)pstQueue->readWriteableCnt[OS_QUEUE_WRITE];
+        LOS_IntRestore(uwIntSave);
+    }
+    return space;
+}
+
+osStatus_t osMessageQueueDelete(osMessageQueueId_t mq_id)
+{
+    LosQueueCB *pstQueue = (LosQueueCB *)mq_id;
+    UINT32 uwRet;
+
+    if (pstQueue == NULL) {
+        return osErrorParameter;
+    }
+
+    if (OS_INT_ACTIVE) {
+        return osErrorISR;
+    }
+
+    uwRet = LOS_QueueDelete((UINT32)pstQueue->queueID);
+    if (uwRet == LOS_OK) {
+        return osOK;
+    } else if (uwRet == LOS_ERRNO_QUEUE_NOT_FOUND || uwRet == LOS_ERRNO_QUEUE_NOT_CREATE) {
+        return osErrorParameter;
+    } else {
+        return osErrorResource;
+    }
+}
+void osThreadExit(void)
+{
+    return;
+}
+#endif
+
+#endif // (CMSIS_OS_VER == 2)
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __cplusplus */

+ 43 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/cmsis_os.h

@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CMSIS_OS_H_
+#define CMSIS_OS_H_
+
+#include "los_config.h"
+
+#if (CMSIS_OS_VER == 1)
+#error "cmsis version 1.0 is not supported now!"
+#elif (CMSIS_OS_VER == 2)
+#include "cmsis_os2.h"
+#endif
+
+#endif /* CMSIS_OS_H_ */

+ 1215 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/cmsis_os2.h

@@ -0,0 +1,1215 @@
+/*
+ * Copyright (c) 2013-2018 Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ----------------------------------------------------------------------
+ *
+ * $Date:        18. June 2018
+ * $Revision:    V2.1.3
+ *
+ * Project:      CMSIS-RTOS2 API
+ * Title:        cmsis_os2.h header file
+ *
+ * Version 2.1.3
+ *    Additional functions allowed to be called from Interrupt Service Routines:
+ *    - osThreadGetId
+ * Version 2.1.2
+ *    Additional functions allowed to be called from Interrupt Service Routines:
+ *    - osKernelGetInfo, osKernelGetState
+ * Version 2.1.1
+ *    Additional functions allowed to be called from Interrupt Service Routines:
+ *    - osKernelGetTickCount, osKernelGetTickFreq
+ *    Changed Kernel Tick type to uint32_t:
+ *    - updated: osKernelGetTickCount, osDelayUntil
+ * Version 2.1.0
+ *    Support for critical and uncritical sections (nesting safe):
+ *    - updated: osKernelLock, osKernelUnlock
+ *    - added: osKernelRestoreLock
+ *    Updated Thread and Event Flags:
+ *    - changed flags parameter and return type from int32_t to uint32_t
+ * Version 2.0.0
+ *    Initial Release
+ *---------------------------------------------------------------------------*/
+
+/**
+ * @addtogroup CMSIS
+ * @{
+ *
+ * @brief Provides standard, universal real-time operating system (RTOS) APIs.
+ *
+ * CMSIS Module may contain portions from ARM Cortex Microcontroller Software Interface Standard (CMSIS) licensed under Apache License v2.0.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+
+#ifndef CMSIS_OS2_H_
+#define CMSIS_OS2_H_
+
+#ifndef __NO_RETURN
+#if   defined(__CC_ARM)
+#define __NO_RETURN __declspec(noreturn)
+#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
+#define __NO_RETURN __attribute__((__noreturn__))
+#elif defined(__GNUC__)
+#define __NO_RETURN __attribute__((__noreturn__))
+#elif defined(__ICCARM__)
+#define __NO_RETURN __noreturn
+#else
+#define __NO_RETURN
+#endif
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+//  ==== Enumerations, structures, defines ====
+
+/**
+* @brief Describes the system version.
+*
+* @since 1.0
+* @version 1.0
+*/
+typedef struct {
+  /** API version */
+  uint32_t                       api;
+  /** Kernel version */
+  uint32_t                    kernel;
+} osVersion_t;
+
+/**
+* @brief Enumerates kernel states.
+*
+*/
+typedef enum {
+  /** The kernel is inactive. */
+  osKernelInactive        =  0,
+  /** The kernel is ready. */
+  osKernelReady           =  1,
+  /** The kernel is running. */
+  osKernelRunning         =  2,
+  /** The kernel is locked. */
+  osKernelLocked          =  3,
+  /** The kernel is suspended. */
+  osKernelSuspended       =  4,
+  /** The kernel is abnormal. */
+  osKernelError           = -1,
+  /** Reserved */
+  osKernelReserved        = 0x7FFFFFFFU
+} osKernelState_t;
+
+/**
+* @brief Enumerates thread states.
+*
+*/
+typedef enum {
+  /** The thread is inactive. */
+  osThreadInactive        =  0,
+  /** The thread is ready. */
+  osThreadReady           =  1,
+  /** The thread is running. */
+  osThreadRunning         =  2,
+  /** The thread is blocked. */
+  osThreadBlocked         =  3,
+  /** The thread is terminated. */
+  osThreadTerminated      =  4,
+  /** The thread is abnormal. */
+  osThreadError           = -1,
+  /** Reserved */
+  osThreadReserved        = 0x7FFFFFFF
+} osThreadState_t;
+
+/**
+* @brief Enumerates thread priorities.
+*
+*/
+typedef enum {
+  /** Undefined */
+  osPriorityNone          =  0,
+  /** Reserved for idle threads */
+  osPriorityIdle          =  1,
+  /** Low (unsupported) */
+  osPriorityLow           =  8,
+  /** Low + 1 */
+  osPriorityLow1          =  8+1,
+  /** Low + 2 */
+  osPriorityLow2          =  8+2,
+  /** Low + 3 */
+  osPriorityLow3          =  8+3,
+  /** Low + 4 */
+  osPriorityLow4          =  8+4,
+  /** Low + 5 */
+  osPriorityLow5          =  8+5,
+  /** Low + 6 */
+  osPriorityLow6          =  8+6,
+  /** Low + 7 */
+  osPriorityLow7          =  8+7,
+  /** Below normal */
+  osPriorityBelowNormal   = 16,
+  /** Below normal + 1 */
+  osPriorityBelowNormal1  = 16+1,
+  /** Below normal + 2 */
+  osPriorityBelowNormal2  = 16+2,
+  /** Below normal + 3 */
+  osPriorityBelowNormal3  = 16+3,
+  /** Below normal + 4 */
+  osPriorityBelowNormal4  = 16+4,
+  /** Below normal + 5 */
+  osPriorityBelowNormal5  = 16+5,
+  /** Below normal + 6 */
+  osPriorityBelowNormal6  = 16+6,
+  /** Below normal + 7 */
+  osPriorityBelowNormal7  = 16+7,
+  /** Normal */
+  osPriorityNormal        = 24,
+  /** Normal + 1 */
+  osPriorityNormal1       = 24+1,
+  /** Normal + 2 */
+  osPriorityNormal2       = 24+2,
+  /** Normal + 3 */
+  osPriorityNormal3       = 24+3,
+  /** Normal + 4 */
+  osPriorityNormal4       = 24+4,
+  /** Normal + 5 */
+  osPriorityNormal5       = 24+5,
+  /** Normal + 6 */
+  osPriorityNormal6       = 24+6,
+  /** Normal + 7 */
+  osPriorityNormal7       = 24+7,
+  /** Above normal */
+  osPriorityAboveNormal   = 32,
+  /** Above normal + 1 */
+  osPriorityAboveNormal1  = 32+1,
+  /** Above normal + 2 */
+  osPriorityAboveNormal2  = 32+2,
+  /** Above normal + 3 */
+  osPriorityAboveNormal3  = 32+3,
+  /** Above normal + 4 */
+  osPriorityAboveNormal4  = 32+4,
+  /** Above normal + 5 */
+  osPriorityAboveNormal5  = 32+5,
+  /** Above normal + 6 */
+  osPriorityAboveNormal6  = 32+6,
+  /** Above normal + 7 (unsupported) */
+  osPriorityAboveNormal7  = 32+7,
+  /** High (unsupported) */
+  osPriorityHigh          = 40,
+  /** High + 1 (unsupported) */
+  osPriorityHigh1         = 40+1,
+  /** High + 2 (unsupported)  */
+  osPriorityHigh2         = 40+2,
+  /** High + 3 (unsupported)  */
+  osPriorityHigh3         = 40+3,
+  /** High + 4 (unsupported)  */
+  osPriorityHigh4         = 40+4,
+  /** High + 5 (unsupported)  */
+  osPriorityHigh5         = 40+5,
+  /** High + 6 (unsupported)  */
+  osPriorityHigh6         = 40+6,
+  /** High + 7 (unsupported)  */
+  osPriorityHigh7         = 40+7,
+  /** Real-time (unsupported)  */
+  osPriorityRealtime      = 48,
+  /** Real-time + 1 (unsupported) */
+  osPriorityRealtime1     = 48+1,
+  /** Real-time + 2 (unsupported) */
+  osPriorityRealtime2     = 48+2,
+  /** Real-time + 3 (unsupported) */
+  osPriorityRealtime3     = 48+3,
+  /** Real-time + 4 (unsupported) */
+  osPriorityRealtime4     = 48+4,
+  /** Real-time + 5 (unsupported) */
+  osPriorityRealtime5     = 48+5,
+  /** Real-time + 6 (unsupported) */
+  osPriorityRealtime6     = 48+6,
+  /** Real-time + 7 (unsupported) */
+  osPriorityRealtime7     = 48+7,
+  /** Reserved for ISR deferred threads (unsupported) */
+  osPriorityISR           = 56,
+  /** Invalid */
+  osPriorityError         = -1,
+  /** Reserved. It enables the compiler to identify enumeration variables as 32-bit numbers and prevents the enumeration variables from being optimized. */
+  osPriorityReserved      = 0x7FFFFFFF
+} osPriority_t;
+
+/**
+* @brief Callback for thread scheduling
+*
+*/
+typedef void (*osThreadFunc_t) (void *argument);
+
+/**
+* @brief Callback for timer triggering
+*
+*/
+typedef void (*osTimerFunc_t) (void *argument);
+
+/**
+* @brief Enumerates timer types.
+*
+*/
+typedef enum {
+  /** One-shot timer */
+  osTimerOnce               = 0,
+  /** Repeating timer */
+  osTimerPeriodic           = 1
+} osTimerType_t;
+
+/**
+* @brief Indicates that the RTOS waits forever unless an event flag is received.
+*
+*/
+#define osWaitForever         0xFFFFFFFFU
+
+/**
+* @brief Indicates that the RTOS does not wait.
+*
+*/
+#define osNoWait              0x0U
+
+/**
+* @brief Indicates that the RTOS waits until any event flag is triggered.
+*
+*/
+#define osFlagsWaitAny        0x00000000U
+
+/**
+* @brief Indicates that the system waits until all event flags are triggered.
+*
+*/
+#define osFlagsWaitAll        0x00000001U
+
+/**
+* @brief Indicates that defined flags are not cleared.
+*
+*/
+#define osFlagsNoClear        0x00000002U
+
+/**
+* @brief Indicates a flag error.
+*
+*/
+#define osFlagsError          0x80000000U
+
+/**
+* @brief Indicates an unknown error.
+*
+*/
+#define osFlagsErrorUnknown   0xFFFFFFFFU
+
+/**
+* @brief Indicates a timeout.
+*
+*/
+#define osFlagsErrorTimeout   0xFFFFFFFEU
+
+/**
+* @brief Indicates a resource error.
+*
+*/
+#define osFlagsErrorResource  0xFFFFFFFDU
+
+/**
+* @brief Indicates an incorrect parameter.
+*
+*/
+#define osFlagsErrorParameter 0xFFFFFFFCU
+#define osFlagsErrorISR       0xFFFFFFFAU
+
+// Thread attributes (attr_bits in \ref osThreadAttr_t).
+#define osThreadDetached      0x00000000U
+#define osThreadJoinable      0x00000001U
+
+// Mutex attributes (attr_bits in \ref osMutexAttr_t).
+#define osMutexRecursive      0x00000001U
+#define osMutexPrioInherit    0x00000002U
+#define osMutexRobust         0x00000008U
+
+/**
+* @brief Enumerates return values of CMSIS-RTOS.
+*
+*/
+typedef enum {
+  /** Operation completed successfully */
+  osOK                      =  0,
+  /** Unspecified error */
+  osError                   = -1,
+  /** Timeout */
+  osErrorTimeout            = -2,
+  /** Resource error */
+  osErrorResource           = -3,
+  /** Incorrect parameter */
+  osErrorParameter          = -4,
+  /** Insufficient memory */
+  osErrorNoMemory           = -5,
+  /** Service interruption */
+  osErrorISR                = -6,
+  /** Reserved. It is used to prevent the compiler from optimizing enumerations. */
+  osStatusReserved          = 0x7FFFFFFF
+} osStatus_t;
+
+/**
+* @brief Identifies a thread.
+*
+*/
+typedef void *osThreadId_t;
+
+/**
+* @brief Identifies a timer.
+*
+*/
+typedef void *osTimerId_t;
+
+/**
+* @brief Identifies an event flag.
+*
+*/
+typedef void *osEventFlagsId_t;
+
+/**
+* @brief Identifies a mutex.
+*
+*/
+typedef void *osMutexId_t;
+
+/**
+* @brief Identifies a semaphore object.
+*
+*/
+typedef void *osSemaphoreId_t;
+
+
+typedef void *osMemoryPoolId_t;
+
+/**
+* @brief Identifies a message queue.
+*
+*/
+typedef void *osMessageQueueId_t;
+
+
+#ifndef TZ_MODULEID_T
+#define TZ_MODULEID_T
+
+/**
+* @brief Identifies a TrustZone module call process.
+*
+*/
+typedef uint32_t TZ_ModuleId_t;
+#endif
+
+/**
+* @brief Describes thread attributes.
+*
+* @since 1.0
+* @version 1.0
+*/
+typedef struct {
+  /** Thread name */
+  const char                   *name;
+  /** Thread attribute bits */
+  uint32_t                 attr_bits;
+  /** Memory for the thread control block */
+  void                      *cb_mem;
+  /** Size of the memory for the thread control block */
+  uint32_t                   cb_size;
+  /** Memory for the thread stack */
+  void                   *stack_mem;
+  /** Size of the thread stack */
+  uint32_t                stack_size;
+  /** Thread priority */
+  osPriority_t              priority;
+  /** TrustZone module of the thread */
+  TZ_ModuleId_t            tz_module;
+  /** Reserved */
+  uint32_t                  reserved;
+} osThreadAttr_t;
+
+/**
+* @brief Describes timer attributes.
+*
+* @since 1.0
+* @version 1.0
+*/
+typedef struct {
+  /** Timer name */
+  const char                   *name;
+  /** Reserved attribute bits */
+  uint32_t                 attr_bits;
+  /** Memory for the timer control block */
+  void                      *cb_mem;
+  /** Size of the memory for the timer control block */
+  uint32_t                   cb_size;
+} osTimerAttr_t;
+
+/**
+* @brief Describes event attributes.
+*
+* @since 1.0
+* @version 1.0
+*/
+typedef struct {
+  /** Event name */
+  const char                   *name;
+  /** Reserved attribute bits */
+  uint32_t                 attr_bits;
+  /** Memory for the event control block */
+  void                      *cb_mem;
+  /** Size of the memory for the event control block */
+  uint32_t                   cb_size;
+} osEventFlagsAttr_t;
+
+/**
+* @brief Describes mutex attributes.
+*
+* @since 1.0
+* @version 1.0
+*/
+typedef struct {
+  /** Mutex name */
+  const char                   *name;
+  /** Reserved attribute bits */
+  uint32_t                 attr_bits;
+  /** Memory for the mutex control block */
+  void                      *cb_mem;
+  /** Size of the memory for the mutex control block */
+  uint32_t                   cb_size;
+} osMutexAttr_t;
+
+/**
+* @brief Describes semaphore attributes.
+*
+* @since 1.0
+* @version 1.0
+*/
+typedef struct {
+  /** Semaphore name */
+  const char                   *name;
+  /** Reserved attribute bits */
+  uint32_t                 attr_bits;
+  /** Memory for the semaphore control block */
+  void                      *cb_mem;
+  /** Size of the memory for the semaphore control block */
+  uint32_t                   cb_size;
+} osSemaphoreAttr_t;
+
+
+typedef struct {
+  const char                   *name;
+  uint32_t                 attr_bits;
+  void                      *cb_mem;
+  uint32_t                   cb_size;
+  void                      *mp_mem;
+  uint32_t                   mp_size;
+} osMemoryPoolAttr_t;
+
+/**
+* @brief Describes message queue attributes.
+*
+* @since 1.0
+* @version 1.0
+*/
+typedef struct {
+  /** Message queue name */
+  const char                   *name;
+  /** Reserved attribute bits */
+  uint32_t                 attr_bits;
+  /** Memory for the message queue control block */
+  void                      *cb_mem;
+  /** Size of the memory for the message queue control block */
+  uint32_t                   cb_size;
+  /** Memory for storing data in the message queue */
+  void                      *mq_mem;
+  /** Size of the memory for storing data in the message queue */
+  uint32_t                   mq_size;
+} osMessageQueueAttr_t;
+
+
+//  ==== Kernel Management Functions ====
+
+/**
+* @brief Initializes the RTOS kernel.
+*
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osKernelInitialize (void);
+
+/**
+* @brief Obtains the system version and name.
+*
+* @param version Indicates the pointer to the buffer for storing the version.
+* @param id_buf Indicates the pointer to the buffer for storing the kernel ID.
+* @param id_size Indicates the size of the buffer for storing the kernel ID.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osKernelGetInfo (osVersion_t *version, char *id_buf, uint32_t id_size);
+
+/**
+* @brief Obtains the kernel state.
+*
+* @return Returns the kernel state.
+* @since 1.0
+* @version 1.0
+*/
+osKernelState_t osKernelGetState (void);
+
+/**
+* @brief Starts the kernel.
+*
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osKernelStart (void);
+
+/**
+* @brief Locks the kernel.
+*
+* @return Returns 1 if the kernel is locked successfully; returns 0 if the lock starts; returns a negative value in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+int32_t osKernelLock (void);
+
+/**
+* @brief Unlocks the kernel.
+*
+* @return Returns 1 if the kernel is unlocked successfully; returns 0 if the kernel is not locked; returns a negative value in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+int32_t osKernelUnlock (void);
+
+/**
+* @brief Restores the previous lock state of the kernel.
+*
+* @param lock Indicates the lock state to restore to. The value 1 indicates the locked state, and 0 indicates the unlocked state.
+* @return Returns 1 if the kernel is locked; returns 0 if the kernel is not locked; returns a negative value in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+int32_t osKernelRestoreLock (int32_t lock);
+
+uint32_t osKernelSuspend (void);
+
+void osKernelResume (uint32_t sleep_ticks);
+
+/// Get the RTOS kernel tick count.
+/// \return RTOS kernel current tick count.
+uint32_t osKernelGetTickCount (void);
+
+
+
+/**
+* @brief Obtains the number of kernel ticks per second.
+*
+* @return Returns the number of kernel ticks.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osKernelGetTickFreq (void);
+
+/**
+* @brief Obtains the kernel system timer.
+*
+* @return Returns the kernel system timer.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osKernelGetSysTimerCount (void);
+
+/**
+* @brief Obtains the frequency of the system timer.
+*
+* @return Returns the system timer frequency.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osKernelGetSysTimerFreq (void);
+
+
+//  ==== Thread Management Functions ====
+
+/**
+* @brief Creates an active thread.
+*
+* The priority ranges from 9 to 38. Select a proper priority as required.
+* The maximum of tasks is LOSCFG_BASE_CORE_TSK_LIMIT(LOSCFG_BASE_CORE_TSK_LIMIT is defined in the traget_config.h).
+* @param func Indicates the entry of the thread callback function.
+* @param argument Indicates the pointer to the argument passed to the thread.
+* @param attr Indicates the thread attributes.
+* @return Returns the thread ID; returns NULL in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+osThreadId_t osThreadNew (osThreadFunc_t func, void *argument, const osThreadAttr_t *attr);
+
+/**
+* @brief Obtains the name of a thread.
+*
+* @param thread_id Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId.
+* @return Returns the thread name; returns NULL in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+const char *osThreadGetName (osThreadId_t thread_id);
+
+/**
+* @brief Obtains the ID of the currently running thread.
+*
+* @return Returns the thread ID; returns NULL in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+osThreadId_t osThreadGetId (void);
+
+
+/**
+* @brief Obtains the state of a thread.
+*
+* @param thread_id Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId.
+* @return Returns the thread state.
+* @since 1.0
+* @version 1.0
+*/
+osThreadState_t osThreadGetState (osThreadId_t thread_id);
+
+/**
+* @brief Obtains the stack size of a thread.
+*
+* @param thread_id Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId.
+* @return Returns the stack size, in bytes; returns 0 in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osThreadGetStackSize (osThreadId_t thread_id);
+
+/**
+* @brief Obtains the size of the available stack space for a thread based on the stack watermark.
+*
+* @param thread_id Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId.
+* @return Returns the available stack size, in bytes; returns 0 in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osThreadGetStackSpace (osThreadId_t thread_id);
+
+/**
+* @brief Changes the priority of a thread.
+*
+* @param thread_id Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId.
+* @param priority Indicates the new priority.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osThreadSetPriority (osThreadId_t thread_id, osPriority_t priority);
+
+/**
+* @brief Gets the prority of an active thread.
+*
+* @param thread_id Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId.
+* @return Returns the prority of the thread.
+* @since 1.0
+* @version 1.0
+*/
+osPriority_t osThreadGetPriority (osThreadId_t thread_id);
+
+/**
+* @brief Sets the currently running thread to the ready state.
+*
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osThreadYield (void);
+
+/**
+* @brief Suspends a thread.
+*
+* @param thread_id Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osThreadSuspend (osThreadId_t thread_id);
+
+/**
+* @brief Resumes a thread from the suspended state.
+*
+* @param thread_id Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osThreadResume (osThreadId_t thread_id);
+
+osStatus_t osThreadDetach (osThreadId_t thread_id);
+
+osStatus_t osThreadJoin (osThreadId_t thread_id);
+
+void osThreadExit (void);
+
+/**
+* @brief Terminates a thread.
+*
+* @param thread_id Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osThreadTerminate (osThreadId_t thread_id);
+
+/**
+* @brief Obtains the number of active threads.
+*
+* @return Returns the number; returns 0 in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osThreadGetCount (void);
+
+uint32_t osThreadEnumerate (osThreadId_t *thread_array, uint32_t array_items);
+
+
+//  ==== Thread Flags Functions ====
+
+uint32_t osThreadFlagsSet (osThreadId_t thread_id, uint32_t flags);
+
+uint32_t osThreadFlagsClear (uint32_t flags);
+
+uint32_t osThreadFlagsGet (void);
+
+uint32_t osThreadFlagsWait (uint32_t flags, uint32_t options, uint32_t timeout);
+
+
+//  ==== Generic Wait Functions ====
+
+/**
+* @brief Waits for a period of time.
+*
+* @param ticks Indicates the number of ticks to wait for.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osDelay (uint32_t ticks);
+
+/**
+* @brief Waits until a specified time arrives.
+*
+* This function handles the overflow of the system timer. Note that the maximum value of this parameter is (2^31 - 1) ticks.
+* @param ticks Indicates the number of ticks converted from the absolute time.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osDelayUntil (uint32_t ticks);
+
+
+//  ==== Timer Management Functions ====
+
+/**
+* @brief Creates and initializes a timer.
+*
+* This function creates a timer associated with the arguments callback function. The timer stays in the stopped state until OSTimerStart is used to start the timer.
+* The timer precision is 1000 / LOSCFG_BASE_CORE_TICK_PER_SECOND ms(LOSCFG_BASE_CORE_TICK_PER_SECOND is defined in the traget_config.h).
+* @param func Indicates the entry of the timer callback function.
+* @param type Indicates the timer type.
+* @param argument Indicates the pointer to the argument used in timer callback.
+* @param attr Indicates the pointer to the timer attributes. This parameter is not used.
+* @return Returns the timer ID; returns NULL in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+osTimerId_t osTimerNew (osTimerFunc_t func, osTimerType_t type, void *argument, const osTimerAttr_t *attr);
+
+/**
+* @brief Obtains the timer name.
+*
+* @param timer_id Indicates the timer ID, which is obtained using osTimerNew.
+* @return Returns the timer name; returns NULL in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+const char *osTimerGetName (osTimerId_t timer_id);
+
+/**
+* @brief Starts or restarts a timer.
+*
+* @param timer_id Indicates the timer ID, which is obtained using osTimerNew.
+* @param ticks Indicates the number of ticks since the timer starts running.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osTimerStart (osTimerId_t timer_id, uint32_t ticks);
+
+/**
+* @brief Stops a timer.
+*
+* @param timer_id Indicates the timer ID, which is obtained using osTimerNew.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osTimerStop (osTimerId_t timer_id);
+
+/**
+* @brief Checks whether a timer is running.
+*
+* @param timer_id Indicates the timer ID, which is obtained using osTimerNew.
+* @return Returns 1 if the timer is running; returns 0 otherwise.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osTimerIsRunning (osTimerId_t timer_id);
+
+/**
+* @brief Deletes a timer.
+*
+* @param timer_id Indicates the timer ID, which is obtained using osTimerNew.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osTimerDelete (osTimerId_t timer_id);
+
+
+//  ==== Event Flags Management Functions ====
+
+/**
+* @brief Creates and initializes an event flags object.
+*
+* @param attr Indicates the pointer to the event flags attributes. This parameter is not used.
+* @return Returns the event flags ID; returns NULL in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+osEventFlagsId_t osEventFlagsNew (const osEventFlagsAttr_t *attr);
+
+/**
+* @brief Obtains the name of an event flags object.
+*
+* @param ef_id Indicates the event flags ID, which is obtained using osEventFlagsNew.
+* @return Returns the event flags name; returns NULL in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+const char *osEventFlagsGetName (osEventFlagsId_t ef_id);
+
+/**
+* @brief Sets event flags.
+*
+* @param ef_id Indicates the event flags ID, which is obtained using osEventFlagsNew.
+* @param flags Indicates the event flags to set.
+* @return Returns the event flags; returns osFlagsErrorParameter in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags);
+
+/**
+* @brief Clears event flags.
+*
+* @param ef_id Indicates the event flags ID, which is obtained using osEventFlagsNew.
+* @param flags Indicates the event flags to clear.
+* @return Returns the event flags; returns osFlagsErrorParameter in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osEventFlagsClear (osEventFlagsId_t ef_id, uint32_t flags);
+
+/**
+* @brief Obtains event flags.
+*
+* @param ef_id Indicates the event flags ID, which is obtained using osEventFlagsNew.
+* @return Returns the event flags triggered.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osEventFlagsGet (osEventFlagsId_t ef_id);
+
+/**
+* @brief Waits for event flags to trigger.
+*
+* When the specified flag of the event is set, the function returns immediately. Otherwise, the thread is blocked.
+* @param ef_id Indicates the event flags ID, which is obtained using osEventFlagsNew.
+* @param flags Indicates the event flags to trigger.
+* @param options Indicates the configuration of the event flags to trigger.
+* @param timeout Indicates the timeout duration.
+* @return Returns the triggered event flags; returns an error value in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout);
+
+/**
+* @brief Deletes an event flags object.
+*
+* @param ef_id Indicates the event flags ID, which is obtained using osEventFlagsNew.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osEventFlagsDelete (osEventFlagsId_t ef_id);
+
+
+//  ==== Mutex Management Functions ====
+
+/**
+* @brief Creates and initializes a mutex.
+*
+* @param attr Indicates the pointer to the mutex attributes. This parameter is not used.
+* @return Returns the mutex ID; returns NULL in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+osMutexId_t osMutexNew (const osMutexAttr_t *attr);
+
+const char *osMutexGetName (osMutexId_t mutex_id);
+
+/**
+* @brief Obtains a mutex.
+*
+* @param mutex_id Indicates the mutex ID, which is obtained using osMutexNew.
+* @param timeout Indicates the timeout duration.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osMutexAcquire (osMutexId_t mutex_id, uint32_t timeout);
+
+/**
+* @brief Releases a mutex.
+*
+* @param mutex_id Indicates the mutex ID, which is obtained using osMutexNew.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osMutexRelease (osMutexId_t mutex_id);
+
+/**
+* @brief Obtains the thread ID of the currently acquired mutex.
+*
+* @param mutex_id Indicates the mutex ID, which is obtained using osMutexNew.
+* @return Returns the thread ID.
+* @since 1.0
+* @version 1.0
+*/
+osThreadId_t osMutexGetOwner (osMutexId_t mutex_id);
+
+/**
+* @brief Deletes a mutex.
+*
+* @param mutex_id Indicates the mutex ID, which is obtained using osMutexNew.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osMutexDelete (osMutexId_t mutex_id);
+
+
+//  ==== Semaphore Management Functions ====
+
+/**
+* @brief Creates and initializes a semaphore object.
+*
+* @param max_count Indicates the maximum number of available tokens that can be applied for.
+* @param initial_count Indicates the initial number of available tokens.
+* @param attr Indicates the pointer to the semaphore attributes. This parameter is not used.
+* @return Returns the semaphore ID; returns NULL in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+osSemaphoreId_t osSemaphoreNew (uint32_t max_count, uint32_t initial_count, const osSemaphoreAttr_t *attr);
+
+const char *osSemaphoreGetName (osSemaphoreId_t semaphore_id);
+
+/**
+* @brief Acquires a token of a semaphore object.
+*
+* @param semaphore_id Indicates the semaphore ID, which is obtained using osSemaphoreNew.
+* @param timeout Indicates the timeout duration. This parameter is the number of ticks.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osSemaphoreAcquire (osSemaphoreId_t semaphore_id, uint32_t timeout);
+
+/**
+* @brief Releases a token of a semaphore object.
+*
+* @param semaphore_id Indicates the semaphore ID, which is obtained using osSemaphoreNew.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osSemaphoreRelease (osSemaphoreId_t semaphore_id);
+
+/**
+* @brief Obtains the number of available tokens of a semaphore object.
+*
+* @param semaphore_id Indicates the semaphore ID, which is obtained using osSemaphoreNew.
+* @return Returns the number of available tokens.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osSemaphoreGetCount (osSemaphoreId_t semaphore_id);
+
+/**
+* @brief Deletes a semaphore object.
+*
+* @param semaphore_id Indicates the semaphore ID, which is obtained using osSemaphoreNew.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osSemaphoreDelete (osSemaphoreId_t semaphore_id);
+
+
+//  ==== Memory Pool Management Functions ====
+
+osMemoryPoolId_t osMemoryPoolNew (uint32_t block_count, uint32_t block_size, const osMemoryPoolAttr_t *attr);
+
+const char *osMemoryPoolGetName (osMemoryPoolId_t mp_id);
+
+void *osMemoryPoolAlloc (osMemoryPoolId_t mp_id, uint32_t timeout);
+
+osStatus_t osMemoryPoolFree (osMemoryPoolId_t mp_id, void *block);
+
+uint32_t osMemoryPoolGetCapacity (osMemoryPoolId_t mp_id);
+
+uint32_t osMemoryPoolGetBlockSize (osMemoryPoolId_t mp_id);
+
+uint32_t osMemoryPoolGetCount (osMemoryPoolId_t mp_id);
+
+uint32_t osMemoryPoolGetSpace (osMemoryPoolId_t mp_id);
+
+osStatus_t osMemoryPoolDelete (osMemoryPoolId_t mp_id);
+
+
+//  ==== Message Queue Management Functions ====
+
+/**
+* @brief Creates and initializes a message queue.
+*
+* @param msg_count Indicates the number of messages in the message queue.
+* @param msg_size Indicates the size of messages in the message queue.
+* @param attr Indicates the pointer to the message queue attributes. This parameter is not used.
+* @return Returns the message queue ID; returns NULL in the case of an error.
+* @since 1.0
+* @version 1.0
+*/
+osMessageQueueId_t osMessageQueueNew (uint32_t msg_count, uint32_t msg_size, const osMessageQueueAttr_t *attr);
+
+const char *osMessageQueueGetName (osMessageQueueId_t mq_id);
+
+/**
+* @brief Places a message in a message queue.
+*
+* @param mq_id Indicates the message queue ID, which is obtained using osMessageQueueNew.
+* @param msg_ptr Indicates the pointer to the buffer for storing the message to be placed in the message queue.
+* @param msg_prio Indicates the priority of the message to be placed in the message queue. This parameter is not used.
+* @param timeout Indicates the timeout duration.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout);
+
+/**
+* @brief Obtains a message in a message queue.
+*
+* @param mq_id Indicates the message queue ID, which is obtained using osMessageQueueNew.
+* @param msg_ptr Indicates the pointer to the buffer for storing the message to be retrieved from the message queue.
+* @param msg_prio Indicates the pointer to the buffer for storing the priority of the message to be retrieved from the message queue. This parameter is not used.
+* @param timeout Indicates the timeout duration.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osMessageQueueGet (osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout);
+
+/**
+* @brief Obtains the maximum number of messages that can be placed in a message queue.
+*
+* @param mq_id Indicates the message queue ID, which is obtained using osMessageQueueNew.
+* @return Returns the maximum number.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osMessageQueueGetCapacity (osMessageQueueId_t mq_id);
+
+/**
+* @brief Obtains the maximum size of messages that can be placed in a message queue.
+*
+* @param mq_id Indicates the message queue ID, which is obtained using osMessageQueueNew.
+* @return Returns the maximum message size.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osMessageQueueGetMsgSize (osMessageQueueId_t mq_id);
+
+/**
+* @brief Obtains the number of queued messages in a message queue.
+*
+* @param mq_id Indicates the message queue ID, which is obtained using osMessageQueueNew.
+* @return Returns the number of queued messages.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osMessageQueueGetCount (osMessageQueueId_t mq_id);
+
+/**
+* @brief Obtains the number of available slots for messages in a message queue.
+*
+* @param mq_id Indicates the message queue ID, which is obtained using osMessageQueueNew.
+* @return Returns the number of available slots for messages.
+* @since 1.0
+* @version 1.0
+*/
+uint32_t osMessageQueueGetSpace (osMessageQueueId_t mq_id);
+
+osStatus_t osMessageQueueReset (osMessageQueueId_t mq_id);
+
+/**
+* @brief Deletes a message queue.
+*
+* @param mq_id Indicates the message queue ID, which is obtained using osMessageQueueNew.
+* @return Returns the CMSIS-RTOS running result.
+* @since 1.0
+* @version 1.0
+*/
+osStatus_t osMessageQueueDelete (osMessageQueueId_t mq_id);
+
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif  // CMSIS_OS2_H_

+ 56 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/cmsis/hos_cmsis_adp.h

@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HOS_CMSIS_ADP_H
+#define HOS_CMSIS_ADP_H
+
+#include "cmsis_os.h"
+#include "ohos_types.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif /* __cplusplus */
+
+typedef struct {
+    osSemaphoreAttr_t attr;
+    uint32 maxCount;
+    uint32 initialCount;
+} SemaphoreEx;
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif /* __cplusplus */
+
+#endif

+ 48 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/posix/BUILD.gn

@@ -0,0 +1,48 @@
+# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list of
+#    conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this list
+#    of conditions and the following disclaimer in the documentation and/or other materials
+#    provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its contributors may be used
+#    to endorse or promote products derived from this software without specific prior written
+#    permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import("//build/lite/config/component/lite_component.gni")
+
+static_library("posix") {
+  sources = [
+    "src/file.c",
+    "src/libc.c",
+    "src/pthread.c",
+    "src/pthread_attr.c",
+    "src/time.c",
+  ]
+
+  include_dirs = [ "include" ]
+  defines = [
+    "LIBC_VERSION_NUM=0x00010000",
+    "LIBC_VERSION_STR=\"1.0.0-liteos_m\"",
+  ]
+
+  cflags = [ "-Werror" ]
+}

+ 12 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/posix/include/README

@@ -0,0 +1,12 @@
+Root directory "//" refers to "/vendor/hisi/hi3861/hi3861".
+We use header files from musl ("//platform/os/Huawei_LiteOS/components/lib/libc/musl/include").
+
+Some posix apis are already defined in different places:
+errno is defined in             //build/libs/libc_base.o
+malloc and free are defined in  //build/libs/libc_base.o
+pthread_mutex_* are defined in  //build/libs/hi3861/release/no_mesh/liblitekernel_flash.a
+semaphore is defined in         //build/libs/hi3861/release/no_mesh/liblitekernel_flash.a
+usleep is defined in            //build/libs/hi3861/release/no_mesh/liblitekernel_flash.a
+clock_* are defined in          //build/libs/liblitekernel_base.o
+printf is defined in            //build/libs/liblitekernel_base.o
+fcntl and socket apis are defined in //build/libs/liblwip.a

+ 46 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/posix/include/libc.h

@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LIBC_H_
+#define LIBC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+const char *libc_get_version_string(void);
+int libc_get_version(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // LIBC_H_

+ 43 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/posix/include/limits.h

@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _KAL_LIMITS_H
+#define _KAL_LIMITS_H
+
+#include_next <limits.h>
+
+#ifndef PTHREAD_STACK_MIN
+#ifdef __LITEOS__
+#define PTHREAD_STACK_MIN LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE
+#endif
+#endif
+
+#endif

+ 49 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/posix/include/pthread.h

@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _KAL_PTHREAD_H
+#define _KAL_PTHREAD_H
+
+#include_next <pthread.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _GNU_SOURCE
+int pthread_getname_np(pthread_t, char *, size_t);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

+ 285 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/posix/src/file.c

@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <securec.h>
+
+#include "lwip/sockets.h"
+#include "hks_client.h"
+#include "hi_fs.h"
+
+#define RANDOM_DEV_FD  (LWIP_SOCKET_OFFSET + LWIP_CONFIG_NUM_SOCKETS)
+#define RANDOM_DEV_PATH  "/dev/random"
+
+#define IS_SOCKET_FD(fd) ((fd) >= LWIP_SOCKET_OFFSET && (fd) < (LWIP_SOCKET_OFFSET + LWIP_CONFIG_NUM_SOCKETS))
+
+#define HI_FS_MAX_OPEN_FILES (32+1)
+#define HI_FS_FD_OFFSET RANDOM_DEV_FD
+
+#define IS_HI_FS_FD(fd) ((fd) >= HI_FS_FD_OFFSET && (fd) < (HI_FS_FD_OFFSET + HI_FS_MAX_OPEN_FILES))
+#define HI_FS_FD(fd) ((fd) - HI_FS_FD_OFFSET)
+
+#define FREE_AND_SET_NULL(ptr) do { \
+    free(ptr);                      \
+    ptr = NULL;                     \
+} while (0)
+
+/**
+ * @brief Get canonical form of a given path based on cwd(Current working directory).
+ *
+ * @param cwd Indicates the current working directory.
+ * @param path Indicates the path to be canonicalization.
+ * @param buf Indicates the pointer to the buffer where the result will be return.
+ * @param bufSize Indicates the size of the buffer.
+ * @return Returns the length of the canonical path.
+ *
+ * @attention if path is an absolute path, cwd is ignored. if cwd if not specified, it is assumed to be root('/').
+ *            if the buffer is not big enough the result will be truncated, but the return value will always be the
+ *            length of the canonical path.
+ */
+static size_t GetCanonicalPath(const char *cwd, const char *path, char *buf, size_t bufSize)
+{
+    if (!path) {
+        path = "";
+    }
+
+    if (!cwd || path[0] == '/') {
+        cwd = "";
+    }
+
+    size_t tmpLen = strlen(cwd) + strlen(path) + 4; // three '/' and one '\0'
+    if (tmpLen <= 0) {
+        return 0;
+    }
+    char *tmpBuf = (char *)malloc(tmpLen);
+    if (tmpBuf == NULL) {
+        return 0;
+    }
+
+    if (-1 == sprintf_s(tmpBuf, tmpLen, "/%s/%s/", cwd, path)) {
+        free(tmpBuf);
+        return 0;
+    }
+
+    char *p;
+    /* replace /./ to / */
+    while ((p = strstr(tmpBuf, "/./")) != NULL) {
+        if (EOK != memmove_s(p, tmpLen - (p - tmpBuf), p + 2, tmpLen - (p - tmpBuf) - 2)) {
+            free(tmpBuf);
+            return 0;
+        }
+    }
+
+    /* replace // to / */
+    while ((p = strstr(tmpBuf, "//")) != NULL) {
+        if (EOK != memmove_s(p, tmpLen - (p - tmpBuf), p + 1, tmpLen - (p - tmpBuf) - 1)) {
+            free(tmpBuf);
+            return 0;
+        }
+    }
+
+    /* handle /../ (e.g., replace /aa/bb/../ to /aa/) */
+    while ((p = strstr(tmpBuf, "/../")) != NULL) {
+        char *start = p;
+        while (start > tmpBuf && *--start != '/') {
+        }
+        if (EOK != memmove_s(start, tmpLen - (start - tmpBuf), p + 3, tmpLen - (p - tmpBuf) - 3)) {
+            free(tmpBuf);
+            return 0;
+        }
+    }
+
+    size_t totalLen = strlen(tmpBuf);
+
+    /* strip the last / */
+    if (totalLen > 1 && tmpBuf[totalLen - 1] == '/') {
+        tmpBuf[--totalLen] = 0;
+    }
+
+    if (!buf || bufSize == 0) {
+        free(tmpBuf);
+        return totalLen;
+    }
+
+    if (EOK != memcpy_s(buf, bufSize, tmpBuf, (totalLen + 1 > bufSize) ? bufSize : totalLen + 1)) {
+        free(tmpBuf);
+        return 0;
+    }
+
+    buf[bufSize - 1] = 0;
+    free(tmpBuf);
+    return totalLen;
+}
+
+int open(const char *file, int oflag, ...)
+{
+    int fd = -1;
+    unsigned flags = O_RDONLY | O_WRONLY | O_RDWR | O_APPEND | O_CREAT | O_LARGEFILE | O_TRUNC | O_EXCL | O_DIRECTORY;
+    if (((unsigned)oflag & ~flags) || (file == NULL)) {
+        errno = EINVAL;
+        return -1;
+    }
+    size_t pathLen = strlen(file) + 1;
+    if (pathLen <= 0) {
+        errno = EINVAL;
+        return -1;
+    }
+    char *canonicalPath = (char *)malloc(pathLen);
+    if (!canonicalPath) {
+        errno = ENOMEM;
+        return -1;
+    }
+    if (GetCanonicalPath(NULL, file, canonicalPath, pathLen) == 0) {
+        FREE_AND_SET_NULL(canonicalPath);
+        errno = ENOMEM;
+        return -1;
+    }
+    if (strcmp(canonicalPath, RANDOM_DEV_PATH) == 0) {
+        FREE_AND_SET_NULL(canonicalPath);
+        if ((O_ACCMODE & (unsigned)oflag) != O_RDONLY) {
+            errno = EPERM;
+            return -1;
+        }
+        if ((unsigned)oflag & O_DIRECTORY) {
+            errno = ENOTDIR;
+            return -1;
+        }
+        return RANDOM_DEV_FD;
+    }
+    if (strcmp(canonicalPath, "/") == 0 || strcmp(canonicalPath, "/dev") == 0) {
+        FREE_AND_SET_NULL(canonicalPath);
+        if ((unsigned)oflag & O_DIRECTORY) {
+            errno = EPERM;
+            return -1;
+        }
+        errno = EISDIR;
+        return -1;
+    }
+    FREE_AND_SET_NULL(canonicalPath);
+    fd = hi_open(file, (uint32_t)oflag);
+    if (fd < 0) {
+	return -1;
+    }
+    return fd + HI_FS_FD_OFFSET;
+}
+
+int close(int fd)
+{
+    if (fd == RANDOM_DEV_FD) {
+        return 0;
+    }
+    if (IS_SOCKET_FD(fd)) {
+        return closesocket(fd);
+    }
+    if (IS_HI_FS_FD(fd)) {
+        return hi_close(HI_FS_FD(fd));
+    }
+    errno = EBADF;
+    return -1;
+}
+
+ssize_t read(int fd, void *buf, size_t nbytes)
+{
+    if (fd == RANDOM_DEV_FD) {
+        if (nbytes == 0) {
+            return 0;
+        }
+        if (buf == NULL) {
+            errno = EINVAL;
+            return -1;
+        }
+        if (nbytes > 1024) {
+            nbytes = 1024; /* hks_generate_random: random_size must <= 1024 */
+        }
+        struct hks_blob key = {HKS_BLOB_TYPE_RAW, (uint8_t *)buf, nbytes};
+        if (hks_generate_random(&key) != 0) {
+            errno = EIO;
+            return -1;
+        }
+        return (ssize_t)nbytes;
+    }
+    if (IS_SOCKET_FD(fd)) {
+        return recv(fd, buf, nbytes, 0);
+    }
+    if (IS_HI_FS_FD(fd)) {
+        return hi_read(HI_FS_FD(fd), buf, nbytes);
+    }
+    errno = EBADF;
+    return -1;
+}
+
+ssize_t write(int fd, const void *buf, size_t nbytes)
+{
+    if (fd == RANDOM_DEV_FD) {
+        errno = EBADF; /* "/dev/random" is readonly */
+        return -1;
+    }
+    if (IS_SOCKET_FD(fd)) {
+        return send(fd, buf, nbytes, 0);
+    }
+    if (IS_HI_FS_FD(fd)) {
+        return hi_write(HI_FS_FD(fd), (const char*)buf, nbytes);
+    }
+    errno = EBADF;
+    return -1;
+}
+
+off_t lseek(int fd, off_t offset, int whence)
+{
+    if (fd == RANDOM_DEV_FD) {
+        errno = ENOTSUP;
+        return (off_t)-1;
+    }
+    if (IS_SOCKET_FD(fd)) {
+        errno = ESPIPE;
+        return (off_t)-1;
+    }
+    if (IS_HI_FS_FD(fd)) {
+        return hi_lseek(HI_FS_FD(fd), offset, whence);
+    }
+    errno = EBADF;
+    return (off_t)-1;
+}
+
+int unlink(const char *path)
+{
+    return hi_unlink(path);
+}
+
+int fsync(int fd)
+{
+    (void)fd;
+    return 0;
+}

+ 50 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/posix/src/libc.c

@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <libc.h>
+
+/**
+ * get libc version string.
+ * @return libc version string. the format is <major>.<minor>.<patch>[-<platform>[-<desc>]]
+ */
+const char *libc_get_version_string(void)
+{
+    return LIBC_VERSION_STR;
+}
+
+/**
+ * get libc version code.
+ * @return libc version code. the format is 0x00XXYYZZ, XX is major version, YY is minor version and ZZ is patch version
+ */
+int libc_get_version(void)
+{
+    return LIBC_VERSION_NUM;
+}

+ 262 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/posix/src/pthread.c

@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <securec.h>
+#include "los_task.h"
+#include "los_task_pri.h"
+
+#define PTHREAD_NAMELEN 16
+
+/* this is just an assertion: LOS_TASK_ARG_NUM >= 4 */
+typedef char NULNAM[-!((LOS_TASK_ARG_NUM * 4) >= PTHREAD_NAMELEN)];
+
+static void *PthreadEntry(UINT32 param1, UINT32 param2, UINT32 param3, UINT32 param4)
+{
+    void *(*startRoutine)(void *) = (void *)(UINTPTR)param1;
+    void *param = (void *)(UINTPTR)param2;
+    (void)param3;
+    (void)param4;
+    int ret;
+
+    LosTaskCB *tcb = OS_TCB_FROM_TID(LOS_CurTaskIDGet());
+    char *tmp = tcb->taskName;
+    tcb->taskName = (char *)tcb->args; /* args are reused as task name */
+    ret = strcpy_s(tcb->taskName, PTHREAD_NAMELEN, tmp);
+    if (ret != 0) {
+        free(tmp);
+        return NULL;
+    }
+    free(tmp);
+
+    return startRoutine(param);
+}
+
+static inline int IsPthread(pthread_t thread)
+{
+    return ((UINT32)thread <= LOSCFG_BASE_CORE_TSK_LIMIT) &&
+           (OS_TCB_FROM_TID((UINT32)thread)->taskEntry == PthreadEntry);
+}
+
+int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
+                   void *(*startRoutine)(void *), void *arg)
+{
+    TSK_INIT_PARAM_S taskInitParam = {0};
+    UINT32 taskID;
+
+    if ((thread == NULL) || (startRoutine == NULL)) {
+        return EINVAL;
+    }
+
+    taskInitParam.usTaskPrio = LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO;
+    taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
+    if (attr) {
+        if (attr->detachstate == PTHREAD_CREATE_DETACHED) {
+            return ENOTSUP;
+        }
+        if (attr->stackaddr_set) {
+            return ENOTSUP;
+        }
+        if (attr->stacksize_set) {
+            taskInitParam.uwStackSize = attr->stacksize;
+        }
+        taskInitParam.usTaskPrio = (UINT16)attr->schedparam.sched_priority;
+    }
+
+    taskInitParam.pcName       = malloc(PTHREAD_NAMELEN);
+    if (taskInitParam.pcName == NULL) {
+        return ENOMEM;
+    }
+
+    taskInitParam.pfnTaskEntry = PthreadEntry;
+    taskInitParam.auwArgs[0]   = (UINT32)(UINTPTR)startRoutine;
+    taskInitParam.auwArgs[1]   = (UINT32)(UINTPTR)arg;
+
+    if (LOS_TaskCreateOnly(&taskID, &taskInitParam) != LOS_OK) {
+        free(taskInitParam.pcName);
+        return EINVAL;
+    }
+
+    /* set pthread default name */
+    (void)sprintf_s(taskInitParam.pcName, PTHREAD_NAMELEN, "pthread%u", taskID);
+
+    (void)LOS_TaskResume(taskID);
+
+    *thread = (pthread_t)taskID;
+    return 0;
+}
+
+int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param *param)
+{
+    if ((param == NULL) || (param->sched_priority < OS_TASK_PRIORITY_HIGHEST) ||
+        (param->sched_priority >= OS_TASK_PRIORITY_LOWEST) || !IsPthread(thread)) {
+        return EINVAL;
+    }
+
+    /* Only support SCHED_RR policy now */
+    if (policy != SCHED_RR) {
+        return ENOTSUP;
+    }
+
+    if (LOS_TaskPriSet((UINT32)thread, (UINT16)param->sched_priority) != LOS_OK) {
+        return EINVAL;
+    }
+
+    return 0;
+}
+
+int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param)
+{
+    UINT32 prio;
+
+    if ((policy == NULL) || (param == NULL) || !IsPthread(thread)) {
+        return EINVAL;
+    }
+
+    prio = LOS_TaskPriGet((UINT32)thread);
+    if (prio == OS_INVALID) {
+        return EINVAL;
+    }
+
+    *policy = SCHED_RR;
+    param->sched_priority = prio;
+    return 0;
+}
+
+pthread_t pthread_self(void)
+{
+    return (pthread_t)LOS_CurTaskIDGet();
+}
+
+int pthread_cancel(pthread_t thread)
+{
+    if (!IsPthread(thread)) {
+        return EINVAL;
+    }
+
+    return ENOSYS;
+}
+
+static void *VoidTask(UINT32 param1, UINT32 param2, UINT32 param3, UINT32 param4)
+{
+    (void)param1;
+    (void)param2;
+    (void)param3;
+    (void)param4;
+    return 0;
+}
+
+static void CleanupTaskResource(void)
+{
+    TSK_INIT_PARAM_S taskInitParam = {0};
+    UINT32 taskID;
+
+    taskInitParam.pcName       = "void";
+    taskInitParam.pfnTaskEntry = VoidTask;
+    taskInitParam.usTaskPrio = LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO;
+    taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE;
+
+    (void)LOS_TaskCreate(&taskID, &taskInitParam);
+}
+
+int pthread_join(pthread_t thread, void **retval)
+{
+    UINT32 taskStatus;
+
+    if (!IsPthread(thread)) {
+        return EINVAL;
+    }
+
+    if (retval) {
+        /* retrieve thread exit code is not supported currently */
+        return ENOTSUP;
+    }
+
+    if (thread == pthread_self()) {
+        return EDEADLK;
+    }
+
+    while (LOS_TaskStatusGet((UINT32)thread, &taskStatus) == LOS_OK) {
+        usleep(10000);
+    }
+
+    CleanupTaskResource();
+    return 0;
+}
+
+int pthread_detach(pthread_t thread)
+{
+    if (!IsPthread(thread)) {
+        return EINVAL;
+    }
+
+    return ENOSYS;
+}
+
+void pthread_exit(void *retVal)
+{
+    (void)retVal;
+    (void)LOS_TaskDelete(LOS_CurTaskIDGet());
+}
+
+int pthread_setname_np(pthread_t thread, const char *name)
+{
+    char *taskName = LOS_TaskNameGet((UINT32)thread);
+    if (taskName == NULL || !IsPthread(thread)) {
+        return EINVAL;
+    }
+    if (strnlen(name, PTHREAD_NAMELEN) >= PTHREAD_NAMELEN) {
+        return ERANGE;
+    }
+    if (strcpy_s(taskName, PTHREAD_NAMELEN, name) != 0) {
+        return ERANGE;
+    }
+    return 0;
+}
+
+int pthread_getname_np(pthread_t thread, char *buf, size_t buflen)
+{
+    int ret;
+
+    const char *name = LOS_TaskNameGet((UINT32)thread);
+    if (name == NULL || !IsPthread(thread)) {
+        return EINVAL;
+    }
+    if (buflen > strlen(name)) {
+        ret = strcpy_s(buf, buflen, name);
+        if (ret == 0) {
+            return 0;
+        }
+    }
+    return ERANGE;
+}

+ 232 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/posix/src/pthread_attr.c

@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <errno.h>
+#include <pthread.h>
+#include <limits.h>
+
+int pthread_attr_init(pthread_attr_t *attr)
+{
+    if (attr == NULL) {
+        return EINVAL;
+    }
+
+    attr->detachstate                 = PTHREAD_CREATE_JOINABLE;
+    attr->schedpolicy                 = SCHED_RR;
+    attr->schedparam.sched_priority   = LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO;
+    attr->inheritsched                = PTHREAD_INHERIT_SCHED;
+    attr->scope                       = PTHREAD_SCOPE_PROCESS;
+    attr->stackaddr_set               = 0;
+    attr->stackaddr                   = NULL;
+    attr->stacksize_set               = 1;
+    attr->stacksize                   = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
+
+    return 0;
+}
+
+int pthread_attr_destroy(pthread_attr_t *attr)
+{
+    if (attr == NULL) {
+        return EINVAL;
+    }
+
+    /* Nothing to do here... */
+    return 0;
+}
+
+int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachState)
+{
+    if ((attr != NULL) && ((detachState == PTHREAD_CREATE_JOINABLE) || (detachState == PTHREAD_CREATE_DETACHED))) {
+        attr->detachstate = (UINT32)detachState;
+        return 0;
+    }
+
+    return EINVAL;
+}
+
+int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachState)
+{
+    if ((attr == NULL) || (detachState == NULL)) {
+        return EINVAL;
+    }
+
+    *detachState = (int)attr->detachstate;
+
+    return 0;
+}
+
+int pthread_attr_setscope(pthread_attr_t *attr, int scope)
+{
+    if (attr == NULL) {
+        return EINVAL;
+    }
+
+    if (scope == PTHREAD_SCOPE_PROCESS) {
+        attr->scope = (unsigned int)scope;
+        return 0;
+    }
+
+    if (scope == PTHREAD_SCOPE_SYSTEM) {
+        return ENOTSUP;
+    }
+
+    return EINVAL;
+}
+
+int pthread_attr_getscope(const pthread_attr_t *attr, int *scope)
+{
+    if ((attr == NULL) || (scope == NULL)) {
+        return EINVAL;
+    }
+
+    *scope = (int)attr->scope;
+
+    return 0;
+}
+
+int pthread_attr_setinheritsched(pthread_attr_t *attr, int inherit)
+{
+    if ((attr != NULL) && ((inherit == PTHREAD_INHERIT_SCHED) || (inherit == PTHREAD_EXPLICIT_SCHED))) {
+        attr->inheritsched = (UINT32)inherit;
+        return 0;
+    }
+
+    return EINVAL;
+}
+
+int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inherit)
+{
+    if ((attr == NULL) || (inherit == NULL)) {
+        return EINVAL;
+    }
+
+    *inherit = (int)attr->inheritsched;
+
+    return 0;
+}
+
+int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
+{
+    if ((attr != NULL) && (policy == SCHED_RR)) {
+        attr->schedpolicy = SCHED_RR;
+        return 0;
+    }
+
+    return EINVAL;
+}
+
+int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy)
+{
+    if ((attr == NULL) || (policy == NULL)) {
+        return EINVAL;
+    }
+
+    *policy = (int)attr->schedpolicy;
+
+    return 0;
+}
+
+int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param)
+{
+    if ((attr == NULL) || (param == NULL)) {
+        return EINVAL;
+    } else if ((param->sched_priority < OS_TASK_PRIORITY_HIGHEST) ||
+               (param->sched_priority >= OS_TASK_PRIORITY_LOWEST)) {
+        return ENOTSUP;
+    }
+
+    attr->schedparam = *param;
+
+    return 0;
+}
+
+int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *param)
+{
+    if ((attr == NULL) || (param == NULL)) {
+        return EINVAL;
+    }
+
+    *param = attr->schedparam;
+
+    return 0;
+}
+
+/*
+ * Set starting address of stack. Whether this is at the start or end of
+ * the memory block allocated for the stack depends on whether the stack
+ * grows up or down.
+ */
+int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackAddr)
+{
+    if (attr == NULL) {
+        return EINVAL;
+    }
+
+    attr->stackaddr_set = 1;
+    attr->stackaddr     = stackAddr;
+
+    return 0;
+}
+
+int pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackAddr)
+{
+    if (((attr != NULL) && (stackAddr != NULL)) && attr->stackaddr_set) {
+        *stackAddr = attr->stackaddr;
+        return 0;
+    }
+
+    return EINVAL; /* Stack address not set, return EINVAL. */
+}
+
+int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stackSize)
+{
+    /* Reject inadequate stack sizes */
+    if ((attr == NULL) || (stackSize < PTHREAD_STACK_MIN)) {
+        return EINVAL;
+    }
+
+    attr->stacksize_set = 1;
+    attr->stacksize     = stackSize;
+
+    return 0;
+}
+
+int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stackSize)
+{
+    /* Reject attempts to get a stack size when one has not been set. */
+    if ((attr == NULL) || (stackSize == NULL) || (!attr->stacksize_set)) {
+        return EINVAL;
+    }
+
+    *stackSize = attr->stacksize;
+
+    return 0;
+}

+ 274 - 0
device/bossay/hi3861_l0/hi3861_adapter/kal/posix/src/time.c

@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
+ * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ *    conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *    of conditions and the following disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <errno.h>
+#include <time.h>
+#include <signal.h>
+#include <unistd.h>
+#include <los_hwi.h>
+#include <los_swtmr.h>
+#include <los_swtmr_pri.h>
+
+#ifndef STATIC
+#define STATIC static
+#endif
+
+#define OS_SYS_NS_PER_US 1000
+#define OS_SYS_NS_PER_SECOND 1000000000
+#define OS_SYS_US_PER_SECOND 1000000
+#define OS_SYS_MS_PER_SECOND 1000
+
+STATIC INLINE BOOL ValidTimerID(UINT16 swtmrID)
+{
+    /* check timer id */
+    return (swtmrID < LOSCFG_BASE_CORE_SWTMR_LIMIT);
+}
+
+/* internal functions */
+STATIC INLINE BOOL ValidTimeSpec(const struct timespec *tp)
+{
+    /* Fail a NULL pointer */
+    if (tp == NULL) {
+        return FALSE;
+    }
+
+    /* Fail illegal nanosecond values */
+    if ((tp->tv_nsec < 0) || (tp->tv_nsec >= OS_SYS_NS_PER_SECOND) || (tp->tv_sec < 0)) {
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
+STATIC INLINE UINT32 OsTimeSpec2Tick(const struct timespec *tp)
+{
+    UINT64 tick, ns;
+
+    ns = (UINT64)tp->tv_sec * OS_SYS_NS_PER_SECOND + tp->tv_nsec;
+    /* Round up for ticks */
+    tick = (ns * LOSCFG_BASE_CORE_TICK_PER_SECOND + (OS_SYS_NS_PER_SECOND - 1)) / OS_SYS_NS_PER_SECOND;
+    if (tick > LOS_WAIT_FOREVER) {
+        tick = LOS_WAIT_FOREVER;
+    }
+    return (UINT32)tick;
+}
+
+STATIC INLINE VOID OsTick2TimeSpec(struct timespec *tp, UINT32 tick)
+{
+    UINT64 ns = ((UINT64)tick * OS_SYS_NS_PER_SECOND) / LOSCFG_BASE_CORE_TICK_PER_SECOND;
+    tp->tv_sec = (time_t)(ns / OS_SYS_NS_PER_SECOND);
+    tp->tv_nsec = (long)(ns % OS_SYS_NS_PER_SECOND);
+}
+
+int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
+{
+    UINT64 nseconds;
+    UINT64 tick;
+    UINT32 ret;
+    const UINT32 nsPerTick = OS_SYS_NS_PER_SECOND / LOSCFG_BASE_CORE_TICK_PER_SECOND;
+
+    if (!ValidTimeSpec(rqtp)) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    nseconds = (UINT64)rqtp->tv_sec * OS_SYS_NS_PER_SECOND + rqtp->tv_nsec;
+
+    tick = (nseconds + nsPerTick - 1) / nsPerTick; // Round up for ticks
+
+    if (tick >= UINT32_MAX) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    /* PS: skip the first tick because it is NOT a full tick. */
+    ret = LOS_TaskDelay(tick ? (UINT32)(tick + 1) : 0);
+    if (ret == LOS_OK || ret == LOS_ERRNO_TSK_YIELD_NOT_ENOUGH_TASK) {
+        if (rmtp) {
+            rmtp->tv_sec = rmtp->tv_nsec = 0;
+        }
+        return 0;
+    }
+
+    /* sleep in interrupt context or in task sched lock state */
+    errno = EPERM;
+    return -1;
+}
+
+int timer_create(clockid_t clockID, struct sigevent *restrict evp, timer_t *restrict timerID)
+{
+    UINT32 ret;
+    UINT16 swtmrID;
+
+    if (!timerID || (clockID != CLOCK_REALTIME)) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    if (!evp || evp->sigev_notify != SIGEV_THREAD || evp->sigev_notify_attributes) {
+        errno = ENOTSUP;
+        return -1;
+    }
+
+    ret = LOS_SwtmrCreate(1, LOS_SWTMR_MODE_ONCE, (SWTMR_PROC_FUNC)evp->sigev_notify_function,
+                          &swtmrID, (UINT32)(UINTPTR)evp->sigev_value.sival_ptr);
+    if (ret != LOS_OK) {
+        errno = (ret == LOS_ERRNO_SWTMR_MAXSIZE) ? EAGAIN : EINVAL;
+        return -1;
+    }
+
+    *timerID = (timer_t)(UINTPTR)swtmrID;
+    return 0;
+}
+
+int timer_delete(timer_t timerID)
+{
+    UINT16 swtmrID = (UINT16)(UINTPTR)timerID;
+
+    if (!ValidTimerID(swtmrID)) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    if (LOS_SwtmrDelete(swtmrID) != LOS_OK) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    return 0;
+}
+
+int timer_settime(timer_t timerID, int flags,
+                  const struct itimerspec *restrict value,
+                  struct itimerspec *restrict oldValue)
+{
+    UINT32 intSave;
+    UINT16 swtmrID = (UINT16)(UINTPTR)timerID;
+    SWTMR_CTRL_S *swtmr = NULL;
+    UINT32 interval, expiry, ret;
+
+    if (flags != 0) {
+        /* flags not supported currently */
+        errno = ENOSYS;
+        return -1;
+    }
+
+    if (value == NULL || !ValidTimerID(swtmrID)) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    if (!ValidTimeSpec(&value->it_value) || !ValidTimeSpec(&value->it_interval)) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    expiry = OsTimeSpec2Tick(&value->it_value);
+    interval = OsTimeSpec2Tick(&value->it_interval);
+    /* if specified interval, it must be same with expiry due to the limitation of liteos-m */
+    if (interval && interval != expiry) {
+        errno = ENOTSUP;
+        return -1;
+    }
+
+    if (oldValue) {
+        (VOID)timer_gettime(timerID, oldValue);
+    }
+
+    ret = LOS_SwtmrStop(swtmrID);
+    if ((ret != LOS_OK) && (ret != LOS_ERRNO_SWTMR_NOT_STARTED)) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    intSave = LOS_IntLock();
+    swtmr = OS_SWT_FROM_SID(swtmrID);
+    swtmr->ucMode = (interval ? LOS_SWTMR_MODE_PERIOD : LOS_SWTMR_MODE_NO_SELFDELETE);
+    swtmr->uwInterval = (interval ? interval : expiry);
+
+    LOS_IntRestore(intSave);
+
+    if ((value->it_value.tv_sec == 0) && (value->it_value.tv_nsec == 0)) {
+        /*
+         * 1) when expiry is 0, means timer should be stopped.
+         * 2) If timer is ticking, stopping timer is already done before.
+         * 3) If timer is created but not ticking, return 0 as well.
+         */
+        return 0;
+    }
+
+    if (LOS_SwtmrStart(swtmr->usTimerID) != LOS_OK) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    return 0;
+}
+
+int timer_gettime(timer_t timerID, struct itimerspec *value)
+{
+    UINT32 tick = 0;
+    SWTMR_CTRL_S *swtmr = NULL;
+    UINT16 swtmrID = (UINT16)(UINTPTR)timerID;
+    UINT32 ret;
+
+    if ((value == NULL) || !ValidTimerID(swtmrID)) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    swtmr = OS_SWT_FROM_SID(swtmrID);
+
+    /* get expire time */
+    ret = LOS_SwtmrTimeGet(swtmr->usTimerID, &tick);
+    if ((ret != LOS_OK) && (ret != LOS_ERRNO_SWTMR_NOT_STARTED)) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    OsTick2TimeSpec(&value->it_value, tick);
+    OsTick2TimeSpec(&value->it_interval, (swtmr->ucMode == LOS_SWTMR_MODE_ONCE) ? 0 : swtmr->uwInterval);
+    return 0;
+}
+
+int timer_getoverrun(timer_t timerID)
+{
+    UINT16 swtmrID = (UINT16)(UINTPTR)timerID;
+
+    if (!ValidTimerID(swtmrID)) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    errno = ENOSYS;
+    return -1;
+}

+ 94 - 0
device/bossay/hi3861_l0/iot_hardware_hals/include/iot_adc.h

@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @addtogroup IotHardware
+ * @{
+ *
+ * @brief Provides APIs for operating devices,
+ * including flash, GPIO, I2C, PWM, UART,ADC, and watchdog APIs.
+ *
+ *
+ *
+ * @since 2.2
+ * @version 2.2
+ */
+
+/**
+ * @file iot_adc.h
+ *
+ * @brief Declares the ADC interface functions for you to read data.
+ *
+ * @since 1.0
+ * @version 1.1.0
+ */
+
+#ifndef IOT_ADC_H
+#define IOT_ADC_H
+
+
+/**
+ * @brief Enumerates analog power control modes.
+ */
+typedef enum {
+    /** Automatic control */
+    IOT_ADC_CUR_BAIS_DEFAULT,
+    /** Automatic control */
+    IOT_ADC_CUR_BAIS_AUTO,
+    /** Manual control (AVDD = 1.8 V) */
+    IOT_ADC_CUR_BAIS_1P8V,
+    /** Manual control (AVDD = 3.3 V) */
+    IOT_ADC_CUR_BAIS_3P3V,
+    /** Button value */
+    IOT_ADC_CUR_BAIS_BUTT,
+} IotAdcCurBais;
+
+/**
+ * @brief Enumerates equation models.
+ */
+typedef enum {
+    /** One-equation model */
+    IOT_ADC_EQU_MODEL_1,
+    /** Two-equation model */
+    IOT_ADC_EQU_MODEL_2,
+    /** Four-equation model */
+    IOT_ADC_EQU_MODEL_4,
+    /** Eight-equation model */
+    IOT_ADC_EQU_MODEL_8,
+    /** Button value */
+    IOT_ADC_EQU_MODEL_BUTT,
+} IotAdcEquModelSel;
+
+/**
+ * @brief Reads a piece of sampled data from a specified ADC channel based on the input parameters.
+ *
+ *
+ *
+ * @param channel Indicates the ADC channel index.
+ * @param data Indicates the pointer to the address for storing the read data.
+ * @param equModel Indicates the equation model.
+ * @param curBais Indicates the analog power control mode.
+ * @param rstCnt Indicates the count of the time from reset to conversion start.
+ *               One count is equal to 334 ns. The value must range from 0 to 0xFF0.
+ * @return Returns {@link IOT_SUCCESS} if the PWM signal output is stopped;
+ * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTAdcRead(unsigned int channel, unsigned short *data, IotAdcEquModelSel equModel,
+                     IotAdcCurBais curBais, unsigned short rstCnt);
+
+#endif
+/** @} */

+ 340 - 0
device/bossay/hi3861_l0/iot_hardware_hals/include/iot_gpio_ex.h

@@ -0,0 +1,340 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/**
+ * @file iot_gpio_ex.h
+ *
+ * @brief Declares the extended GPIO interface functions.
+ *
+ * These functions are used for settings GPIO pulls and driver strength. \n
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+
+#ifndef IOT_GPIO_EX_H
+#define IOT_GPIO_EX_H
+
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 0.
+ */
+typedef enum {
+    /** GPIO0 function */
+    IOT_GPIO_FUNC_GPIO_0_GPIO,
+    /** Functions of UART1 TXD */
+    IOT_GPIO_FUNC_GPIO_0_UART1_TXD = 2,
+    /** SPI1 CK function */
+    IOT_GPIO_FUNC_GPIO_0_SPI1_CK,
+    /** Functions of JTAG TD0 */
+    IOT_GPIO_FUNC_GPIO_0_JTAG_TDO,
+    /** PWM3 OUT function */
+    IOT_GPIO_FUNC_GPIO_0_PWM3_OUT,
+    /** I2C1 SDA function */
+    IOT_GPIO_FUNC_GPIO_0_I2C1_SDA,
+} WifiIotIoFuncGpio0;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 1.
+ */
+typedef enum {
+    /** GPIO1 function */
+    IOT_GPIO_FUNC_GPIO_1_GPIO,
+    /** UART1 RXD function */
+    IOT_GPIO_FUNC_GPIO_1_UART1_RXD = 2,
+    /** SPI1 RXD function */
+    IOT_GPIO_FUNC_GPIO_1_SPI1_RXD,
+    /** JTAG TCKfunction */
+    IOT_GPIO_FUNC_GPIO_1_JTAG_TCK,
+    /** PWM4 OUT function */
+    IOT_GPIO_FUNC_GPIO_1_PWM4_OUT,
+    /** I2C1 SCL function */
+    IOT_GPIO_FUNC_GPIO_1_I2C1_SCL,
+    /** BT FREQ function */
+    IOT_GPIO_FUNC_GPIO_1_BT_FREQ,
+} WifiiIotIoFuncGpio1;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 2.
+ */
+typedef enum {
+    /** GPIO2 function */
+    IOT_GPIO_FUNC_GPIO_2_GPIO,
+    /** UART1 RTS function */
+    IOT_GPIO_FUNC_GPIO_2_UART1_RTS_N = 2,
+    /** SPI1 TXD function */
+    IOT_GPIO_FUNC_GPIO_2_SPI1_TXD,
+    /** JTAG TRSTN function */
+    IOT_GPIO_FUNC_GPIO_2_JTAG_TRSTN,
+    /** PWM2 OUT function */
+    IOT_GPIO_FUNC_GPIO_2_PWM2_OUT,
+    /** SSI CLK function */
+    IOT_GPIO_FUNC_GPIO_2_SSI_CLK = 7,
+} WifiIotIoFuncGpio2;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 3.
+ */
+typedef enum {
+    /** GPIO3 function */
+    IOT_GPIO_FUNC_GPIO_3_GPIO,
+    /** UART0 TXD function */
+    IOT_GPIO_FUNC_GPIO_3_UART0_TXD,
+    /** UART1 CTS function */
+    IOT_GPIO_FUNC_GPIO_3_UART1_CTS_N,
+    /** SPI CSN function */
+    IOT_GPIO_FUNC_GPIO_3_SPI1_CSN,
+    /** JTAG TDI function */
+    IOT_GPIO_FUNC_GPIO_3_JTAG_TDI,
+    /** PWM5 OUT function */
+    IOT_GPIO_FUNC_GPIO_3_PWM5_OUT,
+    /** I2C1 SDA function */
+    IOT_GPIO_FUNC_GPIO_3_I2C1_SDA,
+    /** SSI DATA function */
+    IOT_GPIO_FUNC_GPIO_3_SSI_DATA,
+} WifiIotIoFuncGpio3;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 4.
+ */
+typedef enum {
+    /** GPIO4 function */
+    IOT_GPIO_FUNC_GPIO_4_GPIO,
+    /** UART0 RXD function */
+    IOT_GPIO_FUNC_GPIO_4_UART0_RXD = 2,
+    /** JTAG TMS function */
+    IOT_GPIO_FUNC_GPIO_4_JTAG_TMS = 4,
+    /** PWM1 OUT function */
+    IOT_GPIO_FUNC_GPIO_4_PWM1_OUT,
+    /** I2C1 SCL function */
+    IOT_GPIO_FUNC_GPIO_4_I2C1_SCL,
+} WifiIotIoFuncGpio4;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 5.
+ */
+typedef enum {
+    /** GPIO5 function */
+    IOT_GPIO_FUNC_GPIO_5_GPIO,
+    /** UART1 RXD function */
+    IOT_GPIO_FUNC_GPIO_5_UART1_RXD = 2,
+    /** SPI0 CSN function */
+    IOT_GPIO_FUNC_GPIO_5_SPI0_CSN,
+    /** PWM2 OUT function */
+    IOT_GPIO_FUNC_GPIO_5_PWM2_OUT = 5,
+    /** I2C0 MCLK function */
+    IOT_GPIO_FUNC_GPIO_5_I2S0_MCLK,
+    /** BT STATUS function */
+    IOT_GPIO_FUNC_GPIO_5_BT_STATUS,
+} WifiIotIoFuncGpio5;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 6.
+ */
+typedef enum {
+    /** GPIO6 function */
+    IOT_GPIO_FUNC_GPIO_6_GPIO,
+    /** UART1 TXD function */
+    IOT_GPIO_FUNC_GPIO_6_UART1_TXD = 2,
+    /** SPI0 CK function */
+    IOT_GPIO_FUNC_GPIO_6_SPI0_CK,
+    /** PWM3 OUT function */
+    IOT_GPIO_FUNC_GPIO_6_PWM3_OUT = 5,
+    /** I2S0 TX function */
+    IOT_GPIO_FUNC_GPIO_6_I2S0_TX,
+    /** COEX switch function */
+    IOT_GPIO_FUNC_GPIO_6_COEX_SWITCH,
+} WifiIotIoFuncGpio6;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 7.
+ */
+typedef enum {
+    /** GPIO7 function */
+    IOT_GPIO_FUNC_GPIO_7_GPIO,
+    /** UART1 CTS function */
+    IOT_GPIO_FUNC_GPIO_7_UART1_CTS_N = 2,
+    /** SPI0 RXD function */
+    IOT_GPIO_FUNC_GPIO_7_SPI0_RXD,
+    /** PWM0 OUT function */
+    IOT_GPIO_FUNC_GPIO_7_PWM0_OUT = 5,
+    /** I2S0 BCLK function */
+    IOT_GPIO_FUNC_GPIO_7_I2S0_BCLK,
+    /** BT ACTIVE function */
+    IOT_GPIO_FUNC_GPIO_7_BT_ACTIVE,
+} WifiIotIoFuncGpio7;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 8.
+ */
+typedef enum {
+    /** GPIO8 function */
+    IOT_GPIO_FUNC_GPIO_8_GPIO,
+    /** UART1 RTS function */
+    IOT_GPIO_FUNC_GPIO_8_UART1_RTS_N = 2,
+    /** SPI0 TXD function */
+    IOT_GPIO_FUNC_GPIO_8_SPI0_TXD,
+    /** PWM1 OUT function */
+    IOT_GPIO_FUNC_GPIO_8_PWM1_OUT = 5,
+    /** I2S0 WS function */
+    IOT_GPIO_FUNC_GPIO_8_I2S0_WS,
+    /** WLAN ACTIVE function */
+    IOT_GPIO_FUNC_GPIO_8_WLAN_ACTIVE,
+} WifiIotIoFuncGpio8;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 9.
+ */
+typedef enum {
+    /** GPIO9 function */
+    IOT_GPIO_FUNC_GPIO_9_GPIO,
+    /** I2C0 SCL function */
+    IOT_GPIO_FUNC_GPIO_9_I2C0_SCL,
+    /** UART2 RTS function */
+    IOT_GPIO_FUNC_GPIO_9_UART2_RTS_N,
+    /** SDIO D2 function */
+    IOT_GPIO_FUNC_GPIO_9_SDIO_D2,
+    /** SPI0 TXD function */
+    IOT_GPIO_FUNC_GPIO_9_SPI0_TXD,
+    /** PWM0 OUT function */
+    IOT_GPIO_FUNC_GPIO_9_PWM0_OUT,
+    /** I2S0 MCLK function */
+    IOT_GPIO_FUNC_GPIO_9_I2S0_MCLK = 7,
+} WifiIotIoFuncGpio9;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 10.
+ */
+typedef enum {
+    /** GPIO10 function */
+    IOT_GPIO_FUNC_GPIO_10_GPIO,
+    /** I2C0 SDA function */
+    IOT_GPIO_FUNC_GPIO_10_I2C0_SDA,
+    /** UART2 CTS function */
+    IOT_GPIO_FUNC_GPIO_10_UART2_CTS_N,
+    /** SDIO D3 function */
+    IOT_GPIO_FUNC_GPIO_10_SDIO_D3,
+    /** SPI0 CK function */
+    IOT_GPIO_FUNC_GPIO_10_SPI0_CK,
+    /** PWM1 OUT function */
+    IOT_GPIO_FUNC_GPIO_10_PWM1_OUT,
+    /** I2S0 TX function */
+    IOT_GPIO_FUNC_GPIO_10_I2S0_TX = 7,
+} WifiIotIoFuncGpio10;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 11.
+ */
+typedef enum {
+    /** GPIO11 function */
+    IOT_GPIO_FUNC_GPIO_11_GPIO,
+    /** UART2 TXD function */
+    IOT_GPIO_FUNC_GPIO_11_UART2_TXD = 2,
+    /** SDIO CMD function */
+    IOT_GPIO_FUNC_GPIO_11_SDIO_CMD,
+    /** SDIO RXD function */
+    IOT_GPIO_FUNC_GPIO_11_SPI0_RXD,
+    /** PWM2 OUT function */
+    IOT_GPIO_FUNC_GPIO_11_PWM2_OUT,
+    /** RF TX_EN_EXT function */
+    IOT_GPIO_FUNC_GPIO_11_RF_TX_EN_EXT,
+    /** I2S0 RX function */
+    IOT_GPIO_FUNC_GPIO_11_I2S0_RX,
+} WifiIotIoFuncGpio11;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 12.
+ */
+typedef enum {
+    /** GPIO12 function */
+    IOT_GPIO_FUNC_GPIO_12_GPIO,
+    /** SUART2 RXD function */
+    IOT_GPIO_FUNC_GPIO_12_UART2_RXD = 2,
+    /** SDIO CLK function */
+    IOT_GPIO_FUNC_GPIO_12_SDIO_CLK,
+    /** SDIO CSN function */
+    IOT_GPIO_FUNC_GPIO_12_SPI0_CSN,
+    /** PWM3 OUT function */
+    IOT_GPIO_FUNC_GPIO_12_PWM3_OUT,
+    /** RF RX_EN_EXT function */
+    IOT_GPIO_FUNC_GPIO_12_RF_RX_EN_EXT,
+    /** I2S0 BCLK function */
+    IOT_GPIO_FUNC_GPIO_12_I2S0_BCLK,
+} WifiIotIoFuncGpio12;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 13.
+ */
+typedef enum {
+    /** SSI DATA function */
+    IOT_GPIO_FUNC_GPIO_13_SSI_DATA,
+    /** UART0 TXD function */
+    IOT_GPIO_FUNC_GPIO_13_UART0_TXD,
+    /** UART2 RTS function */
+    IOT_GPIO_FUNC_GPIO_13_UART2_RTS_N,
+    /** SDIO D0 function */
+    IOT_GPIO_FUNC_GPIO_13_SDIO_D0,
+    /** GPIO13 function */
+    IOT_GPIO_FUNC_GPIO_13_GPIO,
+    /** PWM4 OUT function */
+    IOT_GPIO_FUNC_GPIO_13_PWM4_OUT,
+    /** I2C0 SDA function */
+    IOT_GPIO_FUNC_GPIO_13_I2C0_SDA,
+    /** I2S0 WS function */
+    IOT_GPIO_FUNC_GPIO_13_I2S0_WS,
+} WifiIotIoFuncGpio13;
+
+/**
+ * @brief Enumerates the functions of GPIO hardware pin 14.
+ */
+typedef enum {
+    /** SSI CLK function */
+    IOT_GPIO_FUNC_GPIO_14_SSI_CLK,
+    /** UART0 RXD function */
+    IOT_GPIO_FUNC_GPIO_14_UART0_RXD,
+    /** UART2 CTS function */
+    IOT_GPIO_FUNC_GPIO_14_UART2_CTS_N,
+    /** SDIO D1 function */
+    IOT_GPIO_FUNC_GPIO_14_SDIO_D1,
+    /** GPIO14 function */
+    IOT_GPIO_FUNC_GPIO_14_GPIO,
+    /** PWM5 OUT function */
+    IOT_GPIO_FUNC_GPIO_14_PWM5_OUT,
+    /** I2C0 SCL function */
+    IOT_GPIO_FUNC_GPIO_14_I2C0_SCL,
+} WifiIotIoFuncGpio14;
+
+/**
+ * @brief Enumerates GPIO pull-up or pull-down settings.
+ */
+typedef enum {
+    /** No pull */
+    IOT_GPIO_PULL_NONE,
+    /** Pull-up */
+    IOT_GPIO_PULL_UP,
+    /** Pull-down */
+    IOT_GPIO_PULL_DOWN,
+    /** Maximum value */
+    IOT_GPIO_PULL_MAX,
+} IotGpioPull;
+
+
+unsigned int IoTGpioSetFunc(unsigned int id, unsigned char val);
+
+unsigned int IoTGpioSetPull(unsigned int id, IotGpioPull val);
+
+#endif
+/** @} */

+ 78 - 0
device/bossay/hi3861_l0/iot_hardware_hals/include/iot_i2c_ex.h

@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/**
+ * @addtogroup wifiiot
+ * @{
+ *
+ * @brief Provides dedicated device operation interfaces on the Wi-Fi module,
+ * including ADC, AT, flash, GPIO, I2C, I2S, partition, PWM, SDIO, UART, and watchdog.
+ *
+ *
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+
+/**
+ * @file wifiiot_i2c_ex.h
+ *
+ * @brief Declares the extended I2C interface functions.
+ *
+ * These functions are used for I2C baud rate setting and device exception callback. \n
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+
+#ifndef IOT_I2C_EX_H
+#define IOT_I2C_EX_H
+
+
+/**
+ * @brief Defines I2C data transmission attributes.
+ */
+typedef struct {
+    /** Pointer to the buffer storing data to send */
+    unsigned char *sendBuf;
+    /** Length of data to send */
+    unsigned int  sendLen;
+    /** Pointer to the buffer for storing data to receive */
+    unsigned char *receiveBuf;
+    /** Length of data received */
+    unsigned int  receiveLen;
+} IotI2cData;
+
+
+/**
+ * @brief Sends data to and receives data responses from an I2C device.
+ *
+ *
+ *
+ * @param id Indicates the I2C device ID.
+ * @param deviceAddr Indicates the I2C device address.
+ * @param i2cData Indicates the pointer to the device descriptor of the data to receive.
+ * @return Returns {@link WIFI_IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link wifiiot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTI2cWriteread(unsigned int  id, unsigned short deviceAddr, const IotI2cData *i2cData);
+
+
+
+#endif
+/** @} */

+ 368 - 0
device/bossay/hi3861_l0/iot_hardware_hals/include/iot_spi.h

@@ -0,0 +1,368 @@
+/*
+ * Copyright (c) 2020 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @addtogroup IotHardware
+ * @{
+ *
+ * @brief Provides APIs for operating devices,
+ * including flash, GPIO, I2C, PWM, UART, and watchdog APIs.
+ *
+ *
+ *
+ * @since 2.2
+ * @version 2.2
+ */
+
+/**
+ * @file iot_spi.h
+ *
+ * @brief Declares flash functions.
+ *
+ * These functions are used to initialize or deinitialize a flash device,
+ * and read data from or write data to a flash memory. \n
+ *
+ * @since 2.2
+ * @version 2.2
+ */
+
+#ifndef IOT_SPI_H
+#define IOT_SPI_H
+
+/**
+ * @brief Indicates the SPI callback, which is used in {@link SpiRegisterUsrFunc}.
+ */
+typedef void (*SpiIsrFunc)(void);
+
+/**
+ * @brief Enumerates SPI channel IDs.
+ */
+typedef enum {
+    /** Channel 0 */
+    IOT_SPI_ID_0 = 0,
+    /** Channel 1 */
+    IOT_SPI_ID_1,
+} IotSpiIdx;
+
+/**
+ * @brief Enumerates communication polarities.
+ */
+typedef enum {
+    /** Polarity 0 */
+    IOT_SPI_CFG_CLOCK_CPOL_0,
+    /** Polarity 1 */
+    IOT_SPI_CFG_CLOCK_CPOL_1,
+}IotSpiCfgClockCpol;
+
+/**
+ * @brief Enumerates communication phases.
+ */
+typedef enum {
+    /** Phase 0 */
+    IOT_SPI_CFG_CLOCK_CPHA_0,
+    /** Phase 1 */
+    IOT_SPI_CFG_CLOCK_CPHA_1,
+} IotSpiCfgClockCpha;
+
+/**
+ * @brief Enumerates communication protocols.
+ */
+typedef enum {
+    /** Motorola protocol */
+    IOT_SPI_CFG_FRAM_MODE_MOTOROLA,
+    /** Texas Instruments protocol */
+    IOT_SPI_CFG_FRAM_MODE_TI,
+    /** Microwire protocol */
+    IOT_SPI_CFG_FRAM_MODE_MICROWIRE,
+} IotSpiCfgFramMode;
+
+/**
+ * @brief Enumerates the communication data width, that is,
+ * the number of valid bits in each frame.
+ *
+ */
+typedef enum {
+    /** 4 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_4BIT = 0x3,
+    /** 5 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_5BIT,
+    /** 6 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_6BIT,
+    /** 7 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_7BIT,
+    /** 8 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_8BIT,
+    /** 9 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_9BIT,
+    /** 10 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_10BIT,
+    /** 11 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_11BIT,
+    /** 12 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_12BIT,
+    /** 13 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_13BIT,
+    /** 14 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_14BIT,
+    /** 15 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_15BIT,
+    /** 16 bits */
+    IOT_SPI_CFG_DATA_WIDTH_E_16BIT,
+} IotSpiCfgDataWidth;
+
+/**
+ * @brief Enumerates the endian mode of each frame.
+ */
+typedef enum {
+    /** Little-endian */
+    IOT_SPI_CFG_ENDIAN_LITTLE,
+    /** Big-endian */
+    IOT_SPI_CFG_ENDIAN_BIG,
+} IotSpiCfgEndian;
+
+/**
+ * @brief Defines data communication parameters.
+ */
+typedef struct {
+    /** Communication polarity. For details about available values,
+     * see {@link IotSpiCfgClockCpol}.
+     */
+    unsigned int cpol : 1;
+    /** Communication phase.
+     * For details about available values, see {@link IotSpiCfgClockCpha}.
+     */
+    unsigned int cpha : 1;
+    /** Communication protocol.
+     * For details about available values, see {@link IotSpiCfgFramMode}.
+     */
+    unsigned int framMode : 2;
+    /** Communication data width.
+     * For details about available values, see {@link IotSpiCfgDataWidth}.
+     */
+    unsigned int dataWidth : 4;
+    /** Endian mode. For details about available values, see {@link IotSpiCfgEndian}. */
+    unsigned int endian : 1;
+    /** Padding bit */
+    unsigned int pad : 23;
+    /** Communication frequency. The value ranges from 2460 Hz to 40 MHz. */
+    unsigned int freq;
+} IotSpiCfgBasicInfo;
+
+/**
+ * @brief Specifies whether a device is a master or slave device.
+ *
+ * @since 1.0
+ * @version 1.0
+ */
+typedef struct {
+    /** Whether the device is a slave device */
+    unsigned int isSlave : 1;
+    /** Padding bit */
+    unsigned int pad : 31;
+} IotSpiCfgInitParam;
+
+/**
+ * @brief Sends data in SPI slave mode.
+ *
+ * In SPI slave mode, this function sends data of the length
+ * specified by <b>byteLen</b> in <b>writeData</b> through
+ * the channel specified by <b>spiId</b> within the duration <b>timeOutMs</b>.
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @param writeData Indicates the pointer to the data to send.
+ * @param byteLen Indicates the length of the data to send.
+ * @param timeOutMs Indicates the timeout interval.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiSlaveWrite(IotSpiIdx spiId, char *writeData, unsigned int byteLen, unsigned int timeOutMs);
+
+/**
+ * @brief Reads data in SPI slave mode.
+ *
+ * In SPI slave mode, this function reads data of the length
+ * specified by <b>byteLen</b> in <b>readData</b> through the channel
+ * specified by <b>spiId</b> within the duration <b>timeOutMs</b>.
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @param readData Indicates the pointer to the data to read.
+ * @param byteLen Indicates the length of the data to read.
+ * @param timeOutMs Indicates the timeout interval.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiSlaveRead(IotSpiIdx spiId, char *readData, unsigned int byteLen, unsigned int timeOutMs);
+
+/**
+ * @brief Sends data in half-duplex SPI master mode.
+ *
+ * In SPI master mode, this function sends data of the length
+ * specified by <b>byteLen</b> in <b>writeData</b>
+ * through the channel specified by <b>spiId</b>.
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @param writeData Indicates the pointer to the data to send.
+ * @param byteLen Indicates the length of the data to send.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiHostWrite(IotSpiIdx spiId, char *writeData, unsigned int byteLen);
+
+/**
+ * @brief Reads data in half-duplex SPI master mode.
+ *
+ * In SPI master mode, this function reads data of the length
+ * specified by <b>byteLen</b> in <b>readData</b>
+ * through the channel specified by <b>spiId</b>.
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @param readData Indicates the pointer to the data to read.
+ * @param byteLen Indicates the length of the data to read.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiHostRead(IotSpiIdx spiId, char *readData, unsigned int byteLen);
+
+/**
+ * @brief Sends and reads data in full-duplex SPI master mode.
+ *
+ * In SPI master mode, this function sends data in <b>writeData</b> and
+ * reads data of the length specified by <b>byteLen</b> in <b>readData</b>
+ * both through the channel specified by <b>spiId</b>.
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @param writeData Indicates the pointer to the data to send.
+ * @param readData Indicates the pointer to the data to read.
+ * @param byteLen Indicates the length of the data to read.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiHostWriteread(IotSpiIdx spiId, char *writeData, char *readData, unsigned int byteLen);
+
+/**
+ * @brief Sets the SPI channel parameter.
+ *
+ *
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @param param Indicates the pointer to the SPI parameter to set.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiSetBasicInfo(IotSpiIdx spiId, const IotSpiCfgBasicInfo *param);
+
+/**
+ * @brief Initializes an SPI device.
+ *
+ * This function initializes the device with the channel ID <b>spiId</b>,
+ * device type <b>initParam</b>, and device parameter <b>param</b>.
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @param initParam Specifies whether the device is a slave one.
+ * @param param Indicates the pointer to the SPI device parameter.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiInit(IotSpiIdx spiId, IotSpiCfgInitParam initParam, const IotSpiCfgBasicInfo *param);
+
+/**
+ * @brief Deinitializes an SPI device.
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiDeinit(IotSpiIdx spiId);
+
+/**
+ * @brief Sets whether to enable the interrupt request (IRQ) mode for an SPI device.
+ *
+ *
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @param irqEn Specifies whether to enable IRQ.
+ * The value <b>1</b> means to enable IRQ, and <b>0</b> means to disable IRQ.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiSetIrqMode(IotSpiIdx spiId, unsigned char irqEn);
+
+/**
+ * @brief Sets whether to enable DMA to transfer data for an SPI device in slave mode.
+ *
+ *
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @param dmaEn Specifies whether to enable DMA.
+ * The value <b>1</b> means to enable DMA, and <b>0</b> means to disable DMA.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiSetDmaMode(IotSpiIdx spiId, unsigned char dmaEn);
+
+/**
+ * @brief Registers the data TX preparation/recovery function.
+ *
+ * This function registers the functions
+ * registered by <b>prepareF</b> and <b>restoreF</b> for
+ * an SPI device with a channel specified by <b>spiId</b>.
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @param prepareF Indicates the function used for data preparation.
+ * @param restoreF Indicates the function used for data recovery.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiRegisterUsrFunc(IotSpiIdx spiId, SpiIsrFunc prepareF, SpiIsrFunc restoreF);
+
+/**
+ * @brief Sets whether to enable loopback test for an SPI device.
+ *
+ *
+ *
+ * @param spiId Indicates the SPI channel ID.
+ * @param lbEn Specifies whether to enable loopback test. The value <b>1</b>
+ * means to enable loopback test, and <b>0</b> means to disable loopback test.
+ * @return Returns {@link IOT_SUCCESS} if the operation is successful;
+ * returns an error code defined in {@link iot_errno.h} otherwise.
+ * @since 1.0
+ * @version 1.0
+ */
+unsigned int IoTSpiSetLoopBackMode(IotSpiIdx spiId, unsigned char lbEn);
+
+#endif
+/** @} */

BIN
device/bossay/hi3861_l0/sdk_liteos/.sconsign.dblite


+ 0 - 0
device/bossay/hi3861_l0/sdk_liteos/3rd_sdk/demolink/libs/.gitignore


+ 42 - 0
device/bossay/hi3861_l0/sdk_liteos/BUILD.gn

@@ -0,0 +1,42 @@
+# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
+
+import("//build/lite/config/component/lite_component.gni")
+import("//build/lite/config/subsystem/lite_subsystem.gni")
+
+declare_args() {
+  enable_hos_vendor_wifiiot_xts = false
+}
+
+lite_subsystem("wifiiot_sdk") {
+  subsystem_components = [ ":sdk" ]
+}
+
+build_ext_component("run_wifiiot_scons") {
+  exec_path = rebase_path(".", root_build_dir)
+  outdir = rebase_path(root_out_dir)
+
+  if (host_os == "win") {
+    command = "sh hm_build.sh $outdir win"
+  } else {
+    command = "sh hm_build.sh $outdir linux"
+  }
+  deps = [
+    ":sdk",
+    "//base/security/deviceauth/frameworks/deviceauth_lite:hichainsdk",
+    "//build/lite:ohos",
+    # gdtr_TODO:
+    "//build/lite:product",
+  ]
+  if (enable_hos_vendor_wifiiot_xts) {
+    deps += [ "//build/lite/config/subsystem/xts:xts" ]
+  }
+}
+
+lite_component("sdk") {
+  features = []
+
+  deps = [
+    "//build/lite/config/component/cJSON:cjson_static",
+    "//device/bossay/hi3861_l0/hi3861_adapter/kal",
+  ]
+}

+ 31 - 0
device/bossay/hi3861_l0/sdk_liteos/Makefile

@@ -0,0 +1,31 @@
+# Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+MAIN_TOPDIR = $(shell pwd)
+export MAIN_TOPDIR
+
+all:
+	$(MAKE) -f non_factory.mk all
+
+clean:
+	$(MAKE) -f non_factory.mk clean
+
+all_clean:
+	$(MAKE) -f non_factory.mk all_clean
+
+factory:
+	$(MAKE) -f factory.mk all
+
+clean_factory:
+	$(MAKE) -f factory.mk clean
+

+ 3687 - 0
device/bossay/hi3861_l0/sdk_liteos/NOTICE

@@ -0,0 +1,3687 @@
+OPEN SOURCE SOFTWARE NOTICE
+
+Please note we provide an open source software notice for the third party open source software along with this software and/or this software component (in the following just “this SOFTWARE”). The open source software licenses are granted by the respective right holders.
+
+Warranty Disclaimer
+THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
+
+Copyright Notice and License Texts
+
+----------------------------------------------------------------------
+Software: mbed TLS 2.16.6
+
+Copyright notice:
+Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
+Copyright (C) 2016, ARM Limited, All Rights Reserved
+Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
+Copyright (c) 2014-2017, ARM Limited, All Rights Reserved
+Copyright (c) 2016, ARM Limited, All Rights Reserved
+Copyright (c) 2018, Arm Limited, All Rights Reserved
+Copyright (c) 2018, ARM Limited, All Rights Reserved
+Copyright (c) 2015-2019, ARM Limited, All Rights Reserved
+Copyright (C) 2018, Arm Limited, All Rights Reserved
+Copyright (C) 2018, ARM Limited, All Rights Reserved
+Copyright (c) 2017, ARM Limited, All Rights Reserved
+Copyright (C) 2006-2017, ARM Limited, All Rights Reserved
+Copyright (C) 2016-2018, ARM Limited, All Rights Reserved
+Copyright (C) 2018, Arm Limited (or its affiliates), All Rights Reserved
+Copyright (C) 2019, ARM Limited, All Rights Reserved
+Copyright (c) 2012-2016, ARM Limited, All Rights Reserved
+Copyright (c) 2015-2016, ARM Limited, All Rights Reserved
+Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved.
+Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
+Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved
+Copyright (C) 2015-2018, Arm Limited (or its affiliates), All Rights Reserved
+Copyright (C) 2006-2019, Arm Limited (or its affiliates), All Rights Reserved
+Copyright (C) 2016-2019, ARM Limited, All Rights Reserved
+Copyright (C) 2006-2019, ARM Limited, All Rights Reserved
+
+License: Apache License V2.0
+Unless specifically indicated otherwise in a file, files are licensed
+under the Apache 2.0 license, as can be found in: apache-2.0.txt
+
+----------------------------------------------------------------------
+Software: musl 1.2.0
+
+Copyright notice:
+Copyright © 2005-2020 Rich Felker, et al.
+Copyright © 1993,2004 Sun Microsystems or
+Copyright © 2003-2011 David Schultz or
+Copyright © 2003-2009 Steven G. Kargl or
+Copyright © 2003-2009 Bruce D. Evans or
+Copyright © 2008 Stephen L. Moshier or
+Copyright © 2017-2018 Arm Limited
+Copyright © 1994 David Burren.
+Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
+Copyright (c) 2005 Bruce D. Evans and Steven G. Kargl
+Copyright (c) 2011 David Schultz <das@FreeBSD.ORG>
+Copyright (c) 2007 David Schultz <das@FreeBSD.ORG>
+Copyright (c) 2011 David Schultz
+Copyright (c) 1998-2012 Solar Designer
+Copyright (c) 1994 David Burren
+Copyright (c) 2000,2002,2010,2012 Solar Designer
+Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+Copyright (c) 2009-2011, Bruce D. Evans, Steven G. Kargl, David Schultz.
+Copyright (c) 2018, Arm Limited.
+Copyright (c) 2017-2018, Arm Limited.
+Copyright (c) 2005-2008 David Schultz <das@FreeBSD.ORG>
+Copyright (c) 2005-2011 David Schultz <das@FreeBSD.ORG>
+Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans.
+Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+Copyright (c) 2001-2009 Ville Laurikari <vl@iki.fi>
+Copyright (C) 2011 by Valentin Ochs
+
+License: BSD 2-Clause License
+musl as a whole is licensed under the following standard MIT license:
+
+Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Authors/contributors include:
+
+A. Wilcox
+Ada Worcester
+Alex Dowad
+Alex Suykov
+Alexander Monakov
+Andre McCurdy
+Andrew Kelley
+Anthony G. Basile
+Aric Belsito
+Arvid Picciani
+Bartosz Brachaczek
+Benjamin Peterson
+Bobby Bingham
+Boris Brezillon
+Brent Cook
+Chris Spiegel
+Clément Vasseur
+Daniel Micay
+Daniel Sabogal
+Daurnimator
+David Carlier
+David Edelsohn
+Denys Vlasenko
+Dmitry Ivanov
+Dmitry V. Levin
+Drew DeVault
+Emil Renner Berthing
+Fangrui Song
+Felix Fietkau
+Felix Janda
+Gianluca Anzolin
+Hauke Mehrtens
+He X
+Hiltjo Posthuma
+Isaac Dunham
+Jaydeep Patil
+Jens Gustedt
+Jeremy Huntwork
+Jo-Philipp Wich
+Joakim Sindholt
+John Spencer
+Julien Ramseier
+Justin Cormack
+Kaarle Ritvanen
+Khem Raj
+Kylie McClain
+Leah Neukirchen
+Luca Barbato
+Luka Perkov
+M Farkas-Dyck (Strake)
+Mahesh Bodapati
+Markus Wichmann
+Masanori Ogino
+Michael Clark
+Michael Forney
+Mikhail Kremnyov
+Natanael Copa
+Nicholas J. Kain
+orc
+Pascal Cuoq
+Patrick Oppenlander
+Petr Hosek
+Petr Skocik
+Pierre Carrier
+Reini Urban
+Rich Felker
+Richard Pennington
+Ryan Fairfax
+Samuel Holland
+Segev Finer
+Shiz
+sin
+Solar Designer
+Stefan Kristiansson
+Stefan O'Rear
+Szabolcs Nagy
+Timo Teräs
+Trutz Behn
+Valentin Ochs
+Will Dietz
+William Haddon
+William Pitcock
+
+Portions of this software are derived from third-party works licensed
+under terms compatible with the above MIT license:
+
+The TRE regular expression implementation (src/regex/reg* and
+src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
+under a 2-clause BSD license (license text in the source files). The
+included version has been heavily modified by Rich Felker in 2012, in
+the interests of size, simplicity, and namespace cleanliness.
+
+Much of the math library code (src/math/* and src/complex/*) is
+Copyright © 1993,2004 Sun Microsystems or
+Copyright © 2003-2011 David Schultz or
+Copyright © 2003-2009 Steven G. Kargl or
+Copyright © 2003-2009 Bruce D. Evans or
+Copyright © 2008 Stephen L. Moshier or
+Copyright © 2017-2018 Arm Limited
+and labelled as such in comments in the individual source files. All
+have been licensed under extremely permissive terms.
+
+The ARM memcpy code (src/string/arm/memcpy_el.S) is Copyright © 2008
+The Android Open Source Project and is licensed under a two-clause BSD
+license. It was taken from Bionic libc, used on Android.
+
+The implementation of DES for crypt (src/crypt/crypt_des.c) is
+Copyright © 1994 David Burren. It is licensed under a BSD license.
+
+The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
+originally written by Solar Designer and placed into the public
+domain. The code also comes with a fallback permissive license for use
+in jurisdictions that may not recognize the public domain.
+
+The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
+Valentin Ochs and is licensed under an MIT-style license.
+
+The x86_64 port was written by Nicholas J. Kain and is licensed under
+the standard MIT terms.
+
+The mips and microblaze ports were originally written by Richard
+Pennington for use in the ellcc project. The original code was adapted
+by Rich Felker for build system and code conventions during upstream
+integration. It is licensed under the standard MIT terms.
+
+The mips64 port was contributed by Imagination Technologies and is
+licensed under the standard MIT terms.
+
+The powerpc port was also originally written by Richard Pennington,
+and later supplemented and integrated by John Spencer. It is licensed
+under the standard MIT terms.
+
+All other files which have no copyright comments are original works
+produced specifically for use as part of this library, written either
+by Rich Felker, the main author of the library, or by one or more
+contibutors listed above. Details on authorship of individual files
+can be found in the git version control history of the project. The
+omission of copyright and license comments in each file is in the
+interest of source tree size.
+
+In addition, permission is hereby granted for all public header files
+(include/* and arch/*/bits/*) and crt files intended to be linked into
+applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
+the copyright notice and permission notice otherwise required by the
+license, and to use these files without any requirement of
+attribution. These files include substantial contributions from:
+
+Bobby Bingham
+John Spencer
+Nicholas J. Kain
+Rich Felker
+Richard Pennington
+Stefan Kristiansson
+Szabolcs Nagy
+
+all of whom have explicitly granted such permission.
+
+This file previously contained text expressing a belief that most of
+the files covered by the above exception were sufficiently trivial not
+to be subject to copyright, resulting in confusion over whether it
+negated the permissions granted in the license. In the spirit of
+permissive licensing, and of not having licensing issues being an
+obstacle to adoption, that text has been removed.
+----------------------------------------------------------------------
+Software:WPA supplicant 2.9
+
+Copyright notice:
+Copyright (c) 2002-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2000-2003 Intel Corporation
+Copyright (c) 2006-2007 Sony Corporation
+Copyright (c) 2008-2009 Atheros Communications
+Copyright (c) 2009, Jouni Malinen <j@w1.fi>
+Copyright 2008 Atheros Communications
+Copyright (c) 2009-2012, Masashi Honma <masashi.honma@gmail.com>
+Copyright (c) 2007-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2008-2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2008, Jouni Malinen <j@w1.fi>
+Copyright (c) 2008-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009-2010, Jouni Malinen <j@w1.fi>
+Copyright 2008 Atheros Communications.
+Copyright (c) 2006-2007 Sony Corporation. All Rights Reserved.
+Copyright (c) 2010, Atheros Communications, Inc.
+Copyright (c) 2006-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005, Jouni Malinen <j@w1.fi>
+Copyright (c) 2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2013, Qualcomm Atheros, Inc.
+Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2019, The Linux Foundation
+Copyright (c) 2010, Jouni Malinen <j@w1.fi>
+Copyright (c) 2010-2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2006, Jouni Malinen <j@w1.fi>
+Copyright (c) 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2012-2013, Qualcomm Atheros, Inc.
+Copyright (c) 2012-2014, Qualcomm Atheros, Inc.
+Copyright (c) 2003-2006, Jouni Malinen <j@w1.fi>
+Copyright (c) 2017, Qualcomm Atheros, Inc.
+Copyright (c) 2009-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2014-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2007, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2006, 2012, Jouni Malinen <j@w1.fi>
+Copyright 2007		Andy Green <andy@warmcat.com>
+Copyright 2009		Johannes Berg <johannes@sipsolutions.net>
+Copyright (c) 2003, 2004 David Young.  All rights reserved.
+Copyright (c) 2002-2005, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2009, 2011-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2009, 2012, 2014-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2012-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2009, 2011-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2009, 2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2016, Roshan Pius <rpius@google.com>
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+(c) The contribution was provided directly to me by some other
+person who certified (a), (b) or (c) and I have not modified
+Copyright (c) 2002-2019, Jouni Malinen <j@w1.fi> and contributors
+Copyright (c) 2013-2014, Qualcomm Atheros, Inc.
+Copyright (c) 2003-2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2005, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004, Sam Leffler <sam@errno.com>
+Copyright (c) 2004, Video54 Technologies
+Copyright (c) 2005-2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009, Atheros Communications
+Copyright (c) 2004, 2Wire, Inc
+Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
+Copyright (c) 2016, Sabrina Dubroca <sd@queasysnail.net> and Red Hat, Inc.
+Copyright (c) 2004, Gunter Burchardt <tira@isx.de>
+Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2006, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2004, Instant802 Networks, Inc.
+Copyright (c) 2005-2006, Devicescape Software, Inc.
+Copyright (c) 2007, Johannes Berg <johannes@sipsolutions.net>
+Copyright (c) 2009-2010, Atheros Communications
+Copyright (c) 2002-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2017, Jouni Malinen <j@w1.fi>
+Copyright(c) 2015 Intel Deutschland GmbH
+Copyright (c) 2008, Atheros Communications
+Copyright (c) 2013, Mark Kettenis
+Copyright (c) 2008-2012 Jouke Witteveen
+Copyright (c) 2003-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2010, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2011, Jouni Malinen <j@w1.fi>
+Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
+Copyright 2008 Michael Wu <flamingice@sourmilk.net>
+Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com>
+Copyright 2008 Michael Buesch <m@bues.ch>
+Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com>
+Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
+Copyright 2008 Colin McCabe <colin@cozybit.com>
+Copyright 2015-2017	Intel Deutschland GmbH
+Copyright (C) 2018-2019 Intel Corporation
+Copyright (c) 2010, Atheros Communications
+Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2008, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
+Copyright (c) 2013 Qualcomm Atheros, Inc.
+Copyright (c) 2010, Dan Harkins <dharkins@lounge.org>
+Copyright (c) 2004-2008, 2012-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2009, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2009, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>
+Copyright (c) 2010-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2013 Cozybit, Inc.
+Copyright (c) 2004-2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006-2007 <j@w1.fi>
+Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi>
+Copyright (c) 2014-2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2015, Pali Roh��r <pali.rohar@gmail.com>
+Copyright (c) 2015-2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2018, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2014, Qualcomm Atheros, Inc.
+Copyright (c) 2012, Intel Corporation. All rights reserved.
+Copyright 2015	Intel Deutschland GmbH
+Copyright (c) 2003-2008, Jouni Malinen <j@w1.fi>
+Copyright (c) 2018-2019, The Linux Foundation
+Copyright (c) 2003-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011-2014, Qualcomm Atheros, Inc.
+Copyright (c) 2011-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011, Qualcomm Atheros
+Copyright (c) 2009, Atheros Communications, Inc.
+Copyright (c) 2011-2013, Qualcomm Atheros, Inc.
+Copyright (c) 2011-2012, Qualcomm Atheros
+Copyright (c) 2013-2014, cozybit, Inc.  All rights reserved.
+Copyright (c) 2010-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2019, Jouni Malinen <j@w1.fi> and contributors
+Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi> and contributors
+Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011, Atheros Communications, Inc.
+Copyright (c) 2011-2012, Qualcomm Atheros, Inc.
+Copyright(c) 2014, Intel Mobile Communication GmbH.
+Copyright(c) 2014, Intel Corporation. All rights reserved.
+Copyright (C) 2010 The Android Open Source Project
+Copyright (c) 2008-2014, Jouni Malinen <j@w1.fi>
+Copyright (c) 2012, Intel Corporation
+Copyright (c) 2008 Bernard Gray <bernard.gray@gmail.com>
+Copyright (c) 2014-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2015, Qualcomm Atheros, Inc.
+Copyright (c) 2004-2018, Jouni Malinen <j@w1.fi>
+Copyright (c) 2014-2017, Qualcomm Atheros, Inc.
+Copyright (c) 2012-2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2008 Intel Corporation
+Copyright (c) 2016, Jouni Malinen <j@w1.fi>
+Copyright (c) 2018, Mathy Vanhoef
+Copyright (c) 2002-2018, Jouni Malinen <j@w1.fi>
+Copyright (c) 2010-2011, Atheros Communications, Inc.
+Copyright (c) 2002-2009, 2012-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2011, Atheros Communications
+Copyright (c) 2018-2019, Toke H?iland-J?rgensen <toke@toke.dk>
+Copyright (c) 2006, Devicescape Software, Inc.
+Copyright (c) 2002-2003, Jouni Malinen <j@w1.fi>
+Copyright 2003-2006, Jouni Malinen <j@w1.fi>
+Copyright 2003-2004, Instant802 Networks, Inc.
+Copyright 2005-2006, Devicescape Software, Inc.
+Copyright 2003, Jouni Malinen <j@w1.fi>
+Copyright (c) 2002-2004, Instant802 Networks, Inc.
+Copyright (c) 2013-2017, Qualcomm Atheros, Inc.
+Copyright (c) 2011-2017, Qualcomm Atheros, Inc.
+Copyright (c) 2011-2017, Qualcomm Atheros
+Copyright 2002-2003, Instant802 Networks, Inc.
+Copyright (c) 2008-2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2016-2017, Qualcomm Atheros, Inc.
+Copyright (c) 2019 John Crispin <john@phrozen.org>
+Copyright (c) 2007-2008, Intel Corporation
+Copyright (c) 2002-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2016, Qualcomm Atheros, Inc.
+Copyright(c) 2013 - 2016 Intel Mobile Communications GmbH.
+Copyright(c) 2011 - 2016 Intel Corporation. All rights reserved.
+Copyright (c) 2004-2008, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2016-2017, Jouni Malinen <j@w1.fi>
+Copyright (c) 2015 Google, Inc.
+Copyright 2003, Instant802 Networks, Inc.
+Copyright 2005, Devicescape Software, Inc.
+Copyright (c) 2012, Michael Braun <michael-dev@fami-braun.de>
+Copyright (c) 2011-2013, Jouni Malinen <j@w1.fi>
+Copyright (c) 2009, Dan Harkins <dharkins@lounge.org>
+Copyright (c) 2008-2019, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005, Sam Leffler <sam@errno.com>
+Copyright (c) 2004-2009, 2011-2015, Jouni Malinen <j@w1.fi>
+Copyright (c) 2003-2009, 2011-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2010-2011, Atheros Communications
+Copyright (c) 2006-2018, Jouni Malinen <j@w1.fi>
+Copyright (c) 2015, Adrian Nowicki <adinowicki@gmail.com>
+Copyright (c) 2011, Kel Modderman <kel@otaku42.de>
+Copyright (c) 2005-2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
+Copyright (c) 2009, Witold Sowa <witold.sowa@gmail.com>
+Copyright (c) 2009-2010, Witold Sowa <witold.sowa@gmail.com>
+Copyright (c) 2011-2012, Intel Corporation
+Copyright (c) 2005-2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2010, Jouni Malinen <j@w1.fi>
+Copyright (c) 2004-2011, Jouni Malinen <j@w1.fi>
+Copyright (c) 2007-2008, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2010, 2012, Jouni Malinen <j@w1.fi>
+Copyright (c) 2005-2008, 2012, Jouni Malinen <j@w1.fi>
+
+License: BSD License
+Copyright (c) <YEAR>, <OWNER>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+----------------------------------------------------------------------
+Software:Das U-Boot 2019.07
+
+Copyright notice:
+Copyright (C) 2015 Sakari Ailus
+Copyright (C) 2018, STMicroelectronics - All Rights Reserved
+Copyright (c) 2017 Intel Corporation
+Copyright (C) Freescale Semiconductor, Inc. 2006-2007
+(C) Copyright 2010
+Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2015, Intel Corporation
+Copyright (C) 2015-2016 Marvell International Ltd.
+Copyright 2008 Freescale Semiconductor, Inc.
+(C) Copyright 2000
+Copyright 2008-2012 Freescale Semiconductor, Inc.
+Copyright (C) 2016 Google, Inc
+Copyright (C) 2012-2020  ASPEED Technology Inc.
+Copyright 2016 Google, Inc
+(C) Copyright 2002
+(C) Copyright 2003
+(C) Copyright 2004
+(C) Copyright 2016 Linaro
+Copyright (C) 2015-2016 Wills Wang <wills.wang@live.com>
+(C) Copyright 2013 Siemens Schweiz AG
+(C) Heiko Schocher, DENX Software Engineering, hs@denx.de.
+Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2013
+Copyright 2016-2017 Texas Instruments, Inc.
+(C) Copyright 2012
+(C) Copyright 2016-2017
+(C) Copyright 2017 Linaro Ltd.
+(C) Copyright 2008
+Copyright 2011 Linaro Limited
+Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2018
+Copyright (C) 2017 Álvaro Fernández Rojas <noltari@gmail.com>
+Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
+(C) Copyright 2019 Rockchip Electronics Co., Ltd
+(C) Copyright 2009 Magnus Lilja <lilja.magnus@gmail.com>
+(c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
+Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2014 Gateworks Corporation
+Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
+Copyright (C) 2016 Grinn
+(C) Copyright 2014
+(C) Copyright 2009 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Armadeus Systems
+(C) Copyright 2007
+(C) Copyright 2000-2003
+Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
+(C) Copyright 2004-2007, 2012 Freescale Semiconductor, Inc.
+(C) Copyright 2019
+(C) Copyright 2000-2004
+Copyright (c) 2015 Google, Inc
+Copyright (C) Freescale Semiconductor, Inc. 2006.
+Copyright (C) 2016 Stefan Roese <sr@denx.de>
+(C) Copyright 2016
+Copyright (C) 2010 Freescale Semiconductor, Inc.
+(C) Copyright 2019 NXP, Inc.
+Copyright (C) 2008,2010 Freescale Semiconductor, Inc.
+Copyright (C) 2007-2008 Freescale Semiconductor, Inc.
+Copyright (C) 2008 Freescale Semiconductor, Inc.
+Copyright (C) 2010 Albert ARIBAUD <albert.u.boot@aribaud.net>
+Copyright (C) 2000-2005, DENX Software Engineering
+Copyright (C) Procsys. All rights reserved.
+(C) Copyright 2015 - 2016 Xilinx, Inc.
+Copyright (C) Excito Elektronik i Skåne AB, 2010.
+Copyright (C) 2015, 2019 Stefan Roese <sr@denx.de>
+Copyright (C) 2015 Google, Inc
+Copyright (C) 2011 Freescale Semiconductor, Inc.
+Copyright (C) Excito Elektronik i Skåne AB, All rights reserved.
+(C) Copyright 2007-2008
+Copyright (C) 2013 Ludovic Desroches <ludovic.desroches@atmel.com>
+Copyright (C) 2018 Álvaro Fernández Rojas <noltari@gmail.com>
+Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+Copyright 2014 Maxime Ripard
+Copyright (c) 2016 Google, Inc
+Copyright (C) 2011 The Chromium OS Authors. All rights reserved.
+Copyright (c) 2014 Google, Inc
+Copyright (C) 2000 Ronald G. Minnich
+Copyright (C) 2012 Google Inc.
+Copyright (C) 2018 Ãlvaro Fernández Rojas <noltari@gmail.com>
+(C) Copyright 2014, Cavium Inc.
+(C) Copyright 2014 - 2018 Xilinx, Inc.
+Copyright (C) 2013 The Chromium OS Authors.
+(C) Copyright 2018  Cisco Systems, Inc.
+(C) Copyright 2019  Synamedia
+Copyright 2018 NXP
+Copyright (C) 2017 Marek Behun <marek.behun@nic.cz>
+Copyright (C) 2016 Tomas Hlavacek <tomas.hlavacek@nic.cz>
+Copyright (C) 2012 Altera Corporation <www.altera.com>
+(c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
+(C) Copyright 2011
+Copyright (C) 2015 Atmel Corporation
+(C) 2006 Andrew Victor
+Copyright (C) 2007 Atmel Corporation.
+Copyright (C) SAN People
+(C) 2007 Atmel Corporation.
+Copyright (C) 2006 Atmel Corporation.
+(C) 2008 Atmel Corporation.
+Copyright (C) 2008 Atmel Corporation.
+Copyright (C) 2007 Atmel Corporation
+Copyright (C) 2012-2013 Atmel Corporation.
+Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jrosoft.com>
+Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Copyright (C) 2007 Andrew Victor
+Copyright (C) 2010
+Copyright (C) 2009 Jens Scharsig (jsatng@scharsoft.de)
+Copyright (C) 2005 Ivan Kokshaysky
+Copyright (C) 2008 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Copyright (C) 2018 Microchip Technology Inc.
+Copyright (C) 2013 Atmel Corporation
+Copyright (C) 2015 Atmel Corporation.
+Copyright (c) 2015 Atmel Corporation
+Copyright (C) 2005-2013 Atmel Corporation
+Copyright (C) 2005 HP Labs
+Copyright (C) 2015 Atmel
+Copyright (C) 2017 Microchip Corporation.
+(C) 2012 - 2013 Atmel Corporation.
+Copyright (C) 2012 Atmel Corporation.
+Copyright (C) 2014 Atmel
+Copyright (C) 2016 Marek Vasut <marex@denx.de>
+Copyright (C) 2013 DENX Software Engineering, hs@denx.de
+(C) Copyright 2014 DENX Software Engineering
+Copyright 2012 Freescale Semiconductor, Inc.
+Copyright 2013 Freescale Semiconductor, Inc.
+Copyright 2007-2012 Freescale Semiconductor, Inc.
+Copyright 2014 Freescale Semiconductor, Inc.
+Copyright 2009-2012 Freescale Semiconductor, Inc.
+Copyright 2011-2012 Freescale Semiconductor, Inc.
+Copyright (C) 2015-2016 Socionext Inc.
+Copyright (C) 2012-2015 Panasonic Corporation
+Copyright (C) 2014      Panasonic Corporation
+Copyright (C) 2013-2014 Panasonic Corporation
+Copyright (C) 2015-2017 Socionext Inc.
+Copyright (C) 2016 Socionext Inc.
+Copyright (C) 2016-2018 Socionext Inc.
+Copyright (C) 2011-2015 Panasonic Corporation
+Copyright (C) 2016      Socionext Inc.
+Copyright (C) 2012-2014 Panasonic Corporation
+Copyright (C) 2011-2015 Copyright (C) 2011-2015 Panasonic Corporation
+Copyright (C) 2016-2017 Socionext Inc.
+Copyright (C) 2017 Socionext Inc.
+Copyright (C) 2008-2009 Samsung Electronics
+(C) Copyright 2017
+(C) Copyright 2017, 2018
+Copyright (c) 2018, Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (C) 2006 David Gibson, IBM Corporation.
+Copyright 2012 Kim Phillips, Freescale Semiconductor.
+Copyright (C) 2014 David Gibson <david@gibson.dropbear.id.au>
+Copyright (C) 2012 David Gibson, IBM Corporation.
+Copyright (C) 2016 Free Electrons
+Copyright (C) 2016 NextThing Co.
+Copyright (c) 2017 Heinrich Schuchardt
+Copyright (C) 2007
+Copyright (C) 2014 STMicroelectronics All Rights Reserved
+Copyright (c) 2018 Microsemi Corporation
+Copyright (c) 2019 Microsemi Corporation
+Copyright 2019, Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (c) 2018 Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (c) 2018 AKASHI Takahiro, Linaro Limited
+Copyright 2006 - 2016 Unified EFI, Inc.<BR>
+Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2019 Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (c) 2018 Heinrich Schuchardt
+Copyright (C) 2018 MediaTek Inc.
+Copyright (c) 2018 Emlid Limited
+Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2013 Texas Instruments
+Copyright (c) 1999-2002 Vojtech Pavlik
+Copyright (c) 2015 Hans de Goede <hdegoede@redhat.com>
+Copyright (C) 2013 Boundary Devices
+Copyright (C) 2013, 2014 Markus Niebel <Markus.Niebel@tq-group.com>
+Copyright (C) 2012 Freescale Semiconductor, Inc.
+Copyright (C) 2013, 2014 TQ Systems (ported SabreSD to TQMa6x)
+Copyright (C) 2014 - 2015 Markus Niebel <Markus.Niebel@tq-group.com>
+Copyright (C) 2013, 2014 TQ Systems
+Copyright (C) 2015 Stefan Roese <sr@denx.de>
+Copyright (C) 2013 Suriyan Ramasami <suriyan.r@gmail.com>
+Copyright (C) 2010  Eric C. Cooper <ecc@cmu.edu>
+(C) Copyright 2009
+Copyright 2011, 2013 Freescale Semiconductor, Inc.
+Copyright (C) 2017
+Copyright 2010-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2013, Texas Instruments, Incorporated - http://www.ti.com/
+Copyright 2017 Bernecker & Rainer Industrieelektronik GmbH
+Copyright 2011 Freescale Semiconductor, Inc.
+Copyright (C) 2015 Amlogic, Inc. All rights reserved.
+Copyright (C) 2016 BayLibre, SAS. All rights reserved.
+(C) 2012 NetModule AG, David Andrey, added KSZ9031
+(C) Copyright 2017 Adaptrum, Inc.
+(C) Copyright 2009 Industrie Dial Face S.p.A.
+(C) Copyright 2001
+Copyright (c) 2016 Microsemi Corporation
+(C) Copyright 2015
+Copyright 2010-2011, 2015 Freescale Semiconductor, Inc.
+Copyright 2016 Karsten Merker <merker@debian.org>
+Copyright (c) 2006 Herbert Valerio Riedel <hvr@gnu.org>
+Copyright 2010-2014 Freescale Semiconductor, Inc.
+Copyright (C) 2015 - 2016 Xilinx, Inc.
+Copyright (C) 2018 Rosy Song <rosysong@rosinson.com>
+Copyright (C) 2017 Linaro
+JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
+Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
+(C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
+Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
+Copyright (c) 2010-2014, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
+Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
+Copyright (C) 2009 Florian Fainelli <florian@openwrt.org>
+Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2017, STMicroelectronics - All Rights Reserved
+(C) Copyright 2012 Michal Simek <monstr@monstr.eu>
+(C) Copyright 2013 - 2018 Xilinx, Inc.
+Copyright (C) 2018 Xilinx, Inc.
+Copyright 2009-2011 Freescale Semiconductor, Inc.
+Copyright 2016 Freescale Semiconductor, Inc.
+Copyright 2011-2015 Freescale Semiconductor, Inc.
+Copyright 2015 Freescale Semiconductor, Inc.
+(C) Copyright 2004-2011
+Copyright (C) 2014 STMicroelectronics
+Copyright (C) 2017 Rockchip Electronics Co., Ltd
+Copyright (c) 2016 Rockchip Electronics Co., Ltd
+Copyright (c) 2016 Andreas Färber
+(C) Copyright 2017 Rockchip Electronics Co., Ltd
+(C) Copyright 2016 Beniamino Galvani <b.galvani@gmail.com>
+Copyright (c) 2012 Michael Walle
+(C) Copyright 2011 Andes Technology Corp
+Copyright (C) 2016 BayLibre, SAS
+Copyright (c) 2011 IDS GmbH, Germany
+Copyright (c) 2017 Rockchip Electronics Co., Ltd
+Copyright (C) 2007 Free Software Foundation, Inc.
+(C) Copyright 2011-2012 Pali Rohár <pali.rohar@gmail.com>
+(C) Copyright 2008-2009
+Copyright 2010 Nicolas Palix <npalix@diku.dk>
+Copyright 2010 Julia Lawall <julia@diku.dk>
+Copyright 2010 Gilles Muller <Gilles.Muller@lip6.fr>
+Copyright (C) 2015
+(C) Copyright 2014 Red Hat Inc.
+Copyright (c) 2014-2015, NVIDIA CORPORATION.  All rights reserved.
+Copyright (C) 2015 K. Merker <merker@debian.org>
+Copyright (c) 2011 The Chromium OS Authors.
+(C) Copyright 2014 Google, Inc
+Copyright (C) 2012 Samsung Electronics
+Copyright (c) 2007
+Copyright 2010-2011 Calxeda, Inc.
+Copyright (C) 2017 NXP Semiconductors
+Copyright (C) 2017 Bin Meng <bmeng.cn@gmail.com>
+(C) Copyright 2014 Samsung Electronics
+Copyright (C) 2017, Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
+Copyright (C) 2006 Free Software Foundation, Inc.
+Copyright (C) 2015 Google. Inc
+(C) 2003 Arun Dharankar <ADharankar@ATTBI.Com>
+Copyright 2014 Broadcom Corporation.
+Copyright (c) 2007,2008
+Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
+Copyright (c) 2013 The Chromium OS Authors.
+Copyright (C) Thomas Gleixner <tglx@linutronix.de>
+Copyright (C) 2013, Miao Yan <miao.yan@windriver.com>
+Copyright (C) 2015-2018, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2014, Simon Glass <sjg@chromium.org>
+(C) Copyright 2013 Xilinx, Inc.
+Copyright (C) 2018 Synopsys, Inc. All rights reserved.
+(C) Copyright 2016 Rockchip Electronics Co., Ltd
+Copyright (c) 2016-2019 Toradex, Inc.
+Copyright (c) 2016 Toradex, Inc.
+(C) Copyright 2015 Google, Inc
+Copyright (C) 2016-2018 Toradex AG
+Copyright (C) 2015 Freescale Semiconductor, Inc.
+2015 Toradex AG
+Copyright (C) 2011 Samsung Electronics
+Copyright (C) 2017 Marek Vasut <marex@denx.de>
+(C) Copyright 2011 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Dennis Gilmore <dgilmore@redhat.com>
+(c) Copyright 2015 Xilinx, Inc. All rights reserved.
+(C) Copyright 2010-2015
+Copyright (c) 2012 The Chromium OS Authors.
+(C) Copyright 2010,2011
+Copyright (c) 2014-2016, NVIDIA CORPORATION.
+Copyright (c) 2019 NVIDIA Corporation. All rights reserved.
+(C) Copyright 2010-2014
+Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+Copyright (c) 2011, Google Inc. All rights reserved.
+Copyright (c) 2016, NVIDIA CORPORATION.
+(C) Copyright 2010-2019
+Copyright 2018 Google LLC
+Copyright 2010-2011 NVIDIA Corporation
+Copyright (c) 2011-2013, NVIDIA CORPORATION.  All rights reserved.
+(C) Copyright 2009 SAMSUNG Electronics
+Copyright (C) 2011-2012 NVIDIA Corporation
+Copyright (c) 2013 NVIDIA Corporation
+(C) Copyright 2010, 2011
+Copyright (C) 2019, STMicroelectronics - All Rights Reserved
+Copyright (C) 2007-2009 Industrie Dial Face S.p.A.
+Copyright (C) 1999-2005 Igor Pavlov
+Copyright (C) 2007-2008 Industrie Dial Face S.p.A.
+Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr>
+(C) Copyright 2004-2008
+Copyright (C) 2013 Marek Vasut <marex@denx.de>
+(C) Copyright 2009-2015
+Copyright (C) STMicroelectronics 2018 - All Rights Reserved
+Copyright (C) 2014 STMicroelectronics -- All Rights Reserved
+(C) Copyright 2012-2014
+(C) Copyright 2015 Texas Insturments
+(C) Copyright 2008 Texas Insturments
+Copyright (C) 2016 Chen-Yu Tsai
+Copyright (C) 2013 - ARM Ltd
+Copyright 2004, 2011 Freescale Semiconductor.
+(C) Copyright 2002 Scott McNutt <smcnutt@artesyncp.com>
+Copyright (C) 2017 Impinj
+Copyright (C) 2016 Glider bvba
+Copyright (C) 2016 Cogent Embedded Inc.
+Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org>
+Copyright (C) 2017 Cogent Embedded Inc.
+Copyright (C) 2018 Renesas Electronics Corp.
+Copyright (C) 2017 Glider bvba
+Copyright © 2015 Broadcom
+Copyright (c) 2015-2016, NVIDIA CORPORATION.
+Copyright (c) 2016, NVIDIA CORPORATION
+(C) Copyright 2013 Atmel Corporation
+(C) Copyright 2014 Freescale Semiconductor, Inc.
+(C) Copyright 2014 Freescale Semiconductor, Inc
+Copyright (C) 2004-2008, 2012 Freescale Semiconductor, Inc.
+Copyright © 2016 Intel Corporation
+Copyright 2015 Freescale Semiconductor
+Copyright 2017 NXP
+Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+Copyright 2016 Google Inc.
+Copyright (c) 2017-2018 Vasily Khoruzhick <anarsoul@gmail.com>
+(C) Copyright 2016  Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2018-2019 Toradex AG
+Copyright (C) 2016 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Toradex AG
+(C) Copyright 2016 Broadcom Ltd.
+Copyright (C) 2016 David Lechner <david@lechnology.com>
+Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd. <nick.thompson@gefanuc.com>
+Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
+Copyright (c) 2013 Xilinx Inc.
+Copyright (c) 2013 Xilinx, Inc.
+Copyright (c) 2015 DAVE Embedded Systems
+(c) Copyright 2016 Topic Embedded Products.
+Copyright (C) 2013,2014 Renesas Electronics Corporation
+Copyright (C) 2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C)  2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C)  2014 Renesas Electronics Corporation
+Copyright (C) 2011  Renesas Solutions Corp.
+Copyright (C) 2011  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Copyright (C) 2012 Renesas Solutions Corp.
+Copyright (C) 2016 Renesas Electronics Corporation
+Copyright (C) 2014 Renesas Electronics Corporation
+Copyright (C) 2015 Renesas Electronics Corporation
+Copyright (C) 2013, 2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C) 2013, 2014 Renesas Electronics Corporation
+Copyright (C) 2013-2017 Renesas Electronics Corporation
+Copyright (C) 2008-2009 Renesas Solutions Corp.
+Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
+Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+Copyright (C) 2018-2019 Rosy Song <rosysong@rosinson.com>
+Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2013-2017, ISEE 2007 SL - http://www.isee.biz/
+Copyright (C) 2013, ISEE 2007 SL - http://www.isee.biz/
+(C) Copyright 2011 Bluewater Systems
+Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com
+Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com
+Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com
+Copyright (c) 2003,Motorola Inc.
+Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
+Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
+(C) Copyright 2000-2006
+Copyright 2004 Freescale Semiconductor, Inc.
+Copyright 2006 Freescale Semiconductor, Inc.
+Copyright 2008-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2004-2008,2010-2011 Freescale Semiconductor, Inc.
+Copyright 2010 Freescale Semiconductor, Inc.
+Copyright 2012-2016 Freescale Semiconductor, Inc.
+Copyright 2007,2009-2012 Freescale Semiconductor, Inc.
+(C) Copyright 2002-2010
+Copyright 2004-2011 Freescale Semiconductor, Inc.
+Copyright(c) 2002,2003 Motorola Inc.
+Copyright 2004, 2011 Freescale Semiconductor
+Copyright 2009-2010 Freescale Semiconductor, Inc.
+Copyright 2010 eXMeritus, A Boeing Company
+Copyright 2008 Qstreams Networks, Inc.
+(C) Copyright 2000-2009
+(C) Copyright 2000 - 2002
+Copyright (C) 2015 Altera Corporation <www.altera.com>
+Copyright (C) 2011 Andes Technology Corporation
+Copyright (C) 2013 Renesas Electronics Corporation
+Copyright (C) 2013 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C) 2015 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Copyright (C) 2019 Marek Vasut <marek.vasut@gmail.com>
+Copyright 2008 Extreme Engineering Solutions, Inc.
+Copyright 2004, 2007 Freescale Semiconductor, Inc.
+Copyright (C) 2013
+Copyright (C) 2009
+Copyright (C) 2006
+Copyright (C) 2004, 2005
+Copyright (C) 2004 Ray Lehtiniemi
+Copyright (C) 2003 Cirrus Logic, Inc
+Copyright (C) 1999 ARM Limited.
+Copyright 2008, 2010 Freescale Semiconductor, Inc.
+Copyright 2007,2009-2010 Freescale Semiconductor, Inc.
+Copyright (c) 2013, Andreas Oetken.
+Copyright (c) 2013, Google Inc.
+(C) Copyright 2008 Semihalf
+Copyright (C) 2003-2006  Christophe Devine
+Copyright (c) 2009 Analog Devices Inc.
+Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
+Copyright (C) 2013 Soren Brinkmann <soren.brinkmann@xilinx.com>
+Copyright (C) 2013 Xilinx, Inc. All rights reserved.
+Copyright (C) 2012 Michal Simek <monstr@monstr.eu>
+Copyright (C) 2012 Xilinx, Inc. All rights reserved.
+Copyright (C) 2012 - 2013 Michal Simek <monstr@monstr.eu>
+Copyright (C) 2012 - 2017 Xilinx, Inc. All rights reserved.
+(c) Copyright 2010-2017 Xilinx, Inc. All rights reserved.
+Copyright (c) 2013 - 2017 Xilinx Inc.
+(C) Copyright 2014 - 2017 Xilinx, Inc. Michal Simek
+Copyright (C) 2017 Weidmüller Interface GmbH & Co. KG
+Copyright (C) 2011-2017 Xilinx, Inc. All rights reserved.
+(C) Copyright 2002-2004
+Copyright (C) 2015 Actions Semi Co., Ltd.
+Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
+Copyright (C) 2012 Vikram Narayananan
+(C) Copyright 2012,2015 Stephen Warren
+Copyright (c) 2018 BayLibre, SAS.
+Copyright (C) 2018 BayLibre, SAS
+(C) Copyright 2013-2014 Luc Verhaegen <libv@skynet.be>
+(C) Copyright 2014-2015 Hans de Goede <hdegoede@redhat.com>
+(C) Copyright 2017 Icenowy Zheng <icenowy@aosc.io>
+Copyright (c) 2018 Microsemi Coprporation
+Copyright (C) 1996-2002 Julian R Seward.  All rights reserved.
+Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
+(C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+(C) Copyright 2011 CompuLab, Ltd. <www.compulab.co.il>
+(C) Copyright 2012 - 2013 CompuLab, Ltd. <www.compulab.co.il>
+Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH,
+<armlinux@phytec.de>
+Copyright 2017 Google, Inc
+Copyright (C) 2006-2009 Freescale Semiconductor, Inc.
+Copyright 2007-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2014 Stefan Roese <sr@denx.de>
+Copyright (C) 1996, 99 Ralf Baechle
+Copyright (C) 2000, 2002  Maciej W. Rozycki
+Copyright (C) 1990, 1999 by Silicon Graphics, Inc.
+Copyright (C) 1995, 1996, 1997, 1999, 2001 by Ralf Baechle
+Copyright (C) 1999 by Silicon Graphics, Inc.
+Copyright (C) 2001 MIPS Technologies, Inc.
+Copyright (C) 2002  Maciej W. Rozycki
+Copyright (C) 2016 Cadence Design Systems Inc.
+Copyright (c) 1994 - 1997, 1999, 2000  Ralf Baechle (ralf@gnu.org)
+Copyright (c) 2000  Silicon Graphics, Inc.
+Copyright (C) 1996, 99, 2003 by Ralf Baechle
+Copyright (C) 1994, 1995, 1996 by Ralf Baechle
+(C) Copyright 1996, 97, 99, 2002, 03 Ralf Baechle
+(C) Copyright 1999 Silicon Graphics, Inc.
+Copyright (c) 2016 Imagination Technologies Ltd.
+Copyright 2009 Freescale Semiconductor, Inc.
+Copyright (C) 2003, 2004 Ralf Baechle
+Copyright (C) 2004  Maciej W. Rozycki
+Copyright (C) 1994, 1995 Waldorf GmbH
+Copyright (C) 1994 - 2000, 06 Ralf Baechle
+Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+Copyright (C) 2004, 2005  MIPS Technologies, Inc.  All rights reserved.
+Copyright (c) 1998 Harald Koerfgen
+Copyright (C) 2013 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2013 Imagination Technologies
+Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001 by Ralf Baechle
+Copyright (C) 2000 Silicon Graphics, Inc.
+Copyright (C) 2000, 07 MIPS Technologies, Inc.
+Copyright (C) 2003, 2004  Maciej W. Rozycki
+Copyright (C) 1994 - 2002 by Ralf Baechle
+Copyright (C) 1999, 2000, 2001 Silicon Graphics, Inc.
+Copyright (C) 1996, 1997, 1998, 2000 by Ralf Baechle
+Copyright (C) 1994 Waldorf GMBH
+Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle
+Copyright (C) 1996 Paul M. Antoine
+Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
+Copyright (C) 1997, 1999, 2001, 06 by Ralf Baechle
+Copyright (C) 1995, 1999 by Ralf Baechle
+Copyright (C) 1995, 1999 Silicon Graphics
+Copyright (C) 1985 MIPS Computer Systems, Inc.
+Copyright (C) 1994, 95, 99, 2003 by Ralf Baechle
+Copyright (C) 1990 - 1992, 1999 Silicon Graphics, Inc.
+Copyright (C) 2011 Wind River Systems,
+written by Ralf Baechle <ralf@linux-mips.org>
+Copyright (c) 2017 Imagination Technologies Ltd.
+Copyright (C) 1996, 1999, 2001 Ralf Baechle
+Copyright (C) 1999 Silicon Graphics, Inc.
+Copyright (c) 1994, 95, 96, 97, 98, 2000, 01 Ralf Baechle
+Copyright (c) 2000 by Silicon Graphics, Inc.
+Copyright (c) 2001 MIPS Technologies, Inc.
+Copyright (C) 1994 - 1999 by Ralf Baechle
+Copyright (C) 1996 by Paul M. Antoine
+Copyright (C) 2000 MIPS Technologies, Inc.
+Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
+Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
+Copyright (C) 2014 Marek Vasut <marex@denx.de>
+(C) Copyright 2018, Linaro Limited
+Copyright (c) 2018 JJ Hiblot <jjhiblot@ti.com>
+Copyright (C) Nelson Integration, LLC 2016
+Copyright (c) 2017 Google, Inc
+(C) Copyright 2000-2011
+Copyright (c) 2016 Alexander Graf
+(C) Copyright 2011-2013 Pali Rohár <pali.rohar@gmail.com>
+Copyright (c) 2012, Google Inc. All rights reserved.
+Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+Copyright (C) 2013 Xilinx, Inc.
+Copyright (C) 2017 Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright (c) 2017 Álvaro Fernández Rojas <noltari@gmail.com>
+Copyright (c) 2016 The Chromium OS Authors.
+Copyright (c) 2016 National Instruments Corp
+Copyright (c) 2013 Google, Inc
+(C) Copyright 2018 Linaro Ltd.
+Copyright 2000-2009
+(C) Copyright 2000, 2001
+Copyright (c) 2001 William L. Pitts
+(C) Copyright 2011 - 2012 Samsung Electronics
+(C) Copyright 2003 - 2004
+Copyright 2008 - 2009 Windriver, <www.windriver.com>
+(C) Copyright 2014 Linaro, Ltd.
+Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
+Copyright (C) 2014, Bachmann electronic GmbH
+(C) Copyright 2009-2013 ADVANSEE
+Copyright 2008 Silicon Turnkey Express, Inc.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+Copyright (c) 2008-2011 Analog Devices Inc.
+Copyright (c) 2012, Google Inc.
+Copyright (c) 2009, Brush Technology
+Copyright (c) 2012:
+Joe Hershberger, National Instruments, joe.hershberger@ni.com
+(C) Copyright 2005
+Copyright 2002 SYSGO Real-Time Solutions GmbH
+(C) Copyright 2007 by OpenMoko, Inc.
+(C) Copyright 2013 Patrice Bouchand <pbfwdlistgmailcom>
+Copyright 2006 Freescale Semiconductor
+(C) Copyright 2011 Freescale Semiconductor, Inc
+(C) Copyright 2007 Michal Simek
+Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
+Copyright 2008-2009 Freescale Semiconductor, Inc.
+(c) 1999 Machine Vision Holdings, Inc.
+(c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
+(C) 2010 Nanometrics, Inc.
+(C) Copyright 2006-2007 OpenMoko, Inc.
+(C) 2004 Texas Instruments
+Copyright 2010, 2012 Freescale Semiconductor
+(C) Copyright 2000-2013
+(C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+Copyright (C) 2005-2008 Samsung Electronics
+(C) 1999-2000 Magnus Damm <damm@bitsmart.com>
+Copyright (C) 2014-2015 Samsung Electronics
+Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
+(C) Copyright 2015 Miao Yan <yanmiaobest@gmail.com>
+Copyright (C) 2017 Eddie Cai <eddie.cai.linux@gmail.com>
+Copyright 2018, Google Inc.
+Copyright 2013 Wolfgang Denk <wd@denx.de>
+Copyright (C) 2008 Atmel Corporation
+Copyright 2018
+Copyright (C) 2011
+Copyright (c) 2008 Analog Devices Inc.
+(C) Copyright 2007 OpenMoko, Inc.
+Copyright (C) 2013 Lukasz Majewski <l.majewski@samsung.com>
+Coypright (c) 2013 Guntermann & Drunck GmbH
+Copyright (c) 2018 Bootlin
+(C) Copyright 2009 Reinhard Arlt, reinhard.arlt@esd-electronics.com
+(C) Copyright 2003 Stefan Roese, stefan.roese@esd-electronics.com
+Copyright (C) 2008 Samsung Electronics
+Copyright 2008-2009 Stefan Roese <sr@denx.de>, DENX Software Engineering
+Copyright (C) 2016 Toradex
+Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
+Copyright (C) 2018, Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
+Copyright (c) 2019 Michael Walle <michael@walle.cc>
+(C) Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
+Copyright 2011, Marvell Semiconductor Inc.
+Copyright (C) 2005 for Samsung Electronics
+Copyright (c) 2005, 2009 Freescale Semiconductor, Inc
+Copyright (c) 2005 MontaVista Software
+Copyright (c) 2008 Excito Elektronik i Sk=E5ne AB
+(C) Copyright 2010 Faraday Technology
+Copyright (C) 2007 Rodolfo Giometti <giometti@linux.it>
+Copyright (C) 2007 Eurotech S.p.A. <info@eurotech.it>
+Copyright (C) 2011 Jana Rapava <fermata7@gmail.com>
+Copyright (C) 2011 CompuLab, Ltd. <www.compulab.co.il>
+Copyright (C) 2010 Nokia Corporation
+(C) Copyright 2016 - 2018 Xilinx, Inc.
+Copyright 2016 - 2018 Xilinx, Inc.
+(C) Copyright 2019 Xilinx, Inc.
+Copyright 2017 Theobroma Systems Design und Consulting GmbH
+(C) Copyright 2017 Heiko Stuebner <heiko@sntech.de>
+(C) Copyright 2015 Rockchip Electronics Co., Ltd
+(C) Copyright 2016 Heiko Stuebner <heiko@sntech.de>
+(C) Copyright 2017 Rockchip Electronics Co., Ltd.
+(C) Copyright 2008-2014 Rockchip Electronics
+Copyright 2014 Rockchip Inc.
+Copyright (c) 2016 Heiko Stuebner <heiko@sntech.de>
+Copyright 2015 Google, Inc
+(C) Copyright 2012 SAMSUNG Electronics
+Copyright 2016 Rockchip Inc.
+(C) Copyright 2016 Google, Inc
+Copyright (C) 2017 Fuzhou Rockchip Electronics Co., Ltd
+Copyright (C) 2017 Rockchip Electronics Co., Ltd.
+Copyright (C) 2016-2017 Rockchip Electronics Co., Ltd
+(C) Copyright 2016 Rockchip Electronics Co.,Ltd
+(C) Copyright 2009 Stefan Roese <sr@denx.de>, DENX Software Engineering
+Copyright (C) 2006 Micronas GmbH
+(C) Copyright 2008 Stefan Roese <sr@denx.de>, DENX Software Engineering
+Copyright 2005, Seagate Technology LLC
+(C) Copyright 2014 Albert ARIBAUD <albert.u.boot@aribaud.net>
+Copyright (c) 2000 MontaVista Software, Inc (source@mvista.com)
+Copyright (c) 2003 Motorola,Inc.
+Copyright 2004,2007-2011 Freescale Semiconductor, Inc.
+(C) Copyright 2002, 2003 Motorola Inc.
+(C) Copyright 2003 Motorola Inc.
+Copyright 2009-2012 Freescale Semiconductor, Inc
+Copyright (c) 2000 MontaVista Software, Inc.   Dan Malek (dmalek@jlc.net)
+(C) Copyright 2000 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+(C) Copyright 2000-2002
+(C) Copyright 2002 (440 port)
+(C) Copyright 2003 Motorola Inc. (MPC85xx port)
+Copyright 2008,2010 Freescale Semiconductor, Inc.
+Copyright 2004 Freescale Semiconductor.
+Copyright (C) 2003 Motorola Inc.
+Copyright (C) 2006 Freescale Semiconductor, Inc.
+Copyright 2004, 2007-2011 Freescale Semiconductor, Inc.
+Copyright 2007 Freescale Semiconductor.
+Copyright (C) 2003 Motorola
+Copyright (C) 1995-1996  Gary Thomas (gdt@linuxppc.org)
+Copyright (C) 2014 NVIDIA Corporation
+(C) 2018 Theobroma Systems Design und Consulting GmbH
+Copyright (C) 2015 Samsung Electronics
+(C) Copyright 2016 Texas Instruments Incorporated, <www.ti.com>
+(C) Copyright 2017 Texas Instruments Incorporated, <www.ti.com>
+Copyright (C) 2016 Samsung Electronics
+Copyright (C) 2018
+Copyright (C) 2015 Freescale Semiconductor, Inc
+(C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
+Copyright (C) 2015 Linaro
+(C) Copyright 2014 Texas Instruments Incorporated -  http://www.ti.com
+(C) Copyright 2011-2013
+Copyright (C) EETS GmbH, 2017, Felix Brack <f.brack@eets.ch>
+Copyright (C) 2016 Toradex AG
+(C) Copyright 2015, Freescale Semiconductor, Inc.
+(C) Copyright 2013-2015, Freescale Semiconductor, Inc.
+Copyright (c) 2019 Western Digital Corporation or its affiliates.
+Copyright (C) 2016 Vladimir Zapolskiy <vz@mleia.com>
+(c) Copyright 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
+(c) Copyright 2008 Renesas Solutions Corp.
+(C) Copyright 2007-2012
+Copyright (C) 2007,2008 Nobobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Copyright (C) 2008 Renesas Solutions Corp.
+(C) Copyright 2007, 2012 Freescale Semiconductor, Inc.
+Copyright (C) 2015 ARM Limited
+Copyright (C)  2018 Texas Instruments Incorporated - http://www.ti.com/
+(C Copyright 2009
+Copyright (C) 2010-2013 Freescale Semiconductor, Inc.
+Copyright (C) 2013, Boundary Devices <info@boundarydevices.com>
+Copyright (C) 2014-2019, Toradex AG
+Copyright (C) 2014-2016, Toradex AG
+Copyright (c) 2017 Andy Yan
+Copyright (C) 2012 Boundary Devices Inc.
+Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
+Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2012-2015 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2012
+Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+(C) Copyright 2007-2013
+Copyright (C) 2017, Grinn - http://grinn-global.com/
+Copyright (C) 2016, Texas Instruments, Incorporated - http://www.ti.com/
+Copyright (C) 2013, Texas Instruments, Incorporated
+Copyright (C) 2013, Adeneo Embedded <www.adeneo-embedded.com>
+Copyright (C) 2009, Texas Instruments, Incorporated
+Copyright 2017 Texas Instruments, Inc.
+Copyright (C) 2017, Konsulko Group
+Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2015 Simon Arlott <simon@fire.lp0.eu>
+Copyright (C) 2000-2010 Broadcom Corporation
+Copyright (C) 2010 Broadcom Corporation
+Copyright (C) 2015 - 2018 Texas Instruments Incorporated <www.ti.com>
+Copyright 2004,2007,2008 Freescale Semiconductor, Inc.
+Copyright (C) 2008 by NXP Semiconductors
+Copyright (c) 2015 Tyco Fire Protection Products.
+Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Texas Instruments Incorporated <www.ti.com>
+Copyright 2015-2016 Freescale Semiconductor, Inc.
+Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2014-2016 Stefan Roese <sr@denx.de>
+Copyright (C) 2015-2016 Reinhard Pfau <reinhard.pfau@gdsys.cc>
+Copyright (C) 2015 Reinhard Pfau <reinhard.pfau@gdsys.cc>
+(C) Copyright 2008 Marvell Semiconductor
+Copyright (C) Marvell International Ltd. and its affiliates
+Copyright (c) Xilinx, Inc.
+(C) Copyright 2014 - 2015 Xilinx, Inc.
+Copyright (c) 2013-2014, NVIDIA CORPORATION.  All rights reserved.
+Copyright (c) 2016-2018, NVIDIA CORPORATION.
+Copyright (c) 2010-2019, NVIDIA CORPORATION.  All rights reserved.
+Copyright (c) 2012-2019, NVIDIA CORPORATION. All rights reserved.
+(C) Copyright 2004 Texas Insturments
+Copyright (c) 2010-2016, NVIDIA CORPORATION.
+(C) Copyright 2010,2011 NVIDIA Corporation <www.nvidia.com>
+Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2014-2019, NVIDIA CORPORATION.  All rights reserved.
+Copyright (C) 2016 samtec automotive software & electronics gmbh
+Copyright (C) 2017-2019 softing automotive electronics gmbH
+(C) Copyright 2007-2008 Semihalf
+(C) Copyright 2007-2008 Semihalf, Rafal Jaworowski <raj@semihalf.com>
+(C) Copyright 2007 Semihalf
+Copyright 2016 Timesys Corporation
+Copyright 2016 Advantech Corporation
+Copyright 2015 Timesys Corporation.
+Copyright 2015 General Electric Company
+Copyright (C) 2017 Andes Technology Corporation
+Copyright (c) 2015, Sony Mobile Communications AB.
+Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2018, Ramon Fried <ramon.fried@gmail.com>
+Copyright (c) 2018 Ramon Fried <ramon.fried@gmail.com>
+Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
+Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd
+Copyright (c) 2018, Linaro Limited
+Copyright (c) 2019, Texas Instrument
+(C) Copyright 2014-2016, Freescale Semiconductor, Inc.
+(C) Copyright 2013-2016, Freescale Semiconductor, Inc.
+Copyright (c) 2018, Google Inc. All rights reserved.
+Copyright (c) 2012, The Chromium Authors
+Copyright (c) 2013, The Chromium Authors
+(C) Copyright 2008-2011
+Copyright (C) 1991, 1992  Linus Torvalds
+(C) Copyright 2011 - 2013 CompuLab, Ltd. <www.compulab.co.il>
+Copyright (c) 2014, Steffen Trumtrar <s.trumtrar@pengutronix.de>
+Copyright (C) 2016-2018 Intel Corporation. All rights reserved
+Copyright (C) 2016 Altera Corporation. All rights reserved
+Copyright (c) 2018 Baylibre SAS.
+Copyright (c) 2016 BayLibre, SAS.
+Copyright (c) 2017 Amlogic, inc.
+Copyright (c) 2019 BayLibre, SAS.
+Copyright (c) 2016 BayLibre, SAS
+Copyright (c) 2018 Amlogic, inc.
+Copyright (C) Broadcom Corporation
+Copyright (C) 2017 Priit Laes <plaes@plaes.org>
+Copyright (C) 2016 Maxime Ripard <maxime.ripard@free-electrons.com>
+Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
+Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
+Copyright 2016 Maxime Ripard
+Copyright (C) 2016 Chen-Yu Tsai <wens@csie.org>
+Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org>
+Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.io>
+Copyright (c) 2015, NVIDIA CORPORATION.
+Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2004, Psyent Corporation <www.psyent.com>
+Copyright (C) 2004 Patrik Kluba,
+University of Szeged, Hungary
+Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer
+Copyright (C) 2001 Red Hat, Inc.
+Bugfixing by Kai-Uwe Bloem <kai-uwe.bloem@auerswald.de>, (C) Mar/2003
+Copyright © 2004  Ferenc Havasi <havasi@inf.u-szeged.hu>,
+Zoltan Sogor <weth@inf.u-szeged.hu>,
+Patrik Kluba <pajko@halom.u-szeged.hu>,
+Copyright (C) 2014 Samsung Electronics
+Copyright 2013 Broadcom Corporation.
+(C) Copyright 2008 - 2013 Tensilica Inc.
+(C) Copyright 2014 Cadence Design Systems Inc.
+(C) Copyright 2014 - 2016 Cadence Design Systems Inc.
+Copyright 2019 Google LLC
+Copyright (C) 2016 Google Inc.
+Copyright (C) 2014 Google Inc.
+Copyright (C) 2016 Google, Inc.
+Copyright (C) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+(C) Copyright 2017, Fuzhou Rockchip Electronics Co., Ltd
+(C) Copyright 2011 NVIDIA Corporation www.nvidia.com
+Copyright © 2011 Parrot S.A.
+Copyright (c) 2017 Rob Clark
+Copyright (C) 1995-1998 Mark Adler
+Copyright (c) 2004 Cisco Systems, Inc.
+Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
+Copyright (C) 2003 Bernardo Innocenti <bernie@develer.com>
+Copyright (C) 1999 Hewlett-Packard Co
+Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+Copyright (c) 2014
+Copyright (C) 2010-2013 Wolfgang Denk <wd@denx.de>
+Copyright (C) 1993, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+Copyright (c) 2009, Google Inc.
+Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
+Copyright (C) 1992, 1997 Free Software Foundation, Inc.
+Copyright (C) 2001 Peter Bergner.
+Copyright (C) 2011-2015, Yann Collet.
+Copyright 2015 Google Inc.
+Copyright (c) 1992 Simon Glass
+Copyright 1994 - 2000 Neil Russell.
+Copyright 2000 Roland Borde
+Copyright 2000 Paolo Scaffardi
+Copyright 2000-2002 Wolfgang Denk, wd@denx.de
+Copyright 2009 Dirk Behme, dirk.behme@googlemail.com
+Copyright 2009 Benjamin Herrenschmidt, IBM Corp
+Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+(C) 1999  Andrea Arcangeli <andrea@suse.de>
+(C) 2002  David Woodhouse <dwmw2@infradead.org>
+(C) 2012  Michel Lespinasse <walken@google.com>
+Copyright (C) 2001-2003  Christophe Devine
+Copyright (c) 2004-2005 Sergey Lyubka <valenok@gmail.com>
+(C) Copyright 2002-2006
+Copyright (C) 2004,2008  Kustaa Nyholm
+Copyright 2011 Calxeda, Inc.
+Copyright (C) 2012-2016, Yann Collet.
+(C) Copyright 2013-2016, NVIDIA CORPORATION.
+Copyright 2008 Maxime Bizon <mbizon@freebox.fr>
+Copyright 2013 Florian Fainelli <florian@openwrt.org>
+Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2019 BayLibre, SAS
+Copyright (C) 2018 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
+Copyright (C) 2018 Ramon Fried <ramon.fried@gmail.com>
+Copyright (C) 2019 Stefan Roese <sr@denx.de>
+Copyright (C) 2017 John Crispin <john@phrozen.org>
+Copyright (C) 2018 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2015-2017, STMicroelectronics - All Rights Reserved
+Copyright (C) 2010 Ilya Yanok, Emcraft Systems, yanok@emcraft.com
+Copyright (C) 2007 Freescale Semiconductor, Inc.
+Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
+Copyright (C) 2007 Kenati Technologies, Inc.
+Copyright (c) 2013 Imagination Technologies
+Copyright (c) 2015 Imagination Technologies
+Copyright 2009: Marvell Technology Group Ltd.
+Copyright © 2010-2015 Broadcom Corporation
+Copyright (C) 2017  Beckhoff Automation GmbH & Co. KG
+(C) Copyright 2017 CompuLab, Ltd. http://www.compulab.com
+Copyright 2018 Linaro
+Bloat-o-meter code used here Copyright 2004 Matt Mackall <mpm@selenic.com>
+Copyright (c) 2016 Xilinx, Inc
+Copyright (C) 2017 Jagan Teki <jagan@amarulasolutions.com>
+Copyright (C) 2015 Hans de Goede <hdegoede@redhat.com>
+Copyright (C) 2014 Roman Byshko <rbyshko@gmail.com>
+(C) Copyright Siemens AG
+Copyright (c) 2017 Amlogic, Inc. All rights reserved.
+Copyright (c) 2018 Amlogic, Inc. All rights reserved.
+Copyright (C) 2016 Endless Mobile, Inc.
+Copyright (C) 2015 Broadcom Corporation
+Copyright (C) 2016 Imagination Technologies
+Copyright (c) 2014 Samsung Electronics Co., Ltd.
+Copyright (c) 2015 Hisilicon Limited.
+Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+Copyright 2013 Lucas Stach, Pengutronix <l.stach@pengutronix.de>
+Copyright (C) 2014 Freescale Semiconductor, Inc.
+Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
+Copyright (C) 2014 Google, Inc
+(c) 2015 Purna Chandra Mandal <purna.mandal@microchip.com>
+Copyright (c) 2018 BayLibre, SAS
+Copyright (c) 2018 MediaTek Inc.
+Copyright (C) 2014 Renesas Solutions Corp.
+Copyright (C) 2014 Wolfram Sang, Sang Engineering <wsa@sang-engineering.com>
+Copyright 2013 Ideas On Board SPRL
+Copyright (C) 2015 Renesas Electronics Corp.
+Copyright (C) 2016 Cogent Embedded, Inc.
+Copyright (C) 2014  Renesas Electronics Corporation
+Copyright (C) 2016 Renesas Electronics Corp.
+Copyright (C) 2017 Cogent Embedded, Inc.
+Copyright (c) 2014 MundoReader S.L.
+Copyright (c) 2015 Heiko Stuebner <heiko@sntech.de>
+Copyright (c) 2016 Rockchip Electronics Co. Ltd.
+Copyright (c) 2017 Rockchip Electronics Co. Ltd.
+Copyright (C) 2017 Synopsys
+Copyright (C) 2016 STMicroelectronics
+Copyright 2015 Maxime Ripard
+Copyright (c) 2017 Icenowy Zheng <icenowy@aosc.xyz>
+Copyright (c) 2016 Icenowy Zheng <icenowy@aosc.xyz>
+Copyright (C) 2018 Jernej Skrabec <jernej.skrabec@siol.net>
+Copyright (C) 2016, Texas Instruments, Incorporated
+Copyright (C) 2010-2018 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2005 Texas Instruments.
+Copyright (C) 2011 Ilya Yanok, Emcraft Systems
+Copyright (C) 1999-2015 Tensilica Inc.
+Copyright (C) 1999-2015 Cadence Design Systems Inc.
+Copyright (C) 2012-2017 Texas Instruments Incorporated, <www.ti.com>
+Copyright (C) 2013 Hannes Schmelzer <oe5hpm@oevsv.at>
+Copyright (C) ARM Limited
+Copyright (C) 2000-2001 Deep Blue Solutions Ltd.
+Copyright (C) 2013 Samsung Electronics
+Copyright (C) 1999  Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
+Copyright 2012 Stefan Roese <sr@denx.de>
+Copyright (c) 2015 Andreas Bießmann <andreas@biessmann.org>
+(C) Copyright 2017 Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
+Copyright (C) 1995-2004 Mark Adler
+Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+Copyright (C) 1995-2010 Jean-loup Gailly
+Copyright (C) 1995-2003 Mark Adler
+Copyright (C) 1995-2005 Mark Adler
+Copyright (C) 1995-2005 Jean-loup Gailly.
+Copyright (C) 2011-2014 Panasonic Corporation
+Copyright (C) 2014 Wandboard
+Copyright (C) 2013 Freescale Semiconductor, Inc.
+Copyright (C) 2014 O.S. Systems Software LTDA.
+(C) Copyright 2007-2018 Michal Simek
+Copyright (C) 2017 DENX Software Engineering
+(C) Copyright 2010-2013
+Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
+Copyright 1992, Linus Torvalds.
+Copyright (C) 2003  John Williams <jwilliams@itee.uq.edu.au>
+Copyright (C) 2001  NEC Corporation
+Copyright (C) 2001  Miles Bader <miles@gnu.org>
+(C) Copyright 2004 Atmark Techno, Inc.
+Copyright (C) 2003     John Williams <jwilliams@itee.uq.edu.au>
+Copyright (C) 2001,02  NEC Corporation
+Copyright (C) 2001,02  Miles Bader <miles@gnu.org>
+Copyright (C) 2003       John Williams <jwilliams@itee.uq.edu.au>
+Copyright (C) 2001,2002  NEC Corporation
+Copyright (C) 2001,2002  Miles Bader <miles@gnu.org>
+Copyright (C) 2011 Michal Simek <monstr@monstr.eu>
+(C) Copyright 2013 - 2014 Xilinx, Inc
+Copyright (C) 2003	John Williams (jwilliams@itee.uq.edu.au)
+Copyright (C) 2001	NEC Corporation
+Copyright (C) 2001	Miles Bader <miles@gnu.org>
+(C) Copyright 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+(C) Copyright 2012 Renesas Solutions Corp.
+Copyright (C) 2012  Renesas Solutions Corp.
+Copyright (C) 2012  Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C) 2017 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2010 Renesas Solutions Corp.
+Copyright (C) 2010 NISHIMOTO Hiroki
+Copyright (C) 2017 National Instruments Corp
+Copyright (c) 2018 Flowbird
+Copyright (c) 2015 Free Electrons
+Copyright (c) 2015 NextThing Co
+Copyright (c) 2015 NextThing Co.
+Copyright (c) 2018 Microchip Technology, Inc.
+Copyright (C) 2012-2013 Marek Vasut <marex@denx.de>
+Copyright (C) 2012-2017 Marek Vasut <marex@denx.de>
+Copyright (C) 2014-2017 Olaf Mandel <o.mandel@menlosystems.com>
+Copyright (c) 2005-2011 Analog Devices Inc.
+Copyright (C) 1996-2005 Markus F.X.J. Oberhumer <markus@oberhumer.com>
+Copyright (C) 2018 Stefan Roese <sr@denx.de>
+Copyright (c) 2005-2008 Analog Devices Inc.
+Copyright 2017 Andes Technology, Inc.
+Copyright (C) 2012-2013 Jonas Gorski <jogo@openwrt.org>
+Copyright (C) 2009-2012 Florian Fainelli <florian@openwrt.org>
+Copyright (C) 2010 Tanguy Bouzeloc <tanguy.bouzeloc@efixo.com>
+Copyright (C) 2004-2009 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (c) 2009, Intel Corporation.
+Copyright (C) 2004-2009, 2015 Freescale Semiconductor, Inc.
+Copyright 2013-2015 Freescale Semiconductor, Inc.
+Copyright 2013-2014 Freescale Semiconductor, Inc.
+Copyright (c) 2011-12 The Chromium OS Authors.
+(C) Copyright 2014  DENX Software Engineering GmbH
+Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
+Copyright (c) 2006 Ben Warren, Qstreams Networks Inc.
+Copyright (c) 2001 Navin Boppuri / Prashant Patel
+Copyright (c) 2001 Gerd Mennchen <Gerd.Mennchen@icn.siemens.de>
+Copyright (c) 2001 Wolfgang Denk, DENX Software Engineering, <wd@denx.de>.
+Copyright (C) 2011 Sergiy <piratfm@gmail.com>
+Copyright (C) 2011-2013 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2014-2015 Felix Fietkau <nbd@nbd.name>
+Copyright (c) 2018  MediaTek, Inc.
+Copyright (C) 2015 Marvell International Ltd.
+Copyright (C) 2008, Guennadi Liakhovetski <lg@denx.de>
+Copyright (C) 2016 Jagan Teki <jteki@openedev.com>
+Copyright (C) 2010 Dirk Behme <dirk.behme@googlemail.com>
+Copyright (C) 2005, 2006 Nokia Corporation
+Copyright (c) 2015, Microchip Technology Inc.
+(C) 2019 Theobroma Systems Design und Consulting GmbH
+(C) Copyright 2008-2013 Rockchip Electronics
+Copyright (c) 2011-2013 The Chromium OS Authors.
+Copyright (C) 2011-2012 Renesas Solutions Corp.
+Copyright (C) 2011 Renesas Solutions Corp.
+Copyright (C) 2018 Exceet Electronics GmbH
+Copyright (C) 2018 Bootlin
+(C) Copyright 2017 Whitebox Systems / Northend Systems B.V.
+(C) Copyright 2017 Olimex Ltd..
+Based on linux spi driver. Original copyright follows:
+Copyright (C) 2012 - 2014 Allwinner Tech
+Copyright (C) 2014 Maxime Ripard
+Copyright (c) 2010-2013 NVIDIA Corporation
+(C) Copyright 2015 NVIDIA Corporation <www.nvidia.com>
+Copyright (c) 2015 Jagan Teki <jteki@openedev.com>
+Copyright (c) 2012 Stephan Linz <linz@li-pro.net>
+Copyright (c) 2010 Graeme Smecher <graeme.smecher@mail.mcgill.ca>
+Copyright (c) 2010 Thomas Chou <thomas@wytron.com.tw>
+(C) Copyright 2018 Xilinx
+(C) Copyright 2015 Jagan Teki <jteki@openedev.com>
+Copyright (C) 2011-2015 Vladimir Zapolskiy <vz@mleia.com>
+(C) Copyright 2015 Vladimir Zapolskiy <vz@mleia.com>
+Copyright (C) 2018 Microchip Technology, Inc.
+(C) Copyright 2013-2015
+Copyright (c) 2014-2015 NVIDIA CORPORATION. All rights reserved.
+(C) Copyright 2006
+(C) Copyright 2009, 2011 Freescale Semiconductor, Inc.
+(C) Copyright 2008, Excito Elektronik i Sk=E5ne AB
+(C) Copyright 2018 Theobroma Systems Design und Consulting GmbH
+(C) Copyright 2010-2012
+Copyright (c) 2017 General Electric Company. All rights reserved.
+Copyright (C) 2019 Rosy Song <rosysong@rosinson.com>
+Copyright (C) 2008 Altera Corporation.
+Copyright (C) 2009 BuS Elektronik GmbH & Co. KG
+(c) 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Copyright 2014-2017 Broadcom.
+(C) 2009 Ben Warren , biggerbadderben@gmail.com
+(C) 2003 Wolfgang Denk, wd@denx.de
+Copyright (C) 1999 Ben Williamson <benw@pobox.com>
+Copyright (C) 1997  Sten Wang
+(C)Copyright 1997-1998 DAVICOM Semiconductor,Inc. All Rights Reserved.
+Copyright (C) 2008 Dave S.r.l. <www.dave.eu>
+Copyright (C) 2018 Marek Vasut <marex@denx.de>
+Copyright(c) 1999 - 2002 Intel Corporation. All rights reserved.
+Copyright (C) Archway Digital Solutions.
+Copyright (C) Linux Networx.
+Copyright (C) 2010, 2009
+(C) Copyright 2002 2003
+Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
+Copyright (C) 2007-2008 Avionic Design Development GmbH
+Copyright (C) 2008-2009 Avionic Design GmbH
+(C) Copyright 2009 Ilya Yanok, Emcraft Systems Ltd <yanok@emcraft.com>
+(C) Copyright 2008,2009 Eric Jarrige <eric.jarrige@armadeus.org>
+(C) Copyright 2008 Armadeus Systems nc
+(C) Copyright 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
+(C) Copyright 2007 Pengutronix, Juergen Beisert <j.beisert@pengutronix.de>
+(C) Copyright 2008 Armadeus Systems, nc
+(C) Copyright 2008 Eric Jarrige <eric.jarrige@armadeus.org>
+(C) Copyright Motorola, Inc., 2000
+(C) Copyright 2007 Freescale Semiconductor, Inc.
+Copyright 2009-2010, 2013 Freescale Semiconductor, Inc.
+(C) Copyright 2009 Faraday Technology
+(C) Copyright 2010 Andes Technology
+Copyright (C) 2018, IBM Corporation.
+(C) Copyright 2013 Faraday Technology
+(C) Copyright 2015 Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Copyright (c) 2019, Linaro Limited
+Copyright (c) 2011 Roberto Cerati <roberto.cerati@bticino.it>
+Copyright (c) 2009 Micrel Inc.
+(c) 2011 Bticino s.p.a, Roberto Cerati <roberto.cerati@bticino.it>
+Copyright (C) 2001 Standard Microsystems Corporation (SMSC)
+Copyright (C) 1996 by Erik Stahlman (ES)
+Copyright (C) 2005-2006 Atmel Corporation
+Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
+Copyright (C) 2002 rabeeh@galileo.co.il
+Copyright (C) 2014-2015 Stefan Roese <sr@denx.de>
+Copyright (C) 2012 Marvell
+Copyright (C) 2014 Marvell
+Copyright (C) 2016-2017 Stefan Roese <sr@denx.de>
+Copyright (C) 2001 Entity Cyber, Inc.
+Written/copyright 1999-2001 by Donald Becker.
+Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+Written/copyright 1999-2002 by Donald Becker.
+(C) Copyright 2002 Wolfgang Grandegger, wg@denx.de.
+Copyright 2015 Microchip Inc.
+Copyright (C) 2015-2017  Renesas Electronics Corporation
+Copyright (c) 2018 National Instruments
+Copyright (c) 2018 Joe Hershberger <joe.hershberger@ni.com>
+Copyright (c) 2015 National Instruments
+Copyright (C) 2008, 2011 Renesas Solutions Corp.
+Copyright (c) 2008, 2011, 2014 2014 Nobuhiro Iwamatsu
+Copyright (c) 2007 Carlos Munoz <carlos@kenati.com>
+Copyright (C) 2008 - 2012 Renesas Solutions Corp.
+Copyright (c) 2008 - 2012 Nobuhiro Iwamatsu
+(C) Copyright 2002
+Copyright (C) 2001 Standard Microsystems Corporation (SMSC)
+Copyright (C) 1996 by Erik Stahlman (ES)
+Copyright 2016-2018 Socionext inc.
+(C) Copyright 2012, Stefan Roese <sr@denx.de>
+Copyright 2004-2011, 2013 Freescale Semiconductor, Inc.
+(C) Copyright 2003, Motorola, Inc.
+Copyright 2007, 2010 Freescale Semiconductor, Inc.
+Copyright 2008 Freescale Semiconductor, Inc.  This file is licensed
+Copyright 2014 - 2015 Freescale Semiconductor, Inc.
+Copyright (C) 2011 PetaLogix
+Copyright (C) 2010 Xilinx, Inc. All rights reserved.
+(C) Copyright 2007-2009 Michal Simek
+(C) Copyright 2003 Xilinx Inc.
+(C) Copyright 2011 Michal Simek
+(C) Copyright 2011 Xilinx
+Copyright (C) 2015-2017 Renesas Electronics Corporation
+Copyright (c) 2016-2018 Toradex, Inc.
+Copyright (c) 2012-2016 Toradex, Inc.
+Copyright (c) 2016, Toradex, Inc.
+(C) Copyright 2000-2010
+(C) Copyright 2002-2008
+(C) Copyright 2000-2008
+(C) Copyright 2017 Renesas Electronics Europe Ltd
+Copyright 2015 ATS Advanced Telematics Systems GmbH
+Copyright 2015 Konsulko Group, Matt Porter <mporter@konsulko.com>
+(C) Copyright 2003, Psyent Corporation <www.psyent.com>
+Copyright (C) 2015 Thomas Chou <thomas@wytron.com.tw>
+Copyright (C) 2009, Wind River Systems Inc
+Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2004,
+2005  Free Software Foundation, Inc.
+Copyright 2008-2016 Freescale Semiconductor, Inc.
+Copyright 2017-2018 NXP Semiconductor
+Copyright 2014-2016 Freescale Semiconductor, Inc.
+Copyright 2014-2015 Freescale Semiconductor, Inc.
+Copyright 2010-2016 Freescale Semiconductor, Inc.
+Copyright 2008-2014 Freescale Semiconductor, Inc.
+Copyright 2008, 2010-2016 Freescale Semiconductor, Inc.
+Copyright 2008, 2010-2011 Freescale Semiconductor, Inc.
+Copyright 2007,2009-2011 Freescale Semiconductor, Inc.
+Copyright (C) 1999-2010 Tensilica Inc.
+Copyright 2009 Lattice Semiconductor Corp.
+Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
+Copyright (C) 2017-2019 Intel Corporation <www.intel.com>
+Copyright (C) 2018 Intel Corporation <www.intel.com>
+(C) Copyright 2012-2013, Xilinx, Michal Simek
+(C) Copyright 2015 - 2016, Xilinx, Inc,
+Michal Simek <michal.simek@xilinx.com>
+Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Copyright (C) 2015 Stefan Wahren <stefan.wahren@i2se.com>
+Copyright (c) 2015 Linaro Limited.
+Copyright (C) 2018 Texas Instruments
+Copyright (C) 2009 Nokia
+Copyright (C) 2009-2010 Texas Instruments
+(C) Copyright 2018 Ramon Fried <ramon.fried@gmail.com>
+Copyright (c) 2013 MundoReader S.L.
+Copyright (C) STMicroelectronics 2017 - All Rights Reserved
+Copyright (C) 2018 SiFive, Inc.
+Copyright (C) 2013 Texas Instruments, Inc.
+Copyright (C) 2018 Lukasz Majewski <lukma@denx.de>
+(C) Copyright 2014 Hans de Goede <hdegoede@redhat.com>
+(C) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
+(C) Copyright 2016 Chen-Yu Tsai <wens@csie.org>
+(C) Copyright 2015 Vishnu Patekar <vishnuptekar0510@gmail.com>
+Copyright (c) 2012 Samsung Electronics Co., Ltd.
+Copyright (C) 2010 Andes Technology Corporation
+(C) Copyright 2012-2013
+(C) Copyright 2008-2009 Freescale Semiconductor, Inc.
+Copyright (c) 2009 Wind River Systems, Inc.
+Copyright (C) 2007-2009 Texas Instruments, Inc.
+Copyright (C) 2017 Intel Corporation <www.intel.com>
+Copyright Altera Corporation (C) 2014-2015
+Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+Copyright (C) 2017-2018 Intel Corporation <www.intel.com>
+Copyright Altera Corporation (C) 2012-2015
+Copyright (C) 2011-2012
+Copyright 2012 Calxeda, Inc.
+Copyright (C) 2016 Marvell International Ltd.
+Copyright 2009-2014 Freescale Semiconductor, Inc.
+Copyright (c) 2017 Free Electrons
+Copyright (C) 2019 Microchip Technology Inc.
+Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@gmail.com>
+Copyright (C) 2016 Atmel Corporation
+Copyright (C) 2018 Microhip / Atmel Corporation
+Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
+Copyright (c) 2005 Ben Gardner <bgardner@wabtec.com>
+Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved
+Copyright (C) 2011 The ChromiumOS Authors.
+Copyright (C) 2008-2009 coresystems GmbH
+Copyright (C) 2012 The Chromium OS Authors.  All rights reserved.
+Copyright (c) 2011, Google Inc.
+Copyright (C) 2007-2008 coresystems GmbH
+Copyright (C) 2011 Google Inc.
+Copyright (C) 2012 Atmel Corporation
+Copyright 2007,2009-2014 Freescale Semiconductor, Inc.
+Copyright (C) 2013 Google, Inc
+(C) Copyright 2018 Allied Telesis
+(C) Copyright 2010, 2018
+Copyright 2018 Google, Inc
+Copyright (C) 2017 Microchip Corporation
+Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright 2018-2019 NXP
+Copyright (C) 2016 Nelson Integration, LLC
+Copyright (c) 2018, Theobroma Systems Design und Consulting GmbH
+Copyright (C) 2015 Purna Chandra Mandal <purna.mandal@microchip.com>
+Copyright (C) 2018 Arm Ltd
+Copyright (C) 2016 Xilinx, Inc.
+(C) Copyright 2015 Linaro
+(C) Copyright 2010 Freescale Semiconductor, Inc.
+(C)Copyright 2016 Rockchip Electronics Co., Ltd
+Copyright (C) 2017 Renesas Electronics
+Copyright (C) Chris Brandt
+Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
+Copyright (C) 2015-2019 Variscite Ltd.
+Copyright (C) 2019 Parthiban Nallathambi <parthitce@gmail.com>
+Copyright (C) 2013, Intel Corporation
+Copyright (C) 2015  Beckhoff Automation GmbH
+Copyright (C) 2015  Beckhoff Automation GmbH & Co. KG
+(C) Copyright 2017 Rob Clark
+Copyright (c) 2017 Leif Lindholm
+Copyright (c) 2016-2018 Alexander Graf et al.
+Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com
+(C) Copyright 2006-2010
+Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
+Copyright (C) 2003-2005 Nokia Corporation
+(C) Copyright 2004-2010
+(C) Copyright 2006-2008
+(C) Copyright 2004-2009
+(c) Copyright 2017 Opal Kelly Inc.
+Copyright (c) 2018, Bootlin
+Copyright (C) 2013 Guntermann & Drunck, GmbH
+Copyright (C) 2011 Infineon Technologies
+Copyright (C) 2016, STMicroelectronics - All Rights Reserved
+Copyright (C) 2010-2017 CS Systemes d'Information
+Author		Copyright (c) Marc A. Viredaz, 1998
+Copyright (C) 2014 Andrew Ruder <andrew.ruder@elecsyscorp.com>
+Copyright (C) 2012 Łukasz Dałek <luk0104@gmail.com>
+Copyright (C) 2018 Xilinx, Inc. - Michal Simek
+Copyright (C) 2013, Applied Micro Circuits Corporation
+(C) Copyright 2016 Cadence Design Systems Inc.
+Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+Copyright (C) 2015 Synopsys, Inc. All rights reserved.
+Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com
+(C) Copyright 2015-2016, Freescale Semiconductor, Inc.
+Copyright (C) 1993, 2003, 2004, 2005, 2006, 2007
+Copyright 2017-2018 NXP
+Copyright (C) 2019 Philippe Reynes <philippe.reynes@softathome.com>
+Copyright (C) 2008 Ronetix Ilko Iliev (www.ronetix.at)
+Copyright (C) 2009 Jean-Christopher PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+(C) Copyright 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+(C) Copyright 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+(C) Copyright 2008 Renesas Solutions Corp.
+(C) Copyright 2008, 2011 Renesas Solutions Corp.
+Copyright (C) 2007,2008 Nobuhiro Iwamatsu
+Copyright (c) 2007,2008 Nobuhiro Iwamatsu
+Copyright (c) 2008 Yusuke Goda <goda.yusuke@renesas.com>
+Copyright (C) 1996-2000 Russell King
+Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+Copyright (C)  2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C)  2012 Renesas Solutions Corp.
+(C) Dustin McIntire (dustin@sensoria.com)
+(C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+(C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
+Copyright (C) 1999, 2000  Niibe Yutaka
+Copyright (C) 1999 Niibe Yutaka
+Copyright (C) 1999, 2000  Niibe Yutaka  &  Kaz Kojima
+Copyright (C) 2002 Paul Mundt
+Copyright (C) 2010, STMicroelectronics - All Rights Reserved
+Copyright (C) 2012 Stefan Roese <sr@denx.de>
+Copyright (C) 2009, STMicroelectronics - All Rights Reserved
+Copyright (C) 2005 Silicon Graphics, Inc.
+Copyright (c) 2011, NVIDIA Corp. All rights reserved.
+(C) Copyright 2008,2009
+Copyright (C) 2011 The Chromium Authors.
+Copyright (C) 2015, Inverse Path
+Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
+Copyright 2016 IBM Corporation
+Copyright 2017 Google, Inc.
+(C) Copyright 2016 Songjun Wu <songjun.wu@atmel.com>
+(C) Copyright 2007 Sergey Kubushyn <ksi@koi8.net>
+(C) Copyright 2004-2014
+Some changes copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
+Copyright (c) 2016, Google Inc
+Copyright 2006,2009 Freescale Semiconductor, Inc.
+2012, Heiko Schocher, DENX Software Engineering, hs@denx.de.
+Copyright (C) 2015 Moritz Fischer <moritz.fischer@ettus.com>
+(C) Copyright 2015, Samsung Electronics
+Copyright (c) 2018 Arm Ltd.
+Copyright (C) 2009 Sergey Kubushyn <ksi@koi8.net>
+Copyright 2016 Freescale Semiconductors, Inc.
+(C) Copyright 2014-2015  DENX Software Engineering GmbH
+(C) Copyright 2017 - Beniamino Galvani <b.galvani@gmail.com>
+Copyright (c) 2010 Albert Aribaud.
+(C) Copyright 2003 Pengutronix e.K.
+(C) Copyright 2011 Marvell Inc.
+(c) 2011 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2005 Torsten Koschorrek <koschorrek at synertronixx.de>
+Copyright (C) 2005 Matthias Blaschke <blaschke at synertronixx.de>
+Copyright (C) 2007 RightHand Technologies, Inc.
+Copyright (C) 2008 Darius Augulis <darius.augulis at teltonika.lt>
+Copyright (c) 2004 Texas Instruments
+Copyright (c) 2003 Wolfgang Denk, wd@denx.de
+Copyright (c) 2013 Lubomir Popov <lpopov@mm-sol.com>, MM Solutions
+Copyright (c) 2014 Hannes Schmelzer <oe5hpm@oevsv.at>, B&R
+Copyright (C) 2014-15 Wolfram Sang <wsa@sang-engineering.com>
+Copyright (C) 2011-2015 Renesas Electronics Corporation
+Copyright (C) 2012-14 Renesas Solutions Corp.
+Copyright (C) 2011, 2013 Renesas Solutions Corp.
+Copyright (C) 2011, 2013 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+(C) Copyright 2001, 2002
+(C) Copyright 2017 STMicroelectronics
+Copyright (c) 2010-2011 NVIDIA Corporation
+Copyright (c) 2002-2007 Xilinx Inc.
+Copyright (c) 2009-2010 Intel Corporation
+Copyright (c) 2018 Linaro Limited
+Copyright (c) 2015-2018, Linaro Limited
+Copyright (c) 2016-2018, Linaro Limited
+Copyright 2014 Google Inc.
+Copyright (c) 2014, NVIDIA Corporation.
+Copyright (c) 2011-2013, NVIDIA Corporation.
+(c) 2011 Graf-Syteco, Matthias Weisser
+(C) Copyright 2009 DENX Software Engineering
+Copyright (C) 2008,2009 Eric Jarrige <jorasse@users.sourceforge.net>
+Copyright (C) 2009 Ilya Yanok <yanok@emcraft.com>
+Copyright (C) 2013 Seco USA Inc
+Copyright (C) 2015 ECA Sinters
+Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+generated by ppmlogo (c) 2004 by Andre Renaud from logogurnardsmall.ppm
+Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2013 Boundary Devices Inc.
+Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2014 - 2016 Freescale Semiconductor, Inc.
+Copyright (C) 2013 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2014 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2017 Armadeus Systems
+Copyright (c) 2017 Microsemi Corporation
+Copyright (C) 2017-2018 STMicroelectronics - All Rights Reserved
+Copyright 2014 Freescale Semiconductor
+Copyright (C) 2014, STMicroelectronics - All Rights Reserved
+Copyright (c) 2010-2012 NVIDIA Corporation <www.nvidia.com>
+Copyright 2011-2012 NVIDIA Corporation
+(C) Copyright 2015 Stephen Warren
+(C) Copyright 2014 Suriyan Ramasami
+(C) Copyright 2014-2015
+Copyright (C) 2015, Microchip Technology Inc.
+Copyright 2004-2012 Freescale Semiconductor, Inc.
+(C) Copyright 2002 - 2010
+Copyright (c) 2003 Josef Baumgartner <josef.baumgartner@telex.de>
+2006 Zachary P. Landau <zachary.landau@labxtechnologies.com>
+Copyright (c) 2005 Arthur Shipkowski <art@videon-central.com>
+Based on work Copyright (c) 2003 Josef Baumgartner
+(C) Copyright 2014  Angelo Dureghello <angelo@sysam.it>
+Copyright 2010-2012 Freescale Semiconductor, Inc.
+(C) Copyright 1999, Greg Ungerer (gerg@snapgear.com)
+(C) Copyright 2000, Lineo Inc. (www.lineo.com)
+(C) Copyright 2006, Lab X Technologies <zachary.landau@labxtechnologies.com>
+Copyright (C) 2003-2004, Greg Ungerer (gerg@snapgear.com)
+Copyright (C) 2004-2008 Arthur Shipkowski (art@videon-central.com)
+(C) Copyright 2000 - 2003
+Copyright (C) 2007,2010 Freescale Semiconductor, Inc.
+Copyright (C) 2015  Phil Sutter <phil@nwl.cc>
+Copyright (C) 2015 Phil Sutter <phil@nwl.cc>
+Copyright (C) ST-Ericsson SA 2010
+and hence presumably (C) 2012 Oleksandr Tymoshenko
+(C) 2012 Stephen Warren
+The Linux kernel code has the following (c) and license, which is hence
+Based on sdhci-bcm2708.c (c) 2010 Broadcom
+Copyright (C) 2015-2016 Raspberry Pi (Trading) Ltd.
+Copyright (C) 2010 Texas Instruments Incorporated
+Copyright 2007, 2010-2011 Freescale Semiconductor, Inc
+Copyright 2019 NXP Semiconductors
+Copyright 2018 Andes Technology, Inc.
+Copyright (C) 2004-2006 Atmel Corporation
+(C) Copyright 2016 Carlo Caione <carlo@caione.org>
+Copyright 2008, Freescale Semiconductor, Inc
+Copyright 2008,2010 Freescale Semiconductor, Inc
+Copyright (C) 2009 Ilya Yanok, <yanok@emcraft.com>
+Copyright (C) 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
+Copyright (C) 2006 Pavel Pisa, PiKRON <ppisa@pikron.com>
+(C) Copyright 2008-2010 Freescale Semiconductor, Inc.
+Copyright 2007, Freescale Semiconductor, Inc
+Copyright (C) 2015, Google, Inc
+Copyright (C) 2015 Microchip Technology Inc.
+Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
+(C) Copyright 2016 Fuzhou Rockchip Electronics Co., Ltd
+Copyright 2014, Staubli Faverges
+Copyright (C)  2011 Renesas Solutions Corp.
+Copyright (C) 2011,2013-2017 Renesas Electronics Corporation
+Copyright (C) 2019 Synopsys
+(C) Copyright 2013 Altera Corporation <www.altera.com>
+(C) Copyright 2007-2011
+Copyright 2011-2016 NVIDIA Corporation
+Copyright (C) 2016 Marvell, All Rights Reserved.
+(C) Copyright 2013 - 2015 Xilinx, Inc.
+Copyright 2007,2009 Wind River Systems, Inc. <www.windriver.com>
+Copyright 2007 Embedded Specialties, Inc.
+Copyright 2004, 2007 Freescale Semiconductor.
+(C) Copyright 2016 Vladimir Zapolskiy <vz@mleia.com>
+Copyright (C) 2010 Samsung Electronics
+Copyright (C) 2010 Texas Instruments
+Copyright (C) 2007,2008 Oracle.  All rights reserved.
+Copyright (C) 2017 Grinn
+Copyright (C) 2011, Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2010 Linaro
+Copyright 2016 Broadcom Corporation.
+Copyright 2016-2018 NXP
+Copyright 2015, Freescale Semiconductor
+Copyright 2014-2015, Freescale Semiconductor
+Copyright 2017-2019 NXP
+Copyright 2016 NXP Semiconductor, Inc.
+Copyright 2014-2015, Freescale Semiconductor, Inc.
+Copyright 2017 NXP Semiconductor, Inc.
+Copyright 2015-2018 NXP
+(C) Copyright 2017 Linaro
+Copyright (C) 2017 NXP
+Copyright (C) 2011 by Vladimir Zapolskiy <vz@mleia.com>
+(C) Copyright 2015  DENX Software Engineering GmbH
+Copyright (C) 2011 Vladimir Zapolskiy <vz@mleia.com>
+Copyright 2014, Freescale Semiconductor
+Copyright 2016 - AmLogic, Inc.
+Copyright 2018 - Beniamino Galvani <b.galvani@gmail.com>
+Copyright 2018 - BayLibre, SAS
+(C) Copyright 2016 - Beniamino Galvani <b.galvani@gmail.com>
+Copyright 2017 - Beniamino Galvani <b.galvani@gmail.com>
+(c) 2009 Ilya Yanok, Emcraft Systems <yanok@emcraft.com>
+Copyright (C) 2009, DENX Software Engineering
+Copyright (C) 2009 Ilya Yanok,
+Emcraft Systems <yanok@emcraft.com>
+Copyright (C) 2007 Pengutronix,
+Sascha Hauer <s.hauer@pengutronix.de>
+(C) Copyright 2013 ADVANSEE
+Copyright (C) 2009 by Lothar Wassmann <LW@KARO-electronics.de>
+Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH <armlinux@phytec.de>
+Copyright (c) 2009 Ilya Yanok <yanok@emcraft.com>
+Copyright (C) 2012 Philippe Reynes <tremyfr@yahoo.fr>
+Copyright 2004-2009 Freescale Semiconductor, Inc.
+Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com>
+Copyright (C) 2009-2012 Genesi USA, Inc.
+Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2015 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2008 Embedded Alley Solutions Inc.
+(C) Copyright 2009-2010 Freescale Semiconductor, Inc.
+Copyright (C) 2012 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2012 Robert Delien <robert@delien.nl>
+Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2012 Marek Vasut <marex@denx.de>
+Copyright (C) 2013 Andreas Wass <andreas.wass@dalelven.com>
+Copyright (c) 2010 Texas Instruments Incorporated
+(c) 2011 Comelit Group SpA, Luca Ceresoli <luca.ceresoli@comelit.it>
+Copyright (C) 2018 Amarula Solutions.
+(C) Copyright 2015 Vishnu Patekar <vishnupatekar0510@gmail.com>
+(C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+(C) Copyright 2014 Hans de Goede <hdegoede@redhat.com
+(C) Copyright 2017 Jernej Skrabec <jernej.skrabec@siol.net>
+Copyright (C) 2016 Jean-Francois Moine <moinejf@free.fr>
+Copyright (c) 2016 Allwinnertech Co., Ltd.
+(C) Copyright 2015 Roy Spliet <rspliet@ultimaker.com>
+(C) Copyright 2017  Icenowy Zheng <icenowy@aosc.io>
+(C) Copyright 2007-2015 Allwinner Technology Co.
+(C) Copyright 2015      Vishnu Patekar <vishnupatekar0510@gmail.com>
+(C) Copyright 2016  Theobroma Systems Design und Consulting GmbH
+(C) Copyright 2015      Jens Kuske <jenskuske@gmail.com>
+(C) Copyright 2016 Theobroma Systems Design und Consulting GmbH
+Copyright 2014 - Hans de Goede <hdegoede@redhat.com>
+(c) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
+(c)Copyright 2006-2013
+(C) Copyright 2016 Hans de Goede <hdegoede@redhat.com>
+(C) Copyright 2015 Chen-Yu Tsai <wens@csie.org>
+Copyright (c) 1996 Russell King.
+Copyright (C) 2016 ARM Ltd.
+Original copyright in armv7.h was:
+(C) Copyright 2010 Texas Instruments, <www.ti.com> Aneesh V <aneesh@ti.com>
+Copyright 1995, Russell King.
+(C) Copyright 2017 NVIDIA Corporation <www.nvidia.com>
+Copyright (C) 2012 ARM Ltd.
+Copyright (C) 1994-2002 Russell King
+Copyright (C) 2003-2012 ARM Ltd.
+Copyright (C) 2014 ARM Ltd.
+Copyright (C) 2006 Texas Instruments.
+Copyright (C) 2009-2010 Texas Instruments, Inc.
+Copyright (C) 1996 Russell King
+Copyright (C) 2000-2002 Russell King
+Copyright (C) 2012, Ilya Yanok <ilya.yanok@gmail.com>
+Copyright (C) 2012 ARM Limited
+Copyright (C) 2012  Linaro Limited
+Copyright (C) 1996-1998 Russell King.
+Copyright (C) 1999 Russell King.
+Copyright (C) 1996-1999 Russell King.
+Copyright (C) 1996-1999 Russell King
+Copyright (C) 1995-2002 Russell King
+(C) Copyright 2016 Alexander Graf <agraf@suse.de>
+Copyright (C) 1997-1999 Russell King
+Copyright (C) 2006-2014 Texas Instruments.
+Copyright (C) 2008 ARM Limited
+Copyright 2017 General Electric Company
+Copyright 2016 General Electric Company
+Copyright (C) 2011-2015 by Vladimir Zapolskiy <vz@mleia.com>
+Copyright (C) 2015 Compulab, Ltd.
+Copyright (C) 2016 Compulab, Ltd.
+Copyright 2008 (C) Bryan O'Donoghue
+Copyright (C) 2002-2011 Aleph One Ltd.
+Copyright (C) 2002-2007 Aleph One Ltd.
+Copyright (c) 1992, 1993
+Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
+Copyright (C) 2017 Microchip
+Copyright (C) 2015 Marek Vasut <marex@denx.de>
+Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
+Copyright (C) 2011, Stefano Babic <sbabic@denx.de>
+(C) Copyright 2011, 2012, 2013
+Copyright (C) 2016 Mario Six <mario.six@gdsys.cc>
+Copyright (C) 2009 Texas Instruments Incorporated
+Copyright (C) 2008 Lyrtech <www.lyrtech.com>
+Copyright (C) 2011 OMICRON electronics GmbH
+Copyright (C) 2011 DENX Software Engineering GmbH
+Copyright (C) 2011 Simon Guinot <sguinot@lacie.com>
+Copyright 2015 Xilinx, Inc.
+Copyright 2009 Extreme Engineering Solutions, Inc.
+Copyright 2007-2008 Freescale Semiconductor, Inc.
+Copyright 2016 - 2017 Xilinx, Inc.
+Copyright 2018 Xilinx, Inc.
+Copyright 2015 - 2016 Xilinx, Inc.
+Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright (c) 2006  SUSE Linux Products GmbH
+Copyright (c) 2006  Tejun Heo <teheo@suse.de>
+Copyright (C) 1996-2005 Paul Mackerras.
+Copyright (C) 2012, Stefano Babic <sbabic@denx.de>
+Copyright (C) 2017, Intel Corporation
+(C) Copyright 2009-2011
+Copyright (C) 2005 David Brownell
+Copyright 2019 Toradex
+Copyright 2013 Freescale Semiconductor
+Copyright (C) 2013 Jon Nettleton <jon.nettleton@gmail.com>
+IT6251 code based on code Copyright (C) 2014 Sean Cross
+Copyright (C) 2008-2013 Tensilica Inc.
+Copyright (C) 1999-2007 Tensilica Inc.
+Copyright (C) 2005 - 2013 Tensilica Inc.
+Copyright (C) 2014 - 2016 Cadence Design Systems Inc.
+Copyright (C) 2001 - 2012 Tensilica Inc.
+Copyright (C) 2001 - 2009  Tensilica Inc.
+Copyright (C) 2001 - 2007 Tensilica Inc.
+Copyright (C) 2009 Tensilica Inc.
+Copyright (C) 2006 Tensilica Inc.
+(C) Copyright 2007, Tensilica Inc.
+Copyright (C) 2001-2007 Tensilica Inc.
+(C) Copyright 2007 Tensilica, Inc.
+(C) Copyright 2008, Tensilica Inc.
+Copyright (C) 2007, Tensilica Inc.
+Copyright (C) 1997 Tensilica Inc.
+Copyright (c) 2006 Tensilica, Inc.  All Rights Reserved.
+Copyright (c) 2009 esd gmbh.
+Copyright (c) 2006 Wind River Systems, Inc.
+Copyright (c) 2008-2009 esd gmbh.
+(C) Copyright 2014-2016
+Copyright (c) 2013-2014, Stefan Agner
+(C) Copyright 2015 Inter Act B.V.
+Copyright (C) 2017 Stefano Babic <sbabic@denx.de>
+Copyright (c) 2015 Vladimir Zapolskiy <vz@mleia.com>
+(C) Copyright 2016 Stephen Warren <swarren@wwwdotorg.org>
+Copyright (c) 2015  Angelo Dureghello <angelo@sysam.it>
+Copyright (c) 2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>
+Copyright (c) 2014  Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (c) 2014  Renesas Electronics Corporation
+Copyright (c) 2018  Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2018 Jagan Teki <jagan@amarulasolutions.com>
+(C) Copyright 2010 Andreas Bießmann <andreas@biessmann.org>
+Copyright (C) 2018 Marvell International Ltd.
+(C) Copyright 2014 Pierrick Hascoet, Abilis Systems
+Copyright (C) 2007-2010 coresystems GmbH
+Copyright (C) 2007-2009 coresystems GmbH
+Copyright (C) 2011 The Chromium Authors
+Copyright (C) 2013 Ideas On Board SPRL
+Copyright (C) 2015-2017 Glider bvba
+Copyright (C) 2015 Glider bvba
+Copyright (C) 2017-2018 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2015-2016 Glider bvba
+Copyright (C) 2018 Alexander Graf <agraf@suse.de>
+Copyright (C) 2012 Bluegiga Technologies Oy
+(C) Copyright 2018 Xilinx, Inc. (Michal Simek)
+Copyright (c) 2015 Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Copyright 2013 Albert ARIBAUD <albert.u.boot@aribaud.net>
+Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
+Copyright (C) 1996-1999 SciTech Software, Inc.
+Copyright (C) 2019, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2017 Allied Telesis Labs
+Copyright (C) 2016 Amarula Solutions B.V.
+Copyright (C) 2016 Engicam S.r.l.
+Copyright (c) 2008 Eric Jarrige <eric.jarrige@armadeus.org>
+Copyright (C) 2013 Regents of the University of California
+Copyright (C) 2017 SiFive
+Copyright (C) 2015 Regents of the University of California
+Copyright (c) 2018 Western Digital Corporation or its affiliates.
+Copyright (c) 2017 Microsemi Corporation.
+Copyright (c) 2005-2007 Analog Devices Inc.
+Copyright (C) 2010 Shawn Lin (nobuhiro@andestech.com)
+Copyright (C) 2011 Macpaul Lin (macpaul@andestech.com)
+Copyright (C) 2017 Rick Chen (rick@andestech.com)
+Copyright (c) 2017 Padmarao Begari <Padmarao.Begari@microsemi.com>
+(C) Copyright 2018 Alexander Graf <agraf@suse.de>
+Copyright (C) 2019 Fraunhofer AISEC,
+Lukas Auer <lukas.auer@aisec.fraunhofer.de>
+Copyright (C) 2015-2019 Stefan Roese <sr@denx.de>
+Copyright (c) 2017 Tuomas Tynkkynen
+Copyright (C) 2017 Renesas Electronics Corporation
+(C) Copyright 2017 Vasily Khoruzhick <anarsoul@gmail.com>
+Copyright (C) 2019 Hannes Schmelzer <oe5hpm@oevsv.at>
+Copyright (C) 2017 Google, Inc
+(C) Copyright 2015, Siemens AG
+Copyright (c) International Business Machines Corp., 2006
+Copyright (c) Thomas Gleixner <tglx@linutronix.de>
+(C) 2018 Google, Inc
+Copyright (c) 2011-2012 The Chromium OS Authors.
+Copyright (C) 2017 Vasily Khoruzhick <anarsoul@gmail.com>
+Copyright (C) 2007,2008
+Copyright (C) 2013, Masahiro Yamada <yamada.m@jp.panasonic.com>
+Copyright (C) 2016, Lukasz Majewski <l.majewski@majess.pl>
+Copyright 2019 NXP
+Copyright    2002 by Kai Germaschewski  <kai.germaschewski@gmx.de>
+Copyright abandoned, Michael Chastain, <mailto:mec@shout.net>.
+Copyright (C) 2013 Bo Shen <voice.shen@atmel.com>
+Copyright (C) 2015 Wenyou Yang <wenyou.yang@atmel.com>
+Copyright (C) 2012-2013 Atmel Corporation
+(C) Copyright 2016-2017 Rockchip Inc.
+Copyright (C) 2016 Stefano Babic <sbabic@denx.de>
+(C) Copyright 2017 Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2018 Linaro Limited
+(C) Copyright 2016 Savoir-faire Linux Inc.
+Copyright 2019 NXP.
+Copyright 2014-2015 Freescale Semiconductor
+Copyright (c) 2012-2014 Birdland Audio - http://birdland.com/oem
+Copyright (c) 2012-2014, Birdland Audio - http://birdland.com/oem
+Copyright (C) 2015 Free Electrons
+copyright (c) 2013-2016, ARM Limited and Contributors. All rights
+Copyright (C) 2016 Rockchip Electronic Co.,Ltd
+Copyright (C) 2017 Theobroma Systems Design und Consulting GmbH
+Copyright (C) 2017 Theobroma Systems Design und Consulting GmH
+(C) Copyright 2016 Toradex
+Copyright (C) 2016
+Copyright (C) 2018 Marek Behun <marek.behun@nic.cz>
+Copyright (C) 2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>
+(C) Copyright 2015 General Electric Company
+(C) Copyright 2013 Samsung Electronics
+(C) Copyright 2010 Samsung Electronics
+Copyright (C) 2012 Samsung Electronics Co.Ltd
+(C) Copyright 2012 Samsung Electronics
+Copyright (C) 2009 Samsung Electronics
+Copyright (C) 2010 Samsung Electrnoics
+(C) Copyright 2009 Samsung Electronics
+Copyright (c) 2012 Samsung Electronics Co. Ltd
+Copyright (c) 2012 Samsung Electronics.
+Copyright (c) 2010 Samsung Electronics.
+Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
+Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
+Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+Copyright 2007-2014 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Synopsys
+Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. All rights reserved.
+Copyright (C) 2004, 2007-2010, 2011-2015 Synopsys, Inc. All rights reserved.
+Copyright (C) 2014 Synopsys, Inc. All rights reserved.
+Copyright (C) 2012 Andes Technology Corporation
+Copyright (C) STMicroelectronics SA 2017
+(C) 2017 Theobroma Systems Design und Consulting GmbH
+(C) Copyright 2017, Xilinx Inc.
+Copyright (C) 2008 Advanced Micro Devices, Inc.
+Copyright 2010 Maxim Integrated Products
+Copyright 2011 Maxim Integrated Products
+Copyright 2014 Rockchip Electronics Co., Ltd.
+Copyright 2018 Google, LLC
+Copyright 2013 Realtek Semiconductor Corp.
+(C) Copyright 2011-2012
+(C) Copyright 2004-2005
+Copyright (C) 2004	Nokia Corporation
+(C) Copyright 2018 Xilinx, Inc.
+(c) 2004 Sascha Hauer <sascha@saschahauer.de>
+Copyright (c) 2018 Google, Inc
+Copyright (C) 2003 Arabella Software Ltd.
+Copyright (C) 2004
+(C) 2000 Red Hat. GPL'd.
+Copyright © 2002 Robert Kaiser <rkaiser@sysgo.de>
+Copyright © 2002-2010 David Woodhouse <dwmw2@infradead.org>
+Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org>
+Copyright © 2006      Red Hat UK Limited
+Copyright © 2000 Nicolas Pitre <nico@fluxnic.net>
+Copyright © 2002 Thomas Gleixner <gleixner@linutronix.de>
+Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org>
+Copyright (C) 2016 Microchip
+Copyright (C) 2018 Robert Bosch Power Tools GmbH
+Copyright (C) 2018 Philippe Reynes <philippe.reynes@softathome.com>
+Copyright (C) 2013 Gateworks Corporation
+Copyright (C) 2009 Freescale Semiconductor, Inc.
+Copyright 2009-2010 Freescale Semiconductor.
+Copyright 2006 Freescale Semiconductor.
+Copyright 2018 NXP.
+Copyright 2010-2011 Freescale Semiconductor
+Copyright 2006,2010 Freescale Semiconductor
+Copyright 2011 Freescale Semiconductor
+Copyright 2006, 2008-2009, 2011 Freescale Semiconductor
+Copyright (C) 2007 Logic Product Development, Inc.
+Copyright (C) 2007 MontaVista Software, Inc.
+(C) Copyright 2008 - 2010
+Copyright (C) 2007-2011 Freescale Semiconductor, Inc.
+Copyright 2007 Freescale Semiconductor, Inc.
+Copyright (C) Freescale Semiconductor, Inc. 2007
+Copyright (C) 2007-2009  Freescale Semiconductor, Inc.
+Copyright (C) 2008-2009  MontaVista Software, Inc.
+Copyright 2007,2011 Freescale Semiconductor, Inc.
+Copyright (C) 2008 MontaVista Software, Inc.
+(C) Copyright 2006-2007 Freescale Semiconductor, Inc.
+Copyright (C) 2004-2006 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Allied Telesis Labs
+Copyright (c) 2014 DENX
+Copyright (C) DENX
+Original code (C) Copyright 2010
+(C) Copyright 2013 Siemens AG
+Copyright 2018 Google
+Copyright (C) 2018 Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright 2016 Rockchip Electronics Co., Ltd
+(C) Copyright 2009 Atin Malaviya (atin.malaviya@gmail.com)
+Copyright (C) 2004-2007 Texas Instruments
+Copyright (C) 2008 Nokia Corporation
+Copyright (C) David Mosberger-Tang
+Copyright (C) 1999 Egbert Eich
+Copyright (c) 2009 Samsung Electronics
+Copyright (C) 2009 Samsung Electrnoics
+Copyright 2008-2010 Freescale Semiconductor, Inc.
+Copyright (C) 2000,2001  Larry Doolittle  <larry@doolittle.boa.org>
+Copyright (C) Nalin Dahyabhai <bigfun@pobox.com>
+Copyright (c) 2009  MontaVista Software, Inc.
+Copyright (c) 2011 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Copyright (c) 2014 Google, Inc.
+Copyright (c) 2008-2009 Analog Devices Inc.
+Copyright 2009 Analog Devices Inc.
+(C) Copyright 2001-2002
+(C) Copyright 2001-2015
+Copyright (c) Orbacom Systems, Inc <www.orbacom.com>
+(C) Copyright Linus Torvalds 1999
+(C) Copyright Johannes Erdfelt 1999-2001
+(C) Copyright Andreas Gal 1999
+(C) Copyright Gregory P. Smith 1999
+(C) Copyright Deti Fliegl 1999 (new USB architecture)
+(C) Copyright Randy Dunlap 2000
+(C) Copyright David Brownell 2000 (kernel hotplug, usbdeviceid)
+(C) Copyright Yggdrasil Computing, Inc. 2000
+(C) Copyright 2001 Denis Peter, MPL AG Switzerland
+(c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
+(c) 2000 David L. Brown, Jr. (usb-storage@davidb.org)
+(c) 1999 Michael Gee (michael@linuxspecific.com)
+(c) 2000 Yggdrasil Computing, Inc.
+For BBB support (C) Copyright 2003
+Copyright (C) 2015  Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright (c) 2013 Google, Inc.
+Copyright (C) 2013-2016, Yann Collet.
+Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+Copyright (C) 2016, Yann Collet.
+Copyright (C) 2013-2015, Yann Collet.
+Copyright (c) 2016-present, Przemyslaw Skibinski, Yann Collet, Facebook, Inc.
+Copyright (C) 2017 PHYTEC Messtechnik GmbH
+Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2010 Reinhard Meyer, EMK Elektronik
+Copyright (C) 2013 Jagannadha Sutradharudu Teki, Xilinx Inc.
+Copyright (C) 2012-2014 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
+Copyright (C) 2005, Intec Automation Inc.
+Copyright (C) 2014, Freescale Semiconductor, Inc.
+Copyright (C) 2016 Jagan Teki <jagan@openedev.com>
+Copyright (C) 2015 Cogent Embedded, Inc.
+Copyright (c) 2006-2007 Wind River Systems, Inc.
+Copyright (C) 2018-2019 Marek Vasut <marek.vasut@gmail.com>
+Copyright (C) 2014 Renesas Electronics Europe Ltd
+Copyright (C) 2009 - 2011  Paul Mundt
+(C) Copyright 2002, 2003
+Copyright (C) 2013-2018 Intel Corporation. All rights reserved
+Copyright 2000 MontaVista Software Inc.
+Copyright (C) 1999, 2000, 2004  MIPS Technologies, Inc.
+Copyright (C) 1998 Gabriel Paubert.
+Copyright (C) 2003-2004 Linux Networx
+Copyright (C) 2003-2006 Ronald G. Minnich <rminnich@gmail.com>
+Copyright (C) 2004-2005 Li-Ta Lo <ollie@lanl.gov>
+Copyright (C) 2005-2006 Tyan
+Copyright (C) 2005-2009 coresystems GmbH
+Copyright 1993 -- 1997 Drew Eckhardt, Frederic Potter,
+David Mosberger-Tang
+Copyright 1997 -- 1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+Copyright (c) 2010, CompuLab, Ltd.
+Copyright (c) 2008-2009, NVIDIA Corporation.
+Copyright (c) 2013-2014, NVIDIA Corporation.
+(c) Copyright 2016 by VRT Technology
+(c) Copyright 2011 by Tigris Elektronik GmbH
+(C) Copyright 2008-2011 Freescale Semiconductor, Inc.
+(C) Copyright 2010 DENX Software Engineering
+(C) Copyright 2005-2009 Samsung Electronics
+(C) Copyright 2011-2012 Freescale Semiconductor, Inc.
+(C) Copyright 2010-2016 Freescale Semiconductor, Inc.
+(C) Copyright 2008 Atmel Corporation
+(c) Copyright 2012 by National Instruments,
+Joe Hershberger <joe.hershberger@ni.com>
+Copyright (C) 2013 Andes Technology Corporation
+Copyright (C) 2008 Andes Technology Corporation
+Copyright (C) 2013 Ken Kuo (kenkuo@andestech.com)
+Copyright (C) 2014, Barco (www.barco.com)
+Copyright (C) 2015, Miao Yan <yanmiaobest@gmail.com>
+Copyright (C) 2011 Mistral Solutions Pvt Ltd
+Copyright (C) 2008 Renaud CERRATO r.cerrato@til-technologies.fr
+Copyright (C) 2017 Paolo Pisati <p.pisati@gmail.com>
+Copyright (C) 2007 Miguel Gaio <miguel.gaio@efixo.com>
+Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
+Copyright (C) 2013 Altera Corporation <www.altera.com>
+(c) Copyright 2004 Faraday Technology Corp. (www.faraday-tech.com)
+Copyright 2017 CS Systemes d'Information
+Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2013 John Crispin <blogic@openwrt.org>
+(c) Copyright 2000 Oleg Drokin <green@crimea.edu>
+Copyright (c) 2004 Texas Instruments.
+Copyright (c) 2005 David Brownell
+Copyright (c) 2011-2018 Xilinx Inc.
+(C) Copyright 2013 Keymile AG
+(C) Copyright 2010-2011
+Copyright (C) 2015, Saket Sinha <saket.sinha89@gmail.com>
+Copyright (c) 2014 The Chromium OS Authors.
+Copyright (C) 2010 coresystems GmbH
+Copyright 2002 Andy Grover <andrew.grover@intel.com>
+Copyright (C) 2015 Bin Meng <bmeng.cn@gmail.com>
+Copyright(c) 2009 Intel Corporation. All rights reserved.
+Copyright (c) 2015 Gooogle, Inc
+2012 secunet Security Networks AG
+Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
+Copyright (C) 2015 Udoo
+Copyright (C) 2012 Ilya Yanok <ilya.yanok@gmail.com>
+(C) Copyright 2011, Ilya Yanok, Emcraft Systems
+Copyright (C) 2004-2010
+Copyright (C) 2011 The ChromiumOS Authors.  All rights reserved.
+Copyright (C) 2016, Imagination Technologies Ltd.
+(C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
+(C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+Copyright (c) 2015 Microchip Technology Inc.
+Copyright (C) Stefano Babic <sbabic@denx.de>
+Copyright (C) 2014 Soeren Moch <smoch@web.de>
+Copyright (C) 2017 Soeren Moch <smoch@web.de>
+Copyright (c) 2010, by Texas Instruments
+Copyright (c) 2008-2009, MontaVista Software, Inc. <source@mvista.com>
+Copyright 2005 Mentor Graphics Corporation
+Copyright (C) 2005-2006 by Texas Instruments
+Copyright (C) 2006-2007 Nokia Corporation
+Copyright (C) 2012, by Texas Instruments
+Copyright (C) 2009 MontaVista Software, Inc. <source@mvista.com>
+Copyright (C) 2008-2009 MontaVista Software, Inc. <source@mvista.com>
+Copyright © 2015 Hans de Goede <hdegoede@redhat.com>
+Copyright (C) 2005-2007 by Texas Instruments
+Copyright (C) 2006 Nokia Corporation
+Copyright © 2013 Jussi Kivilinna <jussi.kivilinna@iki.fi>
+Copyright 2007-2012 (C) Allwinner Technology Co., Ltd.
+Copyright (c) 2008-2009 MontaVista Software, Inc. <source@mvista.com>
+(C) Copyright 2018 Neil Armstrong <narmstrong@baylibre.com>
+(C) Copyright 2019 Julien Masson <jmasson@baylibre.com>
+(C) Copyright 2019 Neil Armstrong <narmstrong@baylibre.com>
+Copyright (C) 2013 Lothar Felten <lothar.felten@gmail.com>
+(C) Copyright 2008-2009 Stefan Roese <sr@denx.de>, DENX Software Engineering
+Copyright (C) 2014 Freescale Semiconductor
+Copyright 2013-2016 Freescale Semiconductor, Inc.
+Copyright 2013-2015 Freescale Semiconductor Inc.
+Copyright (C) 2015 Freescale Semiconductor
+(C) Copyright TechNexion 2010
+Copyright (C) 2013  Renesas Electronics Corporation
+Copyright (C) 2013  Magnus Damm
+Copyright (C) 2012  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Copyright (C) 2014-2017 Cogent Embedded, Inc.
+Copyright (C) 2013-2014 Renesas Electronics Corporation
+Copyright (C) 2016 Cogent Embedded, Inc., <source@cogentembedded.com>
+Copyright (C) 2014-2015 Renesas Electronics Corporation
+Copyright (C) 2015 Renesas Solutions Corp.
+Copyright (C) 2015-2017 Cogent Embedded, Inc. <source@cogentembedded.com>
+Copyright (C) 2016-2017 Renesas Electronics Corp.
+Copyright (C) 2015  Renesas Electronics Corporation
+Copyright (C) 2017 Cogent Embedded, Inc. <source@cogentembedded.com>
+Copyright (C) 2017 Renesas Electronics Corp.
+Copyright (C) 2008 Magnus Damm
+Copyright (C) 2009 - 2012 Paul Mundt
+Copyright (C) 2017 Marek Vasut
+Copyright (c) 2008 Magnus Damm
+Copyright (C) Jasbir Matharu
+Copyright (C) UDOO Team
+Copyright (C) 2015 Socionext Inc.
+Copyright (C) 2004-2007 ARM Limited.
+Copyright (C) 2015 - 2016 Xilinx, Inc, Michal Simek
+(C) Copyright 2004-2007 Freescale Semiconductor, Inc.
+(C) Copyright 2015  Angelo Dureghello <angelo@sysam.it>
+(C) Copyright 2018  Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
+Copyright (c) 2018 Alexander Graf <agraf@suse.de>
+(C) Copyright 2013-2016 Freescale Semiconductor, Inc.
+(c) 2007 Sascha Hauer <s.hauer@pengutronix.de>
+(c) 2015 Paul Thacker <paul.thacker@microchip.com>
+(C) Copyright 2003, 2004
+Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
+(C) Copyright 2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>
+Copyright (C) 2007,2008,2010, 2014 Nobuhiro Iwamatsu
+Copyright (C) 2002 - 2008  Paul Mundt
+Copyright (C) 2018 Anup Patel <anup@brainfault.org>
+(C) Copyright 2008 - 2015 Michal Simek <monstr@monstr.eu>
+Copyright (C) 2011-2012 Xilinx, Inc. All rights reserved.
+(C) Copyright 2005, Psyent Corporation <www.psyent.com>
+(C) Copyright 2010, Thomas Chou <thomas@wytron.com.tw>
+Copyright (C) 2016 Timesys Corporation
+Copyright (C) 2016 Advantech Corporation
+Copyright (C) 2018 sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Copyright (C) 2015 Toby Churchill Ltd - http://www.toby-churchill.com/
+Copyright (C) 2011 Mistral Solutions pvt Ltd
+Copyright (c) 2017 Toradex, Inc.
+Copyright 2013-2019 Toradex, Inc.
+Copyright (c) 2014-2016 Marcel Ziswiler
+Copyright (C) 2008-2013 Eric Jarrige <eric.jarrige@armadeus.org>
+(C) Copyright 2003 Josef Baumgartner <josef.baumgartner@telex.de>
+Copyright (C) 2010 Andreas Bießmann <biessmann.devel@googlemail.com>
+(C) Copyright 2013 Atmel Corporation.
+Copyright (C) 2013-2016 Synopsys, Inc. All rights reserved.
+(C) Copyright 2018 Michal Simek <monstr@monstr.eu>
+Copyright 2016 3ADEV <http://3adev.com>
+Copyright (C) 2013 Hannes Schmelzer <oe5hpm@oevsv.at> -
+Copyright (C) 2016 Hannes Schmelzer <oe5hpm@oevsv.at> -
+Copyright (c) 2008, 2009 esd gmbh Hannover Germany
+(c) Copyright 2016, Data61
+(C) Copyright 2013-2014
+Copyright (C) 2017 Grinn - http://grinn-global.com/
+Copyright (C) 2015 CompuLab, Ltd.
+Copyright (C) 2013, Compulab Ltd - http://compulab.co.il/
+(C) Copyright 2011 CompuLab, Ltd.
+Copyright 2018-2019 Toradex AG
+Copyright 2016-2018 Toradex AG
+Copyright (C) 2015-2016 Marcel Ziswiler <marcel@ziswiler.com>
+Copyright (C) 2012 Lucas Stach
+Copyright (c) 2013-2016 Stefan Agner
+Copyright 2015-2019 Toradex, Inc.
+Copyright (C) 2018 Renesas Electronics Corporation
+(C) Copyright 2005-2009 BuS Elektronik GmbH & Co.KG <esw@bus-elektonik.de>
+Copyright (c) 2017 Intel Corp.
+Copyright (C) 2014 Eukréa Electromatique
+Copyright 2016 Google Inc
+(C) Copyright 2011, Stefano Babic <sbabic@denx.de>
+Copyright (C) 2015 Timesys Corporation
+Copyright (C) 2015 General Electric Company
+Copyright (C) 2014 Advantech
+Copyright (C) 2017-2019 Renesas Electronics
+(C) Copyright 2009-2014
+Copyright (C) 2012 Lukasz Dalek <luk0104@gmail.com>
+Copyright (C) 2017 Synopsys, Inc. All rights reserved.
+(C) Copyright 2009-2012
+Copyright (C) 2010 Heiko Schocher <hs@denx.de>
+Copyright (C) 2018 Simone CIANNI <simone.cianni@bticino.it>
+Copyright (C) 2018 Raffaele RECALCATI <raffaele.recalcati@bticino.it>
+Copyright (C) 2017 Logic PD, Inc.
+Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+Copyright (C) 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
+Copyright (C) 2017 Baylibre, SAS
+Copyright 2016 Freescale Semiconductor
+Copyright 2017, 2019 NXP
+Copyright (C) 2005 Videon Central, Inc.
+Copyright (C) 2016-2017
+(C) Copyright 2007-2010 Michal Simek
+Copyright (C) 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Copyright (C) 2009-2010 Freescale Semiconductor, Inc.
+Copyright (C) Freescale Semiconductor, Inc. 2006, 2010.
+Copyright (C) 2007-2010 Freescale Semiconductor, Inc.
+Copyright 2007-2009,2010-2012 Freescale Semiconductor, Inc.
+(C) Copyright 2002,2003 Motorola,Inc.
+Copyright 2007, 2010-2011 Freescale Semiconductor, Inc.
+Copyright 2004, 2007, 2010-2011 Freescale Semiconductor.
+Copyright 2004-2007, 2010-2011 Freescale Semiconductor.
+Copyright 2007-2008,2010-2011 Freescale Semiconductor, Inc.
+Copyright 2006, 2010-2011 Freescale Semiconductor.
+Copyright (C) 2013 Otavio Salvador <otavio@ossystems.com.br>
+(C) Copyright 2008 Magnus Lilja <lilja.magnus@gmail.com>
+(C) Copyright 2010, Stefano Babic <sbabic@denx.de>
+Copyright (C) 2010-2011 Freescale Semiconductor.
+Copyright (C) 2010-2018 Freescale Semiconductor, Inc.
+Copyright (C) 2014 Evgeni Dobrev <evgeni@studio-punkt.com>
+Copyright (C) DENX GmbH
+Copyright (C) 2006-2011 Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2011 Logic Product Development <www.logicpd.com>
+(C) Copyright 2008-2010
+Copyright (C) 2014 Bachmann electronic GmbH
+Copyright (c) 2013-2016, NVIDIA CORPORATION.
+Copyright (c) 2010-2012 NVIDIA CORPORATION.  All rights reserved.
+Copyright (C) 2018 Collabora Ltd.
+Copyright (C) 2015-2016 Stefan Roese <sr@denx.de>
+Copyright (C) 2013 Lemonage Software GmbH
+Copyright (C) 2018 EETS GmbH - http://www.eets.ch/
+Copyright (C) 2011 Texas Instruments Inc.
+Copyright (C) 2013 Gumstix, Inc. - http://www.gumstix.com/
+Copyright (C) 2015 Technexion Ltd.
+Copyright 2011-2014 Freescale Semiconductor, Inc.
+Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
+(C) Copyright 2012-2016 Stephen Warren
+(C) Copyright 2015-2016 Freescale Semiconductor, Inc.
+Copyright (C) 2018 Microchip Corporation
+Copyright (C) 2017 Microchip Technology Inc.
+Copyright (C) 2012 - 2013 Atmel
+Copyright (C) 2014 Atmel Corporation
+Copyright (c) 2006, 2007 Wind River Systems, Inc.
+Copyright 2007,2009 Wind River Systems <www.windriver.com>
+Copyright 2007 Wind River Systems <www.windriver.com>
+(C) Copyright 2016 Allied Telesis <www.alliedtelesis.co.nz>
+Copyright (C) 2013 Seco S.r.l
+Copyright (C) 2015-2019 Altera Corporation <www.altera.com>
+Copyright (C) 2016 Pavel Machek <pavel@denx.de>
+(C) Copyright 2017  Angelo Dureghello <angelo@sysam.it>
+Copyright (C) 2015 Renesas Electronics Europe GmbH
+(C) Copyright 2013 Maxime Ripard <maxime.ripard@free-electrons.com>
+(C) Copyright 2014 Chen-Yu Tsai <wens@csie.org>
+(C) Copyright 2012-2012 Henrik Nordstrom <henrik@henriknordstrom.net>
+(C) Copyright 2012 Xilinx
+(C) Copyright 2017 Opal Kelly Inc.
+Copyright 2011-2013 Freescale Semiconductor, Inc.
+Copyright (C) 2009 TechNexion Ltd.
+Copyright (C) 2013 Stefan Roese <sr@denx.de>
+Copyright (C) 2011-2014 Pierrick Hascoet, Abilis Systems
+Copyright 2013-2016, NVIDIA CORPORATION.
+Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
+(C) Copyright 2014 Topic Embedded Products
+Copyright (C) 2013, 2014, 2017 Markus Niebel <Markus.Niebel@tq-group.com>
+Copyright (C) 2013 - 2017 Markus Niebel <Markus.Niebel@tq-group.com>
+Copyright (C) 2015, Savoir-faire Linux Inc.
+Copyright 2013-2019 Arcturus Networks, Inc.
+original copyright follows:
+Copyright Jasbir Matharu
+Copyright 2015 UDOO Team
+(C) Copyright 2013 Linaro
+(C) Copyright 2011 Linaro
+(C) Copyright 2011 ARM Limited
+Copyright (C) 2017 Amarula Solutions
+Copyright (C) 2014 Kynetics LLC.
+Copyright (C) 2014 Revolution Robotics, Inc.
+Copyright (C) 2016 NXP Semiconductors
+Copyright (C) 2012, 2015 Stefan Roese <sr@denx.de>
+(C) Copyright 2018-2019 Xilinx, Inc.
+Copyright 2004-2008 Freescale Semiconductor, Inc.
+Copyright 2010 Extreme Engineering Solutions, Inc.
+Copyright (C) 2007-2013 Tensilica, Inc.
+(C) Copyright 2013 - 2017 Xilinx.
+Copyright 2015 3ADEV <http://www.3adev.com>
+Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> et al.
+Copyright © International Business Machines Corp., 2006
+Copyright (C) 2009-2012
+Copyright (C) 2014-2015, Bin Meng <bmeng.cn@gmail.com>
+Copyright (C) 2011-2014 Freescale Semiconductor, Inc.
+(C) Copyright 2004-2008, 2012 Freescale Semiconductor, Inc.
+Copyright (C) 2019 Intel Corporation <www.intel.com>
+Copyright (C) 2012 TQ-Systems GmbH
+Copyright (C) 2018 Jerome Brunet  <jbrunet@baylibre.com>
+Copyright (C) 2017 Xingyu Chen <xingyu.chen@amlogic.com>
+(C) Copyright (C) 2018 Neil Armstrong <narmstrong@baylibre.com>
+Copyright (C) 2017 Jerome Brunet  <jbrunet@baylibre.com>
+(C) Copyright (C) 2019 Jerome Brunet <jbrunet@baylibre.com>
+Copyright 2008,2011 Freescale Semiconductor, Inc.
+Copyright 2008,2010-2011 Freescale Semiconductor, Inc.
+Copyright 2006, 2007, 2010-2011 Freescale Semiconductor.
+Copyright (C) 2012-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright (C) 2007 Nobuhiro Iwamatsu
+Copyright (C) ARM Ltd 2015
+Copyright (C) 2016 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+Copyright (C) 2016-2017 Micron Technology, Inc.
+Copyright (c) 2016-2017 Micron Technology, Inc.
+Copyright (c) 2018 Macronix
+Copyright (c) 2017 exceet electronics GmbH
+Copyright 2004, 2007, 2009-2011 Freescale Semiconductor, Inc.
+Copyright 2008, 2011 Freescale Semiconductor, Inc.
+Copyright (C) 2009 coresystems GmbH
+Copyright (C) 2014  Evgeni Dobrev <evgeni@studio-punkt.com>
+Copyright (C) 2015 Linaro.
+Copyright 2011,2012 Freescale Semiconductor, Inc.
+Copyright (C) 1999 Linus Torvalds
+Copyright (C) 2000-2002 Transmeta Corporation
+Copyright (C) 2003 Kai-Uwe Bloem,
+Auerswald GmbH & Co KG, <linux-development@auerswald.de>
+Copyright 2004-2009 Analog Devices Inc.
+Copyright (C) 2016 - 2018 Xilinx, Inc.
+Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
+(C) Copyright 2007 - 2013 Tensilica Inc.
+Copyright (C) 2014 - 2015 Xilinx, Inc.
+(C) Copyright 2006 ATMEL Rousset, Lacressonniere Nicolas
+(C) Copyright 2012 ATMEL, Hong Xu
+Copyright (C) 2014       Panasonic Corporation
+Copyright (C) 2013-2014, Altera Corporation <www.altera.com>
+Copyright (C) 2009-2010, Intel Corporation and its suppliers.
+Copyright (C) 2013-2014 Altera Corporation <www.altera.com>
+Copyright (C) 2014-2015  Masahiro Yamada <yamada.masahiro@socionext.com>
+Copyright (c) 2006-2008 Freescale Semiconductor
+Copyright (c) 2008 Freescale Semiconductor, Inc.
+Copyright (c) 2012 Freescale Semiconductor, Inc
+(C) Copyright 2014 3ADEV <http://3adev.com>
+(C) Copyright 2015-2018 Vladimir Zapolskiy <vz@mleia.com>
+Copyright 2004-2007 Freescale Semiconductor, Inc.
+Copyright 2008 Sascha Hauer, kernel@pengutronix.de
+Copyright 2009 Ilya Yanok, <yanok@emcraft.com>
+(c) 2009 Magnus Lilja <lilja.magnus@gmail.com>
+Copyright (C) 2008 Embedded Alley Solutions, Inc.
+Copyright (C) 2018 Toradex
+Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com)
+2002-2006 Thomas Gleixner (tglx@linutronix.de)
+Copyright © 2004 Thomas Gleixner (tglx@linutronix.de)
+Copyright © 2011 Ivan Djelic <ivan.djelic@parrot.com>
+Copyright (C) 2000-2004 Steven J. Hill (sjhill@realitydiluted.com)
+Copyright (C) 2006 Thomas Gleixner <tglx@linutronix.de>
+Copyright (C) 2002 Thomas Gleixner (tglx@linutronix.de)
+Copyright (c) 2006-2009 Analog Devices Inc.
+Copyright (C) 2014 Free Electrons
+Copyright (C) 2006 by Weiss-Electronic GmbH.
+Copyright (C) 2008 Nokia Corporation: dropffs() function by
+Artem Bityutskiy <dedekind1@gmail.com> from mtd-utils
+Copyright 2010 Freescale Semiconductor
+(C) Copyright 2010-2011 Texas Instruments, <www.ti.com>
+(C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
+Copyright © 2005 Intel Corporation
+Copyright © 2006 Marvell International Ltd.
+Copyright (C) STMicroelectronics 2019
+Copyright (C) 2013 Boris BREZILLON <b.brezillon.dev@gmail.com>
+Copyright (C) 2015 Roy Spliet <r.spliet@ultimaker.com>
+Copyright (C) 2013 Qiang Yu <yuq825@gmail.com>
+Copyright (C) 2013 Henrik Nordström <Henrik Nordström>
+Copyright (C) 2013 Dmitriy B. <rzk333@gmail.com>
+Copyright (C) 2013 Sergey Lapin <slapin@ossfans.org>
+Copyright (c) 2014-2015, Antmicro Ltd <www.antmicro.com>
+Copyright (c) 2015, AW-SOM Technologies <www.aw-som.com>
+(C) Copyright 2011 NVIDIA Corporation <www.nvidia.com>
+(C) Copyright 2006 Detlev Zundel, dzu@denx.de
+(C) Copyright 2006 DENX Software Engineering
+Copyright 2009-2015 Freescale Semiconductor, Inc. and others
+(C) Copyright 2016 Xilinx, Inc.
+Copyright (c) 2014 Rene Griessl <rgriessl@cit-ec.uni-bielefeld.de>
+Copyright (c) 2017 Microchip Technology Inc. All rights reserved.
+Copyright (c) 2013 Gerhard Sittig <gsi@denx.de>
+Copyright (c) 2015 Realtek Semiconductor Corp. All rights reserved.
+Copyright (C) 2009 NVIDIA, Corporation
+Copyright (C) 2007-2008 SMSC (Steve Glendinning)
+Copyright (C) 2013 Henrik Nordstrom <henrik@henriknordstrom.net>
+Copyright (C) 2013 Google Inc.
+Copyright (C) 2014 Sage Electronics Engineering, LLC.
+Copyright (C) 2016 Bin Meng <bmeng.cn@gmail.com>
+(C) Copyright 2015-2016 Texas Instruments Incorporated, <www.ti.com>
+Copyright (C) 2014, Gumstix, Incorporated - http://www.gumstix.com/
+Copyright (C) 2014, Gumstix, Inc. - http://www.gumstix.com/
+(C) Copyright 2007 Stanislav Galabov <sgalabov@gmail.com>
+Copyright (C) 2017 Stefan Roese <sr@denx.de>
+Copyright (C) 2017 Marvell
+(C) Copyright 2010 - 2011 NVIDIA Corporation <www.nvidia.com>
+(C) Copyright 2010 - 2011
+Copyright (C) 2008 Arthur Shipkowski (art@videon-central.com)
+Copyright (c) 2009 Freescale Semiconductor, Inc.
+(c) Copyright 2010
+Copyright (C) 2004 by Thomas Rathbone
+Copyright (C) 2005 by HP Labs
+Copyright (C) 2005 by David Brownell
+Copyright (C) 2004 by Thomas Rathbone, HP Labs
+Copyright (C) 2005 by Ivan Kokshaysky
+Copyright (C) 2006 by SAN People
+Copyright 2015 Broadcom Corporation.
+Copyright (C) 2006-2008 David Brownell
+Copyright (C) 2003 David Brownell
+Copyright (c) 2000, 2001, 2002 Lineo
+Copyright (c) 2001 Hewlett Packard
+Copyright (C) 2008 for Samsung Electronics
+Copyright (C) 2004 Herbert Poetzl <herbert@13thfloor.at>
+Copyright (C) 2009 for Samsung Electronics
+Copyright (C) 2004 David Brownell
+Copyright (C) 2003-2005,2008 David Brownell
+Copyright (C) 2003-2004 Robert Schwebel, Benedikt Spranger
+(C) 2007 by OpenMoko, Inc.
+(C) Copyright 2006 by Harald Welte <hwelte at hmw-consulting.de>
+Copyright (C) 2011-2012 Samsung Electronics
+(C) Copyright 2008 - 2009
+Copyright 2011 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Copyright 2014 Linaro, Ltd.
+Copyright (C) 2003-2008 Alan Stern
+Copyright (C) 2017 Toradex
+Copyright (C) 2002 Intrinsyc, Inc. (Frank Becker)
+Copyright (C) 2003 Robert Schwebel, Pengutronix
+Copyright (C) 2003 Benedikt Spranger, Pengutronix
+Copyright (C) 2003 Joshua Wise
+Copyright (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de>, Pengutronix
+Copyright (C) 2007 Eurotech S.p.A.  <info@eurotech.it>
+Copyright (C) 2008 Vivek Kutal      <vivek.kutal@azingo.com>
+Copyright (C) 2004 by David Brownell
+Copyeight (C) 2009 Samsung Electronics
+Copyright (C) 2016 Andes Technology Corporation
+Copyright (C) 1991-2004 SciTech Software, Inc.
+(C) Copyright 2015 Savoir-faire Linux Inc.
+(C) Copyright 2002-2013
+Copyright 1994-2001 Stephen Rothwell (sfr@canb.auug.org.au)
+Copyright (c) 2015, Linaro Limited
+Copyright (C) 2014 Felix Fietkau <nbd@nbd.name>
+Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
+(C) Copyright 2001 Linus Torvalds
+Copyright © 2008 Keith Packard
+Copyright (C) 2002, 2003, 2004 Dell Inc.
+Copyright (C) 1998 David S. Miller (davem@redhat.com)
+Copyright 2001 Jeff Garzik <jgarzik@pobox.com>
+Copyright 2001 Sun Microsystems (thockin@sun.com)
+Copyright 2002 Intel (eli.kupermann@intel.com,
+christopher.leech@intel.com,
+scott.feldman@intel.com)
+Copyright (C) Sun Microsystems 2008
+Copyright (c) 2006-2009, 2011 Freescale Semiconductor, Inc.
+Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
+Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
+Copyright (C) 2008 Marvell Semiconductor
+Copyright Torsten Duwe <duwe@informatik.uni-erlangen.de> 1993
+derived from Data Sheet, Copyright Motorola 1984 (!).
+Copyright 2006-2009 Solarflare Communications Inc.
+Copyright (C) 1996, 1999, 2001 David S. Miller (davem@redhat.com)
+Copyright (C) 2014 Linaro Ltd.
+Copyright (C) 1992, 1994 by Theodore Ts'o.
+Copyright (C) 2004 Texas Instruments.
+Copyright (C) 2009 David Brownell
+Copyright (C) 2009 Nick Thompson, GE Fanuc Ltd, <nick.thompson@gefanuc.com>
+Copyright (C) 2012 Dmitry Bondar <bond@inmys.ru>
+Copyright (C) 2005-2008 Arthur Shipkowski (art@videon-central.com)
+(C) Copyright 2012 Stephen Warren
+Copyright 2015 Stephen Warren
+Copyright (C) 2018 STMicroelectronics - All Rights Reserved
+Copyright 2009-2013 Freescale Semiconductor, Inc.
+Copyright (c) 2015 Samsung Electronics
+(C) Copyright 2019 - Texas Instruments Incorporated - http://www.ti.com/
+Copyright (c) 2018, STMicroelectronics
+Copyright (C) 2018 ROHM Semiconductors
+(C) Copyright 2014 Texas Instruments Incorporated - http://www.ti.com
+Copyright (c) 2010-2014, NVIDIA CORPORATION.  All rights reserved.
+Copyright (c) 2006-2013 Ingenic Semiconductor
+Copyright (C) 2013, Lemonage Software GmbH
+Copyright (C) 2008 The Android Open Source Project
+Copyright (C) 2016-2017 Rockchip Electronic Co.,Ltd
+Copyright (C) 2014 Josh Datko, Cryptotronix, jbd@cryptotronix.com
+2016 Tomas Hlavacek, CZ.NIC, tmshlvck@gmail.com
+2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+(C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
+Copyright (C) 2017 Texas Instruments
+(C) Copyright 2005-2009
+Copyright 2014 Red Hat, Inc.
+Copyright 2012 Texas Instruments
+Copyright(c) 2009 Dialog Semiconductor Ltd.
+Copyright (C) 2006-2015 Nicolas Pitre
+Copyright (C) 2017 The Android Open Source Project
+Copyright (c) 2015 Texas Instruments Incorporated - http://www.ti.com
+Copyright 2003 Motorola,Inc.
+Copyright (c) 2018 The Chromium OS Authors. All rights reserved.
+(C) Copyright 2009-2016 CompuLab, Ltd.
+Copyright (C) 1999 VA Linux Systems
+Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
+Copyright (C) 1999, 2002-2003 Hewlett-Packard Co.
+Copyright (c) 1995, 1996, 2001, 2002
+Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com
+Copyright 2015 Free Electrons.
+(C) Copyright 2000-2005
+Copyright 2007, 2011 Freescale Semiconductor, Inc.
+Copyright (C) 2004-2007, 2015 Freescale Semiconductor, Inc.
+Copyright 2013 - 2015  Freescale Semiconductor, Inc.
+Copyright 2007-2008,2010-2011 Freescale Semiconductor, Inc
+Copyright 2009-2012, 2013 Freescale Semiconductor, Inc.
+(C) Copyright 2015 Freescale Semiconductor, Inc.
+Copyright (C) 2000, 2004, 2005  MIPS Technologies, Inc.
+Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
+Copyright (c) 2012  Samsung Electronics
+Copyright (C) 2009 - 2013 Heiko Schocher <hs@denx.de>
+(C) 2000 by Paolo Scaffardi (arsenio@tin.it)
+(C) Copyright 2002 ELTEC Elektronik AG
+Copyright (C) 1997-2001, 2004, 2007 Free Software Foundation, Inc.
+(C) Copyright 2005-2010 Freescale Semiconductor, Inc.
+Lattice Semiconductor Corp. Copyright 2009
+Copyright 2003-2004 Red Hat, Inc.  All rights reserved.
+Copyright 2003-2004 Jeff Garzik
+Copyright (C) 1996 Larry Ewing (lewing@isc.tamu.edu)
+Copyright (C) 1996,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
+Copyright (C) 2001 Peter Bergner, IBM Corp.
+Copyright (C) 2004 by FS Forth-Systeme GmbH.
+(C) Copyright 2012 Freescale Semiconductor, Inc.
+Copyright (C) 2009 Marc Kleine-Budde <mkl@pengutronix.de>
+Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Additions (C) Copyright 2009 Industrie Dial Face S.p.A.
+Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Copyright (C) 2004-2007, 2010 Freescale Semiconductor, Inc.
+Copyright(c) 2003 Motorola Inc.
+(C) 2009 by Detlev Zundel, DENX Software Engineering GmbH
+modifications (c) Rob Taylor, Flying Pig Systems. 2000.
+by Richard Danter (richard.danter@windriver.com), (C) 2005 Wind River Systems
+Copyright (C) 2005-2007 Samsung Electronics
+Copyright (C) 2008 RuggedCom, Inc.
+Copyright 2009 CJSC "NII STT", http://www.niistt.ru/
+Copyright (c) 2018 Toradex, Inc.
+Copyright (c) 2011 samsung electronics
+Copyright 2000-2002 by Hans Reiser, licensing governed by reiserfs/README
+Copyright (C) 2000, 2001  Free Software Foundation, Inc.
+(C) Copyright 2003 Sysgo Real-Time Solutions, AG <www.elinos.com>
+Copyright (c) 2013, Henrik Nordstrom <henrik@henriknordstrom.net>
+Copyright (c) 2013, Compulab Inc.
+Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+Copyright 2009, Matthias Fuchs <matthias.fuchs@esd.eu>
+Copyright (C) 2010 The Android Open Source Project
+Copyright 2013 Texas Instruments, Inc.
+Copyright (c) 2014 Texas Instruments Incorporated - http://www.ti.com
+Copyright 2004, 2007, 2009, 2011, 2013 Freescale Semiconductor, Inc.
+Copyright (C) 2006-2008 Nokia Corporation
+Copyright (C) 2011 Samsung Electrnoics
+Copyright (c) 2004, 2008 IBM Corporation
+Copyright (c) 2009 Pattrick Hueper <phueper@hueper.net>
+(C) Copyright 1997-2002 ELTEC Elektronik AG
+Generated by EasyLogo, (C) 2000 by Paolo Scaffardi
+Copyright 2013, 2015 Freescale Semiconductor, Inc.
+(C) Copyright 2015 Xilinx, Inc,
+Copyright (C) 2013 Simon Guinot <simon.guinot@sequanux.org>
+Copyright (c) 2015 Stephen Warren
+Copyright (c) 2016, Alexander Graf <agraf@suse.de>
+Copyright (c) 2017, Heinrich Schuchardt <xypron.glpk@gmx.de>
+Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2018, Xilinx Inc.
+Copyright (c) 2017 Alison Chaiken
+Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2016, Google Inc.
+Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
+Copyright (c) 2016, Xilinx Inc. Michal Simek
+Copyright (c) 2017, Xiphos Systems Corp. All rights reserved.
+Copyright (C) 2018, EETS GmbH, http://www.eets.ch/
+Copyright (C) 1996 David S. Miller
+Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Ralf Baechle
+Copyright (C) 1994 - 1999, 2000, 01, 06 Ralf Baechle
+Copyright (C) 1995, 1996 Paul M. Antoine
+Copyright (C) 1998 Ulf Carlsson
+Copyright (C) 2002, 2003, 2004, 2005, 2007  Maciej W. Rozycki
+Copyright (C) 2000, 2001, 2012 MIPS Technologies, Inc.  All rights reserved.
+Copyright (C) 2014, Imagination Technologies Ltd.
+Copyright (C) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org>
+(C) Copyright 2009, 2011, 2016 Freescale Semiconductor, Inc.
+Copyright (C) 2015 Alexey Brodkin <abrodkin@synopsys.com>
+Copyright (c) 2007-2008, Juniper Networks, Inc.
+Copyright (c) 2008, Excito Elektronik i Skåne AB
+Copyright (c) 2008, Michael Trimarchi <trimarchimichael@yahoo.it>
+Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
+(C) Copyright 2011 Ilya Yanok, Emcraft Systems
+Copyright (c) 2009-2015 NVIDIA Corporation
+Copyright (c) 2013 Lucas Stach
+Copyright (c) 2015 Sanchayan Maity <sanchayan.maity@toradex.com>
+Copyright (C) 2015 Toradex AG
+(C) Copyright 2014, Xilinx, Inc
+Copyright (C) 2012 Sughosh Ganu <urwithsughosh@gmail.com>
+(C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
+(C) Copyright 2000-2002 David Brownell
+(C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net>
+Copyright (C) 2008  Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+Copyright (c) 2003/06, Courage Co., Ltd.
+Copyright 2015,2016 Freescale Semiconductor, Inc.
+Copyright (C) 2008 Intel Corp.
+Copyright (C) 2013 Samsung Electronics Co.Ltd
+Copyright (c) 2015, Google, Inc
+Copyright (c) 2014, Renesas Electronics Corporation
+Copyright (c) 2016 Rockchip, Inc.
+Copyright (C) 2003  Manuel Novoa III  <mjn3@codepoet.org>
+Copyright (C) 2013-2014, 2018 Synopsys, Inc. All rights reserved.
+Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
+Copyright (C) 1989-2013 Free Software Foundation, Inc.
+Copyright (C) 2016 Synopsys, Inc. All rights reserved.
+Copyright (C) 2018 Xilinx, Inc. (Michal Simek)
+Copyright (C) 2015, Texas Instruments, Incorporated
+Copyright (C) 2018-2019 Intel Corporation <www.intel.com>
+Copyright (c) 2014 Imagination Technologies
+(C) Copyright 2010 Stefano Babic <sbabic@denx.de>
+Copyright 2017, Theobroma Systems Design und Consulting GmbH
+Copyright (C) 2013 SolidRun ltd.
+Copyright (C) 2013 Jon Nettleton <jon.nettleton@gmail.com>.
+Copyright (C) 2014, 2015 Renesas Electronics Corporation
+(C) Copyright 2002-2004 by David Brownell
+Copyright (C) 1989-2015 Free Software Foundation, Inc.
+(C) Copyright 2007 Freescale Semiconductor Inc
+Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+Copyright 2006,2009-2010 Freescale Semiconductor, Inc.
+Copyright 2004,2009-2011 Freescale Semiconductor, Inc.
+(C) Copyright 2004, 2007 Freescale Semiconductor. (MPC86xx Port)
+Copyright (C) 2015, Bachmann electronic GmbH
+Copyright (C) 2012 rockchips
+Copyright (C) 2012-2015 Samsung Electronics
+Copyright (C) 2016 Rockchip Electronics Co., Ltd
+Copyright (C) 2014 - STMicroelectronics Inc.
+Copyright (C) 2018 Samsung Electronics
+(C) Copyright 2015-2016
+(C) Copyright 2014-2015 Samsung Electronics
+(C) Copyright 2013 O.S. Systems Software LTDA.
+Copyright (C) 2011 Andreas Bießmann
+Copyright (C) 2003 Ralf Baechle
+Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
+Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
+Copyright (c) 2013 Corscience GmbH & Co.KG
+Copyright (C) 2019, Rick Chen <rick@andestech.com>
+Copyright (C) 2019 Western Digital Corporation or its affiliates.
+Copyright (c) 2016-17 Microsemi Corporation.
+Copyright (C) 2018, Anup Patel <anup@brainfault.org>
+Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org>
+Copyright (C) 1999 Hewlett-Packard Co.
+Copyright (C) 2016 The Android Open Source Project
+Copyright 1994, 1995, 2000 Neil Russell.
+Copyright 2011 Comelit Group SpA
+Copyright 2010-2011, 2013 Freescale Semiconductor, Inc.
+Copyright (C) 2012 Jonas Gorski <jonas.gorski@gmail.com>
+Copyright 2014 Steffen Trumtrar <s.trumtrar@pengutronix.de>
+Copyright 2013 Maxime Ripard
+Copyright 2017 Toradex AG
+Copyright 2014 Toradex, Inc.
+Copyright (C) 2017 Google, Inc.
+(C) Copyright 2011 DENX Software Engineering GmbH
+(C) Copyright 2002 SIXNET, dge@sixnetio.com.
+(C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
+(C) Copyright 2001, 2002, 2003
+(C) Copyright 2001-2008
+(C) Copyright 2009-2012 ADVANSEE
+Copyright 2010 Orex Computed Radiography
+Alexander Bigga <ab@mycable.de>, 2006 (c) mycable GmbH
+Copyright (C) 2008 Kim B. Heino
+Copyright (C) 2016 by NXP Semiconductors Inc.
+Copyright (C) 2004 Gary Jennejohn garyj@denx.de
+Copyright (C) 2005-06 Tower Technologies
+Copyright (c) 2017, General Electric Company
+Copyright 2004 Karen Spearel
+Copyright 2005 Alessandro Zummo
+Copyright (c) 2008 Texas Instruments
+Copyright 2008 Mentor Graphics Corporation
+Copyright (C) 2008 by Texas Instruments
+(C) Copyright 2008 Texas Instruments Incorporated.
+Copyright (c) 2009 Texas Instruments
+Copyright (c) 2010 Texas Instruments, Inc.
+Copyright (C) 2010, 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
+Copyright (C) 2009, 2010 Matthias Kaehlcke <matthias@kaehlcke.net>
+Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+Copyright (C) 2002-2003 Romain Lievin <roms@tilp.info>
+Copyright (c) 2009-2010 Wind River Systems, Inc.
+Copyright 2011 Linaro
+Copyright (C) 2008 Nir Tzachar <nir.tzachar@gmail.com?
+Copyright (C) 2015 Boris Barbulovski <bbarbulovski@gmail.com>
+Copyright (C) 2002-2005 Roman Zippel <zippel@linux-m68k.org>
+Copyright (C) 2002-2005 Sam Ravnborg <sam@ravnborg.org>
+(C) Copyright 2017 Jorge Ramirez Ortiz <jorge.ramirez-ortiz@linaro.org>
+(C) Copyright 2019 Ramon Fried <ramon.fried@gmail.com>
+(C) Copyright 2016 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
+(C) Copyright 2014 - 2019 Xilinx, Inc.
+(C) Copyright 2014-2018
+Copyright (c) 2014, Marcel Ziswiler
+(C) Copyright 2018 Michal Simek
+Copyright (C) 2014-2017 Altera Corporation <www.altera.com>
+Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
+Copyright (C) 2013-2017 Altera Corporation <www.altera.com>
+Copyright (C) 2016-2017 Intel Corporation
+Copyright (C) 2015-2017 Intel Corporation <www.intel.com>
+(C) Copyright 2014 Andreas Bießmann <andreas@biessmann.org>
+Copyright (C) 1993, 1996, 2001, 2002 Free Software Foundation, Inc.
+Copyright 2014 Google, Inc
+COPYRIGHT (c) 2000 BY ABATRON AG
+(C) Copyright 2013 Thomas Petazzoni
+(c) 2012 Daniel Stodden <daniel.stodden@gmail.com>
+Copyright (c) 2005-2006 Gianluigi Tiesi <sherpya@netfarm.it>
+(C) Copyright 2011 Free Electrons
+Copyright 2012-2014 Freescale Semiconductor, Inc.
+Copyright (C) 2017 Andes Technology
+(C) Copyright 2015 Google,  Inc
+Copyright (C) 2014 Charles Manning <cdhmanning@gmail.com>
+Copyright (c) 2019, Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
+Copyright © 2016 NextThing Co.
+Copyright © 2016 Free Electrons
+(C) Copyright 2016  DENX Software Engineering GmbH
+Copyright (C) 2015 Nathan Rossi <nathan@nathanrossi.com>
+Copyright (C) 2016 Michal Simek <michals@xilinx.com>
+Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
+Copyright (C) 2018 Marek Vasut <marek.vasut+renesas@gmail.com>
+Copyright 2016 Texas Instruments, Inc.
+Copyright (C) Nokia Corporation, 2007
+Copyright (C) Samsung Electronics, 2009
+Copyright(c) 2005-2008 Samsung Electronics
+Copyright (C) 2005-2009 Samsung Electronics
+(C) 2007-2008 Mike Frysinger <vapier@gentoo.org>
+Copyright (C) 2007 Advanced Micro Devices, Inc.
+Copyright (C) 2009-2010 coresystems GmbH
+Copyright (C) 2001 Ronald G. Minnich
+Copyright (C) 2005 Nick.Barker9@btinternet.com
+Copyright (C) 2001  Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
+(C) Copyright -2003
+Copyright (C) 2005 Intel Co.
+Copyright (C) 1991,1992,1993,1997,1998,2003, 2005 Free Software Foundation, Inc.
+JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
+(C) Copyright 2005-2009 Freescale Semiconductor, Inc.
+(C) Copyright 2004-2009 Freescale Semiconductor, Inc.
+(C) Copyright 2004-2010 Freescale Semiconductor, Inc.
+Copyright (C) 2012 - 2013 Atmel Corporation
+Copyright (C) 2016 George McCollister <george.mccollister@gmail.com>
+Copyright 2013-2019 Arcturus Networks Inc.
+Copyright 2013-2015 Arcturus Networks, Inc.
+Copyright 2013-2015 Arcturus Networks, Inc
+Copyright 2007-2013 Freescale Semiconductor, Inc.
+Copyright 2008-2013 Freescale Semiconductor, Inc.
+Copyright 2015 Timesys Corporation
+Copyright (C) 2013  Renesas Solutions Corp.
+(C) Copyright 2013 SAMSUNG Electronics
+Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+Copyright 2007, Embedded Specialties, Inc.
+Copyright 2007 Wind River Systems, Inc.
+Copyright 2007 Wind River Systemes, Inc. <www.windriver.com>
+(C) Copyright 2012-
+(C) Copyright 2002,2003, Motorola Inc.
+Copyright (C) 2018 Technexion Ltd.
+Copyright (C) 2014, 2015 O.S. Systems Software LTDA.
+(C) Copyright 2000 - 2013
+of logo, copyright and system information on the LCD
+(C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2007.
+(C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
+Copyright 2011 The Chromium Authors, All Rights Reserved.
+Copyright 2008 Jon Loeliger, Freescale Semiconductor, Inc.
+Copyright (C) 2016 Peng Fan <van.freenix@gmail.com>
+Copyright 2008-2013 Analog Devices Inc.
+Copyright (C) 2015  Thomas Chou <thomas@wytron.com.tw>
+Copyright (C) 2011  Missing Link Electronics
+Copyright (C) 2008-2011 Florian Fainelli <florian@openwrt.org>
+(C) Copyright 2011 Guralp Systems Ltd.
+Copyright (C) 2008,2009 STMicroelectronics
+Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
+Copyright (C) 2010 Joakim Axelsson <joakim.axelsson AT stericsson.com>
+(C) Copyright 2015 Marek Vasut <marex@denx.de>
+Copyright (C) 2009-2011 Gabor Juhos <juhosg@openwrt.org>
+Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
+Copyright (C) 2007 David Brownell
+Copyright (c) 2015 Microchip Technology Inc
+(C) Copyright 2010-2012,2015
+Copyright (c) 2013 - 2018 Xilinx, Michal Simek
+Copyright (C) 2015 DAVE Embedded Systems <devel@dave.eu>
+Copyright (C) 2009 - 2014 Xilinx, Inc.
+(C) Copyright 2016 Vasily Khoruzhick <anarsoul@gmail.com>
+Copyright (c) Nokia Corporation, 2007
+Copyright (c) 2012 Linutronix GmbH
+Copyright (c) 2014 sigma star gmbh
+Copyright (c) Nokia Corporation, 2006, 2007
+Copyright (c) Nokia Corporation, 2006
+Copyright 2000-2004 Wolfgang Denk, wd@denx.de
+Copyright (c) 2001 Charles Mott <cm@linktel.net>
+Copyright (c) 2008 coresystems GmbH
+Copyright (c) 2008 Pieter Voorthuijsen <pieter.voorthuijsen@prodrive.nl>
+Copyright (c) 2009 Robin Getz <rgetz@blackfin.uclinux.org>
+(C) Masami Komiya <mkomiya@sonare.it> 2005
+Copyright 2009, Robin Getz <rgetz@blackfin.uclinux.org>
+Copyright (C) 2003 by Arthur van Hoff (avh@strangeberry.com)
+Copyright (C) 2010 by Joe Hershberger
+(C) Masami Komiya <mkomiya@sonare.it> 2004
+Copyright 2000, 2001 DENX Software Engineering, Wolfgang Denk, wd@denx.de
+Copyright 2011 Comelit Group SpA,
+Luca Ceresoli <luca.ceresoli@comelit.it>
+Copyright 2018 Lothar Felten, lothar.felten@gmail.com
+Copyright (c) 2016 NextThing Co
+Copyright (c) 2016 Free Electrons
+(C) Copyright 2009 Wolfgang Denk <wd@denx.de>
+Copyright 2014 Broadcom Corporation
+(C) Copyright 2004 DENX Software Engineering, Wolfgang Denk, wd@denx.de
+Copyright (C) 2015, Kodak Alaris, Inc
+(C) Copyright 2017      Icenowy Zheng <icenowy@aosc.io>
+(C) Copyright 2015      Hans de Goede <hdegoede@redhat.com>
+(C) Copyright 2007-2015
+(C) Copyright 2006-2013
+Copyright (C) 2016 Siarhei Siamashka <siarhei.siamashka@gmail.com>
+Copyright (C) 2018 Amarula Solutions B.V.
+Copyright (C) 1999,2000,2001,2002,2003,2004
+Copyright 2004	Sun Microsystems, Inc.
+Copyright (C) 2012-2013 Texas Instruments, Inc.
+Copyright (C) 2018 DENX Software Engineering
+Original Copyright follow:
+Copyright (C) 2011 Google, Inc.
+Copyright (C) 2009 Daniel Mack <daniel@caiaq.de>
+Copyright (C) 2005, 2007 Olivier Gay <olivier.gay@a3.epfl.ch>
+Copyright (C) 2013-2018 Hannes Schmelzer <oe5hpm@oevsv.at>
+Copyright (C) 2013-2018 Hannes Schmelzer <oe5hpm@oevsv.at> -
+(C) 2015 Hans de Goede <hdegoede@redhat.com>
+Copyright (C) 2008-2009 MontaVista Software Inc.
+Copyright (C) 2008-2009 Texas Instruments Inc
+Copyright 2017 Jernej Skrabec <jernej.skrabec@siol.net>
+Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+(C) Copyright 2016-2018 ARM Ltd.
+Copyright (C) 2011-2013 Marek Vasut <marex@denx.de>
+Copyright (c) 2013 Adapted from Linux driver:
+Copyright (c) 2012 Anders Electronics plc. All Rights Reserved.
+Copyright (c) 2012 CompuLab, Ltd
+(C) 2015 Siarhei Siamashka <siarhei.siamashka@gmail.com>
+(C) Copyright 2018 Liviu Dudau <liviu@dudau.co.uk>
+Based on the Linux driver, (C) 2012 Texas Instruments
+(C) Copyright 2018 - Beniamino Galvani <b.galvani@gmail.com>
+(C) Copyright 2018 - BayLibre, SAS
+Copyright 2008-2015 Freescale Semiconductor, Inc.
+Copyright 2015 Toradex, Inc.
+Copyright (C) 2010-2015 Freescale Semiconductor, Inc.
+Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
+Copyright (C) 2004-2011 Freescale Semiconductor, Inc.
+Copyright 2013 Stefan Roese <sr@denx.de>
+Copyright (C) 2011-2012 Freescale Semiconductor, Inc.
+Copyright (C) 2006-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2006-2010 Freescale Semiconductor, Inc.
+Copyright (C) 2005,2010-2011 Freescale Semiconductor, Inc.
+Copyright (C) 2005, 2011 Freescale Semiconductor, Inc.
+(C) Copyright 2018 Simon Goldschmidt
+Copyright (C) 2005-2011 Canonical Ltd
+Copyright © 2005 Samsung Electronics
+Copyright © 2000-2005
+Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> et al.
+Copyright © 2002      Robert Kaiser <rkaiser@sysgo.de>
+Copyright © 1999 Machine Vision Holdings, Inc.
+Copyright © 2002-2003 Greg Ungerer <gerg@snapgear.com>
+Copyright © 2002-2003 SnapGear Inc
+Copyright © 2000      Red Hat UK Limited
+Copyright 2017 - Free Electrons
+Copyright (C) 2000-2010 Steven J. Hill <sjhill@realitydiluted.com>
+Copyright (c) 2006 Thomas Gleixner <tglx@linutronix.de>
+(C) Copyright 2013 Andreas Bießmann <andreas@biessmann.org>
+(C) 2000 Nicolas Pitre <nico@fluxnic.net>
+Copyright (c) 2015-2018 National Instruments
+Copyright (c) 2015-2018 Joe Hershberger <joe.hershberger@ni.com>
+(C) Copyright 2016 Linaro Limited
+Copyright (C) 2012-2019 Altera Corporation <www.altera.com>
+Copyright 2004-2006,2010 Freescale Semiconductor, Inc. All Rights Reserved.
+Copyright (C) 2006-2008 Nokia Corporation.
+Copyright (C) 2006, 2007 University of Szeged, Hungary
+Copyright (C) 2013-2015 Freescale Semiconductor, Inc.
+
+License: GNU GENERAL PUBLIC LICENSE
+GNU GENERAL PUBLIC LICENSE
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+Preamble
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+How to Apply These Terms to Your New Programs
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+one line to give the program's name and an idea of what it does.
+Copyright (C) yyyy  name of author
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+Gnomovision version 69, Copyright (C) year name of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+type `show w'.  This is free software, and you are welcome
+to redistribute it under certain conditions; type `show c'
+for details.
+The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright
+interest in the program `Gnomovision'
+(which makes passes at compilers) written
+by James Hacker.
+
+signature of Ty Coon, 1 April 1989
+Ty Coon, President of Vice
+This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
+----------------------------------------------------------------------
+Software:spiffs 0.3.7
+
+Copyright notice:
+Copyright (c) 2013-2017 Peter Andersson (pelleplutt1976<at>gmail.com)
+Copyright (c) 2013-2017 Peter Andersson (pelleplutt1976 at gmail.com)
+
+License: The MIT License
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+----------------------------------------------------------------------
+Software:7 Zip-LZMA SDK 19.00
+
+Copyright notice:
+Copyright (C) 2019 Igor Pavlov.
+
+License:Public Domain
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any means.
+----------------------------------------------------------------------
+Software:lwip 2.1.2
+
+Copyright notice:
+Copyright (c) 2016 Elias Oenal.
+Copyright (c) 2016 Elias Oenal and Dirk Ziegelmeier.
+Copyright (c) 2006 Axon Digital Design B.V., The Netherlands.
+Copyright (c) 2001-2004 Swedish Institute of Computer Science.
+Copyright (c) 2007 Dominik Spies <kontakt@dspies.de>
+Copyright (c) 2001-2004 Leon Woestenberg <leon.woestenberg@gmx.net>
+Copyright (c) 2001-2004 Axon Digital Design B.V., The Netherlands.
+Copyright (c) 2017 Simon Goldschmidt <goldsimon@gmx.de>
+uIP version Copyright (c) 2002-2003, Adam Dunkels.
+Copyright (c) 2017 Dirk Ziegelmeier.
+Copyright (c) 2015 Verisure Innovation AB
+Copyright (c) 2018 Simon Goldschmidt
+Copyright (c) 2001-2003 Swedish Institute of Computer Science.
+Copyright (c) 2018 Simon Goldschmidt <goldsimon@gmx.de>
+Copyright (c) 1994-2002 Paul Mackerras. All rights reserved.
+Copyright (c) 2003 Paul Mackerras. All rights reserved.
+Copyright (c) 1995 Eric Rosenquist.  All rights reserved.
+Copyright (c) 2001 by Sun Microsystems, Inc.
+Copyright (c) 2002 Google, Inc.
+Copyright (c) 1999 Tommi Komulainen.  All rights reserved.
+Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
+Copyright (c) 1995, 1996, 1997 Francis.Dupont@inria.fr, INRIA Rocquencourt,
+Alain.Durand@imag.fr, IMAG,
+Jean-Luc.Richier@imag.fr, IMAG-LSR.
+Copyright (c) 1998, 1999 Francis.Dupont@inria.fr, GIE DYADE,
+Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
+Copyright (c) 1998 Global Election Systems Inc.
+Copyright (c) 2008 Paul Mackerras. All rights reserved.
+portions Copyright (c) 1997 Global Election Systems Inc.
+portions Copyright (c) 1998 Global Election Systems Inc.
+portions Copyright (c) 2001 by Cognizant Pty Ltd.
+Copyright (c) 2006 by Marc Boucher, Services Informatiques (MBSI) inc.
+Copyright (c) 2002 The NetBSD Foundation, Inc.
+Copyright (c) 1989 Regents of the University of California.
+Copyright (c) Deltatee Enterprises Ltd. 2013
+Copyright (c) 1993-2002 Paul Mackerras. All rights reserved.
+Copyright (c) 2002 Google, Inc.  All rights reserved.
+Copyright (c) 1996-2002 Paul Mackerras. All rights reserved.
+Copyright (c) 1998 by Global Election Systems Inc.
+Copyright (c) 2002,2003,2004 Google, Inc.
+Copyright (c) 2000-2002 Paul Mackerras. All rights reserved.
+portions Copyright (c) 1997 by Global Election Systems Inc.
+Copyright (c) 1994 The Australian National University.
+Copyright (c) 1989 Carnegie Mellon University.
+Copyright (c) 1999-2002 Paul Mackerras. All rights reserved.
+Copyright (c) 2017 Simon Goldschmidt.
+Copyright (c) 2003-2004 Leon Woestenberg <leon.woestenberg@axon.tv>
+Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands.
+Copyright (c) 2015 Inico Technologies Ltd.
+Copyright (c) 2017 Benjamin Aigner
+Copyright (c) 2015 Inico Technologies Ltd. , Author: Ivan Delamer <delamer@inicotech.com>
+Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt
+Copyright (c) 2017 Simon Goldschmidt
+Copyright (c) 2013-2017, tinydir authors:
+- Cong Xu
+- Lautis Sun
+- Baudouin Feildel
+- Andargor <andargor@yahoo.com>
+All rights reserved.
+Copyright (c) 2014 Simon Goldschmidt
+Copyright (c) 2016 Erik Andersson <erian747@gmail.com>
+Copyright (c) 2017 Joel Cunningham, Garmin International, Inc. <joel.cunningham@garmin.com>
+Copyright (c) 2016 Erik Andersson
+Copyright (c) 2001, 2002 Leon Woestenberg <leon.woestenberg@axon.tv>
+Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands.
+Copyright (c) 2015 Dirk Ziegelmeier
+ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels.
+Copyright (c) 2010 Inico Technologies Ltd.
+Copyright (c) 2002 CITEL Technologies Ltd.
+Copyright (c) 2017 The MINIX 3 Project.
+Copyright (c) 2018 Swedish Institute of Computer Science.
+Copyright (c) 2018 Simon Goldschmidt.
+Based on XySSL: Copyright (C) 2006-2008  Christophe Devine
+Copyright (C) 2009  Paul Bakker <polarsslmaintainer at polarssl dot org>
+Copyright (c) 2001, Swedish Institute of Computer Science.
+Copyright (c) 2001, 2002 Swedish Institute of Computer Science.
+
+License:BSD 3-Clause License
+Copyright (c) <YEAR>, <OWNER>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+----------------------------------------------------------------------
+Software:libcoap 4.2.1
+
+Copyright notice:
+Copyright (C) 2010-2011,2015-2016 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2011 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2012,2014-2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2011,2014 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2016 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2017 Jean-Claude Michelou <jcm@spinetix.com>
+Copyright (C) 2012-2013 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2017 Jean-Claue Michelou <jcm@spinetix.com>
+Copyright (C) 2010-2019 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2012 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2015 Carsten Schoenert <c.schoenert@t-online.de>
+Copyright (C) 2010-2011,2014-2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2013 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2014 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010,2011,2014,2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010-2011,2016 Olaf Bergmann <bergmann@tzi.org>
+Copyright (c) 2003-2017, Troy D. Hanson     http:troydhanson.github.com/uthash/
+Copyright (c) 2007-2017, Troy D. Hanson   http:troydhanson.github.com/uthash/
+Copyright (C) 2011,2015,2018-2019 Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (C) 2011 Olaf Bergmann <bergmann@tzi.org>
+Copyright (c) 2010--2019, Olaf Bergmann and others
+Copyright (C) 2010—2019 by Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (c) 2001-2003 Swedish Institute of Computer Science.
+Copyright (C) 2019 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2013,2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2013 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2012,2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2012 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2013,2015-2018 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2018 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2013--2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010--2019 Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (C) 2010--2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010,2011,2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2012--2013 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010,2011 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2015-2016,2019 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010--2012,2015-2019 Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (C) 2010--2012,2014--2019 Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (C) 2017 Dag Bjorklund <dag.bjorklund@comsel.fi>
+Copyright (C) 2012,2014,2016-2019 Olaf Bergmann <bergmann@tzi.org> and others
+Copyright (C) 2012,2014 Olaf Bergmann <bergmann@tzi.org>
+2014 chrysn <chrysn@fsfe.org>
+Copyright (C) 2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2014--2015 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010--2019 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010--2016 Olaf Bergmann <bergmann@tzi.org>
+Copyright (C) 2010--2012,2015-2016 Olaf Bergmann <bergmann@tzi.org>
+
+License: BSD 3-Clause License
+Copyright (c) <YEAR>, <OWNER>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+----------------------------------------------------------------------
+Software:paho.mqtt.c 1.3.1
+
+Copyright notice:
+Copyright (c) 2015 logi.cals GmbH
+Copyright (c) 2013, 2018 IBM Corp.
+Copyright (c) 2013, 2014 IBM Corp.
+Copyright (c) 2009, 2018 IBM Corp.
+Copyright (c) 2012, 2018 IBM Corp.
+Copyright (c) 2009, 2014 IBM Corp.
+Copyright (c) 2009, 2019 IBM Corp.
+Copyright (c) 2012, 2019 IBM Corp.
+Copyright (c) 2011, 2014 IBM Corp.
+Copyright (c) 2012, 2017 IBM Corp.
+Copyright (c) 2018 Wind River Systems, Inc. All Rights Reserved.
+Copyright (c) 2009, 2013 IBM Corp.
+Copyright (c) 2015, 2018 logi.cals GmbH and others
+&copy; Copyright IBM Corp. 2009, 2018
+Copyright (c) 2009, 2012 IBM Corp.
+Copyright (c) 2017, 2019 IBM Corp.
+Copyright (c) 2009, 2017 IBM Corp.
+Copyright (c) 2017, 2018 IBM Corp.
+Copyright (c) 2018 IBM Corp.
+Copyright (c) 2016, 2017 logi.cals GmbH
+Copyright (c) 2018, 2019 Wind River Systems, Inc. and others. All Rights Reserved.
+Copyright (c) 2015, 2019 logi.cals GmbH and others
+Copyright (c) 2015, 2017 logi.cals GmbH and others
+Copyright (c) 2012, 2018 IBM Corp., and others
+Copyright (c) 2012, 2019 IBM Corp., and others
+
+License: Eclipse Public License(EPL) V1.0
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT’S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+
+i)changes to the Program, and
+ii)additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor’s behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient’s responsibility to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor’s responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient’s patent(s), then such Recipient’s rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient’s rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient’s rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient’s obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+----------------------------------------------------------------------
+Software:cJSON 1.7.13
+
+Copyright notice:
+Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams
+Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
+Copyright (c) 2009-2019 Dave Gamble and cJSON contributors
+Copyright (c) 2010 James Grenning and Contributed to Unity Project
+Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
+Copyright (c) 2007 - 2017 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams
+Copyright 2014 The Authors
+Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de
+Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
+
+License: The MIT License
+The MIT License
+
+Copyright (c) <year> <copyright holders>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+----------------------------------------------------------------------
+Software:bounds_checking_function
+
+Copyright notice:
+Copyright (c) Huawei Technologies Co., Ltd. 2014-2020. All rights reserved.
+
+License: Mulan Permissive Software License,Version 2
+木兰宽松许可证, 第2版
+木兰宽松许可证, 第2版
+
+2020年1月 http://license.coscl.org.cn/MulanPSL2
+
+您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
+
+0.   定义
+
+“软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
+
+“贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
+
+“贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
+
+“法人实体” 是指提交贡献的机构及其“关联实体”。
+
+“关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
+
+1.   授予版权许可
+
+每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
+
+2.   授予专利许可
+
+每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
+
+3.   无商标许可
+
+“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
+
+4.   分发限制
+
+您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
+
+5.   免责声明与责任限制
+
+“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
+
+6.   语言
+
+“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
+
+条款结束
+
+如何将木兰宽松许可证,第2版,应用到您的软件
+
+如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
+
+1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
+
+2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
+
+3, 请将如下声明文本放入每个源文件的头部注释中。
+
+Copyright (c) [Year] [name of copyright holder]
+[Software Name] is licensed under Mulan PSL v2.
+You can use this software according to the terms and conditions of the Mulan PSL v2.
+You may obtain a copy of Mulan PSL v2 at:
+         http://license.coscl.org.cn/MulanPSL2
+THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+See the Mulan PSL v2 for more details.
+Mulan Permissive Software License,Version 2
+Mulan Permissive Software License,Version 2 (Mulan PSL v2)
+
+January 2020 http://license.coscl.org.cn/MulanPSL2
+
+Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
+
+0. Definition
+
+Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
+
+Contribution means the copyrightable work licensed by a particular Contributor under this License.
+
+Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
+
+Legal Entity means the entity making a Contribution and all its Affiliates.
+
+Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
+
+1. Grant of Copyright License
+
+Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
+
+2. Grant of Patent License
+
+Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
+
+3. No Trademark License
+
+No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4.
+
+4. Distribution Restriction
+
+You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
+
+5. Disclaimer of Warranty and Limitation of Liability
+
+THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+6. Language
+
+THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
+
+END OF THE TERMS AND CONDITIONS
+
+How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software
+
+To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
+
+Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
+Create a file named "LICENSE" which contains the whole context of this License in the first directory of your software package;
+Attach the statement to the appropriate annotated syntax at the beginning of each source file.
+Copyright (c) [Year] [name of copyright holder]
+[Software Name] is licensed under Mulan PSL v2.
+You can use this software according to the terms and conditions of the Mulan PSL v2.
+You may obtain a copy of Mulan PSL v2 at:
+         http://license.coscl.org.cn/MulanPSL2
+THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+See the Mulan PSL v2 for more details.
+

+ 179 - 0
device/bossay/hi3861_l0/sdk_liteos/README.md

@@ -0,0 +1,179 @@
+# Hi3861V100介绍<a name="ZH-CN_TOPIC_0000001054467126"></a>
+
+## 简介<a name="section469617221261"></a>
+
+Hi3861V100是一款高度集成的2.4GHz WiFi SoC芯片,集成IEEE 802.11b/g/n基带和RF电路,RF电路包括功率放大器PA、低 噪声放大器LNA、RF balun、天线开关以及电源管理等模块;支持20MHz标准带宽和5MHz/10MHz窄带宽,提供最大72.2Mbit/s 物理层速率。 Hi3861V100 WiFi基带支持正交频分复用(OFDM)技术,并向下兼容直接序列扩频(DSSS)和补码键控(CCK)技术,支 持IEEE 802.11 b/g/n协议的各种数据速率。 Hi3861V100芯片集成高性能32bit微处理器、硬件安全引擎以及丰富的外设接口,外设接口包括SPI、UART、I2C、PWM、 GPIO和多路ADC,同时支持高速SDIO2.0 Slave接口,最高时钟可达50MHz;芯片内置SRAM和Flash,可独立运行,并支持 在Flash上运行程序。 Hi3861V100芯片适应于智能家电等物联网智能终端领域。
+
+## 架构<a name="section15884114210197"></a>
+
+上海海思Hi3861系列的平台软件对应用层实现了底层屏蔽,并对应用软件直接提供API\(Application Programming Interface\)接口完成相应功能。典型的系统应用架构如下:
+
+**图 1**  系统应用框架图<a name="fig16620102217403"></a>  
+
+
+![](figures/zh-cn_image_0000001054797626.png)
+
+该框架可以分为以下几个层次:
+
+-   APP层:即应用层。SDK提供的代码示例在SDK的代码目录:app\\demo\\src。
+-   API层:提供基于SDK开发的通用接口。
+-   Platform平台层:提供SOC系统板级支持包,包括如下功能:
+    -   芯片和外围器件驱动
+    -   操作系统
+    -   系统管理
+
+-   Service服务层:提供包含WiFi等应用协议栈。用于上层应用软件进行数据收发等操作。
+-   第三方库:提供给Service服务层或提供给应用层使用的第三方软件库。
+
+## 特点<a name="section12212842173518"></a>
+
+**稳定、可靠的通信能力**
+
+-   支持复杂环境下 TPC、自动速率、弱干扰免疫等可靠性通信算法
+
+**灵活的组网能力**
+
+-   支持 256 节点 Mesh 组网
+-   支持标准 20M 带宽组网和 5M/10M 窄带组网
+
+**完善的网络支持**
+
+-   支持 IPv4/IPv6 网络功能
+-   支持 DHCPv4/DHCPv6 Client/Server
+-   支持 DNS Client 功能
+-   支持 mDNS 功能
+-   支持 CoAP/MQTT/HTTP/JSON 基础组件
+
+**强大的安全引擎**
+
+-   硬件实现 AES128/256 加解密算法
+-   硬件实现 HASH-SHA256、HMAC\_SHA256 算法
+-   硬件实现 RSA、ECC 签名校验算法
+-   硬件实现真随机数生成,满足 FIPS140-2 随机测试标准
+-   硬件支持 TLS/DTLS 加速
+-   内部集成 EFUSE,支持安全存储、安全启动、硬件 ID
+-   内部集成 MPU 特性,支持内存隔离特性
+
+**开放的操作系统**
+
+-   丰富的低功耗、小内存、高稳定性、高实时性机制
+-   灵活的协议支撑和扩展能力
+-   二次开发接口
+-   多层级开发接口:操作系统适配接口和系统诊断接口、 链路层接口、网络层接口
+
+## 目录<a name="section1464106163817"></a>
+
+SDK根目录结构如下图所示:
+
+<a name="table13927142512394"></a>
+<table><thead align="left"><tr id="row15927132514396"><th class="cellrowborder" valign="top" width="27.38%" id="mcps1.1.3.1.1"><p id="p11927325113916"><a name="p11927325113916"></a><a name="p11927325113916"></a>目录</p>
+</th>
+<th class="cellrowborder" valign="top" width="72.61999999999999%" id="mcps1.1.3.1.2"><p id="p1292722593913"><a name="p1292722593913"></a><a name="p1292722593913"></a>说明</p>
+</th>
+</tr>
+</thead>
+<tbody><tr id="row292882517399"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p159281025163910"><a name="p159281025163910"></a><a name="p159281025163910"></a>app</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p417918234"><a name="p417918234"></a><a name="p417918234"></a>应用层代码(其中包含demo程序为参考示例)。</p>
+</td>
+</tr>
+<tr id="row13791175961418"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p1279265920148"><a name="p1279265920148"></a><a name="p1279265920148"></a>boot</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p1579211591149"><a name="p1579211591149"></a><a name="p1579211591149"></a>Flash bootloader代码。</p>
+</td>
+</tr>
+<tr id="row19928225163913"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p2928122511393"><a name="p2928122511393"></a><a name="p2928122511393"></a>build</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p1192882518398"><a name="p1192882518398"></a><a name="p1192882518398"></a>SDK构建所需的库文件、链接文件、配置文件。</p>
+</td>
+</tr>
+<tr id="row12928225173915"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p199281425143911"><a name="p199281425143911"></a><a name="p199281425143911"></a>config</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p792802515395"><a name="p792802515395"></a><a name="p792802515395"></a>SDK系统配置文件。</p>
+</td>
+</tr>
+<tr id="row18928182533911"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p145973615257"><a name="p145973615257"></a><a name="p145973615257"></a>documents</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p41400225239"><a name="p41400225239"></a><a name="p41400225239"></a>文档目录(包括:SDK说明文档)。</p>
+</td>
+</tr>
+<tr id="row15928132512396"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p3928172518391"><a name="p3928172518391"></a><a name="p3928172518391"></a>include</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p0346235152311"><a name="p0346235152311"></a><a name="p0346235152311"></a>API头文件存放目录。</p>
+</td>
+</tr>
+<tr id="row971803313228"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p171813332218"><a name="p171813332218"></a><a name="p171813332218"></a>license</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p14718533192216"><a name="p14718533192216"></a><a name="p14718533192216"></a>SDK开源license声明</p>
+</td>
+</tr>
+<tr id="row15928192593911"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p12928182573915"><a name="p12928182573915"></a><a name="p12928182573915"></a>output</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p05488436238"><a name="p05488436238"></a><a name="p05488436238"></a>编译时生成的目标文件与中间文件(包括:库文件、打印log、生成的二进制文件等)。</p>
+</td>
+</tr>
+<tr id="row2050315115427"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p9503161154215"><a name="p9503161154215"></a><a name="p9503161154215"></a>platform</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p155032116427"><a name="p155032116427"></a><a name="p155032116427"></a>SDK平台相关的文件(包括:镜像、内核驱动模块等)。</p>
+</td>
+</tr>
+<tr id="row1783061594218"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p2083021554215"><a name="p2083021554215"></a><a name="p2083021554215"></a>third_party</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p15830715194212"><a name="p15830715194212"></a><a name="p15830715194212"></a>开源第三方软件目录。</p>
+</td>
+</tr>
+<tr id="row69981918194210"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p159981318154216"><a name="p159981318154216"></a><a name="p159981318154216"></a>tools</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p5998121854210"><a name="p5998121854210"></a><a name="p5998121854210"></a>SDK提供的Linux系统和Windows系统上使用的工具(包括:NV制作工具、签名工具、Menuconfig等)。</p>
+</td>
+</tr>
+<tr id="row415218166102"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p515281614109"><a name="p515281614109"></a><a name="p515281614109"></a>SConstruct</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p1615231614109"><a name="p1615231614109"></a><a name="p1615231614109"></a>SCons编译脚本。</p>
+</td>
+</tr>
+<tr id="row75842056117"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p2058415591118"><a name="p2058415591118"></a><a name="p2058415591118"></a>build.sh</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p558420511112"><a name="p558420511112"></a><a name="p558420511112"></a>启动编译脚本,同时支持“sh build.sh menuconfig”进行客制化配置。</p>
+</td>
+</tr>
+<tr id="row152262035269"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p42263352615"><a name="p42263352615"></a><a name="p42263352615"></a>build_patch.sh</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p1422613353614"><a name="p1422613353614"></a><a name="p1422613353614"></a>解压开源源码包和patch文件编译脚本。</p>
+</td>
+</tr>
+<tr id="row07472124410"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p1574821211416"><a name="p1574821211416"></a><a name="p1574821211416"></a>Makefile</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p126461354552"><a name="p126461354552"></a><a name="p126461354552"></a>支持makefile编译,使用“make”或“make all”启动编译。</p>
+</td>
+</tr>
+<tr id="row26011201747"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p1601420844"><a name="p1601420844"></a><a name="p1601420844"></a>non_factory.mk</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p14611201340"><a name="p14611201340"></a><a name="p14611201340"></a>非厂测版本编译脚本。</p>
+</td>
+</tr>
+<tr id="row17747172410413"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p974719241849"><a name="p974719241849"></a><a name="p974719241849"></a>factory.mk</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p87471724848"><a name="p87471724848"></a><a name="p87471724848"></a>厂测版本编译脚本。</p>
+</td>
+</tr>
+<tr id="row28411416998"><td class="cellrowborder" valign="top" width="27.38%" headers="mcps1.1.3.1.1 "><p id="p1842161613918"><a name="p1842161613918"></a><a name="p1842161613918"></a>NOTICE</p>
+</td>
+<td class="cellrowborder" valign="top" width="72.61999999999999%" headers="mcps1.1.3.1.2 "><p id="p58427168912"><a name="p58427168912"></a><a name="p58427168912"></a>第三方软件开源声明</p>
+</td>
+</tr>
+</tbody>
+</table>
+
+## 许可协议<a name="section1478215290"></a>
+
+-   Hi3861V100自研代码使用基于Apache License Version 2.0许可的hisi版权声明。许可信息和版权信息通常可以在代码开头看到:
+
+```
+  / *Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.Licensed under the Apache License,* ... * / 
+```
+
+-   Hi3861V100使用的第三方代码遵循软件版本自带的开源许可声明。
+-   将生成的库文件统一存放于根目录下的build/libs下。
+-   本软件中可能会使用一些开源软件组件。如果这些开源软件组件所适用的许可与本协议内容冲突,则以该开源软件组件的许可为准。
+

+ 556 - 0
device/bossay/hi3861_l0/sdk_liteos/SConstruct

@@ -0,0 +1,556 @@
+#!/usr/bin/env python3
+# coding=utf-8
+
+'''
+* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* Description: SCons build system entry.
+'''
+
+EnsureSConsVersion(3, 0, 1)
+EnsurePythonVersion(3, 7)
+
+import os
+import sys
+import datetime
+import atexit
+from distutils import dir_util
+sys.path.insert(0,os.path.join(os.getcwd(), 'build'))
+from scripts import common_env
+from scripts import scons_utils
+from scripts import scons_app
+from scripts import scons_env_cfg
+from scripts import pkt_builder
+from scripts.packet_create import packet_bin
+from tools.nvtool.build_nv import make_nv_bin
+import shutil
+
+#Init compile parameters
+env_cfg = scons_env_cfg.SconsEnvCfg()
+
+#Accept APP parameter
+app_name = ARGUMENTS.get('app', 'demo')
+factory_mode = ARGUMENTS.get('factory_mode', 'no')
+app_builder = scons_app.AppTarget(app_name, factory_mode)
+env_cfg.set_app_builder(app_builder)
+
+#Compile message output control
+if common_env.log_output_flag == False:
+    current = datetime.datetime.now()
+    if not os.path.exists(os.path.dirname(env_cfg.log_path)) or not os.path.exists(env_cfg.log_path):
+        os.makedirs(env_cfg.log_path)
+    log_file = os.path.join(env_cfg.log_path,'scons_trace.log')
+    old_stdout = sys.stdout
+    file = open(log_file, 'w+')
+    file.write("Building at %s %s\n" % (current.strftime('%Y/%m/%d'), current.strftime('%H:%M:%S')))
+    sys.stdout = file
+
+#Init environment
+env = Environment(ENV={'PATH':os.environ['PATH']},
+                  TARGET_PREFIX=env_cfg.target_name,)
+
+env_cfg.set_tools(env)
+env_cfg.set_environs(env)
+
+print('----------------------------top-----------------')
+#libraries to be built
+libs = [env.SConscript(os.path.join(env_cfg.get_module_dir(module), 'SConscript'), {'env':env, 'env_cfg':env_cfg, 'module':module},
+    variant_dir=os.path.join(env_cfg.lib_path, env_cfg.get_module_dir(module)), duplicate=0) for module in env_cfg.get_build_modules()]
+#Get settings
+env['LIBPATH'] = env_cfg.get_lib_path()
+
+if scons_utils.scons_usr_bool_option('CONFIG_TARGET_CHIP_HI3861') == 'y':
+    if scons_utils.scons_usr_bool_option('CONFIG_DIAG_SUPPORT') == 'y':
+        if factory_mode == 'yes':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861', 'debug', 'factory'))
+        elif scons_utils.scons_usr_bool_option('CONFIG_QUICK_SEND_MODE') == 'y':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861', 'debug', 'no_mesh_quick_start'))
+        elif scons_utils.scons_usr_bool_option('CONFIG_MESH_SUPPORT') == 'y':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861', 'debug', 'mesh'))
+        else:
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861', 'debug', 'no_mesh'))
+    else:
+        if factory_mode == 'yes':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861', 'release', 'factory'))
+        elif scons_utils.scons_usr_bool_option('CONFIG_QUICK_SEND_MODE') == 'y':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861', 'release', 'no_mesh_quick_start'))
+        elif scons_utils.scons_usr_bool_option('CONFIG_MESH_SUPPORT') == 'y':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861', 'release', 'mesh'))
+        else:
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861', 'release', 'no_mesh'))
+else:
+    if scons_utils.scons_usr_bool_option('CONFIG_DIAG_SUPPORT') == 'y':
+        if factory_mode == 'yes':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861l', 'debug', 'factory'))
+        elif scons_utils.scons_get_cfg_val('CONFIG_CHIP_PKT_48K') == 'y':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861l', 'debug', 'no_mesh_pkt_48k'))
+        elif scons_utils.scons_usr_bool_option('CONFIG_MESH_SUPPORT') == 'y':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861l', 'debug', 'mesh'))
+        else:
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861l', 'debug', 'no_mesh'))
+    else:
+        if factory_mode == 'yes':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861l', 'release', 'factory'))
+        elif scons_utils.scons_get_cfg_val('CONFIG_CHIP_PKT_48K') == 'y':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861l', 'release', 'no_mesh_pkt_48k'))
+        elif scons_utils.scons_usr_bool_option('CONFIG_MESH_SUPPORT') == 'y':
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861l', 'release', 'mesh'))
+        else:
+            env.Append(LIBPATH=os.path.join('-Lbuild', 'libs', 'hi3861l', 'release', 'no_mesh'))
+
+env.Append(LIBPATH=app_builder.get_app_lib_path())
+## wifiiot_app is the only one app for ohos
+if app_name != "wifiiot_app":
+    env['LIBS'] = list(map(lambda x:'-l%s'%x, env_cfg.get_libs()))
+else:
+    env['LIBS'] = list(map(lambda x:'-l%s'%x, env_cfg.get_libs())) + ['--whole-archive'] + list(map(lambda x:'-l%s'%x, env_cfg.get_ohos_libs())) + ['--no-whole-archive']
+env.Append(LIBS = app_builder.get_app_libs())
+env.Append(LIBS = '-lwifi_flash')
+env.Append(LIBS = '-lwifi')
+env.Append(LIBS = '-llitekernel_flash')
+env.Append(LIBS = '-lsystem')
+if scons_utils.scons_usr_bool_option('CONFIG_MESH_SUPPORT') == 'y':
+    if factory_mode != 'yes':
+        env.Append(LIBS = '-lmeshautolink')
+env['LIBS'] = sorted(env["LIBS"])
+env['LIBPATH'] = sorted(env["LIBPATH"])
+env['LINKFILE'] = env_cfg.link_file
+env['MAPFILE'] = env_cfg.map_file
+print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~libpath:',env['LIBPATH'])
+print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~libs:',env['LIBS'])
+
+#######################################################  LINK by Command  #######################################################
+
+# config by menuconfig
+signature = {
+    'RSA':{
+        0:0x0054d3c0, # factory startup addr:0x1E3000(HILINK_ADDR - 600K) = 0x14D000
+        'A':0x0040d3c0,
+        'B':0x004f13c0,
+    },
+    'ECC':{
+        0:0x0054d3c0, # factory startup addr:0x1E3000(HILINK_ADDR - 600K) = 0x14D000
+        'A':0x0040d3c0,
+        'B':0x004f13c0,
+    }
+}
+
+link_env = env.Clone()
+
+"""Build link script
+"""
+linker_builder = Builder(
+    action='$CC $LINK_SCRIPTS_FLAG -E $SOURCE -o $TARGET -P',
+    src_suffix='.ld.S'
+)
+
+"""Build elf file
+"""
+elf_builder = Builder(
+    action='$LINK $LINKFLAGS $LIBPATH -T$LINKFILE -Map=$MAPFILE -o $TARGET --start-group $LIBS --end-group',#--verbose
+    suffix='.out'
+)
+
+"""Build binary from .out file
+"""
+binary_builder = Builder(
+    action='$OBJCOPY -O binary $SOURCE $TARGET',
+    suffix='.bin',
+    src_suffix='.out'
+)
+
+"""Build asm file from binary
+"""
+asm_builder = Builder(
+    action='$OBJDUMP -d $SOURCE >$TARGET',
+    suffix='.asm',
+    src_suffix='.out'
+)
+
+"""Base image builder
+"""
+def baseimg_builder(target, source, env):
+    base_bin_target = str(target[0])
+    scons_utils.scons_bin_dd(str(source[0]), base_bin_target, seek=0, count=278)
+    env_cfg.base_bin_check(base_bin_target)
+    no_base_bin_target = str(target[1])
+    scons_utils.scons_bin_dd(str(source[0]), no_base_bin_target, skip=278)
+
+"""NV image builder
+"""
+def nvimg_builder(target, source, env):
+    if os.path.exists(env_cfg.nv_path) is False:
+        os.makedirs(env_cfg.nv_path)
+    make_nv_bin(env_cfg.nv_path, env_cfg.target_name, env_cfg.nv_cfg_name) #genrate nv first
+
+"""Combine NV image and kernel
+"""
+def nvkernel_builder(target, source, env):
+    factory_nv = str(source[0])
+    normal_nv = str(source[1])
+    no_base_bin_target = str(source[2])
+    nv_kernel_bin = str(target[0])
+    scons_utils.scons_bin_dd(factory_nv, nv_kernel_bin, seek=0, bs=4096, count=1)
+    scons_utils.scons_bin_dd(normal_nv, nv_kernel_bin, seek=2, bs=4096, count=1)
+    scons_utils.scons_bin_dd(no_base_bin_target, nv_kernel_bin, seek=4, bs=4096)
+
+factory_nv = os.path.join(env_cfg.nv_path, env_cfg.nv_factory_name)
+normal_nv = os.path.join(env_cfg.nv_path, env_cfg.nv_normal_name)
+#Build flashboot
+flash_boot_bin = env.SConscript(os.path.join('boot', 'flashboot', 'SConscript'), {'env':env, 'env_cfg':env_cfg, 'module':'boot'}, duplicate=0)
+#Build loaderboot
+loader_boot_bin = env.SConscript(os.path.join('boot', 'loaderboot', 'SConscript'), {'env':env, 'env_cfg':env_cfg, 'module':'loaderboot'}, duplicate=0)
+#ota object
+ota_flag = 1 if scons_utils.scons_usr_bool_option('CONFIG_COMPRESSION_OTA_SUPPORT') != 'y' else 0
+ota_build_object = pkt_builder.ImageBuild(env_cfg.target_name, ota_mode=ota_flag)
+def init_ota_build_object(ota_build_object):
+    ota_build_object.set_pkt_path(env_cfg.bin_path)
+    ota_build_object.set_src_path(boot_bin_path=str(flash_boot_bin[0]), normal_nv_path=normal_nv, factory_nv_path=factory_nv)
+    ota_build_object.set_chip_product_name(env.get("CHIP_TYPE"))
+
+def get_ota_object():
+    return ota_build_object
+
+def get_secure_boot():
+    if (scons_utils.scons_usr_bool_option('CONFIG_TARGET_SIG_SHA256') == 'y'):
+        return False
+    else:
+        return True;
+
+def get_hilink_enable():
+    if (scons_utils.scons_usr_bool_option('CONFIG_HILINK') == 'y'):
+        return True
+    else:
+        return False;
+
+def get_sign_dict():
+    sig = ''
+    if scons_utils.scons_usr_bool_option('CONFIG_TARGET_SIG_RSA_V15') == 'y':
+        sig = 'RSA'
+        get_ota_object().set_sign_alg(0x0)
+    elif scons_utils.scons_usr_bool_option('CONFIG_TARGET_SIG_RSA_PSS') == 'y':
+        sig = 'RSA'
+        get_ota_object().set_sign_alg(0x1)
+    elif scons_utils.scons_usr_bool_option('CONFIG_TARGET_SIG_ECC') == 'y':
+        sig = 'ECC'
+        get_ota_object().set_sign_alg(0x10)
+    elif scons_utils.scons_usr_bool_option('CONFIG_TARGET_SIG_SHA256') == 'y':
+        sig = 'ECC'
+        get_ota_object().set_sign_alg(0x3F)
+    if sig not in signature:
+        raise scons_utils.SconsBuildError("%s============== <%s> SIGNATURE SETTING NULL =============%s"%(scons_utils.colors['red'], sig, scons_utils.colors['end']))
+    return signature[sig]
+
+init_ota_build_object(ota_build_object)
+sign_dict = get_sign_dict()    #signature mode configuration
+
+def ota_builder(target, source, env):
+    """Build upg binary
+    """
+    get_ota_object().set_encrypt_flag(0x42)
+    if scons_utils.scons_usr_bool_option('CONFIG_FLASH_ENCRYPT_SUPPORT') == 'y':
+        get_ota_object().set_file_attr_encrypt(0x2)
+    else:
+        get_ota_object().set_file_attr_encrypt(0x1)
+    if scons_utils.scons_usr_bool_option('CONFIG_COMPRESSION_OTA_SUPPORT') == 'y':
+        get_ota_object().set_kernel_file_attr_ota(0x4)
+        get_ota_object().set_kernel_max_size(0) #(912+972)KB
+    else:
+        get_ota_object().set_kernel_file_attr_ota(env['SIGN'])
+        get_ota_object().set_kernel_max_size(env['SIGN']) #912 or 972KB
+        if scons_utils.scons_usr_bool_option('CONFIG_FLASH_ENCRYPT_SUPPORT') == 'y':
+            get_ota_object().set_encrypt_flag(0xFF)
+    get_ota_object().set_src_path(kernel_bin_path=str(source[1]))
+    get_ota_object().BuildUpgBin(str(target[0]))
+
+    return 0
+
+def factory_builder(target, source, env):
+    """Build factory binary
+    """
+    get_ota_object().set_encrypt_flag(0x42)
+    if scons_utils.scons_usr_bool_option('CONFIG_FLASH_ENCRYPT_SUPPORT') == 'y':
+        get_ota_object().set_file_attr_encrypt(0x2)
+    else:
+        get_ota_object().set_file_attr_encrypt(0x1)
+    get_ota_object().set_kernel_file_attr_ota('A') # same as kernel A.
+    get_ota_object().set_kernel_max_size(0x4) #0x4 means __factory_bin_max_size:600K
+    get_ota_object().set_src_path(kernel_bin_path=str(source[1]))
+    get_ota_object().BuildUpgBurnBin(str(target[0]))
+
+    factory_bin_path = os.path.join('build', 'libs', 'factory_bin')
+    if not os.path.exists(factory_bin_path):
+        os.makedirs(factory_bin_path)
+    shutil.rmtree(factory_bin_path)
+    shutil.copytree(env_cfg.bin_path, factory_bin_path, False) #copy factory bin output to build/libs temply.
+
+    return 0
+
+def burn_bin_builder(target, source, env):
+    """Build binary
+    """
+    get_ota_object().set_build_temp_path(build_temp_path = env_cfg.cache_path)
+    burn_bin = get_ota_object().BuildHiburnBin(str(target[0]), str(source[0]))
+    loader_bin = str(source[1])
+    efuse_bin = str(source[2]) if len(source) == 3 else None
+    boot_b = os.path.join('output', 'bin', '%s_boot_signed_B.bin'%(env.get('CHIP_TYPE')))
+    boot_b_size = os.path.getsize(boot_b)
+    factory_bin_path = os.path.join('build', 'libs', 'factory_bin')
+    factory_bin = os.path.join(factory_bin_path, '%s_factory.bin'%env_cfg.target_name)
+    burn_for_erase_bin = os.path.join('build', 'basebin', 'burn_for_erase_4k.bin')
+    #证书安全存储示例
+    tee_cert1_file = os.path.join('build', 'basebin', 'tee_cert1.bin');
+    tee_cert2_file = os.path.join('build', 'basebin', 'tee_cert2.bin');
+    tee_key_file = os.path.join('build', 'basebin', 'tee_key.bin');
+    tee_cert_key_bin_max = 12*1024; #必须为4KB证书倍,需匹配分区表确定烧写地址和大小
+    tee_total_file_cnt = 3; #3个文件:2个证书,1个key。
+    burn_tee_cert = False
+    if ((os.path.exists(tee_cert1_file)) and (os.path.exists(tee_cert2_file)) and (os.path.exists(tee_key_file))):
+        burn_tee_cert = True
+
+    version_bin = bytearray(8)
+    boot_ver = get_ota_object().get_flashboot_file_ver()
+    kernel_ver = get_ota_object().get_kernel_file_ver()
+    boot_ver_bytes = boot_ver.to_bytes(4, byteorder = 'little', signed = True)
+    kernel_ver_bytes = kernel_ver.to_bytes(4, byteorder = 'little', signed = True)
+    version_bin[0:4] = boot_ver_bytes
+    version_bin[4:8] = kernel_ver_bytes
+    version_file = os.path.join("output", "bin", '%s_vercfg.bin'%env_cfg.target_name)
+    with open(version_file, 'wb+') as fp:
+        fp.write(version_bin)
+
+    burn_bin_ease_size = 0x200000;
+    #根据分区表适配烧写地址和大小
+    if (get_hilink_enable() == True):
+        burn_bin_ease_size = 0x200000 - 0x8000 - 0x1000 - 0x2000
+    if (burn_tee_cert == True):
+        burn_bin_ease_size = 0x200000 - 0x8000 - 0x1000 - 0x2000 - 0x5000
+
+    if os.path.exists(factory_bin):
+        cmd_list = ['%s|0|0|0'%loader_bin, '%s|0|0|3'%efuse_bin, '%s|0|%d|1'%(burn_bin, burn_bin_ease_size), '%s|%d|%d|6'%(factory_bin, 0x14D000, 0x96000)] if efuse_bin!=None else ['%s|0|0|0'%loader_bin, '%s|0|%d|1'%(burn_bin, burn_bin_ease_size), '%s|%d|%d|6'%(factory_bin, 0x14D000, 0x96000),]
+        shutil.copytree(factory_bin_path, os.path.join(env_cfg.bin_path, 'factory_bin'))
+    else:
+        cmd_list = ['%s|0|0|0'%loader_bin, '%s|0|0|3'%efuse_bin, '%s|0|%d|1'%(burn_bin, burn_bin_ease_size)] if efuse_bin!=None else ['%s|0|0|0'%loader_bin, '%s|0|%d|1'%(burn_bin, burn_bin_ease_size)]
+
+    if ((get_hilink_enable() == True) or (burn_tee_cert == True)):
+        cmd_list.append('%s|%d|%d|1'%(burn_for_erase_bin, 0x200000 - 0x8000 - 0x1000, 0x1000))
+
+    #cmd_list.append('%s|%d|%d|1'%(boot_b, 0x200000 - boot_b_size, boot_b_size));
+
+    if (burn_tee_cert == True):
+        cert_key_bin = bytearray(tee_cert_key_bin_max)
+        tee_cert1_size = os.path.getsize(tee_cert1_file)
+        tee_cert2_size = os.path.getsize(tee_cert2_file)
+        tee_key_size = os.path.getsize(tee_key_file)
+        total_cert_key_size = tee_cert1_size + tee_cert2_size + tee_key_size
+        if (total_cert_key_size > tee_cert_key_bin_max - 4 - 4 - 4*tee_total_file_cnt):
+            print ("%s============== cert total len bigger than %d=============%s"%(scons_utils.colors['red'], total_cert_key_size,scons_utils.colors['end']))
+            return -1
+        else:
+            with open(tee_cert1_file, 'rb') as fp:
+                tee_cert1_bin = fp.read()
+            with open(tee_cert2_file, 'rb') as fp:
+                tee_cert2_bin = fp.read()
+            with open(tee_key_file, 'rb') as fp:
+                tee_key_bin = fp.read()
+
+            #填充头部结构
+            start_flag = 0xDEADBEEF
+            start_flag_bytes = start_flag.to_bytes(4, byteorder = 'little', signed = False)
+            cert_key_bin[0:4] = start_flag_bytes #填充魔术字
+            tee_total_file_cnt_bytes = tee_total_file_cnt.to_bytes(4, byteorder = 'little', signed = True)
+            cert_key_bin[4:8] = tee_total_file_cnt_bytes #填充总的文件数
+            #填充各文件的大小
+            cert_key_bin[8:12] = tee_cert1_size.to_bytes(4, byteorder = 'little', signed = True)
+            cert_key_bin[12:16] = tee_cert2_size.to_bytes(4, byteorder = 'little', signed = True)
+            cert_key_bin[16:20] = tee_key_size.to_bytes(4, byteorder = 'little', signed = True)
+            #填充各文件
+            cert_key_bin[20:20 + tee_cert1_size] = tee_cert1_bin
+            cert_key_bin[20 + tee_cert1_size:20 + tee_cert1_size + tee_cert2_size] = tee_cert2_bin
+            cert_key_bin[20 + tee_cert1_size + tee_cert2_size:20 + tee_cert1_size + tee_cert2_size + tee_key_size] = tee_key_bin
+            #写文件
+            cert_bin_file = os.path.join("output", "bin", '%s_tee_cert_key.bin'%env_cfg.target_name)
+            with open(cert_bin_file, 'wb+') as fp:
+                fp.write(cert_key_bin)
+            cmd_list.append('%s|%d|%d|1'%(cert_bin_file, 0x200000 - 0x8000 - 0x1000 - 0x2000 - 0x5000, tee_cert_key_bin_max))
+
+    if (get_secure_boot() == True): #only need write ver file in secure boot mode.
+        cmd_list.append('%s|0|0|7'%version_file)
+
+    packet_bin(str(target[1]), cmd_list)
+    if os.path.exists(factory_bin_path):
+        shutil.rmtree(factory_bin_path)
+    return 0
+
+def compress_ota_builder(target, source, env):
+    """Build compressed upgrade file
+    """
+    get_ota_object().set_encrypt_flag(0x42)
+    if scons_utils.scons_usr_bool_option('CONFIG_FLASH_ENCRYPT_SUPPORT') == 'y':
+        get_ota_object().set_file_attr_encrypt(0x2)
+        get_ota_object().set_encrypt_flag(0xFF)
+    else:
+        get_ota_object().set_file_attr_encrypt(0x1)
+    get_ota_object().set_kernel_file_attr_ota(0x4)
+    get_ota_object().set_build_temp_path(build_temp_path = env_cfg.cache_path)
+    compress_ota = get_ota_object().BuildCompressUpgBin(str(target[0]), str(source[0]))
+    return 0
+
+def boot_ota_builder(target, source, env):
+    """Build boot ota
+    """
+    if scons_utils.scons_usr_bool_option('CONFIG_FLASH_ENCRYPT_SUPPORT') == 'y':
+        get_ota_object().set_file_attr_encrypt(0x2)
+    else:
+        get_ota_object().set_file_attr_encrypt(0x1)
+    if scons_utils.scons_usr_bool_option('CONFIG_COMPRESSION_OTA_SUPPORT') == 'y':
+        get_ota_object().set_flashboot_file_attr_ota(0x4)
+    else:
+        get_ota_object().set_flashboot_file_attr_ota(0x3)
+    get_ota_object().set_encrypt_flag(0x42)
+    boot_ota = get_ota_object().BuildUpgBoot(str(target[0]))
+    return 0
+
+#Builders
+link_env.Append(BUILDERS={'LinkFile':linker_builder,
+    'Elf':elf_builder,
+    'Binary':binary_builder,
+    'Asm':asm_builder,
+    'BaseImg':Builder(action=baseimg_builder),
+    'NVKernel':Builder(action=nvkernel_builder),
+    'BootOta':Builder(action=boot_ota_builder),
+    'OtaImg':Builder(action=ota_builder),
+    'FactoryImg':Builder(action=factory_builder),
+    'BurnImg':Builder(action=burn_bin_builder),
+    'CompressOtaImg':Builder(action = compress_ota_builder),
+})
+
+def build_all(build_env, link_sys, flash_boot_bin, loader_boot_bin):
+    """Processing build
+    """
+
+    #kernel_ver
+    kernel_ver = scons_utils.scons_usr_int_option('CONFIG_TARGET_KERNEL_VER')
+    if (kernel_ver < 0 or kernel_ver > 48):
+        raise scons_utils.SconsBuildError("%s============== kernel_ver invalied, should be 0-48 =============%s"%(scons_utils.colors['red'], scons_utils.colors['end']))
+    else:
+        get_ota_object().set_kernel_file_ver(kernel_ver)
+
+    #boot_ver
+    boot_ver = scons_utils.scons_usr_int_option('CONFIG_TARGET_BOOT_VER')
+    if (boot_ver < 0 or boot_ver > 16):
+        raise scons_utils.SconsBuildError("%s============== boot_ver invalied, should be 0-16 =============%s"%(scons_utils.colors['red'], scons_utils.colors['end']))
+    else:
+        get_ota_object().set_flashboot_file_ver(boot_ver)
+
+    #images container, insert boot ota at first
+    imgs = [build_env.BootOta(target=os.path.join(env_cfg.bin_path, '%s_flash_boot_ota.bin'%env_cfg.target_name), source=flash_boot_bin)]
+    for sig_key in sign_dict:
+        if sig_key == 0 and factory_mode != 'yes':
+            continue
+        sign_build = build_env.Clone()
+        sign_build['SIGN'] = sig_key
+        name_suffix = '_%s'%sig_key
+        if sig_key == 0:
+            name_suffix = '_factory'
+            ota_file = os.path.join(env_cfg.bin_path, '%s%s.bin'%(env_cfg.target_name, name_suffix))
+        elif scons_utils.scons_usr_bool_option('CONFIG_COMPRESSION_OTA_SUPPORT') == 'y':
+            name_suffix = ''
+            ota_file = os.path.join(env_cfg.cache_path, '%s_ota_%s.bin'%(env_cfg.target_name, 'temp')) #tmp file
+        else:
+            ota_file = os.path.join(env_cfg.bin_path, '%s_ota%s.bin'%(env_cfg.target_name, name_suffix))
+
+        sign_build['LINKFILE'] = os.path.join(env_cfg.link_path, 'link%s.lds'%name_suffix)
+        sign_build['MAPFILE'] = '%s%s.map'%(sign_build['MAPFILE'][:-len('.map')], name_suffix)
+        sign_build.Append(LINK_SCRIPTS_FLAG = '-DFLASH_FIRM_START=%s'%sign_dict[sig_key])
+
+        link_risc = sign_build.LinkFile(source=os.path.join('build', 'link', 'link'),
+                                        target='$LINKFILE')
+        sign_build.Depends(link_risc, link_sys)
+        #start
+        target_out = sign_build.Elf(source = libs, target = os.path.join(env_cfg.bin_path, '%s%s.out'%(env_cfg.target_name, name_suffix)))
+        sign_build.Depends(target_out, [link_risc, libs])
+        target_out_bin = sign_build.Binary(source = target_out, target = os.path.join(env_cfg.cache_path, '%s%s'%(env_cfg.target_name, name_suffix)))
+        target_asm = sign_build.Asm(source = target_out, target=os.path.join(env_cfg.bin_path, '%s%s.asm'%(env_cfg.target_name, name_suffix)))
+
+        base_bin_target = os.path.join(env_cfg.cache_path, '%s_base%s.bin'%(env_cfg.target_name, name_suffix))
+        kernel_bin_target = os.path.join(env_cfg.cache_path, '%s_kernel%s.bin'%(env_cfg.target_name, name_suffix))
+
+        #Build kernel and ota
+        kernel = sign_build.BaseImg(source=target_out_bin, target=[base_bin_target, kernel_bin_target])
+        if factory_mode == 'yes':
+            ota_bin = sign_build.FactoryImg(source=kernel, target=ota_file)
+        else:
+            ota_bin = sign_build.OtaImg(source=kernel, target=ota_file)
+        imgs.append(ota_bin)
+        sign_build.AddPostAction(kernel, scons_utils.cleanup) #hook clean
+        if sig_key == 'A': #need signature
+            loader_bin = os.path.join('#', env_cfg.bin_path, '%s_loader_signed.bin'%(env.get('CHIP_TYPE')))
+            efuse_bin = os.path.join('build', 'basebin', 'efuse_cfg.bin')
+            burn_bin = os.path.join(env_cfg.bin_path, '%s_burn.bin'%env_cfg.target_name)
+            allinone_bin = os.path.join(env_cfg.bin_path, '%s_allinone.bin'%env_cfg.target_name)
+            burn_bins = sign_build.BurnImg(source=[ota_bin, loader_bin, efuse_bin] if os.path.exists(efuse_bin) else [ota_bin, loader_bin],
+                                           target=[burn_bin, allinone_bin])
+            imgs.append(burn_bins)
+        #mark binaries to be built everytime
+        if sig_key in ['A', 'B']:
+            sign_build.AlwaysBuild([link_risc, target_out, target_out_bin, target_asm, kernel, ota_bin, burn_bins])
+        if scons_utils.scons_usr_bool_option('CONFIG_COMPRESSION_OTA_SUPPORT') == 'y' and sig_key == 'A':
+            compress_ota_bin = os.path.join(env_cfg.bin_path, '%s_ota.bin'%env_cfg.target_name)
+            compress_ota_file = sign_build.CompressOtaImg(source = ota_bin, target = compress_ota_bin)
+            break
+        if sig_key == 0:
+            break
+    return imgs
+
+link_env.AddMethod(build_all, 'BUILD')
+#prepare link script
+link_sys = link_env.LinkFile(source=os.path.join('build', 'link', 'system_config'),
+                             target=os.path.join(env_cfg.link_path, 'system_config.ld'))
+link_env.Depends(link_sys, [flash_boot_bin, loader_boot_bin])
+link_env.AddPostAction(link_sys, nvimg_builder) #prepare nv image
+
+# START LINK
+target_img = link_env.BUILD(link_sys, flash_boot_bin, loader_boot_bin)
+link_env.AlwaysBuild([target_img, link_sys])
+Clean(target_img, env_cfg.clean_list)
+#######################################################  LINK  #######################################################
+
+#######################################################  BUILD CHECK  #######################################################
+
+def build_status():
+    bf = GetBuildFailures()
+    status = 0
+    failures_message = ''
+    if bf:
+        status = -1
+        failures_message = "\n".join(["Failed building %s" % scons_utils.bf_to_str(x) for x in bf if x is not None])
+    return (status, failures_message)
+
+def display_build_status():
+    if env.GetOption("clean"):
+        return
+    status, failures_message = build_status()
+    if status == 0:
+        scons_utils.show_burn_tips()
+    else:
+        scons_utils.show_alert("BUILD FAILED!!!!")
+        scons_utils.show_alert(failures_message)
+
+atexit.register(display_build_status)
+
+if common_env.log_output_flag == False:
+    file.close() #close log file handler
+    sys.stdout = old_stdout
+

+ 49 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/Makefile

@@ -0,0 +1,49 @@
+# Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+include $(MAIN_TOPDIR)/build/make_scripts/config.mk
+-include $(MAIN_TOPDIR)/$(MODULE_DIR)/srcs.mk
+include $(MAIN_TOPDIR)/$(MODULE_DIR)/module_config.mk
+
+OBJDIR = $(MAIN_TOPDIR)/$(OBJ_PATH)/$(MODULE_DIR)
+
+ID_CFG_FILE = $(MAIN_TOPDIR)/$(MODULE_DIR)/file_id.cfg
+
+LIB_NAME = lib$(LIB).a
+SRCS = $($(LIB)_srcs)
+LIBOUT = $(MAIN_TOPDIR)/$(LIB_PATH)/$(MODULE_DIR)/$(LIB_NAME)
+
+ifdef SRC_FILES
+OBJ_SRCS := $(filter %.c, $(SRC_FILES))
+ASM_SRCS := $(filter %.S, $(SRC_FILES))
+else
+OBJ_SRCS := $(foreach dir, $(SRCS), $(wildcard $(dir)/*.c))
+ASM_SRCS := $(foreach dir, $(SRCS), $(wildcard $(dir)/*.S ))
+endif
+
+OBJ_SRCS := $(filter-out %/ethernetif.c, $(OBJ_SRCS))
+OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(OBJ_SRCS))
+ASM_OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(ASM_SRCS))
+
+all: $(LIBOUT)
+include $(MAIN_TOPDIR)/build/make_scripts/lib.mk
+
+clean:
+	$(Q)$(foreach x, $(OBJS) $(ASM_OBJS) $(LIBOUT), \
+	if [ -d $(dir $x) ]; \
+	then $(RM) $(dir $x); \
+	echo clean dir $(dir $x) success; \
+	fi;)
+
+.PHONY: all clean
+

+ 39 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/SConscript

@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+# coding=utf-8
+#
+# Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import os
+from scripts import common_env
+Import('env')
+Import('env_cfg')
+Import('module')
+
+module_path = env_cfg.get_module_dir(module)
+obj_path = env_cfg.obj_path
+module_libs = env_cfg.get_module_libs(module)
+libs = []
+
+env = env.Clone()
+env_cfg.append_environs(env, module)
+common_env.print_log_env(env, env_cfg.get_module_dir(module))
+
+for lib in module_libs:
+    print('lib_name:',lib)
+    src_path = module_libs[lib]
+    objs = []
+    for src in src_path:
+        objs += env.SConscript(os.path.join(src, 'SConscript'), {'env':env}, variant_dir = os.path.join('#', obj_path, module_path, src), duplicate = 0)
+    libs += env.Library(lib,objs)
+Return('libs')

+ 31 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/app.json

@@ -0,0 +1,31 @@
+{
+    "TARGET_LIB": "demo",
+    "APP_SRCS": [
+        "init",
+        "src"
+    ],
+    "INCLUDE": [
+        "components/iperf2/include",
+        "app/demo/include",
+        "app/demo/init",
+        "app/demo/src",
+        "config/app",
+        "config/diag",
+        "platform/os/Huawei_LiteOS/net/ripple/exports",
+        "components/ripple/exports",
+        "components/hilink/include",
+        "third_party/mbedtls/include/mbedtls/"
+    ],
+    "CC_FLAGS": [
+    ],
+    "DEFINES": [
+        "_PRE_WLAN_FEATURE_CSI",
+        "_PRE_WLAN_FEATURE_P2P",
+        "LWIP_ENABLE_DIAG_CMD=0"
+    ],
+    "AR_FLAGS": [],
+    "LD_FLAGS": [],
+    "AS_FLAGS": [],
+    "LD_DIRS": [],
+    "CLEAN": []
+}

+ 33 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_adc.h

@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_ADC_H__
+#define __APP_DEMO_ADC_H__
+
+#include <hi_types_base.h>
+
+#define APP_DEMO_ADC
+#ifdef APP_DEMO_ADC
+
+#include <hi_adc.h>
+#include <hi_stdlib.h>
+#include <hi_early_debug.h>
+
+#define ADC_TEST_LENGTH  128
+#define VLT_MIN 100
+
+hi_void app_demo_adc_test(hi_void);
+#endif
+#endif

+ 38 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_efuse.h

@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_EFUSE_H__
+#define __APP_DEMO_EFUSE_H__
+
+#include <hi_types_base.h>
+
+#include <hi_early_debug.h>
+#include <hi_efuse.h>
+
+#define EFUSE_USR_RW_SAMPLE_BUFF_MAX_LEN 2 /* The efuse customer_rsvd0 length is 64 bits.
+                                              Two 32-bit space is required for storing read and write data. */
+
+hi_u32 get_efuse_id_size_test(hi_void);
+hi_void efuse_get_lock_stat(hi_void);
+hi_u32 efuse_usr_read(hi_void);
+hi_u32 efuse_usr_write(hi_void);
+hi_u32 efuse_usr_lock(hi_void);
+hi_u32 sample_usr_efuse(hi_void);
+hi_u32 efuse_id_read(hi_void);
+hi_u32 efuse_id_write(hi_void);
+hi_u32 efuse_id_lock(hi_void);
+hi_u32 sample_id_efuse(hi_void);
+hi_void efuse_demo(hi_void);
+#endif

+ 35 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_flash.h

@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_FLASH_H__
+#define __APP_DEMO_FLASH_H__
+
+#include <hi_types_base.h>
+
+#ifdef TEST_KERNEL_FLASH
+
+#include <hi_flash.h>
+#include <hi_task.h>
+#include <hi_stdlib.h>
+#include <hi_watchdog.h>
+#include <hi_early_debug.h>
+#include <hi_time.h>
+
+#define TEST_SIZE 0x1000
+#define TEST_FLASH_OFFSET 0x1FF000
+
+hi_void cmd_test_flash(hi_u32 test_time, hi_u32 test_mode);
+#endif
+#endif

+ 36 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_i2c.h

@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_I2C_H__
+#define __APP_DEMO_I2C_H__
+
+#include <hi_types_base.h>
+#include <hi_i2c.h>
+#include <hi_early_debug.h>
+#include <hi_stdlib.h>
+
+#define I2C_REG_ARRAY_LEN 64
+#define ES8311_DEV_ADDR 0x30          /* 11000 0 */
+#define ES8311_REG_ADDR 0x10
+#define I2C_SEND_LEN_2  2
+#define I2C_RECV_LEN_1  1
+
+hi_void i2c_demo_send_data_init(hi_void);
+hi_u32 i2c_demo_write(hi_i2c_idx id, hi_u16 device_addr, hi_u32 send_len);
+hi_u32 i2c_demo_writeread(hi_i2c_idx id, hi_u16 device_addr, hi_u32 recv_len);
+hi_void i2c_demo(hi_i2c_idx id);
+hi_void app_demo_custom_i2c(hi_void);
+
+#endif

+ 53 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_i2s.h

@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_I2S_H__
+#define __APP_DEMO_I2S_H__
+
+#include <hi_types_base.h>
+#include <hi_errno.h>
+#include <hi_mem.h>
+#include <hi_event.h>
+#include <hi_time.h>
+#include <hi_task.h>
+#include <hi_early_debug.h>
+#include <hi_config.h>
+#include <hi_stdlib.h>
+#include <hi_i2s.h>
+#include <hi_i2c.h>
+#include <hi_flash.h>
+#include <es8311_codec.h>
+#define I2S_TEST_TASK_STAK_SIZE     2048
+#define I2S_TEST_TASK_PRIORITY      28
+#define AUDIO_PLAY_BUF_SIZE         4096
+#define AUDIO_RECORD_BUF_SIZE       3072
+#define AUDIO_RECORD_FINISH_BIT     (1 << 0)
+#define ALL_AUDIO_RECORD_FINISH_BIT (1 << 1)
+
+#define AUDIO_PLAY_FIEL_MODE         0
+#define AUDIO_RECORD_AND_PLAY_MODE   1
+
+typedef struct {
+    hi_u32 flash_start_addr;
+    hi_u32 data_len;
+} audio_map;
+
+typedef struct {
+    hi_u8 *play_buf;
+    hi_u8 *record_buf;
+} test_audio_attr;
+
+hi_void i2s_demo(hi_void);
+#endif

+ 31 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_io_gpio.h

@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_IO_GPIO_H__
+#define __APP_DEMO_IO_GPIO_H__
+
+#include <hi_types_base.h>
+#include <hi_io.h>
+#include <hi_early_debug.h>
+#include <hi_gpio.h>
+#include <hi_task.h>
+
+/* gpio callback func */
+hi_void gpio_isr_func(hi_void *arg);
+hi_void io_gpio_demo(hi_void);
+/* gpio callback demo */
+hi_void gpio_isr_demo(hi_void);
+hi_void app_demo_custom_io_gpio(hi_void);
+#endif

+ 45 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_nv.h

@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_NV_H__
+#define __APP_DEMO_NV_H__
+
+#include <hi_types_base.h>
+#include <hi_stdlib.h>
+#include <hi_early_debug.h>
+#include <hi_nv.h>
+#include <hi_flash.h>
+#include <hi_partition_table.h>
+
+#define  HI_NV_DEMO_RST_CFG_ID  0x22
+#define  HI_FACTORY_NV_DEMO_ID  0x1
+
+typedef struct {
+    hi_u32 nv_demo_test_num0;
+    hi_u32 nv_demo_test_num1;
+    hi_u32 nv_demo_test_num2;
+    hi_u32 nv_demo_test_num3;
+} hi_nv_demo_tset_cfg;
+
+typedef struct {
+    hi_s32 nv_factory_demo_test_num0;
+    hi_s32 nv_factory_demo_test_num1;
+    hi_s32 nv_factory_demo_test_num2;
+} hi_factory_nv_demo_tset_cfg;
+
+hi_void nv_demo(hi_void);
+hi_void factory_nv_demo(hi_void);
+
+#endif

+ 25 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_pwm.h

@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_PWM_H__
+#define __APP_DEMO_PWM_H__
+
+#include <hi_types_base.h>
+#include <hi_early_debug.h>
+#include <hi_pwm.h>
+#include <app_demo_pwm.h>
+
+hi_void app_demo_pwm(hi_void);
+#endif

+ 86 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_spi.h

@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_SPI_H__
+#define __APP_DEMO_SPI_H__
+
+#include <hi_types_base.h>
+#include <hi3861_platform.h>
+#include <hi_task.h>
+#include <hi_stdlib.h>
+#include <hi_early_debug.h>
+#include <hi_time.h>
+#include <hi_watchdog.h>
+#include <hi_io.h>
+#include <hi_spi.h>
+
+#define BUF_LENGTH       512
+#define BUF_LENGTH_HALF (BUF_LENGTH >> 1)
+#define TEST_LOOP_LENGTH 256
+#define test_spi_printf(fmt...)     \
+    do {                            \
+        printf("[SPI TEST]" fmt); \
+        printf("\n");     \
+    } while (0)
+
+#ifndef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+typedef struct {
+    hi_spi_cfg_basic_info cfg_info;
+    hi_spi_idx spi_id;
+    hi_u32 loop;
+    hi_u32 length;
+    hi_bool irq;
+    hi_bool slave;
+    hi_bool lb;
+    hi_bool dma_en;
+} test_spi_para;
+
+typedef enum {
+    TEST_CASE_ALL,
+    TEST_CASE_POL0_PHA0 = 1,
+    TEST_CASE_POL0_PHA1,
+    TEST_CASE_POL1_PHA0,
+    TEST_CASE_POL1_PHA1,
+    TEST_CASE_MOTOROLA,
+    TEST_CASE_TI,
+    TEST_CASE_BIT4,
+    TEST_CASE_BIT7,
+    TEST_CASE_BIT8,
+    TEST_CASE_BIT9 = 10,
+    TEST_CASE_BIT15,
+    TEST_CASE_BIT16,
+    TEST_CASE_CLK_MIN,
+    TEST_CASE_CLK_16,
+    TEST_CASE_CLK_50,
+    TEST_CASE_CLK_100,
+    TEST_CASE_CLK_200,
+    TEST_CASE_CLK_MAX,
+    TEST_CASE_PARAMETER_WRONG,
+    TEST_CASE_SLAVE = 20,
+    TEST_CASE_MASTER,
+    TEST_CASE_MAX,
+} hi_spi_test_case;
+
+hi_u32 app_demo_spi_para_test(hi_spi_cfg_basic_info *spi_para);
+hi_u32 app_demo_spi_test_case(hi_u8 test_case);
+hi_void app_demo_spi_test(hi_spi_idx spi_id, hi_u32 irq_en, hi_u32 test_case, hi_u32 loop);
+hi_void app_demo_spi_cmd_host_read(hi_spi_idx spi_id, hi_u32 length, hi_u32 loop);
+hi_void app_demo_spi_cmd_slave_write(hi_spi_idx spi_id, hi_u32 length, hi_u32 loop);
+hi_void app_demo_spi_cmd_host_write(hi_spi_idx spi_id, hi_u32 length, hi_u32 loop);
+hi_void app_demo_spi_cmd_slave_read(hi_spi_idx spi_id, hi_u32 length, hi_u32 loop);
+#endif

+ 37 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_timer_systick.h

@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_TIMER_SYSTICK_H__
+#define __APP_DEMO_TIMER_SYSTICK_H__
+
+#include <hi_types_base.h>
+#include <hi_hrtimer.h>
+#include <hi_early_debug.h>
+#include <hi_systick.h>
+#include <hi_task.h>
+#include <hi_time.h>
+#include <hi_timer.h>
+
+#define NO_CALLBACK 0xffff
+#define HRTIMER_EXPIRE 2000       /* expire timer is 2000us */
+#define WORK_TICK_DELAY_US 31     /* 1/32K */
+#define APP_DEMO_TIMER_WAIT 10000 /* wait 10s */
+
+hi_void hr_timer_callback(hi_u32 data);
+hi_void app_demo_hrtimer(hi_void);
+hi_void app_demo_systick(hi_void);
+static hi_void app_demo_timer_handle(hi_u32 data);
+hi_void app_demo_timer(hi_void);
+#endif

+ 44 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_tsensor.h

@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_I2S_H__
+#define __APP_DEMO_I2S_H__
+
+#include <hi_types_base.h>
+#include <hi_early_debug.h>
+#include <hi_task.h>
+#include <hi_systick.h>
+#include <hi_time.h>
+#include <hi_tsensor.h>
+#include <app_demo_tsensor.h>
+
+#define TEMPERRATURE_OUT_THRESHOLD_LOW    (-30)
+#define TEMPERRATURE_OUT_THRESHOLD_HIGH   100
+#define TEMPERRATURE_OVER_THRESHOLD       115
+#define TEMPERRATURE_POWER_DOWN_THRESHOLD 125
+#define TSENSOR_CALIBRATE_CODE            0x07
+#define TSENSOR_CALIBRATE_CODE_LOAD_EFUSE 0
+#define TSENSOR_CALIBRATE_CODE_LOAD_REG   1
+#define TSENSOR_PERIOD_VALUE              500
+#define TSENSOR_TEST_INTERVAL             1000
+#define TSENSOR_TEST_LOOP                 10
+#define TSENSOR_GET_TEMPERRATURE_INTERVAL (TSENSOR_PERIOD_VALUE * 31.25 + 192 * 16)
+
+static hi_void tensor_collect_finish_irq(hi_s16 irq_temperature);
+static hi_void tensor_outtemp_irq(hi_s16 irq_temperature);
+static hi_void tensor_overtemp_irq(hi_s16 irq_temperature);
+static hi_void read_temprature_none_irq_single(hi_void);
+hi_void tsensor_demo(hi_void);
+#endif

+ 33 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_demo_uart.h

@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_DEMO_UART_H__
+#define __APP_DEMO_UART_H__
+
+#include <hi_types_base.h>
+#include <hi_early_debug.h>
+#include <hi_task.h>
+#include <hi_uart.h>
+#include <app_demo_uart.h>
+
+#define WRITE_BY_INT
+#define UART_DEMO_TASK_STAK_SIZE 2048
+#define UART_DEMO_TASK_PRIORITY  25
+#define DEMO_UART_NUM            HI_UART_IDX_2
+#define UART_BUFF_SIZE           32
+
+static hi_void *uart_demo_task(hi_void *param);
+hi_void uart_demo(hi_void);
+#endif

+ 22 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_http_client.h

@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_HTTP_CLOENT_H__
+#define __APP_HTTP_CLOENT_H__
+
+#include <hi_types_base.h>
+
+unsigned int http_clienti_get(int argc, const char *argv[]);
+#endif

+ 28 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_io_init.h

@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_IO_INIT_H__
+#define __APP_IO_INIT_H__
+
+#include <hi_types_base.h>
+
+HI_CPP_START
+
+hi_void app_io_init(hi_void);
+hi_void app_io_set_gpio2_clkout_enable(hi_bool enable);
+
+HI_CPP_END
+#endif /* __APP_IO_INIT_H__ */
+

+ 31 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/app_main.h

@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __APP_MAIN_H__
+#define __APP_MAIN_H__
+
+#include <hi_types_base.h>
+
+typedef struct {
+    hi_u16 gpio6_cfg;
+    hi_u16 gpio8_cfg;
+    hi_u16 gpio10_cfg;
+    hi_u16 gpio11_cfg;
+    hi_u16 gpio12_cfg;
+    hi_u16 gpio13_cfg;
+    hi_u16 sfc_csn_cfg;
+} app_iocfg_backup;
+
+#endif // __APP_MAIN_H__

+ 24 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/wifi_softap.h

@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __WIFI_SOFTAP_H__
+#define __WIFI_SOFTAP_H__
+
+int hi_wifi_start_softap(void);
+
+void hi_wifi_stop_softap(void);
+
+#endif /* __WIFI_STA_H__ */
+

+ 24 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/include/wifi_sta.h

@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __WIFI_STA_H__
+#define __WIFI_STA_H__
+
+int hi_wifi_start_sta(void);
+
+void hi_wifi_stop_sta(void);
+
+#endif /* __WIFI_STA_H__ */
+

+ 19 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/init/SConscript

@@ -0,0 +1,19 @@
+# Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+Import('env')
+
+env = env.Clone()
+
+objs = env.Object(Glob('*.c'))
+Return('objs')

+ 108 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/init/app_io_init.c

@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <hi_io.h>
+#include <hi3861_platform.h>
+
+hi_void app_io_set_gpio2_clkout_enable(hi_bool enable)
+{
+    if (enable == HI_TRUE) {
+        hi_io_set_input_enable(HI_IO_NAME_GPIO_2, HI_TRUE);
+        hi_reg_write16(DIAG_CTL_DIAG_MUX, 0x2);
+        hi_reg_write16(DIAG_CTL_CLOCK_TEST_DIV, 0x0);
+        hi_reg_write16(DIAG_CTL_CLOCK_TEST_EN, 0x3FFF);
+        hi_reg_write16(DIAG_CTL_CLOCK_TEST_SEL, 0x1);
+        hi_io_set_func(HI_IO_NAME_GPIO_2, 0x6); /* let gpio2 output clk. */
+        hi_io_set_driver_strength(HI_IO_NAME_GPIO_2, HI_IO_DRIVER_STRENGTH_3);
+    } else {
+        hi_io_set_func(HI_IO_NAME_GPIO_2, HI_IO_FUNC_GPIO_2_GPIO);
+        hi_io_set_input_enable(HI_IO_NAME_GPIO_2, HI_FALSE); /* set io enable false, for low power. */
+        hi_io_set_pull(HI_IO_NAME_GPIO_2, HI_IO_PULL_NONE);
+    }
+}
+
+hi_void app_io_init(hi_void)
+{
+    /*
+     * You need to select the I/O multiplexing configuration of each peripheral
+     * based on the application scenario. The following is an example.
+     */
+#ifdef CONFIG_UART0_SUPPORT
+    /* Configure UART0 as the debugging serial port. */
+    hi_io_set_func(HI_IO_NAME_GPIO_3, HI_IO_FUNC_GPIO_3_UART0_TXD); /* uart0 tx */
+    hi_io_set_func(HI_IO_NAME_GPIO_4, HI_IO_FUNC_GPIO_4_UART0_RXD); /* uart0 rx */
+#endif
+
+#ifdef CONFIG_UART1_SUPPORT
+    /* Configure UART1 as the AT command serial port. */
+    hi_io_set_func(HI_IO_NAME_GPIO_5, HI_IO_FUNC_GPIO_5_UART1_RXD); /* uart1 rx */
+    hi_io_set_func(HI_IO_NAME_GPIO_6, HI_IO_FUNC_GPIO_6_UART1_TXD); /* uart1 tx */
+#endif
+
+#ifdef CONFIG_UART2_SUPPORT
+    /* Configure UART1 as the SIGMA authentication serial port. */
+    hi_io_set_func(HI_IO_NAME_GPIO_11, HI_IO_FUNC_GPIO_11_UART2_TXD); /* uart2 tx */
+    hi_io_set_func(HI_IO_NAME_GPIO_12, HI_IO_FUNC_GPIO_12_UART2_RXD); /* uart2 rx */
+#endif
+
+    /* SPI MUX: */
+#ifdef CONFIG_SPI_SUPPORT
+    /* The SPI I/O multiplexing mode can also be 5/6/7/8 or 0/1/2/3 based on the product design. */
+    hi_io_set_func(HI_IO_NAME_GPIO_9, HI_IO_FUNC_GPIO_9_SPI0_TXD);
+    hi_io_set_func(HI_IO_NAME_GPIO_10, HI_IO_FUNC_GPIO_10_SPI0_CK);
+    hi_io_set_func(HI_IO_NAME_GPIO_11, HI_IO_FUNC_GPIO_11_SPI0_RXD);
+    hi_io_set_func(HI_IO_NAME_GPIO_12, HI_IO_FUNC_GPIO_12_SPI0_CSN);
+    hi_io_set_driver_strength(HI_IO_NAME_GPIO_9, HI_IO_DRIVER_STRENGTH_0);
+#endif
+
+    /* I2C MUX: */
+#ifdef CONFIG_I2C_SUPPORT
+    /* The I2C I/O multiplexing mode can also be 3/4 or 9/10 based on the product design. */
+    hi_io_set_func(HI_IO_NAME_GPIO_0, HI_IO_FUNC_GPIO_0_I2C1_SDA);
+    hi_io_set_func(HI_IO_NAME_GPIO_1, HI_IO_FUNC_GPIO_1_I2C1_SCL);
+#endif
+
+    /* PWM MUX: */
+#ifdef CONFIG_PWM_SUPPORT
+    /* The configurations for multiplexing 0/2/3/4/5 into PWM are similar. */
+    hi_io_set_func(HI_IO_NAME_GPIO_8, HI_IO_FUNC_GPIO_8_PWM1_OUT);
+#endif
+
+    /* I2S MUX: */
+#ifdef CONFIG_I2S_SUPPORT
+    hi_io_set_func(HI_IO_NAME_GPIO_9, HI_IO_FUNC_GPIO_9_I2S0_MCLK);
+    hi_io_set_func(HI_IO_NAME_GPIO_10, HI_IO_FUNC_GPIO_10_I2S0_TX);
+    hi_io_set_func(HI_IO_NAME_GPIO_11, HI_IO_FUNC_GPIO_11_I2S0_RX);
+    hi_io_set_func(HI_IO_NAME_GPIO_12, HI_IO_FUNC_GPIO_12_I2S0_BCLK);
+    hi_io_set_func(HI_IO_NAME_GPIO_13, HI_IO_FUNC_GPIO_13_I2S0_WS);
+#endif
+
+    /* SDIO MUX: */
+#ifdef CONFIG_SDIO_SUPPORT
+    (hi_void)hi_io_set_func(HI_IO_NAME_GPIO_9, HI_IO_FUNC_GPIO_9_SDIO_D2);
+    (hi_void)hi_io_set_func(HI_IO_NAME_GPIO_10, HI_IO_FUNC_GPIO_10_SDIO_D3);
+    (hi_void)hi_io_set_func(HI_IO_NAME_GPIO_11, HI_IO_FUNC_GPIO_11_SDIO_CMD);
+    (hi_void)hi_io_set_func(HI_IO_NAME_GPIO_12, HI_IO_FUNC_GPIO_12_SDIO_CLK);
+    (hi_void)hi_io_set_func(HI_IO_NAME_GPIO_13, HI_IO_FUNC_GPIO_13_SDIO_D0);
+    (hi_void)hi_io_set_func(HI_IO_NAME_GPIO_14, HI_IO_FUNC_GPIO_14_SDIO_D1);
+
+    (hi_void)hi_io_set_pull(HI_IO_NAME_GPIO_9, HI_IO_PULL_UP);
+    (hi_void)hi_io_set_pull(HI_IO_NAME_GPIO_10, HI_IO_PULL_UP);
+    (hi_void)hi_io_set_pull(HI_IO_NAME_GPIO_11, HI_IO_PULL_UP);
+    (hi_void)hi_io_set_pull(HI_IO_NAME_GPIO_13, HI_IO_PULL_UP);
+    (hi_void)hi_io_set_pull(HI_IO_NAME_GPIO_14, HI_IO_PULL_UP);
+#endif
+}
+

+ 19 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/module_config.mk

@@ -0,0 +1,19 @@
+# Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+ALL_LIBS := demo
+demo_srcs := init src
+CCFLAGS +=
+CCFLAGS += -D_PRE_WLAN_FEATURE_CSI -D_PRE_WLAN_FEATURE_P2P -DLWIP_ENABLE_DIAG_CMD=0
+CCFLAGS += -I$(MAIN_TOPDIR)/components/iperf2/include -I$(MAIN_TOPDIR)/app/demo/include -I$(MAIN_TOPDIR)/app/demo/init -I$(MAIN_TOPDIR)/app/demo/src -I$(MAIN_TOPDIR)/config/app -I$(MAIN_TOPDIR)/config/diag -I$(MAIN_TOPDIR)/platform/os/Huawei_LiteOS/net/ripple/exports -I$(MAIN_TOPDIR)/components/ripple/exports -I$(MAIN_TOPDIR)/components/hilink/include
+CCFLAGS += -I$(MAIN_TOPDIR)/third_party/mbedtls/include/mbedtls

+ 19 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/SConscript

@@ -0,0 +1,19 @@
+# Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+Import('env')
+
+env = env.Clone()
+
+objs = env.Object(Glob('*.c'))
+Return('objs')

+ 118 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_adc.c

@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define APP_DEMO_ADC
+#ifdef APP_DEMO_ADC
+#include <app_demo_adc.h>
+
+hi_u16 g_adc_buf[ADC_TEST_LENGTH] = { 0 };
+
+hi_void test_para(hi_void)
+{
+    hi_u32 ret;
+    hi_u16 data = 0;
+    printf("********ADC Test Para Set Start********\n");
+    ret = hi_adc_read(HI_ADC_CHANNEL_BUTT, &data, HI_ADC_EQU_MODEL_1, HI_ADC_CUR_BAIS_DEFAULT, 0);
+    if (ret == HI_ERR_ADC_PARAMETER_WRONG) {
+        printf("ADC TEST WRONG Channel SUCCESS!\n");
+    }
+    ret = hi_adc_read(HI_ADC_CHANNEL_7, HI_NULL, HI_ADC_EQU_MODEL_1, HI_ADC_CUR_BAIS_DEFAULT, 0);
+    if (ret == HI_ERR_ADC_PARAMETER_WRONG) {
+        printf("ADC TEST WRONG Data point SUCCESS!\n");
+    }
+    ret = hi_adc_read(HI_ADC_CHANNEL_7, &data, HI_ADC_EQU_MODEL_BUTT, HI_ADC_CUR_BAIS_DEFAULT, 0);
+    if (ret == HI_ERR_ADC_PARAMETER_WRONG) {
+        printf("ADC TEST WRONG Average Algorithm SUCCESS!\n");
+    }
+    ret = hi_adc_read(HI_ADC_CHANNEL_7, &data, HI_ADC_EQU_MODEL_1, HI_ADC_CUR_BAIS_BUTT, 0);
+    if (ret == HI_ERR_ADC_PARAMETER_WRONG) {
+        printf("ADC TEST WRONG Analog Power Control SUCCESS!\n");
+    }
+    ret = hi_adc_read(HI_ADC_CHANNEL_7, &data, HI_ADC_EQU_MODEL_1, HI_ADC_CUR_BAIS_DEFAULT, 0xFFF);
+    if (ret == HI_ERR_ADC_PARAMETER_WRONG) {
+        printf("ADC TEST WRONG Reset Count SUCCESS!\n");
+    }
+}
+
+/* asic adc test  */
+hi_void convert_to_voltage(hi_u32 data_len)
+{
+    hi_u32 i;
+    float vlt_max = 0;
+    float vlt_min = VLT_MIN;
+    hi_u16 vlt;
+    for (i = 0; i < data_len; i++) {
+        vlt = g_adc_buf[i];
+        float voltage = (float)vlt * 1.8 * 4 / 4096.0;  /* vlt * 1.8 * 4 / 4096.0: Convert code into voltage */
+        vlt_max = (voltage > vlt_max) ? voltage : vlt_max;
+        vlt_min = (voltage < vlt_min) ? voltage : vlt_min;
+    }
+    printf("vlt_min:%.3f, vlt_max:%.3f \n", vlt_min, vlt_max);
+}
+
+hi_void app_demo_adc_test(hi_void)
+{
+    hi_u32 ret, i;
+    hi_u16 data;  /* 10 */
+    printf("ADC Test Start\n");
+
+    memset_s(g_adc_buf, sizeof(g_adc_buf), 0x0, sizeof(g_adc_buf));
+    for (hi_u8 ch = 0; ch < HI_ADC_CHANNEL_BUTT; ch++) {
+        for (i = 0; i < ADC_TEST_LENGTH; i++) {
+            ret = hi_adc_read((hi_adc_channel_index)ch, &data, HI_ADC_EQU_MODEL_1, HI_ADC_CUR_BAIS_DEFAULT, 0);
+            if (ret != HI_ERR_SUCCESS) {
+                printf("ADC Read Fail\n");
+                return;
+            }
+            g_adc_buf[i] = data;
+        }
+        convert_to_voltage(ADC_TEST_LENGTH);
+    }
+    printf("ADC Test Channels End\n");
+
+    memset_s(g_adc_buf, sizeof(g_adc_buf), 0x0, sizeof(g_adc_buf));
+    for (hi_u8 em = 0; em < HI_ADC_EQU_MODEL_BUTT; em++) {
+        for (i = 0; i < ADC_TEST_LENGTH; i++) {
+            ret = hi_adc_read(HI_ADC_CHANNEL_7, &data, (hi_adc_equ_model_sel)em, HI_ADC_CUR_BAIS_DEFAULT, 0);
+            if (ret != HI_ERR_SUCCESS) {
+                printf("ADC Read Fail\n");
+                return;
+            }
+            g_adc_buf[i] = data;
+        }
+        convert_to_voltage(ADC_TEST_LENGTH);
+    }
+    printf("ADC Test Average Mode End\n");
+
+    memset_s(g_adc_buf, sizeof(g_adc_buf), 0x0, sizeof(g_adc_buf));
+    for (hi_u16 rc = 0; rc <= 0xFF0; rc += 0xF) {
+        for (i = 0; i < ADC_TEST_LENGTH; i++) {
+            ret = hi_adc_read(HI_ADC_CHANNEL_7, &data, HI_ADC_EQU_MODEL_8, HI_ADC_CUR_BAIS_DEFAULT, rc);
+            if (ret != HI_ERR_SUCCESS) {
+                printf("ADC Read Fail\n");
+                return;
+            }
+            g_adc_buf[i] = data;
+        }
+        convert_to_voltage(ADC_TEST_LENGTH);
+    }
+    printf("ADC Test Reset Count End\n");
+
+    test_para();
+
+    printf("ADC Test End!\n");
+}
+
+#endif

+ 257 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_efuse.c

@@ -0,0 +1,257 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <app_demo_efuse.h>
+
+hi_u32 get_efuse_id_size_test(hi_void)
+{
+    hi_s32 i;
+    hi_u32 efuse_size;
+
+    for (i = 0; i < HI_EFUSE_IDX_MAX; i++) {
+        efuse_size = hi_efuse_get_id_size((hi_efuse_idx)i);
+        if (efuse_size == HI_ERR_EFUSE_INVALIDATE_ID) {
+            printf("***exception***! failed to get size of efuse ID%d(0x%02X)\n", i, i);
+            return efuse_size;
+        }
+
+        printf("size of efuse ID%d(0x%02X) = %d\n", i, i, efuse_size);
+    }
+
+    return HI_ERR_SUCCESS;
+}
+
+hi_void efuse_get_lock_stat(hi_void)
+{
+    hi_u64 lock_data;
+
+    hi_efuse_get_lockstat(&lock_data);
+    printf("lock_stat = 0x%08X ", (hi_u32)((lock_data >> 32) & 0xFFFFFFFF)); /* right shift 32bits */
+    printf("%08X\n", (hi_u32)(lock_data & 0xFFFFFFFF));
+}
+
+hi_u32 efuse_usr_read(hi_void)
+{
+    hi_u32 ret;
+    hi_u32 read_data[EFUSE_USR_RW_SAMPLE_BUFF_MAX_LEN] = {0};
+    hi_u16 start_bit = 0x75C;       /* The offset address of customer_rsvd0 is 0x75C */
+    hi_u16 rw_bits = 64;            /* The lenth of customer_rsvd0 is 64bits */
+    hi_u16 align_size;
+    hi_u8 tmp_data[9] = {0}; /* 9 bytes(72 bits) for customer_rsvd0 field, length 8-bit aligned. */
+    hi_u64 first_u64;
+    hi_u8 second_u8;
+
+    hi_u8 diff_head_read = start_bit % 8; /* The start address is read in 8-bit alignment mode. */
+    start_bit = start_bit - diff_head_read;
+    align_size = (((rw_bits + diff_head_read) >> 3) + 1) << 3; /* 3-bit offset */
+
+    ret = hi_efuse_usr_read(start_bit, align_size, (hi_u8 *)tmp_data);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("Failed to read EFUSE at line%d! Err code = %X\n", __LINE__, ret);
+        return ret;
+    }
+
+    first_u64 = *(hi_u64 *)&tmp_data[0];
+    second_u8 = *(hi_u8 *)&tmp_data[8]; /* the last u8 bit */
+    /* The lower bits of the first u64 multi-read are discarded.(The diff_head_read) */
+    first_u64 = first_u64 >> diff_head_read;
+    /*
+     * The least significant eight bits of tmp_data are shifted leftward by 64-diff_head_read bits
+     * as the most significant 64 bits of tmp_data.diff_head_read)
+     */
+    first_u64 = first_u64 | ((hi_u64)second_u8 << (64 - diff_head_read)); /* (64 - diff_head_read)bits */
+    *(hi_u64 *)read_data = first_u64;
+
+    printf("usr_data = 0x%08X %08X\n", read_data[0], read_data[1]);
+
+    return HI_ERR_SUCCESS;
+}
+
+hi_u32 efuse_usr_write(hi_void)
+{
+    hi_u32 ret;
+    hi_u32 write_data[EFUSE_USR_RW_SAMPLE_BUFF_MAX_LEN] = {
+        0x0,
+        0x1,
+    };
+    hi_u16 start_bit = 0x75C;       /* Offset address:0x75C */
+    hi_u16 rw_bits = 64;            /* length:64bits */
+
+    ret = efuse_usr_read();
+    if (ret != HI_ERR_SUCCESS) {
+        return ret;
+    }
+
+    ret = hi_efuse_usr_write(start_bit, rw_bits, (hi_u8 *)write_data);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("Failed to write EFUSE!\n");
+        return ret;
+    }
+
+    return HI_ERR_SUCCESS;
+}
+
+hi_u32 efuse_usr_lock(hi_void)
+{
+    hi_u32 ret;
+    hi_u8  lock_data = 0x1;
+    hi_u16 lock_start_bit = 0x7FD;  /* Offset address:0x7FD */
+    hi_u16 lock_bits = 1;           /* length:1bit  */
+
+    efuse_get_lock_stat();
+
+    ret = hi_efuse_usr_write(lock_start_bit, lock_bits, &lock_data);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("Failed to lock EFUSE!\n");
+        return ret;
+    }
+
+    efuse_get_lock_stat();
+
+    return HI_ERR_SUCCESS;
+}
+
+hi_u32 sample_usr_efuse(hi_void)
+{
+    hi_u32 ret;
+
+#ifdef EFUSE_WRITE_ENABLE
+    ret = efuse_usr_write();
+    if (ret != HI_ERR_SUCCESS) {
+        return ret;
+    }
+#endif
+
+    ret = efuse_usr_read();
+    if (ret != HI_ERR_SUCCESS) {
+        return ret;
+    }
+
+#ifdef EFUSE_LOCK_ENABLE
+    ret = efuse_usr_lock();
+    if (ret != HI_ERR_SUCCESS) {
+        return ret;
+    }
+#endif
+
+    return HI_ERR_SUCCESS;
+}
+
+hi_u32 efuse_id_read(hi_void)
+{
+    hi_u32 ret;
+    hi_u32 read_data[EFUSE_USR_RW_SAMPLE_BUFF_MAX_LEN] = {0};
+    hi_efuse_idx efuse_id = HI_EFUSE_CUSTOMER_RSVD0_RW_ID;
+
+    ret = hi_efuse_read(efuse_id, (hi_u8 *)read_data, (hi_u8)sizeof(read_data));
+    if (ret != HI_ERR_SUCCESS) {
+        printf("Failed to read EFUSE at line%d! Err code = %X\n", __LINE__, ret);
+        return ret;
+    }
+    printf("id_data = 0x%08X %08X\n", read_data[0], read_data[1]);
+
+    return HI_ERR_SUCCESS;
+}
+
+hi_u32 efuse_id_write(hi_void)
+{
+    hi_u32 ret;
+    hi_u32 write_data[EFUSE_USR_RW_SAMPLE_BUFF_MAX_LEN] = {
+        0x1,
+        0x0,
+    };
+    hi_efuse_idx efuse_id = HI_EFUSE_CUSTOMER_RSVD0_RW_ID;
+
+    ret = efuse_id_read();
+    if (ret != HI_ERR_SUCCESS) {
+        return ret;
+    }
+
+    ret = hi_efuse_write(efuse_id, (hi_u8 *)write_data);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("Failed to write EFUSE!\n");
+        return ret;
+    }
+
+    return HI_ERR_SUCCESS;
+}
+
+hi_u32 efuse_id_lock(hi_void)
+{
+    hi_u32 ret;
+    hi_efuse_lock_id lock_id = HI_EFUSE_LOCK_CUSTOMER_RSVD0_ID;
+    efuse_get_lock_stat();
+
+    ret = hi_efuse_lock(lock_id);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("Failed to lock EFUSE!\n");
+        return ret;
+    }
+
+    efuse_get_lock_stat();
+
+    return HI_ERR_SUCCESS;
+}
+
+hi_u32 sample_id_efuse(hi_void)
+{
+    hi_u32 ret;
+
+#ifdef EFUSE_WRITE_ENABLE
+    ret = efuse_id_write();
+    if (ret != HI_ERR_SUCCESS) {
+        return ret;
+    }
+#endif
+
+    ret = efuse_id_read();
+    if (ret != HI_ERR_SUCCESS) {
+        return ret;
+    }
+
+#ifdef EFUSE_LOCK_ENABLE
+    ret = efuse_id_lock();
+    if (ret != HI_ERR_SUCCESS) {
+        return ret;
+    }
+#endif
+
+    return HI_ERR_SUCCESS;
+}
+
+/*
+ * This demo simply shows how to use efuse interface to write, read and lock customer_rsvd0 field.
+ * -note: Efuse is a one-time programmable logic. Once set, it cannot be modified.
+ *        Be careful when using write and lock interfaces.
+ */
+hi_void efuse_demo(hi_void)
+{
+    hi_u32 ret;
+
+    ret = get_efuse_id_size_test();
+    if (ret != HI_ERR_SUCCESS) {
+        return;
+    }
+
+    ret = sample_id_efuse();
+    if (ret != HI_ERR_SUCCESS) {
+        return;
+    }
+
+    ret = sample_usr_efuse();
+    if (ret != HI_ERR_SUCCESS) {
+        return;
+    }
+}

+ 110 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_flash.c

@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define TEST_KERNEL_FLASH
+#ifdef TEST_KERNEL_FLASH
+#include <app_demo_flash.h>
+
+hi_u32 g_test_flash_tb = 0;
+hi_u32 g_tf_test_time = 60;
+hi_u32 g_tf_test_mode = 0;
+
+hi_u8 g_tf_pdata[TEST_SIZE];
+hi_u8 g_tf_pdata_back[TEST_SIZE];
+
+#define CODE_IN_FLASH
+#ifdef CODE_IN_FLASH
+hi_void *test_flash_body2(hi_void* param)
+#else
+BSP_RAM_TEXT_SECTION hi_void *test_flash_body2(hi_void* param)
+#endif
+{
+    hi_u32 ret;
+    hi_u32 tick[2]; /* 2 */
+    hi_unref_param(param);
+    hi_watchdog_disable();
+    tick[0] = hi_get_tick();
+    for (;;) {
+        if (g_tf_test_mode == 2) { /* 2 */
+            for (int i = 0; i < TEST_SIZE; i++) {
+                g_tf_pdata_back[i] = (hi_u8)(*(hi_u16*)(0x401000 + i * 2)); /* flash addr:0x401000 2 */
+            }
+        } else {
+            ret = hi_flash_erase(TEST_FLASH_OFFSET, TEST_SIZE);
+            if (ret != HI_ERR_SUCCESS) {
+                printf("erase fail:%x\n", ret);
+            }
+            ret = hi_flash_write(TEST_FLASH_OFFSET, TEST_SIZE, g_tf_pdata, HI_TRUE);
+            if (ret != HI_ERR_SUCCESS) {
+                printf("write fail:%x\n", ret);
+            }
+            memset_s(g_tf_pdata_back, TEST_SIZE, 0x0, TEST_SIZE);
+            ret = hi_flash_read(TEST_FLASH_OFFSET, TEST_SIZE, g_tf_pdata_back);
+            if (ret != HI_ERR_SUCCESS) {
+                printf("read fail:%x\n", ret);
+            }
+        }
+        if (memcmp(g_tf_pdata, g_tf_pdata_back, TEST_SIZE)) {
+            printf("hi_flash_read fail !\r\n");
+            break;
+        }
+        tick[1] = hi_get_tick();
+        if ((tick[1] - tick[0]) >= (g_tf_test_time * 100)) { /* 100 */
+            printf("test over\r\n");
+            break;
+        }
+    }
+    return HI_NULL;
+}
+
+hi_void cmd_test_flash(hi_u32 test_time, hi_u32 test_mode)
+{
+    hi_task_attr attr;
+    hi_u32 ret;
+    hi_u32 i;
+    g_tf_test_time = test_time;
+    g_tf_test_mode = test_mode;
+    printf("test mode %d ,test %d s,wait ..\r\n", g_tf_test_mode, g_tf_test_time);
+    if (g_tf_test_mode == 0) {
+        for (i = 0; i < TEST_SIZE; i++) {
+            g_tf_pdata[i] = (hi_u8)i;
+        }
+    } else if (g_tf_test_mode == 1) {
+        memset_s(g_tf_pdata, TEST_SIZE, 0xF0, TEST_SIZE);
+        printf("test F0\r\n");
+    } else if (g_tf_test_mode == 2) { /* 2 */
+        printf("test task in flash\r\n");
+    }
+    ret = hi_flash_write(TEST_FLASH_OFFSET, TEST_SIZE, g_tf_pdata, HI_TRUE);
+    if (ret != HI_ERR_SUCCESS) {
+        return;
+    }
+    ret = hi_flash_read(TEST_FLASH_OFFSET, TEST_SIZE, g_tf_pdata_back);
+    if (ret != HI_ERR_SUCCESS) {
+        return;
+    }
+    if (memcmp(g_tf_pdata, g_tf_pdata_back, TEST_SIZE)) {
+        printf("write or read fail !\r\n");
+        printf("testdata addr:0x%x\r\n", (hi_u32)g_tf_pdata_back);
+        return;
+    }
+    printf("testdata addr:0x%x\r\n", (hi_u32)g_tf_pdata_back);
+    attr.stack_size = 0x800; /* 800 */
+    attr.task_name = (hi_char*) "test_flash";
+    attr.task_prio = 28; /* 28 */
+    hi_task_create(&g_test_flash_tb, &attr, test_flash_body2, 0);
+}
+
+#endif

+ 125 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_i2c.c

@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <app_demo_i2c.h>
+
+/* Es8311 initialization array */
+hi_u8 g_es8311_reg_array[I2C_REG_ARRAY_LEN] = {
+    0x1F, 0x00, 0x00, 0x10, 0x10, 0x00, 0x03, 0x00, /* 0x00 ~ 0x0f */
+    0xff, 0x00, 0x00, 0x00, 0x20, 0xfc, 0x6a, 0x00,
+    0x13, 0x7c, 0x02, 0x40, 0x10, 0x00, 0x04, 0x00, /* 0x10 ~ 0x1f */
+    0x00, 0x00, 0x00, 0x0b, 0x4b, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20 ~ 0x2f */
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* 0x30 ~ 0x3f */
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+hi_u8 g_send_data[I2C_REG_ARRAY_LEN] = { 0 };
+
+hi_void i2c_demo_send_data_init(hi_void)
+{
+    hi_u8 i;
+
+    hi_u8 reg_addr = ES8311_REG_ADDR;
+
+    g_send_data[0] = reg_addr;
+    g_send_data[1] = g_es8311_reg_array[reg_addr];
+
+    reg_addr++;
+    g_send_data[2] = reg_addr;                       /* size 2 */
+    g_send_data[3] = g_es8311_reg_array[reg_addr];   /* size 3 */
+
+    for (i = 0; i < I2C_SEND_LEN_2; i++) {
+        printf("----- data init:  send_buf[%d] = 0x%x! -----*\r\n", i, g_send_data[i]);
+    }
+
+    printf("\n");
+}
+
+hi_u32 i2c_demo_write(hi_i2c_idx id, hi_u16 device_addr, hi_u32 send_len)
+{
+    hi_u32 status;
+    hi_i2c_data es8311_i2c_data = { 0 };
+
+    es8311_i2c_data.send_buf = g_send_data;
+    es8311_i2c_data.send_len = send_len;
+    status = hi_i2c_write(id, device_addr, &es8311_i2c_data);
+    if (status != HI_ERR_SUCCESS) {
+        printf("===== Error: I2C write status = 0x%x! =====\r\n", status);
+        return status;
+    }
+
+    return HI_ERR_SUCCESS;
+}
+
+hi_u32 i2c_demo_writeread(hi_i2c_idx id, hi_u16 device_addr, hi_u32 recv_len)
+{
+    hi_u8 i;
+    hi_u32 status;
+    hi_u8 recv_data[I2C_REG_ARRAY_LEN] = { 0 };
+    hi_i2c_data es8311_i2c_data = { 0 };
+
+    printf("----- reg addr[0] = 0x%x! -----\r\n", g_send_data[0]);
+
+    /* Request memory space */
+    memset_s(recv_data, I2C_REG_ARRAY_LEN, 0x0, sizeof(recv_data));
+    memset_s(&es8311_i2c_data, sizeof(hi_i2c_data), 0x0, sizeof(hi_i2c_data));
+
+    es8311_i2c_data.send_buf = g_send_data;
+    es8311_i2c_data.send_len = 1;
+    es8311_i2c_data.receive_buf = recv_data;
+    es8311_i2c_data.receive_len = recv_len;
+    status = hi_i2c_writeread(id, device_addr, &es8311_i2c_data);
+    if (status != HI_ERR_SUCCESS) {
+        printf("===== Error: I2C read status = 0x%x! =====\r\n", status);
+        return status;
+    }
+
+    for (i = 0; i < recv_len; i++) {
+        printf("----- revData[%d] = 0x%x! -----\r\n", i, recv_data[i]);
+    }
+
+    return HI_ERR_SUCCESS;
+}
+
+hi_void i2c_demo(hi_i2c_idx id)
+{
+    hi_u32 ret;
+
+    printf("----- I2C Start -----\r\n");
+
+    i2c_demo_send_data_init();
+    hi_i2c_init(id, 100000); /* baudrate: 100000 */
+
+    ret = i2c_demo_write(id, ES8311_DEV_ADDR, I2C_SEND_LEN_2);
+    printf("----- (ES8311)i2c_demo_write %d : %s! -----\r\n\n", __LINE__,
+        ret == HI_ERR_SUCCESS ? "SUCCESS!" : "FAILURE!");
+
+    ret = i2c_demo_writeread(id, ES8311_DEV_ADDR, I2C_RECV_LEN_1);
+    printf("----- (ES8311)i2c_demo_writeread %d : %s! -----\r\n\n", __LINE__,
+        ret == HI_ERR_SUCCESS ? "SUCCESS!" : "FAILURE!");
+
+    hi_i2c_deinit(id);
+
+    printf("I2C Test End!\r\n");
+}
+
+hi_void app_demo_custom_i2c(hi_void)
+{
+    /* Default use I2C 0 */
+    i2c_demo(HI_I2C_IDX_0);
+}
+

+ 237 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_i2s.c

@@ -0,0 +1,237 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "app_demo_i2s.h"
+
+#ifndef I2S_TEST_DEBUG
+#define i2s_print(ftm...) do {printf(ftm);} while (0);
+#else
+#define i2s_print(ftm...)
+#endif
+
+audio_map g_audio_map[2] = {  /* 2 flash fields */
+    {0x001A1000, 100 * 1024}, /* audio file size: 100 * 1024(100K) */
+    {0x001CE000, 204800},     /* recod size: 200K */
+};
+
+hi_u32 g_audio_event;
+hi_u32 g_audio_task_id;
+test_audio_attr g_audio_test;
+hi_u8 g_record_data[AUDIO_RECORD_BUF_SIZE] = {0};
+
+hi_void es8311_codec_init(const hi_codec_attribute *codec_attr)
+{
+    if (codec_attr == HI_NULL) {
+        return;
+    }
+    hi_u32 ret;
+
+    ret = hi_i2c_init(HI_I2C_IDX_1, 100000);  /* 100000: i2s bit rate */
+    if (ret != HI_ERR_SUCCESS) {
+        i2s_print("==ERROR== hi_i2c_init, err = %X\n", ret);
+        return;
+    }
+
+    ret = hi_codec_init(codec_attr);
+    if (ret != HI_ERR_SUCCESS) {
+        i2s_print("==ERROR== Failed to init codec!! err = %X\n", ret);
+    } else {
+        i2s_print("init codec success!\n");
+    }
+}
+
+hi_void audio_play(hi_u32 map_index)
+{
+    hi_u32 ret;
+    hi_u32 play_addr = g_audio_map[map_index].flash_start_addr;
+    hi_u32 total_play_len = g_audio_map[map_index].data_len;
+    hi_u32 time_out = HI_SYS_WAIT_FOREVER;
+
+    /* apply memory */
+    g_audio_test.play_buf = (hi_u8 *) hi_malloc(HI_MOD_ID_DRV, AUDIO_PLAY_BUF_SIZE);
+    if (g_audio_test.play_buf == HI_NULL) {
+        hi_i2s_deinit();
+        i2s_print("==ERROR== play buf malloc fail!!!\n");
+        return;
+    }
+    memset_s(g_audio_test.play_buf, AUDIO_PLAY_BUF_SIZE, 0, AUDIO_PLAY_BUF_SIZE);
+
+    while (total_play_len > 0) {
+        hi_u32 send_len = hi_min(total_play_len, AUDIO_PLAY_BUF_SIZE);
+        ret = hi_flash_read(play_addr, send_len, g_audio_test.play_buf);
+        if (ret != HI_ERR_SUCCESS) {
+            i2s_print("==ERROR== hi_flash_read fail, err = %X\n", ret);
+        }
+
+        ret = hi_i2s_write(g_audio_test.play_buf, send_len, time_out);
+        if (ret != HI_ERR_SUCCESS) {
+            i2s_print("hi_i2s_write fail, err = %X\n", ret);
+        }
+
+        play_addr += send_len;
+        total_play_len -= send_len;
+    }
+
+    i2s_print("Play over....\n");
+
+    hi_free(HI_MOD_ID_DRV, g_audio_test.play_buf);
+}
+
+hi_void audio_record_func(hi_u32 map_index)
+{
+    hi_u32 ret;
+    hi_u32 record_addr = g_audio_map[map_index].flash_start_addr;
+    hi_u32 total_record_len = g_audio_map[map_index].data_len;
+    hi_u32 time_out = HI_SYS_WAIT_FOREVER;
+
+    ret = hi_flash_erase(record_addr, total_record_len);
+    if (ret != HI_ERR_SUCCESS) {
+        i2s_print("Failed to erase flash, err = %X\n", ret);
+        return;
+    }
+
+    while (total_record_len > 0) {
+        hi_u32 len = hi_min(AUDIO_RECORD_BUF_SIZE, total_record_len);
+        ret = hi_i2s_read(g_audio_test.record_buf, len, time_out);
+        if (ret != HI_ERR_SUCCESS) {
+            i2s_print("Failed to hi_i2s_read, err = %X\n", ret);
+            return;
+        }
+
+        if (memcpy_s(g_record_data, sizeof(g_record_data), g_audio_test.record_buf, len) != EOK) {
+            return;
+        }
+        hi_event_send(g_audio_event, AUDIO_RECORD_FINISH_BIT);
+
+        record_addr += len;
+        total_record_len -= len;
+    }
+
+    hi_event_send(g_audio_event, ALL_AUDIO_RECORD_FINISH_BIT);
+}
+
+hi_void *record_n_play_task(hi_void *param)
+{
+    hi_u32 ret;
+    hi_u32 event_bit = 0;
+    hi_u32 record_addr = g_audio_map[AUDIO_RECORD_AND_PLAY_MODE].flash_start_addr;
+    hi_u32 total_record_len = g_audio_map[AUDIO_RECORD_AND_PLAY_MODE].data_len;
+    hi_u32 len;
+    hi_unref_param(param);
+
+    while (1) {
+        hi_event_wait(g_audio_event, AUDIO_RECORD_FINISH_BIT | ALL_AUDIO_RECORD_FINISH_BIT, &event_bit,
+            HI_SYS_WAIT_FOREVER, HI_EVENT_WAITMODE_OR | HI_EVENT_WAITMODE_CLR);
+        if (event_bit & ALL_AUDIO_RECORD_FINISH_BIT) {
+            break;
+        }
+        len = hi_min(AUDIO_RECORD_BUF_SIZE, total_record_len);
+
+        ret = hi_flash_write(record_addr, len, g_record_data, HI_FALSE);
+        if (ret != HI_ERR_SUCCESS) {
+            i2s_print("==ERROR== hi_flash_write, err = %X\n", ret);
+        }
+        record_addr += len;
+        total_record_len -= len;
+    }
+
+    i2s_print("Record success!...\n");
+    hi_udelay(1000000); /* 1000000: delay 1s */
+
+    audio_play(AUDIO_RECORD_AND_PLAY_MODE);
+    i2s_print("Play record audio success!...\n");
+
+    return HI_NULL;
+}
+
+
+hi_void audio_record_play(hi_u32 map_index)
+{
+    hi_u32 ret;
+
+    hi_task_attr attr = {0};
+    attr.stack_size = I2S_TEST_TASK_STAK_SIZE;
+    attr.task_prio = I2S_TEST_TASK_PRIORITY;
+    attr.task_name = (hi_char*)"audio_record";
+    ret = hi_task_create(&g_audio_task_id, &attr, record_n_play_task, 0);
+    if (ret != HI_ERR_SUCCESS) {
+        i2s_print("Falied to create record task, err = %X\n", ret);
+    }
+
+    /* apply memory */
+    g_audio_test.record_buf = (hi_u8 *) hi_malloc(HI_MOD_ID_DRV, AUDIO_RECORD_BUF_SIZE);
+    if (g_audio_test.record_buf == HI_NULL) {
+        hi_i2s_deinit();
+        i2s_print("==ERROR== record buf malloc fail!!!\n");
+        return;
+    }
+    memset_s(g_audio_test.record_buf, AUDIO_RECORD_BUF_SIZE, 0, AUDIO_RECORD_BUF_SIZE);
+
+    i2s_print("==start record== please say somerthing~~\n");
+    audio_record_func(map_index);
+}
+
+/*
+ * i2s_demo: a simple demo implement paly audio file and record audio then play them back function.
+ * -note: If it is in play mode, user need to burn the audio file to the specified location of flash in advance.
+ *        max size of audio file: 100K bytes
+ *        burn command:           burn 1A1000 19000
+ */
+hi_void i2s_demo(hi_void)
+{
+    hi_u32 ret;
+
+    ret = hi_flash_init();
+    if (ret == HI_ERR_FLASH_RE_INIT) {
+        i2s_print("Flash has already been initialized!\n");
+    } else if (ret != HI_ERR_SUCCESS) {
+        i2s_print("Falied to init flash, err = %X\n", ret);
+    }
+
+    /* create I2S record event */
+    ret = hi_event_create(&g_audio_event);
+    if (ret != HI_ERR_SUCCESS) {
+        i2s_print("Failed to init g_audio_event! err = %X\n", ret);
+        return;
+    }
+
+    hi_codec_attribute codec_cfg = {
+        .sample_rate = HI_CODEC_SAMPLE_RATE_8K,
+        .resolution = HI_CODEC_RESOLUTION_16BIT,
+    };
+    hi_i2s_attribute i2s_cfg = {
+        .sample_rate = HI_I2S_SAMPLE_RATE_8K,
+        .resolution = HI_I2S_RESOLUTION_16BIT,
+    };
+
+    es8311_codec_init(&codec_cfg);
+
+    ret = hi_i2s_init(&i2s_cfg);
+    if (ret != HI_ERR_SUCCESS) {
+        i2s_print("Failed to init i2s!\n");
+        return;
+    }
+
+    i2s_print("I2s init success!\n");
+
+    /* paly audio file */
+    audio_play(AUDIO_PLAY_FIEL_MODE);
+
+    hi_udelay(5000000); /* 5000000: delay 5s */
+
+    /* record audio then play them back */
+    audio_record_play(AUDIO_RECORD_AND_PLAY_MODE);
+}
+

+ 95 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_io_gpio.c

@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <app_demo_io_gpio.h>
+
+/* gpio callback func */
+hi_void gpio_isr_func(hi_void *arg)
+{
+    hi_unref_param(arg);
+    printf("----- gpio isr success -----\r\n");
+}
+
+hi_void io_gpio_demo(hi_void)
+{
+    /* Take gpio 0 as an example */
+    hi_u32 ret;
+    hi_gpio_value gpio_val = HI_GPIO_VALUE1;
+
+    ret = hi_gpio_init();
+    if (ret != HI_ERR_SUCCESS) {
+        printf("===== ERROR ===== gpio -> hi_gpio_init ret:%d\r\n", ret);
+        return;
+    }
+    printf("----- gpio init success-----\r\n");
+
+    ret = hi_io_set_func(HI_IO_NAME_GPIO_0, HI_IO_FUNC_GPIO_0_GPIO);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("===== ERROR ===== gpio -> hi_io_set_func ret:%d\r\n", ret);
+        return;
+    }
+    printf("----- io set func success-----\r\n");
+
+    ret = hi_gpio_set_dir(HI_GPIO_IDX_0, HI_GPIO_DIR_IN);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("===== ERROR ===== gpio -> hi_gpio_set_dir1 ret:%d\r\n", ret);
+        return;
+    }
+    printf("----- gpio set dir success! -----\r\n");
+
+    ret = hi_gpio_get_input_val(HI_GPIO_IDX_0, &gpio_val);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("===== ERROR ===== gpio -> hi_gpio_get_input_val ret:%d\r\n", ret);
+        return;
+    }
+    printf("----- gpio input val is:%d. -----\r\n", gpio_val);
+
+    ret = hi_gpio_deinit();
+    if (ret != HI_ERR_SUCCESS) {
+        printf("===== ERROR ===== gpio -> hi_gpio_deinit ret:%d\r\n", ret);
+        return;
+    }
+    printf("----- gpio deinit success-----\r\n");
+}
+
+/* gpio callback demo */
+hi_void gpio_isr_demo(hi_void)
+{
+    hi_u32 ret;
+
+    printf("----- gpio isr demo -----\r\n");
+
+    (hi_void)hi_gpio_init();
+
+    ret = hi_gpio_set_dir(HI_GPIO_IDX_0, HI_GPIO_DIR_IN);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("===== ERROR ======gpio -> hi_gpio_set_dir1 ret:%d\r\n", ret);
+        return;
+    }
+
+    ret = hi_gpio_register_isr_function(HI_GPIO_IDX_0, HI_INT_TYPE_LEVEL,
+                                        HI_GPIO_EDGE_RISE_LEVEL_HIGH, gpio_isr_func, HI_NULL);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("===== ERROR ======gpio -> hi_gpio_register_isr_function ret:%d\r\n", ret);
+    }
+}
+
+hi_void app_demo_custom_io_gpio(hi_void)
+{
+    io_gpio_demo();
+    hi_sleep(1000);  /* sleep 1000ms */
+    gpio_isr_demo();
+}
+

+ 122 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_nv.c

@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <app_demo_nv.h>
+
+/*
+ * This demo simply shows how to read and write nv item.
+ * nv demo must excute after hi_nv_init in app_main.
+ * nv default value was defined in tools\scripts\generate_nv\xml_file\mss_nvi_db.xml
+ */
+hi_void nv_demo(hi_void)
+{
+    hi_u32 ret;
+    hi_u32 err_info = 0;
+    hi_nv_demo_tset_cfg cfg, cfg1;
+    hi_flash_partition_table *ptable = hi_get_partition_table();
+    (hi_void)memset_s(&cfg, sizeof(cfg), 0, sizeof(cfg));
+    (hi_void)memset_s(&cfg1, sizeof(cfg1), 0, sizeof(cfg1));
+
+    cfg.nv_demo_test_num0 = 0x1;
+
+    hi_flash_deinit();
+    ret = hi_flash_init();
+    if (ret != HI_ERR_SUCCESS) {
+        err_info |= 1 << 0x6;
+        printf("flash init status:0x%x\n", err_info);
+        return;
+    }
+
+    ret = hi_nv_init(ptable->table[HI_FLASH_PARTITON_NORMAL_NV].addr, HI_NV_DEFAULT_TOTAL_SIZE,
+        HI_NV_DEFAULT_BLOCK_SIZE);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("nv init fail\r\n");
+        return;
+    }
+
+    /* read nv data(which nv id is 0x22) from board */
+    ret = hi_nv_read(HI_NV_DEMO_RST_CFG_ID, &cfg, sizeof(cfg), 0);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("nv read fail\r\n");
+        return;
+    }
+    printf("nv read success, cfg.nv_demo_test_num0:%d\r\n", cfg.nv_demo_test_num0);
+
+    cfg1.nv_demo_test_num0 = 0x3;
+
+    /* write nv data(which nv id is 0x22) to board */
+    ret = hi_nv_write(HI_NV_DEMO_RST_CFG_ID, &cfg1, sizeof(cfg1), 0);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("nv write fail\r\n");
+        return;
+    }
+    printf("nv write success\r\n");
+    ret = hi_nv_read(HI_NV_DEMO_RST_CFG_ID, &cfg, sizeof(cfg), 0);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("nv read fail\r\n");
+        return;
+    }
+    printf("nv read success, cfg.nv_demo_test_num0:%d\r\n", cfg.nv_demo_test_num0);
+}
+
+hi_void factory_nv_demo(hi_void)
+{
+    hi_u32 ret;
+    hi_u32 err_info = 0;
+    hi_factory_nv_demo_tset_cfg cfg, cfg1;
+    (hi_void)memset_s(&cfg, sizeof(cfg), 0, sizeof(cfg));
+    (hi_void)memset_s(&cfg1, sizeof(cfg1), 0, sizeof(cfg1));
+
+    cfg.nv_factory_demo_test_num0 = 0x1;
+
+    hi_flash_deinit();
+    ret = hi_flash_init();
+    if (ret != HI_ERR_SUCCESS) {
+        err_info |= 1 << 0x6;
+        printf("flash init status:0x%x\n", err_info);
+        return;
+    }
+
+    ret = hi_factory_nv_init(HI_FNV_DEFAULT_ADDR, HI_NV_DEFAULT_TOTAL_SIZE, HI_NV_DEFAULT_BLOCK_SIZE);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("factory nv init fail\r\n");
+        return;
+    }
+
+    /* read factory nv data(which nv id is 0x1) from board */
+    ret = hi_factory_nv_read(HI_FACTORY_NV_DEMO_ID, &cfg, sizeof(cfg), 0);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("factory nv read fail\r\n");
+        return;
+    }
+    printf("factory nv read success, cfg.nv_demo_test_num0:%d\r\n", cfg.nv_factory_demo_test_num0);
+
+    cfg1.nv_factory_demo_test_num0 = 0x3;
+
+    /* write factory nv data(which nv id is 0x1) to board */
+    ret = hi_factory_nv_write(HI_FACTORY_NV_DEMO_ID, &cfg1, sizeof(cfg1), 0);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("factory nv write fail\r\n");
+        return;
+    }
+    printf("factory nv write success\r\n");
+    ret = hi_factory_nv_read(HI_FACTORY_NV_DEMO_ID, &cfg, sizeof(cfg), 0);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("factory nv read fail\r\n");
+        return;
+    }
+    printf("factory nv read success, cfg.nv_demo_test_num0:%d\r\n", cfg.nv_factory_demo_test_num0);
+}
+

+ 73 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_pwm.c

@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <app_demo_pwm.h>
+
+hi_void pwm_0_demo(hi_void)
+{
+    hi_pwm_init(HI_PWM_PORT_PWM0);
+    hi_pwm_set_clock(PWM_CLK_160M);
+    hi_pwm_start(HI_PWM_PORT_PWM0, 750, 1500); /* duty: 750 freq:1500 */
+}
+
+hi_void pwm_1_demo(hi_void)
+{
+    hi_pwm_init(HI_PWM_PORT_PWM1);
+    hi_pwm_set_clock(PWM_CLK_160M);
+    hi_pwm_start(HI_PWM_PORT_PWM1, 750, 1500); /* duty: 750 freq:1500 */
+}
+
+hi_void pwm_2_demo(hi_void)
+{
+    hi_pwm_init(HI_PWM_PORT_PWM2);
+    hi_pwm_set_clock(PWM_CLK_160M);
+    hi_pwm_start(HI_PWM_PORT_PWM2, 750, 1500); /* duty: 750 freq:1500 */
+}
+
+hi_void pwm_3_demo(hi_void)
+{
+    hi_pwm_init(HI_PWM_PORT_PWM3);
+    hi_pwm_set_clock(PWM_CLK_160M);
+    hi_pwm_start(HI_PWM_PORT_PWM3, 750, 1500); /* duty: 750 freq:1500 */
+}
+
+hi_void pwm_4_demo(hi_void)
+{
+    hi_pwm_init(HI_PWM_PORT_PWM4);
+    hi_pwm_set_clock(PWM_CLK_160M);
+    hi_pwm_start(HI_PWM_PORT_PWM4, 750, 1500); /* duty: 750 freq:1500 */
+}
+
+hi_void pwm_5_demo(hi_void)
+{
+    hi_pwm_init(HI_PWM_PORT_PWM5);
+    hi_pwm_set_clock(PWM_CLK_160M);
+    hi_pwm_start(HI_PWM_PORT_PWM5, 750, 1500); /* duty: 750 freq:1500 */
+}
+
+hi_void app_demo_pwm(hi_void)
+{
+    printf("start test pwm");
+
+    pwm_0_demo();
+    pwm_1_demo();
+    pwm_2_demo();
+    pwm_3_demo();
+    pwm_4_demo();
+    pwm_5_demo();
+
+    printf("please use an oscilloscope to check the output waveform!");
+}
+

+ 197 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_sdio_device.c

@@ -0,0 +1,197 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Description: app sdio slave demo: shows send and receive data with sdio.
+ */
+
+#include <hi_early_debug.h>
+#include <hi_watchdog.h>
+#include <hi_sdio_device.h>
+#include <hi_cipher.h>
+#include <hi_cpu.h>
+
+#define  DATA_BLOCK         32768 /* sdio data block size:32768 */
+#define SEND_RCV_DATA_SIZE  1024  /* send/recv 1024 byte per cycle */
+hi_u32 g_sdio_send_data[SEND_RCV_DATA_SIZE] = {0}; /* data array of data to be send */
+hi_u32* g_sdio_send_data_addr = NULL;
+
+hi_s32 app_demo_sdio_read_over_callback(hi_void)
+{
+    printf("app_demo_sdio_read_over_callback\r\n");
+    return HI_ERR_SUCCESS;
+}
+
+hi_s32 app_demo_sdio_read_start_callback(hi_u32 len, hi_u8* admatable)
+{
+    hi_watchdog_feed();
+
+    hi_u32 i;
+    hi_u32 remain;
+    hi_u32 index = 0;
+    hi_u32* addr = NULL;
+    g_sdio_send_data_addr = &g_sdio_send_data[0];
+
+    for (i = 0; i < (len / DATA_BLOCK); i++) {
+        addr = g_sdio_send_data_addr + ((DATA_BLOCK >> 2) * i); /* 2 bits for g_download_addr is hi_u32 */
+        if (hi_sdio_set_admatable(admatable, index++, addr, DATA_BLOCK) != 0) {
+            return HI_ERR_FAILURE;
+        }
+    }
+
+    remain = len % DATA_BLOCK;
+    if (remain != 0) {
+        addr = g_sdio_send_data_addr + ((DATA_BLOCK >> 2) * i); /* 2 bits for g_download_addr is hi_u32 */
+        if (hi_sdio_set_admatable(admatable, index++, addr, remain) != 0) {
+            return HI_ERR_FAILURE;
+        }
+    }
+
+    if (hi_sdio_complete_send(admatable, index) != 0) {
+        return  HI_ERR_FAILURE;
+    }
+
+    hi_cache_flush();
+    return (hi_s32) index;
+}
+
+hi_u32 g_receive_data[SEND_RCV_DATA_SIZE] = {0}; /* data array to receive data */
+hi_u32* g_receive_data_addr = NULL;
+hi_u32 g_recevei_data_len = 0;
+hi_s32 app_demo_sdio_write_start_callback(hi_u32 len, hi_u8* admatable)
+{
+    printf("app_demo_sdio_write_start_callback,len: %d\n",  len);
+    hi_watchdog_feed();
+    g_receive_data_addr = &g_receive_data[0];
+    g_recevei_data_len = len;
+
+    hi_u32 i;
+    hi_u32 remain;
+    hi_u32 index = 0;
+    hi_u32* addr = NULL;
+
+    for (i = 0; i < (len / DATA_BLOCK); i++) {
+        addr = g_receive_data_addr + ((DATA_BLOCK >> 2) * i); /* shift 2bits is for hi_u32* reason. */
+        if (hi_sdio_set_admatable(admatable, index++, addr, DATA_BLOCK) != 0) {
+            return HI_ERR_FAILURE;
+        }
+    }
+
+    remain = len % DATA_BLOCK;
+
+    if (remain != 0) {
+        addr = g_receive_data_addr + ((DATA_BLOCK >> 2) * i); /* shift 2bits is for hi_u32* reason. */
+        if (hi_sdio_set_admatable(admatable, index++, addr, remain) != 0) {
+            return HI_ERR_FAILURE;
+        }
+    }
+
+    if (hi_sdio_complete_send(admatable, index) != 0) {
+        return HI_ERR_FAILURE;
+    }
+
+    hi_cache_flush();
+    return (hi_s32) index;
+}
+
+hi_s32 app_demo_sdio_write_over_callback(hi_void)
+{
+    printf("app_demo_sdio_write_over_callback, len:%d\n", g_recevei_data_len);
+
+    hi_u8* received_data = (hi_u8*)(&g_receive_data[0]);
+    for (hi_u32 i = 0; i < g_recevei_data_len; i++) {
+        if (i % 8 == 0) { /* 8:Newline */
+            printf ("\r\n");
+        }
+        printf("0x%x ", received_data[i]);
+    }
+    return HI_ERR_SUCCESS;
+}
+
+hi_void app_demo_sdio_receive_msg_callback(hi_u32 msg)
+{
+    printf("app_demo_sdio_receive_msg_callback:0x%x\n", msg);
+}
+
+hi_void app_demo_sdio_read_err_callback(hi_void)
+{
+    printf("app_demo_sdio_read_err_callback\n");
+}
+
+hi_void app_demo_sdio_soft_rst_callback(hi_void)
+{
+    printf("app_demo_sdio_soft_rst_callback\r\n");
+}
+
+hi_void app_demo_sdio_send_data(hi_void)
+{
+    printf("app demo sdio start send data\r\n");
+
+    hi_u8* send_data = (hi_u8*)&g_sdio_send_data[0];
+    hi_cipher_trng_get_random_bytes(send_data, SEND_RCV_DATA_SIZE);
+    hi_sdio_send_data(SEND_RCV_DATA_SIZE);
+
+    return;
+}
+
+hi_void app_demo_sdio_send_msg(hi_void)
+{
+    hi_sdio_send_sync_msg(0);
+    return;
+}
+
+hi_void app_demo_sdio_callback_init(hi_void)
+{
+    hi_sdio_intcallback callback;
+
+    callback.rdover_callback     = app_demo_sdio_read_over_callback;
+    callback.rdstart_callback    = app_demo_sdio_read_start_callback;
+    callback.wrstart_callback    = app_demo_sdio_write_start_callback;
+    callback.wrover_callback     = app_demo_sdio_write_over_callback;
+    callback.processmsg_callback = app_demo_sdio_receive_msg_callback;
+    callback.rderr_callback      = app_demo_sdio_read_err_callback;
+    callback.soft_rst_callback   = app_demo_sdio_soft_rst_callback;
+    (hi_void)hi_sdio_register_callback(&callback);
+
+    printf("app_demo_sdio_callback_init success\r\n");
+}
+
+hi_void app_demo_sdio(hi_void)
+{
+    hi_u32 ret;
+    /* init sdio */
+    /* should config io in app_io_init first. */
+    ret = hi_sdio_init();
+    if (ret != HI_ERR_SUCCESS) {
+        printf("app demo sdio init fail\r\n");
+        return;
+    }
+
+    /* register sdio interrupt callbak. */
+    app_demo_sdio_callback_init();
+
+    /* sdio send and receive msg */
+    /* when host send msg to device, device will receive msg in
+     * app_demo_sdio_receive_msg_callback
+     */
+    app_demo_sdio_send_msg();
+
+    /* sdio send data */
+    app_demo_sdio_send_data();
+
+    /* sdio receive data */
+    /*
+     * when host send data to device, device will receive data in
+     * app_demo_sdio_write_start_callback, app_demo_sdio_write_over_callback
+     */
+}

+ 30 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_sdio_device.h

@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Description: app sdio slave demo headerfile.
+ */
+
+#ifndef __APP_DEMO_SDIO_DEVICE_H__
+#define __APP_DEMO_SDIO_DEVICE_H__
+
+#include <hi_types.h>
+#include <hi_early_debug.h>
+#include <hi_watchdog.h>
+#include <hi_sdio_device.h>
+#include <hi_cipher.h>
+#include <hi_cpu.h>
+
+hi_void app_demo_sdio_callback_init(hi_void);
+
+#endif

+ 937 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_spi.c

@@ -0,0 +1,937 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <app_demo_spi.h>
+
+hi_u8 g_spi_send_buf[BUF_LENGTH];
+hi_u8 g_spi_rcv_buf[BUF_LENGTH];
+hi_spi_idx g_spi_id = HI_SPI_ID_0;
+hi_u32 g_transfer_lenth = 0;
+hi_u32 g_test_loop = 0;
+hi_u32 g_lb_loop = 0;
+hi_u32 g_delay_us_spi = 0;
+hi_spi_cfg_data_width g_data_width = HI_SPI_CFG_DATA_WIDTH_E_7BIT;
+
+hi_void prepare_func(hi_void)
+{
+    test_spi_printf("prepare");
+}
+
+hi_void restore_func(hi_void)
+{
+    test_spi_printf("restore");
+}
+
+hi_void app_demo_spi_print_reg(hi_spi_idx spi_id)
+{
+    hi_u16 reg_val;
+    hi_u32 reg_base;
+    if (spi_id == HI_SPI_ID_0) {
+        reg_base = HI_SSP0_REG_BASE;
+    } else {
+        reg_base = HI_SSP1_REG_BASE;
+    }
+    test_spi_printf("BASE_ADDR=%x", reg_base);
+    reg_val = hi_reg_read_val16(reg_base + 0x00);
+    test_spi_printf("REG_SPI_CR0=%x", reg_val);
+    reg_val = hi_reg_read_val16(reg_base + 0x04);
+    test_spi_printf("REG_SPI_CR1=%x", reg_val);
+    reg_val = hi_reg_read_val16(reg_base + 0x0c);
+    test_spi_printf("REG_SPI_SR=%x", reg_val);
+    reg_val = hi_reg_read_val16(reg_base + 0x10);
+    test_spi_printf("REG_SPI_CPSR=%x", reg_val);
+    reg_val = hi_reg_read_val16(reg_base + 0x14);
+    test_spi_printf("REG_SPI_IMSC=%x", reg_val);
+    reg_val = hi_reg_read_val16(reg_base + 0x18);
+    test_spi_printf("REG_SPI_RIS=%x", reg_val);
+    reg_val = hi_reg_read_val16(reg_base + 0x1c);
+    test_spi_printf("REG_SPI_MIS=%x", reg_val);
+    reg_val = hi_reg_read_val16(reg_base + 0x24);
+    test_spi_printf("REG_SPI_DMACR=%x", reg_val);
+    reg_val = hi_reg_read_val16(reg_base + 0x28);
+    test_spi_printf("REG_SPI_TXFIFOCR=%x", reg_val);
+    reg_val = hi_reg_read_val16(reg_base + 0x2c);
+    test_spi_printf("REG_SPI_RXFIFOCR=%x", reg_val);
+}
+
+hi_void app_demo_spi_print_test_para(const test_spi_para *spi_para)
+{
+    if (spi_para == HI_NULL) {
+        test_spi_printf("spi para is null\n");
+        return;
+    }
+    test_spi_printf("cpol:%d", spi_para->cfg_info.cpol);
+    test_spi_printf("cpha:%d", spi_para->cfg_info.cpha);
+    test_spi_printf("fram_mode:%d", spi_para->cfg_info.fram_mode);
+    test_spi_printf("data_width:%d", spi_para->cfg_info.data_width);
+    test_spi_printf("freq:%d", spi_para->cfg_info.freq);
+    test_spi_printf("spi id:%d", spi_para->spi_id);
+    test_spi_printf("loop:%d", spi_para->loop);
+    test_spi_printf("length:%d", spi_para->length);
+    test_spi_printf("irq:%d", spi_para->irq);
+    test_spi_printf("slave:%d", spi_para->slave);
+    test_spi_printf("lb:%d", spi_para->lb);
+    test_spi_printf("dma en:%d", spi_para->dma_en);
+    test_spi_printf("delay:%d", g_delay_us_spi);
+}
+
+hi_void print_err_send_buf_u8(const hi_u8 *buf, hi_u32 len)
+{
+    hi_u32 i;
+    for (i = 0; i < len; i++) {
+        test_spi_printf("%d", buf[i]);
+    }
+}
+
+hi_void print_err_send_buf_u16(const hi_u16 *buf, hi_u32 len)
+{
+    hi_u32 i;
+    for (i = 0; i < len; i++) {
+        test_spi_printf("%d", buf[i]);
+    }
+}
+
+hi_void print_err_rev_buf_u16(const hi_u16 *buf, const hi_u16 *cmp, hi_u32 len)
+{
+    hi_u32 i;
+    for (i = 0; i < len; i++) {
+        test_spi_printf("%d, %d", cmp[i], buf[i]);
+    }
+}
+hi_void print_err_rev_buf_u8(const hi_u8 *buf, const hi_u8 *cmp, hi_u32 len)
+{
+    hi_u32 i;
+    for (i = 0; i < len; i++) {
+        test_spi_printf("%d, %d", cmp[i], buf[i]);
+    }
+}
+
+
+hi_u32 app_demo_spi_init(hi_spi_idx id, const hi_spi_cfg_basic_info *spi_cfg_basic_info, hi_bool slave)
+{
+    hi_u32 ret;
+    hi_spi_cfg_init_param init_param;
+    init_param.is_slave = slave;
+    ret = hi_spi_init(id, init_param, spi_cfg_basic_info);
+
+    test_spi_printf("app_demo_spi_init ret=%x", ret);
+    return ret;
+}
+
+hi_void app_demo_spi_config_gpio(hi_spi_idx id)
+{
+    if (id == HI_SPI_ID_0) {
+        hi_io_set_func(HI_IO_NAME_GPIO_5, HI_IO_FUNC_GPIO_5_SPI0_CSN);
+        hi_io_set_func(HI_IO_NAME_GPIO_6, HI_IO_FUNC_GPIO_6_SPI0_CK);
+        hi_io_set_func(HI_IO_NAME_GPIO_7, HI_IO_FUNC_GPIO_7_SPI0_RXD);
+        hi_io_set_func(HI_IO_NAME_GPIO_8, HI_IO_FUNC_GPIO_8_SPI0_TXD);
+        hi_io_set_driver_strength(HI_IO_NAME_GPIO_6, HI_IO_DRIVER_STRENGTH_2);
+    } else {
+        hi_io_set_func(HI_IO_NAME_GPIO_0, HI_IO_FUNC_GPIO_0_SPI1_CK);
+        hi_io_set_func(HI_IO_NAME_GPIO_1, HI_IO_FUNC_GPIO_1_SPI1_RXD);
+        hi_io_set_func(HI_IO_NAME_GPIO_2, HI_IO_FUNC_GPIO_2_SPI1_TXD);
+        hi_io_set_func(HI_IO_NAME_GPIO_3, HI_IO_FUNC_GPIO_3_SPI1_CSN);
+        hi_io_set_driver_strength(HI_IO_NAME_GPIO_0, HI_IO_DRIVER_STRENGTH_2);
+    }
+}
+
+hi_u32 app_demo_spi_slave_send_8bits(hi_spi_idx spi_id)
+{
+    hi_u32 i;
+    hi_u32 j;
+    hi_u32 while_times = 0;
+    hi_u32 ret;
+    hi_u32 err_times = 0;
+    if (g_transfer_lenth > BUF_LENGTH) {
+        return HI_ERR_FAILURE;
+    }
+    i = 0;
+    for (j = 0; j < g_transfer_lenth; j++) {
+        g_spi_send_buf[j] = (hi_u8)i;
+        i++;
+    }
+    do {
+        ret = hi_spi_slave_write(spi_id, g_spi_send_buf, g_transfer_lenth, 10000);  /* time out 10000 ms */
+        if (ret != HI_ERR_SUCCESS) {
+            err_times += 1;
+            break;
+        }
+        hi_watchdog_feed();
+        while_times++;
+    } while (while_times < g_test_loop || g_test_loop == 0);
+    test_spi_printf("demo_spi_slave_send err_send: %d,while_times:%d, ret:%x", err_times, while_times, ret);
+    return ret;
+}
+
+hi_u32 app_demo_spi_slave_send_16bits(hi_spi_idx spi_id)
+{
+    hi_u32 i;
+    hi_u32 j;
+    hi_u32 while_times = 0;
+    hi_u32 ret = HI_ERR_SUCCESS;
+    hi_u32 index;
+    hi_u32 err_times = 0;
+    hi_u32 send_len;
+    do {
+        i = 0;
+        index = 0;
+        while (index < g_transfer_lenth) {
+            send_len = min(g_transfer_lenth - index, BUF_LENGTH_HALF);
+            for (j = 0; j < send_len; j++) { /* loops 256 */
+                *((hi_u16 *)g_spi_send_buf + j) = (hi_u16)i;
+                i++;
+            }
+            ret = hi_spi_slave_write(spi_id, g_spi_send_buf, send_len * 2, 10000);  /* 2:doubule the length 10000:ms */
+            if (ret != HI_ERR_SUCCESS) {
+                err_times++;
+                print_err_send_buf_u16((hi_u16 *)g_spi_send_buf, send_len);
+                break;
+            }
+            hi_watchdog_feed();
+            index += send_len; /* add 256 */
+        }
+        while_times++;
+    } while (while_times < g_test_loop || g_test_loop == 0);
+    test_spi_printf("demo_spi_slave_send err_send: %d,while_times:%d, ret:%x", err_times, while_times, ret);
+    return ret;
+}
+
+hi_void *app_demo_spi_slave_send_task(hi_void *param)
+{
+    hi_spi_idx spi_id = *(hi_spi_idx*)param;
+    hi_u32 ret;
+    hi_u32 time_old;
+    hi_u32 time_new;
+    time_old = hi_get_milli_seconds();
+    if (g_data_width < HI_SPI_CFG_DATA_WIDTH_E_9BIT) {
+        ret = app_demo_spi_slave_send_8bits(spi_id);
+    } else {
+        ret = app_demo_spi_slave_send_16bits(spi_id);
+    }
+    if (ret != HI_ERR_SUCCESS) {
+        printf("app_demo_spi_slave_send fail: %x\n", ret);
+    }
+
+    time_new = hi_get_milli_seconds();
+    app_demo_spi_print_reg(spi_id);
+    test_spi_printf("demo_spi_slave_send time_old: %d,time_new %d, delt:%d", time_old, time_new, time_new - time_old);
+    ret = hi_spi_deinit(spi_id);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("hi_spi_deinit fail: %x\n", ret);
+    }
+    return HI_NULL;
+}
+
+hi_u32 app_demo_spi_slave_receive_8bits(hi_spi_idx spi_id)
+{
+    hi_u8 cmp_buf[BUF_LENGTH];
+    hi_u32 while_times = 0;
+    hi_u32 i;
+    hi_u32 j;
+    hi_u32 ret;
+    hi_u32 err_times = 0;
+    i = 0;
+    if (g_transfer_lenth > BUF_LENGTH) {
+        return HI_ERR_FAILURE;
+    }
+    for (j = 0; j < g_transfer_lenth; j++) {
+        cmp_buf[j] = (hi_u8)i;
+        i++;
+    }
+    do {
+        while_times++;
+        memset_s(g_spi_rcv_buf, sizeof(g_spi_rcv_buf), 0x0, sizeof(g_spi_rcv_buf));
+        ret = hi_spi_slave_read(spi_id, g_spi_rcv_buf, g_transfer_lenth, 10000); /* time out 10000 ms */
+        if ((memcmp(g_spi_rcv_buf, cmp_buf, g_transfer_lenth) != 0) || (ret != HI_ERR_SUCCESS)) {
+            err_times++;
+            print_err_rev_buf_u8(g_spi_rcv_buf, cmp_buf, g_transfer_lenth);
+            break;
+        }
+    } while (while_times < g_test_loop || g_test_loop == 0);
+    test_spi_printf("demo_spi_rev err_rev: %d,while_times:%d, ret:%x", err_times, while_times, ret);
+    return ret;
+}
+
+hi_u32 app_demo_spi_slave_receive_16bits(hi_spi_idx spi_id)
+{
+    hi_u8 cmp_buf[BUF_LENGTH];
+    hi_u32 while_times = 0;
+    hi_u32 i;
+    hi_u32 j;
+    hi_u32 k;
+    hi_u32 ret = HI_ERR_SUCCESS;
+    hi_u32 err_times = 0;
+    hi_u32 rcv_len;
+    do {
+        k = 0;
+        while_times++;
+        i = 0;
+        while (k < g_transfer_lenth) {
+            rcv_len = min(g_transfer_lenth - k, BUF_LENGTH_HALF);
+            for (j = 0; j < rcv_len; j++) {
+                *((hi_u16 *)cmp_buf + j) = (hi_u16)i;
+                i++;
+            }
+            memset_s(g_spi_rcv_buf, sizeof(g_spi_rcv_buf), 0x0, sizeof(g_spi_rcv_buf));
+            ret = hi_spi_slave_read(spi_id, g_spi_rcv_buf, rcv_len * 2, 10000);  /* 2:doubule the length 10000:ms */
+            if ((memcmp(g_spi_rcv_buf, cmp_buf, rcv_len) != 0) || (ret != HI_ERR_SUCCESS)) {
+                err_times++;
+                print_err_rev_buf_u16((hi_u16 *)g_spi_rcv_buf, (hi_u16 *)cmp_buf, rcv_len);
+                break;
+            }
+            hi_watchdog_feed();
+            k += rcv_len;
+        }
+    } while (while_times < g_test_loop || g_test_loop == 0);
+    test_spi_printf("demo_spi_slave_rev err_rev: %d,while_times:%d, ret:%x", err_times, while_times, ret);
+    return ret;
+}
+
+hi_void *app_demo_spi_slave_receive_task(hi_void *param)
+{
+    hi_spi_idx spi_id = *(hi_spi_idx*)param;
+    hi_u32 ret;
+    hi_u32 time_old;
+    hi_u32 time_new;
+    time_old = hi_get_milli_seconds();
+    if (g_data_width < HI_SPI_CFG_DATA_WIDTH_E_9BIT) {
+        ret = app_demo_spi_slave_receive_8bits(spi_id);
+    } else {
+        ret = app_demo_spi_slave_receive_16bits(spi_id);
+    }
+    if (ret != HI_ERR_SUCCESS) {
+        printf("app_demo_spi_slave_receive fail: %x\n", ret);
+    }
+
+    time_new = hi_get_milli_seconds();
+    test_spi_printf("time_old: %d,time_new %d, delt:%d", time_old, time_new, time_new - time_old);
+    app_demo_spi_print_reg(spi_id);
+    ret = hi_spi_deinit(spi_id);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("hi_spi_deinit fail: %x\n", ret);
+    }
+    return HI_NULL;
+}
+
+hi_void *app_demo_spi_host_write_read_task(hi_void *param)
+{
+    hi_spi_idx spi_id = *(hi_spi_idx*)param;
+    hi_u32 ret;
+    hi_u32 i;
+    hi_u8 send_buf[g_transfer_lenth];
+    hi_u8 recv_buf[g_transfer_lenth + 1];
+    hi_u32 while_times = 0;
+    hi_u32 err_times = 0;
+    hi_u32 time_old;
+    hi_u32 time_new;
+    for (i = 0; i < g_transfer_lenth; i++) {
+        send_buf[i] = (hi_u8)i;
+    }
+    time_old = hi_get_milli_seconds();
+    do {
+        memset_s(recv_buf, sizeof(recv_buf), 0x0, sizeof(recv_buf));
+        ret = hi_spi_host_writeread(spi_id, send_buf, recv_buf, g_transfer_lenth);
+        if (memcmp(recv_buf, send_buf, g_transfer_lenth) != 0 || ret != HI_ERR_SUCCESS) {
+            err_times++;
+        }
+        while_times++;
+    } while (while_times < g_test_loop || g_test_loop == 0);
+    time_new = hi_get_milli_seconds();
+    test_spi_printf("while_times:%d ,err_times:%d", while_times, err_times);
+    test_spi_printf("time_old: %d,time_new %d, delt:%d", time_old, time_new, time_new - time_old);
+    app_demo_spi_print_reg(spi_id);
+    return HI_NULL;
+}
+
+hi_u32 app_demo_spi_host_send_8bits(hi_spi_idx spi_id)
+{
+    hi_u32 i;
+    hi_u32 j;
+    hi_u32 while_times = 0;
+    hi_u32 err_times = 0;
+    hi_u32 ret;
+    if (g_transfer_lenth > BUF_LENGTH) {
+        return HI_ERR_FAILURE;
+    }
+    i = 0;
+    for (j = 0; j < g_transfer_lenth; j++) {
+        g_spi_send_buf[j] = (hi_u8)i;
+        i++;
+    }
+    do {
+        ret = hi_spi_host_write(spi_id, g_spi_send_buf, g_transfer_lenth);
+        hi_udelay(g_delay_us_spi);
+        if (ret != HI_ERR_SUCCESS) {
+            err_times++;
+            break;
+        }
+        while_times++;
+    } while (while_times < g_test_loop || g_test_loop == 0);
+    test_spi_printf("demo_spi_host_send err_send: %d,while_times:%d, ret:%x", err_times, while_times, ret);
+    return ret;
+}
+
+hi_u32 app_demo_spi_host_send_16bits(hi_spi_idx spi_id)
+{
+    hi_u32 i;
+    hi_u32 j;
+    hi_u32 while_times = 0;
+    hi_u32 ret = HI_ERR_SUCCESS;
+    hi_u32 index;
+    hi_u32 err_times = 0;
+    hi_u32 send_len;
+    do {
+        i = 0;
+        index = 0;
+        while (index < g_transfer_lenth) {
+            send_len = min(g_transfer_lenth - index, BUF_LENGTH_HALF);
+            for (j = 0; j < send_len; j++) {
+                *((hi_u16 *)g_spi_send_buf + j) = (hi_u16)i;
+                i++;
+            }
+            ret = hi_spi_host_write(spi_id, g_spi_send_buf, send_len * 2);  /* 2:doubule the length */
+            hi_udelay(g_delay_us_spi);
+            if (ret != HI_ERR_SUCCESS) {
+                err_times++;
+                print_err_send_buf_u16((hi_u16 *)g_spi_send_buf, send_len);
+            }
+            hi_watchdog_feed();
+            index += send_len;
+        }
+        while_times++;
+    } while (while_times < g_test_loop || g_test_loop == 0);
+    test_spi_printf("demo_spi_slave_send err_send: %d,while_times:%d, ret:%x", err_times, while_times, ret);
+    return ret;
+}
+/*
+ * spi host device write data task
+ */
+hi_void *app_demo_spi_host_write_task(hi_void *param)
+{
+    hi_spi_idx spi_id = *(hi_spi_idx*)param;
+    hi_u32 ret;
+    hi_u32 time_old;
+    hi_u32 time_new;
+    time_old = hi_get_milli_seconds();
+    if (g_data_width < HI_SPI_CFG_DATA_WIDTH_E_9BIT) {
+        ret = app_demo_spi_host_send_8bits(spi_id);
+    } else {
+        ret = app_demo_spi_host_send_16bits(spi_id);
+    }
+    if (ret != HI_ERR_SUCCESS) {
+        printf("app_demo_spi_host_send fail: %x\n", ret);
+    }
+    time_new = hi_get_milli_seconds();
+    test_spi_printf("time_old: %d,time_new %d, delt:%d", time_old, time_new, time_new - time_old);
+    app_demo_spi_print_reg(spi_id);
+    ret = hi_spi_deinit(spi_id);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("hi_spi_deinit fail: %x\n", ret);
+        return HI_NULL;
+    }
+    return HI_NULL;
+}
+
+hi_u32 app_demo_spi_host_receive_8bits(hi_spi_idx spi_id)
+{
+    hi_u8 cmp_buf[BUF_LENGTH];
+    hi_u32 while_times = 0;
+    hi_u32 i;
+    hi_u32 j;
+    hi_u32 err_times = 0;
+    hi_u32 ret;
+    i = 0;
+    if (g_transfer_lenth > BUF_LENGTH) {
+        return HI_ERR_FAILURE;
+    }
+    for (j = 0; j < g_transfer_lenth; j++) {
+        cmp_buf[j] = (hi_u8)i;
+        i++;
+    }
+    do {
+        while_times++;
+        if (memset_s(g_spi_rcv_buf, sizeof(g_spi_rcv_buf), 0x0, sizeof(g_spi_rcv_buf)) != EOK) {
+            ret = HI_ERR_MEMSET_S;
+            break;
+        }
+        ret = hi_spi_host_read(spi_id, g_spi_rcv_buf, g_transfer_lenth);
+        hi_udelay(g_delay_us_spi);
+        if (memcmp(g_spi_rcv_buf, cmp_buf, g_transfer_lenth) != 0) {
+            err_times++;
+            print_err_rev_buf_u8(g_spi_rcv_buf, cmp_buf, g_transfer_lenth);
+            break;
+        }
+    } while (while_times < g_test_loop || g_test_loop == 0);
+    test_spi_printf("demo_spi_host_rev err_rev: %d,while_times:%d, ret:%x", err_times, while_times, ret);
+    return ret;
+}
+
+hi_u32 app_demo_spi_host_receive_16bits(hi_spi_idx spi_id)
+{
+    hi_u8 cmp_buf[BUF_LENGTH];
+    hi_u32 while_times = 0;
+    hi_u32 err_times = 0;
+    hi_u32 i;
+    hi_u32 j;
+    hi_u32 k;
+    hi_u32 ret = HI_ERR_SUCCESS;
+    hi_u32 recv_len;
+    do {
+        k = 0;
+        while_times++;
+        i = 0;
+        while (k < g_transfer_lenth) {
+            recv_len = min(g_transfer_lenth - k, BUF_LENGTH_HALF);
+            for (j = 0; j < recv_len; j++) {
+                *((hi_u16 *)cmp_buf + j) = (hi_u16)i;
+                i++;
+            }
+            memset_s(g_spi_rcv_buf, sizeof(g_spi_rcv_buf), 0x0, sizeof(g_spi_rcv_buf));
+            ret = hi_spi_host_read(spi_id, g_spi_rcv_buf, recv_len * 2); /* 2:doubule the length */
+            hi_udelay(g_delay_us_spi);
+            if (memcmp(g_spi_rcv_buf, cmp_buf, recv_len * 2) != 0) {  /* 2:doubule the length */
+                err_times++;
+                print_err_rev_buf_u16((hi_u16 *)g_spi_rcv_buf, (hi_u16 *)cmp_buf, recv_len);
+                break;
+            }
+            hi_watchdog_feed();
+            k += recv_len;
+        }
+    } while (while_times < g_test_loop || g_test_loop == 0);
+    test_spi_printf("demo_spi_host_rev err_rev: %d,while_times:%d, ret:%x", err_times, while_times, ret);
+    return ret;
+}
+
+/*
+ * spi host device read data task
+ */
+hi_void *app_demo_spi_host_read_task(hi_void *param)
+{
+    hi_spi_idx spi_id = *(hi_spi_idx*)param;
+    printf("spi_id:%d\n", spi_id);
+    hi_u32 ret;
+    hi_u32 time_old;
+    hi_u32 time_new;
+    time_old = hi_get_milli_seconds();
+    if (g_data_width < HI_SPI_CFG_DATA_WIDTH_E_9BIT) {
+        ret = app_demo_spi_host_receive_8bits(spi_id);
+    } else {
+        ret = app_demo_spi_host_receive_16bits(spi_id);
+    }
+    if (ret != HI_ERR_SUCCESS) {
+        printf("app_demo_spi_host_receive fail: %x\n", ret);
+    }
+    time_new = hi_get_milli_seconds();
+    test_spi_printf("time_old: %d,time_new %d, delt:%d", time_old, time_new, time_new - time_old);
+    app_demo_spi_print_reg(spi_id);
+    ret = hi_spi_deinit(spi_id);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("hi_spi_deinit fail: %x\n", ret);
+    }
+    return HI_NULL;
+}
+
+/*
+ * host device write data and slave device read data
+ */
+hi_void app_demo_spi_test_cmd_mw_sr(const test_spi_para *spi_para)
+{
+    hi_u32 ret;
+    hi_u32 taskid1;
+    hi_task_attr attr;
+
+    test_spi_printf("app_demo_spi_test_cmd_mw_sr Start");
+    ret = app_demo_spi_init(spi_para->spi_id, &(spi_para->cfg_info), spi_para->slave);
+
+    g_transfer_lenth = spi_para->length;
+    g_spi_id = spi_para->spi_id;
+    if (ret == HI_ERR_SUCCESS) {
+        test_spi_printf("SPI init succ!");
+    } else {
+        test_spi_printf("SPI init fail! %x ", ret);
+        return;
+    }
+    hi_spi_set_loop_back_mode(spi_para->spi_id, spi_para->lb);
+    app_demo_spi_config_gpio(spi_para->spi_id);
+    g_test_loop = spi_para->loop;
+    g_data_width = (hi_spi_cfg_data_width)spi_para->cfg_info.data_width;
+    hi_sleep(1000); /* 1000 */
+    hi_spi_set_irq_mode(spi_para->spi_id, spi_para->irq);
+    hi_spi_set_dma_mode(spi_para->spi_id, spi_para->dma_en);
+    if (spi_para->slave == 0) {
+        attr.task_prio = 5; /* priority 5 */
+        attr.stack_size = 0x2000;
+        attr.task_name = (hi_char *)"spi_host";
+        ret = hi_task_create(&taskid1, &attr, app_demo_spi_host_write_task, (hi_void *)&spi_para->spi_id);
+    } else {
+        attr.task_prio = 5; /* priority 5 */
+        attr.stack_size = 0x2000;
+        attr.task_name = (hi_char *)"r_spi_slave";
+        ret = hi_task_create(&taskid1, &attr, app_demo_spi_slave_receive_task, (hi_void *)&spi_para->spi_id);
+    }
+    test_spi_printf("SPI Test End!");
+}
+
+/*
+ * host device read data and slave device write data
+ */
+hi_void app_demo_spi_test_cmd_mr_sw(const test_spi_para *spi_para)
+{
+    hi_u32 ret;
+    hi_u32 taskid1;
+    hi_task_attr attr;
+
+    test_spi_printf("app_demo_spi_test_cmd_mr_sw Start");
+    ret = app_demo_spi_init(spi_para->spi_id, &(spi_para->cfg_info), spi_para->slave);
+    app_demo_spi_config_gpio(spi_para->spi_id);
+    g_transfer_lenth = spi_para->length;
+    g_spi_id = spi_para->spi_id;
+    g_data_width = (hi_spi_cfg_data_width)spi_para->cfg_info.data_width;
+    if (ret == HI_ERR_SUCCESS) {
+        test_spi_printf("SPI init succ!");
+    } else {
+        test_spi_printf("SPI init fail! %x ", ret);
+        return;
+    }
+    hi_spi_set_loop_back_mode(spi_para->spi_id, spi_para->lb);
+    g_test_loop = spi_para->loop;
+    hi_sleep(1000); /* 1000 */
+    hi_spi_set_irq_mode(spi_para->spi_id, spi_para->irq);
+    ret = hi_spi_set_dma_mode(spi_para->spi_id, spi_para->dma_en);
+    printf("hi_spi_set_dma_mode :%x\n", ret);
+    if (spi_para->slave == 0) {
+        attr.task_prio = 25; /* priority 25 */
+        attr.stack_size = 0x2000;
+        attr.task_name = (hi_char *)"spi_host";
+        ret = hi_task_create(&taskid1, &attr, app_demo_spi_host_read_task, (hi_void *)&spi_para->spi_id);
+    } else {
+        attr.task_prio = 25; /* priority 25 */
+        attr.stack_size = 0x2000;
+        attr.task_name = (hi_char *)"w_spi_slave";
+        ret = hi_task_create(&taskid1, &attr, app_demo_spi_slave_send_task, (hi_void *)&spi_para->spi_id);
+    }
+    test_spi_printf("SPI Test End!");
+}
+
+hi_u32 app_demo_spi_single_loopback(hi_spi_idx spi_id, hi_u8 data_width)
+{
+    hi_u32 ret;
+    hi_u32 i;
+    hi_u8 send_buf[512] = { 0 }; /* 512 */
+    hi_u8 recv_buf[512] = { 0 }; /* 512 */
+    hi_u32 test_length = 243; /* 243: test length */
+    hi_u32 while_times = 0;
+    do {
+        if (data_width < HI_SPI_CFG_DATA_WIDTH_E_8BIT) {
+            test_length = (0x1 << data_width) - 1;
+        }
+        while_times++;
+        printf("while_times:%d \n", while_times);
+        memset_s(recv_buf, sizeof(recv_buf), 0x0, sizeof(recv_buf));
+        if (data_width >= HI_SPI_CFG_DATA_WIDTH_E_9BIT) {
+            for (i = 0; i < 256; i++) { /* loop 256 times */
+                *((hi_u16 *)send_buf + i) = (hi_u16)i;
+            }
+            ret = hi_spi_host_writeread(spi_id, (hi_pvoid)send_buf, (hi_pvoid)recv_buf, test_length * 2); /* 2 */
+            if (ret != HI_ERR_SUCCESS) {
+                return ret;
+            }
+            if (memcmp(recv_buf, send_buf, test_length * 2) != 0) { /* 2 double buf length */
+                print_err_rev_buf_u16((hi_u16 *)send_buf, (hi_u16 *)recv_buf, test_length);
+                return HI_ERR_FAILURE;
+            }
+            continue;
+        }
+        for (i = 0; i < 512; i++) { /* 512 */
+            send_buf[i] = (hi_u8)i;
+        }
+        ret = hi_spi_host_writeread(spi_id, (hi_pvoid)send_buf, (hi_pvoid)recv_buf, test_length);
+        if (ret != HI_ERR_SUCCESS) {
+            return ret;
+        }
+        if (memcmp(recv_buf, send_buf, test_length) != 0) {
+            for (i = 0; i < test_length; i++) {
+                test_spi_printf("b[%d]i[%d]s[%d]r[%d]", data_width + 1, i, send_buf[i], recv_buf[i]);
+            }
+            return HI_ERR_FAILURE;
+        }
+    } while (while_times <= g_lb_loop);
+    return ret;
+}
+
+hi_u32 app_demo_spi_para_test(hi_spi_cfg_basic_info *spi_para)
+{
+    hi_u32 ret;
+    spi_para->data_width = 2; /* data width 2 */
+    ret = hi_spi_set_basic_info(g_spi_id, spi_para);
+    if (ret != HI_ERR_SPI_PARAMETER_WRONG) {
+        return HI_ERR_FAILURE;
+    }
+    spi_para->data_width = HI_SPI_CFG_DATA_WIDTH_E_8BIT;
+    spi_para->fram_mode = 3; /* data protocol 3 */
+    ret = hi_spi_set_basic_info(g_spi_id, spi_para);
+    if (ret != HI_ERR_SPI_PARAMETER_WRONG) {
+        return HI_ERR_FAILURE;
+    }
+    spi_para->fram_mode = HI_SPI_CFG_FRAM_MODE_MOTOROLA;
+    spi_para->freq = 80000000; /* Clock rate 13 80000000 */
+    ret = hi_spi_set_basic_info(g_spi_id, spi_para);
+    if (ret != HI_ERR_SPI_PARAMETER_WRONG) {
+        return HI_ERR_FAILURE;
+    }
+    spi_para->freq = 1000; /* Clock rate 256 1000 */
+    ret = hi_spi_set_basic_info(g_spi_id, spi_para);
+    if (ret != HI_ERR_SPI_PARAMETER_WRONG) {
+        return HI_ERR_FAILURE;
+    }
+    spi_para->freq = 2000000; /* Clock rate 24 2000000 */
+    return HI_ERR_SUCCESS;
+}
+
+hi_void app_demo_spi_test_case_part1(hi_spi_cfg_basic_info *spi_para, hi_u8 test_case)
+{
+    switch (test_case) {
+        case TEST_CASE_POL0_PHA0:
+            spi_para->cpol = HI_SPI_CFG_CLOCK_CPOL_0;
+            spi_para->cpha = HI_SPI_CFG_CLOCK_CPHA_0;
+            break;
+        case TEST_CASE_POL0_PHA1:
+            spi_para->cpol = HI_SPI_CFG_CLOCK_CPOL_0;
+            spi_para->cpha = HI_SPI_CFG_CLOCK_CPHA_1;
+            break;
+        case TEST_CASE_POL1_PHA0:
+            spi_para->cpol = HI_SPI_CFG_CLOCK_CPOL_1;
+            spi_para->cpha = HI_SPI_CFG_CLOCK_CPHA_0;
+            break;
+        case TEST_CASE_POL1_PHA1:
+            spi_para->cpol = HI_SPI_CFG_CLOCK_CPOL_1;
+            spi_para->cpha = HI_SPI_CFG_CLOCK_CPHA_1;
+            break;
+        case TEST_CASE_MOTOROLA:
+            spi_para->fram_mode = HI_SPI_CFG_FRAM_MODE_MOTOROLA;
+            break;
+        case TEST_CASE_TI:
+            spi_para->fram_mode = HI_SPI_CFG_FRAM_MODE_TI;
+            break;
+        /* Microware does not support self-loopback tests. Two devices must be connected for tests. */
+        case TEST_CASE_BIT4:
+            spi_para->data_width = HI_SPI_CFG_DATA_WIDTH_E_4BIT;
+            break;
+        case TEST_CASE_BIT7:
+            spi_para->data_width = HI_SPI_CFG_DATA_WIDTH_E_7BIT;
+            break;
+        case TEST_CASE_BIT8:
+            spi_para->data_width = HI_SPI_CFG_DATA_WIDTH_E_8BIT;
+            break;
+        case TEST_CASE_BIT9:
+            spi_para->data_width = HI_SPI_CFG_DATA_WIDTH_E_9BIT;
+            break;
+        case TEST_CASE_BIT15:
+            spi_para->data_width = HI_SPI_CFG_DATA_WIDTH_E_15BIT;
+            break;
+        case TEST_CASE_BIT16:
+            spi_para->data_width = HI_SPI_CFG_DATA_WIDTH_E_16BIT;
+            break;
+        default:
+            break;
+    }
+}
+
+hi_u32 app_demo_spi_test_case_part2(hi_spi_cfg_basic_info *spi_para, hi_u8 test_case, hi_u8 *flag)
+{
+    switch (test_case) {
+        case TEST_CASE_CLK_MIN:
+            spi_para->freq = 20000000; /* Clock rate 4 20000000 */
+            break;
+        case TEST_CASE_CLK_16:
+            spi_para->freq = 5000000; /* Clock rate 16 5000000 */
+            break;
+        case TEST_CASE_CLK_50:
+            spi_para->freq = 1600000; /* Clock rate 50 1600000 */
+            break;
+        case TEST_CASE_CLK_100:
+            spi_para->freq = 800000; /* Clock rate 100 800000 */
+            break;
+        case TEST_CASE_CLK_200:
+            spi_para->freq = 400000; /* Clock rate 200 400000 */
+            break;
+        case TEST_CASE_PARAMETER_WRONG:
+            *flag = 1;
+            return app_demo_spi_para_test(spi_para);
+        default:
+            break;
+    }
+    return HI_ERR_SUCCESS;
+}
+
+hi_u32 app_demo_spi_test_case(hi_u8 test_case)
+{
+    hi_u32 ret;
+    hi_u8 flag = 0;
+    hi_spi_cfg_basic_info spi_para = {
+        .data_width = HI_SPI_CFG_DATA_WIDTH_E_8BIT,
+        .fram_mode = HI_SPI_CFG_FRAM_MODE_MOTOROLA,
+        .cpol = HI_SPI_CFG_CLOCK_CPOL_0,
+        .cpha = HI_SPI_CFG_CLOCK_CPHA_0,
+        .endian = HI_SPI_CFG_ENDIAN_LITTLE,
+        .pad = 0,
+        .freq = 2000000, /* Clock rate 24 2000000 */
+    };
+    app_demo_spi_test_case_part1(&spi_para, test_case);
+    ret = app_demo_spi_test_case_part2(&spi_para, test_case, &flag);
+    if (flag) {
+        return ret;
+    }
+    ret = hi_spi_set_basic_info(g_spi_id, &spi_para);
+    if (ret != HI_ERR_SUCCESS) {
+        return ret;
+    }
+    return app_demo_spi_single_loopback(g_spi_id, spi_para.data_width);
+}
+
+/*
+ * Test SPI unit parameters and loop back mode
+ */
+hi_void app_demo_spi_test(hi_spi_idx spi_id, hi_u32 irq_en, hi_u32 test_case, hi_u32 loop)
+{
+    test_spi_printf("SPI%d TEST START", spi_id);
+    hi_spi_cfg_basic_info spi_cfg_basic_info;
+    spi_cfg_basic_info.cpha = 1;
+    spi_cfg_basic_info.cpol = 1;
+    spi_cfg_basic_info.data_width = HI_SPI_CFG_DATA_WIDTH_E_7BIT;
+    spi_cfg_basic_info.endian = 0;
+    spi_cfg_basic_info.fram_mode = 0;
+    spi_cfg_basic_info.freq = 2000000; /* set frequency 2000000 */
+    app_demo_spi_init(spi_id, &spi_cfg_basic_info, HI_FALSE);
+    hi_spi_set_loop_back_mode(spi_id, HI_TRUE);
+    hi_spi_set_irq_mode(spi_id, (hi_bool)irq_en);
+    g_spi_id = spi_id;
+    g_lb_loop = loop;
+    if (test_case == TEST_CASE_ALL) {
+        /* The last three test case need connect Peripherals */
+        for (int i = TEST_CASE_POL0_PHA0; i < TEST_CASE_SLAVE; i++) {
+            hi_u32 ret = app_demo_spi_test_case((hi_u8)i);
+            test_spi_printf("===spi[%d]====TEST_CASE %d %s!=====", spi_id, i,
+                            ret == HI_ERR_SUCCESS ? "SUCCESS!" : "FAILURE!");
+        }
+    } else {
+        if (test_case >= TEST_CASE_MAX) {
+            test_spi_printf("INVALID TEST CASE!");
+            return;
+        }
+        hi_u32 ret = app_demo_spi_test_case((hi_u8)test_case);
+        test_spi_printf("===spi[%d]====TEST_CASE %d %s!=====", spi_id, test_case,
+                        ret == HI_ERR_SUCCESS ? "SUCCESS!" : "FAILURE!");
+    }
+    app_demo_spi_print_reg(g_spi_id);
+    test_spi_printf("SPI%d TEST END", spi_id);
+}
+
+/*
+ * The host device sets the SPI unit and read data
+ */
+hi_void app_demo_spi_cmd_host_read(hi_spi_idx spi_id, hi_u32 length, hi_u32 loop)
+{
+    test_spi_para spi_para;
+    spi_para.spi_id = spi_id;
+    spi_para.irq = HI_FALSE;
+    spi_para.length = length;
+    spi_para.loop = loop;
+    spi_para.cfg_info.data_width = HI_SPI_CFG_DATA_WIDTH_E_8BIT;
+    spi_para.cfg_info.cpha = HI_SPI_CFG_CLOCK_CPHA_0;
+    spi_para.cfg_info.cpol = HI_SPI_CFG_CLOCK_CPOL_0;
+    spi_para.cfg_info.fram_mode = HI_SPI_CFG_FRAM_MODE_MOTOROLA;
+    spi_para.cfg_info.endian = HI_SPI_CFG_ENDIAN_LITTLE;
+    spi_para.slave = HI_FALSE;
+    spi_para.lb = HI_FALSE;
+    spi_para.dma_en = HI_FALSE;
+    g_delay_us_spi = 200; /* 200us */
+    spi_para.cfg_info.freq = 8000000; /* defaul freq 8000000 Hz */
+    app_demo_spi_print_test_para(&spi_para);
+    app_demo_spi_test_cmd_mr_sw(&spi_para);
+}
+
+/*
+ * The slave device sets the SPI unit and write data
+ */
+hi_void app_demo_spi_cmd_slave_write(hi_spi_idx spi_id, hi_u32 length, hi_u32 loop)
+{
+    test_spi_para spi_para;
+    spi_para.spi_id = spi_id;
+    spi_para.irq = HI_FALSE;
+    spi_para.length = length;
+    spi_para.loop = loop;
+    spi_para.cfg_info.data_width = HI_SPI_CFG_DATA_WIDTH_E_8BIT;
+    spi_para.cfg_info.cpha = HI_SPI_CFG_CLOCK_CPHA_0;
+    spi_para.cfg_info.cpol = HI_SPI_CFG_CLOCK_CPOL_0;
+    spi_para.cfg_info.fram_mode = HI_SPI_CFG_FRAM_MODE_MOTOROLA;
+    spi_para.cfg_info.endian = HI_SPI_CFG_ENDIAN_LITTLE;
+    spi_para.slave = HI_TRUE;
+    spi_para.lb = HI_FALSE;
+    spi_para.dma_en = HI_TRUE;
+    g_delay_us_spi = 0;
+    spi_para.cfg_info.freq = 8000000; /* defaul freq 8000000 Hz */
+    app_demo_spi_print_test_para(&spi_para);
+    app_demo_spi_test_cmd_mr_sw(&spi_para);
+}
+
+/*
+ * The host device sets the SPI unit and write data
+ */
+hi_void app_demo_spi_cmd_host_write(hi_spi_idx spi_id, hi_u32 length, hi_u32 loop)
+{
+    test_spi_para spi_para;
+    spi_para.spi_id = spi_id;
+    spi_para.irq = HI_FALSE;
+    spi_para.length = length;
+    spi_para.loop = loop;
+    spi_para.cfg_info.data_width = HI_SPI_CFG_DATA_WIDTH_E_8BIT;
+    spi_para.cfg_info.cpha = HI_SPI_CFG_CLOCK_CPHA_0;
+    spi_para.cfg_info.cpol = HI_SPI_CFG_CLOCK_CPOL_0;
+    spi_para.cfg_info.fram_mode = HI_SPI_CFG_FRAM_MODE_MOTOROLA;
+    spi_para.cfg_info.endian = HI_SPI_CFG_ENDIAN_LITTLE;
+    spi_para.slave = HI_FALSE;
+    spi_para.lb = HI_FALSE;
+    spi_para.dma_en = HI_FALSE;
+    g_delay_us_spi = 100;  /* 100 us */
+    spi_para.cfg_info.freq = 8000000; /* defaul freq 8000000 Hz */
+    app_demo_spi_print_test_para(&spi_para);
+    app_demo_spi_test_cmd_mw_sr(&spi_para);
+}
+
+/*
+ * The slave device sets the SPI unit and read data
+ */
+hi_void app_demo_spi_cmd_slave_read(hi_spi_idx spi_id, hi_u32 length, hi_u32 loop)
+{
+    test_spi_para spi_para;
+    spi_para.spi_id = spi_id;
+    spi_para.irq = HI_FALSE;
+    spi_para.length = length;
+    spi_para.loop = loop;
+    spi_para.cfg_info.data_width = HI_SPI_CFG_DATA_WIDTH_E_8BIT;
+    spi_para.cfg_info.cpha = HI_SPI_CFG_CLOCK_CPHA_0;
+    spi_para.cfg_info.cpol = HI_SPI_CFG_CLOCK_CPOL_0;
+    spi_para.cfg_info.fram_mode = HI_SPI_CFG_FRAM_MODE_MOTOROLA;
+    spi_para.cfg_info.endian = HI_SPI_CFG_ENDIAN_LITTLE;
+    spi_para.slave = HI_TRUE;
+    spi_para.lb = HI_FALSE;
+    spi_para.dma_en = HI_TRUE;
+    g_delay_us_spi = 0;
+    spi_para.cfg_info.freq = 8000000; /* defaul freq 8000000 Hz */
+    app_demo_spi_print_test_para(&spi_para);
+    app_demo_spi_test_cmd_mw_sr(&spi_para);
+}
+

+ 133 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_timer_systick.c

@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <app_demo_timer_systick.h>
+
+hi_u64 g_time1;
+hi_u64 g_time2;
+hi_u32 g_hrtimer_handle;       /* hr timer handle */
+hi_u32 g_timer_handle;         /* timer handle */
+
+/* hrtimer callback func */
+hi_void hr_timer_callback(hi_u32 data)
+{
+    g_time2 = hi_systick_get_cur_tick();
+
+    printf("----- hrtimer_callback data:%d\r\n", data);
+
+    printf("----- hrtimer_callback, g_time1:%lld\r\n", g_time1);
+    printf("----- hrtimer_callback, g_time2:%lld\r\n", g_time2);
+    printf("----- hrtimer_callback, cha:%lld\r\n", g_time2 - g_time1);
+
+    printf("***** sleep 50000us ******\r\n");
+}
+
+/*
+ * This demo simply shows how to create and start hrtimer.
+ */
+hi_void app_demo_hrtimer(hi_void)
+{
+    hi_u32 ret;
+
+    /* create timer handle */
+    ret = hi_hrtimer_create(&g_hrtimer_handle);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("=====ERROR===== hrtimer handle create ret is: %d !!\r\n", ret);
+        return;
+    }
+    printf("----- hrtimer handle create success -----\n");
+
+    g_time1 = hi_systick_get_cur_tick();
+
+    ret = hi_hrtimer_start(g_hrtimer_handle, HRTIMER_EXPIRE, hr_timer_callback, 0);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("=====ERROR=====hrtimer start error, ret is: %d !!\n", ret);
+        return;
+    }
+    printf("----- hrtimer start success -----\n");
+
+    hi_sleep(1000); /* sleep 1000 to prevent the timer from being destroyed before the callback function is completed */
+    ret = hi_hrtimer_stop(g_hrtimer_handle);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("=====ERROR===== hrtimer stop error, ret is: %d !!\r\n", ret);
+    }
+    printf("----- hrtimer stop success -----\n");
+
+    /* delete timer */
+    ret = hi_hrtimer_delete(g_hrtimer_handle);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("=====ERROR===== hrtimer delete error, ret is: %d !!\r\n", ret);
+    }
+    printf("----- hrtimer handle delete success -----\n");
+}
+
+/*
+ * This demo simply shows how to use systick.
+ */
+hi_void app_demo_systick(hi_void)
+{
+    hi_u64 cnt1;
+    hi_u64 cnt2;
+
+    /* Get the current tick value, then clear the tick and get the tick value again */
+    cnt1 = hi_systick_get_cur_tick();
+    printf("----- get current tick cnt1 is %llu -----\r\n", cnt1);
+    hi_systick_clear();
+    hi_udelay(WORK_TICK_DELAY_US * 3); /* systick waits for 3 tick before clearing */
+    cnt2 = hi_systick_get_cur_tick();
+    printf("----- get current tick cnt2 is %llu -----\r\n", cnt2);
+
+    /* Because of the error, the number read immediately after clearing cannot be guaranteed to be 0,
+        so cnt2 which less than 20us is qualified */
+    if (cnt2 < 20) { /* 20us */
+        printf("----- systick clear success -----\r\n");
+    } else {
+        printf("======ERROR===== systick clear error, cnt2 = %llu\r\n", cnt2);
+    }
+}
+
+static hi_void app_demo_timer_handle(hi_u32 data)
+{
+    hi_unref_param(data);
+    printf("app demo timer timeout\r\n");
+}
+
+/*
+ * This demo simply shows how to create and start os timer.
+ */
+hi_void app_demo_timer(hi_void)
+{
+    hi_u32 ret;
+    ret = hi_timer_create(&g_timer_handle);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("timer create fail\r\n");
+    }
+    printf("timer create success\r\n");
+
+    ret = hi_timer_start(g_timer_handle, HI_TIMER_TYPE_ONCE, APP_DEMO_TIMER_WAIT, app_demo_timer_handle, 0);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("timer start fail\r\n");
+    }
+    printf("timer start success\r\n");
+
+    hi_sleep(20000);    /* 20000: sleep 20s */
+
+    ret = hi_timer_stop(g_timer_handle);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("timer stop fail\r\n");
+    }
+    printf("timer stop success\r\n");
+}
+

+ 123 - 0
device/bossay/hi3861_l0/sdk_liteos/app/demo/src/app_demo_tsensor.c

@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <app_demo_tsensor.h>
+
+hi_u32 g_tsensor_loop_count = 0;
+
+static hi_void tensor_collect_finish_irq(hi_s16 irq_temperature)
+{
+    hi_u64 cnt;
+
+    cnt = hi_systick_get_cur_tick();
+    printf("cnt = %lld\n", cnt);
+    printf("read temperature: %d\n", irq_temperature);
+    if (g_tsensor_loop_count > TSENSOR_TEST_LOOP) {
+        g_tsensor_loop_count = 0;
+
+        hi_tsensor_stop();
+        printf("*********stop tsensor***********\n");
+        printf("**** End of reading temperature by interrupt mode****\r\n");
+    }
+
+    g_tsensor_loop_count++;
+}
+
+static hi_void tensor_outtemp_irq(hi_s16 irq_temperature)
+{
+    hi_s16 temperature;
+    temperature = irq_temperature;
+
+    printf("temperature: %d is outtemp!!\n", temperature);
+    hi_tsensor_stop();
+    printf("*********stop tsensor***********\n");
+}
+
+static hi_void tensor_overtemp_irq(hi_s16 irq_temperature)
+{
+    hi_s16 temperature;
+    temperature = irq_temperature;
+
+    printf("temperature: %d is overtemp!!\n", temperature);
+    hi_tsensor_destroy();
+    printf("*********destroy tsensor***********\n");
+}
+
+static hi_void read_temprature_none_irq_single(hi_void)
+{
+    hi_s32 i;
+
+    for (i = 0; i < TSENSOR_TEST_LOOP; i++) {
+        hi_udelay((hi_u32)TSENSOR_GET_TEMPERRATURE_INTERVAL);
+        hi_s16 temperature = 0;
+        if (hi_tsensor_read_temperature(&temperature) == HI_ERR_SUCCESS) {
+            printf("Read success: temperature = %d\n", temperature);
+        } else {
+            printf("Read fail, continue!\n");
+        }
+    }
+
+    hi_sleep(TSENSOR_TEST_INTERVAL);
+}
+
+/*
+ * This demo simply shows how to set temperature protect threshold and read temperature by polling or interrupt mode.
+ */
+hi_void tsensor_demo(hi_void)
+{
+    hi_u32 ret;
+
+    hi_sleep(TSENSOR_TEST_INTERVAL);
+    printf("\n**** set temperature threshold ****\n");
+    /* Set power down temperature threshold. */
+    ret = hi_tsensor_set_pdtemp_threshold(TEMPERRATURE_POWER_DOWN_THRESHOLD);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("Failed to set power down temperature threshold! Err code = %X\n", ret);
+        return;
+    }
+
+    /* Set over temperature threshold and register callback function. */
+    hi_tsensor_set_overtemp_threshold(TEMPERRATURE_OVER_THRESHOLD, tensor_overtemp_irq);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("Failed to set overtemp temperature threshold! Err code = %X\n", ret);
+        return;
+    }
+
+    /* Set out temperature threshold and register callback function. */
+    hi_tsensor_set_outtemp_threshold(TEMPERRATURE_OUT_THRESHOLD_LOW,
+                                     TEMPERRATURE_OUT_THRESHOLD_HIGH, tensor_outtemp_irq);
+    if (ret != HI_ERR_SUCCESS) {
+        printf("Failed to set outtemp temperature threshold! Err code = %X\n", ret);
+        return;
+    }
+    hi_tsensor_start(HI_TSENSOR_MODE_16_POINTS_SINGLE, TSENSOR_PERIOD_VALUE);
+    hi_sleep(TSENSOR_TEST_INTERVAL);
+    printf("**** End of setting temperature threshold ****\n");
+
+    printf("\n**** read temperature by polling mode****\n");
+    hi_tsensor_start(HI_TSENSOR_MODE_16_POINTS_SINGLE, TSENSOR_PERIOD_VALUE);
+    /* Read temperature by polling mode. */
+    read_temprature_none_irq_single();
+    hi_tsensor_stop();
+    printf("**** End of reading temperature by polling mode****\n");
+
+    printf("\n**** read temperature by interrupt mode****\n");
+    /* Read temperature by interrupt mode. */
+    hi_tsensor_register_temp_collect_finish_int_callback(tensor_collect_finish_irq);
+    if (ret != HI_ERR_SUCCESS) {
+        return;
+    }
+    hi_tsensor_start(HI_TSENSOR_MODE_16_POINTS_SINGLE, TSENSOR_PERIOD_VALUE);
+}

Some files were not shown because too many files changed in this diff