Portenta Add COMPONENT_WHD/resources to TARGET_PORTENTA_H7

pull/14663/head
pennam 2021-05-03 16:41:01 +02:00
parent bfedc39f7c
commit ef7ce6ba68
9 changed files with 26723 additions and 0 deletions

View File

@ -0,0 +1,110 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
add_library(mbed-cy-psoc6-whd-43012 INTERFACE)
target_include_directories(mbed-cy-psoc6-whd-43012
INTERFACE
resources/firmware/COMPONENT_43012
)
target_sources(mbed-cy-psoc6-whd-43012
INTERFACE
resources/firmware/COMPONENT_43012/43012C0-mfgtest_bin.c
resources/firmware/COMPONENT_43012/43012C0-mfgtest_clm_blob.c
resources/firmware/COMPONENT_43012/43012C0_bin.c
resources/firmware/COMPONENT_43012/43012C0_clm_blob.c
)
add_library(mbed-cy-psoc6-whd-43438 INTERFACE)
target_include_directories(mbed-cy-psoc6-whd-43438
INTERFACE
resources/firmware/COMPONENT_43438
)
target_sources(mbed-cy-psoc6-whd-43438
INTERFACE
resources/firmware/COMPONENT_43438/43438A1-mfgtest_bin.c
resources/firmware/COMPONENT_43438/43438A1-mfgtest_clm_blob.c
resources/firmware/COMPONENT_43438/43438A1_bin.c
resources/firmware/COMPONENT_43438/43438A1_clm_blob.c
)
add_library(mbed-cy-psoc6-whd-4343w INTERFACE)
target_include_directories(mbed-cy-psoc6-whd-4343w
INTERFACE
resources/firmware/COMPONENT_4343W
)
target_sources(mbed-cy-psoc6-whd-4343w
INTERFACE
resources/firmware/COMPONENT_4343W/4343WA1-mfgtest_bin.c
resources/firmware/COMPONENT_4343W/4343WA1-mfgtest_clm_blob.c
resources/firmware/COMPONENT_4343W/4343WA1_bin.c
resources/firmware/COMPONENT_4343W/4343WA1_clm_blob.c
)
add_library(mbed-cy8ckit-062s2-43012-whd INTERFACE)
target_include_directories(mbed-cy8ckit-062s2-43012-whd INTERFACE resources/nvram/TARGET_CY8CKIT_062S2_43012)
add_library(mbed-cy8ckit-062s2-4343w-whd INTERFACE)
target_include_directories(mbed-cy8ckit-062s2-4343w-whd INTERFACE resources/nvram/TARGET_CY8CKIT_062S2_4343W)
add_library(mbed-cy8ckit-062-4343w-whd INTERFACE)
target_include_directories(mbed-cy8ckit-062-4343w-whd INTERFACE resources/nvram/TARGET_CY8CKIT_062_4343W)
add_library(mbed-cy8ckit-062-wifi-bt-whd INTERFACE)
target_include_directories(mbed-cy8ckit-062-wifi-bt-whd INTERFACE resources/nvram/TARGET_CY8CKIT_062_WIFI_BT)
add_library(mbed-cy8ckit-064s1-4343w-whd INTERFACE)
target_include_directories(mbed-cy8ckit-064s1-4343w-whd INTERFACE resources/nvram/TARGET_CY8CKIT_064S1_4343W)
add_library(mbed-cy8ckit-064s2-4343w-whd INTERFACE)
target_include_directories(mbed-cy8ckit-064s2-4343w-whd INTERFACE resources/nvram/TARGET_CY8CKIT_064S2_4343W)
add_library(mbed-cy8cmod-062s2-43012-whd INTERFACE)
target_include_directories(mbed-cy8cmod-062s2-43012-whd INTERFACE resources/nvram/TARGET_CY8CMOD_062S2_43012)
add_library(mbed-cy8cmod-062s3-4343w-whd INTERFACE)
target_include_directories(mbed-cy8cmod-062s3-4343w-whd INTERFACE resources/nvram/TARGET_CY8CMOD_062S3_4343W)
add_library(mbed-cy8cmod-062-4343w-whd INTERFACE)
target_include_directories(mbed-cy8cmod-062-4343w-whd INTERFACE resources/nvram/TARGET_CY8CMOD_062_4343W)
add_library(mbed-cy8cproto-062s3-4343w-whd INTERFACE)
target_include_directories(mbed-cy8cproto-062s3-4343w-whd INTERFACE resources/nvram/TARGET_CY8CPROTO_062S3_4343W)
add_library(mbed-cy8cproto-062-4343w-whd INTERFACE)
target_include_directories(mbed-cy8cproto-062-4343w-whd INTERFACE resources/nvram/TARGET_CY8CPROTO_062_4343W)
add_library(mbed-cytfm-064b0s2-4343w-whd INTERFACE)
target_include_directories(mbed-cytfm-064b0s2-4343w-whd INTERFACE resources/nvram/TARGET_CYTFM_064B0S2_4343W)
add_library(mbed-cyw943012p6evb-01-whd INTERFACE)
target_include_directories(mbed-cyw943012p6evb-01-whd INTERFACE resources/nvram/TARGET_CYW943012P6EVB_01)
add_library(mbed-cyw943012wcd2-whd INTERFACE)
target_include_directories(mbed-cyw943012wcd2-whd INTERFACE resources/nvram/TARGET_CYW943012WCD2)
add_library(mbed-cyw9p62s1-43012car-01-whd INTERFACE)
target_include_directories(mbed-cyw9p62s1-43012car-01-whd INTERFACE resources/nvram/TARGET_CYW9P62S1_43012CAR_01)
add_library(mbed-cyw9p62s1-43012evb-01-whd INTERFACE)
target_include_directories(mbed-cyw9p62s1-43012evb-01-whd INTERFACE resources/nvram/TARGET_CYW9P62S1_43012EVB_01)
add_library(mbed-cyw9p62s1-43438evb-01-whd INTERFACE)
target_include_directories(mbed-cyw9p62s1-43438evb-01-whd INTERFACE resources/nvram/TARGET_CYW9P62S1_43438EVB_01)
add_library(mbed-cy8ckit-064b0s2-4343w-whd INTERFACE)
target_include_directories(mbed-cy8ckit-064b0s2-4343w-whd INTERFACE resources/nvram/TARGET_CY8CKIT_064B0S2_4343W)
target_include_directories(mbed-cy-psoc6-whd
INTERFACE
.
resources/resource_imp
)
target_sources(mbed-cy-psoc6-whd
INTERFACE
resources/resource_imp/whd_resources.c
)

View File

@ -0,0 +1,9 @@
/*
* This file is used to set the MAC address in NVRAM.
* The MAC address of the Wi-Fi device may be configured in OTP and/or in NVRAM.
* If both OTP and NVRAM contains the MAC address then OTP programmed MAC address will be used.
* PSOC boards are usually programmed with OTP MAC address.
* MAC address is printed during WHD power up
*/
#define NVRAM_GENERATED_MAC_ADDRESS "macaddr=00:A0:50:6f:b2:ea"

View File

@ -0,0 +1,49 @@
Permissive Binary License
Version 1.0, July 2019
Redistribution. Redistribution and use in binary form, without
modification, are permitted provided that the following conditions are
met:
1) Redistributions must reproduce the above copyright notice and the
following disclaimer in the documentation and/or other materials
provided with the distribution.
2) Unless to the extent explicitly permitted by law, no reverse
engineering, decompilation, or disassembly of this software is
permitted.
3) Redistribution as part of a software development kit must include the
accompanying file named <20>DEPENDENCIES<45> and any dependencies listed in
that file.
4) 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.
Limited patent license. The copyright holders (and contributors) grant a
worldwide, non-exclusive, no-charge, royalty-free patent license to
make, have made, use, offer to sell, sell, import, and otherwise
transfer this software, where such license applies only to those patent
claims licensable by the copyright holders (and contributors) that are
necessarily infringed by this software. This patent license shall not
apply to any combinations that include this software. No hardware is
licensed hereunder.
If you institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the software
itself infringes your patent(s), then your rights granted under this
license shall terminate as of the date such litigation is filed.
DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS." 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
HOLDERS 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.

View File

@ -0,0 +1,400 @@
/*
* Copyright (c) 2019, Cypress Semiconductor Corporation, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "wiced_resource.h"
#if defined(CY_STORAGE_WIFI_DATA)
CY_SECTION_WHD(CY_STORAGE_WIFI_DATA) __attribute__((used))
#endif
const unsigned char wifi_firmware_clm_blob_image_data[7222] = {
66, 76, 79, 66, 60, 0, 0, 0, 132, 159, 16, 216, 1, 0, 0, 0, 2, 0, 0,
0, 0, 0, 0, 0, 60, 0, 0, 0, 246, 27, 0, 0, 183, 10, 32, 40, 0, 0, 0,
0, 0, 0, 0, 0, 50, 28, 0, 0, 4, 0, 0, 0, 42, 255, 237, 159, 0, 0, 0,
0, 67, 76, 77, 32, 68, 65, 84, 65, 0, 0, 12, 0, 2, 0, 57, 46, 49, 48,
46, 51, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 46, 50, 57, 46,
52, 0, 0, 0, 0, 0, 0, 0, 0, 184, 10, 0, 0, 67, 108, 109, 73, 109, 112,
111, 114, 116, 58, 32, 49, 46, 51, 54, 46, 51, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 66, 114, 111, 97, 100, 99, 111, 109, 45, 48, 46, 48,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 49, 0, 81, 50, 0, 3, 3, 3, 9, 3, 11,
4, 4, 4, 7, 4, 8, 4, 10, 4, 11, 5, 7, 8, 8, 9, 9, 9, 11, 11, 11, 38,
38, 38, 46, 38, 62, 38, 110, 38, 118, 38, 134, 38, 142, 38, 159, 38,
175, 46, 46, 54, 54, 54, 62, 54, 134, 62, 62, 102, 102, 102, 110, 102,
134, 102, 142, 102, 159, 110, 126, 110, 134, 110, 142, 134, 134, 134,
159, 142, 142, 151, 151, 151, 159, 151, 175, 159, 159, 65, 69, 1, 65,
82, 1, 65, 84, 1, 65, 85, 2, 66, 69, 1, 66, 71, 1, 66, 78, 1, 67, 65,
2, 67, 72, 1, 67, 89, 1, 67, 90, 1, 68, 69, 3, 68, 75, 1, 69, 69, 1,
69, 83, 1, 70, 73, 1, 70, 82, 1, 71, 66, 1, 71, 82, 1, 72, 82, 1, 72,
85, 1, 73, 68, 5, 73, 69, 1, 73, 83, 1, 73, 84, 1, 74, 80, 3, 75, 82,
4, 75, 87, 1, 76, 73, 1, 76, 84, 1, 76, 85, 1, 76, 86, 1, 77, 65, 1,
77, 84, 1, 77, 88, 1, 78, 76, 1, 78, 79, 1, 80, 76, 1, 80, 84, 1, 80,
89, 1, 82, 79, 1, 82, 85, 5, 83, 69, 1, 83, 73, 1, 83, 75, 1, 84, 82,
7, 84, 87, 2, 85, 83, 26, 1, 0, 255, 1, 30, 2, 0, 3, 76, 1, 3, 76, 2,
1, 66, 12, 3, 1, 0, 255, 1, 30, 2, 0, 7, 72, 0, 1, 58, 0, 3, 68, 6,
3, 74, 8, 1, 74, 10, 3, 68, 11, 3, 66, 12, 3, 1, 0, 255, 1, 30, 2, 0,
2, 64, 2, 1, 56, 2, 3, 1, 0, 255, 1, 30, 2, 0, 5, 72, 0, 1, 76, 1, 3,
76, 7, 1, 72, 12, 1, 66, 12, 3, 1, 0, 255, 1, 30, 2, 0, 4, 58, 0, 3,
68, 2, 1, 66, 7, 3, 58, 12, 3, 1, 0, 255, 1, 30, 2, 0, 5, 92, 0, 1,
86, 0, 3, 126, 7, 0, 92, 12, 1, 86, 12, 3, 1, 0, 255, 1, 30, 2, 0, 5,
70, 0, 3, 80, 1, 1, 80, 7, 3, 76, 12, 1, 72, 12, 3, 2, 4, 255, 1, 20,
4, 2, 1, 76, 4, 0, 2, 0, 3, 1, 20, 4, 2, 1, 76, 4, 1, 2, 0, 255, 1,
20, 4, 0, 1, 76, 4, 0, 3, 0, 4, 1, 20, 5, 2, 5, 76, 1, 3, 76, 4, 1,
70, 12, 3, 76, 14, 3, 54, 17, 1, 3, 0, 4, 1, 20, 5, 0, 6, 60, 0, 3,
68, 2, 1, 64, 8, 3, 48, 14, 1, 44, 14, 3, 64, 17, 1, 3, 0, 4, 1, 20,
5, 0, 3, 64, 3, 3, 64, 5, 1, 46, 16, 3, 2, 0, 3, 1, 20, 4, 0, 3, 64,
2, 0, 48, 14, 1, 44, 14, 3, 3, 0, 4, 1, 20, 5, 0, 6, 62, 0, 3, 66, 4,
1, 66, 7, 3, 62, 12, 3, 66, 14, 3, 42, 17, 1, 3, 0, 255, 1, 20, 5, 2,
2, 84, 4, 3, 78, 5, 1, 1, 0, 255, 1, 20, 2, 0, 2, 69, 2, 1, 79, 2, 3,
3, 0, 255, 1, 30, 5, 0, 1, 120, 5, 0, 0, 0, 255, 0, 0, 0, 2, 0, 255,
1, 23, 4, 2, 1, 92, 4, 0, 2, 0, 255, 1, 36, 4, 2, 1, 100, 4, 0, 2, 4,
3, 1, 20, 4, 2, 1, 76, 4, 0, 1, 0, 255, 1, 20, 2, 2, 1, 76, 2, 0, 2,
0, 255, 1, 20, 4, 4, 3, 56, 0, 3, 64, 9, 3, 56, 16, 3, 2, 1, 76, 4,
1, 74, 48, 0, 74, 49, 0, 74, 50, 0, 74, 51, 0, 74, 52, 0, 74, 53, 0,
74, 54, 0, 74, 55, 0, 74, 56, 0, 74, 57, 0, 0, 0, 4, 0, 0, 0, 37, 4,
0, 0, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 4, 0, 1, 2, 3, 8, 12,
13, 14, 15, 16, 17, 18, 19, 8, 4, 5, 6, 7, 8, 9, 10, 11, 1, 1, 1, 10,
1, 11, 1, 12, 1, 13, 1, 14, 2, 2, 2, 10, 2, 11, 2, 12, 3, 9, 10, 10,
11, 11, 12, 12, 12, 13, 12, 14, 13, 13, 14, 14, 34, 46, 36, 48, 36,
64, 36, 116, 36, 140, 36, 144, 36, 161, 36, 165, 36, 177, 52, 60, 52,
64, 52, 124, 52, 140, 52, 144, 52, 165, 56, 64, 64, 64, 64, 100, 100,
100, 100, 116, 100, 140, 100, 144, 100, 165, 104, 128, 104, 140, 104,
165, 132, 140, 132, 144, 132, 165, 149, 149, 149, 161, 149, 165, 149,
177, 153, 161, 165, 165, 0, 1, 2, 1, 4, 1, 5, 1, 18, 2, 18, 19, 4, 18,
19, 29, 48, 2, 18, 20, 2, 18, 22, 1, 19, 3, 19, 28, 49, 3, 19, 30, 49,
3, 19, 31, 50, 2, 19, 32, 2, 19, 49, 1, 20, 2, 20, 38, 2, 20, 40, 2,
20, 44, 2, 20, 48, 2, 20, 49, 2, 21, 46, 1, 22, 2, 22, 49, 2, 23, 49,
1, 24, 1, 25, 1, 26, 3, 28, 38, 49, 2, 28, 49, 3, 33, 38, 49, 2, 33,
49, 1, 38, 1, 48, 1, 49, 69, 48, 0, 88, 65, 0, 88, 85, 0, 65, 85, 2,
74, 80, 1, 0, 0, 3, 0, 0, 0, 124, 10, 0, 0, 16, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 34, 46, 4, 36, 64, 4, 100, 144,
4, 149, 177, 4, 50, 48, 50, 48, 45, 48, 49, 45, 51, 48, 32, 50, 49,
58, 51, 48, 58, 48, 53, 0, 4, 2, 64, 19, 0, 64, 49, 0, 1, 2, 40, 14,
0, 40, 39, 0, 4, 4, 56, 19, 0, 58, 28, 0, 60, 39, 0, 70, 49, 0, 1, 3,
52, 15, 0, 64, 30, 0, 72, 39, 0, 4, 3, 60, 20, 0, 60, 38, 0, 60, 49,
0, 1, 3, 56, 14, 0, 60, 25, 0, 60, 39, 0, 6, 1, 84, 20, 0, 3, 1, 84,
15, 0, 4, 1, 60, 20, 0, 1, 1, 56, 15, 0, 6, 1, 84, 20, 0, 3, 1, 88,
15, 0, 6, 2, 84, 20, 0, 84, 49, 0, 3, 2, 84, 15, 0, 84, 39, 0, 0, 0,
4, 2, 66, 20, 0, 66, 48, 0, 1, 2, 54, 15, 0, 54, 39, 0, 6, 2, 92, 20,
0, 80, 49, 0, 3, 2, 88, 15, 0, 76, 39, 0, 4, 2, 66, 20, 0, 64, 49, 0,
1, 2, 56, 15, 0, 56, 39, 0, 4, 1, 56, 19, 0, 1, 1, 48, 14, 0, 4, 1,
60, 19, 0, 1, 1, 56, 14, 0, 4, 1, 60, 19, 0, 1, 1, 56, 14, 0, 6, 2,
84, 23, 0, 112, 49, 0, 3, 2, 88, 19, 0, 116, 39, 0, 4, 5, 56, 19, 0,
70, 27, 0, 58, 34, 0, 68, 38, 0, 70, 49, 0, 1, 7, 52, 13, 0, 66, 22,
0, 68, 23, 0, 52, 26, 0, 62, 27, 0, 72, 33, 0, 74, 39, 0, 4, 4, 58,
19, 0, 80, 47, 0, 80, 51, 0, 80, 52, 0, 1, 4, 58, 13, 0, 66, 22, 0,
72, 38, 0, 80, 41, 0, 4, 6, 56, 19, 0, 68, 27, 0, 56, 34, 0, 68, 36,
0, 68, 42, 0, 68, 49, 0, 1, 6, 48, 14, 0, 68, 23, 0, 48, 26, 0, 62,
27, 0, 74, 33, 0, 72, 39, 0, 4, 5, 56, 19, 0, 78, 27, 0, 64, 34, 0,
68, 36, 0, 78, 43, 0, 1, 10, 62, 13, 0, 62, 22, 0, 78, 23, 0, 50, 26,
0, 56, 27, 0, 78, 32, 0, 78, 35, 0, 78, 37, 0, 60, 38, 0, 78, 41, 0,
4, 1, 120, 26, 0, 1, 1, 120, 21, 0, 4, 1, 120, 25, 0, 1, 1, 120, 20,
0, 4, 4, 56, 19, 0, 70, 27, 0, 58, 34, 0, 70, 49, 0, 1, 4, 48, 14, 0,
62, 23, 0, 48, 26, 0, 60, 39, 0, 4, 4, 56, 19, 0, 66, 27, 0, 60, 34,
0, 66, 49, 0, 1, 3, 56, 14, 0, 60, 24, 0, 60, 39, 0, 6, 2, 84, 20, 0,
84, 49, 0, 3, 2, 88, 15, 0, 88, 39, 0, 4, 4, 56, 19, 0, 70, 27, 0, 58,
34, 0, 70, 49, 0, 1, 4, 48, 14, 0, 62, 23, 0, 48, 26, 0, 60, 39, 0,
4, 2, 60, 28, 0, 68, 49, 0, 1, 2, 56, 24, 0, 56, 39, 0, 6, 2, 112, 28,
0, 112, 49, 0, 3, 2, 112, 24, 0, 112, 39, 0, 0, 2, 64, 18, 0, 64, 20,
0, 4, 4, 48, 18, 0, 48, 19, 0, 60, 29, 0, 60, 48, 0, 1, 2, 48, 17, 0,
48, 39, 0, 4, 2, 56, 19, 0, 68, 49, 0, 1, 2, 48, 14, 0, 60, 39, 0, 4,
6, 62, 19, 0, 90, 27, 0, 80, 35, 0, 90, 41, 0, 86, 45, 0, 118, 50, 0,
1, 6, 74, 14, 0, 98, 23, 0, 66, 26, 0, 74, 27, 0, 98, 34, 0, 118, 40,
0, 6, 1, 84, 24, 0, 3, 1, 88, 20, 0, 6, 1, 84, 24, 0, 3, 1, 88, 20,
0, 4, 2, 56, 19, 0, 60, 49, 0, 1, 2, 48, 14, 0, 60, 39, 0, 6, 2, 72,
20, 0, 72, 44, 0, 3, 2, 76, 15, 0, 76, 35, 0, 4, 2, 60, 20, 0, 60, 38,
0, 1, 2, 56, 15, 0, 64, 29, 0, 4, 2, 60, 20, 0, 60, 38, 0, 1, 1, 56,
18, 0, 4, 2, 84, 20, 0, 84, 38, 0, 1, 1, 56, 18, 0, 6, 1, 84, 22, 0,
3, 1, 88, 18, 0, 6, 1, 84, 22, 0, 3, 1, 88, 18, 0, 6, 2, 84, 20, 0,
112, 38, 0, 3, 2, 68, 15, 0, 96, 29, 0, 4, 2, 66, 20, 0, 66, 38, 0,
1, 2, 42, 15, 0, 64, 29, 0, 4, 2, 62, 20, 0, 66, 38, 0, 1, 2, 42, 15,
0, 64, 29, 0, 4, 2, 60, 20, 0, 60, 38, 0, 1, 2, 56, 15, 0, 64, 29, 0,
0, 0, 4, 4, 60, 20, 0, 60, 37, 0, 60, 44, 0, 60, 49, 0, 1, 4, 56, 15,
0, 60, 28, 0, 60, 35, 0, 60, 39, 0, 6, 2, 84, 21, 0, 84, 46, 0, 3, 2,
88, 16, 0, 88, 36, 0, 4, 2, 60, 20, 0, 60, 49, 0, 1, 2, 56, 15, 0, 60,
39, 0, 0, 2, 60, 20, 0, 60, 49, 0, 6, 1, 84, 25, 0, 3, 1, 84, 20, 0,
6, 1, 84, 25, 0, 3, 1, 88, 20, 0, 6, 2, 84, 20, 0, 112, 40, 0, 3, 2,
88, 15, 0, 116, 31, 0, 4, 3, 60, 20, 0, 60, 38, 0, 60, 49, 0, 1, 3,
56, 15, 0, 64, 29, 0, 60, 39, 0, 4, 1, 60, 49, 0, 1, 1, 52, 39, 0, 6,
1, 80, 49, 0, 3, 1, 80, 39, 0, 6, 1, 80, 49, 0, 3, 1, 80, 39, 0, 6,
2, 80, 19, 0, 80, 49, 0, 3, 2, 80, 14, 0, 80, 39, 0, 6, 1, 76, 49, 0,
3, 1, 76, 39, 0, 6, 1, 76, 48, 0, 3, 1, 68, 39, 0, 4, 1, 60, 49, 0,
1, 1, 60, 39, 0, 6, 1, 84, 49, 0, 3, 1, 88, 39, 0, 4, 1, 78, 49, 0,
1, 1, 78, 39, 0, 4, 3, 56, 33, 0, 68, 38, 0, 68, 49, 0, 1, 4, 48, 26,
0, 62, 27, 0, 74, 33, 0, 72, 39, 0, 4, 3, 56, 28, 0, 58, 38, 0, 62,
49, 0, 1, 4, 46, 23, 0, 48, 26, 0, 56, 29, 0, 56, 39, 0, 4, 2, 68, 33,
0, 68, 49, 0, 1, 2, 66, 26, 0, 60, 39, 0, 2, 1, 84, 48, 0, 65, 69, 1,
65, 82, 1, 65, 84, 1, 65, 85, 2, 66, 69, 1, 66, 71, 1, 66, 78, 1, 67,
65, 2, 67, 72, 1, 67, 89, 1, 67, 90, 1, 68, 69, 3, 68, 75, 1, 69, 69,
1, 69, 83, 1, 70, 73, 1, 70, 82, 1, 71, 66, 1, 71, 82, 1, 72, 82, 1,
72, 85, 1, 73, 68, 5, 73, 69, 1, 73, 83, 1, 73, 84, 1, 74, 80, 3, 75,
82, 4, 75, 87, 1, 76, 73, 1, 76, 84, 1, 76, 85, 1, 76, 86, 1, 77, 65,
1, 77, 84, 1, 77, 88, 1, 78, 76, 1, 78, 79, 1, 80, 76, 1, 80, 84, 1,
80, 89, 1, 82, 79, 1, 82, 85, 5, 83, 69, 1, 83, 73, 1, 83, 75, 1, 84,
87, 2, 85, 83, 25, 4, 5, 76, 0, 2, 76, 6, 2, 76, 10, 2, 76, 11, 2, 66,
12, 2, 1, 4, 62, 0, 0, 66, 4, 0, 62, 9, 0, 58, 10, 0, 4, 3, 58, 0, 2,
66, 7, 2, 58, 12, 2, 1, 5, 42, 0, 0, 50, 3, 0, 60, 8, 0, 54, 9, 0, 46,
10, 0, 4, 1, 56, 2, 2, 1, 1, 32, 1, 0, 4, 5, 58, 0, 2, 68, 6, 2, 74,
10, 2, 68, 11, 2, 66, 12, 2, 1, 5, 48, 0, 0, 58, 3, 0, 66, 8, 0, 58,
9, 0, 54, 10, 0, 4, 3, 86, 0, 2, 126, 7, 2, 86, 12, 2, 1, 3, 78, 0,
0, 126, 5, 0, 78, 10, 0, 4, 5, 70, 0, 2, 80, 6, 2, 80, 10, 2, 80, 11,
2, 72, 12, 2, 1, 5, 58, 0, 0, 68, 3, 0, 80, 8, 0, 68, 9, 0, 60, 10,
0, 4, 1, 64, 4, 2, 1, 1, 64, 2, 0, 4, 1, 76, 4, 2, 1, 1, 72, 2, 0, 0,
1, 64, 4, 2, 4, 4, 60, 0, 2, 64, 8, 2, 44, 13, 2, 44, 16, 2, 1, 3, 40,
0, 0, 52, 5, 0, 46, 11, 0, 0, 2, 64, 3, 2, 46, 16, 2, 4, 2, 64, 2, 2,
44, 14, 2, 1, 3, 54, 0, 0, 64, 6, 0, 52, 12, 0, 6, 1, 76, 4, 2, 3, 1,
76, 2, 0, 6, 1, 76, 4, 2, 3, 1, 76, 2, 0, 6, 1, 76, 4, 2, 3, 1, 76,
2, 0, 6, 1, 76, 4, 2, 3, 1, 128, 2, 0, 4, 1, 64, 4, 2, 1, 1, 64, 2,
0, 6, 1, 84, 4, 2, 3, 1, 72, 2, 0, 0, 1, 79, 2, 2, 4, 2, 120, 4, 2,
120, 17, 2, 1, 1, 120, 2, 0, 0, 0, 0, 1, 64, 4, 2, 4, 1, 80, 4, 2, 1,
1, 64, 2, 0, 4, 1, 88, 4, 2, 1, 1, 60, 2, 0, 6, 1, 100, 4, 2, 3, 1,
88, 2, 0, 4, 1, 64, 2, 2, 1, 1, 52, 1, 0, 4, 3, 56, 0, 2, 64, 9, 2,
56, 16, 2, 1, 2, 46, 0, 0, 52, 7, 0, 68, 69, 0, 0, 3, 0, 0, 0, 251,
3, 0, 0, 74, 80, 0, 0, 10, 0, 0, 0, 228, 2, 0, 0, 85, 83, 0, 0, 2, 0,
0, 0, 104, 0, 0, 0, 8, 12, 13, 14, 15, 16, 17, 18, 19, 8, 4, 5, 6, 7,
8, 9, 10, 11, 1, 14, 1, 0, 0, 0, 112, 11, 0, 0, 4, 3, 0, 0, 48, 3, 0,
0, 229, 27, 0, 0, 154, 3, 0, 0, 160, 10, 0, 0, 82, 1, 0, 0, 67, 24,
0, 0, 0, 9, 0, 0, 69, 4, 0, 0, 156, 11, 0, 0, 12, 4, 0, 0, 204, 27,
0, 0, 127, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 212, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 3, 0, 0, 20,
4, 0, 0, 49, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 178, 10, 0, 0, 88, 65, 0, 0, 2, 0, 0, 0, 4, 4, 0, 0, 88, 84,
0, 0, 47, 0, 0, 0, 115, 8, 0, 0, 88, 86, 0, 0, 48, 0, 0, 0, 194, 0,
0, 0, 103, 1, 0, 0, 164, 11, 0, 0, 35, 97, 0, 17, 18, 19, 19, 0, 0,
35, 110, 0, 18, 8, 255, 255, 240, 0, 35, 114, 0, 17, 19, 19, 20, 0,
0, 48, 65, 0, 7, 8, 255, 255, 240, 16, 48, 66, 0, 0, 14, 0, 17, 0, 16,
48, 67, 0, 7, 6, 13, 5, 0, 16, 65, 67, 0, 18, 8, 255, 255, 240, 16,
65, 68, 0, 7, 33, 14, 39, 0, 48, 65, 69, 0, 7, 8, 6, 7, 0, 32, 65, 69,
1, 7, 33, 6, 43, 0, 32, 65, 70, 0, 7, 33, 14, 39, 0, 48, 65, 71, 0,
7, 41, 6, 47, 0, 32, 65, 73, 0, 6, 15, 5, 18, 0, 16, 65, 76, 0, 7, 33,
6, 43, 0, 32, 65, 77, 0, 7, 5, 13, 3, 0, 0, 65, 78, 0, 7, 14, 6, 17,
0, 32, 65, 79, 0, 7, 8, 255, 255, 240, 16, 65, 81, 0, 18, 8, 255, 255,
240, 16, 65, 82, 0, 7, 25, 6, 25, 0, 0, 65, 82, 1, 7, 14, 6, 17, 0,
0, 65, 83, 0, 6, 15, 5, 18, 0, 16, 65, 84, 0, 7, 33, 6, 43, 0, 32, 65,
84, 1, 7, 37, 6, 36, 0, 32, 65, 85, 0, 20, 42, 24, 46, 0, 0, 65, 85,
2, 20, 42, 23, 45, 0, 0, 65, 87, 0, 7, 34, 6, 31, 0, 0, 65, 88, 0, 18,
8, 255, 255, 240, 16, 65, 90, 0, 7, 14, 6, 17, 0, 32, 66, 65, 0, 7,
33, 6, 43, 0, 32, 66, 66, 0, 7, 22, 13, 23, 0, 16, 66, 68, 0, 7, 46,
6, 59, 0, 0, 66, 69, 0, 7, 33, 6, 43, 0, 32, 66, 69, 1, 7, 37, 6, 36,
0, 32, 66, 70, 0, 7, 33, 14, 39, 0, 16, 66, 71, 0, 7, 33, 6, 43, 0,
32, 66, 71, 1, 7, 37, 6, 36, 0, 32, 66, 72, 0, 7, 21, 6, 22, 0, 0, 66,
73, 0, 7, 33, 14, 39, 0, 16, 66, 74, 0, 7, 33, 14, 39, 0, 48, 66, 76,
0, 18, 8, 255, 255, 240, 16, 66, 77, 0, 6, 15, 5, 18, 0, 16, 66, 78,
0, 7, 8, 255, 255, 240, 0, 66, 78, 1, 19, 41, 22, 47, 0, 0, 66, 79,
0, 7, 15, 13, 18, 0, 32, 66, 81, 0, 18, 8, 255, 255, 240, 16, 66, 82,
0, 7, 43, 6, 52, 0, 32, 66, 83, 0, 20, 21, 23, 22, 0, 0, 66, 84, 0,
7, 8, 13, 7, 0, 48, 66, 86, 0, 18, 8, 255, 255, 240, 16, 66, 87, 0,
7, 45, 13, 51, 0, 48, 66, 89, 0, 7, 33, 255, 255, 240, 0, 66, 90, 0,
7, 15, 13, 18, 0, 16, 67, 65, 0, 0, 21, 0, 22, 0, 0, 67, 65, 2, 6, 15,
5, 18, 0, 16, 67, 67, 0, 18, 8, 255, 255, 240, 16, 67, 68, 0, 7, 33,
14, 39, 0, 48, 67, 70, 0, 7, 33, 14, 39, 0, 16, 67, 71, 0, 7, 33, 14,
39, 0, 48, 67, 72, 0, 7, 33, 6, 43, 0, 32, 67, 72, 1, 7, 37, 6, 36,
0, 32, 67, 73, 0, 7, 33, 14, 39, 0, 48, 67, 75, 0, 7, 44, 13, 50, 0,
16, 67, 76, 0, 7, 7, 6, 6, 0, 0, 67, 77, 0, 7, 33, 14, 39, 0, 16, 67,
78, 0, 23, 49, 26, 53, 0, 0, 67, 79, 0, 7, 13, 6, 11, 0, 32, 67, 80,
0, 18, 8, 255, 255, 240, 16, 67, 82, 0, 7, 14, 6, 15, 0, 32, 67, 85,
0, 7, 8, 14, 255, 192, 48, 67, 86, 0, 7, 33, 14, 39, 0, 16, 67, 87,
0, 18, 8, 255, 255, 240, 16, 67, 88, 0, 20, 42, 23, 46, 0, 16, 67, 89,
0, 7, 33, 6, 43, 0, 32, 67, 89, 1, 7, 37, 6, 36, 0, 32, 67, 90, 0, 7,
33, 6, 43, 0, 32, 67, 90, 1, 7, 37, 6, 36, 0, 32, 68, 69, 0, 7, 33,
6, 43, 0, 32, 68, 69, 3, 7, 37, 6, 36, 0, 32, 68, 74, 0, 7, 8, 255,
255, 240, 16, 68, 75, 0, 7, 33, 6, 43, 0, 32, 68, 75, 1, 7, 37, 6, 36,
0, 32, 68, 77, 0, 7, 15, 13, 18, 0, 16, 68, 79, 0, 7, 15, 13, 18, 0,
16, 68, 90, 0, 7, 5, 6, 4, 0, 32, 69, 48, 0, 7, 12, 6, 13, 0, 32, 69,
67, 0, 7, 14, 6, 17, 0, 32, 69, 69, 0, 7, 33, 6, 43, 0, 32, 69, 69,
1, 7, 37, 6, 36, 0, 32, 69, 71, 0, 7, 41, 21, 48, 0, 0, 69, 72, 0, 7,
6, 13, 5, 0, 16, 69, 82, 0, 7, 8, 255, 255, 240, 16, 69, 83, 0, 7, 33,
6, 43, 0, 32, 69, 83, 1, 7, 37, 6, 36, 0, 32, 69, 84, 0, 7, 33, 6, 43,
0, 0, 70, 73, 0, 7, 33, 6, 43, 0, 32, 70, 73, 1, 7, 37, 6, 36, 0, 32,
70, 74, 0, 7, 42, 13, 46, 0, 16, 70, 75, 0, 7, 33, 14, 39, 0, 16, 70,
77, 0, 6, 15, 5, 18, 0, 16, 70, 79, 0, 7, 33, 14, 39, 0, 48, 70, 82,
0, 7, 33, 6, 43, 0, 32, 70, 82, 1, 7, 37, 6, 36, 0, 32, 71, 65, 0, 7,
33, 14, 39, 0, 16, 71, 66, 0, 7, 33, 6, 43, 0, 32, 71, 66, 1, 7, 37,
6, 36, 0, 32, 71, 68, 0, 7, 43, 6, 52, 0, 0, 71, 69, 0, 7, 33, 14, 39,
0, 48, 71, 70, 0, 7, 33, 6, 43, 0, 0, 71, 71, 0, 7, 33, 14, 39, 0, 16,
71, 72, 0, 7, 33, 14, 39, 0, 48, 71, 73, 0, 7, 33, 14, 39, 0, 16, 71,
76, 0, 18, 8, 255, 255, 240, 16, 71, 77, 0, 7, 33, 14, 39, 0, 16, 71,
78, 0, 7, 33, 14, 39, 0, 48, 71, 80, 0, 7, 33, 6, 43, 0, 0, 71, 81,
0, 7, 33, 14, 39, 0, 16, 71, 82, 0, 7, 33, 6, 43, 0, 32, 71, 82, 1,
7, 37, 6, 36, 0, 32, 71, 83, 0, 18, 8, 255, 255, 240, 16, 71, 84, 0,
7, 14, 12, 17, 0, 16, 71, 85, 0, 0, 14, 0, 17, 0, 0, 71, 87, 0, 7, 33,
14, 39, 0, 16, 71, 89, 0, 7, 46, 13, 54, 0, 16, 72, 75, 0, 20, 43, 24,
52, 0, 0, 72, 77, 0, 18, 8, 255, 255, 240, 16, 72, 78, 0, 7, 47, 13,
61, 0, 0, 72, 82, 0, 7, 33, 6, 43, 0, 32, 72, 82, 1, 7, 37, 6, 36, 0,
32, 72, 84, 0, 7, 46, 13, 54, 0, 0, 72, 85, 0, 7, 33, 6, 43, 0, 32,
72, 85, 1, 7, 37, 6, 36, 0, 32, 73, 68, 0, 7, 8, 6, 7, 0, 0, 73, 68,
5, 7, 55, 14, 65, 0, 16, 73, 69, 0, 7, 33, 6, 43, 0, 32, 73, 69, 1,
7, 37, 6, 36, 0, 32, 73, 76, 0, 7, 5, 6, 4, 0, 32, 73, 77, 0, 7, 33,
14, 39, 0, 16, 73, 78, 0, 19, 41, 22, 47, 0, 32, 73, 79, 0, 7, 33, 14,
39, 0, 16, 73, 81, 0, 7, 33, 14, 39, 0, 16, 73, 82, 0, 7, 8, 14, 255,
192, 48, 73, 83, 0, 7, 33, 6, 43, 0, 32, 73, 83, 1, 7, 37, 6, 36, 0,
32, 73, 84, 0, 7, 33, 6, 43, 0, 32, 73, 84, 1, 7, 37, 6, 36, 0, 32,
74, 48, 0, 7, 38, 16, 42, 0, 0, 74, 49, 0, 15, 12, 255, 255, 240, 0,
74, 50, 0, 15, 5, 255, 255, 240, 0, 74, 51, 0, 15, 38, 255, 255, 240,
0, 74, 52, 0, 15, 24, 255, 255, 240, 0, 74, 53, 0, 15, 27, 255, 255,
240, 0, 74, 54, 0, 15, 28, 255, 255, 240, 0, 74, 55, 0, 15, 29, 255,
255, 240, 0, 74, 56, 0, 15, 40, 255, 255, 240, 0, 74, 57, 0, 7, 28,
16, 27, 0, 0, 74, 69, 0, 7, 33, 14, 39, 0, 16, 74, 77, 0, 7, 46, 14,
60, 0, 16, 74, 79, 0, 7, 1, 6, 0, 0, 32, 74, 80, 0, 15, 39, 17, 40,
0, 0, 74, 80, 1, 15, 28, 16, 27, 0, 0, 74, 80, 3, 15, 39, 16, 41, 0,
0, 74, 80, 88, 16, 8, 18, 7, 0, 0, 75, 65, 0, 22, 17, 25, 16, 0, 0,
75, 67, 0, 22, 46, 25, 54, 0, 0, 75, 68, 0, 7, 51, 6, 58, 0, 0, 75,
69, 0, 7, 33, 6, 38, 0, 32, 75, 71, 0, 7, 33, 14, 39, 0, 16, 75, 72,
0, 7, 43, 6, 52, 0, 0, 75, 73, 0, 20, 42, 23, 46, 0, 16, 75, 75, 0,
22, 8, 25, 7, 0, 0, 75, 77, 0, 7, 33, 14, 39, 0, 16, 75, 78, 0, 7, 15,
13, 18, 0, 16, 75, 80, 0, 18, 8, 255, 255, 240, 16, 75, 82, 0, 18, 55,
20, 44, 0, 0, 75, 82, 4, 23, 30, 26, 28, 0, 16, 75, 87, 0, 7, 8, 6,
7, 0, 32, 75, 87, 1, 7, 5, 6, 4, 0, 32, 75, 88, 0, 7, 48, 6, 56, 0,
0, 75, 89, 0, 8, 8, 8, 7, 0, 0, 75, 90, 0, 7, 36, 13, 34, 0, 0, 76,
65, 0, 7, 34, 6, 31, 0, 0, 76, 66, 0, 7, 46, 6, 59, 0, 32, 76, 67, 0,
7, 15, 13, 18, 0, 16, 76, 73, 0, 7, 33, 6, 43, 0, 0, 76, 73, 1, 7, 37,
6, 36, 0, 0, 76, 75, 0, 19, 43, 22, 52, 0, 0, 76, 82, 0, 7, 43, 21,
50, 0, 16, 76, 83, 0, 7, 33, 6, 43, 0, 0, 76, 84, 0, 7, 33, 6, 43, 0,
32, 76, 84, 1, 7, 37, 6, 36, 0, 32, 76, 85, 0, 7, 33, 6, 43, 0, 32,
76, 85, 1, 7, 37, 6, 36, 0, 32, 76, 86, 0, 7, 33, 6, 43, 0, 32, 76,
86, 1, 7, 37, 6, 36, 0, 32, 76, 89, 0, 7, 8, 15, 255, 192, 16, 77, 65,
0, 7, 12, 21, 12, 0, 32, 77, 65, 1, 7, 5, 21, 4, 0, 32, 77, 67, 0, 7,
33, 6, 43, 0, 0, 77, 68, 0, 7, 33, 6, 43, 0, 32, 77, 69, 0, 7, 33, 6,
43, 0, 32, 77, 70, 0, 7, 45, 13, 51, 0, 16, 77, 71, 0, 7, 33, 14, 39,
0, 48, 77, 72, 0, 18, 8, 255, 255, 240, 16, 77, 75, 0, 7, 33, 6, 43,
0, 32, 77, 76, 0, 7, 33, 14, 39, 0, 16, 77, 77, 0, 7, 33, 14, 39, 0,
16, 77, 78, 0, 7, 14, 12, 17, 0, 32, 77, 79, 0, 7, 50, 6, 59, 0, 0,
77, 80, 0, 6, 15, 5, 18, 0, 16, 77, 81, 0, 7, 33, 6, 43, 0, 0, 77, 82,
0, 7, 33, 6, 43, 0, 0, 77, 83, 0, 7, 33, 14, 39, 0, 48, 77, 84, 0, 7,
33, 6, 43, 0, 32, 77, 84, 1, 7, 37, 6, 36, 0, 32, 77, 85, 0, 7, 33,
6, 43, 0, 32, 77, 86, 0, 7, 10, 6, 10, 0, 32, 77, 87, 0, 7, 46, 6, 59,
0, 32, 77, 88, 0, 7, 5, 6, 4, 0, 0, 77, 88, 1, 7, 21, 6, 22, 0, 0, 77,
89, 0, 19, 41, 22, 47, 0, 0, 77, 90, 0, 7, 16, 13, 14, 0, 16, 78, 65,
0, 7, 16, 13, 14, 0, 16, 78, 67, 0, 7, 33, 14, 39, 0, 16, 78, 69, 0,
7, 33, 14, 39, 0, 16, 78, 70, 0, 7, 42, 12, 45, 0, 0, 78, 71, 0, 7,
26, 14, 26, 0, 48, 78, 73, 0, 7, 14, 6, 17, 0, 32, 78, 76, 0, 7, 33,
6, 43, 0, 32, 78, 76, 1, 7, 37, 6, 36, 0, 32, 78, 79, 0, 7, 33, 6, 43,
0, 32, 78, 79, 1, 7, 37, 6, 36, 0, 32, 78, 80, 0, 19, 9, 22, 8, 0, 0,
78, 82, 0, 7, 33, 14, 39, 0, 16, 78, 85, 0, 7, 14, 255, 255, 240, 16,
78, 90, 0, 7, 43, 6, 52, 0, 32, 79, 77, 0, 7, 33, 6, 43, 0, 32, 80,
65, 0, 19, 0, 22, 24, 0, 32, 80, 69, 0, 7, 14, 6, 17, 0, 32, 80, 70,
0, 7, 33, 14, 39, 0, 16, 80, 71, 0, 7, 2, 6, 0, 0, 0, 80, 72, 0, 7,
43, 6, 52, 0, 32, 80, 75, 0, 7, 50, 12, 55, 0, 32, 80, 76, 0, 7, 33,
6, 43, 0, 32, 80, 76, 1, 7, 37, 6, 36, 0, 32, 80, 77, 0, 7, 33, 14,
39, 0, 16, 80, 78, 0, 18, 8, 255, 255, 240, 16, 80, 82, 0, 0, 14, 0,
17, 0, 0, 80, 83, 0, 18, 8, 255, 255, 240, 0, 80, 84, 0, 7, 33, 6, 43,
0, 32, 80, 84, 1, 7, 37, 6, 36, 0, 32, 80, 87, 0, 7, 15, 13, 18, 0,
16, 80, 89, 0, 7, 46, 6, 59, 0, 0, 80, 89, 1, 7, 43, 6, 52, 0, 0, 81,
49, 0, 2, 8, 2, 7, 0, 0, 81, 50, 0, 0, 31, 0, 29, 0, 0, 81, 65, 0, 7,
50, 14, 57, 0, 48, 82, 69, 0, 7, 33, 6, 43, 0, 0, 82, 79, 0, 7, 33,
6, 43, 0, 32, 82, 79, 1, 7, 37, 6, 36, 0, 32, 82, 83, 0, 7, 33, 6, 43,
0, 32, 82, 85, 0, 7, 8, 255, 255, 240, 0, 82, 85, 5, 7, 11, 12, 9, 0,
0, 82, 87, 0, 7, 33, 14, 39, 0, 48, 83, 65, 0, 7, 34, 6, 32, 0, 32,
83, 66, 0, 7, 8, 255, 255, 240, 16, 83, 67, 0, 7, 45, 13, 51, 0, 16,
83, 68, 0, 7, 8, 14, 255, 192, 48, 83, 69, 0, 7, 33, 6, 43, 0, 32, 83,
69, 1, 7, 37, 6, 36, 0, 32, 83, 71, 0, 19, 44, 22, 50, 0, 32, 83, 72,
0, 18, 8, 255, 255, 240, 16, 83, 73, 0, 7, 33, 6, 43, 0, 32, 83, 73,
1, 7, 37, 6, 36, 0, 32, 83, 74, 0, 18, 8, 255, 255, 240, 16, 83, 75,
0, 7, 33, 6, 43, 0, 32, 83, 75, 1, 7, 37, 6, 36, 0, 32, 83, 76, 0, 7,
33, 14, 39, 0, 16, 83, 77, 0, 7, 33, 14, 39, 0, 16, 83, 78, 0, 7, 33,
6, 43, 0, 32, 83, 79, 0, 7, 8, 255, 255, 240, 16, 83, 82, 0, 7, 33,
14, 39, 0, 16, 83, 84, 0, 7, 33, 14, 39, 0, 16, 83, 86, 0, 7, 14, 12,
17, 0, 32, 83, 88, 0, 18, 8, 255, 255, 240, 16, 83, 89, 0, 18, 8, 255,
255, 240, 16, 83, 90, 0, 7, 33, 14, 39, 0, 16, 84, 65, 0, 18, 8, 255,
255, 240, 16, 84, 67, 0, 7, 33, 14, 39, 0, 16, 84, 68, 0, 7, 33, 14,
39, 0, 16, 84, 70, 0, 7, 33, 14, 39, 0, 16, 84, 71, 0, 7, 33, 14, 39,
0, 16, 84, 72, 0, 7, 43, 6, 52, 0, 32, 84, 74, 0, 7, 33, 14, 39, 0,
16, 84, 75, 0, 18, 8, 255, 255, 240, 16, 84, 76, 0, 7, 33, 14, 39, 0,
48, 84, 77, 0, 7, 33, 14, 39, 0, 16, 84, 78, 0, 7, 5, 6, 4, 0, 32, 84,
79, 0, 7, 8, 255, 255, 240, 16, 84, 82, 0, 7, 5, 6, 4, 0, 32, 84, 82,
7, 7, 33, 14, 39, 0, 48, 84, 84, 0, 7, 43, 6, 52, 0, 32, 84, 86, 0,
7, 8, 255, 255, 240, 16, 84, 87, 0, 0, 52, 0, 64, 0, 0, 84, 87, 2, 0,
53, 0, 62, 0, 0, 84, 90, 0, 7, 33, 14, 39, 0, 16, 85, 65, 0, 7, 8, 255,
255, 240, 0, 85, 71, 0, 7, 34, 6, 31, 0, 32, 85, 77, 0, 0, 14, 0, 17,
0, 0, 85, 83, 0, 5, 32, 4, 30, 0, 0, 85, 83, 25, 12, 8, 10, 7, 0, 0,
85, 83, 26, 4, 8, 1, 7, 0, 0, 85, 89, 0, 20, 43, 23, 52, 0, 0, 85, 90,
0, 7, 33, 14, 39, 0, 16, 86, 65, 0, 7, 33, 6, 43, 0, 0, 86, 67, 0, 7,
15, 13, 18, 0, 16, 86, 69, 0, 7, 41, 6, 47, 0, 0, 86, 71, 0, 7, 33,
6, 43, 0, 0, 86, 73, 0, 0, 14, 0, 17, 0, 0, 86, 78, 0, 7, 5, 6, 4, 0,
0, 86, 85, 0, 7, 43, 13, 49, 0, 16, 87, 70, 0, 7, 33, 13, 43, 0, 16,
87, 83, 0, 7, 43, 12, 49, 0, 16, 88, 48, 0, 3, 20, 0, 21, 0, 0, 88,
49, 0, 7, 41, 6, 47, 0, 0, 88, 50, 0, 21, 3, 6, 2, 0, 0, 88, 51, 0,
7, 33, 6, 35, 0, 32, 88, 65, 0, 7, 3, 255, 255, 240, 0, 88, 66, 0, 0,
23, 255, 255, 240, 0, 88, 82, 0, 1, 54, 3, 63, 0, 0, 88, 83, 0, 13,
4, 11, 1, 0, 32, 88, 84, 0, 12, 8, 10, 7, 0, 32, 88, 85, 0, 9, 37, 7,
37, 0, 32, 88, 86, 0, 11, 8, 9, 7, 0, 32, 88, 87, 0, 22, 35, 25, 33,
0, 32, 88, 88, 0, 10, 33, 255, 255, 240, 32, 88, 89, 0, 7, 33, 6, 43,
0, 32, 88, 90, 0, 14, 8, 255, 255, 240, 32, 89, 49, 0, 0, 14, 255, 255,
240, 16, 89, 50, 0, 0, 14, 255, 255, 240, 16, 89, 51, 0, 0, 14, 255,
255, 240, 16, 89, 52, 0, 0, 14, 255, 255, 240, 16, 89, 53, 0, 0, 14,
255, 255, 240, 16, 89, 54, 0, 0, 14, 255, 255, 240, 16, 89, 55, 0, 0,
14, 255, 255, 240, 16, 89, 69, 0, 7, 45, 13, 51, 0, 16, 89, 84, 0, 7,
33, 6, 43, 0, 0, 89, 89, 0, 18, 8, 255, 255, 240, 0, 90, 49, 0, 18,
8, 255, 255, 240, 16, 90, 50, 0, 18, 8, 255, 255, 240, 16, 90, 51, 0,
18, 8, 255, 255, 240, 16, 90, 52, 0, 18, 8, 255, 255, 240, 16, 90, 53,
0, 18, 8, 255, 255, 240, 16, 90, 54, 0, 18, 8, 255, 255, 240, 16, 90,
55, 0, 18, 8, 255, 255, 240, 16, 90, 56, 0, 18, 8, 255, 255, 240, 16,
90, 57, 0, 18, 8, 255, 255, 240, 16, 90, 65, 0, 7, 33, 6, 43, 0, 32,
90, 77, 0, 19, 41, 22, 47, 0, 0, 90, 87, 0, 7, 33, 14, 39, 0, 48, 10,
2, 255, 3, 17, 19, 24, 28, 30, 49, 0, 4, 56, 19, 1, 70, 27, 1, 58, 34,
1, 70, 49, 1, 14, 0, 255, 2, 23, 19, 23, 49, 2, 2, 84, 19, 1, 84, 49,
1, 14, 0, 255, 2, 23, 19, 23, 49, 0, 2, 66, 19, 1, 66, 49, 1, 23, 1,
1, 4, 23, 19, 17, 28, 23, 38, 30, 49, 2, 2, 84, 22, 1, 84, 49, 1, 24,
1, 5, 2, 23, 23, 30, 49, 0, 4, 56, 19, 1, 58, 28, 1, 60, 39, 1, 70,
49, 1, 15, 1, 255, 1, 23, 20, 2, 1, 84, 20, 1, 15, 1, 255, 1, 23, 20,
2, 1, 84, 20, 1, 20, 1, 255, 2, 21, 20, 21, 49, 2, 2, 84, 20, 1, 84,
49, 1, 0, 0, 255, 0, 0, 0, 19, 1, 255, 2, 23, 20, 23, 48, 0, 2, 66,
20, 1, 66, 48, 1, 20, 1, 255, 2, 23, 20, 20, 49, 0, 2, 66, 20, 1, 64,
49, 1, 20, 1, 255, 2, 23, 20, 20, 49, 2, 2, 92, 20, 1, 80, 49, 1, 9,
0, 255, 1, 23, 19, 2, 1, 84, 19, 1, 9, 0, 255, 1, 20, 19, 0, 1, 56,
19, 1, 11, 2, 255, 3, 17, 19, 24, 30, 30, 49, 0, 5, 56, 19, 1, 70, 27,
1, 58, 34, 1, 68, 38, 1, 70, 49, 1, 13, 2, 255, 3, 17, 19, 24, 31, 30,
49, 0, 5, 56, 19, 1, 78, 27, 1, 64, 34, 1, 68, 36, 1, 78, 43, 1, 26,
1, 255, 2, 23, 20, 30, 40, 2, 2, 84, 23, 1, 112, 49, 1, 14, 2, 255,
2, 17, 19, 30, 49, 0, 2, 58, 19, 1, 80, 49, 1, 27, 0, 255, 1, 30, 26,
0, 1, 120, 26, 1, 26, 2, 255, 1, 30, 25, 0, 1, 120, 25, 1, 10, 2, 2,
3, 17, 19, 24, 28, 30, 49, 0, 4, 56, 19, 1, 70, 27, 1, 58, 34, 1, 70,
49, 1, 10, 2, 255, 3, 17, 19, 24, 28, 30, 49, 0, 4, 56, 19, 1, 66, 27,
1, 60, 34, 1, 66, 49, 1, 20, 2, 255, 2, 23, 20, 33, 49, 2, 2, 84, 20,
1, 84, 49, 1, 10, 2, 1, 3, 17, 19, 24, 28, 30, 49, 0, 4, 56, 19, 1,
70, 27, 1, 58, 34, 1, 70, 49, 1, 32, 2, 255, 1, 30, 38, 2, 1, 84, 38,
1, 29, 2, 255, 2, 21, 28, 30, 49, 0, 2, 60, 28, 1, 68, 49, 1, 29, 1,
255, 2, 30, 28, 30, 49, 2, 2, 112, 28, 1, 112, 49, 1, 5, 2, 0, 2, 23,
18, 23, 19, 2, 2, 84, 18, 1, 84, 19, 1, 7, 2, 0, 2, 23, 18, 23, 20,
2, 2, 84, 18, 1, 84, 20, 1, 8, 2, 0, 3, 23, 18, 23, 20, 30, 38, 2, 2,
84, 18, 1, 84, 22, 1, 6, 1, 255, 4, 14, 18, 14, 19, 20, 29, 20, 48,
0, 4, 48, 18, 1, 48, 19, 1, 60, 29, 1, 60, 48, 1, 14, 0, 255, 2, 17,
19, 30, 49, 0, 2, 56, 19, 1, 68, 49, 1, 12, 2, 255, 3, 17, 19, 24, 31,
30, 50, 0, 6, 62, 19, 1, 90, 27, 1, 80, 35, 1, 90, 41, 1, 86, 45, 1,
118, 50, 1, 22, 1, 255, 2, 23, 20, 30, 38, 2, 1, 84, 22, 1, 25, 1, 255,
1, 23, 24, 2, 1, 84, 24, 1, 14, 0, 6, 2, 17, 19, 20, 49, 0, 2, 56, 19,
1, 60, 49, 1, 18, 1, 255, 2, 20, 20, 20, 44, 2, 2, 72, 20, 1, 72, 44,
1, 22, 1, 255, 2, 23, 20, 30, 38, 2, 1, 84, 22, 1, 22, 2, 255, 1, 20,
22, 0, 2, 62, 20, 1, 66, 38, 1, 16, 2, 255, 2, 20, 20, 28, 38, 2, 2,
84, 20, 1, 112, 38, 1, 4, 0, 255, 1, 23, 18, 2, 1, 84, 18, 1, 20, 1,
255, 2, 23, 20, 30, 49, 2, 2, 84, 20, 1, 84, 49, 1, 21, 1, 255, 3, 23,
20, 30, 37, 30, 46, 2, 2, 84, 21, 1, 84, 46, 1, 26, 1, 255, 3, 23, 20,
24, 39, 30, 49, 2, 1, 84, 25, 1, 26, 1, 255, 3, 23, 20, 24, 39, 30,
49, 2, 1, 84, 25, 1, 17, 1, 255, 2, 23, 20, 30, 40, 2, 2, 84, 20, 1,
112, 40, 1, 34, 0, 255, 1, 27, 49, 2, 1, 84, 49, 1, 34, 0, 255, 1, 30,
49, 0, 1, 78, 49, 1, 14, 0, 255, 2, 27, 19, 27, 49, 2, 2, 84, 19, 1,
84, 49, 1, 34, 0, 255, 1, 27, 49, 2, 1, 84, 49, 1, 34, 0, 255, 1, 20,
49, 2, 1, 76, 49, 1, 33, 0, 255, 1, 20, 48, 2, 1, 76, 48, 1, 31, 2,
255, 2, 17, 33, 30, 49, 0, 2, 68, 33, 1, 68, 49, 1, 30, 2, 255, 3, 17,
33, 24, 38, 30, 49, 0, 3, 56, 33, 1, 68, 38, 1, 68, 49, 1, 28, 2, 255,
3, 17, 28, 24, 38, 30, 49, 0, 3, 56, 28, 1, 58, 38, 1, 62, 49, 1, 33,
0, 255, 1, 27, 48, 2, 1, 84, 48, 1, 0, 0, 3, 0, 0, 0, 120, 11, 0, 0,
16, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1, 18,
1, 255, 1, 52, 1, 14, 1, 15, 3, 28, 39, 49, 2, 19, 49, 166, 169, 0,
0
};
const resource_hnd_t wifi_firmware_clm_blob = { RESOURCE_IN_MEMORY, 7222, {.mem = { (const char *) wifi_firmware_clm_blob_image_data }}};

View File

@ -0,0 +1,27 @@
/*
* Copyright (c) 2019, Cypress Semiconductor Corporation, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Automatically generated file - this comment ensures resources.h file creation */
/* Auto-generated header file. Do not edit */
#ifndef INCLUDED_RESOURCES_H_
#define INCLUDED_RESOURCES_H_
#include "wiced_resource.h"
extern resource_hnd_t wifi_firmware_image;
extern const unsigned char wifi_firmware_image_data[421098];
extern const resource_hnd_t wifi_firmware_clm_blob;
extern const unsigned char wifi_firmware_clm_blob_image_data[7222];
#endif /* ifndef INCLUDED_RESOURCES_H_ */

View File

@ -0,0 +1,87 @@
/*
* Copyright (c) 2019, Cypress Semiconductor Corporation, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** @file
* NVRAM file for CY8CKIT-062-WiFi-BT (PSoC6 WiFi-BT Pioneer Kit) using
* Murata's Type 1DX module - Copied from bcm94343wwcd1.txt on 08/04/2019
* # 2.4 GHz, 20 MHz BW mode; No Antenna Diversity
*/
#ifndef INCLUDED_NVRAM_IMAGE_H_
#define INCLUDED_NVRAM_IMAGE_H_
#include <string.h>
#include <stdint.h>
#include "generated_mac_address.txt"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Character array of NVRAM image
*
* Generated from cyw94343cy8ckit-062-wifi-bt.txt
*/
static const char wifi_nvram_image[] =
"manfid=0x2d0" "\x00"
"prodid=0x0726" "\x00"
"vendid=0x14e4" "\x00"
"devid=0x43e2" "\x00"
"boardtype=0x0726" "\x00"
"boardrev=0x1202" "\x00"
"boardnum=22" "\x00"
NVRAM_GENERATED_MAC_ADDRESS "\x00"
"sromrev=11" "\x00"
"boardflags=0x00404201" "\x00"
"boardflags3=0x04000000" "\x00"
"xtalfreq=37400" "\x00"
"nocrc=1" "\x00"
"ag0=0" "\x00"
"aa2g=1" "\x00"
"ccode=ALL" "\x00"
"extpagain2g=0" "\x00"
"pa2ga0=-145,6667,-751" "\x00"
"AvVmid_c0=0x0,0xc8" "\x00"
"cckpwroffset0=2" "\x00"
"maxp2ga0=74" "\x00"
"cckbw202gpo=0" "\x00"
"legofdmbw202gpo=0x88888888" "\x00"
"mcsbw202gpo=0xaaaaaaaa" "\x00"
"propbw202gpo=0xdd" "\x00"
"ofdmdigfilttype=18" "\x00"
"ofdmdigfilttypebe=18" "\x00"
"papdmode=1" "\x00"
"papdvalidtest=1" "\x00"
"pacalidx2g=48" "\x00"
"papdepsoffset=-22" "\x00"
"papdendidx=58" "\x00"
"il0"NVRAM_GENERATED_MAC_ADDRESS "\x00"
"wl0id=0x431b" "\x00"
"muxenab=0x10" "\x00"
"\x00\x00";
#ifdef __cplusplus
} /* extern "C" */
#endif
#else /* ifndef INCLUDED_NVRAM_IMAGE_H_ */
#error Wi-Fi NVRAM image included twice
#endif /* ifndef INCLUDED_NVRAM_IMAGE_H_ */

View File

@ -0,0 +1,320 @@
/*
* Copyright 2020 Cypress Semiconductor Corporation
* 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
*
* 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
* Defines WHD resource functions for BCM943340WCD1 platform
*/
#include "resources.h"
#include "wifi_nvram_image.h"
#include "whd_resource_api.h"
#include "whd_debug.h"
#include "whd.h"
/******************************************************
* Macros
******************************************************/
#define BLOCK_BUFFER_SIZE (1024)
/******************************************************
* Constants
******************************************************/
#if defined(WHD_DYNAMIC_NVRAM)
#define NVRAM_SIZE dynamic_nvram_size
#define NVRAM_IMAGE_VARIABLE dynamic_nvram_image
#else
#define NVRAM_SIZE sizeof(wifi_nvram_image)
#define NVRAM_IMAGE_VARIABLE wifi_nvram_image
#endif
/******************************************************
* Enumerations
******************************************************/
/******************************************************
* Type Definitions
******************************************************/
/******************************************************
* Structures
******************************************************/
/******************************************************
* Static Function Declarations
******************************************************/
uint32_t host_platform_resource_size(whd_driver_t whd_drv, whd_resource_type_t resource, uint32_t *size_out);
uint32_t host_get_resource_block(whd_driver_t whd_drv, whd_resource_type_t type,
uint32_t blockno, const uint8_t **data, uint32_t *size_out);
uint32_t host_get_resource_no_of_blocks(whd_driver_t whd_drv, whd_resource_type_t type, uint32_t *block_count);
uint32_t host_get_resource_block_size(whd_driver_t whd_drv, whd_resource_type_t type, uint32_t *size_out);
resource_result_t resource_read(const resource_hnd_t *resource, uint32_t offset, uint32_t maxsize, uint32_t *size,
void *buffer);
/******************************************************
* Variable Definitions
******************************************************/
#ifdef WLAN_MFG_FIRMWARE
extern const resource_hnd_t wifi_mfg_firmware_image;
extern const resource_hnd_t wifi_mfg_firmware_clm_blob;
#else
extern const resource_hnd_t wifi_firmware_image;
extern const resource_hnd_t wifi_firmware_clm_blob;
#endif
unsigned char r_buffer[BLOCK_BUFFER_SIZE];
#if defined(WHD_DYNAMIC_NVRAM)
uint32_t dynamic_nvram_size = sizeof(wifi_nvram_image);
void *dynamic_nvram_image = &wifi_nvram_image;
#endif
/******************************************************
* Function Definitions
******************************************************/
resource_result_t resource_read(const resource_hnd_t *resource, uint32_t offset, uint32_t maxsize, uint32_t *size,
void *buffer)
{
if (offset > resource->size)
{
return RESOURCE_OFFSET_TOO_BIG;
}
*size = MIN(maxsize, resource->size - offset);
if (resource->location == RESOURCE_IN_MEMORY)
{
memcpy(buffer, &resource->val.mem.data[offset], *size);
}
#ifdef USES_RESOURCES_IN_EXTERNAL_STORAGE
else if (resource->location == RESOURCE_IN_EXTERNAL_STORAGE)
{
return platform_read_external_resource(resource, offset, maxsize, size, buffer);
}
#endif
#ifdef USES_RESOURCE_GENERIC_FILESYSTEM
else
{
wiced_file_t file_handle;
uint64_t size64;
uint64_t maxsize64 = maxsize;
if (WICED_SUCCESS !=
wiced_filesystem_file_open (&resource_fs_handle, &file_handle, resource->val.fs.filename,
WICED_FILESYSTEM_OPEN_FOR_READ) )
{
return RESOURCE_FILE_OPEN_FAIL;
}
if (WICED_SUCCESS != wiced_filesystem_file_seek (&file_handle, (offset + resource->val.fs.offset), SEEK_SET) )
{
return RESOURCE_FILE_SEEK_FAIL;
}
if (WICED_SUCCESS != wiced_filesystem_file_read (&file_handle, buffer, maxsize64, &size64) )
{
wiced_filesystem_file_close (&file_handle);
return RESOURCE_FILE_READ_FAIL;
}
*size = (uint32_t)size64;
wiced_filesystem_file_close (&file_handle);
}
#else
#ifdef USES_RESOURCE_FILESYSTEM
else
{
wicedfs_file_t file_hnd;
if (0 != wicedfs_fopen(&resource_fs_handle, &file_hnd, resource->val.fs.filename) )
{
return RESOURCE_FILE_OPEN_FAIL;
}
if (0 != wicedfs_fseek(&file_hnd, (long)(offset + resource->val.fs.offset), SEEK_SET) )
{
wicedfs_fclose(&file_hnd);
return RESOURCE_FILE_SEEK_FAIL;
}
if (*size != wicedfs_fread(buffer, 1, *size, &file_hnd) )
{
wicedfs_fclose(&file_hnd);
return RESOURCE_FILE_READ_FAIL;
}
wicedfs_fclose(&file_hnd);
}
#endif /* ifdef USES_RESOURCE_FILESYSTEM */
#endif /* USES_RESOURCE_GENERIC_FILESYSTEM */
return RESOURCE_SUCCESS;
}
uint32_t host_platform_resource_size(whd_driver_t whd_drv, whd_resource_type_t resource, uint32_t *size_out)
{
if (resource == WHD_RESOURCE_WLAN_FIRMWARE)
{
#ifdef NO_WIFI_FIRMWARE
whd_assert("Request firmware in a no wifi firmware application", 0 == 1);
*size_out = 0;
#else
#ifdef WIFI_FIRMWARE_IN_MULTI_APP
wiced_app_t wifi_app;
*size_out = 0;
if (wiced_waf_app_open(DCT_WIFI_FIRMWARE_INDEX, &wifi_app) != WICED_SUCCESS)
{
return ( whd_result_t )RESOURCE_UNSUPPORTED;
}
wiced_waf_app_get_size(&wifi_app, size_out);
#else
#ifdef WLAN_MFG_FIRMWARE
*size_out = (uint32_t)resource_get_size(&wifi_mfg_firmware_image);
#else
*size_out = (uint32_t)resource_get_size(&wifi_firmware_image);
#endif /* WLAN_MFG_FIRMWARE */
#endif /* WIFI_FIRMWARE_IN_MULTI_APP */
#endif /* NO_WIFI_FIRMWARE */
}
else if (resource == WHD_RESOURCE_WLAN_NVRAM)
{
*size_out = NVRAM_SIZE;
}
else
{
#ifdef WLAN_MFG_FIRMWARE
*size_out = (uint32_t)resource_get_size(&wifi_mfg_firmware_clm_blob);
#else
*size_out = (uint32_t)resource_get_size(&wifi_firmware_clm_blob);
#endif /* WLAN_MFG_FIRMWARE */
}
return WHD_SUCCESS;
}
uint32_t host_get_resource_block(whd_driver_t whd_drv, whd_resource_type_t type,
uint32_t blockno, const uint8_t **data, uint32_t *size_out)
{
uint32_t resource_size;
uint32_t block_size;
uint32_t block_count;
uint32_t read_pos;
uint32_t result;
host_platform_resource_size(whd_drv, type, &resource_size);
host_get_resource_block_size(whd_drv, type, &block_size);
host_get_resource_no_of_blocks(whd_drv, type, &block_count);
memset(r_buffer, 0, block_size);
read_pos = blockno * block_size;
if (blockno >= block_count)
{
return WHD_BADARG;
}
if (type == WHD_RESOURCE_WLAN_FIRMWARE)
{
#ifdef WLAN_MFG_FIRMWARE
result = resource_read( (const resource_hnd_t *)&wifi_mfg_firmware_image, read_pos, block_size, size_out,
r_buffer );
#else
result = resource_read( (const resource_hnd_t *)&wifi_firmware_image, read_pos, block_size, size_out,
r_buffer );
#endif /* WLAN_MFG_FIRMWARE */
if (result != WHD_SUCCESS)
{
return result;
}
*data = (uint8_t *)&r_buffer;
/*
* In case of local buffer read use the following code
*
* *size_out = MIN(BLOCK_BUFFER_SIZE, resource_size - transfer_progress);
* *data = (uint8_t *)wifi_firmware_image_data;
*
* For sending the entire buffer in single block set size out as following
* *size_out = (uint32_t)resource_get_size(&wifi_firmware_image);
*/
}
else if (type == WHD_RESOURCE_WLAN_NVRAM)
{
if (NVRAM_SIZE - read_pos > block_size)
{
*size_out = block_size;
}
else
{
*size_out = NVRAM_SIZE - read_pos;
}
*data = ( (uint8_t *)NVRAM_IMAGE_VARIABLE ) + read_pos;
}
else
{
#ifdef WLAN_MFG_FIRMWARE
result = resource_read( (const resource_hnd_t *)&wifi_mfg_firmware_clm_blob, read_pos, block_size,
size_out,
r_buffer );
#else
result = resource_read( (const resource_hnd_t *)&wifi_firmware_clm_blob, read_pos, block_size,
size_out,
r_buffer );
#endif /* WLAN_MFG_FIRMWARE */
if (result != WHD_SUCCESS)
{
return result;
}
*data = (uint8_t *)&r_buffer;
/*
* In case of local buffer read use the following code
*
* *size_out = MIN(BLOCK_BUFFER_SIZE, resource_size - transfer_progress);
* *data = (uint8_t *)wifi_firmware_clm_blob_image_data;
*
* For sending the entire buffer in single block set size out as following
* *size_out = sizeof(wifi_firmware_clm_blob_image_data);
*/
}
return WHD_SUCCESS;
}
uint32_t host_get_resource_block_size(whd_driver_t whd_drv, whd_resource_type_t type, uint32_t *size_out)
{
*size_out = BLOCK_BUFFER_SIZE;
return WHD_SUCCESS;
}
uint32_t host_get_resource_no_of_blocks(whd_driver_t whd_drv, whd_resource_type_t type, uint32_t *block_count)
{
uint32_t resource_size;
uint32_t block_size;
host_platform_resource_size(whd_drv, type, &resource_size);
host_get_resource_block_size(whd_drv, type, &block_size);
*block_count = resource_size / block_size;
if (resource_size % block_size)
*block_count += 1;
return WHD_SUCCESS;
}
whd_resource_source_t resource_ops =
{
.whd_resource_size = host_platform_resource_size,
.whd_get_resource_block_size = host_get_resource_block_size,
.whd_get_resource_no_of_blocks = host_get_resource_no_of_blocks,
.whd_get_resource_block = host_get_resource_block
};

View File

@ -0,0 +1,228 @@
/*
* Copyright 2020 Cypress Semiconductor Corporation
* 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
*
* 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
* WICED Resource API's
* The Resource Management functions reads resource from a resource location
* and returns the number of bytes from an offset in an caller filled buffer.
*
* Functions to get the resource size and resource data
*
* The Resource could be one of the three locations
*
* - Wiced Filesystem (File System)
* - Internal Memory (Embedded Flash memory)
* - External Storage ( External Flash connected via SPI interface)
*
*/
#ifndef INCLUDED_RESOURCE_H_
#define INCLUDED_RESOURCE_H_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************
* Macros
******************************************************/
#ifndef MIN
#define MIN(x, y) ( (x) < (y) ? (x) : (y) )
#endif /* ifndef MIN */
/* Suppress unused parameter warning */
#ifndef UNUSED_PARAMETER
#define UNUSED_PARAMETER(x) ( (void)(x) )
#endif
#ifndef RESULT_ENUM
#define RESULT_ENUM(prefix, name, value) prefix ## name = (value)
#endif /* ifndef RESULT_ENUM */
#if defined(CY_SECTION)
#define CY_SECTION_WHD CY_SECTION
#else
#if !defined(CY_SECTION_WHD)
#if defined(__ARMCC_VERSION)
#define CY_SECTION_WHD(name) __attribute__ ( (section(name) ) )
#elif defined (__GNUC__)
#if defined (__clang__)
#define CY_SECTION_WHD(name) __attribute__ ( (section("__DATA, "name) ) )
#else
#define CY_SECTION_WHD(name) __attribute__ ( (section(name) ) )
#endif
#elif defined (__ICCARM__)
#define CY_SECTION_WHD(name) CY_PRAGMA(location = name)
#else
#error "An unsupported toolchain"
#endif /* (__ARMCC_VERSION) */
#endif /* !defined(CY_SECTION_WHD) */
#endif /* defined(CY_SECTION) */
/* These Enum result values are for Resource errors
* Values: 4000 - 4999
*/
#define RESOURCE_RESULT_LIST(prefix) \
RESULT_ENUM(prefix, SUCCESS, 0), /**< Success */ \
RESULT_ENUM(prefix, UNSUPPORTED, 7), /**< Unsupported function */ \
RESULT_ENUM(prefix, OFFSET_TOO_BIG, 4001), /**< Offset past end of resource */ \
RESULT_ENUM(prefix, FILE_OPEN_FAIL, 4002), /**< Failed to open resource file */ \
RESULT_ENUM(prefix, FILE_SEEK_FAIL, 4003), /**< Failed to seek to requested offset in resource file */ \
RESULT_ENUM(prefix, FILE_READ_FAIL, 4004), /**< Failed to read resource file */
#define resource_get_size(resource) ( (resource)->size )
/******************************************************
* Constants
******************************************************/
#define RESOURCE_ENUM_OFFSET (1300)
/******************************************************
* Enumerations
******************************************************/
/**
* Result type for WICED Resource function
*/
typedef enum
{
RESOURCE_RESULT_LIST(RESOURCE_)
} resource_result_t;
/******************************************************
* Type Definitions
******************************************************/
typedef const void *resource_data_t;
typedef unsigned long resource_size_t;
/******************************************************
* Structures
******************************************************/
/**
* Memory handle
*/
typedef struct
{
const char *data; /**< resource data */
} memory_resource_handle_t;
/**
* Filesystem handle
*/
typedef struct
{
unsigned long offset; /**< Offset to the start of the resource */
const char *filename; /**< name of the resource */
} filesystem_resource_handle_t;
typedef enum
{
RESOURCE_IN_MEMORY, /**< resource location in memory */
RESOURCE_IN_FILESYSTEM, /**< resource location in filesystem */
RESOURCE_IN_EXTERNAL_STORAGE /**< resource location in external storage */
} resource_location_t;
/**
* Resource handle structure
*/
typedef struct
{
resource_location_t location; /**< resource location */
unsigned long size; /**< resource size */
union
{
filesystem_resource_handle_t fs; /** < filesystem resource handle */
memory_resource_handle_t mem; /** < memory resource handle */
void *external_storage_context; /** < external storage context */
} val;
} resource_hnd_t;
/******************************************************
* Global Variables
******************************************************/
/******************************************************
* Function Declarations
******************************************************/
/*****************************************************************************/
/** @addtogroup resourceapi Wiced Resource Management API's
* @ingroup framework
*
* WCIED Resource Management API's has functions to get the
* resource size and reads resource data from a resource
* location and returns the number of bytes in an caller
* filled buffer
*
* The Resource could be one of the three locations
*
* - Wiced Filesystem ( File System)
* - Internal Memory (Embedded Flash memory)
* - External Storage ( External Flash connected via SPI interface )
*
* @{
*/
/*****************************************************************************/
/** Read resource using the handle specified
*
* @param[in] resource : handle of the resource to read
* @param[in] offset : offset from the beginning of the resource block
* @param[in] maxsize : size of the buffer
* @param[out] size : size of the data successfully read
* @param[in] buffer : pointer to a buffer to contain the read data
*
* @return @ref resource_result_t
*/
extern resource_result_t resource_read(const resource_hnd_t *resource, uint32_t offset, uint32_t maxsize,
uint32_t *size, void *buffer);
/** Retrieve a read only resource buffer using the handle specified
*
* @param[in] resource : handle of the resource to read
* @param[in] offset : offset from the beginning of the resource block
* @param[in] maxsize : size of the buffer
* @param[out] size : size of the data successfully read
* @param[out] buffer : pointer to a buffer pointer to point to the resource data
*
* @return @ref resource_result_t
*/
extern resource_result_t resource_get_readonly_buffer(const resource_hnd_t *resource, uint32_t offset, uint32_t maxsize,
uint32_t *size_out, const void **buffer);
/** Free a read only resource buffer using the handle specified
*
* @param[in] resource : handle of the resource to read
* @param[in] buffer : pointer to a buffer set using resource_get_readonly_buffer
*
* @return @ref resource_result_t
*/
extern resource_result_t resource_free_readonly_buffer(const resource_hnd_t *handle, const void *buffer);
/* @} */
#ifdef __cplusplus
} /*extern "C" */
#endif
#endif /* ifndef INCLUDED_RESOURCE_H_ */