diff --git a/fm33lc0xxn_mini_system_demo/BUILD.gn b/fm33lc0xxn_mini_system_demo/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..f3dc27c151c3f02a33f29c79fb9ad20aea504995 --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/BUILD.gn @@ -0,0 +1,62 @@ +# 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. + +executable("fm33lc0xxn_mini_system_demo") { + output_name = "OHOS_Image" + ldflags = [ + "-Wl,-T" + rebase_path("//device/fudanmicro/FM33LC0xxN/fm33lc04x_flash.ld"), + "-mcpu=cortex-m0", + "-fdata-sections", + "-mthumb", + "-mthumb-interwork", + "-Wl,--gc-section", + "-Wl,-Map=bin/$output_name.map", + ] + + # config force lib from /config.json + foreach(lib_file, lib_list) { + # force link invisible function ,which ar to lib + ldflags += [ "-Wl,--whole-archive",] + foreach(force_link_lib, lib_file.force_link_libs) { + ldflags += [ "libs/lib${force_link_lib}.a", ] + } + ldflags += [ "-Wl,--no-whole-archive",] + } + + deps = [ + "//build/lite:ohos", + "//device/fudanmicro/FM33LC0xxN:board", + "//device/fudanmicro/FM33LC0xxN/drivers:drivers", + "//drivers/adapter/khdf/liteos_m:hdf_lite", + "//drivers/adapter/khdf/liteos_m/core:hdf_core", + "//drivers/adapter/khdf/liteos_m/osal:hdf_osal_lite", + "//base/startup/bootstrap_lite/services/source:bootstrap", + "//foundation/distributedschedule/samgr_lite/samgr:samgr", + "//base/hiviewdfx/hilog_lite/frameworks/mini:hilog_lite", + ] +} diff --git a/fm33lc0xxn_mini_system_demo/config.json b/fm33lc0xxn_mini_system_demo/config.json new file mode 100755 index 0000000000000000000000000000000000000000..04fae4d3535c73cde704ea8af311672a27a4b006 --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/config.json @@ -0,0 +1,66 @@ +{ + "product_name": "fm33lc0xxn_mini_system_demo", + "ohos_version": "OpenHarmony 1.0", + "device_company": "fudanmicro", + "board": "FM33LC0xxN", + "kernel_type": "liteos_m", + "kernel_version": "3.0.0", + "subsystems": [ + { + "subsystem": "kernel", + "components": [ + { + "component": "liteos_m", + "features": [ + "enable_ohos_kernel_liteos_m_fs = true", + "enable_ohos_kernel_liteos_m_fatfs = false" + ] + } + ] + }, + { + "subsystem": "distributedschedule", + "components": [ + { "component": "samgr_lite", "features":[]} + ] + }, + { + "subsystem": "startup", + "components": [ + { "component": "bootstrap_lite", "features":[]} + ] + }, + { + "subsystem": "hdf", + "components": [ + { "component": "adapter_khdf_liteos_m", "features":[]} + ] + }, + { + "subsystem": "hiviewdfx", + "components": [ + { + "component": "hilog_lite", + "optional": "true", + "features": [] + } + ] + } + ], + "lib_list": [ + { + "force_link_libs": [ + "hdf_platform_lite", + "gpio", + "pwm", + "rtc", + "spi", + "board", + "watchdog" + ] + } + ], + + "third_party_dir": "", + "product_adapter_dir": "//vendor/fudanmicro/fm33lc0xxn_mini_system_demo/hals" +} diff --git a/fm33lc0xxn_mini_system_demo/config/BUILD.gn b/fm33lc0xxn_mini_system_demo/config/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..5ff24554c9cc4374128484bd3f61f6a0986fb19a --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/config/BUILD.gn @@ -0,0 +1,5 @@ +group("config") { + deps = [ + "hdf_config:hdf_hcs", + ] +} diff --git a/fm33lc0xxn_mini_system_demo/config/gpio/gpio_config.hcs b/fm33lc0xxn_mini_system_demo/config/gpio/gpio_config.hcs new file mode 100755 index 0000000000000000000000000000000000000000..04da09b065a48f6c2c3d76d78f1e95035054964b --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/config/gpio/gpio_config.hcs @@ -0,0 +1,30 @@ +// Copyright 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. + + +root { + platform { + gpio_config { + gpio_sample { + match_attr = "Fm33xx_gpio"; + groupNum = 4; + bitNum = 16; + regBase = 0x40000C00; + regStep = 0x40; + irqStart = 48; + irqShare = 0; + } + } + } +} diff --git a/fm33lc0xxn_mini_system_demo/config/hdf.hcs b/fm33lc0xxn_mini_system_demo/config/hdf.hcs new file mode 100755 index 0000000000000000000000000000000000000000..f9924867e15eb5de1d19a24987671ca8b899b9ea --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/config/hdf.hcs @@ -0,0 +1,12 @@ +#include "./hdf_config/device_info.hcs" +#include "./uart/uart_config.hcs" +#include "./gpio/gpio_config.hcs" +#include "./i2c/i2c_config.hcs" +#include "./pwm/pwm_config.hcs" +#include "./rtc/rtc_config.hcs" +#include "./spi/spi_config.hcs" +#include "./watchdog/watchdog_config.hcs" + +root { + module = "fudanmicro,fm33xx_chip"; +} diff --git a/fm33lc0xxn_mini_system_demo/config/hdf_config/device_info.hcs b/fm33lc0xxn_mini_system_demo/config/hdf_config/device_info.hcs new file mode 100755 index 0000000000000000000000000000000000000000..4a4d158dd3d08b94bd1187e5d650f15a1e7f5f58 --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/config/hdf_config/device_info.hcs @@ -0,0 +1,112 @@ + root { + device_info { + match_attr = "hdf_manager"; + template host { + hostName = ""; + priority = 100; + template device { + template deviceNode { + policy = 0; + priority = 100; + preload = 0; + permission = 0664; + moduleName = ""; + serviceName = ""; + deviceMatchAttr = ""; + } + } + } + platform :: host { + hostName = "platform_host"; + priority = 50; + device_uart :: device { + device0 :: deviceNode { + policy = 1; + priority = 40; + permission = 0644; + moduleName = "Fm33xx_uart_driver"; + serviceName = "HDF_PLATFORM_UART_0"; + deviceMatchAttr = "fm33xx_uart_0"; + } + device1 :: deviceNode { + policy = 1; + priority = 40; + permission = 0644; + moduleName = "Fm33xx_uart_driver"; + serviceName = "HDF_PLATFORM_UART_1"; + deviceMatchAttr = "fm33xx_uart_1"; + } + } + device_gpio :: device { + device0 :: deviceNode { + policy = 2; + priority = 50; + preload = 0; + permission = 0644; + moduleName = "Fm33xx_gpio_driver"; + serviceName = "Fm33xx_gpio"; + deviceMatchAttr = "Fm33xx_gpio"; + } + } + device_i2c :: device { + device0 :: deviceNode { + policy = 2; + priority = 50; + permission = 0644; + moduleName = "HDF_PLATFORM_I2C_MANAGER"; + serviceName = "HDF_PLATFORM_I2C_MANAGER"; + deviceMatchAttr = "hdf_platform_i2c_manager"; + } + device1 :: deviceNode { + policy = 0; + priority = 55; + permission = 0644; + moduleName = "Fm33xx_i2c_driver"; + serviceName = "Fm33xx_i2c_driver"; + deviceMatchAttr = "fm33xx_i2c_0"; + } + } + device_pwm :: device { + device0 :: deviceNode { + policy = 1; + priority = 40; + permission = 0644; + moduleName = "Fm33xx_pwm_driver"; + serviceName = "HDF_PLATFORM_PWM_0"; + deviceMatchAttr = "fm33xx_pwm_0"; + } + } + device_rtc :: device { + device0 :: deviceNode { + policy = 1; + priority = 30; + permission = 0644; + moduleName = "Fm33xx_rtc_driver"; + serviceName = "HDF_PLATFORM_RTC"; + deviceMatchAttr = "fm33cl0xx_rtc"; + } + } + device_watchdog :: device { + device0 :: deviceNode { + policy = 1; + priority = 20; + permission = 0644; + moduleName = "HDF_PLATFORM_WATCHDOG"; + serviceName = "HDF_PLATFORM_WATCHDOG_0"; + deviceMatchAttr = "fudanmicro_fm33xx_watchdog_0"; + } + } + device_spi :: device { + device0 :: deviceNode { + policy = 1; + priority = 60; + permission = 0644; + moduleName = "Fm33xx_spi_driver"; + serviceName = "HDF_PLATFORM_SPI_1"; + deviceMatchAttr = "Fm33lc0xx_spi_1"; + } + } + } + } +} + diff --git a/fm33lc0xxn_mini_system_demo/config/i2c/i2c_config.hcs b/fm33lc0xxn_mini_system_demo/config/i2c/i2c_config.hcs new file mode 100755 index 0000000000000000000000000000000000000000..85ac08fa234056b028091d0dbb3ca3fb6dd7f533 --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/config/i2c/i2c_config.hcs @@ -0,0 +1,28 @@ +root { + platform { + i2c_config{ + match_attr = "fm33xx_i2c_0"; + template i2c_controller { + bus = 0; + irq = 0; + baudrate = 40000; + regbase = 0; + } + + controller_0 :: i2c_controller { + bus = 0; + regbase = 0x40012400; + i2cport = 0x40000C00; + sclpin = 0x00001000; + sdapin = 0x00000800; + } + + controller_1 :: i2c_controller { + bus = 1; + regbase = 0; + } + + } + } +} + diff --git a/fm33lc0xxn_mini_system_demo/config/pwm/pwm_config.hcs b/fm33lc0xxn_mini_system_demo/config/pwm/pwm_config.hcs new file mode 100755 index 0000000000000000000000000000000000000000..e619c8b8bd5770852981b32cbf217035c2803230 --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/config/pwm/pwm_config.hcs @@ -0,0 +1,18 @@ +root { + platform { + pwm_config { + template pwm_device { + serviceName = ""; + match_attr = ""; + } + + device_0 :: pwm_device { + match_attr = "fm33xx_pwm_0"; + num = 0; + gptim = 0; + channel = 0x8; + prescaler = 10; + } + } + } +} diff --git a/fm33lc0xxn_mini_system_demo/config/rtc/rtc_config.hcs b/fm33lc0xxn_mini_system_demo/config/rtc/rtc_config.hcs new file mode 100755 index 0000000000000000000000000000000000000000..3e5d882f4b1cbcb316d6fcc0d4b1425e14a6dc60 --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/config/rtc/rtc_config.hcs @@ -0,0 +1,13 @@ +root { + platform { + rtc_config { + controller_0x12080000 { + match_attr = "fm33cl0xx_rtc"; + irq = 37; + supportAnaCtrl = false; + supportLock = false; + } + } + } +} + diff --git a/fm33lc0xxn_mini_system_demo/config/spi/spi_config.hcs b/fm33lc0xxn_mini_system_demo/config/spi/spi_config.hcs new file mode 100755 index 0000000000000000000000000000000000000000..f6dce6908a8901a0ff0aed35cb10a280b1bbc93e --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/config/spi/spi_config.hcs @@ -0,0 +1,22 @@ +root { + platform { + spi_config { + template spi_controller { + serviceName = ""; + } + + controller_0 :: spi_controller { + busNum = 1; + numCs = 1; + match_attr = "Fm33lc0xx_spi_1"; + } + + controller_1 :: spi_controller { + busNum = 2; + numCs = 1; + match_attr = "Fm33lc0xx_spi_2"; + } + } + } +} + diff --git a/fm33lc0xxn_mini_system_demo/config/uart/uart_config.hcs b/fm33lc0xxn_mini_system_demo/config/uart/uart_config.hcs new file mode 100755 index 0000000000000000000000000000000000000000..69d9f10654ad4623bca9a50abdf852a8f82c7416 --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/config/uart/uart_config.hcs @@ -0,0 +1,35 @@ +root { + platform { + template uart_controller { + match_attr = ""; + num = 0; + baudrate = 115200; + fifoRxEn = 1; + fifoTxEn = 1; + flags = 4; + regPbase = 0x120a0000; + interrupt = 38; + iomemCount = 0x48; + } + + controller_0 :: uart_controller { + num = 0; + match_attr = "fm33xx_uart_0"; + gpioport = 0x40000C00; + rx_pin = 0x00002000; + tx_pin = 0x00004000; + } + + controller_1 :: uart_controller { + num = 1; + baudrate = 57600; + fifoTxEn = 0; + match_attr = "fm33xx_uart_1"; + gpioport = 0x40000C80; + rx_pin = 0x00000004; + tx_pin = 0x00000008; + } + + } +} + diff --git a/fm33lc0xxn_mini_system_demo/config/watchdog/watchdog_config.hcs b/fm33lc0xxn_mini_system_demo/config/watchdog/watchdog_config.hcs new file mode 100755 index 0000000000000000000000000000000000000000..46a68e46a3d796637b5533b103457f11207291b0 --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/config/watchdog/watchdog_config.hcs @@ -0,0 +1,13 @@ +root { + platform { + template watchdog_controller { + id = 0; + match_attr = ""; + regBase = 0x40011400; + regStep = 0x1000; + } + controller_0x12050000 :: watchdog_controller { + match_attr = "fudanmicro_fm33xx_watchdog_0"; + } + } +} diff --git a/fm33lc0xxn_mini_system_demo/hals/utils/sys_param/BUILD.gn b/fm33lc0xxn_mini_system_demo/hals/utils/sys_param/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..da7e635996338b5573b1e7e12df269b5cac566dc --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/hals/utils/sys_param/BUILD.gn @@ -0,0 +1,27 @@ +# 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_sysparam") { + sources = [ "hal_sys_param.c" ] + include_dirs = [ + "//base/startup/syspara_lite/hals", + ] + defines = [ + "INCREMENTAL_VERSION=\"${ohos_version}\"", + "BUILD_TYPE=\"${ohos_build_type}\"", + "BUILD_USER=\"${ohos_build_user}\"", + "BUILD_TIME=\"${ohos_build_time}\"", + "BUILD_HOST=\"${ohos_build_host}\"", + "BUILD_ROOTHASH=\"${ohos_build_roothash}\"", + ] +} diff --git a/fm33lc0xxn_mini_system_demo/hals/utils/sys_param/hal_sys_param.c b/fm33lc0xxn_mini_system_demo/hals/utils/sys_param/hal_sys_param.c new file mode 100755 index 0000000000000000000000000000000000000000..11b5c4d9771eb8aa7aae044bc9a8b93056fda637 --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/hals/utils/sys_param/hal_sys_param.c @@ -0,0 +1,128 @@ +/* + * 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_sys_param.h" + +static const char OHOS_DEVICE_TYPE[] = {"****"}; +static const char OHOS_DISPLAY_VERSION[] = {"OpenHarmony 1.0.1"}; +static const char OHOS_MANUFACTURE[] = {"****"}; +static const char OHOS_BRAND[] = {"****"}; +static const char OHOS_MARKET_NAME[] = {"****"}; +static const char OHOS_PRODUCT_SERIES[] = {"****"}; +static const char OHOS_PRODUCT_MODEL[] = {"****"}; +static const char OHOS_SOFTWARE_MODEL[] = {"****"}; +static const char OHOS_HARDWARE_MODEL[] = {"****"}; +static const char OHOS_HARDWARE_PROFILE[] = {"aout:true,display:true"}; +static const char OHOS_BOOTLOADER_VERSION[] = {"bootloader"}; +static const char OHOS_ABI_LIST[] = {"****"}; +static const char OHOS_SERIAL[] = {"1234567890"}; // provided by OEM. +static const int OHOS_FIRST_API_VERSION = 1; + +static const char EMPTY_STR[] = {""}; + +const char* HalGetDeviceType(void) +{ + return OHOS_DEVICE_TYPE; +} + +const char* HalGetManufacture(void) +{ + return OHOS_MANUFACTURE; +} + +const char* HalGetBrand(void) +{ + return OHOS_BRAND; +} + +const char* HalGetMarketName(void) +{ + return OHOS_MARKET_NAME; +} + +const char* HalGetProductSeries(void) +{ + return OHOS_PRODUCT_SERIES; +} + +const char* HalGetProductModel(void) +{ + return OHOS_PRODUCT_MODEL; +} + +const char* HalGetSoftwareModel(void) +{ + return OHOS_SOFTWARE_MODEL; +} + +const char* HalGetHardwareModel(void) +{ + return OHOS_HARDWARE_MODEL; +} + +const char* HalGetHardwareProfile(void) +{ + return OHOS_HARDWARE_PROFILE; +} + +const char* HalGetSerial(void) +{ + return OHOS_SERIAL; +} + +const char* HalGetBootloaderVersion(void) +{ + return OHOS_BOOTLOADER_VERSION; +} + +const char* HalGetAbiList(void) +{ + return OHOS_ABI_LIST; +} + +const char* HalGetDisplayVersion(void) +{ + return OHOS_DISPLAY_VERSION; +} + +const char* HalGetIncrementalVersion(void) +{ + return INCREMENTAL_VERSION; +} + +const char* HalGetBuildType(void) +{ + return BUILD_TYPE; +} + +const char* HalGetBuildUser(void) +{ + return BUILD_USER; +} + +const char* HalGetBuildHost(void) +{ + return BUILD_HOST; +} + +const char* HalGetBuildTime(void) +{ + return BUILD_TIME; +} + +int HalGetFirstApiVersion(void) +{ + return OHOS_FIRST_API_VERSION; +} diff --git a/fm33lc0xxn_mini_system_demo/hals/utils/token/BUILD.gn b/fm33lc0xxn_mini_system_demo/hals/utils/token/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..0fde10c63e4090fa37eb1c7de532c09206942651 --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/hals/utils/token/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. + +static_library("hal_token_static") { + sources = [ "hal_token.c" ] + + include_dirs = [ + "//base/startup/syspara_lite/hals", + "//utils/native/lite/include", + ] + deps = [] +} diff --git a/fm33lc0xxn_mini_system_demo/hals/utils/token/hal_token.c b/fm33lc0xxn_mini_system_demo/hals/utils/token/hal_token.c new file mode 100755 index 0000000000000000000000000000000000000000..08c9c3ff3892f0db5408494fd2a57a1d786c5298 --- /dev/null +++ b/fm33lc0xxn_mini_system_demo/hals/utils/token/hal_token.c @@ -0,0 +1,104 @@ +/* + * 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_token.h" +#include "ohos_errno.h" +#include "ohos_types.h" + +static int OEMReadToken(char *token, unsigned int len) +{ + // OEM need add here, read token from device + (void)(token); + (void)(len); + return EC_SUCCESS; +} + +static int OEMWriteToken(const char *token, unsigned int len) +{ + // OEM need add here, write token to device + (void)(token); + (void)(len); + return EC_SUCCESS; +} + +static int OEMGetAcKey(char *acKey, unsigned int len) +{ + // OEM need add here, get AcKey + (void)(acKey); + (void)(len); + return EC_SUCCESS; +} + +static int OEMGetProdId(char *productId, unsigned int len) +{ + // OEM need add here, get ProdId + (void)(productId); + (void)(len); + return EC_SUCCESS; +} + +static int OEMGetProdKey(char *productKey, unsigned int len) +{ + // OEM need add here, get ProdKey + (void)(productKey); + (void)(len); + return EC_SUCCESS; +} + + +int HalReadToken(char *token, unsigned int len) +{ + if (token == NULL) { + return EC_FAILURE; + } + + return OEMReadToken(token, len); +} + +int HalWriteToken(const char *token, unsigned int len) +{ + if (token == NULL) { + return EC_FAILURE; + } + + return OEMWriteToken(token, len); +} + +int HalGetAcKey(char *acKey, unsigned int len) +{ + if (acKey == NULL) { + return EC_FAILURE; + } + + return OEMGetAcKey(acKey, len); +} + +int HalGetProdId(char *productId, unsigned int len) +{ + if (productId == NULL) { + return EC_FAILURE; + } + + return OEMGetProdId(productId, len); +} + +int HalGetProdKey(char *productKey, unsigned int len) +{ + if (productKey == NULL) { + return EC_FAILURE; + } + + return OEMGetProdKey(productKey, len); +} \ No newline at end of file