zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.08k stars 6.19k forks source link

Introduce blobs for AIROC CYW43xx Bluetooth/Wi-Fi Connectivity SoCs #54936

Closed npal-cy closed 1 year ago

npal-cy commented 1 year ago

Origin

I would like to add blobs which need to enable support of AIROC CYW43xx Bluetooth/Wi-Fi Connectivity SoCs: -- CYW43012 -- CYW4343W -- CYW43439 -- CYW4373

The origin of these binary blobs is the Infineon repository:

Type

Module

hal_infineon: https://github.com/zephyrproject-rtos/hal_infineon/.

Purpose

CYW43xx devices required following sort of blobs:

  1. BT controller firmware blob file.
  2. WLAN firmware blob file.
  3. CLM (Country Locale Matrix) blob file.

Pull Request

hal_infineon: https://github.com/zephyrproject-rtos/hal_infineon/pull/7 bt driver: https://github.com/zephyrproject-rtos/zephyr/pull/55014

License

CYPRESS (AN INFINEON COMPANY) END USER LICENSE AGREEMENT

PLEASE READ THIS END USER LICENSE AGREEMENT ("Agreement") CAREFULLY BEFORE
DOWNLOADING, INSTALLING, COPYING, OR USING THIS SOFTWARE AND ACCOMPANYING
DOCUMENTATION.  BY DOWNLOADING, INSTALLING, COPYING OR USING THE SOFTWARE,
YOU ARE AGREEING TO BE BOUND BY THIS AGREEMENT.  IF YOU DO NOT AGREE TO ALL
OF THE TERMS OF THIS AGREEMENT, PROMPTLY RETURN AND DO NOT USE THE SOFTWARE.
IF YOU HAVE PURCHASED THIS LICENSE TO THE SOFTWARE, YOUR RIGHT TO RETURN THE
SOFTWARE EXPIRES 30 DAYS AFTER YOUR PURCHASE AND APPLIES ONLY TO THE ORIGINAL
PURCHASER.

1. Definitions.

    "Software" means this software and any accompanying documentation,
      including any upgrades, updates, bug fixes or modified versions provided
      to you by Cypress.

    "Source Code" means software in human-readable form.

    "Binary Code" means the software in binary code form such as object code or
      an executable.

    "Development Tools" means software that is intended to be installed on a
      personal computer and used to create programming code for Firmware,
      Drivers, or Host Applications.  Examples of Development Tools are
      Cypress's PSoC Creator software, Cypress's AIROC SDKs, and Cypress's
      ModusToolbox software.

    "Firmware" means software that executes on a Cypress hardware product.

    "Driver" means software that enables the use of a Cypress hardware product
      on a particular host operating system such as GNU/Linux, Windows, MacOS,
      Android, and iOS.

    "Host Application" means software that executes on a device other than a
      Cypress hardware product in order to program, control, or communicate
      with a Cypress hardware product.

    "inf File" means a hardware setup information file (.inf file) created by
      the Software to allow a Microsoft Windows operating system to install
      the driver for a Cypress hardware product.

2. License.  Subject to the terms and conditions of this Agreement, Cypress
Semiconductor Corporation ("Cypress") and its suppliers grant to you a
non-exclusive, non-transferable license under their copyright rights:

    a. to use the Development Tools in object code form solely for the purpose
       of creating Firmware, Drivers, Host Applications, and inf Files for
       Cypress hardware products; and

    b. (i) if provided in Source Code form, to copy, modify, and compile the
           Firmware Source Code to create Firmware for execution on a Cypress
           hardware product, and
      (ii) to distribute Firmware in binary code form only, only when
           installed onto a Cypress hardware product; and

    c. (i) if provided in Source Code form, to copy, modify, and compile the
           Driver Source Code to create one or more Drivers to enable the use
           of a Cypress hardware product on a particular host operating
           system, and
      (ii) to distribute the Driver, in binary code form only, only when
           installed on a device that includes the Cypress hardware product
           that the Driver is intended to enable; and

    d. (i) if provided in Source Code form, to copy, modify, and compile the
           Host Application Source Code to create one or more Host
           Applications to program, control, or communicate with a Cypress
           hardware product, and
      (ii) to distribute Host Applications, in binary code form only, only
           when installed on a device that includes a Cypress hardware product
           that the Host Application is intended to program, control, or
           communicate with; and

    e. to freely distribute any inf File.

Any distribution of Software permitted under this Agreement must be made
pursuant to your standard end user license agreement used for your proprietary
(closed source) software products, such end user license agreement to include,
at a minimum, provisions limiting your licensors' liability and prohibiting
reverse engineering of the Software, consistent with such provisions in this
Agreement.

3. Free and Open Source Software.  Portions of the Software may be licensed
under free and/or open source licenses such as the GNU General Public License
or other licenses from third parties ("Third Party Software").  Third Party
Software is subject to the applicable license agreement and not this
Agreement.  If you are entitled to receive the source code from Cypress for
any Third Party Software included with the Software, either the source code
will  be included with the Software or you may obtain the source code at no
charge from
<https://www.infineon.com/cms/en/design-support/software/free-and-open-source-software-foss/>.
The applicable license terms will accompany each source code package.  To
review the license terms applicable to any Third Party Software for which
Cypress is not required to provide you with source code, please see the
Software's installation directory on your computer.

4. Proprietary Rights; Ownership.  The Software, including all intellectual
property rights therein, is and will remain the sole and exclusive property of
Cypress or its suppliers.  Cypress retains ownership of the Source Code and
any compiled version thereof.  Subject to Cypress' ownership of the underlying
Software (including Source Code), you retain ownership of any modifications
you make to the Source Code.  You agree not to remove any Cypress copyright or
other notices from the Source Code and any modifications thereof.  You agree
to keep the Source Code confidential.  Any reproduction, modification,
translation, compilation, or representation of the Source Code except as
permitted in Section 2 ("License") is prohibited without the express written
permission of Cypress.  Except as otherwise expressly provided in this
Agreement, you may not:
    (i) modify, adapt, or create derivative works based upon the Software;
   (ii) copy the Software;
  (iii) except and only to the extent explicitly permitted by applicable
        law despite this limitation, decompile, translate, reverse engineer,
        disassemble or otherwise reduce the Software to human-readable form;
        or
   (iv) use the Software or any sample code other than for the Purpose.
You hereby covenant that you will not assert any claim that the Software, or
derivative works thereof created by or for Cypress, infringe any intellectual
property right owned or controlled by you

5. No Support.  Cypress may, but is not required to, provide technical support
for the Software.

6. Term and Termination.  This Agreement is effective until terminated, and
either party may terminate this Agreement at any time with or without cause.
This Agreement and your license rights under this Agreement will terminate
immediately without notice from Cypress if you fail to comply with any
provision of this Agreement.  Upon termination, you must destroy all copies of
Software in your possession or control.  The following paragraphs shall
survive any termination of this Agreement: "Free and Open Source Software,"
"Proprietary Rights; Ownership," "Compliance With Law," "Disclaimer,"
"Limitation of Liability," and "General."

7. Compliance With Law.  Each party agrees to comply with all applicable laws,
rules and regulations in connection with its activities under this Agreement.
Without limiting the foregoing, the Software may be subject to export control
laws and regulations of the United States and other countries.  You agree to
comply strictly with all such laws and regulations and acknowledge that you
have the responsibility to obtain licenses to export, re-export, or import the
Software.

8. Disclaimer.  TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS
MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THE
SOFTWARE, INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress
reserves the right to make changes to the Software without notice. Cypress
does not assume any liability arising out of the application or use of
Software or any product or circuit described in the Software.  It is the
responsibility of the user of the Software to properly design, program, and
test the functionality and safety of any application made of the Software and
any resulting product.  Cypress does not authorize its Software or products
for use in any products where a malfunction or failure of the Software or
Cypress product may reasonably be expected to result in significant property
damage, injury or death ("High Risk Product").  If you include any Software or
Cypress product in a High Risk Product, you assume all risk of such use and
agree to indemnify Cypress and its suppliers against all liability.  No
computing device can be absolutely secure.  Therefore, despite security
measures implemented in Cypress hardware or software products, Cypress does
not assume any liability arising out of any security breach, such as
unauthorized access to or use of a Cypress product.

9. Limitation of Liability.  TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE
LAW, IN NO EVENT WILL CYPRESS OR ITS SUPPLIERS, RESELLERS, OR DISTRIBUTORS BE
LIABLE FOR ANY LOST REVENUE, PROFIT, OR DATA, OR FOR SPECIAL, INDIRECT,
CONSEQUENTIAL, INCIDENTAL, OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS
OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR
INABILITY TO USE THE SOFTWARE EVEN IF CYPRESS OR ITS SUPPLIERS, RESELLERS, OR
DISTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  IN NO
EVENT SHALL CYPRESS' OR ITS SUPPLIERS', RESELLERS', OR DISTRIBUTORS' TOTAL
LIABILITY TO YOU, WHETHER IN CONTRACT, TORT (INCLUDING NEGLIGENCE), OR
OTHERWISE, EXCEED THE GREATER OF US$500 OR THE PRICE PAID BY YOU FOR THE
SOFTWARE.  THE FOREGOING LIMITATIONS SHALL APPLY EVEN IF THE ABOVE-STATED
WARRANTY FAILS OF ITS ESSENTIAL PURPOSE.  BECAUSE SOME STATES OR JURISDICTIONS
DO NOT ALLOW LIMITATION OR EXCLUSION OF CONSEQUENTIAL OR INCIDENTAL DAMAGES,
ALL OR PORTIONS OF THE ABOVE LIMITATION MAY NOT APPLY TO YOU.

10. Restricted Rights.  The Software is commercial computer software as that
term is described in 48 C.F.R. 252.227-7014(a)(1).  If the Software is being
acquired by or on behalf of the U.S. Government or by a U.S. Government prime
contractor or subcontractor (at any tier), then the Government's rights in
Software shall be only those set forth in this Agreement.

11. Personal Information.  You agree that information you provide through your
registration on Cypress IoT Community Forum or other Cypress websites,
including contact information or other personal information, may be collected
and used by Cypress consistent with its Data Privacy Policy
(https://www.infineon.com/cms/en/about-infineon/privacy-policy/), as updated
or revised from time to time, and may be provided to its third party sales
representatives, distributors and other entities conducting sales activities
for Cypress for sales-related and other business purposes.

12. General.  This Agreement will bind and inure to the benefit of each
party's successors and assigns, provided that you may not assign or transfer
this Agreement, in whole or in part, without Cypress' written consent.  This
Agreement shall be governed by and construed in accordance with the laws of
the State of California, United States of America, as if performed wholly
within the state and without giving effect to the principles of conflict of
law.  The parties consent to personal and exclusive jurisdiction of and venue
in, the state and federal courts within Santa Clara County, California;
provided however, that nothing in this Agreement will limit Cypress' right to
bring legal action in any venue in order to protect or enforce its
intellectual property rights.  No failure of either party to exercise or
enforce any of its rights under this Agreement will act as a waiver of such
rights.  If any portion of this Agreement is found to be void or
unenforceable, the remaining provisions of this Agreement shall remain in full
force and effect.  This Agreement is the complete and exclusive agreement
between the parties with respect to the subject matter hereof, superseding and
replacing any and all prior agreements, communications, and understandings
(both written and oral) regarding such subject matter.  Any notice to Cypress
will be deemed effective when actually received and must be sent to Cypress
Semiconductor Corporation, ATTN: Chief Legal Officer, 198 Champion Court, San
Jose, CA 95134 USA.

cc: @ifyall

thedjnK commented 1 year ago

https://github.com/Infineon/btstack-integration/blob/master/LICENSE.txt this does not look like the apache license to me.

npal-cy commented 1 year ago

https://github.com/Infineon/btstack-integration/blob/master/LICENSE.txt this does not look like the apache license to me.

Hi @thedjnK, The LICENSE.txt (from https://github.com/Infineon/btstack-integration/blob/master/LICENSE.txt) is Infineon EULA, which presents in all assets.

All blobs which we added in zephyr/module.yml has license-path: ./LICENSE.txt. This is path to apache license license hal_infinen/modules/LICENSE.txt.

Let me know if there are some problem here. Regards, Nazar

eanderlind commented 1 year ago

How does one gain access to understandable sources so that can audit/bugfix the Apache-licensed code? What benefit is Apache license if blob itself is a black box and hides all functionality?

Would an alternative be to host actual source code and a tool to convert this into the desired format during build process?

ifyall commented 1 year ago

How does one gain access to understandable sources so that can audit/bugfix the Apache-licensed code? What benefit is Apache license if blob itself is a black box and hides all functionality?

Would an alternative be to host actual source code and a tool to convert this into the desired format during build process?

See subsequent comment, for updates. This post is no longer relevant, but I am keeping it for history.

@eanderlind, the code that is compiled into these binary blobs will not be released to the public. It is proprietary. Our only intent is to deliver the fw blobs to the Zephyr community so that such users can add connectivity (BLE/Wi-Fi) support to their MCU projects via the CYW43xxx connectivity co-processors.

We are open to any reasonable license for the blobs that doesn't require the actual source code to be made available. In Mbed OS we released these under the "Open Binary License", but that is not an OSI approved license at this time.

Thank you,

Ian

ifyall commented 1 year ago

Additionally, we are attempting to follow the process documented here: https://docs.zephyrproject.org/latest/contribute/bin_blobs.html. As shown in that section, the west blobs capability is meant for our use case of proprietary binaries distributed for a coprocessor. Re-reading that documentation, I am now reminded that we should be pointing at our Cypress/Infineon EULA for these blobs, and not Apache 2.0.

I will work with @npal-cy to update that to correctly point at https://github.com/Infineon/btstack-integration/blob/master/LICENSE.txt, rather than the generic Apache 2.0 license in hal_infineon (and Zephyr in general).

Thanks again,

Ian

npal-cy commented 1 year ago
  1. updated License in Description for this ticket.
  2. updated hal_infineon (https://github.com/zephyrproject-rtos/hal_infineon/pull/7/commits/2644c4ecbe3bc1aea1a0659289febf87fb7976f5) 2.1. added EULA, 2.2. updated license-path to ./EULA.txt in zephyr/module.yml
fabiobaltieri commented 1 year ago

The point 2.d.ii (and the others as well) mention that the host application can only be redistributed in binary code form only, does that mean that this can't be used for open source application? There's other bit in that license that seems a bit fuzzy, who's "you" in that context? The project? The developer? How does the "non-transferable" bit works when the project is used by a vendor SDK?

That EULA feels intimidating, clearly it works when licensing directly to a company developing a closed source product but it does not seem to quite work here.

The RPi SDK in comparison has a way simpler license for this in their SDK (https://github.com/georgerobotics/cyw43-driver/blob/main/LICENSE.RP), would it be possible to have something like that for this effort as well?

The linux-firmware license also seems to make more sense than this: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/LICENCE.cypress

The definition of "Host Application" and "Firmware" is also confusing, seems like the same software may fall to either depending on whether it's build for a Cypress SoC or not, does not make much sense.

ifyall commented 1 year ago

@fabiobaltieri, re-reading 2.d.ii, I realized that it is meant to apply to the "firmware in binary form". That is, if we give you binary images, you cannot de-compile them, ship that de-compiled source, nor can you use the binary on any non-Cypress/Infineon device. You can contrast this directly with section 2.d.i, which applies to "... Firmware provided in Source Code form ...".

Since this RFC is about distributing a binary file, section 2.d.ii is the appropriate clause, however it has no impact on other firmware provided as source.

Thanks,

Ian

fabiobaltieri commented 1 year ago

Since this RFC is about distributing a binary file, section 2.d.ii is the appropriate clause, however it has no impact on other firmware provided as source.

I see, so the binary will use this, the rest of the code whatever license is already in the module. The EULA file would live in the module/ directory though, so I think having wording there that refers to "host application" etc would be very confusing (I'm looking at https://github.com/zephyrproject-rtos/hal_infineon/pull/7)). Thinking that at minimum the file name/location should indicate that it only applies to the blobs (example: https://github.com/zephyrproject-rtos/hal_espressif/blob/zephyr/zephyr/module.yml#L12), but it'd be ideal if also the text only covers what it applies for.

npal-cy commented 1 year ago

moved zephyr/EULA.txt → zephyr/blobs/license.txt

keith-zephyr commented 1 year ago

Clause 4(i) could be an issue: "Except as otherwise expressly provided in this Agreement, you may not: (i) modify, adapt, or create derivative works based upon the Software; "

I'm not a lawyer, but I've understood "derivative works" to broadly mean statically linking in a library, makes the larger program a derivative work of the library. I don't know how this applies for a binary blob that runs on a separate processing unit.

I agree with @fabiobaltieri, that the mix of licensing terms/rights for source code and the binary code is confusing.

ifyall commented 1 year ago

@keith-zephyr, as per @fabiobaltieri 's suggestion, we moved the license to zephyr/blobs/license.txt and the blob yml points at that. I believe this should make the intent clear here. Thanks for the feedback.

keith-zephyr commented 1 year ago

@keith-zephyr, as per @fabiobaltieri 's suggestion, we moved the license to zephyr/blobs/license.txt and the blob yml points at that. I believe this should make the intent clear here. Thanks for the feedback.

Where is zephyr/blobs/license.txt? I don't see that file i n the hal_infineon repo or as part of https://github.com/zephyrproject-rtos/zephyr/pull/55014.

ifyall commented 1 year ago

@keith-zephyr, the license lives in the hal_infineon repo. You can see this change in hal_infineon/pull/7.

carlescufi commented 1 year ago

This has been approved by the TSC